var sPe=Object.defineProperty,oPe=Object.defineProperties,aPe=Object.getOwnPropertyDescriptors,Qj=Object.getOwnPropertySymbols,lPe=Object.prototype.hasOwnProperty,cPe=Object.prototype.propertyIsEnumerable,Jj=(kt,qt,ye)=>qt in kt?sPe(kt,qt,{enumerable:!0,configurable:!0,writable:!0,value:ye}):kt[qt]=ye,$t=(kt,qt)=>{for(var ye in qt||(qt={}))lPe.call(qt,ye)&&Jj(kt,ye,qt[ye]);if(Qj)for(var ye of Qj(qt))cPe.call(qt,ye)&&Jj(kt,ye,qt[ye]);return kt},l5=(kt,qt)=>oPe(kt,aPe(qt));(self.webpackChunkwaves_tracker=self.webpackChunkwaves_tracker||[]).push([[179],{8255:kt=>{function qt(ye){return Promise.resolve().then(()=>{var fe=new Error("Cannot find module '"+ye+"'");throw fe.code="MODULE_NOT_FOUND",fe})}qt.keys=()=>[],qt.resolve=qt,qt.id=8255,kt.exports=qt},4086:(kt,qt,ye)=>{"use strict";ye.d(qt,{c:()=>at});var fe=ye(2377);let be;const p=Je=>Je.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qe=Je=>{if(void 0===be){const qe=void 0!==Je.style.webkitAnimationName;be=void 0===Je.style.animationName&&qe?"-webkit-":""}return be},Fe=(Je,_t,qe)=>{const It=_t.startsWith("animation")?Qe(Je):"";Je.style.setProperty(It+_t,qe)},ne=(Je,_t)=>{const qe=_t.startsWith("animation")?Qe(Je):"";Je.style.removeProperty(qe+_t)},pe=[],Pe=(Je=[],_t)=>{if(void 0!==_t){const qe=Array.isArray(_t)?_t:[_t];return[...Je,...qe]}return Je},at=Je=>{let _t,qe,It,ge,ce,Ge,Ye,Et,zt,Ot,mt,Hn,wn,q=[],je=[],nt=[],Ce=!1,ut={},lt=[],Ct=[],Dt={},Qt=0,Rn=!1,Wt=!1,Lt=!0,tn=!1,mn=!0;const Cr=Je,os=[],lr=[],Pn=[],Wi=[],$s=[],Qo=[],Pa=[],Mn=[],qi=[],Is=[],Mo="function"==typeof AnimationEffect||"function"==typeof window.AnimationEffect,Os="function"==typeof Element&&"function"==typeof Element.prototype.animate&&Mo,hs=(Z,we)=>((we&&we.oneTimeCallback?lr:os).push({c:Z,o:we}),wn),ea=()=>{if(Os)Is.forEach(Z=>{Z.cancel()}),Is.length=0;else{const Z=Pn.slice();(0,fe.r)(()=>{Z.forEach(we=>{ne(we,"animation-name"),ne(we,"animation-duration"),ne(we,"animation-timing-function"),ne(we,"animation-iteration-count"),ne(we,"animation-delay"),ne(we,"animation-play-state"),ne(we,"animation-fill-mode"),ne(we,"animation-direction")})})}},ga=()=>{$s.forEach(Z=>{Z&&Z.parentNode&&Z.parentNode.removeChild(Z)}),$s.length=0},oo=()=>void 0!==ce?ce:Ye?Ye.getFill():"both",oi=()=>void 0!==zt?zt:void 0!==Ge?Ge:Ye?Ye.getDirection():"normal",No=()=>Rn?"linear":void 0!==It?It:Ye?Ye.getEasing():"linear",Xr=()=>Wt?0:void 0!==Ot?Ot:void 0!==qe?qe:Ye?Ye.getDuration():0,oe=()=>void 0!==ge?ge:Ye?Ye.getIterations():1,R=()=>void 0!==mt?mt:void 0!==_t?_t:Ye?Ye.getDelay():0,Un=()=>{0!==Qt&&(Qt--,0===Qt&&((()=>{n1(),Mn.forEach(Be=>Be()),qi.forEach(Be=>Be());const Z=Lt?1:0,we=lt,Ne=Ct,yt=Dt;Pn.forEach(Be=>{const Pt=Be.classList;we.forEach(en=>Pt.add(en)),Ne.forEach(en=>Pt.remove(en));for(const en in yt)yt.hasOwnProperty(en)&&Fe(Be,en,yt[en])}),os.forEach(Be=>Be.c(Z,wn)),lr.forEach(Be=>Be.c(Z,wn)),lr.length=0,mn=!0,Lt&&(tn=!0),Lt=!0})(),Ye&&Ye.animationFinish()))},Mr=(Z=!0)=>{(()=>{Qo.forEach(yt=>yt()),Pa.forEach(yt=>yt());const Z=je,we=nt,Ne=ut;Pn.forEach(yt=>{const Be=yt.classList;Z.forEach(Pt=>Be.add(Pt)),we.forEach(Pt=>Be.remove(Pt));for(const Pt in Ne)Ne.hasOwnProperty(Pt)&&Fe(yt,Pt,Ne[Pt])})})(),q.length>0&&(Os?(Pn.forEach(Z=>{const we=Z.animate(q,{id:Cr,delay:R(),duration:Xr(),easing:No(),iterations:oe(),fill:oo(),direction:oi()});we.pause(),Is.push(we)}),Is.length>0&&(Is[0].onfinish=()=>{Un()})):((Z=!0)=>{ga();const we=(Je=>(Je.forEach(_t=>{for(const qe in _t)if(_t.hasOwnProperty(qe)){const It=_t[qe];if("easing"===qe)_t["animation-timing-function"]=It,delete _t[qe];else{const ge=p(qe);ge!==qe&&(_t[ge]=It,delete _t[qe])}}}),Je))(q);Pn.forEach(Ne=>{if(we.length>0){const yt=((Je=[])=>Je.map(_t=>{const qe=_t.offset,It=[];for(const ge in _t)_t.hasOwnProperty(ge)&&"offset"!==ge&&It.push(`${ge}: ${_t[ge]};`);return`${100*qe}% { ${It.join(" ")} }`}).join(" "))(we);Hn=void 0!==Je?Je:(Je=>{let _t=pe.indexOf(Je);return _t<0&&(_t=pe.push(Je)-1),`ion-animation-${_t}`})(yt);const Be=((Je,_t,qe)=>{const It=(Je=>{const _t=Je.getRootNode();return _t.head||_t})(qe),ge=Qe(qe),ce=It.querySelector("#"+Je);if(ce)return ce;const Ge=(qe.ownerDocument||document).createElement("style");return Ge.id=Je,Ge.textContent=`@${ge}keyframes ${Je} { ${_t} } @${ge}keyframes ${Je}-alt { ${_t} }`,It.appendChild(Ge),Ge})(Hn,yt,Ne);$s.push(Be),Fe(Ne,"animation-duration",`${Xr()}ms`),Fe(Ne,"animation-timing-function",No()),Fe(Ne,"animation-delay",`${R()}ms`),Fe(Ne,"animation-fill-mode",oo()),Fe(Ne,"animation-direction",oi());const Pt=oe()===1/0?"infinite":oe().toString();Fe(Ne,"animation-iteration-count",Pt),Fe(Ne,"animation-play-state","paused"),Z&&Fe(Ne,"animation-name",`${Be.id}-alt`),(0,fe.r)(()=>{Fe(Ne,"animation-name",Be.id||null)})}})})(Z)),Ce=!0},hr=Z=>{if(Z=Math.min(Math.max(Z,0),.9999),Os)Is.forEach(we=>{we.currentTime=we.effect.getComputedTiming().delay+Xr()*Z,we.pause()});else{const we=`-${Xr()*Z}ms`;Pn.forEach(Ne=>{q.length>0&&(Fe(Ne,"animation-delay",we),Fe(Ne,"animation-play-state","paused"))})}},Ui=Z=>{Is.forEach(we=>{we.effect.updateTiming({delay:R(),duration:Xr(),easing:No(),iterations:oe(),fill:oo(),direction:oi()})}),void 0!==Z&&hr(Z)},kr=(Z=!0,we)=>{(0,fe.r)(()=>{Pn.forEach(Ne=>{Fe(Ne,"animation-name",Hn||null),Fe(Ne,"animation-duration",`${Xr()}ms`),Fe(Ne,"animation-timing-function",No()),Fe(Ne,"animation-delay",void 0!==we?`-${we*Xr()}ms`:`${R()}ms`),Fe(Ne,"animation-fill-mode",oo()||null),Fe(Ne,"animation-direction",oi()||null);const yt=oe()===1/0?"infinite":oe().toString();Fe(Ne,"animation-iteration-count",yt),Z&&Fe(Ne,"animation-name",`${Hn}-alt`),(0,fe.r)(()=>{Fe(Ne,"animation-name",Hn||null)})})})},ds=(Z=!1,we=!0,Ne)=>(Z&&Wi.forEach(yt=>{yt.update(Z,we,Ne)}),Os?Ui(Ne):kr(we,Ne),wn),zs=()=>{Ce&&(Os?Is.forEach(Z=>{Z.pause()}):Pn.forEach(Z=>{Fe(Z,"animation-play-state","paused")}))},Xl=()=>{Et=void 0,Un()},n1=()=>{Et&&clearTimeout(Et)},js=Z=>new Promise(we=>{Z&&Z.sync&&(Wt=!0,hs(()=>Wt=!1,{oneTimeCallback:!0})),Ce||Mr(),tn&&(Os?(hr(0),Ui()):kr(),tn=!1),mn&&(Qt=Wi.length+1,mn=!1),hs(()=>we(),{oneTimeCallback:!0}),Wi.forEach(Ne=>{Ne.play()}),Os?(Is.forEach(Z=>{Z.play()}),(0===q.length||0===Pn.length)&&Un()):(()=>{if(n1(),(0,fe.r)(()=>{Pn.forEach(Z=>{q.length>0&&Fe(Z,"animation-play-state","running")})}),0===q.length||0===Pn.length)Un();else{const Z=R()||0,we=Xr()||0,Ne=oe()||1;isFinite(Ne)&&(Et=setTimeout(Xl,Z+we*Ne+100)),((Je,_t)=>{let qe;const It={passive:!0},ce=Ge=>{Je===Ge.target&&(qe&&qe(),n1(),(0,fe.r)(()=>{Pn.forEach(Z=>{ne(Z,"animation-duration"),ne(Z,"animation-delay"),ne(Z,"animation-play-state")}),(0,fe.r)(Un)}))};Je&&(Je.addEventListener("webkitAnimationEnd",ce,It),Je.addEventListener("animationend",ce,It),qe=()=>{Je.removeEventListener("webkitAnimationEnd",ce,It),Je.removeEventListener("animationend",ce,It)})})(Pn[0])}})()}),V1=(Z,we)=>{const Ne=q[0];return void 0===Ne||void 0!==Ne.offset&&0!==Ne.offset?q=[{offset:0,[Z]:we},...q]:Ne[Z]=we,wn};return wn={parentAnimation:Ye,elements:Pn,childAnimations:Wi,id:Cr,animationFinish:Un,from:V1,to:(Z,we)=>{const Ne=q[q.length-1];return void 0===Ne||void 0!==Ne.offset&&1!==Ne.offset?q=[...q,{offset:1,[Z]:we}]:Ne[Z]=we,wn},fromTo:(Z,we,Ne)=>V1(Z,we).to(Z,Ne),parent:Z=>(Ye=Z,wn),play:js,pause:()=>(Wi.forEach(Z=>{Z.pause()}),zs(),wn),stop:()=>{Wi.forEach(Z=>{Z.stop()}),Ce&&(ea(),Ce=!1),Rn=!1,Wt=!1,mn=!0,zt=void 0,Ot=void 0,mt=void 0,Qt=0,tn=!1,Lt=!0},destroy:Z=>(Wi.forEach(we=>{we.destroy(Z)}),(Z=>{ea(),Z&&ga()})(Z),Pn.length=0,Wi.length=0,q.length=0,os.length=0,lr.length=0,Ce=!1,mn=!0,wn),keyframes:Z=>(q=Z,wn),addAnimation:Z=>{if(null!=Z)if(Array.isArray(Z))for(const we of Z)we.parent(wn),Wi.push(we);else Z.parent(wn),Wi.push(Z);return wn},addElement:Z=>{if(null!=Z)if(1===Z.nodeType)Pn.push(Z);else if(Z.length>=0)for(let we=0;we(ce=Z,ds(!0),wn),direction:Z=>(Ge=Z,ds(!0),wn),iterations:Z=>(ge=Z,ds(!0),wn),duration:Z=>(!Os&&0===Z&&(Z=1),qe=Z,ds(!0),wn),easing:Z=>(It=Z,ds(!0),wn),delay:Z=>(_t=Z,ds(!0),wn),getWebAnimations:()=>Is,getKeyframes:()=>q,getFill:oo,getDirection:oi,getDelay:R,getIterations:oe,getEasing:No,getDuration:Xr,afterAddRead:Z=>(Mn.push(Z),wn),afterAddWrite:Z=>(qi.push(Z),wn),afterClearStyles:(Z=[])=>{for(const we of Z)Dt[we]="";return wn},afterStyles:(Z={})=>(Dt=Z,wn),afterRemoveClass:Z=>(Ct=Pe(Ct,Z),wn),afterAddClass:Z=>(lt=Pe(lt,Z),wn),beforeAddRead:Z=>(Qo.push(Z),wn),beforeAddWrite:Z=>(Pa.push(Z),wn),beforeClearStyles:(Z=[])=>{for(const we of Z)ut[we]="";return wn},beforeStyles:(Z={})=>(ut=Z,wn),beforeRemoveClass:Z=>(nt=Pe(nt,Z),wn),beforeAddClass:Z=>(je=Pe(je,Z),wn),onFinish:hs,progressStart:(Z=!1,we)=>(Wi.forEach(Ne=>{Ne.progressStart(Z,we)}),zs(),Rn=Z,Ce?ds(!1,!0,we):Mr(),wn),progressStep:Z=>(Wi.forEach(we=>{we.progressStep(Z)}),hr(Z),wn),progressEnd:(Z,we,Ne)=>(Rn=!1,Wi.forEach(yt=>{yt.progressEnd(Z,we,Ne)}),void 0!==Ne&&(Ot=Ne),tn=!1,Lt=!0,0===Z?(zt="reverse"===oi()?"normal":"reverse","reverse"===zt&&(Lt=!1),Os?(ds(),hr(1-we)):(mt=(1-we)*Xr()*-1,ds(!1,!1))):1===Z&&(Os?(ds(),hr(we)):(mt=we*Xr()*-1,ds(!1,!1))),void 0!==Z&&(hs(()=>{Ot=void 0,zt=void 0,mt=void 0},{oneTimeCallback:!0}),Ye||js()),wn)}}},7807:(kt,qt,ye)=>{"use strict";ye.d(qt,{g:()=>fe});const fe=(Fe,ne,de,re,pe)=>Me(Fe[1],ne[1],de[1],re[1],pe).map(Xe=>be(Fe[0],ne[0],de[0],re[0],Xe)),be=(Fe,ne,de,re,pe)=>pe*(3*ne*Math.pow(pe-1,2)+pe*(-3*de*pe+3*de+re*pe))-Fe*Math.pow(pe-1,3),Me=(Fe,ne,de,re,pe)=>Qe((re-=pe)-3*(de-=pe)+3*(ne-=pe)-(Fe-=pe),3*de-6*ne+3*Fe,3*ne-3*Fe,Fe).filter(ze=>ze>=0&&ze<=1),Qe=(Fe,ne,de,re)=>{if(0===Fe)return((Fe,ne,de)=>{const re=ne*ne-4*Fe*de;return re<0?[]:[(-ne+Math.sqrt(re))/(2*Fe),(-ne-Math.sqrt(re))/(2*Fe)]})(ne,de,re);const pe=(3*(de/=Fe)-(ne/=Fe)*ne)/3,Xe=(2*ne*ne*ne-9*ne*de+27*(re/=Fe))/27;if(0===pe)return[Math.pow(-Xe,1/3)];if(0===Xe)return[Math.sqrt(-pe),-Math.sqrt(-pe)];const ze=Math.pow(Xe/2,2)+Math.pow(pe/3,3);if(0===ze)return[Math.pow(Xe/2,.5)-ne/3];if(ze>0)return[Math.pow(-Xe/2+Math.sqrt(ze),1/3)-Math.pow(Xe/2+Math.sqrt(ze),1/3)-ne/3];const Le=Math.sqrt(Math.pow(-pe/3,3)),Pe=Math.acos(-Xe/(2*Math.sqrt(Math.pow(-pe/3,3)))),at=2*Math.pow(Le,1/3);return[at*Math.cos(Pe/3)-ne/3,at*Math.cos((Pe+2*Math.PI)/3)-ne/3,at*Math.cos((Pe+4*Math.PI)/3)-ne/3]}},960:(kt,qt,ye)=>{"use strict";ye.d(qt,{G:()=>Qe});class be{constructor(ne,de,re,pe,Xe){this.id=de,this.name=re,this.disableScroll=Xe,this.priority=1e6*pe+de,this.ctrl=ne}canStart(){return!!this.ctrl&&this.ctrl.canStart(this.name)}start(){return!!this.ctrl&&this.ctrl.start(this.name,this.id,this.priority)}capture(){if(!this.ctrl)return!1;const ne=this.ctrl.capture(this.name,this.id,this.priority);return ne&&this.disableScroll&&this.ctrl.disableScroll(this.id),ne}release(){this.ctrl&&(this.ctrl.release(this.id),this.disableScroll&&this.ctrl.enableScroll(this.id))}destroy(){this.release(),this.ctrl=void 0}}class Me{constructor(ne,de,re,pe){this.id=de,this.disable=re,this.disableScroll=pe,this.ctrl=ne}block(){if(this.ctrl){if(this.disable)for(const ne of this.disable)this.ctrl.disableGesture(ne,this.id);this.disableScroll&&this.ctrl.disableScroll(this.id)}}unblock(){if(this.ctrl){if(this.disable)for(const ne of this.disable)this.ctrl.enableGesture(ne,this.id);this.disableScroll&&this.ctrl.enableScroll(this.id)}}destroy(){this.unblock(),this.ctrl=void 0}}const p="backdrop-no-scroll",Qe=new class{constructor(){this.gestureId=0,this.requestedStart=new Map,this.disabledGestures=new Map,this.disabledScroll=new Set}createGesture(ne){return new be(this,this.newID(),ne.name,ne.priority||0,!!ne.disableScroll)}createBlocker(ne={}){return new Me(this,this.newID(),ne.disable,!!ne.disableScroll)}start(ne,de,re){return this.canStart(ne)?(this.requestedStart.set(de,re),!0):(this.requestedStart.delete(de),!1)}capture(ne,de,re){if(!this.start(ne,de,re))return!1;const pe=this.requestedStart;let Xe=-1e4;if(pe.forEach(ze=>{Xe=Math.max(Xe,ze)}),Xe===re){this.capturedId=de,pe.clear();const ze=new CustomEvent("ionGestureCaptured",{detail:{gestureName:ne}});return document.dispatchEvent(ze),!0}return pe.delete(de),!1}release(ne){this.requestedStart.delete(ne),this.capturedId===ne&&(this.capturedId=void 0)}disableGesture(ne,de){let re=this.disabledGestures.get(ne);void 0===re&&(re=new Set,this.disabledGestures.set(ne,re)),re.add(de)}enableGesture(ne,de){const re=this.disabledGestures.get(ne);void 0!==re&&re.delete(de)}disableScroll(ne){this.disabledScroll.add(ne),1===this.disabledScroll.size&&document.body.classList.add(p)}enableScroll(ne){this.disabledScroll.delete(ne),0===this.disabledScroll.size&&document.body.classList.remove(p)}canStart(ne){return!(void 0!==this.capturedId||this.isDisabled(ne))}isCaptured(){return void 0!==this.capturedId}isScrollDisabled(){return this.disabledScroll.size>0}isDisabled(ne){const de=this.disabledGestures.get(ne);return!!(de&&de.size>0)}newID(){return this.gestureId++,this.gestureId}}},3087:(kt,qt,ye)=>{"use strict";ye.r(qt),ye.d(qt,{MENU_BACK_BUTTON_PRIORITY:()=>Qe,OVERLAY_BACK_BUTTON_PRIORITY:()=>p,blockHardwareBackButton:()=>be,startHardwareBackButton:()=>Me});var fe=ye(8239);const be=()=>{document.addEventListener("backbutton",()=>{})},Me=()=>{const Fe=document;let ne=!1;Fe.addEventListener("backbutton",()=>{if(ne)return;let de=0,re=[];const pe=new CustomEvent("ionBackButton",{bubbles:!1,detail:{register(Le,Pe){re.push({priority:Le,handler:Pe,id:de++})}}});Fe.dispatchEvent(pe);const Xe=function(){var Le=(0,fe.Z)(function*(Pe){try{if(Pe&&Pe.handler){const at=Pe.handler(ze);null!=at&&(yield at)}}catch(at){console.error(at)}});return function(at){return Le.apply(this,arguments)}}(),ze=()=>{if(re.length>0){let Le={priority:Number.MIN_SAFE_INTEGER,handler:()=>{},id:-1};re.forEach(Pe=>{Pe.priority>=Le.priority&&(Le=Pe)}),ne=!0,re=re.filter(Pe=>Pe.id!==Le.id),Xe(Le).then(()=>ne=!1)}};ze()})},p=100,Qe=99},2377:(kt,qt,ye)=>{"use strict";ye.d(qt,{a:()=>Me,b:()=>p,c:()=>fe,d:()=>re,e:()=>pe,f:()=>Je,g:()=>Qe,h:()=>de,i:()=>be,j:()=>Xe,k:()=>ne,l:()=>ze,m:()=>at,n:()=>_t,o:()=>Le,p:()=>Pe,r:()=>Fe});const fe=(qe,It)=>{qe.componentOnReady?qe.componentOnReady().then(ge=>It(ge)):Fe(()=>It(qe))},be=(qe,It=[])=>{const ge={};return It.forEach(ce=>{qe.hasAttribute(ce)&&(null!==qe.getAttribute(ce)&&(ge[ce]=qe.getAttribute(ce)),qe.removeAttribute(ce))}),ge},Me=(qe,It,ge,ce)=>{if("undefined"!=typeof window){const Ge=window,q=Ge&&Ge.Ionic&&Ge.Ionic.config;if(q){const je=q.get("_ael");if(je)return je(qe,It,ge,ce);if(q._ael)return q._ael(qe,It,ge,ce)}}return qe.addEventListener(It,ge,ce)},p=(qe,It,ge,ce)=>{if("undefined"!=typeof window){const Ge=window,q=Ge&&Ge.Ionic&&Ge.Ionic.config;if(q){const je=q.get("_rel");if(je)return je(qe,It,ge,ce);if(q._rel)return q._rel(qe,It,ge,ce)}}return qe.removeEventListener(It,ge,ce)},Qe=(qe,It=qe)=>qe.shadowRoot||It,Fe=qe=>"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(qe):"function"==typeof requestAnimationFrame?requestAnimationFrame(qe):setTimeout(qe),ne=qe=>!!qe.shadowRoot&&!!qe.attachShadow,de=qe=>{const It=qe.closest("ion-item");return It?It.querySelector("ion-label"):null},re=(qe,It)=>{let ge;const ce=qe.getAttribute("aria-labelledby"),Ge=qe.id;let q=null!==ce&&""!==ce.trim()?ce:It+"-lbl",je=null!==ce&&""!==ce.trim()?document.getElementById(ce):de(qe);return je?(null===ce&&(je.id=q),ge=je.textContent,je.setAttribute("aria-hidden","true")):""!==Ge.trim()&&(je=document.querySelector(`label[for="${Ge}"]`),je&&(""!==je.id?q=je.id:je.id=q=`${Ge}-lbl`,ge=je.textContent)),{label:je,labelId:q,labelText:ge}},pe=(qe,It,ge,ce,Ge)=>{if(qe||ne(It)){let q=It.querySelector("input.aux-input");q||(q=It.ownerDocument.createElement("input"),q.type="hidden",q.classList.add("aux-input"),It.appendChild(q)),q.disabled=Ge,q.name=ge,q.value=ce||""}},Xe=(qe,It,ge)=>Math.max(qe,Math.min(It,ge)),ze=(qe,It)=>{if(!qe){const ge="ASSERT: "+It;throw console.error(ge),new Error(ge)}},Le=qe=>qe.timeStamp||Date.now(),Pe=qe=>{if(qe){const It=qe.changedTouches;if(It&&It.length>0){const ge=It[0];return{x:ge.clientX,y:ge.clientY}}if(void 0!==qe.pageX)return{x:qe.pageX,y:qe.pageY}}return{x:0,y:0}},at=qe=>{const It="rtl"===document.dir;switch(qe){case"start":return It;case"end":return!It;default:throw new Error(`"${qe}" is not a valid value for [side]. Use "start" or "end" instead.`)}},Je=(qe,It)=>{const ge=qe._original||qe;return{_original:qe,emit:_t(ge.emit.bind(ge),It)}},_t=(qe,It=0)=>{let ge;return(...ce)=>{clearTimeout(ge),ge=setTimeout(qe,It,...ce)}}},5554:(kt,qt,ye)=>{"use strict";ye.d(qt,{m:()=>Xe});var fe=ye(8239),be=ye(3087),Me=ye(2377),p=ye(7585),Qe=ye(4086);const Fe=ze=>(0,Qe.c)().duration(ze?400:300),ne=ze=>{let Le,Pe;const at=ze.width+8,Je=(0,Qe.c)(),_t=(0,Qe.c)();ze.isEndSide?(Le=at+"px",Pe="0px"):(Le=-at+"px",Pe="0px"),Je.addElement(ze.menuInnerEl).fromTo("transform",`translateX(${Le})`,`translateX(${Pe})`);const It="ios"===(0,p.b)(ze),ge=It?.2:.25;return _t.addElement(ze.backdropEl).fromTo("opacity",.01,ge),Fe(It).addAnimation([Je,_t])},de=ze=>{let Le,Pe;const at=(0,p.b)(ze),Je=ze.width;ze.isEndSide?(Le=-Je+"px",Pe=Je+"px"):(Le=Je+"px",Pe=-Je+"px");const _t=(0,Qe.c)().addElement(ze.menuInnerEl).fromTo("transform",`translateX(${Pe})`,"translateX(0px)"),qe=(0,Qe.c)().addElement(ze.contentEl).fromTo("transform","translateX(0px)",`translateX(${Le})`),It=(0,Qe.c)().addElement(ze.backdropEl).fromTo("opacity",.01,.32);return Fe("ios"===at).addAnimation([_t,qe,It])},re=ze=>{const Le=(0,p.b)(ze),Pe=ze.width*(ze.isEndSide?-1:1)+"px",at=(0,Qe.c)().addElement(ze.contentEl).fromTo("transform","translateX(0px)",`translateX(${Pe})`);return Fe("ios"===Le).addAnimation(at)},Xe=(()=>{const ze=new Map,Le=[],Pe=function(){var zt=(0,fe.Z)(function*(Ot){const mt=yield ce(Ot);return!!mt&&mt.open()});return function(mt){return zt.apply(this,arguments)}}(),at=function(){var zt=(0,fe.Z)(function*(Ot){const mt=yield void 0!==Ot?ce(Ot):Ge();return void 0!==mt&&mt.close()});return function(mt){return zt.apply(this,arguments)}}(),Je=function(){var zt=(0,fe.Z)(function*(Ot){const mt=yield ce(Ot);return!!mt&&mt.toggle()});return function(mt){return zt.apply(this,arguments)}}(),_t=function(){var zt=(0,fe.Z)(function*(Ot,mt){const Lt=yield ce(mt);return Lt&&(Lt.disabled=!Ot),Lt});return function(mt,Lt){return zt.apply(this,arguments)}}(),qe=function(){var zt=(0,fe.Z)(function*(Ot,mt){const Lt=yield ce(mt);return Lt&&(Lt.swipeGesture=Ot),Lt});return function(mt,Lt){return zt.apply(this,arguments)}}(),It=function(){var zt=(0,fe.Z)(function*(Ot){if(null!=Ot){const mt=yield ce(Ot);return void 0!==mt&&mt.isOpen()}return void 0!==(yield Ge())});return function(mt){return zt.apply(this,arguments)}}(),ge=function(){var zt=(0,fe.Z)(function*(Ot){const mt=yield ce(Ot);return!!mt&&!mt.disabled});return function(mt){return zt.apply(this,arguments)}}(),ce=function(){var zt=(0,fe.Z)(function*(Ot){return yield Et(),"start"===Ot||"end"===Ot?Wt(tn=>tn.side===Ot&&!tn.disabled)||Wt(tn=>tn.side===Ot):null!=Ot?Wt(Lt=>Lt.menuId===Ot):Wt(Lt=>!Lt.disabled)||(Le.length>0?Le[0].el:void 0)});return function(mt){return zt.apply(this,arguments)}}(),Ge=function(){var zt=(0,fe.Z)(function*(){return yield Et(),Dt()});return function(){return zt.apply(this,arguments)}}(),q=function(){var zt=(0,fe.Z)(function*(){return yield Et(),Qt()});return function(){return zt.apply(this,arguments)}}(),je=function(){var zt=(0,fe.Z)(function*(){return yield Et(),Rn()});return function(){return zt.apply(this,arguments)}}(),nt=(zt,Ot)=>{ze.set(zt,Ot)},ut=zt=>{const Ot=zt.side;Le.filter(mt=>mt.side===Ot&&mt!==zt).forEach(mt=>mt.disabled=!0)},lt=function(){var zt=(0,fe.Z)(function*(Ot,mt,Lt){if(Rn())return!1;if(mt){const tn=yield Ge();tn&&Ot.el!==tn&&(yield tn.setOpen(!1,!1))}return Ot._setOpen(mt,Lt)});return function(mt,Lt,tn){return zt.apply(this,arguments)}}(),Dt=()=>Wt(zt=>zt._isOpen),Qt=()=>Le.map(zt=>zt.el),Rn=()=>Le.some(zt=>zt.isAnimating),Wt=zt=>{const Ot=Le.find(zt);if(void 0!==Ot)return Ot.el},Et=()=>Promise.all(Array.from(document.querySelectorAll("ion-menu")).map(zt=>new Promise(Ot=>(0,Me.c)(zt,Ot))));return nt("reveal",re),nt("push",de),nt("overlay",ne),"undefined"!=typeof document&&document.addEventListener("ionBackButton",zt=>{const Ot=Dt();Ot&&zt.detail.register(be.MENU_BACK_BUTTON_PRIORITY,()=>Ot.close())}),{registerAnimation:nt,get:ce,getMenus:q,getOpen:Ge,isEnabled:ge,swipeGesture:qe,isAnimating:je,isOpen:It,enable:_t,toggle:Je,close:at,open:Pe,_getOpenSync:Dt,_createAnimation:(zt,Ot)=>{const mt=ze.get(zt);if(!mt)throw new Error("animation not registered");return mt(Ot)},_register:zt=>{Le.indexOf(zt)<0&&(zt.disabled||ut(zt),Le.push(zt))},_unregister:zt=>{const Ot=Le.indexOf(zt);Ot>-1&&Le.splice(Ot,1)},_setOpen:lt,_setActiveMenu:ut}})()},9461:(kt,qt,ye)=>{"use strict";ye.r(qt),ye.d(qt,{GESTURE_CONTROLLER:()=>fe.G,createGesture:()=>re});var fe=ye(960);const be=(Le,Pe,at,Je)=>{const _t=Me(Le)?{capture:!!Je.capture,passive:!!Je.passive}:!!Je.capture;let qe,It;return Le.__zone_symbol__addEventListener?(qe="__zone_symbol__addEventListener",It="__zone_symbol__removeEventListener"):(qe="addEventListener",It="removeEventListener"),Le[qe](Pe,at,_t),()=>{Le[It](Pe,at,_t)}},Me=Le=>{if(void 0===p)try{const Pe=Object.defineProperty({},"passive",{get:()=>{p=!0}});Le.addEventListener("optsTest",()=>{},Pe)}catch(Pe){p=!1}return!!p};let p;const ne=Le=>Le instanceof Document?Le:Le.ownerDocument,re=Le=>{let Pe=!1,at=!1,Je=!0,_t=!1;const qe=Object.assign({disableScroll:!1,direction:"x",gesturePriority:0,passive:!0,maxAngle:40,threshold:10},Le),It=qe.canStart,ge=qe.onWillStart,ce=qe.onStart,Ge=qe.onEnd,q=qe.notCaptured,je=qe.onMove,nt=qe.threshold,Ce=qe.passive,Ye=qe.blurOnStart,ut={type:"pan",startX:0,startY:0,startTime:0,currentX:0,currentY:0,velocityX:0,velocityY:0,deltaX:0,deltaY:0,currentTime:0,event:void 0,data:void 0},lt=((Le,Pe,at)=>{const Je=at*(Math.PI/180),_t="x"===Le,qe=Math.cos(Je),It=Pe*Pe;let ge=0,ce=0,Ge=!1,q=0;return{start(je,nt){ge=je,ce=nt,q=0,Ge=!0},detect(je,nt){if(!Ge)return!1;const Ce=je-ge,Ye=nt-ce,ut=Ce*Ce+Ye*Ye;if(utqe?1:Ct<-qe?-1:0,Ge=!1,!0},isGesture:()=>0!==q,getDirection:()=>q}})(qe.direction,qe.threshold,qe.maxAngle),Ct=fe.G.createGesture({name:Le.gestureName,priority:Le.gesturePriority,disableScroll:Le.disableScroll}),Rn=()=>{!Pe||(_t=!1,je&&je(ut))},Wt=()=>!(Ct&&!Ct.capture()||(Pe=!0,Je=!1,ut.startX=ut.currentX,ut.startY=ut.currentY,ut.startTime=ut.currentTime,ge?ge(ut).then(zt):zt(),0)),zt=()=>{Ye&&(()=>{if("undefined"!=typeof document){const mn=document.activeElement;null!==mn&&mn.blur&&mn.blur()}})(),ce&&ce(ut),Je=!0},Ot=()=>{Pe=!1,at=!1,_t=!1,Je=!0,Ct.release()},mt=mn=>{const Hn=Pe,wn=Je;if(Ot(),wn){if(pe(ut,mn),Hn)return void(Ge&&Ge(ut));q&&q(ut)}},Lt=((Le,Pe,at,Je,_t)=>{let qe,It,ge,ce,Ge,q,je,nt=0;const Ce=Et=>{nt=Date.now()+2e3,Pe(Et)&&(!It&&at&&(It=be(Le,"touchmove",at,_t)),ge||(ge=be(Et.target,"touchend",ut,_t)),ce||(ce=be(Et.target,"touchcancel",ut,_t)))},Ye=Et=>{nt>Date.now()||!Pe(Et)||(!q&&at&&(q=be(ne(Le),"mousemove",at,_t)),je||(je=be(ne(Le),"mouseup",lt,_t)))},ut=Et=>{Ct(),Je&&Je(Et)},lt=Et=>{Dt(),Je&&Je(Et)},Ct=()=>{It&&It(),ge&&ge(),ce&&ce(),It=ge=ce=void 0},Dt=()=>{q&&q(),je&&je(),q=je=void 0},Qt=()=>{Ct(),Dt()},Rn=(Et=!0)=>{Et?(qe||(qe=be(Le,"touchstart",Ce,_t)),Ge||(Ge=be(Le,"mousedown",Ye,_t))):(qe&&qe(),Ge&&Ge(),qe=Ge=void 0,Qt())};return{enable:Rn,stop:Qt,destroy:()=>{Rn(!1),Je=at=Pe=void 0}}})(qe.el,mn=>{const Hn=ze(mn);return!(at||!Je||(Xe(mn,ut),ut.startX=ut.currentX,ut.startY=ut.currentY,ut.startTime=ut.currentTime=Hn,ut.velocityX=ut.velocityY=ut.deltaX=ut.deltaY=0,ut.event=mn,It&&!1===It(ut))||(Ct.release(),!Ct.start()))&&(at=!0,0===nt?Wt():(lt.start(ut.startX,ut.startY),!0))},mn=>{Pe?!_t&&Je&&(_t=!0,pe(ut,mn),requestAnimationFrame(Rn)):(pe(ut,mn),lt.detect(ut.currentX,ut.currentY)&&(!lt.isGesture()||!Wt())&&tn())},mt,{capture:!1,passive:Ce}),tn=()=>{Ot(),Lt.stop(),q&&q(ut)};return{enable(mn=!0){mn||(Pe&&mt(void 0),Ot()),Lt.enable(mn)},destroy(){Ct.destroy(),Lt.destroy()}}},pe=(Le,Pe)=>{if(!Pe)return;const at=Le.currentX,Je=Le.currentY,_t=Le.currentTime;Xe(Pe,Le);const qe=Le.currentX,It=Le.currentY,ce=(Le.currentTime=ze(Pe))-_t;if(ce>0&&ce<100){const q=(It-Je)/ce;Le.velocityX=(qe-at)/ce*.7+.3*Le.velocityX,Le.velocityY=.7*q+.3*Le.velocityY}Le.deltaX=qe-Le.startX,Le.deltaY=It-Le.startY,Le.event=Pe},Xe=(Le,Pe)=>{let at=0,Je=0;if(Le){const _t=Le.changedTouches;if(_t&&_t.length>0){const qe=_t[0];at=qe.clientX,Je=qe.clientY}else void 0!==Le.pageX&&(at=Le.pageX,Je=Le.pageY)}Pe.currentX=at,Pe.currentY=Je},ze=Le=>Le.timeStamp||Date.now()},3150:(kt,qt,ye)=>{"use strict";ye.d(qt,{B:()=>Oa,C:()=>ze,H:()=>$s,a:()=>Je,b:()=>pi,c:()=>V1,e:()=>J1,f:()=>Ro,g:()=>mn,h:()=>Pn,i:()=>To,j:()=>oe,k:()=>Mr,p:()=>Pe,r:()=>kr,s:()=>tn,w:()=>Xe});var fe=ye(8239);let Me,p,Qe,Fe=!1,ne=!1,de=!1,re=!1,pe=!1;const Xe="undefined"!=typeof window?window:{},ze=Xe.CSS,Le=Xe.document||{head:{}},Pe={$flags$:0,$resourcesUrl$:"",jmp:te=>te(),raf:te=>requestAnimationFrame(te),ael:(te,Z,we,Ne)=>te.addEventListener(Z,we,Ne),rel:(te,Z,we,Ne)=>te.removeEventListener(Z,we,Ne),ce:(te,Z)=>new CustomEvent(te,Z)},at=(()=>(Le.head.attachShadow+"").indexOf("[native")>-1)(),Je=te=>Promise.resolve(te),_t=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(te){}return!1})(),qe=(te,Z,we,Ne)=>{we&&we.map(([yt,Be,Pt])=>{const en=ge(te,yt),Gt=It(Z,Pt),gn=ce(yt);Pe.ael(en,Be,Gt,gn),(Z.$rmListeners$=Z.$rmListeners$||[]).push(()=>Pe.rel(en,Be,Gt,gn))})},It=(te,Z)=>we=>{try{256&te.$flags$?te.$lazyInstance$[Z](we):(te.$queuedListeners$=te.$queuedListeners$||[]).push([Z,we])}catch(Ne){Zr(Ne)}},ge=(te,Z)=>4&Z?Le:8&Z?Xe:16&Z?Le.body:te,ce=te=>0!=(2&te),Ce="s-id",Ye="sty-id",Ct="http://www.w3.org/1999/xlink",Rn=new WeakMap,Wt=(te,Z,we)=>{let Ne=vr.get(te);_t&&we?(Ne=Ne||new CSSStyleSheet,Ne.replace(Z)):Ne=Z,vr.set(te,Ne)},Et=(te,Z,we,Ne)=>{let yt=Ot(Z,we),Be=vr.get(yt);if(te=11===te.nodeType?te:Le,Be)if("string"==typeof Be){let en,Pt=Rn.get(te=te.head||te);if(Pt||Rn.set(te,Pt=new Set),!Pt.has(yt)){if(te.host&&(en=te.querySelector(`[${Ye}="${yt}"]`)))en.innerHTML=Be;else{if(Pe.$cssShim$){en=Pe.$cssShim$.createHostStyle(Ne,yt,Be,!!(10&Z.$flags$));const Gt=en["s-sc"];Gt&&(yt=Gt,Pt=null)}else en=Le.createElement("style"),en.innerHTML=Be;te.insertBefore(en,te.querySelector("link"))}Pt&&Pt.add(yt)}}else te.adoptedStyleSheets.includes(Be)||(te.adoptedStyleSheets=[...te.adoptedStyleSheets,Be]);return yt},Ot=(te,Z)=>"sc-"+(Z&&32&te.$flags$?te.$tagName$+"-"+Z:te.$tagName$),mt=te=>te.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g,"$1{"),tn=te=>Xl.push(te),mn=te=>Ui(te).$modeName$,Hn={},lr=te=>"object"==(te=typeof te)||"function"===te,Pn=(te,Z,...we)=>{let Ne=null,yt=null,Be=null,Pt=!1,en=!1,Gt=[];const gn=it=>{for(let Ft=0;Ftit[Ft]).join(" "))}}if("function"==typeof te)return te(null===Z?{}:Z,Gt,Pa);const Bn=Wi(te,null);return Bn.$attrs$=Z,Gt.length>0&&(Bn.$children$=Gt),Bn.$key$=yt,Bn.$name$=Be,Bn},Wi=(te,Z)=>({$flags$:0,$tag$:te,$text$:Z,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null}),$s={},Pa={forEach:(te,Z)=>te.map(Mn).forEach(Z),map:(te,Z)=>te.map(Mn).map(Z).map(qi)},Mn=te=>({vattrs:te.$attrs$,vchildren:te.$children$,vkey:te.$key$,vname:te.$name$,vtag:te.$tag$,vtext:te.$text$}),qi=te=>{if("function"==typeof te.vtag){const we=Object.assign({},te.vattrs);return te.vkey&&(we.key=te.vkey),te.vname&&(we.name=te.vname),Pn(te.vtag,we,...te.vchildren||[])}const Z=Wi(te.vtag,te.vtext);return Z.$attrs$=te.vattrs,Z.$children$=te.vchildren,Z.$key$=te.vkey,Z.$name$=te.vname,Z},Is=(te,Z,we,Ne,yt,Be)=>{if(we!==Ne){let Pt=Fa(te,Z),en=Z.toLowerCase();if("class"===Z){const Gt=te.classList,gn=Os(we),Bn=Os(Ne);Gt.remove(...gn.filter(it=>it&&!Bn.includes(it))),Gt.add(...Bn.filter(it=>it&&!gn.includes(it)))}else if("style"===Z){for(const Gt in we)(!Ne||null==Ne[Gt])&&(Gt.includes("-")?te.style.removeProperty(Gt):te.style[Gt]="");for(const Gt in Ne)(!we||Ne[Gt]!==we[Gt])&&(Gt.includes("-")?te.style.setProperty(Gt,Ne[Gt]):te.style[Gt]=Ne[Gt])}else if("key"!==Z)if("ref"===Z)Ne&&Ne(te);else if(Pt||"o"!==Z[0]||"n"!==Z[1]){const Gt=lr(Ne);if((Pt||Gt&&null!==Ne)&&!yt)try{if(te.tagName.includes("-"))te[Z]=Ne;else{let Bn=null==Ne?"":Ne;"list"===Z?Pt=!1:(null==we||te[Z]!=Bn)&&(te[Z]=Bn)}}catch(Bn){}let gn=!1;en!==(en=en.replace(/^xlink\:?/,""))&&(Z=en,gn=!0),null==Ne||!1===Ne?(!1!==Ne||""===te.getAttribute(Z))&&(gn?te.removeAttributeNS(Ct,Z):te.removeAttribute(Z)):(!Pt||4&Be||yt)&&!Gt&&(Ne=!0===Ne?"":Ne,gn?te.setAttributeNS(Ct,Z,Ne):te.setAttribute(Z,Ne))}else Z="-"===Z[2]?Z.slice(3):Fa(Xe,en)?en.slice(2):en[2]+Z.slice(3),we&&Pe.rel(te,Z,we,!1),Ne&&Pe.ael(te,Z,Ne,!1)}},Mo=/\s/,Os=te=>te?te.split(Mo):[],Jo=(te,Z,we,Ne)=>{const yt=11===Z.$elm$.nodeType&&Z.$elm$.host?Z.$elm$.host:Z.$elm$,Be=te&&te.$attrs$||Hn,Pt=Z.$attrs$||Hn;for(Ne in Be)Ne in Pt||Is(yt,Ne,Be[Ne],void 0,we,Z.$flags$);for(Ne in Pt)Is(yt,Ne,Be[Ne],Pt[Ne],we,Z.$flags$)},Li=(te,Z,we,Ne)=>{let Pt,en,Gt,yt=Z.$children$[we],Be=0;if(Fe||(de=!0,"slot"===yt.$tag$&&(Me&&Ne.classList.add(Me+"-s"),yt.$flags$|=yt.$children$?2:1)),null!==yt.$text$)Pt=yt.$elm$=Le.createTextNode(yt.$text$);else if(1&yt.$flags$)Pt=yt.$elm$=Le.createTextNode("");else{if(re||(re="svg"===yt.$tag$),Pt=yt.$elm$=Le.createElementNS(re?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&yt.$flags$?"slot-fb":yt.$tag$),re&&"foreignObject"===yt.$tag$&&(re=!1),Jo(null,yt,re),(te=>null!=te)(Me)&&Pt["s-si"]!==Me&&Pt.classList.add(Pt["s-si"]=Me),yt.$children$)for(Be=0;Be{Pe.$flags$|=1;const we=te.childNodes;for(let Ne=we.length-1;Ne>=0;Ne--){const yt=we[Ne];yt["s-hn"]!==Qe&&yt["s-ol"]&&(ga(yt).insertBefore(yt,ea(yt)),yt["s-ol"].remove(),yt["s-ol"]=void 0,de=!0),Z&&Va(yt,Z)}Pe.$flags$&=-2},K1=(te,Z,we,Ne,yt,Be)=>{let en,Pt=te["s-cr"]&&te["s-cr"].parentNode||te;for(Pt.shadowRoot&&Pt.tagName===Qe&&(Pt=Pt.shadowRoot);yt<=Be;++yt)Ne[yt]&&(en=Li(null,we,yt,te),en&&(Ne[yt].$elm$=en,Pt.insertBefore(en,ea(Z))))},S2=(te,Z,we,Ne,yt)=>{for(;Z<=we;++Z)(Ne=te[Z])&&(yt=Ne.$elm$,Oo(Ne),ne=!0,yt["s-ol"]?yt["s-ol"].remove():Va(yt,!0),yt.remove())},ma=(te,Z)=>te.$tag$===Z.$tag$&&("slot"===te.$tag$?te.$name$===Z.$name$:te.$key$===Z.$key$),ea=te=>te&&te["s-ol"]||te,ga=te=>(te["s-ol"]?te["s-ol"]:te).parentNode,So=(te,Z)=>{const we=Z.$elm$=te.$elm$,Ne=te.$children$,yt=Z.$children$,Be=Z.$tag$,Pt=Z.$text$;let en;null===Pt?(re="svg"===Be||"foreignObject"!==Be&&re,"slot"===Be||Jo(te,Z,re),null!==Ne&&null!==yt?((te,Z,we,Ne)=>{let ao,mi,yt=0,Be=0,Pt=0,en=0,Gt=Z.length-1,gn=Z[0],Bn=Z[Gt],it=Ne.length-1,Ft=Ne[0],fs=Ne[it];for(;yt<=Gt&&Be<=it;)if(null==gn)gn=Z[++yt];else if(null==Bn)Bn=Z[--Gt];else if(null==Ft)Ft=Ne[++Be];else if(null==fs)fs=Ne[--it];else if(ma(gn,Ft))So(gn,Ft),gn=Z[++yt],Ft=Ne[++Be];else if(ma(Bn,fs))So(Bn,fs),Bn=Z[--Gt],fs=Ne[--it];else if(ma(gn,fs))("slot"===gn.$tag$||"slot"===fs.$tag$)&&Va(gn.$elm$.parentNode,!1),So(gn,fs),te.insertBefore(gn.$elm$,Bn.$elm$.nextSibling),gn=Z[++yt],fs=Ne[--it];else if(ma(Bn,Ft))("slot"===gn.$tag$||"slot"===fs.$tag$)&&Va(Bn.$elm$.parentNode,!1),So(Bn,Ft),te.insertBefore(Bn.$elm$,gn.$elm$),Bn=Z[--Gt],Ft=Ne[++Be];else{for(Pt=-1,en=yt;en<=Gt;++en)if(Z[en]&&null!==Z[en].$key$&&Z[en].$key$===Ft.$key$){Pt=en;break}Pt>=0?(mi=Z[Pt],mi.$tag$!==Ft.$tag$?ao=Li(Z&&Z[Be],we,Pt,te):(So(mi,Ft),Z[Pt]=void 0,ao=mi.$elm$),Ft=Ne[++Be]):(ao=Li(Z&&Z[Be],we,Be,te),Ft=Ne[++Be]),ao&&ga(gn.$elm$).insertBefore(ao,ea(gn.$elm$))}yt>Gt?K1(te,null==Ne[it+1]?null:Ne[it+1].$elm$,we,Ne,Be,it):Be>it&&S2(Z,yt,Gt)})(we,Ne,Z,yt):null!==yt?(null!==te.$text$&&(we.textContent=""),K1(we,null,Z,yt,0,yt.length-1)):null!==Ne&&S2(Ne,0,Ne.length-1),re&&"svg"===Be&&(re=!1)):(en=we["s-cr"])?en.parentNode.textContent=Pt:te.$text$!==Pt&&(we.data=Pt)},P1=te=>{let we,Ne,yt,Be,Pt,en,Z=te.childNodes;for(Ne=0,yt=Z.length;Ne{let Z,we,Ne,yt,Be,Pt,en=0,Gt=te.childNodes,gn=Gt.length;for(;en=0;Pt--)we=Ne[Pt],!we["s-cn"]&&!we["s-nr"]&&we["s-hn"]!==Z["s-hn"]&&(Fr(we,yt)?(Be=qr.find(Bn=>Bn.$nodeToRelocate$===we),ne=!0,we["s-sn"]=we["s-sn"]||yt,Be?Be.$slotRefNode$=Z:qr.push({$slotRefNode$:Z,$nodeToRelocate$:we}),we["s-sr"]&&qr.map(Bn=>{Fr(Bn.$nodeToRelocate$,we["s-sn"])&&(Be=qr.find(it=>it.$nodeToRelocate$===we),Be&&!Bn.$slotRefNode$&&(Bn.$slotRefNode$=Be.$slotRefNode$))})):qr.some(Bn=>Bn.$nodeToRelocate$===we)||qr.push({$nodeToRelocate$:we}));1===Z.nodeType&&T2(Z)}},Fr=(te,Z)=>1===te.nodeType?null===te.getAttribute("slot")&&""===Z||te.getAttribute("slot")===Z:te["s-sn"]===Z||""===Z,Oo=te=>{te.$attrs$&&te.$attrs$.ref&&te.$attrs$.ref(null),te.$children$&&te.$children$.map(Oo)},To=te=>Ui(te).$hostElement$,J1=(te,Z,we)=>{const Ne=To(te);return{emit:yt=>t1(Ne,Z,{bubbles:!!(4&we),composed:!!(2&we),cancelable:!!(1&we),detail:yt})}},t1=(te,Z,we)=>{const Ne=Pe.ce(Z,we);return te.dispatchEvent(Ne),Ne},Ca=(te,Z)=>{Z&&!te.$onRenderResolve$&&Z["s-p"]&&Z["s-p"].push(new Promise(we=>te.$onRenderResolve$=we))},_i=(te,Z)=>{if(te.$flags$|=16,!(4&te.$flags$))return Ca(te,te.$ancestorComponent$),V1(()=>oo(te,Z));te.$flags$|=512},oo=(te,Z)=>{const Ne=te.$lazyInstance$;let yt;return Z&&(te.$flags$|=256,te.$queuedListeners$&&(te.$queuedListeners$.map(([Be,Pt])=>Y(Ne,Be,Pt)),te.$queuedListeners$=null),yt=Y(Ne,"componentWillLoad")),yt=me(yt,()=>Y(Ne,"componentWillRender")),me(yt,()=>oi(te,Ne,Z))},oi=function(){var te=(0,fe.Z)(function*(Z,we,Ne){const yt=Z.$hostElement$,Pt=yt["s-rc"];Ne&&(te=>{const Z=te.$cmpMeta$,we=te.$hostElement$,Ne=Z.$flags$,Be=Et(at&&we.shadowRoot?we.shadowRoot:we.getRootNode(),Z,te.$modeName$,we);10&Ne&&(we["s-sc"]=Be,we.classList.add(Be+"-h"),2&Ne&&we.classList.add(Be+"-s"))})(Z);No(Z,we),Pe.$cssShim$&&Pe.$cssShim$.updateHost(yt),Pt&&(Pt.map(Gt=>Gt()),yt["s-rc"]=void 0);{const Gt=yt["s-p"],gn=()=>Xr(Z);0===Gt.length?gn():(Promise.all(Gt).then(gn),Z.$flags$|=4,Gt.length=0)}});return function(we,Ne,yt){return te.apply(this,arguments)}}(),No=(te,Z,we)=>{try{Z=Z.render&&Z.render(),te.$flags$&=-17,te.$flags$|=2,((te,Z)=>{const we=te.$hostElement$,Ne=te.$cmpMeta$,yt=te.$vnode$||Wi(null,null),Be=(te=>te&&te.$tag$===$s)(Z)?Z:Pn(null,null,Z);if(Qe=we.tagName,Ne.$attrsToReflect$&&(Be.$attrs$=Be.$attrs$||{},Ne.$attrsToReflect$.map(([Pt,en])=>Be.$attrs$[en]=we[Pt])),Be.$tag$=null,Be.$flags$|=4,te.$vnode$=Be,Be.$elm$=yt.$elm$=we.shadowRoot||we,Me=we["s-sc"],p=we["s-cr"],Fe=at&&0!=(1&Ne.$flags$),ne=!1,So(yt,Be),Pe.$flags$|=1,de){T2(Be.$elm$);let Pt,en,Gt,gn,Bn,it,Ft=0;for(;Ft{const we=te.$hostElement$,yt=te.$lazyInstance$,Be=te.$ancestorComponent$;64&te.$flags$?Y(yt,"componentDidUpdate"):(te.$flags$|=64,_e(we),Y(yt,"componentDidLoad"),te.$onReadyResolve$(we),Be||R()),te.$onInstanceResolve$(we),te.$onRenderResolve$&&(te.$onRenderResolve$(),te.$onRenderResolve$=void 0),512&te.$flags$&&js(()=>_i(te,!1)),te.$flags$&=-517},oe=te=>{{const Z=Ui(te),we=Z.$hostElement$.isConnected;return we&&2==(18&Z.$flags$)&&_i(Z,!1),we}},R=te=>{_e(Le.documentElement),js(()=>t1(Xe,"appload",{detail:{namespace:"ionic"}}))},Y=(te,Z,we)=>{if(te&&te[Z])try{return te[Z](we)}catch(Ne){Zr(Ne)}},me=(te,Z)=>te&&te.then?te.then(Z):Z(),_e=te=>te.classList.add("hydrated"),tt=(te,Z,we,Ne,yt,Be,Pt)=>{let en,Gt,gn,Bn;if(1===Be.nodeType){for(en=Be.getAttribute("c-id"),en&&(Gt=en.split("."),(Gt[0]===Pt||"0"===Gt[0])&&(gn={$flags$:0,$hostId$:Gt[0],$nodeId$:Gt[1],$depth$:Gt[2],$index$:Gt[3],$tag$:Be.tagName.toLowerCase(),$elm$:Be,$attrs$:null,$children$:null,$key$:null,$name$:null,$text$:null},Z.push(gn),Be.removeAttribute("c-id"),te.$children$||(te.$children$=[]),te.$children$[gn.$index$]=gn,te=gn,Ne&&"0"===gn.$depth$&&(Ne[gn.$index$]=gn.$elm$))),Bn=Be.childNodes.length-1;Bn>=0;Bn--)tt(te,Z,we,Ne,yt,Be.childNodes[Bn],Pt);if(Be.shadowRoot)for(Bn=Be.shadowRoot.childNodes.length-1;Bn>=0;Bn--)tt(te,Z,we,Ne,yt,Be.shadowRoot.childNodes[Bn],Pt)}else if(8===Be.nodeType)Gt=Be.nodeValue.split("."),(Gt[1]===Pt||"0"===Gt[1])&&(en=Gt[0],gn={$flags$:0,$hostId$:Gt[1],$nodeId$:Gt[2],$depth$:Gt[3],$index$:Gt[4],$elm$:Be,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null},"t"===en?(gn.$elm$=Be.nextSibling,gn.$elm$&&3===gn.$elm$.nodeType&&(gn.$text$=gn.$elm$.textContent,Z.push(gn),Be.remove(),te.$children$||(te.$children$=[]),te.$children$[gn.$index$]=gn,Ne&&"0"===gn.$depth$&&(Ne[gn.$index$]=gn.$elm$))):gn.$hostId$===Pt&&("s"===en?(gn.$tag$="slot",Be["s-sn"]=Gt[5]?gn.$name$=Gt[5]:"",Be["s-sr"]=!0,Ne&&(gn.$elm$=Le.createElement(gn.$tag$),gn.$name$&&gn.$elm$.setAttribute("name",gn.$name$),Be.parentNode.insertBefore(gn.$elm$,Be),Be.remove(),"0"===gn.$depth$&&(Ne[gn.$index$]=gn.$elm$)),we.push(gn),te.$children$||(te.$children$=[]),te.$children$[gn.$index$]=gn):"r"===en&&(Ne?Be.remove():(yt["s-cr"]=Be,Be["s-cn"]=!0))));else if(te&&"style"===te.$tag$){const it=Wi(null,Be.textContent);it.$elm$=Be,it.$index$="0",te.$children$=[it]}},Re=(te,Z)=>{if(1===te.nodeType){let we=0;for(;we{if(Z.$members$){te.watchers&&(Z.$watchers$=te.watchers);const Ne=Object.entries(Z.$members$),yt=te.prototype;if(Ne.map(([Be,[Pt]])=>{31&Pt||2&we&&32&Pt?Object.defineProperty(yt,Be,{get(){return((te,Z)=>Ui(this).$instanceValues$.get(Z))(0,Be)},set(en){((te,Z,we,Ne)=>{const yt=Ui(te),Be=yt.$hostElement$,Pt=yt.$instanceValues$.get(Z),en=yt.$flags$,Gt=yt.$lazyInstance$;if(we=((te,Z)=>null==te||lr(te)?te:4&Z?"false"!==te&&(""===te||!!te):2&Z?parseFloat(te):1&Z?String(te):te)(we,Ne.$members$[Z][0]),(!(8&en)||void 0===Pt)&&we!==Pt&&(yt.$instanceValues$.set(Z,we),Gt)){if(Ne.$watchers$&&128&en){const gn=Ne.$watchers$[Z];gn&&gn.map(Bn=>{try{Gt[Bn](we,Pt,Z)}catch(it){Zr(it,Be)}})}2==(18&en)&&_i(yt,!1)}})(this,Be,en,Z)},configurable:!0,enumerable:!0}):1&we&&64&Pt&&Object.defineProperty(yt,Be,{value(...en){const Gt=Ui(this);return Gt.$onInstancePromise$.then(()=>Gt.$lazyInstance$[Be](...en))}})}),1&we){const Be=new Map;yt.attributeChangedCallback=function(Pt,en,Gt){Pe.jmp(()=>{const gn=Be.get(Pt);this[gn]=(null!==Gt||"boolean"!=typeof this[gn])&&Gt})},te.observedAttributes=Ne.filter(([Pt,en])=>15&en[0]).map(([Pt,en])=>{const Gt=en[1]||Pt;return Be.set(Gt,Pt),512&en[0]&&Z.$attrsToReflect$.push([Pt,Gt]),Gt})}}return te},Zt=function(){var te=(0,fe.Z)(function*(Z,we,Ne,yt,Be){if(0==(32&we.$flags$)){{if(we.$flags$|=32,(Be=zs(Ne)).then){const gn=()=>{};Be=yield Be,gn()}Be.isProxied||(Ne.$watchers$=Be.watchers,jt(Be,Ne,2),Be.isProxied=!0);const Gt=()=>{};we.$flags$|=8;try{new Be(we)}catch(gn){Zr(gn)}we.$flags$&=-9,we.$flags$|=128,Gt(),bn(we.$lazyInstance$)}if(Be.style){let Gt=Be.style;"string"!=typeof Gt&&(Gt=Gt[we.$modeName$=(te=>Xl.map(Z=>Z(te)).find(Z=>!!Z))(Z)]);const gn=Ot(Ne,we.$modeName$);if(!vr.has(gn)){const Bn=()=>{};8&Ne.$flags$&&(Gt=yield ye.e(8810).then(ye.bind(ye,8810)).then(it=>it.scopeCss(Gt,gn,!1))),Wt(gn,Gt,!!(1&Ne.$flags$)),Bn()}}}const Pt=we.$ancestorComponent$,en=()=>_i(we,!0);Pt&&Pt["s-rc"]?Pt["s-rc"].push(en):en()});return function(we,Ne,yt,Be,Pt){return te.apply(this,arguments)}}(),bn=te=>{Y(te,"connectedCallback")},Un=te=>{const Z=te["s-cr"]=Le.createComment("");Z["s-cn"]=!0,te.insertBefore(Z,te.firstChild)},pi=(te,Z={})=>{const Ne=[],yt=Z.exclude||[],Be=Xe.customElements,Pt=Le.head,en=Pt.querySelector("meta[charset]"),Gt=Le.createElement("style"),gn=[],Bn=Le.querySelectorAll(`[${Ye}]`);let it,Ft=!0,fs=0;for(Object.assign(Pe,Z),Pe.$resourcesUrl$=new URL(Z.resourcesUrl||"./",Le.baseURI).href,Pe.$flags$|=2;fsao[1].map(mi=>{const xs={$flags$:mi[0],$tagName$:mi[1],$members$:mi[2],$listeners$:mi[3]};xs.$members$=mi[2],xs.$listeners$=mi[3],xs.$attrsToReflect$=[],xs.$watchers$={},!at&&1&xs.$flags$&&(xs.$flags$|=8);const ta=xs.$tagName$,Fc=class extends HTMLElement{constructor(na){super(na),ds(na=this,xs),1&xs.$flags$&&(at?na.attachShadow({mode:"open",delegatesFocus:!!(16&xs.$flags$)}):"shadowRoot"in na||(na.shadowRoot=na))}connectedCallback(){it&&(clearTimeout(it),it=null),Ft?gn.push(this):Pe.jmp(()=>(te=>{if(0==(1&Pe.$flags$)){const Z=Ui(te),we=Z.$cmpMeta$,Ne=()=>{};if(1&Z.$flags$)qe(te,Z,we.$listeners$),bn(Z.$lazyInstance$);else{let yt;if(Z.$flags$|=1,yt=te.getAttribute(Ce),yt){if(at&&1&we.$flags$){const Be=Et(te.shadowRoot,we,te.getAttribute("s-mode"));te.classList.remove(Be+"-h",Be+"-s")}((te,Z,we,Ne)=>{const Be=te.shadowRoot,Pt=[],Gt=Be?[]:null,gn=Ne.$vnode$=Wi(Z,null);Pe.$orgLocNodes$||Re(Le.body,Pe.$orgLocNodes$=new Map),te[Ce]=we,te.removeAttribute(Ce),tt(gn,Pt,[],Gt,te,te,we),Pt.map(Bn=>{const it=Bn.$hostId$+"."+Bn.$nodeId$,Ft=Pe.$orgLocNodes$.get(it),fs=Bn.$elm$;Ft&&at&&""===Ft["s-en"]&&Ft.parentNode.insertBefore(fs,Ft.nextSibling),Be||(fs["s-hn"]=Z,Ft&&(fs["s-ol"]=Ft,fs["s-ol"]["s-nr"]=fs)),Pe.$orgLocNodes$.delete(it)}),Be&&Gt.map(Bn=>{Bn&&Be.appendChild(Bn)})})(te,we.$tagName$,yt,Z)}yt||12&we.$flags$&&Un(te);{let Be=te;for(;Be=Be.parentNode||Be.host;)if(1===Be.nodeType&&Be.hasAttribute("s-id")&&Be["s-p"]||Be["s-p"]){Ca(Z,Z.$ancestorComponent$=Be);break}}we.$members$&&Object.entries(we.$members$).map(([Be,[Pt]])=>{if(31&Pt&&te.hasOwnProperty(Be)){const en=te[Be];delete te[Be],te[Be]=en}}),js(()=>Zt(te,Z,we))}Ne()}})(this))}disconnectedCallback(){Pe.jmp(()=>(te=>{if(0==(1&Pe.$flags$)){const Z=Ui(te),we=Z.$lazyInstance$;Z.$rmListeners$&&(Z.$rmListeners$.map(Ne=>Ne()),Z.$rmListeners$=void 0),Pe.$cssShim$&&Pe.$cssShim$.removeHost(te),Y(we,"disconnectedCallback")}})(this))}componentOnReady(){return Ui(this).$onReadyPromise$}};xs.$lazyBundleId$=ao[0],!yt.includes(ta)&&!Be.get(ta)&&(Ne.push(ta),Be.define(ta,jt(Fc,xs,1)))})),Gt.innerHTML=Ne+"{visibility:hidden}.hydrated{visibility:inherit}",Gt.setAttribute("data-styles",""),Pt.insertBefore(Gt,en?en.nextSibling:Pt.firstChild),Ft=!1,gn.length?gn.map(ao=>ao.connectedCallback()):Pe.jmp(()=>it=setTimeout(R,30))},Mr=te=>{const Z=new URL(te,Pe.$resourcesUrl$);return Z.origin!==Xe.location.origin?Z.href:Z.pathname},hr=new WeakMap,Ui=te=>hr.get(te),kr=(te,Z)=>hr.set(Z.$lazyInstance$=te,Z),ds=(te,Z)=>{const we={$flags$:0,$hostElement$:te,$cmpMeta$:Z,$instanceValues$:new Map};return we.$onInstancePromise$=new Promise(Ne=>we.$onInstanceResolve$=Ne),we.$onReadyPromise$=new Promise(Ne=>we.$onReadyResolve$=Ne),te["s-p"]=[],te["s-rc"]=[],qe(te,we,Z.$listeners$),hr.set(te,we)},Fa=(te,Z)=>Z in te,Zr=(te,Z)=>(0,console.error)(te,Z),va=new Map,zs=(te,Z,we)=>{const Ne=te.$tagName$.replace(/-/g,"_"),yt=te.$lazyBundleId$,Be=va.get(yt);return Be?Be[Ne]:ye(863)(`./${yt}.entry.js`).then(Pt=>(va.set(yt,Pt),Pt[Ne]),Zr)},vr=new Map,Xl=[],n1=[],Zl=[],Jt=(te,Z)=>we=>{te.push(we),pe||(pe=!0,Z&&4&Pe.$flags$?js(yi):Pe.raf(yi))},al=te=>{for(let Z=0;Z{al(n1),al(Zl),(pe=n1.length>0)&&Pe.raf(yi)},js=te=>Je().then(te),Ro=Jt(n1,!1),V1=Jt(Zl,!0),Oa={isDev:!1,isBrowser:!0,isServer:!1,isTesting:!1}},4001:(kt,qt,ye)=>{"use strict";ye.d(qt,{L:()=>p,a:()=>Qe,b:()=>Fe,c:()=>ne,d:()=>de,e:()=>nt,g:()=>ut,l:()=>q,s:()=>Ce,t:()=>Xe});var fe=ye(8239),be=ye(3150),Me=ye(2377);const p="ionViewWillEnter",Qe="ionViewDidEnter",Fe="ionViewWillLeave",ne="ionViewDidLeave",de="ionViewWillUnload",Xe=lt=>new Promise((Ct,Dt)=>{(0,be.c)(()=>{ze(lt),Le(lt).then(Qt=>{Qt.animation&&Qt.animation.destroy(),Pe(lt),Ct(Qt)},Qt=>{Pe(lt),Dt(Qt)})})}),ze=lt=>{const Ct=lt.enteringEl,Dt=lt.leavingEl;Ye(Ct,Dt,lt.direction),lt.showGoBack?Ct.classList.add("can-go-back"):Ct.classList.remove("can-go-back"),Ce(Ct,!1),Ct.style.setProperty("pointer-events","none"),Dt&&(Ce(Dt,!1),Dt.style.setProperty("pointer-events","none"))},Le=function(){var lt=(0,fe.Z)(function*(Ct){const Dt=yield at(Ct);return Dt&&be.B.isBrowser?Je(Dt,Ct):_t(Ct)});return function(Dt){return lt.apply(this,arguments)}}(),Pe=lt=>{const Ct=lt.enteringEl,Dt=lt.leavingEl;Ct.classList.remove("ion-page-invisible"),Ct.style.removeProperty("pointer-events"),void 0!==Dt&&(Dt.classList.remove("ion-page-invisible"),Dt.style.removeProperty("pointer-events"))},at=function(){var lt=(0,fe.Z)(function*(Ct){return Ct.leavingEl&&Ct.animated&&0!==Ct.duration?Ct.animationBuilder?Ct.animationBuilder:"ios"===Ct.mode?(yield Promise.resolve().then(ye.bind(ye,9554))).iosTransitionAnimation:(yield Promise.resolve().then(ye.bind(ye,7405))).mdTransitionAnimation:void 0});return function(Dt){return lt.apply(this,arguments)}}(),Je=function(){var lt=(0,fe.Z)(function*(Ct,Dt){yield qe(Dt,!0);const Qt=Ct(Dt.baseEl,Dt);ce(Dt.enteringEl,Dt.leavingEl);const Rn=yield ge(Qt,Dt);return Dt.progressCallback&&Dt.progressCallback(void 0),Rn&&Ge(Dt.enteringEl,Dt.leavingEl),{hasCompleted:Rn,animation:Qt}});return function(Dt,Qt){return lt.apply(this,arguments)}}(),_t=function(){var lt=(0,fe.Z)(function*(Ct){const Dt=Ct.enteringEl,Qt=Ct.leavingEl;return yield qe(Ct,!1),ce(Dt,Qt),Ge(Dt,Qt),{hasCompleted:!0}});return function(Dt){return lt.apply(this,arguments)}}(),qe=function(){var lt=(0,fe.Z)(function*(Ct,Dt){const Rn=(void 0!==Ct.deepWait?Ct.deepWait:Dt)?[nt(Ct.enteringEl),nt(Ct.leavingEl)]:[je(Ct.enteringEl),je(Ct.leavingEl)];yield Promise.all(Rn),yield It(Ct.viewIsReady,Ct.enteringEl)});return function(Dt,Qt){return lt.apply(this,arguments)}}(),It=function(){var lt=(0,fe.Z)(function*(Ct,Dt){Ct&&(yield Ct(Dt))});return function(Dt,Qt){return lt.apply(this,arguments)}}(),ge=(lt,Ct)=>{const Dt=Ct.progressCallback,Qt=new Promise(Rn=>{lt.onFinish(Wt=>Rn(1===Wt))});return Dt?(lt.progressStart(!0),Dt(lt)):lt.play(),Qt},ce=(lt,Ct)=>{q(Ct,Fe),q(lt,p)},Ge=(lt,Ct)=>{q(lt,Qe),q(Ct,ne)},q=(lt,Ct)=>{if(lt){const Dt=new CustomEvent(Ct,{bubbles:!1,cancelable:!1});lt.dispatchEvent(Dt)}},je=lt=>lt?new Promise(Ct=>(0,Me.c)(lt,Ct)):Promise.resolve(),nt=function(){var lt=(0,fe.Z)(function*(Ct){const Dt=Ct;if(Dt){if(null!=Dt.componentOnReady&&null!=(yield Dt.componentOnReady()))return;yield Promise.all(Array.from(Dt.children).map(nt))}});return function(Dt){return lt.apply(this,arguments)}}(),Ce=(lt,Ct)=>{Ct?(lt.setAttribute("aria-hidden","true"),lt.classList.add("ion-page-hidden")):(lt.hidden=!1,lt.removeAttribute("aria-hidden"),lt.classList.remove("ion-page-hidden"))},Ye=(lt,Ct,Dt)=>{void 0!==lt&&(lt.style.zIndex="back"===Dt?"99":"101"),void 0!==Ct&&(Ct.style.zIndex="100")},ut=lt=>lt.classList.contains("ion-page")?lt:lt.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")||lt},7585:(kt,qt,ye)=>{"use strict";ye.d(qt,{a:()=>Me,b:()=>Rn,c:()=>nt,g:()=>be,i:()=>Wt});var fe=ye(3150);const be=Et=>p(Et),Me=(Et,zt)=>("string"==typeof Et&&(zt=Et,Et=void 0),be(Et).includes(zt)),p=(Et=window)=>{if(void 0===Et)return[];Et.Ionic=Et.Ionic||{};let zt=Et.Ionic.platforms;return null==zt&&(zt=Et.Ionic.platforms=Qe(Et),zt.forEach(Ot=>Et.document.documentElement.classList.add(`plt-${Ot}`))),zt},Qe=Et=>Object.keys(q).filter(zt=>q[zt](Et)),ne=Et=>!!(ce(Et,/iPad/i)||ce(Et,/Macintosh/i)&&Pe(Et)),pe=Et=>ce(Et,/android|sink/i),Pe=Et=>Ge(Et,"(any-pointer:coarse)"),Je=Et=>_t(Et)||qe(Et),_t=Et=>!!(Et.cordova||Et.phonegap||Et.PhoneGap),qe=Et=>{const zt=Et.Capacitor;return!(!zt||!zt.isNative)},ce=(Et,zt)=>zt.test(Et.navigator.userAgent),Ge=(Et,zt)=>Et.matchMedia(zt).matches,q={ipad:ne,iphone:Et=>ce(Et,/iPhone/i),ios:Et=>ce(Et,/iPhone|iPod/i)||ne(Et),android:pe,phablet:Et=>{const zt=Et.innerWidth,Ot=Et.innerHeight,mt=Math.min(zt,Ot),Lt=Math.max(zt,Ot);return mt>390&&mt<520&&Lt>620&&Lt<800},tablet:Et=>{const zt=Et.innerWidth,Ot=Et.innerHeight,mt=Math.min(zt,Ot),Lt=Math.max(zt,Ot);return ne(Et)||(Et=>pe(Et)&&!ce(Et,/mobile/i))(Et)||mt>460&&mt<820&&Lt>780&&Lt<1400},cordova:_t,capacitor:qe,electron:Et=>ce(Et,/electron/i),pwa:Et=>!(!Et.matchMedia("(display-mode: standalone)").matches&&!Et.navigator.standalone),mobile:Pe,mobileweb:Et=>Pe(Et)&&!Je(Et),desktop:Et=>!Pe(Et),hybrid:Je};class je{constructor(){this.m=new Map}reset(zt){this.m=new Map(Object.entries(zt))}get(zt,Ot){const mt=this.m.get(zt);return void 0!==mt?mt:Ot}getBoolean(zt,Ot=!1){const mt=this.m.get(zt);return void 0===mt?Ot:"string"==typeof mt?"true"===mt:!!mt}getNumber(zt,Ot){const mt=parseFloat(this.m.get(zt));return isNaN(mt)?void 0!==Ot?Ot:NaN:mt}set(zt,Ot){this.m.set(zt,Ot)}}const nt=new je,Dt="ionic-persist-config";let Qt;const Rn=Et=>Et&&(0,fe.g)(Et)||Qt,Wt=(Et={})=>{if("undefined"==typeof window)return;const zt=window.document,Ot=window,mt=Ot.Ionic=Ot.Ionic||{};p(Ot);const Lt=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(Et=>{try{const zt=Et.sessionStorage.getItem(Dt);return null!==zt?JSON.parse(zt):{}}catch(zt){return{}}})(Ot)),{persistConfig:!1}),mt.config),(Et=>{const zt={};return Et.location.search.slice(1).split("&").map(Ot=>Ot.split("=")).map(([Ot,mt])=>[decodeURIComponent(Ot),decodeURIComponent(mt)]).filter(([Ot])=>((Et,zt)=>Et.substr(0,zt.length)===zt)(Ot,"ionic:")).map(([Ot,mt])=>[Ot.slice("ionic:".length),mt]).forEach(([Ot,mt])=>{zt[Ot]=mt}),zt})(Ot)),Et);nt.reset(Lt),nt.getBoolean("persistConfig")&&((Et,zt)=>{try{Et.sessionStorage.setItem(Dt,JSON.stringify(zt))}catch(Ot){return}})(Ot,Lt),mt.config=nt,mt.mode=Qt=nt.get("mode",zt.documentElement.getAttribute("mode")||(Me(Ot,"ios")?"ios":"md")),nt.set("mode",Qt),zt.documentElement.setAttribute("mode",Qt),zt.documentElement.classList.add(Qt),nt.getBoolean("_testing")&&nt.set("animated",!1);const tn=Hn=>Hn.tagName&&Hn.tagName.startsWith("ION-"),mn=Hn=>["ios","md"].includes(Hn);(0,fe.s)(Hn=>{for(;Hn;){const wn=Hn.mode||Hn.getAttribute("mode");if(wn){if(mn(wn))return wn;tn(Hn)&&console.warn('Invalid ionic mode: "'+wn+'", expected: "ios" or "md"')}Hn=Hn.parentElement}return Qt})}},9554:(kt,qt,ye)=>{"use strict";ye.r(qt),ye.d(qt,{iosTransitionAnimation:()=>ze,shadow:()=>Fe});var fe=ye(4086),be=ye(4001);ye(3150);const Qe=Le=>document.querySelector(`${Le}.ion-cloned-element`),Fe=Le=>Le.shadowRoot||Le,ne=Le=>{const Pe="ION-TABS"===Le.tagName?Le:Le.querySelector("ion-tabs"),at="ion-content ion-header:not(.header-collapse-condense-inactive) ion-title.title-large";if(null!=Pe){const Je=Pe.querySelector("ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)");return null!=Je?Je.querySelector(at):null}return Le.querySelector(at)},de=(Le,Pe)=>{const at="ION-TABS"===Le.tagName?Le:Le.querySelector("ion-tabs");let Je=[];if(null!=at){const _t=at.querySelector("ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)");null!=_t&&(Je=_t.querySelectorAll("ion-buttons"))}else Je=Le.querySelectorAll("ion-buttons");for(const _t of Je){const qe=_t.closest("ion-header"),It=qe&&!qe.classList.contains("header-collapse-condense-inactive"),ge=_t.querySelector("ion-back-button"),ce=_t.classList.contains("buttons-collapse"),Ge="start"===_t.slot||""===_t.slot;if(null!==ge&&Ge&&(ce&&It&&Pe||!ce))return ge}return null},pe=(Le,Pe,at,Je,_t,qe)=>{const It=Pe?`calc(100% - ${qe.right+4}px)`:qe.left-4+"px",ge=Pe?"7px":"-7px",ce=Pe?"-4px":"4px",Ge=Pe?"-4px":"4px",q=Pe?"right":"left",je=Pe?"left":"right",Ye=at?[{offset:0,opacity:1,transform:`translate3d(${ce}, ${qe.top-46}px, 0) scale(1)`},{offset:.6,opacity:0},{offset:1,opacity:0,transform:`translate3d(${ge}, ${_t.top-40}px, 0) scale(2.1)`}]:[{offset:0,opacity:0,transform:`translate3d(${ge}, ${_t.top-40}px, 0) scale(2.1)`},{offset:1,opacity:1,transform:`translate3d(${ce}, ${qe.top-46}px, 0) scale(1)`}],Ct=at?[{offset:0,opacity:1,transform:`translate3d(${Ge}, ${qe.top-46}px, 0) scale(1)`},{offset:.2,opacity:0,transform:`translate3d(${Ge}, ${qe.top-41}px, 0) scale(0.6)`},{offset:1,opacity:0,transform:`translate3d(${Ge}, ${qe.top-41}px, 0) scale(0.6)`}]:[{offset:0,opacity:0,transform:`translate3d(${Ge}, ${qe.top-41}px, 0) scale(0.6)`},{offset:1,opacity:1,transform:`translate3d(${Ge}, ${qe.top-46}px, 0) scale(1)`}],Dt=(0,fe.c)(),Qt=(0,fe.c)(),Rn=Qe("ion-back-button"),Wt=Fe(Rn).querySelector(".button-text"),Et=Fe(Rn).querySelector("ion-icon");Rn.text=Je.text,Rn.mode=Je.mode,Rn.icon=Je.icon,Rn.color=Je.color,Rn.disabled=Je.disabled,Rn.style.setProperty("display","block"),Rn.style.setProperty("position","fixed"),Qt.addElement(Et),Dt.addElement(Wt),Dt.beforeStyles({"transform-origin":`${q} center`}).beforeAddWrite(()=>{Je.style.setProperty("display","none"),Rn.style.setProperty(q,It)}).afterAddWrite(()=>{Je.style.setProperty("display",""),Rn.style.setProperty("display","none"),Rn.style.removeProperty(q)}).keyframes(Ye),Qt.beforeStyles({"transform-origin":`${je} center`}).keyframes(Ct),Le.addAnimation([Dt,Qt])},Xe=(Le,Pe,at,Je,_t,qe)=>{const It=Pe?`calc(100% - ${_t.right}px)`:`${_t.left}px`,ge=Pe?"-18px":"18px",ce=Pe?"right":"left",je=at?[{offset:0,opacity:0,transform:`translate3d(${ge}, ${qe.top-4}px, 0) scale(0.49)`},{offset:.1,opacity:0},{offset:1,opacity:1,transform:`translate3d(0, ${_t.top-2}px, 0) scale(1)`}]:[{offset:0,opacity:.99,transform:`translate3d(0, ${_t.top-2}px, 0) scale(1)`},{offset:.6,opacity:0},{offset:1,opacity:0,transform:`translate3d(${ge}, ${qe.top-4}px, 0) scale(0.5)`}],nt=Qe("ion-title"),Ce=(0,fe.c)();nt.innerText=Je.innerText,nt.size=Je.size,nt.color=Je.color,Ce.addElement(nt),Ce.beforeStyles({"transform-origin":`${ce} center`,height:"46px",display:"",position:"relative",[ce]:It}).beforeAddWrite(()=>{Je.style.setProperty("display","none")}).afterAddWrite(()=>{Je.style.setProperty("display",""),nt.style.setProperty("display","none")}).keyframes(je),Le.addAnimation(Ce)},ze=(Le,Pe)=>{try{const at="cubic-bezier(0.32,0.72,0,1)",Je="opacity",_t="transform",qe="0%",It=.8,ge="rtl"===Le.ownerDocument.dir,ce=ge?"-99.5%":"99.5%",Ge=ge?"33%":"-33%",q=Pe.enteringEl,je=Pe.leavingEl,nt="back"===Pe.direction,Ce=q.querySelector(":scope > ion-content"),Ye=q.querySelectorAll(":scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *"),ut=q.querySelectorAll(":scope > ion-header > ion-toolbar"),lt=(0,fe.c)(),Ct=(0,fe.c)();if(lt.addElement(q).duration(Pe.duration||540).easing(Pe.easing||at).fill("both").beforeRemoveClass("ion-page-invisible"),je&&Le){const Wt=(0,fe.c)();Wt.addElement(Le),lt.addAnimation(Wt)}if(Ce||0!==ut.length||0!==Ye.length?(Ct.addElement(Ce),Ct.addElement(Ye)):Ct.addElement(q.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")),lt.addAnimation(Ct),nt?Ct.beforeClearStyles([Je]).fromTo("transform",`translateX(${Ge})`,`translateX(${qe})`).fromTo(Je,It,1):Ct.beforeClearStyles([Je]).fromTo("transform",`translateX(${ce})`,`translateX(${qe})`),Ce){const Wt=Fe(Ce).querySelector(".transition-effect");if(Wt){const Et=Wt.querySelector(".transition-cover"),zt=Wt.querySelector(".transition-shadow"),Ot=(0,fe.c)(),mt=(0,fe.c)(),Lt=(0,fe.c)();Ot.addElement(Wt).beforeStyles({opacity:"1",display:"block"}).afterStyles({opacity:"",display:""}),mt.addElement(Et).beforeClearStyles([Je]).fromTo(Je,0,.1),Lt.addElement(zt).beforeClearStyles([Je]).fromTo(Je,.03,.7),Ot.addAnimation([mt,Lt]),Ct.addAnimation([Ot])}}const Dt=q.querySelector("ion-header.header-collapse-condense"),{forward:Qt,backward:Rn}=((Le,Pe,at,Je,_t)=>{const qe=de(Je,at),It=ne(_t),ge=ne(Je),ce=de(_t,at),Ge=null!==qe&&null!==It&&!at,q=null!==ge&&null!==ce&&at;if(Ge){const je=It.getBoundingClientRect(),nt=qe.getBoundingClientRect();Xe(Le,Pe,at,It,je,nt),pe(Le,Pe,at,qe,je,nt)}else if(q){const je=ge.getBoundingClientRect(),nt=ce.getBoundingClientRect();Xe(Le,Pe,at,ge,je,nt),pe(Le,Pe,at,ce,je,nt)}return{forward:Ge,backward:q}})(lt,ge,nt,q,je);if(ut.forEach(Wt=>{const Et=(0,fe.c)();Et.addElement(Wt),lt.addAnimation(Et);const zt=(0,fe.c)();zt.addElement(Wt.querySelector("ion-title"));const Ot=(0,fe.c)(),mt=Array.from(Wt.querySelectorAll("ion-buttons,[menuToggle]")),Lt=Wt.closest("ion-header"),tn=Lt&&Lt.classList.contains("header-collapse-condense-inactive");let mn;mn=mt.filter(nt?lr=>{const Pn=lr.classList.contains("buttons-collapse");return Pn&&!tn||!Pn}:lr=>!lr.classList.contains("buttons-collapse")),Ot.addElement(mn);const Hn=(0,fe.c)();Hn.addElement(Wt.querySelectorAll(":scope > *:not(ion-title):not(ion-buttons):not([menuToggle])"));const wn=(0,fe.c)();wn.addElement(Fe(Wt).querySelector(".toolbar-background"));const Cr=(0,fe.c)(),os=Wt.querySelector("ion-back-button");if(os&&Cr.addElement(os),Et.addAnimation([zt,Ot,Hn,wn,Cr]),Ot.fromTo(Je,.01,1),Hn.fromTo(Je,.01,1),nt)tn||zt.fromTo("transform",`translateX(${Ge})`,`translateX(${qe})`).fromTo(Je,.01,1),Hn.fromTo("transform",`translateX(${Ge})`,`translateX(${qe})`),Cr.fromTo(Je,.01,1);else if(Dt||zt.fromTo("transform",`translateX(${ce})`,`translateX(${qe})`).fromTo(Je,.01,1),Hn.fromTo("transform",`translateX(${ce})`,`translateX(${qe})`),wn.beforeClearStyles([Je,"transform"]),(null==Lt?void 0:Lt.translucent)?wn.fromTo("transform",ge?"translateX(-100%)":"translateX(100%)","translateX(0px)"):wn.fromTo(Je,.01,"var(--opacity)"),Qt||Cr.fromTo(Je,.01,1),os&&!Qt){const Pn=(0,fe.c)();Pn.addElement(Fe(os).querySelector(".button-text")).fromTo("transform",ge?"translateX(-100px)":"translateX(100px)","translateX(0px)"),Et.addAnimation(Pn)}}),je){const Wt=(0,fe.c)(),Et=je.querySelector(":scope > ion-content"),zt=je.querySelectorAll(":scope > ion-header > ion-toolbar"),Ot=je.querySelectorAll(":scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *");if(Et||0!==zt.length||0!==Ot.length?(Wt.addElement(Et),Wt.addElement(Ot)):Wt.addElement(je.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")),lt.addAnimation(Wt),nt){Wt.beforeClearStyles([Je]).fromTo("transform",`translateX(${qe})`,ge?"translateX(-100%)":"translateX(100%)");const mt=(0,be.g)(je);lt.afterAddWrite(()=>{"normal"===lt.getDirection()&&mt.style.setProperty("display","none")})}else Wt.fromTo("transform",`translateX(${qe})`,`translateX(${Ge})`).fromTo(Je,1,It);if(Et){const mt=Fe(Et).querySelector(".transition-effect");if(mt){const Lt=mt.querySelector(".transition-cover"),tn=mt.querySelector(".transition-shadow"),mn=(0,fe.c)(),Hn=(0,fe.c)(),wn=(0,fe.c)();mn.addElement(mt).beforeStyles({opacity:"1",display:"block"}).afterStyles({opacity:"",display:""}),Hn.addElement(Lt).beforeClearStyles([Je]).fromTo(Je,.1,0),wn.addElement(tn).beforeClearStyles([Je]).fromTo(Je,.7,.03),mn.addAnimation([Hn,wn]),Wt.addAnimation([mn])}}zt.forEach(mt=>{const Lt=(0,fe.c)();Lt.addElement(mt);const tn=(0,fe.c)();tn.addElement(mt.querySelector("ion-title"));const mn=(0,fe.c)(),Hn=mt.querySelectorAll("ion-buttons,[menuToggle]"),wn=mt.closest("ion-header"),Cr=wn&&wn.classList.contains("header-collapse-condense-inactive"),os=Array.from(Hn).filter(Pa=>{const Mn=Pa.classList.contains("buttons-collapse");return Mn&&!Cr||!Mn});mn.addElement(os);const lr=(0,fe.c)(),Pn=mt.querySelectorAll(":scope > *:not(ion-title):not(ion-buttons):not([menuToggle])");Pn.length>0&&lr.addElement(Pn);const Wi=(0,fe.c)();Wi.addElement(Fe(mt).querySelector(".toolbar-background"));const $s=(0,fe.c)(),Qo=mt.querySelector("ion-back-button");if(Qo&&$s.addElement(Qo),Lt.addAnimation([tn,mn,lr,$s,Wi]),lt.addAnimation(Lt),$s.fromTo(Je,.99,0),mn.fromTo(Je,.99,0),lr.fromTo(Je,.99,0),nt){if(Cr||tn.fromTo("transform",`translateX(${qe})`,ge?"translateX(-100%)":"translateX(100%)").fromTo(Je,.99,0),lr.fromTo("transform",`translateX(${qe})`,ge?"translateX(-100%)":"translateX(100%)"),Wi.beforeClearStyles([Je,"transform"]),(null==wn?void 0:wn.translucent)?Wi.fromTo("transform","translateX(0px)",ge?"translateX(-100%)":"translateX(100%)"):Wi.fromTo(Je,"var(--opacity)",0),Qo&&!Rn){const Mn=(0,fe.c)();Mn.addElement(Fe(Qo).querySelector(".button-text")).fromTo("transform",`translateX(${qe})`,`translateX(${(ge?-124:124)+"px"})`),Lt.addAnimation(Mn)}}else Cr||tn.fromTo("transform",`translateX(${qe})`,`translateX(${Ge})`).fromTo(Je,.99,0).afterClearStyles([_t,Je]),lr.fromTo("transform",`translateX(${qe})`,`translateX(${Ge})`).afterClearStyles([_t,Je]),$s.afterClearStyles([Je]),tn.afterClearStyles([Je]),mn.afterClearStyles([Je])})}return lt}catch(at){throw at}}},7405:(kt,qt,ye)=>{"use strict";ye.r(qt),ye.d(qt,{mdTransitionAnimation:()=>p});var fe=ye(4086),be=ye(4001);ye(3150);const p=(Qe,Fe)=>{const re="back"===Fe.direction,Xe=Fe.leavingEl,ze=(0,be.g)(Fe.enteringEl),Le=ze.querySelector("ion-toolbar"),Pe=(0,fe.c)();if(Pe.addElement(ze).fill("both").beforeRemoveClass("ion-page-invisible"),re?Pe.duration(Fe.duration||200).easing("cubic-bezier(0.47,0,0.745,0.715)"):Pe.duration(Fe.duration||280).easing("cubic-bezier(0.36,0.66,0.04,1)").fromTo("transform","translateY(40px)","translateY(0px)").fromTo("opacity",.01,1),Le){const at=(0,fe.c)();at.addElement(Le),Pe.addAnimation(at)}if(Xe&&re){Pe.duration(Fe.duration||200).easing("cubic-bezier(0.47,0,0.745,0.715)");const at=(0,fe.c)();at.addElement((0,be.g)(Xe)).onFinish(Je=>{1===Je&&at.elements.length>0&&at.elements[0].style.setProperty("display","none")}).fromTo("transform","translateY(0px)","translateY(40px)").fromTo("opacity",1,0),Pe.addAnimation(at)}return Pe}},7053:(kt,qt,ye)=>{"use strict";ye.d(qt,{B:()=>Ot,a:()=>de,b:()=>re,c:()=>Le,d:()=>Ye,e:()=>at,f:()=>lt,g:()=>Qt,h:()=>Fe,i:()=>Wt,l:()=>pe,m:()=>Xe,p:()=>ze,s:()=>zt,t:()=>Pe});var fe=ye(8239),be=ye(7585),Me=ye(3087),p=ye(2377);let Qe=0;const Fe=new WeakMap,ne=mt=>({create:Lt=>Je(mt,Lt),dismiss:(Lt,tn,mn)=>q(document,Lt,tn,mt,mn),getTop:()=>(0,fe.Z)(function*(){return nt(document,mt)})()}),de=ne("ion-alert"),re=ne("ion-action-sheet"),pe=ne("ion-loading"),Xe=ne("ion-modal"),ze=ne("ion-picker"),Le=ne("ion-popover"),Pe=ne("ion-toast"),at=mt=>{"undefined"!=typeof document&&Ge(document);const Lt=Qe++;mt.overlayIndex=Lt,mt.hasAttribute("id")||(mt.id=`ion-overlay-${Lt}`)},Je=(mt,Lt)=>"undefined"!=typeof customElements?customElements.whenDefined(mt).then(()=>{const tn=document.createElement(mt);return tn.classList.add("overlay-hidden"),Object.assign(tn,Lt),Ct(document).appendChild(tn),new Promise(mn=>(0,p.c)(tn,mn))}):Promise.resolve(),_t='[tabindex]:not([tabindex^="-"]), input:not([type=hidden]):not([tabindex^="-"]), textarea:not([tabindex^="-"]), button:not([tabindex^="-"]), select:not([tabindex^="-"]), .ion-focusable:not([tabindex^="-"])',qe="input:not([type=hidden]), textarea, button, select",Ge=mt=>{0===Qe&&(Qe=1,mt.addEventListener("focus",Lt=>((mt,Lt)=>{const tn=nt(Lt),mn=mt.target;if(tn&&mn)if(tn===mn)tn.lastFocus=void 0;else{const Hn=(0,p.g)(tn);if(!Hn.contains(mn))return;const wn=Hn.querySelector(".ion-overlay-wrapper");if(!wn)return;if(wn.contains(mn))tn.lastFocus=mn;else{const Cr=tn.lastFocus;((mt,Lt)=>{let tn=mt.querySelector(_t);const mn=tn&&tn.shadowRoot;mn&&(tn=mn.querySelector(qe)||tn),tn?tn.focus():Lt.focus()})(wn,tn),Cr===Lt.activeElement&&((mt,Lt)=>{const tn=Array.from(mt.querySelectorAll(_t));let mn=tn.length>0?tn[tn.length-1]:null;const Hn=mn&&mn.shadowRoot;Hn&&(mn=Hn.querySelector(qe)||mn),mn?mn.focus():Lt.focus()})(wn,tn),tn.lastFocus=Lt.activeElement}}})(Lt,mt),!0),mt.addEventListener("ionBackButton",Lt=>{const tn=nt(mt);tn&&tn.backdropDismiss&&Lt.detail.register(Me.OVERLAY_BACK_BUTTON_PRIORITY,()=>tn.dismiss(void 0,Ot))}),mt.addEventListener("keyup",Lt=>{if("Escape"===Lt.key){const tn=nt(mt);tn&&tn.backdropDismiss&&tn.dismiss(void 0,Ot)}}))},q=(mt,Lt,tn,mn,Hn)=>{const wn=nt(mt,mn,Hn);return wn?wn.dismiss(Lt,tn):Promise.reject("overlay does not exist")},nt=(mt,Lt,tn)=>{const mn=((mt,Lt)=>(void 0===Lt&&(Lt="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast"),Array.from(mt.querySelectorAll(Lt)).filter(tn=>tn.overlayIndex>0)))(mt,Lt);return void 0===tn?mn[mn.length-1]:mn.find(Hn=>Hn.id===tn)},Ce=(mt=!1)=>{const tn=Ct(document).querySelector("ion-router-outlet, ion-nav, #ion-view-container-root");!tn||(mt?tn.setAttribute("aria-hidden","true"):tn.removeAttribute("aria-hidden"))},Ye=function(){var mt=(0,fe.Z)(function*(Lt,tn,mn,Hn,wn){if(Lt.presented)return;Ce(!0),Lt.presented=!0,Lt.willPresent.emit();const Cr=(0,be.b)(Lt),os=Lt.enterAnimation?Lt.enterAnimation:be.c.get(tn,"ios"===Cr?mn:Hn);(yield Dt(Lt,os,Lt.el,wn))&&Lt.didPresent.emit(),"ION-TOAST"!==Lt.el.tagName&&ut(Lt.el),Lt.keyboardClose&&Lt.el.focus()});return function(tn,mn,Hn,wn,Cr){return mt.apply(this,arguments)}}(),ut=function(){var mt=(0,fe.Z)(function*(Lt){let tn=document.activeElement;if(!tn)return;const mn=tn&&tn.shadowRoot;mn&&(tn=mn.querySelector(qe)||tn),yield Lt.onDidDismiss(),tn.focus()});return function(tn){return mt.apply(this,arguments)}}(),lt=function(){var mt=(0,fe.Z)(function*(Lt,tn,mn,Hn,wn,Cr,os){if(!Lt.presented)return!1;Ce(!1),Lt.presented=!1;try{Lt.el.style.setProperty("pointer-events","none"),Lt.willDismiss.emit({data:tn,role:mn});const lr=(0,be.b)(Lt),Pn=Lt.leaveAnimation?Lt.leaveAnimation:be.c.get(Hn,"ios"===lr?wn:Cr);"gesture"!==mn&&(yield Dt(Lt,Pn,Lt.el,os)),Lt.didDismiss.emit({data:tn,role:mn}),Fe.delete(Lt)}catch(lr){console.error(lr)}return Lt.el.remove(),!0});return function(tn,mn,Hn,wn,Cr,os,lr){return mt.apply(this,arguments)}}(),Ct=mt=>mt.querySelector("ion-app")||mt.body,Dt=function(){var mt=(0,fe.Z)(function*(Lt,tn,mn,Hn){mn.classList.remove("overlay-hidden");const Cr=tn(mn.shadowRoot||Lt.el,Hn);(!Lt.animated||!be.c.getBoolean("animated",!0))&&Cr.duration(0),Lt.keyboardClose&&Cr.beforeAddWrite(()=>{const lr=mn.ownerDocument.activeElement;lr&&lr.matches("input, ion-input, ion-textarea")&&lr.blur()});const os=Fe.get(Lt)||[];return Fe.set(Lt,[...os,Cr]),yield Cr.play(),!0});return function(tn,mn,Hn,wn){return mt.apply(this,arguments)}}(),Qt=(mt,Lt)=>{let tn;const mn=new Promise(Hn=>tn=Hn);return Rn(mt,Lt,Hn=>{tn(Hn.detail)}),mn},Rn=(mt,Lt,tn)=>{const mn=Hn=>{(0,p.b)(mt,Lt,mn),tn(Hn)};(0,p.a)(mt,Lt,mn)},Wt=mt=>"cancel"===mt||mt===Ot,Et=mt=>mt(),zt=(mt,Lt)=>{if("function"==typeof mt)return be.c.get("_zoneGate",Et)(()=>{try{return mt(Lt)}catch(mn){console.error(mn)}})},Ot="backdrop"},7960:(kt,qt,ye)=>{"use strict";const fe=ye(3213),be=ye(7930),Me=ye(1299);kt.exports=function p(ne,de){switch(be(ne)){case"object":return function(ne,de){if("function"==typeof de)return de(ne);if(de||Me(ne)){const re=new ne.constructor;for(let pe in ne)re[pe]=p(ne[pe],de);return re}return ne}(ne,de);case"array":return function(ne,de){const re=new ne.constructor(ne.length);for(let pe=0;pe{"use strict";kt.exports=class{constructor(fe,be,Me,p){this.minlat=fe,this.minlon=be,this.maxlat=Me,this.maxlon=p}toObject(){const{minlat:fe,minlon:be,maxlat:Me,maxlon:p}=this;return{attributes:{minlat:fe,minlon:be,maxlat:Me,maxlon:p}}}}},1209:kt=>{"use strict";kt.exports=class{constructor(fe,{year:be,license:Me}){this.author=fe,this.year=be||null,this.license=Me||null}toObject(){const{author:fe,year:be,license:Me}=this;return $t($t({attributes:{author:fe}},be?{year:be}:{}),Me?{license:Me}:{})}}},9092:kt=>{"use strict";kt.exports=class{constructor(fe,{text:be,type:Me}){this.href=fe,this.text=be||null,this.type=Me||null}toObject(){const{href:fe,text:be,type:Me}=this;return $t($t({attributes:{href:fe}},be?{text:be}:{}),Me?{type:Me}:{})}}},6475:kt=>{"use strict";kt.exports=class{constructor({name:fe,desc:be,author:Me,copyright:p,link:Qe,time:Fe,keywords:ne,bounds:de,extensions:re}){this.name=fe||null,this.desc=be||null,this.author=Me||null,this.copyright=p||null,this.link=Qe||null,this.time=Fe||null,this.keywords=ne||null,this.bounds=de||null,this.extensions=re||null}toObject(){const{name:fe,desc:be,author:Me,copyright:p,link:Qe,time:Fe,keywords:ne,bounds:de,extensions:re}=this;return $t($t($t($t($t($t($t($t($t({},fe?{name:fe}:{}),be?{desc:be}:{}),Me?{author:Me.toObject()}:{}),p?{copyright:p.toObject()}:{}),Qe?{link:Qe.toObject()}:{}),Fe?{time:Fe}:{}),ne?{keywords:ne}:{}),de?{bounds:de.toObject()}:{}),re?{extensions:re}:{})}}},3662:kt=>{"use strict";kt.exports=class{constructor({name:fe,email:be,link:Me}){this.name=fe||null,this.email=be||null,this.link=Me||null}toObject(){const{name:fe,email:be,link:Me}=this;return $t($t($t({},fe?{name:fe}:{}),be?{email:be}:{}),Me?{link:Me.toObject()}:{})}}},8728:kt=>{"use strict";kt.exports=class{constructor(fe,be,{ele:Me,time:p,magvar:Qe,geoidheight:Fe,name:ne,cmt:de,desc:re,src:pe,link:Xe,sym:ze,type:Le,fix:Pe,sat:at,hdop:Je,vdop:_t,pdop:qe,ageofdgpsdata:It,dgpsid:ge,extensions:ce}={}){this.lat=fe,this.lon=be,this.ele=Me||null,this.time=p||null,this.magvar=Qe||null,this.geoidheight=Fe||null,this.name=ne||null,this.cmt=de||null,this.desc=re||null,this.src=pe||null,this.link=Xe||null,this.sym=ze||null,this.type=Le||null,this.fix=Pe||null,this.sat=at||null,this.hdop=Je||null,this.vdop=_t||null,this.pdop=qe||null,this.ageofdgpsdata=It||null,this.dgpsid=ge||null,this.extensions=ce||null}toObject(){const{lat:fe,lon:be,ele:Me,time:p,magvar:Qe,geoidheight:Fe,name:ne,cmt:de,desc:re,src:pe,link:Xe,sym:ze,type:Le,fix:Pe,sat:at,hdop:Je,vdop:_t,pdop:qe,ageofdgpsdata:It,dgpsid:ge,extensions:ce}=this;return $t($t($t($t($t($t($t($t($t($t($t($t($t($t($t($t($t($t($t({attributes:{lat:fe,lon:be}},Me?{ele:Me}:{}),p?{time:p}:{}),Qe?{magvar:Qe}:{}),Fe?{geoidheight:Fe}:{}),ne?{name:ne}:{}),de?{cmt:de}:{}),re?{desc:re}:{}),pe?{src:pe}:{}),Xe?{link:Xe.toObject()}:{}),ze?{sym:ze}:{}),Le?{type:Le}:{}),Pe?{fix:Pe}:{}),at?{sat:at}:{}),Je?{hdop:Je}:{}),_t?{vdop:_t}:{}),qe?{pdop:qe}:{}),It?{ageofdgpsdata:It}:{}),ge?{dgpsid:ge}:{}),ce&&Object.keys(ce).length>0?{extensions:ce}:{})}}},7816:kt=>{"use strict";kt.exports=class{constructor(fe){this.cmt=fe.cmt,this.desc=fe.desc,this.extensions=fe.extensions,this.link=fe.link,this.name=fe.name,this.number=fe.number,this.rtept=fe.rtept,this.src=fe.src,this.type=fe.type}toObject(){const{cmt:fe,desc:be,src:Me,link:p,number:Qe,type:Fe,extensions:ne,rtept:de,name:re}=this;return $t($t($t($t($t($t($t($t($t({},fe?{cmt:fe}:{}),be?{desc:be}:{}),Me?{src:Me}:{}),p?{link:p}:{}),Qe?{number:Qe}:{}),Fe?{type:Fe}:{}),ne?{extensions:ne}:{}),de?{rtept:de.map(pe=>pe.toObject())}:{}),re?{name:re}:{})}}},2772:kt=>{"use strict";kt.exports=class{constructor(fe,be=null){this.trkpt=fe,this.extensions=be||null}setPoints(fe){return this.trkpt=fe,this}toObject(){const{trkpt:fe,extensions:be}=this;return $t({trkpt:fe.map(Me=>Me.toObject())},be?{extensions:be}:{})}}},254:kt=>{"use strict";kt.exports=class{constructor(fe,{name:be,cmt:Me,desc:p,src:Qe,link:Fe,number:ne,type:de,extensions:re}={}){this.name=be||null,this.cmt=Me||null,this.desc=p||null,this.src=Qe||null,this.link=Fe||null,this.number=ne||null,this.type=de||null,this.extensions=re||null,this.trkseg=fe||null}setSegments(fe){return this.trkseg=fe,this}toObject(){const{name:fe,cmt:be,desc:Me,src:p,link:Qe,number:Fe,type:ne,extensions:de,trkseg:re}=this;return $t($t($t($t($t($t($t($t($t({},fe?{name:fe}:{}),be?{cmt:be}:{}),Me?{desc:Me}:{}),p?{src:p}:{}),Qe?{link:Qe.toObject()}:{}),Fe?{number:Fe}:{}),ne?{type:ne}:{}),de?{extensions:de}:{}),re?{trkseg:re.map(pe=>pe.toObject())}:{})}}},1262:(kt,qt,ye)=>{"use strict";ye(7455),ye(9092);var p=ye(1209),Fe=(ye(3662),ye(6475)),de=(ye(7816),ye(8728));ye(254),ye(2772);qt.wZ=p,qt.SF=Fe,qt.E9=de},1299:(kt,qt,ye)=>{"use strict";var fe=ye(9708);function be(Me){return!0===fe(Me)&&"[object Object]"===Object.prototype.toString.call(Me)}kt.exports=function(p){var Qe,Fe;return!(!1===be(p)||(Qe=p.constructor,"function"!=typeof Qe)||(Fe=Qe.prototype,!1===be(Fe))||!1===Fe.hasOwnProperty("isPrototypeOf"))}},9708:kt=>{"use strict";kt.exports=function(ye){return null!=ye&&"object"==typeof ye&&!1===Array.isArray(ye)}},7930:kt=>{var qt=Object.prototype.toString;function ye(re){return"function"==typeof re.constructor?re.constructor.name:null}kt.exports=function(pe){if(void 0===pe)return"undefined";if(null===pe)return"null";var re,Xe=typeof pe;if("boolean"===Xe)return"boolean";if("string"===Xe)return"string";if("number"===Xe)return"number";if("symbol"===Xe)return"symbol";if("function"===Xe)return"GeneratorFunction"===ye(pe)?"generatorfunction":"function";if(re=pe,Array.isArray?Array.isArray(re):re instanceof Array)return"array";if(function(re){return!(!re.constructor||"function"!=typeof re.constructor.isBuffer)&&re.constructor.isBuffer(re)}(pe))return"buffer";if(function(re){try{if("number"==typeof re.length&&"function"==typeof re.callee)return!0}catch(pe){if(-1!==pe.message.indexOf("callee"))return!0}return!1}(pe))return"arguments";if(function(re){return re instanceof Date||"function"==typeof re.toDateString&&"function"==typeof re.getDate&&"function"==typeof re.setDate}(pe))return"date";if(function(re){return re instanceof Error||"string"==typeof re.message&&re.constructor&&"number"==typeof re.constructor.stackTraceLimit}(pe))return"error";if(function(re){return re instanceof RegExp||"string"==typeof re.flags&&"boolean"==typeof re.ignoreCase&&"boolean"==typeof re.multiline&&"boolean"==typeof re.global}(pe))return"regexp";switch(ye(pe)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(re){return"function"==typeof re.throw&&"function"==typeof re.return&&"function"==typeof re.next}(pe))return"generator";switch(Xe=qt.call(pe)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return Xe.slice(8,-1).toLowerCase().replace(/\s/g,"")}},2958:function(kt){kt.exports=function(){"use strict";var qt,ye,fe;function be(p,Qe){if(qt)if(ye){var Fe="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+qt+")(sharedChunk); ("+ye+")(sharedChunk); self.onerror = null;",ne={};qt(ne),fe=Qe(ne),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(fe.workerUrl=window.URL.createObjectURL(new Blob([Fe],{type:"text/javascript"})))}else ye=Qe;else qt=Qe}return be(0,function(p){var Fe=ne;function ne(a,o,u,d){this.cx=3*a,this.bx=3*(u-a)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*o,this.by=3*(d-o)-this.cy,this.ay=1-this.cy-this.by,this.p1x=a,this.p1y=d,this.p2x=u,this.p2y=d}ne.prototype.sampleCurveX=function(a){return((this.ax*a+this.bx)*a+this.cx)*a},ne.prototype.sampleCurveY=function(a){return((this.ay*a+this.by)*a+this.cy)*a},ne.prototype.sampleCurveDerivativeX=function(a){return(3*this.ax*a+2*this.bx)*a+this.cx},ne.prototype.solveCurveX=function(a,o){var u,d,m,C,_;for(void 0===o&&(o=1e-6),m=a,_=0;_<8;_++){if(C=this.sampleCurveX(m)-a,Math.abs(C)(d=1))return d;for(;uC?u=m:d=m,m=.5*(d-u)+u}return m},ne.prototype.solve=function(a,o){return this.sampleCurveY(this.solveCurveX(a,o))};var de=re;function re(a,o){this.x=a,this.y=o}re.prototype={clone:function(){return new re(this.x,this.y)},add:function(a){return this.clone()._add(a)},sub:function(a){return this.clone()._sub(a)},multByPoint:function(a){return this.clone()._multByPoint(a)},divByPoint:function(a){return this.clone()._divByPoint(a)},mult:function(a){return this.clone()._mult(a)},div:function(a){return this.clone()._div(a)},rotate:function(a){return this.clone()._rotate(a)},rotateAround:function(a,o){return this.clone()._rotateAround(a,o)},matMult:function(a){return this.clone()._matMult(a)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(a){return this.x===a.x&&this.y===a.y},dist:function(a){return Math.sqrt(this.distSqr(a))},distSqr:function(a){var o=a.x-this.x,u=a.y-this.y;return o*o+u*u},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(a){return Math.atan2(this.y-a.y,this.x-a.x)},angleWith:function(a){return this.angleWithSep(a.x,a.y)},angleWithSep:function(a,o){return Math.atan2(this.x*o-this.y*a,this.x*a+this.y*o)},_matMult:function(a){var o=a[2]*this.x+a[3]*this.y;return this.x=a[0]*this.x+a[1]*this.y,this.y=o,this},_add:function(a){return this.x+=a.x,this.y+=a.y,this},_sub:function(a){return this.x-=a.x,this.y-=a.y,this},_mult:function(a){return this.x*=a,this.y*=a,this},_div:function(a){return this.x/=a,this.y/=a,this},_multByPoint:function(a){return this.x*=a.x,this.y*=a.y,this},_divByPoint:function(a){return this.x/=a.x,this.y/=a.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var a=this.y;return this.y=this.x,this.x=-a,this},_rotate:function(a){var o=Math.cos(a),u=Math.sin(a),d=u*this.x+o*this.y;return this.x=o*this.x-u*this.y,this.y=d,this},_rotateAround:function(a,o){var u=Math.cos(a),d=Math.sin(a),m=o.y+d*(this.x-o.x)+u*(this.y-o.y);return this.x=o.x+u*(this.x-o.x)-d*(this.y-o.y),this.y=m,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},re.convert=function(a){return a instanceof re?a:Array.isArray(a)?new re(a[0],a[1]):a};var pe="undefined"!=typeof self?self:{},Xe=1e-6,ze="undefined"!=typeof Float32Array?Float32Array:Array;function Le(){var a=new ze(9);return ze!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[5]=0,a[6]=0,a[7]=0),a[0]=1,a[4]=1,a[8]=1,a}function Pe(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}function at(a,o,u){var d=o[0],m=o[1],C=o[2],_=o[3],w=o[4],T=o[5],D=o[6],P=o[7],V=o[8],O=o[9],U=o[10],X=o[11],ee=o[12],se=o[13],xe=o[14],Ie=o[15],$e=u[0],Ke=u[1],rt=u[2],st=u[3];return a[0]=$e*d+Ke*w+rt*V+st*ee,a[1]=$e*m+Ke*T+rt*O+st*se,a[2]=$e*C+Ke*D+rt*U+st*xe,a[3]=$e*_+Ke*P+rt*X+st*Ie,a[4]=($e=u[4])*d+(Ke=u[5])*w+(rt=u[6])*V+(st=u[7])*ee,a[5]=$e*m+Ke*T+rt*O+st*se,a[6]=$e*C+Ke*D+rt*U+st*xe,a[7]=$e*_+Ke*P+rt*X+st*Ie,a[8]=($e=u[8])*d+(Ke=u[9])*w+(rt=u[10])*V+(st=u[11])*ee,a[9]=$e*m+Ke*T+rt*O+st*se,a[10]=$e*C+Ke*D+rt*U+st*xe,a[11]=$e*_+Ke*P+rt*X+st*Ie,a[12]=($e=u[12])*d+(Ke=u[13])*w+(rt=u[14])*V+(st=u[15])*ee,a[13]=$e*m+Ke*T+rt*O+st*se,a[14]=$e*C+Ke*D+rt*U+st*xe,a[15]=$e*_+Ke*P+rt*X+st*Ie,a}function Je(a,o,u){var d,m,C,_,w,T,D,P,V,O,U,X,ee=u[0],se=u[1],xe=u[2];return o===a?(a[12]=o[0]*ee+o[4]*se+o[8]*xe+o[12],a[13]=o[1]*ee+o[5]*se+o[9]*xe+o[13],a[14]=o[2]*ee+o[6]*se+o[10]*xe+o[14],a[15]=o[3]*ee+o[7]*se+o[11]*xe+o[15]):(m=o[1],C=o[2],_=o[3],w=o[4],T=o[5],D=o[6],P=o[7],V=o[8],O=o[9],U=o[10],X=o[11],a[0]=d=o[0],a[1]=m,a[2]=C,a[3]=_,a[4]=w,a[5]=T,a[6]=D,a[7]=P,a[8]=V,a[9]=O,a[10]=U,a[11]=X,a[12]=d*ee+w*se+V*xe+o[12],a[13]=m*ee+T*se+O*xe+o[13],a[14]=C*ee+D*se+U*xe+o[14],a[15]=_*ee+P*se+X*xe+o[15]),a}function _t(a,o,u){var d=u[0],m=u[1],C=u[2];return a[0]=o[0]*d,a[1]=o[1]*d,a[2]=o[2]*d,a[3]=o[3]*d,a[4]=o[4]*m,a[5]=o[5]*m,a[6]=o[6]*m,a[7]=o[7]*m,a[8]=o[8]*C,a[9]=o[9]*C,a[10]=o[10]*C,a[11]=o[11]*C,a[12]=o[12],a[13]=o[13],a[14]=o[14],a[15]=o[15],a}function qe(a,o,u){var d=Math.sin(u),m=Math.cos(u),C=o[4],_=o[5],w=o[6],T=o[7],D=o[8],P=o[9],V=o[10],O=o[11];return o!==a&&(a[0]=o[0],a[1]=o[1],a[2]=o[2],a[3]=o[3],a[12]=o[12],a[13]=o[13],a[14]=o[14],a[15]=o[15]),a[4]=C*m+D*d,a[5]=_*m+P*d,a[6]=w*m+V*d,a[7]=T*m+O*d,a[8]=D*m-C*d,a[9]=P*m-_*d,a[10]=V*m-w*d,a[11]=O*m-T*d,a}function It(a,o,u){var d=Math.sin(u),m=Math.cos(u),C=o[0],_=o[1],w=o[2],T=o[3],D=o[8],P=o[9],V=o[10],O=o[11];return o!==a&&(a[4]=o[4],a[5]=o[5],a[6]=o[6],a[7]=o[7],a[12]=o[12],a[13]=o[13],a[14]=o[14],a[15]=o[15]),a[0]=C*m-D*d,a[1]=_*m-P*d,a[2]=w*m-V*d,a[3]=T*m-O*d,a[8]=C*d+D*m,a[9]=_*d+P*m,a[10]=w*d+V*m,a[11]=T*d+O*m,a}Math.hypot||(Math.hypot=function(){for(var a=0,o=arguments.length;o--;)a+=arguments[o]*arguments[o];return Math.sqrt(a)});var ge=at;function ce(){var a=new ze(3);return ze!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0),a}function Ge(a){var o=new ze(3);return o[0]=a[0],o[1]=a[1],o[2]=a[2],o}function q(a){return Math.hypot(a[0],a[1],a[2])}function je(a,o,u){var d=new ze(3);return d[0]=a,d[1]=o,d[2]=u,d}function nt(a,o,u){return a[0]=o[0]+u[0],a[1]=o[1]+u[1],a[2]=o[2]+u[2],a}function Ce(a,o,u){return a[0]=o[0]-u[0],a[1]=o[1]-u[1],a[2]=o[2]-u[2],a}function Ye(a,o,u){return a[0]=o[0]*u[0],a[1]=o[1]*u[1],a[2]=o[2]*u[2],a}function ut(a,o,u){return a[0]=Math.max(o[0],u[0]),a[1]=Math.max(o[1],u[1]),a[2]=Math.max(o[2],u[2]),a}function lt(a,o,u){return a[0]=o[0]*u,a[1]=o[1]*u,a[2]=o[2]*u,a}function Ct(a,o,u,d){return a[0]=o[0]+u[0]*d,a[1]=o[1]+u[1]*d,a[2]=o[2]+u[2]*d,a}function Dt(a,o){var u=o[0],d=o[1],m=o[2],C=u*u+d*d+m*m;return C>0&&(C=1/Math.sqrt(C)),a[0]=o[0]*C,a[1]=o[1]*C,a[2]=o[2]*C,a}function Qt(a,o){return a[0]*o[0]+a[1]*o[1]+a[2]*o[2]}function Rn(a,o,u){var d=o[0],m=o[1],C=o[2],_=u[0],w=u[1],T=u[2];return a[0]=m*T-C*w,a[1]=C*_-d*T,a[2]=d*w-m*_,a}function Wt(a,o,u){var d=o[0],m=o[1],C=o[2],_=u[3]*d+u[7]*m+u[11]*C+u[15];return a[0]=(u[0]*d+u[4]*m+u[8]*C+u[12])/(_=_||1),a[1]=(u[1]*d+u[5]*m+u[9]*C+u[13])/_,a[2]=(u[2]*d+u[6]*m+u[10]*C+u[14])/_,a}function Et(a,o,u){var d=u[0],m=u[1],C=u[2],_=o[0],w=o[1],T=o[2],D=m*T-C*w,P=C*_-d*T,V=d*w-m*_,O=m*V-C*P,U=C*D-d*V,X=d*P-m*D,ee=2*u[3];return P*=ee,V*=ee,U*=2,X*=2,a[0]=_+(D*=ee)+(O*=2),a[1]=w+P+U,a[2]=T+V+X,a}var zt,a,Ot=Ce,mt=Ye,Lt=q;function tn(a,o,u){var d=o[0],m=o[1],C=o[2],_=o[3];return a[0]=u[0]*d+u[4]*m+u[8]*C+u[12]*_,a[1]=u[1]*d+u[5]*m+u[9]*C+u[13]*_,a[2]=u[2]*d+u[6]*m+u[10]*C+u[14]*_,a[3]=u[3]*d+u[7]*m+u[11]*C+u[15]*_,a}function mn(){var a=new ze(4);return ze!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0),a[3]=1,a}function Hn(a){return a[0]=0,a[1]=0,a[2]=0,a[3]=1,a}function wn(a,o,u){u*=.5;var d=o[0],m=o[1],C=o[2],_=o[3],w=Math.sin(u),T=Math.cos(u);return a[0]=d*T+_*w,a[1]=m*T+C*w,a[2]=C*T-m*w,a[3]=_*T-d*w,a}function Cr(a,o){return a[0]===o[0]&&a[1]===o[1]}ce(),zt=new ze(4),ze!=Float32Array&&(zt[0]=0,zt[1]=0,zt[2]=0,zt[3]=0),ce(),je(1,0,0),je(0,1,0),mn(),mn(),Le(),a=new ze(2),ze!=Float32Array&&(a[0]=0,a[1]=0);const os=Math.PI/180,lr=180/Math.PI;function Pn(a){return a*os}function Wi(a){return a*lr}const $s=[[0,0],[1,0],[1,1],[0,1]];function Qo(a){if(a<=0)return 0;if(a>=1)return 1;const o=a*a,u=o*a;return 4*(a<.5?u:3*(a-o)+u-.75)}function Pa(a,o,u,d){const m=new Fe(a,o,u,d);return function(C){return m.solve(C)}}const Mn=Pa(.25,.1,.25,1);function qi(a,o,u){return Math.min(u,Math.max(o,a))}function Is(a,o,u){return(u=qi((u-a)/(o-a),0,1))*u*(3-2*u)}function Mo(a,o,u){const d=u-o,m=((a-o)%d+d)%d+o;return m===o?u:m}function Os(a,o,u){if(!a.length)return u(null,[]);let d=a.length;const m=new Array(a.length);let C=null;a.forEach((_,w)=>{o(_,(T,D)=>{T&&(C=T),m[w]=D,0==--d&&u(C,m)})})}function Jo(a){const o=[];for(const u in a)o.push(a[u]);return o}function Li(a,...o){for(const u of o)for(const d in u)a[d]=u[d];return a}let Va=1;function K1(){return Va++}function S2(){return function a(o){return o?(o^16*Math.random()>>o/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,a)}()}function hs(a){return a<=1?1:Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))}function ma(a){return!!a&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(a)}function ea(a,o){a.forEach(u=>{o[u]&&(o[u]=o[u].bind(o))})}function ga(a,o){return-1!==a.indexOf(o,a.length-o.length)}function So(a,o,u){const d={};for(const m in a)d[m]=o.call(u||this,a[m],m,a);return d}function P1(a,o,u){const d={};for(const m in a)o.call(u||this,a[m],m,a)&&(d[m]=a[m]);return d}function qr(a){return Array.isArray(a)?a.map(qr):"object"==typeof a&&a?So(a,qr):a}const T2={};function Fr(a){T2[a]||("undefined"!=typeof console&&console.warn(a),T2[a]=!0)}function Oo(a,o,u){return(u.y-a.y)*(o.x-a.x)>(o.y-a.y)*(u.x-a.x)}function Q1(a){let o=0;for(let u,d,m=0,C=a.length,_=C-1;m@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(u,d,m,C)=>{const _=m||C;return o[d]=!_||_.toLowerCase(),""}),o["max-age"]){const u=parseInt(o["max-age"],10);isNaN(u)?delete o["max-age"]:o["max-age"]=u}return o}let t1,Ca,_i,oo=null;function oi(a){if(null==oo){const o=a.navigator?a.navigator.userAgent:null;oo=!!a.safari||!(!o||!(/\b(iPad|iPhone|iPod)\b/.test(o)||o.match("Safari")&&!o.match("Chrome")))}return oo}function No(a){try{const o=pe[a];return o.setItem("_mapbox_test_",1),o.removeItem("_mapbox_test_"),!0}catch(o){return!1}}const Xr={now:()=>void 0!==_i?_i:pe.performance.now(),setNow(a){_i=a},restoreNow(){_i=void 0},frame(a){const o=pe.requestAnimationFrame(a);return{cancel:()=>pe.cancelAnimationFrame(o)}},getImageData(a,o=0){const u=pe.document.createElement("canvas"),d=u.getContext("2d");if(!d)throw new Error("failed to create canvas 2d context");return u.width=a.width,u.height=a.height,d.drawImage(a,0,0,a.width,a.height),d.getImageData(-o,-o,a.width+2*o,a.height+2*o)},resolveURL:a=>(t1||(t1=pe.document.createElement("a")),t1.href=a,t1.href),get devicePixelRatio(){return pe.devicePixelRatio},get prefersReducedMotion(){return!!pe.matchMedia&&(null==Ca&&(Ca=pe.matchMedia("(prefers-reduced-motion: reduce)")),Ca.matches)}};let oe;const R={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==oe){const a=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{oe=null!=process.env.API_URL_REGEX?new RegExp(process.env.API_URL_REGEX):a}catch(o){oe=a}}return oe},get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Y={supported:!1,testSupport:function(a){!Ue&&_e&&(tt?Re(a):me=a)}};let me,_e,Ue=!1,tt=!1;function Re(a){const o=a.createTexture();a.bindTexture(a.TEXTURE_2D,o);try{if(a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,_e),a.isContextLost())return;Y.supported=!0}catch(u){}a.deleteTexture(o),Ue=!0}pe.document&&(_e=pe.document.createElement("img"),_e.onload=function(){me&&Re(me),me=null,tt=!0},_e.onerror=function(){Ue=!0,me=null},_e.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const He="01",dt="NO_ACCESS_TOKEN";function Nt(a){return 0===a.indexOf("mapbox:")}function jt(a){return R.API_URL_REGEX.test(a)}const Zt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function bn(a){const o=a.match(Zt);if(!o)throw new Error("Unable to parse URL object");return{protocol:o[1],authority:o[2],path:o[3]||"/",params:o[4]?o[4].split("&"):[]}}function Zn(a){const o=a.params.length?`?${a.params.join("&")}`:"";return`${a.protocol}://${a.authority}${a.path}${o}`}function Un(a){if(!a)return null;const o=a.split(".");if(!o||3!==o.length)return null;try{return JSON.parse(decodeURIComponent(pe.atob(o[1]).split("").map(u=>"%"+("00"+u.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch(u){return null}}class si{constructor(o){this.type=o,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(o){const u=Un(R.ACCESS_TOKEN);let d="";return d=u&&u.u?pe.btoa(encodeURIComponent(u.u).replace(/%([0-9A-F]{2})/g,(m,C)=>String.fromCharCode(Number("0x"+C)))):R.ACCESS_TOKEN||"",o?`mapbox.eventData.${o}:${d}`:`mapbox.eventData:${d}`}fetchEventData(){const o=No("localStorage"),u=this.getStorageKey(),d=this.getStorageKey("uuid");if(o)try{const m=pe.localStorage.getItem(u);m&&(this.eventData=JSON.parse(m));const C=pe.localStorage.getItem(d);C&&(this.anonId=C)}catch(m){Fr("Unable to read from LocalStorage")}}saveEventData(){const o=No("localStorage"),u=this.getStorageKey(),d=this.getStorageKey("uuid");if(o)try{pe.localStorage.setItem(d,this.anonId),Object.keys(this.eventData).length>=1&&pe.localStorage.setItem(u,JSON.stringify(this.eventData))}catch(m){Fr("Unable to write to LocalStorage")}}processRequests(o){}postEvent(o,u,d,m){if(!R.EVENTS_URL)return;const C=bn(R.EVENTS_URL);C.params.push(`access_token=${m||R.ACCESS_TOKEN||""}`);const _={event:this.type,created:new Date(o).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"2.7.0",skuId:He,userId:this.anonId},w=u?Li(_,u):_,T={url:Zn(C),headers:{"Content-Type":"text/plain"},body:JSON.stringify([w])};this.pendingRequest=Oa(T,D=>{this.pendingRequest=null,d(D),this.saveEventData(),this.processRequests(m)})}queueRequest(o,u){this.queue.push(o),this.processRequests(u)}}const pi=new class extends si{constructor(a){super("appUserTurnstile"),this._customAccessToken=a}postTurnstileEvent(a,o){R.EVENTS_URL&&R.ACCESS_TOKEN&&Array.isArray(a)&&a.some(u=>Nt(u)||jt(u))&&this.queueRequest(Date.now(),o)}processRequests(a){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const o=Un(R.ACCESS_TOKEN),u=o?o.u:R.ACCESS_TOKEN;let d=u!==this.eventData.tokenU;ma(this.anonId)||(this.anonId=S2(),d=!0);const m=this.queue.shift();if(this.eventData.lastSuccess){const C=new Date(this.eventData.lastSuccess),_=new Date(m),w=(m-this.eventData.lastSuccess)/864e5;d=d||w>=1||w<-1||C.getDate()!==_.getDate()}else d=!0;if(!d)return this.processRequests();this.postEvent(m,{"enabled.telemetry":!1},C=>{C||(this.eventData.lastSuccess=m,this.eventData.tokenU=u)},a)}},Mr=pi.postTurnstileEvent.bind(pi),hr=new class extends si{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(a,o,u,d){this.skuToken=o,this.errorCb=d,R.EVENTS_URL&&(u||R.ACCESS_TOKEN?this.queueRequest({id:a,timestamp:Date.now()},u):this.errorCb(new Error(dt)))}processRequests(a){if(this.pendingRequest||0===this.queue.length)return;const{id:o,timestamp:u}=this.queue.shift();o&&this.success[o]||(this.anonId||this.fetchEventData(),ma(this.anonId)||(this.anonId=S2()),this.postEvent(u,{skuToken:this.skuToken},d=>{d?this.errorCb(d):o&&(this.success[o]=!0)},a))}},Ui=hr.postMapLoadEvent.bind(hr),kr=new class extends si{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(a,o,u,d){if(!R.API_URL||!R.SESSION_PATH)return;const m=bn(R.API_URL+R.SESSION_PATH);m.params.push(`sku=${o||""}`),m.params.push(`access_token=${d||R.ACCESS_TOKEN||""}`);const C={url:Zn(m),headers:{"Content-Type":"text/plain"}};this.pendingRequest=te(C,_=>{this.pendingRequest=null,u(_),this.saveEventData(),this.processRequests(d)})}getSessionAPI(a,o,u,d){this.skuToken=o,this.errorCb=d,R.SESSION_PATH&&R.API_URL&&(u||R.ACCESS_TOKEN?this.queueRequest({id:a,timestamp:Date.now()},u):this.errorCb(new Error(dt)))}processRequests(a){if(this.pendingRequest||0===this.queue.length)return;const{id:o,timestamp:u}=this.queue.shift();o&&this.success[o]||this.getSession(u,this.skuToken,d=>{d?this.errorCb(d):o&&(this.success[o]=!0)},a)}},ds=kr.getSessionAPI.bind(kr),Fa=new Set,Zr="mapbox-tiles";let va,zs,vr=500,Xl=50;function n1(){pe.caches&&!va&&(va=pe.caches.open(Zr))}function Zl(a){const o=a.indexOf("?");return o<0?a:a.slice(0,o)}let Jt=1/0;const al={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(al);class yi extends Error{constructor(o,u,d){401===u&&jt(d)&&(o+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),super(o),this.status=u,this.url=d}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const js=To()?()=>self.worker&&self.worker.referrer:()=>("blob:"===pe.location.protocol?pe.parent:pe).location.href,Ro=function(a,o){if(!(/^file:/.test(u=a.url)||/^file:/.test(js())&&!/^\w+:/.test(u))){if(pe.fetch&&pe.Request&&pe.AbortController&&pe.Request.prototype.hasOwnProperty("signal"))return function(d,m){const C=new pe.AbortController,_=new pe.Request(d.url,{method:d.method||"GET",body:d.body,credentials:d.credentials,headers:d.headers,referrer:js(),signal:C.signal});let w=!1,T=!1;const D=(P=_.url).indexOf("sku=")>0&&jt(P);var P;"json"===d.type&&_.headers.set("Accept","application/json");const V=(U,X,ee)=>{if(T)return;if(U&&"SecurityError"!==U.message&&Fr(U),X&&ee)return O(X);const se=Date.now();pe.fetch(_).then(xe=>{if(xe.ok){const Ie=D?xe.clone():null;return O(xe,Ie,se)}return m(new yi(xe.statusText,xe.status,d.url))}).catch(xe=>{20!==xe.code&&m(new Error(xe.message))})},O=(U,X,ee)=>{("arrayBuffer"===d.type?U.arrayBuffer():"json"===d.type?U.json():U.text()).then(se=>{T||(X&&ee&&function(xe,Ie,$e){if(n1(),!va)return;const Ke={status:Ie.status,statusText:Ie.statusText,headers:new pe.Headers};Ie.headers.forEach((st,Rt)=>Ke.headers.set(Rt,st));const rt=J1(Ie.headers.get("Cache-Control")||"");rt["no-store"]||(rt["max-age"]&&Ke.headers.set("Expires",new Date($e+1e3*rt["max-age"]).toUTCString()),new Date(Ke.headers.get("Expires")).getTime()-$e<42e4||function(st,Rt){if(void 0===zs)try{new Response(new ReadableStream),zs=!0}catch(Vt){zs=!1}zs?Rt(st.body):st.blob().then(Rt)}(Ie,st=>{const Rt=new pe.Response(st,Ke);n1(),va&&va.then(Vt=>Vt.put(Zl(xe.url),Rt)).catch(Vt=>Fr(Vt.message))}))}(_,X,ee),w=!0,m(null,se,U.headers.get("Cache-Control"),U.headers.get("Expires")))}).catch(se=>{T||m(new Error(se.message))})};return D?function(U,X){if(n1(),!va)return X(null);const ee=Zl(U.url);va.then(se=>{se.match(ee).then(xe=>{const Ie=function($e){if(!$e)return!1;const Ke=new Date($e.headers.get("Expires")||0),rt=J1($e.headers.get("Cache-Control")||"");return Ke>Date.now()&&!rt["no-cache"]}(xe);se.delete(ee),Ie&&se.put(ee,xe.clone()),X(null,xe,Ie)}).catch(X)}).catch(X)}(_,V):V(null,null),{cancel:()=>{T=!0,w||C.abort()}}}(a,o);if(To()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",a,o,void 0,!0)}var u;return function(d,m){const C=new pe.XMLHttpRequest;C.open(d.method||"GET",d.url,!0),"arrayBuffer"===d.type&&(C.responseType="arraybuffer");for(const _ in d.headers)C.setRequestHeader(_,d.headers[_]);return"json"===d.type&&(C.responseType="text",C.setRequestHeader("Accept","application/json")),C.withCredentials="include"===d.credentials,C.onerror=()=>{m(new Error(C.statusText))},C.onload=()=>{if((C.status>=200&&C.status<300||0===C.status)&&null!==C.response){let _=C.response;if("json"===d.type)try{_=JSON.parse(C.response)}catch(w){return m(w)}m(null,_,C.getResponseHeader("Cache-Control"),C.getResponseHeader("Expires"))}else m(new yi(C.statusText,C.status,d.url))},C.send(d.body),{cancel:()=>C.abort()}}(a,o)},V1=function(a,o){return Ro(Li(a,{type:"arrayBuffer"}),o)},Oa=function(a,o){return Ro(Li(a,{method:"POST"}),o)},te=function(a,o){return Ro(Li(a,{method:"GET"}),o)};function Z(a){const o=pe.document.createElement("a");return o.href=a,o.protocol===pe.document.location.protocol&&o.host===pe.document.location.host}const we="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let Ne,yt;Ne=[],yt=0;const Be=function(a,o){if(Y.supported&&(a.headers||(a.headers={}),a.headers.accept="image/webp,*/*"),yt>=R.MAX_PARALLEL_IMAGE_REQUESTS){const C={requestParameters:a,callback:o,cancelled:!1,cancel(){this.cancelled=!0}};return Ne.push(C),C}yt++;let u=!1;const d=()=>{if(!u)for(u=!0,yt--;Ne.length&&yt{d(),C?o(C):_&&(pe.createImageBitmap?function(D,P){const V=new pe.Blob([new Uint8Array(D)],{type:"image/png"});pe.createImageBitmap(V).then(O=>{P(null,O)}).catch(O=>{P(new Error(`Could not load image because of ${O.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(_,(D,P)=>o(D,P,w,T)):function(D,P){const V=new pe.Image,O=pe.URL;V.onload=()=>{P(null,V),O.revokeObjectURL(V.src),V.onload=null,pe.requestAnimationFrame(()=>{V.src=we})},V.onerror=()=>P(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const U=new pe.Blob([new Uint8Array(D)],{type:"image/png"});V.src=D.byteLength?O.createObjectURL(U):we}(_,(D,P)=>o(D,P,w,T)))});return{cancel:()=>{m.cancel(),d()}}};function Pt(a,o,u){u[a]&&-1!==u[a].indexOf(o)||(u[a]=u[a]||[],u[a].push(o))}function en(a,o,u){if(u&&u[a]){const d=u[a].indexOf(o);-1!==d&&u[a].splice(d,1)}}class Gt{constructor(o,u={}){Li(this,u),this.type=o}}class gn extends Gt{constructor(o,u={}){super("error",Li({error:o},u))}}class Bn{on(o,u){return this._listeners=this._listeners||{},Pt(o,u,this._listeners),this}off(o,u){return en(o,u,this._listeners),en(o,u,this._oneTimeListeners),this}once(o,u){return u?(this._oneTimeListeners=this._oneTimeListeners||{},Pt(o,u,this._oneTimeListeners),this):new Promise(d=>this.once(o,d))}fire(o,u){"string"==typeof o&&(o=new Gt(o,u||{}));const d=o.type;if(this.listens(d)){o.target=this;const m=this._listeners&&this._listeners[d]?this._listeners[d].slice():[];for(const w of m)w.call(this,o);const C=this._oneTimeListeners&&this._oneTimeListeners[d]?this._oneTimeListeners[d].slice():[];for(const w of C)en(d,w,this._oneTimeListeners),w.call(this,o);const _=this._eventedParent;_&&(Li(o,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),_.fire(o))}else o instanceof gn&&console.error(o.error);return this}listens(o){return!!(this._listeners&&this._listeners[o]&&this._listeners[o].length>0||this._oneTimeListeners&&this._oneTimeListeners[o]&&this._oneTimeListeners[o].length>0||this._eventedParent&&this._eventedParent.listens(o))}setEventedParent(o,u){return this._eventedParent=o,this._eventedParentData=u,this}}var it=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":{},"mapbox":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":{},"line":{},"line-center":{}},"default":"point","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"units":"factor of the original icon size","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":{},"width":{},"height":{},"both":{}},"default":"none","requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"units":"pixels","requires":["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","units":"ems","default":0,"requires":["text-field"],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["text-field",{"!":"text-variable-anchor"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"units":"degrees","requires":["text-field",{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","units":"ems","length":2,"default":[0,0],"requires":["text-field",{"!":"text-radial-offset"}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"geometry_type":{"type":"enum","values":{"Point":{},"LineString":{},"Polygon":{}}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":{},"exponential":{},"interval":{},"categorical":{}},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{},"lab":{},"hcl":{}},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":0.1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":true,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{"type":"resolvedImage","transition":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"cross-faded"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds"},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds"}},"property-type":{"data-driven":{"type":"property-type"},"cross-faded":{"type":"property-type"},"cross-faded-data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');class Ft{constructor(o,u,d,m){this.message=(o?`${o}: `:"")+d,m&&(this.identifier=m),null!=u&&u.__line__&&(this.line=u.__line__)}}function fs(a){const o=a.value;return o?[new Ft(a.key,o,"constants have been deprecated as of v8")]:[]}function ao(a,...o){for(const u of o)for(const d in u)a[d]=u[d];return a}function mi(a){return a instanceof Number||a instanceof String||a instanceof Boolean?a.valueOf():a}function xs(a){if(Array.isArray(a))return a.map(xs);if(a instanceof Object&&!(a instanceof Number||a instanceof String||a instanceof Boolean)){const o={};for(const u in a)o[u]=xs(a[u]);return o}return mi(a)}class ta extends Error{constructor(o,u){super(u),this.message=u,this.key=o}}class Fc{constructor(o,u=[]){this.parent=o,this.bindings={};for(const[d,m]of u)this.bindings[d]=m}concat(o){return new Fc(this,o)}get(o){if(this.bindings[o])return this.bindings[o];if(this.parent)return this.parent.get(o);throw new Error(`${o} not found in scope.`)}has(o){return!!this.bindings[o]||!!this.parent&&this.parent.has(o)}}const na={kind:"null"},an={kind:"number"},er={kind:"string"},$i={kind:"boolean"},ia={kind:"color"},yr={kind:"object"},Ei={kind:"value"},Yl={kind:"collator"},e2={kind:"formatted"},Oc={kind:"resolvedImage"};function i1(a,o){return{kind:"array",itemType:a,N:o}}function Sr(a){if("array"===a.kind){const o=Sr(a.itemType);return"number"==typeof a.N?`array<${o}, ${a.N}>`:"value"===a.itemType.kind?"array":`array<${o}>`}return a.kind}const R3=[na,an,er,$i,ia,e2,yr,i1(Ei),Oc];function ya(a,o){if("error"===o.kind)return null;if("array"===a.kind){if("array"===o.kind&&(0===o.N&&"value"===o.itemType.kind||!ya(a.itemType,o.itemType))&&("number"!=typeof a.N||a.N===o.N))return null}else{if(a.kind===o.kind)return null;if("value"===a.kind)for(const u of R3)if(!ya(u,o))return null}return`Expected ${Sr(a)} but found ${Sr(o)} instead.`}function ht(a,o){return o.some(u=>u.kind===a.kind)}function Nc(a,o){return o.some(u=>"null"===u?null===a:"array"===u?Array.isArray(a):"object"===u?a&&!Array.isArray(a)&&"object"==typeof a:u===typeof a)}function Kl(a){var o={exports:{}};return a(o,o.exports),o.exports}var Ql=Kl(function(a,o){var u={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function d(w){return(w=Math.round(w))<0?0:w>255?255:w}function m(w){return d("%"===w[w.length-1]?parseFloat(w)/100*255:parseInt(w))}function C(w){return(T="%"===w[w.length-1]?parseFloat(w)/100:parseFloat(w))<0?0:T>1?1:T;var T}function _(w,T,D){return D<0?D+=1:D>1&&(D-=1),6*D<1?w+(T-w)*D*6:2*D<1?T:3*D<2?w+(T-w)*(2/3-D)*6:w}try{o.parseCSSColor=function(w){var T,D=w.replace(/ /g,"").toLowerCase();if(D in u)return u[D].slice();if("#"===D[0])return 4===D.length?(T=parseInt(D.substr(1),16))>=0&&T<=4095?[(3840&T)>>4|(3840&T)>>8,240&T|(240&T)>>4,15&T|(15&T)<<4,1]:null:7===D.length&&(T=parseInt(D.substr(1),16))>=0&&T<=16777215?[(16711680&T)>>16,(65280&T)>>8,255&T,1]:null;var P=D.indexOf("("),V=D.indexOf(")");if(-1!==P&&V+1===D.length){var O=D.substr(0,P),U=D.substr(P+1,V-(P+1)).split(","),X=1;switch(O){case"rgba":if(4!==U.length)return null;X=C(U.pop());case"rgb":return 3!==U.length?null:[m(U[0]),m(U[1]),m(U[2]),X];case"hsla":if(4!==U.length)return null;X=C(U.pop());case"hsl":if(3!==U.length)return null;var ee=(parseFloat(U[0])%360+360)%360/360,se=C(U[1]),xe=C(U[2]),Ie=xe<=.5?xe*(se+1):xe+se-xe*se,$e=2*xe-Ie;return[d(255*_($e,Ie,ee+1/3)),d(255*_($e,Ie,ee)),d(255*_($e,Ie,ee-1/3)),X];default:return null}}return null}}catch(w){}});class nr{constructor(o,u,d,m=1){this.r=o,this.g=u,this.b=d,this.a=m}static parse(o){if(!o)return;if(o instanceof nr)return o;if("string"!=typeof o)return;const u=Ql.parseCSSColor(o);return u?new nr(u[0]/255*u[3],u[1]/255*u[3],u[2]/255*u[3],u[3]):void 0}toString(){const[o,u,d,m]=this.toArray();return`rgba(${Math.round(o)},${Math.round(u)},${Math.round(d)},${m})`}toArray(){const{r:o,g:u,b:d,a:m}=this;return 0===m?[0,0,0,0]:[255*o/m,255*u/m,255*d/m,m]}}nr.black=new nr(0,0,0,1),nr.white=new nr(1,1,1,1),nr.transparent=new nr(0,0,0,0),nr.red=new nr(1,0,0,1),nr.blue=new nr(0,0,1,1);class Xi{constructor(o,u,d){this.sensitivity=o?u?"variant":"case":u?"accent":"base",this.locale=d,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(o,u){return this.collator.compare(o,u)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class _h{constructor(o,u,d,m,C){this.text=o.normalize?o.normalize():o,this.image=u,this.scale=d,this.fontStack=m,this.textColor=C}}class wi{constructor(o){this.sections=o}static fromString(o){return new wi([new _h(o,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(o=>0!==o.text.length||o.image&&0!==o.image.name.length)}static factory(o){return o instanceof wi?o:wi.fromString(o)}toString(){return 0===this.sections.length?"":this.sections.map(o=>o.text).join("")}serialize(){const o=["format"];for(const u of this.sections){if(u.image){o.push(["image",u.image.name]);continue}o.push(u.text);const d={};u.fontStack&&(d["text-font"]=["literal",u.fontStack.split(",")]),u.scale&&(d["font-scale"]=u.scale),u.textColor&&(d["text-color"]=["rgba"].concat(u.textColor.toArray())),o.push(d)}return o}}class Tn{constructor(o){this.name=o.name,this.available=o.available}toString(){return this.name}static fromString(o){return o?new Tn({name:o,available:!1}):null}serialize(){return["image",this.name]}}function ra(a,o,u,d){return"number"==typeof a&&a>=0&&a<=255&&"number"==typeof o&&o>=0&&o<=255&&"number"==typeof u&&u>=0&&u<=255?void 0===d||"number"==typeof d&&d>=0&&d<=1?null:`Invalid rgba value [${[a,o,u,d].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof d?[a,o,u,d]:[a,o,u]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function lo(a){if(null===a||"string"==typeof a||"boolean"==typeof a||"number"==typeof a||a instanceof nr||a instanceof Xi||a instanceof wi||a instanceof Tn)return!0;if(Array.isArray(a)){for(const o of a)if(!lo(o))return!1;return!0}if("object"==typeof a){for(const o in a)if(!lo(a[o]))return!1;return!0}return!1}function Ur(a){if(null===a)return na;if("string"==typeof a)return er;if("boolean"==typeof a)return $i;if("number"==typeof a)return an;if(a instanceof nr)return ia;if(a instanceof Xi)return Yl;if(a instanceof wi)return e2;if(a instanceof Tn)return Oc;if(Array.isArray(a)){const o=a.length;let u;for(const d of a){const m=Ur(d);if(u){if(u===m)continue;u=Ei;break}u=m}return i1(u||Ei,o)}return yr}function F1(a){const o=typeof a;return null===a?"":"string"===o||"number"===o||"boolean"===o?String(a):a instanceof nr||a instanceof wi||a instanceof Tn?a.toString():JSON.stringify(a)}class Gs{constructor(o,u){this.type=o,this.value=u}static parse(o,u){if(2!==o.length)return u.error(`'literal' expression requires exactly one argument, but found ${o.length-1} instead.`);if(!lo(o[1]))return u.error("invalid value");const d=o[1];let m=Ur(d);const C=u.expectedType;return"array"!==m.kind||0!==m.N||!C||"array"!==C.kind||"number"==typeof C.N&&0!==C.N||(m=C),new Gs(m,d)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof nr?["rgba"].concat(this.value.toArray()):this.value instanceof wi?this.value.serialize():this.value}}class co{constructor(o){this.name="ExpressionEvaluationError",this.message=o}toJSON(){return this.message}}const sa={string:er,number:an,boolean:$i,object:yr};class Sn{constructor(o,u){this.type=o,this.args=u}static parse(o,u){if(o.length<2)return u.error("Expected at least one argument.");let d,m=1;const C=o[0];if("array"===C){let w,T;if(o.length>2){const D=o[1];if("string"!=typeof D||!(D in sa)||"object"===D)return u.error('The item type argument of "array" must be one of string, number, boolean',1);w=sa[D],m++}else w=Ei;if(o.length>3){if(null!==o[2]&&("number"!=typeof o[2]||o[2]<0||o[2]!==Math.floor(o[2])))return u.error('The length argument to "array" must be a positive integer literal',2);T=o[2],m++}d=i1(w,T)}else d=sa[C];const _=[];for(;mo.outputDefined())}serialize(){const o=this.type,u=[o.kind];if("array"===o.kind){const d=o.itemType;if("string"===d.kind||"number"===d.kind||"boolean"===d.kind){u.push(d.kind);const m=o.N;("number"==typeof m||this.args.length>1)&&u.push(m)}}return u.concat(this.args.map(d=>d.serialize()))}}class Mi{constructor(o){this.type=e2,this.sections=o}static parse(o,u){if(o.length<2)return u.error("Expected at least one argument.");const d=o[1];if(!Array.isArray(d)&&"object"==typeof d)return u.error("First argument must be an image or text section.");const m=[];let C=!1;for(let _=1;_<=o.length-1;++_){const w=o[_];if(C&&"object"==typeof w&&!Array.isArray(w)){C=!1;let T=null;if(w["font-scale"]&&(T=u.parse(w["font-scale"],1,an),!T))return null;let D=null;if(w["text-font"]&&(D=u.parse(w["text-font"],1,i1(er)),!D))return null;let P=null;if(w["text-color"]&&(P=u.parse(w["text-color"],1,ia),!P))return null;const V=m[m.length-1];V.scale=T,V.font=D,V.textColor=P}else{const T=u.parse(o[_],1,Ei);if(!T)return null;const D=T.type.kind;if("string"!==D&&"value"!==D&&"null"!==D&&"resolvedImage"!==D)return u.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");C=!0,m.push({content:T,scale:null,font:null,textColor:null})}}return new Mi(m)}evaluate(o){return new wi(this.sections.map(u=>{const d=u.content.evaluate(o);return Ur(d)===Oc?new _h("",d,null,null,null):new _h(F1(d),null,u.scale?u.scale.evaluate(o):null,u.font?u.font.evaluate(o).join(","):null,u.textColor?u.textColor.evaluate(o):null)}))}eachChild(o){for(const u of this.sections)o(u.content),u.scale&&o(u.scale),u.font&&o(u.font),u.textColor&&o(u.textColor)}outputDefined(){return!1}serialize(){const o=["format"];for(const u of this.sections){o.push(u.content.serialize());const d={};u.scale&&(d["font-scale"]=u.scale.serialize()),u.font&&(d["text-font"]=u.font.serialize()),u.textColor&&(d["text-color"]=u.textColor.serialize()),o.push(d)}return o}}class Ir{constructor(o){this.type=Oc,this.input=o}static parse(o,u){if(2!==o.length)return u.error("Expected two arguments.");const d=u.parse(o[1],1,er);return d?new Ir(d):u.error("No image name provided.")}evaluate(o){const u=this.input.evaluate(o),d=Tn.fromString(u);return d&&o.availableImages&&(d.available=o.availableImages.indexOf(u)>-1),d}eachChild(o){o(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Na={"to-boolean":$i,"to-color":ia,"to-number":an,"to-string":er};class Ho{constructor(o,u){this.type=o,this.args=u}static parse(o,u){if(o.length<2)return u.error("Expected at least one argument.");const d=o[0];if(("to-boolean"===d||"to-string"===d)&&2!==o.length)return u.error("Expected one argument.");const m=Na[d],C=[];for(let _=1;_4?`Invalid rbga value ${JSON.stringify(u)}: expected an array containing either three or four numeric values.`:ra(u[0],u[1],u[2],u[3]),!d))return new nr(u[0]/255,u[1]/255,u[2]/255,u[3])}throw new co(d||`Could not parse color from value '${"string"==typeof u?u:String(JSON.stringify(u))}'`)}if("number"===this.type.kind){let u=null;for(const d of this.args){if(u=d.evaluate(o),null===u)return 0;const m=Number(u);if(!isNaN(m))return m}throw new co(`Could not convert ${JSON.stringify(u)} to number.`)}return"formatted"===this.type.kind?wi.fromString(F1(this.args[0].evaluate(o))):"resolvedImage"===this.type.kind?Tn.fromString(F1(this.args[0].evaluate(o))):F1(this.args[0].evaluate(o))}eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}serialize(){if("formatted"===this.type.kind)return new Mi([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Ir(this.args[0]).serialize();const o=[`to-${this.type.kind}`];return this.eachChild(u=>{o.push(u.serialize())}),o}}const Ws=["Unknown","Point","LineString","Polygon"];class ll{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Ws[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const o=this.featureDistanceData.center,u=this.featureDistanceData.scale,{x:d,y:m}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(d*u-o[0])+this.featureDistanceData.bearing[1]*(m*u-o[1])}return 0}parseColor(o){let u=this._parseColorCache[o];return u||(u=this._parseColorCache[o]=nr.parse(o)),u}}class _r{constructor(o,u,d,m){this.name=o,this.type=u,this._evaluate=d,this.args=m}evaluate(o){return this._evaluate(o,this.args)}eachChild(o){this.args.forEach(o)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(o=>o.serialize()))}static parse(o,u){const d=o[0],m=_r.definitions[d];if(!m)return u.error(`Unknown expression "${d}". If you wanted a literal array, use ["literal", [...]].`,0);const C=Array.isArray(m)?m[0]:m.type,_=Array.isArray(m)?[[m[1],m[2]]]:m.overloads,w=_.filter(([D])=>!Array.isArray(D)||D.length===o.length-1);let T=null;for(const[D,P]of w){T=new _a(u.registry,u.path,null,u.scope);const V=[];let O=!1;for(let U=1;U{return O=V,Array.isArray(O)?`(${O.map(Sr).join(", ")})`:`(${Sr(O.type)}...)`;var O}).join(" | "),P=[];for(let V=1;V=o[2]||a[1]<=o[1]||a[3]>=o[3])}function Jl(a,o){const u=(180+a[0])/360,d=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a[1]*Math.PI/360)))/360,m=Math.pow(2,o.z);return[Math.round(u*m*Ra),Math.round(d*m*Ra)]}function J4(a,o,u){const d=a[0]-o[0],m=a[1]-o[1],C=a[0]-u[0],_=a[1]-u[1];return d*_-C*m==0&&d*C<=0&&m*_<=0}function ul(a,o){let u=!1;for(let _=0,w=o.length;_(d=a)[1]!=(C=T[D+1])[1]>d[1]&&d[0]<(C[0]-m[0])*(d[1]-m[1])/(C[1]-m[1])+m[0]&&(u=!u)}}var d,m,C;return u}function oa(a,o){for(let u=0;u0&&w<0||_<0&&w>0}function Rc(a,o,u){for(const D of u)for(let P=0;Pu[2]){const m=.5*d;let C=a[0]-u[0]>m?-d:u[0]-a[0]>m?d:0;0===C&&(C=a[0]-u[2]>m?-d:u[2]-a[0]>m?d:0),a[0]+=C}zi(o,a)}function eu(a,o,u,d){const m=Math.pow(2,d.z)*Ra,C=[d.x*Ra,d.y*Ra],_=[];for(const w of a)for(const T of w){const D=[T.x+C[0],T.y+C[1]];Hc(D,o,u,m),_.push(D)}return _}function Bc(a,o,u,d){const m=Math.pow(2,d.z)*Ra,C=[d.x*Ra,d.y*Ra],_=[];for(const T of a){const D=[];for(const P of T){const V=[P.x+C[0],P.y+C[1]];zi(o,V),D.push(V)}_.push(D)}if(o[2]-o[0]<=m/2){(w=o)[0]=w[1]=1/0,w[2]=w[3]=-1/0;for(const T of _)for(const D of T)Hc(D,o,u,m)}var w;return _}class t2{constructor(o,u){this.type=$i,this.geojson=o,this.geometries=u}static parse(o,u){if(2!==o.length)return u.error(`'within' expression requires exactly one argument, but found ${o.length-1} instead.`);if(lo(o[1])){const d=o[1];if("FeatureCollection"===d.type)for(let m=0;m{o&&!s1(u)&&(o=!1)}),o}function Ns(a){if(a instanceof _r&&"feature-state"===a.name)return!1;let o=!0;return a.eachChild(u=>{o&&!Ns(u)&&(o=!1)}),o}function H3(a,o){if(a instanceof _r&&o.indexOf(a.name)>=0)return!1;let u=!0;return a.eachChild(d=>{u&&!H3(d,o)&&(u=!1)}),u}class Ha{constructor(o,u){this.type=u.type,this.name=o,this.boundExpression=u}static parse(o,u){if(2!==o.length||"string"!=typeof o[1])return u.error("'var' expression requires exactly one string literal argument.");const d=o[1];return u.scope.has(d)?new Ha(d,u.scope.get(d)):u.error(`Unknown variable "${d}". Make sure "${d}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(o){return this.boundExpression.evaluate(o)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class _a{constructor(o,u=[],d,m=new Fc,C=[]){this.registry=o,this.path=u,this.key=u.map(_=>`[${_}]`).join(""),this.scope=m,this.errors=C,this.expectedType=d}parse(o,u,d,m,C={}){return u?this.concat(u,d,m)._parse(o,C):this._parse(o,C)}_parse(o,u){function d(m,C,_){return"assert"===_?new Sn(C,[m]):"coerce"===_?new Ho(C,[m]):m}if(null!==o&&"string"!=typeof o&&"boolean"!=typeof o&&"number"!=typeof o||(o=["literal",o]),Array.isArray(o)){if(0===o.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const m=o[0];if("string"!=typeof m)return this.error(`Expression name must be a string, but found ${typeof m} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const C=this.registry[m];if(C){let _=C.parse(o,this);if(!_)return null;if(this.expectedType){const w=this.expectedType,T=_.type;if("string"!==w.kind&&"number"!==w.kind&&"boolean"!==w.kind&&"object"!==w.kind&&"array"!==w.kind||"value"!==T.kind)if("color"!==w.kind&&"formatted"!==w.kind&&"resolvedImage"!==w.kind||"value"!==T.kind&&"string"!==T.kind){if(this.checkSubtype(w,T))return null}else _=d(_,w,u.typeAnnotation||"coerce");else _=d(_,w,u.typeAnnotation||"assert")}if(!(_ instanceof Gs)&&"resolvedImage"!==_.type.kind&&Uc(_)){const w=new ll;try{_=new Gs(_.type,_.evaluate(w))}catch(T){return this.error(T.message),null}}return _}return this.error(`Unknown expression "${m}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===o?"'undefined' value invalid. Use null instead.":"object"==typeof o?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof o} instead.`)}concat(o,u,d){const m="number"==typeof o?this.path.concat(o):this.path,C=d?this.scope.concat(d):this.scope;return new _a(this.registry,m,u||null,C,this.errors)}error(o,...u){const d=`${this.key}${u.map(m=>`[${m}]`).join("")}`;this.errors.push(new ta(d,o))}checkSubtype(o,u){const d=ya(o,u);return d&&this.error(d),d}}function Uc(a){if(a instanceof Ha)return Uc(a.boundExpression);if(a instanceof _r&&"error"===a.name||a instanceof L2||a instanceof t2)return!1;const o=a instanceof Ho||a instanceof Sn;let u=!0;return a.eachChild(d=>{u=o?u&&Uc(d):u&&d instanceof Gs}),!!u&&s1(a)&&H3(a,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function hl(a,o){const u=a.length-1;let d,m,C=0,_=u,w=0;for(;C<=_;)if(w=Math.floor((C+_)/2),d=a[w],m=a[w+1],d<=o){if(w===u||oo))throw new co("Input is not a number.");_=w-1}return 0}class dl{constructor(o,u,d){this.type=o,this.input=u,this.labels=[],this.outputs=[];for(const[m,C]of d)this.labels.push(m),this.outputs.push(C)}static parse(o,u){if(o.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if((o.length-1)%2!=0)return u.error("Expected an even number of arguments.");const d=u.parse(o[1],1,an);if(!d)return null;const m=[];let C=null;u.expectedType&&"value"!==u.expectedType.kind&&(C=u.expectedType);for(let _=1;_=w)return u.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',D);const V=u.parse(T,P,C);if(!V)return null;C=C||V.type,m.push([w,V])}return new dl(C,d,m)}evaluate(o){const u=this.labels,d=this.outputs;if(1===u.length)return d[0].evaluate(o);const m=this.input.evaluate(o);if(m<=u[0])return d[0].evaluate(o);const C=u.length;return m>=u[C-1]?d[C-1].evaluate(o):d[hl(u,m)].evaluate(o)}eachChild(o){o(this.input);for(const u of this.outputs)o(u)}outputDefined(){return this.outputs.every(o=>o.outputDefined())}serialize(){const o=["step",this.input.serialize()];for(let u=0;u0&&o.push(this.labels[u]),o.push(this.outputs[u].serialize());return o}}function Fi(a,o,u){return a*(1-u)+o*u}var tu=Object.freeze({__proto__:null,number:Fi,color:function(a,o,u){return new nr(Fi(a.r,o.r,u),Fi(a.g,o.g,u),Fi(a.b,o.b,u),Fi(a.a,o.a,u))},array:function(a,o,u){return a.map((d,m)=>Fi(d,o[m],u))}});const bh=4/29,wh=6/29,u5=3*wh*wh,pp=Math.PI/180,mp=180/Math.PI;function Mh(a){return a>.008856451679035631?Math.pow(a,1/3):a/u5+bh}function Sh(a){return a>wh?a*a*a:u5*(a-bh)}function Th(a){return 255*(a<=.0031308?12.92*a:1.055*Math.pow(a,1/2.4)-.055)}function nu(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function h5(a){const o=nu(a.r),u=nu(a.g),d=nu(a.b),m=Mh((.4124564*o+.3575761*u+.1804375*d)/.95047),C=Mh((.2126729*o+.7151522*u+.072175*d)/1);return{l:116*C-16,a:500*(m-C),b:200*(C-Mh((.0193339*o+.119192*u+.9503041*d)/1.08883)),alpha:a.a}}function d5(a){let o=(a.l+16)/116,u=isNaN(a.a)?o:o+a.a/500,d=isNaN(a.b)?o:o-a.b/200;return o=1*Sh(o),u=.95047*Sh(u),d=1.08883*Sh(d),new nr(Th(3.2404542*u-1.5371385*o-.4985314*d),Th(-.969266*u+1.8760108*o+.041556*d),Th(.0556434*u-.2040259*o+1.0572252*d),a.alpha)}function gp(a,o,u){const d=o-a;return a+u*(d>180||d<-180?d-360*Math.round(d/360):d)}const iu={forward:h5,reverse:d5,interpolate:function(a,o,u){return{l:Fi(a.l,o.l,u),a:Fi(a.a,o.a,u),b:Fi(a.b,o.b,u),alpha:Fi(a.alpha,o.alpha,u)}}},ru={forward:function(a){const{l:o,a:u,b:d}=h5(a),m=Math.atan2(d,u)*mp;return{h:m<0?m+360:m,c:Math.sqrt(u*u+d*d),l:o,alpha:a.a}},reverse:function(a){const o=a.h*pp,u=a.c;return d5({l:a.l,a:Math.cos(o)*u,b:Math.sin(o)*u,alpha:a.alpha})},interpolate:function(a,o,u){return{h:gp(a.h,o.h,u),c:Fi(a.c,o.c,u),l:Fi(a.l,o.l,u),alpha:Fi(a.alpha,o.alpha,u)}}};var f5=Object.freeze({__proto__:null,lab:iu,hcl:ru});class aa{constructor(o,u,d,m,C){this.type=o,this.operator=u,this.interpolation=d,this.input=m,this.labels=[],this.outputs=[];for(const[_,w]of C)this.labels.push(_),this.outputs.push(w)}static interpolationFactor(o,u,d,m){let C=0;if("exponential"===o.name)C=$c(u,o.base,d,m);else if("linear"===o.name)C=$c(u,1,d,m);else if("cubic-bezier"===o.name){const _=o.controlPoints;C=new Fe(_[0],_[1],_[2],_[3]).solve($c(u,1,d,m))}return C}static parse(o,u){let[d,m,C,..._]=o;if(!Array.isArray(m)||0===m.length)return u.error("Expected an interpolation type expression.",1);if("linear"===m[0])m={name:"linear"};else if("exponential"===m[0]){const D=m[1];if("number"!=typeof D)return u.error("Exponential interpolation requires a numeric base.",1,1);m={name:"exponential",base:D}}else{if("cubic-bezier"!==m[0])return u.error(`Unknown interpolation type ${String(m[0])}`,1,0);{const D=m.slice(1);if(4!==D.length||D.some(P=>"number"!=typeof P||P<0||P>1))return u.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);m={name:"cubic-bezier",controlPoints:D}}}if(o.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if((o.length-1)%2!=0)return u.error("Expected an even number of arguments.");if(C=u.parse(C,2,an),!C)return null;const w=[];let T=null;"interpolate-hcl"===d||"interpolate-lab"===d?T=ia:u.expectedType&&"value"!==u.expectedType.kind&&(T=u.expectedType);for(let D=0;D<_.length;D+=2){const P=_[D],V=_[D+1],O=D+3,U=D+4;if("number"!=typeof P)return u.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',O);if(w.length&&w[w.length-1][0]>=P)return u.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',O);const X=u.parse(V,U,T);if(!X)return null;T=T||X.type,w.push([P,X])}return"number"===T.kind||"color"===T.kind||"array"===T.kind&&"number"===T.itemType.kind&&"number"==typeof T.N?new aa(T,d,m,C,w):u.error(`Type ${Sr(T)} is not interpolatable.`)}evaluate(o){const u=this.labels,d=this.outputs;if(1===u.length)return d[0].evaluate(o);const m=this.input.evaluate(o);if(m<=u[0])return d[0].evaluate(o);const C=u.length;if(m>=u[C-1])return d[C-1].evaluate(o);const _=hl(u,m),w=aa.interpolationFactor(this.interpolation,m,u[_],u[_+1]),T=d[_].evaluate(o),D=d[_+1].evaluate(o);return"interpolate"===this.operator?tu[this.type.kind.toLowerCase()](T,D,w):"interpolate-hcl"===this.operator?ru.reverse(ru.interpolate(ru.forward(T),ru.forward(D),w)):iu.reverse(iu.interpolate(iu.forward(T),iu.forward(D),w))}eachChild(o){o(this.input);for(const u of this.outputs)o(u)}outputDefined(){return this.outputs.every(o=>o.outputDefined())}serialize(){let o;o="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const u=[this.operator,o,this.input.serialize()];for(let d=0;dya(m,w.type));return new jc(_?Ei:d,C)}evaluate(o){let u,d=null,m=0;for(const C of this.args){if(m++,d=C.evaluate(o),d&&d instanceof Tn&&!d.available&&(u||(u=d),d=null,m===this.args.length))return u;if(null!==d)break}return d}eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}serialize(){const o=["coalesce"];return this.eachChild(u=>{o.push(u.serialize())}),o}}class Lh{constructor(o,u){this.type=u.type,this.bindings=[].concat(o),this.result=u}evaluate(o){return this.result.evaluate(o)}eachChild(o){for(const u of this.bindings)o(u[1]);o(this.result)}static parse(o,u){if(o.length<4)return u.error(`Expected at least 3 arguments, but found ${o.length-1} instead.`);const d=[];for(let C=1;C=d.length)throw new co(`Array index out of bounds: ${u} > ${d.length-1}.`);if(u!==Math.floor(u))throw new co(`Array index must be an integer, but found ${u} instead.`);return d[u]}eachChild(o){o(this.index),o(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class E2{constructor(o,u){this.type=$i,this.needle=o,this.haystack=u}static parse(o,u){if(3!==o.length)return u.error(`Expected 2 arguments, but found ${o.length-1} instead.`);const d=u.parse(o[1],1,Ei),m=u.parse(o[2],2,Ei);return d&&m?ht(d.type,[$i,er,an,na,Ei])?new E2(d,m):u.error(`Expected first argument to be of type boolean, string, number or null, but found ${Sr(d.type)} instead`):null}evaluate(o){const u=this.needle.evaluate(o),d=this.haystack.evaluate(o);if(!d)return!1;if(!Nc(u,["boolean","string","number","null"]))throw new co(`Expected first argument to be of type boolean, string, number or null, but found ${Sr(Ur(u))} instead.`);if(!Nc(d,["string","array"]))throw new co(`Expected second argument to be of type array or string, but found ${Sr(Ur(d))} instead.`);return d.indexOf(u)>=0}eachChild(o){o(this.needle),o(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class o1{constructor(o,u,d){this.type=an,this.needle=o,this.haystack=u,this.fromIndex=d}static parse(o,u){if(o.length<=2||o.length>=5)return u.error(`Expected 3 or 4 arguments, but found ${o.length-1} instead.`);const d=u.parse(o[1],1,Ei),m=u.parse(o[2],2,Ei);if(!d||!m)return null;if(!ht(d.type,[$i,er,an,na,Ei]))return u.error(`Expected first argument to be of type boolean, string, number or null, but found ${Sr(d.type)} instead`);if(4===o.length){const C=u.parse(o[3],3,an);return C?new o1(d,m,C):null}return new o1(d,m)}evaluate(o){const u=this.needle.evaluate(o),d=this.haystack.evaluate(o);if(!Nc(u,["boolean","string","number","null"]))throw new co(`Expected first argument to be of type boolean, string, number or null, but found ${Sr(Ur(u))} instead.`);if(!Nc(d,["string","array"]))throw new co(`Expected second argument to be of type array or string, but found ${Sr(Ur(d))} instead.`);if(this.fromIndex){const m=this.fromIndex.evaluate(o);return d.indexOf(u,m)}return d.indexOf(u)}eachChild(o){o(this.needle),o(this.haystack),this.fromIndex&&o(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const o=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),o]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class kn{constructor(o,u,d,m,C,_){this.inputType=o,this.type=u,this.input=d,this.cases=m,this.outputs=C,this.otherwise=_}static parse(o,u){if(o.length<5)return u.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if(o.length%2!=1)return u.error("Expected an even number of arguments.");let d,m;u.expectedType&&"value"!==u.expectedType.kind&&(m=u.expectedType);const C={},_=[];for(let D=2;DNumber.MAX_SAFE_INTEGER)return O.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof X&&Math.floor(X)!==X)return O.error("Numeric branch labels must be integer values.");if(d){if(O.checkSubtype(d,Ur(X)))return null}else d=Ur(X);if(void 0!==C[String(X)])return O.error("Branch labels must be unique.");C[String(X)]=_.length}const U=u.parse(V,D,m);if(!U)return null;m=m||U.type,_.push(U)}const w=u.parse(o[1],1,Ei);if(!w)return null;const T=u.parse(o[o.length-1],o.length-1,m);return T?"value"!==w.type.kind&&u.concat(1).checkSubtype(d,w.type)?null:new kn(d,m,w,C,_,T):null}evaluate(o){const u=this.input.evaluate(o);return(Ur(u)===this.inputType&&this.outputs[this.cases[u]]||this.otherwise).evaluate(o)}eachChild(o){o(this.input),this.outputs.forEach(o),o(this.otherwise)}outputDefined(){return this.outputs.every(o=>o.outputDefined())&&this.otherwise.outputDefined()}serialize(){const o=["match",this.input.serialize()],u=Object.keys(this.cases).sort(),d=[],m={};for(const _ of u){const w=m[this.cases[_]];void 0===w?(m[this.cases[_]]=d.length,d.push([this.cases[_],[_]])):d[w][1].push(_)}const C=_=>"number"===this.inputType.kind?Number(_):_;for(const[_,w]of d)o.push(1===w.length?C(w[0]):w.map(C)),o.push(this.outputs[_].serialize());return o.push(this.otherwise.serialize()),o}}class D2{constructor(o,u,d){this.type=o,this.branches=u,this.otherwise=d}static parse(o,u){if(o.length<4)return u.error(`Expected at least 3 arguments, but found only ${o.length-1}.`);if(o.length%2!=0)return u.error("Expected an odd number of arguments.");let d;u.expectedType&&"value"!==u.expectedType.kind&&(d=u.expectedType);const m=[];for(let _=1;_u.outputDefined())&&this.otherwise.outputDefined()}serialize(){const o=["case"];return this.eachChild(u=>{o.push(u.serialize())}),o}}class U3{constructor(o,u,d,m){this.type=o,this.input=u,this.beginIndex=d,this.endIndex=m}static parse(o,u){if(o.length<=2||o.length>=5)return u.error(`Expected 3 or 4 arguments, but found ${o.length-1} instead.`);const d=u.parse(o[1],1,Ei),m=u.parse(o[2],2,an);if(!d||!m)return null;if(!ht(d.type,[i1(Ei),er,Ei]))return u.error(`Expected first argument to be of type array or string, but found ${Sr(d.type)} instead`);if(4===o.length){const C=u.parse(o[3],3,an);return C?new U3(d.type,d,m,C):null}return new U3(d.type,d,m)}evaluate(o){const u=this.input.evaluate(o),d=this.beginIndex.evaluate(o);if(!Nc(u,["string","array"]))throw new co(`Expected first argument to be of type array or string, but found ${Sr(Ur(u))} instead.`);if(this.endIndex){const m=this.endIndex.evaluate(o);return u.slice(d,m)}return u.slice(d)}eachChild(o){o(this.input),o(this.beginIndex),this.endIndex&&o(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const o=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),o]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function td(a,o){return"=="===a||"!="===a?"boolean"===o.kind||"string"===o.kind||"number"===o.kind||"null"===o.kind||"value"===o.kind:"string"===o.kind||"number"===o.kind||"value"===o.kind}function $3(a,o,u,d){return 0===d.compare(o,u)}function A2(a,o,u){const d="=="!==a&&"!="!==a;return class eG{constructor(C,_,w){this.type=$i,this.lhs=C,this.rhs=_,this.collator=w,this.hasUntypedArgument="value"===C.type.kind||"value"===_.type.kind}static parse(C,_){if(3!==C.length&&4!==C.length)return _.error("Expected two or three arguments.");const w=C[0];let T=_.parse(C[1],1,Ei);if(!T)return null;if(!td(w,T.type))return _.concat(1).error(`"${w}" comparisons are not supported for type '${Sr(T.type)}'.`);let D=_.parse(C[2],2,Ei);if(!D)return null;if(!td(w,D.type))return _.concat(2).error(`"${w}" comparisons are not supported for type '${Sr(D.type)}'.`);if(T.type.kind!==D.type.kind&&"value"!==T.type.kind&&"value"!==D.type.kind)return _.error(`Cannot compare types '${Sr(T.type)}' and '${Sr(D.type)}'.`);d&&("value"===T.type.kind&&"value"!==D.type.kind?T=new Sn(D.type,[T]):"value"!==T.type.kind&&"value"===D.type.kind&&(D=new Sn(T.type,[D])));let P=null;if(4===C.length){if("string"!==T.type.kind&&"string"!==D.type.kind&&"value"!==T.type.kind&&"value"!==D.type.kind)return _.error("Cannot use collator to compare non-string types.");if(P=_.parse(C[3],3,Yl),!P)return null}return new eG(T,D,P)}evaluate(C){const _=this.lhs.evaluate(C),w=this.rhs.evaluate(C);if(d&&this.hasUntypedArgument){const T=Ur(_),D=Ur(w);if(T.kind!==D.kind||"string"!==T.kind&&"number"!==T.kind)throw new co(`Expected arguments for "${a}" to be (string, string) or (number, number), but found (${T.kind}, ${D.kind}) instead.`)}if(this.collator&&!d&&this.hasUntypedArgument){const T=Ur(_),D=Ur(w);if("string"!==T.kind||"string"!==D.kind)return o(C,_,w)}return this.collator?u(C,_,w,this.collator.evaluate(C)):o(C,_,w)}eachChild(C){C(this.lhs),C(this.rhs),this.collator&&C(this.collator)}outputDefined(){return!0}serialize(){const C=[a];return this.eachChild(_=>{C.push(_.serialize())}),C}}}const nd=A2("==",function(a,o,u){return o===u},$3),j3=A2("!=",function(a,o,u){return o!==u},function(a,o,u,d){return!$3(0,o,u,d)}),Eh=A2("<",function(a,o,u){return o",function(a,o,u){return o>u},function(a,o,u,d){return d.compare(o,u)>0}),su=A2("<=",function(a,o,u){return o<=u},function(a,o,u,d){return d.compare(o,u)<=0}),Dh=A2(">=",function(a,o,u){return o>=u},function(a,o,u,d){return d.compare(o,u)>=0});class Gc{constructor(o,u,d,m,C){this.type=er,this.number=o,this.locale=u,this.currency=d,this.minFractionDigits=m,this.maxFractionDigits=C}static parse(o,u){if(3!==o.length)return u.error("Expected two arguments.");const d=u.parse(o[1],1,an);if(!d)return null;const m=o[2];if("object"!=typeof m||Array.isArray(m))return u.error("NumberFormat options argument must be an object.");let C=null;if(m.locale&&(C=u.parse(m.locale,1,er),!C))return null;let _=null;if(m.currency&&(_=u.parse(m.currency,1,er),!_))return null;let w=null;if(m["min-fraction-digits"]&&(w=u.parse(m["min-fraction-digits"],1,an),!w))return null;let T=null;return m["max-fraction-digits"]&&(T=u.parse(m["max-fraction-digits"],1,an),!T)?null:new Gc(d,C,_,w,T)}evaluate(o){return new Intl.NumberFormat(this.locale?this.locale.evaluate(o):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(o):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(o):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(o):void 0}).format(this.number.evaluate(o))}eachChild(o){o(this.number),this.locale&&o(this.locale),this.currency&&o(this.currency),this.minFractionDigits&&o(this.minFractionDigits),this.maxFractionDigits&&o(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const o={};return this.locale&&(o.locale=this.locale.serialize()),this.currency&&(o.currency=this.currency.serialize()),this.minFractionDigits&&(o["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(o["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),o]}}class ou{constructor(o){this.type=an,this.input=o}static parse(o,u){if(2!==o.length)return u.error(`Expected 1 argument, but found ${o.length-1} instead.`);const d=u.parse(o[1],1);return d?"array"!==d.type.kind&&"string"!==d.type.kind&&"value"!==d.type.kind?u.error(`Expected argument of type string or array, but found ${Sr(d.type)} instead.`):new ou(d):null}evaluate(o){const u=this.input.evaluate(o);if("string"==typeof u||Array.isArray(u))return u.length;throw new co(`Expected value to be of type string or array, but found ${Sr(Ur(u))} instead.`)}eachChild(o){o(this.input)}outputDefined(){return!1}serialize(){const o=["length"];return this.eachChild(u=>{o.push(u.serialize())}),o}}const Ua={"==":nd,"!=":j3,">":Ba,"<":Eh,">=":Dh,"<=":su,array:Sn,at:ed,boolean:Sn,case:D2,coalesce:jc,collator:L2,format:Mi,image:Ir,in:E2,"index-of":o1,interpolate:aa,"interpolate-hcl":aa,"interpolate-lab":aa,length:ou,let:Lh,literal:Gs,match:kn,number:Sn,"number-format":Gc,object:Sn,slice:U3,step:dl,string:Sn,"to-boolean":Ho,"to-color":Ho,"to-number":Ho,"to-string":Ho,var:Ha,within:t2};function id(a,[o,u,d,m]){o=o.evaluate(a),u=u.evaluate(a),d=d.evaluate(a);const C=m?m.evaluate(a):1,_=ra(o,u,d,C);if(_)throw new co(_);return new nr(o/255*C,u/255*C,d/255*C,C)}function as(a,o){return a in o}function au(a,o){const u=o[a];return void 0===u?null:u}function k2(a){return{type:a}}function rd(a){return{result:"success",value:a}}function $r(a){return{result:"error",value:a}}function Wc(a){return"data-driven"===a["property-type"]||"cross-faded-data-driven"===a["property-type"]}function p5(a){return!!a.expression&&a.expression.parameters.indexOf("zoom")>-1}function qc(a){return!!a.expression&&a.expression.interpolated}function Di(a){return a instanceof Number?"number":a instanceof String?"string":a instanceof Boolean?"boolean":Array.isArray(a)?"array":null===a?"null":typeof a}function lu(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function Xc(a){return a}function n2(a,o){const u="color"===o.type,d=a.stops&&"object"==typeof a.stops[0][0],m=d||!(d||void 0!==a.property),C=a.type||(qc(o)?"exponential":"interval");if(u&&((a=ao({},a)).stops&&(a.stops=a.stops.map(D=>[D[0],nr.parse(D[1])])),a.default=nr.parse(a.default?a.default:o.default)),a.colorSpace&&"rgb"!==a.colorSpace&&!f5[a.colorSpace])throw new Error(`Unknown color space: ${a.colorSpace}`);let _,w,T;if("exponential"===C)_=sd;else if("interval"===C)_=Ah;else if("categorical"===C){_=G3,w=Object.create(null);for(const D of a.stops)w[D[0]]=D[1];T=typeof a.stops[0][0]}else{if("identity"!==C)throw new Error(`Unknown function type "${C}"`);_=fl}if(d){const D={},P=[];for(let U=0;UU[0]),evaluate:({zoom:U},X)=>sd({stops:V,base:a.base},o,U).evaluate(U,X)}}if(m){const D="exponential"===C?{name:"exponential",base:void 0!==a.base?a.base:1}:null;return{kind:"camera",interpolationType:D,interpolationFactor:aa.interpolationFactor.bind(void 0,D),zoomStops:a.stops.map(P=>P[0]),evaluate:({zoom:P})=>_(a,o,P,w,T)}}return{kind:"source",evaluate(D,P){const V=P&&P.properties?P.properties[a.property]:void 0;return void 0===V?Or(a.default,o.default):_(a,o,V,w,T)}}}function Or(a,o,u){return void 0!==a?a:void 0!==o?o:void 0!==u?u:void 0}function G3(a,o,u,d,m){return Or(typeof u===m?d[u]:void 0,a.default,o.default)}function Ah(a,o,u){if("number"!==Di(u))return Or(a.default,o.default);const d=a.stops.length;if(1===d||u<=a.stops[0][0])return a.stops[0][1];if(u>=a.stops[d-1][0])return a.stops[d-1][1];const m=hl(a.stops.map(C=>C[0]),u);return a.stops[m][1]}function sd(a,o,u){const d=void 0!==a.base?a.base:1;if("number"!==Di(u))return Or(a.default,o.default);const m=a.stops.length;if(1===m||u<=a.stops[0][0])return a.stops[0][1];if(u>=a.stops[m-1][0])return a.stops[m-1][1];const C=hl(a.stops.map(P=>P[0]),u),_=function(P,V,O,U){const X=U-O,ee=P-O;return 0===X?0:1===V?ee/X:(Math.pow(V,ee)-1)/(Math.pow(V,X)-1)}(u,d,a.stops[C][0],a.stops[C+1][0]),w=a.stops[C][1],T=a.stops[C+1][1];let D=tu[o.type]||Xc;if(a.colorSpace&&"rgb"!==a.colorSpace){const P=f5[a.colorSpace];D=(V,O)=>P.reverse(P.interpolate(P.forward(V),P.forward(O),_))}return"function"==typeof w.evaluate?{evaluate(...P){const V=w.evaluate.apply(void 0,P),O=T.evaluate.apply(void 0,P);if(void 0!==V&&void 0!==O)return D(V,O,_)}}:D(w,T,_)}function fl(a,o,u){return"color"===o.type?u=nr.parse(u):"formatted"===o.type?u=wi.fromString(u.toString()):"resolvedImage"===o.type?u=Tn.fromString(u.toString()):Di(u)===o.type||"enum"===o.type&&o.values[u]||(u=void 0),Or(u,a.default,o.default)}_r.register(Ua,{error:[{kind:"error"},[er],(a,[o])=>{throw new co(o.evaluate(a))}],typeof:[er,[Ei],(a,[o])=>Sr(Ur(o.evaluate(a)))],"to-rgba":[i1(an,4),[ia],(a,[o])=>o.evaluate(a).toArray()],rgb:[ia,[an,an,an],id],rgba:[ia,[an,an,an,an],id],has:{type:$i,overloads:[[[er],(a,[o])=>as(o.evaluate(a),a.properties())],[[er,yr],(a,[o,u])=>as(o.evaluate(a),u.evaluate(a))]]},get:{type:Ei,overloads:[[[er],(a,[o])=>au(o.evaluate(a),a.properties())],[[er,yr],(a,[o,u])=>au(o.evaluate(a),u.evaluate(a))]]},"feature-state":[Ei,[er],(a,[o])=>au(o.evaluate(a),a.featureState||{})],properties:[yr,[],a=>a.properties()],"geometry-type":[er,[],a=>a.geometryType()],id:[Ei,[],a=>a.id()],zoom:[an,[],a=>a.globals.zoom],pitch:[an,[],a=>a.globals.pitch||0],"distance-from-center":[an,[],a=>a.distanceFromCenter()],"heatmap-density":[an,[],a=>a.globals.heatmapDensity||0],"line-progress":[an,[],a=>a.globals.lineProgress||0],"sky-radial-progress":[an,[],a=>a.globals.skyRadialProgress||0],accumulated:[Ei,[],a=>void 0===a.globals.accumulated?null:a.globals.accumulated],"+":[an,k2(an),(a,o)=>{let u=0;for(const d of o)u+=d.evaluate(a);return u}],"*":[an,k2(an),(a,o)=>{let u=1;for(const d of o)u*=d.evaluate(a);return u}],"-":{type:an,overloads:[[[an,an],(a,[o,u])=>o.evaluate(a)-u.evaluate(a)],[[an],(a,[o])=>-o.evaluate(a)]]},"/":[an,[an,an],(a,[o,u])=>o.evaluate(a)/u.evaluate(a)],"%":[an,[an,an],(a,[o,u])=>o.evaluate(a)%u.evaluate(a)],ln2:[an,[],()=>Math.LN2],pi:[an,[],()=>Math.PI],e:[an,[],()=>Math.E],"^":[an,[an,an],(a,[o,u])=>Math.pow(o.evaluate(a),u.evaluate(a))],sqrt:[an,[an],(a,[o])=>Math.sqrt(o.evaluate(a))],log10:[an,[an],(a,[o])=>Math.log(o.evaluate(a))/Math.LN10],ln:[an,[an],(a,[o])=>Math.log(o.evaluate(a))],log2:[an,[an],(a,[o])=>Math.log(o.evaluate(a))/Math.LN2],sin:[an,[an],(a,[o])=>Math.sin(o.evaluate(a))],cos:[an,[an],(a,[o])=>Math.cos(o.evaluate(a))],tan:[an,[an],(a,[o])=>Math.tan(o.evaluate(a))],asin:[an,[an],(a,[o])=>Math.asin(o.evaluate(a))],acos:[an,[an],(a,[o])=>Math.acos(o.evaluate(a))],atan:[an,[an],(a,[o])=>Math.atan(o.evaluate(a))],min:[an,k2(an),(a,o)=>Math.min(...o.map(u=>u.evaluate(a)))],max:[an,k2(an),(a,o)=>Math.max(...o.map(u=>u.evaluate(a)))],abs:[an,[an],(a,[o])=>Math.abs(o.evaluate(a))],round:[an,[an],(a,[o])=>{const u=o.evaluate(a);return u<0?-Math.round(-u):Math.round(u)}],floor:[an,[an],(a,[o])=>Math.floor(o.evaluate(a))],ceil:[an,[an],(a,[o])=>Math.ceil(o.evaluate(a))],"filter-==":[$i,[er,Ei],(a,[o,u])=>a.properties()[o.value]===u.value],"filter-id-==":[$i,[Ei],(a,[o])=>a.id()===o.value],"filter-type-==":[$i,[er],(a,[o])=>a.geometryType()===o.value],"filter-<":[$i,[er,Ei],(a,[o,u])=>{const d=a.properties()[o.value],m=u.value;return typeof d==typeof m&&d{const u=a.id(),d=o.value;return typeof u==typeof d&&u":[$i,[er,Ei],(a,[o,u])=>{const d=a.properties()[o.value],m=u.value;return typeof d==typeof m&&d>m}],"filter-id->":[$i,[Ei],(a,[o])=>{const u=a.id(),d=o.value;return typeof u==typeof d&&u>d}],"filter-<=":[$i,[er,Ei],(a,[o,u])=>{const d=a.properties()[o.value],m=u.value;return typeof d==typeof m&&d<=m}],"filter-id-<=":[$i,[Ei],(a,[o])=>{const u=a.id(),d=o.value;return typeof u==typeof d&&u<=d}],"filter->=":[$i,[er,Ei],(a,[o,u])=>{const d=a.properties()[o.value],m=u.value;return typeof d==typeof m&&d>=m}],"filter-id->=":[$i,[Ei],(a,[o])=>{const u=a.id(),d=o.value;return typeof u==typeof d&&u>=d}],"filter-has":[$i,[Ei],(a,[o])=>o.value in a.properties()],"filter-has-id":[$i,[],a=>null!==a.id()&&void 0!==a.id()],"filter-type-in":[$i,[i1(er)],(a,[o])=>o.value.indexOf(a.geometryType())>=0],"filter-id-in":[$i,[i1(Ei)],(a,[o])=>o.value.indexOf(a.id())>=0],"filter-in-small":[$i,[er,i1(Ei)],(a,[o,u])=>u.value.indexOf(a.properties()[o.value])>=0],"filter-in-large":[$i,[er,i1(Ei)],(a,[o,u])=>function(d,m,C,_){for(;C<=_;){const w=C+_>>1;if(m[w]===d)return!0;m[w]>d?_=w-1:C=w+1}return!1}(a.properties()[o.value],u.value,0,u.value.length-1)],all:{type:$i,overloads:[[[$i,$i],(a,[o,u])=>o.evaluate(a)&&u.evaluate(a)],[k2($i),(a,o)=>{for(const u of o)if(!u.evaluate(a))return!1;return!0}]]},any:{type:$i,overloads:[[[$i,$i],(a,[o,u])=>o.evaluate(a)||u.evaluate(a)],[k2($i),(a,o)=>{for(const u of o)if(u.evaluate(a))return!0;return!1}]]},"!":[$i,[$i],(a,[o])=>!o.evaluate(a)],"is-supported-script":[$i,[er],(a,[o])=>{const u=a.globals&&a.globals.isSupportedScript;return!u||u(o.evaluate(a))}],upcase:[er,[er],(a,[o])=>o.evaluate(a).toUpperCase()],downcase:[er,[er],(a,[o])=>o.evaluate(a).toLowerCase()],concat:[er,k2(Ei),(a,o)=>o.map(u=>F1(u.evaluate(a))).join("")],"resolved-locale":[er,[Yl],(a,[o])=>o.evaluate(a).resolvedLocale()]});class cu{constructor(o,u){var d;this.expression=o,this._warningHistory={},this._evaluator=new ll,this._defaultValue=u?"color"===(d=u).type&&lu(d.default)?new nr(0,0,0,0):"color"===d.type?nr.parse(d.default)||null:void 0===d.default?null:d.default:null,this._enumValues=u&&"enum"===u.type?u.values:null}evaluateWithoutErrorHandling(o,u,d,m,C,_,w,T){return this._evaluator.globals=o,this._evaluator.feature=u,this._evaluator.featureState=d,this._evaluator.canonical=m,this._evaluator.availableImages=C||null,this._evaluator.formattedSection=_,this._evaluator.featureTileCoord=w||null,this._evaluator.featureDistanceData=T||null,this.expression.evaluate(this._evaluator)}evaluate(o,u,d,m,C,_,w,T){this._evaluator.globals=o,this._evaluator.feature=u||null,this._evaluator.featureState=d||null,this._evaluator.canonical=m,this._evaluator.availableImages=C||null,this._evaluator.formattedSection=_||null,this._evaluator.featureTileCoord=w||null,this._evaluator.featureDistanceData=T||null;try{const D=this.expression.evaluate(this._evaluator);if(null==D||"number"==typeof D&&D!=D)return this._defaultValue;if(this._enumValues&&!(D in this._enumValues))throw new co(`Expected value to be one of ${Object.keys(this._enumValues).map(P=>JSON.stringify(P)).join(", ")}, but found ${JSON.stringify(D)} instead.`);return D}catch(D){return this._warningHistory[D.message]||(this._warningHistory[D.message]=!0,"undefined"!=typeof console&&console.warn(D.message)),this._defaultValue}}}function pl(a){return Array.isArray(a)&&a.length>0&&"string"==typeof a[0]&&a[0]in Ua}function vi(a,o){const u=new _a(Ua,[],o?function(m){const C={color:ia,string:er,number:an,enum:er,boolean:$i,formatted:e2,resolvedImage:Oc};return"array"===m.type?i1(C[m.value]||Ei,m.length):C[m.type]}(o):void 0),d=u.parse(a,void 0,void 0,void 0,o&&"string"===o.type?{typeAnnotation:"coerce"}:void 0);return d?rd(new cu(d,o)):$r(u.errors)}class uu{constructor(o,u){this.kind=o,this._styleExpression=u,this.isStateDependent="constant"!==o&&!Ns(u.expression)}evaluateWithoutErrorHandling(o,u,d,m,C,_){return this._styleExpression.evaluateWithoutErrorHandling(o,u,d,m,C,_)}evaluate(o,u,d,m,C,_){return this._styleExpression.evaluate(o,u,d,m,C,_)}}class kh{constructor(o,u,d,m){this.kind=o,this.zoomStops=d,this._styleExpression=u,this.isStateDependent="camera"!==o&&!Ns(u.expression),this.interpolationType=m}evaluateWithoutErrorHandling(o,u,d,m,C,_){return this._styleExpression.evaluateWithoutErrorHandling(o,u,d,m,C,_)}evaluate(o,u,d,m,C,_){return this._styleExpression.evaluate(o,u,d,m,C,_)}interpolationFactor(o,u,d){return this.interpolationType?aa.interpolationFactor(this.interpolationType,o,u,d):0}}function od(a,o){if("error"===(a=vi(a,o)).result)return a;const u=a.value.expression,d=s1(u);if(!d&&!Wc(o))return $r([new ta("","data expressions not supported")]);const m=H3(u,["zoom","pitch","distance-from-center"]);if(!m&&!p5(o))return $r([new ta("","zoom expressions not supported")]);const C=W3(u);return C||m?C instanceof ta?$r([C]):C instanceof aa&&!qc(o)?$r([new ta("",'"interpolate" expressions cannot be used with this property')]):rd(C?new kh(d?"camera":"composite",a.value,C.labels,C instanceof aa?C.interpolation:void 0):new uu(d?"constant":"source",a.value)):$r([new ta("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Zc{constructor(o,u){this._parameters=o,this._specification=u,ao(this,n2(this._parameters,this._specification))}static deserialize(o){return new Zc(o._parameters,o._specification)}static serialize(o){return{_parameters:o._parameters,_specification:o._specification}}}function W3(a){let o=null;if(a instanceof Lh)o=W3(a.result);else if(a instanceof jc){for(const u of a.args)if(o=W3(u),o)break}else(a instanceof dl||a instanceof aa)&&a.input instanceof _r&&"zoom"===a.input.name&&(o=a);return o instanceof ta||a.eachChild(u=>{const d=W3(u);d instanceof ta?o=d:!o&&d?o=new ta("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):o&&d&&o!==d&&(o=new ta("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),o}function a1(a){const o=a.key,u=a.value,d=a.valueSpec||{},m=a.objectElementValidators||{},C=a.style,_=a.styleSpec;let w=[];const T=Di(u);if("object"!==T)return[new Ft(o,u,`object expected, ${T} found`)];for(const D in u){const P=D.split(".")[0],V=d[P]||d["*"];let O;if(m[P])O=m[P];else if(d[P])O=qs;else if(m["*"])O=m["*"];else{if(!d["*"]){w.push(new Ft(o,u[D],`unknown property "${D}"`));continue}O=qs}w=w.concat(O({key:(o&&`${o}.`)+D,value:u[D],valueSpec:V,style:C,styleSpec:_,object:u,objectKey:D},u))}for(const D in d)m[D]||d[D].required&&void 0===d[D].default&&void 0===u[D]&&w.push(new Ft(o,u,`missing required property "${D}"`));return w}function Ih(a){const o=a.value,u=a.valueSpec,d=a.style,m=a.styleSpec,C=a.key,_=a.arrayElementValidator||qs;if("array"!==Di(o))return[new Ft(C,o,`array expected, ${Di(o)} found`)];if(u.length&&o.length!==u.length)return[new Ft(C,o,`array length ${u.length} expected, length ${o.length} found`)];if(u["min-length"]&&o.lengthC)return[new Ft(o,u,`${u} is greater than the maximum value ${C}`)]}return[]}function ir(a){const o=a.valueSpec,u=mi(a.value.type);let d,m,C,_={};const w="categorical"!==u&&void 0===a.value.property,T=!w,D="array"===Di(a.value.stops)&&"array"===Di(a.value.stops[0])&&"object"===Di(a.value.stops[0][0]),P=a1({key:a.key,value:a.value,valueSpec:a.styleSpec.function,style:a.style,styleSpec:a.styleSpec,objectElementValidators:{stops:function(U){if("identity"===u)return[new Ft(U.key,U.value,'identity function may not have a "stops" property')];let X=[];const ee=U.value;return X=X.concat(Ih({key:U.key,value:ee,valueSpec:U.valueSpec,style:U.style,styleSpec:U.styleSpec,arrayElementValidator:V})),"array"===Di(ee)&&0===ee.length&&X.push(new Ft(U.key,ee,"array must have at least one stop")),X},default:function(U){return qs({key:U.key,value:U.value,valueSpec:o,style:U.style,styleSpec:U.styleSpec})}}});return"identity"===u&&w&&P.push(new Ft(a.key,a.value,'missing required property "property"')),"identity"===u||a.value.stops||P.push(new Ft(a.key,a.value,'missing required property "stops"')),"exponential"===u&&a.valueSpec.expression&&!qc(a.valueSpec)&&P.push(new Ft(a.key,a.value,"exponential functions not supported")),a.styleSpec.$version>=8&&(T&&!Wc(a.valueSpec)?P.push(new Ft(a.key,a.value,"property functions not supported")):w&&!p5(a.valueSpec)&&P.push(new Ft(a.key,a.value,"zoom functions not supported"))),"categorical"!==u&&!D||void 0!==a.value.property||P.push(new Ft(a.key,a.value,'"property" property is required')),P;function V(U){let X=[];const ee=U.value,se=U.key;if("array"!==Di(ee))return[new Ft(se,ee,`array expected, ${Di(ee)} found`)];if(2!==ee.length)return[new Ft(se,ee,`array length 2 expected, length ${ee.length} found`)];if(D){if("object"!==Di(ee[0]))return[new Ft(se,ee,`object expected, ${Di(ee[0])} found`)];if(void 0===ee[0].zoom)return[new Ft(se,ee,"object stop key must have zoom")];if(void 0===ee[0].value)return[new Ft(se,ee,"object stop key must have value")];if(C&&C>mi(ee[0].zoom))return[new Ft(se,ee[0].zoom,"stop zoom values must appear in ascending order")];mi(ee[0].zoom)!==C&&(C=mi(ee[0].zoom),m=void 0,_={}),X=X.concat(a1({key:`${se}[0]`,value:ee[0],valueSpec:{zoom:{}},style:U.style,styleSpec:U.styleSpec,objectElementValidators:{zoom:un,value:O}}))}else X=X.concat(O({key:`${se}[0]`,value:ee[0],valueSpec:{},style:U.style,styleSpec:U.styleSpec},ee));return pl(xs(ee[1]))?X.concat([new Ft(`${se}[1]`,ee[1],"expressions are not allowed in function stops.")]):X.concat(qs({key:`${se}[1]`,value:ee[1],valueSpec:o,style:U.style,styleSpec:U.styleSpec}))}function O(U,X){const ee=Di(U.value),se=mi(U.value),xe=null!==U.value?U.value:X;if(d){if(ee!==d)return[new Ft(U.key,xe,`${ee} stop domain type must match previous stop domain type ${d}`)]}else d=ee;if("number"!==ee&&"string"!==ee&&"boolean"!==ee)return[new Ft(U.key,xe,"stop domain value must be a number, string, or boolean")];if("number"!==ee&&"categorical"!==u){let Ie=`number expected, ${ee} found`;return Wc(o)&&void 0===u&&(Ie+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ft(U.key,xe,Ie)]}return"categorical"!==u||"number"!==ee||isFinite(se)&&Math.floor(se)===se?"categorical"!==u&&"number"===ee&&void 0!==m&&senew Ft(`${a.key}${d.key}`,a.value,d.message));const u=o.value.expression||o.value._styleExpression.expression;if("property"===a.expressionContext&&"text-font"===a.propertyKey&&!u.outputDefined())return[new Ft(a.key,a.value,`Invalid data expression for "${a.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===a.expressionContext&&"layout"===a.propertyType&&!Ns(u))return[new Ft(a.key,a.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===a.expressionContext)return Ps(u,a);if(a.expressionContext&&0===a.expressionContext.indexOf("cluster")){if(!H3(u,["zoom","feature-state"]))return[new Ft(a.key,a.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===a.expressionContext&&!s1(u))return[new Ft(a.key,a.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ps(a,o){const u=new Set(["zoom","feature-state","pitch","distance-from-center"]);for(const m of o.valueSpec.expression.parameters)u.delete(m);if(0===u.size)return[];const d=[];return a instanceof _r&&u.has(a.name)?[new Ft(o.key,o.value,`["${a.name}"] expression is not supported in a filter for a ${o.object.type} layer with id: ${o.object.id}`)]:(a.eachChild(m=>{d.push(...Ps(m,o))}),d)}function q3(a){const o=a.key,u=a.value,d=a.valueSpec,m=[];return Array.isArray(d.values)?-1===d.values.indexOf(mi(u))&&m.push(new Ft(o,u,`expected one of [${d.values.join(", ")}], ${JSON.stringify(u)} found`)):-1===Object.keys(d.values).indexOf(mi(u))&&m.push(new Ft(o,u,`expected one of [${Object.keys(d.values).join(", ")}], ${JSON.stringify(u)} found`)),m}function ml(a){if(!0===a||!1===a)return!0;if(!Array.isArray(a)||0===a.length)return!1;switch(a[0]){case"has":return a.length>=2&&"$id"!==a[1]&&"$type"!==a[1];case"in":return a.length>=3&&("string"!=typeof a[1]||Array.isArray(a[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==a.length||Array.isArray(a[1])||Array.isArray(a[2]);case"any":case"all":for(const o of a.slice(1))if(!ml(o)&&"boolean"!=typeof o)return!1;return!0;default:return!0}}function $a(a,o="fill"){if(null==a)return{filter:()=>!0,needGeometry:!1,needFeature:!1};ml(a)||(a=uo(a));const u=a;let d=!0;try{d=function(D){if(!X3(D))return D;let P=xs(D);return hu(P),P=Yc(P),P}(u)}catch(D){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(u,null,2)}\n `)}const m=it[`filter_${o}`],C=vi(d,m);let _=null;if("error"===C.result)throw new Error(C.value.map(D=>`${D.key}: ${D.message}`).join(", "));_=(D,P,V)=>C.value.evaluate(D,P,{},V);let w=null,T=null;if(d!==u){const D=vi(u,m);if("error"===D.result)throw new Error(D.value.map(P=>`${P.key}: ${P.message}`).join(", "));w=(P,V,O,U,X)=>D.value.evaluate(P,V,{},O,void 0,void 0,U,X),T=!s1(D.value.expression)}return _=_,{filter:_,dynamicFilter:w||void 0,needGeometry:Kc(d),needFeature:!!T}}function Yc(a){if(!Array.isArray(a))return a;const o=function(u){if(m5.has(u[0]))for(let d=1;dYc(u))}function hu(a){let o=!1;const u=[];if("case"===a[0]){for(let d=1;d",">=","<","<=","to-boolean"]);function du(a,o){return ao?1:0}function Kc(a){if(!Array.isArray(a))return!1;if("within"===a[0])return!0;for(let o=1;o"===o||"<="===o||">="===o?l1(a[1],a[2],o):"any"===o?(u=a.slice(1),["any"].concat(u.map(uo))):"all"===o?["all"].concat(a.slice(1).map(uo)):"none"===o?["all"].concat(a.slice(1).map(uo).map(c1)):"in"===o?zh(a[1],a.slice(2)):"!in"===o?c1(zh(a[1],a.slice(2))):"has"===o?tc(a[1]):"!has"===o?c1(tc(a[1])):"within"!==o||a;var u}function l1(a,o,u){switch(a){case"$type":return[`filter-type-${u}`,o];case"$id":return[`filter-id-${u}`,o];default:return[`filter-${u}`,a,o]}}function zh(a,o){if(0===o.length)return!1;switch(a){case"$type":return["filter-type-in",["literal",o]];case"$id":return["filter-id-in",["literal",o]];default:return o.length>200&&!o.some(u=>typeof u!=typeof o[0])?["filter-in-large",a,["literal",o.sort(du)]]:["filter-in-small",a,["literal",o]]}}function tc(a){switch(a){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",a]}}function c1(a){return["!",a]}function Ph(a){if(ml(xs(a.value))){const o=xs(a.layerType);return bt(ao({},a,{expressionContext:"filter",valueSpec:a.styleSpec[`filter_${o||"fill"}`]}))}return Vh(a)}function Vh(a){const o=a.value,u=a.key;if("array"!==Di(o))return[new Ft(u,o,`array expected, ${Di(o)} found`)];const d=a.styleSpec;let m,C=[];if(o.length<1)return[new Ft(u,o,"filter array must have at least 1 element")];switch(C=C.concat(q3({key:`${u}[0]`,value:o[0],valueSpec:d.filter_operator,style:a.style,styleSpec:a.styleSpec})),mi(o[0])){case"<":case"<=":case">":case">=":o.length>=2&&"$type"===mi(o[1])&&C.push(new Ft(u,o,`"$type" cannot be use with operator "${o[0]}"`));case"==":case"!=":3!==o.length&&C.push(new Ft(u,o,`filter array for operator "${o[0]}" must have 3 elements`));case"in":case"!in":o.length>=2&&(m=Di(o[1]),"string"!==m&&C.push(new Ft(`${u}[1]`,o[1],`string expected, ${m} found`)));for(let _=2;_{D in u&&o.push(new Ft(d,u[D],`"${D}" is prohibited for ref layers`))}),m.layers.forEach(D=>{mi(D.id)===w&&(T=D)}),T?T.ref?o.push(new Ft(d,u.ref,"ref cannot reference another ref layer")):_=mi(T.type):o.push(new Ft(d,u.ref,`ref layer "${w}" not found`))}else if("background"!==_&&"sky"!==_)if(u.source){const T=m.sources&&m.sources[u.source],D=T&&mi(T.type);T?"vector"===D&&"raster"===_?o.push(new Ft(d,u.source,`layer "${u.id}" requires a raster source`)):"raster"===D&&"raster"!==_?o.push(new Ft(d,u.source,`layer "${u.id}" requires a vector source`)):"vector"!==D||u["source-layer"]?"raster-dem"===D&&"hillshade"!==_?o.push(new Ft(d,u.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==_||!u.paint||!u.paint["line-gradient"]||"geojson"===D&&T.lineMetrics||o.push(new Ft(d,u,`layer "${u.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):o.push(new Ft(d,u,`layer "${u.id}" must specify a "source-layer"`)):o.push(new Ft(d,u.source,`source "${u.source}" not found`))}else o.push(new Ft(d,u,'missing required property "source"'));return o=o.concat(a1({key:d,value:u,valueSpec:C.layer,style:a.style,styleSpec:a.styleSpec,objectElementValidators:{"*":()=>[],type:()=>qs({key:`${d}.type`,value:u.type,valueSpec:C.layer.type,style:a.style,styleSpec:a.styleSpec,object:u,objectKey:"type"}),filter:T=>Ph(ao({layerType:_},T)),layout:T=>a1({layer:u,key:T.key,value:T.value,style:T.style,styleSpec:T.styleSpec,objectElementValidators:{"*":D=>fu(ao({layerType:_},D))}}),paint:T=>a1({layer:u,key:T.key,value:T.value,style:T.style,styleSpec:T.styleSpec,objectElementValidators:{"*":D=>ad(ao({layerType:_},D))}})}})),o}function ic(a){const o=a.value,u=a.key,d=Di(o);return"string"!==d?[new Ft(u,o,`string expected, ${d} found`)]:[]}const Y3={promoteId:function({key:a,value:o}){if("string"===Di(o))return ic({key:a,value:o});{const u=[];for(const d in o)u.push(...ic({key:`${a}.${d}`,value:o[d]}));return u}}};function ld(a){const o=a.value,u=a.key,d=a.styleSpec,m=a.style;if(!o.type)return[new Ft(u,o,'"type" is required')];const C=mi(o.type);let _;switch(C){case"vector":case"raster":case"raster-dem":return _=a1({key:u,value:o,valueSpec:d[`source_${C.replace("-","_")}`],style:a.style,styleSpec:d,objectElementValidators:Y3}),_;case"geojson":if(_=a1({key:u,value:o,valueSpec:d.source_geojson,style:m,styleSpec:d,objectElementValidators:Y3}),o.cluster)for(const w in o.clusterProperties){const[T,D]=o.clusterProperties[w],P="string"==typeof T?[T,["accumulated"],["get",w]]:T;_.push(...bt({key:`${u}.${w}.map`,value:D,expressionContext:"cluster-map"})),_.push(...bt({key:`${u}.${w}.reduce`,value:P,expressionContext:"cluster-reduce"}))}return _;case"video":return a1({key:u,value:o,valueSpec:d.source_video,style:m,styleSpec:d});case"image":return a1({key:u,value:o,valueSpec:d.source_image,style:m,styleSpec:d});case"canvas":return[new Ft(u,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return q3({key:`${u}.type`,value:o.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:m,styleSpec:d})}}function pu(a){const o=a.value,u=a.styleSpec,d=u.light,m=a.style;let C=[];const _=Di(o);if(void 0===o)return C;if("object"!==_)return C=C.concat([new Ft("light",o,`object expected, ${_} found`)]),C;for(const w in o){const T=w.match(/^(.*)-transition$/);C=C.concat(T&&d[T[1]]&&d[T[1]].transition?qs({key:w,value:o[w],valueSpec:u.transition,style:m,styleSpec:u}):d[w]?qs({key:w,value:o[w],valueSpec:d[w],style:m,styleSpec:u}):[new Ft(w,o[w],`unknown property "${w}"`)])}return C}function Qc(a){const o=a.value,u=a.key,d=a.style,m=a.styleSpec,C=m.terrain;let _=[];const w=Di(o);if(void 0===o)return _;if("object"!==w)return _=_.concat([new Ft("terrain",o,`object expected, ${w} found`)]),_;for(const T in o){const D=T.match(/^(.*)-transition$/);_=_.concat(D&&C[D[1]]&&C[D[1]].transition?qs({key:T,value:o[T],valueSpec:m.transition,style:d,styleSpec:m}):C[T]?qs({key:T,value:o[T],valueSpec:C[T],style:d,styleSpec:m}):[new Ft(T,o[T],`unknown property "${T}"`)])}if(o.source){const T=d.sources&&d.sources[o.source],D=T&&mi(T.type);T?"raster-dem"!==D&&_.push(new Ft(u,o.source,`terrain cannot be used with a source of type ${D}, it only be used with a "raster-dem" source type`)):_.push(new Ft(u,o.source,`source "${o.source}" not found`))}else _.push(new Ft(u,o,'terrain is missing required property "source"'));return _}function mu(a){const o=a.value,u=a.style,d=a.styleSpec,m=d.fog;let C=[];const _=Di(o);if(void 0===o)return C;if("object"!==_)return C=C.concat([new Ft("fog",o,`object expected, ${_} found`)]),C;for(const w in o){const T=w.match(/^(.*)-transition$/);C=C.concat(T&&m[T[1]]&&m[T[1]].transition?qs({key:w,value:o[w],valueSpec:d.transition,style:u,styleSpec:d}):m[w]?qs({key:w,value:o[w],valueSpec:m[w],style:u,styleSpec:d}):[new Ft(w,o[w],`unknown property "${w}"`)])}return C}const gu={"*":()=>[],array:Ih,boolean:function(a){const o=a.value,u=a.key,d=Di(o);return"boolean"!==d?[new Ft(u,o,`boolean expected, ${d} found`)]:[]},number:un,color:function(a){const o=a.key,u=a.value,d=Di(u);return"string"!==d?[new Ft(o,u,`color expected, ${d} found`)]:null===Ql.parseCSSColor(u)?[new Ft(o,u,`color expected, "${u}" found`)]:[]},constants:fs,enum:q3,filter:Ph,function:ir,layer:nc,object:a1,source:ld,light:pu,terrain:Qc,fog:mu,string:ic,formatted:function(a){return 0===ic(a).length?[]:bt(a)},resolvedImage:function(a){return 0===ic(a).length?[]:bt(a)},projection:function(a){const o=a.value,u=a.styleSpec,d=u.projection,m=a.style;let C=[];const _=Di(o);if("object"===_)for(const w in o)C=C.concat(qs({key:w,value:o[w],valueSpec:d[w],style:m,styleSpec:u}));else"string"!==_&&(C=C.concat([new Ft("projection",o,`object or string expected, ${_} found`)]));return C}};function qs(a){const o=a.value,u=a.valueSpec,d=a.styleSpec;return u.expression&&lu(mi(o))?ir(a):u.expression&&pl(xs(o))?bt(a):u.type&&gu[u.type]?gu[u.type](a):a1(ao({},a,{valueSpec:u.type?d[u.type]:u}))}function Cu(a){const o=a.value,u=a.key,d=ic(a);return d.length||(-1===o.indexOf("{fontstack}")&&d.push(new Ft(u,o,'"glyphs" url must include a "{fontstack}" token')),-1===o.indexOf("{range}")&&d.push(new Ft(u,o,'"glyphs" url must include a "{range}" token'))),d}function u1(a,o=it){let u=[];return u=u.concat(qs({key:"",value:a,valueSpec:o.$root,styleSpec:o,style:a,objectElementValidators:{glyphs:Cu,"*":()=>[]}})),a.constants&&(u=u.concat(fs({key:"constants",value:a.constants,style:a,styleSpec:o}))),cd(u)}function cd(a){return[].concat(a).sort((o,u)=>o.line-u.line)}function O1(a){return function(...o){return cd(a.apply(this,o))}}u1.source=O1(ld),u1.light=O1(pu),u1.terrain=O1(Qc),u1.fog=O1(mu),u1.layer=O1(nc),u1.filter=O1(Ph),u1.paintProperty=O1(ad),u1.layoutProperty=O1(fu);const Rs=u1,ja=Rs.light,bs=Rs.fog,ct=Rs.paintProperty,g5=Rs.layoutProperty;function gl(a,o){let u=!1;if(o&&o.length)for(const d of o)a.fire(new gn(new Error(d.message))),u=!0;return u}var K3=la;function la(a,o,u){var d=this.cells=[];if(a instanceof ArrayBuffer){this.arrayBuffer=a;var m=new Int32Array(this.arrayBuffer);a=m[0],this.d=(o=m[1])+2*(u=m[2]);for(var C=0;C=P[U+0]&&d>=P[U+1])?(_[O]=!0,C.push(D[O])):_[O]=!1}}},la.prototype._forEachCell=function(a,o,u,d,m,C,_,w){for(var T=this._convertToCellCoord(a),D=this._convertToCellCoord(o),P=this._convertToCellCoord(u),V=this._convertToCellCoord(d),O=T;O<=P;O++)for(var U=D;U<=V;U++){var X=this.d*U+O;if((!w||w(this._convertFromCellCoord(O),this._convertFromCellCoord(U),this._convertFromCellCoord(O+1),this._convertFromCellCoord(U+1)))&&m.call(this,a,o,u,d,X,C,_,w))return}},la.prototype._convertFromCellCoord=function(a){return(a-this.padding)/this.scale},la.prototype._convertToCellCoord=function(a){return Math.max(0,Math.min(this.d-1,Math.floor(a*this.scale)+this.padding))},la.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var a=this.cells,o=3+this.cells.length+1+1,u=0,d=0;d=0)continue;const _=a[C];m[C]=Cl[d].shallow.indexOf(C)>=0?_:J3(_,o)}a instanceof Error&&(m.message=a.message)}if(m.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==d&&(m.$name=d),m}throw new Error("can't serialize object of type "+typeof a)}function ca(a){if(null==a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||a instanceof Boolean||a instanceof Number||a instanceof String||a instanceof Date||a instanceof RegExp||vl(a)||Fh(a)||ArrayBuffer.isView(a)||a instanceof Q3)return a;if(Array.isArray(a))return a.map(ca);if("object"==typeof a){const o=a.$name||"Object",{klass:u}=Cl[o];if(!u)throw new Error(`can't deserialize unregistered class ${o}`);if(u.deserialize)return u.deserialize(a);const d=Object.create(u.prototype);for(const m of Object.keys(a)){if("$name"===m)continue;const C=a[m];d[m]=Cl[o].shallow.indexOf(m)>=0?C:ca(C)}return d}throw new Error("can't deserialize object of type "+typeof a)}class v{constructor(){this.first=!0}update(o,u){const d=Math.floor(o);return this.first?(this.first=!1,this.lastIntegerZoom=d,this.lastIntegerZoomTime=0,this.lastZoom=o,this.lastFloorZoom=d,!0):(this.lastFloorZoom>d?(this.lastIntegerZoom=d+1,this.lastIntegerZoomTime=u):this.lastFloorZooma>=1536&&a<=1791,f=a=>a>=1872&&a<=1919,y=a=>a>=2208&&a<=2303,b=a=>a>=11904&&a<=12031,M=a=>a>=12032&&a<=12255,L=a=>a>=12272&&a<=12287,k=a=>a>=12288&&a<=12351,N=a=>a>=12352&&a<=12447,H=a=>a>=12448&&a<=12543,$=a=>a>=12544&&a<=12591,G=a=>a>=12704&&a<=12735,J=a=>a>=12736&&a<=12783,he=a=>a>=12784&&a<=12799,ae=a=>a>=12800&&a<=13055,ue=a=>a>=13056&&a<=13311,Ve=a=>a>=13312&&a<=19903,le=a=>a>=19968&&a<=40959,Ae=a=>a>=40960&&a<=42127,ke=a=>a>=42128&&a<=42191,Te=a=>a>=44032&&a<=55215,De=a=>a>=63744&&a<=64255,Oe=a=>a>=64336&&a<=65023,pt=a=>a>=65040&&a<=65055,Tt=a=>a>=65072&&a<=65103,hn=a=>a>=65104&&a<=65135,sn=a=>a>=65136&&a<=65279,nn=a=>a>=65280&&a<=65519;function At(a){for(const o of a)if(Bt(o.charCodeAt(0)))return!0;return!1}function vt(a){for(const o of a)if(!Yt(o.charCodeAt(0)))return!1;return!0}function Yt(a){return!(l(a)||f(a)||y(a)||Oe(a)||sn(a))}function Bt(a){return!(746!==a&&747!==a&&(a<4352||!(G(a)||$(a)||Tt(a)&&!(a>=65097&&a<=65103)||De(a)||ue(a)||b(a)||J(a)||!(!k(a)||a>=12296&&a<=12305||a>=12308&&a<=12319||12336===a)||Ve(a)||le(a)||ae(a)||(o=a,o>=12592&&o<=12687)||(o=>o>=43360&&o<=43391)(a)||(o=>o>=55216&&o<=55295)(a)||(o=>o>=4352&&o<=4607)(a)||Te(a)||N(a)||L(a)||(o=>o>=12688&&o<=12703)(a)||M(a)||he(a)||H(a)&&12540!==a||!(!nn(a)||65288===a||65289===a||65293===a||a>=65306&&a<=65310||65339===a||65341===a||65343===a||a>=65371&&a<=65503||65507===a||a>=65512&&a<=65519)||!(!hn(a)||a>=65112&&a<=65118||a>=65123&&a<=65126)||(o=>o>=5120&&o<=5759)(a)||(o=>o>=6320&&o<=6399)(a)||pt(a)||(o=>o>=19904&&o<=19967)(a)||Ae(a)||ke(a))));var o}function Gn(a){return!(Bt(a)||(o=a,(u=o)>=128&&u<=255&&(167===o||169===o||174===o||177===o||188===o||189===o||190===o||215===o||247===o)||(u=>u>=8192&&u<=8303)(o)&&(8214===o||8224===o||8225===o||8240===o||8241===o||8251===o||8252===o||8258===o||8263===o||8264===o||8265===o||8273===o)||(u=>u>=8448&&u<=8527)(o)||(u=>u>=8528&&u<=8591)(o)||(u=>u>=8960&&u<=9215)(o)&&(o>=8960&&o<=8967||o>=8972&&o<=8991||o>=8996&&o<=9e3||9003===o||o>=9085&&o<=9114||o>=9150&&o<=9165||9167===o||o>=9169&&o<=9179||o>=9186&&o<=9215)||(u=>u>=9216&&u<=9279)(o)&&9251!==o||(u=>u>=9280&&u<=9311)(o)||(u=>u>=9312&&u<=9471)(o)||(u=>u>=9632&&u<=9727)(o)||(u=>u>=9728&&u<=9983)(o)&&!(o>=9754&&o<=9759)||(u=>u>=11008&&u<=11263)(o)&&(o>=11026&&o<=11055||o>=11088&&o<=11097||o>=11192&&o<=11243)||k(o)||H(o)||(u=>u>=57344&&u<=63743)(o)||Tt(o)||hn(o)||nn(o)||8734===o||8756===o||8757===o||o>=9984&&o<=10087||o>=10102&&o<=10131||65532===o||65533===o));var o,u}function ii(a){return a>=1424&&a<=2303||Oe(a)||sn(a)}function Pi(a,o){return!(!o&&ii(a)||a>=2304&&a<=3583||a>=3840&&a<=4255||(u=a,u>=6016&&u<=6143));var u}function fn(a){for(const o of a)if(ii(o.charCodeAt(0)))return!0;return!1}const Jn="deferred",gi="loading",cr="loaded";let Nr=null,Ci="unavailable",Ri=null;const Er=function(a){a&&"string"==typeof a&&a.indexOf("NetworkError")>-1&&(Ci="error"),Nr&&Nr(a)};function ci(){Bo.fire(new Gt("pluginStateChange",{pluginStatus:Ci,pluginURL:Ri}))}const Bo=new Bn,ho=function(){return Ci},Uo=function(){if(Ci!==Jn||!Ri)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ci=gi,ci(),Ri&&V1({url:Ri},a=>{a?Er(a):(Ci=cr,ci())})},Hi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Ci===cr||null!=Hi.applyArabicShaping,isLoading:()=>Ci===gi,setState(a){Ci=a.pluginStatus,Ri=a.pluginURL},isParsed:()=>null!=Hi.applyArabicShaping&&null!=Hi.processBidirectionalText&&null!=Hi.processStyledBidirectionalText,getPluginURL:()=>Ri};class ui{constructor(o,u){this.zoom=o,u?(this.now=u.now,this.fadeDuration=u.fadeDuration,this.zoomHistory=u.zoomHistory,this.transition=u.transition,this.pitch=u.pitch):(this.now=0,this.fadeDuration=0,this.zoomHistory=new v,this.transition={},this.pitch=0)}isSupportedScript(o){return function(u,d){for(const m of u)if(!Pi(m.charCodeAt(0),d))return!1;return!0}(o,Hi.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const o=this.zoom,u=o-Math.floor(o),d=this.crossFadingFactor();return o>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:u+(1-u)*d}:{fromScale:.5,toScale:1,t:1-(1-d)*u}}}class Oi{constructor(o,u){this.property=o,this.value=u,this.expression=function(d,m){if(lu(d))return new Zc(d,m);if(pl(d)){const C=od(d,m);if("error"===C.result)throw new Error(C.value.map(_=>`${_.key}: ${_.message}`).join(", "));return C.value}{let C=d;return"string"==typeof d&&"color"===m.type&&(C=nr.parse(d)),{kind:"constant",evaluate:()=>C}}}(void 0===u?o.specification.default:u,o.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(o,u,d){return this.property.possiblyEvaluate(this,o,u,d)}}class ts{constructor(o){this.property=o,this.value=new Oi(o,void 0)}transitioned(o,u){return new zr(this.property,this.value,u,Li({},o.transition,this.transition),o.now)}untransitioned(){return new zr(this.property,this.value,null,{},0)}}class Xs{constructor(o){this._properties=o,this._values=Object.create(o.defaultTransitionablePropertyValues)}getValue(o){return qr(this._values[o].value.value)}setValue(o,u){this._values.hasOwnProperty(o)||(this._values[o]=new ts(this._values[o].property)),this._values[o].value=new Oi(this._values[o].property,null===u?void 0:qr(u))}getTransition(o){return qr(this._values[o].transition)}setTransition(o,u){this._values.hasOwnProperty(o)||(this._values[o]=new ts(this._values[o].property)),this._values[o].transition=qr(u)||void 0}serialize(){const o={};for(const u of Object.keys(this._values)){const d=this.getValue(u);void 0!==d&&(o[u]=d);const m=this.getTransition(u);void 0!==m&&(o[`${u}-transition`]=m)}return o}transitioned(o,u){const d=new h1(this._properties);for(const m of Object.keys(this._values))d._values[m]=this._values[m].transitioned(o,u._values[m]);return d}untransitioned(){const o=new h1(this._properties);for(const u of Object.keys(this._values))o._values[u]=this._values[u].untransitioned();return o}}class zr{constructor(o,u,d,m,C){const _=m.delay||0,w=m.duration||0;C=C||0,this.property=o,this.value=u,this.begin=C+_,this.end=this.begin+w,o.specification.transition&&(m.delay||m.duration)&&(this.prior=d)}possiblyEvaluate(o,u,d){const m=o.now||0,C=this.value.possiblyEvaluate(o,u,d),_=this.prior;if(_){if(m>this.end)return this.prior=null,C;if(this.value.isDataDriven())return this.prior=null,C;if(mm.zoomHistory.lastIntegerZoom?{from:o,to:u,other:d}:{from:d,to:u,other:o}}interpolate(o){return o}}class yl{constructor(o){this.specification=o}possiblyEvaluate(o,u,d,m){if(void 0!==o.value){if("constant"===o.expression.kind){const C=o.expression.evaluate(u,null,{},d,m);return this._calculate(C,C,C,u)}return this._calculate(o.expression.evaluate(new ui(Math.floor(u.zoom-1),u)),o.expression.evaluate(new ui(Math.floor(u.zoom),u)),o.expression.evaluate(new ui(Math.floor(u.zoom+1),u)),u)}}_calculate(o,u,d,m){return m.zoom>m.zoomHistory.lastIntegerZoom?{from:o,to:u}:{from:d,to:u}}interpolate(o){return o}}class rc{constructor(o){this.specification=o}possiblyEvaluate(o,u,d,m){return!!o.expression.evaluate(u,null,{},d,m)}interpolate(){return!1}}class $o{constructor(o){this.properties=o,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const u in o){const d=o[u];d.specification.overridable&&this.overridableProperties.push(u);const m=this.defaultPropertyValues[u]=new Oi(d,void 0),C=this.defaultTransitionablePropertyValues[u]=new ts(d);this.defaultTransitioningPropertyValues[u]=C.untransitioned(),this.defaultPossiblyEvaluatedValues[u]=m.possiblyEvaluate({})}}}function gC(a,o){return 256*(a=qi(Math.floor(a),0,255))+qi(Math.floor(o),0,255)}En("DataDrivenProperty",ei),En("DataConstantProperty",Xt),En("CrossFadedDataDrivenProperty",Zs),En("CrossFadedProperty",yl),En("ColorRampProperty",rc);const ud={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class hd{constructor(o,u){this._structArray=o,this._pos1=u*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Hs{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(o,u){return o._trim(),u&&(o.isTransferred=!0,u.push(o.arrayBuffer)),{length:o.length,arrayBuffer:o.arrayBuffer}}static deserialize(o){const u=Object.create(this.prototype);return u.arrayBuffer=o.arrayBuffer,u.length=o.length,u.capacity=o.arrayBuffer.byteLength/u.bytesPerElement,u._refreshViews(),u}_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(o){this.reserve(o),this.length=o}reserve(o){if(o>this.capacity){this.capacity=Math.max(o,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const u=this.uint8;this._refreshViews(),u&&this.uint8.set(u)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ps(a,o=1){let u=0,d=0;return{members:a.map(m=>{const C=ud[m.type].BYTES_PER_ELEMENT,_=u=Cp(u,Math.max(o,C)),w=m.components||1;return d=Math.max(d,C),u+=C*w,{name:m.name,type:m.type,components:w,offset:_}}),size:Cp(u,Math.max(d,o)),alignment:o}}function Cp(a,o){return Math.ceil(a/o)*o}class _l extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,u){const d=this.length;return this.resize(d+1),this.emplace(d,o,u)}emplace(o,u,d){const m=2*o;return this.int16[m+0]=u,this.int16[m+1]=d,o}}_l.prototype.bytesPerElement=4,En("StructArrayLayout2i4",_l);class Oh extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,u,d,m){const C=this.length;return this.resize(C+1),this.emplace(C,o,u,d,m)}emplace(o,u,d,m,C){const _=4*o;return this.int16[_+0]=u,this.int16[_+1]=d,this.int16[_+2]=m,this.int16[_+3]=C,o}}Oh.prototype.bytesPerElement=8,En("StructArrayLayout4i8",Oh);class Ys extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,u,d,m,C,_,w){const T=this.length;return this.resize(T+1),this.emplace(T,o,u,d,m,C,_,w)}emplace(o,u,d,m,C,_,w,T){const D=6*o,P=12*o,V=3*o;return this.int16[D+0]=u,this.int16[D+1]=d,this.uint8[P+4]=m,this.uint8[P+5]=C,this.uint8[P+6]=_,this.uint8[P+7]=w,this.float32[V+2]=T,o}}Ys.prototype.bytesPerElement=12,En("StructArrayLayout2i4ub1f12",Ys);class sc extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,u,d){const m=this.length;return this.resize(m+1),this.emplace(m,o,u,d)}emplace(o,u,d,m){const C=3*o;return this.float32[C+0]=u,this.float32[C+1]=d,this.float32[C+2]=m,o}}sc.prototype.bytesPerElement=12,En("StructArrayLayout3f12",sc);class P2 extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,u,d,m,C,_,w,T,D,P){const V=this.length;return this.resize(V+1),this.emplace(V,o,u,d,m,C,_,w,T,D,P)}emplace(o,u,d,m,C,_,w,T,D,P,V){const O=10*o;return this.uint16[O+0]=u,this.uint16[O+1]=d,this.uint16[O+2]=m,this.uint16[O+3]=C,this.uint16[O+4]=_,this.uint16[O+5]=w,this.uint16[O+6]=T,this.uint16[O+7]=D,this.uint16[O+8]=P,this.uint16[O+9]=V,o}}P2.prototype.bytesPerElement=20,En("StructArrayLayout10ui20",P2);class C5 extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,u,d,m,C,_,w,T){const D=this.length;return this.resize(D+1),this.emplace(D,o,u,d,m,C,_,w,T)}emplace(o,u,d,m,C,_,w,T,D){const P=8*o;return this.uint16[P+0]=u,this.uint16[P+1]=d,this.uint16[P+2]=m,this.uint16[P+3]=C,this.uint16[P+4]=_,this.uint16[P+5]=w,this.uint16[P+6]=T,this.uint16[P+7]=D,o}}C5.prototype.bytesPerElement=16,En("StructArrayLayout8ui16",C5);class v5 extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,u,d,m,C,_,w,T,D,P,V,O,U,X,ee,se){const xe=this.length;return this.resize(xe+1),this.emplace(xe,o,u,d,m,C,_,w,T,D,P,V,O,U,X,ee,se)}emplace(o,u,d,m,C,_,w,T,D,P,V,O,U,X,ee,se,xe){const Ie=16*o;return this.int16[Ie+0]=u,this.int16[Ie+1]=d,this.int16[Ie+2]=m,this.int16[Ie+3]=C,this.uint16[Ie+4]=_,this.uint16[Ie+5]=w,this.uint16[Ie+6]=T,this.uint16[Ie+7]=D,this.int16[Ie+8]=P,this.int16[Ie+9]=V,this.int16[Ie+10]=O,this.int16[Ie+11]=U,this.int16[Ie+12]=X,this.int16[Ie+13]=ee,this.int16[Ie+14]=se,this.int16[Ie+15]=xe,o}}v5.prototype.bytesPerElement=32,En("StructArrayLayout4i4ui4i4i32",v5);class d1 extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(o){const u=this.length;return this.resize(u+1),this.emplace(u,o)}emplace(o,u){return this.uint32[1*o+0]=u,o}}d1.prototype.bytesPerElement=4,En("StructArrayLayout1ul4",d1);class i2 extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,u,d,m,C,_,w,T,D,P,V,O,U){const X=this.length;return this.resize(X+1),this.emplace(X,o,u,d,m,C,_,w,T,D,P,V,O,U)}emplace(o,u,d,m,C,_,w,T,D,P,V,O,U,X){const ee=20*o,se=10*o;return this.int16[ee+0]=u,this.int16[ee+1]=d,this.int16[ee+2]=m,this.int16[ee+3]=C,this.int16[ee+4]=_,this.float32[se+3]=w,this.float32[se+4]=T,this.float32[se+5]=D,this.float32[se+6]=P,this.int16[ee+14]=V,this.uint32[se+8]=O,this.uint16[ee+18]=U,this.uint16[ee+19]=X,o}}i2.prototype.bytesPerElement=40,En("StructArrayLayout5i4f1i1ul2ui40",i2);class t4 extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,u,d,m,C,_,w){const T=this.length;return this.resize(T+1),this.emplace(T,o,u,d,m,C,_,w)}emplace(o,u,d,m,C,_,w,T){const D=8*o;return this.int16[D+0]=u,this.int16[D+1]=d,this.int16[D+2]=m,this.int16[D+4]=C,this.int16[D+5]=_,this.int16[D+6]=w,this.int16[D+7]=T,o}}t4.prototype.bytesPerElement=16,En("StructArrayLayout3i2i2i16",t4);class oc extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,u,d,m,C){const _=this.length;return this.resize(_+1),this.emplace(_,o,u,d,m,C)}emplace(o,u,d,m,C,_){const w=4*o,T=8*o;return this.float32[w+0]=u,this.float32[w+1]=d,this.float32[w+2]=m,this.int16[T+6]=C,this.int16[T+7]=_,o}}oc.prototype.bytesPerElement=16,En("StructArrayLayout2f1f2i16",oc);class xl extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,u,d,m){const C=this.length;return this.resize(C+1),this.emplace(C,o,u,d,m)}emplace(o,u,d,m,C){const _=12*o,w=3*o;return this.uint8[_+0]=u,this.uint8[_+1]=d,this.float32[w+1]=m,this.float32[w+2]=C,o}}xl.prototype.bytesPerElement=12,En("StructArrayLayout2ub2f12",xl);class f1 extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,u,d){const m=this.length;return this.resize(m+1),this.emplace(m,o,u,d)}emplace(o,u,d,m){const C=3*o;return this.uint16[C+0]=u,this.uint16[C+1]=d,this.uint16[C+2]=m,o}}f1.prototype.bytesPerElement=6,En("StructArrayLayout3ui6",f1);class y5 extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(o,u,d,m,C,_,w,T,D,P,V,O,U,X,ee,se,xe,Ie,$e,Ke,rt){const st=this.length;return this.resize(st+1),this.emplace(st,o,u,d,m,C,_,w,T,D,P,V,O,U,X,ee,se,xe,Ie,$e,Ke,rt)}emplace(o,u,d,m,C,_,w,T,D,P,V,O,U,X,ee,se,xe,Ie,$e,Ke,rt,st){const Rt=30*o,Vt=15*o,Cn=60*o;return this.int16[Rt+0]=u,this.int16[Rt+1]=d,this.int16[Rt+2]=m,this.float32[Vt+2]=C,this.float32[Vt+3]=_,this.uint16[Rt+8]=w,this.uint16[Rt+9]=T,this.uint32[Vt+5]=D,this.uint32[Vt+6]=P,this.uint32[Vt+7]=V,this.uint16[Rt+16]=O,this.uint16[Rt+17]=U,this.uint16[Rt+18]=X,this.float32[Vt+10]=ee,this.float32[Vt+11]=se,this.uint8[Cn+48]=xe,this.uint8[Cn+49]=Ie,this.uint8[Cn+50]=$e,this.uint32[Vt+13]=Ke,this.int16[Rt+28]=rt,this.uint8[Cn+58]=st,o}}y5.prototype.bytesPerElement=60,En("StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60",y5);class _5 extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(o,u,d,m,C,_,w,T,D,P,V,O,U,X,ee,se,xe,Ie,$e,Ke,rt,st,Rt,Vt,Cn,dn,Ht,cn,yn,Kt){const Dn=this.length;return this.resize(Dn+1),this.emplace(Dn,o,u,d,m,C,_,w,T,D,P,V,O,U,X,ee,se,xe,Ie,$e,Ke,rt,st,Rt,Vt,Cn,dn,Ht,cn,yn,Kt)}emplace(o,u,d,m,C,_,w,T,D,P,V,O,U,X,ee,se,xe,Ie,$e,Ke,rt,st,Rt,Vt,Cn,dn,Ht,cn,yn,Kt,Dn){const Vn=38*o,Ki=19*o;return this.int16[Vn+0]=u,this.int16[Vn+1]=d,this.int16[Vn+2]=m,this.float32[Ki+2]=C,this.float32[Ki+3]=_,this.int16[Vn+8]=w,this.int16[Vn+9]=T,this.int16[Vn+10]=D,this.int16[Vn+11]=P,this.int16[Vn+12]=V,this.int16[Vn+13]=O,this.uint16[Vn+14]=U,this.uint16[Vn+15]=X,this.uint16[Vn+16]=ee,this.uint16[Vn+17]=se,this.uint16[Vn+18]=xe,this.uint16[Vn+19]=Ie,this.uint16[Vn+20]=$e,this.uint16[Vn+21]=Ke,this.uint16[Vn+22]=rt,this.uint16[Vn+23]=st,this.uint16[Vn+24]=Rt,this.uint16[Vn+25]=Vt,this.uint16[Vn+26]=Cn,this.uint16[Vn+27]=dn,this.uint16[Vn+28]=Ht,this.uint32[Ki+15]=cn,this.float32[Ki+16]=yn,this.float32[Ki+17]=Kt,this.float32[Ki+18]=Dn,o}}_5.prototype.bytesPerElement=76,En("StructArrayLayout3i2f6i15ui1ul3f76",_5);class x5 extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o){const u=this.length;return this.resize(u+1),this.emplace(u,o)}emplace(o,u){return this.float32[1*o+0]=u,o}}x5.prototype.bytesPerElement=4,En("StructArrayLayout1f4",x5);class vp extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,u,d){const m=this.length;return this.resize(m+1),this.emplace(m,o,u,d)}emplace(o,u,d,m){const C=3*o;return this.int16[C+0]=u,this.int16[C+1]=d,this.int16[C+2]=m,o}}vp.prototype.bytesPerElement=6,En("StructArrayLayout3i6",vp);class vu extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,u,d,m,C,_,w){const T=this.length;return this.resize(T+1),this.emplace(T,o,u,d,m,C,_,w)}emplace(o,u,d,m,C,_,w,T){const D=7*o;return this.float32[D+0]=u,this.float32[D+1]=d,this.float32[D+2]=m,this.float32[D+3]=C,this.float32[D+4]=_,this.float32[D+5]=w,this.float32[D+6]=T,o}}vu.prototype.bytesPerElement=28,En("StructArrayLayout7f28",vu);class Wa extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,u,d,m){const C=this.length;return this.resize(C+1),this.emplace(C,o,u,d,m)}emplace(o,u,d,m,C){const _=6*o;return this.uint32[3*o+0]=u,this.uint16[_+2]=d,this.uint16[_+3]=m,this.uint16[_+4]=C,o}}Wa.prototype.bytesPerElement=12,En("StructArrayLayout1ul3ui12",Wa);class bl extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,u){const d=this.length;return this.resize(d+1),this.emplace(d,o,u)}emplace(o,u,d){const m=2*o;return this.uint16[m+0]=u,this.uint16[m+1]=d,o}}bl.prototype.bytesPerElement=4,En("StructArrayLayout2ui4",bl);class ac extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o){const u=this.length;return this.resize(u+1),this.emplace(u,o)}emplace(o,u){return this.uint16[1*o+0]=u,o}}ac.prototype.bytesPerElement=2,En("StructArrayLayout1ui2",ac);class b5 extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,u){const d=this.length;return this.resize(d+1),this.emplace(d,o,u)}emplace(o,u,d){const m=2*o;return this.float32[m+0]=u,this.float32[m+1]=d,o}}b5.prototype.bytesPerElement=8,En("StructArrayLayout2f8",b5);class dd extends Hs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,u,d,m){const C=this.length;return this.resize(C+1),this.emplace(C,o,u,d,m)}emplace(o,u,d,m,C){const _=4*o;return this.float32[_+0]=u,this.float32[_+1]=d,this.float32[_+2]=m,this.float32[_+3]=C,o}}dd.prototype.bytesPerElement=16,En("StructArrayLayout4f16",dd);class yp extends hd{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}yp.prototype.size=40;class w5 extends i2{get(o){return new yp(this,o)}}En("CollisionBoxArray",w5);class _p extends hd{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(o){this._structArray.uint8[this._pos1+49]=o}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(o){this._structArray.uint8[this._pos1+50]=o}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(o){this._structArray.uint32[this._pos4+13]=o}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(o){this._structArray.uint8[this._pos1+58]=o}}_p.prototype.size=60;class xp extends y5{get(o){return new _p(this,o)}}En("PlacedSymbolArray",xp);class bp extends hd{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(o){this._structArray.uint32[this._pos4+15]=o}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}bp.prototype.size=76;class yu extends _5{get(o){return new bp(this,o)}}En("SymbolInstanceArray",yu);class fd extends x5{getoffsetX(o){return this.float32[1*o+0]}}En("GlyphOffsetArray",fd);class Nh extends vp{getx(o){return this.int16[3*o+0]}gety(o){return this.int16[3*o+1]}gettileUnitDistanceFromAnchor(o){return this.int16[3*o+2]}}En("SymbolLineVertexArray",Nh);class CC extends hd{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}CC.prototype.size=12;class _u extends Wa{get(o){return new CC(this,o)}}En("FeatureIndexArray",_u);class pd extends hd{get a_centroid_pos0(){return this._structArray.uint16[this._pos2+0]}get a_centroid_pos1(){return this._structArray.uint16[this._pos2+1]}}pd.prototype.size=4;class n4 extends bl{get(o){return new pd(this,o)}}En("FillExtrusionCentroidArray",n4);const vC=ps([{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"}]),yC=ps([{name:"a_dash_to",components:4,type:"Uint16"},{name:"a_dash_from",components:4,type:"Uint16"}]);var wp=Kl(function(a){a.exports=function(o,u){var d,m,C,_,w,T,D,P;for(m=o.length-(d=3&o.length),C=u,w=3432918353,T=461845907,P=0;P>>16)*w&65535)<<16)&4294967295)<<15|D>>>17))*T+(((D>>>16)*T&65535)<<16)&4294967295)<<13|C>>>19))+((5*(C>>>16)&65535)<<16)&4294967295))+((58964+(_>>>16)&65535)<<16);switch(D=0,d){case 3:D^=(255&o.charCodeAt(P+2))<<16;case 2:D^=(255&o.charCodeAt(P+1))<<8;case 1:C^=D=(65535&(D=(D=(65535&(D^=255&o.charCodeAt(P)))*w+(((D>>>16)*w&65535)<<16)&4294967295)<<15|D>>>17))*T+(((D>>>16)*T&65535)<<16)&4294967295}return C^=o.length,C=2246822507*(65535&(C^=C>>>16))+((2246822507*(C>>>16)&65535)<<16)&4294967295,C=3266489909*(65535&(C^=C>>>13))+((3266489909*(C>>>16)&65535)<<16)&4294967295,(C^=C>>>16)>>>0}}),M5=Kl(function(a){a.exports=function(o,u){for(var d,m=o.length,C=u^m,_=0;m>=4;)d=1540483477*(65535&(d=255&o.charCodeAt(_)|(255&o.charCodeAt(++_))<<8|(255&o.charCodeAt(++_))<<16|(255&o.charCodeAt(++_))<<24))+((1540483477*(d>>>16)&65535)<<16),C=1540483477*(65535&C)+((1540483477*(C>>>16)&65535)<<16)^(d=1540483477*(65535&(d^=d>>>24))+((1540483477*(d>>>16)&65535)<<16)),m-=4,++_;switch(m){case 3:C^=(255&o.charCodeAt(_+2))<<16;case 2:C^=(255&o.charCodeAt(_+1))<<8;case 1:C=1540483477*(65535&(C^=255&o.charCodeAt(_)))+((1540483477*(C>>>16)&65535)<<16)}return C=1540483477*(65535&(C^=C>>>13))+((1540483477*(C>>>16)&65535)<<16),(C^=C>>>15)>>>0}}),md=wp,S5=M5;md.murmur3=wp,md.murmur2=S5;class Jc{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(o,u,d,m){this.ids.push(r4(o)),this.positions.push(u,d,m)}getPositions(o){const u=r4(o);let d=0,m=this.ids.length-1;for(;d>1;this.ids[_]>=u?m=_:d=_+1}const C=[];for(;this.ids[d]===u;)C.push({index:this.positions[3*d],start:this.positions[3*d+1],end:this.positions[3*d+2]}),d++;return C}static serialize(o,u){const d=new Float64Array(o.ids),m=new Uint32Array(o.positions);return T5(d,m,0,d.length-1),u&&u.push(d.buffer,m.buffer),{ids:d,positions:m}}static deserialize(o){const u=new Jc;return u.ids=o.ids,u.positions=o.positions,u.indexed=!0,u}}function r4(a){const o=+a;return!isNaN(o)&&Number.MIN_SAFE_INTEGER<=o&&o<=Number.MAX_SAFE_INTEGER?o:md(String(a))}function T5(a,o,u,d){for(;u>1];let C=u-1,_=d+1;for(;;){do{C++}while(a[C]m);if(C>=_)break;Mt(a,C,_),Mt(o,3*C,3*_),Mt(o,3*C+1,3*_+1),Mt(o,3*C+2,3*_+2)}_-u`u_${m}`),this.type=d}setUniform(o,u,d){o.set(d.constantOr(this.value))}getBinding(o,u,d){return"color"===this.type?new xu(o,u):new L5(o,u)}}class ws{constructor(o,u){this.uniformNames=u.map(d=>`u_${d}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(o,u){this.pixelRatioFrom=u.pixelRatio,this.pixelRatioTo=o.pixelRatio,this.patternFrom=u.tl.concat(u.br),this.patternTo=o.tl.concat(o.br)}setUniform(o,u,d,m){const C="u_pattern_to"===m||"u_dash_to"===m?this.patternTo:"u_pattern_from"===m||"u_dash_from"===m?this.patternFrom:"u_pixel_ratio_to"===m?this.pixelRatioTo:"u_pixel_ratio_from"===m?this.pixelRatioFrom:null;C&&o.set(C)}getBinding(o,u,d){return"u_pattern_from"===d||"u_pattern_to"===d||"u_dash_from"===d||"u_dash_to"===d?new e3(o,u):new L5(o,u)}}class r2{constructor(o,u,d,m){this.expression=o,this.type=d,this.maxValue=0,this.paintVertexAttributes=u.map(C=>({name:`a_${C}`,type:"Float32",components:"color"===d?2:1,offset:0})),this.paintVertexArray=new m}populatePaintArray(o,u,d,m,C,_){const w=this.paintVertexArray.length,T=this.expression.evaluate(new ui(0),u,{},C,m,_);this.paintVertexArray.resize(o),this._setPaintValue(w,o,T)}updatePaintArray(o,u,d,m,C){const _=this.expression.evaluate({zoom:0},d,m,void 0,C);this._setPaintValue(o,u,_)}_setPaintValue(o,u,d){if("color"===this.type){const m=Tp(d);for(let C=o;C`u_${w}_t`),this.type=d,this.useIntegerZoom=m,this.zoom=C,this.maxValue=0,this.paintVertexAttributes=u.map(w=>({name:`a_${w}`,type:"Float32",components:"color"===d?4:2,offset:0})),this.paintVertexArray=new _}populatePaintArray(o,u,d,m,C,_){const w=this.expression.evaluate(new ui(this.zoom),u,{},C,m,_),T=this.expression.evaluate(new ui(this.zoom+1),u,{},C,m,_),D=this.paintVertexArray.length;this.paintVertexArray.resize(o),this._setPaintValue(D,o,w,T)}updatePaintArray(o,u,d,m,C){const _=this.expression.evaluate({zoom:this.zoom},d,m,void 0,C),w=this.expression.evaluate({zoom:this.zoom+1},d,m,void 0,C);this._setPaintValue(o,u,_,w)}_setPaintValue(o,u,d,m){if("color"===this.type){const C=Tp(d),_=Tp(m);for(let w=o;w!0)){this.binders={},this._buffers=[];const m=[];for(const C in o.paint._values){if(!d(C))continue;const _=o.paint.get(C);if(!(_ instanceof Ga&&Wc(_.property.specification)))continue;const w=Lp(C,o.type),T=_.value,D=_.property.specification.type,P=_.property.useIntegerZoom,V=_.property.specification["property-type"],O="cross-faded"===V||"cross-faded-data-driven"===V,U="line-dasharray"===String(C)&&"constant"!==o.layout.get("line-cap").value.kind;if("constant"!==T.kind||U)if("source"===T.kind||U||O){const X=s4(C,D,"source");this.binders[C]=O?new t3(T,w,D,P,u,X,o.id):new r2(T,w,D,X),m.push(`/a_${C}`)}else{const X=s4(C,D,"composite");this.binders[C]=new Lo(T,w,D,P,u,X),m.push(`/z_${C}`)}else this.binders[C]=O?new ws(T.value,w):new V2(T.value,w,D),m.push(`/u_${C}`)}this.cacheKey=m.sort().join("")}getMaxValue(o){const u=this.binders[o];return u instanceof r2||u instanceof Lo?u.maxValue:0}populatePaintArrays(o,u,d,m,C,_){for(const w in this.binders){const T=this.binders[w];(T instanceof r2||T instanceof Lo||T instanceof t3)&&T.populatePaintArray(o,u,d,m,C,_)}}setConstantPatternPositions(o,u){for(const d in this.binders){const m=this.binders[d];m instanceof ws&&m.setConstantPatternPositions(o,u)}}updatePaintArrays(o,u,d,m,C,_){let w=!1;for(const T in o){const D=u.getPositions(T);for(const P of D){const V=d.feature(P.index);for(const O in this.binders){const U=this.binders[O];if((U instanceof r2||U instanceof Lo||U instanceof t3)&&!0===U.expression.isStateDependent){const X=m.paint.get(O);U.expression=X.value,U.updatePaintArray(P.start,P.end,V,o[T],C,_),w=!0}}}}return w}defines(){const o=[];for(const u in this.binders){const d=this.binders[u];(d instanceof V2||d instanceof ws)&&o.push(...d.uniformNames.map(m=>`#define HAS_UNIFORM_${m}`))}return o}getBinderAttributes(){const o=[];for(const u in this.binders){const d=this.binders[u];if(d instanceof r2||d instanceof Lo||d instanceof t3)for(let m=0;m!0)){this.programConfigurations={};for(const m of o)this.programConfigurations[m.id]=new Ml(m,u,d);this.needsUpload=!1,this._featureMap=new Jc,this._bufferOffset=0}populatePaintArrays(o,u,d,m,C,_,w){for(const T in this.programConfigurations)this.programConfigurations[T].populatePaintArrays(o,u,m,C,_,w);void 0!==u.id&&this._featureMap.add(u.id,d,this._bufferOffset,o),this._bufferOffset=o,this.needsUpload=!0}updatePaintArrays(o,u,d,m,C){for(const _ of d)this.needsUpload=this.programConfigurations[_.id].updatePaintArrays(o,this._featureMap,u,_,m,C)||this.needsUpload}get(o){return this.programConfigurations[o]}upload(o){if(this.needsUpload){for(const u in this.programConfigurations)this.programConfigurations[u].upload(o);this.needsUpload=!1}}destroy(){for(const o in this.programConfigurations)this.programConfigurations[o].destroy()}}const gd={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"line-dasharray":["dash_to","dash_from"]};function Lp(a,o){return gd[a]||[a.replace(`${o}-`,"").replace(/-/g,"_")]}const xC={"line-pattern":{source:P2,composite:P2},"fill-pattern":{source:P2,composite:P2},"fill-extrusion-pattern":{source:P2,composite:P2},"line-dasharray":{source:C5,composite:C5}},bC={color:{source:b5,composite:dd},number:{source:x5,composite:b5}};function s4(a,o,u){const d=xC[a];return d&&d[u]||bC[o][u]}En("ConstantBinder",V2),En("CrossFadedConstantBinder",ws),En("SourceExpressionBinder",r2),En("CrossFadedCompositeBinder",t3),En("CompositeExpressionBinder",Lo),En("ProgramConfiguration",Ml,{omit:["_buffers"]}),En("ProgramConfigurationSet",lc);const n3="-transition";class F2 extends Bn{constructor(o,u){if(super(),this.id=o.id,this.type=o.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,"custom"!==o.type&&(this.metadata=(o=o).metadata,this.minzoom=o.minzoom,this.maxzoom=o.maxzoom,"background"!==o.type&&"sky"!==o.type&&(this.source=o.source,this.sourceLayer=o["source-layer"],this.filter=o.filter),u.layout&&(this._unevaluatedLayout=new e4(u.layout)),u.paint)){this._transitionablePaint=new Xs(u.paint);for(const d in o.paint)this.setPaintProperty(d,o.paint[d],{validate:!1});for(const d in o.layout)this.setLayoutProperty(d,o.layout[d],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new z2(u.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(o){return"visibility"===o?this.visibility:this._unevaluatedLayout.getValue(o)}setLayoutProperty(o,u,d={}){null!=u&&this._validate(g5,`layers.${this.id}.layout.${o}`,o,u,d)||("visibility"!==o?this._unevaluatedLayout.setValue(o,u):this.visibility=u)}getPaintProperty(o){return ga(o,n3)?this._transitionablePaint.getTransition(o.slice(0,-n3.length)):this._transitionablePaint.getValue(o)}setPaintProperty(o,u,d={}){if(null!=u&&this._validate(ct,`layers.${this.id}.paint.${o}`,o,u,d))return!1;if(ga(o,n3))return this._transitionablePaint.setTransition(o.slice(0,-n3.length),u||void 0),!1;{const m=this._transitionablePaint._values[o],C="cross-faded-data-driven"===m.property.specification["property-type"],_=m.value.isDataDriven(),w=m.value;this._transitionablePaint.setValue(o,u),this._handleSpecialPaintPropertyUpdate(o);const T=this._transitionablePaint._values[o].value;return T.isDataDriven()||_||C||this._handleOverridablePaintPropertyUpdate(o,w,T)}}_handleSpecialPaintPropertyUpdate(o){}getProgramIds(){return null}getProgramConfiguration(o){return null}_handleOverridablePaintPropertyUpdate(o,u,d){return!1}isHidden(o){return!!(this.minzoom&&o=this.maxzoom)||"none"===this.visibility}updateTransitions(o){this._transitioningPaint=this._transitionablePaint.transitioned(o,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(o,u){o.getCrossfadeParameters&&(this._crossfadeParameters=o.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(o,void 0,u)),this.paint=this._transitioningPaint.possiblyEvaluate(o,void 0,u)}serialize(){const o={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(o.layout=o.layout||{},o.layout.visibility=this.visibility),P1(o,(u,d)=>!(void 0===u||"layout"===d&&!Object.keys(u).length||"paint"===d&&!Object.keys(u).length))}_validate(o,u,d,m,C={}){return(!C||!1!==C.validate)&&gl(this,o.call(Rs,{key:u,layerType:this.type,objectKey:d,value:m,styleSpec:it,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const o in this.paint._values){const u=this.paint.get(o);if(u instanceof Ga&&Wc(u.property.specification)&&("source"===u.value.kind||"composite"===u.value.kind)&&u.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=$a(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const TM=ps([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ep}=TM;class Vs{constructor(o=[]){this.segments=o}prepareSegment(o,u,d,m){let C=this.segments[this.segments.length-1];return o>Vs.MAX_VERTEX_ARRAY_LENGTH&&Fr(`Max vertices per segment is ${Vs.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${o}`),(!C||C.vertexLength+o>Vs.MAX_VERTEX_ARRAY_LENGTH||C.sortKey!==m)&&(C={vertexOffset:u.length,primitiveOffset:d.length,vertexLength:0,primitiveLength:0},void 0!==m&&(C.sortKey=m),this.segments.push(C)),C}get(){return this.segments}destroy(){for(const o of this.segments)for(const u in o.vaos)o.vaos[u].destroy()}static simpleSegment(o,u,d,m){return new Vs([{vertexOffset:o,primitiveOffset:u,vertexLength:d,primitiveLength:m,vaos:{},sortKey:0}])}}Vs.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,En("SegmentVector",Vs);var Yi=8192;class o4{constructor(o,u){o&&(u?this.setSouthWest(o).setNorthEast(u):4===o.length?this.setSouthWest([o[0],o[1]]).setNorthEast([o[2],o[3]]):this.setSouthWest(o[0]).setNorthEast(o[1]))}setNorthEast(o){return this._ne=o instanceof Pr?new Pr(o.lng,o.lat):Pr.convert(o),this}setSouthWest(o){return this._sw=o instanceof Pr?new Pr(o.lng,o.lat):Pr.convert(o),this}extend(o){const u=this._sw,d=this._ne;let m,C;if(o instanceof Pr)m=o,C=o;else{if(!(o instanceof o4))return Array.isArray(o)?4===o.length||o.every(Array.isArray)?this.extend(o4.convert(o)):this.extend(Pr.convert(o)):this;if(m=o._sw,C=o._ne,!m||!C)return this}return u||d?(u.lng=Math.min(m.lng,u.lng),u.lat=Math.min(m.lat,u.lat),d.lng=Math.max(C.lng,d.lng),d.lat=Math.max(C.lat,d.lat)):(this._sw=new Pr(m.lng,m.lat),this._ne=new Pr(C.lng,C.lat)),this}getCenter(){return new Pr((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 Pr(this.getWest(),this.getNorth())}getSouthEast(){return new Pr(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(o){const{lng:u,lat:d}=Pr.convert(o);let m=this._sw.lng<=u&&u<=this._ne.lng;return this._sw.lng>this._ne.lng&&(m=this._sw.lng>=u&&u>=this._ne.lng),this._sw.lat<=d&&d<=this._ne.lat&&m}static convert(o){return!o||o instanceof o4?o:new o4(o)}}const Dp=6371008.8;class Pr{constructor(o,u){if(isNaN(o)||isNaN(u))throw new Error(`Invalid LngLat object: (${o}, ${u})`);if(this.lng=+o,this.lat=+u,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Pr(Mo(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(o){const u=Math.PI/180,d=this.lat*u,m=o.lat*u,C=Math.sin(d)*Math.sin(m)+Math.cos(d)*Math.cos(m)*Math.cos((o.lng-this.lng)*u);return Dp*Math.acos(Math.min(C,1))}toBounds(o=0){const u=360*o/40075017,d=u/Math.cos(Math.PI/180*this.lat);return new o4(new Pr(this.lng-d,this.lat-u),new Pr(this.lng+d,this.lat+u))}static convert(o){if(o instanceof Pr)return o;if(Array.isArray(o)&&(2===o.length||3===o.length))return new Pr(Number(o[0]),Number(o[1]));if(!Array.isArray(o)&&"object"==typeof o&&null!==o)return new Pr(Number("lng"in o?o.lng:o.lon),Number(o.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const Rh=2*Math.PI*Dp;function Cd(a){return Rh*Math.cos(a*Math.PI/180)}function O2(a){return(180+a)/360}function bu(a){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a*Math.PI/360)))/360}function N2(a,o){return a/Cd(o)}function i3(a){return 360*a-180}function qa(a){return 360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90}function vd(a,o){return a*Cd(qa(o))}const R2=85.051129;class Hh{constructor(o,u,d=0){this.x=+o,this.y=+u,this.z=+d}static fromLngLat(o,u=0){const d=Pr.convert(o);return new Hh(O2(d.lng),bu(d.lat),N2(u,d.lat))}toLngLat(){return new Pr(i3(this.x),qa(this.y))}toAltitude(){return vd(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Rh*(o=qa(this.y),1/Math.cos(o*Math.PI/180));var o}}function yd(a,o,u,d,m,C,_,w,T){const D=(o+d)/2,P=(u+m)/2,V=new de(D,P);w(V),function(O,U,X,ee,se,xe){const Ie=X-se,$e=ee-xe;return Math.abs((ee-U)*Ie-(X-O)*$e)/Math.hypot(Ie,$e)}(V.x,V.y,C.x,C.y,_.x,_.y)>=T?(yd(a,o,u,D,P,C,V,w,T),yd(a,D,P,d,m,V,_,w,T)):a.push(_)}function a4(a,o,u){const d=[];let m,C,_;for(const w of a){const{x:T,y:D}=w;o(w),_?yd(d,m,C,T,D,_,w,o,u):d.push(w),m=T,C=D,_=w}return d}const E5=Math.pow(2,14)-1,Ap=-E5-1;function wC(a,o){const u=Math.round(a.x*o),d=Math.round(a.y*o);return a.x=qi(u,Ap,E5),a.y=qi(d,Ap,E5),(ua.x+1||da.y+1)&&Fr("Geometry exceeds allowed extent, reduce your vector tile buffer size"),a}function cc(a,o,u){const d=a.loadGeometry(),m=a.extent,C=Yi/m;if(o&&u&&u.projection.isReprojectedInTileSpace){const _=1<{const U=i3((o.x+O.x/m)/_),X=qa((o.y+O.y/m)/_),ee=P.project(U,X);O.x=(ee.x*w-T)*m,O.y=(ee.y*w-D)*m};for(let O=0;O=m||X.y<0||X.y>=m||(V(X),U.push(X));d[O]=U}}for(const _ of d)for(const w of _)wC(w,C);return d}function l4(a,o){return{type:a.type,id:a.id,properties:a.properties,geometry:o?cc(a):[]}}function xa(a,o,u,d,m){a.emplaceBack(2*o+(d+1)/2,2*u+(m+1)/2)}class s2{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(u=>u.id),this.index=o.index,this.hasPattern=!1,this.layoutVertexArray=new _l,this.indexArray=new f1,this.segments=new Vs,this.programConfigurations=new lc(o.layers,o.zoom),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(o,u,d,m){const C=this.layers[0],_=[];let w=null;"circle"===C.type&&(w=C.layout.get("circle-sort-key"));for(const{feature:T,id:D,index:P,sourceLayerIndex:V}of o){const O=this.layers[0]._featureFilter.needGeometry,U=l4(T,O);if(!this.layers[0]._featureFilter.filter(new ui(this.zoom),U,d))continue;const X=w?w.evaluate(U,{},d):void 0,ee={id:D,properties:T.properties,type:T.type,sourceLayerIndex:V,index:P,geometry:O?U.geometry:cc(T,d,m),patterns:{},sortKey:X};_.push(ee)}w&&_.sort((T,D)=>T.sortKey-D.sortKey);for(const T of _){const{geometry:D,index:P,sourceLayerIndex:V}=T,O=o[P].feature;this.addFeature(T,D,P,u.availableImages,d),u.featureIndex.insert(O,D,P,V,this.index)}}update(o,u,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,u,this.stateDependentLayers,d,m)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,Ep),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(o,u,d,m,C){for(const _ of u)for(const w of _){const T=w.x,D=w.y;if(T<0||T>=Yi||D<0||D>=Yi)continue;const P=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,o.sortKey),V=P.vertexLength;xa(this.layoutVertexArray,T,D,-1,-1),xa(this.layoutVertexArray,T,D,1,-1),xa(this.layoutVertexArray,T,D,1,1),xa(this.layoutVertexArray,T,D,-1,1),this.indexArray.emplaceBack(V,V+1,V+2),this.indexArray.emplaceBack(V,V+3,V+2),P.vertexLength+=4,P.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,d,{},m,C)}}function D5(a,o){for(let u=0;u1){if(A5(a,o))return!0;for(let d=0;d1?u:u.sub(o)._mult(m)._add(o))}function zp(a,o){let u,d,m,C=!1;for(let _=0;_o.y!=m.y>o.y&&o.x<(m.x-d.x)*(o.y-d.y)/(m.y-d.y)+d.x&&(C=!C)}return C}function wu(a,o){let u=!1;for(let d=0,m=a.length-1;do.y!=_.y>o.y&&o.x<(_.x-C.x)*(o.y-C.y)/(_.y-C.y)+C.x&&(u=!u)}return u}function Pp(a,o,u,d,m){for(const _ of a)if(o<=_.x&&u<=_.y&&d>=_.x&&m>=_.y)return!0;const C=[new de(o,u),new de(o,m),new de(d,m),new de(d,u)];if(a.length>2)for(const _ of C)if(wu(a,_))return!0;for(let _=0;_m.x&&o.x>m.x||a.ym.y&&o.y>m.y)return!1;const C=Oo(a,o,u[0]);return C!==Oo(a,o,u[1])||C!==Oo(a,o,u[2])||C!==Oo(a,o,u[3])}function Mu(a,o,u){const d=o.paint.get(a).value;return"constant"===d.kind?d.value:u.programConfigurations.get(o.id).getMaxValue(a)}function r3(a){return Math.sqrt(a[0]*a[0]+a[1]*a[1])}function k5(a,o,u,d,m){if(!o[0]&&!o[1])return a;const C=de.convert(o)._mult(m);"viewport"===u&&C._rotate(-d);const _=[];for(let w=0;w{const D=tn([],T,o),P=1/D[3]/u*C;return(V=D)[0]=(O=D)[0]*(U=[P,P,m?1/D[3]:P,P])[0],V[1]=O[1]*U[1],V[2]=O[2]*U[2],V[3]=O[3]*U[3],V;var V,O,U}),w=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(T=>{const D=Dt([],Rn([],Ot([],_[T[0]],_[T[1]]),Ot([],_[T[2]],_[T[1]]))),P=-Qt(D,_[T[1]]);return D.concat(P)});return new xd(_,w)}}class o2{constructor(o,u){this.min=o,this.max=u,this.center=lt([],nt([],this.min,this.max),.5)}quadrant(o){const u=[o%2==0,o<2],d=Ge(this.min),m=Ge(this.max);for(let C=0;C=0;if(0===_)return 0;_!==u.length&&(d=!1)}if(d)return 2;for(let m=0;m<3;m++){let C=Number.MAX_VALUE,_=-Number.MAX_VALUE;for(let w=0;wthis.max[m]-this.min[m])return 0}return 1}}function LC(a,o,u,d,m,C,_,w,T){if(C&&a.queryGeometry.isAboveHorizon)return!1;C&&(T*=a.pixelToTileUnitsFactor);for(const D of o)for(const P of D){const V=P.add(w),O=m&&u.elevation?u.elevation.exaggeration()*m.getElevationAt(V.x,V.y,!0):0,U=C?V:EM(V,O,d),X=C?a.tilespaceRays.map(se=>z5(se,O)):a.queryGeometry.screenGeometry,ee=tn([],[P.x,P.y,O,1],d);if(!_&&C?T*=ee[3]/u.cameraToCenterDistance:_&&!C&&(T*=u.cameraToCenterDistance/ee[3]),MC(X,U,T))return!0}return!1}function EM(a,o,u){const d=tn([],[a.x,a.y,o,1],u);return new de(d[0]/d[3],d[1]/d[3])}const EC=je(0,0,0),I5=je(0,0,1);function z5(a,o){const u=ce();return EC[2]=o,a.intersectsPlane(EC,I5,u),new de(u[0],u[1])}class bd extends s2{}function Fp(a,{width:o,height:u},d,m){if(m){if(m instanceof Uint8ClampedArray)m=new Uint8Array(m.buffer);else if(m.length!==o*u*d)throw new RangeError("mismatched image size")}else m=new Uint8Array(o*u*d);return a.width=o,a.height=u,a.data=m,a}function DC(a,{width:o,height:u},d){if(o===a.width&&u===a.height)return;const m=Fp({},{width:o,height:u},d);wd(a,m,{x:0,y:0},{x:0,y:0},{width:Math.min(a.width,o),height:Math.min(a.height,u)},d),a.width=o,a.height=u,a.data=m.data}function wd(a,o,u,d,m,C){if(0===m.width||0===m.height)return o;if(m.width>a.width||m.height>a.height||u.x>a.width-m.width||u.y>a.height-m.height)throw new RangeError("out of range source coordinates for image copy");if(m.width>o.width||m.height>o.height||d.x>o.width-m.width||d.y>o.height-m.height)throw new RangeError("out of range destination coordinates for image copy");const _=a.data,w=o.data;for(let T=0;T{o[a.evaluationKey]=T;const D=a.expression.evaluate(o);m.data[_+w+0]=Math.floor(255*D.r/D.a),m.data[_+w+1]=Math.floor(255*D.g/D.a),m.data[_+w+2]=Math.floor(255*D.b/D.a),m.data[_+w+3]=Math.floor(255*D.a)};if(a.clips)for(let _=0,w=0;_80*u){d=C=a[0],m=_=a[1];for(var X=u;XC&&(C=w),T>_&&(_=T);D=0!==(D=Math.max(C-d,_-m))?1/D:0}return R1(O,U,u,d,m,D),U}function o3(a,o,u,d,m){var C,_;if(m===O5(a,o,u,d)>0)for(C=o;C=o;C-=d)_=F5(C,a[C],a[C+1],_);return _&&$h(_,_.next)&&(Gh(_),_=_.next),_}function a3(a,o){if(!a)return a;o||(o=a);var u,d=a;do{if(u=!1,d.steiner||!$h(d,d.next)&&0!==Ms(d.prev,d,d.next))d=d.next;else{if(Gh(d),(d=o=d.prev)===d.next)break;u=!0}}while(u||d!==o);return o}function R1(a,o,u,d,m,C,_){if(a){!_&&C&&function(P,V,O,U){var X=P;do{null===X.z&&(X.z=Hp(X.x,X.y,V,O,U)),X.prevZ=X.prev,X.nextZ=X.next,X=X.next}while(X!==P);X.prevZ.nextZ=null,X.prevZ=null,function(ee){var se,xe,Ie,$e,Ke,rt,st,Rt,Vt=1;do{for(xe=ee,ee=null,Ke=null,rt=0;xe;){for(rt++,Ie=xe,st=0,se=0;se0||Rt>0&&Ie;)0!==st&&(0===Rt||!Ie||xe.z<=Ie.z)?($e=xe,xe=xe.nextZ,st--):($e=Ie,Ie=Ie.nextZ,Rt--),Ke?Ke.nextZ=$e:ee=$e,$e.prevZ=Ke,Ke=$e;xe=Ie}Ke.nextZ=null,Vt*=2}while(rt>1)}(X)}(a,d,m,C);for(var w,T,D=a;a.prev!==a.next;)if(w=a.prev,T=a.next,C?IC(a,d,m,C):Rp(a))o.push(w.i/u),o.push(a.i/u),o.push(T.i/u),Gh(a),a=T.next,D=T.next;else if((a=T)===D){_?1===_?R1(a=zC(a3(a),o,u),o,u,d,m,C,2):2===_&&PC(a,o,u,d,m,C):R1(a3(a),o,u,d,m,C,1);break}}}function Rp(a){var o=a.prev,u=a,d=a.next;if(Ms(o,u,d)>=0)return!1;for(var m=a.next.next;m!==a.prev;){if(fo(o.x,o.y,u.x,u.y,d.x,d.y,m.x,m.y)&&Ms(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function IC(a,o,u,d){var m=a.prev,C=a,_=a.next;if(Ms(m,C,_)>=0)return!1;for(var w=m.x>C.x?m.x>_.x?m.x:_.x:C.x>_.x?C.x:_.x,T=m.y>C.y?m.y>_.y?m.y:_.y:C.y>_.y?C.y:_.y,D=Hp(m.x=D&&O&&O.z<=P;){if(V!==a.prev&&V!==a.next&&fo(m.x,m.y,C.x,C.y,_.x,_.y,V.x,V.y)&&Ms(V.prev,V,V.next)>=0||(V=V.prevZ,O!==a.prev&&O!==a.next&&fo(m.x,m.y,C.x,C.y,_.x,_.y,O.x,O.y)&&Ms(O.prev,O,O.next)>=0))return!1;O=O.nextZ}for(;V&&V.z>=D;){if(V!==a.prev&&V!==a.next&&fo(m.x,m.y,C.x,C.y,_.x,_.y,V.x,V.y)&&Ms(V.prev,V,V.next)>=0)return!1;V=V.prevZ}for(;O&&O.z<=P;){if(O!==a.prev&&O!==a.next&&fo(m.x,m.y,C.x,C.y,_.x,_.y,O.x,O.y)&&Ms(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function zC(a,o,u){var d=a;do{var m=d.prev,C=d.next.next;!$h(m,C)&&ua(m,d,d.next,C)&&jh(m,C)&&jh(C,m)&&(o.push(m.i/u),o.push(d.i/u),o.push(C.i/u),Gh(d),Gh(d.next),d=a=C),d=d.next}while(d!==a);return a3(d)}function PC(a,o,u,d,m,C){var _=a;do{for(var w=_.next.next;w!==_.prev;){if(_.i!==w.i&&V5(_,w)){var T=Bp(_,w);return _=a3(_,_.next),T=a3(T,T.next),R1(_,o,u,d,m,C),void R1(T,o,u,d,m,C)}w=w.next}_=_.next}while(_!==a)}function VC(a,o){return a.x-o.x}function FC(a,o){var u=function(C,_){var w,T=_,D=C.x,P=C.y,V=-1/0;do{if(P<=T.y&&P>=T.next.y&&T.next.y!==T.y){var O=T.x+(P-T.y)*(T.next.x-T.x)/(T.next.y-T.y);if(O<=D&&O>V){if(V=O,O===D){if(P===T.y)return T;if(P===T.next.y)return T.next}w=T.x=T.x&&T.x>=ee&&D!==T.x&&fo(Pw.x||T.x===w.x&&DM(w,T)))&&(w=T,xe=U)),T=T.next}while(T!==X);return w}(a,o);if(!u)return o;var d=Bp(u,a),m=a3(u,u.next);return a3(d,d.next),o===u?m:o}function DM(a,o){return Ms(a.prev,a,o.prev)<0&&Ms(o.next,a,a.next)<0}function Hp(a,o,u,d,m){return(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=32767*(a-u)*m)|a<<8))|a<<4))|a<<2))|a<<1))|(o=1431655765&((o=858993459&((o=252645135&((o=16711935&((o=32767*(o-d)*m)|o<<8))|o<<4))|o<<2))|o<<1))<<1}function Uh(a){var o=a,u=a;do{(o.x=0&&(a-_)*(d-w)-(u-_)*(o-w)>=0&&(u-_)*(C-w)-(m-_)*(d-w)>=0}function V5(a,o){return a.next.i!==o.i&&a.prev.i!==o.i&&!function(u,d){var m=u;do{if(m.i!==u.i&&m.next.i!==u.i&&m.i!==d.i&&m.next.i!==d.i&&ua(m,m.next,u,d))return!0;m=m.next}while(m!==u);return!1}(a,o)&&(jh(a,o)&&jh(o,a)&&function(u,d){var m=u,C=!1,_=(u.x+d.x)/2,w=(u.y+d.y)/2;do{m.y>w!=m.next.y>w&&m.next.y!==m.y&&_<(m.next.x-m.x)*(w-m.y)/(m.next.y-m.y)+m.x&&(C=!C),m=m.next}while(m!==u);return C}(a,o)&&(Ms(a.prev,a,o.prev)||Ms(a,o.prev,o))||$h(a,o)&&Ms(a.prev,a,a.next)>0&&Ms(o.prev,o,o.next)>0)}function Ms(a,o,u){return(o.y-a.y)*(u.x-o.x)-(o.x-a.x)*(u.y-o.y)}function $h(a,o){return a.x===o.x&&a.y===o.y}function ua(a,o,u,d){var m=Tu(Ms(a,o,u)),C=Tu(Ms(a,o,d)),_=Tu(Ms(u,d,a)),w=Tu(Ms(u,d,o));return m!==C&&_!==w||!(0!==m||!l3(a,u,o))||!(0!==C||!l3(a,d,o))||!(0!==_||!l3(u,a,d))||!(0!==w||!l3(u,o,d))}function l3(a,o,u){return o.x<=Math.max(a.x,u.x)&&o.x>=Math.min(a.x,u.x)&&o.y<=Math.max(a.y,u.y)&&o.y>=Math.min(a.y,u.y)}function Tu(a){return a>0?1:a<0?-1:0}function jh(a,o){return Ms(a.prev,a,a.next)<0?Ms(a,o,a.next)>=0&&Ms(a,a.prev,o)>=0:Ms(a,o,a.prev)<0||Ms(a,a.next,o)<0}function Bp(a,o){var u=new Sd(a.i,a.x,a.y),d=new Sd(o.i,o.x,o.y),m=a.next,C=o.prev;return a.next=o,o.prev=a,u.next=m,m.prev=u,d.next=u,u.prev=d,C.next=d,d.prev=C,d}function F5(a,o,u,d){var m=new Sd(a,o,u);return d?(m.next=d.next,m.prev=d,d.next.prev=m,d.next=m):(m.prev=m,m.next=m),m}function Gh(a){a.next.prev=a.prev,a.prev.next=a.next,a.prevZ&&(a.prevZ.nextZ=a.nextZ),a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function Sd(a,o,u){this.i=a,this.x=o,this.y=u,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O5(a,o,u,d){for(var m=0,C=o,_=u-d;Cu;){if(d-u>600){var C=d-u+1,_=o-u+1,w=Math.log(C),T=.5*Math.exp(2*w/3),D=.5*Math.sqrt(w*T*(C-T)/C)*(_-C/2<0?-1:1);$p(a,o,Math.max(u,Math.floor(o-_*T/C+D)),Math.min(d,Math.floor(o+(C-_)*T/C+D)),m)}var P=a[o],V=u,O=d;for(Wh(a,u,o),m(a[d],P)>0&&Wh(a,u,d);V0;)O--}0===m(a[u],P)?Wh(a,u,O):Wh(a,++O,d),O<=o&&(u=O+1),o<=O&&(d=O-1)}}function Wh(a,o,u){var d=a[o];a[o]=a[u],a[u]=d}function OC(a,o){return ao?1:0}function Td(a,o){const u=a.length;if(u<=1)return[a];const d=[];let m,C;for(let _=0;_1)for(let _=0;_0&&u.holes.push(d+=a[m-1].length)}return u},Su.default=kC;class H5{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(u=>u.id),this.index=o.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new _l,this.indexArray=new f1,this.indexArray2=new bl,this.programConfigurations=new lc(o.layers,o.zoom),this.segments=new Vs,this.segments2=new Vs,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(o,u,d,m){this.hasPattern=Ld("fill",this.layers,u);const C=this.layers[0].layout.get("fill-sort-key"),_=[];for(const{feature:w,id:T,index:D,sourceLayerIndex:P}of o){const V=this.layers[0]._featureFilter.needGeometry,O=l4(w,V);if(!this.layers[0]._featureFilter.filter(new ui(this.zoom),O,d))continue;const U=C?C.evaluate(O,{},d,u.availableImages):void 0,X={id:T,properties:w.properties,type:w.type,sourceLayerIndex:P,index:D,geometry:V?O.geometry:cc(w,d,m),patterns:{},sortKey:U};_.push(X)}C&&_.sort((w,T)=>w.sortKey-T.sortKey);for(const w of _){const{geometry:T,index:D,sourceLayerIndex:P}=w;if(this.hasPattern){const V=R5("fill",this.layers,w,this.zoom,u);this.patternFeatures.push(V)}else this.addFeature(w,T,D,d,{},u.availableImages);u.featureIndex.insert(o[D].feature,T,D,P,this.index)}}update(o,u,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,u,this.stateDependentLayers,d,m)}addFeatures(o,u,d,m){for(const C of this.patternFeatures)this.addFeature(C,C.geometry,C.index,u,d,m)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,Np),this.indexBuffer=o.createIndexBuffer(this.indexArray),this.indexBuffer2=o.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(o),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(o,u,d,m,C,_=[]){for(const w of Td(u,500)){let T=0;for(const X of w)T+=X.length;const D=this.segments.prepareSegment(T,this.layoutVertexArray,this.indexArray),P=D.vertexLength,V=[],O=[];for(const X of w){if(0===X.length)continue;X!==w[0]&&O.push(V.length/2);const ee=this.segments2.prepareSegment(X.length,this.layoutVertexArray,this.indexArray2),se=ee.vertexLength;this.layoutVertexArray.emplaceBack(X[0].x,X[0].y),this.indexArray2.emplaceBack(se+X.length-1,se),V.push(X[0].x),V.push(X[0].y);for(let xe=1;xe>3}if(m--,1===d||2===d)C+=a.readSVarint(),_+=a.readSVarint(),1===d&&(o&&w.push(o),o=[]),o.push(new de(C,_));else{if(7!==d)throw new Error("unknown command "+d);o&&o.push(o[0].clone())}}return o&&w.push(o),w},Lu.prototype.bbox=function(){var a=this._pbf;a.pos=this._geometry;for(var o=a.readVarint()+a.pos,u=1,d=0,m=0,C=0,_=1/0,w=-1/0,T=1/0,D=-1/0;a.pos>3}if(d--,1===u||2===u)(m+=a.readSVarint())<_&&(_=m),m>w&&(w=m),(C+=a.readSVarint())D&&(D=C);else if(7!==u)throw new Error("unknown command "+u)}return[_,T,w,D]},Lu.prototype.toGeoJSON=function(a,o,u){var d,m,C=this.extent*Math.pow(2,u),_=this.extent*a,w=this.extent*o,T=this.loadGeometry(),D=Lu.types[this.type];function P(U){for(var X=0;X>3;m=1===_?d.readString():2===_?d.readFloat():3===_?d.readDouble():4===_?d.readVarint64():5===_?d.readVarint():6===_?d.readSVarint():7===_?d.readBoolean():null}return m}(u))}function qp(a,o,u){if(3===a){var d=new Wp(u,u.readVarint()+u.pos);d.length&&(o[d.name]=d)}}qh.prototype.feature=function(a){if(a<0||a>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[a];var o=this._pbf.readVarint()+this._pbf.pos;return new Gp(this._pbf,o,this.extent,this._keys,this._values)};var u4={VectorTile:function(a,o){this.layers=a.readFields(qp,{},o)},VectorTileFeature:Gp,VectorTileLayer:Wp};const UC=u4.VectorTileFeature.types,Xp=Math.pow(2,13);function Dd(a,o,u,d,m,C,_,w){a.emplaceBack((o<<1)+_,(u<<1)+C,(Math.floor(d*Xp)<<1)+m,Math.round(w))}class B5{constructor(){this.acc=new de(0,0),this.polyCount=[]}startRing(o){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new de(o.x,o.y),this.max=new de(o.x,o.y))}append(o,u){this.currentPolyCount.edges++,this.acc._add(o);let d=!!this.borders;const m=this.min,C=this.max;o.xC.x&&(C.x=o.x,d=!0),o.yC.y&&(C.y=o.y,d=!0),((0===o.x||o.x===Yi)&&o.x===u.x)!=((0===o.y||o.y===Yi)&&o.y===u.y)&&this.processBorderOverlap(o,u),d&&this.checkBorderIntersection(o,u)}checkBorderIntersection(o,u){u.x<0!=o.x<0&&this.addBorderIntersection(0,Fi(u.y,o.y,(0-u.x)/(o.x-u.x))),u.x>Yi!=o.x>Yi&&this.addBorderIntersection(1,Fi(u.y,o.y,(Yi-u.x)/(o.x-u.x))),u.y<0!=o.y<0&&this.addBorderIntersection(2,Fi(u.x,o.x,(0-u.y)/(o.y-u.y))),u.y>Yi!=o.y>Yi&&this.addBorderIntersection(3,Fi(u.x,o.x,(Yi-u.y)/(o.y-u.y)))}addBorderIntersection(o,u){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const d=this.borders[o];ud[1]&&(d[1]=u)}processBorderOverlap(o,u){if(o.x===u.x){if(o.y===u.y)return;const d=0===o.x?0:1;this.addBorderIntersection(d,u.y),this.addBorderIntersection(d,o.y)}else{const d=0===o.y?2:3;this.addBorderIntersection(d,u.x),this.addBorderIntersection(d,o.x)}}centroid(){const o=this.polyCount.reduce((u,d)=>u+d.edges,0);return 0!==o?this.acc.div(o)._round():new de(0,0)}span(){return new de(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((o,u)=>o+ +(u[0]!==Number.MAX_VALUE),0)}}class Ad{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(u=>u.id),this.index=o.index,this.hasPattern=!1,this.layoutVertexArray=new Oh,this.centroidVertexArray=new n4,this.indexArray=new f1,this.programConfigurations=new lc(o.layers,o.zoom),this.segments=new Vs,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id),this.enableTerrain=o.enableTerrain}populate(o,u,d,m){this.features=[],this.hasPattern=Ld("fill-extrusion",this.layers,u),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDone=[!1,!1,!1,!1],this.tileToMeter=function(C){const _=Math.exp(Math.PI*(1-C.y/(1<se.x<=0)||T.every(se=>se.x>=Yi)||T.every(se=>se.y<=0)||T.every(se=>se.y>=Yi))continue;for(let se=0;se=1){const rt=xe[$e-1];if(!$C(Ke,rt)){w&&w.append(Ke,rt),V.vertexLength+4>Vs.MAX_VERTEX_ARRAY_LENGTH&&(V=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const st=Ke.sub(rt)._perp(),Rt=st.x/(Math.abs(st.x)+Math.abs(st.y)),Vt=st.y>0?1:0,Cn=rt.dist(Ke);Ie+Cn>32768&&(Ie=0),Dd(this.layoutVertexArray,Ke.x,Ke.y,Rt,Vt,0,0,Ie),Dd(this.layoutVertexArray,Ke.x,Ke.y,Rt,Vt,0,1,Ie),Ie+=Cn,Dd(this.layoutVertexArray,rt.x,rt.y,Rt,Vt,0,0,Ie),Dd(this.layoutVertexArray,rt.x,rt.y,Rt,Vt,0,1,Ie);const dn=V.vertexLength;this.indexArray.emplaceBack(dn,dn+2,dn+1),this.indexArray.emplaceBack(dn+1,dn+2,dn+3),V.vertexLength+=4,V.primitiveLength+=2}}}}if(V.vertexLength+P>Vs.MAX_VERTEX_ARRAY_LENGTH&&(V=this.segments.prepareSegment(P,this.layoutVertexArray,this.indexArray)),"Polygon"!==UC[o.type])continue;const O=[],U=[],X=V.vertexLength;for(let se=0;se0){if(w.borders){w.vertexArrayOffset=this.centroidVertexArray.length;const D=w.borders,P=this.featuresOnBorder.push(w)-1;for(let V=0;V<4;V++)D[V][0]!==Number.MAX_VALUE&&this.borders[V].push(P)}this.encodeCentroid(w.borders?void 0:w.centroid(),w)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,d,C,_,m)}sortBorders(){for(let o=0;o<4;o++)this.borders[o].sort((u,d)=>this.featuresOnBorder[u].borders[o][0]-this.featuresOnBorder[d].borders[o][0])}encodeCentroid(o,u,d=!0){let m,C;if(o)if(0!==o.y){const w=u.span()._mult(this.tileToMeter);m=(Math.max(o.x,1)<<3)+Math.min(7,Math.round(w.x/10)),C=(Math.max(o.y,1)<<3)+Math.min(7,Math.round(w.y/10))}else m=Math.ceil(7*(o.x+450)),C=0;else m=0,C=+d;let _=d?this.centroidVertexArray.length:u.vertexArrayOffset;for(const w of u.polyCount){d&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*w.edges+w.top);for(let T=0;T<2*w.edges;T++)this.centroidVertexArray.emplace(_++,0,C),this.centroidVertexArray.emplace(_++,m,C);for(let T=0;TYi)||a.y===o.y&&(a.y<0||a.y>Yi)}En("FillExtrusionBucket",Ad,{omit:["layers","features"]}),En("PartMetadata",B5);var jC={paint:new $o({"fill-extrusion-opacity":new Xt(it["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ei(it["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Xt(it["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Xt(it["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Zs(it["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ei(it["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ei(it["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Xt(it["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function Sl(a,o){return a.x*o.x+a.y*o.y}function B2(a,o){if(1===a.length){let u=0;const d=o[u++];let m;for(;!m||d.equals(m);)if(m=o[u++],!m)return 1/0;for(;uu.id),this.index=o.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(u=>{this.gradients[u.id]={}}),this.layoutVertexArray=new Ys,this.layoutVertexArray2=new sc,this.indexArray=new f1,this.programConfigurations=new lc(o.layers,o.zoom),this.segments=new Vs,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(o,u,d,m){this.hasPattern=Ld("line",this.layers,u);const C=this.layers[0].layout.get("line-sort-key"),_=[];for(const{feature:P,id:V,index:O,sourceLayerIndex:U}of o){const X=this.layers[0]._featureFilter.needGeometry,ee=l4(P,X);if(!this.layers[0]._featureFilter.filter(new ui(this.zoom),ee,d))continue;const se=C?C.evaluate(ee,{},d):void 0,xe={id:V,properties:P.properties,type:P.type,sourceLayerIndex:U,index:O,geometry:X?ee.geometry:cc(P,d,m),patterns:{},sortKey:se};_.push(xe)}C&&_.sort((P,V)=>P.sortKey-V.sortKey);const{lineAtlas:w,featureIndex:T}=u,D=this.addConstantDashes(w);for(const P of _){const{geometry:V,index:O,sourceLayerIndex:U}=P;if(D&&this.addFeatureDashes(P,w),this.hasPattern){const X=R5("line",this.layers,P,this.zoom,u);this.patternFeatures.push(X)}else this.addFeature(P,V,O,d,w.positions,u.availableImages);T.insert(o[O].feature,V,O,U,this.index)}}addConstantDashes(o){let u=!1;for(const d of this.layers){const m=d.paint.get("line-dasharray").value,C=d.layout.get("line-cap").value;if("constant"!==m.kind||"constant"!==C.kind)u=!0;else{const _=C.value,w=m.value;if(!w)continue;o.addDash(w.from,_),o.addDash(w.to,_),w.other&&o.addDash(w.other,_)}}return u}addFeatureDashes(o,u){const d=this.zoom;for(const m of this.layers){const C=m.paint.get("line-dasharray").value,_=m.layout.get("line-cap").value;if("constant"===C.kind&&"constant"===_.kind)continue;let w,T,D,P,V,O;if("constant"===C.kind){const se=C.value;if(!se)continue;w=se.other||se.to,T=se.to,D=se.from}else w=C.evaluate({zoom:d-1},o),T=C.evaluate({zoom:d},o),D=C.evaluate({zoom:d+1},o);"constant"===_.kind?P=V=O=_.value:(P=_.evaluate({zoom:d-1},o),V=_.evaluate({zoom:d},o),O=_.evaluate({zoom:d+1},o)),u.addDash(w,P),u.addDash(T,V),u.addDash(D,O);const U=u.getKey(w,P),X=u.getKey(T,V),ee=u.getKey(D,O);o.patterns[m.id]={min:U,mid:X,max:ee}}}update(o,u,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,u,this.stateDependentLayers,d,m)}addFeatures(o,u,d,m){for(const C of this.patternFeatures)this.addFeature(C,C.geometry,C.index,u,d,m)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=o.createVertexBuffer(this.layoutVertexArray2,U5)),this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,kM),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(o){if(o.properties&&o.properties.hasOwnProperty("mapbox_clip_start")&&o.properties.hasOwnProperty("mapbox_clip_end"))return{start:+o.properties.mapbox_clip_start,end:+o.properties.mapbox_clip_end}}addFeature(o,u,d,m,C,_){const w=this.layers[0].layout,T=w.get("line-join").evaluate(o,{}),D=w.get("line-cap").evaluate(o,{}),P=w.get("line-miter-limit"),V=w.get("line-round-limit");this.lineClips=this.lineFeatureClips(o);for(const O of u)this.addLine(O,o,T,D,P,V);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,d,C,_,m)}addLine(o,u,d,m,C,_){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let xe=0;xe=2&&o[T-1].equals(o[T-2]);)T--;let D=0;for(;D0;if(Rt&&xe>D){const Ht=O.dist(U);if(Ht>2*P){const cn=O.sub(O.sub(U)._mult(P/Ht)._round());this.updateDistance(U,cn),this.addCurrentVertex(cn,ee,0,0,V),U=cn}}const Cn=U&&X;let dn=Cn?d:w?"butt":m;if(Cn&&"round"===dn&&(rt<_?dn="miter":rt<=2&&(dn="fakeround")),"miter"===dn&&rt>C&&(dn="bevel"),"bevel"===dn&&(rt>2&&(dn="flipbevel"),rt100)Ie=se.mult(-1);else{const Ht=rt*ee.add(se).mag()/ee.sub(se).mag();Ie._perp()._mult(Ht*(Vt?-1:1))}this.addCurrentVertex(O,Ie,0,0,V),this.addCurrentVertex(O,Ie.mult(-1),0,0,V)}else if("bevel"===dn||"fakeround"===dn){const Ht=-Math.sqrt(rt*rt-1),cn=Vt?Ht:0,yn=Vt?0:Ht;if(U&&this.addCurrentVertex(O,ee,cn,yn,V),"fakeround"===dn){const Kt=Math.round(180*st/Math.PI/20);for(let Dn=1;Dn2*P){const cn=O.add(X.sub(O)._mult(P/Ht)._round());this.updateDistance(O,cn),this.addCurrentVertex(cn,se,0,0,V),O=cn}}}}addCurrentVertex(o,u,d,m,C,_=!1){const w=u.y*m-u.x,T=-u.y-u.x*m;this.addHalfVertex(o,u.x+u.y*d,u.y-u.x*d,_,!1,d,C),this.addHalfVertex(o,w,T,_,!0,-m,C)}addHalfVertex({x:o,y:u},d,m,C,_,w,T){this.layoutVertexArray.emplaceBack((o<<1)+(C?1:0),(u<<1)+(_?1:0),Math.round(63*d)+128,Math.round(63*m)+128,1+(0===w?0:w<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineSoFar);const D=T.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,D),T.primitiveLength++),_?this.e2=D:this.e1=D}updateScaledDistance(){if(this.lineClips){const o=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=o*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(o,u){this.distance+=o.dist(u),this.updateScaledDistance()}}En("LineBucket",Xh,{omit:["layers","patternFeatures"]});const Zh=new $o({"line-cap":new ei(it.layout_line["line-cap"]),"line-join":new ei(it.layout_line["line-join"]),"line-miter-limit":new Xt(it.layout_line["line-miter-limit"]),"line-round-limit":new Xt(it.layout_line["line-round-limit"]),"line-sort-key":new ei(it.layout_line["line-sort-key"])});var j5={paint:new $o({"line-opacity":new ei(it.paint_line["line-opacity"]),"line-color":new ei(it.paint_line["line-color"]),"line-translate":new Xt(it.paint_line["line-translate"]),"line-translate-anchor":new Xt(it.paint_line["line-translate-anchor"]),"line-width":new ei(it.paint_line["line-width"]),"line-gap-width":new ei(it.paint_line["line-gap-width"]),"line-offset":new ei(it.paint_line["line-offset"]),"line-blur":new ei(it.paint_line["line-blur"]),"line-dasharray":new Zs(it.paint_line["line-dasharray"]),"line-pattern":new Zs(it.paint_line["line-pattern"]),"line-gradient":new rc(it.paint_line["line-gradient"])}),layout:Zh};const G5=new class extends ei{possiblyEvaluate(a,o){return o=new ui(Math.floor(o.zoom),{now:o.now,fadeDuration:o.fadeDuration,zoomHistory:o.zoomHistory,transition:o.transition}),super.possiblyEvaluate(a,o)}evaluate(a,o,u,d){return o=Li({},o,{zoom:Math.floor(o.zoom)}),super.evaluate(a,o,u,d)}}(j5.paint.properties["line-width"].specification);function kd(a,o){return o>0?o+2*a:a}G5.useIntegerZoom=!0;const W5=ps([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_z_tile_anchor",components:4,type:"Int16"}],4),Yp=ps([{name:"a_projected_pos",components:3,type:"Float32"}],4);ps([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const IM=ps([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Eu=ps([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);ps([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Id=ps([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Kp=ps([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);ps([{name:"triangle",components:3,type:"Uint16"}]),ps([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),ps([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ps([{type:"Float32",name:"offsetX"}]),ps([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const l2=128;function q5(a,o){const{expression:u}=o;if("constant"===u.kind)return{kind:"constant",layoutSize:u.evaluate(new ui(a+1))};if("source"===u.kind)return{kind:"source"};{const{zoomStops:d,interpolationType:m}=u;let C=0;for(;C{d.text=function(m,C,_){const w=C.layout.get("text-transform").evaluate(_,{});return"uppercase"===w?m=m.toLocaleUpperCase():"lowercase"===w&&(m=m.toLocaleLowerCase()),Hi.applyArabicShaping&&(m=Hi.applyArabicShaping(m)),m}(d.text,o,u)}),a}const Yh={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};function Qp(a){return"\ufe36"===a||"\ufe48"===a||"\ufe38"===a||"\ufe44"===a||"\ufe42"===a||"\ufe3e"===a||"\ufe3c"===a||"\ufe3a"===a||"\ufe18"===a||"\ufe40"===a||"\ufe10"===a||"\ufe13"===a||"\ufe14"===a||"\uff40"===a||"\uffe3"===a||"\ufe11"===a||"\ufe12"===a}function X5(a){return"\ufe35"===a||"\ufe47"===a||"\ufe37"===a||"\ufe43"===a||"\ufe41"===a||"\ufe3d"===a||"\ufe3b"===a||"\ufe39"===a||"\ufe17"===a||"\ufe3f"===a}var Z5=function(a,o,u,d,m){var C,_,w=8*m-d-1,T=(1<>1,P=-7,V=u?m-1:0,O=u?-1:1,U=a[o+V];for(V+=O,C=U&(1<<-P)-1,U>>=-P,P+=w;P>0;C=256*C+a[o+V],V+=O,P-=8);for(_=C&(1<<-P)-1,C>>=-P,P+=d;P>0;_=256*_+a[o+V],V+=O,P-=8);if(0===C)C=1-D;else{if(C===T)return _?NaN:1/0*(U?-1:1);_+=Math.pow(2,d),C-=D}return(U?-1:1)*_*Math.pow(2,C-d)},Pd=function(a,o,u,d,m,C){var _,w,T,D=8*C-m-1,P=(1<>1,O=23===m?Math.pow(2,-24)-Math.pow(2,-77):0,U=d?0:C-1,X=d?1:-1,ee=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,_=P):(_=Math.floor(Math.log(o)/Math.LN2),o*(T=Math.pow(2,-_))<1&&(_--,T*=2),(o+=_+V>=1?O/T:O*Math.pow(2,1-V))*T>=2&&(_++,T/=2),_+V>=P?(w=0,_=P):_+V>=1?(w=(o*T-1)*Math.pow(2,m),_+=V):(w=o*Math.pow(2,V-1)*Math.pow(2,m),_=0));m>=8;a[u+U]=255&w,U+=X,w/=256,m-=8);for(_=_<0;a[u+U]=255&_,U+=X,_/=256,D-=8);a[u+U-X]|=128*ee},Kh=Rr;function Rr(a){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(a)?a:new Uint8Array(a||0),this.pos=0,this.type=0,this.length=this.buf.length}Rr.Varint=0,Rr.Fixed64=1,Rr.Bytes=2,Rr.Fixed32=5;var Vd=4294967296,Y5=1/Vd,c3="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Tl(a){return a.type===Rr.Bytes?a.readVarint()+a.pos:a.pos+1}function Jp(a,o,u){var d=o<=16383?1:o<=2097151?2:o<=268435455?3:Math.floor(Math.log(o)/(7*Math.LN2));u.realloc(d);for(var m=u.pos-1;m>=a;m--)u.buf[m+d]=u.buf[m]}function Fd(a,o){for(var u=0;u>>8,a[u+2]=o>>>16,a[u+3]=o>>>24}function Q5(a,o){return(a[o]|a[o+1]<<8|a[o+2]<<16)+(a[o+3]<<24)}function J5(a,o,u){o.glyphs=[],1===a&&u.readMessage(Jh,o)}function Jh(a,o,u){if(3===a){const{id:d,bitmap:m,width:C,height:_,left:w,top:T,advance:D}=u.readMessage(YC,{});o.glyphs.push({id:d,bitmap:new s3({width:C+6,height:_+6},m),metrics:{width:C,height:_,left:w,top:T,advance:D}})}else 4===a?o.ascender=u.readSVarint():5===a&&(o.descender=u.readSVarint())}function YC(a,o,u){1===a?o.id=u.readVarint():2===a?o.bitmap=u.readBytes():3===a?o.width=u.readVarint():4===a?o.height=u.readVarint():5===a?o.left=u.readSVarint():6===a?o.top=u.readSVarint():7===a&&(o.advance=u.readVarint())}function Rd(a){let o=0,u=0;for(const _ of a)o+=_.w*_.h,u=Math.max(u,_.w);a.sort((_,w)=>w.h-_.h);const d=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(o/.95)),u),h:1/0}];let m=0,C=0;for(const _ of a)for(let w=d.length-1;w>=0;w--){const T=d[w];if(!(_.w>T.w||_.h>T.h)){if(_.x=T.x,_.y=T.y,C=Math.max(C,_.y+_.h),m=Math.max(m,_.x+_.w),_.w===T.w&&_.h===T.h){const D=d.pop();w>3,C=this.pos;this.type=7&d,a(m,o,this),this.pos===C&&this.skip(d)}return o},readMessage:function(a,o){return this.readFields(a,o,this.readVarint()+this.pos)},readFixed32:function(){var a=Qh(this.buf,this.pos);return this.pos+=4,a},readSFixed32:function(){var a=Q5(this.buf,this.pos);return this.pos+=4,a},readFixed64:function(){var a=Qh(this.buf,this.pos)+Qh(this.buf,this.pos+4)*Vd;return this.pos+=8,a},readSFixed64:function(){var a=Qh(this.buf,this.pos)+Q5(this.buf,this.pos+4)*Vd;return this.pos+=8,a},readFloat:function(){var a=Z5(this.buf,this.pos,!0,23,4);return this.pos+=4,a},readDouble:function(){var a=Z5(this.buf,this.pos,!0,52,8);return this.pos+=8,a},readVarint:function(a){var o,u,d=this.buf;return o=127&(u=d[this.pos++]),u<128?o:(o|=(127&(u=d[this.pos++]))<<7,u<128?o:(o|=(127&(u=d[this.pos++]))<<14,u<128?o:(o|=(127&(u=d[this.pos++]))<<21,u<128?o:function(m,C,_){var w,T,D=_.buf;if(w=(112&(T=D[_.pos++]))>>4,T<128||(w|=(127&(T=D[_.pos++]))<<3,T<128)||(w|=(127&(T=D[_.pos++]))<<10,T<128)||(w|=(127&(T=D[_.pos++]))<<17,T<128)||(w|=(127&(T=D[_.pos++]))<<24,T<128)||(w|=(1&(T=D[_.pos++]))<<31,T<128))return function(a,o,u){return u?4294967296*o+(a>>>0):4294967296*(o>>>0)+(a>>>0)}(m,w,C);throw new Error("Expected varint not more than 10 bytes")}(o|=(15&(u=d[this.pos]))<<28,a,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var a=this.readVarint();return a%2==1?(a+1)/-2:a/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var a=this.readVarint()+this.pos,o=this.pos;return this.pos=a,a-o>=12&&c3?c3.decode(this.buf.subarray(o,a)):function(u,d,m){for(var C="",_=d;_239?4:P>223?3:P>191?2:1;if(_+O>m)break;1===O?P<128&&(V=P):2===O?128==(192&(w=u[_+1]))&&(V=(31&P)<<6|63&w)<=127&&(V=null):3===O?(T=u[_+2],128==(192&(w=u[_+1]))&&128==(192&T)&&((V=(15&P)<<12|(63&w)<<6|63&T)<=2047||V>=55296&&V<=57343)&&(V=null)):4===O&&(T=u[_+2],D=u[_+3],128==(192&(w=u[_+1]))&&128==(192&T)&&128==(192&D)&&((V=(15&P)<<18|(63&w)<<12|(63&T)<<6|63&D)<=65535||V>=1114112)&&(V=null)),null===V?(V=65533,O=1):V>65535&&(V-=65536,C+=String.fromCharCode(V>>>10&1023|55296),V=56320|1023&V),C+=String.fromCharCode(V),_+=O}return C}(this.buf,o,a)},readBytes:function(){var a=this.readVarint()+this.pos,o=this.buf.subarray(this.pos,a);return this.pos=a,o},readPackedVarint:function(a,o){if(this.type!==Rr.Bytes)return a.push(this.readVarint(o));var u=Tl(this);for(a=a||[];this.pos127;);else if(o===Rr.Bytes)this.pos=this.readVarint()+this.pos;else if(o===Rr.Fixed32)this.pos+=4;else{if(o!==Rr.Fixed64)throw new Error("Unimplemented type: "+o);this.pos+=8}},writeTag:function(a,o){this.writeVarint(a<<3|o)},realloc:function(a){for(var o=this.length||16;o268435455||a<0?function(o,u){var d,m,C,w;if(o>=0?(d=o%4294967296|0,m=o/4294967296|0):(m=~(-o/4294967296),4294967295^(d=~(-o%4294967296))?d=d+1|0:(d=0,m=m+1|0)),o>=0x10000000000000000||o<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");u.realloc(10),C=d,(w=u).buf[w.pos++]=127&C|128,C>>>=7,w.buf[w.pos++]=127&C|128,C>>>=7,w.buf[w.pos++]=127&C|128,C>>>=7,w.buf[w.pos++]=127&C|128,w.buf[w.pos]=127&(C>>>=7),function(C,_){var w=(7&C)<<4;_.buf[_.pos++]|=w|((C>>>=3)?128:0),C&&(_.buf[_.pos++]=127&C|((C>>>=7)?128:0),C&&(_.buf[_.pos++]=127&C|((C>>>=7)?128:0),C&&(_.buf[_.pos++]=127&C|((C>>>=7)?128:0),C&&(_.buf[_.pos++]=127&C|((C>>>=7)?128:0),C&&(_.buf[_.pos++]=127&C)))))}(m,u)}(a,this):(this.realloc(4),this.buf[this.pos++]=127&a|(a>127?128:0),a<=127||(this.buf[this.pos++]=127&(a>>>=7)|(a>127?128:0),a<=127||(this.buf[this.pos++]=127&(a>>>=7)|(a>127?128:0),a<=127||(this.buf[this.pos++]=a>>>7&127))))},writeSVarint:function(a){this.writeVarint(a<0?2*-a-1:2*a)},writeBoolean:function(a){this.writeVarint(Boolean(a))},writeString:function(a){a=String(a),this.realloc(4*a.length),this.pos++;var o=this.pos;this.pos=function(d,m,C){for(var _,w,T=0;T55295&&_<57344){if(!w){_>56319||T+1===m.length?(d[C++]=239,d[C++]=191,d[C++]=189):w=_;continue}if(_<56320){d[C++]=239,d[C++]=191,d[C++]=189,w=_;continue}_=w-55296<<10|_-56320|65536,w=null}else w&&(d[C++]=239,d[C++]=191,d[C++]=189,w=null);_<128?d[C++]=_:(_<2048?d[C++]=_>>6|192:(_<65536?d[C++]=_>>12|224:(d[C++]=_>>18|240,d[C++]=_>>12&63|128),d[C++]=_>>6&63|128),d[C++]=63&_|128)}return C}(this.buf,a,this.pos);var u=this.pos-o;u>=128&&Jp(o,u,this),this.pos=o-1,this.writeVarint(u),this.pos+=u},writeFloat:function(a){this.realloc(4),Pd(this.buf,a,this.pos,!0,23,4),this.pos+=4},writeDouble:function(a){this.realloc(8),Pd(this.buf,a,this.pos,!0,52,8),this.pos+=8},writeBytes:function(a){var o=a.length;this.writeVarint(o),this.realloc(o);for(var u=0;u=128&&Jp(u,d,this),this.pos=u-1,this.writeVarint(d),this.pos+=d},writeMessage:function(a,o,u){this.writeTag(a,Rr.Bytes),this.writeRawMessage(o,u)},writePackedVarint:function(a,o){o.length&&this.writeMessage(a,Fd,o)},writePackedSVarint:function(a,o){o.length&&this.writeMessage(a,ZC,o)},writePackedBoolean:function(a,o){o.length&&this.writeMessage(a,nm,o)},writePackedFloat:function(a,o){o.length&&this.writeMessage(a,em,o)},writePackedDouble:function(a,o){o.length&&this.writeMessage(a,tm,o)},writePackedFixed32:function(a,o){o.length&&this.writeMessage(a,K5,o)},writePackedSFixed32:function(a,o){o.length&&this.writeMessage(a,im,o)},writePackedFixed64:function(a,o){o.length&&this.writeMessage(a,Od,o)},writePackedSFixed64:function(a,o){o.length&&this.writeMessage(a,Nd,o)},writeBytesField:function(a,o){this.writeTag(a,Rr.Bytes),this.writeBytes(o)},writeFixed32Field:function(a,o){this.writeTag(a,Rr.Fixed32),this.writeFixed32(o)},writeSFixed32Field:function(a,o){this.writeTag(a,Rr.Fixed32),this.writeSFixed32(o)},writeFixed64Field:function(a,o){this.writeTag(a,Rr.Fixed64),this.writeFixed64(o)},writeSFixed64Field:function(a,o){this.writeTag(a,Rr.Fixed64),this.writeSFixed64(o)},writeVarintField:function(a,o){this.writeTag(a,Rr.Varint),this.writeVarint(o)},writeSVarintField:function(a,o){this.writeTag(a,Rr.Varint),this.writeSVarint(o)},writeStringField:function(a,o){this.writeTag(a,Rr.Bytes),this.writeString(o)},writeFloatField:function(a,o){this.writeTag(a,Rr.Fixed32),this.writeFloat(o)},writeDoubleField:function(a,o){this.writeTag(a,Rr.Fixed64),this.writeDouble(o)},writeBooleanField:function(a,o){this.writeVarintField(a,Boolean(o))}};class ef{constructor(o,{pixelRatio:u,version:d,stretchX:m,stretchY:C,content:_}){this.paddedRect=o,this.pixelRatio=u,this.stretchX=m,this.stretchY=C,this.content=_,this.version=d}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 displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class rm{constructor(o,u){const d={},m={};this.haveRenderCallbacks=[];const C=[];this.addImages(o,d,C),this.addImages(u,m,C);const{w:_,h:w}=Rd(C),T=new N1({width:_||1,height:w||1});for(const D in o){const P=o[D],V=d[D].paddedRect;N1.copy(P.data,T,{x:0,y:0},{x:V.x+1,y:V.y+1},P.data)}for(const D in u){const P=u[D],V=m[D].paddedRect,O=V.x+1,U=V.y+1,X=P.data.width,ee=P.data.height;N1.copy(P.data,T,{x:0,y:0},{x:O,y:U},P.data),N1.copy(P.data,T,{x:0,y:ee-1},{x:O,y:U-1},{width:X,height:1}),N1.copy(P.data,T,{x:0,y:0},{x:O,y:U+ee},{width:X,height:1}),N1.copy(P.data,T,{x:X-1,y:0},{x:O-1,y:U},{width:1,height:ee}),N1.copy(P.data,T,{x:0,y:0},{x:O+X,y:U},{width:1,height:ee})}this.image=T,this.iconPositions=d,this.patternPositions=m}addImages(o,u,d){for(const m in o){const C=o[m],_={x:0,y:0,w:C.data.width+2,h:C.data.height+2};d.push(_),u[m]=new ef(_,C),C.hasRenderCallback&&this.haveRenderCallbacks.push(m)}}patchUpdatedImages(o,u){o.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const d in o.updatedImages)this.patchUpdatedImage(this.iconPositions[d],o.getImage(d),u),this.patchUpdatedImage(this.patternPositions[d],o.getImage(d),u)}patchUpdatedImage(o,u,d){if(!o||!u||o.version===u.version)return;o.version=u.version;const[m,C]=o.tl;d.update(u.data,void 0,{x:m,y:C})}}En("ImagePosition",ef),En("ImageAtlas",rm);const p1={horizontal:1,vertical:2,horizontalOnly:3};class d4{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(o,u){const d=new d4;return d.scale=o||1,d.fontStack=u,d}static forImage(o){const u=new d4;return u.imageName=o,u}}class f4{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(o,u){const d=new f4;for(let m=0;m=0&&d>=o&&e0[this.text.charCodeAt(d)];d--)u--;this.text=this.text.substring(o,u),this.sectionIndex=this.sectionIndex.slice(o,u)}substring(o,u){const d=new f4;return d.text=this.text.substring(o,u),d.sectionIndex=this.sectionIndex.slice(o,u),d.sections=this.sections,d}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((o,u)=>Math.max(o,this.sections[u].scale),0)}addTextSection(o,u){this.text+=o.text,this.sections.push(d4.forText(o.scale,o.fontStack||u));const d=this.sections.length-1;for(let m=0;m=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function sm(a,o,u,d,m,C,_,w,T,D,P,V,O,U,X,ee){const se=f4.fromFeature(a,m);let xe;V===p1.vertical&&se.verticalizePunctuation(O);const{processBidirectionalText:Ie,processStyledBidirectionalText:$e}=Hi;if(Ie&&1===se.sections.length){xe=[];const st=Ie(se.toString(),Hd(se,D,C,o,d,U,X));for(const Rt of st){const Vt=new f4;Vt.text=Rt,Vt.sections=se.sections;for(let Cn=0;Cn0&&j2>Ks&&(Ks=j2)}else{const Sa=Vt[Qs.fontStack];if(!Sa)continue;Sa[mo]&&(Jr=Sa[mo]);const go=Rt[Qs.fontStack];if(!go)continue;const j2=go.glyphs[mo];if(!j2)continue;if(Eo=j2.metrics,Js=8203!==mo?24:0,dr){const Ru=void 0!==go.ascender?Math.abs(go.ascender):0,u0=void 0!==go.descender?Math.abs(go.descender):0,v3=(Ru+u0)*Vr;Qr=0;let P=0;for(let O=0;O-u/2;){if(_--,_<0)return!1;w-=a[_].dist(C),C=a[_]}w+=a[_].dist(a[_+1]),_++;const T=[];let D=0;for(;wd;)D-=T.shift().angleDelta;if(D>m)return!1;_++,w+=P.dist(V)}return!0}function hm(a){let o=0;for(let u=0;uD){const X=(D-T)/U,ee=Fi(V.x,O.x,X),se=Fi(V.y,O.y,X),xe=new Ll(ee,se,0,O.angleTo(V),P);return!_||um(a,xe,w,_,o)?xe:void 0}T+=U}}function fm(a,o,u,d,m,C,_,w,T){const D=dm(d,C,_),P=Vi(d,m),V=P*_,O=0===a[0].x||a[0].x===T||0===a[0].y||a[0].y===T;return o-V=0&&Ke=0&&rt=0&&O+D<=P){const st=new Ll(Ke,rt,0,Ie,X);st._round(),d&&!um(a,st,C,d,m)||U.push(st)}}V+=xe}return w||U.length||_||(U=t0(a,V/2,u,d,m,C,_,!0,T)),U}function u2(a,o,u,d,m){const C=[];for(let _=0;_=d&&V.x>=d||(P.x>=d?P=new de(d,P.y+(d-P.x)/(V.x-P.x)*(V.y-P.y))._round():V.x>=d&&(V=new de(d,P.y+(d-P.x)/(V.x-P.x)*(V.y-P.y))._round()),P.y>=m&&V.y>=m||(P.y>=m?P=new de(P.x+(m-P.y)/(V.y-P.y)*(V.x-P.x),m)._round():V.y>=m&&(V=new de(P.x+(m-P.y)/(V.y-P.y)*(V.x-P.x),m)._round()),T&&P.equals(T[T.length-1])||(T=[P],C.push(T)),T.push(V)))))}}return C}En("Anchor",Ll);const Au=1e20;function pm(a,o,u,d,m,C,_,w,T){for(let D=o;D-1);T++,C[T]=w,_[T]=D,_[T+1]=Au}for(let w=0,T=0;w{let w=this.entries[m];w||(w=this.entries[m]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let T=w.glyphs[C];if(void 0!==T)return void _(null,{stack:m,id:C,glyph:T});if(T=this._tinySDF(w,m,C),T)return w.glyphs[C]=T,void _(null,{stack:m,id:C,glyph:T});const D=Math.floor(C/256);if(256*D>65535)return void _(new Error("glyphs > 65535 not supported"));if(w.ranges[D])return void _(null,{stack:m,id:C,glyph:T});let P=w.requests[D];P||(P=w.requests[D]=[],h3.loadGlyphRange(m,D,this.url,this.requestManager,(V,O)=>{if(O){w.ascender=O.ascender,w.descender=O.descender;for(const U in O.glyphs)this._doesCharSupportLocalGlyph(+U)||(w.glyphs[+U]=O.glyphs[+U]);w.ranges[D]=!0}for(const U of P)U(V,O);delete w.requests[D]})),P.push((V,O)=>{V?_(V):O&&_(null,{stack:m,id:C,glyph:O.glyphs[C]||null})})},(m,C)=>{if(m)u(m);else if(C){const _={};for(const{stack:w,id:T,glyph:D}of C)void 0===_[w]&&(_[w]={}),void 0===_[w].glyphs&&(_[w].glyphs={}),_[w].glyphs[T]=D&&{id:D.id,bitmap:D.bitmap.clone(),metrics:D.metrics},_[w].ascender=this.entries[w].ascender,_[w].descender=this.entries[w].descender;u(null,_)}})}_doesCharSupportLocalGlyph(o){return this.localGlyphMode!==U2.none&&(this.localGlyphMode===U2.all?!!this.localFontFamily:!!this.localFontFamily&&(le(o)||Te(o)||N(o)||H(o))||k(o))}_tinySDF(o,u,d){const m=this.localFontFamily;if(!m||!this._doesCharSupportLocalGlyph(d))return;let C=o.tinySDF;if(!C){let ee="400";/bold/i.test(u)?ee="900":/medium/i.test(u)?ee="500":/light/i.test(u)&&(ee="200"),C=o.tinySDF=new h3.TinySDF({fontFamily:m,fontWeight:ee,fontSize:48,buffer:6,radius:16}),C.fontWeight=ee}if(this.localGlyphs[C.fontWeight][d])return this.localGlyphs[C.fontWeight][d];const _=String.fromCharCode(d),{data:w,width:T,height:D,glyphWidth:P,glyphHeight:V,glyphLeft:O,glyphTop:U,glyphAdvance:X}=C.draw(_);return this.localGlyphs[C.fontWeight][d]={id:d,bitmap:new s3({width:T,height:D},w),metrics:{width:P/2,height:V/2,left:O/2,top:U/2-27,advance:X/2,localGlyph:!0}}}}function rf(a,o,u,d){const m=[],C=a.image,_=C.pixelRatio,w=C.paddedRect.w-2,T=C.paddedRect.h-2,D=a.right-a.left,P=a.bottom-a.top,V=C.stretchX||[[0,w]],O=C.stretchY||[[0,T]],U=(Ht,cn)=>Ht+cn[1]-cn[0],X=V.reduce(U,0),ee=O.reduce(U,0),se=w-X,xe=T-ee;let Ie=0,$e=X,Ke=0,rt=ee,st=0,Rt=se,Vt=0,Cn=xe;if(C.content&&d){const Ht=C.content;Ie=ku(V,0,Ht[0]),Ke=ku(O,0,Ht[1]),$e=ku(V,Ht[0],Ht[2]),rt=ku(O,Ht[1],Ht[3]),st=Ht[0]-Ie,Vt=Ht[1]-Ke,Rt=Ht[2]-Ht[0]-$e,Cn=Ht[3]-Ht[1]-rt}const dn=(Ht,cn,yn,Kt)=>{const Dn=n0(Ht.stretch-Ie,$e,D,a.left),Vn=sf(Ht.fixed-st,Rt,Ht.stretch,X),Ki=n0(cn.stretch-Ke,rt,P,a.top),Hr=sf(cn.fixed-Vt,Cn,cn.stretch,ee),rr=n0(yn.stretch-Ie,$e,D,a.left),sr=sf(yn.fixed-st,Rt,yn.stretch,X),ln=n0(Kt.stretch-Ke,rt,P,a.top),dr=sf(Kt.fixed-Vt,Cn,Kt.stretch,ee),fr=new de(Dn,Ki),Ss=new de(rr,Ki),ms=new de(rr,ln),po=new de(Dn,ln),wa=new de(Vn/_,Hr/_),xr=new de(sr/_,dr/_),ji=o*Math.PI/180;if(ji){const gs=Math.sin(ji),Ks=Math.cos(ji),Qr=[Ks,-gs,gs,Ks];fr._matMult(Qr),Ss._matMult(Qr),po._matMult(Qr),ms._matMult(Qr)}const ns=Ht.stretch+Ht.fixed,Ts=cn.stretch+cn.fixed;return{tl:fr,tr:Ss,bl:po,br:ms,tex:{x:C.paddedRect.x+1+ns,y:C.paddedRect.y+1+Ts,w:yn.stretch+yn.fixed-ns,h:Kt.stretch+Kt.fixed-Ts},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:wa,pixelOffsetBR:xr,minFontScaleX:Rt/_/D,minFontScaleY:Cn/_/P,isSDF:u}};if(d&&(C.stretchX||C.stretchY)){const Ht=ev(V,se,X),cn=ev(O,xe,ee);for(let yn=0;yn{if(T)m(T);else if(D){const P={},V=new Kh(D).readFields(J5,{});for(const O of V.glyphs)P[O.id]=O;m(null,{glyphs:P,ascender:V.ascender,descender:V.descender})}})},h3.TinySDF=class{constructor({fontSize:a=24,buffer:o=3,radius:u=8,cutoff:d=.25,fontFamily:m="sans-serif",fontWeight:C="normal",fontStyle:_="normal"}){this.buffer=o,this.cutoff=d,this.radius=u;const w=this.size=a+4*o,T=this._createCanvas(w),D=this.ctx=T.getContext("2d",{willReadFrequently:!0});D.font=`${_} ${C} ${a}px ${m}`,D.textBaseline="alphabetic",D.textAlign="left",D.fillStyle="black",this.gridOuter=new Float64Array(w*w),this.gridInner=new Float64Array(w*w),this.f=new Float64Array(w),this.z=new Float64Array(w+1),this.v=new Uint16Array(w)}_createCanvas(a){const o=document.createElement("canvas");return o.width=o.height=a,o}draw(a){const{width:o,actualBoundingBoxAscent:u,actualBoundingBoxDescent:d,actualBoundingBoxLeft:m,actualBoundingBoxRight:C}=this.ctx.measureText(a),_=Math.floor(u),w=Math.min(this.size-this.buffer,Math.ceil(C-m)),T=Math.min(this.size-this.buffer,Math.ceil(u)+Math.ceil(d)),D=w+2*this.buffer,P=T+2*this.buffer,V=D*P,O=new Uint8ClampedArray(V),U={data:O,width:D,height:P,glyphWidth:w,glyphHeight:T,glyphTop:_,glyphLeft:0,glyphAdvance:o};if(0===w||0===T)return U;const{ctx:X,buffer:ee,gridInner:se,gridOuter:xe}=this;X.clearRect(ee,ee,w,T),X.fillText(a,ee,ee+_+1);const Ie=X.getImageData(ee,ee,w,T);xe.fill(Au,0,V),se.fill(0,0,V);for(let $e=0;$e0?Rt*Rt:0,se[st]=Rt<0?Rt*Rt:0}}pm(xe,0,0,D,P,D,this.f,this.v,this.z),pm(se,ee,ee,w,T,D,this.f,this.v,this.z);for(let $e=0;$e0)for(let d=(this.length>>1)-1;d>=0;d--)this._down(d)}push(o){this.data.push(o),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const o=this.data[0],u=this.data.pop();return this.length--,this.length>0&&(this.data[0]=u,this._down(0)),o}peek(){return this.data[0]}_up(o){const{data:u,compare:d}=this,m=u[o];for(;o>0;){const C=o-1>>1,_=u[C];if(d(m,_)>=0)break;u[o]=_,o=C}u[o]=m}_down(o){const{data:u,compare:d}=this,m=this.length>>1,C=u[o];for(;o=0)break;u[o]=w,o=_}u[o]=C}}function $d(a,o){return ao?1:0}function of(a,o=1,u=!1){let d=1/0,m=1/0,C=-1/0,_=-1/0;const w=a[0];for(let U=0;UC)&&(C=X.x),(!U||X.y>_)&&(_=X.y)}const T=Math.min(C-d,_-m);let D=T/2;const P=new Ud([],zM);if(0===T)return new de(d,m);for(let U=d;UV.d||!V.d)&&(V=U,u&&console.log("found best %d after %d probes",Math.round(1e4*U.d)/1e4,O)),U.max-V.d<=o||(D=U.h/2,P.push(new Iu(U.p.x-D,U.p.y-D,D,a)),P.push(new Iu(U.p.x+D,U.p.y-D,D,a)),P.push(new Iu(U.p.x-D,U.p.y+D,D,a)),P.push(new Iu(U.p.x+D,U.p.y+D,D,a)),O+=4)}return u&&(console.log(`num probes: ${O}`),console.log(`best distance: ${V.d}`)),V.p}function zM(a,o){return o.max-a.max}function Iu(a,o,u,d){this.p=new de(a,o),this.h=u,this.d=function(m,C){let _=!1,w=1/0;for(let T=0;Tm.y!=X.y>m.y&&m.x<(X.x-U.x)*(m.y-U.y)/(X.y-U.y)+U.x&&(_=!_),w=Math.min(w,Ip(m,U,X))}}return(_?1:-1)*Math.sqrt(w)}(this.p,d),this.max=this.d+this.h*Math.SQRT2}const jd=Number.POSITIVE_INFINITY,PM=Math.sqrt(2);function mm(a,o){return o[1]!==jd?function(u,d,m){let C=0,_=0;switch(d=Math.abs(d),m=Math.abs(m),u){case"top-right":case"top-left":case"top":_=m-7;break;case"bottom-right":case"bottom-left":case"bottom":_=7-m}switch(u){case"top-right":case"bottom-right":case"right":C=-d;break;case"top-left":case"bottom-left":case"left":C=d}return[C,_]}(a,o[0],o[1]):function(u,d){let m=0,C=0;d<0&&(d=0);const _=d/PM;switch(u){case"top-right":case"top-left":C=_-7;break;case"bottom-right":case"bottom-left":C=7-_;break;case"bottom":C=7-d;break;case"top":C=d-7}switch(u){case"top-right":case"bottom-right":m=-_;break;case"top-left":case"bottom-left":m=_;break;case"left":m=d;break;case"right":m=-d}return[m,C]}(a,o[0])}function VM(a,o,u,d,m,C,_,w,T,D){a.createArrays(),a.tilePixelRatio=Yi/(512*a.overscaling),a.compareText={},a.iconsNeedLinear=!1;const P=a.layers[0].layout,V=a.layers[0]._unevaluatedLayout._values,O={};if("composite"===a.textSizeData.kind){const{minZoom:ee,maxZoom:se}=a.textSizeData;O.compositeTextSizes=[V["text-size"].possiblyEvaluate(new ui(ee),w),V["text-size"].possiblyEvaluate(new ui(se),w)]}if("composite"===a.iconSizeData.kind){const{minZoom:ee,maxZoom:se}=a.iconSizeData;O.compositeIconSizes=[V["icon-size"].possiblyEvaluate(new ui(ee),w),V["icon-size"].possiblyEvaluate(new ui(se),w)]}O.layoutTextSize=V["text-size"].possiblyEvaluate(new ui(T+1),w),O.layoutIconSize=V["icon-size"].possiblyEvaluate(new ui(T+1),w),O.textMaxSize=V["text-size"].possiblyEvaluate(new ui(18),w);const U="map"===P.get("text-rotation-alignment")&&"point"!==P.get("symbol-placement"),X=P.get("text-size");for(const ee of a.features){const se=P.get("text-font").evaluate(ee,{},w).join(","),xe=X.evaluate(ee,{},w),Ie=O.layoutTextSize.evaluate(ee,{},w),$e=(O.layoutIconSize.evaluate(ee,{},w),{horizontal:{},vertical:void 0}),Ke=ee.text;let rt,st=[0,0];if(Ke){const Cn=Ke.toString(),dn=24*P.get("text-letter-spacing").evaluate(ee,{},w),Ht=24*P.get("text-line-height").evaluate(ee,{},w),cn=vt(Cn)?dn:0,yn=P.get("text-anchor").evaluate(ee,{},w),Kt=P.get("text-variable-anchor");if(!Kt){const sr=P.get("text-radial-offset").evaluate(ee,{},w);st=sr?mm(yn,[24*sr,jd]):P.get("text-offset").evaluate(ee,{},w).map(ln=>24*ln)}let Dn=U?"center":P.get("text-justify").evaluate(ee,{},w);const Vn=P.get("symbol-placement"),Ki="point"===Vn,Hr="point"===Vn?24*P.get("text-max-width").evaluate(ee,{},w):0,rr=sr=>{a.allowVerticalPlacement&&At(Cn)&&($e.vertical=sm(Ke,o,u,m,se,Hr,Ht,yn,sr,cn,st,p1.vertical,!0,Vn,Ie,xe))};if(!U&&Kt){const sr="auto"===Dn?Kt.map(dr=>Gd(dr)):[Dn];let ln=!1;for(let dr=0;dr=0||!At(Cn)){const sr=sm(Ke,o,u,m,se,Hr,Ht,yn,Dn,cn,st,p1.horizontal,!1,Vn,Ie,xe);sr&&($e.horizontal[Dn]=sr)}rr("point"===Vn?"left":Dn)}}let Rt=!1;if(ee.icon&&ee.icon.name){const Cn=d[ee.icon.name];Cn&&(rt=JC(m[ee.icon.name],P.get("icon-offset").evaluate(ee,{},w),P.get("icon-anchor").evaluate(ee,{},w)),Rt=Cn.sdf,void 0===a.sdfIcons?a.sdfIcons=Cn.sdf:a.sdfIcons!==Cn.sdf&&Fr("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Cn.pixelRatio!==a.pixelRatio||0!==P.get("icon-rotate").constantOr(1))&&(a.iconsNeedLinear=!0))}const Vt=tv($e.horizontal)||$e.vertical;a.iconsInText||(a.iconsInText=!!Vt&&Vt.iconsInText),(Vt||rt)&&gm(a,ee,$e,rt,d,O,Ie,0,st,Rt,_,w,D)}C&&a.generateCollisionDebugBuffers(T,a.collisionBoxArray)}function Gd(a){switch(a){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function gm(a,o,u,d,m,C,_,w,T,D,P,V,O){let U=C.textMaxSize.evaluate(o,{},V);void 0===U&&(U=_);const X=a.layers[0].layout,ee=X.get("icon-offset").evaluate(o,{},V),se=tv(u.horizontal)||u.vertical,xe=_/24,Ie=a.tilePixelRatio*U/24,$e=a.tilePixelRatio*X.get("symbol-spacing"),Ke=X.get("text-padding")*a.tilePixelRatio,rt=X.get("icon-padding")*a.tilePixelRatio,st=Pn(X.get("text-max-angle")),Rt="map"===X.get("text-rotation-alignment")&&"point"!==X.get("symbol-placement"),Vt="map"===X.get("icon-rotation-alignment")&&"point"!==X.get("symbol-placement"),Cn=X.get("symbol-placement"),dn=$e/2,Ht=X.get("icon-text-fit");let cn;d&&"none"!==Ht&&(a.allowVerticalPlacement&&u.vertical&&(cn=cm(d,u.vertical,Ht,X.get("icon-text-fit-padding"),ee,xe)),se&&(d=cm(d,se,Ht,X.get("icon-text-fit-padding"),ee,xe)));const yn=(Kt,Dn,Vn)=>{if(Dn.x<0||Dn.x>=Yi||Dn.y<0||Dn.y>=Yi)return;const{x:Ki,y:Hr,z:rr}=O.projectTilePoint(Dn.x,Dn.y,Vn),sr=new Ll(Ki,Hr,rr,0,void 0);!function(ln,dr,fr,Ss,ms,po,wa,xr,ji,ns,Ts,gs,Ks,Qr,C1,v1,is,Qs,B1,mo,Vr,Eo,Jr,Ln,Js){const Do=ln.addToLineVertexArray(dr,Ss);let Ma,Sa,go,j2,Ru,u0,v3,v4=0,Sf=0,f2=0,Hu=0,Tf=-1,Lf=-1;const p2={};let G2=md(""),y4=0,Go=0;if(void 0===ji._unevaluatedLayout.getValue("text-radial-offset")?[y4,Go]=ji.layout.get("text-offset").evaluate(Vr,{},Js).map(St=>24*St):(y4=24*ji.layout.get("text-radial-offset").evaluate(Vr,{},Js),Go=jd),ln.allowVerticalPlacement&&ms.vertical){const St=ms.vertical;if(C1)u0=Cm(St),xr&&(v3=Cm(xr));else{const Ao=ji.layout.get("text-rotate").evaluate(Vr,{},Js)+90;go=af(ns,fr,dr,Ts,gs,Ks,St,Qr,Ao,v1),xr&&(j2=af(ns,fr,dr,Ts,gs,Ks,xr,Qs,Ao))}}if(po){const St=ji.layout.get("icon-rotate").evaluate(Vr,{},Js),Ao="none"!==ji.layout.get("icon-text-fit"),Il=rf(po,St,Jr,Ao),y3=xr?rf(xr,St,Jr,Ao):void 0;Sa=af(ns,fr,dr,Ts,gs,Ks,po,Qs,St),v4=4*Il.length;const _4=ln.iconSizeData;let g2=null;"source"===_4.kind?(g2=[l2*ji.layout.get("icon-size").evaluate(Vr,{},Js)],g2[0]>d3&&Fr(`${ln.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===_4.kind&&(g2=[l2*Eo.compositeIconSizes[0].evaluate(Vr,{},Js),l2*Eo.compositeIconSizes[1].evaluate(Vr,{},Js)],(g2[0]>d3||g2[1]>d3)&&Fr(`${ln.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),ln.addSymbols(ln.icon,Il,g2,mo,B1,Vr,!1,fr,dr,Do.lineStartIndex,Do.lineLength,-1,Ln,Js),Tf=ln.icon.placedSymbolArray.length-1,y3&&(Sf=4*y3.length,ln.addSymbols(ln.icon,y3,g2,mo,B1,Vr,p1.vertical,fr,dr,Do.lineStartIndex,Do.lineLength,-1,Ln,Js),Lf=ln.icon.placedSymbolArray.length-1)}for(const St in ms.horizontal){const Ao=ms.horizontal[St];Ma||(G2=md(Ao.text),C1?Ru=Cm(Ao):Ma=af(ns,fr,dr,Ts,gs,Ks,Ao,Qr,ji.layout.get("text-rotate").evaluate(Vr,{},Js),v1));const Il=1===Ao.positionedLines.length;if(f2+=Wd(ln,fr,dr,Ao,wa,ji,C1,Vr,v1,Do,ms.vertical?p1.horizontal:p1.horizontalOnly,Il?Object.keys(ms.horizontal):[St],p2,Tf,Eo,Ln,Js),Il)break}ms.vertical&&(Hu+=Wd(ln,fr,dr,ms.vertical,wa,ji,C1,Vr,v1,Do,p1.vertical,["vertical"],p2,Lf,Eo,Ln,Js));let y1=-1;const Bu=(St,Ao)=>St?Math.max(St,Ao):Ao;y1=Bu(Ru,y1),y1=Bu(u0,y1),y1=Bu(v3,y1);const m2=y1>-1?1:0;ln.glyphOffsetArray.length>=Xa.MAX_GLYPHS&&Fr("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==Vr.sortKey&&ln.addToSortKeyRanges(ln.symbolInstances.length,Vr.sortKey),ln.symbolInstances.emplaceBack(fr.x,fr.y,fr.z,dr.x,dr.y,p2.right>=0?p2.right:-1,p2.center>=0?p2.center:-1,p2.left>=0?p2.left:-1,p2.vertical>=0?p2.vertical:-1,Tf,Lf,G2,void 0!==Ma?Ma:ln.collisionBoxArray.length,void 0!==Ma?Ma+1:ln.collisionBoxArray.length,void 0!==go?go:ln.collisionBoxArray.length,void 0!==go?go+1:ln.collisionBoxArray.length,void 0!==Sa?Sa:ln.collisionBoxArray.length,void 0!==Sa?Sa+1:ln.collisionBoxArray.length,j2||ln.collisionBoxArray.length,j2?j2+1:ln.collisionBoxArray.length,Ts,f2,Hu,v4,Sf,m2,0,y4,Go,y1)}(a,Dn,sr,Kt,u,d,m,cn,a.layers[0],a.collisionBoxArray,o.index,o.sourceLayerIndex,a.index,Ke,Rt,T,0,rt,Vt,ee,o,C,D,P,V)};if("line"===Cn)for(const Kt of u2(o.geometry,0,0,Yi,Yi)){const Dn=fm(Kt,$e,st,u.vertical||se,d,24,Ie,a.overscaling,Yi);for(const Vn of Dn){const Ki=se;Ki&&FM(a,Ki.text,dn,Vn)||yn(Kt,Vn,V)}}else if("line-center"===Cn){for(const Kt of o.geometry)if(Kt.length>1){const Dn=K(Kt,st,u.vertical||se,d,24,Ie);Dn&&yn(Kt,Dn,V)}}else if("Polygon"===o.type)for(const Kt of Td(o.geometry,0)){const Dn=of(Kt,16);yn(Kt[0],new Ll(Dn.x,Dn.y,0,0,void 0),V)}else if("LineString"===o.type)for(const Kt of o.geometry)yn(Kt,new Ll(Kt[0].x,Kt[0].y,0,0,void 0),V);else if("Point"===o.type)for(const Kt of o.geometry)for(const Dn of Kt)yn([Dn],new Ll(Dn.x,Dn.y,0,0,void 0),V)}const d3=32640;function Wd(a,o,u,d,m,C,_,w,T,D,P,V,O,U,X,ee,se){const xe=function(Ke,rt,st,Rt,Vt,Cn,dn,Ht){const cn=[];if(0===rt.positionedLines.length)return cn;const yn=Rt.layout.get("text-rotate").evaluate(Cn,{})*Math.PI/180,Kt=function(rr){const sr=rr[0],ln=rr[1],dr=sr*ln;return dr>0?[sr,-ln]:dr<0?[-sr,ln]:0===sr?[ln,sr]:[ln,-sr]}(st);let Dn=Math.abs(rt.top-rt.bottom);for(const rr of rt.positionedLines)Dn-=rr.lineOffset;const Vn=rt.positionedLines.length,Ki=Dn/Vn;let Hr=rt.top-st[1];for(let rr=0;rrd3&&Fr(`${a.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===Ie.kind&&($e=[l2*X.compositeTextSizes[0].evaluate(w,{},se),l2*X.compositeTextSizes[1].evaluate(w,{},se)],($e[0]>d3||$e[1]>d3)&&Fr(`${a.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),a.addSymbols(a.text,xe,$e,T,_,w,P,o,u,D.lineStartIndex,D.lineLength,U,ee,se);for(const Ke of V)O[Ke]=a.text.placedSymbolArray.length-1;return 4*xe.length}function tv(a){for(const o in a)return a[o];return null}function af(a,o,u,d,m,C,_,w,T,D){let P=_.top,V=_.bottom,O=_.left,U=_.right;const X=_.collisionPadding;if(X&&(O-=X[0],P-=X[1],U+=X[2],V+=X[3]),T){const ee=new de(O,P),se=new de(U,P),xe=new de(O,V),Ie=new de(U,V),$e=Pn(T);let Ke=new de(0,0);D&&(Ke=new de(D[0],D[1])),ee._rotateAround($e,Ke),se._rotateAround($e,Ke),xe._rotateAround($e,Ke),Ie._rotateAround($e,Ke),O=Math.min(ee.x,se.x,xe.x,Ie.x),U=Math.max(ee.x,se.x,xe.x,Ie.x),P=Math.min(ee.y,se.y,xe.y,Ie.y),V=Math.max(ee.y,se.y,xe.y,Ie.y)}return a.emplaceBack(o.x,o.y,o.z,u.x,u.y,O,P,U,V,w,d,m,C),a.length-1}function Cm(a){a.collisionPadding&&(a.top-=a.collisionPadding[1],a.bottom+=a.collisionPadding[3]);const o=a.bottom-a.top;return o>0?Math.max(10,o):null}function FM(a,o,u,d){const m=a.compareText;if(o in m){const C=m[o];for(let _=C.length-1;_>=0;_--)if(d.dist(C[_])_.id),this.index=o.index,this.pixelRatio=o.pixelRatio,this.sourceLayerIndex=o.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Pe([]),this.placementViewportMatrix=Pe([]);const u=this.layers[0]._unevaluatedLayout._values;this.textSizeData=q5(this.zoom,u["text-size"]),this.iconSizeData=q5(this.zoom,u["icon-size"]);const d=this.layers[0].layout,m=d.get("symbol-sort-key"),C=d.get("symbol-z-order");this.canOverlap=d.get("text-allow-overlap")||d.get("icon-allow-overlap")||d.get("text-ignore-placement")||d.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==C&&void 0!==m.constantOr(1),this.sortFeaturesByY=("viewport-y"===C||"auto"===C&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=d.get("text-writing-mode").map(_=>p1[_]),this.stateDependentLayerIds=this.layers.filter(_=>_.isStateDependent()).map(_=>_.id),this.sourceID=o.sourceID}createArrays(){this.text=new ym(new lc(this.layers,this.zoom,o=>/^text/.test(o))),this.icon=new ym(new lc(this.layers,this.zoom,o=>/^icon/.test(o))),this.glyphOffsetArray=new fd,this.lineVertexArray=new Nh,this.symbolInstances=new yu}calculateGlyphDependencies(o,u,d,m,C){for(let _=0;_0)&&("constant"!==w.value.kind||w.value.value.length>0),V="constant"!==D.value.kind||!!D.value.value||Object.keys(D.parameters).length>0,O=_.get("symbol-sort-key");if(this.features=[],!P&&!V)return;const U=u.iconDependencies,X=u.glyphDependencies,ee=u.availableImages,se=new ui(this.zoom);for(const{feature:xe,id:Ie,index:$e,sourceLayerIndex:Ke}of o){const rt=C._featureFilter.needGeometry,st=l4(xe,rt);if(!C._featureFilter.filter(se,st,d))continue;let Rt,Vt;if(rt||(st.geometry=cc(xe,d,m)),P){const dn=C.getValueAndResolveTokens("text-field",st,d,ee),Ht=wi.factory(dn);RM(Ht)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===ho()||this.hasRTLText&&Hi.isParsed())&&(Rt=XC(Ht,C,st))}if(V){const dn=C.getValueAndResolveTokens("icon-image",st,d,ee);Vt=dn instanceof Tn?dn:Tn.fromString(dn)}if(!Rt&&!Vt)continue;const Cn=this.sortFeaturesByKey?O.evaluate(st,{},d):void 0;if(this.features.push({id:Ie,text:Rt,icon:Vt,index:$e,sourceLayerIndex:Ke,geometry:st.geometry,properties:xe.properties,type:OM[xe.type],sortKey:Cn}),Vt&&(U[Vt.name]=!0),Rt){const dn=w.evaluate(st,{},d).join(","),Ht="map"===_.get("text-rotation-alignment")&&"point"!==_.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(p1.vertical)>=0;for(const cn of Rt.sections)if(cn.image)U[cn.image.name]=!0;else{const yn=At(Rt.toString()),Kt=cn.fontStack||dn,Dn=X[Kt]=X[Kt]||{};this.calculateGlyphDependencies(cn.text,Dn,Ht,this.allowVerticalPlacement,yn)}}}"line"===_.get("symbol-placement")&&(this.features=function(xe){const Ie={},$e={},Ke=[];let rt=0;function st(dn){Ke.push(xe[dn]),rt++}function Rt(dn,Ht,cn){const yn=$e[dn];return delete $e[dn],$e[Ht]=yn,Ke[yn].geometry[0].pop(),Ke[yn].geometry[0]=Ke[yn].geometry[0].concat(cn[0]),yn}function Vt(dn,Ht,cn){const yn=Ie[Ht];return delete Ie[Ht],Ie[dn]=yn,Ke[yn].geometry[0].shift(),Ke[yn].geometry[0]=cn[0].concat(Ke[yn].geometry[0]),yn}function Cn(dn,Ht,cn){const yn=cn?Ht[0][Ht[0].length-1]:Ht[0][0];return`${dn}:${yn.x}:${yn.y}`}for(let dn=0;dndn.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((xe,Ie)=>xe.sortKey-Ie.sortKey)}update(o,u,d,m){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(o,u,this.layers,d,m),this.icon.programConfigurations.updatePaintArrays(o,u,this.layers,d,m))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(o){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(o),this.iconCollisionBox.upload(o)),this.text.upload(o,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(o,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(o,u){const d=this.lineVertexArray.length;if(void 0!==o.segment){let m=o.dist(u[o.segment+1]),C=o.dist(u[o.segment]);const _={};for(let w=o.segment+1;w=0;w--)_[w]={x:u[w].x,y:u[w].y,tileUnitDistanceFromAnchor:C},w>0&&(C+=u[w-1].dist(u[w]));for(let w=0;w=0?u.rightJustifiedTextSymbolIndex:u.centerJustifiedTextSymbolIndex>=0?u.centerJustifiedTextSymbolIndex:u.leftJustifiedTextSymbolIndex>=0?u.leftJustifiedTextSymbolIndex:u.verticalPlacedTextSymbolIndex>=0?u.verticalPlacedTextSymbolIndex:m),_=zd(this.textSizeData,o,C)/24;return this.tilePixelRatio*_}getSymbolInstanceIconSize(o,u,d){const m=this.icon.placedSymbolArray.get(d),C=zd(this.iconSizeData,o,m);return this.tilePixelRatio*C}_commitDebugCollisionVertexUpdate(o,u,d){o.emplaceBack(u,-d,-d),o.emplaceBack(u,d,-d),o.emplaceBack(u,d,d),o.emplaceBack(u,-d,d)}_updateTextDebugCollisionBoxes(o,u,d,m,C,_){for(let w=m;w0}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(o,u){const d=o.placedSymbolArray.get(u),m=d.vertexStartIndex+4*d.numGlyphs;for(let C=d.vertexStartIndex;Cm[w]-m[T]||C[T]-C[w]),_}addToSortKeyRanges(o,u){const d=this.sortKeyRanges[this.sortKeyRanges.length-1];d&&d.sortKey===u?d.symbolInstanceEnd=o+1:this.sortKeyRanges.push({sortKey:u,symbolInstanceStart:o,symbolInstanceEnd:o+1})}sortFeatures(o){if(this.sortFeaturesByY&&this.sortedAngle!==o&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(o),this.sortedAngle=o,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const u of this.symbolInstanceIndexes){const d=this.symbolInstances.get(u);this.featureSortOrder.push(d.featureIndex),[d.rightJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.leftJustifiedTextSymbolIndex].forEach((m,C,_)=>{m>=0&&_.indexOf(m)===C&&this.addIndicesForPlacedSymbol(this.text,m)}),d.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,d.verticalPlacedTextSymbolIndex),d.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,d.placedIconSymbolIndex),d.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,d.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}En("SymbolBucket",Xa,{omit:["layers","collisionBoxArray","features","compareText"]}),Xa.MAX_GLYPHS=65535,Xa.addDynamicAttributes=vm;const cf=new $o({"symbol-placement":new Xt(it.layout_symbol["symbol-placement"]),"symbol-spacing":new Xt(it.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Xt(it.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ei(it.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Xt(it.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Xt(it.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Xt(it.layout_symbol["icon-ignore-placement"]),"icon-optional":new Xt(it.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Xt(it.layout_symbol["icon-rotation-alignment"]),"icon-size":new ei(it.layout_symbol["icon-size"]),"icon-text-fit":new Xt(it.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Xt(it.layout_symbol["icon-text-fit-padding"]),"icon-image":new ei(it.layout_symbol["icon-image"]),"icon-rotate":new ei(it.layout_symbol["icon-rotate"]),"icon-padding":new Xt(it.layout_symbol["icon-padding"]),"icon-keep-upright":new Xt(it.layout_symbol["icon-keep-upright"]),"icon-offset":new ei(it.layout_symbol["icon-offset"]),"icon-anchor":new ei(it.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Xt(it.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Xt(it.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Xt(it.layout_symbol["text-rotation-alignment"]),"text-field":new ei(it.layout_symbol["text-field"]),"text-font":new ei(it.layout_symbol["text-font"]),"text-size":new ei(it.layout_symbol["text-size"]),"text-max-width":new ei(it.layout_symbol["text-max-width"]),"text-line-height":new ei(it.layout_symbol["text-line-height"]),"text-letter-spacing":new ei(it.layout_symbol["text-letter-spacing"]),"text-justify":new ei(it.layout_symbol["text-justify"]),"text-radial-offset":new ei(it.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Xt(it.layout_symbol["text-variable-anchor"]),"text-anchor":new ei(it.layout_symbol["text-anchor"]),"text-max-angle":new Xt(it.layout_symbol["text-max-angle"]),"text-writing-mode":new Xt(it.layout_symbol["text-writing-mode"]),"text-rotate":new ei(it.layout_symbol["text-rotate"]),"text-padding":new Xt(it.layout_symbol["text-padding"]),"text-keep-upright":new Xt(it.layout_symbol["text-keep-upright"]),"text-transform":new ei(it.layout_symbol["text-transform"]),"text-offset":new ei(it.layout_symbol["text-offset"]),"text-allow-overlap":new Xt(it.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Xt(it.layout_symbol["text-ignore-placement"]),"text-optional":new Xt(it.layout_symbol["text-optional"])});var uf={paint:new $o({"icon-opacity":new ei(it.paint_symbol["icon-opacity"]),"icon-color":new ei(it.paint_symbol["icon-color"]),"icon-halo-color":new ei(it.paint_symbol["icon-halo-color"]),"icon-halo-width":new ei(it.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ei(it.paint_symbol["icon-halo-blur"]),"icon-translate":new Xt(it.paint_symbol["icon-translate"]),"icon-translate-anchor":new Xt(it.paint_symbol["icon-translate-anchor"]),"text-opacity":new ei(it.paint_symbol["text-opacity"]),"text-color":new ei(it.paint_symbol["text-color"],{runtimeType:ia,getOverride:a=>a.textColor,hasOverride:a=>!!a.textColor}),"text-halo-color":new ei(it.paint_symbol["text-halo-color"]),"text-halo-width":new ei(it.paint_symbol["text-halo-width"]),"text-halo-blur":new ei(it.paint_symbol["text-halo-blur"]),"text-translate":new Xt(it.paint_symbol["text-translate"]),"text-translate-anchor":new Xt(it.paint_symbol["text-translate-anchor"])}),layout:cf};class hf{constructor(o){this.type=o.property.overrides?o.property.overrides.runtimeType:na,this.defaultValue=o}evaluate(o){if(o.formattedSection){const u=this.defaultValue.property.overrides;if(u&&u.hasOverride(o.formattedSection))return u.getOverride(o.formattedSection)}return o.feature&&o.featureState?this.defaultValue.evaluate(o.feature,o.featureState):this.defaultValue.property.specification.default}eachChild(o){this.defaultValue.isConstant()||o(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}En("FormatSectionOverride",hf,{omit:["defaultValue"]});class zu extends F2{constructor(o){super(o,uf)}recalculate(o,u){super.recalculate(o,u),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const d=this.layout.get("text-writing-mode");if(d){const m=[];for(const C of d)m.indexOf(C)<0&&m.push(C);this.layout._values["text-writing-mode"]=m}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(o,u,d,m){const C=this.layout.get(o).evaluate(u,{},d,m),_=this._unevaluatedLayout._values[o];return _.isDataDriven()||pl(_.value)||!C?C:(w=u.properties,C.replace(/{([^{}]+)}/g,(D,P)=>P in w?String(w[P]):""));var w}createBucket(o){return new Xa(o)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const o of uf.paint.overridableProperties){if(!zu.hasPaintOverride(this.layout,o))continue;const u=this.paint.get(o),d=new hf(u),m=new cu(d,u.property.specification);let C=null;C="constant"===u.value.kind||"source"===u.value.kind?new uu("source",m):new kh("composite",m,u.value.zoomStops,u.value._interpolationType),this.paint._values[o]=new Ga(u.property,C,u.parameters)}}_handleOverridablePaintPropertyUpdate(o,u,d){return!(!this.layout||u.isDataDriven()||d.isDataDriven())&&zu.hasPaintOverride(this.layout,o)}static hasPaintOverride(o,u){const d=o.get("text-field"),m=uf.paint.properties[u];let C=!1;const _=w=>{for(const T of w)if(m.overrides&&m.overrides.hasOverride(T))return void(C=!0)};if("constant"===d.value.kind&&d.value.value instanceof wi)_(d.value.value.sections);else if("source"===d.value.kind){const w=D=>{C||(D instanceof Gs&&Ur(D.value)===e2?_(D.value.sections):D instanceof Mi?_(D.sections):D.eachChild(w))},T=d.value;T._styleExpression&&w(T._styleExpression.expression)}return C}getProgramConfiguration(o){return new Ml(this,o)}}var xm={paint:new $o({"background-color":new Xt(it.paint_background["background-color"]),"background-pattern":new yl(it.paint_background["background-pattern"]),"background-opacity":new Xt(it.paint_background["background-opacity"])})},df={paint:new $o({"raster-opacity":new Xt(it.paint_raster["raster-opacity"]),"raster-hue-rotate":new Xt(it.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Xt(it.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Xt(it.paint_raster["raster-brightness-max"]),"raster-saturation":new Xt(it.paint_raster["raster-saturation"]),"raster-contrast":new Xt(it.paint_raster["raster-contrast"]),"raster-resampling":new Xt(it.paint_raster["raster-resampling"]),"raster-fade-duration":new Xt(it.paint_raster["raster-fade-duration"])})};class nv extends F2{constructor(o){super(o,{}),this.implementation=o}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){}serialize(){}onAdd(o){this.implementation.onAdd&&this.implementation.onAdd(o,o.painter.context.gl)}onRemove(o){this.implementation.onRemove&&this.implementation.onRemove(o,o.painter.context.gl)}}var f3={paint:new $o({"sky-type":new Xt(it.paint_sky["sky-type"]),"sky-atmosphere-sun":new Xt(it.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new Xt(it.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new Xt(it.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new Xt(it.paint_sky["sky-gradient-radius"]),"sky-gradient":new rc(it.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new Xt(it.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new Xt(it.paint_sky["sky-atmosphere-color"]),"sky-opacity":new Xt(it.paint_sky["sky-opacity"])})};function qd(a,o,u){const d=je(0,0,1),m=Hn(mn());return function(C,_,w){w*=.5;var T=_[0],D=_[1],P=_[2],V=_[3],O=Math.sin(w),U=Math.cos(w);C[0]=T*U-P*O,C[1]=D*U+V*O,C[2]=P*U+T*O,C[3]=V*U-D*O}(m,m,u?-Pn(a)+Math.PI:Pn(a)),wn(m,m,-Pn(o)),Et(d,d,m),Dt(d,d)}const iv={circle:class extends F2{constructor(a){super(a,Vp)}createBucket(a){return new s2(a)}queryRadius(a){const o=a;return Mu("circle-radius",this,o)+Mu("circle-stroke-width",this,o)+r3(this.paint.get("circle-translate"))}queryIntersectsFeature(a,o,u,d,m,C,_,w){const T=H2(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),C.angle,a.pixelToTileUnitsFactor),D=this.paint.get("circle-radius").evaluate(o,u)+this.paint.get("circle-stroke-width").evaluate(o,u);return LC(a,d,C,_,w,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),T,D)}getProgramIds(){return["circle"]}getProgramConfiguration(a){return new Ml(this,a)}},heatmap:class extends F2{createBucket(a){return new bd(a)}constructor(a){super(a,AC),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(a){"heatmap-color"===a&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=P5({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(a){return Mu("heatmap-radius",this,a)}queryIntersectsFeature(a,o,u,d,m,C,_,w){const T=this.paint.get("heatmap-radius").evaluate(o,u);return LC(a,d,C,_,w,!0,!0,new de(0,0),T)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(a){return new Ml(this,a)}},hillshade:class extends F2{constructor(a){super(a,Op)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getProgramConfiguration(a){return new Ml(this,a)}},fill:class extends F2{constructor(a){super(a,Ed)}getProgramIds(){const a=this.paint.get("fill-pattern"),o=a&&a.constantOr(1),u=[o?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&u.push(o&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),u}getProgramConfiguration(a){return new Ml(this,a)}recalculate(a,o){super.recalculate(a,o);const u=this.paint._values["fill-outline-color"];"constant"===u.value.kind&&void 0===u.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(a){return new H5(a)}queryRadius(){return r3(this.paint.get("fill-translate"))}queryIntersectsFeature(a,o,u,d,m,C){return!a.queryGeometry.isAboveHorizon&&kp(k5(a.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),C.angle,a.pixelToTileUnitsFactor),d)}isTileClipped(){return!0}},"fill-extrusion":class extends F2{constructor(a){super(a,jC)}createBucket(a){return new Ad(a)}queryRadius(){return r3(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(a){return new Ml(this,a)}queryIntersectsFeature(a,o,u,d,m,C,_,w,T){const D=H2(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),C.angle,a.pixelToTileUnitsFactor),P=this.paint.get("fill-extrusion-height").evaluate(o,u),V=this.paint.get("fill-extrusion-base").evaluate(o,u),O=[0,0],U=w&&C.elevation,X=C.elevation?C.elevation.exaggeration():1;if(U){const xe=a.tile.getBucket(this).centroidVertexArray,Ie=T+1;if(Ie=3)for(let X=0;X1&&(T=o[++w]);const P=Math.abs(D-T.left),V=Math.abs(D-T.right),O=Math.min(P,V);let U;const X=C/d*(m+1);if(T.isDash){const ee=m-Math.abs(X);U=Math.sqrt(O*O+ee*ee)}else U=m-Math.sqrt(O*O+X*X);this.image.data[_+D]=Math.max(0,Math.min(255,U+128))}}}addRegularDash(o,u){for(let T=o.length-1;T>=0;--T){const D=o[T],P=o[T+1];D.zeroLength?o.splice(T,1):P&&P.isDash===D.isDash&&(P.left=D.left,o.splice(T,1))}const d=o[0],m=o[o.length-1];d.isDash===m.isDash&&(d.left=m.left-this.width,m.right=d.right+this.width);const C=this.width*this.nextRow;let _=0,w=o[_];for(let T=0;T1&&(w=o[++_]);const D=Math.abs(T-w.left),P=Math.abs(T-w.right),V=Math.min(D,P);this.image.data[C+T]=Math.max(0,Math.min(255,(w.isDash?V:-V)+u+128))}}addDash(o,u){const d=this.getKey(o,u);if(this.positions[d])return this.positions[d];const m="round"===u,C=m?7:0,_=2*C+1;if(this.nextRow+_>this.height)return Fr("LineAtlas out of space"),null;0===o.length&&o.push(1);let w=0;for(let P=0;P{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const pf=pe.performance;function m4(a){const o=a?a.url.toString():void 0;return pf.getEntriesByName(o)}class r0{constructor(){this.tasks={},this.taskQueue=[],ea(["process"],this),this.invoker=new Pu(this.process),this.nextId=0}add(o,u){const d=this.nextId++,m=function({type:C,isSymbolTile:_,zoom:w}){return w=w||0,"message"===C?0:"maybePrepare"!==C||_?"parseTile"!==C||_?"parseTile"===C&&_?300-w:"maybePrepare"===C&&_?400-w:500:200-w:100-w}(u);if(0===m){To();try{o()}finally{}return{cancel:()=>{}}}return this.tasks[d]={fn:o,metadata:u,priority:m,id:d},this.taskQueue.push(d),this.invoker.trigger(),{cancel:()=>{delete this.tasks[d]}}}process(){To();try{if(this.taskQueue=this.taskQueue.filter(d=>!!this.tasks[d]),!this.taskQueue.length)return;const o=this.pick();if(null===o)return;const u=this.tasks[o];if(delete this.tasks[o],this.taskQueue.length&&this.invoker.trigger(),!u)return;u.fn()}finally{}}pick(){let o=null,u=1/0;for(let m=0;m0;P--)T=1<this.canonical.z?new ba(o,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ba(o,this.wrap,o,this.canonical.x>>u,this.canonical.y>>u)}calculateScaledKey(o,u=!0){if(this.overscaledZ===o&&u)return this.key;if(o>this.canonical.z)return C4(this.wrap*+u,o,this.canonical.z,this.canonical.x,this.canonical.y);{const d=this.canonical.z-o;return C4(this.wrap*+u,o,o,this.canonical.x>>d,this.canonical.y>>d)}}isChildOf(o){if(o.wrap!==this.wrap)return!1;const u=this.canonical.z-o.canonical.z;return 0===o.overscaledZ||o.overscaledZ>u&&o.canonical.y===this.canonical.y>>u}children(o){if(this.overscaledZ>=o)return[new ba(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const u=this.canonical.z+1,d=2*this.canonical.x,m=2*this.canonical.y;return[new ba(u,this.wrap,u,d,m),new ba(u,this.wrap,u,d+1,m),new ba(u,this.wrap,u,d,m+1),new ba(u,this.wrap,u,d+1,m+1)]}isLessThan(o){return this.wrapo.wrap)&&(this.overscaledZo.overscaledZ)&&(this.canonical.xo.canonical.x)&&this.canonical.yo[_])return null}else{const w=1/d[_];let T=(a[_]-u[_])*w,D=(o[_]-u[_])*w;if(T>D){const P=T;T=D,D=P}if(T>m&&(m=T),DC)return null}return m}function m1(a,o,u,d,m,C,_,w,T,D,P){const V=d-a,O=m-o,U=C-u,X=_-a,ee=w-o,se=T-u,xe=P[1]*se-P[2]*ee,Ie=P[2]*X-P[0]*se,$e=P[0]*ee-P[1]*X,Ke=V*xe+O*Ie+U*$e;if(Math.abs(Ke)<1e-15)return null;const rt=1/Ke,st=D[0]-a,Rt=D[1]-o,Vt=D[2]-u,Cn=(st*xe+Rt*Ie+Vt*$e)*rt;if(Cn<0||Cn>1)return null;const dn=Rt*U-Vt*O,Ht=Vt*V-st*U,cn=st*O-Rt*V,yn=(P[0]*dn+P[1]*Ht+P[2]*cn)*rt;return yn<0||Cn+yn>1?null:(X*dn+ee*Ht+se*cn)*rt}function Em(a,o,u){return(a-o)/(u-o)}function Dm(a,o,u,d,m,C,_,w,T){const D=1<{const Ie=se?1:0,$e=(U+1)*ee-Ie,Ke=X*ee,rt=(X+1)*ee-Ie;xe[0]=U*ee,xe[1]=Ke,xe[2]=$e,xe[3]=rt};let V=new Tm(T);const O=[];for(let U=0;U=1;T/=2){const U=w[w.length-1];V=new Tm(T);for(let X=0;X0;){const{idx:X,t:ee,nodex:se,nodey:xe,depth:Ie}=U.pop();if(this.leaves[X]){Dm(se,xe,Ie,o,u,d,m,V,O);const Ke=1<=Vn[2])return ee}continue}let $e=0;for(let Ke=0;Ke=D[P[Vt]]&&(P.splice(Vt,0,Ke),Rt=!0);Rt||(P[$e]=Ke),$e++}}for(let Ke=0;Ke<$e;Ke++){const rt=P[Ke];U.push({idx:this.childOffsets[X]+rt,t:D[rt],nodex:(se<<1)+this._siblingOffset[rt][0],nodey:(xe<<1)+this._siblingOffset[rt][1],depth:Ie+1})}}return null}_addNode(o,u,d){return this.minimums.push(o),this.maximums.push(u),this.leaves.push(d),this.childOffsets.push(0),this.nodeCount++}_construct(o,u,d,m,C){if(1===o[m].isLeaf(u,d))return;this.childOffsets[C]||(this.childOffsets[C]=this.nodeCount);const _=m-1,w=o[_];let T,D=0;for(let P=0;P=this.dim+1||u<-1||u>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(u+1)*this.stride+(o+1)}_unpackMapbox(o,u,d){return(256*o*256+256*u+d)/10-1e4}_unpackTerrarium(o,u,d){return 256*o+u+d/256-32768}static pack(o,u){const d=[0,0,0,0],m=t6.getUnpackVector(u);let C=Math.floor((o+m[3])/m[2]);return d[2]=C%256,C=Math.floor(C/256),d[1]=C%256,C=Math.floor(C/256),d[0]=C,d}getPixels(){return new N1({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(o,u,d){if(this.dim!==o.dim)throw new Error("dem dimension mismatch");let m=u*this.dim,C=u*this.dim+this.dim,_=d*this.dim,w=d*this.dim+this.dim;switch(u){case-1:m=C-1;break;case 1:C=m+1}switch(d){case-1:_=w-1;break;case 1:w=_+1}const T=-u*this.dim,D=-d*this.dim;for(let P=_;P{this.remove(o,C)},d)),this.data[m].push(C),this.order.push(m),this.order.length>this.max){const _=this._getAndRemoveByKey(this.order[0]);_&&this.onRemove(_)}return this}has(o){return o.wrapped().key in this.data}getAndRemove(o){return this.has(o)?this._getAndRemoveByKey(o.wrapped().key):null}_getAndRemoveByKey(o){const u=this.data[o].shift();return u.timeout&&clearTimeout(u.timeout),0===this.data[o].length&&delete this.data[o],this.order.splice(this.order.indexOf(o),1),u.value}getByKey(o){const u=this.data[o];return u?u[0].value:null}get(o){return this.has(o)?this.data[o.wrapped().key][0].value:null}remove(o,u){if(!this.has(o))return this;const d=o.wrapped().key,m=void 0===u?0:this.data[d].indexOf(u),C=this.data[d][m];return this.data[d].splice(m,1),C.timeout&&clearTimeout(C.timeout),0===this.data[d].length&&delete this.data[d],this.onRemove(C.value),this.order.splice(this.order.indexOf(d),1),this}setMaxSize(o){for(this.max=o;this.order.length>this.max;){const u=this._getAndRemoveByKey(this.order[0]);u&&this.onRemove(u)}return this}filter(o){const u=[];for(const d in this.data)for(const m of this.data[d])o(m.value)||u.push(m);for(const d of u)this.remove(d.value.tileID,d)}}class m3 extends Bn{constructor(o,u,d){super(),this.id=o,this._onlySymbols=d,u.on("data",m=>{"source"===m.dataType&&"metadata"===m.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===m.dataType&&"content"===m.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))}),u.on("error",()=>{this._sourceErrored=!0}),this._source=u,this._tiles={},this._cache=new gf(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=null,this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Sm}onAdd(o){this.map=o,this._minTileCacheSize=o?o._minTileCacheSize:null,this._maxTileCacheSize=o?o._maxTileCacheSize:null}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const o in this._tiles){const u=this._tiles[o];if("loaded"!==u.state&&"errored"!==u.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const o=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,o&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(o,u){return o.isSymbolTile=this._onlySymbols,this._source.loadTile(o,u)}_unloadTile(o){if(this._source.unloadTile)return this._source.unloadTile(o,()=>{})}_abortTile(o){if(this._source.abortTile)return this._source.abortTile(o,()=>{})}serialize(){return this._source.serialize()}prepare(o){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const u in this._tiles){const d=this._tiles[u];d.upload(o),d.prepare(this.map.style.imageManager)}}getIds(){return Jo(this._tiles).map(o=>o.tileID).sort(Am).map(o=>o.key)}getRenderableIds(o){const u=[];for(const d in this._tiles)this._isIdRenderable(+d,o)&&u.push(this._tiles[d]);return o?u.sort((d,m)=>{const C=d.tileID,_=m.tileID,w=new de(C.canonical.x,C.canonical.y)._rotate(this.transform.angle),T=new de(_.canonical.x,_.canonical.y)._rotate(this.transform.angle);return C.overscaledZ-_.overscaledZ||T.y-w.y||T.x-w.x}).map(d=>d.tileID.key):u.map(d=>d.tileID).sort(Am).map(d=>d.key)}hasRenderableParent(o){const u=this.findLoadedParent(o,0);return!!u&&this._isIdRenderable(u.tileID.key)}_isIdRenderable(o,u){return this._tiles[o]&&this._tiles[o].hasData()&&!this._coveredTiles[o]&&(u||!this._tiles[o].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const o in this._tiles)"errored"!==this._tiles[o].state&&this._reloadTile(+o,"reloading")}}_reloadTile(o,u){const d=this._tiles[o];d&&("loading"!==d.state&&(d.state=u),this._loadTile(d,this._tileLoaded.bind(this,d,o,u)))}_tileLoaded(o,u,d,m){if(m)if(o.state="errored",404!==m.status)this._source.fire(new gn(m,{tile:o}));else if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const C=this.map.painter.terrain;this.update(this.transform,C.getScaledDemTileSize(),!0),C.resetTileLookupCache(this.id)}else this.update(this.transform);else o.timeAdded=Xr.now(),"expired"===d&&(o.refreshedUponExpiration=!0),this._setTileReloadTimer(u,o),"raster-dem"===this._source.type&&o.dem&&this._backfillDEM(o),this._state.initializeTileState(o,this.map?this.map.painter:null),this._source.fire(new Gt("data",{dataType:"source",tile:o,coord:o.tileID,sourceCacheId:this.id}))}_backfillDEM(o){const u=this.getRenderableIds();for(let m=0;m1||(Math.abs(_)>1&&(1===Math.abs(_+T)?_+=T:1===Math.abs(_-T)&&(_-=T)),C.dem&&m.dem&&(m.dem.backfillBorder(C.dem,_,w),m.neighboringTiles&&m.neighboringTiles[D]&&(m.neighboringTiles[D].backfilled=!0)))}}getTile(o){return this.getTileByID(o.key)}getTileByID(o){return this._tiles[o]}_retainLoadedChildren(o,u,d,m){for(const C in this._tiles){let _=this._tiles[C];if(m[C]||!_.hasData()||_.tileID.overscaledZ<=u||_.tileID.overscaledZ>d)continue;let w=_.tileID;for(;_&&_.tileID.overscaledZ>u+1;){const D=_.tileID.scaledTo(_.tileID.overscaledZ-1);_=this._tiles[D.key],_&&_.hasData()&&(w=D)}let T=w;for(;T.overscaledZ>u;)if(T=T.scaledTo(T.overscaledZ-1),o[T.key]){m[w.key]=w;break}}}findLoadedParent(o,u){if(o.key in this._loadedParentTiles){const d=this._loadedParentTiles[o.key];return d&&d.tileID.overscaledZ>=u?d:null}for(let d=o.overscaledZ-1;d>=u;d--){const m=o.scaledTo(d),C=this._getLoadedTile(m);if(C)return C}}_getLoadedTile(o){const u=this._tiles[o.key];return u&&u.hasData()?u:this._cache.getByKey(this._source.reparseOverscaled?o.wrapped().key:o.canonical.key)}updateCacheSize(o,u){u=u||this._source.tileSize;const d=Math.ceil(o.width/u)+1,m=Math.ceil(o.height/u)+1,C=Math.floor(d*m*5),_="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,C):C,w="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,_):_;this._cache.setMaxSize(w)}handleWrapJump(o){const u=Math.round((o-(void 0===this._prevLng?o:this._prevLng))/360);if(this._prevLng=o,u){const d={};for(const m in this._tiles){const C=this._tiles[m];C.tileID=C.tileID.unwrapTo(C.tileID.wrap+u),d[C.tileID.key]=C}this._tiles=d;for(const m in this._timers)clearTimeout(this._timers[m]),delete this._timers[m];for(const m in this._tiles)this._setTileReloadTimer(+m,this._tiles[m])}}update(o,u,d){if(this.transform=o,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!d)return;let m;this.updateCacheSize(o,u),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?m=o.getVisibleUnwrappedCoordinates(this._source.tileID).map(w=>new ba(w.canonical.z,w.wrap,w.canonical.z,w.canonical.x,w.canonical.y)):(m=o.coveringTiles({tileSize:u||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!d,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(m=m.filter(w=>this._source.hasTile(w)))):m=[];const C=this._updateRetainedTiles(m);if(km(this._source.type)&&0!==m.length){const w={},T={},D=Object.keys(C);for(const V of D){const O=C[V],U=this._tiles[V];if(!U||U.fadeEndTime&&U.fadeEndTime<=Xr.now())continue;const X=this.findLoadedParent(O,Math.max(O.overscaledZ-m3.maxOverzooming,this._source.minzoom));X&&(this._addTile(X.tileID),w[X.tileID.key]=X.tileID),T[V]=O}const P=m[m.length-1].overscaledZ;for(const V in this._tiles){const O=this._tiles[V];if(C[V]||!O.hasData())continue;let U=O.tileID;for(;U.overscaledZ>P;){U=U.scaledTo(U.overscaledZ-1);const X=this._tiles[U.key];if(X&&X.hasData()&&T[U.key]){C[V]=O.tileID;break}}}for(const V in w)C[V]||(this._coveredTiles[V]=!0,C[V]=w[V])}for(const w in C)this._tiles[w].clearFadeHold();const _=function(w,T){const D=[];for(const P in w)P in T||D.push(P);return D}(this._tiles,C);for(const w of _){const T=this._tiles[w];T.hasSymbolBuckets&&!T.holdingForFade()?T.setHoldDuration(this.map._fadeDuration):T.hasSymbolBuckets&&!T.symbolFadeFinished()||this._removeTile(+w)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const o in this._tiles)this._tiles[o].holdingForFade()&&this._removeTile(+o)}_updateRetainedTiles(o){const u={};if(0===o.length)return u;const d={},m=o.reduce((D,P)=>Math.min(D,P.overscaledZ),1/0),C=o[0].overscaledZ,_=Math.max(C-m3.maxOverzooming,this._source.minzoom),w=Math.max(C+m3.maxUnderzooming,this._source.minzoom),T={};for(const D of o){const P=this._addTile(D);u[D.key]=D,P.hasData()||m=this._source.maxzoom){const O=D.children(this._source.maxzoom)[0],U=this.getTile(O);if(U&&U.hasData()){u[O.key]=O;continue}}else{const O=D.children(this._source.maxzoom);if(u[O[0].key]&&u[O[1].key]&&u[O[2].key]&&u[O[3].key])continue}let V=P.wasRequested();for(let O=D.overscaledZ-1;O>=_;--O){const U=D.scaledTo(O);if(d[U.key]||(d[U.key]=!0,P=this.getTile(U),!P&&V&&(P=this._addTile(U)),P&&(u[U.key]=U,V=P.wasRequested(),P.hasData())))break}}return u}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const o in this._tiles){const u=[];let d,m=this._tiles[o].tileID;for(;m.overscaledZ>0;){if(m.key in this._loadedParentTiles){d=this._loadedParentTiles[m.key];break}u.push(m.key);const C=m.scaledTo(m.overscaledZ-1);if(d=this._getLoadedTile(C),d)break;m=C}for(const C of u)this._loadedParentTiles[C]=d}}_addTile(o){let u=this._tiles[o.key];if(u)return u;u=this._cache.getAndRemove(o),u&&(this._setTileReloadTimer(o.key,u),u.tileID=o,this._state.initializeTileState(u,this.map?this.map.painter:null),this._cacheTimers[o.key]&&(clearTimeout(this._cacheTimers[o.key]),delete this._cacheTimers[o.key],this._setTileReloadTimer(o.key,u)));const d=Boolean(u);if(!d){const m=this.map?this.map.painter:null,C="raster"===this._source.type||"raster-dem"===this._source.type;u=new i6(o,this._source.tileSize*o.overscaleFactor(),this.transform.tileZoom,m,C),this._loadTile(u,this._tileLoaded.bind(this,u,o.key,u.state))}return u?(u.uses++,this._tiles[o.key]=u,d||this._source.fire(new Gt("dataloading",{tile:u,coord:u.tileID,dataType:"source"})),u):null}_setTileReloadTimer(o,u){o in this._timers&&(clearTimeout(this._timers[o]),delete this._timers[o]);const d=u.getExpiryTimeout();d&&(this._timers[o]=setTimeout(()=>{this._reloadTile(o,"expired"),delete this._timers[o]},d))}_removeTile(o){const u=this._tiles[o];u&&(u.uses--,delete this._tiles[o],this._timers[o]&&(clearTimeout(this._timers[o]),delete this._timers[o]),u.uses>0||(u.hasData()&&"reloading"!==u.state?this._cache.add(u.tileID,u,u.getExpiryTimeout()):(u.aborted=!0,this._abortTile(u),this._unloadTile(u))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const o in this._tiles)this._removeTile(+o);this._source._clear&&this._source._clear(),this._cache.reset()}tilesIn(o,u,d){const m=[],C=this.transform;if(!C)return m;for(const _ in this._tiles){const w=this._tiles[_];if(d&&w.clearQueryDebugViz(),w.holdingForFade())continue;const T=o.containsTile(w,C,u);T&&m.push(T)}return m}getVisibleCoordinates(o){const u=this.getRenderableIds(o).map(d=>this._tiles[d].tileID);for(const d of u)d.projMatrix=this.transform.calculateProjMatrix(d.toUnwrapped());return u}hasTransition(){if(this._source.hasTransition())return!0;if(km(this._source.type))for(const o in this._tiles){const u=this._tiles[o];if(void 0!==u.fadeEndTime&&u.fadeEndTime>=Xr.now())return!0}return!1}setFeatureState(o,u,d){this._state.updateState(o=o||"_geojsonTileLayer",u,d)}removeFeatureState(o,u,d){this._state.removeFeatureState(o=o||"_geojsonTileLayer",u,d)}getFeatureState(o,u){return this._state.getState(o=o||"_geojsonTileLayer",u)}setDependencies(o,u,d){const m=this._tiles[o];m&&m.setDependencies(u,d)}reloadTilesForDependencies(o,u){for(const d in this._tiles)this._tiles[d].hasDependency(o,u)&&this._reloadTile(+d,"reloading");this._cache.filter(d=>!d.hasDependency(o,u))}_preloadTiles(o,u){const d=new Map,m=Array.isArray(o)?o:[o],C=this.map.painter.terrain,_=this.usedForTerrain&&C?C.getScaledDemTileSize():this._source.tileSize;for(const D of m){const P=D.coveringTiles({tileSize:_,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const V of P)d.set(V.key,V);this.usedForTerrain&&D.updateElevation(!1)}const w=Array.from(d.values()),T="raster"===this._source.type||"raster-dem"===this._source.type;Os(w,(D,P)=>{const V=new i6(D,this._source.tileSize*D.overscaleFactor(),this.transform.tileZoom,this.map.painter,T);this._loadTile(V,O=>{"raster-dem"===this._source.type&&V.dem&&this._backfillDEM(V),P(O,V)})},u)}}function Am(a,o){const u=Math.abs(2*a.wrap)-+(a.wrap<0),d=Math.abs(2*o.wrap)-+(o.wrap<0);return a.overscaledZ-o.overscaledZ||d-u||o.canonical.y-a.canonical.y||o.canonical.x-a.canonical.x}function km(a){return"raster"===a||"image"===a||"video"===a}m3.maxOverzooming=10,m3.maxUnderzooming=3;class n6{constructor(o,u,d){this._demTile=o,this._dem=this._demTile.dem,this._scale=u,this._offset=d}static create(o,u,d){const m=d||o.findDEMTileFor(u);if(!m||!m.dem)return;const C=m.dem,_=m.tileID,w=1<=0&&V[3]>=0&&T.insert(w,V[0],V[1],V[2],V[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new u4.VectorTile(new Kh(this.rawTileData)).layers,this.sourceLayerCoder=new mf(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const o in this.vtLayers)this.vtFeatures[o]=[]}return this.vtLayers}query(o,u,d,m){this.loadVTLayers();const C=o.params||{},_=$a(C.filter),w=o.tileResult,T=o.transform,D=w.bufferedTilespaceBounds,P=this.grid.query(D.min.x,D.min.y,D.max.x,D.max.y,(X,ee,se,xe)=>Pp(w.bufferedTilespaceGeometry,X,ee,se,xe));P.sort(zm);let V=null;T.elevation&&P.length>0&&(V=n6.create(T.elevation,this.tileID));const O={};let U;for(let X=0;X(xe||(xe=cc(Ie,this.tileID.canonical,o.tileTransform)),$e.queryIntersectsFeature(w,Ie,Ke,xe,this.z,o.transform,o.pixelPosMatrix,V,rt)))}return O}loadMatchingFeature(o,u,d,m,C,_,w,T,D){const{featureIndex:P,bucketIndex:V,sourceLayerIndex:O,layoutVertexArrayOffset:U}=u,X=this.bucketLayerIDs[V];if(m&&!function(Ie,$e){for(let Ke=0;Ke=0)return!0;return!1}(m,X))return;const ee=this.sourceLayerCoder.decode(O),se=this.vtLayers[ee].feature(P);if(d.needGeometry){const Ie=l4(se,!0);if(!d.filter(new ui(this.tileID.overscaledZ),Ie,this.tileID.canonical))return}else if(!d.filter(new ui(this.tileID.overscaledZ),se))return;const xe=this.getId(se,ee);for(let Ie=0;Ie{const w=o instanceof z2?o.get(_):null;return w&&w.evaluate?w.evaluate(u,d,m):w})}function zm(a,o){return o-a}En("FeatureIndex",Cf,{omit:["rawTileData","sourceLayerCoder"]});var lv=ps([{name:"a_pos",type:"Int16",components:2}]);const dc=new Uint16Array(8184);for(let a=0;a<2046;a++){let o=a+2,u=0,d=0,m=0,C=0,_=0,w=0;for(1&o?m=C=_=32:u=d=w=32;(o>>=1)>1;){const D=u+m>>1,P=d+C>>1;1&o?(m=u,C=d,u=_,d=w):(u=m,d=C,m=_,C=w),_=D,w=P}const T=4*a;dc[T+0]=u,dc[T+1]=d,dc[T+2]=m,dc[T+3]=C}const Dl=new Uint16Array(2178),ha=new Uint8Array(1089),Fu=new Uint16Array(1089);function Pm(a){return 0===a?-.03125:32===a?.03125:0}var vf=ps([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const cv={type:2,extent:Yi,loadGeometry:()=>[[new de(0,0),new de(8193,0),new de(8193,8193),new de(0,8193),new de(0,0)]]};class i6{constructor(o,u,d,m,C){this.tileID=o,this.uid=K1(),this.uses=0,this.tileSize=u,this.tileZoom=d,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=C,this.expiredRequestCount=0,this.state="loading",m&&m.transform&&(this.projection=m.transform.projection)}registerFadeDuration(o){const u=o+this.timeAdded;uC.getLayer(D)).filter(Boolean);if(0!==T.length){w.layers=T,w.stateDependentLayerIds&&(w.stateDependentLayers=w.stateDependentLayerIds.map(D=>T.filter(P=>P.id===D)[0]));for(const D of T)_[D.id]=w}}return _}(o.buckets,u.style),this.hasSymbolBuckets=!1;for(const m in this.buckets){const C=this.buckets[m];if(C instanceof Xa){if(this.hasSymbolBuckets=!0,!d)break;C.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const m in this.buckets){const C=this.buckets[m];if(C instanceof Xa&&C.hasRTLText){this.hasRTLText=!0,Hi.isLoading()||Hi.isLoaded()||"deferred"!==ho()||Uo();break}}this.queryPadding=0;for(const m in this.buckets){const C=this.buckets[m];this.queryPadding=Math.max(this.queryPadding,u.style.getLayer(m).queryRadius(C))}o.imageAtlas&&(this.imageAtlas=o.imageAtlas),o.glyphAtlasImage&&(this.glyphAtlasImage=o.glyphAtlasImage),o.lineAtlas&&(this.lineAtlas=o.lineAtlas)}else this.collisionBoxArray=new w5}unloadVectorData(){if(this.hasData()){for(const o in this.buckets)this.buckets[o].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugIndexBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this.globeGridBuffer&&(this.globeGridBuffer.destroy(),this.globeGridBuffer=null),this.globePoleBuffer&&(this.globePoleBuffer.destroy(),this.globePoleBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(o){return this.buckets[o.id]}upload(o){for(const d in this.buckets){const m=this.buckets[d];m.uploadPending()&&m.upload(o)}const u=o.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Yd(o,this.imageAtlas.image,u.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Yd(o,this.glyphAtlasImage,u.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Yd(o,this.lineAtlas.image,u.ALPHA),this.lineAtlas.uploaded=!0)}prepare(o){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(o,this.imageAtlasTexture)}queryRenderedFeatures(o,u,d,m,C,_,w,T){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:m,pixelPosMatrix:w,transform:_,params:C,tileTransform:this.tileTransform},o,u,d):{}}querySourceFeatures(o,u){const d=this.latestFeatureIndex;if(!d||!d.rawTileData)return;const m=d.loadVTLayers(),C=u?u.sourceLayer:"",_=m._geojsonTileLayer||m[C];if(!_)return;const w=$a(u&&u.filter),{z:T,x:D,y:P}=this.tileID.canonical,V={z:T,x:D,y:P};for(let O=0;O<_.length;O++){const U=_.feature(O);if(w.needGeometry){const se=l4(U,!0);if(!w.filter(new ui(this.tileID.overscaledZ),se,this.tileID.canonical))continue}else if(!w.filter(new ui(this.tileID.overscaledZ),U))continue;const X=d.getId(U,C),ee=new Mm(U,T,D,P,X);ee.tile=V,o.push(ee)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(o){const u=this.expirationTime;if(o.cacheControl){const d=J1(o.cacheControl);d["max-age"]&&(this.expirationTime=Date.now()+1e3*d["max-age"])}else o.expires&&(this.expirationTime=new Date(o.expires).getTime());if(this.expirationTime){const d=Date.now();let m=!1;if(this.expirationTime>d)m=!1;else if(u)if(this.expirationTime=0;se--){const xe=4*se,Ie=dc[xe+0],$e=dc[xe+1],Ke=dc[xe+2],rt=dc[xe+3],st=Ie+Ke>>1,Rt=$e+rt>>1,Vt=st+Rt-$e,Cn=Rt+Ie-st,dn=33*$e+Ie,Ht=33*rt+Ke,cn=33*Rt+st,yn=Math.hypot((Dl[2*dn+0]+Dl[2*Ht+0])/2-Dl[2*cn+0],(Dl[2*dn+1]+Dl[2*Ht+1])/2-Dl[2*cn+1])>=16;if(ha[cn]=ha[cn]||(yn?1:0),se<1022){const Kt=33*($e+Cn>>1)+(Ie+Vt>>1),Dn=33*(rt+Cn>>1)+(Ke+Vt>>1);ha[cn]=ha[cn]||ha[Kt]||ha[Dn]}}const V=new Oh,O=new f1;let U=0;function X(se,xe){const Ie=33*xe+se;return 0===Fu[Ie]&&(V.emplaceBack(Dl[2*Ie+0],Dl[2*Ie+1],se*Yi/32,xe*Yi/32),Fu[Ie]=++U),Fu[Ie]-1}function ee(se,xe,Ie,$e,Ke,rt){const st=se+Ie>>1,Rt=xe+$e>>1;if(Math.abs(se-Ke)+Math.abs(xe-rt)>1&&ha[33*Rt+st])ee(Ke,rt,se,xe,st,Rt),ee(Ie,$e,Ke,rt,st,Rt);else{const Vt=X(se,xe),Cn=X(Ie,$e),dn=X(Ke,rt);O.emplaceBack(Vt,Cn,dn)}}return ee(0,0,32,32,32,0),ee(32,32,0,0,0,32),{vertices:V,indices:O}}(this.tileID.canonical,u);m=_.vertices,C=_.indices}else{m=new Oh,C=new f1;for(const{x:w,y:T}of d)m.emplaceBack(w,T,0,0);const _=Su(m.int16,void 0,4);for(let w=0;w<_.length;w+=3)C.emplaceBack(_[w],_[w+1],_[w+2])}this._tileBoundsBuffer=o.createVertexBuffer(m,vf.members),this._tileBoundsIndexBuffer=o.createIndexBuffer(C),this._tileBoundsSegments=Vs.simpleSegment(0,0,m.length,C.length)}}const uv=ps([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_merc_pos",components:2},{type:"Float32",name:"a_uv",components:2}]),hv=ps([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Vm}=uv;function fc(a,o){const u=a.fovAboveCenter,d=a.elevation?a.elevation.getMinElevationBelowMSL()*o:0,m=(a._camera.position[2]*a.worldSize-d)/Math.cos(a._pitch),C=Math.sin(u)*m/Math.sin(Math.max(Math.PI/2-a._pitch-u,.01)),_=Math.sin(a._pitch)*C+m;return Math.min(1.01*_,m*(1/a._horizonShift))}const yf=Yi/Math.PI/2,g1=-yf,da=yf,_f=[new o2([g1,g1,g1],[da,da,da]),new o2([g1,g1,g1],[0,0,da]),new o2([0,g1,g1],[da,0,da]),new o2([g1,0,g1],[0,da,da]),new o2([0,0,g1],[da,da,da])];function r6(a){if(a.z<=1)return _f[a.z+2*a.y+a.x];const[o,u]=s6(a),d=[o0(o[0],o[1]),o0(o[0],u[1]),o0(u[0],o[1]),o0(u[0],u[1])],m=[da,da,da],C=[g1,g1,g1];for(const _ of d)m[0]=Math.min(m[0],_[0]),m[1]=Math.min(m[1],_[1]),m[2]=Math.min(m[2],_[2]),C[0]=Math.max(C[0],_[0]),C[1]=Math.max(C[1],_[1]),C[2]=Math.max(C[2],_[2]);return new o2(m,C)}function s6(a){const o=Math.pow(2,a.z),u=a.x/o,d=(a.x+1)/o,m=(a.y+1)/o;return[[qa(a.y/o),i3(u)],[qa(m),i3(d)]]}function s0(a,o,u,d){return u=Pn(u),d||(d=yf),[a*Math.sin(u)*d,-o*d,a*Math.cos(u)*d]}function o0(a,o,u){return s0(Math.cos(Pn(a)),Math.sin(Pn(a)),o,u)}function Fm(a){return 16383/Math.max(...Ot([],a.max,a.min))}function Om(a){const o=Pe(new Float64Array(16)),u=1/Fm(a);return Je(o,o,a.min),_t(o,o,[u,u,u]),o}function o6(a,o,u){const d=o/(2*Math.PI),m=function(_){const w=Yi/(2*Math.PI);return _/(2*Math.PI)/w}(o);if(!u){const _=qi(a.center.lat,-85.051129,R2);u=[O2(a.center.lng)*o,bu(_)*o]}const C=Pe(new Float64Array(16));return Je(C,C,[u[0],u[1],-d]),_t(C,C,[m,m,m]),qe(C,C,Pn(-a._center.lat)),It(C,C,Pn(-a._center.lng)),C}class Nm{constructor(o){const u=this._createGridIndices();this.gridIndexBuffer=o.createIndexBuffer(u,!0),this.gridSegments=Vs.simpleSegment(0,0,4225,8192);const d=this._createPoleTriangleIndices();this.poleIndexBuffer=o.createIndexBuffer(d,!0),this.poleSegments=Vs.simpleSegment(0,0,66,64);const m=new vu;m.emplaceBack(-1,1,1,0,0,0,0),m.emplaceBack(1,1,1,0,0,1,0),m.emplaceBack(1,-1,1,0,0,1,1),m.emplaceBack(-1,-1,1,0,0,0,1);const C=new f1;C.emplaceBack(0,1,2),C.emplaceBack(2,3,0),this.atmosphereVertexBuffer=o.createVertexBuffer(m,hv.members),this.atmosphereIndexBuffer=o.createIndexBuffer(C),this.atmosphereSegments=Vs.simpleSegment(0,0,4,2)}destroy(){this.poleIndexBuffer.destroy(),this.gridIndexBuffer.destroy(),this.poleSegments.destroy(),this.gridSegments.destroy(),this.atmosphereVertexBuffer.destroy(),this.atmosphereIndexBuffer.destroy(),this.atmosphereSegments.destroy(),this.wireframeIndexBuffer&&(this.wireframeIndexBuffer.destroy(),this.wireframeSegments.destroy())}static createPoleTriangleVertices(o,u,d){const m=new vu,C=u/Math.PI/2;m.emplaceBack(0,-C,0,0,0,.5,d?0:1);const _=360/o,w=Math.cos(Pn(85)),T=Math.sin(Pn(85));for(let P=0;P<=64;P++){const V=P/64,O=s0(w,T,0*(1-(D=V))+_*D,C);m.emplaceBack(O[0],O[1],O[2],0,0,V,d?0:1)}var D;return m}_createPoleTriangleIndices(){const o=new f1;for(let u=0;u<=64;u++)o.emplaceBack(0,u+1,u+2);return o}static createGridVertices(o){const u=Math.pow(2,o.z),d=(T,D,P)=>T*(1-P)+D*P,[m,C]=s6(o),_=new vu,w=function(T){const D=Pe(new Float64Array(16)),P=Fm(T);var V,O;return _t(D,D,[P,P,P]),Je(D,D,((V=[])[0]=-(O=T.min)[0],V[1]=-O[1],V[2]=-O[2],V)),D}(r6(o));_.reserve(4096);for(let T=0;T<65;T++){const D=d(m[0],C[0],T/64),P=bu(D),V=P*u-o.y,O=Math.sin(Pn(D)),U=Math.cos(Pn(D));for(let X=0;X<65;X++){const ee=X/64,se=d(m[1],C[1],ee),xe=s0(U,O,se);Wt(xe,xe,w);const Ie=O2(se);_.emplaceBack(xe[0],xe[1],xe[2],Ie,P,ee,V)}}return _}_createGridIndices(){const o=new f1,u=(d,m)=>{const C=65*m+d;o.emplaceBack(C+1,C,C+65),o.emplaceBack(C+65,C+65+1,C+1)};for(let d=0;d<64;d++)for(let m=0;m<64;m++)u(m,d);return o}getWirefameBuffer(o){if(!this.wireframeSegments){const u=this._createWireframeGrid();this.wireframeIndexBuffer=o.createIndexBuffer(u),this.wireframeSegments=Vs.simpleSegment(0,0,4096,u.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}_createWireframeGrid(){const o=new bl,u=(d,m)=>{const C=65*m+d;o.emplaceBack(C,C+1),o.emplaceBack(C,C+65),o.emplaceBack(C,C+65+1)};for(let d=0;d<64;d++)for(let m=0;m<64;m++)u(m,d);return o}}function Ou(a,o){if(!o.isReprojectedInTileSpace)return{scale:1<$e&&(Ke(st,Kt,Vt,Cn,cn,yn),Ke(Kt,Rt,cn,yn,dn,Ht))}Ke(V,O,d,C,m,C),Ke(O,U,m,C,m,_),Ke(U,X,m,_,d,_),Ke(X,V,d,_,d,C),ee-=$e,se-=$e,xe+=$e,Ie+=$e;const rt=1/Math.max(xe-ee,Ie-se);return{scale:rt,x:ee*rt,y:se*rt,x2:xe*rt,y2:Ie*rt,projection:o}}class xf{constructor(o){const u={},d=[];for(const w in o){const T=o[w],D=u[w]={};for(const P in T.glyphs){const V=T.glyphs[+P];if(!V||0===V.bitmap.width||0===V.bitmap.height)continue;const O=V.metrics.localGlyph?2:1,U={x:0,y:0,w:V.bitmap.width+2*O,h:V.bitmap.height+2*O};d.push(U),D[P]=U}}const{w:m,h:C}=Rd(d),_=new s3({width:m||1,height:C||1});for(const w in o){const T=o[w];for(const D in T.glyphs){const P=T.glyphs[+D];if(!P||0===P.bitmap.width||0===P.bitmap.height)continue;const V=u[w][D],O=P.metrics.localGlyph?2:1;s3.copy(P.bitmap,_,{x:0,y:0},{x:V.x+O,y:V.y+O},P.bitmap)}}this.image=_,this.positions=u}}En("GlyphAtlas",xf);class Rm{constructor(o){this.tileID=new ba(o.tileID.overscaledZ,o.tileID.wrap,o.tileID.canonical.z,o.tileID.canonical.x,o.tileID.canonical.y),this.tileZoom=o.tileZoom,this.uid=o.uid,this.zoom=o.zoom,this.canonical=o.tileID.canonical,this.pixelRatio=o.pixelRatio,this.tileSize=o.tileSize,this.source=o.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=o.showCollisionBoxes,this.collectResourceTiming=!!o.collectResourceTiming,this.returnDependencies=!!o.returnDependencies,this.promoteId=o.promoteId,this.enableTerrain=!!o.enableTerrain,this.isSymbolTile=o.isSymbolTile,this.tileTransform=Ou(o.tileID.canonical,o.projection),this.projection=o.projection}parse(o,u,d,m,C){this.status="parsing",this.data=o,this.collisionBoxArray=new w5;const _=new mf(Object.keys(o.layers).sort()),w=new Cf(this.tileID,this.promoteId);w.bucketLayerIDs=[];const T={},D=new p4(256,256),P={featureIndex:w,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:D,availableImages:d},V=u.familiesBySource[this.source];for(const rt in V){const st=o.layers[rt];if(!st)continue;let Rt=!1,Vt=!1;for(const Ht of V[rt])"symbol"===Ht[0].type?Rt=!0:Vt=!0;if(!0===this.isSymbolTile&&!Rt||!1===this.isSymbolTile&&!Vt)continue;1===st.version&&Fr(`Vector tile source "${this.source}" layer "${rt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Cn=_.encode(rt),dn=[];for(let Ht=0;Ht=cn.maxzoom||"none"!==cn.visibility&&(a6(Ht,this.zoom,d),(T[cn.id]=cn.createBucket({index:w.bucketLayerIDs.length,layers:Ht,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Cn,sourceID:this.source,enableTerrain:this.enableTerrain,availableImages:d})).populate(dn,P,this.tileID.canonical,this.tileTransform),w.bucketLayerIDs.push(Ht.map(yn=>yn.id)))}}let O,U,X,ee;D.trim();const se={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},xe=So(P.glyphDependencies,rt=>Object.keys(rt).map(Number));Object.keys(xe).length?m.send("getGlyphs",{uid:this.uid,stacks:xe},(rt,st)=>{O||(O=rt,U=st,Ke.call(this))},void 0,!1,se):U={};const Ie=Object.keys(P.iconDependencies);Ie.length?m.send("getImages",{icons:Ie,source:this.source,tileID:this.tileID,type:"icons"},(rt,st)=>{O||(O=rt,X=st,Ke.call(this))},void 0,!1,se):X={};const $e=Object.keys(P.patternDependencies);function Ke(){if(O)return C(O);if(U&&X&&ee){const rt=new xf(U),st=new rm(X,ee);for(const Rt in T){const Vt=T[Rt];Vt instanceof Xa?(a6(Vt.layers,this.zoom,d),VM(Vt,U,rt.positions,X,st.iconPositions,this.showCollisionBoxes,d,this.tileID.canonical,this.tileZoom,this.projection),Vt.projection=this.projection.name):Vt.hasPattern&&(Vt instanceof Xh||Vt instanceof H5||Vt instanceof Ad)&&(a6(Vt.layers,this.zoom,d),Vt.addFeatures(P,this.tileID.canonical,st.patternPositions,d))}this.status="done",C(null,{buckets:Jo(T).filter(Rt=>!Rt.isEmpty()),featureIndex:w,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:rt.image,lineAtlas:D,imageAtlas:st,glyphMap:this.returnDependencies?U:null,iconMap:this.returnDependencies?X:null,glyphPositions:this.returnDependencies?rt.positions:null})}}$e.length?m.send("getImages",{icons:$e,source:this.source,tileID:this.tileID,type:"patterns"},(rt,st)=>{O||(O=rt,ee=st,Ke.call(this))},void 0,!1,se):ee={},Ke.call(this)}}function a6(a,o,u){const d=new ui(o);for(const m of a)m.recalculate(d,u)}class bf{constructor(o){this.entries={},this.scheduler=o}request(o,u,d,m){const C=this.entries[o]=this.entries[o]||{callbacks:[]};if(C.result){const[_,w]=C.result;return this.scheduler?this.scheduler.add(()=>{m(_,w)},u):m(_,w),()=>{}}return C.callbacks.push(m),C.cancel||(C.cancel=d((_,w)=>{C.result=[_,w];for(const T of C.callbacks)this.scheduler?this.scheduler.add(()=>{T(_,w)},u):T(_,w);setTimeout(()=>delete this.entries[o],3e3)})),()=>{C.result||(C.callbacks=C.callbacks.filter(_=>_!==m),C.callbacks.length||(C.cancel(),delete this.entries[o]))}}}function wf(a,o,u){const d=JSON.stringify(a.request);return a.data&&(this.deduped.entries[d]={result:[null,a.data]}),this.deduped.request(d,{type:"parseTile",isSymbolTile:a.isSymbolTile,zoom:a.tileZoom},m=>{const C=V1(a.request,(_,w,T,D)=>{_?m(_):w&&m(null,{vectorTile:u?void 0:new u4.VectorTile(new Kh(w)),rawData:w,cacheControl:T,expires:D})});return()=>{C.cancel(),m()}},o)}const pc=Pe(new Float64Array(16));class Al{constructor(o,u){this._tr=o,this._worldSize=u}createInversionMatrix(){return pc}createTileMatrix(o){let u,d,m;const C=o.canonical,_=Pe(new Float64Array(16)),w=this._tr.projection;if(w.isReprojectedInTileSpace){const T=Ou(C,w);u=1,d=T.x+o.wrap*T.scale,m=T.y,_t(_,_,[u/T.scale,u/T.scale,this._tr.pixelsPerMeter/this._worldSize])}else u=this._worldSize/this._tr.zoomScale(C.z),d=(C.x+Math.pow(2,C.z)*o.wrap)*u,m=C.y*u;return Je(_,_,[d,m,0]),_t(_,_,[u/Yi,u/Yi,1]),_}pointCoordinate(o,u,d){const m=this._tr.horizonLineFromTop(!1),C=new de(o,Math.max(m,u));return this._tr.rayIntersectionCoordinate(this._tr.pointRayIntersection(C,d))}upVector(){return[0,0,1]}upVectorScale(){return 1}}var dv={name:"albers",range:[4,7],center:[-96,37.5],parallels:[29.5,45.5],zAxisUnit:"meters",conic:!0,isReprojectedInTileSpace:!0,unsupportedLayers:["custom"],initializeConstants(){if(this.constants&&Cr(this.parallels,this.constants.parallels))return;const a=Math.sin(Pn(this.parallels[0])),o=(a+Math.sin(Pn(this.parallels[1])))/2,u=1+a*(2*o-a),d=Math.sqrt(u)/o;this.constants={n:o,c:u,r0:d,parallels:this.parallels}},project(a,o){this.initializeConstants();const u=Pn(a-this.center[0]),d=Pn(o),{n:m,c:C,r0:_}=this.constants,w=Math.sqrt(C-2*m*Math.sin(d))/m;return{x:w*Math.sin(u*m),y:w*Math.cos(u*m)-_,z:0}},unproject(a,o){this.initializeConstants();const{n:u,c:d,r0:m}=this.constants,C=m+o;let _=Math.atan2(a,Math.abs(C))*Math.sign(C);C*u<0&&(_-=Math.PI*Math.sign(a)*Math.sign(C));const w=Pn(this.center[0])*u;_=Mo(_,-Math.PI-w,Math.PI-w);const T=Wi(_/u)+this.center[0],D=Math.asin(qi((d-(a*a+C*C)*u*u)/(2*u),-1,1)),P=qi(Wi(D),-85.051129,R2);return new Pr(T,P)},projectTilePoint:(a,o)=>({x:a,y:o,z:0}),locationPoint:(a,o)=>a._coordinatePoint(a.locationCoordinate(o),!1),pixelsPerMeter:(a,o)=>N2(1,a)*o,farthestPixelDistance(a){return fc(a,this.pixelsPerMeter(a.center.lat,a.worldSize))},createTileTransform:(a,o)=>new Al(a,o)};const a0=1.340264,l6=-.081106,kl=893e-6,Nu=.003796,g3=Math.sqrt(3)/2;var l0={name:"equalEarth",center:[0,0],range:[3.5,7],zAxisUnit:"meters",isReprojectedInTileSpace:!0,unsupportedLayers:["custom"],project(a,o){o=o/180*Math.PI,a=a/180*Math.PI;const u=Math.asin(g3*Math.sin(o)),d=u*u,m=d*d*d;return{x:.5*(a*Math.cos(u)/(g3*(a0+3*l6*d+m*(7*kl+9*Nu*d)))/Math.PI+.5),y:1-.5*(u*(a0+l6*d+m*(kl+Nu*d))/Math.PI+1),z:0}},unproject(a,o){a=(2*a-.5)*Math.PI;let u=o=(2*(1-o)-1)*Math.PI,d=u*u,m=d*d*d;for(let D,P,V,O=0;O<12&&(P=u*(a0+l6*d+m*(kl+Nu*d))-o,V=a0+3*l6*d+m*(7*kl+9*Nu*d),D=P/V,u=qi(u-D,-Math.PI/3,Math.PI/3),d=u*u,m=d*d*d,!(Math.abs(D)<1e-12));++O);const C=g3*a*(a0+3*l6*d+m*(7*kl+9*Nu*d))/Math.cos(u),_=Math.asin(Math.sin(u)/g3),w=qi(180*C/Math.PI,-180,180),T=qi(180*_/Math.PI,-85.051129,R2);return new Pr(w,T)},projectTilePoint:(a,o)=>({x:a,y:o,z:0}),locationPoint:(a,o)=>a._coordinatePoint(a.locationCoordinate(o),!1),pixelsPerMeter:(a,o)=>N2(1,a)*o,farthestPixelDistance(a){return fc(a,this.pixelsPerMeter(a.center.lat,a.worldSize))},createTileTransform:(a,o)=>new Al(a,o)},fv={name:"equirectangular",supportsWorldCopies:!0,center:[0,0],range:[3.5,7],zAxisUnit:"meters",wrap:!0,isReprojectedInTileSpace:!0,unsupportedLayers:["custom"],project:(a,o)=>({x:.5+a/360,y:.5-o/360,z:0}),unproject(a,o){const u=360*(a-.5),d=qi(360*(.5-o),-85.051129,R2);return new Pr(u,d)},projectTilePoint:(a,o)=>({x:a,y:o,z:0}),locationPoint:(a,o)=>a._coordinatePoint(a.locationCoordinate(o),!1),pixelsPerMeter:(a,o)=>N2(1,a)*o,farthestPixelDistance(a){return fc(a,this.pixelsPerMeter(a.center.lat,a.worldSize))},createTileTransform:(a,o)=>new Al(a,o)};const C3=Math.PI/2;function c0(a){return Math.tan((C3+a)/2)}var pv={name:"lambertConformalConic",range:[3.5,7],zAxisUnit:"meters",center:[0,30],parallels:[30,30],conic:!0,isReprojectedInTileSpace:!0,unsupportedLayers:["custom"],initializeConstants(){if(this.constants&&Cr(this.parallels,this.constants.parallels))return;const a=Pn(this.parallels[0]),o=Pn(this.parallels[1]),u=Math.cos(a),d=a===o?Math.sin(a):Math.log(u/Math.cos(o))/Math.log(c0(o)/c0(a)),m=u*Math.pow(c0(a),d)/d;this.constants={n:d,f:m,parallels:this.parallels}},project(a,o){this.initializeConstants(),o=Pn(o),a=Pn(a-this.center[0]);const u=1e-6,{n:d,f:m}=this.constants;m>0?o<-C3+u&&(o=-C3+u):o>C3-u&&(o=C3-u);const C=m/Math.pow(c0(o),d),_=C*Math.sin(d*a),w=m-C*Math.cos(d*a);return{x:.5*(_/Math.PI+.5),y:1-.5*(w/Math.PI+.5),z:0}},unproject(a,o){this.initializeConstants(),a=(2*a-.5)*Math.PI,o=(2*(1-o)-.5)*Math.PI;const{n:u,f:d}=this.constants,m=d-o,C=Math.sign(m),_=Math.sign(u)*Math.sqrt(a*a+m*m);let w=Math.atan2(a,Math.abs(m))*C;m*u<0&&(w-=Math.PI*Math.sign(a)*C);const T=qi(Wi(w/u)+this.center[0],-180,180),D=qi(Wi(2*Math.atan(Math.pow(d/_,1/u))-C3),-85.051129,R2);return new Pr(T,D)},projectTilePoint:(a,o)=>({x:a,y:o,z:0}),locationPoint:(a,o)=>a._coordinatePoint(a.locationCoordinate(o),!1),pixelsPerMeter:(a,o)=>N2(1,a)*o,farthestPixelDistance(a){return fc(a,this.pixelsPerMeter(a.center.lat,a.worldSize))},createTileTransform:(a,o)=>new Al(a,o)},Hm={name:"mercator",wrap:!0,requiresDraping:!1,supportsWorldCopies:!0,supportsTerrain:!0,supportsFog:!0,supportsFreeCamera:!0,zAxisUnit:"meters",center:[0,0],project:(a,o)=>({x:O2(a),y:bu(o),z:0}),unproject(a,o){const u=i3(a),d=qa(o);return new Pr(u,d)},projectTilePoint:(a,o)=>({x:a,y:o,z:0}),locationPoint:(a,o)=>a._coordinatePoint(a.locationCoordinate(o),!1),pixelsPerMeter:(a,o)=>N2(1,a)*o,farthestPixelDistance(a){return fc(a,this.pixelsPerMeter(a.center.lat,a.worldSize))},createTileTransform:(a,o)=>new Al(a,o)};const Bm=Pn(R2);var Mf={name:"naturalEarth",center:[0,0],range:[3.5,7],isReprojectedInTileSpace:!0,zAxisUnit:"meters",unsupportedLayers:["custom"],project(a,o){const u=(o=Pn(o))*o,d=u*u;return{x:.5*((a=Pn(a))*(.8707-.131979*u+d*(d*(.003971*u-.001529*d)-.013791))/Math.PI+.5),y:1-.5*(o*(1.007226+u*(.015085+d*(.028874*u-.044475-.005916*d)))/Math.PI+1),z:0}},unproject(a,o){a=(2*a-.5)*Math.PI;let u=o=(2*(1-o)-1)*Math.PI,d=25,m=0,C=u*u;do{C=u*u;const T=C*C;m=(u*(1.007226+C*(.015085+T*(.028874*C-.044475-.005916*T)))-o)/(1.007226+C*(.045255+T*(.259866*C-.311325-.005916*11*T))),u=qi(u-m,-Bm,Bm)}while(Math.abs(m)>1e-6&&--d>0);C=u*u;const _=qi(Wi(a/(.8707+C*(C*(C*C*C*(.003971-.001529*C)-.013791)-.131979))),-180,180),w=Wi(u);return new Pr(_,w)},projectTilePoint:(a,o)=>({x:a,y:o,z:0}),locationPoint:(a,o)=>a._coordinatePoint(a.locationCoordinate(o),!1),pixelsPerMeter:(a,o)=>N2(1,a)*o,farthestPixelDistance(a){return fc(a,this.pixelsPerMeter(a.center.lat,a.worldSize))},createTileTransform:(a,o)=>new Al(a,o)};const Um=Pn(R2),$m={albers:dv,equalEarth:l0,equirectangular:fv,lambertConformalConic:pv,mercator:Hm,naturalEarth:Mf,winkelTripel:{name:"winkelTripel",center:[0,0],range:[3.5,7],zAxisUnit:"meters",isReprojectedInTileSpace:!0,unsupportedLayers:["custom"],project(a,o){o=Pn(o),a=Pn(a);const u=Math.cos(o),d=2/Math.PI,m=Math.acos(u*Math.cos(a/2)),C=Math.sin(m)/m,_=.5*(a*d+2*u*Math.sin(a/2)/C)||0,w=.5*(o+Math.sin(o)/C)||0;return{x:.5*(_/Math.PI+.5),y:1-.5*(w/Math.PI+1),z:0}},unproject(a,o){let u=a=(2*a-.5)*Math.PI,d=o=(2*(1-o)-1)*Math.PI,m=25;const C=1e-6;let _=0,w=0;do{const T=Math.cos(d),D=Math.sin(d),P=2*D*T,V=D*D,O=T*T,U=Math.cos(u/2),X=Math.sin(u/2),ee=2*U*X,se=X*X,xe=1-O*U*U,Ie=xe?1/xe:0,$e=xe?Math.acos(T*U)*Math.sqrt(1/xe):0,Ke=.5*(2*$e*T*X+2*u/Math.PI)-a,rt=.5*($e*D+d)-o,st=.5*Ie*(O*se+$e*T*U*V)+1/Math.PI,Rt=Ie*(ee*P/4-$e*D*X),Vt=.125*Ie*(P*X-$e*D*O*ee),Cn=.5*Ie*(V*U+$e*se*T)+.5,dn=Rt*Vt-Cn*st;_=(rt*Rt-Ke*Cn)/dn,w=(Ke*Vt-rt*st)/dn,u=qi(u-_,-Math.PI,Math.PI),d=qi(d-w,-Um,Um)}while((Math.abs(_)>C||Math.abs(w)>C)&&--m>0);return new Pr(Wi(u),Wi(d))},projectTilePoint:(a,o)=>({x:a,y:o,z:0}),locationPoint:(a,o)=>a._coordinatePoint(a.locationCoordinate(o),!1),pixelsPerMeter:(a,o)=>N2(1,a)*o,farthestPixelDistance(a){return fc(a,this.pixelsPerMeter(a.center.lat,a.worldSize))},createTileTransform:(a,o)=>new Al(a,o)}};p.ARRAY_TYPE=ze,p.AUTH_ERR_MSG=dt,p.Aabb=o2,p.Actor=class{constructor(a,o,u){this.target=a,this.parent=o,this.mapId=u,this.callbacks={},this.cancelCallbacks={},ea(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=To()?a:pe,this.scheduler=new r0}send(a,o,u,d,m=!1,C){const _=Math.round(1e18*Math.random()).toString(36).substring(0,10);u&&(u.metadata=C,this.callbacks[_]=u);const w=oi(this.globalScope)?void 0:[];return this.target.postMessage({id:_,type:a,hasCallback:!!u,targetMapId:d,mustQueue:m,sourceMapId:this.mapId,data:J3(o,w)},w),{cancel:()=>{u&&delete this.callbacks[_],this.target.postMessage({id:_,type:"",targetMapId:d,sourceMapId:this.mapId})}}}receive(a){const o=a.data,u=o.id;if(u&&(!o.targetMapId||this.mapId===o.targetMapId))if(""===o.type){const d=this.cancelCallbacks[u];delete this.cancelCallbacks[u],d&&d.cancel()}else if(o.mustQueue||To()){const d=this.callbacks[u];this.cancelCallbacks[u]=this.scheduler.add(()=>this.processTask(u,o),d&&d.metadata||{type:"message"})}else this.processTask(u,o)}processTask(a,o){if(""===o.type){const u=this.callbacks[a];delete this.callbacks[a],u&&(o.error?u(ca(o.error)):u(null,ca(o.data)))}else{const u=oi(this.globalScope)?void 0:[],d=o.hasCallback?(C,_)=>{delete this.cancelCallbacks[a],this.target.postMessage({id:a,type:"",sourceMapId:this.mapId,error:C?J3(C):null,data:J3(_,u)},u)}:C=>{},m=ca(o.data);if(this.parent[o.type])this.parent[o.type](o.sourceMapId,m,d);else if(this.parent.getWorkerSource){const C=o.type.split(".");this.parent.getWorkerSource(o.sourceMapId,C[0],m.source)[C[1]](m,d)}else d(new Error(`Could not find function ${o.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},p.CanonicalTileID=Kd,p.Color=nr,p.ColorMode=El,p.CullFaceMode=h2,p.DEMData=t6,p.DataConstantProperty=Xt,p.DedupedRequest=bf,p.DepthMode=p3,p.EXTENT=Yi,p.Elevation=class{getAtPointOrZero(a,o=0){return this.getAtPoint(a,o)||0}getAtPoint(a,o,u=!0){null==o&&(o=null);const d=this._source();if(!d||a.y<0||a.y>1)return o;const m=d.getSource().maxzoom,C=1<{const d=this.getAtTileOffset(a,u.x,u.y),m=o.upVector(a.canonical,u.x,u.y);return lt(m,m,d*o.upVectorScale(a.canonical)),m}}getForTilePoints(a,o,u,d){const m=n6.create(this,a,d);return!!m&&(o.forEach(C=>{C[2]=this.exaggeration()*m.getElevationAt(C[0],C[1],u)}),!0)}getMinMaxForTile(a){const o=this.findDEMTileFor(a);if(!o||!o.dem)return null;const u=o.dem.tree,d=o.tileID,m=1<this._skuTokenExpiresAt}transformRequest(a,o){return this._transformRequestFn&&this._transformRequestFn(a,o)||{url:a}}normalizeStyleURL(a,o){if(!Nt(a))return a;const u=bn(a);return u.path=`/styles/v1${u.path}`,this._makeAPIURL(u,this._customAccessToken||o)}normalizeGlyphsURL(a,o){if(!Nt(a))return a;const u=bn(a);return u.path=`/fonts/v1${u.path}`,this._makeAPIURL(u,this._customAccessToken||o)}normalizeSourceURL(a,o){if(!Nt(a))return a;const u=bn(a);return u.path=`/v4/${u.authority}.json`,u.params.push("secure"),this._makeAPIURL(u,this._customAccessToken||o)}normalizeSpriteURL(a,o,u,d){const m=bn(a);return Nt(a)?(m.path=`/styles/v1${m.path}/sprite${o}${u}`,this._makeAPIURL(m,this._customAccessToken||d)):(m.path+=`${o}${u}`,Zn(m))}normalizeTileURL(a,o,u){if(this._isSkuTokenExpired()&&this._createSkuToken(),a&&!Nt(a))return a;const d=bn(a);d.path=d.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${o||u&&"raster"!==d.authority&&512===u?"@2x":""}${Y.supported?".webp":"$1"}`),"raster"===d.authority?d.path=`/${R.RASTER_URL_PREFIX}${d.path}`:(d.path=d.path.replace(/^.+\/v4\//,"/"),d.path=`/${R.TILE_URL_VERSION}${d.path}`);const m=this._customAccessToken||function(C){for(const _ of C){const w=_.match(/^access_token=(.*)$/);if(w)return w[1]}return null}(d.params)||R.ACCESS_TOKEN;return R.REQUIRE_ACCESS_TOKEN&&m&&this._skuToken&&d.params.push(`sku=${this._skuToken}`),this._makeAPIURL(d,m)}canonicalizeTileURL(a,o){const u=bn(a);if(!u.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!u.path.match(/\.[\w]+$/))return a;let d="mapbox://";u.path.match(/^\/raster\/v1\//)?d+=`raster/${u.path.replace(`/${R.RASTER_URL_PREFIX}/`,"")}`:d+=`tiles/${u.path.replace(`/${R.TILE_URL_VERSION}/`,"")}`;let m=u.params;return o&&(m=m.filter(C=>!C.match(/^access_token=/))),m.length&&(d+=`?${m.join("&")}`),d}canonicalizeTileset(a,o){const u=!!o&&Nt(o),d=[];for(const m of a.tiles||[])jt(m)?d.push(this.canonicalizeTileURL(m,u)):d.push(m);return d}_makeAPIURL(a,o){const u="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",d=bn(R.API_URL);if(a.protocol=d.protocol,a.authority=d.authority,"http"===a.protocol){const m=a.params.indexOf("secure");m>=0&&a.params.splice(m,1)}if("/"!==d.path&&(a.path=`${d.path}${a.path}`),!R.REQUIRE_ACCESS_TOKEN)return Zn(a);if(o=o||R.ACCESS_TOKEN,!this._silenceAuthErrors){if(!o)throw new Error(`An API access token is required to use Mapbox GL. ${u}`);if("s"===o[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${u}`)}return a.params=a.params.filter(m=>-1===m.indexOf("access_token")),a.params.push(`access_token=${o||""}`),Zn(a)}},p.ResourceType=al,p.SegmentVector=Vs,p.SourceCache=m3,p.StencilMode=Vu,p.StructArrayLayout1ui2=ac,p.StructArrayLayout2f1f2i16=oc,p.StructArrayLayout2i4=_l,p.StructArrayLayout2ui4=bl,p.StructArrayLayout3f12=sc,p.StructArrayLayout3ui6=f1,p.StructArrayLayout4i8=Oh,p.Texture=Yd,p.Tile=i6,p.Transitionable=Xs,p.Uniform1f=L5,p.Uniform1i=class extends wl{constructor(a,o){super(a,o),this.current=0}set(a){this.current!==a&&(this.current=a,this.gl.uniform1i(this.location,a))}},p.Uniform2f=class extends wl{constructor(a,o){super(a,o),this.current=[0,0]}set(a){a[0]===this.current[0]&&a[1]===this.current[1]||(this.current=a,this.gl.uniform2f(this.location,a[0],a[1]))}},p.Uniform3f=class extends wl{constructor(a,o){super(a,o),this.current=[0,0,0]}set(a){a[0]===this.current[0]&&a[1]===this.current[1]&&a[2]===this.current[2]||(this.current=a,this.gl.uniform3f(this.location,a[0],a[1],a[2]))}},p.Uniform4f=e3,p.UniformColor=xu,p.UniformMatrix2f=class extends wl{constructor(a,o){super(a,o),this.current=Sp}set(a){for(let o=0;o<4;o++)if(a[o]!==this.current[o]){this.current=a,this.gl.uniformMatrix2fv(this.location,!1,a);break}}},p.UniformMatrix3f=class extends wl{constructor(a,o){super(a,o),this.current=Mp}set(a){for(let o=0;o<9;o++)if(a[o]!==this.current[o]){this.current=a,this.gl.uniformMatrix3fv(this.location,!1,a);break}}},p.UniformMatrix4f=class extends wl{constructor(a,o){super(a,o),this.current=_C}set(a){if(a[12]!==this.current[12]||a[0]!==this.current[0])return this.current=a,void this.gl.uniformMatrix4fv(this.location,!1,a);for(let o=1;o<16;o++)if(a[o]!==this.current[o]){this.current=a,this.gl.uniformMatrix4fv(this.location,!1,a);break}}},p.UnwrappedTileID=Qd,p.ValidationError=Ft,p.VectorTileWorkerSource=class extends Bn{constructor(a,o,u,d,m){super(),this.actor=a,this.layerIndex=o,this.availableImages=u,this.loadVectorData=m||wf,this.loading={},this.loaded={},this.deduped=new bf(a.scheduler),this.isSpriteLoaded=d,this.scheduler=a.scheduler}loadTile(a,o){const u=a.uid,d=a&&a.request,m=d&&d.collectResourceTiming,C=this.loading[u]=new Rm(a);C.abort=this.loadVectorData(a,(_,w)=>{const T=!this.loading[u];if(delete this.loading[u],T||_||!w)return C.status="done",T||(this.loaded[u]=C),o(_);const D=w.rawData,P={};w.expires&&(P.expires=w.expires),w.cacheControl&&(P.cacheControl=w.cacheControl),C.vectorTile=w.vectorTile||new u4.VectorTile(new Kh(D));const V=()=>{C.parse(C.vectorTile,this.layerIndex,this.availableImages,this.actor,(O,U)=>{if(O||!U)return o(O);const X={};if(m){const ee=m4(d);ee.length>0&&(X.resourceTiming=JSON.parse(JSON.stringify(ee)))}o(null,Li({rawTileData:D.slice(0)},U,P,X))})};this.isSpriteLoaded?V():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(V,{type:"parseTile",isSymbolTile:a.isSymbolTile,zoom:a.tileZoom}):V()}),this.loaded=this.loaded||{},this.loaded[u]=C})}reloadTile(a,o){const u=this.loaded,d=a.uid,m=this;if(u&&u[d]){const C=u[d];C.showCollisionBoxes=a.showCollisionBoxes,C.enableTerrain=!!a.enableTerrain,C.projection=a.projection;const _=(w,T)=>{const D=C.reloadCallback;D&&(delete C.reloadCallback,C.parse(C.vectorTile,m.layerIndex,this.availableImages,m.actor,D)),o(w,T)};"parsing"===C.status?C.reloadCallback=_:"done"===C.status&&(C.vectorTile?C.parse(C.vectorTile,this.layerIndex,this.availableImages,this.actor,_):_())}}abortTile(a,o){const u=a.uid,d=this.loading[u];d&&(d.abort&&d.abort(),delete this.loading[u]),o()}removeTile(a,o){const u=this.loaded,d=a.uid;u&&u[d]&&delete u[d],o()}},p.WritingMode=p1,p.ZoomHistory=v,p.add=nt,p.addDynamicAttributes=vm,p.adjoint=function(a,o){var u=o[0],d=o[1],m=o[2],C=o[3],_=o[4],w=o[5],T=o[6],D=o[7],P=o[8];return a[0]=_*P-w*D,a[1]=m*D-d*P,a[2]=d*w-m*_,a[3]=w*T-C*P,a[4]=u*P-m*T,a[5]=m*C-u*w,a[6]=C*D-_*T,a[7]=d*T-u*D,a[8]=u*_-d*C,a},p.asyncAll=Os,p.bezier=Pa,p.bindAll=ea,p.boundsAttributes=vf,p.bufferConvexPolygon=function(a,o){const u=[];for(let d=0;dXl&&(a.getActor().send("enforceCacheSizeLimit",vr),Jt=0)},p.calculateGlobeMatrix=o6,p.calculateGlobeMercatorMatrix=function(a){const o=a.worldSize,u=qi(a.center.lat,-85.051129,R2),d=new de(O2(a.center.lng)*o,bu(u)*o),m=N2(1,a.center.lat)*o,C=a.pixelsPerMeter,_=o/(m/a.pixelsPerMeter),w=Pe(new Float64Array(16));return Je(w,w,[d.x,d.y,0]),_t(w,w,[_,_,C]),w},p.clamp=qi,p.clearTileCache=function(a){const o=pe.caches.delete(Zr);a&&o.catch(a).then(()=>a())},p.clipLine=u2,p.clone=function(a){var o=new ze(16);return o[0]=a[0],o[1]=a[1],o[2]=a[2],o[3]=a[3],o[4]=a[4],o[5]=a[5],o[6]=a[6],o[7]=a[7],o[8]=a[8],o[9]=a[9],o[10]=a[10],o[11]=a[11],o[12]=a[12],o[13]=a[13],o[14]=a[14],o[15]=a[15],o},p.clone$1=qr,p.collisionCircleLayout=Kp,p.config=R,p.conjugate=function(a,o){return a[0]=-o[0],a[1]=-o[1],a[2]=-o[2],a[3]=o[3],a},p.create=function(){var a=new ze(16);return ze!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[11]=0,a[12]=0,a[13]=0,a[14]=0),a[0]=1,a[5]=1,a[10]=1,a[15]=1,a},p.create$1=Le,p.createExpression=vi,p.createLayout=ps,p.createStyleLayer=function(a){return"custom"===a.type?new nv(a):new iv[a.type](a)},p.cross=Rn,p.degToRad=Pn,p.div=function(a,o,u){return a[0]=o[0]/u[0],a[1]=o[1]/u[1],a[2]=o[2]/u[2],a},p.dot=Qt,p.ease=Mn,p.easeCubicInOut=Qo,p.emitValidationErrors=gl,p.endsWith=ga,p.enforceCacheSizeLimit=function(a){n1(),va&&va.then(o=>{o.keys().then(u=>{for(let d=0;dC&&(d+=(a[m]-C)*(a[m]-C)),o[m]{}}},p.globeBuffersForTileMesh=function(a,o,u,d){const m=a.context,C=a.transform;let _=o.globeGridBuffer,w=o.globePoleBuffer;if(!_){const T=Nm.createGridVertices(u.canonical);_=o.globeGridBuffer=m.createVertexBuffer(T,Vm,!1)}if(!w){const T=Nm.createPoleTriangleVertices(d,C.tileSize*d,0===u.canonical.y);w=o.globePoleBuffer=m.createVertexBuffer(T,Vm,!1)}return[_,w]},p.globeDenormalizeECEF=Om,p.globeMatrixForTile=function(a,o){const u=Om(r6(a)),d=((m=new Float64Array(16))[0]=(C=o)[0],m[1]=C[1],m[2]=C[2],m[3]=C[3],m[4]=C[4],m[5]=C[5],m[6]=C[6],m[7]=C[7],m[8]=C[8],m[9]=C[9],m[10]=C[10],m[11]=C[11],m[12]=C[12],m[13]=C[13],m[14]=C[14],m[15]=C[15],m);var m,C;return ge(d,d,u),d},p.globePoleMatrixForTile=function(a,o,u){const d=Pe(new Float64Array(16)),m=Math.pow(2,a.z),C=(a.x-m/2)/m*Math.PI*2,_=u.point,w=u.worldSize/(u.tileSize*m);return Je(d,d,[_.x,_.y,-u.worldSize/Math.PI/2]),_t(d,d,[w,w,w]),qe(d,d,Pn(-u._center.lat)),It(d,d,Pn(-u._center.lng)),It(d,d,C),o&&_t(d,d,[1,-1,1]),d},p.globeTileBounds=r6,p.globeToMercatorTransition=function(a){return Is(5,6,a)},p.identity=Pe,p.identity$1=Hn,p.invert=function(a,o){var u=o[0],d=o[1],m=o[2],C=o[3],_=o[4],w=o[5],T=o[6],D=o[7],P=o[8],V=o[9],O=o[10],U=o[11],X=o[12],ee=o[13],se=o[14],xe=o[15],Ie=u*w-d*_,$e=u*T-m*_,Ke=u*D-C*_,rt=d*T-m*w,st=d*D-C*w,Rt=m*D-C*T,Vt=P*ee-V*X,Cn=P*se-O*X,dn=P*xe-U*X,Ht=V*se-O*ee,cn=V*xe-U*ee,yn=O*xe-U*se,Kt=Ie*yn-$e*cn+Ke*Ht+rt*dn-st*Cn+Rt*Vt;return Kt?(a[0]=(w*yn-T*cn+D*Ht)*(Kt=1/Kt),a[1]=(m*cn-d*yn-C*Ht)*Kt,a[2]=(ee*Rt-se*st+xe*rt)*Kt,a[3]=(O*st-V*Rt-U*rt)*Kt,a[4]=(T*dn-_*yn-D*Cn)*Kt,a[5]=(u*yn-m*dn+C*Cn)*Kt,a[6]=(se*Ke-X*Rt-xe*$e)*Kt,a[7]=(P*Rt-O*Ke+U*$e)*Kt,a[8]=(_*cn-w*dn+D*Vt)*Kt,a[9]=(d*dn-u*cn-C*Vt)*Kt,a[10]=(X*st-ee*Ke+xe*Ie)*Kt,a[11]=(V*Ke-P*st-U*Ie)*Kt,a[12]=(w*Cn-_*Ht-T*Vt)*Kt,a[13]=(u*Ht-d*Cn+m*Vt)*Kt,a[14]=(ee*$e-X*rt-se*Ie)*Kt,a[15]=(P*rt-V*$e+O*Ie)*Kt,a):null},p.isMapAuthenticated=function(a){return Fa.has(a)},p.isMapboxURL=Nt,p.latFromMercatorY=qa,p.len=Lt,p.length=q,p.length$1=function(a){return Math.hypot(a[0],a[1],a[2],a[3])},p.loadVectorTile=wf,p.makeRequest=Ro,p.mercatorXfromLng=O2,p.mercatorYfromLat=bu,p.mercatorZfromAltitude=N2,p.mul=ge,p.mul$1=mt,p.multiply=function(a,o,u){var d=o[0],m=o[1],C=o[2],_=o[3],w=o[4],T=o[5],D=o[6],P=o[7],V=o[8],O=u[0],U=u[1],X=u[2],ee=u[3],se=u[4],xe=u[5],Ie=u[6],$e=u[7],Ke=u[8];return a[0]=O*d+U*_+X*D,a[1]=O*m+U*w+X*P,a[2]=O*C+U*T+X*V,a[3]=ee*d+se*_+xe*D,a[4]=ee*m+se*w+xe*P,a[5]=ee*C+se*T+xe*V,a[6]=Ie*d+$e*_+Ke*D,a[7]=Ie*m+$e*w+Ke*P,a[8]=Ie*C+$e*T+Ke*V,a},p.multiply$1=at,p.multiply$2=Ye,p.nextPowerOfTwo=hs,p.normalize=Dt,p.normalize$1=function(a,o){var u=o[0],d=o[1],m=o[2],C=o[3],_=u*u+d*d+m*m+C*C;return _>0&&(_=1/Math.sqrt(_)),a[0]=u*_,a[1]=d*_,a[2]=m*_,a[3]=C*_,a},p.number=Fi,p.ortho=function(a,o,u,d,m,C,_){var w=1/(o-u),T=1/(d-m),D=1/(C-_);return a[0]=-2*w,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*T,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*D,a[11]=0,a[12]=(o+u)*w,a[13]=(m+d)*T,a[14]=(_+C)*D,a[15]=1,a},p.pbf=Kh,p.perspective=function(a,o,u,d,m){var C,_=1/Math.tan(o/2);return a[0]=_/u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=_,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[11]=-1,a[12]=0,a[13]=0,a[15]=0,null!=m&&m!==1/0?(a[10]=(m+d)*(C=1/(d-m)),a[14]=2*m*d*C):(a[10]=-1,a[14]=-2*d),a},p.pick=function(a,o){const u={};for(let d=0;dthis._layers[jt.id]),tt=Ue[0];if("none"===tt.visibility)continue;const Re=tt.source||"";let He=this.familiesBySource[Re];He||(He=this.familiesBySource[Re]={});const dt=tt.sourceLayer||"_geojsonTileLayer";let Nt=He[dt];Nt||(Nt=He[dt]=[]),Nt.push(Ue)}}}const{ImageBitmap:de}=p.window;class re{loadTile(R,Y){const{uid:me,encoding:_e,rawImageData:Ue,padding:tt,buildQuadTree:Re}=R,He=de&&Ue instanceof de?this.getImageData(Ue,tt):Ue;Y(null,new p.DEMData(me,He,_e,tt<1,Re))}getImageData(R,Y){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(R.width,R.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=R.width,this.offscreenCanvas.height=R.height,this.offscreenCanvasContext.drawImage(R,0,0,R.width,R.height);const me=this.offscreenCanvasContext.getImageData(-Y,-Y,R.width+2*Y,R.height+2*Y);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new p.RGBAImage({width:me.width,height:me.height},me.data)}}var pe=function oe(R,Y){var me,_e=R&&R.type;if("FeatureCollection"===_e)for(me=0;me=Math.abs(Re)?Y-He+Re:Re-He+Y,Y=He}Y+me>=0!=!!R&&oe.reverse()}const Le=p.vectorTile.VectorTileFeature.prototype.toGeoJSON;class Pe{constructor(R){this._feature=R,this.extent=p.EXTENT,this.type=R.type,this.properties=R.tags,"id"in R&&!isNaN(R.id)&&(this.id=parseInt(R.id,10))}loadGeometry(){if(1===this._feature.type){const R=[];for(const Y of this._feature.geometry)R.push([new p.pointGeometry(Y[0],Y[1])]);return R}{const R=[];for(const Y of this._feature.geometry){const me=[];for(const _e of Y)me.push(new p.pointGeometry(_e[0],_e[1]));R.push(me)}return R}}toGeoJSON(R,Y,me){return Le.call(this,R,Y,me)}}class at{constructor(R){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=p.EXTENT,this.length=R.length,this._features=R}feature(R){return new Pe(this._features[R])}}var Je=p.vectorTile.VectorTileFeature,_t=qe;function qe(oe,R){this.options=R||{},this.features=oe,this.length=oe.length}function It(oe,R){this.id="number"==typeof oe.id?oe.id:void 0,this.type=oe.type,this.rawGeometry=1===oe.type?[oe.geometry]:oe.geometry,this.properties=oe.tags,this.extent=R||4096}qe.prototype.feature=function(oe){return new It(this.features[oe],this.options.extent)},It.prototype.loadGeometry=function(){var oe=this.rawGeometry;this.geometry=[];for(var R=0;R>31}function ut(oe,R){for(var Y=oe.loadGeometry(),me=oe.type,_e=0,Ue=0,tt=Y.length,Re=0;Re>1;Dt(oe,R,tt,me,_e,Ue%2),Ct(oe,R,Y,me,tt-1,Ue+1),Ct(oe,R,Y,tt+1,_e,Ue+1)}function Dt(oe,R,Y,me,_e,Ue){for(;_e>me;){if(_e-me>600){const dt=_e-me+1,Nt=Y-me+1,jt=Math.log(dt),Zt=.5*Math.exp(2*jt/3),bn=.5*Math.sqrt(jt*Zt*(dt-Zt)/dt)*(Nt-dt/2<0?-1:1);Dt(oe,R,Y,Math.max(me,Math.floor(Y-Nt*Zt/dt+bn)),Math.min(_e,Math.floor(Y+(dt-Nt)*Zt/dt+bn)),Ue)}const tt=R[2*Y+Ue];let Re=me,He=_e;for(Qt(oe,R,me,Y),R[2*_e+Ue]>tt&&Qt(oe,R,me,_e);Rett;)He--}R[2*me+Ue]===tt?Qt(oe,R,me,He):(He++,Qt(oe,R,He,_e)),He<=Y&&(me=He+1),Y<=He&&(_e=He-1)}}function Qt(oe,R,Y,me){Rn(oe,Y,me),Rn(R,2*Y,2*me),Rn(R,2*Y+1,2*me+1)}function Rn(oe,R,Y){const me=oe[R];oe[R]=oe[Y],oe[Y]=me}function Wt(oe,R,Y,me){const _e=oe-Y,Ue=R-me;return _e*_e+Ue*Ue}ge.fromVectorTileJs=Ge,ge.fromGeojsonVt=function(oe,R){R=R||{};var Y={};for(var me in oe)Y[me]=new _t(oe[me].features,R),Y[me].name=me,Y[me].version=R.version,Y[me].extent=R.extent;return Ge({layers:Y})},ge.GeoJSONWrapper=ce;const Et=oe=>oe[0],zt=oe=>oe[1];class Ot{constructor(R,Y=Et,me=zt,_e=64,Ue=Float64Array){this.nodeSize=_e,this.points=R;const tt=R.length<65536?Uint16Array:Uint32Array,Re=this.ids=new tt(R.length),He=this.coords=new Ue(2*R.length);for(let dt=0;dt=Re&&Zn<=dt&&Un>=He&&Un<=Nt&&bn.push(Ue[kr]);continue}const hr=Math.floor((Mr+pi)/2);Zn=tt[2*hr],Un=tt[2*hr+1],Zn>=Re&&Zn<=dt&&Un>=He&&Un<=Nt&&bn.push(Ue[hr]);const Ui=(si+1)%2;(0===si?Re<=Zn:He<=Un)&&(Zt.push(Mr),Zt.push(hr-1),Zt.push(Ui)),(0===si?dt>=Zn:Nt>=Un)&&(Zt.push(hr+1),Zt.push(pi),Zt.push(Ui))}return bn}(this.ids,this.coords,R,Y,me,_e,this.nodeSize)}within(R,Y,me){return function(_e,Ue,tt,Re,He,dt){const Nt=[0,_e.length-1,0],jt=[],Zt=He*He;for(;Nt.length;){const bn=Nt.pop(),Zn=Nt.pop(),Un=Nt.pop();if(Zn-Un<=dt){for(let Ui=Un;Ui<=Zn;Ui++)Wt(Ue[2*Ui],Ue[2*Ui+1],tt,Re)<=Zt&&jt.push(_e[Ui]);continue}const si=Math.floor((Un+Zn)/2),pi=Ue[2*si],Mr=Ue[2*si+1];Wt(pi,Mr,tt,Re)<=Zt&&jt.push(_e[si]);const hr=(bn+1)%2;(0===bn?tt-He<=pi:Re-He<=Mr)&&(Nt.push(Un),Nt.push(si-1),Nt.push(hr)),(0===bn?tt+He>=pi:Re+He>=Mr)&&(Nt.push(si+1),Nt.push(Zn),Nt.push(hr))}return jt}(this.ids,this.coords,R,Y,me,this.nodeSize)}}const mt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:oe=>oe},Lt=Math.fround||(tn=new Float32Array(1),oe=>(tn[0]=+oe,tn[0]));var tn;class mn{constructor(R){this.options=$s(Object.create(mt),R),this.trees=new Array(this.options.maxZoom+1)}load(R){const{log:Y,minZoom:me,maxZoom:_e,nodeSize:Ue}=this.options;Y&&console.time("total time");const tt=`prepare ${R.length} points`;Y&&console.time(tt),this.points=R;let Re=[];for(let He=0;He=me;He--){const dt=+Date.now();Re=this._cluster(Re,He),this.trees[He]=new Ot(Re,Qo,Pa,Ue,Float32Array),Y&&console.log("z%d: %d clusters in %dms",He,Re.length,+Date.now()-dt)}return Y&&console.timeEnd("total time"),this}getClusters(R,Y){let me=((R[0]+180)%360+360)%360-180;const _e=Math.max(-90,Math.min(90,R[1]));let Ue=180===R[2]?180:((R[2]+180)%360+360)%360-180;const tt=Math.max(-90,Math.min(90,R[3]));if(R[2]-R[0]>=360)me=-180,Ue=180;else if(me>Ue){const Nt=this.getClusters([me,_e,180,tt],Y),jt=this.getClusters([-180,_e,Ue,tt],Y);return Nt.concat(jt)}const Re=this.trees[this._limitZoom(Y)],He=Re.range(lr(me),Pn(tt),lr(Ue),Pn(_e)),dt=[];for(const Nt of He){const jt=Re.points[Nt];dt.push(jt.numPoints?Cr(jt):this.points[jt.index])}return dt}getChildren(R){const Y=this._getOriginId(R),me=this._getOriginZoom(R),_e="No cluster with the specified id.",Ue=this.trees[me];if(!Ue)throw new Error(_e);const tt=Ue.points[Y];if(!tt)throw new Error(_e);const Re=this.options.radius/(this.options.extent*Math.pow(2,me-1)),He=Ue.within(tt.x,tt.y,Re),dt=[];for(const Nt of He){const jt=Ue.points[Nt];jt.parentId===R&&dt.push(jt.numPoints?Cr(jt):this.points[jt.index])}if(0===dt.length)throw new Error(_e);return dt}getLeaves(R,Y,me){const _e=[];return this._appendLeaves(_e,R,Y=Y||10,me=me||0,0),_e}getTile(R,Y,me){const _e=this.trees[this._limitZoom(R)],Ue=Math.pow(2,R),{extent:tt,radius:Re}=this.options,He=Re/tt,dt=(me-He)/Ue,Nt=(me+1+He)/Ue,jt={features:[]};return this._addTileFeatures(_e.range((Y-He)/Ue,dt,(Y+1+He)/Ue,Nt),_e.points,Y,me,Ue,jt),0===Y&&this._addTileFeatures(_e.range(1-He/Ue,dt,1,Nt),_e.points,Ue,me,Ue,jt),Y===Ue-1&&this._addTileFeatures(_e.range(0,dt,He/Ue,Nt),_e.points,-1,me,Ue,jt),jt.features.length?jt:null}getClusterExpansionZoom(R){let Y=this._getOriginZoom(R)-1;for(;Y<=this.options.maxZoom;){const me=this.getChildren(R);if(Y++,1!==me.length)break;R=me[0].properties.cluster_id}return Y}_appendLeaves(R,Y,me,_e,Ue){const tt=this.getChildren(Y);for(const Re of tt){const He=Re.properties;if(He&&He.cluster?Ue+He.point_count<=_e?Ue+=He.point_count:Ue=this._appendLeaves(R,He.cluster_id,me,_e,Ue):Ue<_e?Ue++:R.push(Re),R.length===me)break}return Ue}_addTileFeatures(R,Y,me,_e,Ue,tt){for(const Re of R){const He=Y[Re],dt=He.numPoints;let Nt,jt,Zt;if(dt)Nt=os(He),jt=He.x,Zt=He.y;else{const Un=this.points[He.index];Nt=Un.properties,jt=lr(Un.geometry.coordinates[0]),Zt=Pn(Un.geometry.coordinates[1])}const bn={type:1,geometry:[[Math.round(this.options.extent*(jt*Ue-me)),Math.round(this.options.extent*(Zt*Ue-_e))]],tags:Nt};let Zn;dt?Zn=He.id:this.options.generateId?Zn=He.index:this.points[He.index].id&&(Zn=this.points[He.index].id),void 0!==Zn&&(bn.id=Zn),tt.features.push(bn)}}_limitZoom(R){return Math.max(this.options.minZoom,Math.min(+R,this.options.maxZoom+1))}_cluster(R,Y){const me=[],{radius:_e,extent:Ue,reduce:tt,minPoints:Re}=this.options,He=_e/(Ue*Math.pow(2,Y));for(let dt=0;dtY&&(Zn+=si.numPoints||1)}if(Zn>bn&&Zn>=Re){let Un=Nt.x*bn,si=Nt.y*bn,pi=tt&&bn>1?this._map(Nt,!0):null;const Mr=(dt<<5)+(Y+1)+this.points.length;for(const hr of Zt){const Ui=jt.points[hr];if(Ui.zoom<=Y)continue;Ui.zoom=Y;const kr=Ui.numPoints||1;Un+=Ui.x*kr,si+=Ui.y*kr,Ui.parentId=Mr,tt&&(pi||(pi=this._map(Nt,!0)),tt(pi,this._map(Ui)))}Nt.parentId=Mr,me.push(Hn(Un/Zn,si/Zn,Mr,Zn,pi))}else if(me.push(Nt),Zn>1)for(const Un of Zt){const si=jt.points[Un];si.zoom<=Y||(si.zoom=Y,me.push(si))}}return me}_getOriginId(R){return R-this.points.length>>5}_getOriginZoom(R){return(R-this.points.length)%32}_map(R,Y){if(R.numPoints)return Y?$s({},R.properties):R.properties;const me=this.points[R.index].properties,_e=this.options.map(me);return Y&&_e===me?$s({},_e):_e}}function Hn(oe,R,Y,me,_e){return{x:Lt(oe),y:Lt(R),zoom:1/0,id:Y,parentId:-1,numPoints:me,properties:_e}}function wn(oe,R){const[Y,me]=oe.geometry.coordinates;return{x:Lt(lr(Y)),y:Lt(Pn(me)),zoom:1/0,index:R,parentId:-1}}function Cr(oe){return{type:"Feature",id:oe.id,properties:os(oe),geometry:{type:"Point",coordinates:[(R=oe.x,360*(R-.5)),Wi(oe.y)]}};var R}function os(oe){const R=oe.numPoints,Y=R>=1e4?`${Math.round(R/1e3)}k`:R>=1e3?Math.round(R/100)/10+"k":R;return $s($s({},oe.properties),{cluster:!0,cluster_id:oe.id,point_count:R,point_count_abbreviated:Y})}function lr(oe){return oe/360+.5}function Pn(oe){const R=Math.sin(oe*Math.PI/180),Y=.5-.25*Math.log((1+R)/(1-R))/Math.PI;return Y<0?0:Y>1?1:Y}function Wi(oe){const R=(180-360*oe)*Math.PI/180;return 360*Math.atan(Math.exp(R))/Math.PI-90}function $s(oe,R){for(const Y in R)oe[Y]=R[Y];return oe}function Qo(oe){return oe.x}function Pa(oe){return oe.y}function Mn(oe,R,Y,me){for(var _e,Ue=me,tt=Y-R>>1,Re=Y-R,He=oe[R],dt=oe[R+1],Nt=oe[Y],jt=oe[Y+1],Zt=R+3;ZtUe)_e=Zt,Ue=bn;else if(bn===Ue){var Zn=Math.abs(Zt-tt);Znme&&(_e-R>3&&Mn(oe,R,_e,me),oe[_e+2]=Ue,Y-_e>3&&Mn(oe,_e,Y,me))}function qi(oe,R,Y,me,_e,Ue){var tt=_e-Y,Re=Ue-me;if(0!==tt||0!==Re){var He=((oe-Y)*tt+(R-me)*Re)/(tt*tt+Re*Re);He>1?(Y=_e,me=Ue):He>0&&(Y+=tt*He,me+=Re*He)}return(tt=oe-Y)*tt+(Re=R-me)*Re}function Is(oe,R,Y,me){var _e={id:void 0===oe?null:oe,type:R,geometry:Y,tags:me,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Ue){var tt=Ue.geometry,Re=Ue.type;if("Point"===Re||"MultiPoint"===Re||"LineString"===Re)Mo(Ue,tt);else if("Polygon"===Re||"MultiLineString"===Re)for(var He=0;He0&&(tt+=me?(_e*dt-He*Ue)/2:Math.sqrt(Math.pow(He-_e,2)+Math.pow(dt-Ue,2))),_e=He,Ue=dt}var Nt=R.length-3;R[2]=1,Mn(R,0,Nt,Y),R[Nt+2]=1,R.size=Math.abs(tt),R.start=0,R.end=R.size}function Va(oe,R,Y,me){for(var _e=0;_e1?1:Y}function hs(oe,R,Y,me,_e,Ue,tt,Re){if(me/=R,Ue>=(Y/=R)&&tt=me)return null;for(var He=[],dt=0;dt=Y&&Zn=me)){var Un=[];if("Point"===Zt||"MultiPoint"===Zt)ma(jt,Un,Y,me,_e);else if("LineString"===Zt)ea(jt,Un,Y,me,_e,!1,Re.lineMetrics);else if("MultiLineString"===Zt)So(jt,Un,Y,me,_e,!1);else if("Polygon"===Zt)So(jt,Un,Y,me,_e,!0);else if("MultiPolygon"===Zt)for(var si=0;si=Y&&tt<=me&&(R.push(oe[Ue]),R.push(oe[Ue+1]),R.push(oe[Ue+2]))}}function ea(oe,R,Y,me,_e,Ue,tt){for(var Re,He,dt=ga(oe),Nt=0===_e?qr:T2,jt=oe.start,Zt=0;ZtY&&(He=Nt(dt,bn,Zn,si,pi,Y),tt&&(dt.start=jt+Re*He)):Mr>me?hr=Y&&(He=Nt(dt,bn,Zn,si,pi,Y),Ui=!0),hr>me&&Mr<=me&&(He=Nt(dt,bn,Zn,si,pi,me),Ui=!0),!Ue&&Ui&&(tt&&(dt.end=jt+Re*He),R.push(dt),dt=ga(oe)),tt&&(jt+=Re)}var kr=oe.length-3;bn=oe[kr],Zn=oe[kr+1],Un=oe[kr+2],(Mr=0===_e?bn:Zn)>=Y&&Mr<=me&&P1(dt,bn,Zn,Un),kr=dt.length-3,Ue&&kr>=3&&(dt[kr]!==dt[0]||dt[kr+1]!==dt[1])&&P1(dt,dt[0],dt[1],dt[2]),dt.length&&R.push(dt)}function ga(oe){var R=[];return R.size=oe.size,R.start=oe.start,R.end=oe.end,R}function So(oe,R,Y,me,_e,Ue){for(var tt=0;tttt.maxX&&(tt.maxX=Nt),jt>tt.maxY&&(tt.maxY=jt)}return tt}function t1(oe,R,Y,me){var _e=R.geometry,Ue=R.type,tt=[];if("Point"===Ue||"MultiPoint"===Ue)for(var Re=0;Re<_e.length;Re+=3)tt.push(_e[Re]),tt.push(_e[Re+1]),oe.numPoints++,oe.numSimplified++;else if("LineString"===Ue)Ca(tt,_e,oe,Y,!1,!1);else if("MultiLineString"===Ue||"Polygon"===Ue)for(Re=0;Re<_e.length;Re++)Ca(tt,_e[Re],oe,Y,"Polygon"===Ue,0===Re);else if("MultiPolygon"===Ue)for(var He=0;He<_e.length;He++){var dt=_e[He];for(Re=0;Re0&&R.size<(_e?tt:me))Y.numPoints+=R.length/3;else{for(var Re=[],He=0;Hett)&&(Y.numSimplified++,Re.push(R[He]),Re.push(R[He+1])),Y.numPoints++;_e&&function(dt,Nt){for(var jt=0,Zt=0,bn=dt.length,Zn=bn-2;Zt0===Nt)for(Zt=0,bn=dt.length;Zt24)throw new Error("maxZoom should be in the 0-24 range");if(R.promoteId&&R.generateId)throw new Error("promoteId and generateId cannot be used together.");var _e,Ue,tt,Re,He,dt,me=function(_e,Ue){var tt=[];if("FeatureCollection"===_e.type)for(var Re=0;Re<_e.features.length;Re++)Os(tt,_e.features[Re],Ue,Re);else Os(tt,"Feature"===_e.type?_e:{geometry:_e},Ue);return tt}(oe,R);this.tiles={},this.tileCoords=[],Y&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",R.indexMaxZoom,R.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(_e=me,Ue=R,tt=Ue.buffer/Ue.extent,Re=_e,He=hs(_e,1,-1-tt,tt,0,-1,2,Ue),dt=hs(_e,1,1-tt,2+tt,0,-1,2,Ue),(He||dt)&&(Re=hs(_e,1,-tt,1+tt,0,-1,2,Ue)||[],He&&(Re=Fr(He,1).concat(Re)),dt&&(Re=Re.concat(Fr(dt,-1)))),me=Re).length&&this.splitTile(me,0,0,0),Y&&(me.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function oo(oe,R,Y){return 32*((1<1&&console.time("creation"),Zt=this.tiles[jt]=J1(oe,R,Y,me,He),this.tileCoords.push({z:R,x:Y,y:me}),dt)){dt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",R,Y,me,Zt.numFeatures,Zt.numPoints,Zt.numSimplified),console.timeEnd("creation"));var bn="z"+R;this.stats[bn]=(this.stats[bn]||0)+1,this.total++}if(Zt.source=oe,_e){if(R===He.maxZoom||R===_e)continue;var Zn=1<<_e-R;if(Y!==Math.floor(Ue/Zn)||me!==Math.floor(tt/Zn))continue}else if(R===He.indexMaxZoom||Zt.numPoints<=He.indexMaxPoints)continue;if(Zt.source=null,0!==oe.length){dt>1&&console.time("clipping");var Un,si,pi,Mr,hr,Ui,kr=.5*He.buffer/He.extent,ds=.5-kr,Fa=.5+kr,Zr=1+kr;Un=si=pi=Mr=null,hr=hs(oe,Nt,Y-kr,Y+Fa,0,Zt.minX,Zt.maxX,He),Ui=hs(oe,Nt,Y+ds,Y+Zr,0,Zt.minX,Zt.maxX,He),oe=null,hr&&(Un=hs(hr,Nt,me-kr,me+Fa,1,Zt.minY,Zt.maxY,He),si=hs(hr,Nt,me+ds,me+Zr,1,Zt.minY,Zt.maxY,He),hr=null),Ui&&(pi=hs(Ui,Nt,me-kr,me+Fa,1,Zt.minY,Zt.maxY,He),Mr=hs(Ui,Nt,me+ds,me+Zr,1,Zt.minY,Zt.maxY,He),Ui=null),dt>1&&console.timeEnd("clipping"),Re.push(Un||[],R+1,2*Y,2*me),Re.push(si||[],R+1,2*Y,2*me+1),Re.push(pi||[],R+1,2*Y+1,2*me),Re.push(Mr||[],R+1,2*Y+1,2*me+1)}}},_i.prototype.getTile=function(oe,R,Y){var me=this.options,_e=me.extent,Ue=me.debug;if(oe<0||oe>24)return null;var tt=1<1&&console.log("drilling down to z%d-%d-%d",oe,R,Y);for(var He,dt=oe,Nt=R,jt=Y;!He&&dt>0;)dt--,Nt=Math.floor(Nt/2),jt=Math.floor(jt/2),He=this.tiles[oo(dt,Nt,jt)];return He&&He.source?(Ue>1&&console.log("found parent tile z%d-%d-%d",dt,Nt,jt),Ue>1&&console.time("drilling down"),this.splitTile(He.source,dt,Nt,jt,oe,R,Y),Ue>1&&console.timeEnd("drilling down"),this.tiles[Re]?Q1(this.tiles[Re],_e):null):null};class No extends p.VectorTileWorkerSource{constructor(R,Y,me,_e,Ue){super(R,Y,me,_e,oi),Ue&&(this.loadGeoJSON=Ue)}loadData(R,Y){const me=R&&R.request,_e=me&&me.collectResourceTiming;this.loadGeoJSON(R,(Ue,tt)=>{if(Ue||!tt)return Y(Ue);if("object"!=typeof tt)return Y(new Error(`Input data given to '${R.source}' is not a valid GeoJSON object.`));{pe(tt,!0);try{if(R.filter){const He=p.createExpression(R.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===He.result)throw new Error(He.value.map(Nt=>`${Nt.key}: ${Nt.message}`).join(", "));const dt=tt.features.filter(Nt=>He.value.evaluate({zoom:0},Nt));tt={type:"FeatureCollection",features:dt}}this._geoJSONIndex=R.cluster?new mn(function({superclusterOptions:He,clusterProperties:dt}){if(!dt||!He)return He;const Nt={},jt={},Zt={accumulated:null,zoom:0},bn={properties:null},Zn=Object.keys(dt);for(const Un of Zn){const[si,pi]=dt[Un],Mr=p.createExpression(pi),hr=p.createExpression("string"==typeof si?[si,["accumulated"],["get",Un]]:si);Nt[Un]=Mr.value,jt[Un]=hr.value}return He.map=Un=>{bn.properties=Un;const si={};for(const pi of Zn)si[pi]=Nt[pi].evaluate(Zt,bn);return si},He.reduce=(Un,si)=>{bn.properties=si;for(const pi of Zn)Zt.accumulated=Un[pi],Un[pi]=jt[pi].evaluate(Zt,bn)},He}(R)).load(tt.features):new _i(He=tt,R.geojsonVtOptions)}catch(He){return Y(He)}this.loaded={};const Re={};if(_e){const He=p.getPerformanceMeasurement(me);He&&(Re.resourceTiming={},Re.resourceTiming[R.source]=JSON.parse(JSON.stringify(He)))}Y(null,Re)}var He})}reloadTile(R,Y){const me=this.loaded;return me&&me[R.uid]?super.reloadTile(R,Y):this.loadTile(R,Y)}loadGeoJSON(R,Y){if(R.request)p.getJSON(R.request,Y);else{if("string"!=typeof R.data)return Y(new Error(`Input data given to '${R.source}' is not a valid GeoJSON object.`));try{return Y(null,JSON.parse(R.data))}catch(me){return Y(new Error(`Input data given to '${R.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(R,Y){try{Y(null,this._geoJSONIndex.getClusterExpansionZoom(R.clusterId))}catch(me){Y(me)}}getClusterChildren(R,Y){try{Y(null,this._geoJSONIndex.getChildren(R.clusterId))}catch(me){Y(me)}}getClusterLeaves(R,Y){try{Y(null,this._geoJSONIndex.getLeaves(R.clusterId,R.limit,R.offset))}catch(me){Y(me)}}}class Xr{constructor(R){this.self=R,this.actor=new p.Actor(R,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=p.getProjection({name:"mercator"}),this.workerSourceTypes={vector:p.VectorTileWorkerSource,geojson:No},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(Y,me)=>{if(this.workerSourceTypes[Y])throw new Error(`Worker source with name "${Y}" already registered.`);this.workerSourceTypes[Y]=me},this.self.registerRTLTextPlugin=Y=>{if(p.plugin.isParsed())throw new Error("RTL text plugin already registered.");p.plugin.applyArabicShaping=Y.applyArabicShaping,p.plugin.processBidirectionalText=Y.processBidirectionalText,p.plugin.processStyledBidirectionalText=Y.processStyledBidirectionalText}}clearCaches(R,Y,me){delete this.layerIndexes[R],delete this.availableImages[R],delete this.workerSources[R],delete this.demWorkerSources[R],me()}checkIfReady(R,Y,me){me()}setReferrer(R,Y){this.referrer=Y}spriteLoaded(R,Y){this.isSpriteLoaded[R]=Y;for(const me in this.workerSources[R]){const _e=this.workerSources[R][me];for(const Ue in _e)_e[Ue]instanceof p.VectorTileWorkerSource&&(_e[Ue].isSpriteLoaded=Y,_e[Ue].fire(new p.Event("isSpriteLoaded")))}}setImages(R,Y,me){this.availableImages[R]=Y;for(const _e in this.workerSources[R]){const Ue=this.workerSources[R][_e];for(const tt in Ue)Ue[tt].availableImages=Y}me()}enableTerrain(R,Y,me){this.terrain=Y,me()}setProjection(R,Y){this.projections[R]=p.getProjection(Y)}setLayers(R,Y,me){this.getLayerIndex(R).replace(Y),me()}updateLayers(R,Y,me){this.getLayerIndex(R).update(Y.layers,Y.removedIds),me()}loadTile(R,Y,me){const _e=this.enableTerrain?p.extend({enableTerrain:this.terrain},Y):Y;_e.projection=this.projections[R]||this.defaultProjection,this.getWorkerSource(R,Y.type,Y.source).loadTile(_e,me)}loadDEMTile(R,Y,me){const _e=this.enableTerrain?p.extend({buildQuadTree:this.terrain},Y):Y;this.getDEMWorkerSource(R,Y.source).loadTile(_e,me)}reloadTile(R,Y,me){const _e=this.enableTerrain?p.extend({enableTerrain:this.terrain},Y):Y;_e.projection=this.projections[R]||this.defaultProjection,this.getWorkerSource(R,Y.type,Y.source).reloadTile(_e,me)}abortTile(R,Y,me){this.getWorkerSource(R,Y.type,Y.source).abortTile(Y,me)}removeTile(R,Y,me){this.getWorkerSource(R,Y.type,Y.source).removeTile(Y,me)}removeSource(R,Y,me){if(!this.workerSources[R]||!this.workerSources[R][Y.type]||!this.workerSources[R][Y.type][Y.source])return;const _e=this.workerSources[R][Y.type][Y.source];delete this.workerSources[R][Y.type][Y.source],void 0!==_e.removeSource?_e.removeSource(Y,me):me()}loadWorkerSource(R,Y,me){try{this.self.importScripts(Y.url),me()}catch(_e){me(_e.toString())}}syncRTLPluginState(R,Y,me){try{p.plugin.setState(Y);const _e=p.plugin.getPluginURL();if(p.plugin.isLoaded()&&!p.plugin.isParsed()&&null!=_e){this.self.importScripts(_e);const Ue=p.plugin.isParsed();me(Ue?void 0:new Error(`RTL Text Plugin failed to import scripts from ${_e}`),Ue)}}catch(_e){me(_e.toString())}}getAvailableImages(R){let Y=this.availableImages[R];return Y||(Y=[]),Y}getLayerIndex(R){let Y=this.layerIndexes[R];return Y||(Y=this.layerIndexes[R]=new ne),Y}getWorkerSource(R,Y,me){return this.workerSources[R]||(this.workerSources[R]={}),this.workerSources[R][Y]||(this.workerSources[R][Y]={}),this.workerSources[R][Y][me]||(this.workerSources[R][Y][me]=new this.workerSourceTypes[Y]({send:(_e,Ue,tt,Re,He,dt)=>{this.actor.send(_e,Ue,tt,R,He,dt)},scheduler:this.actor.scheduler},this.getLayerIndex(R),this.getAvailableImages(R),this.isSpriteLoaded[R])),this.workerSources[R][Y][me]}getDEMWorkerSource(R,Y){return this.demWorkerSources[R]||(this.demWorkerSources[R]={}),this.demWorkerSources[R][Y]||(this.demWorkerSources[R][Y]=new re),this.demWorkerSources[R][Y]}enforceCacheSizeLimit(R,Y){p.enforceCacheSizeLimit(Y)}getWorkerPerformanceMetrics(R,Y,me){me(void 0,void 0)}}return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new Xr(self)),Xr}),be(0,function(p){var Qe=Fe;function Fe(v){return l=v,!("undefined"==typeof window||"undefined"==typeof document||!(Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray)||!Function.prototype||!Function.prototype.bind||!(Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions)||!("JSON"in window&&"parse"in JSON&&"stringify"in JSON)||!function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var y,b,M=new Blob([""],{type:"text/javascript"}),L=URL.createObjectURL(M);try{b=new Worker(L),y=!0}catch(k){y=!1}return b&&b.terminate(),URL.revokeObjectURL(L),y}()||!("Uint8ClampedArray"in window)||!ArrayBuffer.isView||!function(){var y=document.createElement("canvas");y.width=y.height=1;var b=y.getContext("2d");if(!b)return!1;var M=b.getImageData(0,0,1,1);return M&&M.width===y.width}()||(void 0===ne[f=l&&l.failIfMajorPerformanceCaveat]&&(ne[f]=function(y){var b,L,k,N,M=(L=y,k=document.createElement("canvas"),(N=Object.create(Fe.webGLContextAttributes)).failIfMajorPerformanceCaveat=L,k.getContext("webgl",N)||k.getContext("experimental-webgl",N));if(!M)return!1;try{b=M.createShader(M.VERTEX_SHADER)}catch(L){return!1}return!(!b||M.isContextLost())&&(M.shaderSource(b,"void main() {}"),M.compileShader(b),!0===M.getShaderParameter(b,M.COMPILE_STATUS))}(f)),!ne[f]||document.documentMode));var l,f}var ne={};function de(v,l){var f=l[0],y=l[1],b=l[2],M=l[3],L=f*M-b*y;return L?(v[0]=M*(L=1/L),v[1]=-y*L,v[2]=-b*L,v[3]=f*L,v):null}function re(v,l){if(Array.isArray(v)){if(!Array.isArray(l)||v.length!==l.length)return!1;for(let f=0;f{p.window.removeEventListener("click",Pe,!0)},0)},pe.mousePos=function(v,l){const f=v.getBoundingClientRect();return at(v,f,l)},pe.touchPos=function(v,l){const f=v.getBoundingClientRect(),y=[];for(let b=0;b=0?0:v.button};class _t extends p.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new p.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(l){if(this.loaded!==l&&(this.loaded=l,l)){for(const{ids:f,callback:y}of this.requestors)this._notify(f,y);this.requestors=[]}}getImage(l){return this.images[l]}addImage(l,f){this._validate(l,f)&&(this.images[l]=f)}_validate(l,f){let y=!0;return this._validateStretch(f.stretchX,f.data&&f.data.width)||(this.fire(new p.ErrorEvent(new Error(`Image "${l}" has invalid "stretchX" value`))),y=!1),this._validateStretch(f.stretchY,f.data&&f.data.height)||(this.fire(new p.ErrorEvent(new Error(`Image "${l}" has invalid "stretchY" value`))),y=!1),this._validateContent(f.content,f)||(this.fire(new p.ErrorEvent(new Error(`Image "${l}" has invalid "content" value`))),y=!1),y}_validateStretch(l,f){if(!l)return!0;let y=0;for(const b of l){if(b[0]{this.ready=!0})}broadcast(l,f,y){p.asyncAll(this.actors,(b,M)=>{b.send(l,f,M)},y=y||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(l=>{l.remove()}),this.actors=[],this.workerPool.release(this.id)}}function Ct(v,l,f){return l*(p.EXTENT/(v.tileSize*Math.pow(2,f-v.tileID.overscaledZ)))}lt.Actor=p.Actor;class Dt{constructor(l,f,y){this.context=l;const b=l.gl;this.buffer=b.createBuffer(),this.dynamicDraw=Boolean(y),this.context.unbindVAO(),l.bindElementBuffer.set(this.buffer),b.bufferData(b.ELEMENT_ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?b.DYNAMIC_DRAW:b.STATIC_DRAW),this.dynamicDraw||delete f.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(l){const f=this.context.gl;this.context.unbindVAO(),this.bind(),f.bufferSubData(f.ELEMENT_ARRAY_BUFFER,0,l.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Qt={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Rn{constructor(l,f,y,b){this.length=f.length,this.attributes=y,this.itemSize=f.bytesPerElement,this.dynamicDraw=b,this.context=l;const M=l.gl;this.buffer=M.createBuffer(),l.bindVertexBuffer.set(this.buffer),M.bufferData(M.ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?M.DYNAMIC_DRAW:M.STATIC_DRAW),this.dynamicDraw||delete f.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(l){const f=this.context.gl;this.bind(),f.bufferSubData(f.ARRAY_BUFFER,0,l.arrayBuffer)}enableAttributes(l,f){for(let y=0;yb.pointCoordinate3D(M)),this.cameraGeometry=this.bufferedCameraGeometry(0)}static createFromScreenPoints(l,f){let y,b;if(l instanceof p.pointGeometry||"number"==typeof l[0]){const M=p.pointGeometry.convert(l);y=[p.pointGeometry.convert(l)],b=f.isPointAboveHorizon(M)}else{const M=p.pointGeometry.convert(l[0]),L=p.pointGeometry.convert(l[1]);y=[M,L],b=p.polygonizeBounds(M,L).every(k=>f.isPointAboveHorizon(k))}return new Q1(y,f.getCameraPoint(),b,f)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(l){return p.polygonizeBounds(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],l)}bufferedCameraGeometry(l){const f=this.screenBounds[0],y=1===this.screenBounds.length?this.screenBounds[0].add(new p.pointGeometry(1,1)):this.screenBounds[1],b=p.polygonizeBounds(f,y,0,!1);return this.cameraPoint.y>y.y&&(this.cameraPoint.x>f.x&&this.cameraPoint.x=y.x?b[2]=this.cameraPoint:this.cameraPoint.x<=f.x&&(b[3]=this.cameraPoint)),p.bufferConvexPolygon(b,l)}containsTile(l,f,y){const b=l.queryPadding+1,M=l.tileID.wrap,L=y?this._bufferedCameraMercator(b,f).map(ae=>p.getTilePoint(l.tileTransform,ae,M)):this._bufferedScreenMercator(b,f).map(ae=>p.getTilePoint(l.tileTransform,ae,M)),k=this.screenGeometryMercator.map(ae=>p.getTileVec3(l.tileTransform,ae,M)),N=k.map(ae=>new p.pointGeometry(ae[0],ae[1])),H=f.getFreeCameraOptions().position||new p.MercatorCoordinate(0,0,0),$=p.getTileVec3(l.tileTransform,H,M),G=k.map(ae=>{const ue=p.sub(ae,ae,$);return p.normalize(ue,ue),new p.Ray($,ue)}),J=Ct(l,1,f.zoom);if(p.polygonIntersectsBox(L,0,0,p.EXTENT,p.EXTENT))return{queryGeometry:this,tilespaceGeometry:N,tilespaceRays:G,bufferedTilespaceGeometry:L,bufferedTilespaceBounds:(he=p.getBounds(L),he.min.x=p.clamp(he.min.x,0,p.EXTENT),he.min.y=p.clamp(he.min.y,0,p.EXTENT),he.max.x=p.clamp(he.max.x,0,p.EXTENT),he.max.y=p.clamp(he.max.y,0,p.EXTENT),he),tile:l,tileID:l.tileID,pixelToTileUnitsFactor:J};var he}_bufferedScreenMercator(l,f){const y=To(l);if(this._screenRaycastCache[y])return this._screenRaycastCache[y];{const b=this.bufferedScreenGeometry(l).map(M=>f.pointCoordinate3D(M));return this._screenRaycastCache[y]=b,b}}_bufferedCameraMercator(l,f){const y=To(l);if(this._cameraRaycastCache[y])return this._cameraRaycastCache[y];{const b=this.bufferedCameraGeometry(l).map(M=>f.pointCoordinate3D(M));return this._cameraRaycastCache[y]=b,b}}}function To(v){return 100*v|0}function J1(v,l,f){const y=function(b,M){if(b)return f(b);if(M){const L=p.pick(p.extend(M,v),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);M.vector_layers&&(L.vectorLayers=M.vector_layers,L.vectorLayerIds=L.vectorLayers.map(k=>k.id)),L.tiles=l.canonicalizeTileset(L,v.url),f(null,L)}};return v.url?p.getJSON(l.transformRequest(l.normalizeSourceURL(v.url),p.ResourceType.Source),y):p.exported.frame(()=>y(null,v))}class t1{constructor(l,f,y){this.bounds=p.LngLatBounds.convert(this.validateBounds(l)),this.minzoom=f||0,this.maxzoom=y||24}validateBounds(l){return Array.isArray(l)&&4===l.length?[Math.max(-180,l[0]),Math.max(-90,l[1]),Math.min(180,l[2]),Math.min(90,l[3])]:[-180,-90,180,90]}contains(l){const f=Math.pow(2,l.z),y=Math.floor(p.mercatorXfromLng(this.bounds.getWest())*f),b=Math.floor(p.mercatorYfromLat(this.bounds.getNorth())*f),M=Math.ceil(p.mercatorXfromLng(this.bounds.getEast())*f),L=Math.ceil(p.mercatorYfromLat(this.bounds.getSouth())*f);return l.x>=y&&l.x=b&&l.y{this._tileJSONRequest=null,this._loaded=!0,l?this.fire(new p.ErrorEvent(l)):f&&(p.extend(this,f),f.bounds&&(this.tileBounds=new t1(f.bounds,this.minzoom,this.maxzoom)),p.postTurnstileEvent(f.tiles),this.fire(new p.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new p.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(l){this.map=l,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return p.extend({},this._options)}hasTile(l){return!this.tileBounds||this.tileBounds.contains(l.canonical)}loadTile(l,f){const y=p.exported.devicePixelRatio>=2,b=this.map._requestManager.normalizeTileURL(l.tileID.canonical.url(this.tiles,this.scheme),y,this.tileSize);l.request=p.getImage(this.map._requestManager.transformRequest(b,p.ResourceType.Tile),(M,L,k,N)=>{if(delete l.request,l.aborted)l.state="unloaded",f(null);else if(M)l.state="errored",f(M);else if(L){this.map._refreshExpiredTiles&&l.setExpiryData({cacheControl:k,expires:N});const H=this.map.painter.context,$=H.gl;l.texture=this.map.painter.getTileTexture(L.width),l.texture?l.texture.update(L,{useMipmap:!0}):(l.texture=new p.Texture(H,L,$.RGBA,{useMipmap:!0}),l.texture.bind($.LINEAR,$.CLAMP_TO_EDGE),H.extTextureFilterAnisotropic&&$.texParameterf($.TEXTURE_2D,H.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,H.extTextureFilterAnisotropicMax)),l.state="loaded",p.cacheEntryPossiblyAdded(this.dispatcher),f(null)}})}abortTile(l,f){l.request&&(l.request.cancel(),delete l.request),f()}unloadTile(l,f){l.texture&&this.map.painter.saveTileTexture(l.texture),f()}hasTransition(){return!1}}let _i;function oo(v,l,f,y,b,M,L,k){const N=[v,f,b,l,y,M,1,1,1],H=[L,k,1],$=p.adjoint([],N),[G,J,he]=p.transformMat3(H,H,p.transpose($,$));return p.multiply(N,[G,0,0,0,J,0,0,0,he],N)}class oi extends p.Evented{constructor(l,f,y,b){super(),this.id=l,this.dispatcher=y,this.coordinates=f.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(b),this.options=f}load(l,f){this._loaded=!1,this.fire(new p.Event("dataloading",{dataType:"source"})),this.url=this.options.url,p.getImage(this.map._requestManager.transformRequest(this.url,p.ResourceType.Image),(y,b)=>{this._loaded=!0,y?this.fire(new p.ErrorEvent(y)):b&&(this.image=p.exported.getImageData(b),this.width=this.image.width,this.height=this.image.height,l&&(this.coordinates=l),f&&f(),this._finishLoading())})}loaded(){return this._loaded}updateImage(l){return this.image&&l.url?(this.options.url=l.url,this.load(l.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new p.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(l){this.map=l,this.load()}setCoordinates(l){this.coordinates=l,delete this._boundsArray;const f=l.map(p.MercatorCoordinate.fromLngLat);return this.tileID=function(y){let b=1/0,M=1/0,L=-1/0,k=-1/0;for(const G of y)b=Math.min(b,G.x),M=Math.min(M,G.y),L=Math.max(L,G.x),k=Math.max(k,G.y);const N=Math.max(L-b,k-M),H=Math.max(0,Math.floor(-Math.log(N)/Math.LN2)),$=Math.pow(2,H);return new p.CanonicalTileID(H,Math.floor((b+L)/2*$),Math.floor((M+k)/2*$))}(f),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new p.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){delete this._boundsArray}_makeBoundsArray(){const l=p.tileTransform(this.tileID,this.map.transform.projection),[f,y,b,M]=this.coordinates.map(L=>{const k=l.projection.project(L[0],L[1]);return p.getTilePoint(l,k)._round()});return this.perspectiveTransform=function(L,k,N,H,$,G,J,he,ae,ue){const Ve=oo(0,0,L,0,0,k,L,k),le=oo(N,H,$,G,J,he,ae,ue);return p.multiply(le,p.adjoint(Ve,Ve),le),[le[6]/le[8]*L/p.EXTENT,le[7]/le[8]*k/p.EXTENT]}(this.width,this.height,f.x,f.y,y.x,y.y,M.x,M.y,b.x,b.y),this._boundsArray=new p.StructArrayLayout4i8,this._boundsArray.emplaceBack(f.x,f.y,0,0),this._boundsArray.emplaceBack(y.x,y.y,p.EXTENT,0),this._boundsArray.emplaceBack(M.x,M.y,0,p.EXTENT),this._boundsArray.emplaceBack(b.x,b.y,p.EXTENT,p.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const l=this.map.painter.context,f=l.gl;this._boundsArray||this._makeBoundsArray(),this.boundsBuffer||(this.boundsBuffer=l.createVertexBuffer(this._boundsArray,p.boundsAttributes.members)),this.boundsSegments||(this.boundsSegments=p.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new p.Texture(l,this.image,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));for(const y in this.tiles){const b=this.tiles[y];"loaded"!==b.state&&(b.state="loaded",b.texture=this.texture)}}loadTile(l,f){this.tileID&&this.tileID.equals(l.tileID.canonical)?(this.tiles[String(l.tileID.wrap)]=l,l.buckets={},f(null)):(l.state="errored",f(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const No={vector:class extends p.Evented{constructor(v,l,f,y){if(super(),this.id=v,this.dispatcher=f,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,p.extend(this,p.pick(l,["url","scheme","tileSize","promoteId"])),this._options=p.extend({type:"vector"},l),this._collectResourceTiming=l.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(y),this._tileWorkers={},this._deduped=new p.DedupedRequest}load(){this._loaded=!1,this.fire(new p.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=J1(this._options,this.map._requestManager,(v,l)=>{this._tileJSONRequest=null,this._loaded=!0,v?this.fire(new p.ErrorEvent(v)):l&&(p.extend(this,l),l.bounds&&(this.tileBounds=new t1(l.bounds,this.minzoom,this.maxzoom)),p.postTurnstileEvent(l.tiles,this.map._requestManager._customAccessToken),this.fire(new p.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new p.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(v){return!this.tileBounds||this.tileBounds.contains(v.canonical)}onAdd(v){this.map=v,this.load()}setSourceProperty(v){this._tileJSONRequest&&this._tileJSONRequest.cancel(),v();const l=this.map.style._getSourceCaches(this.id);for(const f of l)f.clearTiles();this.load()}setTiles(v){return this.setSourceProperty(()=>{this._options.tiles=v}),this}setUrl(v){return this.setSourceProperty(()=>{this.url=v,this._options.url=v}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return p.extend({},this._options)}loadTile(v,l){const f=this.map._requestManager.normalizeTileURL(v.tileID.canonical.url(this.tiles,this.scheme)),y={request:this.map._requestManager.transformRequest(f,p.ResourceType.Tile),data:void 0,uid:v.uid,tileID:v.tileID,tileZoom:v.tileZoom,zoom:v.tileID.overscaledZ,tileSize:this.tileSize*v.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:p.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:v.isSymbolTile};if(y.request.collectResourceTiming=this._collectResourceTiming,v.actor&&"expired"!==v.state)"loading"===v.state?v.reloadCallback=l:v.request=v.actor.send("reloadTile",y,b.bind(this));else if(v.actor=this._tileWorkers[f]=this._tileWorkers[f]||this.dispatcher.getActor(),this.dispatcher.ready)v.request=v.actor.send("loadTile",y,b.bind(this),void 0,!0);else{const M=p.loadVectorTile.call({deduped:this._deduped},y,(L,k)=>{L||!k?b.call(this,L):(y.data={cacheControl:k.cacheControl,expires:k.expires,rawData:k.rawData.slice(0)},v.actor&&v.actor.send("loadTile",y,b.bind(this),void 0,!0))},!0);v.request={cancel:M}}function b(M,L){return delete v.request,v.aborted?l(null):M&&404!==M.status?l(M):(L&&L.resourceTiming&&(v.resourceTiming=L.resourceTiming),this.map._refreshExpiredTiles&&L&&v.setExpiryData(L),v.loadVectorData(L,this.map.painter),p.cacheEntryPossiblyAdded(this.dispatcher),l(null),void(v.reloadCallback&&(this.loadTile(v,v.reloadCallback),v.reloadCallback=null)))}}abortTile(v){v.request&&(v.request.cancel(),delete v.request),v.actor&&v.actor.send("abortTile",{uid:v.uid,type:this.type,source:this.id})}unloadTile(v){v.unloadVectorData(),v.actor&&v.actor.send("removeTile",{uid:v.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}},raster:Ca,"raster-dem":class extends Ca{constructor(v,l,f,y){super(v,l,f,y),this.type="raster-dem",this.maxzoom=22,this._options=p.extend({type:"raster-dem"},l),this.encoding=l.encoding||"mapbox"}loadTile(v,l){const f=this.map._requestManager.normalizeTileURL(v.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function y(b,M){b&&(v.state="errored",l(b)),M&&(v.dem=M,v.dem.onDeserialize(),v.needsHillshadePrepare=!0,v.needsDEMTextureUpload=!0,v.state="loaded",l(null))}v.request=p.getImage(this.map._requestManager.transformRequest(f,p.ResourceType.Tile),function(b,M,L,k){if(delete v.request,v.aborted)v.state="unloaded",l(null);else if(b)v.state="errored",l(b);else if(M){this.map._refreshExpiredTiles&&v.setExpiryData({cacheControl:L,expires:k});const N=p.window.ImageBitmap&&M instanceof p.window.ImageBitmap&&(null==_i&&(_i=p.window.OffscreenCanvas&&new p.window.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof p.window.createImageBitmap),_i),H=1-(M.width-p.prevPowerOfTwo(M.width))/2;H<1||v.neighboringTiles||(v.neighboringTiles=this._getNeighboringTiles(v.tileID));const $=N?M:p.exported.getImageData(M,H),G={uid:v.uid,coord:v.tileID,source:this.id,rawImageData:$,encoding:this.encoding,padding:H};v.actor&&"expired"!==v.state||(v.actor=this.dispatcher.getActor(),v.actor.send("loadDEMTile",G,y.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(v){const l=v.canonical,f=Math.pow(2,l.z),y=(l.x-1+f)%f,b=0===l.x?v.wrap-1:v.wrap,M=(l.x+1+f)%f,L=l.x+1===f?v.wrap+1:v.wrap,k={};return k[new p.OverscaledTileID(v.overscaledZ,b,l.z,y,l.y).key]={backfilled:!1},k[new p.OverscaledTileID(v.overscaledZ,L,l.z,M,l.y).key]={backfilled:!1},l.y>0&&(k[new p.OverscaledTileID(v.overscaledZ,b,l.z,y,l.y-1).key]={backfilled:!1},k[new p.OverscaledTileID(v.overscaledZ,v.wrap,l.z,l.x,l.y-1).key]={backfilled:!1},k[new p.OverscaledTileID(v.overscaledZ,L,l.z,M,l.y-1).key]={backfilled:!1}),l.y+1{if(this._loaded=!0,this._pendingLoad=null,f)this.fire(new p.ErrorEvent(f));else{const b={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&y&&y.resourceTiming&&y.resourceTiming[this.id]&&(b.resourceTiming=y.resourceTiming[this.id]),this.fire(new p.Event("data",b)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(v,l){const f=v.actor?"reloadTile":"loadTile";v.actor=this.actor,v.request=this.actor.send(f,{type:this.type,uid:v.uid,tileID:v.tileID,tileZoom:v.tileZoom,zoom:v.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:p.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(y,b)=>(delete v.request,v.unloadVectorData(),v.aborted?l(null):y?l(y):(v.loadVectorData(b,this.map.painter,"reloadTile"===f),l(null))),void 0,"loadTile"===f)}abortTile(v){v.request&&(v.request.cancel(),delete v.request),v.aborted=!0}unloadTile(v){v.unloadVectorData(),this.actor.send("removeTile",{uid:v.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return p.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends oi{constructor(v,l,f,y){super(v,l,f,y),this.roundZoom=!0,this.type="video",this.options=l}load(){this._loaded=!1;const v=this.options;this.urls=[];for(const l of v.urls)this.urls.push(this.map._requestManager.transformRequest(l,p.ResourceType.Source).url);p.getVideo(this.urls,(l,f)=>{this._loaded=!0,l?this.fire(new p.ErrorEvent(l)):f&&(this.video=f,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(v){if(this.video){const l=this.video.seekable;vl.end(0)?this.fire(new p.ErrorEvent(new p.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${l.start(0)} and ${l.end(0)}-second mark.`))):this.video.currentTime=v}}getVideo(){return this.video}onAdd(v){this.map||(this.map=v,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const v=this.map.painter.context,l=v.gl;this.texture?this.video.paused||(this.texture.bind(l.LINEAR,l.CLAMP_TO_EDGE),l.texSubImage2D(l.TEXTURE_2D,0,0,0,l.RGBA,l.UNSIGNED_BYTE,this.video)):(this.texture=new p.Texture(v,this.video,l.RGBA),this.texture.bind(l.LINEAR,l.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._boundsArray||this._makeBoundsArray(),this.boundsBuffer||(this.boundsBuffer=v.createVertexBuffer(this._boundsArray,p.boundsAttributes.members)),this.boundsSegments||(this.boundsSegments=p.SegmentVector.simpleSegment(0,0,4,2));for(const f in this.tiles){const y=this.tiles[f];"loaded"!==y.state&&(y.state="loaded",y.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:oi,canvas:class extends oi{constructor(v,l,f,y){super(v,l,f,y),l.coordinates?Array.isArray(l.coordinates)&&4===l.coordinates.length&&!l.coordinates.some(b=>!Array.isArray(b)||2!==b.length||b.some(M=>"number"!=typeof M))||this.fire(new p.ErrorEvent(new p.ValidationError(`sources.${v}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new p.ErrorEvent(new p.ValidationError(`sources.${v}`,null,'missing required property "coordinates"'))),l.animate&&"boolean"!=typeof l.animate&&this.fire(new p.ErrorEvent(new p.ValidationError(`sources.${v}`,null,'optional "animate" property must be a boolean value'))),l.canvas?"string"==typeof l.canvas||l.canvas instanceof p.window.HTMLCanvasElement||this.fire(new p.ErrorEvent(new p.ValidationError(`sources.${v}`,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 p.ErrorEvent(new p.ValidationError(`sources.${v}`,null,'missing required property "canvas"'))),this.options=l,this.animate=void 0===l.animate||l.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof p.window.HTMLCanvasElement?this.options.canvas:p.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new p.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(v){this.map=v,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let v=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,v=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,v=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;const l=this.map.painter.context,f=l.gl;this._boundsArray||this._makeBoundsArray(),this.boundsBuffer||(this.boundsBuffer=l.createVertexBuffer(this._boundsArray,p.boundsAttributes.members)),this.boundsSegments||(this.boundsSegments=p.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(v||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new p.Texture(l,this.canvas,f.RGBA,{premultiply:!0});for(const y in this.tiles){const b=this.tiles[y];"loaded"!==b.state&&(b.state="loaded",b.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const v of[this.canvas.width,this.canvas.height])if(isNaN(v)||v<=0)return!0;return!1}}},Xr=function(v,l,f,y){const b=new No[l.type](v,l,f,y);if(b.id!==v)throw new Error(`Expected Source id to be ${v} instead of ${b.id}`);return p.bindAll(["load","abort","unload","serialize","prepare"],b),b};function oe(v,l){const f=p.identity([]);return p.scale(f,f,[.5*v.width,.5*-v.height,1]),p.translate(f,f,[1,-1,0]),p.multiply$1(f,f,v.calculateProjMatrix(l.toUnwrapped()))}function R(v,l,f,y,b,M,L,k=!1){const N=v.tilesIn(y,L,k);N.sort(me);const H=[];for(const G of N)H.push({wrappedTileID:G.tile.tileID.wrapped().key,queryResults:G.tile.queryRenderedFeatures(l,f,v._state,G,b,M,oe(v.transform,G.tile.tileID),k)});const $=function(G){const J={},he={};for(const ae of G){const ue=ae.queryResults,Ve=ae.wrappedTileID,le=he[Ve]=he[Ve]||{};for(const Ae in ue){const ke=ue[Ae],Te=le[Ae]=le[Ae]||{},De=J[Ae]=J[Ae]||[];for(const Oe of ke)Te[Oe.featureIndex]||(Te[Oe.featureIndex]=!0,De.push(Oe))}}return J}(H);for(const G in $)$[G].forEach(J=>{const he=J.feature,ae=v.getFeatureState(he.layer["source-layer"],he.id);he.source=he.layer.source,he.layer["source-layer"]&&(he.sourceLayer=he.layer["source-layer"]),he.state=ae});return $}function Y(v,l){const f=v.getRenderableIds().map(M=>v.getTileByID(M)),y=[],b={};for(let M=0;M{f.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ue]}numActive(){return Object.keys(this.active).length}}let Re;function He(){return Re||(Re=new tt),Re}function dt(v,l){const f={};for(const y in v)"ref"!==y&&(f[y]=v[y]);return p.refProperties.forEach(y=>{y in l&&(f[y]=l[y])}),f}function Nt(v){v=v.slice();const l=Object.create(null);for(let f=0;f0?(b-L)/k:0;return this.points[M].mult(1-N).add(this.points[f].mult(N))}}class Ui{constructor(l,f,y){const b=this.boxCells=[],M=this.circleCells=[];this.xCellCount=Math.ceil(l/y),this.yCellCount=Math.ceil(f/y);for(let L=0;Lthis.width||b<0||f>this.height)return!M&&[];const k=[];if(l<=0&&f<=0&&this.width<=y&&this.height<=b){if(M)return!0;for(let N=0;N0:k}_queryCircle(l,f,y,b,M){const L=l-y,k=l+y,N=f-y,H=f+y;if(k<0||L>this.width||H<0||N>this.height)return!b&&[];const $=[];return this._forEachCell(L,N,k,H,this._queryCellCircle,$,{hitTest:b,circle:{x:l,y:f,radius:y},seenUids:{box:{},circle:{}}},M),b?$.length>0:$}query(l,f,y,b,M){return this._query(l,f,y,b,!1,M)}hitTest(l,f,y,b,M){return this._query(l,f,y,b,!0,M)}hitTestCircle(l,f,y,b){return this._queryCircle(l,f,y,!0,b)}_queryCell(l,f,y,b,M,L,k,N){const H=k.seenUids,$=this.boxCells[M];if(null!==$){const J=this.bboxes;for(const he of $)if(!H.box[he]){H.box[he]=!0;const ae=4*he;if(l<=J[ae+2]&&f<=J[ae+3]&&y>=J[ae+0]&&b>=J[ae+1]&&(!N||N(this.boxKeys[he]))){if(k.hitTest)return L.push(!0),!0;L.push({key:this.boxKeys[he],x1:J[ae],y1:J[ae+1],x2:J[ae+2],y2:J[ae+3]})}}}const G=this.circleCells[M];if(null!==G){const J=this.circles;for(const he of G)if(!H.circle[he]){H.circle[he]=!0;const ae=3*he;if(this._circleAndRectCollide(J[ae],J[ae+1],J[ae+2],l,f,y,b)&&(!N||N(this.circleKeys[he]))){if(k.hitTest)return L.push(!0),!0;{const ue=J[ae],Ve=J[ae+1],le=J[ae+2];L.push({key:this.circleKeys[he],x1:ue-le,y1:Ve-le,x2:ue+le,y2:Ve+le})}}}}}_queryCellCircle(l,f,y,b,M,L,k,N){const H=k.circle,$=k.seenUids,G=this.boxCells[M];if(null!==G){const he=this.bboxes;for(const ae of G)if(!$.box[ae]){$.box[ae]=!0;const ue=4*ae;if(this._circleAndRectCollide(H.x,H.y,H.radius,he[ue+0],he[ue+1],he[ue+2],he[ue+3])&&(!N||N(this.boxKeys[ae])))return L.push(!0),!0}}const J=this.circleCells[M];if(null!==J){const he=this.circles;for(const ae of J)if(!$.circle[ae]){$.circle[ae]=!0;const ue=3*ae;if(this._circlesCollide(he[ue],he[ue+1],he[ue+2],H.x,H.y,H.radius)&&(!N||N(this.circleKeys[ae])))return L.push(!0),!0}}}_forEachCell(l,f,y,b,M,L,k,N){const H=this._convertToXCellCoord(l),$=this._convertToYCellCoord(f),G=this._convertToXCellCoord(y),J=this._convertToYCellCoord(b);for(let he=H;he<=G;he++)for(let ae=$;ae<=J;ae++)if(M.call(this,l,f,y,b,this.xCellCount*ae+he,L,k,N))return}_convertToXCellCoord(l){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(l*this.xScale)))}_convertToYCellCoord(l){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(l*this.yScale)))}_circlesCollide(l,f,y,b,M,L){const k=b-l,N=M-f,H=y+L;return H*H>k*k+N*N}_circleAndRectCollide(l,f,y,b,M,L,k){const N=(L-b)/2,H=Math.abs(l-(b+N));if(H>N+y)return!1;const $=(k-M)/2,G=Math.abs(f-(M+$));if(G>$+y)return!1;if(H<=N||G<=$)return!0;const J=H-N,he=G-$;return J*J+he*he<=y*y}}const kr=Math.tan(85*Math.PI/180);function ds(v,l,f,y,b,M){let L=p.create();if(f){if("globe"===b.projection.name)L=p.calculateGlobeMatrix(b,b.worldSize/b._projectionScaler,[0,0]),p.multiply$1(L,L,p.globeDenormalizeECEF(p.globeTileBounds(l)));else{const k=de([],M);L[0]=k[0],L[1]=k[1],L[4]=k[2],L[5]=k[3]}y||p.rotateZ(L,L,b.angle)}else p.multiply$1(L,b.labelPlaneMatrix,v);return L}function Fa(v,l,f,y,b,M){if(f){if("globe"===b.projection.name){const L=ds(v,l,f,y,b,M);return p.invert(L,L),p.multiply$1(L,v,L),L}{const L=p.clone(v),k=p.identity([]);return k[0]=M[0],k[1]=M[1],k[4]=M[2],k[5]=M[3],p.multiply$1(L,L,k),y||p.rotateZ(L,L,-b.angle),L}}return b.glCoordMatrix}function Zr(v,l,f=0){const y=[v.x,v.y,f,1];f?p.transformMat4$1(y,y,l):V1(y,y,l);const b=y[3];return{point:new p.pointGeometry(y[0]/b,y[1]/b),signedDistanceFromCamera:b}}function va(v,l){return Math.min(.5+v/l*.5,1.5)}function zs(v,l){const f=v[0]/v[3],y=v[1]/v[3];return f>=-l[0]&&f<=l[0]&&y>=-l[1]&&y<=l[1]}function vr(v,l,f,y,b,M,L,k,N,H){const $=f.transform,G=y?v.textSizeData:v.iconSizeData,J=p.evaluateSizeForZoom(G,f.transform.zoom),he=[256/f.width*2+1,256/f.height*2+1],ae=y?v.text.dynamicLayoutVertexArray:v.icon.dynamicLayoutVertexArray;ae.clear();const ue=v.lineVertexArray,Ve=y?v.text.placedSymbolArray:v.icon.placedSymbolArray,le=f.transform.width/f.transform.height;let Ae=!1;for(let ke=0;keMath.abs(f.x-l.x)*y?{useVertical:!0}:v.writingMode===p.WritingMode.vertical?l.ykr}(l,f,y)?1===v.flipState?{needsFlipping:!0}:null:l.x>f.x?{needsFlipping:!0}:null}function Zl(v,l,f,y,b,M,L,k,N,H,$,G,J,he,ae,ue,Ve){const le=l/24,Ae=v.lineOffsetX*le,ke=v.lineOffsetY*le;let Te;if(v.numGlyphs>1){const De=v.glyphStartIndex+v.numGlyphs,Oe=v.lineStartIndex,pt=v.lineStartIndex+v.lineLength,Tt=Xl(le,k,Ae,ke,f,$,G,v,N,M,J,ae,!1,ue,Ve);if(!Tt)return{notEnoughRoom:!0};const hn=Zr(Tt.first.point,L).point,sn=Zr(Tt.last.point,L).point;if(y&&!f){const nn=n1(v,hn,sn,he);if(v.flipState=nn&&nn.needsFlipping?1:2,nn)return nn}Te=[Tt.first];for(let nn=v.glyphStartIndex+1;nn0?hn.point:al(G,Tt,Oe,1,b,void 0,ue,Ve.canonical),he);if(v.flipState=sn&&sn.needsFlipping?1:2,sn)return sn}const De=yi(le*k.getoffsetX(v.glyphStartIndex),Ae,ke,f,$,G,v.segment,v.lineStartIndex,v.lineStartIndex+v.lineLength,N,M,J,ae,!1,!1,ue,Ve);if(!De)return{notEnoughRoom:!0};Te=[De]}for(const De of Te)p.addDynamicAttributes(H,De.point,De.angle);return{}}function Jt(v,l,f,y,b){const M=y.projectTilePoint(v.x,v.y,l);if(!b)return Zr(M,f,M.z);const L=b(v);return Zr(new p.pointGeometry(M.x+L[0],M.y+L[1]),f,M.z+L[2])}function al(v,l,f,y,b,M,L,k){const N=Jt(v.add(v.sub(l)._unit()),k,b,L,M).point,H=f.sub(N);return f.add(H._mult(y/H.mag()))}function yi(v,l,f,y,b,M,L,k,N,H,$,G,J,he,ae,ue,Ve){const le=y?v-l:v+l;let Ae=le>0?1:-1,ke=0;y&&(Ae*=-1,ke=Math.PI),Ae<0&&(ke+=Math.PI);let Te=Ae>0?k+L:k+L+1,De=b,Oe=b,pt=0,Tt=0;const hn=Math.abs(le),sn=[],nn=[];let At=M;const vt=()=>{const fn=Te-Ae;return 0===pt?M:new p.pointGeometry(H.getx(fn),H.gety(fn))},Yt=()=>al(vt(),At,Oe,hn-pt+1,$,J,ue,Ve.canonical);for(;pt+Tt<=hn;){if(Te+=Ae,Te=N)return null;if(Oe=De,sn.push(De),he&&nn.push(At||vt()),De=G[Te],void 0===De){At=new p.pointGeometry(H.getx(Te),H.gety(Te));const fn=Jt(At,Ve.canonical,$,ue,J);De=fn.signedDistanceFromCamera>0?G[Te]=fn.point:Yt()}else At=null;pt+=Tt,Tt=Oe.dist(De)}ae&&J&&(At=At||new p.pointGeometry(H.getx(Te),H.gety(Te)),G[Te]=De=void 0===G[Te]?De:Yt(),Tt=Oe.dist(De));const Bt=(hn-pt)/Tt,Gn=De.sub(Oe),ii=Gn.mult(Bt)._add(Oe);f&&ii._add(Gn._unit()._perp()._mult(f*Ae));const Pi=ke+Math.atan2(De.y-Oe.y,De.x-Oe.x);return sn.push(ii),he&&(At=At||new p.pointGeometry(H.getx(Te),H.gety(Te)),nn.push(function(fn,Jn,gi){const cr=1-gi;return new p.pointGeometry(fn.x*cr+Jn.x*gi,fn.y*cr+Jn.y*gi)}(nn.length>0?nn[nn.length-1]:At,At,Bt))),{point:ii,angle:Pi,path:sn,tilePath:nn}}const js=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ro(v,l){for(let f=0;f[0,0,0],ke=new p.pointGeometry(f.tileAnchorX,f.tileAnchorY),Te=this.transform.projection.projectTilePoint(f.tileAnchorX,f.tileAnchorY,ae.canonical),De=Ae(ke),Oe=[Te.x+De[0],Te.y+De[1],Te.z+De[2]],pt=this.projectAndGetPerspectiveRatio(L,Oe[0],Oe[1],Oe[2],ae),{perspectiveRatio:Tt}=pt,hn=($?M/Tt:M*Tt)/p.ONE_EM,sn=Zr(new p.pointGeometry(Oe[0],Oe[1]),k,Oe[2]).point,nn=pt.signedDistanceFromCamera>0?Xl(hn,b,f.lineOffsetX*hn,f.lineOffsetY*hn,!1,sn,ke,f,y,k,{},Ve&&!$?Ae:null,$&&!!Ve,this.transform.projection,ae):null;let At=!1,vt=!1,Yt=!0;if(nn&&!pt.aboveHorizon){const Bt=.5*J*Tt+he,Gn=new p.pointGeometry(-100,-100),ii=new p.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),Pi=new hr,fn=nn.first,Jn=nn.last;let gi=[];for(let Ci=fn.path.length-1;Ci>=1;Ci--)gi.push(fn.path[Ci]);for(let Ci=1;Ci{const ci=Ae(ErZr(Ri,N));gi=Ci.some(Ri=>Ri.signedDistanceFromCamera<=0)?[]:Ci.map(Ri=>Ri.point)}let Nr=[];if(gi.length>0){const Ci=gi[0].clone(),Ri=gi[0].clone();for(let Er=1;Er=Gn.x&&Ri.x<=ii.x&&Ci.y>=Gn.y&&Ri.y<=ii.y?[gi]:Ri.xii.x||Ri.yii.y?[]:p.clipLine([gi],Gn.x,Gn.y,ii.x,ii.y)}for(const Ci of Nr){Pi.reset(Ci,.25*Bt);let Ri=0;Ri=Pi.length<=.5*Bt?1:Math.ceil(Pi.paddedLength/cr)+1;for(let Er=0;Er0){p.transformMat4$1(L,L,l);let N=!1;this.fogState&&M&&(N=function(H,$,G,J,he,ae){const ue=ae.calculateFogTileMatrix(he),Ve=[$,G,J];return p.transformMat4(Ve,Ve,ue),je(H,Ve,ae.pitch,ae._fov)}(this.fogState,f,y,b||0,M.toUnwrapped(),this.transform)>.9),k=L[2]>L[3]||N}else V1(L,L,l);return{point:new p.pointGeometry((L[0]/L[3]+1)/2*this.transform.width+Oa,(-L[1]/L[3]+1)/2*this.transform.height+Oa),perspectiveRatio:Math.min(.5+this.transform.cameraToCenterDistance/L[3]*.5,1.5),signedDistanceFromCamera:L[3],aboveHorizon:k}}isOffscreen(l,f,y,b){return y=this.screenRightBoundary||bthis.screenBottomBoundary}isInsideGrid(l,f,y,b){return y>=0&&l=0&&fy.collisionGroupID===f}}return this.collisionGroups[l]}}function en(v,l,f,y,b){const{horizontalAlign:M,verticalAlign:L}=p.getAnchorAlignment(v),k=-(M-.5)*l,N=-(L-.5)*f,H=p.evaluateVariableOffset(v,y);return new p.pointGeometry(k+H[0]*b,N+H[1]*b)}function Gt(v,l,f,y,b){const M=new p.pointGeometry(v,l);return f&&M._rotate(y?b:-b),M}class gn{constructor(l,f,y,b,M){this.transform=l.clone(),this.collisionIndex=new te(this.transform,M),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=f,this.retainedQueryData={},this.collisionGroups=new Pt(y),this.collisionCircleArrays={},this.prevPlacement=b,b&&(b.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(l,f,y,b){const M=y.getBucket(f),L=y.latestFeatureIndex;if(!M||!L||f.id!==M.layerIds[0])return;const k=M.layers[0].layout,N=y.collisionBoxArray,H=Math.pow(2,this.transform.zoom-y.tileID.overscaledZ),$=y.tileSize/p.EXTENT,G=y.tileID.toUnwrapped(),J=this.transform.calculateProjMatrix(G),he="map"===k.get("text-pitch-alignment"),ae="map"===k.get("text-rotation-alignment");f.compileFilter();const ue=f.dynamicFilter(),Ve=f.dynamicFilterNeedsFeature(),le=this.transform.calculatePixelsToTileUnitsMatrix(y),Ae=ds(J,y.tileID.canonical,he,ae,this.transform,le);let ke=null;if(he){const Oe=Fa(J,y.tileID.canonical,he,ae,this.transform,le);ke=p.multiply$1([],this.transform.labelPlaneMatrix,Oe)}let Te=null;ue&&y.latestFeatureIndex&&(Te={unwrappedTileID:G,dynamicFilter:ue,dynamicFilterNeedsFeature:Ve,featureIndex:y.latestFeatureIndex}),this.retainedQueryData[M.bucketInstanceId]=new Be(M.bucketInstanceId,L,M.sourceLayerIndex,M.index,y.tileID);const De={bucket:M,layout:k,posMatrix:J,textLabelPlaneMatrix:Ae,labelToScreenMatrix:ke,clippingData:Te,scale:H,textPixelRatio:$,holdingForFade:y.holdingForFade(),collisionBoxArray:N,partiallyEvaluatedTextSize:p.evaluateSizeForZoom(M.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:p.evaluateSizeForZoom(M.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(M.sourceID)};if(b)for(const Oe of M.sortKeyRanges){const{sortKey:pt,symbolInstanceStart:Tt,symbolInstanceEnd:hn}=Oe;l.push({sortKey:pt,symbolInstanceStart:Tt,symbolInstanceEnd:hn,parameters:De})}else l.push({symbolInstanceStart:0,symbolInstanceEnd:M.symbolInstances.length,parameters:De})}attemptAnchorPlacement(l,f,y,b,M,L,k,N,H,$,G,J,he,ae,ue,Ve,le,Ae){const ke=[J.textOffset0,J.textOffset1],Te=en(l,y,b,ke,M),De=this.collisionIndex.placeCollisionBox(M,f,Gt(Te.x,Te.y,L,k,this.transform.angle),G,N,H,$.predicate);if((!Ve||0!==this.collisionIndex.placeCollisionBox(ae.getSymbolInstanceIconSize(Ae,this.transform.zoom,he),Ve,Gt(Te.x,Te.y,L,k,this.transform.angle),G,N,H,$.predicate).box.length)&&De.box.length>0){let Oe;return this.prevPlacement&&this.prevPlacement.variableOffsets[J.crossTileID]&&this.prevPlacement.placements[J.crossTileID]&&this.prevPlacement.placements[J.crossTileID].text&&(Oe=this.prevPlacement.variableOffsets[J.crossTileID].anchor),this.variableOffsets[J.crossTileID]={textOffset:ke,width:y,height:b,anchor:l,textScale:M,prevAnchor:Oe},this.markUsedJustification(ae,l,J,ue),ae.allowVerticalPlacement&&(this.markUsedOrientation(ae,ue,J),this.placedOrientations[J.crossTileID]=ue),{shift:Te,placedGlyphBoxes:De}}}placeLayerBucketPart(l,f,y,b){const{bucket:M,layout:L,posMatrix:k,textLabelPlaneMatrix:N,labelToScreenMatrix:H,clippingData:$,textPixelRatio:G,holdingForFade:J,collisionBoxArray:he,partiallyEvaluatedTextSize:ae,partiallyEvaluatedIconSize:ue,collisionGroup:Ve}=l.parameters,le=L.get("text-optional"),Ae=L.get("icon-optional"),ke=L.get("text-allow-overlap"),Te=L.get("icon-allow-overlap"),De="map"===L.get("text-rotation-alignment"),Oe="map"===L.get("text-pitch-alignment"),pt="none"!==L.get("icon-text-fit"),Tt="viewport-y"===L.get("symbol-z-order"),hn=ke&&(Te||!M.hasIconData()||Ae),sn=Te&&(ke||!M.hasTextData()||le);!M.collisionArrays&&he&&M.deserializeCollisionBoxes(he),y&&b&&M.updateCollisionDebugBuffers(this.transform.zoom,he);const nn=(At,vt,Yt)=>{if($){const Hi={zoom:this.transform.zoom,pitch:this.transform.pitch};let ui=null;if($.dynamicFilterNeedsFeature){const Oi=this.retainedQueryData[M.bucketInstanceId];ui=$.featureIndex.loadFeature({featureIndex:At.featureIndex,bucketIndex:Oi.bucketIndex,sourceLayerIndex:Oi.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,$.dynamicFilter)(Hi,ui,this.retainedQueryData[M.bucketInstanceId].tileID.canonical,new p.pointGeometry(At.tileAnchorX,At.tileAnchorY),this.transform.calculateDistanceTileData($.unwrappedTileID)))return this.placements[At.crossTileID]=new Ne(!1,!1,!1,!0),void(f[At.crossTileID]=!0)}if(f[At.crossTileID])return;if(J)return void(this.placements[At.crossTileID]=new Ne(!1,!1,!1));let Bt=!1,Gn=!1,ii=!0,Pi=null,fn={box:null,offscreen:null},Jn={box:null,offscreen:null},gi=null,cr=null,Nr=null,Ci=0,Ri=0,Er=0;Yt.textFeatureIndex?Ci=Yt.textFeatureIndex:At.useRuntimeCollisionCircles&&(Ci=At.featureIndex),Yt.verticalTextFeatureIndex&&(Ri=Yt.verticalTextFeatureIndex);const ci=Hi=>{Hi.tileID=this.retainedQueryData[M.bucketInstanceId].tileID,(this.transform.elevation||Hi.elevation)&&(Hi.elevation=this.transform.elevation?this.transform.elevation.getAtTileOffset(this.retainedQueryData[M.bucketInstanceId].tileID,Hi.tileAnchorX,Hi.tileAnchorY):0)},Bo=Yt.textBox;if(Bo){ci(Bo);const Hi=Oi=>{let ts=p.WritingMode.horizontal;if(M.allowVerticalPlacement&&!Oi&&this.prevPlacement){const Xs=this.prevPlacement.placedOrientations[At.crossTileID];Xs&&(this.placedOrientations[At.crossTileID]=Xs,ts=Xs,this.markUsedOrientation(M,ts,At))}return ts},ui=(Oi,ts)=>{if(M.allowVerticalPlacement&&At.numVerticalGlyphVertices>0&&Yt.verticalTextBox){for(const Xs of M.writingModes)if(Xs===p.WritingMode.vertical?(fn=ts(),Jn=fn):fn=Oi(),fn&&fn.box&&fn.box.length)break}else fn=Oi()};if(L.get("text-variable-anchor")){let Oi=L.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[At.crossTileID]){const zr=this.prevPlacement.variableOffsets[At.crossTileID];Oi.indexOf(zr.anchor)>0&&(Oi=Oi.filter(h1=>h1!==zr.anchor),Oi.unshift(zr.anchor))}const ts=(zr,h1,e4)=>{const Ga=M.getSymbolInstanceTextSize(ae,At,this.transform.zoom,vt),z2=(zr.x2-zr.x1)*Ga+2*zr.padding,Xt=(zr.y2-zr.y1)*Ga+2*zr.padding,ei=pt&&!Te?h1:null;ei&&ci(ei);let Zs={box:[],offscreen:!1};const yl=ke?2*Oi.length:Oi.length;for(let rc=0;rc=Oi.length,At,vt,M,e4,ei,ae,ue);if($o&&(Zs=$o.placedGlyphBoxes,Zs&&Zs.box&&Zs.box.length)){Bt=!0,Pi=$o.shift;break}}return Zs};ui(()=>ts(Bo,Yt.iconBox,p.WritingMode.horizontal),()=>{const zr=Yt.verticalTextBox;return zr&&ci(zr),M.allowVerticalPlacement&&!(fn&&fn.box&&fn.box.length)&&At.numVerticalGlyphVertices>0&&zr?ts(zr,Yt.verticalIconBox,p.WritingMode.vertical):{box:null,offscreen:null}}),fn&&(Bt=fn.box,ii=fn.offscreen);const Xs=Hi(fn&&fn.box);if(!Bt&&this.prevPlacement){const zr=this.prevPlacement.variableOffsets[At.crossTileID];zr&&(this.variableOffsets[At.crossTileID]=zr,this.markUsedJustification(M,zr.anchor,At,Xs))}}else{const Oi=(ts,Xs)=>{const zr=M.getSymbolInstanceTextSize(ae,At,this.transform.zoom,vt),h1=this.collisionIndex.placeCollisionBox(zr,ts,new p.pointGeometry(0,0),ke,G,k,Ve.predicate);return h1&&h1.box&&h1.box.length&&(this.markUsedOrientation(M,Xs,At),this.placedOrientations[At.crossTileID]=Xs),h1};ui(()=>Oi(Bo,p.WritingMode.horizontal),()=>{const ts=Yt.verticalTextBox;return M.allowVerticalPlacement&&At.numVerticalGlyphVertices>0&&ts?(ci(ts),Oi(ts,p.WritingMode.vertical)):{box:null,offscreen:null}}),Hi(fn&&fn.box&&fn.box.length)}}if(gi=fn,Bt=gi&&gi.box&&gi.box.length>0,ii=gi&&gi.offscreen,At.useRuntimeCollisionCircles){const Hi=M.text.placedSymbolArray.get(At.centerJustifiedTextSymbolIndex>=0?At.centerJustifiedTextSymbolIndex:At.verticalPlacedTextSymbolIndex),ui=p.evaluateSizeForFeature(M.textSizeData,ae,Hi),Oi=L.get("text-padding");cr=this.collisionIndex.placeCollisionCircles(ke,Hi,M.lineVertexArray,M.glyphOffsetArray,ui,k,N,H,y,Oe,Ve.predicate,At.collisionCircleDiameter*ui/p.ONE_EM,Oi,this.retainedQueryData[M.bucketInstanceId].tileID),Bt=ke||cr.circles.length>0&&!cr.collisionDetected,ii=ii&&cr.offscreen}if(Yt.iconFeatureIndex&&(Er=Yt.iconFeatureIndex),Yt.iconBox){const Hi=ui=>{ci(ui);const Oi=pt&&Pi?Gt(Pi.x,Pi.y,De,Oe,this.transform.angle):new p.pointGeometry(0,0),ts=M.getSymbolInstanceIconSize(ue,this.transform.zoom,vt);return this.collisionIndex.placeCollisionBox(ts,ui,Oi,Te,G,k,Ve.predicate)};Jn&&Jn.box&&Jn.box.length&&Yt.verticalIconBox?(Nr=Hi(Yt.verticalIconBox),Gn=Nr.box.length>0):(Nr=Hi(Yt.iconBox),Gn=Nr.box.length>0),ii=ii&&Nr.offscreen}const ho=le||0===At.numHorizontalGlyphVertices&&0===At.numVerticalGlyphVertices,Uo=Ae||0===At.numIconVertices;if(ho||Uo?Uo?ho||(Gn=Gn&&Bt):Bt=Gn&&Bt:Gn=Bt=Gn&&Bt,Bt&&gi&&gi.box&&this.collisionIndex.insertCollisionBox(gi.box,L.get("text-ignore-placement"),M.bucketInstanceId,Jn&&Jn.box&&Ri?Ri:Ci,Ve.ID),Gn&&Nr&&this.collisionIndex.insertCollisionBox(Nr.box,L.get("icon-ignore-placement"),M.bucketInstanceId,Er,Ve.ID),cr&&(Bt&&this.collisionIndex.insertCollisionCircles(cr.circles,L.get("text-ignore-placement"),M.bucketInstanceId,Ci,Ve.ID),y)){const Hi=M.bucketInstanceId;let ui=this.collisionCircleArrays[Hi];void 0===ui&&(ui=this.collisionCircleArrays[Hi]=new yt);for(let Oi=0;Oi=0;--vt){const Yt=At[vt];nn(M.symbolInstances.get(Yt),Yt,M.collisionArrays[Yt])}}else for(let At=l.symbolInstanceStart;At=0&&(l.text.placedSymbolArray.get(k).crossTileID=M>=0&&k!==M?0:y.crossTileID)}markUsedOrientation(l,f,y){const b=f===p.WritingMode.horizontal||f===p.WritingMode.horizontalOnly?f:0,M=f===p.WritingMode.vertical?f:0,L=[y.leftJustifiedTextSymbolIndex,y.centerJustifiedTextSymbolIndex,y.rightJustifiedTextSymbolIndex];for(const k of L)l.text.placedSymbolArray.get(k).placedOrientation=b;y.verticalPlacedTextSymbolIndex&&(l.text.placedSymbolArray.get(y.verticalPlacedTextSymbolIndex).placedOrientation=M)}commit(l){this.commitTime=l,this.zoomAtLastRecencyCheck=this.transform.zoom;const f=this.prevPlacement;let y=!1;this.prevZoomAdjustment=f?f.zoomAdjustment(this.transform.zoom):0;const b=f?f.symbolFadeChange(l):1,M=f?f.opacities:{},L=f?f.variableOffsets:{},k=f?f.placedOrientations:{};for(const N in this.placements){const H=this.placements[N],$=M[N];$?(this.opacities[N]=new we($,b,H.text,H.icon,null,H.clipped),y=y||H.text!==$.text.placed||H.icon!==$.icon.placed):(this.opacities[N]=new we(null,b,H.text,H.icon,H.skipFade,H.clipped),y=y||H.text||H.icon)}for(const N in M){const H=M[N];if(!this.opacities[N]){const $=new we(H,b,!1,!1);$.isHidden()||(this.opacities[N]=$,y=y||H.text.placed||H.icon.placed)}}for(const N in L)this.variableOffsets[N]||!this.opacities[N]||this.opacities[N].isHidden()||(this.variableOffsets[N]=L[N]);for(const N in k)this.placedOrientations[N]||!this.opacities[N]||this.opacities[N].isHidden()||(this.placedOrientations[N]=k[N]);y?this.lastPlacementChangeTime=l:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=f?f.lastPlacementChangeTime:l)}updateLayerOpacities(l,f){const y={};for(const b of f){const M=b.getBucket(l);M&&b.latestFeatureIndex&&l.id===M.layerIds[0]&&this.updateBucketOpacities(M,y,b.collisionBoxArray)}}updateBucketOpacities(l,f,y){l.hasTextData()&&l.text.opacityVertexArray.clear(),l.hasIconData()&&l.icon.opacityVertexArray.clear(),l.hasIconCollisionBoxData()&&l.iconCollisionBox.collisionVertexArray.clear(),l.hasTextCollisionBoxData()&&l.textCollisionBox.collisionVertexArray.clear();const b=l.layers[0].layout,M=!!l.layers[0].dynamicFilter(),L=new we(null,0,!1,!1,!0),k=b.get("text-allow-overlap"),N=b.get("icon-allow-overlap"),H=b.get("text-variable-anchor"),$="map"===b.get("text-rotation-alignment"),G="map"===b.get("text-pitch-alignment"),J="none"!==b.get("icon-text-fit"),he=new we(null,0,k&&(N||!l.hasIconData()||b.get("icon-optional")),N&&(k||!l.hasTextData()||b.get("text-optional")),!0);!l.collisionArrays&&y&&(l.hasIconCollisionBoxData()||l.hasTextCollisionBoxData())&&l.deserializeCollisionBoxes(y);const ae=(Ve,le,Ae)=>{for(let ke=0;ke0||ke>0,pt=le.numIconVertices>0,Tt=this.placedOrientations[le.crossTileID],hn=Tt===p.WritingMode.vertical,sn=Tt===p.WritingMode.horizontal||Tt===p.WritingMode.horizontalOnly;if(!Oe&&!pt||De.isHidden()||ue++,Oe){const nn=Fc(De.text);ae(l.text,Ae,hn?na:nn),ae(l.text,ke,sn?na:nn);const At=De.text.isHidden();[le.rightJustifiedTextSymbolIndex,le.centerJustifiedTextSymbolIndex,le.leftJustifiedTextSymbolIndex].forEach(Bt=>{Bt>=0&&(l.text.placedSymbolArray.get(Bt).hidden=At||hn?1:0)}),le.verticalPlacedTextSymbolIndex>=0&&(l.text.placedSymbolArray.get(le.verticalPlacedTextSymbolIndex).hidden=At||sn?1:0);const vt=this.variableOffsets[le.crossTileID];vt&&this.markUsedJustification(l,vt.anchor,le,Tt);const Yt=this.placedOrientations[le.crossTileID];Yt&&(this.markUsedJustification(l,"left",le,Yt),this.markUsedOrientation(l,Yt,le))}if(pt){const nn=Fc(De.icon);le.placedIconSymbolIndex>=0&&(ae(l.icon,le.numIconVertices,hn?na:nn),l.icon.placedSymbolArray.get(le.placedIconSymbolIndex).hidden=De.icon.isHidden()),le.verticalPlacedIconSymbolIndex>=0&&(ae(l.icon,le.numVerticalIconVertices,sn?na:nn),l.icon.placedSymbolArray.get(le.verticalPlacedIconSymbolIndex).hidden=De.icon.isHidden())}if(l.hasIconCollisionBoxData()||l.hasTextCollisionBoxData()){const nn=l.collisionArrays[Ve];if(nn){let At=new p.pointGeometry(0,0),vt=!0;if(nn.textBox||nn.verticalTextBox){if(H){const Bt=this.variableOffsets[Te];Bt?(At=en(Bt.anchor,Bt.width,Bt.height,Bt.textOffset,Bt.textScale),$&&At._rotate(G?this.transform.angle:-this.transform.angle)):vt=!1}M&&(vt=!De.clipped),nn.textBox&&Bn(l.textCollisionBox.collisionVertexArray,De.text.placed,!vt||hn,At.x,At.y),nn.verticalTextBox&&Bn(l.textCollisionBox.collisionVertexArray,De.text.placed,!vt||sn,At.x,At.y)}const Yt=vt&&Boolean(!sn&&nn.verticalIconBox);nn.iconBox&&Bn(l.iconCollisionBox.collisionVertexArray,De.icon.placed,Yt,J?At.x:0,J?At.y:0),nn.verticalIconBox&&Bn(l.iconCollisionBox.collisionVertexArray,De.icon.placed,!Yt,J?At.x:0,J?At.y:0)}}}if(l.fullyClipped=0===ue,l.sortFeatures(this.transform.angle),this.retainedQueryData[l.bucketInstanceId]&&(this.retainedQueryData[l.bucketInstanceId].featureSortOrder=l.featureSortOrder),l.hasTextData()&&l.text.opacityVertexBuffer&&l.text.opacityVertexBuffer.updateData(l.text.opacityVertexArray),l.hasIconData()&&l.icon.opacityVertexBuffer&&l.icon.opacityVertexBuffer.updateData(l.icon.opacityVertexArray),l.hasIconCollisionBoxData()&&l.iconCollisionBox.collisionVertexBuffer&&l.iconCollisionBox.collisionVertexBuffer.updateData(l.iconCollisionBox.collisionVertexArray),l.hasTextCollisionBoxData()&&l.textCollisionBox.collisionVertexBuffer&&l.textCollisionBox.collisionVertexBuffer.updateData(l.textCollisionBox.collisionVertexArray),l.bucketInstanceId in this.collisionCircleArrays){const Ve=this.collisionCircleArrays[l.bucketInstanceId];l.placementInvProjMatrix=Ve.invProjMatrix,l.placementViewportMatrix=Ve.viewportMatrix,l.collisionCircleArray=Ve.circles,delete this.collisionCircleArrays[l.bucketInstanceId]}}symbolFadeChange(l){return 0===this.fadeDuration?1:(l-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(l){return Math.max(0,(this.transform.zoom-l)/1.5)}hasTransitions(l){return this.stale||l-this.lastPlacementChangeTimel}setStale(){this.stale=!0}}function Bn(v,l,f,y,b){v.emplaceBack(l?1:0,f?1:0,y||0,b||0),v.emplaceBack(l?1:0,f?1:0,y||0,b||0),v.emplaceBack(l?1:0,f?1:0,y||0,b||0),v.emplaceBack(l?1:0,f?1:0,y||0,b||0)}const it=Math.pow(2,25),Ft=Math.pow(2,24),fs=Math.pow(2,17),ao=Math.pow(2,16),mi=Math.pow(2,9),xs=Math.pow(2,8),ta=Math.pow(2,1);function Fc(v){if(0===v.opacity&&!v.placed)return 0;if(1===v.opacity&&v.placed)return 4294967295;const l=v.placed?1:0,f=Math.floor(127*v.opacity);return f*it+l*Ft+f*fs+l*ao+f*mi+l*xs+f*ta+l}const na=0;class an{constructor(l){this._sortAcrossTiles="viewport-y"!==l.layout.get("symbol-z-order")&&void 0!==l.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(l,f,y,b,M){const L=this._bucketParts;for(;this._currentTileIndexk.sortKey-N.sortKey));this._currentPartIndex{const L=p.exported.now()-b;return!this._forceFullPlacement&&L>2};for(;this._currentPlacementIndex>=0;){const L=f[l[this._currentPlacementIndex]],k=this.placement.collisionIndex.transform.zoom;if("symbol"===L.type&&(!L.minzoom||L.minzoom<=k)&&(!L.maxzoom||L.maxzoom>k)){if(this._inProgressLayer||(this._inProgressLayer=new an(L)),this._inProgressLayer.continuePlacement(y[L.source],this.placement,this._showCollisionBoxes,L,M))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(l){return this.placement.commit(l),this.placement}}const $i=512/p.EXTENT/2;class ia{constructor(l,f,y){this.tileID=l,this.indexedSymbolInstances={},this.bucketInstanceId=y;for(let b=0;bl.overscaledZ)for(const k in L){const N=L[k];N.tileID.isChildOf(l)&&N.findMatches(f.symbolInstances,l,b)}else{const k=L[l.scaledTo(Number(M)).key];k&&k.findMatches(f.symbolInstances,l,b)}}for(let M=0;M{f[y]=!0});for(const y in this.layerIndexes)f[y]||delete this.layerIndexes[y]}}const e2=(v,l)=>p.emitValidationErrors(v,l&&l.filter(f=>"source.canvas"!==f.identifier)),Oc=p.pick(jt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),i1=p.pick(jt,["setCenter","setZoom","setBearing","setPitch"]),Sr=function(){const v={},l=p.spec.$version;for(const f in p.spec.$root){const y=p.spec.$root[f];if(y.required){let b=null;b="version"===f?l:"array"===y.type?[]:{},null!=b&&(v[f]=b)}}return v}(),R3={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class ya extends p.Evented{constructor(l,f={}){super(),this.map=l,this.dispatcher=new lt(He(),this),this.imageManager=new _t,this.imageManager.setEventedParent(this),this.glyphManager=new p.GlyphManager(l._requestManager,f.localFontFamily?p.LocalGlyphMode.all:f.localIdeographFontFamily?p.LocalGlyphMode.ideographs:p.LocalGlyphMode.none,f.localFontFamily||f.localIdeographFontFamily),this.lineAtlas=new p.LineAtlas(256,512),this.crossTileSymbolIndex=new Yl,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this.zoomHistory=new p.ZoomHistory,this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",p.getReferrer());const y=this;this._rtlTextPluginCallback=ya.registerForPluginStateChange(b=>{y.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:b.pluginStatus,pluginURL:b.pluginURL},(M,L)=>{if(p.triggerPluginCompletionEvent(M),L&&L.every(k=>k))for(const k in y._sourceCaches){const N=y._sourceCaches[k],H=N.getSource().type;"vector"!==H&&"geojson"!==H||N.reload()}})}),this.on("data",b=>{if("source"!==b.dataType||"metadata"!==b.sourceDataType)return;const M=this.getSource(b.sourceId);if(M&&M.vectorLayerIds)for(const L in this._layers){const k=this._layers[L];k.source===M.id&&this._validateLayer(k)}})}loadURL(l,f={}){this.fire(new p.Event("dataloading",{dataType:"style"}));const y="boolean"==typeof f.validate?f.validate:!p.isMapboxURL(l);l=this.map._requestManager.normalizeStyleURL(l,f.accessToken);const b=this.map._requestManager.transformRequest(l,p.ResourceType.Style);this._request=p.getJSON(b,(M,L)=>{this._request=null,M?this.fire(new p.ErrorEvent(M)):L&&this._load(L,y)})}loadJSON(l,f={}){this.fire(new p.Event("dataloading",{dataType:"style"})),this._request=p.exported.frame(()=>{this._request=null,this._load(l,!1!==f.validate)})}loadEmpty(){this.fire(new p.Event("dataloading",{dataType:"style"})),this._load(Sr,!1)}_updateLayerCount(l,f){const y=f?1:-1;l.is3D()&&(this._num3DLayers+=y),"circle"===l.type&&(this._numCircleLayers+=y),"symbol"===l.type&&(this._numSymbolLayers+=y)}_load(l,f){if(f&&e2(this,p.validateStyle(l)))return;this._loaded=!0,this.stylesheet=l,this.updateProjection();for(const b in l.sources)this.addSource(b,l.sources[b],{validate:!1});this._changed=!1,l.sprite?this._loadSprite(l.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(l.glyphs);const y=Nt(this.stylesheet.layers);this._order=y.map(b=>b.id),this._layers={},this._serializedLayers={};for(let b of y)b=p.createStyleLayer(b),b.setEventedParent(this,{layer:{id:b.id}}),this._layers[b.id]=b,this._serializedLayers[b.id]=b.serialize(),this._updateLayerCount(b,!0);this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new ge(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new p.Event("data",{dataType:"style"})),this.fire(new p.Event("style.load"))}terrainSetForDrapingOnly(){return this.terrain&&0===this.terrain.drapeRenderMode}setProjection(l){l?this.stylesheet.projection=l:delete this.stylesheet.projection,this.updateProjection()}updateProjection(){const l=this.map.transform.projection,f=this.map.transform.setProjection(this.map._runtimeProjection||(this.stylesheet?this.stylesheet.projection:void 0)),y=this.map.transform.projection;if(this._loaded&&(y.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null)),this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),f){if(y.isReprojectedInTileSpace||l.isReprojectedInTileSpace){this.map.painter.clearBackgroundTiles();for(const b in this._sourceCaches)this._sourceCaches[b].clearTiles()}else this._forceSymbolLayerUpdate();this.map._update(!0)}}_loadSprite(l){this._spriteRequest=function(f,y,b){let M,L,k;const N=p.exported.devicePixelRatio>1?"@2x":"";let H=p.getJSON(y.transformRequest(y.normalizeSpriteURL(f,N,".json"),p.ResourceType.SpriteJSON),(J,he)=>{H=null,k||(k=J,M=he,G())}),$=p.getImage(y.transformRequest(y.normalizeSpriteURL(f,N,".png"),p.ResourceType.SpriteImage),(J,he)=>{$=null,k||(k=J,L=he,G())});function G(){if(k)b(k);else if(M&&L){const J=p.exported.getImageData(L),he={};for(const ae in M){const{width:ue,height:Ve,x:le,y:Ae,sdf:ke,pixelRatio:Te,stretchX:De,stretchY:Oe,content:pt}=M[ae],Tt=new p.RGBAImage({width:ue,height:Ve});p.RGBAImage.copy(J,Tt,{x:le,y:Ae},{x:0,y:0},{width:ue,height:Ve}),he[ae]={data:Tt,pixelRatio:Te,sdf:ke,stretchX:De,stretchY:Oe,content:pt}}b(null,he)}}return{cancel(){H&&(H.cancel(),H=null),$&&($.cancel(),$=null)}}}(l,this.map._requestManager,(f,y)=>{if(this._spriteRequest=null,f)this.fire(new p.ErrorEvent(f));else if(y)for(const b in y)this.imageManager.addImage(b,y[b]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new p.Event("data",{dataType:"style"}))})}_validateLayer(l){const f=this.getSource(l.source);if(!f)return;const y=l.sourceLayer;y&&("geojson"===f.type||f.vectorLayerIds&&-1===f.vectorLayerIds.indexOf(y))&&this.fire(new p.ErrorEvent(new Error(`Source layer "${y}" does not exist on source "${f.id}" as specified by style layer "${l.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const l in this._sourceCaches)if(!this._sourceCaches[l].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(l){const f=[];for(const y of l){const b=this._layers[y];"custom"!==b.type&&f.push(b.serialize())}return f}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const l in this._sourceCaches)if(this._sourceCaches[l].hasTransition())return!0;for(const l in this._layers)if(this._layers[l].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(l){return!!this.terrain&&R3[l.type]}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(l){if(!this._loaded)return;const f=this._changed;if(this._changed){const b=Object.keys(this._updatedLayers),M=Object.keys(this._removedLayers);(b.length||M.length)&&this._updateWorkerLayers(b,M);for(const L in this._updatedSources){const k=this._updatedSources[L];"reload"===k?this._reloadSource(L):"clear"===k&&this._clearSource(L)}this._updateTilesForChangedImages();for(const L in this._updatedPaintProps)this._layers[L].updateTransitions(l);this.light.updateTransitions(l),this.fog&&this.fog.updateTransitions(l),this._resetUpdates()}const y={};for(const b in this._sourceCaches){const M=this._sourceCaches[b];y[b]=M.used,M.used=!1}for(const b of this._order){const M=this._layers[b];if(M.recalculate(l,this._availableImages),!M.isHidden(l.zoom)){const k=this._getLayerSourceCache(M);k&&(k.used=!0)}const L=this.map.painter;if(L){const k=M.getProgramIds();if(!k)continue;const N=M.getProgramConfiguration(l.zoom);for(const H of k)L.useProgram(H,N)}}for(const b in y){const M=this._sourceCaches[b];y[b]!==M.used&&M.getSource().fire(new p.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:M.getSource().id}))}this.light.recalculate(l),this.terrain&&this.terrain.recalculate(l),this.fog&&this.fog.recalculate(l),this.z=l.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),f&&this.fire(new p.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const l=Object.keys(this._changedImages);if(l.length){for(const f in this._sourceCaches)this._sourceCaches[f].reloadTilesForDependencies(["icons","patterns"],l);this._changedImages={}}}_updateWorkerLayers(l,f){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(l),removedIds:f})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(l){if(this._checkLoaded(),e2(this,p.validateStyle(l)))return!1;(l=p.clone$1(l)).layers=Nt(l.layers);const f=function(b,M){if(!b)return[{command:jt.setStyle,args:[M]}];let L=[];try{if(!re(b.version,M.version))return[{command:jt.setStyle,args:[M]}];re(b.center,M.center)||L.push({command:jt.setCenter,args:[M.center]}),re(b.zoom,M.zoom)||L.push({command:jt.setZoom,args:[M.zoom]}),re(b.bearing,M.bearing)||L.push({command:jt.setBearing,args:[M.bearing]}),re(b.pitch,M.pitch)||L.push({command:jt.setPitch,args:[M.pitch]}),re(b.sprite,M.sprite)||L.push({command:jt.setSprite,args:[M.sprite]}),re(b.glyphs,M.glyphs)||L.push({command:jt.setGlyphs,args:[M.glyphs]}),re(b.transition,M.transition)||L.push({command:jt.setTransition,args:[M.transition]}),re(b.light,M.light)||L.push({command:jt.setLight,args:[M.light]}),re(b.fog,M.fog)||L.push({command:jt.setFog,args:[M.fog]}),re(b.projection,M.projection)||L.push({command:jt.setProjection,args:[M.projection]});const k={},N=[];!function(G,J,he,ae){let ue;for(ue in J=J||{},G=G||{})G.hasOwnProperty(ue)&&(J.hasOwnProperty(ue)||bn(ue,he,ae));for(ue in J)J.hasOwnProperty(ue)&&(G.hasOwnProperty(ue)?re(G[ue],J[ue])||("geojson"===G[ue].type&&"geojson"===J[ue].type&&Un(G,J,ue)?he.push({command:jt.setGeoJSONSourceData,args:[ue,J[ue].data]}):Zn(ue,J,he,ae)):Zt(ue,J,he))}(b.sources,M.sources,N,k);const H=[];b.layers&&b.layers.forEach(G=>{k[G.source]?L.push({command:jt.removeLayer,args:[G.id]}):H.push(G)});let $=b.terrain;$&&k[$.source]&&(L.push({command:jt.setTerrain,args:[void 0]}),$=void 0),L=L.concat(N),re($,M.terrain)||L.push({command:jt.setTerrain,args:[M.terrain]}),function(G,J,he){J=J||[];const ae=(G=G||[]).map(pi),ue=J.map(pi),Ve=G.reduce(Mr,{}),le=J.reduce(Mr,{}),Ae=ae.slice(),ke=Object.create(null);let Te,De,Oe,pt,Tt,hn,sn;for(Te=0,De=0;Te!(b.command in i1));if(0===f.length)return!1;const y=f.filter(b=>!(b.command in Oc));if(y.length>0)throw new Error(`Unimplemented: ${y.map(b=>b.command).join(", ")}.`);return f.forEach(b=>{"setTransition"!==b.command&&this[b.command].apply(this,b.args)}),this.stylesheet=l,this.updateProjection(),!0}addImage(l,f){if(this.getImage(l))return this.fire(new p.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(l,f),this._afterImageUpdated(l)}updateImage(l,f){this.imageManager.updateImage(l,f)}getImage(l){return this.imageManager.getImage(l)}removeImage(l){if(!this.getImage(l))return this.fire(new p.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(l),this._afterImageUpdated(l)}_afterImageUpdated(l){this._availableImages=this.imageManager.listImages(),this._changedImages[l]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new p.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(l,f,y={}){if(this._checkLoaded(),void 0!==this.getSource(l))throw new Error("There is already a source with this ID");if(!f.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(f).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(f.type)>=0&&this._validate(p.validateStyle.source,`sources.${l}`,f,null,y))return;this.map&&this.map._collectResourceTiming&&(f.collectResourceTiming=!0);const b=Xr(l,f,this.dispatcher,this);b.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:b.serialize(),sourceId:l}));const M=L=>{const k=(L?"symbol:":"other:")+l,N=this._sourceCaches[k]=new p.SourceCache(k,b,L);(L?this._symbolSourceCaches:this._otherSourceCaches)[l]=N,N.style=this,N.onAdd(this.map)};M(!1),"vector"!==f.type&&"geojson"!==f.type||M(!0),b.onAdd&&b.onAdd(this.map),this._changed=!0}removeSource(l){this._checkLoaded();const f=this.getSource(l);if(void 0===f)throw new Error("There is no source with this ID");for(const b in this._layers)if(this._layers[b].source===l)return this.fire(new p.ErrorEvent(new Error(`Source "${l}" cannot be removed while layer "${b}" is using it.`)));if(this.terrain&&this.terrain.get().source===l)return this.fire(new p.ErrorEvent(new Error(`Source "${l}" cannot be removed while terrain is using it.`)));const y=this._getSourceCaches(l);for(const b of y)delete this._sourceCaches[b.id],delete this._updatedSources[b.id],b.fire(new p.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:b.getSource().id})),b.setEventedParent(null),b.clearTiles();delete this._otherSourceCaches[l],delete this._symbolSourceCaches[l],f.setEventedParent(null),f.onRemove&&f.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(l,f){this._checkLoaded(),this.getSource(l).setData(f),this._changed=!0}getSource(l){const f=this._getSourceCache(l);return f&&f.getSource()}addLayer(l,f,y={}){this._checkLoaded();const b=l.id;if(this.getLayer(b))return void this.fire(new p.ErrorEvent(new Error(`Layer with id "${b}" already exists on this map`)));let M;if("custom"===l.type){if(e2(this,p.validateCustomStyleLayer(l)))return;M=p.createStyleLayer(l)}else{if("object"==typeof l.source&&(this.addSource(b,l.source),l=p.clone$1(l),l=p.extend(l,{source:b})),this._validate(p.validateStyle.layer,`layers.${b}`,l,{arrayIndex:-1},y))return;M=p.createStyleLayer(l),this._validateLayer(M),M.setEventedParent(this,{layer:{id:b}}),this._serializedLayers[M.id]=M.serialize(),this._updateLayerCount(M,!0)}const L=f?this._order.indexOf(f):this._order.length;if(f&&-1===L)return void this.fire(new p.ErrorEvent(new Error(`Layer with id "${f}" does not exist on this map.`)));this._order.splice(L,0,b),this._layerOrderChanged=!0,this._layers[b]=M;const k=this._getLayerSourceCache(M);if(this._removedLayers[b]&&M.source&&k&&"custom"!==M.type){const N=this._removedLayers[b];delete this._removedLayers[b],N.type!==M.type?this._updatedSources[M.source]="clear":(this._updatedSources[M.source]="reload",k.pause())}this._updateLayer(M),M.onAdd&&M.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(l,f){if(this._checkLoaded(),this._changed=!0,!this._layers[l])return void this.fire(new p.ErrorEvent(new Error(`The layer '${l}' does not exist in the map's style and cannot be moved.`)));if(l===f)return;const y=this._order.indexOf(l);this._order.splice(y,1);const b=f?this._order.indexOf(f):this._order.length;f&&-1===b?this.fire(new p.ErrorEvent(new Error(`Layer with id "${f}" does not exist on this map.`))):(this._order.splice(b,0,l),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(l){this._checkLoaded();const f=this._layers[l];if(!f)return void this.fire(new p.ErrorEvent(new Error(`The layer '${l}' does not exist in the map's style and cannot be removed.`)));f.setEventedParent(null),this._updateLayerCount(f,!1);const y=this._order.indexOf(l);this._order.splice(y,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[l]=f,delete this._layers[l],delete this._serializedLayers[l],delete this._updatedLayers[l],delete this._updatedPaintProps[l],f.onRemove&&f.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(l){return this._layers[l]}hasLayer(l){return l in this._layers}hasLayerType(l){for(const f in this._layers)if(this._layers[f].type===l)return!0;return!1}setLayerZoomRange(l,f,y){this._checkLoaded();const b=this.getLayer(l);b?b.minzoom===f&&b.maxzoom===y||(null!=f&&(b.minzoom=f),null!=y&&(b.maxzoom=y),this._updateLayer(b)):this.fire(new p.ErrorEvent(new Error(`The layer '${l}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(l,f,y={}){this._checkLoaded();const b=this.getLayer(l);if(b){if(!re(b.filter,f))return null==f?(b.filter=void 0,void this._updateLayer(b)):void(this._validate(p.validateStyle.filter,`layers.${b.id}.filter`,f,{layerType:b.type},y)||(b.filter=p.clone$1(f),this._updateLayer(b)))}else this.fire(new p.ErrorEvent(new Error(`The layer '${l}' does not exist in the map's style and cannot be filtered.`)))}getFilter(l){return p.clone$1(this.getLayer(l).filter)}setLayoutProperty(l,f,y,b={}){this._checkLoaded();const M=this.getLayer(l);M?re(M.getLayoutProperty(f),y)||(M.setLayoutProperty(f,y,b),this._updateLayer(M)):this.fire(new p.ErrorEvent(new Error(`The layer '${l}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(l,f){const y=this.getLayer(l);if(y)return y.getLayoutProperty(f);this.fire(new p.ErrorEvent(new Error(`The layer '${l}' does not exist in the map's style.`)))}setPaintProperty(l,f,y,b={}){this._checkLoaded();const M=this.getLayer(l);M?re(M.getPaintProperty(f),y)||(M.setPaintProperty(f,y,b)&&this._updateLayer(M),this._changed=!0,this._updatedPaintProps[l]=!0):this.fire(new p.ErrorEvent(new Error(`The layer '${l}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(l,f){return this.getLayer(l).getPaintProperty(f)}setFeatureState(l,f){this._checkLoaded();const y=l.source,b=l.sourceLayer,M=this.getSource(y);if(void 0===M)return void this.fire(new p.ErrorEvent(new Error(`The source '${y}' does not exist in the map's style.`)));const L=M.type;if("geojson"===L&&b)return void this.fire(new p.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===L&&!b)return void this.fire(new p.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===l.id&&this.fire(new p.ErrorEvent(new Error("The feature id parameter must be provided.")));const k=this._getSourceCaches(y);for(const N of k)N.setFeatureState(b,l.id,f)}removeFeatureState(l,f){this._checkLoaded();const y=l.source,b=this.getSource(y);if(void 0===b)return void this.fire(new p.ErrorEvent(new Error(`The source '${y}' does not exist in the map's style.`)));const M=b.type,L="vector"===M?l.sourceLayer:void 0;if("vector"===M&&!L)return void this.fire(new p.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(f&&"string"!=typeof l.id&&"number"!=typeof l.id)return void this.fire(new p.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const k=this._getSourceCaches(y);for(const N of k)N.removeFeatureState(L,l.id,f)}getFeatureState(l){this._checkLoaded();const f=l.source,y=l.sourceLayer,b=this.getSource(f);if(void 0!==b){if("vector"!==b.type||y)return void 0===l.id&&this.fire(new p.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(f)[0].getFeatureState(y,l.id);this.fire(new p.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new p.ErrorEvent(new Error(`The source '${f}' does not exist in the map's style.`)))}getTransition(){return p.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const l={};for(const f in this._sourceCaches){const y=this._sourceCaches[f].getSource();l[y.id]||(l[y.id]=y.serialize())}return p.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.stylesheet.terrain,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:l,layers:this._serializeLayers(this._order)},f=>void 0!==f)}_updateLayer(l){this._updatedLayers[l.id]=!0;const f=this._getLayerSourceCache(l);l.source&&!this._updatedSources[l.source]&&f&&"raster"!==f.getSource().type&&(this._updatedSources[l.source]="reload",f.pause()),this._changed=!0,l.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(l){const f=L=>"fill-extrusion"===this._layers[L].type,y={},b=[];for(let L=this._order.length-1;L>=0;L--){const k=this._order[L];if(f(k)){y[k]=L;for(const N of l){const H=N[k];if(H)for(const $ of H)b.push($)}}}b.sort((L,k)=>k.intersectionZ-L.intersectionZ);const M=[];for(let L=this._order.length-1;L>=0;L--){const k=this._order[L];if(f(k))for(let N=b.length-1;N>=0;N--){const H=b[N].feature;if(y[H.layer.id]{const H=this.getLayer(N);return H&&H.is3D()}):this.has3DLayers(),k=Q1.createFromScreenPoints(l,y);for(const N in this._sourceCaches){const H=this._sourceCaches[N].getSource().id;f.layers&&!b[H]||M.push(R(this._sourceCaches[N],this._layers,this._serializedLayers,k,f,y,L,!!this.map._showQueryGeometry))}return this.placement&&M.push(function(N,H,$,G,J,he,ae){const ue={},Ve=he.queryRenderedSymbols(G),le=[];for(const Ae of Object.keys(Ve).map(Number))le.push(ae[Ae]);le.sort(me);for(const Ae of le){const ke=Ae.featureIndex.lookupSymbolFeatures(Ve[Ae.bucketInstanceId],H,Ae.bucketIndex,Ae.sourceLayerIndex,J.filter,J.layers,J.availableImages,N);for(const Te in ke){const De=ue[Te]=ue[Te]||[],Oe=ke[Te];Oe.sort((pt,Tt)=>{const hn=Ae.featureSortOrder;if(hn){const sn=hn.indexOf(pt.featureIndex);return hn.indexOf(Tt.featureIndex)-sn}return Tt.featureIndex-pt.featureIndex});for(const pt of Oe)De.push(pt)}}for(const Ae in ue)ue[Ae].forEach(ke=>{const Te=ke.feature,De=$(N[Ae]).getFeatureState(Te.layer["source-layer"],Te.id);Te.source=Te.layer.source,Te.layer["source-layer"]&&(Te.sourceLayer=Te.layer["source-layer"]),Te.state=De});return ue}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),k.screenGeometry,f,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(M)}querySourceFeatures(l,f){f&&f.filter&&this._validate(p.validateStyle.filter,"querySourceFeatures.filter",f.filter,null,f);const y=this._getSourceCaches(l);let b=[];for(const M of y)b=b.concat(Y(M,f));return b}addSourceType(l,f,y){return ya.getSourceType(l)?y(new Error(`A source type called "${l}" already exists.`)):(ya.setSourceType(l,f),f.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:l,url:f.workerSourceURL},y):y(null,null))}getLight(){return this.light.getLight()}setLight(l,f={}){this._checkLoaded();const y=this.light.getLight();let b=!1;for(const L in l)if(!re(l[L],y[L])){b=!0;break}if(!b)return;const M={now:p.exported.now(),transition:p.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(l,f),this.light.updateTransitions(M)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(l,f=1){if(this._checkLoaded(),!l)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);if(1===f){if("object"==typeof l.source){const y="terrain-dem-src";this.addSource(y,l.source),l=p.clone$1(l),l=p.extend(l,{source:y})}if(this._validate(p.validateStyle.terrain,"terrain",l))return}if(!this.terrain||this.terrain&&f!==this.terrain.drapeRenderMode)this._createTerrain(l,f);else{const y=this.terrain,b=y.get();for(const M in l)if(!re(l[M],b[M])){y.set(l),this.stylesheet.terrain=l;const L={now:p.exported.now(),transition:p.extend({duration:0},this.stylesheet.transition)};y.updateTransitions(L);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(l){const f=this.fog=new ut(l,this.map.transform);this.stylesheet.fog=l;const y={now:p.exported.now(),transition:p.extend({duration:0},this.stylesheet.transition)};f.updateTransitions(y)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask(()=>{for(const l of this.map._markers)l._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(l){if(this._checkLoaded(),!l)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const f=this.fog,y=f.get();for(const b in l)if(!re(l[b],y[b])){f.set(l),this.stylesheet.fog=l;const M={now:p.exported.now(),transition:p.extend({duration:0},this.stylesheet.transition)};f.updateTransitions(M);break}}else this._createFog(l);this._markersNeedUpdate=!0}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const l=this._order.filter(y=>this.isLayerDraped(this._layers[y])),f=this._order.filter(y=>!this.isLayerDraped(this._layers[y]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...l),this._drapedFirstOrder.push(...f)}_createTerrain(l,f){const y=this.terrain=new q(l,f);this.stylesheet.terrain=l,this.dispatcher.broadcast("enableTerrain",!0),this._force3DLayerUpdate();const b={now:p.exported.now(),transition:p.extend({duration:0},this.stylesheet.transition)};y.updateTransitions(b)}_force3DLayerUpdate(){for(const l in this._layers){const f=this._layers[l];"fill-extrusion"===f.type&&this._updateLayer(f)}}_forceSymbolLayerUpdate(){for(const l in this._layers){const f=this._layers[l];"symbol"===f.type&&this._updateLayer(f)}}_validate(l,f,y,b,M={}){return(!M||!1!==M.validate)&&e2(this,l.call(p.validateStyle,p.extend({key:f,style:this.serialize(),value:y,styleSpec:p.spec},b)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),p.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const l in this._layers)this._layers[l].setEventedParent(null);for(const l in this._sourceCaches)this._sourceCaches[l].clearTiles(),this._sourceCaches[l].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(l){const f=this._getSourceCaches(l);for(const y of f)y.clearTiles()}_reloadSource(l){const f=this._getSourceCaches(l);for(const y of f)y.resume(),y.reload()}_updateSources(l){for(const f in this._sourceCaches)this._sourceCaches[f].update(l)}_generateCollisionBoxes(){for(const l in this._sourceCaches){const f=this._sourceCaches[l];f.resume(),f.reload()}}_updatePlacement(l,f,y,b,M=!1){let L=!1,k=!1;const N={};for(const H of this._order){const $=this._layers[H];if("symbol"!==$.type)continue;if(!N[$.source]){const J=this._getLayerSourceCache($);if(!J)continue;N[$.source]=J.getRenderableIds(!0).map(he=>J.getTileByID(he)).sort((he,ae)=>ae.tileID.overscaledZ-he.tileID.overscaledZ||(he.tileID.isLessThan(ae.tileID)?-1:1))}const G=this.crossTileSymbolIndex.addLayer($,N[$.source],l.center.lng,l.projection);L=L||G}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),M=M||this._layerOrderChanged||0===y,this._layerOrderChanged&&this.fire(new p.Event("neworder")),(M||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(p.exported.now(),l.zoom))&&(this.pauseablePlacement=new er(l,this._order,M,f,y,b,this.placement,this.fog&&l.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,N),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(p.exported.now()),k=!0),L&&this.pauseablePlacement.placement.setStale()),k||L)for(const H of this._order){const $=this._layers[H];"symbol"===$.type&&this.placement.updateLayerOpacities($,N[$.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(p.exported.now())}_releaseSymbolFadeTiles(){for(const l in this._sourceCaches)this._sourceCaches[l].releaseSymbolFadeTiles()}getImages(l,f,y){this.imageManager.getImages(f.icons,y),this._updateTilesForChangedImages();const b=M=>{M&&M.setDependencies(f.tileID.key,f.type,f.icons)};b(this._otherSourceCaches[f.source]),b(this._symbolSourceCaches[f.source])}getGlyphs(l,f,y){this.glyphManager.getGlyphs(f.stacks,y)}getResource(l,f,y){return p.makeRequest(f,y)}_getSourceCache(l){return this._otherSourceCaches[l]}_getLayerSourceCache(l){return"symbol"===l.type?this._symbolSourceCaches[l.source]:this._otherSourceCaches[l.source]}_getSourceCaches(l){const f=[];return this._otherSourceCaches[l]&&f.push(this._otherSourceCaches[l]),this._symbolSourceCaches[l]&&f.push(this._symbolSourceCaches[l]),f}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}ya.getSourceType=function(v){return No[v]},ya.setSourceType=function(v,l){No[v]=l},ya.registerForPluginStateChange=p.registerForPluginStateChange;var ht="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#define EXTENT 8192.0\n#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}\n#endif",Nc="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}";let Kl={},Ql={};Kl=wi("","\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\n#ifdef TERRAIN\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;\n#else\nuniform sampler2D u_dem;uniform sampler2D u_dem_prev;\n#endif\nuniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos));\n#ifdef TERRAIN_DEM_NEAREST_FILTER\nreturn u_exaggeration*tl;\n#endif\nfloat tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {return currentElevation(apos);}\n#endif\nfloat unpack_depth(vec4 rgba_depth)\n{const vec4 bit_shift=vec4(1.0/(256.0*256.0*256.0),1.0/(256.0*256.0),1.0/256.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(\nunpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))\n);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nfloat tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a;\n#else\nvec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack);\n#endif\nreturn vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;vec4 bounds=vec4(d,vec2(1.0)-d);h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }\n#endif",!0),Ql=wi("#ifdef FOG\nuniform float u_fog_temporal_offset;float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif","#ifdef FOG\nuniform mat4 u_fog_matrix;vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",!0);const nr=wi("\nhighp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}\n#ifdef TERRAIN\nhighp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(256.0*256.0*256.0,256.0*256.0,256.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/256.0,1.0/256.0,1.0/256.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\n#endif","\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#if defined(PROJECTION_GLOBE_VIEW) && !defined(PROJECTED_POS_ON_VIEWPORT)\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {\n#if defined(PROJECTION_GLOBE_VIEW) && !defined(PROJECTED_POS_ON_VIEWPORT)\nreturn mix(globe,mercator,t);\n#else\nreturn globe;\n#endif\n}\n#ifdef PROJECTION_GLOBE_VIEW\nmat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered."),Xi=ht;var _h={background:wi("uniform vec4 u_color;uniform float u_opacity;void main() {vec4 out_color=u_color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),backgroundPattern:wi("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 out_color=mix(color1,color2,u_mix);\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),circle:wi("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\ngl_FragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;attribute float a_scale;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);\n#ifdef PROJECTION_GLOBE_VIEW\nvec2 scaled_extrude=extrude*a_scale;vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=scaled_extrude.x*surface_vectors[0]+scaled_extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);vec4 world_center=vec4(pos,1);\n#else \nmat3 surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);vec4 world_center=vec4(circle_center,height,1);\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\n#if defined(SCALE_WITH_MAP) && defined(PROJECTION_GLOBE_VIEW)\nview_scale*=a_scale;\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);vec4 occlusion_world_center=vec4(circle_center,cantilevered_height,1);vec4 occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nvec4 occlusion_world_center=world_center;vec4 occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}"),clippingMask:wi("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:wi("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\ngl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;attribute float a_scale;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);\n#ifdef PROJECTION_GLOBE_VIEW\nextrude*=a_scale;vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\nvec3 pos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),heatmapTexture:wi("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:wi("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}","attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:wi("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos_2f;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:wi("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;\n#endif\nvarying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}"),fill:wi("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutline:wi("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutlinePattern:wi("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=mix(color1,color2,u_fade);\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillPattern:wi("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 out_color=mix(color1,color2,u_fade);\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillExtrusion:wi("varying vec4 v_color;void main() {vec4 color=v_color;\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;float ele=elevation(pos_nx.xy);float c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);vec3 pos=vec3(pos_nx.xy,h);\n#else\nvec3 pos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(pos.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=(\n(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.rgb+=clamp(color.rgb*directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),fillExtrusionPattern:wi("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 out_color=mix(color1,color2,u_fade);out_color=out_color*v_lighting;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;float ele=elevation(pos_nx.xy);float c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);vec3 p=vec3(pos_nx.xy,h);\n#else\nvec3 p=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos_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,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*=(\n(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;\n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}"),hillshadePrepare:wi("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nreturn texture2D(u_image,coord).a/4.0;\n#else\nvec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;\n#endif\n}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos);float f=getElevation(v_pos+vec2(epsilon.x,0));float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float h=getElevation(v_pos+vec2(0,epsilon.y));float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:wi("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef FOG\ngl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),line:wi("uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;uniform float u_mix;uniform vec3 u_scale;varying vec2 v_tex_a;varying vec2 v_tex_b;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;varying highp vec2 v_uv;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash_from\n#pragma mapbox: define lowp vec4 dash_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash_from\n#pragma mapbox: initialize lowp vec4 dash_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist_a=texture2D(u_dash_image,v_tex_a).a;float sdfdist_b=texture2D(u_dash_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfwidth=min(dash_from.z*u_scale.y,dash_to.z*u_scale.z);float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/sdfwidth;alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\n#endif\n#ifdef RENDER_LINE_GRADIENT\nvec4 out_color=texture2D(u_gradient_image,v_uv);\n#else\nvec4 out_color=color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef RENDER_LINE_ALPHA_DISCARD\nif (alpha < u_alpha_discard_threshold) {discard;}\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define EXTRUDE_SCALE 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;\n#ifdef RENDER_LINE_GRADIENT\nattribute vec3 a_packed;\n#else\nattribute float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform mediump vec3 u_scale;varying vec2 v_tex_a;varying vec2 v_tex_b;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;varying highp vec2 v_uv;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash_from\n#pragma mapbox: define lowp vec4 dash_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash_from\n#pragma mapbox: initialize lowp vec4 dash_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nfloat a_uv_x=a_packed[0];float a_split_index=a_packed[1];float a_linesofar=a_packed[2];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);\n#endif\n#ifdef RENDER_LINE_DASH\nfloat tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;float scaleA=dash_from.z==0.0 ? 0.0 : tileZoomRatio/(dash_from.z*fromScale);float scaleB=dash_to.z==0.0 ? 0.0 : tileZoomRatio/(dash_to.z*toScale);float heightA=dash_from.y;float heightB=dash_to.y;v_tex_a=vec2(a_linesofar*scaleA/floorwidth,(-normal.y*heightA+dash_from.x+0.5)/u_texsize.y);v_tex_b=vec2(a_linesofar*scaleB/floorwidth,(-normal.y*heightB+dash_to.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),linePattern:wi("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),raster:wi("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef FOG\nout_color=fog_dither(fog_apply(out_color,v_fog_pos));\n#endif\ngl_FragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),symbolIcon:wi("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_z_tile_anchor;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}float anchorZ=a_z_tile_anchor.x;vec2 tileAnchor=a_z_tile_anchor.yz;vec3 h=elevationVector(tileAnchor)*elevation(tileAnchor);vec3 mercator_pos=mercator_tile_position(u_inv_rot_matrix,tileAnchor,u_tile_id,u_merc_center);vec3 world_pos=mix_globe_mercator(vec3(a_pos,anchorZ)+h,mercator_pos,u_zoom_transition);vec4 projectedPoint=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),anchorZ,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec3 proj_pos=mix_globe_mercator(vec3(a_projected_pos.xy,anchorZ),mercator_pos,u_zoom_transition);\n#ifdef PROJECTED_POS_ON_VIEWPORT\nvec4 projected_pos=u_label_plane_matrix*vec4(proj_pos.xy,0.0,1.0);\n#else\nvec4 projected_pos=u_label_plane_matrix*vec4(proj_pos.xyz+h,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0);\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}"),symbolSDF:wi("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_z_tile_anchor;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_tile_id;uniform float u_zoom_transition;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[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;}float anchorZ=a_z_tile_anchor.x;vec2 tileAnchor=a_z_tile_anchor.yz;vec3 h=elevationVector(tileAnchor)*elevation(tileAnchor);vec3 mercator_pos=mercator_tile_position(u_inv_rot_matrix,tileAnchor,u_tile_id,u_merc_center);vec3 world_pos=mix_globe_mercator(vec3(a_pos,anchorZ)+h,mercator_pos,u_zoom_transition);vec4 projectedPoint=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),anchorZ,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec3 proj_pos=mix_globe_mercator(vec3(a_projected_pos.xy,anchorZ),mercator_pos,u_zoom_transition);\n#ifdef PROJECTED_POS_ON_VIEWPORT\nvec4 projected_pos=u_label_plane_matrix*vec4(proj_pos.xy,0.0,1.0);\n#else\nvec4 projected_pos=u_label_plane_matrix*vec4(proj_pos.xyz+h,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));float gamma_scale=gl_Position.w;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}"),symbolTextAndIcon:wi("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_z_tile_anchor;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[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;}float anchorZ=a_z_tile_anchor.x;vec2 tileAnchor=a_z_tile_anchor.yz;vec3 h=elevationVector(tileAnchor)*elevation(tileAnchor);vec3 mercator_pos=mercator_tile_position(u_inv_rot_matrix,tileAnchor,u_tile_id,u_merc_center);vec3 world_pos=mix_globe_mercator(vec3(a_pos,anchorZ)+h,mercator_pos,u_zoom_transition);vec4 projectedPoint=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),anchorZ,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec3 proj_pos=mix_globe_mercator(vec3(a_projected_pos.xy,anchorZ),mercator_pos,u_zoom_transition);\n#ifdef PROJECTED_POS_ON_VIEWPORT\nvec4 projected_pos=u_label_plane_matrix*vec4(proj_pos.xy,0.0,1.0);\n#else\nvec4 projected_pos=u_label_plane_matrix*vec4(proj_pos.xyz+h,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale);\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}"),terrainRaster:wi("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\nvoid main() {vec4 color=texture2D(u_image0,v_pos0);\n#ifdef FOG\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\nconst float skirtOffset=24575.0;const float wireframeOffset=0.00015;void main() {v_pos0=a_texture_pos/8192.0;float skirt=float(a_pos.x >=skirtOffset);float elevation=elevation(a_texture_pos)-skirt*u_skirt_height;\n#ifdef TERRAIN_WIREFRAME\nelevation+=u_skirt_height*u_skirt_height*wireframeOffset;\n#endif\nvec2 decodedPos=a_pos-vec2(skirt*skirtOffset,0.0);gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n}"),terrainDepth:wi("#ifdef GL_ES\nprecision highp float;\n#endif\nvarying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying float v_depth;void main() {float elevation=elevation(a_texture_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:wi("\nvarying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Nc),skyboxGradient:wi("varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Nc),skyboxCapture:wi("\nvarying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;\n#ifdef GL_ES\nprecision highp float;\n#endif\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\n#define MIE_G 0.76\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\n#define DENSITY_STEPS 4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}","attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:wi("uniform sampler2D u_image0;varying vec2 v_pos0;void main() {gl_FragColor=texture2D(u_image0,v_pos0);\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_proj_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;attribute vec3 a_globe_pos;attribute vec2 a_merc_pos;attribute vec2 a_uv;varying vec2 v_pos0;const float wireframeOffset=1e3;void main() {v_pos0=a_uv;vec2 uv=a_uv*EXTENT;vec4 up_vector=vec4(elevationVector(uv),1.0);float height=elevation(uv);\n#ifdef TERRAIN_WIREFRAME\nheight+=wireframeOffset;\n#endif\nvec4 globe=u_globe_matrix*vec4(a_globe_pos+up_vector.xyz*height,1.0);vec4 mercator=vec4(0.0);if (u_zoom_transition > 0.0) {mercator=vec4(a_merc_pos,height,1.0);mercator.xy-=u_merc_center;mercator.x=wrap(mercator.x,-0.5,0.5);mercator=u_merc_matrix*mercator;}vec3 position=mix(globe.xyz,mercator.xyz,u_zoom_transition);gl_Position=u_proj_matrix*vec4(position,1.0);}"),globeAtmosphere:wi("uniform vec2 u_center;uniform float u_radius;uniform vec2 u_screen_size;uniform float u_opacity;uniform highp float u_fadeout_range;uniform vec3 u_start_color;uniform vec3 u_end_color;uniform float u_pixel_ratio;void main() {highp vec2 fragCoord=gl_FragCoord.xy/u_pixel_ratio;fragCoord.y=u_screen_size.y-fragCoord.y;float distFromCenter=length(fragCoord-u_center);float normDistFromCenter=length(fragCoord-u_center)/u_radius;if (normDistFromCenter < 1.0)\ndiscard;float t=clamp(1.0-sqrt(normDistFromCenter-1.0)/u_fadeout_range,0.0,1.0);vec3 color=mix(u_start_color,u_end_color,1.0-t);gl_FragColor=vec4(color*t*u_opacity,u_opacity);}","attribute vec3 a_pos;void main() {gl_Position=vec4(a_pos,1.0);}")};function wi(v,l,f){const y=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,b=/uniform (highp |mediump |lowp )?([\w]+) ([\w]+)([\s]*)([\w]*)/g,M=l.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),L=v.match(b),k=l.match(b),N=ht.match(b);let H=k?k.concat(L):L;f||(Kl.staticUniforms&&(H=Kl.staticUniforms.concat(H)),Ql.staticUniforms&&(H=Ql.staticUniforms.concat(H))),H&&(H=H.concat(N));const $={};return{fragmentSource:v=v.replace(y,(G,J,he,ae,ue)=>($[ue]=!0,"define"===J?`\n#ifndef HAS_UNIFORM_u_${ue}\nvarying ${he} ${ae} ${ue};\n#else\nuniform ${he} ${ae} u_${ue};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${ue}\n ${he} ${ae} ${ue} = u_${ue};\n#endif\n`)),vertexSource:l=l.replace(y,(G,J,he,ae,ue)=>{const Ve="float"===ae?"vec2":"vec4",le=ue.match(/color/)?"color":Ve;return $[ue]?"define"===J?`\n#ifndef HAS_UNIFORM_u_${ue}\nuniform lowp float u_${ue}_t;\nattribute ${he} ${Ve} a_${ue};\nvarying ${he} ${ae} ${ue};\n#else\nuniform ${he} ${ae} u_${ue};\n#endif\n`:"vec4"===le?`\n#ifndef HAS_UNIFORM_u_${ue}\n ${ue} = a_${ue};\n#else\n ${he} ${ae} ${ue} = u_${ue};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${ue}\n ${ue} = unpack_mix_${le}(a_${ue}, u_${ue}_t);\n#else\n ${he} ${ae} ${ue} = u_${ue};\n#endif\n`:"define"===J?`\n#ifndef HAS_UNIFORM_u_${ue}\nuniform lowp float u_${ue}_t;\nattribute ${he} ${Ve} a_${ue};\n#else\nuniform ${he} ${ae} u_${ue};\n#endif\n`:"vec4"===le?`\n#ifndef HAS_UNIFORM_u_${ue}\n ${he} ${ae} ${ue} = a_${ue};\n#else\n ${he} ${ae} ${ue} = u_${ue};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${ue}\n ${he} ${ae} ${ue} = unpack_mix_${le}(a_${ue}, u_${ue}_t);\n#else\n ${he} ${ae} ${ue} = u_${ue};\n#endif\n`}),staticAttributes:M,staticUniforms:H}}class Tn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(l,f,y,b,M,L,k,N){this.context=l;let H=this.boundPaintVertexBuffers.length!==b.length;for(let $=0;!H&&${const ke=le.paint.get("hillshade-shadow-color"),Te=le.paint.get("hillshade-highlight-color"),De=le.paint.get("hillshade-accent-color");let Oe=le.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===le.paint.get("hillshade-illumination-anchor")&&(Oe-=ue.transform.angle);const pt=!ue.options.moving;return{u_matrix:Ae||ue.transform.calculateProjMatrix(Ve.tileID.toUnwrapped(),pt),u_image:0,u_latrange:ra(0,Ve.tileID),u_light:[le.paint.get("hillshade-exaggeration"),Oe],u_shadow:ke,u_highlight:Te,u_accent:De}})(v,f,y,v.terrain?l.projMatrix:null);v.prepareDrawProgram(k,$,l.toUnwrapped());const{tileBoundsBuffer:J,tileBoundsIndexBuffer:he,tileBoundsSegments:ae}=v.getTileBoundsBuffers(f);$.draw(k,N.TRIANGLES,b,M,L,p.CullFaceMode.disabled,G,y.id,J,he,ae)}function Ur(v,l,f){if(!l.needsDEMTextureUpload)return;const y=v.context,b=y.gl;y.pixelStoreUnpackPremultiplyAlpha.set(!1),l.demTexture=l.demTexture||v.getTileTexture(f.stride);const M=f.getPixels();l.demTexture?l.demTexture.update(M,{premultiply:!1}):l.demTexture=new p.Texture(y,M,b.RGBA,{premultiply:!1}),l.needsDEMTextureUpload=!1}function F1(v,l,f,y,b,M){const L=v.context,k=L.gl;if(!l.dem)return;const N=l.dem;if(L.activeTexture.set(k.TEXTURE1),Ur(v,l,N),!l.demTexture)return;l.demTexture.bind(k.NEAREST,k.CLAMP_TO_EDGE);const H=N.dim;L.activeTexture.set(k.TEXTURE0);let $=l.fbo;if(!$){const ae=new p.Texture(L,{width:H,height:H,data:null},k.RGBA);ae.bind(k.LINEAR,k.CLAMP_TO_EDGE),$=l.fbo=L.createFramebuffer(H,H,!0),$.colorAttachment.set(ae.texture)}L.bindFramebuffer.set($.framebuffer),L.viewport.set([0,0,H,H]);const{tileBoundsBuffer:G,tileBoundsIndexBuffer:J,tileBoundsSegments:he}=v.getMercatorTileBoundsBuffers();v.useProgram("hillshadePrepare").draw(L,k.TRIANGLES,y,b,M,p.CullFaceMode.disabled,((ae,ue)=>{const Ve=ue.stride,le=p.create();return p.ortho(le,0,p.EXTENT,-p.EXTENT,0,0,1),p.translate(le,le,[0,-p.EXTENT,0]),{u_matrix:le,u_image:1,u_dimension:[Ve,Ve],u_zoom:ae.overscaledZ,u_unpack:ue.unpackVector}})(l.tileID,N),f.id,G,J,he),l.needsHillshadePrepare=!1}const Gs=(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_image0:new p.Uniform1i(v,l.u_image0),u_skirt_height:new p.Uniform1f(v,l.u_skirt_height)}),co=(v,l)=>({u_matrix:v,u_image0:0,u_skirt_height:l}),sa=(v,l,f,y,b)=>({u_proj_matrix:Float32Array.from(v),u_globe_matrix:l,u_merc_matrix:f,u_zoom_transition:y,u_merc_center:b,u_image0:0});function Sn(v,l){return null!=v&&null!=l&&!(!v.hasData()||!l.hasData())&&null!=v.demTexture&&null!=l.demTexture&&v.tileID.key!==l.tileID.key}const Mi=new class{constructor(){this.operations={}}newMorphing(v,l,f,y,b){if(v in this.operations){const M=this.operations[v];M.to.tileID.key!==f.tileID.key&&(M.queued=f)}else this.operations[v]={startTime:y,phase:0,duration:b,from:l,to:f,queued:null}}getMorphValuesForProxy(v){if(!(v in this.operations))return null;const l=this.operations[v];return{from:l.from,to:l.to,phase:l.phase}}update(v){for(const l in this.operations){const f=this.operations[l];for(f.phase=(v-f.startTime)/f.duration;f.phase>=1||!this._validOp(f);)if(!this._nextOp(f,v)){delete this.operations[l];break}}}_nextOp(v,l){return!!v.queued&&(v.from=v.to,v.to=v.queued,v.queued=null,v.phase=0,v.startTime=l,!0)}_validOp(v){return v.from.hasData()&&v.to.hasData()}},Ir={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function Na(v,l){const f=1<({u_matrix:v});function Ws(v,l,f,y,b){if(b>0){const M=p.exported.now(),L=(M-v.timeAdded)/b,k=l?(M-l.timeAdded)/b:-1,N=f.getSource(),H=y.coveringZoomLevel({tileSize:N.tileSize,roundZoom:N.roundZoom}),$=!l||Math.abs(l.tileID.overscaledZ-H)>Math.abs(v.tileID.overscaledZ-H),G=$&&v.refreshedUponExpiration?1:p.clamp($?L:1-k,0,1);return v.refreshedUponExpiration&&L>=1&&(v.refreshedUponExpiration=!1),l?{opacity:1,mix:1-G}:{opacity:G,mix:0}}return{opacity:1,mix:0}}class ll extends p.SourceCache{constructor(l){const f={type:"raster-dem",maxzoom:l.transform.maxZoom},y=new lt(He(),null),b=Xr("mock-dem",f,y,l.style);super("mock-dem",b,!1),b.setEventedParent(this),this._sourceLoaded=!0}_loadTile(l,f){l.state="loaded",f(null)}}class _r extends p.SourceCache{constructor(l){const f=Xr("proxy",{type:"geojson",maxzoom:l.transform.maxZoom},new lt(He(),null),l.style);super("proxy",f,!1),f.setEventedParent(this),this.map=this.getSource().map=l,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(l,f,y){if(l.freezeTileCoverage)return;this.transform=l;const b=l.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((M,L)=>{if(M[L.key]="",!this._tiles[L.key]){const k=new p.Tile(L,this._source.tileSize*L.overscaleFactor(),l.tileZoom);k.state="loaded",this._tiles[L.key]=k}return M},{});for(const M in this._tiles)M in b||(this.freeFBO(M),this._tiles[M].unloadVectorData(),delete this._tiles[M])}freeFBO(l){const f=this.proxyCachedFBO[l];if(void 0!==f){const y=Object.values(f);this.renderCachePool.push(...y),delete this.proxyCachedFBO[l]}}deallocRenderCache(){this.renderCache.forEach(l=>l.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class L2 extends p.OverscaledTileID{constructor(l,f,y){super(l.overscaledZ,l.wrap,l.canonical.z,l.canonical.x,l.canonical.y),this.proxyTileKey=f,this.projMatrix=y}}class Ra extends p.Elevation{constructor(l,f){super(),this.painter=l,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[y,b,M]=function(N){const H=new p.StructArrayLayout4i8,$=new p.StructArrayLayout3ui6,G=131;H.reserve(17161),$.reserve(33800);const J=p.EXTENT/128,he=p.EXTENT+J/2,ae=he+J;for(let Ve=-J;Vehe||Ve<0||Ve>he?24575:0,ke=p.clamp(Math.round(le),0,p.EXTENT),Te=p.clamp(Math.round(Ve),0,p.EXTENT);H.emplaceBack(ke+Ae,Te,ke,Te)}const ue=(Ve,le)=>{const Ae=le*G+Ve;$.emplaceBack(Ae+1,Ae,Ae+G),$.emplaceBack(Ae+G,Ae+G+1,Ae+1)};for(let Ve=1;Ve<129;Ve++)for(let le=1;le<129;le++)ue(le,Ve);return[0,129].forEach(Ve=>{for(let le=0;le<130;le++)ue(le,Ve),ue(Ve,le)}),[H,$,32768]}(),L=l.context;this.gridBuffer=L.createVertexBuffer(y,p.boundsAttributes.members),this.gridIndexBuffer=L.createIndexBuffer(b),this.gridSegments=p.SegmentVector.simpleSegment(0,0,y.length,b.length),this.gridNoSkirtSegments=p.SegmentVector.simpleSegment(0,0,y.length,M),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new _r(f.map),this.orthoMatrix=p.create(),p.ortho(this.orthoMatrix,0,p.EXTENT,0,p.EXTENT,0,1);const k=L.gl;this._overlapStencilMode=new p.StencilMode({func:k.GEQUAL,mask:255},0,255,k.KEEP,k.KEEP,k.REPLACE),this._previousZoom=l.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=f,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new ll(f.map)}set style(l){l.on("data",this._onStyleDataEvent.bind(this)),l.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=l,this._checkRenderCacheEfficiency()}update(l,f,y){if(l&&l.terrain){this._style!==l&&(this.style=l),this.enabled=!0;const b=l.terrain.properties;this.sourceCache=0===l.terrain.drapeRenderMode?this._mockSourceCache:l._getSourceCache(b.get("source")),this._exaggeration=b.get("exaggeration");const M=()=>{this.sourceCache.used&&p.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const L=this.getScaledDemTileSize();this.sourceCache.update(f,L,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,M(),this._initializing=!0),M(),f.updateElevation(!y),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(f),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(l){this._findCoveringTileCache[l]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const l=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||100!==l.efficiency&&p.warnOnce(`Terrain render cache efficiency is not optimal (${l.efficiency}%) and performance\n may be affected negatively, consider placing all background, fill and line layers before layer\n with id '${l.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(l){l.coord&&"source"===l.dataType?this._clearRenderCacheForTile(l.sourceCacheId,l.coord):"style"===l.dataType&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const l in this._style._sourceCaches)this._style._sourceCaches[l].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(l=>l.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),delete this._depthFBO,delete this._depthTexture)}_source(){return this.enabled?this.sourceCache:null}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const l=2*this.proxySourceCache.getSource().tileSize;return[l,l]}set useVertexMorphing(l){this._useVertexMorphing=l}updateTileBinding(l){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const f=this.proxySourceCache,y=this.painter.transform;this._initializing&&(this._initializing=0===y._centerAltitude&&-1===this.getAtPointOrZero(p.MercatorCoordinate.fromLngLat(y.center),-1),this._emptyDEMTextureDirty=!this._initializing);const b=this.proxyCoords=f.getIds().map(N=>{const H=f.getTileByID(N).tileID;return H.projMatrix=y.calculateProjMatrix(H.toUnwrapped()),H});(function(N,H){const $=H.transform.pointCoordinate(H.transform.getCameraPoint()),G=new p.pointGeometry($.x,$.y);N.sort((J,he)=>{if(he.overscaledZ-J.overscaledZ)return he.overscaledZ-J.overscaledZ;const ae=new p.pointGeometry(J.canonical.x+(1<{this.proxyToSource[N.key]={}}),this.terrainTileForTile={};const L=this._style._sourceCaches;for(const N in L){const H=L[N];if(!H.used||(H!==this.sourceCache&&this.resetTileLookupCache(H.id),this._setupProxiedCoordsForOrtho(H,l[N],M),H.usedForTerrain))continue;const $=l[N];H.getSource().reparseOverscaled&&this._assignTerrainTiles($)}this.proxiedCoords[f.id]=b.map(N=>new L2(N,N.key,this.orthoMatrix)),this._assignTerrainTiles(b),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(M),this.renderingToTexture=!1,this._updateTimestamp=p.exported.now();const k={};this._visibleDemTiles=[];for(const N of this.proxyCoords){const H=this.terrainTileForTile[N.key];if(!H)continue;const $=H.tileID.key;$ in k||(this._visibleDemTiles.push(H),k[$]=$)}}_assignTerrainTiles(l){this._initializing||l.forEach(f=>{if(this.terrainTileForTile[f.key])return;const y=this._findTileCoveringTileID(f,this.sourceCache);y&&(this.terrainTileForTile[f.key]=y)})}_prepareDEMTextures(){const l=this.painter.context,f=l.gl;for(const y in this.terrainTileForTile){const b=this.terrainTileForTile[y],M=b.dem;!M||b.demTexture&&!b.needsDEMTextureUpload||(l.activeTexture.set(f.TEXTURE1),Ur(this.painter,b,M))}}_prepareDemTileUniforms(l,f,y,b){if(!f||null==f.demTexture)return!1;const M=l.tileID.canonical,L=Math.pow(2,f.tileID.canonical.z-M.z),k=b||"";return y[`u_dem_tl${k}`]=[M.x*L%1,M.y*L%1],y[`u_dem_scale${k}`]=L,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const l=this.painter.context,f=l.gl;if(!this._emptyDepthBufferTexture){const y={width:1,height:1,data:new Uint8Array([255,255,255,255])};this._emptyDepthBufferTexture=new p.Texture(l,y,f.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let l=0;const f=this._visibleDemTiles.reduce((y,b)=>{if(!b.dem)return y;const M=b.dem.tree.minimums[0];return M>0&&l++,y+M},0);return l?f/l:0}_updateEmptyDEMTexture(){const l=this.painter.context,f=l.gl;l.activeTexture.set(f.TEXTURE2);const y=this._getLoadedAreaMinimum(),b={width:1,height:1,data:new Uint8Array(p.DEMData.pack(y,this.sourceCache.getSource().encoding))};this._emptyDEMTextureDirty=!1;let M=this._emptyDEMTexture;return M?M.update(b,{premultiply:!1}):M=this._emptyDEMTexture=new p.Texture(l,b,f.RGBA,{premultiply:!1}),M}setupElevationDraw(l,f,y){const b=this.painter.context,M=b.gl,L=(k=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:p.DEMData.getUnpackVector(k),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0,u_tile_tl_up:[0,0,1],u_tile_tr_up:[0,0,1],u_tile_br_up:[0,0,1],u_tile_bl_up:[0,0,1],u_tile_up_scale:1});var k;L.u_dem_size=this.sourceCache.getSource().tileSize,L.u_exaggeration=this.exaggeration();const N=this.painter.transform,H=N.projection.createTileTransform(N,N.worldSize),$=l.tileID.canonical;L.u_tile_tl_up=H.upVector($,0,0),L.u_tile_tr_up=H.upVector($,p.EXTENT,0),L.u_tile_br_up=H.upVector($,p.EXTENT,p.EXTENT),L.u_tile_bl_up=H.upVector($,0,p.EXTENT),L.u_tile_up_scale=H.upVectorScale($);let G=null,J=null,he=1;if(y&&y.morphing&&this._useVertexMorphing){const ae=y.morphing.srcDemTile,ue=y.morphing.dstDemTile;he=y.morphing.phase,ae&&ue&&(this._prepareDemTileUniforms(l,ae,L,"_prev")&&(J=ae),this._prepareDemTileUniforms(l,ue,L)&&(G=ue))}if(J&&G?(b.activeTexture.set(M.TEXTURE2),G.demTexture.bind(M.NEAREST,M.CLAMP_TO_EDGE,M.NEAREST),b.activeTexture.set(M.TEXTURE4),J.demTexture.bind(M.NEAREST,M.CLAMP_TO_EDGE,M.NEAREST),L.u_dem_lerp=he):(G=this.terrainTileForTile[l.tileID.key],b.activeTexture.set(M.TEXTURE2),(this._prepareDemTileUniforms(l,G,L)?G.demTexture:this.emptyDEMTexture).bind(M.NEAREST,M.CLAMP_TO_EDGE)),b.activeTexture.set(M.TEXTURE3),y&&y.useDepthForOcclusion?(this._depthTexture.bind(M.NEAREST,M.CLAMP_TO_EDGE),L.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height]):(this.emptyDepthBufferTexture.bind(M.NEAREST,M.CLAMP_TO_EDGE),L.u_depth_size_inv=[1,1]),y&&y.useMeterToDem&&G){const ae=(1<{if(le===nn)return;const vt=[];At&&vt.push(Ir[Ae]),vt.push(Ir[nn]),vt.push("PROJECTION_GLOBE_VIEW"),Ve=H.useProgram("globeRaster",null,vt),le=nn},Te=H.colorModeForRenderPass(),De=new p.DepthMode(ue.LEQUAL,p.DepthMode.ReadWrite,H.depthRangeFor3D);Mi.update(he);const Oe=H.transform,pt=p.calculateGlobeMatrix(Oe,Oe.worldSize),Tt=p.calculateGlobeMercatorMatrix(Oe),hn=[p.mercatorXfromLng(Oe.center.lng),p.mercatorYfromLat(Oe.center.lat)],sn=H.globeSharedBuffers;(Ae?[!1,!0]:[!1]).forEach(nn=>{le=-1;const At=nn?ue.LINES:ue.TRIANGLES;for(const vt of J){const Yt=G.getTile(vt),Bt=Math.pow(2,vt.canonical.z),[Gn,ii]=p.globeBuffersForTileMesh(H,Yt,vt,Bt),Pi=p.StencilMode.disabled,fn=$.prevTerrainTileForTile[vt.key],Jn=$.terrainTileForTile[vt.key];Sn(fn,Jn)&&Mi.newMorphing(vt.key,fn,Jn,he,250),ae.activeTexture.set(ue.TEXTURE0),Yt.texture.bind(ue.LINEAR,ue.CLAMP_TO_EDGE);const gi=Mi.getMorphValuesForProxy(vt.key),cr=gi?1:0,Nr={};gi&&p.extend$1(Nr,{morphing:{srcDemTile:gi.from,dstDemTile:gi.to,phase:p.easeCubicInOut(gi.phase)}});const Ci=p.globeMatrixForTile(vt.canonical,pt),Ri=sa(Oe.projMatrix,Ci,Tt,p.globeToMercatorTransition(Oe.zoom),hn);if(ke(cr,nn),$.setupElevationDraw(Yt,Ve,Nr),H.prepareDrawProgram(ae,Ve,vt.toUnwrapped()),sn){const[Er,ci]=nn?sn.getWirefameBuffer(H.context):[sn.gridIndexBuffer,sn.gridSegments];Ve.draw(ae,At,De,Pi,Te,p.CullFaceMode.backCCW,Ri,"globe_raster",Gn,Er,ci)}if(!nn){const Er=[0===vt.canonical.y?p.globePoleMatrixForTile(vt.canonical,!1,Oe):null,vt.canonical.y===Bt-1?p.globePoleMatrixForTile(vt.canonical,!0,Oe):null];for(const ci of Er){if(!ci)continue;const Bo=sa(Oe.projMatrix,ci,ci,0,hn);sn&&Ve.draw(ae,At,De,Pi,Te,p.CullFaceMode.disabled,Bo,"globe_pole_raster",ii,sn.poleIndexBuffer,sn.poleSegments)}}}})}(b,M,L,k,N);else{const H=b.context,$=H.gl;let G,J;const he=b.options.showTerrainWireframe?2:0,ae=(ke,Te)=>{if(J===ke)return;const De=[Ir[ke]];Te&&De.push(Ir[he]),G=b.useProgram("terrainRaster",null,De),J=ke},ue=b.colorModeForRenderPass(),Ve=new p.DepthMode($.LEQUAL,p.DepthMode.ReadWrite,b.depthRangeFor3D);Mi.update(N);const le=b.transform,Ae=6*Math.pow(1.5,22-le.zoom)*M.exaggeration();(he?[!1,!0]:[!1]).forEach(ke=>{J=-1;const Te=ke?$.LINES:$.TRIANGLES,[De,Oe]=ke?M.getWirefameBuffer():[M.gridIndexBuffer,M.gridSegments];for(const pt of k){const Tt=L.getTile(pt),hn=p.StencilMode.disabled,sn=M.prevTerrainTileForTile[pt.key],nn=M.terrainTileForTile[pt.key];Sn(sn,nn)&&Mi.newMorphing(pt.key,sn,nn,N,250),H.activeTexture.set($.TEXTURE0),Tt.texture.bind($.LINEAR,$.CLAMP_TO_EDGE,$.LINEAR_MIPMAP_NEAREST);const At=Mi.getMorphValuesForProxy(pt.key),vt=At?1:0;let Yt;At&&(Yt={morphing:{srcDemTile:At.from,dstDemTile:At.to,phase:p.easeCubicInOut(At.phase)}});const Bt=co(pt.projMatrix,Na(pt.canonical,le.renderWorldCopies)?Ae/10:Ae);ae(vt,ke),M.setupElevationDraw(Tt,G,Yt),b.prepareDrawProgram(H,G,pt.toUnwrapped()),G.draw(H,Te,Ve,hn,ue,p.CullFaceMode.backCCW,Bt,"terrain_raster",M.gridBuffer,De,Oe)}})}}(f,this,this.proxySourceCache,l,this._updateTimestamp),this.renderingToTexture=!0,l.splice(0,l.length))}renderBatch(l){if(0===this._drapedRenderBatches.length)return l+1;this.renderingToTexture=!0;const f=this.painter,y=this.painter.context,b=this.proxySourceCache,M=this.proxiedCoords[b.id],L=this._drapedRenderBatches.shift(),k=[],N=f.style.order;let H=0;for(const $ of M){const G=b.getTileByID($.proxyTileKey),J=b.proxyCachedFBO[$.key]?b.proxyCachedFBO[$.key][l]:void 0,he=void 0!==J?b.renderCache[J]:this.pool[H++],ae=void 0!==J;if(G.texture=he.tex,ae&&!he.dirty){k.push(G.tileID);continue}let ue;y.bindFramebuffer.set(he.fb.framebuffer),this.renderedToTile=!1,he.dirty&&(y.clear({color:p.Color.transparent,stencil:0}),he.dirty=!1);for(let Ve=L.start;Ve<=L.end;++Ve){const le=f.style._layers[N[Ve]];if(le.isHidden(f.transform.zoom))continue;const Ae=f.style._getLayerSourceCache(le),ke=Ae?this.proxyToSource[$.key][Ae.id]:[$];if(!ke)continue;const Te=ke;y.viewport.set([0,0,he.fb.width,he.fb.height]),ue!==(Ae?Ae.id:null)&&(this._setupStencil(he,ke,le,Ae),ue=Ae?Ae.id:null),f.renderLayer(f,Ae,le,Te)}this.renderedToTile?(he.dirty=!0,k.push(G.tileID)):ae||--H,5===H&&(H=0,this.renderToBackBuffer(k))}return this.renderToBackBuffer(k),this.renderingToTexture=!1,y.bindFramebuffer.set(null),y.viewport.set([0,0,f.width,f.height]),L.end+1}postRender(){}renderCacheEfficiency(l){const f=l.order.length;if(0===f)return{efficiency:100};let y,b=0,M=0,L=!1;for(let k=0;kf.dem).forEach(f=>{l=Math.min(l,f.dem.tree.minimums[0])}),0===l?l:(l-30)*this._exaggeration}raycast(l,f,y){if(!this._visibleDemTiles)return null;const b=this._visibleDemTiles.filter(M=>M.dem).map(M=>{const L=M.tileID,k=Math.pow(2,L.overscaledZ),{x:N,y:H}=L.canonical,$=N/k,G=(N+1)/k,J=H/k,he=(H+1)/k;return{minx:$,miny:J,maxx:G,maxy:he,t:M.dem.tree.raycastRoot($,J,G,he,l,f,y),tile:M}});b.sort((M,L)=>(null!==M.t?M.t:Number.MAX_VALUE)-(null!==L.t?L.t:Number.MAX_VALUE));for(const M of b){if(null==M.t)return null;const L=M.tile.dem.tree.raycast(M.minx,M.miny,M.maxx,M.maxy,l,f,y);if(null!=L)return L}return null}_createFBO(){const l=this.painter.context,f=l.gl,y=this.drapeBufferSize;l.activeTexture.set(f.TEXTURE0);const b=new p.Texture(l,{width:y[0],height:y[1],data:null},f.RGBA);b.bind(f.LINEAR,f.CLAMP_TO_EDGE);const M=l.createFramebuffer(y[0],y[1],!1);return M.colorAttachment.set(b.texture),M.depthAttachment=new T2(l,M.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=l.createRenderbuffer(l.gl.DEPTH_STENCIL,y[0],y[1]),this._stencilRef=0,M.depthAttachment.set(this._sharedDepthStencil),l.clear({stencil:0})):M.depthAttachment.set(this._sharedDepthStencil),l.extTextureFilterAnisotropic&&!l.extTextureFilterAnisotropicForceOff&&f.texParameterf(f.TEXTURE_2D,l.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,l.extTextureFilterAnisotropicMax),{fb:M,tex:b,dirty:!1}}_initFBOPool(){for(;this.pool.length{const f=this._style._layers[l],y=f.isHidden(this.painter.transform.zoom),b=f.getCrossfadeParameters(),M=!!b&&1!==b.t,L=f.hasTransition();return"custom"!==f.type&&!y&&(M||L)})}_clearRasterFadeFromRenderCache(){let l=!1;for(const f in this._style._sourceCaches)if(this._style._sourceCaches[f]._source instanceof Ca){l=!0;break}if(l)for(let f=0;ff.renderCachePool.length){const L=Object.values(f.proxyCachedFBO);f.proxyCachedFBO={};for(let k=0;k=0;L--){const k=y[L];if(f.getTileByID(k.key),void 0!==f.proxyCachedFBO[k.key]){const N=l[k.key],H=this.proxyToSource[k.key];let $=0;for(const G in H){const J=H[G],he=N[G];if(!he||he.length!==J.length||J.some((ae,ue)=>ae!==he[ue]||b[G]&&b[G].hasOwnProperty(ae.key))){$=-1;break}++$}for(const G in f.proxyCachedFBO[k.key])f.renderCache[f.proxyCachedFBO[k.key][G]].dirty=$<0||$!==Object.values(N).length}}const M=[...this._drapedRenderBatches];M.sort((L,k)=>k.end-k.start-(L.end-L.start));for(const L of M)for(const k of y){if(f.proxyCachedFBO[k.key])continue;let N=f.renderCachePool.pop();void 0===N&&f.renderCache.length<50&&(N=f.renderCache.length,f.renderCache.push(this._createFBO())),void 0!==N&&(f.proxyCachedFBO[k.key]={},f.proxyCachedFBO[k.key][L.start]=N,f.renderCache[N].dirty=!0)}this._tilesDirty={}}_setupStencil(l,f,y,b){if(!b||!this._sourceTilesOverlap[b.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const M=this.painter.context,L=M.gl;if(f.length<=1)return void(this._overlapStencilType=!1);let k;if(y.isTileClipped())k=f.length,this._overlapStencilMode.test={func:L.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(f[0].overscaledZ>f[f.length-1].overscaledZ))return void(this._overlapStencilType=!1);k=1,this._overlapStencilMode.test={func:L.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+k>255&&(M.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=k,this._overlapStencilMode.ref=this._stencilRef,y.isTileClipped()&&this._renderTileClippingMasks(f,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(l){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[l.key]),this._overlapStencilMode):p.StencilMode.disabled}_renderTileClippingMasks(l,f){const y=this.painter,b=this.painter.context,M=b.gl;y._tileClippingMaskIDs={},b.setColorMode(p.ColorMode.disabled),b.setDepthMode(p.DepthMode.disabled);const L=y.useProgram("clippingMask");for(const k of l){const N=y._tileClippingMaskIDs[k.key]=--f;L.draw(b,M.TRIANGLES,p.DepthMode.disabled,new p.StencilMode({func:M.ALWAYS,mask:0},N,255,M.KEEP,M.KEEP,M.REPLACE),p.ColorMode.disabled,p.CullFaceMode.disabled,Ho(k.projMatrix),"$clipping",y.tileExtentBuffer,y.quadTriangleIndexBuffer,y.tileExtentSegments)}}pointCoordinate(l){const f=this.painter.transform;if(l.x<0||l.x>f.width||l.y<0||l.y>f.height)return null;const y=[l.x,l.y,1,1];p.transformMat4$1(y,y,f.pixelMatrixInverse),p.scale$1(y,y,1/y[3]),y[0]/=f.worldSize,y[1]/=f.worldSize;const b=f._camera.position,M=p.mercatorZfromAltitude(1,f.center.lat),L=[b[0],b[1],b[2]/M,0],k=p.subtract([],y.slice(0,3),L);p.normalize(k,k);const N=this.raycast(L,k,this._exaggeration);return null!==N&&N?(p.scaleAndAdd(L,L,k,N),L[3]=L[2],L[2]*=M,L):null}drawDepth(){const l=this.painter,f=l.context,y=this.proxySourceCache,b=Math.ceil(l.width),M=Math.ceil(l.height);if(!this._depthFBO||this._depthFBO.width===b&&this._depthFBO.height===M||(this._depthFBO.destroy(),delete this._depthFBO,delete this._depthTexture),!this._depthFBO){const L=f.gl,k=f.createFramebuffer(b,M,!0);f.activeTexture.set(L.TEXTURE0);const N=new p.Texture(f,{width:b,height:M,data:null},L.RGBA);N.bind(L.NEAREST,L.CLAMP_TO_EDGE),k.colorAttachment.set(N.texture);const H=f.createRenderbuffer(f.gl.DEPTH_COMPONENT16,b,M);k.depthAttachment.set(H),this._depthFBO=k,this._depthTexture=N}f.bindFramebuffer.set(this._depthFBO.framebuffer),f.viewport.set([0,0,b,M]),function(L,k,N,H){if("globe"===L.transform.projection.name)return;const $=L.context,G=$.gl;$.clear({depth:1});const J=L.useProgram("terrainDepth"),he=new p.DepthMode(G.LESS,p.DepthMode.ReadWrite,L.depthRangeFor3D);for(const ae of H){const ue=N.getTile(ae),Ve=co(ae.projMatrix,0);k.setupElevationDraw(ue,J),J.draw($,G.TRIANGLES,he,p.StencilMode.disabled,p.ColorMode.unblended,p.CullFaceMode.backCCW,Ve,"terrain_depth",k.gridBuffer,k.gridIndexBuffer,k.gridNoSkirtSegments)}}(l,this,y,this.proxyCoords)}_setupProxiedCoordsForOrtho(l,f,y){if(l.getSource()instanceof oi)return this._setupProxiedCoordsForImageSource(l,f,y);this._findCoveringTileCache[l.id]=this._findCoveringTileCache[l.id]||{};const b=this.proxiedCoords[l.id]=[],M=this.proxyCoords;for(let k=0;k($.min.x=Math.min($.min.x,G.x-k.x),$.min.y=Math.min($.min.y,G.y-k.y),$.max.x=Math.max($.max.x,G.x-k.x),$.max.y=Math.max($.max.y,G.y-k.y),$),{min:new p.pointGeometry(Number.MAX_VALUE,Number.MAX_VALUE),max:new p.pointGeometry(-Number.MAX_VALUE,-Number.MAX_VALUE)}),H=($,G)=>{const J=$.wrap+$.canonical.x/(1<<$.canonical.z),he=$.canonical.y/(1<<$.canonical.z),ae=p.EXTENT/(1<<$.canonical.z),ue=G.wrap+G.canonical.x/(1<ue+N.max.x||he+aeVe+N.max.y};for(let $=0;$L.key===f.tileID.key);if(M)return M}if(f.tileID.key!==l.key){const M=l.canonical.z-f.tileID.canonical.z;let L,k,N;b=p.create();const H=f.tileID.wrap-l.wrap<0?(L=p.EXTENT>>M,k=L*((f.tileID.canonical.x<=G){const J=l.canonical.z-G;f.getSource().reparseOverscaled?(k=Math.max(l.canonical.z+2,f.transform.tileZoom),L=new p.OverscaledTileID(k,l.wrap,G,l.canonical.x>>J,l.canonical.y>>J)):0!==J&&(k=G,L=new p.OverscaledTileID(k,l.wrap,G,l.canonical.x>>J,l.canonical.y>>J))}L.key!==l.key&&(H.push(L.key),y=f.getTile(L))}const $=G=>{H.forEach(J=>{b[J]=G}),H.length=0};for(k-=1;k>=N&&(!y||!y.hasData());k--){y&&$(y.tileID.key);const G=L.calculateScaledKey(k);if(y=f.getTileByID(G),y&&y.hasData())break;const J=b[G];if(null===J)break;void 0===J?H.push(G):y=f.getTileByID(J)}return $(y?y.tileID.key:null),y&&y.hasData()?y:null}findDEMTileFor(l){return this.enabled?this._findTileCoveringTileID(l,this.sourceCache):null}prepareDrawTile(l){this.renderedToTile=!0}_clearRenderCacheForTile(l,f){let y=this._tilesDirty[l];y||(y=this._tilesDirty[l]={}),y[f.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const l=function(f){let y,b,M;const L=new p.StructArrayLayout2ui4,k=131;for(b=1;b<129;b++){for(y=1;y<129;y++)M=b*k+y,L.emplaceBack(M,M+1),L.emplaceBack(M,M+k),L.emplaceBack(M+1,M+k),128===b&&L.emplaceBack(M+k,M+k+1);L.emplaceBack(M+1,M+1+k)}return L}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(l),this.wireframeSegments=p.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,l.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}function zi(v){const l=[];for(let f=0;f`#define ${De}`));const Ve=ue.concat("\n#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif",Xi,nr.fragmentSource,Ql.fragmentSource,y.fragmentSource).join("\n"),le=ue.concat("\n#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif",Xi,nr.vertexSource,Ql.vertexSource,Kl.vertexSource,y.vertexSource).join("\n"),Ae=k.createShader(k.FRAGMENT_SHADER);if(k.isContextLost())return void(this.failedToCreate=!0);k.shaderSource(Ae,Ve),k.compileShader(Ae),k.attachShader(this.program,Ae);const ke=k.createShader(k.VERTEX_SHADER);if(k.isContextLost())return void(this.failedToCreate=!0);k.shaderSource(ke,le),k.compileShader(ke),k.attachShader(this.program,ke),this.attributes={};const Te={};this.numAttributes=$.length;for(let De=0;De({u_fog_matrix:new p.UniformMatrix4f(De,Oe.u_fog_matrix),u_fog_range:new p.Uniform2f(De,Oe.u_fog_range),u_fog_color:new p.Uniform4f(De,Oe.u_fog_color),u_fog_horizon_blend:new p.Uniform1f(De,Oe.u_fog_horizon_blend),u_fog_temporal_offset:new p.Uniform1f(De,Oe.u_fog_temporal_offset)}))(l,Te))}setTerrainUniformValues(l,f){if(!this.terrainUniforms)return;const y=this.terrainUniforms;if(!this.failedToCreate){l.program.set(this.program);for(const b in f)y[b].set(f[b])}}setFogUniformValues(l,f){if(!this.fogUniforms)return;const y=this.fogUniforms;if(!this.failedToCreate){l.program.set(this.program);for(const b in f)y[b].location&&y[b].set(f[b])}}draw(l,f,y,b,M,L,k,N,H,$,G,J,he,ae,ue,Ve){const le=l.gl;if(this.failedToCreate)return;l.program.set(this.program),l.setDepthMode(y),l.setStencilMode(b),l.setColorMode(M),l.setCullFace(L);for(const ke of Object.keys(this.fixedUniforms))this.fixedUniforms[ke].set(k[ke]);ae&&ae.setUniforms(l,this.binderUniforms,J,{zoom:he});const Ae={[le.LINES]:2,[le.TRIANGLES]:3,[le.LINE_STRIP]:1}[f];for(const ke of G.get()){const Te=ke.vaos||(ke.vaos={});(Te[N]||(Te[N]=new Tn)).bind(l,this,H,ae?ae.getPaintVertexBuffers():[],$,ke.vertexOffset,ue,Ve),le.drawElements(f,ke.primitiveLength*Ae,le.UNSIGNED_SHORT,ke.primitiveOffset*Ae*2)}}}function Jl(v,l,f){const y=1/Ct(f,1,l.transform.tileZoom),b=Math.pow(2,f.tileID.overscaledZ),M=f.tileSize*Math.pow(2,l.transform.tileZoom)/b,L=M*(f.tileID.canonical.x+f.tileID.wrap*b),k=M*f.tileID.canonical.y;return{u_image:0,u_texsize:f.imageAtlasTexture.size,u_scale:[y,v.fromScale,v.toScale],u_fade:v.t,u_pixel_coord_upper:[L>>16,k>>16],u_pixel_coord_lower:[65535&L,65535&k]}}const J4=(v,l,f,y)=>{const b=l.style.light,M=b.properties.get("position"),L=[M.x,M.y,M.z],k=p.create$1();"viewport"===b.properties.get("anchor")&&(p.fromRotation(k,-l.transform.angle),p.transformMat3(L,L,k));const N=b.properties.get("color");return{u_matrix:v,u_lightpos:L,u_lightintensity:b.properties.get("intensity"),u_lightcolor:[N.r,N.g,N.b],u_vertical_gradient:+f,u_opacity:y}},ul=(v,l,f,y,b,M,L)=>p.extend(J4(v,l,f,y),Jl(M,l,L),{u_height_factor:-Math.pow(2,b.overscaledZ)/L.tileSize/8}),oa=v=>({u_matrix:v}),ec=(v,l,f,y)=>p.extend(oa(v),Jl(f,l,y)),Rc=(v,l)=>({u_matrix:v,u_world:l}),r1=(v,l,f,y,b)=>p.extend(ec(v,l,f,y),{u_world:b}),Kr=(v,l,f,y)=>{const b=v.transform;let M;return M="map"===y.paint.get("circle-pitch-alignment")?b.calculatePixelsToTileUnitsMatrix(f):new Float32Array([b.pixelsToGLUnits[0],0,0,b.pixelsToGLUnits[1]]),{u_camera_to_center_distance:b.cameraToCenterDistance,u_matrix:v.translatePosMatrix(l.projMatrix,f,y.paint.get("circle-translate"),y.paint.get("circle-translate-anchor")),u_device_pixel_ratio:p.exported.devicePixelRatio,u_extrude_scale:M}},xh=v=>{const l=[];return"map"===v.paint.get("circle-pitch-alignment")&&l.push("PITCH_WITH_MAP"),"map"===v.paint.get("circle-pitch-scale")&&l.push("SCALE_WITH_MAP"),l},J0=(v,l,f)=>{const y=p.EXTENT/f.tileSize;return{u_matrix:v,u_camera_to_center_distance:l.cameraToCenterDistance,u_extrude_scale:[l.pixelsToGLUnits[0]/y,l.pixelsToGLUnits[1]/y]}},Hc=(v,l,f=1)=>({u_matrix:v,u_color:l,u_overlay:0,u_overlay_scale:f}),eu=(v,l,f,y)=>({u_matrix:v,u_extrude_scale:Ct(l,1,f),u_intensity:y}),Bc=(v,l,f,y,b,M)=>{const L=v.transform,k=L.calculatePixelsToTileUnitsMatrix(l),N={u_matrix:Ns(v,l,f,b),u_pixels_to_tile_units:k,u_device_pixel_ratio:p.exported.devicePixelRatio,u_units_to_pixels:[1/L.pixelsToGLUnits[0],1/L.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:M,u_texsize:[0,0],u_scale:[0,0,0],u_mix:0,u_alpha_discard_threshold:0};if(H3(f)){const H=s1(l,v.transform);N.u_texsize=l.lineAtlasTexture.size,N.u_scale=[H,y.fromScale,y.toScale],N.u_mix=y.t}return N},t2=(v,l,f,y,b)=>{const M=v.transform,L=s1(l,M);return{u_matrix:Ns(v,l,f,b),u_texsize:l.imageAtlasTexture.size,u_pixels_to_tile_units:M.calculatePixelsToTileUnitsMatrix(l),u_device_pixel_ratio:p.exported.devicePixelRatio,u_image:0,u_scale:[L,y.fromScale,y.toScale],u_fade:y.t,u_units_to_pixels:[1/M.pixelsToGLUnits[0],1/M.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function s1(v,l){return 1/Ct(v,1,l.tileZoom)}function Ns(v,l,f,y){return v.translatePosMatrix(y||l.tileID.projMatrix,l,f.paint.get("line-translate"),f.paint.get("line-translate-anchor"))}function H3(v){const l=v.paint.get("line-dasharray").value;return l.value||"constant"!==l.kind}const Ha=(v,l,f,y,b,M)=>{return{u_matrix:v,u_tl_parent:l,u_scale_parent:f,u_fade_t:y.mix,u_opacity:y.opacity*b.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:b.paint.get("raster-brightness-min"),u_brightness_high:b.paint.get("raster-brightness-max"),u_saturation_factor:(k=b.paint.get("raster-saturation"),k>0?1-1/(1.001-k):-k),u_contrast_factor:(L=b.paint.get("raster-contrast"),L>0?1/(1-L):1+L),u_spin_weights:_a(b.paint.get("raster-hue-rotate")),u_perspective_transform:M};var L,k};function _a(v){v*=Math.PI/180;const l=Math.sin(v),f=Math.cos(v);return[(2*f+1)/3,(-Math.sqrt(3)*l-f+1)/3,(Math.sqrt(3)*l-f+1)/3]}const Uc=(v,l,f,y,b,M,L,k,N,H,$,G,J,he)=>{const ae=b.transform;return{u_is_size_zoom_constant:+("constant"===v||"source"===v),u_is_size_feature_constant:+("constant"===v||"camera"===v),u_size_t:l?l.uSizeT:0,u_size:l?l.uSize:0,u_camera_to_center_distance:ae.cameraToCenterDistance,u_pitch:ae.pitch/360*2*Math.PI,u_rotate_symbol:+f,u_aspect_ratio:ae.width/ae.height,u_fade_change:b.options.fadeDuration?b.symbolFadeChange:1,u_matrix:M,u_label_plane_matrix:L,u_coord_matrix:k,u_is_text:+N,u_pitch_with_map:+y,u_texsize:H,u_tile_id:$,u_zoom_transition:G,u_inv_rot_matrix:J,u_merc_center:he,u_texture:0}},hl=(v,l,f,y,b,M,L,k,N,H,$,G,J,he,ae)=>{const{cameraToCenterDistance:ue,_pitch:Ve}=b.transform;return p.extend(Uc(v,l,f,y,b,M,L,k,N,H,G,J,he,ae),{u_gamma_scale:y?ue*Math.cos(b.terrain?0:Ve):1,u_device_pixel_ratio:p.exported.devicePixelRatio,u_is_halo:+$})},dl=(v,l,f,y,b,M,L,k,N,H,$,G,J,he)=>p.extend(hl(v,l,f,y,b,M,L,k,!0,N,!0,$,G,J,he),{u_texsize_icon:H,u_texture_icon:1}),Fi=(v,l,f)=>({u_matrix:v,u_opacity:l,u_color:f}),tu=(v,l,f,y,b,M)=>p.extend(function(L,k,N,H){const $=N.imageManager.getPattern(L.from.toString()),G=N.imageManager.getPattern(L.to.toString()),{width:J,height:he}=N.imageManager.getPixelSize(),ae=Math.pow(2,H.tileID.overscaledZ),ue=H.tileSize*Math.pow(2,N.transform.tileZoom)/ae,Ve=ue*(H.tileID.canonical.x+H.tileID.wrap*ae),le=ue*H.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:$.tl,u_pattern_br_a:$.br,u_pattern_tl_b:G.tl,u_pattern_br_b:G.br,u_texsize:[J,he],u_mix:k.t,u_pattern_size_a:$.displaySize,u_pattern_size_b:G.displaySize,u_scale_a:k.fromScale,u_scale_b:k.toScale,u_tile_units_to_pixels:1/Ct(H,1,N.transform.tileZoom),u_pixel_coord_upper:[Ve>>16,le>>16],u_pixel_coord_lower:[65535&Ve,65535&le]}}(y,M,f,b),{u_matrix:v,u_opacity:l}),c5={fillExtrusion:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_lightpos:new p.Uniform3f(v,l.u_lightpos),u_lightintensity:new p.Uniform1f(v,l.u_lightintensity),u_lightcolor:new p.Uniform3f(v,l.u_lightcolor),u_vertical_gradient:new p.Uniform1f(v,l.u_vertical_gradient),u_opacity:new p.Uniform1f(v,l.u_opacity)}),fillExtrusionPattern:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_lightpos:new p.Uniform3f(v,l.u_lightpos),u_lightintensity:new p.Uniform1f(v,l.u_lightintensity),u_lightcolor:new p.Uniform3f(v,l.u_lightcolor),u_vertical_gradient:new p.Uniform1f(v,l.u_vertical_gradient),u_height_factor:new p.Uniform1f(v,l.u_height_factor),u_image:new p.Uniform1i(v,l.u_image),u_texsize:new p.Uniform2f(v,l.u_texsize),u_pixel_coord_upper:new p.Uniform2f(v,l.u_pixel_coord_upper),u_pixel_coord_lower:new p.Uniform2f(v,l.u_pixel_coord_lower),u_scale:new p.Uniform3f(v,l.u_scale),u_fade:new p.Uniform1f(v,l.u_fade),u_opacity:new p.Uniform1f(v,l.u_opacity)}),fill:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix)}),fillPattern:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_image:new p.Uniform1i(v,l.u_image),u_texsize:new p.Uniform2f(v,l.u_texsize),u_pixel_coord_upper:new p.Uniform2f(v,l.u_pixel_coord_upper),u_pixel_coord_lower:new p.Uniform2f(v,l.u_pixel_coord_lower),u_scale:new p.Uniform3f(v,l.u_scale),u_fade:new p.Uniform1f(v,l.u_fade)}),fillOutline:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_world:new p.Uniform2f(v,l.u_world)}),fillOutlinePattern:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_world:new p.Uniform2f(v,l.u_world),u_image:new p.Uniform1i(v,l.u_image),u_texsize:new p.Uniform2f(v,l.u_texsize),u_pixel_coord_upper:new p.Uniform2f(v,l.u_pixel_coord_upper),u_pixel_coord_lower:new p.Uniform2f(v,l.u_pixel_coord_lower),u_scale:new p.Uniform3f(v,l.u_scale),u_fade:new p.Uniform1f(v,l.u_fade)}),circle:(v,l)=>({u_camera_to_center_distance:new p.Uniform1f(v,l.u_camera_to_center_distance),u_extrude_scale:new p.UniformMatrix2f(v,l.u_extrude_scale),u_device_pixel_ratio:new p.Uniform1f(v,l.u_device_pixel_ratio),u_matrix:new p.UniformMatrix4f(v,l.u_matrix)}),collisionBox:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_camera_to_center_distance:new p.Uniform1f(v,l.u_camera_to_center_distance),u_extrude_scale:new p.Uniform2f(v,l.u_extrude_scale)}),collisionCircle:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_inv_matrix:new p.UniformMatrix4f(v,l.u_inv_matrix),u_camera_to_center_distance:new p.Uniform1f(v,l.u_camera_to_center_distance),u_viewport_size:new p.Uniform2f(v,l.u_viewport_size)}),debug:(v,l)=>({u_color:new p.UniformColor(v,l.u_color),u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_overlay:new p.Uniform1i(v,l.u_overlay),u_overlay_scale:new p.Uniform1f(v,l.u_overlay_scale)}),clippingMask:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix)}),heatmap:(v,l)=>({u_extrude_scale:new p.Uniform1f(v,l.u_extrude_scale),u_intensity:new p.Uniform1f(v,l.u_intensity),u_matrix:new p.UniformMatrix4f(v,l.u_matrix)}),heatmapTexture:(v,l)=>({u_image:new p.Uniform1i(v,l.u_image),u_color_ramp:new p.Uniform1i(v,l.u_color_ramp),u_opacity:new p.Uniform1f(v,l.u_opacity)}),hillshade:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_image:new p.Uniform1i(v,l.u_image),u_latrange:new p.Uniform2f(v,l.u_latrange),u_light:new p.Uniform2f(v,l.u_light),u_shadow:new p.UniformColor(v,l.u_shadow),u_highlight:new p.UniformColor(v,l.u_highlight),u_accent:new p.UniformColor(v,l.u_accent)}),hillshadePrepare:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_image:new p.Uniform1i(v,l.u_image),u_dimension:new p.Uniform2f(v,l.u_dimension),u_zoom:new p.Uniform1f(v,l.u_zoom),u_unpack:new p.Uniform4f(v,l.u_unpack)}),line:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_pixels_to_tile_units:new p.UniformMatrix2f(v,l.u_pixels_to_tile_units),u_device_pixel_ratio:new p.Uniform1f(v,l.u_device_pixel_ratio),u_units_to_pixels:new p.Uniform2f(v,l.u_units_to_pixels),u_dash_image:new p.Uniform1i(v,l.u_dash_image),u_gradient_image:new p.Uniform1i(v,l.u_gradient_image),u_image_height:new p.Uniform1f(v,l.u_image_height),u_texsize:new p.Uniform2f(v,l.u_texsize),u_scale:new p.Uniform3f(v,l.u_scale),u_mix:new p.Uniform1f(v,l.u_mix),u_alpha_discard_threshold:new p.Uniform1f(v,l.u_alpha_discard_threshold)}),linePattern:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_texsize:new p.Uniform2f(v,l.u_texsize),u_pixels_to_tile_units:new p.UniformMatrix2f(v,l.u_pixels_to_tile_units),u_device_pixel_ratio:new p.Uniform1f(v,l.u_device_pixel_ratio),u_image:new p.Uniform1i(v,l.u_image),u_units_to_pixels:new p.Uniform2f(v,l.u_units_to_pixels),u_scale:new p.Uniform3f(v,l.u_scale),u_fade:new p.Uniform1f(v,l.u_fade),u_alpha_discard_threshold:new p.Uniform1f(v,l.u_alpha_discard_threshold)}),raster:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_tl_parent:new p.Uniform2f(v,l.u_tl_parent),u_scale_parent:new p.Uniform1f(v,l.u_scale_parent),u_fade_t:new p.Uniform1f(v,l.u_fade_t),u_opacity:new p.Uniform1f(v,l.u_opacity),u_image0:new p.Uniform1i(v,l.u_image0),u_image1:new p.Uniform1i(v,l.u_image1),u_brightness_low:new p.Uniform1f(v,l.u_brightness_low),u_brightness_high:new p.Uniform1f(v,l.u_brightness_high),u_saturation_factor:new p.Uniform1f(v,l.u_saturation_factor),u_contrast_factor:new p.Uniform1f(v,l.u_contrast_factor),u_spin_weights:new p.Uniform3f(v,l.u_spin_weights),u_perspective_transform:new p.Uniform2f(v,l.u_perspective_transform)}),symbolIcon:(v,l)=>({u_is_size_zoom_constant:new p.Uniform1i(v,l.u_is_size_zoom_constant),u_is_size_feature_constant:new p.Uniform1i(v,l.u_is_size_feature_constant),u_size_t:new p.Uniform1f(v,l.u_size_t),u_size:new p.Uniform1f(v,l.u_size),u_camera_to_center_distance:new p.Uniform1f(v,l.u_camera_to_center_distance),u_pitch:new p.Uniform1f(v,l.u_pitch),u_rotate_symbol:new p.Uniform1i(v,l.u_rotate_symbol),u_aspect_ratio:new p.Uniform1f(v,l.u_aspect_ratio),u_fade_change:new p.Uniform1f(v,l.u_fade_change),u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_label_plane_matrix:new p.UniformMatrix4f(v,l.u_label_plane_matrix),u_coord_matrix:new p.UniformMatrix4f(v,l.u_coord_matrix),u_is_text:new p.Uniform1i(v,l.u_is_text),u_pitch_with_map:new p.Uniform1i(v,l.u_pitch_with_map),u_texsize:new p.Uniform2f(v,l.u_texsize),u_tile_id:new p.Uniform3f(v,l.u_tile_id),u_zoom_transition:new p.Uniform1f(v,l.u_zoom_transition),u_inv_rot_matrix:new p.UniformMatrix4f(v,l.u_inv_rot_matrix),u_merc_center:new p.Uniform2f(v,l.u_merc_center),u_texture:new p.Uniform1i(v,l.u_texture)}),symbolSDF:(v,l)=>({u_is_size_zoom_constant:new p.Uniform1i(v,l.u_is_size_zoom_constant),u_is_size_feature_constant:new p.Uniform1i(v,l.u_is_size_feature_constant),u_size_t:new p.Uniform1f(v,l.u_size_t),u_size:new p.Uniform1f(v,l.u_size),u_camera_to_center_distance:new p.Uniform1f(v,l.u_camera_to_center_distance),u_pitch:new p.Uniform1f(v,l.u_pitch),u_rotate_symbol:new p.Uniform1i(v,l.u_rotate_symbol),u_aspect_ratio:new p.Uniform1f(v,l.u_aspect_ratio),u_fade_change:new p.Uniform1f(v,l.u_fade_change),u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_label_plane_matrix:new p.UniformMatrix4f(v,l.u_label_plane_matrix),u_coord_matrix:new p.UniformMatrix4f(v,l.u_coord_matrix),u_is_text:new p.Uniform1i(v,l.u_is_text),u_pitch_with_map:new p.Uniform1i(v,l.u_pitch_with_map),u_texsize:new p.Uniform2f(v,l.u_texsize),u_texture:new p.Uniform1i(v,l.u_texture),u_gamma_scale:new p.Uniform1f(v,l.u_gamma_scale),u_device_pixel_ratio:new p.Uniform1f(v,l.u_device_pixel_ratio),u_tile_id:new p.Uniform3f(v,l.u_tile_id),u_zoom_transition:new p.Uniform1f(v,l.u_zoom_transition),u_inv_rot_matrix:new p.UniformMatrix4f(v,l.u_inv_rot_matrix),u_merc_center:new p.Uniform2f(v,l.u_merc_center),u_is_halo:new p.Uniform1i(v,l.u_is_halo)}),symbolTextAndIcon:(v,l)=>({u_is_size_zoom_constant:new p.Uniform1i(v,l.u_is_size_zoom_constant),u_is_size_feature_constant:new p.Uniform1i(v,l.u_is_size_feature_constant),u_size_t:new p.Uniform1f(v,l.u_size_t),u_size:new p.Uniform1f(v,l.u_size),u_camera_to_center_distance:new p.Uniform1f(v,l.u_camera_to_center_distance),u_pitch:new p.Uniform1f(v,l.u_pitch),u_rotate_symbol:new p.Uniform1i(v,l.u_rotate_symbol),u_aspect_ratio:new p.Uniform1f(v,l.u_aspect_ratio),u_fade_change:new p.Uniform1f(v,l.u_fade_change),u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_label_plane_matrix:new p.UniformMatrix4f(v,l.u_label_plane_matrix),u_coord_matrix:new p.UniformMatrix4f(v,l.u_coord_matrix),u_is_text:new p.Uniform1i(v,l.u_is_text),u_pitch_with_map:new p.Uniform1i(v,l.u_pitch_with_map),u_texsize:new p.Uniform2f(v,l.u_texsize),u_texsize_icon:new p.Uniform2f(v,l.u_texsize_icon),u_texture:new p.Uniform1i(v,l.u_texture),u_texture_icon:new p.Uniform1i(v,l.u_texture_icon),u_gamma_scale:new p.Uniform1f(v,l.u_gamma_scale),u_device_pixel_ratio:new p.Uniform1f(v,l.u_device_pixel_ratio),u_is_halo:new p.Uniform1i(v,l.u_is_halo)}),background:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_opacity:new p.Uniform1f(v,l.u_opacity),u_color:new p.UniformColor(v,l.u_color)}),backgroundPattern:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_opacity:new p.Uniform1f(v,l.u_opacity),u_image:new p.Uniform1i(v,l.u_image),u_pattern_tl_a:new p.Uniform2f(v,l.u_pattern_tl_a),u_pattern_br_a:new p.Uniform2f(v,l.u_pattern_br_a),u_pattern_tl_b:new p.Uniform2f(v,l.u_pattern_tl_b),u_pattern_br_b:new p.Uniform2f(v,l.u_pattern_br_b),u_texsize:new p.Uniform2f(v,l.u_texsize),u_mix:new p.Uniform1f(v,l.u_mix),u_pattern_size_a:new p.Uniform2f(v,l.u_pattern_size_a),u_pattern_size_b:new p.Uniform2f(v,l.u_pattern_size_b),u_scale_a:new p.Uniform1f(v,l.u_scale_a),u_scale_b:new p.Uniform1f(v,l.u_scale_b),u_pixel_coord_upper:new p.Uniform2f(v,l.u_pixel_coord_upper),u_pixel_coord_lower:new p.Uniform2f(v,l.u_pixel_coord_lower),u_tile_units_to_pixels:new p.Uniform1f(v,l.u_tile_units_to_pixels)}),terrainRaster:Gs,terrainDepth:Gs,skybox:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_sun_direction:new p.Uniform3f(v,l.u_sun_direction),u_cubemap:new p.Uniform1i(v,l.u_cubemap),u_opacity:new p.Uniform1f(v,l.u_opacity),u_temporal_offset:new p.Uniform1f(v,l.u_temporal_offset)}),skyboxGradient:(v,l)=>({u_matrix:new p.UniformMatrix4f(v,l.u_matrix),u_color_ramp:new p.Uniform1i(v,l.u_color_ramp),u_center_direction:new p.Uniform3f(v,l.u_center_direction),u_radius:new p.Uniform1f(v,l.u_radius),u_opacity:new p.Uniform1f(v,l.u_opacity),u_temporal_offset:new p.Uniform1f(v,l.u_temporal_offset)}),skyboxCapture:(v,l)=>({u_matrix_3f:new p.UniformMatrix3f(v,l.u_matrix_3f),u_sun_direction:new p.Uniform3f(v,l.u_sun_direction),u_sun_intensity:new p.Uniform1f(v,l.u_sun_intensity),u_color_tint_r:new p.Uniform4f(v,l.u_color_tint_r),u_color_tint_m:new p.Uniform4f(v,l.u_color_tint_m),u_luminance:new p.Uniform1f(v,l.u_luminance)}),globeRaster:(v,l)=>({u_proj_matrix:new p.UniformMatrix4f(v,l.u_proj_matrix),u_globe_matrix:new p.UniformMatrix4f(v,l.u_globe_matrix),u_merc_matrix:new p.UniformMatrix4f(v,l.u_merc_matrix),u_zoom_transition:new p.Uniform1f(v,l.u_zoom_transition),u_merc_center:new p.Uniform2f(v,l.u_merc_center),u_image0:new p.Uniform1i(v,l.u_image0)}),globeAtmosphere:(v,l)=>({u_center:new p.Uniform2f(v,l.u_center),u_radius:new p.Uniform1f(v,l.u_radius),u_screen_size:new p.Uniform2f(v,l.u_screen_size),u_pixel_ratio:new p.Uniform1f(v,l.u_pixel_ratio),u_opacity:new p.Uniform1f(v,l.u_opacity),u_fadeout_range:new p.Uniform1f(v,l.u_fadeout_range),u_start_color:new p.Uniform3f(v,l.u_start_color),u_end_color:new p.Uniform3f(v,l.u_end_color)})};let B3;function bh(v,l,f,y,b,M,L){const k=v.context,N=k.gl,H=v.useProgram("collisionBox"),$=[];let G=0,J=0;for(let ke=0;ke0){const sn=p.create(),nn=pt;p.mul(sn,Oe.placementInvProjMatrix,v.transform.glCoordMatrix),p.mul(sn,sn,Oe.placementViewportMatrix),$.push({circleArray:hn,circleOffset:J,transform:nn,invTransform:sn}),G+=hn.length/4,J=G}Tt&&(v.terrain&&v.terrain.setupElevationDraw(De,H),H.draw(k,N.LINES,p.DepthMode.disabled,p.StencilMode.disabled,v.colorModeForRenderPass(),p.CullFaceMode.disabled,J0(pt,v.transform,De),f.id,Tt.layoutVertexBuffer,Tt.indexBuffer,Tt.segments,null,v.transform.zoom,null,Tt.collisionVertexBuffer,Tt.collisionVertexBufferExt))}if(!L||!$.length)return;const he=v.useProgram("collisionCircle"),ae=new p.StructArrayLayout2f1f2i16;ae.resize(4*G),ae._trim();let ue=0;for(const ke of $)for(let Te=0;Te[0,0,0];he.clear();for(let ke=0;ke=0&&(ue[Te.associatedIconIndex]={shiftedAnchor:Pi,angle:fn})}else Ro(Te.numGlyphs,he)}if($){ae.clear();const ke=v.icon.placedSymbolArray;for(let Te=0;Te[0,0,0];vr(Bt,vt.projMatrix,v,b,Hi,Oi,le,H,yl,vt)}const zr=v.translatePosMatrix(vt.projMatrix,Yt,M,L),h1=Ae||b&&Tt||Xs?wh:Hi,e4=v.translatePosMatrix(Oi,Yt,M,L,!0),Ga=Pi&&0!==f.paint.get(b?"text-halo-width":"icon-halo-width").constantOr(1);let z2;const Xt=ue.createInversionMatrix(vt.toUnwrapped());z2=Pi?Bt.iconsInText?dl(fn.kind,cr,ke,le,v,zr,h1,e4,Ci,Bo,Nr,sn,Xt,pt):hl(fn.kind,cr,ke,le,v,zr,h1,e4,b,Ci,!0,Nr,sn,Xt,pt):Uc(fn.kind,cr,ke,le,v,zr,h1,e4,b,Ci,Nr,sn,Xt,pt);const ei={program:gi,buffers:Gn,uniformValues:z2,atlasTexture:Ri,atlasTextureIcon:ho,atlasInterpolation:Er,atlasInterpolationIcon:ci,isSDF:Pi,hasHalo:Ga,tile:Yt,labelPlaneMatrixInv:ui};if(Te&&Bt.canOverlap){De=!0;const Zs=Gn.segments.get();for(const yl of Zs)nn.push({segments:new p.SegmentVector([yl]),sortKey:yl.sortKey,state:ei})}else nn.push({segments:Gn.segments,sortKey:0,state:ei})}De&&nn.sort((vt,Yt)=>vt.sortKey-Yt.sortKey);for(const vt of nn){const Yt=vt.state;if(v.terrain&&v.terrain.setupElevationDraw(Yt.tile,Yt.program,{useDepthForOcclusion:!hn,labelPlaneMatrixInv:Yt.labelPlaneMatrixInv}),J.activeTexture.set(he.TEXTURE0),Yt.atlasTexture.bind(Yt.atlasInterpolation,he.CLAMP_TO_EDGE),Yt.atlasTextureIcon&&(J.activeTexture.set(he.TEXTURE1),Yt.atlasTextureIcon&&Yt.atlasTextureIcon.bind(Yt.atlasInterpolationIcon,he.CLAMP_TO_EDGE)),Yt.isSDF){const Bt=Yt.uniformValues;Yt.hasHalo&&(Bt.u_is_halo=1,Sh(Yt.buffers,vt.segments,f,v,Yt.program,Oe,$,G,Bt)),Bt.u_is_halo=0}Sh(Yt.buffers,vt.segments,f,v,Yt.program,Oe,$,G,Yt.uniformValues)}}function Sh(v,l,f,y,b,M,L,k,N){const H=y.context;b.draw(H,H.gl.TRIANGLES,M,L,k,p.CullFaceMode.disabled,N,f.id,v.layoutVertexBuffer,v.indexBuffer,l,f.paint,y.transform.zoom,v.programConfigurations.get(f.id),v.dynamicLayoutVertexBuffer,v.opacityVertexBuffer)}function Th(v,l,f,y,b,M,L){const k=v.context.gl,N=f.paint.get("fill-pattern"),H=N&&N.constantOr(1),$=f.getCrossfadeParameters();let G,J,he,ae,ue;L?(J=H&&!f.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",G=k.LINES):(J=H?"fillPattern":"fill",G=k.TRIANGLES);for(const Ve of y){const le=l.getTile(Ve);if(H&&!le.patternsLoaded())continue;const Ae=le.getBucket(f);if(!Ae)continue;v.prepareDrawTile(Ve);const ke=Ae.programConfigurations.get(f.id),Te=v.useProgram(J,ke);H&&(v.context.activeTexture.set(k.TEXTURE0),le.imageAtlasTexture.bind(k.LINEAR,k.CLAMP_TO_EDGE),ke.updatePaintBuffers($));const De=N.constantOr(null);if(De&&le.imageAtlas){const pt=le.imageAtlas,Tt=pt.patternPositions[De.to.toString()],hn=pt.patternPositions[De.from.toString()];Tt&&hn&&ke.setConstantPatternPositions(Tt,hn)}const Oe=v.translatePosMatrix(Ve.projMatrix,le,f.paint.get("fill-translate"),f.paint.get("fill-translate-anchor"));if(L){ae=Ae.indexBuffer2,ue=Ae.segments2;const pt=v.terrain&&v.terrain.renderingToTexture?v.terrain.drapeBufferSize:[k.drawingBufferWidth,k.drawingBufferHeight];he="fillOutlinePattern"===J&&H?r1(Oe,v,$,le,pt):Rc(Oe,pt)}else ae=Ae.indexBuffer,ue=Ae.segments,he=H?ec(Oe,v,$,le):oa(Oe);v.prepareDrawProgram(v.context,Te,Ve.toUnwrapped()),Te.draw(v.context,G,b,v.stencilModeForClipping(Ve),M,p.CullFaceMode.disabled,he,f.id,Ae.layoutVertexBuffer,ae,ue,f.paint,v.transform.zoom,ke)}}function nu(v,l,f,y,b,M,L){const k=v.context,N=k.gl,H=f.paint.get("fill-extrusion-pattern"),$=H.constantOr(1),G=f.getCrossfadeParameters(),J=f.paint.get("fill-extrusion-opacity");for(const he of y){const ae=l.getTile(he),ue=ae.getBucket(f);if(!ue)continue;const Ve=ue.programConfigurations.get(f.id),le=v.useProgram($?"fillExtrusionPattern":"fillExtrusion",Ve);if(v.terrain){const Oe=v.terrain;if(!ue.enableTerrain)continue;if(Oe.setupElevationDraw(ae,le,{useMeterToDem:!0}),h5(k,l,he,ue,f,Oe),!ue.centroidVertexBuffer){const pt=le.attributes.a_centroid_pos;void 0!==pt&&N.vertexAttrib2f(pt,0,0)}}$&&(v.context.activeTexture.set(N.TEXTURE0),ae.imageAtlasTexture.bind(N.LINEAR,N.CLAMP_TO_EDGE),Ve.updatePaintBuffers(G));const Ae=H.constantOr(null);if(Ae&&ae.imageAtlas){const Oe=ae.imageAtlas,pt=Oe.patternPositions[Ae.to.toString()],Tt=Oe.patternPositions[Ae.from.toString()];pt&&Tt&&Ve.setConstantPatternPositions(pt,Tt)}const ke=v.translatePosMatrix(he.projMatrix,ae,f.paint.get("fill-extrusion-translate"),f.paint.get("fill-extrusion-translate-anchor")),Te=f.paint.get("fill-extrusion-vertical-gradient"),De=$?ul(ke,v,Te,J,he,G,ae):J4(ke,v,Te,J);v.prepareDrawProgram(k,le,he.toUnwrapped()),le.draw(k,k.gl.TRIANGLES,b,M,L,p.CullFaceMode.backCCW,De,f.id,ue.layoutVertexBuffer,ue.indexBuffer,ue.segments,f.paint,v.transform.zoom,Ve,v.terrain?ue.centroidVertexBuffer:null)}}function h5(v,l,f,y,b,M){const L=[le=>{let Ae=le.canonical.x-1,ke=le.wrap;return Ae<0&&(Ae=(1<{let Ae=le.canonical.x+1,ke=le.wrap;return Ae===1<new p.OverscaledTileID(le.overscaledZ,le.wrap,le.canonical.z,le.canonical.x,(0===le.canonical.y?1<new p.OverscaledTileID(le.overscaledZ,le.wrap,le.canonical.z,le.canonical.x,le.canonical.y===(1<{const Ae=l.getSource().maxzoom,ke=pt=>{const Tt=l.getTileByID(pt);if(Tt&&Tt.hasData())return Tt.getBucket(b)};let Te,De,Oe;return(le.overscaledZ===le.canonical.z||le.overscaledZ>=Ae)&&(Te=ke(le.key)),le.overscaledZ>=Ae&&(De=ke(le.calculateScaledKey(le.overscaledZ+1))),le.overscaledZ>Ae&&(Oe=ke(le.calculateScaledKey(le.overscaledZ-1))),Te||De||Oe},N=[0,0,0],H=(le,Ae)=>(N[0]=Math.min(le.min.y,Ae.min.y),N[1]=Math.max(le.max.y,Ae.max.y),N[2]=p.EXTENT-Ae.min.x>le.max.x?Ae.min.x-p.EXTENT:le.max.x,N),$=(le,Ae)=>(N[0]=Math.min(le.min.x,Ae.min.x),N[1]=Math.max(le.max.x,Ae.max.x),N[2]=p.EXTENT-Ae.min.y>le.max.y?Ae.min.y-p.EXTENT:le.max.y,N),G=[(le,Ae)=>H(le,Ae),(le,Ae)=>H(Ae,le),(le,Ae)=>$(le,Ae),(le,Ae)=>$(Ae,le)],J=new p.pointGeometry(0,0);let he,ae,ue;const Ve=(le,Ae,ke,Te,De)=>{const Oe=[[Te?ke:le,Te?le:ke,0],[Te?ke:Ae,Te?Ae:ke,0]],pt=De<0?p.EXTENT+De:De,Tt=[Te?pt:(le+Ae)/2,Te?(le+Ae)/2:pt,0];return 0===ke&&De<0||0!==ke&&De>0?M.getForTilePoints(ue,[Tt],!0,ae):Oe.push(Tt),M.getForTilePoints(f,Oe,!0,he),Math.max(Oe[0][2],Oe[1][2],Tt[2])/M.exaggeration()};for(let le=0;le<4;le++){const Ae=y.borders[le];if(0===Ae.length&&(y.borderDone[le]=!0),y.borderDone[le])continue;const ke=ue=L[le](f),Te=k(ke);if(!(Te&&Te.enableTerrain&&(ae=M.findDEMTileFor(ke),ae&&ae.dem)))continue;if(!he){const Tt=M.findDEMTileFor(f);if(!Tt||!Tt.dem)return;he=Tt}const De=(le<2?1:5)-le,Oe=Te.borders[De];let pt=0;for(let Tt=0;Ttsn[0]+3));)Te.borderDone[De]||Te.encodeCentroid(void 0,nn,!1),pt++;if(nn&&ptsn[1]-3)&&(vt++,++pt!==Oe.length);)nn=Te.featuresOnBorder[Oe[pt]];if(nn=Te.featuresOnBorder[Oe[At]],hn.intersectsCount()>1||nn.intersectsCount()>1||1!==vt){1!==vt&&(pt=At),y.encodeCentroid(void 0,hn,!1),Te.borderDone[De]||Te.encodeCentroid(void 0,nn,!1);continue}const Yt=G[le](hn,nn),Bt=le%2?p.EXTENT-1:0;J.x=Ve(Yt[0],Math.min(p.EXTENT-1,Yt[1]),Bt,le<2,Yt[2]),J.y=0,y.encodeCentroid(J,hn,!1),Te.borderDone[De]||Te.encodeCentroid(J,nn,!1)}else y.encodeCentroid(void 0,hn,!1)}y.borderDone[le]=y.needsCentroidUpdate=!0,Te.borderDone[De]||(Te.borderDone[De]=Te.needsCentroidUpdate=!0)}(y.needsCentroidUpdate||!y.centroidVertexBuffer&&0!==y.centroidVertexArray.length)&&y.uploadCentroid(v)}const d5=new p.Color(1,0,0,1),gp=new p.Color(0,1,0,1),iu=new p.Color(0,0,1,1),ru=new p.Color(1,0,1,1),f5=new p.Color(0,1,1,1);function aa(v,l,f,y){jc(v,0,l+f/2,v.transform.width,f,y)}function $c(v,l,f,y){jc(v,l-f/2,0,f,v.transform.height,y)}function jc(v,l,f,y,b,M){const L=v.context,k=L.gl;k.enable(k.SCISSOR_TEST),k.scissor(l*p.exported.devicePixelRatio,f*p.exported.devicePixelRatio,y*p.exported.devicePixelRatio,b*p.exported.devicePixelRatio),L.clear({color:M}),k.disable(k.SCISSOR_TEST)}function Lh(v,l,f){const y=v.context,b=y.gl,M=f.projMatrix,L=v.useProgram("debug"),k=l.getTileByID(f.key);v.terrain&&v.terrain.setupElevationDraw(k,L);const N=p.DepthMode.disabled,H=p.StencilMode.disabled,$=v.colorModeForRenderPass(),G="$debug";y.activeTexture.set(b.TEXTURE0),v.emptyTexture.bind(b.LINEAR,b.CLAMP_TO_EDGE),k._makeDebugTileBoundsBuffers(v.context,v.transform.projection);const J=k._tileDebugBuffer||v.debugBuffer,he=k._tileDebugIndexBuffer||v.debugIndexBuffer,ae=k._tileDebugSegments||v.debugSegments;L.draw(y,b.LINE_STRIP,N,H,$,p.CullFaceMode.disabled,Hc(M,p.Color.red),G,J,he,ae);const ue=k.latestRawTileData,Ve=Math.floor((ue&&ue.byteLength||0)/1024),le=l.getTile(f).tileSize,Ae=512/Math.min(le,512)*(f.overscaledZ/v.transform.zoom)*.5;let ke=f.canonical.toString();f.overscaledZ!==f.canonical.z&&(ke+=` => ${f.overscaledZ}`),function(Te,De){Te.initDebugOverlayCanvas();const Oe=Te.debugOverlayCanvas,pt=Te.context.gl,Tt=Te.debugOverlayCanvas.getContext("2d");Tt.clearRect(0,0,Oe.width,Oe.height),Tt.shadowColor="white",Tt.shadowBlur=2,Tt.lineWidth=1.5,Tt.strokeStyle="white",Tt.textBaseline="top",Tt.font="bold 36px Open Sans, sans-serif",Tt.fillText(De,5,5),Tt.strokeText(De,5,5),Te.debugOverlayTexture.update(Oe),Te.debugOverlayTexture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE)}(v,`${ke} ${Ve}kb`),L.draw(y,b.TRIANGLES,N,H,p.ColorMode.alphaBlended,p.CullFaceMode.disabled,Hc(M,p.Color.transparent,Ae),G,v.debugBuffer,v.quadTriangleIndexBuffer,v.debugSegments)}const ed=p.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:E2}=ed;function o1(v,l,f,y){v.emplaceBack(l,f,y)}class kn{constructor(l){this.vertexArray=new p.StructArrayLayout3f12,this.indices=new p.StructArrayLayout3ui6,o1(this.vertexArray,-1,-1,1),o1(this.vertexArray,1,-1,1),o1(this.vertexArray,-1,1,1),o1(this.vertexArray,1,1,1),o1(this.vertexArray,-1,-1,-1),o1(this.vertexArray,1,-1,-1),o1(this.vertexArray,-1,1,-1),o1(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=l.createVertexBuffer(this.vertexArray,E2),this.indexBuffer=l.createIndexBuffer(this.indices),this.segment=p.SegmentVector.simpleSegment(0,0,36,12)}}function D2(v,l,f,y,b,M){const L=v.gl,k=l.paint.get("sky-atmosphere-color"),N=l.paint.get("sky-atmosphere-halo-color"),H=l.paint.get("sky-atmosphere-sun-intensity"),$={u_matrix_3f:p.fromMat4([],y),u_sun_direction:b,u_sun_intensity:H,u_color_tint_r:[(ae=k).r,ae.g,ae.b,ae.a],u_color_tint_m:[(ue=N).r,ue.g,ue.b,ue.a],u_luminance:5e-5};var ae,ue;L.framebufferTexture2D(L.FRAMEBUFFER,L.COLOR_ATTACHMENT0,L.TEXTURE_CUBE_MAP_POSITIVE_X+M,l.skyboxTexture,0),f.draw(v,L.TRIANGLES,p.DepthMode.disabled,p.StencilMode.disabled,p.ColorMode.unblended,p.CullFaceMode.frontCW,$,"skyboxCapture",l.skyboxGeometry.vertexBuffer,l.skyboxGeometry.indexBuffer,l.skyboxGeometry.segment)}const U3={symbol:function(v,l,f,y,b){if("translucent"!==v.renderPass)return;const M=p.StencilMode.disabled,L=v.colorModeForRenderPass();f.layout.get("text-variable-anchor")&&function(k,N,H,$,G,J,he){const ae=N.transform,ue="map"===G,Ve="map"===J,le=ae.projection.createTileTransform(ae,ae.worldSize);for(const Ae of k){const ke=$.getTile(Ae),Te=ke.getBucket(H);if(!Te||Te.projection!==ae.projection.name||!Te.text||!Te.text.segments.get().length)continue;const De=p.evaluateSizeForZoom(Te.textSizeData,ae.zoom),Oe=N.transform.calculatePixelsToTileUnitsMatrix(ke),pt=ds(Ae.projMatrix,ke.tileID.canonical,Ve,ue,N.transform,Oe),Tt="none"!==H.layout.get("icon-text-fit")&&Te.hasIconData();if(De){const hn=Math.pow(2,ae.zoom-ke.tileID.overscaledZ);pp(Te,ue,Ve,he,p.symbolSize,ae,pt,Ae,hn,De,Tt,le)}}}(y,v,f,l,f.layout.get("text-rotation-alignment"),f.layout.get("text-pitch-alignment"),b),0!==f.paint.get("icon-opacity").constantOr(1)&&Mh(v,l,f,y,!1,f.paint.get("icon-translate"),f.paint.get("icon-translate-anchor"),f.layout.get("icon-rotation-alignment"),f.layout.get("icon-pitch-alignment"),f.layout.get("icon-keep-upright"),M,L),0!==f.paint.get("text-opacity").constantOr(1)&&Mh(v,l,f,y,!0,f.paint.get("text-translate"),f.paint.get("text-translate-anchor"),f.layout.get("text-rotation-alignment"),f.layout.get("text-pitch-alignment"),f.layout.get("text-keep-upright"),M,L),l.map.showCollisionBoxes&&(bh(v,l,f,y,f.paint.get("text-translate"),f.paint.get("text-translate-anchor"),!0),bh(v,l,f,y,f.paint.get("icon-translate"),f.paint.get("icon-translate-anchor"),!1))},circle:function(v,l,f,y){if("translucent"!==v.renderPass)return;const b=f.paint.get("circle-opacity"),M=f.paint.get("circle-stroke-width"),L=f.paint.get("circle-stroke-opacity"),k=void 0!==f.layout.get("circle-sort-key").constantOr(1);if(0===b.constantOr(1)&&(0===M.constantOr(1)||0===L.constantOr(1)))return;const N=v.context,H=N.gl,$=v.depthModeForSublayer(0,p.DepthMode.ReadOnly),G=p.StencilMode.disabled,J=v.colorModeForRenderPass(),he=[];for(let ue=0;ueue.sortKey-Ve.sortKey);const ae={useDepthForOcclusion:"globe"!==v.transform.projection.name};for(const ue of he){const{programConfiguration:Ve,program:le,layoutVertexBuffer:Ae,indexBuffer:ke,uniformValues:Te,tile:De}=ue.state,Oe=ue.segments;v.terrain&&v.terrain.setupElevationDraw(De,le,ae),v.prepareDrawProgram(N,le,De.tileID.toUnwrapped()),le.draw(N,H.TRIANGLES,$,G,J,p.CullFaceMode.disabled,Te,f.id,Ae,ke,Oe,f.paint,v.transform.zoom,Ve)}},heatmap:function(v,l,f,y){if(0!==f.paint.get("heatmap-opacity"))if("offscreen"===v.renderPass){const b=v.context,M=b.gl,L=p.StencilMode.disabled,k=new p.ColorMode([M.ONE,M.ONE],p.Color.transparent,[!0,!0,!0,!0]);(function(N,H,$){const G=N.gl;N.activeTexture.set(G.TEXTURE1),N.viewport.set([0,0,H.width/4,H.height/4]);let J=$.heatmapFbo;if(J)G.bindTexture(G.TEXTURE_2D,J.colorAttachment.get()),N.bindFramebuffer.set(J.framebuffer);else{const he=G.createTexture();G.bindTexture(G.TEXTURE_2D,he),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_WRAP_S,G.CLAMP_TO_EDGE),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_WRAP_T,G.CLAMP_TO_EDGE),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_MIN_FILTER,G.LINEAR),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_MAG_FILTER,G.LINEAR),J=$.heatmapFbo=N.createFramebuffer(H.width/4,H.height/4,!1),function(ae,ue,Ve,le){const Ae=ae.gl;Ae.texImage2D(Ae.TEXTURE_2D,0,Ae.RGBA,ue.width/4,ue.height/4,0,Ae.RGBA,ae.extRenderToTextureHalfFloat?ae.extTextureHalfFloat.HALF_FLOAT_OES:Ae.UNSIGNED_BYTE,null),le.colorAttachment.set(Ve)}(N,H,he,J)}})(b,v,f),b.clear({color:p.Color.transparent});for(let N=0;N{const De=[];H3(Te)&&De.push("RENDER_LINE_DASH"),Te.paint.get("line-gradient")&&De.push("RENDER_LINE_GRADIENT");const Oe=Te.paint.get("line-pattern").constantOr(1),pt=1!==Te.paint.get("line-opacity").constantOr(1);return!Oe&&pt&&De.push("RENDER_LINE_ALPHA_DISCARD"),De})(f);let ke=Ae.includes("RENDER_LINE_ALPHA_DISCARD");v.terrain&&v.terrain.clipOrMaskOverlapStencilType()&&(ke=!1);for(const Te of y){const De=l.getTile(Te);if(J&&!De.patternsLoaded())continue;const Oe=De.getBucket(f);if(!Oe)continue;v.prepareDrawTile(Te);const pt=Oe.programConfigurations.get(f.id),Tt=v.useProgram(ue,pt,Ae),hn=G.constantOr(null);if(hn&&De.imageAtlas){const Bt=De.imageAtlas,Gn=Bt.patternPositions[hn.to.toString()],ii=Bt.patternPositions[hn.from.toString()];Gn&&ii&&pt.setConstantPatternPositions(Gn,ii)}const sn=N.constantOr(null),nn=$.constantOr(null);if(!J&&sn&&nn&&De.lineAtlas){const Bt=De.lineAtlas,Gn=Bt.getDash(sn.to,nn),ii=Bt.getDash(sn.from,nn);Gn&&ii&&pt.setConstantPatternPositions(Gn,ii)}const At=v.terrain?Te.projMatrix:null,vt=J?t2(v,De,f,ae,At):Bc(v,De,f,ae,At,Oe.lineClipsArray.length);if(he){const Bt=Oe.gradients[f.id];let Gn=Bt.texture;if(f.gradientVersion!==Bt.version){let ii=256;if(f.stepInterpolant){const Pi=l.getSource().maxzoom,fn=Te.canonical.z===Pi?Math.ceil(1<{Tt.draw(Ve,le.TRIANGLES,L,Bt,k,p.CullFaceMode.disabled,vt,f.id,Oe.layoutVertexBuffer,Oe.indexBuffer,Oe.segments,f.paint,v.transform.zoom,pt,Oe.layoutVertexBuffer2)};if(ke){const Bt=v.stencilModeForClipping(Te).ref;0===Bt&&v.terrain&&Ve.clear({stencil:0});const Gn={func:le.EQUAL,mask:255};vt.u_alpha_discard_threshold=.8,Yt(new p.StencilMode(Gn,Bt,255,le.KEEP,le.KEEP,le.INVERT)),vt.u_alpha_discard_threshold=0,Yt(new p.StencilMode(Gn,Bt,255,le.KEEP,le.KEEP,le.KEEP))}else Yt(v.stencilModeForClipping(Te))}ke&&(v.resetStencilClippingMasks(),v.terrain&&Ve.clear({stencil:0}))},fill:function(v,l,f,y){const b=f.paint.get("fill-color"),M=f.paint.get("fill-opacity");if(0===M.constantOr(1))return;const L=v.colorModeForRenderPass(),k=f.paint.get("fill-pattern"),N=v.opaquePassEnabledForLayer()&&!k.constantOr(1)&&1===b.constantOr(p.Color.transparent).a&&1===M.constantOr(0)?"opaque":"translucent";if(v.renderPass===N){const H=v.depthModeForSublayer(1,"opaque"===v.renderPass?p.DepthMode.ReadWrite:p.DepthMode.ReadOnly);Th(v,l,f,y,H,L,!1)}if("translucent"===v.renderPass&&f.paint.get("fill-antialias")){const H=v.depthModeForSublayer(f.getPaintProperty("fill-outline-color")?2:0,p.DepthMode.ReadOnly);Th(v,l,f,y,H,L,!0)}},"fill-extrusion":function(v,l,f,y){const b=f.paint.get("fill-extrusion-opacity");if(0!==b&&"translucent"===v.renderPass){const M=new p.DepthMode(v.context.gl.LEQUAL,p.DepthMode.ReadWrite,v.depthRangeFor3D);if(1!==b||f.paint.get("fill-extrusion-pattern").constantOr(1))nu(v,l,f,y,M,p.StencilMode.disabled,p.ColorMode.disabled),nu(v,l,f,y,M,v.stencilModeFor3D(),v.colorModeForRenderPass()),v.resetStencilClippingMasks();else{const L=v.colorModeForRenderPass();nu(v,l,f,y,M,p.StencilMode.disabled,L)}}},hillshade:function(v,l,f,y){if("offscreen"!==v.renderPass&&"translucent"!==v.renderPass)return;const b=v.context,M=v.depthModeForSublayer(0,p.DepthMode.ReadOnly),L=v.colorModeForRenderPass(),k=v.terrain&&v.terrain.renderingToTexture,[N,H]="translucent"!==v.renderPass||k?[{},y]:v.stencilConfigForOverlap(y);for(const $ of H){const G=l.getTile($);if(G.needsHillshadePrepare&&"offscreen"===v.renderPass)F1(v,G,f,M,p.StencilMode.disabled,L);else if("translucent"===v.renderPass){const J=k&&v.terrain?v.terrain.stencilModeForRTTOverlap($):N[$.overscaledZ];lo(v,$,G,f,M,J,L)}}b.viewport.set([0,0,v.width,v.height]),v.resetStencilClippingMasks()},raster:function(v,l,f,y,b,M){if("translucent"!==v.renderPass||0===f.paint.get("raster-opacity")||!y.length)return;const L=v.context,k=L.gl,N=l.getSource(),H=v.useProgram("raster"),$=v.colorModeForRenderPass(),G=v.terrain&&v.terrain.renderingToTexture,[J,he]=N instanceof oi||G?[{},y]:v.stencilConfigForOverlap(y),ae=he[he.length-1].overscaledZ,ue=!v.options.moving;for(const Ve of he){const le=G?p.DepthMode.disabled:v.depthModeForSublayer(Ve.overscaledZ-ae,1===f.paint.get("raster-opacity")?p.DepthMode.ReadWrite:p.DepthMode.ReadOnly,k.LESS),Ae=Ve.toUnwrapped(),ke=l.getTile(Ve);if(G&&(!ke||!ke.hasData()))continue;const Te=G?Ve.projMatrix:v.transform.calculateProjMatrix(Ae,ue),De=v.terrain&&G?v.terrain.stencilModeForRTTOverlap(Ve):J[Ve.overscaledZ],Oe=M?0:f.paint.get("raster-fade-duration");ke.registerFadeDuration(Oe);const pt=l.findLoadedParent(Ve,0),Tt=Ws(ke,pt,l,v.transform,Oe);let hn,sn;v.terrain&&v.terrain.prepareDrawTile(Ve);const nn="nearest"===f.paint.get("raster-resampling")?k.NEAREST:k.LINEAR;L.activeTexture.set(k.TEXTURE0),ke.texture.bind(nn,k.CLAMP_TO_EDGE),L.activeTexture.set(k.TEXTURE1),pt?(pt.texture.bind(nn,k.CLAMP_TO_EDGE),hn=Math.pow(2,pt.tileID.overscaledZ-ke.tileID.overscaledZ),sn=[ke.tileID.canonical.x*hn%1,ke.tileID.canonical.y*hn%1]):ke.texture.bind(nn,k.CLAMP_TO_EDGE);const At=Ha(Te,sn||[0,0],hn||1,Tt,f,N instanceof oi?N.perspectiveTransform:[0,0]);if(v.prepareDrawProgram(L,H,Ae),N instanceof oi)H.draw(L,k.TRIANGLES,le,p.StencilMode.disabled,$,p.CullFaceMode.disabled,At,f.id,N.boundsBuffer,v.quadTriangleIndexBuffer,N.boundsSegments);else{const{tileBoundsBuffer:vt,tileBoundsIndexBuffer:Yt,tileBoundsSegments:Bt}=v.getTileBoundsBuffers(ke);H.draw(L,k.TRIANGLES,le,De,$,p.CullFaceMode.disabled,At,f.id,vt,Yt,Bt)}}v.resetStencilClippingMasks()},background:function(v,l,f,y){const b=f.paint.get("background-color"),M=f.paint.get("background-opacity");if(0===M)return;const L=v.context,k=L.gl,N=v.transform,H=N.tileSize,$=f.paint.get("background-pattern");if(v.isPatternMissing($))return;const G=!$&&1===b.a&&1===M&&v.opaquePassEnabledForLayer()?"opaque":"translucent";if(v.renderPass!==G)return;const J=p.StencilMode.disabled,he=v.depthModeForSublayer(0,"opaque"===G?p.DepthMode.ReadWrite:p.DepthMode.ReadOnly),ae=v.colorModeForRenderPass(),ue=v.useProgram($?"backgroundPattern":"background");let Ve,le=y;le||(Ve=v.getBackgroundTiles(),le=Object.values(Ve).map(ke=>ke.tileID)),$&&(L.activeTexture.set(k.TEXTURE0),v.imageManager.bind(v.context));const Ae=f.getCrossfadeParameters();for(const ke of le){const Te=ke.toUnwrapped(),De=y?ke.projMatrix:v.transform.calculateProjMatrix(Te);v.prepareDrawTile(ke);const Oe=l?l.getTile(ke):Ve?Ve[ke.key]:new p.Tile(ke,H,N.zoom,v),pt=$?tu(De,M,v,$,{tileID:ke,tileSize:H},Ae):Fi(De,M,b);v.prepareDrawProgram(L,ue,Te);const{tileBoundsBuffer:Tt,tileBoundsIndexBuffer:hn,tileBoundsSegments:sn}=v.getTileBoundsBuffers(Oe);ue.draw(L,k.TRIANGLES,he,J,ae,p.CullFaceMode.disabled,pt,f.id,Tt,hn,sn)}},sky:function(v,l,f){const y=v.transform,b="mercator"===y.projection.name||"globe"===y.projection.name?1:p.smoothstep(7,8,y.zoom),M=f.paint.get("sky-opacity")*b;if(0===M)return;const L=v.context,k=f.paint.get("sky-type"),N=new p.DepthMode(L.gl.LEQUAL,p.DepthMode.ReadOnly,[0,1]),H=v.frameCounter/1e3%1;"atmosphere"===k?"offscreen"===v.renderPass?f.needsSkyboxCapture(v)&&(function($,G,J,he){const ae=$.context,ue=ae.gl;let Ve=G.skyboxFbo;if(!Ve){Ve=G.skyboxFbo=ae.createFramebuffer(32,32,!1),G.skyboxGeometry=new kn(ae),G.skyboxTexture=ae.gl.createTexture(),ue.bindTexture(ue.TEXTURE_CUBE_MAP,G.skyboxTexture),ue.texParameteri(ue.TEXTURE_CUBE_MAP,ue.TEXTURE_WRAP_S,ue.CLAMP_TO_EDGE),ue.texParameteri(ue.TEXTURE_CUBE_MAP,ue.TEXTURE_WRAP_T,ue.CLAMP_TO_EDGE),ue.texParameteri(ue.TEXTURE_CUBE_MAP,ue.TEXTURE_MIN_FILTER,ue.LINEAR),ue.texParameteri(ue.TEXTURE_CUBE_MAP,ue.TEXTURE_MAG_FILTER,ue.LINEAR);for(let Te=0;Te<6;++Te)ue.texImage2D(ue.TEXTURE_CUBE_MAP_POSITIVE_X+Te,0,ue.RGBA,32,32,0,ue.RGBA,ue.UNSIGNED_BYTE,null)}ae.bindFramebuffer.set(Ve.framebuffer),ae.viewport.set([0,0,32,32]);const le=G.getCenter($,!0),Ae=$.useProgram("skyboxCapture"),ke=new Float64Array(16);p.identity(ke),p.rotateY(ke,ke,.5*-Math.PI),D2(ae,G,Ae,ke,le,0),p.identity(ke),p.rotateY(ke,ke,.5*Math.PI),D2(ae,G,Ae,ke,le,1),p.identity(ke),p.rotateX(ke,ke,.5*-Math.PI),D2(ae,G,Ae,ke,le,2),p.identity(ke),p.rotateX(ke,ke,.5*Math.PI),D2(ae,G,Ae,ke,le,3),p.identity(ke),D2(ae,G,Ae,ke,le,4),p.identity(ke),p.rotateY(ke,ke,Math.PI),D2(ae,G,Ae,ke,le,5),ae.viewport.set([0,0,$.width,$.height])}(v,f),f.markSkyboxValid(v)):"sky"===v.renderPass&&function($,G,J,he,ae){const ue=$.context,Ve=ue.gl,le=$.transform,Ae=$.useProgram("skybox");ue.activeTexture.set(Ve.TEXTURE0),Ve.bindTexture(Ve.TEXTURE_CUBE_MAP,G.skyboxTexture);const ke={u_matrix:le.skyboxMatrix,u_sun_direction:G.getCenter($,!1),u_cubemap:0,u_opacity:he,u_temporal_offset:ae};$.prepareDrawProgram(ue,Ae),Ae.draw(ue,Ve.TRIANGLES,J,p.StencilMode.disabled,$.colorModeForRenderPass(),p.CullFaceMode.backCW,ke,"skybox",G.skyboxGeometry.vertexBuffer,G.skyboxGeometry.indexBuffer,G.skyboxGeometry.segment)}(v,f,N,M,H):"gradient"===k&&"sky"===v.renderPass&&function($,G,J,he,ae){const ue=$.context,Ve=ue.gl,le=$.transform,Ae=$.useProgram("skyboxGradient");G.skyboxGeometry||(G.skyboxGeometry=new kn(ue)),ue.activeTexture.set(Ve.TEXTURE0);let ke=G.colorRampTexture;ke||(ke=G.colorRampTexture=new p.Texture(ue,G.colorRamp,Ve.RGBA)),ke.bind(Ve.LINEAR,Ve.CLAMP_TO_EDGE);const Te=(De=le.skyboxMatrix,Oe=G.getCenter($,!1),pt=G.paint.get("sky-gradient-radius"),Tt=he,hn=ae,{u_matrix:De,u_color_ramp:0,u_center_direction:Oe,u_radius:p.degToRad(pt),u_opacity:Tt,u_temporal_offset:hn});var De,Oe,pt,Tt,hn;$.prepareDrawProgram(ue,Ae),Ae.draw(ue,Ve.TRIANGLES,J,p.StencilMode.disabled,$.colorModeForRenderPass(),p.CullFaceMode.backCW,Te,"skyboxGradient",G.skyboxGeometry.vertexBuffer,G.skyboxGeometry.indexBuffer,G.skyboxGeometry.segment)}(v,f,N,M,H)},debug:function(v,l,f){for(let y=0;yb)return void(this.transform.fogCullDistSq=null);const M=y+.78*(b-y);this.transform.fogCullDistSq=M*M}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(l,f){if(this.width=l*p.exported.devicePixelRatio,this.height=f*p.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const y of this.style.order)this.style._layers[y].resize()}setup(){const l=this.context,f=new p.StructArrayLayout2i4;f.emplaceBack(0,0),f.emplaceBack(p.EXTENT,0),f.emplaceBack(0,p.EXTENT),f.emplaceBack(p.EXTENT,p.EXTENT),this.tileExtentBuffer=l.createVertexBuffer(f,p.posAttributes.members),this.tileExtentSegments=p.SegmentVector.simpleSegment(0,0,4,2);const y=new p.StructArrayLayout2i4;y.emplaceBack(0,0),y.emplaceBack(p.EXTENT,0),y.emplaceBack(0,p.EXTENT),y.emplaceBack(p.EXTENT,p.EXTENT),this.debugBuffer=l.createVertexBuffer(y,p.posAttributes.members),this.debugSegments=p.SegmentVector.simpleSegment(0,0,4,5);const b=new p.StructArrayLayout2i4;b.emplaceBack(-1,-1),b.emplaceBack(1,-1),b.emplaceBack(-1,1),b.emplaceBack(1,1),this.viewportBuffer=l.createVertexBuffer(b,p.posAttributes.members),this.viewportSegments=p.SegmentVector.simpleSegment(0,0,4,2);const M=new p.StructArrayLayout4i8;M.emplaceBack(0,0,0,0),M.emplaceBack(p.EXTENT,0,p.EXTENT,0),M.emplaceBack(0,p.EXTENT,0,p.EXTENT),M.emplaceBack(p.EXTENT,p.EXTENT,p.EXTENT,p.EXTENT),this.mercatorBoundsBuffer=l.createVertexBuffer(M,p.boundsAttributes.members),this.mercatorBoundsSegments=p.SegmentVector.simpleSegment(0,0,4,2);const L=new p.StructArrayLayout3ui6;L.emplaceBack(0,1,2),L.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=l.createIndexBuffer(L);const k=new p.StructArrayLayout1ui2;for(const H of[0,1,3,2,0])k.emplaceBack(H);this.debugIndexBuffer=l.createIndexBuffer(k),this.emptyTexture=new p.Texture(l,{width:1,height:1,data:new Uint8Array([0,0,0,0])},l.gl.RGBA),this.identityMat=p.create();const N=this.context.gl;this.stencilClearMode=new p.StencilMode({func:N.ALWAYS,mask:0},0,255,N.ZERO,N.ZERO,N.ZERO),this.loadTimeStamps.push(p.window.performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(l){return l._makeTileBoundsBuffers(this.context,this.transform.projection),l._tileBoundsBuffer?{tileBoundsBuffer:l._tileBoundsBuffer,tileBoundsIndexBuffer:l._tileBoundsIndexBuffer,tileBoundsSegments:l._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const l=this.context,f=l.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(l,f.TRIANGLES,p.DepthMode.disabled,this.stencilClearMode,p.ColorMode.disabled,p.CullFaceMode.disabled,Ho(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(l,f,y){if(!f||this.currentStencilSource===f.id||!l.isTileClipped()||!y||0===y.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let k=!1;for(const N of y)if(void 0===this._tileClippingMaskIDs[N.key]){k=!0;break}if(!k)return}this.currentStencilSource=f.id;const b=this.context,M=b.gl;this.nextStencilID+y.length>256&&this.clearStencil(),b.setColorMode(p.ColorMode.disabled),b.setDepthMode(p.DepthMode.disabled);const L=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const k of y){const N=f.getTile(k),H=this._tileClippingMaskIDs[k.key]=this.nextStencilID++,{tileBoundsBuffer:$,tileBoundsIndexBuffer:G,tileBoundsSegments:J}=this.getTileBoundsBuffers(N);L.draw(b,M.TRIANGLES,p.DepthMode.disabled,new p.StencilMode({func:M.ALWAYS,mask:0},H,255,M.KEEP,M.KEEP,M.REPLACE),p.ColorMode.disabled,p.CullFaceMode.disabled,Ho(k.projMatrix),"$clipping",$,G,J)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const l=this.nextStencilID++,f=this.context.gl;return new p.StencilMode({func:f.NOTEQUAL,mask:255},l,255,f.KEEP,f.KEEP,f.REPLACE)}stencilModeForClipping(l){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(l);const f=this.context.gl;return new p.StencilMode({func:f.EQUAL,mask:255},this._tileClippingMaskIDs[l.key],0,f.KEEP,f.KEEP,f.REPLACE)}stencilConfigForOverlap(l){const f=this.context.gl,y=l.sort((L,k)=>k.overscaledZ-L.overscaledZ),b=y[y.length-1].overscaledZ,M=y[0].overscaledZ-b+1;if(M>1){this.currentStencilSource=void 0,this.nextStencilID+M>256&&this.clearStencil();const L={};for(let k=0;k=0;this.currentLayer--){const H=this.style._layers[y[this.currentLayer]],$=l._getLayerSourceCache(H);if(H.isSky())continue;const G=$?L[$.id]:void 0;this._renderTileClippingMasks(H,$,G),this.renderLayer(this,$,H,G)}if(this.renderPass="sky",(p.globeToMercatorTransition(this.transform.zoom)>0||"globe"!==this.transform.projection.name)&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer{const G=l._getLayerSourceCache($);G&&!$.isHidden(this.transform.zoom)&&(!H||H.getSource().maxzoom0?f.pop():null}isPatternMissing(l){if(!l)return!1;if(!l.from||!l.to)return!0;const f=this.imageManager.getPattern(l.from.toString()),y=this.imageManager.getPattern(l.to.toString());return!f||!y}currentGlobalDefines(){const l=this.terrain&&this.terrain.renderingToTexture,f=this.style&&this.style.fog,y=[];return this.terrain&&!this.terrain.renderingToTexture&&y.push("TERRAIN"),f&&!l&&0!==f.getOpacity(this.transform.pitch)&&y.push("FOG"),l&&y.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&y.push("OVERDRAW_INSPECTOR"),y}useProgram(l,f,y){this.cache=this.cache||{};const b=y||[],M=this.currentGlobalDefines().concat(b),L=cl.cacheKey(l,M,f);return this.cache[L]||(this.cache[L]=new cl(this.context,l,_h[l],f,c5[l],M)),this.cache[L]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const l=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(l.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=p.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new p.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}prepareDrawTile(l){this.terrain&&this.terrain.prepareDrawTile(l)}prepareDrawProgram(l,f,y){if(this.terrain&&this.terrain.renderingToTexture)return;const b=this.style.fog;if(b){const M=b.getOpacity(this.transform.pitch);0!==M&&f.setFogUniformValues(l,((L,k,N,H)=>{const $=k.properties.get("color"),G=L.frameCounter/1e3%1,J=[$.r/$.a,$.g/$.a,$.b/$.a,H];return{u_fog_matrix:N?L.transform.calculateFogTileMatrix(N):L.identityMat,u_fog_range:k.getFovAdjustedRange(L.transform._fov),u_fog_color:J,u_fog_horizon_blend:k.properties.get("horizon-blend"),u_fog_temporal_offset:G}})(this,b,y,M))}}setTileLoadedFlag(l){this.tileLoaded=l}saveCanvasCopy(){this.frameCopies.push(this.canvasCopy()),this.tileLoaded=!1}canvasCopy(){const l=this.context.gl,f=l.createTexture();return l.bindTexture(l.TEXTURE_2D,f),l.copyTexImage2D(l.TEXTURE_2D,0,l.RGBA,0,0,l.drawingBufferWidth,l.drawingBufferHeight,0),f}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const l=this.style&&this.style.fog;return!!l&&0!==l.getOpacity(this.transform.pitch)}getBackgroundTiles(){const l=this._backgroundTiles,f=this._backgroundTiles={},y=this.transform.coveringTiles({tileSize:512});for(const b of y)f[b.key]=l[b.key]||new p.Tile(b,512,this.transform.tileZoom,this);return f}clearBackgroundTiles(){this._backgroundTiles={}}}class $3{constructor(l=0,f=0,y=0,b=0){if(isNaN(l)||l<0||isNaN(f)||f<0||isNaN(y)||y<0||isNaN(b)||b<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=l,this.bottom=f,this.left=y,this.right=b}interpolate(l,f,y){return null!=f.top&&null!=l.top&&(this.top=p.number(l.top,f.top,y)),null!=f.bottom&&null!=l.bottom&&(this.bottom=p.number(l.bottom,f.bottom,y)),null!=f.left&&null!=l.left&&(this.left=p.number(l.left,f.left,y)),null!=f.right&&null!=l.right&&(this.right=p.number(l.right,f.right,y)),this}getCenter(l,f){const y=p.clamp((this.left+l-this.right)/2,0,l),b=p.clamp((this.top+f-this.bottom)/2,0,f);return new p.pointGeometry(y,b)}equals(l){return this.top===l.top&&this.bottom===l.bottom&&this.left===l.left&&this.right===l.right}clone(){return new $3(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function A2(v,l){const f=p.getColumn(v,3);p.fromQuat(v,l),p.setColumn(v,3,f)}function nd(v,l){p.setColumn(v,3,[l[0],l[1],l[2],1])}function j3(v,l){const f=p.identity$1([]);return p.rotateZ$1(f,f,-l),p.rotateX$1(f,f,-v),f}function Eh(v,l){const f=[v[0],v[1],0],y=[l[0],l[1],0];if(p.length(f)>=1e-15){const L=p.normalize([],f);p.scale$2(y,L,p.dot(y,L)),l[0]=y[0],l[1]=y[1]}const b=p.cross([],l,v);if(p.len(b)<1e-15)return null;const M=Math.atan2(-b[1],b[0]);return j3(Math.atan2(Math.sqrt(v[0]*v[0]+v[1]*v[1]),-v[2]),M)}class Ba{constructor(l,f){this.position=l,this.orientation=f}get position(){return this._position}set position(l){this._position=this._renderWorldCopies?function(f){if(!f)return;const y=Array.isArray(f)?new p.MercatorCoordinate(f[0],f[1],f[2]):f;return y.x=p.wrap(y.x,0,1),y}(l):l}lookAtPoint(l,f){if(this.orientation=null,!this.position)return;const y=this._elevation?this._elevation.getAtPointOrZero(p.MercatorCoordinate.fromLngLat(l)):0,b=this.position,M=p.MercatorCoordinate.fromLngLat(l,y),L=[M.x-b.x,M.y-b.y,M.z-b.z];f||(f=[0,0,1]),f[2]=Math.abs(f[2]),this.orientation=Eh(L,f)}setPitchBearing(l,f){this.orientation=j3(p.degToRad(l),p.degToRad(-f))}}class su{constructor(l,f){this._transform=p.identity([]),this._orientation=p.identity$1([]),f&&(this._orientation=f,A2(this._transform,this._orientation)),l&&nd(this._transform,l)}get mercatorPosition(){const l=this.position;return new p.MercatorCoordinate(l[0],l[1],l[2])}get position(){const l=p.getColumn(this._transform,3);return[l[0],l[1],l[2]]}set position(l){nd(this._transform,l)}get orientation(){return this._orientation}set orientation(l){this._orientation=l,A2(this._transform,this._orientation)}getPitchBearing(){const l=this.forward(),f=this.right();return{bearing:Math.atan2(-f[1],f[0]),pitch:Math.atan2(Math.sqrt(l[0]*l[0]+l[1]*l[1]),-l[2])}}setPitchBearing(l,f){this._orientation=j3(l,f),A2(this._transform,this._orientation)}forward(){const l=p.getColumn(this._transform,2);return[-l[0],-l[1],-l[2]]}up(){const l=p.getColumn(this._transform,1);return[-l[0],-l[1],-l[2]]}right(){const l=p.getColumn(this._transform,0);return[l[0],l[1],l[2]]}getCameraToWorld(l,f){const y=new Float64Array(16);return p.invert(y,this.getWorldToCamera(l,f)),y}getWorldToCameraPosition(l,f,y){const b=this.position;p.scale$2(b,b,-l);const M=new Float64Array(16);return p.fromScaling(M,[y,y,y]),p.translate(M,M,b),M[10]*=f,M}getWorldToCamera(l,f){const y=new Float64Array(16),b=new Float64Array(4),M=this.position;return p.conjugate(b,this._orientation),p.scale$2(M,M,-l),p.fromQuat(y,b),p.translate(y,y,M),y[1]*=-1,y[5]*=-1,y[9]*=-1,y[13]*=-1,y[8]*=f,y[9]*=f,y[10]*=f,y[11]*=f,y}getCameraToClipPerspective(l,f,y,b){const M=new Float64Array(16);return p.perspective(M,l,f,y,b),M}getDistanceToElevation(l){const f=0===l?0:p.mercatorZfromAltitude(l,this.position[1]),y=this.forward();return(f-this.position[2])/y[2]}clone(){return new su([...this.position],[...this.orientation])}}function Dh(v,l){const f=ou(v),y=function(M,L,k,N,H){const $=new p.LngLat(k.lng-180*Ua,k.lat),G=new p.LngLat(k.lng+180*Ua,k.lat),J=M.project($.lng,$.lat),he=M.project(G.lng,G.lat),ae=-Math.atan2(he.y-J.y,he.x-J.x),ue=p.MercatorCoordinate.fromLngLat(k);ue.y=p.clamp(ue.y,-.999975,.999975);const Ve=ue.toLngLat(),le=M.project(Ve.lng,Ve.lat),Ae=p.MercatorCoordinate.fromLngLat(Ve);Ae.x+=Ua;const ke=Ae.toLngLat(),Te=M.project(ke.lng,ke.lat),De=as(Te.x-le.x,Te.y-le.y,ae),Oe=p.MercatorCoordinate.fromLngLat(Ve);Oe.y+=Ua;const pt=Oe.toLngLat(),Tt=M.project(pt.lng,pt.lat),hn=as(Tt.x-le.x,Tt.y-le.y,ae),sn=Math.abs(De.x)/Math.abs(hn.y),nn=p.identity([]);p.rotateZ(nn,nn,-ae*(1-(H?0:N)));const At=p.identity([]);return p.scale(At,At,[1,1-(1-sn)*N,1]),At[4]=-hn.x/hn.y*N,p.rotateZ(At,At,ae),p.multiply$1(At,nn,At),At}(v.projection,0,v.center,f,l),b=Gc(v);return p.scale(y,y,[b,b,1]),y}function Gc(v){const l=v.projection,f=ou(v),y=id(l,v.center),b=id(l,p.LngLat.convert(l.center));return Math.pow(2,y*f+(1-f)*b)}function ou(v){const l=v.projection.range;if(!l)return 0;const f=Math.max(v.width,v.height),y=Math.log(f/1024)/Math.LN2;return p.smoothstep(l[0]+y,l[1]+y,v.zoom)}const Ua=1/4e4;function id(v,l){const f=p.clamp(l.lat,-p.MAX_MERCATOR_LATITUDE,p.MAX_MERCATOR_LATITUDE),y=new p.LngLat(l.lng-180*Ua,f),b=new p.LngLat(l.lng+180*Ua,f),M=v.project(y.lng,f),L=v.project(b.lng,f),k=p.MercatorCoordinate.fromLngLat(y),N=p.MercatorCoordinate.fromLngLat(b),H=L.x-M.x,$=L.y-M.y,G=N.x-k.x,J=N.y-k.y,he=Math.sqrt((G*G+J*J)/(H*H+$*$));return Math.log(he)/Math.LN2}function as(v,l,f){const y=Math.cos(f),b=Math.sin(f);return{x:v*y-l*b,y:v*b+l*y}}class au{constructor(l,f,y,b,M){this.tileSize=512,this._renderWorldCopies=void 0===M||M,this._minZoom=l||0,this._maxZoom=f||22,this._minPitch=null==y?0:y,this._maxPitch=null==b?60:b,this.setProjection(),this.setMaxBounds(),this.width=0,this.height=0,this._center=new p.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new $3,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new su,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._projectionScaler=1,this._horizonShift=.1}clone(){const l=new au(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return l.setProjection(this.getProjection()),l._elevation=this._elevation,l._centerAltitude=this._centerAltitude,l.tileSize=this.tileSize,l.setMaxBounds(this.getMaxBounds()),l.width=this.width,l.height=this.height,l.cameraElevationReference=this.cameraElevationReference,l._center=this._center,l._setZoom(this.zoom),l._cameraZoom=this._cameraZoom,l.angle=this.angle,l._fov=this._fov,l._pitch=this._pitch,l._nearZ=this._nearZ,l._farZ=this._farZ,l._averageElevation=this._averageElevation,l._unmodified=this._unmodified,l._edgeInsets=this._edgeInsets.clone(),l._camera=this._camera.clone(),l._calcMatrices(),l.freezeTileCoverage=this.freezeTileCoverage,l}get elevation(){return this._elevation}set elevation(l){this._elevation!==l&&(this._elevation=l,l?this._updateCenterElevation()&&this._updateCameraOnTerrain():(this._cameraZoom=null,this._centerAltitude=0),this._calcMatrices())}updateElevation(l){this._terrainEnabled()&&null==this._cameraZoom&&this._updateCenterElevation()&&this._updateCameraOnTerrain(),l&&this._constrainCameraAltitude(),this._calcMatrices()}getProjection(){return p.pick(this.projection,["name","center","parallels"])}setProjection(l){null==l&&(l={name:"mercator"}),this.projectionOptions=l;const f=this.projection?this.getProjection():void 0;return this.projection=p.getProjection(l),!re(f,this.getProjection())&&(this._calcMatrices(),!0)}get minZoom(){return this._minZoom}set minZoom(l){this._minZoom!==l&&(this._minZoom=l,this.zoom=Math.max(this.zoom,l))}get maxZoom(){return this._maxZoom}set maxZoom(l){this._maxZoom!==l&&(this._maxZoom=l,this.zoom=Math.min(this.zoom,l))}get minPitch(){return this._minPitch}set minPitch(l){this._minPitch!==l&&(this._minPitch=l,this.pitch=Math.max(this.pitch,l))}get maxPitch(){return this._maxPitch}set maxPitch(l){this._maxPitch!==l&&(this._maxPitch=l,this.pitch=Math.min(this.pitch,l))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(l){void 0===l?l=!0:null===l&&(l=!1),this._renderWorldCopies=l}get worldSize(){return this.tileSize*this.scale}get cameraWorldSize(){const l=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(l))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.cameraWorldSize)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new p.pointGeometry(this.width,this.height)}get bearing(){return p.wrap(this.rotation,-180,180)}set bearing(l){this.rotation=l}get rotation(){return-this.angle/Math.PI*180}set rotation(l){const f=-l*Math.PI/180;var y,b,M,L,k,N,H,$,G,J;this.angle!==f&&(this._unmodified=!1,this.angle=f,this._calcMatrices(),this.rotationMatrix=(y=new p.ARRAY_TYPE(4),p.ARRAY_TYPE!=Float32Array&&(y[1]=0,y[2]=0),y[0]=1,y[3]=1,y),b=this.rotationMatrix,L=this.angle,k=(M=this.rotationMatrix)[0],N=M[1],H=M[2],$=M[3],G=Math.sin(L),J=Math.cos(L),b[0]=k*J+H*G,b[1]=N*J+$*G,b[2]=k*-G+H*J,b[3]=N*-G+$*J)}get pitch(){return this._pitch/Math.PI*180}set pitch(l){const f=p.clamp(l,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==f&&(this._unmodified=!1,this._pitch=f,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(l){l=Math.max(.01,Math.min(60,l)),this._fov!==l&&(this._unmodified=!1,this._fov=l/180*Math.PI,this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(l){this._averageElevation=l,this._calcFogMatrices()}get zoom(){return this._zoom}set zoom(l){const f=Math.min(Math.max(l,this.minZoom),this.maxZoom);this._zoom!==f&&(this._unmodified=!1,this._setZoom(f),this._terrainEnabled()&&this._updateCameraOnTerrain(),this._constrain(),this._calcMatrices())}_setZoom(l){this._zoom=l,this.scale=this.zoomScale(l),this.tileZoom=Math.floor(l),this.zoomFraction=l-this.tileZoom}_updateCenterElevation(){if(!this._elevation)return!1;const l=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center),-1);return-1===l?(this._cameraZoom=null,!1):(this._centerAltitude=l,!0)}_updateCameraOnTerrain(){this._cameraZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize)}sampleAverageElevation(){if(!this._elevation)return 0;const l=this._elevation,f=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],y=this.horizonLineFromTop();let b=0,M=0;for(let L=0;Ll.maxzoom&&(f=l.maxzoom);const L=this.locationCoordinate(this.center),k=1<{const Yt=1/4e4,Bt=new p.MercatorCoordinate(vt.x+Yt,vt.y,vt.z),Gn=new p.MercatorCoordinate(vt.x,vt.y+Yt,vt.z),ii=vt.toLngLat(),Pi=Bt.toLngLat(),fn=Gn.toLngLat(),Jn=this.locationCoordinate(ii),gi=this.locationCoordinate(Pi),cr=this.locationCoordinate(fn),Nr=Math.hypot(gi.x-Jn.x,gi.y-Jn.y),Ci=Math.hypot(cr.x-Jn.x,cr.y-Jn.y);return Math.sqrt(Nr*Ci)*Ae/Yt},Te=vt=>{const Yt=Ve,Bt=le;return{aabb:p.tileAABB(this,k,0,0,0,vt,Bt,Yt,this.projection),zoom:0,x:0,y:0,minZ:Bt,maxZ:Yt,wrap:vt,fullyVisible:!1}},De=[];let Oe=[];const pt=f,Tt=l.reparseOverscaled?y:f,hn=vt=>vt*vt,sn=hn((J-this._centerAltitude)*G),nn=vt=>{if(!this._elevation||!vt.tileID||!M)return;const Yt=this._elevation.getMinMaxForTile(vt.tileID),Bt=vt.aabb;Yt?(Bt.min[2]=Yt.min,Bt.max[2]=Yt.max,Bt.center[2]=(Bt.min[2]+Bt.max[2])/2):(vt.shouldSplit=At(vt),vt.shouldSplit||(Bt.min[2]=Bt.max[2]=Bt.center[2]=this._centerAltitude))},At=vt=>{if(vt.zoom.85?1:Jn}const Pi=Yt*Yt+Bt*Bt+Gn;return Pi{if(Jn*hn(.707)0;){const vt=De.pop(),Yt=vt.x,Bt=vt.y;let Gn=vt.fullyVisible;if(!Gn){const ii=vt.aabb.intersects(H);if(0===ii)continue;Gn=2===ii}if(vt.zoom!==pt&&At(vt))for(let ii=0;ii<4;ii++){const Pi=(Yt<<1)+ii%2,fn=(Bt<<1)+(ii>>1),Jn={aabb:M?vt.aabb.quadrant(ii):p.tileAABB(this,k,vt.zoom+1,Pi,fn,vt.wrap,vt.minZ,vt.maxZ,this.projection),zoom:vt.zoom+1,x:Pi,y:fn,wrap:vt.wrap,fullyVisible:Gn,tileID:void 0,shouldSplit:void 0,minZ:vt.minZ,maxZ:vt.maxZ};b&&(Jn.tileID=new p.OverscaledTileID(vt.zoom+1===pt?Tt:vt.zoom+1,vt.wrap,vt.zoom+1,Pi,fn),nn(Jn)),De.push(Jn)}else{const ii=vt.zoom===pt?Tt:vt.zoom;if(l.minzoom&&l.minzoom>ii)continue;const Pi=N[0]-(.5+Yt+(vt.wrap<{const Gn=[0,0,0,1],ii=[p.EXTENT,p.EXTENT,0,1],Pi=this.calculateFogTileMatrix(Bt.tileID.toUnwrapped());p.transformMat4$1(Gn,Gn,Pi),p.transformMat4$1(ii,ii,Pi);const fn=p.getAABBPointSquareDist(Gn,ii);if(0===fn)return!0;let Jn=!1;const gi=this._elevation;if(gi&&fn>vt&&0!==Yt){const cr=this.calculateProjMatrix(Bt.tileID.toUnwrapped());let Nr;l.isTerrainDEM||(Nr=gi.getMinMaxForTile(Bt.tileID)),Nr||(Nr={min:le,max:Ve});const Ci=p.furthestTileCorner(this.rotation),Ri=[Ci[0]*p.EXTENT,Ci[1]*p.EXTENT,Nr.max];p.transformMat4(Ri,Ri,cr),Jn=(1-Ri[1])*this.height*.5vt.distanceSq-Yt.distanceSq).map(vt=>vt.tileID)}resize(l,f){this.width=l,this.height=f,this.pixelsToGLUnits=[2/l,-2/f],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(l){return Math.pow(2,l)}scaleZoom(l){return Math.log(l)/Math.LN2}project(l){const f=p.clamp(l.lat,-p.MAX_MERCATOR_LATITUDE,p.MAX_MERCATOR_LATITUDE),y=this.projection.project(l.lng,f);return new p.pointGeometry(y.x*this.worldSize,y.y*this.worldSize)}unproject(l){return this.projection.unproject(l.x/this.worldSize,l.y/this.worldSize)}get point(){return this.project(this.center)}setLocationAtPoint(l,f){const y=this.pointCoordinate(f),b=this.pointCoordinate(this.centerPoint),M=this.locationCoordinate(l);this.setLocation(new p.MercatorCoordinate(M.x-(y.x-b.x),M.y-(y.y-b.y)))}setLocation(l){this.center=this.coordinateLocation(l),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(l){return this.projection.locationPoint(this,l)}locationPoint3D(l){return this._coordinatePoint(this.locationCoordinate(l),!0)}pointLocation(l){return this.coordinateLocation(this.pointCoordinate(l))}pointLocation3D(l){return this.coordinateLocation(this.pointCoordinate3D(l))}locationCoordinate(l,f){const y=f?p.mercatorZfromAltitude(f,l.lat):void 0,b=this.projection.project(l.lng,l.lat);return new p.MercatorCoordinate(b.x,b.y,y)}coordinateLocation(l){return this.projection.unproject(l.x,l.y)}pointRayIntersection(l,f){const y=null!=f?f:this._centerAltitude,b=[l.x,l.y,0,1],M=[l.x,l.y,1,1];p.transformMat4$1(b,b,this.pixelMatrixInverse),p.transformMat4$1(M,M,this.pixelMatrixInverse);const L=M[3];p.scale$1(b,b,1/b[3]),p.scale$1(M,M,1/L);const k=b[2],N=M[2];return{p0:b,p1:M,t:k===N?0:(y-k)/(N-k)}}screenPointToMercatorRay(l){const f=[l.x,l.y,0,1],y=[l.x,l.y,1,1];return p.transformMat4$1(f,f,this.pixelMatrixInverse),p.transformMat4$1(y,y,this.pixelMatrixInverse),p.scale$1(f,f,1/f[3]),p.scale$1(y,y,1/y[3]),f[2]=p.mercatorZfromAltitude(f[2],this._center.lat)*this.worldSize,y[2]=p.mercatorZfromAltitude(y[2],this._center.lat)*this.worldSize,p.scale$1(f,f,1/this.worldSize),p.scale$1(y,y,1/this.worldSize),new p.Ray([f[0],f[1],f[2]],p.normalize([],p.sub([],y,f)))}rayIntersectionCoordinate(l){const{p0:f,p1:y,t:b}=l,M=p.mercatorZfromAltitude(f[2],this._center.lat),L=p.mercatorZfromAltitude(y[2],this._center.lat);return new p.MercatorCoordinate(p.number(f[0],y[0],b)/this.worldSize,p.number(f[1],y[1],b)/this.worldSize,p.number(M,L,b))}pointCoordinate(l,f=this._centerAltitude){return this.projection.createTileTransform(this,this.worldSize).pointCoordinate(l.x,l.y,f)}pointCoordinate3D(l){if(!this.elevation)return this.pointCoordinate(l);const f=this.elevation;let y=this.elevation.pointCoordinate(l);if(y)return new p.MercatorCoordinate(y[0],y[1],y[2]);let b=0,M=this.horizonLineFromTop();if(l.y>M)return this.pointCoordinate(l);const L=.02*M,k=l.clone();for(let N=0;N<10&&M-b>L;N++){k.y=p.number(b,M,.66);const H=f.pointCoordinate(k);H?(M=k.y,y=H):b=k.y}return y?new p.MercatorCoordinate(y[0],y[1],y[2]):this.pointCoordinate(l)}isPointAboveHorizon(l){if(this.elevation)return!this.elevation.pointCoordinate(l);{const f=this.horizonLineFromTop();return l.y0?new p.pointGeometry(b[0]/b[3],b[1]/b[3]):new p.pointGeometry(Number.MAX_VALUE,Number.MAX_VALUE)}_getBounds(l,f){const y=new p.pointGeometry(this._edgeInsets.left,this._edgeInsets.top),b=new p.pointGeometry(this.width-this._edgeInsets.right,this._edgeInsets.top),M=new p.pointGeometry(this.width-this._edgeInsets.right,this.height-this._edgeInsets.bottom),L=new p.pointGeometry(this._edgeInsets.left,this.height-this._edgeInsets.bottom);let k=this.pointCoordinate(y,l),N=this.pointCoordinate(b,l);const H=this.pointCoordinate(M,f),$=this.pointCoordinate(L,f),G=(J,he)=>(he.y-J.y)/(he.x-J.x);return k.y>1&&N.y>=0?k=new p.MercatorCoordinate((1-$.y)/G($,k)+$.x,1):k.y<0&&N.y<=1&&(k=new p.MercatorCoordinate(-$.y/G($,k)+$.x,0)),N.y>1&&k.y>=0?N=new p.MercatorCoordinate((1-H.y)/G(H,N)+H.x,1):N.y<0&&k.y<=1&&(N=new p.MercatorCoordinate(-H.y/G(H,N)+H.x,0)),(new p.LngLatBounds).extend(this.coordinateLocation(k)).extend(this.coordinateLocation(N)).extend(this.coordinateLocation($)).extend(this.coordinateLocation(H))}_getBounds3D(){const l=this.elevation;if(!l.visibleDemTiles.length)return this._getBounds(0,0);const f=l.visibleDemTiles.reduce((y,b)=>{if(b.dem){const M=b.dem.tree;y.min=Math.min(y.min,M.minimums[0]),y.max=Math.max(y.max,M.maximums[0])}return y},{min:Number.MAX_VALUE,max:0});return this._getBounds(f.min*l.exaggeration(),f.max*l.exaggeration())}getBounds(){return this._terrainEnabled()?this._getBounds3D():this._getBounds(0,0)}horizonLineFromTop(l=!0){const f=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,y=this.height/2-f*(1-this._horizonShift);return l?Math.max(0,y):y}getMaxBounds(){return this.maxBounds}setMaxBounds(l){this.maxBounds=l,this.minLat=-p.MAX_MERCATOR_LATITUDE,this.maxLat=p.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,l&&(this.minLat=l.getSouth(),this.maxLat=l.getNorth(),this.minLng=l.getWest(),this.maxLng=l.getEast(),this.maxLng$&&(L=$-N),$-HJ&&(M=J-k),J-G.5?le-1:le,Ae>.5?Ae-1:Ae,0]),this.alignedProjMatrix=ke,L=p.create(),p.scale(L,L,[this.width/2,-this.height/2,1]),p.translate(L,L,[1,-1,0]),this.labelPlaneMatrix=L,L=p.create(),p.scale(L,L,[1,-1,1]),p.translate(L,L,[-1,-1,0]),p.scale(L,L,[2/this.width,2/this.height,1]),this.glCoordMatrix=L,this.pixelMatrix=p.multiply$1(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},L=p.invert(new Float64Array(16),this.pixelMatrix),!L)throw new Error("failed to invert matrix");this.pixelMatrixInverse=L,this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const l=this.cameraWorldSize,f=this.cameraPixelsPerMeter,y=this._camera.position,b=1/this.height,M=[l,l,f];p.scale$2(M,M,b),p.scale$2(y,y,-1),p.multiply$2(y,y,M);const L=p.create();p.translate(L,L,y),p.scale(L,L,M),this.mercatorFogMatrix=L,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(l,f,b)}_computeCameraPosition(l){const f=(l=l||this.pixelsPerMeter)/this.pixelsPerMeter,y=this._camera.forward(),b=this.point,M=this._mercatorZfromZoom(this._cameraZoom?this._cameraZoom:this._zoom)*f-l/this.worldSize*this._centerAltitude;return[b.x/this.worldSize-y[0]*M,b.y/this.worldSize-y[1]*M,l/this.worldSize*this._centerAltitude-y[2]*M]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(l){const f=this._maxCameraBoundsDistance()*Math.cos(this._pitch),y=l[2];let b=1;y>0&&(b=Math.min((f-this._camera.position[2])/y,1)),this._camera.position=p.scaleAndAdd([],this._camera.position,l,b),this._updateStateFromCamera()}_updateStateFromCamera(){const l=this._camera.position,f=this._camera.forward(),{pitch:y,bearing:b}=this._camera.getPitchBearing(),M=p.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._projectionScaler,L=this._mercatorZfromZoom(this._maxZoom)*Math.cos(p.degToRad(this._maxPitch)),k=Math.max((l[2]-M)/Math.cos(y),L),N=this._zoomFromMercatorZ(k);p.scaleAndAdd(l,l,f,k),this._pitch=p.clamp(y,p.degToRad(this.minPitch),p.degToRad(this.maxPitch)),this.angle=p.wrap(b,-Math.PI,Math.PI),this._setZoom(p.clamp(N,this._minZoom,this._maxZoom)),this._terrainEnabled()&&this._updateCameraOnTerrain(),this._center=this.coordinateLocation(new p.MercatorCoordinate(l[0],l[1],l[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(l){return Math.pow(2,l)*this.tileSize}_mercatorZfromZoom(l){return this.cameraToCenterDistance/this._worldSizeFromZoom(l)}_minimumHeightOverTerrain(){const l=Math.min((null!=this._cameraZoom?this._cameraZoom:this._zoom)+2,this._maxZoom);return this._mercatorZfromZoom(l)}_zoomFromMercatorZ(l){return this.scaleZoom(this.cameraToCenterDistance/(l*this.tileSize))}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(p.warnOnce("Terrain is not yet supported with alternate projections. Use mercator to enable terrain."),1))}anyCornerOffEdge(l,f){const y=Math.min(l.x,f.x),b=Math.max(l.x,f.x),M=Math.min(l.y,f.y),L=Math.max(l.y,f.y);if(MH||J.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+p.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new p.pointGeometry(0,0),new p.pointGeometry(this.width,this.height))}zoomDeltaToMovement(l,f){const y=p.length(p.sub([],this._camera.position,l)),b=this._zoomFromMercatorZ(y)+f;return y-this._mercatorZfromZoom(b)}getCameraPoint(){const l=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new p.pointGeometry(0,l))}}function k2(v,l){let f=!1,y=null;const b=()=>{y=null,f&&(v(),y=setTimeout(b,l),f=!1)};return()=>(f=!0,y||b(),y)}class rd{constructor(l){this._hashName=l&&encodeURIComponent(l),p.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=k2(this._updateHashUnthrottled.bind(this),300)}addTo(l){return this._map=l,p.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return p.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(l){const f=this._map.getCenter(),y=Math.round(100*this._map.getZoom())/100,b=Math.ceil((y*Math.LN2+Math.log(512/360/.5))/Math.LN10),M=Math.pow(10,b),L=Math.round(f.lng*M)/M,k=Math.round(f.lat*M)/M,N=this._map.getBearing(),H=this._map.getPitch();let $="";if($+=l?`/${L}/${k}/${y}`:`${y}/${k}/${L}`,(N||H)&&($+="/"+Math.round(10*N)/10),H&&($+=`/${Math.round(H)}`),this._hashName){const G=this._hashName;let J=!1;const he=p.window.location.hash.slice(1).split("&").map(ae=>{const ue=ae.split("=")[0];return ue===G?(J=!0,`${ue}=${$}`):ae}).filter(ae=>ae);return J||he.push(`${G}=${$}`),`#${he.join("&")}`}return`#${$}`}_getCurrentHash(){const l=p.window.location.hash.replace("#","");if(this._hashName){let f;return l.split("&").map(y=>y.split("=")).forEach(y=>{y[0]===this._hashName&&(f=y)}),(f&&f[1]||"").split("/")}return l.split("/")}_onHashChange(){const l=this._getCurrentHash();if(l.length>=3&&!l.some(f=>isNaN(f))){const f=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(l[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+l[2],+l[1]],zoom:+l[0],bearing:f,pitch:+(l[4]||0)}),!0}return!1}_updateHashUnthrottled(){const l=p.window.location.href.replace(/(#.+)?$/,this.getHashString());p.window.history.replaceState(p.window.history.state,null,l)}}const $r={linearity:.3,easing:p.bezier(0,0,.3,1)},Wc=p.extend({deceleration:2500,maxSpeed:1400},$r),p5=p.extend({deceleration:20,maxSpeed:1400},$r),qc=p.extend({deceleration:1e3,maxSpeed:360},$r),Di=p.extend({deceleration:1e3,maxSpeed:90},$r);class lu{constructor(l){this._map=l,this.clear()}clear(){this._inertiaBuffer=[]}record(l){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:p.exported.now(),settings:l})}_drainInertiaBuffer(){const l=this._inertiaBuffer,f=p.exported.now();for(;l.length>0&&f-l[0].time>160;)l.shift()}_onMoveEnd(l){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const f={zoom:0,bearing:0,pitch:0,pan:new p.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:M}of this._inertiaBuffer)f.zoom+=M.zoomDelta||0,f.bearing+=M.bearingDelta||0,f.pitch+=M.pitchDelta||0,M.panDelta&&f.pan._add(M.panDelta),M.around&&(f.around=M.around),M.pinchAround&&(f.pinchAround=M.pinchAround);const y=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,b={};if(f.pan.mag()){const M=n2(f.pan.mag(),y,p.extend({},Wc,l||{}));b.offset=f.pan.mult(M.amount/f.pan.mag()),b.center=this._map.transform.center,Xc(b,M)}if(f.zoom){const M=n2(f.zoom,y,p5);b.zoom=this._map.transform.zoom+M.amount,Xc(b,M)}if(f.bearing){const M=n2(f.bearing,y,qc);b.bearing=this._map.transform.bearing+p.clamp(M.amount,-179,179),Xc(b,M)}if(f.pitch){const M=n2(f.pitch,y,Di);b.pitch=this._map.transform.pitch+M.amount,Xc(b,M)}if(b.zoom||b.bearing){const M=void 0===f.pinchAround?f.around:f.pinchAround;b.around=M?this._map.unproject(M):this._map.getCenter()}return this.clear(),p.extend(b,{noMoveStart:!0})}}function Xc(v,l){(!v.duration||v.durationf.unproject(N)),k=M.reduce((N,H,$,G)=>N.add(H.div(G.length)),new p.pointGeometry(0,0));super(l,{points:M,point:k,lngLats:L,lngLat:f.unproject(k),originalEvent:y}),this._defaultPrevented=!1}}class Ah extends p.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(l,f,y){super(l,{originalEvent:y}),this._defaultPrevented=!1}}class sd{constructor(l,f){this._map=l,this._clickTolerance=f.clickTolerance}reset(){delete this._mousedownPos}wheel(l){return this._firePreventable(new Ah(l.type,this._map,l))}mousedown(l,f){return this._mousedownPos=f,this._firePreventable(new Or(l.type,this._map,l))}mouseup(l){this._map.fire(new Or(l.type,this._map,l))}preclick(l){const f=p.extend({},l);f.type="preclick",this._map.fire(new Or(f.type,this._map,f))}click(l,f){this._mousedownPos&&this._mousedownPos.dist(f)>=this._clickTolerance||(this.preclick(l),this._map.fire(new Or(l.type,this._map,l)))}dblclick(l){return this._firePreventable(new Or(l.type,this._map,l))}mouseover(l){this._map.fire(new Or(l.type,this._map,l))}mouseout(l){this._map.fire(new Or(l.type,this._map,l))}touchstart(l){return this._firePreventable(new G3(l.type,this._map,l))}touchmove(l){this._map.fire(new G3(l.type,this._map,l))}touchend(l){this._map.fire(new G3(l.type,this._map,l))}touchcancel(l){this._map.fire(new G3(l.type,this._map,l))}_firePreventable(l){if(this._map.fire(l),l.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class fl{constructor(l){this._map=l}reset(){this._delayContextMenu=!1,delete this._contextMenuEvent}mousemove(l){this._map.fire(new Or(l.type,this._map,l))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Or("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(l){this._delayContextMenu?this._contextMenuEvent=l:this._map.fire(new Or(l.type,this._map,l)),this._map.listens("contextmenu")&&l.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class cu{constructor(l,f){this._map=l,this._el=l.getCanvasContainer(),this._container=l.getContainer(),this._clickTolerance=f.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(l,f){this.isEnabled()&&l.shiftKey&&0===l.button&&(pe.disableDrag(),this._startPos=this._lastPos=f,this._active=!0)}mousemoveWindow(l,f){if(!this._active)return;const y=f;if(this._lastPos.equals(y)||!this._box&&y.dist(this._startPos){this._box&&(this._box.style.transform=`translate(${M}px,${k}px)`,this._box.style.width=L-M+"px",this._box.style.height=N-k+"px")})}mouseupWindow(l,f){if(!this._active||0!==l.button)return;const y=this._startPos,b=f;if(this.reset(),pe.suppressClick(),y.x!==b.x||y.y!==b.y)return this._map.fire(new p.Event("boxzoomend",{originalEvent:l})),{cameraAnimation:M=>M.fitScreenCoordinates(y,b,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",l)}keydown(l){this._active&&27===l.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",l))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),pe.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(l,f){return this._map.fire(new p.Event(l,{originalEvent:f}))}}function pl(v,l){const f={};for(let y=0;ythis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=l.timeStamp),y.length===this.numTouches&&(this.centroid=function(b){const M=new p.pointGeometry(0,0);for(const L of b)M._add(L);return M.div(b.length)}(f),this.touches=pl(y,f)))}touchmove(l,f,y){if(this.aborted||!this.centroid)return;const b=pl(y,f);for(const M in this.touches){const L=this.touches[M],k=b[M];(!k||k.dist(L)>30)&&(this.aborted=!0)}}touchend(l,f,y){if((!this.centroid||l.timeStamp-this.startTime>500)&&(this.aborted=!0),0===y.length){const b=!this.aborted&&this.centroid;if(this.reset(),b)return b}}}class uu{constructor(l){this.singleTap=new vi(l),this.numTaps=l.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(l,f,y){this.singleTap.touchstart(l,f,y)}touchmove(l,f,y){this.singleTap.touchmove(l,f,y)}touchend(l,f,y){const b=this.singleTap.touchend(l,f,y);if(b){const M=l.timeStamp-this.lastTime<500,L=!this.lastTap||this.lastTap.dist(b)<30;if(M&&L||this.reset(),this.count++,this.lastTime=l.timeStamp,this.lastTap=b,this.count===this.numTaps)return this.reset(),b}}}class kh{constructor(){this._zoomIn=new uu({numTouches:1,numTaps:2}),this._zoomOut=new uu({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(l,f,y){this._zoomIn.touchstart(l,f,y),this._zoomOut.touchstart(l,f,y)}touchmove(l,f,y){this._zoomIn.touchmove(l,f,y),this._zoomOut.touchmove(l,f,y)}touchend(l,f,y){const b=this._zoomIn.touchend(l,f,y),M=this._zoomOut.touchend(l,f,y);return b?(this._active=!0,l.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:L=>L.easeTo({duration:300,zoom:L.getZoom()+1,around:L.unproject(b)},{originalEvent:l})}):M?(this._active=!0,l.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:L=>L.easeTo({duration:300,zoom:L.getZoom()-1,around:L.unproject(M)},{originalEvent:l})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const od={0:1,2:2};class Zc{constructor(l){this.reset(),this._clickTolerance=l.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(l,f){return!1}_move(l,f){return{}}mousedown(l,f){if(this._lastPoint)return;const y=pe.mouseButton(l);this._correctButton(l,y)&&(this._lastPoint=f,this._eventButton=y)}mousemoveWindow(l,f){const y=this._lastPoint;if(y)if(l.preventDefault(),function(b,M){const L=od[M];return void 0===b.buttons||(b.buttons&L)!==L}(l,this._eventButton))this.reset();else if(this._moved||!(f.dist(y)0&&(this._active=!0);const b=pl(y,f),M=new p.pointGeometry(0,0),L=new p.pointGeometry(0,0);let k=0;for(const H in b){const $=b[H],G=this._touches[H];G&&(M._add($),L._add($.sub(G)),k++,b[H]=$)}if(this._touches=b,k{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show")},500)}}class ir{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}_start(l){}_move(l,f,y){return{}}touchstart(l,f,y){this._firstTwoTouches||y.length<2||(this._firstTwoTouches=[y[0].identifier,y[1].identifier],this._start([f[0],f[1]]))}touchmove(l,f,y){if(!this._firstTwoTouches)return;l.preventDefault();const[b,M]=this._firstTwoTouches,L=bt(y,f,b),k=bt(y,f,M);if(!L||!k)return;const N=this._aroundCenter?null:L.add(k).div(2);return this._move([L,k],N,l)}touchend(l,f,y){if(!this._firstTwoTouches)return;const[b,M]=this._firstTwoTouches,L=bt(y,f,b),k=bt(y,f,M);L&&k||(this._active&&pe.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(l){this._enabled=!0,this._aroundCenter=!!l&&"center"===l.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function bt(v,l,f){for(let y=0;yMath.abs(v.x)}class hu extends ir{constructor(l){super(),this._map=l}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}_start(l){this._lastPoints=l,Yc(l[0].sub(l[1]))&&(this._valid=!1)}_move(l,f,y){const b=l[0].sub(this._lastPoints[0]),M=l[1].sub(this._lastPoints[1]);if(!(this._map._cooperativeGestures&&y.touches.length<3)&&(this._valid=this.gestureBeginsVertically(b,M,y.timeStamp),this._valid))return this._lastPoints=l,this._active=!0,{pitchDelta:(b.y+M.y)/2*-.5}}gestureBeginsVertically(l,f,y){if(void 0!==this._valid)return this._valid;const b=l.mag()>=2,M=f.mag()>=2;if(!b&&!M)return;if(!b||!M)return void 0===this._firstMove&&(this._firstMove=y),y-this._firstMove<100&&void 0;const L=l.y>0==f.y>0;return Yc(l)&&Yc(f)&&L}}const X3={panStep:100,bearingStep:15,pitchStep:10};class m5{constructor(){const l=X3;this._panStep=l.panStep,this._bearingStep=l.bearingStep,this._pitchStep=l.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(l){if(l.altKey||l.ctrlKey||l.metaKey)return;let f=0,y=0,b=0,M=0,L=0;switch(l.keyCode){case 61:case 107:case 171:case 187:f=1;break;case 189:case 109:case 173:f=-1;break;case 37:l.shiftKey?y=-1:(l.preventDefault(),M=-1);break;case 39:l.shiftKey?y=1:(l.preventDefault(),M=1);break;case 38:l.shiftKey?b=1:(l.preventDefault(),L=-1);break;case 40:l.shiftKey?b=-1:(l.preventDefault(),L=1);break;default:return}return this._rotationDisabled&&(y=0,b=0),{cameraAnimation:k=>{const N=k.getZoom();k.easeTo({duration:300,easeId:"keyboardHandler",easing:du,zoom:f?Math.round(N)+f*(l.shiftKey?2:1):N,bearing:k.getBearing()+y*this._bearingStep,pitch:k.getPitch()+b*this._pitchStep,offset:[-M*this._panStep,-L*this._panStep],center:k.getCenter()},{originalEvent:l})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function du(v){return v*(2-v)}const Kc=4.000244140625;class uo{constructor(l,f){this._map=l,this._el=l.getCanvasContainer(),this._handler=f,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,p.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert","_isFullscreen"],this)}setZoomRate(l){this._defaultZoomRate=l}setWheelZoomRate(l){this._wheelZoomRate=l}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(l){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!l&&"center"===l.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(l){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(l.ctrlKey||l.metaKey||this.isZooming()||this._isFullscreen()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let f=l.deltaMode===p.window.WheelEvent.DOM_DELTA_LINE?40*l.deltaY:l.deltaY;const y=p.exported.now(),b=y-(this._lastWheelEventTime||0);this._lastWheelEventTime=y,0!==f&&f%Kc==0?this._type="wheel":0!==f&&Math.abs(f)<4?this._type="trackpad":b>400?(this._type=null,this._lastValue=f,this._timeout=setTimeout(this._onTimeout,40,l)):this._type||(this._type=Math.abs(b*f)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,f+=this._lastValue)),l.shiftKey&&f&&(f/=4),this._type&&(this._lastWheelEvent=l,this._delta-=f,this._active||this._start(l)),l.preventDefault()}_onTimeout(l){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(l)}_start(l){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const f=pe.mousePos(this._el,l);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:f,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const l=this._map.transform,f=()=>l._terrainEnabled()&&this._aroundCoord?l.computeZoomRelativeTo(this._aroundCoord):l.zoom;if(0!==this._delta){const N="wheel"===this._type&&Math.abs(this._delta)>Kc?this._wheelZoomRate:this._defaultZoomRate;let H=2/(1+Math.exp(-Math.abs(this._delta*N)));this._delta<0&&0!==H&&(H=1/H);const $=f(),G=Math.pow(2,$),J="number"==typeof this._targetZoom?l.zoomScale(this._targetZoom):G;this._targetZoom=Math.min(l.maxZoom,Math.max(l.minZoom,l.scaleZoom(J*H))),"wheel"===this._type&&(this._startZoom=f(),this._easing=this._smoothOutEasing(200)),this._delta=0}const y="number"==typeof this._targetZoom?this._targetZoom:f(),b=this._startZoom,M=this._easing;let L,k=!1;if("wheel"===this._type&&b&&M){const N=Math.min((p.exported.now()-this._lastWheelEventTime)/200,1),H=M(N);L=p.number(b,y,H),N<1?this._frameId||(this._frameId=!0):k=!0}else L=y,k=!0;return this._active=!0,k&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!k,zoomDelta:L-f(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(l){let f=p.ease;if(this._prevEase){const y=this._prevEase,b=(p.exported.now()-y.start)/y.duration,M=y.easing(b+.01)-y.easing(b),L=.27/Math.sqrt(M*M+1e-4)*.01,k=Math.sqrt(.0729-L*L);f=p.bezier(L,k,.25,1)}return this._prevEase={start:p.exported.now(),duration:l,easing:f},f}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=pe.create("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(p.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_isFullscreen(){return!!p.window.document.fullscreenElement}_showBlockerAlert(){"hidden"===this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="visible"),this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show")},200)}}class l1{constructor(l,f){this._clickZoom=l,this._tapZoom=f}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class zh{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(l,f){return l.preventDefault(),{cameraAnimation:y=>{y.easeTo({duration:300,zoom:y.getZoom()+(l.shiftKey?-1:1),around:y.unproject(f)},{originalEvent:l})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class tc{constructor(){this._tap=new uu({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(l,f,y){this._swipePoint||(this._tapTime&&l.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?y.length>0&&(this._swipePoint=f[0],this._swipeTouch=y[0].identifier):this._tap.touchstart(l,f,y))}touchmove(l,f,y){if(this._tapTime){if(this._swipePoint){if(y[0].identifier!==this._swipeTouch)return;const b=f[0],M=b.y-this._swipePoint.y;return this._swipePoint=b,l.preventDefault(),this._active=!0,{zoomDelta:M/128}}}else this._tap.touchmove(l,f,y)}touchend(l,f,y){this._tapTime?this._swipePoint&&0===y.length&&this.reset():this._tap.touchend(l,f,y)&&(this._tapTime=l.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class c1{constructor(l,f,y){this._el=l,this._mousePan=f,this._touchPan=y}enable(l){this._inertiaOptions=l||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Ph{constructor(l,f,y){this._pitchWithRotate=l.pitchWithRotate,this._mouseRotate=f,this._mousePitch=y}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Vh{constructor(l,f,y,b){this._el=l,this._touchZoom=f,this._touchRotate=y,this._tapDragZoom=b,this._rotationDisabled=!1,this._enabled=!0}enable(l){this._touchZoom.enable(l),this._rotationDisabled||this._touchRotate.enable(l),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const Z3=v=>v.zoom||v.drag||v.pitch||v.rotate;class ad extends p.Event{}class fu{constructor(){this.constants=[1,1,.01],this.radius=0}setup(l,f){const y=p.sub([],f,l);this.radius=p.length(y[2]<0?p.div([],y,this.constants):[y[0],y[1],0])}projectRay(l){p.div(l,l,this.constants),p.normalize(l,l),p.mul$1(l,l,this.constants);const f=p.scale$2([],l,this.radius);if(f[2]>0){const y=p.scale$2([],[0,0,1],p.dot(f,[0,0,1])),b=p.scale$2([],p.normalize([],[f[0],f[1],0]),this.radius),M=p.add([],f,p.scale$2([],p.sub([],p.add([],b,y),f),2));f[0]=M[0],f[1]=M[1]}return f}}function nc(v){return v.panDelta&&v.panDelta.mag()||v.zoomDelta||v.bearingDelta||v.pitchDelta}class ic{constructor(l,f){this._map=l,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new lu(l),this._bearingSnap=f.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new fu,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(f),p.bindAll(["handleEvent","handleWindowEvent"],this);const y=this._el;this._listeners=[[y,"touchstart",{passive:!0}],[y,"touchmove",{passive:!1}],[y,"touchend",void 0],[y,"touchcancel",void 0],[y,"mousedown",void 0],[y,"mousemove",void 0],[y,"mouseup",void 0],[p.window.document,"mousemove",{capture:!0}],[p.window.document,"mouseup",void 0],[y,"mouseover",void 0],[y,"mouseout",void 0],[y,"dblclick",void 0],[y,"click",void 0],[y,"keydown",{capture:!1}],[y,"keyup",void 0],[y,"wheel",{passive:!1}],[y,"contextmenu",void 0],[p.window,"blur",void 0]];for(const[b,M,L]of this._listeners)b.addEventListener(M,b===p.window.document?this.handleWindowEvent:this.handleEvent,L)}destroy(){for(const[l,f,y]of this._listeners)l.removeEventListener(f,l===p.window.document?this.handleWindowEvent:this.handleEvent,y)}_addDefaultHandlers(l){const f=this._map,y=f.getCanvasContainer();this._add("mapEvent",new sd(f,l));const b=f.boxZoom=new cu(f,l);this._add("boxZoom",b);const M=new kh,L=new zh;f.doubleClickZoom=new l1(L,M),this._add("tapZoom",M),this._add("clickZoom",L);const k=new tc;this._add("tapDragZoom",k);const N=f.touchPitch=new hu(f);this._add("touchPitch",N);const H=new a1(l),$=new Ih(l);f.dragRotate=new Ph(l,H,$),this._add("mouseRotate",H,["mousePitch"]),this._add("mousePitch",$,["mouseRotate"]);const G=new W3(l),J=new un(f,l);f.dragPan=new c1(y,G,J),this._add("mousePan",G),this._add("touchPan",J,["touchZoom","touchRotate"]);const he=new $a,ae=new q3;f.touchZoomRotate=new Vh(y,ae,he,k),this._add("touchRotate",he,["touchPan","touchZoom"]),this._add("touchZoom",ae,["touchPan","touchRotate"]),this._add("blockableMapEvent",new fl(f));const ue=f.scrollZoom=new uo(f,this);this._add("scrollZoom",ue,["mousePan"]);const Ve=f.keyboard=new m5;this._add("keyboard",Ve);for(const le of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])l.interactive&&l[le]&&f[le].enable(l[le])}_add(l,f,y){this._handlers.push({handlerName:l,handler:f,allowed:y}),this._handlersById[l]=f}stop(l){if(!this._updatingCamera){for(const{handler:f}of this._handlers)f.reset();this._inertia.clear(),this._fireEvents({},{},l),this._changes=[]}}isActive(){for(const{handler:l}of this._handlers)if(l.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(Z3(this._eventsInProgress))||this.isZooming()}_blockedByActive(l,f,y){for(const b in l)if(b!==y&&(!f||f.indexOf(b)<0))return!0;return!1}handleWindowEvent(l){this.handleEvent(l,`${l.type}Window`)}_getMapTouches(l){const f=[];for(const y of l)this._el.contains(y.target)&&f.push(y);return f}handleEvent(l,f){this._updatingCamera=!0;const y="renderFrame"===l.type,b=y?void 0:l,M={needsRenderFrame:!1},L={},k={},N=l.touches?this._getMapTouches(l.touches):void 0,H=N?pe.touchPos(this._el,N):y?void 0:pe.mousePos(this._el,l);for(const{handlerName:J,handler:he,allowed:ae}of this._handlers){if(!he.isEnabled())continue;let ue;this._blockedByActive(k,ae,J)?he.reset():he[f||l.type]&&(ue=he[f||l.type](l,H,N),this.mergeHandlerResult(M,L,ue,J,b),ue&&ue.needsRenderFrame&&this._triggerRenderFrame()),(ue||he.isActive())&&(k[J]=he)}const $={};for(const J in this._previousActiveHandlers)k[J]||($[J]=b);this._previousActiveHandlers=k,(Object.keys($).length||nc(M))&&(this._changes.push([M,L,$]),this._triggerRenderFrame()),(Object.keys(k).length||nc(M))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:G}=M;G&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],G(this._map))}mergeHandlerResult(l,f,y,b,M){if(!y)return;p.extend(l,y);const L={handlerName:b,originalEvent:y.originalEvent||M};void 0!==y.zoomDelta&&(f.zoom=L),void 0!==y.panDelta&&(f.drag=L),void 0!==y.pitchDelta&&(f.pitch=L),void 0!==y.bearingDelta&&(f.rotate=L)}_applyChanges(){const l={},f={},y={};for(const[b,M,L]of this._changes)b.panDelta&&(l.panDelta=(l.panDelta||new p.pointGeometry(0,0))._add(b.panDelta)),b.zoomDelta&&(l.zoomDelta=(l.zoomDelta||0)+b.zoomDelta),b.bearingDelta&&(l.bearingDelta=(l.bearingDelta||0)+b.bearingDelta),b.pitchDelta&&(l.pitchDelta=(l.pitchDelta||0)+b.pitchDelta),void 0!==b.around&&(l.around=b.around),void 0!==b.aroundCoord&&(l.aroundCoord=b.aroundCoord),void 0!==b.pinchAround&&(l.pinchAround=b.pinchAround),b.noInertia&&(l.noInertia=b.noInertia),p.extend(f,M),p.extend(y,L);this._updateMapTransform(l,f,y),this._changes=[]}_updateMapTransform(l,f,y){const b=this._map,M=b.transform,L=Ae=>[Ae.x,Ae.y,Ae.z];if((Ae=>{const ke=this._eventsInProgress.drag;return ke&&!this._handlersById[ke.handlerName].isActive()})()&&!nc(l)){const Ae=M.zoom;M.cameraElevationReference="sea",M.recenterOnTerrain(),M.cameraElevationReference="ground",Ae!==M.zoom&&this._map._update(!0)}if(!nc(l))return this._fireEvents(f,y,!0);let{panDelta:k,zoomDelta:N,bearingDelta:H,pitchDelta:$,around:G,aroundCoord:J,pinchAround:he}=l;void 0!==he&&(G=he),(Ae=>f.drag&&!this._eventsInProgress.drag)()&&G&&(this._dragOrigin=L(M.pointCoordinate3D(G)),this._trackingEllipsoid.setup(M._camera.position,this._dragOrigin)),M.cameraElevationReference="sea",b._stop(!0),G=G||b.transform.centerPoint,H&&(M.bearing+=H),$&&(M.pitch+=$),M._updateCameraState();const ae=[0,0,0];if(k){const Ae=M.pointCoordinate(G),ke=M.pointCoordinate(G.sub(k));Ae&&ke&&(ae[0]=ke.x-Ae.x,ae[1]=ke.y-Ae.y)}const ue=M.zoom,Ve=[0,0,0];if(N){const Ae=L(J||M.pointCoordinate3D(G)),ke={dir:p.normalize([],p.sub([],Ae,M._camera.position))};if(ke.dir[2]<0){const Te=M.zoomDeltaToMovement(Ae,N);p.scale$2(Ve,ke.dir,Te)}}const le=p.add(ae,ae,Ve);M._translateCameraConstrained(le),N&&Math.abs(M.zoom-ue)>1e-4&&M.recenterOnTerrain(),M.cameraElevationReference="ground",this._map._update(),l.noInertia||this._inertia.record(l),this._fireEvents(f,y,!0)}_fireEvents(l,f,y){const b=Z3(this._eventsInProgress),M=Z3(l),L={};for(const $ in l){const{originalEvent:G}=l[$];this._eventsInProgress[$]||(L[`${$}start`]=G),this._eventsInProgress[$]=l[$]}!b&&M&&this._fireEvent("movestart",M.originalEvent);for(const $ in L)this._fireEvent($,L[$]);M&&this._fireEvent("move",M.originalEvent);for(const $ in l){const{originalEvent:G}=l[$];this._fireEvent($,G)}const k={};let N;for(const $ in this._eventsInProgress){const{handlerName:G,originalEvent:J}=this._eventsInProgress[$];this._handlersById[G].isActive()||(delete this._eventsInProgress[$],N=f[G]||J,k[`${$}end`]=N)}for(const $ in k)this._fireEvent($,k[$]);const H=Z3(this._eventsInProgress);if(y&&(b||M)&&!H){this._updatingCamera=!0;const $=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),G=J=>0!==J&&-this._bearingSnap{delete this._frameId,this.handleEvent(new ad("renderFrame",{timeStamp:l})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const Y3="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class ld extends p.Evented{constructor(l,f){super(),this._moving=!1,this._zooming=!1,this.transform=l,this._bearingSnap=f.bearingSnap,p.bindAll(["_renderFrameCallback"],this)}getCenter(){return new p.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(l,f){return this.jumpTo({center:l},f)}panBy(l,f,y){return l=p.pointGeometry.convert(l).mult(-1),this.panTo(this.transform.center,p.extend({offset:l},f),y)}panTo(l,f,y){return this.easeTo(p.extend({center:l},f),y)}getZoom(){return this.transform.zoom}setZoom(l,f){return this.jumpTo({zoom:l},f),this}zoomTo(l,f,y){return this.easeTo(p.extend({zoom:l},f),y)}zoomIn(l,f){return this.zoomTo(this.getZoom()+1,l,f),this}zoomOut(l,f){return this.zoomTo(this.getZoom()-1,l,f),this}getBearing(){return this.transform.bearing}setBearing(l,f){return this.jumpTo({bearing:l},f),this}getPadding(){return this.transform.padding}setPadding(l,f){return this.jumpTo({padding:l},f),this}rotateTo(l,f,y){return this.easeTo(p.extend({bearing:l},f),y)}resetNorth(l,f){return this.rotateTo(0,p.extend({duration:1e3},l),f),this}resetNorthPitch(l,f){return this.easeTo(p.extend({bearing:0,pitch:0,duration:1e3},l),f),this}snapToNorth(l,f){return Math.abs(this.getBearing())At=>{if(De&&(nn.zoom=p.number(b,N,At)),Oe&&(nn.bearing=p.number(M,H,At)),pt&&(nn.pitch=p.number(L,$,At)),Tt&&(nn.interpolatePadding(k,G,At),he=nn.centerPoint.add(J)),ke)nn.setLocationAtPoint(ke,Te);else{const vt=nn.zoomScale(nn.zoom-b),Yt=N>b?Math.min(2,Ae):Math.max(.5,Ae),Bt=Math.pow(Yt,1-At),Gn=nn.unproject(Ve.add(le.mult(At*Bt)).mult(vt));nn.setLocationAtPoint(nn.renderWorldCopies?Gn.wrap():Gn,he)}return l.preloadOnly||this._fireMoveEvents(f),nn};if(l.preloadOnly){const nn=this._emulate(hn,l.duration,y);return this._preloadTiles(nn),this}const sn={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=De,this._rotating=Oe,this._pitching=pt,this._padding=Tt,this._easeId=l.easeId,this._prepareEase(f,l.noMoveStart,sn),this._ease(hn(y),nn=>{y.recenterOnTerrain(),this._afterEase(f,nn)},l),this}_prepareEase(l,f,y={}){this._moving=!0,this.transform.cameraElevationReference="sea",f||y.moving||this.fire(new p.Event("movestart",l)),this._zooming&&!y.zooming&&this.fire(new p.Event("zoomstart",l)),this._rotating&&!y.rotating&&this.fire(new p.Event("rotatestart",l)),this._pitching&&!y.pitching&&this.fire(new p.Event("pitchstart",l))}_fireMoveEvents(l){this.fire(new p.Event("move",l)),this._zooming&&this.fire(new p.Event("zoom",l)),this._rotating&&this.fire(new p.Event("rotate",l)),this._pitching&&this.fire(new p.Event("pitch",l))}_afterEase(l,f){if(this._easeId&&f&&this._easeId===f)return;delete this._easeId,this.transform.cameraElevationReference="ground";const y=this._zooming,b=this._rotating,M=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,y&&this.fire(new p.Event("zoomend",l)),b&&this.fire(new p.Event("rotateend",l)),M&&this.fire(new p.Event("pitchend",l)),this.fire(new p.Event("moveend",l))}flyTo(l,f){if(!l.essential&&p.exported.prefersReducedMotion){const fn=p.pick(l,["center","zoom","bearing","pitch","around"]);return this.jumpTo(fn,f)}this.stop(),l=p.extend({offset:[0,0],speed:1.2,curve:1.42,easing:p.ease},l);const y=this.transform,b=this.getZoom(),M=this.getBearing(),L=this.getPitch(),k=this.getPadding(),N="zoom"in l?p.clamp(+l.zoom,y.minZoom,y.maxZoom):b,H="bearing"in l?this._normalizeBearing(l.bearing,M):M,$="pitch"in l?+l.pitch:L,G="padding"in l?l.padding:y.padding,J=y.zoomScale(N-b),he=p.pointGeometry.convert(l.offset);let ae=y.centerPoint.add(he);const ue=y.pointLocation(ae),Ve=p.LngLat.convert(l.center||ue);this._normalizeCenter(Ve);const le=y.project(ue),Ae=y.project(Ve).sub(le);let ke=l.curve;const Te=Math.max(y.width,y.height),De=Te/J,Oe=Ae.mag();if("minZoom"in l){const fn=p.clamp(Math.min(l.minZoom,b,N),y.minZoom,y.maxZoom),Jn=Te/y.zoomScale(fn-b);ke=Math.sqrt(Jn/Oe*2)}const pt=ke*ke;function Tt(fn){const Jn=(De*De-Te*Te+(fn?-1:1)*pt*pt*Oe*Oe)/(2*(fn?De:Te)*pt*Oe);return Math.log(Math.sqrt(Jn*Jn+1)-Jn)}function hn(fn){return(Math.exp(fn)-Math.exp(-fn))/2}function sn(fn){return(Math.exp(fn)+Math.exp(-fn))/2}const nn=Tt(0);let At=function(fn){return sn(nn)/sn(nn+ke*fn)},vt=function(fn){return Te*((sn(nn)*(hn(Jn=nn+ke*fn)/sn(Jn))-hn(nn))/pt)/Oe;var Jn},Yt=(Tt(1)-nn)/ke;if(Math.abs(Oe)<1e-6||!isFinite(Yt)){if(Math.abs(Te-De)<1e-6)return this.easeTo(l,f);const fn=Del.maxDuration&&(l.duration=0);const Bt=M!==H,Gn=$!==L,ii=!y.isPaddingEqual(G),Pi=fn=>Jn=>{const gi=Jn*Yt,cr=1/At(gi);fn.zoom=1===Jn?N:b+fn.scaleZoom(cr),Bt&&(fn.bearing=p.number(M,H,Jn)),Gn&&(fn.pitch=p.number(L,$,Jn)),ii&&(fn.interpolatePadding(k,G,Jn),ae=fn.centerPoint.add(he));const Nr=1===Jn?Ve:fn.unproject(le.add(Ae.mult(vt(gi))).mult(cr));return fn.setLocationAtPoint(fn.renderWorldCopies?Nr.wrap():Nr,ae),fn._updateCenterElevation(),l.preloadOnly||this._fireMoveEvents(f),fn};if(l.preloadOnly){const fn=this._emulate(Pi,l.duration,y);return this._preloadTiles(fn),this}return this._zooming=!0,this._rotating=Bt,this._pitching=Gn,this._padding=ii,this._prepareEase(f,!1),this._ease(Pi(y),()=>this._afterEase(f),l),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(l,f){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const y=this._onEaseEnd;delete this._onEaseEnd,y.call(this,f)}if(!l){const y=this.handlers;y&&y.stop(!1)}return this}_ease(l,f,y){!1===y.animate||0===y.duration?(l(1),f()):(this._easeStart=p.exported.now(),this._easeOptions=y,this._onEaseFrame=l,this._onEaseEnd=f,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const l=Math.min((p.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(l)),l<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(l,f){l=p.wrap(l,-180,180);const y=Math.abs(l-f);return Math.abs(l-360-f)180?-360:y<-180?360:0}_emulate(l,f,y){const b=Math.ceil(15*f/1e3),M=[],L=l(y.clone());for(let k=0;k<=b;k++){const N=L(k/b);M.push(N.clone())}return M}}class pu{constructor(l={}){this.options=l,p.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(l){const f=this.options&&this.options.compact;return this._map=l,this._container=pe.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=pe.create("button","mapboxgl-ctrl-attrib-button",this._container),pe.create("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden",!0),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=pe.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),f&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===f&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(l,f){const y=this._map._getUIString(`AttributionControl.${f}`);l.setAttribute("aria-label",y),l.removeAttribute("title"),l.firstElementChild&&l.firstElementChild.setAttribute("title",y)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let l=this._editLink;l||(l=this._editLink=this._container.querySelector(".mapbox-improve-map"));const f=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||p.config.ACCESS_TOKEN}];if(l){const y=f.reduce((b,M,L)=>(M.value&&(b+=`${M.key}=${M.value}${Lb.length-M.length),l=l.filter((b,M)=>{for(let L=M+1;L=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?l=[...this.options.customAttribution,...l]:l.unshift(this.options.customAttribution));const y=l.join(" | ");y!==this._attribHTML&&(this._attribHTML=y,l.length?(this._innerContainer.innerHTML=y,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class Qc{constructor(){p.bindAll(["_updateLogo"],this),p.bindAll(["_updateCompact"],this)}onAdd(l){this._map=l,this._container=pe.create("div","mapboxgl-ctrl");const f=pe.create("a","mapboxgl-ctrl-logo");return f.target="_blank",f.rel="noopener nofollow",f.href="https://www.mapbox.com/",f.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),f.setAttribute("rel","noopener nofollow"),this._container.appendChild(f),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(l){l&&"metadata"!==l.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const l=this._map.style._sourceCaches;if(0===Object.entries(l).length)return!0;for(const f in l){const y=l[f].getSource();if(y.hasOwnProperty("mapbox_logo")&&!y.mapbox_logo)return!1}return!0}_updateCompact(){const l=this._container.children;if(l.length){const f=l[0];this._map.getCanvasContainer().offsetWidth<250?f.classList.add("mapboxgl-compact"):f.classList.remove("mapboxgl-compact")}}}class mu{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(l){const f=++this._id;return this._queue.push({callback:l,id:f,cancelled:!1}),f}remove(l){const f=this._currentlyRunning,y=f?this._queue.concat(f):this._queue;for(const b of y)if(b.id===l)return void(b.cancelled=!0)}run(l=0){const f=this._currentlyRunning=this._queue;this._queue=[];for(const y of f)if(!y.cancelled&&(y.callback(l),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function gu(v,l,f){if(v=new p.LngLat(v.lng,v.lat),l){const y=new p.LngLat(v.lng-360,v.lat),b=new p.LngLat(v.lng+360,v.lat),M=360*Math.ceil(Math.abs(v.lng-f.center.lng)/360),L=f.locationPoint(v).distSqr(l),k=l.x<0||l.y<0||l.x>f.width||l.y>f.height;f.locationPoint(y).distSqr(l)180;){const y=f.locationPoint(v);if(y.x>=0&&y.y>=0&&y.x<=f.width&&y.y<=f.height)break;v.lng>f.center.lng?v.lng-=360:v.lng+=360}return v}const qs={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};class Cu extends p.Evented{constructor(l,f){if(super(),(l instanceof p.window.HTMLElement||f)&&(l=p.extend({element:l},f)),p.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=l&&l.anchor||"center",this._color=l&&l.color||"#3FB1CE",this._scale=l&&l.scale||1,this._draggable=l&&l.draggable||!1,this._clickTolerance=l&&l.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=l&&l.rotation||0,this._rotationAlignment=l&&l.rotationAlignment||"auto",this._pitchAlignment=l&&l.pitchAlignment&&"auto"!==l.pitchAlignment?l.pitchAlignment:this._rotationAlignment,this._updateMoving=()=>this._update(!0),l&&l.element)this._element=l.element,this._offset=p.pointGeometry.convert(l&&l.offset||[0,0]);else{this._defaultMarker=!0,this._element=pe.create("div");const b=41,M=27,L=pe.createSVG("svg",{display:"block",height:b*this._scale+"px",width:M*this._scale+"px",viewBox:`0 0 ${M} ${b}`},this._element),k=pe.createSVG("radialGradient",{id:"shadowGradient"},pe.createSVG("defs",{},L));pe.createSVG("stop",{offset:"10%","stop-opacity":.4},k),pe.createSVG("stop",{offset:"100%","stop-opacity":.05},k),pe.createSVG("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},L),pe.createSVG("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},L),pe.createSVG("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},L),pe.createSVG("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},L),this._offset=p.pointGeometry.convert(l&&l.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",b=>{b.preventDefault()}),this._element.addEventListener("mousedown",b=>{b.preventDefault()});const y=this._element.classList;for(const b in qs)y.remove(`mapboxgl-marker-anchor-${b}`);y.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(l){return l===this._map||(this.remove(),this._map=l,l.getCanvasContainer().appendChild(this._element),l.on("move",this._updateMoving),l.on("moveend",this._update),l.on("remove",this._clearFadeTimer),l._addMarker(this),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick)),this}remove(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._updateMoving),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._map.off("remove",this._clearFadeTimer),this._map._removeMarker(this),delete this._map),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(l){return this._lngLat=p.LngLat.convert(l),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(l){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),l){if(!("offset"in l.options)){const f=38.1,y=13.5,b=Math.sqrt(Math.pow(y,2)/2);l.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-f],"bottom-left":[b,-1*(f-y+b)],"bottom-right":[-b,-1*(f-y+b)],left:[y,-1*(f-y)],right:[-y,-1*(f-y)]}:this._offset}this._popup=l,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(l){const f=l.code,y=l.charCode||l.keyCode;"Space"!==f&&"Enter"!==f&&32!==y&&13!==y||this.togglePopup()}_onMapClick(l){const f=l.originalEvent.target,y=this._element;this._popup&&(f===y||y.contains(f))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const l=this._popup;return l?(l.isOpen()?(l.remove(),this._element.setAttribute("aria-expanded","false")):(l.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_evaluateOpacity(){const l=this._pos?this._pos.sub(this._transformedOffset()):null;if(!this._withinScreenBounds(l))return void this._clearFadeTimer();const f=this._map.unproject(l);let y=!1;if(this._map.transform._terrainEnabled()&&this._map.getTerrain()){const M=this._map.getFreeCameraOptions();if(M.position){const L=M.position.toLngLat();y=L.distanceTo(f)<.9*L.distanceTo(this._lngLat)}}const b=(1-this._map._queryFogOpacity(f))*(y?.2:1);this._element.style.opacity=`${b}`,this._popup&&this._popup._setOpacity(`${b}`),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_withinScreenBounds(l){const f=this._map.transform;return!!l&&l.x>=0&&l.x=0&&l.y{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),this._map._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),!this._map.getTerrain()&&!this._map.getFog()||this._fadeTimer||(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}_transformedOffset(){if(!this._defaultMarker)return this._offset;const l=this._map.transform,f=this._offset.mult(this._scale);return"map"===this._rotationAlignment&&f._rotate(l.angle),"map"===this._pitchAlignment&&(f.y*=Math.cos(l._pitch)),f}getOffset(){return this._offset}setOffset(l){return this._offset=p.pointGeometry.convert(l),this._update(),this}_onMove(l){if(!this._isDragging){const f=this._clickTolerance||this._map._clickTolerance;this._isDragging=l.point.dist(this._pointerdownPos)>=f}this._isDragging&&(this._pos=l.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 p.Event("dragstart"))),this.fire(new p.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new p.Event("dragend")),this._state="inactive"}_addDragHandler(l){this._element.contains(l.originalEvent.target)&&(l.preventDefault(),this._positionDelta=l.point.sub(this._pos).add(this._transformedOffset()),this._pointerdownPos=l.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(l){return this._draggable=!!l,this._map&&(l?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(l){return this._rotation=l||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(l){return this._rotationAlignment=l||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(l){return this._pitchAlignment=l&&"auto"!==l?l:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}class u1{constructor(l){this.jumpTo(l)}getValue(l){if(l<=this._startTime)return this._start;if(l>=this._endTime)return this._end;const f=p.easeCubicInOut((l-this._startTime)/(this._endTime-this._startTime));return this._start*(1-f)+this._end*f}isEasing(l){return l>=this._startTime&&l<=this._endTime}jumpTo(l){this._startTime=-1/0,this._endTime=-1/0,this._start=l,this._end=l}easeTo(l,f,y){this._start=this.getValue(f),this._end=l,this._startTime=f,this._endTime=f+y}}const cd={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use \u2318 + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},{HTMLImageElement:O1,HTMLElement:Rs,ImageBitmap:ja}=p.window,bs={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0};function ct(v){v.parentNode&&v.parentNode.removeChild(v)}const g5={showCompass:!0,showZoom:!0,visualizePitch:!1};class gl{constructor(l,f,y=!1){this._clickTolerance=10,this.element=f,this.mouseRotate=new a1({clickTolerance:l.dragRotate._mouseRotate._clickTolerance}),this.map=l,y&&(this.mousePitch=new Ih({clickTolerance:l.dragRotate._mousePitch._clickTolerance})),p.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),f.addEventListener("mousedown",this.mousedown),f.addEventListener("touchstart",this.touchstart,{passive:!1}),f.addEventListener("touchmove",this.touchmove),f.addEventListener("touchend",this.touchend),f.addEventListener("touchcancel",this.reset)}down(l,f){this.mouseRotate.mousedown(l,f),this.mousePitch&&this.mousePitch.mousedown(l,f),pe.disableDrag()}move(l,f){const y=this.map,b=this.mouseRotate.mousemoveWindow(l,f);if(b&&b.bearingDelta&&y.setBearing(y.getBearing()+b.bearingDelta),this.mousePitch){const M=this.mousePitch.mousemoveWindow(l,f);M&&M.pitchDelta&&y.setPitch(y.getPitch()+M.pitchDelta)}}off(){const l=this.element;l.removeEventListener("mousedown",this.mousedown),l.removeEventListener("touchstart",this.touchstart,{passive:!1}),l.removeEventListener("touchmove",this.touchmove),l.removeEventListener("touchend",this.touchend),l.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){pe.enableDrag(),p.window.removeEventListener("mousemove",this.mousemove),p.window.removeEventListener("mouseup",this.mouseup)}mousedown(l){this.down(p.extend({},l,{ctrlKey:!0,preventDefault:()=>l.preventDefault()}),pe.mousePos(this.element,l)),p.window.addEventListener("mousemove",this.mousemove),p.window.addEventListener("mouseup",this.mouseup)}mousemove(l){this.move(l,pe.mousePos(this.element,l))}mouseup(l){this.mouseRotate.mouseupWindow(l),this.mousePitch&&this.mousePitch.mouseupWindow(l),this.offTemp()}touchstart(l){1!==l.targetTouches.length?this.reset():(this._startPos=this._lastPos=pe.touchPos(this.element,l.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>l.preventDefault()},this._startPos))}touchmove(l){1!==l.targetTouches.length?this.reset():(this._lastPos=pe.touchPos(this.element,l.targetTouches)[0],this.move({preventDefault:()=>l.preventDefault()},this._lastPos))}touchend(l){0===l.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)5280?vl(l,y,N/5280,v._getUIString("ScaleControl.Miles"),v):vl(l,y,N,v._getUIString("ScaleControl.Feet"),v)}else f&&"nautical"===f.unit?vl(l,y,k/1852,v._getUIString("ScaleControl.NauticalMiles"),v):k>=1e3?vl(l,y,k/1e3,v._getUIString("ScaleControl.Kilometers"),v):vl(l,y,k,v._getUIString("ScaleControl.Meters"),v)}function vl(v,l,f,y,b){const M=function(k){const N=Math.pow(10,`${Math.floor(k)}`.length-1);let H=k/N;return H=H>=10?10:H>=5?5:H>=3?3:H>=2?2:H>=1?1:function($){const G=Math.pow(10,Math.ceil(-Math.log($)/Math.LN10));return Math.round($*G)/G}(H),N*H}(f),L=M/f;b._requestDomTask(()=>{v.style.width=l*L+"px",v.innerHTML=`${M} ${y}`})}const Fh={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},J3=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),ca={version:p.version,supported:Qe,setRTLTextPlugin:p.setRTLTextPlugin,getRTLTextPluginStatus:p.getRTLTextPluginStatus,Map:class extends ld{constructor(v){if(null!=(v=p.extend({},bs,v)).minZoom&&null!=v.maxZoom&&v.minZoom>v.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=v.minPitch&&null!=v.maxPitch&&v.minPitch>v.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=v.minPitch&&v.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=v.maxPitch&&v.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new au(v.minZoom,v.maxZoom,v.minPitch,v.maxPitch,v.renderWorldCopies),v),this._interactive=v.interactive,this._minTileCacheSize=v.minTileCacheSize,this._maxTileCacheSize=v.maxTileCacheSize,this._failIfMajorPerformanceCaveat=v.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=v.preserveDrawingBuffer,this._antialias=v.antialias,this._trackResize=v.trackResize,this._bearingSnap=v.bearingSnap,this._refreshExpiredTiles=v.refreshExpiredTiles,this._fadeDuration=v.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=v.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=v.collectResourceTiming,this._optimizeForTerrain=v.optimizeForTerrain,this._renderTaskQueue=new mu,this._domRenderTaskQueue=new mu,this._controls=[],this._markers=[],this._mapId=p.uniqueId(),this._locale=p.extend({},cd,v.locale),this._clickTolerance=v.clickTolerance,this._cooperativeGestures=v.cooperativeGestures,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevation=new u1(0),this._requestManager=new p.RequestManager(v.transformRequest,v.accessToken,v.testMode),this._silenceAuthErrors=!!v.testMode,"string"==typeof v.container){if(this._container=p.window.document.getElementById(v.container),!this._container)throw new Error(`Container '${v.container}' not found.`)}else{if(!(v.container instanceof Rs))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=v.container}if(this._container.childNodes.length>0&&p.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),v.maxBounds&&this.setMaxBounds(v.maxBounds),p.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),void 0!==p.window&&(p.window.addEventListener("online",this._onWindowOnline,!1),p.window.addEventListener("resize",this._onWindowResize,!1),p.window.addEventListener("orientationchange",this._onWindowResize,!1),p.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1)),this.handlers=new ic(this,v),this._localFontFamily=v.localFontFamily,this._localIdeographFontFamily=v.localIdeographFontFamily,v.style&&this.setStyle(v.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),v.projection&&this.setProjection(v.projection),this._hash=v.hash&&new rd("string"==typeof v.hash&&v.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:v.center,zoom:v.zoom,bearing:v.bearing,pitch:v.pitch}),v.bounds&&(this.resize(),this.fitBounds(v.bounds,p.extend({},v.fitBoundsOptions,{duration:0})))),this.resize(),v.attributionControl&&this.addControl(new pu({customAttribution:v.customAttribution})),this._logoControl=new Qc,this.addControl(this._logoControl,v.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",l=>{this._update("style"===l.dataType),this.fire(new p.Event(`${l.dataType}data`,l))}),this.on("dataloading",l=>{this.fire(new p.Event(`${l.dataType}dataloading`,l))})}_getMapId(){return this._mapId}addControl(v,l){if(void 0===l&&(l=v.getDefaultPosition?v.getDefaultPosition():"top-right"),!v||!v.onAdd)return this.fire(new p.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const f=v.onAdd(this);this._controls.push(v);const y=this._controlPositions[l];return-1!==l.indexOf("bottom")?y.insertBefore(f,y.firstChild):y.appendChild(f),this}removeControl(v){if(!v||!v.onRemove)return this.fire(new p.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const l=this._controls.indexOf(v);return l>-1&&this._controls.splice(l,1),v.onRemove(this),this}hasControl(v){return this._controls.indexOf(v)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(v){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const l=!this._moving;return l&&this.fire(new p.Event("movestart",v)).fire(new p.Event("move",v)),this.fire(new p.Event("resize",v)),l&&this.fire(new p.Event("moveend",v)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(v){return this.transform.setMaxBounds(p.LngLatBounds.convert(v)),this._update()}setMinZoom(v){if((v=null==v?-2:v)>=-2&&v<=this.transform.maxZoom)return this.transform.minZoom=v,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=v,this._update(),this.getZoom()>v?this.setZoom(v):this.fire(new p.Event("zoomstart")).fire(new p.Event("zoom")).fire(new p.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(v){if((v=null==v?0:v)<0)throw new Error("minPitch must be greater than or equal to 0");if(v>=0&&v<=this.transform.maxPitch)return this.transform.minPitch=v,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(v>=this.transform.minPitch)return this.transform.maxPitch=v,this._update(),this.getPitch()>v?this.setPitch(v):this.fire(new p.Event("pitchstart")).fire(new p.Event("pitch")).fire(new p.Event("pitchend")),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(v){return this.transform.renderWorldCopies=v,this._update()}getProjection(){return this.transform.getProjection()}setProjection(v){return this._lazyInitEmptyStyle(),"string"==typeof v&&(v={name:v}),this._runtimeProjection=v,this.style.updateProjection(),this._transitionFromGlobe=!1,this}project(v){return this.transform.locationPoint3D(p.LngLat.convert(v))}unproject(v){return this.transform.pointLocation3D(p.pointGeometry.convert(v))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()}_createDelegatedListener(v,l,f){if("mouseenter"===v||"mouseover"===v){let y=!1;const b=L=>{const k=l.filter(H=>this.getLayer(H)),N=k.length?this.queryRenderedFeatures(L.point,{layers:k}):[];N.length?y||(y=!0,f.call(this,new Or(v,this,L.originalEvent,{features:N}))):y=!1},M=()=>{y=!1};return{layers:new Set(l),listener:f,delegates:{mousemove:b,mouseout:M}}}if("mouseleave"===v||"mouseout"===v){let y=!1;const b=L=>{const k=l.filter(N=>this.getLayer(N));(k.length?this.queryRenderedFeatures(L.point,{layers:k}):[]).length?y=!0:y&&(y=!1,f.call(this,new Or(v,this,L.originalEvent)))},M=L=>{y&&(y=!1,f.call(this,new Or(v,this,L.originalEvent)))};return{layers:new Set(l),listener:f,delegates:{mousemove:b,mouseout:M}}}{const y=b=>{const M=l.filter(k=>this.getLayer(k)),L=M.length?this.queryRenderedFeatures(b.point,{layers:M}):[];L.length&&(b.features=L,f.call(this,b),delete b.features)};return{layers:new Set(l),listener:f,delegates:{[v]:y}}}}on(v,l,f){if(void 0===f)return super.on(v,l);Array.isArray(l)||(l=[l]);const y=this._createDelegatedListener(v,l,f);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[v]=this._delegatedListeners[v]||[],this._delegatedListeners[v].push(y);for(const b in y.delegates)this.on(b,y.delegates[b]);return this}once(v,l,f){if(void 0===f)return super.once(v,l);Array.isArray(l)||(l=[l]);const y=this._createDelegatedListener(v,l,f);for(const b in y.delegates)this.once(b,y.delegates[b]);return this}off(v,l,f){if(void 0===f)return super.off(v,l);l=new Set(Array.isArray(l)?l:[l]);const y=(M,L)=>{if(M.size!==L.size)return!1;for(const k of M)if(!L.has(k))return!1;return!0},b=this._delegatedListeners?this._delegatedListeners[v]:void 0;return b&&(M=>{for(let L=0;L{b?this.fire(new p.ErrorEvent(b)):M&&this._updateDiff(M,l)})}else"object"==typeof v&&this._updateDiff(v,l)}_updateDiff(v,l){try{this.style.setState(v)&&this._update(!0)}catch(f){p.warnOnce(`Unable to perform style diff: ${f.message||f.error||f}. Rebuilding the style from scratch.`),this._updateStyle(v,l)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():p.warnOnce("There is no style added to the map.")}addSource(v,l){return this._lazyInitEmptyStyle(),this.style.addSource(v,l),this._update(!0)}isSourceLoaded(v){const l=this.style&&this.style._getSourceCaches(v);if(0!==l.length)return l.every(f=>f.loaded());this.fire(new p.ErrorEvent(new Error(`There is no source with ID '${v}'`)))}areTilesLoaded(){const v=this.style&&this.style._sourceCaches;for(const l in v){const f=v[l]._tiles;for(const y in f){const b=f[y];if("loaded"!==b.state&&"errored"!==b.state)return!1}}return!0}addSourceType(v,l,f){return this._lazyInitEmptyStyle(),this.style.addSourceType(v,l,f)}removeSource(v){return this.style.removeSource(v),this._updateTerrain(),this._update(!0)}getSource(v){return this.style.getSource(v)}addImage(v,l,{pixelRatio:f=1,sdf:y=!1,stretchX:b,stretchY:M,content:L}={}){if(this._lazyInitEmptyStyle(),l instanceof O1||ja&&l instanceof ja){const{width:k,height:N,data:H}=p.exported.getImageData(l);this.style.addImage(v,{data:new p.RGBAImage({width:k,height:N},H),pixelRatio:f,stretchX:b,stretchY:M,content:L,sdf:y,version:0})}else{if(void 0===l.width||void 0===l.height)return this.fire(new p.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:k,height:N,data:H}=l,$=l;this.style.addImage(v,{data:new p.RGBAImage({width:k,height:N},new Uint8Array(H)),pixelRatio:f,stretchX:b,stretchY:M,content:L,sdf:y,version:0,userImage:$}),$.onAdd&&$.onAdd(this,v)}}}updateImage(v,l){const f=this.style.getImage(v);if(!f)return this.fire(new p.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const y=l instanceof O1||ja&&l instanceof ja?p.exported.getImageData(l):l,{width:b,height:M,data:L}=y;return void 0===b||void 0===M?this.fire(new p.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):b!==f.data.width||M!==f.data.height?this.fire(new p.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(f.data.replace(L,!(l instanceof O1||ja&&l instanceof ja)),void this.style.updateImage(v,f))}hasImage(v){return v?!!this.style.getImage(v):(this.fire(new p.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(v){this.style.removeImage(v)}loadImage(v,l){p.getImage(this._requestManager.transformRequest(v,p.ResourceType.Image),(f,y)=>{l(f,y instanceof O1?p.exported.getImageData(y):y)})}listImages(){return this.style.listImages()}addLayer(v,l){return this._lazyInitEmptyStyle(),this.style.addLayer(v,l),this._update(!0)}moveLayer(v,l){return this.style.moveLayer(v,l),this._update(!0)}removeLayer(v){return this.style.removeLayer(v),this._update(!0)}getLayer(v){return this.style.getLayer(v)}setLayerZoomRange(v,l,f){return this.style.setLayerZoomRange(v,l,f),this._update(!0)}setFilter(v,l,f={}){return this.style.setFilter(v,l,f),this._update(!0)}getFilter(v){return this.style.getFilter(v)}setPaintProperty(v,l,f,y={}){return this.style.setPaintProperty(v,l,f,y),this._update(!0)}getPaintProperty(v,l){return this.style.getPaintProperty(v,l)}setLayoutProperty(v,l,f,y={}){return this.style.setLayoutProperty(v,l,f,y),this._update(!0)}getLayoutProperty(v,l){return this.style.getLayoutProperty(v,l)}setLight(v,l={}){return this._lazyInitEmptyStyle(),this.style.setLight(v,l),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(v){return this._lazyInitEmptyStyle(),!v&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(v),this._averageElevationLastSampledAt=-1/0,this._update(!0)}_updateProjection(){"globe"===this.transform.projection.name&&this.transform.zoom>=p.GLOBE_ZOOM_THRESHOLD_MAX&&!this._transitionFromGlobe&&(this.setProjection({name:"mercator"}),this._transitionFromGlobe=!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(v){return this._lazyInitEmptyStyle(),this.style.setFog(v),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(v){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(p.LngLat.convert(v),this.transform):0}setFeatureState(v,l){return this.style.setFeatureState(v,l),this._update()}removeFeatureState(v,l){return this.style.removeFeatureState(v,l),this._update()}getFeatureState(v){return this.style.getFeatureState(v)}_updateContainerDimensions(){if(!this._container)return;const v=this._container.getBoundingClientRect().width||400,l=this._container.getBoundingClientRect().height||300;let f,y=this._container;for(;y&&!f;){const b=p.window.getComputedStyle(y).transform;b&&"none"!==b&&(f=b.match(/matrix.*\((.+)\)/)[1].split(", ")),y=y.parentElement}f?(this._containerWidth=f[0]&&"0"!==f[0]?Math.abs(v/f[0]):v,this._containerHeight=f[3]&&"0"!==f[3]?Math.abs(l/f[3]):l):(this._containerWidth=v,this._containerHeight=l)}_detectMissingCSS(){"rgb(250, 128, 114)"!==p.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&p.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const v=this._container;v.classList.add("mapboxgl-map"),(this._missingCSSCanary=pe.create("div","mapboxgl-canary",v)).style.visibility="hidden",this._detectMissingCSS();const l=this._canvasContainer=pe.create("div","mapboxgl-canvas-container",v);this._interactive&&l.classList.add("mapboxgl-interactive"),this._canvas=pe.create("canvas","mapboxgl-canvas",l),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const f=this._controlContainer=pe.create("div","mapboxgl-control-container",v),y=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(b=>{y[b]=pe.create("div",`mapboxgl-ctrl-${b}`,f)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(v,l){const f=p.exported.devicePixelRatio||1;this._canvas.width=f*Math.ceil(v),this._canvas.height=f*Math.ceil(l),this._canvas.style.width=`${v}px`,this._canvas.style.height=`${l}px`}_addMarker(v){this._markers.push(v)}_removeMarker(v){const l=this._markers.indexOf(v);-1!==l&&this._markers.splice(l,1)}_setupPainter(){const v=p.extend({},Qe.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),l=this._canvas.getContext("webgl",v)||this._canvas.getContext("experimental-webgl",v);l?(p.storeAuthState(l,!0),this.painter=new td(l,this.transform),this.on("data",f=>{"source"===f.dataType&&this.painter.setTileLoadedFlag(!0)}),p.exported$1.testSupport(l)):this.fire(new p.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(v){v.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new p.Event("webglcontextlost",{originalEvent:v}))}_contextRestored(v){this._setupPainter(),this.resize(),this._update(),this.fire(new p.Event("webglcontextrestored",{originalEvent:v}))}_onMapScroll(v){if(v.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(v){return this.style?(this._styleDirty=this._styleDirty||v,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(v){return this._update(),this._renderTaskQueue.add(v)}_cancelRenderFrame(v){this._renderTaskQueue.remove(v)}_requestDomTask(v){!this.loaded()||this.loaded()&&!this.isMoving()?v():this._domRenderTaskQueue.add(v)}_render(v){let l;const f=this.painter.context.extTimerQuery,y=p.exported.now();this.listens("gpu-timing-frame")&&(l=f.createQueryEXT(),f.beginQueryEXT(f.TIME_ELAPSED_EXT,l));let b=this._updateAverageElevation(y);if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(v),this._domRenderTaskQueue.run(v),this._removed)return;this._updateProjection();let M=!1;const L=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const N=this.transform.zoom,H=this.transform.pitch,$=p.exported.now();this.style.zoomHistory.update(N,$);const G=new p.EvaluationParameters(N,{now:$,fadeDuration:L,pitch:H,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),J=G.crossFadingFactor();1===J&&J===this._crossFadingFactor||(M=!0,this._crossFadingFactor=J),this.style.update(G)}if(this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),this.style._updateSources(this.transform),this._forceMarkerUpdate()),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,L,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:L,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),speedIndexTiming:this.speedIndexTiming}),this.fire(new p.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new p.Event("load"))),this.style&&(this.style.hasTransitions()||M)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const N=p.exported.now()-y;f.endQueryEXT(f.TIME_ELAPSED_EXT,l),setTimeout(()=>{const H=f.getQueryObjectEXT(l,f.QUERY_RESULT_EXT)/1e6;f.deleteQueryEXT(l),this.fire(new p.Event("gpu-timing-frame",{cpuTime:N,gpuTime:H}))},50)}if(this.listens("gpu-timing-layer")){const N=this.painter.collectGpuTimers();setTimeout(()=>{const H=this.painter.queryGpuTimers(N);this.fire(new p.Event("gpu-timing-layer",{layerTimes:H}))},50)}const k=this._sourcesDirty||this._styleDirty||this._placementDirty||b;if(k||this._repaint)this.triggerRepaint();else{const N=!this.isMoving()&&this.loaded();if(N&&(b=this._updateAverageElevation(y,!0)),b)this.triggerRepaint();else if(this._triggerFrame(!1),N&&(this.fire(new p.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const H=this._calculateSpeedIndex();this.fire(new p.Event("speedindexcompleted",{speedIndex:H})),this.speedIndexTiming=!1}}return!this._loaded||this._fullyLoaded||k||(this._fullyLoaded=!0,this._authenticate()),this}_forceMarkerUpdate(){for(const v of this._markers)v._update()}_updateAverageElevation(v,l=!1){const f=y=>(this.transform.averageElevation=y,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&f(0);if((l||v-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(v)){const y=this.transform.averageElevation;let b=this.transform.sampleAverageElevation();isNaN(b)?b=0:this._averageElevationLastSampledAt=v;const M=Math.abs(y-b);if(M>1){if(this._isInitialLoad)return this._averageElevation.jumpTo(b),f(b);this._averageElevation.easeTo(b,v,300)}else if(M>1e-4)return this._averageElevation.jumpTo(b),f(b)}return!!this._averageElevation.isEasing(v)&&f(this._averageElevation.getValue(v))}_authenticate(){p.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,v=>{if(v&&(v.message===p.AUTH_ERR_MSG||401===v.status)){const l=this.painter.context.gl;p.storeAuthState(l,!1),this._logoControl instanceof Qc&&this._logoControl._updateLogo(),l&&l.clear(l.DEPTH_BUFFER_BIT|l.COLOR_BUFFER_BIT|l.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new p.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),p.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){this.painter.updateTerrain(this.style,this.isMoving()||this.isRotating()||this.isZooming())}_calculateSpeedIndex(){const v=this.painter.canvasCopy(),l=this.painter.getCanvasCopiesAndTimestamps();l.timeStamps.push(performance.now());const f=this.painter.context.gl,y=f.createFramebuffer();function b(M){f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,M,0);const L=new Uint8Array(f.drawingBufferWidth*f.drawingBufferHeight*4);return f.readPixels(0,0,f.drawingBufferWidth,f.drawingBufferHeight,f.RGBA,f.UNSIGNED_BYTE,L),L}return f.bindFramebuffer(f.FRAMEBUFFER,y),this._canvasPixelComparison(b(v),l.canvasCopies.map(b),l.timeStamps)}_canvasPixelComparison(v,l,f){let y=f[1]-f[0];const b=v.length/4;for(let M=0;M{const f=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,f&&this._render(l)}))}_preloadTiles(v){const l=this.style&&Object.values(this.style._sourceCaches)||[];return p.asyncAll(l,(f,y)=>f._preloadTiles(v,y),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(v){this._trackResize&&this.resize({originalEvent:v})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(v){this._showTileBoundaries!==v&&(this._showTileBoundaries=v,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(v){this._showTerrainWireframe!==v&&(this._showTerrainWireframe=v,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(v){this._speedIndexTiming!==v&&(this._speedIndexTiming=v,this._update())}get showPadding(){return!!this._showPadding}set showPadding(v){this._showPadding!==v&&(this._showPadding=v,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(v){this._showCollisionBoxes!==v&&(this._showCollisionBoxes=v,v?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(v){this._showOverdrawInspector!==v&&(this._showOverdrawInspector=v,this._update())}get repaint(){return!!this._repaint}set repaint(v){this._repaint!==v&&(this._repaint=v,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(v){this._vertices=v,this._update()}_setCacheLimits(v,l){p.setCacheLimits(v,l)}get version(){return p.version}},NavigationControl:class{constructor(v){this.options=p.extend({},g5,v),this._container=pe.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",l=>l.preventDefault()),this.options.showZoom&&(p.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",l=>this._map.zoomIn({},{originalEvent:l})),pe.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",l=>this._map.zoomOut({},{originalEvent:l})),pe.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(p.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",l=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:l}):this._map.resetNorth({},{originalEvent:l})}),this._compassIcon=pe.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))}_updateZoomButtons(){const v=this._map.getZoom(),l=v===this._map.getMaxZoom(),f=v===this._map.getMinZoom();this._zoomInButton.disabled=l,this._zoomOutButton.disabled=f,this._zoomInButton.setAttribute("aria-disabled",l.toString()),this._zoomOutButton.setAttribute("aria-disabled",f.toString())}_rotateCompassArrow(){const v=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._map._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=v)})}onAdd(v){return this._map=v,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new gl(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(v,l){const f=pe.create("button",v,this._container);return f.type="button",f.addEventListener("click",l),f}_setButtonTitle(v,l){const f=this._map._getUIString(`NavigationControl.${l}`);v.setAttribute("aria-label",f),v.firstElementChild&&v.firstElementChild.setAttribute("title",f)}},GeolocateControl:class extends p.Evented{constructor(v){super(),this.options=p.extend({},K3,v),p.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation"],this),this._onDeviceOrientationListener=this._onDeviceOrientation.bind(this),this._updateMarkerRotationThrottled=k2(this._updateMarkerRotation,20)}onAdd(v){var l;return this._map=v,this._container=pe.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),l=this._setupUI,void 0!==la?l(la):void 0!==p.window.navigator.permissions?p.window.navigator.permissions.query({name:"geolocation"}).then(f=>{la="denied"!==f.state,l(la)}):(la=!!p.window.navigator.geolocation,l(la)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(p.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("zoom",this._onZoom),this._map=void 0,Q3=0,I2=!1}_isOutOfMapMaxBounds(v){const l=this._map.getMaxBounds(),f=v.coords;return l&&(f.longitudel.getEast()||f.latitudel.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(v){if(this._map){if(this._isOutOfMapMaxBounds(v))return this._setErrorState(),this.fire(new p.Event("outofmaxbounds",v)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=v,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(v),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(v),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new p.Event("geolocate",v)),this._finish()}}_updateCamera(v){const l=new p.LngLat(v.coords.longitude,v.coords.latitude),f=v.coords.accuracy,y=this._map.getBearing(),b=p.extend({bearing:y},this.options.fitBoundsOptions);this._map.fitBounds(l.toBounds(f),b,{geolocateSource:!0})}_updateMarker(v){if(v){const l=new p.LngLat(v.coords.longitude,v.coords.latitude);this._accuracyCircleMarker.setLngLat(l).addTo(this._map),this._userLocationDotMarker.setLngLat(l).addTo(this._map),this._accuracy=v.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const v=this._map._containerHeight/2,l=this._map.unproject([0,v]),f=this._map.unproject([100,v]),y=l.distanceTo(f)/100,b=Math.ceil(2*this._accuracy/y);this._circleElement.style.width=`${b}px`,this._circleElement.style.height=`${b}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(v){if(this._map){if(this.options.trackUserLocation)if(1===v.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const l=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",l),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",l),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===v.code&&I2)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new p.Event("error",v)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(v){if(this._container.addEventListener("contextmenu",l=>l.preventDefault()),this._geolocateButton=pe.create("button","mapboxgl-ctrl-geolocate",this._container),pe.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===v){p.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const l=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",l),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",l)}else{const l=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",l),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",l)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=pe.create("div","mapboxgl-user-location"),this._dotElement.appendChild(pe.create("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(pe.create("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Cu({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=pe.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Cu({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",l=>{l.geolocateSource||"ACTIVE_LOCK"!==this._watchState||l.originalEvent&&"resize"===l.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new p.Event("trackuserlocationend")))})}_onDeviceOrientation(v){this._userLocationDotMarker&&(v.webkitCompassHeading?this._heading=v.webkitCompassHeading:!0===v.absolute&&(this._heading=-1*v.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return p.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new p.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Q3--,I2=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new p.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new p.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let v;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Q3++,Q3>1?(v={maximumAge:6e5,timeout:0},I2=!0):(v=this.options.positionOptions,I2=!1),this._geolocationWatchID=p.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,v),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else p.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const v=()=>{p.window.addEventListener("ondeviceorientationabsolute"in p.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientationListener)};void 0!==p.window.DeviceMotionEvent&&"function"==typeof p.window.DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(l=>{"granted"===l&&v()}).catch(console.error):v()}_clearWatch(){p.window.navigator.geolocation.clearWatch(this._geolocationWatchID),p.window.removeEventListener("deviceorientation",this._onDeviceOrientationListener),p.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientationListener),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:pu,ScaleControl:class{constructor(v){this.options=p.extend({},Cl,v),p.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){En(this._map,this._container,this.options)}onAdd(v){return this._map=v,this._container=pe.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",v.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}setUnit(v){this.options.unit=v,En(this._map,this._container,this.options)}},FullscreenControl:class{constructor(v){this._fullscreen=!1,v&&v.container&&(v.container instanceof p.window.HTMLElement?this._container=v.container:p.warnOnce("Full screen control 'container' must be a DOM element.")),p.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in p.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in p.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(v){return this._map=v,this._container||(this._container=this._map.getContainer()),this._controlContainer=pe.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",p.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,p.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!p.window.document.fullscreenEnabled&&!p.window.document.webkitFullscreenEnabled)}_setupUI(){const v=this._fullscreenButton=pe.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);pe.create("span","mapboxgl-ctrl-icon",v).setAttribute("aria-hidden",!0),v.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),p.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const v=this._getTitle();this._fullscreenButton.setAttribute("aria-label",v),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",v)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(p.window.document.fullscreenElement||p.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?p.window.document.exitFullscreen?p.window.document.exitFullscreen():p.window.document.webkitCancelFullScreen&&p.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends p.Evented{constructor(v){super(),this.options=p.extend(Object.create(Fh),v),p.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this),this._classList=new Set(v&&v.className?v.className.trim().split(/\s+/):[])}addTo(v){return this._map&&this.remove(),this._map=v,this.options.closeOnClick&&this._map.on("preclick",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new p.Event("open")),this}isOpen(){return!!this._map}remove(){return 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("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new p.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(v){return this._lngLat=p.LngLat.convert(v),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(v){return this.setDOMContent(p.window.document.createTextNode(v))}setHTML(v){const l=p.window.document.createDocumentFragment(),f=p.window.document.createElement("body");let y;for(f.innerHTML=v;y=f.firstChild,y;)l.appendChild(y);return this.setDOMContent(l)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(v){return this.options.maxWidth=v,this._update(),this}setDOMContent(v){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=pe.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(v),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(v){return this._classList.add(v),this._container&&this._updateClassList(),this}removeClassName(v){return this._classList.delete(v),this._container&&this._updateClassList(),this}setOffset(v){return this.options.offset=v,this._update(),this}toggleClassName(v){let l;return this._classList.delete(v)?l=!1:(this._classList.add(v),l=!0),this._container&&this._updateClassList(),l}_createCloseButton(){this.options.closeButton&&(this._closeButton=pe.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.setAttribute("aria-hidden","true"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(v){this._update(v.point)}_onMouseMove(v){this._update(v.point)}_onDrag(v){this._update(v.point)}_getAnchor(v){if(this.options.anchor)return this.options.anchor;const l=this._pos,f=this._container.offsetWidth,y=this._container.offsetHeight;let b;return b=l.y+v.bottom.ythis._map.transform.height-y?["bottom"]:[],l.xthis._map.transform.width-f/2&&b.push("right"),0===b.length?"bottom":b.join("-")}_updateClassList(){const v=[...this._classList];v.push("mapboxgl-popup"),this._anchor&&v.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&v.push("mapboxgl-popup-track-pointer"),this._container.className=v.join(" ")}_update(v){if(this._map&&(this._lngLat||this._trackPointer)&&this._content){if(this._container||(this._container=pe.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=pe.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content)),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=gu(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||v){const l=this._pos=this._trackPointer&&v?v:this._map.project(this._lngLat),f=function(M){if(M||(M=new p.pointGeometry(0,0)),"number"==typeof M){const L=Math.round(Math.sqrt(.5*Math.pow(M,2)));return{center:new p.pointGeometry(0,0),top:new p.pointGeometry(0,M),"top-left":new p.pointGeometry(L,L),"top-right":new p.pointGeometry(-L,L),bottom:new p.pointGeometry(0,-M),"bottom-left":new p.pointGeometry(L,-L),"bottom-right":new p.pointGeometry(-L,-L),left:new p.pointGeometry(M,0),right:new p.pointGeometry(-M,0)}}if(M instanceof p.pointGeometry||Array.isArray(M)){const L=p.pointGeometry.convert(M);return{center:L,top:L,"top-left":L,"top-right":L,bottom:L,"bottom-left":L,"bottom-right":L,left:L,right:L}}return{center:p.pointGeometry.convert(M.center||[0,0]),top:p.pointGeometry.convert(M.top||[0,0]),"top-left":p.pointGeometry.convert(M["top-left"]||[0,0]),"top-right":p.pointGeometry.convert(M["top-right"]||[0,0]),bottom:p.pointGeometry.convert(M.bottom||[0,0]),"bottom-left":p.pointGeometry.convert(M["bottom-left"]||[0,0]),"bottom-right":p.pointGeometry.convert(M["bottom-right"]||[0,0]),left:p.pointGeometry.convert(M.left||[0,0]),right:p.pointGeometry.convert(M.right||[0,0])}}(this.options.offset),y=this._anchor=this._getAnchor(f),b=l.add(f[y]).round();this._map._requestDomTask(()=>{this._container&&y&&(this._container.style.transform=`${qs[y]} translate(${b.x}px,${b.y}px)`)})}this._updateClassList()}}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const v=this._container.querySelector(J3);v&&v.focus()}_onClose(){this.remove()}_setOpacity(v){this._content&&(this._content.style.opacity=v),this._tip&&(this._tip.style.opacity=v)}},Marker:Cu,Style:ya,LngLat:p.LngLat,LngLatBounds:p.LngLatBounds,Point:p.pointGeometry,MercatorCoordinate:p.MercatorCoordinate,FreeCameraOptions:Ba,Evented:p.Evented,config:p.config,prewarm:function(){He().acquire(Ue)},clearPrewarmedResources:function(){const v=Re;v&&(v.isPreloaded()&&1===v.numActive()?(v.release(Ue),Re=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return p.config.ACCESS_TOKEN},set accessToken(v){p.config.ACCESS_TOKEN=v},get baseApiUrl(){return p.config.API_URL},set baseApiUrl(v){p.config.API_URL=v},get workerCount(){return tt.workerCount},set workerCount(v){tt.workerCount=v},get maxParallelImageRequests(){return p.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(v){p.config.MAX_PARALLEL_IMAGE_REQUESTS=v},clearStorage(v){p.clearTileCache(v)},workerUrl:"",workerClass:null,setNow:p.exported.setNow,restoreNow:p.exported.restoreNow};return ca}),fe}()},3213:(kt,qt,ye)=>{"use strict";const fe=Symbol.prototype.valueOf,be=ye(7930);kt.exports=function(re,pe){switch(be(re)){case"array":return re.slice();case"object":return Object.assign({},re);case"date":return new re.constructor(Number(re));case"map":return new Map(re);case"set":return new Set(re);case"buffer":return function(re){const pe=re.length,Xe=Buffer.allocUnsafe?Buffer.allocUnsafe(pe):Buffer.from(pe);return re.copy(Xe),Xe}(re);case"symbol":return function(re){return fe?Object(fe.call(re)):{}}(re);case"arraybuffer":return function(re){const pe=new re.constructor(re.byteLength);return new Uint8Array(pe).set(new Uint8Array(re)),pe}(re);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return function(re,pe){return new re.constructor(re.buffer,re.byteOffset,re.length)}(re);case"regexp":return function(re){const pe=void 0!==re.flags?re.flags:/\w+$/.exec(re)||void 0,Xe=new re.constructor(re.source,pe);return Xe.lastIndex=re.lastIndex,Xe}(re);case"error":return Object.create(re);default:return re}}},9053:function(kt){(function(){kt.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},2870:function(kt){(function(){kt.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},3146:function(kt){(function(){var qt,ye,fe,be,Me,p,Qe,Fe={}.hasOwnProperty;qt=function(ne,...de){var re,pe,Xe,ze;if(Me(Object.assign))Object.assign.apply(null,arguments);else for(re=0,Xe=de.length;re":"attribute: {"+Fe+"}, parent: <"+this.parent.name+">"}isEqualNode(Fe){return!(Fe.namespaceURI!==this.namespaceURI||Fe.prefix!==this.prefix||Fe.localName!==this.localName||Fe.value!==this.value)}}return Object.defineProperty(p.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(p.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(p.prototype,"textContent",{get:function(){return this.value},set:function(Qe){return this.value=Qe||""}}),Object.defineProperty(p.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(p.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(p.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(p.prototype,"specified",{get:function(){return!0}}),p}.call(this)}).call(this)},9832:function(kt,qt,ye){(function(){var fe,Me;fe=ye(2870),Me=ye(6068),kt.exports=class extends Me{constructor(Qe,Fe){if(super(Qe),null==Fe)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=fe.CData,this.value=this.stringify.cdata(Fe)}clone(){return Object.create(this)}toString(Qe){return this.options.writer.cdata(this,this.options.writer.filterOptions(Qe))}}}).call(this)},6068:function(kt,qt,ye){(function(){var be;be=ye(6627),kt.exports=function(){class Me extends be{constructor(Qe){super(Qe),this.value=""}clone(){return Object.create(this)}substringData(Qe,Fe){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendData(Qe){throw new Error("This DOM method is not implemented."+this.debugInfo())}insertData(Qe,Fe){throw new Error("This DOM method is not implemented."+this.debugInfo())}deleteData(Qe,Fe){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceData(Qe,Fe,ne){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(Qe){return!(!super.isEqualNode(Qe)||Qe.data!==this.data)}}return Object.defineProperty(Me.prototype,"data",{get:function(){return this.value},set:function(p){return this.value=p||""}}),Object.defineProperty(Me.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(Me.prototype,"textContent",{get:function(){return this.value},set:function(p){return this.value=p||""}}),Me}.call(this)}).call(this)},3940:function(kt,qt,ye){(function(){var fe,be;fe=ye(2870),be=ye(6068),kt.exports=class extends be{constructor(Qe,Fe){if(super(Qe),null==Fe)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=fe.Comment,this.value=this.stringify.comment(Fe)}clone(){return Object.create(this)}toString(Qe){return this.options.writer.comment(this,this.options.writer.filterOptions(Qe))}}}).call(this)},4817:function(kt,qt,ye){(function(){var be,Me;be=ye(4551),Me=ye(3569),kt.exports=function(){class p{constructor(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new be,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=Object.create(this.defaultParams)}getParameter(Fe){return this.params.hasOwnProperty(Fe)?this.params[Fe]:null}canSetParameter(Fe,ne){return!0}setParameter(Fe,ne){return null!=ne?this.params[Fe]=ne:delete this.params[Fe]}}return Object.defineProperty(p.prototype,"parameterNames",{get:function(){return new Me(Object.keys(this.defaultParams))}}),p}.call(this)}).call(this)},4551:function(kt){(function(){kt.exports=class{constructor(){}handleError(fe){throw new Error(fe)}}}).call(this)},7951:function(kt){(function(){kt.exports=class{hasFeature(fe,be){return!0}createDocumentType(fe,be,Me){throw new Error("This DOM method is not implemented.")}createDocument(fe,be,Me){throw new Error("This DOM method is not implemented.")}createHTMLDocument(fe){throw new Error("This DOM method is not implemented.")}getFeature(fe,be){throw new Error("This DOM method is not implemented.")}}}).call(this)},3569:function(kt){(function(){kt.exports=function(){class ye{constructor(be){this.arr=be||[]}item(be){return this.arr[be]||null}contains(be){return-1!==this.arr.indexOf(be)}}return Object.defineProperty(ye.prototype,"length",{get:function(){return this.arr.length}}),ye}.call(this)}).call(this)},438:function(kt,qt,ye){(function(){var fe,Me;Me=ye(6627),fe=ye(2870),kt.exports=class extends Me{constructor(Qe,Fe,ne,de,re,pe){if(super(Qe),null==Fe)throw new Error("Missing DTD element name. "+this.debugInfo());if(null==ne)throw new Error("Missing DTD attribute name. "+this.debugInfo(Fe));if(!de)throw new Error("Missing DTD attribute type. "+this.debugInfo(Fe));if(!re)throw new Error("Missing DTD attribute default. "+this.debugInfo(Fe));if(0!==re.indexOf("#")&&(re="#"+re),!re.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(Fe));if(pe&&!re.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(Fe));this.elementName=this.stringify.name(Fe),this.type=fe.AttributeDeclaration,this.attributeName=this.stringify.name(ne),this.attributeType=this.stringify.dtdAttType(de),pe&&(this.defaultValue=this.stringify.dtdAttDefault(pe)),this.defaultValueType=re}toString(Qe){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(Qe))}}}).call(this)},3020:function(kt,qt,ye){(function(){var fe,Me;Me=ye(6627),fe=ye(2870),kt.exports=class extends Me{constructor(Qe,Fe,ne){if(super(Qe),null==Fe)throw new Error("Missing DTD element name. "+this.debugInfo());ne||(ne="(#PCDATA)"),Array.isArray(ne)&&(ne="("+ne.join(",")+")"),this.name=this.stringify.name(Fe),this.type=fe.ElementDeclaration,this.value=this.stringify.dtdElementValue(ne)}toString(Qe){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(Qe))}}}).call(this)},15:function(kt,qt,ye){(function(){var fe,Me,p;({isObject:p}=ye(3146)),Me=ye(6627),fe=ye(2870),kt.exports=function(){class Qe extends Me{constructor(ne,de,re,pe){if(super(ne),null==re)throw new Error("Missing DTD entity name. "+this.debugInfo(re));if(null==pe)throw new Error("Missing DTD entity value. "+this.debugInfo(re));if(this.pe=!!de,this.name=this.stringify.name(re),this.type=fe.EntityDeclaration,p(pe)){if(!pe.pubID&&!pe.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(re));if(pe.pubID&&!pe.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(re));if(this.internal=!1,null!=pe.pubID&&(this.pubID=this.stringify.dtdPubID(pe.pubID)),null!=pe.sysID&&(this.sysID=this.stringify.dtdSysID(pe.sysID)),null!=pe.nData&&(this.nData=this.stringify.dtdNData(pe.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(re))}else this.value=this.stringify.dtdEntityValue(pe),this.internal=!0}toString(ne){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(ne))}}return Object.defineProperty(Qe.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(Qe.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(Qe.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(Qe.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(Qe.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(Qe.prototype,"xmlVersion",{get:function(){return null}}),Qe}.call(this)}).call(this)},6600:function(kt,qt,ye){(function(){var fe,Me;Me=ye(6627),fe=ye(2870),kt.exports=function(){class p extends Me{constructor(Fe,ne,de){if(super(Fe),null==ne)throw new Error("Missing DTD notation name. "+this.debugInfo(ne));if(!de.pubID&&!de.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(ne));this.name=this.stringify.name(ne),this.type=fe.NotationDeclaration,null!=de.pubID&&(this.pubID=this.stringify.dtdPubID(de.pubID)),null!=de.sysID&&(this.sysID=this.stringify.dtdSysID(de.sysID))}toString(Fe){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(Fe))}}return Object.defineProperty(p.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(p.prototype,"systemId",{get:function(){return this.sysID}}),p}.call(this)}).call(this)},9413:function(kt,qt,ye){(function(){var fe,Me,p;({isObject:p}=ye(3146)),Me=ye(6627),fe=ye(2870),kt.exports=class extends Me{constructor(Fe,ne,de,re){super(Fe),p(ne)&&({version:ne,encoding:de,standalone:re}=ne),ne||(ne="1.0"),this.type=fe.Declaration,this.version=this.stringify.xmlVersion(ne),null!=de&&(this.encoding=this.stringify.xmlEncoding(de)),null!=re&&(this.standalone=this.stringify.xmlStandalone(re))}toString(Fe){return this.options.writer.declaration(this,this.options.writer.filterOptions(Fe))}}}).call(this)},7905:function(kt,qt,ye){(function(){var fe,be,Me,p,Qe,ne,de,re;({isObject:re}=ye(3146)),de=ye(6627),fe=ye(2870),be=ye(438),p=ye(15),Me=ye(3020),Qe=ye(6600),ne=ye(5631),kt.exports=function(){class pe extends de{constructor(ze,Le,Pe){var at,Je,_t,qe;if(super(ze),this.type=fe.DocType,ze.children)for(Je=0,_t=(qe=ze.children).length;Je<_t;Je++)if((at=qe[Je]).type===fe.Element){this.name=at.name;break}this.documentObject=ze,re(Le)&&({pubID:Le,sysID:Pe}=Le),null==Pe&&([Pe,Le]=[Le,Pe]),null!=Le&&(this.pubID=this.stringify.dtdPubID(Le)),null!=Pe&&(this.sysID=this.stringify.dtdSysID(Pe))}element(ze,Le){var Pe;return Pe=new Me(this,ze,Le),this.children.push(Pe),this}attList(ze,Le,Pe,at,Je){var _t;return _t=new be(this,ze,Le,Pe,at,Je),this.children.push(_t),this}entity(ze,Le){var Pe;return Pe=new p(this,!1,ze,Le),this.children.push(Pe),this}pEntity(ze,Le){var Pe;return Pe=new p(this,!0,ze,Le),this.children.push(Pe),this}notation(ze,Le){var Pe;return Pe=new Qe(this,ze,Le),this.children.push(Pe),this}toString(ze){return this.options.writer.docType(this,this.options.writer.filterOptions(ze))}ele(ze,Le){return this.element(ze,Le)}att(ze,Le,Pe,at,Je){return this.attList(ze,Le,Pe,at,Je)}ent(ze,Le){return this.entity(ze,Le)}pent(ze,Le){return this.pEntity(ze,Le)}not(ze,Le){return this.notation(ze,Le)}up(){return this.root()||this.documentObject}isEqualNode(ze){return!(!super.isEqualNode(ze)||ze.name!==this.name||ze.publicId!==this.publicId||ze.systemId!==this.systemId)}}return Object.defineProperty(pe.prototype,"entities",{get:function(){var Xe,ze,Le,Pe,at;for(Pe={},ze=0,Le=(at=this.children).length;ze=0;)this.up();return this.onEnd()}openCurrent(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)}openNode(Ce){var ut,lt,Ct;if(!Ce.isOpen){if(!this.root&&0===this.currentLevel&&Ce.type===fe.Element&&(this.root=Ce),ut="",Ce.type===fe.Element){for(lt in this.writerOptions.state=be.OpenTag,ut=this.writer.indent(Ce,this.writerOptions,this.currentLevel)+"<"+Ce.name,Ct=Ce.attribs)!je.call(Ct,lt)||(ut+=this.writer.attribute(Ct[lt],this.writerOptions,this.currentLevel));ut+=(Ce.children?">":"/>")+this.writer.endline(Ce,this.writerOptions,this.currentLevel),this.writerOptions.state=be.InsideTag}else this.writerOptions.state=be.OpenTag,ut=this.writer.indent(Ce,this.writerOptions,this.currentLevel)+""),ut+=this.writer.endline(Ce,this.writerOptions,this.currentLevel);return this.onData(ut,this.currentLevel),Ce.isOpen=!0}}closeNode(Ce){var Ye;if(!Ce.isClosed)return"",this.writerOptions.state=be.CloseTag,Ye=Ce.type===fe.Element?this.writer.indent(Ce,this.writerOptions,this.currentLevel)+""+this.writer.endline(Ce,this.writerOptions,this.currentLevel):this.writer.indent(Ce,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(Ce,this.writerOptions,this.currentLevel),this.writerOptions.state=be.None,this.onData(Ye,this.currentLevel),Ce.isClosed=!0}onData(Ce,Ye){return this.documentStarted=!0,this.onDataCallback(Ce,Ye+1)}onEnd(){return this.documentCompleted=!0,this.onEndCallback()}debugInfo(Ce){return null==Ce?"":"node: <"+Ce+">"}ele(){return this.element(...arguments)}nod(Ce,Ye,ut){return this.node(Ce,Ye,ut)}txt(Ce){return this.text(Ce)}dat(Ce){return this.cdata(Ce)}com(Ce){return this.comment(Ce)}ins(Ce,Ye){return this.instruction(Ce,Ye)}dec(Ce,Ye,ut){return this.declaration(Ce,Ye,ut)}dtd(Ce,Ye,ut){return this.doctype(Ce,Ye,ut)}e(Ce,Ye,ut){return this.element(Ce,Ye,ut)}n(Ce,Ye,ut){return this.node(Ce,Ye,ut)}t(Ce){return this.text(Ce)}d(Ce){return this.cdata(Ce)}c(Ce){return this.comment(Ce)}r(Ce){return this.raw(Ce)}i(Ce,Ye){return this.instruction(Ce,Ye)}att(){return this.currentNode&&this.currentNode.type===fe.DocType?this.attList(...arguments):this.attribute(...arguments)}a(){return this.currentNode&&this.currentNode.type===fe.DocType?this.attList(...arguments):this.attribute(...arguments)}ent(Ce,Ye){return this.entity(Ce,Ye)}pent(Ce,Ye){return this.pEntity(Ce,Ye)}not(Ce,Ye){return this.notation(Ce,Ye)}}}).call(this)},1616:function(kt,qt,ye){(function(){var fe,Me;Me=ye(6627),fe=ye(2870),kt.exports=class extends Me{constructor(Qe){super(Qe),this.type=fe.Dummy}clone(){return Object.create(this)}toString(Qe){return""}}}).call(this)},7770:function(kt,qt,ye){(function(){var fe,be,p,Qe,Fe,ne,de,re={}.hasOwnProperty;({isObject:de,isFunction:ne,getValue:Fe}=ye(3146)),Qe=ye(6627),fe=ye(2870),be=ye(8828),p=ye(5631),kt.exports=function(){class pe extends Qe{constructor(ze,Le,Pe){var at,Je,_t,qe;if(super(ze),null==Le)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(Le),this.type=fe.Element,this.attribs={},this.schemaTypeInfo=null,null!=Pe&&this.attribute(Pe),ze.type===fe.Document&&(this.isRoot=!0,this.documentObject=ze,ze.rootObject=this,ze.children))for(Je=0,_t=(qe=ze.children).length;Je<_t;Je++)if((at=qe[Je]).type===fe.DocType){at.name=this.name;break}}clone(){var Le,Pe,at;for(Le in(Pe=Object.create(this)).isRoot&&(Pe.documentObject=null),Pe.attribs={},at=this.attribs)!re.call(at,Le)||(Pe.attribs[Le]=at[Le].clone());return Pe.children=[],this.children.forEach(function(Je){var _t;return(_t=Je.clone()).parent=Pe,Pe.children.push(_t)}),Pe}attribute(ze,Le){var Pe;if(null!=ze&&(ze=Fe(ze)),de(ze))for(Pe in ze)!re.call(ze,Pe)||this.attribute(Pe,ze[Pe]);else ne(Le)&&(Le=Le.apply()),this.options.keepNullAttributes&&null==Le?this.attribs[ze]=new be(this,ze,""):null!=Le&&(this.attribs[ze]=new be(this,ze,Le));return this}removeAttribute(ze){var Pe,at;if(null==ze)throw new Error("Missing attribute name. "+this.debugInfo());if(ze=Fe(ze),Array.isArray(ze))for(Pe=0,at=ze.length;Pe=at;Le=0<=at?++Pe:--Pe)if(!this.attribs[Le].isEqualNode(ze.attribs[Le]))return!1;return!0}}return Object.defineProperty(pe.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(pe.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(pe.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(pe.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(pe.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(pe.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(pe.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(pe.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new p(this.attribs)),this.attributeMap}}),pe}.call(this)}).call(this)},5631:function(kt){(function(){kt.exports=function(){class ye{constructor(be){this.nodes=be}clone(){return this.nodes=null}getNamedItem(be){return this.nodes[be]}setNamedItem(be){var Me;return Me=this.nodes[be.nodeName],this.nodes[be.nodeName]=be,Me||null}removeNamedItem(be){var Me;return Me=this.nodes[be],delete this.nodes[be],Me||null}item(be){return this.nodes[Object.keys(this.nodes)[be]]||null}getNamedItemNS(be,Me){throw new Error("This DOM method is not implemented.")}setNamedItemNS(be){throw new Error("This DOM method is not implemented.")}removeNamedItemNS(be,Me){throw new Error("This DOM method is not implemented.")}}return Object.defineProperty(ye.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),ye}.call(this)}).call(this)},6627:function(kt,qt,ye){(function(){var fe,be,Me,p,Qe,Fe,ne,de,Xe,ze,Le,Pe,at,Je,_t,qe,It={}.hasOwnProperty,ge=[].splice;({isObject:qe,isFunction:_t,isEmpty:Je,getValue:at}=ye(3146)),de=null,Me=null,p=null,Qe=null,Fe=null,Le=null,Pe=null,ze=null,ne=null,be=null,Xe=null,fe=null,kt.exports=function(){class ce{constructor(q){this.parent=q,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,de||(de=ye(7770),Me=ye(9832),p=ye(3940),Qe=ye(9413),Fe=ye(7905),Le=ye(9166),Pe=ye(504),ze=ye(2726),ne=ye(1616),be=ye(2870),Xe=ye(7137),ye(5631),fe=ye(9053))}setParent(q){var nt,Ce,Ye,ut;for(this.parent=q,q&&(this.options=q.options,this.stringify=q.stringify),ut=[],nt=0,Ce=(Ye=this.children).length;nt":(null!=(nt=this.parent)?nt.name:void 0)?"node: <"+q+">, parent: <"+this.parent.name+">":"node: <"+q+">":""}ele(q,je,nt){return this.element(q,je,nt)}nod(q,je,nt){return this.node(q,je,nt)}txt(q){return this.text(q)}dat(q){return this.cdata(q)}com(q){return this.comment(q)}ins(q,je){return this.instruction(q,je)}doc(){return this.document()}dec(q,je,nt){return this.declaration(q,je,nt)}e(q,je,nt){return this.element(q,je,nt)}n(q,je,nt){return this.node(q,je,nt)}t(q){return this.text(q)}d(q){return this.cdata(q)}c(q){return this.comment(q)}r(q){return this.raw(q)}i(q,je){return this.instruction(q,je)}u(){return this.up()}importXMLBuilder(q){return this.importDocument(q)}attribute(q,je){throw new Error("attribute() applies to element nodes only.")}att(q,je){return this.attribute(q,je)}a(q,je){return this.attribute(q,je)}removeAttribute(q){throw new Error("attribute() applies to element nodes only.")}replaceChild(q,je){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeChild(q){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendChild(q){throw new Error("This DOM method is not implemented."+this.debugInfo())}hasChildNodes(){return 0!==this.children.length}cloneNode(q){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalize(){throw new Error("This DOM method is not implemented."+this.debugInfo())}isSupported(q,je){return!0}hasAttributes(){return 0!==this.attribs.length}compareDocumentPosition(q){var nt;return this===q?0:this.document()!==q.document()?(nt=fe.Disconnected|fe.ImplementationSpecific,Math.random()<.5?nt|=fe.Preceding:nt|=fe.Following,nt):this.isAncestor(q)?fe.Contains|fe.Preceding:this.isDescendant(q)?fe.Contains|fe.Following:this.isPreceding(q)?fe.Preceding:fe.Following}isSameNode(q){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupPrefix(q){throw new Error("This DOM method is not implemented."+this.debugInfo())}isDefaultNamespace(q){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupNamespaceURI(q){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(q){var je,nt,Ce;if(q.nodeType!==this.nodeType||q.children.length!==this.children.length)return!1;for(je=nt=0,Ce=this.children.length-1;0<=Ce?nt<=Ce:nt>=Ce;je=0<=Ce?++nt:--nt)if(!this.children[je].isEqualNode(q.children[je]))return!1;return!0}getFeature(q,je){throw new Error("This DOM method is not implemented."+this.debugInfo())}setUserData(q,je,nt){throw new Error("This DOM method is not implemented."+this.debugInfo())}getUserData(q){throw new Error("This DOM method is not implemented."+this.debugInfo())}contains(q){return!!q&&(q===this||this.isDescendant(q))}isDescendant(q){var je,Ce,Ye,ut;for(Ce=0,Ye=(ut=this.children).length;Cent}treePosition(q){var je,nt;return nt=0,je=!1,this.foreachTreeNode(this.document(),function(Ce){if(nt++,!je&&Ce===q)return je=!0}),je?nt:-1}foreachTreeNode(q,je){var nt,Ce,Ye,ut,lt;for(q||(q=this.document()),Ce=0,Ye=(ut=q.children).length;Ce0){for(this.stream.write(" ["),this.stream.write(this.endline(ne,de,re)),de.state=be.InsideTag,Xe=0,ze=(Le=ne.children).length;Xe"),this.stream.write(this.endline(ne,de,re)),de.state=be.None,this.closeNode(ne,de,re)}element(ne,de,re){var Le,Pe,at,Je,_t,qe,ge,ce,Ge,q,je,nt;if(re||(re=0),this.openNode(ne,de,re),de.state=be.OpenTag,ge=this.indent(ne,de,re)+"<"+ne.name,de.pretty&&de.width>0)for(qe in Je=ge.length,Ge=ne.attribs)!Qe.call(Ge,qe)||(Je+(ce=this.attribute(Ge[qe],de,re)).length>de.width?(nt=this.indent(ne,de,re+1)+ce,ge+=this.endline(ne,de,re)+nt,Je=nt.length):(ge+=nt=" "+ce,Je+=nt.length));else for(qe in q=ne.attribs)!Qe.call(q,qe)||(ge+=this.attribute(q[qe],de,re));if(this.stream.write(ge),Pe=0===(Le=ne.children.length)?null:ne.children[0],0===Le||ne.children.every(function(Ce){return(Ce.type===fe.Text||Ce.type===fe.Raw||Ce.type===fe.CData)&&""===Ce.value}))de.allowEmpty?(this.stream.write(">"),de.state=be.CloseTag,this.stream.write("")):(de.state=be.CloseTag,this.stream.write(de.spaceBeforeSlash+"/>"));else if(!de.pretty||1!==Le||Pe.type!==fe.Text&&Pe.type!==fe.Raw&&Pe.type!==fe.CData||null==Pe.value){for(this.stream.write(">"+this.endline(ne,de,re)),de.state=be.InsideTag,at=0,_t=(je=ne.children).length;at<_t;at++)this.writeChildNode(je[at],de,re+1);de.state=be.CloseTag,this.stream.write(this.indent(ne,de,re)+"")}else this.stream.write(">"),de.state=be.InsideTag,de.suppressPrettyCount++,this.writeChildNode(Pe,de,re+1),de.suppressPrettyCount--,de.state=be.CloseTag,this.stream.write("");return this.stream.write(this.endline(ne,de,re)),de.state=be.None,this.closeNode(ne,de,re)}processingInstruction(ne,de,re){return this.stream.write(super.processingInstruction(ne,de,re))}raw(ne,de,re){return this.stream.write(super.raw(ne,de,re))}text(ne,de,re){return this.stream.write(super.text(ne,de,re))}dtdAttList(ne,de,re){return this.stream.write(super.dtdAttList(ne,de,re))}dtdElement(ne,de,re){return this.stream.write(super.dtdElement(ne,de,re))}dtdEntity(ne,de,re){return this.stream.write(super.dtdEntity(ne,de,re))}dtdNotation(ne,de,re){return this.stream.write(super.dtdNotation(ne,de,re))}}}).call(this)},8337:function(kt,qt,ye){(function(){var be;be=ye(6425),kt.exports=class extends be{constructor(p){super(p)}document(p,Qe){var ne,de,re,pe;for(Qe=this.filterOptions(Qe),re="",ne=0,de=(pe=p.children).length;ne","]]]]>"),this.assertLegalChar(Me))}comment(Me){if(this.options.noValidation)return Me;if((Me=""+Me||"").match(/--/))throw new Error("Comment text cannot contain double-hypen: "+Me);return this.assertLegalChar(Me)}raw(Me){return this.options.noValidation?Me:""+Me||""}attValue(Me){return this.options.noValidation?Me:this.assertLegalChar(this.attEscape(Me=""+Me||""))}insTarget(Me){return this.options.noValidation?Me:this.assertLegalChar(""+Me||"")}insValue(Me){if(this.options.noValidation)return Me;if((Me=""+Me||"").match(/\?>/))throw new Error("Invalid processing instruction value: "+Me);return this.assertLegalChar(Me)}xmlVersion(Me){if(this.options.noValidation)return Me;if(!(Me=""+Me||"").match(/1\.[0-9]+/))throw new Error("Invalid version number: "+Me);return Me}xmlEncoding(Me){if(this.options.noValidation)return Me;if(!(Me=""+Me||"").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+Me);return this.assertLegalChar(Me)}xmlStandalone(Me){return this.options.noValidation?Me:Me?"yes":"no"}dtdPubID(Me){return this.options.noValidation?Me:this.assertLegalChar(""+Me||"")}dtdSysID(Me){return this.options.noValidation?Me:this.assertLegalChar(""+Me||"")}dtdElementValue(Me){return this.options.noValidation?Me:this.assertLegalChar(""+Me||"")}dtdAttType(Me){return this.options.noValidation?Me:this.assertLegalChar(""+Me||"")}dtdAttDefault(Me){return this.options.noValidation?Me:this.assertLegalChar(""+Me||"")}dtdEntityValue(Me){return this.options.noValidation?Me:this.assertLegalChar(""+Me||"")}dtdNData(Me){return this.options.noValidation?Me:this.assertLegalChar(""+Me||"")}assertLegalChar(Me){var p,Qe;if(this.options.noValidation)return Me;if("1.0"===this.options.version){if(p=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,void 0!==this.options.invalidCharReplacement)Me=Me.replace(p,this.options.invalidCharReplacement);else if(Qe=Me.match(p))throw new Error(`Invalid character in string: ${Me} at index ${Qe.index}`)}else if("1.1"===this.options.version)if(p=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,void 0!==this.options.invalidCharReplacement)Me=Me.replace(p,this.options.invalidCharReplacement);else if(Qe=Me.match(p))throw new Error(`Invalid character in string: ${Me} at index ${Qe.index}`);return Me}assertLegalName(Me){if(this.options.noValidation)return Me;if(!(Me=this.assertLegalChar(Me)).match(/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/))throw new Error(`Invalid character in name: ${Me}`);return Me}textEscape(Me){return this.options.noValidation?Me:Me.replace(this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g,"&").replace(//g,">").replace(/\r/g," ")}attEscape(Me){return this.options.noValidation?Me:Me.replace(this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g,"&").replace(/0?new Array(q).join(ce.indent):""}endline(ge,ce,Ge){return!ce.pretty||ce.suppressPrettyCount?"":ce.newline}attribute(ge,ce,Ge){var q;return this.openAttribute(ge,ce,Ge),q=ce.pretty&&ce.width>0?ge.name+'="'+ge.value+'"':" "+ge.name+'="'+ge.value+'"',this.closeAttribute(ge,ce,Ge),q}cdata(ge,ce,Ge){var q;return this.openNode(ge,ce,Ge),ce.state=be.OpenTag,q=this.indent(ge,ce,Ge)+""+this.endline(ge,ce,Ge),ce.state=be.None,this.closeNode(ge,ce,Ge),q}comment(ge,ce,Ge){var q;return this.openNode(ge,ce,Ge),ce.state=be.OpenTag,q=this.indent(ge,ce,Ge)+"\x3c!-- ",ce.state=be.InsideTag,q+=ge.value,ce.state=be.CloseTag,q+=" --\x3e"+this.endline(ge,ce,Ge),ce.state=be.None,this.closeNode(ge,ce,Ge),q}declaration(ge,ce,Ge){var q;return this.openNode(ge,ce,Ge),ce.state=be.OpenTag,q=this.indent(ge,ce,Ge)+"",q+=this.endline(ge,ce,Ge),ce.state=be.None,this.closeNode(ge,ce,Ge),q}docType(ge,ce,Ge){var je,nt,Ce,Ye;if(Ge||(Ge=0),this.openNode(ge,ce,Ge),ce.state=be.OpenTag,Ce=this.indent(ge,ce,Ge),Ce+="0){for(Ce+=" [",Ce+=this.endline(ge,ce,Ge),ce.state=be.InsideTag,je=0,nt=(Ye=ge.children).length;je",Ce+=this.endline(ge,ce,Ge),ce.state=be.None,this.closeNode(ge,ce,Ge),Ce}element(ge,ce,Ge){var nt,Ce,Ye,ut,lt,Ct,Dt,Qt,Rn,Wt,Et,zt,Ot,mt,Lt,tn,mn;if(Ge||(Ge=0),Wt=!1,this.openNode(ge,ce,Ge),ce.state=be.OpenTag,Et=this.indent(ge,ce,Ge)+"<"+ge.name,ce.pretty&&ce.width>0)for(Rn in Ct=Et.length,Ot=ge.attribs)!qe.call(Ot,Rn)||(Ct+(zt=this.attribute(Ot[Rn],ce,Ge)).length>ce.width?(mn=this.indent(ge,ce,Ge+1)+zt,Et+=this.endline(ge,ce,Ge)+mn,Ct=mn.length):(Et+=mn=" "+zt,Ct+=mn.length));else for(Rn in mt=ge.attribs)!qe.call(mt,Rn)||(Et+=this.attribute(mt[Rn],ce,Ge));if(Ye=0===(Ce=ge.children.length)?null:ge.children[0],0===Ce||ge.children.every(function(Hn){return(Hn.type===fe.Text||Hn.type===fe.Raw||Hn.type===fe.CData)&&""===Hn.value}))ce.allowEmpty?(Et+=">",ce.state=be.CloseTag,Et+=""+this.endline(ge,ce,Ge)):(ce.state=be.CloseTag,Et+=ce.spaceBeforeSlash+"/>"+this.endline(ge,ce,Ge));else if(!ce.pretty||1!==Ce||Ye.type!==fe.Text&&Ye.type!==fe.Raw&&Ye.type!==fe.CData||null==Ye.value){if(ce.dontPrettyTextNodes)for(ut=0,Dt=(Lt=ge.children).length;ut"+this.endline(ge,ce,Ge),ce.state=be.InsideTag,lt=0,Qt=(tn=ge.children).length;lt",Wt&&ce.suppressPrettyCount--,Et+=this.endline(ge,ce,Ge),ce.state=be.None}else Et+=">",ce.state=be.InsideTag,ce.suppressPrettyCount++,Wt=!0,Et+=this.writeChildNode(Ye,ce,Ge+1),ce.suppressPrettyCount--,Wt=!1,ce.state=be.CloseTag,Et+=""+this.endline(ge,ce,Ge);return this.closeNode(ge,ce,Ge),Et}writeChildNode(ge,ce,Ge){switch(ge.type){case fe.CData:return this.cdata(ge,ce,Ge);case fe.Comment:return this.comment(ge,ce,Ge);case fe.Element:return this.element(ge,ce,Ge);case fe.Raw:return this.raw(ge,ce,Ge);case fe.Text:return this.text(ge,ce,Ge);case fe.ProcessingInstruction:return this.processingInstruction(ge,ce,Ge);case fe.Dummy:return"";case fe.Declaration:return this.declaration(ge,ce,Ge);case fe.DocType:return this.docType(ge,ce,Ge);case fe.AttributeDeclaration:return this.dtdAttList(ge,ce,Ge);case fe.ElementDeclaration:return this.dtdElement(ge,ce,Ge);case fe.EntityDeclaration:return this.dtdEntity(ge,ce,Ge);case fe.NotationDeclaration:return this.dtdNotation(ge,ce,Ge);default:throw new Error("Unknown XML node type: "+ge.constructor.name)}}processingInstruction(ge,ce,Ge){var q;return this.openNode(ge,ce,Ge),ce.state=be.OpenTag,q=this.indent(ge,ce,Ge)+"",q+=this.endline(ge,ce,Ge),ce.state=be.None,this.closeNode(ge,ce,Ge),q}raw(ge,ce,Ge){var q;return this.openNode(ge,ce,Ge),ce.state=be.OpenTag,q=this.indent(ge,ce,Ge),ce.state=be.InsideTag,q+=ge.value,ce.state=be.CloseTag,q+=this.endline(ge,ce,Ge),ce.state=be.None,this.closeNode(ge,ce,Ge),q}text(ge,ce,Ge){var q;return this.openNode(ge,ce,Ge),ce.state=be.OpenTag,q=this.indent(ge,ce,Ge),ce.state=be.InsideTag,q+=ge.value,ce.state=be.CloseTag,q+=this.endline(ge,ce,Ge),ce.state=be.None,this.closeNode(ge,ce,Ge),q}dtdAttList(ge,ce,Ge){var q;return this.openNode(ge,ce,Ge),ce.state=be.OpenTag,q=this.indent(ge,ce,Ge)+""+this.endline(ge,ce,Ge),ce.state=be.None,this.closeNode(ge,ce,Ge),q}dtdElement(ge,ce,Ge){var q;return this.openNode(ge,ce,Ge),ce.state=be.OpenTag,q=this.indent(ge,ce,Ge)+""+this.endline(ge,ce,Ge),ce.state=be.None,this.closeNode(ge,ce,Ge),q}dtdEntity(ge,ce,Ge){var q;return this.openNode(ge,ce,Ge),ce.state=be.OpenTag,q=this.indent(ge,ce,Ge)+""+this.endline(ge,ce,Ge),ce.state=be.None,this.closeNode(ge,ce,Ge),q}dtdNotation(ge,ce,Ge){var q;return this.openNode(ge,ce,Ge),ce.state=be.OpenTag,q=this.indent(ge,ce,Ge)+""+this.endline(ge,ce,Ge),ce.state=be.None,this.closeNode(ge,ce,Ge),q}openNode(ge,ce,Ge){}closeNode(ge,ce,Ge){}openAttribute(ge,ce,Ge){}closeAttribute(ge,ce,Ge){}}}).call(this)},1741:function(kt,qt,ye){(function(){var fe,be,Me,p,Qe,Fe,ne,de,re;({assign:de,isFunction:re}=ye(3146)),Me=ye(7951),p=ye(2008),Qe=ye(5795),ne=ye(8337),Fe=ye(864),fe=ye(2870),be=ye(7159),kt.exports.create=function(pe,Xe,ze,Le){var Pe,at;if(null==pe)throw new Error("Root element needs a name.");return Le=de({},Xe,ze,Le),at=(Pe=new p(Le)).element(pe),Le.headless||(Pe.declaration(Le),(null!=Le.pubID||null!=Le.sysID)&&Pe.dtd(Le)),at},kt.exports.begin=function(pe,Xe,ze){return re(pe)&&([Xe,ze]=[pe,Xe],pe={}),Xe?new Qe(pe,Xe,ze):new p(pe)},kt.exports.stringWriter=function(pe){return new ne(pe)},kt.exports.streamWriter=function(pe,Xe){return new Fe(pe,Xe)},kt.exports.implementation=new Me,kt.exports.nodeType=fe,kt.exports.writerState=be}).call(this)},1997:(kt,qt,ye)=>{"use strict";var fe={};function be(t){return"function"==typeof t}ye.r(fe),ye.d(fe,{Bounds:()=>Ofe,Copyright:()=>Rfe,Link:()=>Nfe,Metadata:()=>Bfe,Person:()=>Hfe,Point:()=>PO,Route:()=>Ufe,Segment:()=>FO,Track:()=>VO});let Me=!1;const p={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){const n=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+n.stack)}else Me&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Me=t},get useDeprecatedSynchronousErrorHandling(){return Me}};function Qe(t){setTimeout(()=>{throw t},0)}const Fe={closed:!0,next(t){},error(t){if(p.useDeprecatedSynchronousErrorHandling)throw t;Qe(t)},complete(){}},ne=Array.isArray||(t=>t&&"number"==typeof t.length);function de(t){return null!==t&&"object"==typeof t}const pe=(()=>{function t(n){return Error.call(this),this.message=n?`${n.length} errors occurred during unsubscription:\n${n.map((e,i)=>`${i+1}) ${e.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=n,this}return t.prototype=Object.create(Error.prototype),t})();class Xe{constructor(n){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,n&&(this._ctorUnsubscribe=!0,this._unsubscribe=n)}unsubscribe(){let n;if(this.closed)return;let{_parentOrParents:e,_ctorUnsubscribe:i,_unsubscribe:r,_subscriptions:s}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,e instanceof Xe)e.remove(this);else if(null!==e)for(let c=0;cn.concat(e instanceof pe?e.errors:e),[])}Xe.EMPTY=((t=new Xe).closed=!0,t);const Le="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class at extends Xe{constructor(n,e,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=Fe;break;case 1:if(!n){this.destination=Fe;break}if("object"==typeof n){n instanceof at?(this.syncErrorThrowable=n.syncErrorThrowable,this.destination=n,n.add(this)):(this.syncErrorThrowable=!0,this.destination=new Je(this,n));break}default:this.syncErrorThrowable=!0,this.destination=new Je(this,n,e,i)}}[Le](){return this}static create(n,e,i){const r=new at(n,e,i);return r.syncErrorThrowable=!1,r}next(n){this.isStopped||this._next(n)}error(n){this.isStopped||(this.isStopped=!0,this._error(n))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(n){this.destination.next(n)}_error(n){this.destination.error(n),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:n}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=n,this}}class Je extends at{constructor(n,e,i,r){super(),this._parentSubscriber=n;let s,c=this;be(e)?s=e:e&&(s=e.next,i=e.error,r=e.complete,e!==Fe&&(c=Object.create(e),be(c.unsubscribe)&&this.add(c.unsubscribe.bind(c)),c.unsubscribe=this.unsubscribe.bind(this))),this._context=c,this._next=s,this._error=i,this._complete=r}next(n){if(!this.isStopped&&this._next){const{_parentSubscriber:e}=this;p.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,n)&&this.unsubscribe():this.__tryOrUnsub(this._next,n)}}error(n){if(!this.isStopped){const{_parentSubscriber:e}=this,{useDeprecatedSynchronousErrorHandling:i}=p;if(this._error)i&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,n),this.unsubscribe()):(this.__tryOrUnsub(this._error,n),this.unsubscribe());else if(e.syncErrorThrowable)i?(e.syncErrorValue=n,e.syncErrorThrown=!0):Qe(n),this.unsubscribe();else{if(this.unsubscribe(),i)throw n;Qe(n)}}}complete(){if(!this.isStopped){const{_parentSubscriber:n}=this;if(this._complete){const e=()=>this._complete.call(this._context);p.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?(this.__tryOrSetError(n,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(n,e){try{n.call(this._context,e)}catch(i){if(this.unsubscribe(),p.useDeprecatedSynchronousErrorHandling)throw i;Qe(i)}}__tryOrSetError(n,e,i){if(!p.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,i)}catch(r){return p.useDeprecatedSynchronousErrorHandling?(n.syncErrorValue=r,n.syncErrorThrown=!0,!0):(Qe(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:n}=this;this._context=null,this._parentSubscriber=null,n.unsubscribe()}}const It="function"==typeof Symbol&&Symbol.observable||"@@observable";function ge(t){return t}let q=(()=>{class t{constructor(e){this._isScalar=!1,e&&(this._subscribe=e)}lift(e){const i=new t;return i.source=this,i.operator=e,i}subscribe(e,i,r){const{operator:s}=this,c=function(t,n,e){if(t){if(t instanceof at)return t;if(t[Le])return t[Le]()}return t||n||e?new at(t,n,e):new at(Fe)}(e,i,r);if(c.add(s?s.call(c,this.source):this.source||p.useDeprecatedSynchronousErrorHandling&&!c.syncErrorThrowable?this._subscribe(c):this._trySubscribe(c)),p.useDeprecatedSynchronousErrorHandling&&c.syncErrorThrowable&&(c.syncErrorThrowable=!1,c.syncErrorThrown))throw c.syncErrorValue;return c}_trySubscribe(e){try{return this._subscribe(e)}catch(i){p.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=i),function(t){for(;t;){const{closed:n,destination:e,isStopped:i}=t;if(n||i)return!1;t=e&&e instanceof at?e:null}return!0}(e)?e.error(i):console.warn(i)}}forEach(e,i){return new(i=je(i))((r,s)=>{let c;c=this.subscribe(h=>{try{e(h)}catch(g){s(g),c&&c.unsubscribe()}},s,r)})}_subscribe(e){const{source:i}=this;return i&&i.subscribe(e)}[It](){return this}pipe(...e){return 0===e.length?this:function(t){return 0===t.length?ge:1===t.length?t[0]:function(e){return t.reduce((i,r)=>r(i),e)}}(e)(this)}toPromise(e){return new(e=je(e))((i,r)=>{let s;this.subscribe(c=>s=c,c=>r(c),()=>i(s))})}}return t.create=n=>new t(n),t})();function je(t){if(t||(t=p.Promise||Promise),!t)throw new Error("no Promise impl found");return t}const Ce=(()=>{function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t})();class Ye extends Xe{constructor(n,e){super(),this.subject=n,this.subscriber=e,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const n=this.subject,e=n.observers;if(this.subject=null,!e||0===e.length||n.isStopped||n.closed)return;const i=e.indexOf(this.subscriber);-1!==i&&e.splice(i,1)}}class ut extends at{constructor(n){super(n),this.destination=n}}let lt=(()=>{class t extends q{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[Le](){return new ut(this)}lift(e){const i=new Ct(this,this);return i.operator=e,i}next(e){if(this.closed)throw new Ce;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let c=0;cnew Ct(n,e),t})();class Ct extends lt{constructor(n,e){super(),this.destination=n,this.source=e}next(n){const{destination:e}=this;e&&e.next&&e.next(n)}error(n){const{destination:e}=this;e&&e.error&&this.destination.error(n)}complete(){const{destination:n}=this;n&&n.complete&&this.destination.complete()}_subscribe(n){const{source:e}=this;return e?this.source.subscribe(n):Xe.EMPTY}}function Dt(t){return t&&"function"==typeof t.schedule}function Qt(t,n){return function(i){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new Rn(t,n))}}class Rn{constructor(n,e){this.project=n,this.thisArg=e}call(n,e){return e.subscribe(new Wt(n,this.project,this.thisArg))}}class Wt extends at{constructor(n,e,i){super(n),this.project=e,this.count=0,this.thisArg=i||this}_next(n){let e;try{e=this.project.call(this.thisArg,n,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(e)}}const Et=t=>n=>{for(let e=0,i=t.length;et&&"number"==typeof t.length&&"function"!=typeof t;function wn(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}const Cr=t=>{if(t&&"function"==typeof t[It])return(t=>n=>{const e=t[It]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(n)})(t);if(Hn(t))return Et(t);if(wn(t))return(t=>n=>(t.then(e=>{n.closed||(n.next(e),n.complete())},e=>n.error(e)).then(null,Qe),n))(t);if(t&&"function"==typeof t[mt])return(t=>n=>{const e=t[mt]();for(;;){let i;try{i=e.next()}catch(r){return n.error(r),n}if(i.done){n.complete();break}if(n.next(i.value),n.closed)break}return"function"==typeof e.return&&n.add(()=>{e.return&&e.return()}),n})(t);{const e=`You provided ${de(t)?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(e)}};function Pn(t,n){return new q(e=>{const i=new Xe;let r=0;return i.add(n.schedule(function(){r!==t.length?(e.next(t[r++]),e.closed||i.add(this.schedule())):e.complete()})),i})}function Mn(t,n){return n?function(t,n){if(null!=t){if(function(t){return t&&"function"==typeof t[It]}(t))return function(t,n){return new q(e=>{const i=new Xe;return i.add(n.schedule(()=>{const r=t[It]();i.add(r.subscribe({next(s){i.add(n.schedule(()=>e.next(s)))},error(s){i.add(n.schedule(()=>e.error(s)))},complete(){i.add(n.schedule(()=>e.complete()))}}))})),i})}(t,n);if(wn(t))return function(t,n){return new q(e=>{const i=new Xe;return i.add(n.schedule(()=>t.then(r=>{i.add(n.schedule(()=>{e.next(r),i.add(n.schedule(()=>e.complete()))}))},r=>{i.add(n.schedule(()=>e.error(r)))}))),i})}(t,n);if(Hn(t))return Pn(t,n);if(function(t){return t&&"function"==typeof t[mt]}(t)||"string"==typeof t)return function(t,n){if(!t)throw new Error("Iterable cannot be null");return new q(e=>{const i=new Xe;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(n.schedule(()=>{r=t[mt](),i.add(n.schedule(function(){if(e.closed)return;let s,c;try{const h=r.next();s=h.value,c=h.done}catch(h){return void e.error(h)}c?e.complete():(e.next(s),this.schedule())}))})),i})}(t,n)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}(t,n):t instanceof q?t:new q(Cr(t))}class qi extends at{constructor(n){super(),this.parent=n}_next(n){this.parent.notifyNext(n)}_error(n){this.parent.notifyError(n),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class Mo extends at{notifyNext(n){this.destination.next(n)}notifyError(n){this.destination.error(n)}notifyComplete(){this.destination.complete()}}function Jo(t,n){if(n.closed)return;if(t instanceof q)return t.subscribe(n);let e;try{e=Cr(t)(n)}catch(i){n.error(i)}return e}function Li(t,n,e=Number.POSITIVE_INFINITY){return"function"==typeof n?i=>i.pipe(Li((r,s)=>Mn(t(r,s)).pipe(Qt((c,h)=>n(r,c,s,h))),e)):("number"==typeof n&&(e=n),i=>i.lift(new Va(t,e)))}class Va{constructor(n,e=Number.POSITIVE_INFINITY){this.project=n,this.concurrent=e}call(n,e){return e.subscribe(new K1(n,this.project,this.concurrent))}}class K1 extends Mo{constructor(n,e,i=Number.POSITIVE_INFINITY){super(n),this.project=e,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(n){this.active0?this._next(n.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function hs(t=Number.POSITIVE_INFINITY){return Li(ge,t)}function ma(t,n){return n?Pn(t,n):new q(Et(t))}function ea(...t){let n=Number.POSITIVE_INFINITY,e=null,i=t[t.length-1];return Dt(i)?(e=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof i&&(n=t.pop()),null===e&&1===t.length&&t[0]instanceof q?t[0]:hs(n)(ma(t,e))}function ga(){return function(n){return n.lift(new So(n))}}class So{constructor(n){this.connectable=n}call(n,e){const{connectable:i}=this;i._refCount++;const r=new P1(n,i),s=e.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class P1 extends at{constructor(n,e){super(n),this.connectable=e}_unsubscribe(){const{connectable:n}=this;if(!n)return void(this.connection=null);this.connectable=null;const e=n._refCount;if(e<=0)return void(this.connection=null);if(n._refCount=e-1,e>1)return void(this.connection=null);const{connection:i}=this,r=n._connection;this.connection=null,r&&(!i||r===i)&&r.unsubscribe()}}class qr extends q{constructor(n,e){super(),this.source=n,this.subjectFactory=e,this._refCount=0,this._isComplete=!1}_subscribe(n){return this.getSubject().subscribe(n)}getSubject(){const n=this._subject;return(!n||n.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let n=this._connection;return n||(this._isComplete=!1,n=this._connection=new Xe,n.add(this.source.subscribe(new Fr(this.getSubject(),this))),n.closed&&(this._connection=null,n=Xe.EMPTY)),n}refCount(){return ga()(this)}}const T2=(()=>{const t=qr.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}})();class Fr extends ut{constructor(n,e){super(n),this.connectable=e}_error(n){this._unsubscribe(),super._error(n)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const n=this.connectable;if(n){this.connectable=null;const e=n._connection;n._refCount=0,n._subject=null,n._connection=null,e&&e.unsubscribe()}}}function To(t,n){return function(i){let r;if(r="function"==typeof t?t:function(){return t},"function"==typeof n)return i.lift(new J1(r,n));const s=Object.create(i,T2);return s.source=i,s.subjectFactory=r,s}}class J1{constructor(n,e){this.subjectFactory=n,this.selector=e}call(n,e){const{selector:i}=this,r=this.subjectFactory(),s=i(r).subscribe(n);return s.add(e.subscribe(r)),s}}function t1(){return new lt}function _i(t){for(let n in t)if(t[n]===_i)return n;throw Error("Could not find renamed property on target object.")}function oo(t,n){for(const e in n)n.hasOwnProperty(e)&&!t.hasOwnProperty(e)&&(t[e]=n[e])}function oi(t){if("string"==typeof t)return t;if(Array.isArray(t))return"["+t.map(oi).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return`${t.overriddenName}`;if(t.name)return`${t.name}`;const n=t.toString();if(null==n)return""+n;const e=n.indexOf("\n");return-1===e?n:n.substring(0,e)}function No(t,n){return null==t||""===t?null===n?"":n:null==n||""===n?t:t+" "+n}const Xr=_i({__forward_ref__:_i});function oe(t){return t.__forward_ref__=oe,t.toString=function(){return oi(this())},t}function R(t){return Y(t)?t():t}function Y(t){return"function"==typeof t&&t.hasOwnProperty(Xr)&&t.__forward_ref__===oe}class _e extends Error{constructor(n,e){super(function(t,n){return`${t?`NG0${t}: `:""}${n}`}(n,e)),this.code=n}}function Re(t){return"string"==typeof t?t:null==t?"":String(t)}function He(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():Re(t)}function Zt(t,n){const e=n?` in ${n}`:"";throw new _e("201",`No provider for ${He(t)} found${e}`)}function zs(t,n){null==t&&function(t,n,e,i){throw new Error(`ASSERTION ERROR: ${t}`+(null==i?"":` [Expected=> ${e} ${i} ${n} <=Actual]`))}(n,t,null,"!=")}function Jt(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function yi(t){return{providers:t.providers||[],imports:t.imports||[]}}function js(t){return Ro(t,Z)||Ro(t,Ne)}function Ro(t,n){return t.hasOwnProperty(n)?t[n]:null}function te(t){return t&&(t.hasOwnProperty(we)||t.hasOwnProperty(yt))?t[we]:null}const Z=_i({\u0275prov:_i}),we=_i({\u0275inj:_i}),Ne=_i({ngInjectableDef:_i}),yt=_i({ngInjectorDef:_i});var Be=(()=>((Be=Be||{})[Be.Default=0]="Default",Be[Be.Host=1]="Host",Be[Be.Self=2]="Self",Be[Be.SkipSelf=4]="SkipSelf",Be[Be.Optional=8]="Optional",Be))();let Pt;function Gt(t){const n=Pt;return Pt=t,n}function gn(t,n,e){const i=js(t);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:e&Be.Optional?null:void 0!==n?n:void Zt(oi(t),"Injector")}function it(t){return{toString:t}.toString()}var Ft=(()=>((Ft=Ft||{})[Ft.OnPush=0]="OnPush",Ft[Ft.Default=1]="Default",Ft))(),mi=(()=>((mi=mi||{})[mi.Emulated=0]="Emulated",mi[mi.None=2]="None",mi[mi.ShadowDom=3]="ShadowDom",mi))();const xs="undefined"!=typeof globalThis&&globalThis,ta="undefined"!=typeof window&&window,Fc="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,an=xs||"undefined"!=typeof global&&global||ta||Fc,ia={},yr=[],Ei=_i({\u0275cmp:_i}),Yl=_i({\u0275dir:_i}),e2=_i({\u0275pipe:_i}),Oc=_i({\u0275mod:_i}),i1=_i({\u0275loc:_i}),Sr=_i({\u0275fac:_i}),R3=_i({__NG_ELEMENT_ID__:_i});let ya=0;function ht(t){return it(()=>{const e={},i={type:t.type,providersResolver:null,decls:t.decls,vars:t.vars,factory:null,template:t.template||null,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputs:null,outputs:null,exportAs:t.exportAs||null,onPush:t.changeDetection===Ft.OnPush,directiveDefs:null,pipeDefs:null,selectors:t.selectors||yr,viewQuery:t.viewQuery||null,features:t.features||null,data:t.data||{},encapsulation:t.encapsulation||mi.Emulated,id:"c",styles:t.styles||yr,_:null,setInput:null,schemas:t.schemas||null,tView:null},r=t.directives,s=t.features,c=t.pipes;return i.id+=ya++,i.inputs=wi(t.inputs,e),i.outputs=wi(t.outputs),s&&s.forEach(h=>h(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(Kl):null,i.pipeDefs=c?()=>("function"==typeof c?c():c).map(Ql):null,i})}function Kl(t){return lo(t)||function(t){return t[Yl]||null}(t)}function Ql(t){return function(t){return t[e2]||null}(t)}const nr={};function Xi(t){return it(()=>{const n={type:t.type,bootstrap:t.bootstrap||yr,declarations:t.declarations||yr,imports:t.imports||yr,exports:t.exports||yr,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null};return null!=t.id&&(nr[t.id]=t.type),n})}function wi(t,n){if(null==t)return ia;const e={};for(const i in t)if(t.hasOwnProperty(i)){let r=t[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),e[r]=i,n&&(n[r]=s)}return e}const Tn=ht;function ra(t){return{type:t.type,name:t.name,factory:null,pure:!1!==t.pure,onDestroy:t.type.prototype.ngOnDestroy||null}}function lo(t){return t[Ei]||null}function Gs(t,n){const e=t[Oc]||null;if(!e&&!0===n)throw new Error(`Type ${oi(t)} does not have '\u0275mod' property.`);return e}function Ha(t){return Array.isArray(t)&&"object"==typeof t[1]}function _a(t){return Array.isArray(t)&&!0===t[1]}function Uc(t){return 0!=(8&t.flags)}function hl(t){return 2==(2&t.flags)}function dl(t){return 1==(1&t.flags)}function Fi(t){return null!==t.template}function tu(t){return 0!=(512&t[2])}function E2(t,n){return t.hasOwnProperty(Sr)?t[Sr]:null}class o1{constructor(n,e,i){this.previousValue=n,this.currentValue=e,this.firstChange=i}isFirstChange(){return this.firstChange}}function kn(){return D2}function D2(t){return t.type.prototype.ngOnChanges&&(t.setInput=td),U3}function U3(){const t=A2(this),n=null==t?void 0:t.current;if(n){const e=t.previous;if(e===ia)t.previous=n;else for(let i in n)e[i]=n[i];t.current=null,this.ngOnChanges(n)}}function td(t,n,e,i){const r=A2(t)||function(t,n){return t[$3]=n}(t,{previous:ia,current:null}),s=r.current||(r.current={}),c=r.previous,h=this.declaredInputs[e],g=c[h];s[h]=new o1(g&&g.currentValue,n,c===ia),t[i]=n}kn.ngInherit=!0;const $3="__ngSimpleChanges__";function A2(t){return t[$3]||null}const su="http://www.w3.org/2000/svg";let Gc;function Ua(){return void 0!==Gc?Gc:"undefined"!=typeof document?document:void 0}function as(t){return!!t.listen}const k2={createRenderer:(t,n)=>Ua()};function $r(t){for(;Array.isArray(t);)t=t[0];return t}function qc(t,n){return $r(n[t])}function Di(t,n){return $r(n[t.index])}function Xc(t,n){return t.data[n]}function Or(t,n){const e=n[t];return Ha(e)?e:e[0]}function G3(t){return 4==(4&t[2])}function Ah(t){return 128==(128&t[2])}function fl(t,n){return null==n?null:t[n]}function cu(t){t[18]=0}function pl(t,n){t[5]+=n;let e=t,i=t[3];for(;null!==i&&(1===n&&1===e[5]||-1===n&&0===e[5]);)i[5]+=n,e=i,i=i[3]}const vi={lFrame:gu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function W3(){return vi.bindingsEnabled}function un(){return vi.lFrame.lView}function ir(){return vi.lFrame.tView}function bt(t){return vi.lFrame.contextLView=t,t[8]}function Ps(){let t=q3();for(;null!==t&&64===t.type;)t=t.parent;return t}function q3(){return vi.lFrame.currentTNode}function $a(t,n){const e=vi.lFrame;e.currentTNode=t,e.isParent=n}function Yc(){return vi.lFrame.isParent}function hu(){vi.lFrame.isParent=!1}function du(){return vi.isInCheckNoChangesMode}function Kc(t){vi.isInCheckNoChangesMode=t}function uo(){const t=vi.lFrame;let n=t.bindingRootIndex;return-1===n&&(n=t.bindingRootIndex=t.tView.bindingStartIndex),n}function l1(){return vi.lFrame.bindingIndex}function tc(){return vi.lFrame.bindingIndex++}function c1(t){const n=vi.lFrame,e=n.bindingIndex;return n.bindingIndex=n.bindingIndex+t,e}function Z3(t,n){const e=vi.lFrame;e.bindingIndex=e.bindingRootIndex=t,fu(n)}function fu(t){vi.lFrame.currentDirectiveIndex=t}function ic(){return vi.lFrame.currentQueryIndex}function Y3(t){vi.lFrame.currentQueryIndex=t}function ld(t){const n=t[1];return 2===n.type?n.declTNode:1===n.type?t[6]:null}function pu(t,n,e){if(e&Be.SkipSelf){let r=n,s=t;for(;!(r=r.parent,null!==r||e&Be.Host||(r=ld(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;n=r,t=s}const i=vi.lFrame=mu();return i.currentTNode=n,i.lView=t,!0}function Qc(t){const n=mu(),e=t[1];vi.lFrame=n,n.currentTNode=e.firstChild,n.lView=t,n.tView=e,n.contextLView=t,n.bindingIndex=e.bindingStartIndex,n.inI18n=!1}function mu(){const t=vi.lFrame,n=null===t?null:t.child;return null===n?gu(t):n}function gu(t){const n={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return null!==t&&(t.child=n),n}function qs(){const t=vi.lFrame;return vi.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}const Cu=qs;function u1(){const t=qs();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function Rs(){return vi.lFrame.selectedIndex}function ja(t){vi.lFrame.selectedIndex=t}function bs(){const t=vi.lFrame;return Xc(t.tView,t.selectedIndex)}function ct(){vi.lFrame.currentNamespace=su}function gl(){vi.lFrame.currentNamespace=null}function I2(t,n){for(let e=n.directiveStart,i=n.directiveEnd;e=i)break}else n[g]<0&&(t[18]+=65536),(h>11>16&&(3&t[2])===n){t[2]+=2048;try{s.call(h)}finally{}}}else try{s.call(h)}finally{}}class v{constructor(n,e,i){this.factory=n,this.resolving=!1,this.canSeeViewProviders=e,this.injectImpl=i}}function H(t,n,e){const i=as(t);let r=0;for(;rn){c=s-1;break}}}for(;s>16}(t),i=n;for(;e>0;)i=i[15],e--;return i}let Ae=!0;function ke(t){const n=Ae;return Ae=t,n}let pt=0;function hn(t,n){const e=nn(t,n);if(-1!==e)return e;const i=n[1];i.firstCreatePass&&(t.injectorIndex=n.length,sn(i.data,t),sn(n,null),sn(i.blueprint,null));const r=At(t,n),s=t.injectorIndex;if(ae(r)){const c=ue(r),h=le(r,n),g=h[1].data;for(let x=0;x<8;x++)n[s+x]=h[c+x]|g[c+x]}return n[s+8]=r,s}function sn(t,n){t.push(0,0,0,0,0,0,0,0,n)}function nn(t,n){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null===n[t.injectorIndex+8]?-1:t.injectorIndex}function At(t,n){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let e=0,i=null,r=n;for(;null!==r;){const s=r[1],c=s.type;if(i=2===c?s.declTNode:1===c?r[6]:null,null===i)return-1;if(e++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|e<<16}return-1}function vt(t,n,e){!function(t,n,e){let i;"string"==typeof e?i=e.charCodeAt(0)||0:e.hasOwnProperty(R3)&&(i=e[R3]),null==i&&(i=e[R3]=pt++);const r=255&i;n.data[t+(r>>5)]|=1<=0?255&n:fn:n}(e);if("function"==typeof s){if(!pu(n,t,i))return i&Be.Host?Bt(r,e,i):Gn(n,e,i,r);try{const c=s(i);if(null!=c||i&Be.Optional)return c;Zt(e)}finally{Cu()}}else if("number"==typeof s){let c=null,h=nn(t,n),g=-1,x=i&Be.Host?n[16][6]:null;for((-1===h||i&Be.SkipSelf)&&(g=-1===h?At(t,n):n[h+8],-1!==g&&Ri(i,!1)?(c=n[1],h=ue(g),n=le(g,n)):h=-1);-1!==h;){const S=n[1];if(Ci(s,h,S.data)){const E=Jn(h,n,e,c,i,x);if(E!==Pi)return E}g=n[h+8],-1!==g&&Ri(i,n[1].data[h+8]===x)&&Ci(s,h,n)?(c=S,h=ue(g),n=le(g,n)):h=-1}}}return Gn(n,e,i,r)}const Pi={};function fn(){return new Er(Ps(),un())}function Jn(t,n,e,i,r,s){const c=n[1],h=c.data[t+8],S=gi(h,c,e,null==i?hl(h)&&Ae:i!=c&&0!=(3&h.type),r&Be.Host&&s===h);return null!==S?cr(n,c,S,h):Pi}function gi(t,n,e,i,r){const s=t.providerIndexes,c=n.data,h=1048575&s,g=t.directiveStart,S=s>>20,A=r?h+S:t.directiveEnd;for(let F=i?h:h+S;F=g&&j.type===e)return F}if(r){const F=c[g];if(F&&Fi(F)&&F.type===e)return g}return null}function cr(t,n,e,i){let r=t[e];const s=n.data;if(function(t){return t instanceof v}(r)){const c=r;c.resolving&&function(t,n){throw new _e("200",`Circular dependency in DI detected for ${t}`)}(He(s[e]));const h=ke(c.canSeeViewProviders);c.resolving=!0;const g=c.injectImpl?Gt(c.injectImpl):null;pu(t,i,Be.Default);try{r=t[e]=c.factory(void 0,s,t,i),n.firstCreatePass&&e>=i.directiveStart&&function(t,n,e){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=n.type.prototype;if(i){const c=D2(n);(e.preOrderHooks||(e.preOrderHooks=[])).push(t,c),(e.preOrderCheckHooks||(e.preOrderCheckHooks=[])).push(t,c)}r&&(e.preOrderHooks||(e.preOrderHooks=[])).push(0-t,r),s&&((e.preOrderHooks||(e.preOrderHooks=[])).push(t,s),(e.preOrderCheckHooks||(e.preOrderCheckHooks=[])).push(t,s))}(e,s[e],n)}finally{null!==g&&Gt(g),ke(h),c.resolving=!1,Cu()}}return r}function Ci(t,n,e){return!!(e[n+(t>>5)]&1<{const n=t.prototype.constructor,e=n[Sr]||Bo(n),i=Object.prototype;let r=Object.getPrototypeOf(t.prototype).constructor;for(;r&&r!==i;){const s=r[Sr]||Bo(r);if(s&&s!==e)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Bo(t){return Y(t)?()=>{const n=Bo(R(t));return n&&n()}:E2(t)}function ho(t){return function(t,n){if("class"===n)return t.classes;if("style"===n)return t.styles;const e=t.attrs;if(e){const i=e.length;let r=0;for(;r{const i=ts(n);function r(...s){if(this instanceof r)return i.apply(this,s),this;const c=new r(...s);return h.annotation=c,h;function h(g,x,S){const E=g.hasOwnProperty(Hi)?g[Hi]:Object.defineProperty(g,Hi,{value:[]})[Hi];for(;E.length<=S;)E.push(null);return(E[S]=E[S]||[]).push(c),g}}return e&&(r.prototype=Object.create(e.prototype)),r.prototype.ngMetadataName=t,r.annotationCls=r,r})}function zr(t,n,e,i){return it(()=>{const r=ts(n);function s(...c){if(this instanceof s)return r.apply(this,c),this;const h=new s(...c);return function(x,S){const E=x.constructor,A=E.hasOwnProperty(ui)?E[ui]:Object.defineProperty(E,ui,{value:{}})[ui];A[S]=A.hasOwnProperty(S)&&A[S]||[],A[S].unshift(h),i&&i(x,S,...c)}}return e&&(s.prototype=Object.create(e.prototype)),s.prototype.ngMetadataName=t,s.annotationCls=s,s})}function e4(){return Xs("Attribute",t=>({attributeName:t,__NG_ELEMENT_ID__:()=>ho(t)}))}const z2=e4();class Xt{constructor(n,e){this._desc=n,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.\u0275prov=Jt({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}toString(){return`InjectionToken ${this._desc}`}}const ei=new Xt("AnalyzeForEntryComponents"),sc=Function;function d1(t,n){void 0===n&&(n=t);for(let e=0;eArray.isArray(e)?i2(e,n):n(e))}function t4(t,n,e){n>=t.length?t.push(e):t.splice(n,0,e)}function oc(t,n){return n>=t.length-1?t.pop():t.splice(n,1)[0]}function xl(t,n){const e=[];for(let i=0;i=0?t[1|i]=e:(i=~i,function(t,n,e,i){let r=t.length;if(r==n)t.push(e,i);else if(1===r)t.push(i,t[0]),t[0]=e;else{for(r--,t.push(t[r-1],t[r]);r>n;)t[r]=t[r-2],r--;t[n]=e,t[n+1]=i}}(t,i,n,e)),i}function bl(t,n){const e=ac(t,n);if(e>=0)return t[1|e]}function ac(t,n){return function(t,n,e){let i=0,r=t.length>>e;for(;r!==i;){const s=i+(r-i>>1),c=t[s<n?r=s:i=s+1}return~(r< ");else if("object"==typeof n){let s=[];for(let c in n)if(n.hasOwnProperty(c)){let h=n[c];s.push(c+":"+("string"==typeof h?JSON.stringify(h):oi(h)))}r=`{${s.join(", ")}}`}return`${e}${i?"("+i+")":""}[${r}]: ${t.replace(yC,"\n ")}`}("\n"+t.message,r,e,i),t.ngTokenPath=r,t[n4]=null,t}const V2=xu(Xs("Inject",t=>({token:t})),-1),ws=xu(Xs("Optional"),8),Lo=xu(Xs("SkipSelf"),4);let Rh,qa;function O2(t){var n;return(null===(n=function(){if(void 0===Rh&&(Rh=null,an.trustedTypes))try{Rh=an.trustedTypes.createPolicy("angular",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch(t){}return Rh}())||void 0===n?void 0:n.createHTML(t))||t}function R2(t){var n;return(null===(n=function(){if(void 0===qa&&(qa=null,an.trustedTypes))try{qa=an.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch(t){}return qa}())||void 0===n?void 0:n.createHTML(t))||t}class a4{constructor(n){this.changingThisBreaksApplicationSecurity=n}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class E5 extends a4{getTypeName(){return"HTML"}}class Ap extends a4{getTypeName(){return"Style"}}class wC extends a4{getTypeName(){return"Script"}}class cc extends a4{getTypeName(){return"URL"}}class l4 extends a4{getTypeName(){return"ResourceURL"}}function xa(t){return t instanceof a4?t.changingThisBreaksApplicationSecurity:t}function s2(t,n){const e=D5(t);if(null!=e&&e!==n){if("ResourceURL"===e&&"URL"===n)return!0;throw new Error(`Required a safe ${n}, got a ${e} (see https://g.co/ng/security#xss)`)}return e===n}function D5(t){return t instanceof a4&&t.getTypeName()||null}class Ip{constructor(n){this.inertDocumentHelper=n}getInertBodyElement(n){n=""+n;try{const e=(new window.DOMParser).parseFromString(O2(n),"text/html").body;return null===e?this.inertDocumentHelper.getInertBodyElement(n):(e.removeChild(e.firstChild),e)}catch(e){return null}}}class zp{constructor(n){if(this.defaultDoc=n,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const e=this.inertDocument.createElement("html");this.inertDocument.appendChild(e);const i=this.inertDocument.createElement("body");e.appendChild(i)}}getInertBodyElement(n){const e=this.inertDocument.createElement("template");if("content"in e)return e.innerHTML=O2(n),e;const i=this.inertDocument.createElement("body");return i.innerHTML=O2(n),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(n){const e=n.attributes;for(let r=e.length-1;0r3(n.trim())).join(", ")}function H2(t){const n={};for(const e of t.split(","))n[e]=!0;return n}function Bh(...t){const n={};for(const e of t)for(const i in e)e.hasOwnProperty(i)&&(n[i]=!0);return n}const Vp=H2("area,br,col,hr,img,wbr"),xd=H2("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),o2=H2("rp,rt"),I5=Bh(Vp,Bh(xd,H2("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Bh(o2,H2("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Bh(o2,xd)),z5=H2("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),bd=H2("srcset"),wd=Bh(z5,bd,H2("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),H2("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),s3=H2("script,style,template");class N1{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(n){let e=n.firstChild,i=!0;for(;e;)if(e.nodeType===Node.ELEMENT_NODE?i=this.startElement(e):e.nodeType===Node.TEXT_NODE?this.chars(e.nodeValue):this.sanitizedSomething=!0,i&&e.firstChild)e=e.firstChild;else for(;e;){e.nodeType===Node.ELEMENT_NODE&&this.endElement(e);let r=this.checkClobberedElement(e,e.nextSibling);if(r){e=r;break}e=this.checkClobberedElement(e,e.parentNode)}return this.buf.join("")}startElement(n){const e=n.nodeName.toLowerCase();if(!I5.hasOwnProperty(e))return this.sanitizedSomething=!0,!s3.hasOwnProperty(e);this.buf.push("<"),this.buf.push(e);const i=n.attributes;for(let r=0;r"),!0}endElement(n){const e=n.nodeName.toLowerCase();I5.hasOwnProperty(e)&&!Vp.hasOwnProperty(e)&&(this.buf.push(""))}chars(n){this.buf.push(Op(n))}checkClobberedElement(n,e){if(e&&(n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${n.outerHTML}`);return e}}const AC=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,P5=/([^\#-~ |!])/g;function Op(t){return t.replace(/&/g,"&").replace(AC,function(n){return"&#"+(1024*(n.charCodeAt(0)-55296)+(n.charCodeAt(1)-56320)+65536)+";"}).replace(P5,function(n){return"&#"+n.charCodeAt(0)+";"}).replace(//g,">")}let Md;function Np(t,n){let e=null;try{Md=Md||function(t){const n=new zp(t);return function(){try{return!!(new window.DOMParser).parseFromString(O2(""),"text/html")}catch(t){return!1}}()?new Ip(n):n}(t);let i=n?String(n):"";e=Md.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=e.innerHTML,e=Md.getInertBodyElement(i)}while(i!==s);return O2((new N1).sanitizeChildren(Su(e)||e))}finally{if(e){const i=Su(e)||e;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function Su(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var jr=(()=>((jr=jr||{})[jr.NONE=0]="NONE",jr[jr.HTML=1]="HTML",jr[jr.STYLE=2]="STYLE",jr[jr.SCRIPT=3]="SCRIPT",jr[jr.URL=4]="URL",jr[jr.RESOURCE_URL=5]="RESOURCE_URL",jr))();function o3(t){const n=Uh();return n?R2(n.sanitize(jr.HTML,t)||""):s2(t,"HTML")?R2(xa(t)):Np(Ua(),Re(t))}function R1(t){const n=Uh();return n?n.sanitize(jr.URL,t)||"":s2(t,"URL")?xa(t):r3(Re(t))}function Uh(){const t=un();return t&&t[12]}const $h="__ngContext__";function ua(t,n){t[$h]=n}function Tu(t){const n=function(t){return t[$h]||null}(t);return n?Array.isArray(n)?n:n.lView:null}function Ed(t){return t.ngOriginalError}function RC(t,...n){t.error(...n)}class c4{constructor(){this._console=console}handleError(n){const e=this._findOriginalError(n),i=this._findContext(n),r=function(t){return t&&t.ngErrorLogger||RC}(n);r(this._console,"ERROR",n),e&&r(this._console,"ORIGINAL ERROR",e),i&&r(this._console,"ERROR CONTEXT",i)}_findContext(n){return n?function(t){return t.ngDebugContext}(n)||this._findContext(Ed(n)):null}_findOriginalError(n){let e=n&&Ed(n);for(;e&&Ed(e);)e=Ed(e);return e||null}}const B5=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(an))();function Ad(t){return t.ownerDocument.defaultView}function B2(t){return t instanceof Function?t():t}var H1=(()=>((H1=H1||{})[H1.Important=1]="Important",H1[H1.DashCase=2]="DashCase",H1))();function $5(t,n){return undefined(t,n)}function Zh(t){const n=t[3];return _a(n)?n[3]:n}function kd(t){return Yp(t[13])}function W5(t){return Yp(t[4])}function Yp(t){for(;null!==t&&!_a(t);)t=t[4];return t}function Eu(t,n,e,i,r){if(null!=i){let s,c=!1;_a(i)?s=i:Ha(i)&&(c=!0,i=i[0]);const h=$r(i);0===t&&null!==e?null==r?Tl(n,e,h):c3(n,e,h,r||null,!0):1===t&&null!==e?c3(n,e,h,r||null,!0):2===t?function(t,n,e){const i=Fd(t,n);i&&function(t,n,e,i){as(t)?t.removeChild(n,e,i):n.removeChild(e)}(t,i,n,e)}(n,h,c):3===t&&n.destroyNode(h),null!=s&&function(t,n,e,i,r){const s=e[7];s!==$r(e)&&Eu(n,t,i,s,r);for(let h=10;h0&&(t[e-1][4]=i[4]);const s=oc(t,10+n);!function(t,n){Jh(t,n,n[11],2,null,null),n[0]=null,n[6]=null}(i[1],i);const c=s[19];null!==c&&c.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function Z5(t,n){if(!(256&n[2])){const e=n[11];as(e)&&e.destroyNode&&Jh(t,n,e,3,null,null),function(t){let n=t[13];if(!n)return Pd(t[1],t);for(;n;){let e=null;if(Ha(n))e=n[13];else{const i=n[10];i&&(e=i)}if(!e){for(;n&&!n[4]&&n!==t;)Ha(n)&&Pd(n[1],n),n=n[3];null===n&&(n=t),Ha(n)&&Pd(n[1],n),e=n&&n[4]}n=e}}(n)}}function Pd(t,n){if(!(256&n[2])){n[2]&=-129,n[2]|=256,function(t,n){let e;if(null!=t&&null!=(e=t.destroyHooks))for(let i=0;i=0?i[r=x]():i[r=-x].unsubscribe(),s+=2}else{const c=i[r=e[s+1]];e[s].call(c)}if(null!==i){for(let s=r+1;ss?"":r[E+1].toLowerCase();const F=8&i?A:null;if(F&&-1!==f4(F,x,0)||2&i&&x!==A){if(c2(i))return!1;c=!0}}}}else{if(!c&&!c2(i)&&!c2(g))return!1;if(c&&c2(g))continue;c=!1,i=g|1&i}}return c2(i)||c}function c2(t){return 0==(1&t)}function am(t,n,e,i){if(null===n)return-1;let r=0;if(i||!e){let s=!1;for(;r-1)for(e++;e0?'="'+h+'"':"")+"]"}else 8&i?r+="."+c:4&i&&(r+=" "+c);else""!==r&&!c2(c)&&(n+=Ll(s,r),r=""),i=c,s=s||!c2(i);e++}return""!==r&&(n+=Ll(s,r)),n}const Vi={};function K(t){fm(ir(),un(),Rs()+t,du())}function fm(t,n,e,i){if(!i)if(3==(3&n[2])){const s=t.preOrderCheckHooks;null!==s&&Cl(n,s,e)}else{const s=t.preOrderHooks;null!==s&&En(n,s,0,e)}ja(e)}function t0(t,n){return t<<17|n<<2}function u2(t){return t>>17&32767}function Bd(t){return 2|t}function U2(t){return(131068&t)>>2}function h3(t,n){return-131069&t|n<<2}function ku(t){return 1|t}function ff(t,n){const e=t.contentQueries;if(null!==e)for(let i=0;i20&&fm(t,n,20,du()),e(i,r)}finally{ja(s)}}function ba(t,n,e){if(Uc(n)){const r=n.directiveEnd;for(let s=n.directiveStart;s0;){const e=t[--n];if("number"==typeof e&&e<0)return e}return 0})(h)!=g&&h.push(g),h.push(i,r,c)}}function Cf(t,n){null!==t.hostBindings&&t.hostBindings(1,n)}function zm(t,n){n.flags|=2,(t.components||(t.components=[])).push(n.index)}function d2(t,n,e){if(e){if(n.exportAs)for(let i=0;i0&&fc(e)}}function fc(t){for(let i=kd(t);null!==i;i=W5(i))for(let r=10;r0&&fc(s)}const e=t[1].components;if(null!==e)for(let i=0;i0&&fc(r)}}function yf(t,n){const e=Or(n,t),i=e[1];(function(t,n){for(let e=n.length;ePromise.resolve(null))();function xf(t){return t[7]||(t[7]=[])}function Rm(t){return t.cleanup||(t.cleanup=[])}function bf(t,n){const e=t[9],i=e?e.get(c4,null):null;i&&i.handleError(n)}function wf(t,n,e,i,r){for(let s=0;sthis.processProvider(h,n,e)),i2([n],h=>this.processInjectorType(h,[],s)),this.records.set(kl,o(void 0,this));const c=this.records.get(g3);this.scope=null!=c?c.value:null,this.source=r||("object"==typeof n?null:oi(n))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(n=>n.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(n,e=_u,i=Be.Default){this.assertNotDestroyed();const r=r4(this),s=Gt(void 0);try{if(!(i&Be.SkipSelf)){let h=this.records.get(n);if(void 0===h){const g=function(t){return"function"==typeof t||"object"==typeof t&&t instanceof Xt}(n)&&js(n);h=g&&this.injectableDefInScope(g)?o(Mf(n),l0):null,this.records.set(n,h)}if(null!=h)return this.hydrate(n,h)}return(i&Be.Self?c0():this.parent).get(n,e=i&Be.Optional&&e===_u?null:e)}catch(c){if("NullInjectorError"===c.name){if((c[n4]=c[n4]||[]).unshift(oi(n)),r)throw c;return Mp(c,n,"R3InjectorError",this.source)}throw c}finally{Gt(s),r4(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(n=>this.get(n))}toString(){const n=[];return this.records.forEach((i,r)=>n.push(oi(r))),`R3Injector[${n.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(n,e,i){if(!(n=R(n)))return!1;let r=te(n);const s=null==r&&n.ngModule||void 0,c=void 0===s?n:s,h=-1!==i.indexOf(c);if(void 0!==s&&(r=te(s)),null==r)return!1;if(null!=r.imports&&!h){let S;i.push(c);try{i2(r.imports,E=>{this.processInjectorType(E,e,i)&&(void 0===S&&(S=[]),S.push(E))})}finally{}if(void 0!==S)for(let E=0;Ethis.processProvider(j,A,F||yr))}}this.injectorDefTypes.add(c);const g=E2(c)||(()=>new c);this.records.set(c,o(g,l0));const x=r.providers;if(null!=x&&!h){const S=n;i2(x,E=>this.processProvider(E,S,x))}return void 0!==s&&void 0!==n.providers}processProvider(n,e,i){let r=C(n=R(n))?n:R(n&&n.provide);const s=function(t,n,e){return u(t)?o(void 0,t.useValue):o(a(t),l0)}(n);if(C(n)||!0!==n.multi)this.records.get(r);else{let c=this.records.get(r);c||(c=o(void 0,l0,!0),c.factory=()=>e3(c.multi),this.records.set(r,c)),r=n,c.multi.push(n)}this.records.set(r,s)}hydrate(n,e){return e.value===l0&&(e.value=fv,e.value=e.factory()),"object"==typeof e.value&&e.value&&function(t){return null!==t&&"object"==typeof t&&"function"==typeof t.ngOnDestroy}(e.value)&&this.onDestroy.add(e.value),e.value}injectableDefInScope(n){if(!n.providedIn)return!1;const e=R(n.providedIn);return"string"==typeof e?"any"===e||e===this.scope:this.injectorDefTypes.has(e)}}function Mf(t){const n=js(t),e=null!==n?n.factory:E2(t);if(null!==e)return e;if(t instanceof Xt)throw new Error(`Token ${oi(t)} is missing a \u0275prov definition.`);if(t instanceof Function)return function(t){const n=t.length;if(n>0){const i=xl(n,"?");throw new Error(`Can't resolve all parameters for ${oi(t)}: (${i.join(", ")}).`)}const e=function(t){const n=t&&(t[Z]||t[Ne]);if(n){const e=function(t){if(t.hasOwnProperty("name"))return t.name;const n=(""+t).match(/^function\s*([^\s(]+)/);return null===n?"":n[1]}(t);return console.warn(`DEPRECATED: DI is instantiating a token "${e}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${e}" class.`),n}return null}(t);return null!==e?()=>e.factory(t):()=>new t}(t);throw new Error("unreachable")}function a(t,n,e){let i;if(C(t)){const r=R(t);return E2(r)||Mf(r)}if(u(t))i=()=>R(t.useValue);else if(function(t){return!(!t||!t.useFactory)}(t))i=()=>t.useFactory(...e3(t.deps||[]));else if(function(t){return!(!t||!t.useExisting)}(t))i=()=>Mt(R(t.useExisting));else{const r=R(t&&(t.useClass||t.provide));if(!function(t){return!!t.deps}(t))return E2(r)||Mf(r);i=()=>new r(...e3(t.deps))}return i}function o(t,n,e=!1){return{factory:t,value:n,multi:e?[]:void 0}}function u(t){return null!==t&&"object"==typeof t&&S5 in t}function C(t){return"function"==typeof t}const O=function(t,n,e){return function(t,n=null,e=null,i){const r=Hm(t,n,e,i);return r._resolveInjectorDefTypes(),r}({name:e},n,t,e)};let U=(()=>{class t{static create(e,i){return Array.isArray(e)?O(e,i,""):O(e.providers,e.parent,e.name||"")}}return t.THROW_IF_NOT_FOUND=_u,t.NULL=new Nu,t.\u0275prov=Jt({token:t,providedIn:"any",factory:()=>Mt(kl)}),t.__NG_ELEMENT_ID__=-1,t})();function Vr(t,n){I2(Tu(t)[1],Ps())}function Ln(t){let n=function(t){return Object.getPrototypeOf(t.prototype).constructor}(t.type),e=!0;const i=[t];for(;n;){let r;if(Fi(t))r=n.\u0275cmp||n.\u0275dir;else{if(n.\u0275cmp)throw new Error("Directives cannot inherit Components");r=n.\u0275dir}if(r){if(e){i.push(r);const c=t;c.inputs=Do(t.inputs),c.declaredInputs=Do(t.declaredInputs),c.outputs=Do(t.outputs);const h=r.hostBindings;h&&go(t,h);const g=r.viewQuery,x=r.contentQueries;if(g&&Ma(t,g),x&&Sa(t,x),oo(t.inputs,r.inputs),oo(t.declaredInputs,r.declaredInputs),oo(t.outputs,r.outputs),Fi(r)&&r.data.animation){const S=t.data;S.animation=(S.animation||[]).concat(r.data.animation)}}const s=r.features;if(s)for(let c=0;c=0;i--){const r=t[i];r.hostVars=n+=r.hostVars,r.hostAttrs=J(r.hostAttrs,e=J(e,r.hostAttrs))}}(i)}function Do(t){return t===ia?{}:t===yr?[]:t}function Ma(t,n){const e=t.viewQuery;t.viewQuery=e?(i,r)=>{n(i,r),e(i,r)}:n}function Sa(t,n){const e=t.contentQueries;t.contentQueries=e?(i,r,s)=>{n(i,r,s),e(i,r,s)}:n}function go(t,n){const e=t.hostBindings;t.hostBindings=e?(i,r)=>{n(i,r),e(i,r)}:n}let v3=null;function v4(){if(!v3){const t=an.Symbol;if(t&&t.iterator)v3=t.iterator;else{const n=Object.getOwnPropertyNames(Map.prototype);for(let e=0;eh($r(xt[i.index])):i.index;if(as(e)){let xt=null;if(!h&&g&&(xt=function(t,n,e,i){const r=t.cleanup;if(null!=r)for(let s=0;sg?h[g]:null}"string"==typeof c&&(s+=2)}return null}(t,n,r,i.index)),null!==xt)(xt.__ngLastListenerFn__||xt).__ngNextListenerFn__=s,xt.__ngLastListenerFn__=s,F=!1;else{s=_v(i,n,E,s,!1);const Ut=e.listen(Ee,r,s);A.push(s,Ut),S&&S.push(r,Ze,Se,Se+1)}}else s=_v(i,n,E,s,!0),Ee.addEventListener(r,s,c),A.push(s),S&&S.push(r,Ze,Se,c)}else s=_v(i,n,E,s,!1);const j=i.outputs;let ie;if(F&&null!==j&&(ie=j[r])){const W=ie.length;if(W)for(let Ee=0;Ee0;)n=n[15],t--;return n}(t,vi.lFrame.contextLView))[8]}(t)}function EG(t,n){let e=null;const i=function(t){const n=t.attrs;if(null!=n){const e=n.indexOf(5);if(0==(1&e))return n[e+1]}return null}(t);for(let r=0;r=0}const fa={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function xS(t){return t.substring(fa.key,fa.keyEnd)}function bS(t,n){const e=fa.textEnd;return e===n?-1:(n=fa.keyEnd=function(t,n,e){for(;n32;)n++;return n}(t,fa.key=n,e),p6(t,n,e))}function p6(t,n,e){for(;n=0;e=bS(n,e))Wa(t,xS(n),!0)}function mc(t,n,e,i){const r=un(),s=ir(),c=c1(2);s.firstUpdatePass&&DS(s,t,c,i),n!==Vi&&Go(r,c,n)&&kS(s,s.data[Rs()],r,r[11],t,r[c+1]=function(t,n){return null==t||("string"==typeof n?t+=n:"object"==typeof t&&(t=oi(xa(t)))),t}(n,e),i,c)}function gc(t,n,e,i){const r=ir(),s=c1(2);r.firstUpdatePass&&DS(r,null,s,i);const c=un();if(e!==Vi&&Go(c,s,e)){const h=r.data[Rs()];if(zS(h,i)&&!ES(r,s)){let g=i?h.classesWithoutHost:h.stylesWithoutHost;null!==g&&(e=No(g,e||"")),yv(r,h,c,e,i)}else!function(t,n,e,i,r,s,c,h){r===Vi&&(r=yr);let g=0,x=0,S=0=t.expandoStartIndex}function DS(t,n,e,i){const r=t.data;if(null===r[e+1]){const s=r[Rs()],c=ES(t,e);zS(s,i)&&null===n&&!c&&(n=!1),n=function(t,n,e,i){const r=function(t){const n=vi.lFrame.currentDirectiveIndex;return-1===n?null:t[n]}(t);let s=i?n.residualClasses:n.residualStyles;if(null===r)0===(i?n.classBindings:n.styleBindings)&&(e=Af(e=xv(null,t,n,e,i),n.attrs,i),s=null);else{const c=n.directiveStylingLast;if(-1===c||t[c]!==r)if(e=xv(r,t,n,e,i),null===s){let g=function(t,n,e){const i=e?n.classBindings:n.styleBindings;if(0!==U2(i))return t[u2(i)]}(t,n,i);void 0!==g&&Array.isArray(g)&&(g=xv(null,t,n,g[1],i),g=Af(g,n.attrs,i),function(t,n,e,i){t[u2(e?n.classBindings:n.styleBindings)]=i}(t,n,i,g))}else s=function(t,n,e){let i;const r=n.directiveEnd;for(let s=1+n.directiveStylingLast;s0)&&(x=!0)}else S=e;if(r)if(0!==g){const A=u2(t[h+1]);t[i+1]=t0(A,h),0!==A&&(t[A+1]=h3(t[A+1],i)),t[h+1]=function(t,n){return 131071&t|n<<17}(t[h+1],i)}else t[i+1]=t0(h,0),0!==h&&(t[h+1]=h3(t[h+1],i)),h=i;else t[i+1]=t0(g,0),0===h?h=i:t[g+1]=h3(t[g+1],i),g=i;x&&(t[i+1]=Bd(t[i+1])),_S(t,S,i,!0),_S(t,S,i,!1),function(t,n,e,i,r){const s=r?t.residualClasses:t.residualStyles;null!=s&&"string"==typeof n&&ac(s,n)>=0&&(e[i+1]=ku(e[i+1]))}(n,S,t,i,s),c=t0(h,g),s?n.classBindings=c:n.styleBindings=c}(r,s,n,e,c,i)}}function xv(t,n,e,i,r){let s=null;const c=e.directiveEnd;let h=e.directiveStylingLast;for(-1===h?h=e.directiveStart:h++;h0;){const g=t[r],x=Array.isArray(g),S=x?g[1]:g,E=null===S;let A=e[r+1];A===Vi&&(A=E?yr:void 0);let F=E?bl(A,i):S===i?A:void 0;if(x&&!qm(F)&&(F=bl(g,i)),qm(F)&&(h=F,c))return h;const j=t[r+1];r=c?u2(j):U2(j)}if(null!==n){let g=s?n.residualClasses:n.residualStyles;null!=g&&(h=bl(g,i))}return h}function qm(t){return void 0!==t}function zS(t,n){return 0!=(t.flags&(n?16:32))}function gt(t,n=""){const e=un(),i=ir(),r=t+20,s=i.firstCreatePass?Pu(i,r,1,n,null):i.data[r],c=e[r]=function(t,n){return as(t)?t.createText(n):t.createTextNode(n)}(e[11],n);Od(i,e,c,s),$a(s,!1)}function Ls(t){return Qi("",t,""),Ls}function Qi(t,n,e){const i=un(),r=Il(i,t,n,e);return r!==Vi&&pc(i,Rs(),r),Qi}function zl(t,n,e,i,r){const s=un(),c=function(t,n,e,i,r,s){const h=y1(t,l1(),e,r);return c1(2),h?n+Re(e)+i+Re(r)+s:Vi}(s,t,n,e,i,r);return c!==Vi&&pc(s,Rs(),c),zl}function kf(t,n,e,i,r,s,c){const h=un(),g=_4(h,t,n,e,i,r,s,c);return g!==Vi&&pc(h,Rs(),g),kf}function bv(t,n,e,i,r,s,c,h,g){const x=un(),S=g2(x,t,n,e,i,r,s,c,h,g);return S!==Vi&&pc(x,Rs(),S),bv}function m6(t,n,e){const i=un();return Go(i,tc(),n)&&m1(ir(),bs(),i,t,n,i[11],e,!0),m6}const h0=void 0;var uW=["en",[["a","p"],["AM","PM"],h0],[["AM","PM"],h0,h0],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],h0,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],h0,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",h0,"{1} 'at' {0}",h0],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(t){const n=Math.floor(Math.abs(t)),e=t.toString().replace(/^[^.]*\.?/,"").length;return 1===n&&0===e?1:5}];let g6={};function U1(t){const n=function(t){return t.toLowerCase().replace(/_/g,"-")}(t);let e=KS(n);if(e)return e;const i=n.split("-")[0];if(e=KS(i),e)return e;if("en"===i)return uW;throw new Error(`Missing locale data for the locale "${t}".`)}function KS(t){return t in g6||(g6[t]=an.ng&&an.ng.common&&an.ng.common.locales&&an.ng.common.locales[t]),g6[t]}var Wn=(()=>((Wn=Wn||{})[Wn.LocaleId=0]="LocaleId",Wn[Wn.DayPeriodsFormat=1]="DayPeriodsFormat",Wn[Wn.DayPeriodsStandalone=2]="DayPeriodsStandalone",Wn[Wn.DaysFormat=3]="DaysFormat",Wn[Wn.DaysStandalone=4]="DaysStandalone",Wn[Wn.MonthsFormat=5]="MonthsFormat",Wn[Wn.MonthsStandalone=6]="MonthsStandalone",Wn[Wn.Eras=7]="Eras",Wn[Wn.FirstDayOfWeek=8]="FirstDayOfWeek",Wn[Wn.WeekendRange=9]="WeekendRange",Wn[Wn.DateFormat=10]="DateFormat",Wn[Wn.TimeFormat=11]="TimeFormat",Wn[Wn.DateTimeFormat=12]="DateTimeFormat",Wn[Wn.NumberSymbols=13]="NumberSymbols",Wn[Wn.NumberFormats=14]="NumberFormats",Wn[Wn.CurrencyCode=15]="CurrencyCode",Wn[Wn.CurrencySymbol=16]="CurrencySymbol",Wn[Wn.CurrencyName=17]="CurrencyName",Wn[Wn.Currencies=18]="Currencies",Wn[Wn.Directionality=19]="Directionality",Wn[Wn.PluralCase=20]="PluralCase",Wn[Wn.ExtraData=21]="ExtraData",Wn))();const Xm="en-US";let QS=Xm;function wv(t){zs(t,"Expected localeId to be defined"),"string"==typeof t&&(QS=t.toLowerCase().replace(/_/g,"-"))}function Tv(t,n,e,i,r){if(t=R(t),Array.isArray(t))for(let s=0;s>20;if(C(t)||!t.multi){const F=new v(g,r,B),j=Ev(h,n,r?S:S+A,E);-1===j?(vt(hn(x,c),s,h),Lv(s,t,n.length),n.push(h),x.directiveStart++,x.directiveEnd++,r&&(x.providerIndexes+=1048576),e.push(F),c.push(F)):(e[j]=F,c[j]=F)}else{const F=Ev(h,n,S+A,E),j=Ev(h,n,S,S+A),ie=F>=0&&e[F],W=j>=0&&e[j];if(r&&!W||!r&&!ie){vt(hn(x,c),s,h);const Ee=function(t,n,e,i,r){const s=new v(t,e,B);return s.multi=[],s.index=n,s.componentProviders=0,bT(s,r,i&&!e),s}(r?aq:oq,e.length,r,i,g);!r&&W&&(e[j].providerFactory=Ee),Lv(s,t,n.length,0),n.push(h),x.directiveStart++,x.directiveEnd++,r&&(x.providerIndexes+=1048576),e.push(Ee),c.push(Ee)}else Lv(s,t,F>-1?F:j,bT(e[r?j:F],g,!r&&i));!r&&i&&W&&e[j].componentProviders++}}}function Lv(t,n,e,i){const r=C(n);if(r||function(t){return!!t.useClass}(n)){const c=(n.useClass||n).prototype.ngOnDestroy;if(c){const h=t.destroyHooks||(t.destroyHooks=[]);if(!r&&n.multi){const g=h.indexOf(e);-1===g?h.push(e,[i,c]):h[g+1].push(i,c)}else h.push(e,c)}}}function bT(t,n,e){return e&&t.componentProviders++,t.multi.push(n)-1}function Ev(t,n,e,i){for(let r=e;r{e.providersResolver=(i,r)=>function(t,n,e){const i=ir();if(i.firstCreatePass){const r=Fi(t);Tv(e,i.data,i.blueprint,r,!0),Tv(n,i.data,i.blueprint,r,!1)}}(i,r?r(t):t,n)}}class wT{}const ST="ngComponent";class uq{resolveComponentFactory(n){throw function(t){const n=Error(`No component factory found for ${oi(t)}. Did you add it to @NgModule.entryComponents?`);return n[ST]=t,n}(n)}}let W2=(()=>{class t{}return t.NULL=new uq,t})();function Jm(...t){}function v6(t,n){return new rn(Di(t,n))}const fq=function(){return v6(Ps(),un())};let rn=(()=>{class t{constructor(e){this.nativeElement=e}}return t.__NG_ELEMENT_ID__=fq,t})();function TT(t){return t instanceof rn?t.nativeElement:t}class d0{}let q2=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>mq(),t})();const mq=function(){const t=un(),e=Or(Ps().index,t);return function(t){return t[11]}(Ha(e)?e:t)};let kv=(()=>{class t{}return t.\u0275prov=Jt({token:t,providedIn:"root",factory:()=>null}),t})();class Ff{constructor(n){this.full=n,this.major=n.split(".")[0],this.minor=n.split(".")[1],this.patch=n.split(".").slice(2).join(".")}}const LT=new Ff("12.2.16");class ET{constructor(){}supports(n){return Hu(n)}create(n){return new yq(n)}}const vq=(t,n)=>n;class yq{constructor(n){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=n||vq}forEachItem(n){let e;for(e=this._itHead;null!==e;e=e._next)n(e)}forEachOperation(n){let e=this._itHead,i=this._removalsHead,r=0,s=null;for(;e||i;){const c=!i||e&&e.currentIndex{c=this._trackByFn(r,h),null!==e&&Object.is(e.trackById,c)?(i&&(e=this._verifyReinsertion(e,h,c,r)),Object.is(e.item,h)||this._addIdentityChange(e,h)):(e=this._mismatch(e,h,c,r),i=!0),e=e._next,r++}),this.length=r;return this._truncate(e),this.collection=n,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let n;for(n=this._previousItHead=this._itHead;null!==n;n=n._next)n._nextPrevious=n._next;for(n=this._additionsHead;null!==n;n=n._nextAdded)n.previousIndex=n.currentIndex;for(this._additionsHead=this._additionsTail=null,n=this._movesHead;null!==n;n=n._nextMoved)n.previousIndex=n.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(n,e,i,r){let s;return null===n?s=this._itTail:(s=n._prev,this._remove(n)),null!==(n=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(n.item,e)||this._addIdentityChange(n,e),this._reinsertAfter(n,s,r)):null!==(n=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(n.item,e)||this._addIdentityChange(n,e),this._moveAfter(n,s,r)):n=this._addAfter(new _q(e,i),s,r),n}_verifyReinsertion(n,e,i,r){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==s?n=this._reinsertAfter(s,n._prev,r):n.currentIndex!=r&&(n.currentIndex=r,this._addToMoves(n,r)),n}_truncate(n){for(;null!==n;){const e=n._next;this._addToRemovals(this._unlink(n)),n=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(n,e,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(n);const r=n._prevRemoved,s=n._nextRemoved;return null===r?this._removalsHead=s:r._nextRemoved=s,null===s?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(n,e,i),this._addToMoves(n,i),n}_moveAfter(n,e,i){return this._unlink(n),this._insertAfter(n,e,i),this._addToMoves(n,i),n}_addAfter(n,e,i){return this._insertAfter(n,e,i),this._additionsTail=null===this._additionsTail?this._additionsHead=n:this._additionsTail._nextAdded=n,n}_insertAfter(n,e,i){const r=null===e?this._itHead:e._next;return n._next=r,n._prev=e,null===r?this._itTail=n:r._prev=n,null===e?this._itHead=n:e._next=n,null===this._linkedRecords&&(this._linkedRecords=new DT),this._linkedRecords.put(n),n.currentIndex=i,n}_remove(n){return this._addToRemovals(this._unlink(n))}_unlink(n){null!==this._linkedRecords&&this._linkedRecords.remove(n);const e=n._prev,i=n._next;return null===e?this._itHead=i:e._next=i,null===i?this._itTail=e:i._prev=e,n}_addToMoves(n,e){return n.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=n:this._movesTail._nextMoved=n),n}_addToRemovals(n){return null===this._unlinkedRecords&&(this._unlinkedRecords=new DT),this._unlinkedRecords.put(n),n.currentIndex=null,n._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=n,n._prevRemoved=null):(n._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=n),n}_addIdentityChange(n,e){return n.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=n:this._identityChangesTail._nextIdentityChange=n,n}}class _q{constructor(n,e){this.item=n,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class xq{constructor(){this._head=null,this._tail=null}add(n){null===this._head?(this._head=this._tail=n,n._nextDup=null,n._prevDup=null):(this._tail._nextDup=n,n._prevDup=this._tail,n._nextDup=null,this._tail=n)}get(n,e){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===e||e<=i.currentIndex)&&Object.is(i.trackById,n))return i;return null}remove(n){const e=n._prevDup,i=n._nextDup;return null===e?this._head=i:e._nextDup=i,null===i?this._tail=e:i._prevDup=e,null===this._head}}class DT{constructor(){this.map=new Map}put(n){const e=n.trackById;let i=this.map.get(e);i||(i=new xq,this.map.set(e,i)),i.add(n)}get(n,e){const r=this.map.get(n);return r?r.get(n,e):null}remove(n){const e=n.trackById;return this.map.get(e).remove(n)&&this.map.delete(e),n}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function AT(t,n,e){const i=t.previousIndex;if(null===i)return i;let r=0;return e&&i{if(e&&e.key===r)this._maybeAddToChanges(e,i),this._appendAfter=e,e=e._next;else{const s=this._getOrCreateRecordForKey(r,i);e=this._insertBeforeOrAppend(e,s)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let i=e;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(n,e){if(n){const i=n._prev;return e._next=n,e._prev=i,n._prev=e,i&&(i._next=e),n===this._mapHead&&(this._mapHead=e),this._appendAfter=n,n}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(n,e){if(this._records.has(n)){const r=this._records.get(n);this._maybeAddToChanges(r,e);const s=r._prev,c=r._next;return s&&(s._next=c),c&&(c._prev=s),r._next=null,r._prev=null,r}const i=new wq(n);return this._records.set(n,i),i.currentValue=e,this._addToAdditions(i),i}_reset(){if(this.isDirty){let n;for(this._previousMapHead=this._mapHead,n=this._previousMapHead;null!==n;n=n._next)n._nextPrevious=n._next;for(n=this._changesHead;null!==n;n=n._nextChanged)n.previousValue=n.currentValue;for(n=this._additionsHead;null!=n;n=n._nextAdded)n.previousValue=n.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(n,e){Object.is(e,n.currentValue)||(n.previousValue=n.currentValue,n.currentValue=e,this._addToChanges(n))}_addToAdditions(n){null===this._additionsHead?this._additionsHead=this._additionsTail=n:(this._additionsTail._nextAdded=n,this._additionsTail=n)}_addToChanges(n){null===this._changesHead?this._changesHead=this._changesTail=n:(this._changesTail._nextChanged=n,this._changesTail=n)}_forEach(n,e){n instanceof Map?n.forEach(e):Object.keys(n).forEach(i=>e(n[i],i))}}class wq{constructor(n){this.key=n,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function IT(){return new y6([new ET])}let y6=(()=>{class t{constructor(e){this.factories=e}static create(e,i){if(null!=i){const r=i.factories.slice();e=e.concat(r)}return new t(e)}static extend(e){return{provide:t,useFactory:i=>t.create(e,i||IT()),deps:[[t,new Lo,new ws]]}}find(e){const i=this.factories.find(r=>r.supports(e));if(null!=i)return i;throw new Error(`Cannot find a differ supporting object '${e}' of type '${function(t){return t.name||typeof t}(e)}'`)}}return t.\u0275prov=Jt({token:t,providedIn:"root",factory:IT}),t})();function zT(){return new _6([new kT])}let _6=(()=>{class t{constructor(e){this.factories=e}static create(e,i){if(i){const r=i.factories.slice();e=e.concat(r)}return new t(e)}static extend(e){return{provide:t,useFactory:i=>t.create(e,i||zT()),deps:[[t,new Lo,new ws]]}}find(e){const i=this.factories.find(r=>r.supports(e));if(i)return i;throw new Error(`Cannot find a differ supporting object '${e}'`)}}return t.\u0275prov=Jt({token:t,providedIn:"root",factory:zT}),t})();function e7(t,n,e,i,r=!1){for(;null!==e;){const s=n[e.index];if(null!==s&&i.push($r(s)),_a(s))for(let h=10;h-1&&(X5(n,i),oc(e,i))}this._attachedToViewContainer=!1}Z5(this._lView[1],this._lView)}onDestroy(n){mf(this._lView[1],this._lView,null,n)}markForCheck(){_f(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){s0(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(t,n,e){Kc(!0);try{s0(t,n,e)}finally{Kc(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(t,n){Jh(t,n,n[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(n){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=n}}class Sq extends Of{constructor(n){super(n),this._view=n}detectChanges(){o0(this._view)}checkNoChanges(){!function(t){Kc(!0);try{o0(t)}finally{Kc(!1)}}(this._view)}get context(){return null}}const Lq=function(t){return function(t,n,e){if(hl(t)&&!e){const i=Or(t.index,n);return new Of(i,i)}return 47&t.type?new Of(n[16],n):null}(Ps(),un(),16==(16&t))};let zn=(()=>{class t{}return t.__NG_ELEMENT_ID__=Lq,t})();const Aq=[new kT],Iq=new y6([new ET]),zq=new _6(Aq),Vq=function(){return t7(Ps(),un())};let vo=(()=>{class t{}return t.__NG_ELEMENT_ID__=Vq,t})();const Fq=vo,Oq=class extends Fq{constructor(n,e,i){super(),this._declarationLView=n,this._declarationTContainer=e,this.elementRef=i}createEmbeddedView(n){const e=this._declarationTContainer.tViews,i=p4(this._declarationLView,e,n,16,null,e.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(i[19]=s.createEmbeddedView(e)),r0(e,i,n),new Of(i)}};function t7(t,n){return 4&t.type?new Oq(n,t,v6(t,n)):null}class b3{}class PT{}const Hq=function(){return OT(Ps(),un())};let Za=(()=>{class t{}return t.__NG_ELEMENT_ID__=Hq,t})();const Uq=Za,VT=class extends Uq{constructor(n,e,i){super(),this._lContainer=n,this._hostTNode=e,this._hostLView=i}get element(){return v6(this._hostTNode,this._hostLView)}get injector(){return new Er(this._hostTNode,this._hostLView)}get parentInjector(){const n=At(this._hostTNode,this._hostLView);if(ae(n)){const e=le(n,this._hostLView),i=ue(n);return new Er(e[1].data[i+8],e)}return new Er(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(n){const e=FT(this._lContainer);return null!==e&&e[n]||null}get length(){return this._lContainer.length-10}createEmbeddedView(n,e,i){const r=n.createEmbeddedView(e||{});return this.insert(r,i),r}createComponent(n,e,i,r,s){const c=i||this.parentInjector;if(!s&&null==n.ngModule&&c){const g=c.get(b3,null);g&&(s=g)}const h=n.create(c,r,void 0,s);return this.insert(h.hostView,e),h}insert(n,e){const i=n._lView,r=i[1];if(function(t){return _a(t[3])}(i)){const S=this.indexOf(n);if(-1!==S)this.detach(S);else{const E=i[3],A=new VT(E,E[6],E[3]);A.detach(A.indexOf(n))}}const s=this._adjustIndex(e),c=this._lContainer;!function(t,n,e,i){const r=10+i,s=e.length;i>0&&(e[r-1][4]=n),iB5});class sL extends wT{constructor(n,e){super(),this.componentDef=n,this.ngModule=e,this.componentType=n.type,this.selector=function(t){return t.map(um).join(",")}(n.selectors),this.ngContentSelectors=n.ngContentSelectors?n.ngContentSelectors:[],this.isBoundToModule=!!e}get inputs(){return rL(this.componentDef.inputs)}get outputs(){return rL(this.componentDef.outputs)}create(n,e,i,r){const s=(r=r||this.ngModule)?function(t,n){return{get:(e,i,r)=>{const s=t.get(e,M6,r);return s!==M6||i===M6?s:n.get(e,i,r)}}}(n,r.injector):n,c=s.get(d0,k2),h=s.get(kv,null),g=c.createRenderer(null,this.componentDef),x=this.componentDef.selectors[0][0]||"div",S=i?function(t,n,e){if(as(t))return t.selectRootElement(n,e===mi.ShadowDom);let i="string"==typeof n?t.querySelector(n):n;return i.textContent="",i}(g,i,this.componentDef.encapsulation):l2(c.createRenderer(null,this.componentDef),x,function(t){const n=t.toLowerCase();return"svg"===n?su:"math"===n?"http://www.w3.org/1998/MathML/":null}(x)),E=this.componentDef.onPush?576:528,A=function(t,n){return{components:[],scheduler:t||B5,clean:Ou,playerHandler:n||null,flags:0}}(),F=Vu(0,null,null,1,0,null,null,null,null,null),j=p4(null,F,A,E,null,null,c,g,h,s);let ie,W;Qc(j);try{const Ee=function(t,n,e,i,r,s){const c=e[1];e[20]=t;const g=Pu(c,20,2,"#host",null),x=g.mergedAttrs=n.hostAttrs;null!==x&&(Al(g,x,!0),null!==t&&(H(r,t,x),null!==g.classes&&d4(r,t,g.classes),null!==g.styles&&p1(r,t,g.styles)));const S=i.createRenderer(t,n),E=p4(e,Jd(n),null,n.onPush?64:16,e[20],g,i,S,s||null,null);return c.firstCreatePass&&(vt(hn(g,e),c,n.type),zm(c,g),$2(g,e.length,1)),da(e,E),e[20]=E}(S,this.componentDef,j,c,g);if(S)if(i)H(g,S,["ng-version",LT.full]);else{const{attrs:Se,classes:Ze}=function(t){const n=[],e=[];let i=1,r=2;for(;i0&&d4(g,S,Ze.join(" "))}if(W=Xc(F,20),void 0!==e){const Se=W.projection=[];for(let Ze=0;Zeg(c,n)),n.contentQueries){const g=Ps();n.contentQueries(1,c,g.directiveStart)}const h=Ps();return!s.firstCreatePass||null===n.hostBindings&&null===n.hostAttrs||(ja(h.index),m3(e[1],h,0,h.directiveStart,h.directiveEnd,n),Cf(n,c)),c}(Ee,this.componentDef,j,A,[Vr]),r0(F,j,null)}finally{u1()}return new BX(this.componentType,ie,v6(W,j),j,W)}}class BX extends class{}{constructor(n,e,i,r,s){super(),this.location=i,this._rootLView=r,this._tNode=s,this.instance=e,this.hostView=this.changeDetectorRef=new Sq(r),this.componentType=n}get injector(){return new Er(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(n){this.hostView.onDestroy(n)}}const S6=new Map;class jX extends b3{constructor(n,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new iL(this);const i=Gs(n),r=function(t){return t[i1]||null}(n);r&&wv(r),this._bootstrapComponents=B2(i.bootstrap),this._r3Injector=Hm(n,e,[{provide:b3,useValue:this},{provide:W2,useValue:this.componentFactoryResolver}],oi(n)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(n)}get(n,e=U.THROW_IF_NOT_FOUND,i=Be.Default){return n===U||n===b3||n===kl?this:this._r3Injector.get(n,e,i)}destroy(){const n=this._r3Injector;!n.destroyed&&n.destroy(),this.destroyCbs.forEach(e=>e()),this.destroyCbs=null}onDestroy(n){this.destroyCbs.push(n)}}class Gv extends PT{constructor(n){super(),this.moduleType=n,null!==Gs(n)&&function(t){const n=new Set;!function e(i){const r=Gs(i,!0),s=r.id;null!==s&&(function(t,n,e){if(n&&n!==e)throw new Error(`Duplicate module registered for ${t} - ${oi(n)} vs ${oi(n.name)}`)}(s,S6.get(s),i),S6.set(s,i));const c=B2(r.imports);for(const h of c)n.has(h)||(n.add(h),e(h))}(t)}(n)}create(n){return new jX(this.moduleType,n)}}function o7(t,n,e,i){return function(t,n,e,i,r,s){const c=n+e;return Go(t,c,r)?G2(t,c+1,s?i.call(s,r):i(r)):Gf(t,c+1)}(un(),uo(),t,n,e,i)}function Gf(t,n){const e=t[n];return e===Vi?void 0:e}function uL(t,n,e,i,r,s,c){const h=n+e;return y1(t,h,r,s)?G2(t,h+2,c?i.call(c,r,s):i(r,s)):Gf(t,h+2)}function qv(t,n){const e=ir();let i;const r=t+20;e.firstCreatePass?(i=function(t,n){if(n)for(let e=n.length-1;e>=0;e--){const i=n[e];if(t===i.name)return i}throw new _e("302",`The pipe '${t}' could not be found!`)}(n,e.pipeRegistry),e.data[r]=i,i.onDestroy&&(e.destroyHooks||(e.destroyHooks=[])).push(r,i.onDestroy)):i=e.data[r];const s=i.factory||(i.factory=E2(i.type)),c=Gt(B);try{const h=ke(!1),g=s();return ke(h),function(t,n,e,i){e>=t.data.length&&(t.data[e]=null,t.blueprint[e]=null),n[e]=i}(e,un(),r,g),g}finally{Gt(c)}}function Xv(t,n,e,i){const r=t+20,s=un(),c=function(t,n){return t[n]}(s,r);return function(t,n){f2.isWrapped(n)&&(n=f2.unwrap(n),t[l1()]=Vi);return n}(s,function(t,n){return t[1].data[n].pure}(s,r)?uL(s,uo(),n,c.transform,e,i,c):c.transform(e,i))}function Zv(t){return n=>{setTimeout(t,void 0,n)}}const We=class extends lt{constructor(n=!1){super(),this.__isAsync=n}emit(n){super.next(n)}subscribe(n,e,i){var r,s,c;let h=n,g=e||(()=>null),x=i;if(n&&"object"==typeof n){const E=n;h=null===(r=E.next)||void 0===r?void 0:r.bind(E),g=null===(s=E.error)||void 0===s?void 0:s.bind(E),x=null===(c=E.complete)||void 0===c?void 0:c.bind(E)}this.__isAsync&&(g=Zv(g),h&&(h=Zv(h)),x&&(x=Zv(x)));const S=super.subscribe({next:h,error:g,complete:x});return n instanceof Xe&&n.add(S),S}};function iZ(){return this._results[v4()]()}class a7{constructor(n=!1){this._emitDistinctChangesOnly=n,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const e=v4(),i=a7.prototype;i[e]||(i[e]=iZ)}get changes(){return this._changes||(this._changes=new We)}get(n){return this._results[n]}map(n){return this._results.map(n)}filter(n){return this._results.filter(n)}find(n){return this._results.find(n)}reduce(n,e){return this._results.reduce(n,e)}forEach(n){this._results.forEach(n)}some(n){return this._results.some(n)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(n,e){const i=this;i.dirty=!1;const r=d1(n);(this._changesDetected=!function(t,n,e){if(t.length!==n.length)return!1;for(let i=0;i0)i.push(c[h/2]);else{const x=s[h+1],S=n[-g];for(let E=10;E({bindingPropertyName:t})),b4=zr("HostListener",(t,n)=>({eventName:t,args:n})),m0=new Xt("Application Initializer");let L6=(()=>{class t{constructor(e){this.appInits=e,this.resolve=Jm,this.reject=Jm,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const e=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r{s.subscribe({complete:h,error:g})});e.push(c)}}Promise.all(e).then(()=>{i()}).catch(r=>{this.reject(r)}),0===e.length&&i(),this.initialized=!0}}return t.\u0275fac=function(e){return new(e||t)(Mt(m0,8))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();const Yf=new Xt("AppId"),NZ={provide:Yf,useFactory:function(){return`${oy()}${oy()}${oy()}`},deps:[]};function oy(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const OL=new Xt("Platform Initializer"),M1=new Xt("Platform ID"),NL=new Xt("appBootstrapListener");let u7=(()=>{class t{log(e){console.log(e)}warn(e){console.warn(e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();const $u=new Xt("LocaleId"),RL=new Xt("DefaultCurrencyCode");class HZ{constructor(n,e){this.ngModuleFactory=n,this.componentFactories=e}}const ay=function(t){return new Gv(t)},BZ=ay,UZ=function(t){return Promise.resolve(ay(t))},HL=function(t){const n=ay(t),i=B2(Gs(t).declarations).reduce((r,s)=>{const c=lo(s);return c&&r.push(new sL(c)),r},[]);return new HZ(n,i)},$Z=HL,jZ=function(t){return Promise.resolve(HL(t))};let g0=(()=>{class t{constructor(){this.compileModuleSync=BZ,this.compileModuleAsync=UZ,this.compileModuleAndAllComponentsSync=$Z,this.compileModuleAndAllComponentsAsync=jZ}clearCache(){}clearCacheFor(e){}getModuleId(e){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();const qZ=(()=>Promise.resolve(0))();function ly(t){"undefined"==typeof Zone?qZ.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class pn{constructor({enableLongStackTrace:n=!1,shouldCoalesceEventChangeDetection:e=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new We(!1),this.onMicrotaskEmpty=new We(!1),this.onStable=new We(!1),this.onError=new We(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),n&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&e,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function(){let t=an.requestAnimationFrame,n=an.cancelAnimationFrame;if("undefined"!=typeof Zone&&t&&n){const e=t[Zone.__symbol__("OriginalDelegate")];e&&(t=e);const i=n[Zone.__symbol__("OriginalDelegate")];i&&(n=i)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:n}}().nativeRequestAnimationFrame,function(t){const n=()=>{!function(t){t.isCheckStableRunning||-1!==t.lastRequestAnimationFrameId||(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(an,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,uy(t),t.isCheckStableRunning=!0,cy(t),t.isCheckStableRunning=!1},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),uy(t))}(t)};t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(e,i,r,s,c,h)=>{try{return BL(t),e.invokeTask(r,s,c,h)}finally{(t.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||t.shouldCoalesceRunChangeDetection)&&n(),UL(t)}},onInvoke:(e,i,r,s,c,h,g)=>{try{return BL(t),e.invoke(r,s,c,h,g)}finally{t.shouldCoalesceRunChangeDetection&&n(),UL(t)}},onHasTask:(e,i,r,s)=>{e.hasTask(r,s),i===r&&("microTask"==s.change?(t._hasPendingMicrotasks=s.microTask,uy(t),cy(t)):"macroTask"==s.change&&(t.hasPendingMacrotasks=s.macroTask))},onHandleError:(e,i,r,s)=>(e.handleError(r,s),t.runOutsideAngular(()=>t.onError.emit(s)),!1)})}(r)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!pn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(pn.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(n,e,i){return this._inner.run(n,e,i)}runTask(n,e,i,r){const s=this._inner,c=s.scheduleEventTask("NgZoneEvent: "+r,n,ZZ,Jm,Jm);try{return s.runTask(c,e,i)}finally{s.cancelTask(c)}}runGuarded(n,e,i){return this._inner.runGuarded(n,e,i)}runOutsideAngular(n){return this._outer.run(n)}}const ZZ={};function cy(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function uy(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&-1!==t.lastRequestAnimationFrameId)}function BL(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function UL(t){t._nesting--,cy(t)}class QZ{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new We,this.onMicrotaskEmpty=new We,this.onStable=new We,this.onError=new We}run(n,e,i){return n.apply(e,i)}runGuarded(n,e,i){return n.apply(e,i)}runOutsideAngular(n){return n()}runTask(n,e,i,r){return n.apply(e,i)}}let hy=(()=>{class t{constructor(e){this._ngZone=e,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),e.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{pn.assertNotInAngularZone(),ly(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())ly(()=>{for(;0!==this._callbacks.length;){let e=this._callbacks.pop();clearTimeout(e.timeoutId),e.doneCb(this._didWork)}this._didWork=!1});else{let e=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(e)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(e=>({source:e.source,creationLocation:e.creationLocation,data:e.data})):[]}addCallback(e,i,r){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(c=>c.timeoutId!==s),e(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:e,timeoutId:s,updateCb:r})}whenStable(e,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(e,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(e,i,r){return[]}}return t.\u0275fac=function(e){return new(e||t)(Mt(pn))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),$L=(()=>{class t{constructor(){this._applications=new Map,dy.addToWindow(this)}registerApplication(e,i){this._applications.set(e,i)}unregisterApplication(e){this._applications.delete(e)}unregisterAllApplications(){this._applications.clear()}getTestability(e){return this._applications.get(e)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(e,i=!0){return dy.findTestabilityInTree(this,e,i)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();class JZ{addToWindow(n){}findTestabilityInTree(n,e,i){return null}}let dy=new JZ,jL=!0,GL=!1;let yc;const qL=new Xt("AllowMultipleToken");class fy{constructor(n,e){this.name=n,this.token=e}}function XL(t,n,e=[]){const i=`Platform: ${n}`,r=new Xt(i);return(s=[])=>{let c=ZL();if(!c||c.injector.get(qL,!1))if(t)t(e.concat(s).concat({provide:r,useValue:!0}));else{const h=e.concat(s).concat({provide:r,useValue:!0},{provide:g3,useValue:"platform"});!function(t){if(yc&&!yc.destroyed&&!yc.injector.get(qL,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");yc=t.get(YL);const n=t.get(OL,null);n&&n.forEach(e=>e())}(U.create({providers:h,name:i}))}return function(t){const n=ZL();if(!n)throw new Error("No platform exists!");if(!n.injector.get(t,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return n}(r)}}function ZL(){return yc&&!yc.destroyed?yc:null}let YL=(()=>{class t{constructor(e){this._injector=e,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(e,i){const h=function(t,n){let e;return e="noop"===t?new QZ:("zone.js"===t?void 0:t)||new pn({enableLongStackTrace:(GL=!0,jL),shouldCoalesceEventChangeDetection:!!(null==n?void 0:n.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==n?void 0:n.ngZoneRunCoalescing)}),e}(i?i.ngZone:void 0,{ngZoneEventCoalescing:i&&i.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:i&&i.ngZoneRunCoalescing||!1}),g=[{provide:pn,useValue:h}];return h.run(()=>{const x=U.create({providers:g,parent:this.injector,name:e.moduleType.name}),S=e.create(x),E=S.injector.get(c4,null);if(!E)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return h.runOutsideAngular(()=>{const A=h.onError.subscribe({next:F=>{E.handleError(F)}});S.onDestroy(()=>{py(this._modules,S),A.unsubscribe()})}),function(t,n,e){try{const i=e();return Ef(i)?i.catch(r=>{throw n.runOutsideAngular(()=>t.handleError(r)),r}):i}catch(i){throw n.runOutsideAngular(()=>t.handleError(i)),i}}(E,h,()=>{const A=S.injector.get(L6);return A.runInitializers(),A.donePromise.then(()=>(wv(S.injector.get($u,Xm)||Xm),this._moduleDoBootstrap(S),S))})})}bootstrapModule(e,i=[]){const r=KL({},i);return function(t,n,e){const i=new Gv(e);return Promise.resolve(i)}(0,0,e).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(e){const i=e.injector.get(w4);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!e.instance.ngDoBootstrap)throw new Error(`The module ${oi(e.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);e.instance.ngDoBootstrap(i)}this._modules.push(e)}onDestroy(e){this._destroyListeners.push(e)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(e=>e.destroy()),this._destroyListeners.forEach(e=>e()),this._destroyed=!0}get destroyed(){return this._destroyed}}return t.\u0275fac=function(e){return new(e||t)(Mt(U))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();function KL(t,n){return Array.isArray(n)?n.reduce(KL,t):Object.assign(Object.assign({},t),n)}let w4=(()=>{class t{constructor(e,i,r,s,c){this._zone=e,this._injector=i,this._exceptionHandler=r,this._componentFactoryResolver=s,this._initStatus=c,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const h=new q(x=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{x.next(this._stable),x.complete()})}),g=new q(x=>{let S;this._zone.runOutsideAngular(()=>{S=this._zone.onStable.subscribe(()=>{pn.assertNotInAngularZone(),ly(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,x.next(!0))})})});const E=this._zone.onUnstable.subscribe(()=>{pn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{x.next(!1)}))});return()=>{S.unsubscribe(),E.unsubscribe()}});this.isStable=ea(h,g.pipe(t=>ga()(To(t1)(t))))}bootstrap(e,i){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let r;r=e instanceof wT?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(r.componentType);const s=function(t){return t.isBoundToModule}(r)?void 0:this._injector.get(b3),h=r.create(U.NULL,[],i||r.selector,s),g=h.location.nativeElement,x=h.injector.get(hy,null),S=x&&h.injector.get($L);return x&&S&&S.registerApplication(g,x),h.onDestroy(()=>{this.detachView(h.hostView),py(this.components,h),S&&S.unregisterApplication(g)}),this._loadComponent(h),h}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let e of this._views)e.detectChanges()}catch(e){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(e))}finally{this._runningTick=!1}}attachView(e){const i=e;this._views.push(i),i.attachToAppRef(this)}detachView(e){const i=e;py(this._views,i),i.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(NL,[]).concat(this._bootstrapListeners).forEach(r=>r(e))}ngOnDestroy(){this._views.slice().forEach(e=>e.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return t.\u0275fac=function(e){return new(e||t)(Mt(pn),Mt(U),Mt(c4),Mt(W2),Mt(L6))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();function py(t,n){const e=t.indexOf(n);e>-1&&t.splice(e,1)}class d7{}class pY{}const mY={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"};let gY=(()=>{class t{constructor(e,i){this._compiler=e,this._config=i||mY}load(e){return this.loadAndCompile(e)}loadAndCompile(e){let[i,r]=e.split("#");return void 0===r&&(r="default"),ye(8255)(i).then(s=>s[r]).then(s=>tE(s,i,r)).then(s=>this._compiler.compileModuleAsync(s))}loadFactory(e){let[i,r]=e.split("#"),s="NgFactory";return void 0===r&&(r="default",s=""),ye(8255)(this._config.factoryPathPrefix+i+this._config.factoryPathSuffix).then(c=>c[r+s]).then(c=>tE(c,i,r))}}return t.\u0275fac=function(e){return new(e||t)(Mt(g0),Mt(pY,8))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();function tE(t,n,e){if(!t)throw new Error(`Cannot find '${e}' in '${n}'`);return t}const TY=XL(null,"core",[{provide:M1,useValue:"unknown"},{provide:YL,deps:[U]},{provide:$L,deps:[]},{provide:u7,deps:[]}]),kY=[{provide:w4,useClass:w4,deps:[pn,U,c4,W2,L6]},{provide:NX,deps:[pn],useFactory:function(t){let n=[];return t.onStable.subscribe(()=>{for(;n.length;)n.pop()()}),function(e){n.push(e)}}},{provide:L6,useClass:L6,deps:[[new ws,m0]]},{provide:g0,useClass:g0,deps:[]},NZ,{provide:y6,useFactory:function(){return Iq},deps:[]},{provide:_6,useFactory:function(){return zq},deps:[]},{provide:$u,useFactory:function(t){return wv(t=t||"undefined"!=typeof $localize&&$localize.locale||Xm),t},deps:[[new V2($u),new ws,new Lo]]},{provide:RL,useValue:"USD"}];let zY=(()=>{class t{constructor(e){}}return t.\u0275fac=function(e){return new(e||t)(Mt(w4))},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({providers:kY}),t})(),b7=null;function w3(){return b7}const Cs=new Xt("DocumentToken");let y0=(()=>{class t{historyGo(e){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({factory:IK,token:t,providedIn:"platform"}),t})();function IK(){return Mt(SE)}const zK=new Xt("Location Initialized");let SE=(()=>{class t extends y0{constructor(e){super(),this._doc=e,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return w3().getBaseHref(this._doc)}onPopState(e){const i=w3().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",e,!1),()=>i.removeEventListener("popstate",e)}onHashChange(e){const i=w3().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",e,!1),()=>i.removeEventListener("hashchange",e)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(e){this.location.pathname=e}pushState(e,i,r){TE()?this._history.pushState(e,i,r):this.location.hash=r}replaceState(e,i,r){TE()?this._history.replaceState(e,i,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(e=0){this._history.go(e)}getState(){return this._history.state}}return t.\u0275fac=function(e){return new(e||t)(Mt(Cs))},t.\u0275prov=Jt({factory:PK,token:t,providedIn:"platform"}),t})();function TE(){return!!window.history.pushState}function PK(){return new SE(Mt(Cs))}function Dy(t,n){if(0==t.length)return n;if(0==n.length)return t;let e=0;return t.endsWith("/")&&e++,n.startsWith("/")&&e++,2==e?t+n.substring(1):1==e?t+n:t+"/"+n}function LE(t){const n=t.match(/#|\?|$/),e=n&&n.index||t.length;return t.slice(0,e-("/"===t[e-1]?1:0))+t.slice(e)}function S4(t){return t&&"?"!==t[0]?"?"+t:t}let _0=(()=>{class t{historyGo(e){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({factory:FK,token:t,providedIn:"root"}),t})();function FK(t){const n=Mt(Cs).location;return new EE(Mt(y0),n&&n.origin||"")}const Ay=new Xt("appBaseHref");let EE=(()=>{class t extends _0{constructor(e,i){if(super(),this._platformLocation=e,this._removeListenerFns=[],null==i&&(i=this._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=i}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}getBaseHref(){return this._baseHref}prepareExternalUrl(e){return Dy(this._baseHref,e)}path(e=!1){const i=this._platformLocation.pathname+S4(this._platformLocation.search),r=this._platformLocation.hash;return r&&e?`${i}${r}`:i}pushState(e,i,r,s){const c=this.prepareExternalUrl(r+S4(s));this._platformLocation.pushState(e,i,c)}replaceState(e,i,r,s){const c=this.prepareExternalUrl(r+S4(s));this._platformLocation.replaceState(e,i,c)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(e=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,e)}}return t.\u0275fac=function(e){return new(e||t)(Mt(y0),Mt(Ay,8))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),OK=(()=>{class t extends _0{constructor(e,i){super(),this._platformLocation=e,this._baseHref="",this._removeListenerFns=[],null!=i&&(this._baseHref=i)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}getBaseHref(){return this._baseHref}path(e=!1){let i=this._platformLocation.hash;return null==i&&(i="#"),i.length>0?i.substring(1):i}prepareExternalUrl(e){const i=Dy(this._baseHref,e);return i.length>0?"#"+i:i}pushState(e,i,r,s){let c=this.prepareExternalUrl(r+S4(s));0==c.length&&(c=this._platformLocation.pathname),this._platformLocation.pushState(e,i,c)}replaceState(e,i,r,s){let c=this.prepareExternalUrl(r+S4(s));0==c.length&&(c=this._platformLocation.pathname),this._platformLocation.replaceState(e,i,c)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(e=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,e)}}return t.\u0275fac=function(e){return new(e||t)(Mt(y0),Mt(Ay,8))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),x0=(()=>{class t{constructor(e,i){this._subject=new We,this._urlChangeListeners=[],this._platformStrategy=e;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=LE(DE(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(e=!1){return this.normalize(this._platformStrategy.path(e))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(e,i=""){return this.path()==this.normalize(e+S4(i))}normalize(e){return t.stripTrailingSlash(function(t,n){return t&&n.startsWith(t)?n.substring(t.length):n}(this._baseHref,DE(e)))}prepareExternalUrl(e){return e&&"/"!==e[0]&&(e="/"+e),this._platformStrategy.prepareExternalUrl(e)}go(e,i="",r=null){this._platformStrategy.pushState(r,"",e,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+S4(i)),r)}replaceState(e,i="",r=null){this._platformStrategy.replaceState(r,"",e,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+S4(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(e=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,e)}onUrlChange(e){this._urlChangeListeners.push(e),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(e="",i){this._urlChangeListeners.forEach(r=>r(e,i))}subscribe(e,i,r){return this._subject.subscribe({next:e,error:i,complete:r})}}return t.\u0275fac=function(e){return new(e||t)(Mt(_0),Mt(y0))},t.normalizeQueryParams=S4,t.joinWithSlash=Dy,t.stripTrailingSlash=LE,t.\u0275prov=Jt({factory:NK,token:t,providedIn:"root"}),t})();function NK(){return new x0(Mt(_0),Mt(y0))}function DE(t){return t.replace(/\/index.html$/,"")}var Wo=(()=>((Wo=Wo||{})[Wo.Zero=0]="Zero",Wo[Wo.One=1]="One",Wo[Wo.Two=2]="Two",Wo[Wo.Few=3]="Few",Wo[Wo.Many=4]="Many",Wo[Wo.Other=5]="Other",Wo))(),ko=(()=>((ko=ko||{})[ko.Format=0]="Format",ko[ko.Standalone=1]="Standalone",ko))(),br=(()=>((br=br||{})[br.Narrow=0]="Narrow",br[br.Abbreviated=1]="Abbreviated",br[br.Wide=2]="Wide",br[br.Short=3]="Short",br))(),io=(()=>((io=io||{})[io.Short=0]="Short",io[io.Medium=1]="Medium",io[io.Long=2]="Long",io[io.Full=3]="Full",io))(),Si=(()=>((Si=Si||{})[Si.Decimal=0]="Decimal",Si[Si.Group=1]="Group",Si[Si.List=2]="List",Si[Si.PercentSign=3]="PercentSign",Si[Si.PlusSign=4]="PlusSign",Si[Si.MinusSign=5]="MinusSign",Si[Si.Exponential=6]="Exponential",Si[Si.SuperscriptingExponent=7]="SuperscriptingExponent",Si[Si.PerMille=8]="PerMille",Si[Si.Infinity=9]="Infinity",Si[Si.NaN=10]="NaN",Si[Si.TimeSeparator=11]="TimeSeparator",Si[Si.CurrencyDecimal=12]="CurrencyDecimal",Si[Si.CurrencyGroup=13]="CurrencyGroup",Si))();function w7(t,n){return Ol(U1(t)[Wn.DateFormat],n)}function M7(t,n){return Ol(U1(t)[Wn.TimeFormat],n)}function S7(t,n){return Ol(U1(t)[Wn.DateTimeFormat],n)}function Fl(t,n){const e=U1(t),i=e[Wn.NumberSymbols][n];if(void 0===i){if(n===Si.CurrencyDecimal)return e[Wn.NumberSymbols][Si.Decimal];if(n===Si.CurrencyGroup)return e[Wn.NumberSymbols][Si.Group]}return i}const WK=function(t){return U1(t)[Wn.PluralCase]};function kE(t){if(!t[Wn.ExtraData])throw new Error(`Missing extra locale data for the locale "${t[Wn.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function Ol(t,n){for(let e=n;e>-1;e--)if(void 0!==t[e])return t[e];throw new Error("Locale data API: locale data undefined")}function Iy(t){const[n,e]=t.split(":");return{hours:+n,minutes:+e}}const QK=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,t8={},JK=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;var pa=(()=>((pa=pa||{})[pa.Short=0]="Short",pa[pa.ShortGMT=1]="ShortGMT",pa[pa.Long=2]="Long",pa[pa.Extended=3]="Extended",pa))(),Ai=(()=>((Ai=Ai||{})[Ai.FullYear=0]="FullYear",Ai[Ai.Month=1]="Month",Ai[Ai.Date=2]="Date",Ai[Ai.Hours=3]="Hours",Ai[Ai.Minutes=4]="Minutes",Ai[Ai.Seconds=5]="Seconds",Ai[Ai.FractionalSeconds=6]="FractionalSeconds",Ai[Ai.Day=7]="Day",Ai))(),or=(()=>((or=or||{})[or.DayPeriods=0]="DayPeriods",or[or.Days=1]="Days",or[or.Months=2]="Months",or[or.Eras=3]="Eras",or))();function eQ(t,n,e,i){let r=function(t){if(PE(t))return t;if("number"==typeof t&&!isNaN(t))return new Date(t);if("string"==typeof t){if(t=t.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(t)){const[r,s=1,c=1]=t.split("-").map(h=>+h);return T7(r,s-1,c)}const e=parseFloat(t);if(!isNaN(t-e))return new Date(e);let i;if(i=t.match(QK))return function(t){const n=new Date(0);let e=0,i=0;const r=t[8]?n.setUTCFullYear:n.setFullYear,s=t[8]?n.setUTCHours:n.setHours;t[9]&&(e=Number(t[9]+t[10]),i=Number(t[9]+t[11])),r.call(n,Number(t[1]),Number(t[2])-1,Number(t[3]));const c=Number(t[4]||0)-e,h=Number(t[5]||0)-i,g=Number(t[6]||0),x=Math.floor(1e3*parseFloat("0."+(t[7]||0)));return s.call(n,c,h,g,x),n}(i)}const n=new Date(t);if(!PE(n))throw new Error(`Unable to convert "${t}" into a date`);return n}(t);n=T4(e,n)||n;let h,c=[];for(;n;){if(h=JK.exec(n),!h){c.push(n);break}{c=c.concat(h.slice(1));const S=c.pop();if(!S)break;n=S}}let g=r.getTimezoneOffset();i&&(g=zE(i,g),r=function(t,n,e){const r=t.getTimezoneOffset();return function(t,n){return(t=new Date(t.getTime())).setMinutes(t.getMinutes()+n),t}(t,-1*(zE(n,r)-r))}(r,i));let x="";return c.forEach(S=>{const E=function(t){if(Py[t])return Py[t];let n;switch(t){case"G":case"GG":case"GGG":n=Es(or.Eras,br.Abbreviated);break;case"GGGG":n=Es(or.Eras,br.Wide);break;case"GGGGG":n=Es(or.Eras,br.Narrow);break;case"y":n=qo(Ai.FullYear,1,0,!1,!0);break;case"yy":n=qo(Ai.FullYear,2,0,!0,!0);break;case"yyy":n=qo(Ai.FullYear,3,0,!1,!0);break;case"yyyy":n=qo(Ai.FullYear,4,0,!1,!0);break;case"Y":n=A7(1);break;case"YY":n=A7(2,!0);break;case"YYY":n=A7(3);break;case"YYYY":n=A7(4);break;case"M":case"L":n=qo(Ai.Month,1,1);break;case"MM":case"LL":n=qo(Ai.Month,2,1);break;case"MMM":n=Es(or.Months,br.Abbreviated);break;case"MMMM":n=Es(or.Months,br.Wide);break;case"MMMMM":n=Es(or.Months,br.Narrow);break;case"LLL":n=Es(or.Months,br.Abbreviated,ko.Standalone);break;case"LLLL":n=Es(or.Months,br.Wide,ko.Standalone);break;case"LLLLL":n=Es(or.Months,br.Narrow,ko.Standalone);break;case"w":n=zy(1);break;case"ww":n=zy(2);break;case"W":n=zy(1,!0);break;case"d":n=qo(Ai.Date,1);break;case"dd":n=qo(Ai.Date,2);break;case"c":case"cc":n=qo(Ai.Day,1);break;case"ccc":n=Es(or.Days,br.Abbreviated,ko.Standalone);break;case"cccc":n=Es(or.Days,br.Wide,ko.Standalone);break;case"ccccc":n=Es(or.Days,br.Narrow,ko.Standalone);break;case"cccccc":n=Es(or.Days,br.Short,ko.Standalone);break;case"E":case"EE":case"EEE":n=Es(or.Days,br.Abbreviated);break;case"EEEE":n=Es(or.Days,br.Wide);break;case"EEEEE":n=Es(or.Days,br.Narrow);break;case"EEEEEE":n=Es(or.Days,br.Short);break;case"a":case"aa":case"aaa":n=Es(or.DayPeriods,br.Abbreviated);break;case"aaaa":n=Es(or.DayPeriods,br.Wide);break;case"aaaaa":n=Es(or.DayPeriods,br.Narrow);break;case"b":case"bb":case"bbb":n=Es(or.DayPeriods,br.Abbreviated,ko.Standalone,!0);break;case"bbbb":n=Es(or.DayPeriods,br.Wide,ko.Standalone,!0);break;case"bbbbb":n=Es(or.DayPeriods,br.Narrow,ko.Standalone,!0);break;case"B":case"BB":case"BBB":n=Es(or.DayPeriods,br.Abbreviated,ko.Format,!0);break;case"BBBB":n=Es(or.DayPeriods,br.Wide,ko.Format,!0);break;case"BBBBB":n=Es(or.DayPeriods,br.Narrow,ko.Format,!0);break;case"h":n=qo(Ai.Hours,1,-12);break;case"hh":n=qo(Ai.Hours,2,-12);break;case"H":n=qo(Ai.Hours,1);break;case"HH":n=qo(Ai.Hours,2);break;case"m":n=qo(Ai.Minutes,1);break;case"mm":n=qo(Ai.Minutes,2);break;case"s":n=qo(Ai.Seconds,1);break;case"ss":n=qo(Ai.Seconds,2);break;case"S":n=qo(Ai.FractionalSeconds,1);break;case"SS":n=qo(Ai.FractionalSeconds,2);break;case"SSS":n=qo(Ai.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":n=E7(pa.Short);break;case"ZZZZZ":n=E7(pa.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":n=E7(pa.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":n=E7(pa.Long);break;default:return null}return Py[t]=n,n}(S);x+=E?E(r,e,g):"''"===S?"'":S.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),x}function T7(t,n,e){const i=new Date(0);return i.setFullYear(t,n,e),i.setHours(0,0,0),i}function T4(t,n){const e=function(t){return U1(t)[Wn.LocaleId]}(t);if(t8[e]=t8[e]||{},t8[e][n])return t8[e][n];let i="";switch(n){case"shortDate":i=w7(t,io.Short);break;case"mediumDate":i=w7(t,io.Medium);break;case"longDate":i=w7(t,io.Long);break;case"fullDate":i=w7(t,io.Full);break;case"shortTime":i=M7(t,io.Short);break;case"mediumTime":i=M7(t,io.Medium);break;case"longTime":i=M7(t,io.Long);break;case"fullTime":i=M7(t,io.Full);break;case"short":const r=T4(t,"shortTime"),s=T4(t,"shortDate");i=L7(S7(t,io.Short),[r,s]);break;case"medium":const c=T4(t,"mediumTime"),h=T4(t,"mediumDate");i=L7(S7(t,io.Medium),[c,h]);break;case"long":const g=T4(t,"longTime"),x=T4(t,"longDate");i=L7(S7(t,io.Long),[g,x]);break;case"full":const S=T4(t,"fullTime"),E=T4(t,"fullDate");i=L7(S7(t,io.Full),[S,E])}return i&&(t8[e][n]=i),i}function L7(t,n){return n&&(t=t.replace(/\{([^}]+)}/g,function(e,i){return null!=n&&i in n?n[i]:e})),t}function bc(t,n,e="-",i,r){let s="";(t<0||r&&t<=0)&&(r?t=1-t:(t=-t,s=e));let c=String(t);for(;c.length0||h>-e)&&(h+=e),t===Ai.Hours)0===h&&-12===e&&(h=12);else if(t===Ai.FractionalSeconds)return function(t,n){return bc(t,3).substr(0,n)}(h,n);const g=Fl(c,Si.MinusSign);return bc(h,n,g,i,r)}}function Es(t,n,e=ko.Format,i=!1){return function(r,s){return function(t,n,e,i,r,s){switch(e){case or.Months:return function(t,n,e){const i=U1(t),s=Ol([i[Wn.MonthsFormat],i[Wn.MonthsStandalone]],n);return Ol(s,e)}(n,r,i)[t.getMonth()];case or.Days:return function(t,n,e){const i=U1(t),s=Ol([i[Wn.DaysFormat],i[Wn.DaysStandalone]],n);return Ol(s,e)}(n,r,i)[t.getDay()];case or.DayPeriods:const c=t.getHours(),h=t.getMinutes();if(s){const x=function(t){const n=U1(t);return kE(n),(n[Wn.ExtraData][2]||[]).map(i=>"string"==typeof i?Iy(i):[Iy(i[0]),Iy(i[1])])}(n),S=function(t,n,e){const i=U1(t);kE(i);const s=Ol([i[Wn.ExtraData][0],i[Wn.ExtraData][1]],n)||[];return Ol(s,e)||[]}(n,r,i),E=x.findIndex(A=>{if(Array.isArray(A)){const[F,j]=A,ie=c>=F.hours&&h>=F.minutes,W=c0?Math.floor(r/60):Math.ceil(r/60);switch(t){case pa.Short:return(r>=0?"+":"")+bc(c,2,s)+bc(Math.abs(r%60),2,s);case pa.ShortGMT:return"GMT"+(r>=0?"+":"")+bc(c,1,s);case pa.Long:return"GMT"+(r>=0?"+":"")+bc(c,2,s)+":"+bc(Math.abs(r%60),2,s);case pa.Extended:return 0===i?"Z":(r>=0?"+":"")+bc(c,2,s)+":"+bc(Math.abs(r%60),2,s);default:throw new Error(`Unknown zone width "${t}"`)}}}function IE(t){return T7(t.getFullYear(),t.getMonth(),t.getDate()+(4-t.getDay()))}function zy(t,n=!1){return function(e,i){let r;if(n){const s=new Date(e.getFullYear(),e.getMonth(),1).getDay()-1,c=e.getDate();r=1+Math.floor((c+s)/7)}else{const s=IE(e),c=function(t){const n=T7(t,0,1).getDay();return T7(t,0,1+(n<=4?4:11)-n)}(s.getFullYear()),h=s.getTime()-c.getTime();r=1+Math.round(h/6048e5)}return bc(r,t,Fl(i,Si.MinusSign))}}function A7(t,n=!1){return function(e,i){return bc(IE(e).getFullYear(),t,Fl(i,Si.MinusSign),n)}}const Py={};function zE(t,n){t=t.replace(/:/g,"");const e=Date.parse("Jan 01, 1970 00:00:00 "+t)/6e4;return isNaN(e)?n:e}function PE(t){return t instanceof Date&&!isNaN(t.valueOf())}class I7{}let xQ=(()=>{class t extends I7{constructor(e){super(),this.locale=e}getPluralCategory(e,i){switch(WK(i||this.locale)(e)){case Wo.Zero:return"zero";case Wo.One:return"one";case Wo.Two:return"two";case Wo.Few:return"few";case Wo.Many:return"many";default:return"other"}}}return t.\u0275fac=function(e){return new(e||t)(Mt($u))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();function NE(t,n){n=encodeURIComponent(n);for(const e of t.split(";")){const i=e.indexOf("="),[r,s]=-1==i?[e,""]:[e.slice(0,i),e.slice(i+1)];if(r.trim()===n)return decodeURIComponent(s)}return null}class MQ{constructor(n,e,i,r){this.$implicit=n,this.ngForOf=e,this.index=i,this.count=r}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let tr=(()=>{class t{constructor(e,i,r){this._viewContainer=e,this._template=i,this._differs=r,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const e=this._ngForOf;if(!this._differ&&e)try{this._differ=this._differs.find(e).create(this.ngForTrackBy)}catch(i){throw new Error(`Cannot find a differ supporting object '${e}' of type '${function(t){return t.name||typeof t}(e)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){const i=[];e.forEachOperation((r,s,c)=>{if(null==r.previousIndex){const h=this._viewContainer.createEmbeddedView(this._template,new MQ(null,this._ngForOf,-1,-1),null===c?void 0:c),g=new RE(r,h);i.push(g)}else if(null==c)this._viewContainer.remove(null===s?void 0:s);else if(null!==s){const h=this._viewContainer.get(s);this._viewContainer.move(h,c);const g=new RE(r,h);i.push(g)}});for(let r=0;r{this._viewContainer.get(r.currentIndex).context.$implicit=r.item})}_perViewChange(e,i){e.context.$implicit=i.item}static ngTemplateContextGuard(e,i){return!0}}return t.\u0275fac=function(e){return new(e||t)(B(Za),B(vo),B(y6))},t.\u0275dir=Tn({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),t})();class RE{constructor(n,e){this.record=n,this.view=e}}let di=(()=>{class t{constructor(e,i){this._viewContainer=e,this._context=new TQ,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){HE("ngIfThen",e),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){HE("ngIfElse",e),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(e,i){return!0}}return t.\u0275fac=function(e){return new(e||t)(B(Za),B(vo))},t.\u0275dir=Tn({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),t})();class TQ{constructor(){this.$implicit=null,this.ngIf=null}}function HE(t,n){if(n&&!n.createEmbeddedView)throw new Error(`${t} must be a TemplateRef, but received '${oi(n)}'.`)}let M3=(()=>{class t{constructor(e){this._viewContainerRef=e,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(e){if(e.ngTemplateOutlet){const i=this._viewContainerRef;this._viewRef&&i.remove(i.indexOf(this._viewRef)),this._viewRef=this.ngTemplateOutlet?i.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext):null}else this._viewRef&&e.ngTemplateOutletContext&&this.ngTemplateOutletContext&&(this._viewRef.context=this.ngTemplateOutletContext)}}return t.\u0275fac=function(e){return new(e||t)(B(Za))},t.\u0275dir=Tn({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[kn]}),t})();let UE=(()=>{class t{constructor(e){this.locale=e}transform(e,i="mediumDate",r,s){if(null==e||""===e||e!=e)return null;try{return eQ(e,i,s||this.locale,r)}catch(c){throw function(t,n){return Error(`InvalidPipeArgument: '${n}' for pipe '${oi(t)}'`)}(t,c.message)}}}return t.\u0275fac=function(e){return new(e||t)(B($u,16))},t.\u0275pipe=ra({name:"date",type:t,pure:!0}),t})(),S3=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({providers:[{provide:I7,useClass:xQ}]}),t})();const jE="browser";function X2(t){return t===jE}function i8(t){return"server"===t}let GE=(()=>{class t{}return t.\u0275prov=Jt({token:t,providedIn:"root",factory:()=>new JQ(Mt(Cs),window)}),t})();class JQ{constructor(n,e){this.document=n,this.window=e,this.offset=()=>[0,0]}setOffset(n){this.offset=Array.isArray(n)?()=>n:n}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(n){this.supportsScrolling()&&this.window.scrollTo(n[0],n[1])}scrollToAnchor(n){if(!this.supportsScrolling())return;const e=function(t,n){const e=t.getElementById(n)||t.getElementsByName(n)[0];if(e)return e;if("function"==typeof t.createTreeWalker&&t.body&&(t.body.createShadowRoot||t.body.attachShadow)){const i=t.createTreeWalker(t.body,NodeFilter.SHOW_ELEMENT);let r=i.currentNode;for(;r;){const s=r.shadowRoot;if(s){const c=s.getElementById(n)||s.querySelector(`[name="${n}"]`);if(c)return c}r=i.nextNode()}}return null}(this.document,n);e&&(this.scrollToElement(e),this.attemptFocus(e))}setHistoryScrollRestoration(n){if(this.supportScrollRestoration()){const e=this.window.history;e&&e.scrollRestoration&&(e.scrollRestoration=n)}}scrollToElement(n){const e=n.getBoundingClientRect(),i=e.left+this.window.pageXOffset,r=e.top+this.window.pageYOffset,s=this.offset();this.window.scrollTo(i-s[0],r-s[1])}attemptFocus(n){return n.focus(),this.document.activeElement===n}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const n=WE(this.window.history)||WE(Object.getPrototypeOf(this.window.history));return!(!n||!n.writable&&!n.set)}catch(n){return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch(n){return!1}}}function WE(t){return Object.getOwnPropertyDescriptor(t,"scrollRestoration")}class qE{}class $y extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(t){b7||(b7=t)}(new $y)}onAndCancel(n,e,i){return n.addEventListener(e,i,!1),()=>{n.removeEventListener(e,i,!1)}}dispatchEvent(n,e){n.dispatchEvent(e)}remove(n){n.parentNode&&n.parentNode.removeChild(n)}createElement(n,e){return(e=e||this.getDefaultDocument()).createElement(n)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(n){return n.nodeType===Node.ELEMENT_NODE}isShadowRoot(n){return n instanceof DocumentFragment}getGlobalEventTarget(n,e){return"window"===e?window:"document"===e?n:"body"===e?n.body:null}getBaseHref(n){const e=(r8=r8||document.querySelector("base"),r8?r8.getAttribute("href"):null);return null==e?null:function(t){z7=z7||document.createElement("a"),z7.setAttribute("href",t);const n=z7.pathname;return"/"===n.charAt(0)?n:`/${n}`}(e)}resetBaseElement(){r8=null}getUserAgent(){return window.navigator.userAgent}getCookie(n){return NE(document.cookie,n)}}let z7,r8=null;const XE=new Xt("TRANSITION_ID"),sJ=[{provide:m0,useFactory:function(t,n,e){return()=>{e.get(L6).donePromise.then(()=>{const i=w3(),r=n.querySelectorAll(`style[ng-transition="${t}"]`);for(let s=0;s{const s=n.findTestabilityInTree(i,r);if(null==s)throw new Error("Could not find testability for element.");return s},an.getAllAngularTestabilities=()=>n.getAllTestabilities(),an.getAllAngularRootElements=()=>n.getAllRootElements(),an.frameworkStabilizers||(an.frameworkStabilizers=[]),an.frameworkStabilizers.push(i=>{const r=an.getAllAngularTestabilities();let s=r.length,c=!1;const h=function(g){c=c||g,s--,0==s&&i(c)};r.forEach(function(g){g.whenStable(h)})})}findTestabilityInTree(n,e,i){if(null==e)return null;const r=n.getTestability(e);return null!=r?r:i?w3().isShadowRoot(e)?this.findTestabilityInTree(n,e.host,!0):this.findTestabilityInTree(n,e.parentElement,!0):null}}let oJ=(()=>{class t{build(){return new XMLHttpRequest}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();const s8=new Xt("EventManagerPlugins");let V7=(()=>{class t{constructor(e,i){this._zone=i,this._eventNameToPlugin=new Map,e.forEach(r=>r.manager=this),this._plugins=e.slice().reverse()}addEventListener(e,i,r){return this._findPluginFor(i).addEventListener(e,i,r)}addGlobalEventListener(e,i,r){return this._findPluginFor(i).addGlobalEventListener(e,i,r)}getZone(){return this._zone}_findPluginFor(e){const i=this._eventNameToPlugin.get(e);if(i)return i;const r=this._plugins;for(let s=0;s{class t{constructor(){this._stylesSet=new Set}addStyles(e){const i=new Set;e.forEach(r=>{this._stylesSet.has(r)||(this._stylesSet.add(r),i.add(r))}),this.onStylesAdded(i)}onStylesAdded(e){}getAllStyles(){return Array.from(this._stylesSet)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),o8=(()=>{class t extends YE{constructor(e){super(),this._doc=e,this._hostNodes=new Map,this._hostNodes.set(e.head,[])}_addStylesToHost(e,i,r){e.forEach(s=>{const c=this._doc.createElement("style");c.textContent=s,r.push(i.appendChild(c))})}addHost(e){const i=[];this._addStylesToHost(this._stylesSet,e,i),this._hostNodes.set(e,i)}removeHost(e){const i=this._hostNodes.get(e);i&&i.forEach(KE),this._hostNodes.delete(e)}onStylesAdded(e){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(e,r,i)})}ngOnDestroy(){this._hostNodes.forEach(e=>e.forEach(KE))}}return t.\u0275fac=function(e){return new(e||t)(Mt(Cs))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();function KE(t){w3().remove(t)}const Wy={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qy=/%COMP%/g;function F7(t,n,e){for(let i=0;i{if("__ngUnwrap__"===n)return t;!1===t(n)&&(n.preventDefault(),n.returnValue=!1)}}let O7=(()=>{class t{constructor(e,i,r){this.eventManager=e,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new Xy(e)}createRenderer(e,i){if(!e||!i)return this.defaultRenderer;switch(i.encapsulation){case mi.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new xJ(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(e),r}case 1:case mi.ShadowDom:return new bJ(this.eventManager,this.sharedStylesHost,e,i);default:if(!this.rendererByCompId.has(i.id)){const r=F7(i.id,i.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(i.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return t.\u0275fac=function(e){return new(e||t)(Mt(V7),Mt(o8),Mt(Yf))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();class Xy{constructor(n){this.eventManager=n,this.data=Object.create(null)}destroy(){}createElement(n,e){return e?document.createElementNS(Wy[e]||e,n):document.createElement(n)}createComment(n){return document.createComment(n)}createText(n){return document.createTextNode(n)}appendChild(n,e){n.appendChild(e)}insertBefore(n,e,i){n&&n.insertBefore(e,i)}removeChild(n,e){n&&n.removeChild(e)}selectRootElement(n,e){let i="string"==typeof n?document.querySelector(n):n;if(!i)throw new Error(`The selector "${n}" did not match any elements`);return e||(i.textContent=""),i}parentNode(n){return n.parentNode}nextSibling(n){return n.nextSibling}setAttribute(n,e,i,r){if(r){e=r+":"+e;const s=Wy[r];s?n.setAttributeNS(s,e,i):n.setAttribute(e,i)}else n.setAttribute(e,i)}removeAttribute(n,e,i){if(i){const r=Wy[i];r?n.removeAttributeNS(r,e):n.removeAttribute(`${i}:${e}`)}else n.removeAttribute(e)}addClass(n,e){n.classList.add(e)}removeClass(n,e){n.classList.remove(e)}setStyle(n,e,i,r){r&(H1.DashCase|H1.Important)?n.style.setProperty(e,i,r&H1.Important?"important":""):n.style[e]=i}removeStyle(n,e,i){i&H1.DashCase?n.style.removeProperty(e):n.style[e]=""}setProperty(n,e,i){n[e]=i}setValue(n,e){n.nodeValue=e}listen(n,e,i){return"string"==typeof n?this.eventManager.addGlobalEventListener(n,e,eD(i)):this.eventManager.addEventListener(n,e,eD(i))}}class xJ extends Xy{constructor(n,e,i,r){super(n),this.component=i;const s=F7(r+"-"+i.id,i.styles,[]);e.addStyles(s),this.contentAttr=function(t){return"_ngcontent-%COMP%".replace(qy,t)}(r+"-"+i.id),this.hostAttr=function(t){return"_nghost-%COMP%".replace(qy,t)}(r+"-"+i.id)}applyToHost(n){super.setAttribute(n,this.hostAttr,"")}createElement(n,e){const i=super.createElement(n,e);return super.setAttribute(i,this.contentAttr,""),i}}class bJ extends Xy{constructor(n,e,i,r){super(n),this.sharedStylesHost=e,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=F7(r.id,r.styles,[]);for(let c=0;c{class t extends Gy{constructor(e){super(e)}supports(e){return!0}addEventListener(e,i,r){return e.addEventListener(i,r,!1),()=>this.removeEventListener(e,i,r)}removeEventListener(e,i,r){return e.removeEventListener(i,r)}}return t.\u0275fac=function(e){return new(e||t)(Mt(Cs))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();const iD=["alt","control","meta","shift"],AJ={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},rD={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},kJ={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let IJ=(()=>{class t extends Gy{constructor(e){super(e)}supports(e){return null!=t.parseEventName(e)}addEventListener(e,i,r){const s=t.parseEventName(i),c=t.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>w3().onAndCancel(e,s.domEventName,c))}static parseEventName(e){const i=e.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const s=t._normalizeKey(i.pop());let c="";if(iD.forEach(g=>{const x=i.indexOf(g);x>-1&&(i.splice(x,1),c+=g+".")}),c+=s,0!=i.length||0===s.length)return null;const h={};return h.domEventName=r,h.fullKey=c,h}static getEventFullKey(e){let i="",r=function(t){let n=t.key;if(null==n){if(n=t.keyIdentifier,null==n)return"Unidentified";n.startsWith("U+")&&(n=String.fromCharCode(parseInt(n.substring(2),16)),3===t.location&&rD.hasOwnProperty(n)&&(n=rD[n]))}return AJ[n]||n}(e);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),iD.forEach(s=>{s!=r&&kJ[s](e)&&(i+=s+".")}),i+=r,i}static eventCallback(e,i,r){return s=>{t.getEventFullKey(s)===e&&r.runGuarded(()=>i(s))}}static _normalizeKey(e){switch(e){case"esc":return"escape";default:return e}}}return t.\u0275fac=function(e){return new(e||t)(Mt(Cs))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),L4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({factory:function(){return Mt(Yy)},token:t,providedIn:"root"}),t})(),Yy=(()=>{class t extends L4{constructor(e){super(),this._doc=e}sanitize(e,i){if(null==i)return null;switch(e){case jr.NONE:return i;case jr.HTML:return s2(i,"HTML")?xa(i):Np(this._doc,String(i)).toString();case jr.STYLE:return s2(i,"Style")?xa(i):i;case jr.SCRIPT:if(s2(i,"Script"))return xa(i);throw new Error("unsafe value used in a script context");case jr.URL:return D5(i),s2(i,"URL")?xa(i):r3(String(i));case jr.RESOURCE_URL:if(s2(i,"ResourceURL"))return xa(i);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${e} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(e){return function(t){return new E5(t)}(e)}bypassSecurityTrustStyle(e){return function(t){return new Ap(t)}(e)}bypassSecurityTrustScript(e){return function(t){return new wC(t)}(e)}bypassSecurityTrustUrl(e){return function(t){return new cc(t)}(e)}bypassSecurityTrustResourceUrl(e){return function(t){return new l4(t)}(e)}}return t.\u0275fac=function(e){return new(e||t)(Mt(Cs))},t.\u0275prov=Jt({factory:function(){return function(t){return new Yy(t.get(Cs))}(Mt(kl))},token:t,providedIn:"root"}),t})();const HJ=XL(TY,"browser",[{provide:M1,useValue:jE},{provide:OL,useValue:function(){$y.makeCurrent(),jy.init()},multi:!0},{provide:Cs,useFactory:function(){return function(t){Gc=t}(document),document},deps:[]}]),BJ=[[],{provide:g3,useValue:"root"},{provide:c4,useFactory:function(){return new c4},deps:[]},{provide:s8,useClass:wJ,multi:!0,deps:[Cs,pn,M1]},{provide:s8,useClass:IJ,multi:!0,deps:[Cs]},[],{provide:O7,useClass:O7,deps:[V7,o8,Yf]},{provide:d0,useExisting:O7},{provide:YE,useExisting:o8},{provide:o8,useClass:o8,deps:[Cs]},{provide:hy,useClass:hy,deps:[pn]},{provide:V7,useClass:V7,deps:[s8,pn]},{provide:qE,useClass:oJ,deps:[]},[]];let Ky=(()=>{class t{constructor(e){if(e)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(e){return{ngModule:t,providers:[{provide:Yf,useValue:e.appId},{provide:XE,useExisting:Yf},sJ]}}}return t.\u0275fac=function(e){return new(e||t)(Mt(t,12))},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({providers:BJ,imports:[S3,zY]}),t})();function $J(){return new sD(Mt(Cs))}let sD=(()=>{class t{constructor(e){this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}}return t.\u0275fac=function(e){return new(e||t)(Mt(Cs))},t.\u0275prov=Jt({factory:$J,token:t,providedIn:"root"}),t})();function Ni(...t){let n=t[t.length-1];return Dt(n)?(t.pop(),Pn(t,n)):ma(t)}"undefined"!=typeof window&&window;class S1 extends lt{constructor(n){super(),this._value=n}get value(){return this.getValue()}_subscribe(n){const e=super._subscribe(n);return e&&!e.closed&&n.next(this._value),e}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Ce;return this._value}next(n){super.next(this._value=n)}}class ZJ extends at{notifyNext(n,e,i,r,s){this.destination.next(e)}notifyError(n,e){this.destination.error(n)}notifyComplete(n){this.destination.complete()}}class YJ extends at{constructor(n,e,i){super(),this.parent=n,this.outerValue=e,this.outerIndex=i,this.index=0}_next(n){this.parent.notifyNext(this.outerValue,n,this.outerIndex,this.index++,this)}_error(n){this.parent.notifyError(n,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function KJ(t,n,e,i,r=new YJ(t,e,i)){if(!r.closed)return n instanceof q?n.subscribe(r):Cr(n)(r)}const aD={};class JJ{constructor(n){this.resultSelector=n}call(n,e){return e.subscribe(new eee(n,this.resultSelector))}}class eee extends ZJ{constructor(n,e){super(n),this.resultSelector=e,this.active=0,this.values=[],this.observables=[]}_next(n){this.values.push(aD),this.observables.push(n)}_complete(){const n=this.observables,e=n.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(let i=0;i{function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t})();function R7(...t){return hs(1)(Ni(...t))}const A6=new q(t=>t.complete());function H7(t){return t?function(t){return new q(n=>t.schedule(()=>n.complete()))}(t):A6}function B7(t){return new q(n=>{let e;try{e=t()}catch(r){return void n.error(r)}return(e?Mn(e):H7()).subscribe(n)})}function ri(t,n){return"function"==typeof n?e=>e.pipe(ri((i,r)=>Mn(t(i,r)).pipe(Qt((s,c)=>n(i,s,r,c))))):e=>e.lift(new iee(t))}class iee{constructor(n){this.project=n}call(n,e){return e.subscribe(new ree(n,this.project))}}class ree extends Mo{constructor(n,e){super(n),this.project=e,this.index=0}_next(n){let e;const i=this.index++;try{e=this.project(n,i)}catch(r){return void this.destination.error(r)}this._innerSub(e)}_innerSub(n){const e=this.innerSubscription;e&&e.unsubscribe();const i=new qi(this),r=this.destination;r.add(i),this.innerSubscription=Jo(n,i),this.innerSubscription!==i&&r.add(this.innerSubscription)}_complete(){const{innerSubscription:n}=this;(!n||n.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(n){this.destination.next(n)}}const lD=(()=>{function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t})();function E4(t){return n=>0===t?H7():n.lift(new see(t))}class see{constructor(n){if(this.total=n,this.total<0)throw new lD}call(n,e){return e.subscribe(new oee(n,this.total))}}class oee extends at{constructor(n,e){super(n),this.total=e,this.count=0}_next(n){const e=this.total,i=++this.count;i<=e&&(this.destination.next(n),i===e&&(this.destination.complete(),this.unsubscribe()))}}function cD(t,n){let e=!1;return arguments.length>=2&&(e=!0),function(r){return r.lift(new lee(t,n,e))}}class lee{constructor(n,e,i=!1){this.accumulator=n,this.seed=e,this.hasSeed=i}call(n,e){return e.subscribe(new cee(n,this.accumulator,this.seed,this.hasSeed))}}class cee extends at{constructor(n,e,i,r){super(n),this.accumulator=e,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(n){this.hasSeed=!0,this._seed=n}_next(n){if(this.hasSeed)return this._tryNext(n);this.seed=n,this.destination.next(n)}_tryNext(n){const e=this.index++;let i;try{i=this.accumulator(this.seed,n,e)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}function Ea(t,n){return function(i){return i.lift(new uee(t,n))}}class uee{constructor(n,e){this.predicate=n,this.thisArg=e}call(n,e){return e.subscribe(new hee(n,this.predicate,this.thisArg))}}class hee extends at{constructor(n,e,i){super(n),this.predicate=e,this.thisArg=i,this.count=0}_next(n){let e;try{e=this.predicate.call(this.thisArg,n,this.count++)}catch(i){return void this.destination.error(i)}e&&this.destination.next(n)}}function b0(t){return function(e){const i=new dee(t),r=e.lift(i);return i.caught=r}}class dee{constructor(n){this.selector=n}call(n,e){return e.subscribe(new fee(n,this.selector,this.caught))}}class fee extends Mo{constructor(n,e,i){super(n),this.selector=e,this.caught=i}error(n){if(!this.isStopped){let e;try{e=this.selector(n,this.caught)}catch(s){return void super.error(s)}this._unsubscribeAndRecycle();const i=new qi(this);this.add(i);const r=Jo(e,i);r!==i&&this.add(r)}}}function k6(t,n){return Li(t,n,1)}function Jy(t){return function(e){return 0===t?H7():e.lift(new pee(t))}}class pee{constructor(n){if(this.total=n,this.total<0)throw new lD}call(n,e){return e.subscribe(new mee(n,this.total))}}class mee extends at{constructor(n,e){super(n),this.total=e,this.ring=new Array,this.count=0}_next(n){const e=this.ring,i=this.total,r=this.count++;e.length0){const i=this.count>=this.total?this.total:this.count,r=this.ring;for(let s=0;sn.lift(new gee(t))}class gee{constructor(n){this.errorFactory=n}call(n,e){return e.subscribe(new Cee(n,this.errorFactory))}}class Cee extends at{constructor(n,e){super(n),this.errorFactory=e,this.hasValue=!1}_next(n){this.hasValue=!0,this.destination.next(n)}_complete(){if(this.hasValue)return this.destination.complete();{let n;try{n=this.errorFactory()}catch(e){n=e}this.destination.error(n)}}}function vee(){return new N7}function hD(t=null){return n=>n.lift(new yee(t))}class yee{constructor(n){this.defaultValue=n}call(n,e){return e.subscribe(new _ee(n,this.defaultValue))}}class _ee extends at{constructor(n,e){super(n),this.defaultValue=e,this.isEmpty=!0}_next(n){this.isEmpty=!1,this.destination.next(n)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function fi(t,n){const e=arguments.length>=2;return i=>i.pipe(t?Ea((r,s)=>t(r,s,i)):ge,E4(1),e?hD(n):uD(()=>new N7))}function D4(){}function v2(t,n,e){return function(r){return r.lift(new bee(t,n,e))}}class bee{constructor(n,e,i){this.nextOrObserver=n,this.error=e,this.complete=i}call(n,e){return e.subscribe(new wee(n,this.nextOrObserver,this.error,this.complete))}}class wee extends at{constructor(n,e,i,r){super(n),this._tapNext=D4,this._tapError=D4,this._tapComplete=D4,this._tapError=i||D4,this._tapComplete=r||D4,be(e)?(this._context=this,this._tapNext=e):e&&(this._context=e,this._tapNext=e.next||D4,this._tapError=e.error||D4,this._tapComplete=e.complete||D4)}_next(n){try{this._tapNext.call(this._context,n)}catch(e){return void this.destination.error(e)}this.destination.next(n)}_error(n){try{this._tapError.call(this._context,n)}catch(e){return void this.destination.error(e)}this.destination.error(n)}_complete(){try{this._tapComplete.call(this._context)}catch(n){return void this.destination.error(n)}return this.destination.complete()}}class See{constructor(n){this.callback=n}call(n,e){return e.subscribe(new Tee(n,this.callback))}}class Tee extends at{constructor(n,e){super(n),this.add(new Xe(e))}}class A4{constructor(n,e){this.id=n,this.url=e}}class U7 extends A4{constructor(n,e,i="imperative",r=null){super(n,e),this.navigationTrigger=i,this.restoredState=r}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class a8 extends A4{constructor(n,e,i){super(n,e),this.urlAfterRedirects=i}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class dD extends A4{constructor(n,e,i){super(n,e),this.reason=i}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class Lee extends A4{constructor(n,e,i){super(n,e),this.error=i}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class Eee extends A4{constructor(n,e,i,r){super(n,e),this.urlAfterRedirects=i,this.state=r}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Dee extends A4{constructor(n,e,i,r){super(n,e),this.urlAfterRedirects=i,this.state=r}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Aee extends A4{constructor(n,e,i,r,s){super(n,e),this.urlAfterRedirects=i,this.state=r,this.shouldActivate=s}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class kee extends A4{constructor(n,e,i,r){super(n,e),this.urlAfterRedirects=i,this.state=r}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Iee extends A4{constructor(n,e,i,r){super(n,e),this.urlAfterRedirects=i,this.state=r}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class fD{constructor(n){this.route=n}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class pD{constructor(n){this.route=n}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class zee{constructor(n){this.snapshot=n}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Pee{constructor(n){this.snapshot=n}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Vee{constructor(n){this.snapshot=n}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Fee{constructor(n){this.snapshot=n}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class mD{constructor(n,e,i){this.routerEvent=n,this.position=e,this.anchor=i}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}const pr="primary";class Oee{constructor(n){this.params=n||{}}has(n){return Object.prototype.hasOwnProperty.call(this.params,n)}get(n){if(this.has(n)){const e=this.params[n];return Array.isArray(e)?e[0]:e}return null}getAll(n){if(this.has(n)){const e=this.params[n];return Array.isArray(e)?e:[e]}return[]}get keys(){return Object.keys(this.params)}}function I6(t){return new Oee(t)}const gD="ngNavigationCancelingError";function e_(t){const n=Error("NavigationCancelingError: "+t);return n[gD]=!0,n}function Ree(t,n,e){const i=e.path.split("/");if(i.length>t.length||"full"===e.pathMatch&&(n.hasChildren()||i.lengthi[s]===r)}return t===n}function vD(t){return Array.prototype.concat.apply([],t)}function yD(t){return t.length>0?t[t.length-1]:null}function Ya(t,n){for(const e in t)t.hasOwnProperty(e)&&n(t[e],e)}function L3(t){return Gm(t)?t:Ef(t)?Mn(Promise.resolve(t)):Ni(t)}const Uee={exact:function bD(t,n,e){if(!M0(t.segments,n.segments)||!$7(t.segments,n.segments,e)||t.numberOfChildren!==n.numberOfChildren)return!1;for(const i in n.children)if(!t.children[i]||!bD(t.children[i],n.children[i],e))return!1;return!0},subset:wD},_D={exact:function(t,n){return T3(t,n)},subset:function(t,n){return Object.keys(n).length<=Object.keys(t).length&&Object.keys(n).every(e=>CD(t[e],n[e]))},ignored:()=>!0};function xD(t,n,e){return Uee[e.paths](t.root,n.root,e.matrixParams)&&_D[e.queryParams](t.queryParams,n.queryParams)&&!("exact"===e.fragment&&t.fragment!==n.fragment)}function wD(t,n,e){return MD(t,n,n.segments,e)}function MD(t,n,e,i){if(t.segments.length>e.length){const r=t.segments.slice(0,e.length);return!(!M0(r,e)||n.hasChildren()||!$7(r,e,i))}if(t.segments.length===e.length){if(!M0(t.segments,e)||!$7(t.segments,e,i))return!1;for(const r in n.children)if(!t.children[r]||!wD(t.children[r],n.children[r],i))return!1;return!0}{const r=e.slice(0,t.segments.length),s=e.slice(t.segments.length);return!!(M0(t.segments,r)&&$7(t.segments,r,i)&&t.children[pr])&&MD(t.children[pr],n,s,i)}}function $7(t,n,e){return n.every((i,r)=>_D[e](t[r].parameters,i.parameters))}class w0{constructor(n,e,i){this.root=n,this.queryParams=e,this.fragment=i}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=I6(this.queryParams)),this._queryParamMap}toString(){return qee.serialize(this)}}class Tr{constructor(n,e){this.segments=n,this.children=e,this.parent=null,Ya(e,(i,r)=>i.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return j7(this)}}class l8{constructor(n,e){this.path=n,this.parameters=e}get parameterMap(){return this._parameterMap||(this._parameterMap=I6(this.parameters)),this._parameterMap}toString(){return ED(this)}}function M0(t,n){return t.length===n.length&&t.every((e,i)=>e.path===n[i].path)}class c8{}class SD{parse(n){const e=new nte(n);return new w0(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())}serialize(n){return`${`/${u8(n.root,!0)}`}${function(t){const n=Object.keys(t).map(e=>{const i=t[e];return Array.isArray(i)?i.map(r=>`${G7(e)}=${G7(r)}`).join("&"):`${G7(e)}=${G7(i)}`}).filter(e=>!!e);return n.length?`?${n.join("&")}`:""}(n.queryParams)}${"string"==typeof n.fragment?`#${function(t){return encodeURI(t)}(n.fragment)}`:""}`}}const qee=new SD;function j7(t){return t.segments.map(n=>ED(n)).join("/")}function u8(t,n){if(!t.hasChildren())return j7(t);if(n){const e=t.children[pr]?u8(t.children[pr],!1):"",i=[];return Ya(t.children,(r,s)=>{s!==pr&&i.push(`${s}:${u8(r,!1)}`)}),i.length>0?`${e}(${i.join("//")})`:e}{const e=function(t,n){let e=[];return Ya(t.children,(i,r)=>{r===pr&&(e=e.concat(n(i,r)))}),Ya(t.children,(i,r)=>{r!==pr&&(e=e.concat(n(i,r)))}),e}(t,(i,r)=>r===pr?[u8(t.children[pr],!1)]:[`${r}:${u8(i,!1)}`]);return 1===Object.keys(t.children).length&&null!=t.children[pr]?`${j7(t)}/${e[0]}`:`${j7(t)}/(${e.join("//")})`}}function TD(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function G7(t){return TD(t).replace(/%3B/gi,";")}function t_(t){return TD(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function W7(t){return decodeURIComponent(t)}function LD(t){return W7(t.replace(/\+/g,"%20"))}function ED(t){return`${t_(t.path)}${function(t){return Object.keys(t).map(n=>`;${t_(n)}=${t_(t[n])}`).join("")}(t.parameters)}`}const Kee=/^[^\/()?;=#]+/;function q7(t){const n=t.match(Kee);return n?n[0]:""}const Qee=/^[^=?&#]+/,ete=/^[^?&#]+/;class nte{constructor(n){this.url=n,this.remaining=n}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Tr([],{}):new Tr([],this.parseChildren())}parseQueryParams(){const n={};if(this.consumeOptional("?"))do{this.parseQueryParam(n)}while(this.consumeOptional("&"));return n}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const n=[];for(this.peekStartsWith("(")||n.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),n.push(this.parseSegment());let e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));let i={};return this.peekStartsWith("(")&&(i=this.parseParens(!1)),(n.length>0||Object.keys(e).length>0)&&(i[pr]=new Tr(n,e)),i}parseSegment(){const n=q7(this.remaining);if(""===n&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(n),new l8(W7(n),this.parseMatrixParams())}parseMatrixParams(){const n={};for(;this.consumeOptional(";");)this.parseParam(n);return n}parseParam(n){const e=q7(this.remaining);if(!e)return;this.capture(e);let i="";if(this.consumeOptional("=")){const r=q7(this.remaining);r&&(i=r,this.capture(i))}n[W7(e)]=W7(i)}parseQueryParam(n){const e=function(t){const n=t.match(Qee);return n?n[0]:""}(this.remaining);if(!e)return;this.capture(e);let i="";if(this.consumeOptional("=")){const c=function(t){const n=t.match(ete);return n?n[0]:""}(this.remaining);c&&(i=c,this.capture(i))}const r=LD(e),s=LD(i);if(n.hasOwnProperty(r)){let c=n[r];Array.isArray(c)||(c=[c],n[r]=c),c.push(s)}else n[r]=s}parseParens(n){const e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const i=q7(this.remaining),r=this.remaining[i.length];if("/"!==r&&")"!==r&&";"!==r)throw new Error(`Cannot parse url '${this.url}'`);let s;i.indexOf(":")>-1?(s=i.substr(0,i.indexOf(":")),this.capture(s),this.capture(":")):n&&(s=pr);const c=this.parseChildren();e[s]=1===Object.keys(c).length?c[pr]:new Tr([],c),this.consumeOptional("//")}return e}peekStartsWith(n){return this.remaining.startsWith(n)}consumeOptional(n){return!!this.peekStartsWith(n)&&(this.remaining=this.remaining.substring(n.length),!0)}capture(n){if(!this.consumeOptional(n))throw new Error(`Expected "${n}".`)}}class DD{constructor(n){this._root=n}get root(){return this._root.value}parent(n){const e=this.pathFromRoot(n);return e.length>1?e[e.length-2]:null}children(n){const e=n_(n,this._root);return e?e.children.map(i=>i.value):[]}firstChild(n){const e=n_(n,this._root);return e&&e.children.length>0?e.children[0].value:null}siblings(n){const e=i_(n,this._root);return e.length<2?[]:e[e.length-2].children.map(r=>r.value).filter(r=>r!==n)}pathFromRoot(n){return i_(n,this._root).map(e=>e.value)}}function n_(t,n){if(t===n.value)return n;for(const e of n.children){const i=n_(t,e);if(i)return i}return null}function i_(t,n){if(t===n.value)return[n];for(const e of n.children){const i=i_(t,e);if(i.length)return i.unshift(n),i}return[]}class k4{constructor(n,e){this.value=n,this.children=e}toString(){return`TreeNode(${this.value})`}}function h8(t){const n={};return t&&t.children.forEach(e=>n[e.value.outlet]=e),n}class AD extends DD{constructor(n,e){super(n),this.snapshot=e,r_(this,n)}toString(){return this.snapshot.toString()}}function kD(t,n){const e=function(t,n){const c=new X7([],{},{},"",{},pr,n,null,t.root,-1,{});return new zD("",new k4(c,[]))}(t,n),i=new S1([new l8("",{})]),r=new S1({}),s=new S1({}),c=new S1({}),h=new S1(""),g=new Mc(i,r,c,h,s,pr,n,e.root);return g.snapshot=e.root,new AD(new k4(g,[]),e)}class Mc{constructor(n,e,i,r,s,c,h,g){this.url=n,this.params=e,this.queryParams=i,this.fragment=r,this.data=s,this.outlet=c,this.component=h,this._futureSnapshot=g}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(Qt(n=>I6(n)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Qt(n=>I6(n)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function ID(t,n="emptyOnly"){const e=t.pathFromRoot;let i=0;if("always"!==n)for(i=e.length-1;i>=1;){const r=e[i],s=e[i-1];if(r.routeConfig&&""===r.routeConfig.path)i--;else{if(s.component)break;i--}}return function(t){return t.reduce((n,e)=>({params:Object.assign(Object.assign({},n.params),e.params),data:Object.assign(Object.assign({},n.data),e.data),resolve:Object.assign(Object.assign({},n.resolve),e._resolvedData)}),{params:{},data:{},resolve:{}})}(e.slice(i))}class X7{constructor(n,e,i,r,s,c,h,g,x,S,E){this.url=n,this.params=e,this.queryParams=i,this.fragment=r,this.data=s,this.outlet=c,this.component=h,this.routeConfig=g,this._urlSegment=x,this._lastPathIndex=S,this._resolve=E}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=I6(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=I6(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(i=>i.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class zD extends DD{constructor(n,e){super(e),this.url=n,r_(this,e)}toString(){return PD(this._root)}}function r_(t,n){n.value._routerState=t,n.children.forEach(e=>r_(t,e))}function PD(t){const n=t.children.length>0?` { ${t.children.map(PD).join(", ")} } `:"";return`${t.value}${n}`}function s_(t){if(t.snapshot){const n=t.snapshot,e=t._futureSnapshot;t.snapshot=e,T3(n.queryParams,e.queryParams)||t.queryParams.next(e.queryParams),n.fragment!==e.fragment&&t.fragment.next(e.fragment),T3(n.params,e.params)||t.params.next(e.params),function(t,n){if(t.length!==n.length)return!1;for(let e=0;eT3(e.parameters,n[i].parameters))}(t.url,n.url)&&!(!t.parent!=!n.parent)&&(!t.parent||o_(t.parent,n.parent))}function Z7(t,n,e){if(e&&t.shouldReuseRoute(n.value,e.value.snapshot)){const i=e.value;i._futureSnapshot=n.value;const r=function(t,n,e){return n.children.map(i=>{for(const r of e.children)if(t.shouldReuseRoute(i.value,r.value.snapshot))return Z7(t,i,r);return Z7(t,i)})}(t,n,e);return new k4(i,r)}{if(t.shouldAttach(n.value)){const s=t.retrieve(n.value);if(null!==s){const c=s.route;return VD(n,c),c}}const i=function(t){return new Mc(new S1(t.url),new S1(t.params),new S1(t.queryParams),new S1(t.fragment),new S1(t.data),t.outlet,t.component,t)}(n.value),r=n.children.map(s=>Z7(t,s));return new k4(i,r)}}function VD(t,n){if(t.value.routeConfig!==n.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(t.children.length!==n.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");n.value._futureSnapshot=t.value;for(let e=0;e{s[h]=Array.isArray(c)?c.map(g=>`${g}`):`${c}`}),new w0(e.root===t?n:FD(e.root,t,n),s,r)}function FD(t,n,e){const i={};return Ya(t.children,(r,s)=>{i[s]=r===n?e:FD(r,n,e)}),new Tr(t.segments,i)}class OD{constructor(n,e,i){if(this.isAbsolute=n,this.numberOfDoubleDots=e,this.commands=i,n&&i.length>0&&Y7(i[0]))throw new Error("Root segment cannot have matrix parameters");const r=i.find(d8);if(r&&r!==yD(i))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class l_{constructor(n,e,i){this.segmentGroup=n,this.processChildren=e,this.index=i}}function ND(t,n,e){if(t||(t=new Tr([],{})),0===t.segments.length&&t.hasChildren())return K7(t,n,e);const i=function(t,n,e){let i=0,r=n;const s={match:!1,pathIndex:0,commandIndex:0};for(;r=e.length)return s;const c=t.segments[r],h=e[i];if(d8(h))break;const g=`${h}`,x=i0&&void 0===g)break;if(g&&x&&"object"==typeof x&&void 0===x.outlets){if(!HD(g,x,c))return s;i+=2}else{if(!HD(g,{},c))return s;i++}r++}return{match:!0,pathIndex:r,commandIndex:i}}(t,n,e),r=e.slice(i.commandIndex);if(i.match&&i.pathIndex{"string"==typeof s&&(s=[s]),null!==s&&(r[c]=ND(t.children[c],n,s))}),Ya(t.children,(s,c)=>{void 0===i[c]&&(r[c]=s)}),new Tr(t.segments,r)}}function c_(t,n,e){const i=t.segments.slice(0,n);let r=0;for(;r{"string"==typeof e&&(e=[e]),null!==e&&(n[i]=c_(new Tr([],{}),0,e))}),n}function RD(t){const n={};return Ya(t,(e,i)=>n[i]=`${e}`),n}function HD(t,n,e){return t==e.path&&T3(n,e.parameters)}class gte{constructor(n,e,i,r){this.routeReuseStrategy=n,this.futureState=e,this.currState=i,this.forwardEvent=r}activate(n){const e=this.futureState._root,i=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,i,n),s_(this.futureState.root),this.activateChildRoutes(e,i,n)}deactivateChildRoutes(n,e,i){const r=h8(e);n.children.forEach(s=>{const c=s.value.outlet;this.deactivateRoutes(s,r[c],i),delete r[c]}),Ya(r,(s,c)=>{this.deactivateRouteAndItsChildren(s,i)})}deactivateRoutes(n,e,i){const r=n.value,s=e?e.value:null;if(r===s)if(r.component){const c=i.getContext(r.outlet);c&&this.deactivateChildRoutes(n,e,c.children)}else this.deactivateChildRoutes(n,e,i);else s&&this.deactivateRouteAndItsChildren(e,i)}deactivateRouteAndItsChildren(n,e){this.routeReuseStrategy.shouldDetach(n.value.snapshot)?this.detachAndStoreRouteSubtree(n,e):this.deactivateRouteAndOutlet(n,e)}detachAndStoreRouteSubtree(n,e){const i=e.getContext(n.value.outlet);if(i&&i.outlet){const r=i.outlet.detach(),s=i.children.onOutletDeactivated();this.routeReuseStrategy.store(n.value.snapshot,{componentRef:r,route:n,contexts:s})}}deactivateRouteAndOutlet(n,e){const i=e.getContext(n.value.outlet),r=i&&n.value.component?i.children:e,s=h8(n);for(const c of Object.keys(s))this.deactivateRouteAndItsChildren(s[c],r);i&&i.outlet&&(i.outlet.deactivate(),i.children.onOutletDeactivated(),i.attachRef=null,i.resolver=null,i.route=null)}activateChildRoutes(n,e,i){const r=h8(e);n.children.forEach(s=>{this.activateRoutes(s,r[s.value.outlet],i),this.forwardEvent(new Fee(s.value.snapshot))}),n.children.length&&this.forwardEvent(new Pee(n.value.snapshot))}activateRoutes(n,e,i){const r=n.value,s=e?e.value:null;if(s_(r),r===s)if(r.component){const c=i.getOrCreateContext(r.outlet);this.activateChildRoutes(n,e,c.children)}else this.activateChildRoutes(n,e,i);else if(r.component){const c=i.getOrCreateContext(r.outlet);if(this.routeReuseStrategy.shouldAttach(r.snapshot)){const h=this.routeReuseStrategy.retrieve(r.snapshot);this.routeReuseStrategy.store(r.snapshot,null),c.children.onOutletReAttached(h.contexts),c.attachRef=h.componentRef,c.route=h.route.value,c.outlet&&c.outlet.attach(h.componentRef,h.route.value),BD(h.route)}else{const h=function(t){for(let n=t.parent;n;n=n.parent){const e=n.routeConfig;if(e&&e._loadedConfig)return e._loadedConfig;if(e&&e.component)return null}return null}(r.snapshot),g=h?h.module.componentFactoryResolver:null;c.attachRef=null,c.route=r,c.resolver=g,c.outlet&&c.outlet.activateWith(r,g),this.activateChildRoutes(n,null,c.children)}}else this.activateChildRoutes(n,null,i)}}function BD(t){s_(t.value),t.children.forEach(BD)}class u_{constructor(n,e){this.routes=n,this.module=e}}function Wu(t){return"function"==typeof t}function S0(t){return t instanceof w0}const f8=Symbol("INITIAL_VALUE");function p8(){return ri(t=>function(...t){let n,e;return Dt(t[t.length-1])&&(e=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&ne(t[0])&&(t=t[0]),ma(t,e).lift(new JJ(n))}(t.map(n=>n.pipe(E4(1),function(...t){const n=t[t.length-1];return Dt(n)?(t.pop(),e=>R7(t,e,n)):e=>R7(t,e)}(f8)))).pipe(cD((n,e)=>{let i=!1;return e.reduce((r,s,c)=>r!==f8?r:(s===f8&&(i=!0),i||!1!==s&&c!==e.length-1&&!S0(s)?r:s),n)},f8),Ea(n=>n!==f8),Qt(n=>S0(n)?n:!0===n),E4(1)))}let UD=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=ht({type:t,selectors:[["ng-component"]],decls:1,vars:0,template:function(e,i){1&e&&et(0,"router-outlet")},directives:function(){return[aA]},encapsulation:2}),t})();function $D(t,n=""){for(let e=0;eNl(i)===n);return e.push(...t.filter(i=>Nl(i)!==n)),e}const GD={matched:!1,consumedSegments:[],lastChild:0,parameters:{},positionalParamSegments:{}};function Q7(t,n,e){var i;if(""===n.path)return"full"===n.pathMatch&&(t.hasChildren()||e.length>0)?Object.assign({},GD):{matched:!0,consumedSegments:[],lastChild:0,parameters:{},positionalParamSegments:{}};const s=(n.matcher||Ree)(e,t,n);if(!s)return Object.assign({},GD);const c={};Ya(s.posParams,(g,x)=>{c[x]=g.path});const h=s.consumed.length>0?Object.assign(Object.assign({},c),s.consumed[s.consumed.length-1].parameters):c;return{matched:!0,consumedSegments:s.consumed,lastChild:s.consumed.length,parameters:h,positionalParamSegments:null!==(i=s.posParams)&&void 0!==i?i:{}}}function J7(t,n,e,i,r="corrected"){if(e.length>0&&function(t,n,e){return e.some(i=>eg(t,n,i)&&Nl(i)!==pr)}(t,e,i)){const c=new Tr(n,function(t,n,e,i){const r={};r[pr]=i,i._sourceSegment=t,i._segmentIndexShift=n.length;for(const s of e)if(""===s.path&&Nl(s)!==pr){const c=new Tr([],{});c._sourceSegment=t,c._segmentIndexShift=n.length,r[Nl(s)]=c}return r}(t,n,i,new Tr(e,t.children)));return c._sourceSegment=t,c._segmentIndexShift=n.length,{segmentGroup:c,slicedSegments:[]}}if(0===e.length&&function(t,n,e){return e.some(i=>eg(t,n,i))}(t,e,i)){const c=new Tr(t.segments,function(t,n,e,i,r,s){const c={};for(const h of i)if(eg(t,e,h)&&!r[Nl(h)]){const g=new Tr([],{});g._sourceSegment=t,g._segmentIndexShift="legacy"===s?t.segments.length:n.length,c[Nl(h)]=g}return Object.assign(Object.assign({},r),c)}(t,n,e,i,t.children,r));return c._sourceSegment=t,c._segmentIndexShift=n.length,{segmentGroup:c,slicedSegments:e}}const s=new Tr(t.segments,t.children);return s._sourceSegment=t,s._segmentIndexShift=n.length,{segmentGroup:s,slicedSegments:e}}function eg(t,n,e){return(!(t.hasChildren()||n.length>0)||"full"!==e.pathMatch)&&""===e.path}function WD(t,n,e,i){return!!(Nl(t)===i||i!==pr&&eg(n,e,t))&&("**"===t.path||Q7(n,t,e).matched)}function qD(t,n,e){return 0===n.length&&!t.children[e]}class m8{constructor(n){this.segmentGroup=n||null}}class XD{constructor(n){this.urlTree=n}}function tg(t){return new q(n=>n.error(new m8(t)))}function ZD(t){return new q(n=>n.error(new XD(t)))}function Dte(t){return new q(n=>n.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${t}'`)))}class Ite{constructor(n,e,i,r,s){this.configLoader=e,this.urlSerializer=i,this.urlTree=r,this.config=s,this.allowRedirects=!0,this.ngModule=n.get(b3)}apply(){const n=J7(this.urlTree.root,[],[],this.config).segmentGroup,e=new Tr(n.segments,n.children);return this.expandSegmentGroup(this.ngModule,this.config,e,pr).pipe(Qt(s=>this.createUrlTree(d_(s),this.urlTree.queryParams,this.urlTree.fragment))).pipe(b0(s=>{if(s instanceof XD)return this.allowRedirects=!1,this.match(s.urlTree);throw s instanceof m8?this.noMatchError(s):s}))}match(n){return this.expandSegmentGroup(this.ngModule,this.config,n.root,pr).pipe(Qt(r=>this.createUrlTree(d_(r),n.queryParams,n.fragment))).pipe(b0(r=>{throw r instanceof m8?this.noMatchError(r):r}))}noMatchError(n){return new Error(`Cannot match any routes. URL Segment: '${n.segmentGroup}'`)}createUrlTree(n,e,i){const r=n.segments.length>0?new Tr([],{[pr]:n}):n;return new w0(r,e,i)}expandSegmentGroup(n,e,i,r){return 0===i.segments.length&&i.hasChildren()?this.expandChildren(n,e,i).pipe(Qt(s=>new Tr([],s))):this.expandSegment(n,i,e,i.segments,r,!0)}expandChildren(n,e,i){const r=[];for(const s of Object.keys(i.children))"primary"===s?r.unshift(s):r.push(s);return Mn(r).pipe(k6(s=>{const c=i.children[s],h=jD(e,s);return this.expandSegmentGroup(n,h,c,s).pipe(Qt(g=>({segment:g,outlet:s})))}),cD((s,c)=>(s[c.outlet]=c.segment,s),{}),function(t,n){const e=arguments.length>=2;return i=>i.pipe(t?Ea((r,s)=>t(r,s,i)):ge,Jy(1),e?hD(n):uD(()=>new N7))}())}expandSegment(n,e,i,r,s,c){return Mn(i).pipe(k6(h=>this.expandSegmentAgainstRoute(n,e,i,h,r,s,c).pipe(b0(x=>{if(x instanceof m8)return Ni(null);throw x}))),fi(h=>!!h),b0((h,g)=>{if(h instanceof N7||"EmptyError"===h.name){if(qD(e,r,s))return Ni(new Tr([],{}));throw new m8(e)}throw h}))}expandSegmentAgainstRoute(n,e,i,r,s,c,h){return WD(r,e,s,c)?void 0===r.redirectTo?this.matchSegmentAgainstRoute(n,e,r,s,c):h&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(n,e,i,r,s,c):tg(e):tg(e)}expandSegmentAgainstRouteUsingRedirect(n,e,i,r,s,c){return"**"===r.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(n,i,r,c):this.expandRegularSegmentAgainstRouteUsingRedirect(n,e,i,r,s,c)}expandWildCardWithParamsAgainstRouteUsingRedirect(n,e,i,r){const s=this.applyRedirectCommands([],i.redirectTo,{});return i.redirectTo.startsWith("/")?ZD(s):this.lineralizeSegments(i,s).pipe(Li(c=>{const h=new Tr(c,{});return this.expandSegment(n,h,e,c,r,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(n,e,i,r,s,c){const{matched:h,consumedSegments:g,lastChild:x,positionalParamSegments:S}=Q7(e,r,s);if(!h)return tg(e);const E=this.applyRedirectCommands(g,r.redirectTo,S);return r.redirectTo.startsWith("/")?ZD(E):this.lineralizeSegments(r,E).pipe(Li(A=>this.expandSegment(n,e,i,A.concat(s.slice(x)),c,!1)))}matchSegmentAgainstRoute(n,e,i,r,s){if("**"===i.path)return i.loadChildren?(i._loadedConfig?Ni(i._loadedConfig):this.configLoader.load(n.injector,i)).pipe(Qt(A=>(i._loadedConfig=A,new Tr(r,{})))):Ni(new Tr(r,{}));const{matched:c,consumedSegments:h,lastChild:g}=Q7(e,i,r);if(!c)return tg(e);const x=r.slice(g);return this.getChildConfig(n,i,r).pipe(Li(E=>{const A=E.module,F=E.routes,{segmentGroup:j,slicedSegments:ie}=J7(e,h,x,F),W=new Tr(j.segments,j.children);if(0===ie.length&&W.hasChildren())return this.expandChildren(A,F,W).pipe(Qt(xt=>new Tr(h,xt)));if(0===F.length&&0===ie.length)return Ni(new Tr(h,{}));const Ee=Nl(i)===s;return this.expandSegment(A,W,F,ie,Ee?pr:s,!0).pipe(Qt(Ze=>new Tr(h.concat(Ze.segments),Ze.children)))}))}getChildConfig(n,e,i){return e.children?Ni(new u_(e.children,n)):e.loadChildren?void 0!==e._loadedConfig?Ni(e._loadedConfig):this.runCanLoadGuards(n.injector,e,i).pipe(Li(r=>r?this.configLoader.load(n.injector,e).pipe(Qt(s=>(e._loadedConfig=s,s))):function(t){return new q(n=>n.error(e_(`Cannot load children because the guard of the route "path: '${t.path}'" returned false`)))}(e))):Ni(new u_([],n))}runCanLoadGuards(n,e,i){const r=e.canLoad;return r&&0!==r.length?Ni(r.map(c=>{const h=n.get(c);let g;if(function(t){return t&&Wu(t.canLoad)}(h))g=h.canLoad(e,i);else{if(!Wu(h))throw new Error("Invalid CanLoad guard");g=h(e,i)}return L3(g)})).pipe(p8(),v2(c=>{if(!S0(c))return;const h=e_(`Redirecting to "${this.urlSerializer.serialize(c)}"`);throw h.url=c,h}),Qt(c=>!0===c)):Ni(!0)}lineralizeSegments(n,e){let i=[],r=e.root;for(;;){if(i=i.concat(r.segments),0===r.numberOfChildren)return Ni(i);if(r.numberOfChildren>1||!r.children[pr])return Dte(n.redirectTo);r=r.children[pr]}}applyRedirectCommands(n,e,i){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),n,i)}applyRedirectCreatreUrlTree(n,e,i,r){const s=this.createSegmentGroup(n,e.root,i,r);return new w0(s,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)}createQueryParams(n,e){const i={};return Ya(n,(r,s)=>{if("string"==typeof r&&r.startsWith(":")){const h=r.substring(1);i[s]=e[h]}else i[s]=r}),i}createSegmentGroup(n,e,i,r){const s=this.createSegments(n,e.segments,i,r);let c={};return Ya(e.children,(h,g)=>{c[g]=this.createSegmentGroup(n,h,i,r)}),new Tr(s,c)}createSegments(n,e,i,r){return e.map(s=>s.path.startsWith(":")?this.findPosParam(n,s,r):this.findOrReturn(s,i))}findPosParam(n,e,i){const r=i[e.path.substring(1)];if(!r)throw new Error(`Cannot redirect to '${n}'. Cannot find '${e.path}'.`);return r}findOrReturn(n,e){let i=0;for(const r of e){if(r.path===n.path)return e.splice(i),r;i++}return n}}function d_(t){const n={};for(const i of Object.keys(t.children)){const s=d_(t.children[i]);(s.segments.length>0||s.hasChildren())&&(n[i]=s)}return function(t){if(1===t.numberOfChildren&&t.children[pr]){const n=t.children[pr];return new Tr(t.segments.concat(n.segments),n.children)}return t}(new Tr(t.segments,n))}class YD{constructor(n){this.path=n,this.route=this.path[this.path.length-1]}}class ng{constructor(n,e){this.component=n,this.route=e}}function Vte(t,n,e){const i=t._root;return g8(i,n?n._root:null,e,[i.value])}function ig(t,n,e){const i=function(t){if(!t)return null;for(let n=t.parent;n;n=n.parent){const e=n.routeConfig;if(e&&e._loadedConfig)return e._loadedConfig}return null}(n);return(i?i.module.injector:e).get(t)}function g8(t,n,e,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const s=h8(n);return t.children.forEach(c=>{(function(t,n,e,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const s=t.value,c=n?n.value:null,h=e?e.getContext(t.value.outlet):null;if(c&&s.routeConfig===c.routeConfig){const g=function(t,n,e){if("function"==typeof e)return e(t,n);switch(e){case"pathParamsChange":return!M0(t.url,n.url);case"pathParamsOrQueryParamsChange":return!M0(t.url,n.url)||!T3(t.queryParams,n.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!o_(t,n)||!T3(t.queryParams,n.queryParams);case"paramsChange":default:return!o_(t,n)}}(c,s,s.routeConfig.runGuardsAndResolvers);g?r.canActivateChecks.push(new YD(i)):(s.data=c.data,s._resolvedData=c._resolvedData),g8(t,n,s.component?h?h.children:null:e,i,r),g&&h&&h.outlet&&h.outlet.isActivated&&r.canDeactivateChecks.push(new ng(h.outlet.component,c))}else c&&C8(n,h,r),r.canActivateChecks.push(new YD(i)),g8(t,null,s.component?h?h.children:null:e,i,r)})(c,s[c.value.outlet],e,i.concat([c.value]),r),delete s[c.value.outlet]}),Ya(s,(c,h)=>C8(c,e.getContext(h),r)),r}function C8(t,n,e){const i=h8(t),r=t.value;Ya(i,(s,c)=>{C8(s,r.component?n?n.children.getContext(c):null:n,e)}),e.canDeactivateChecks.push(new ng(r.component&&n&&n.outlet&&n.outlet.isActivated?n.outlet.component:null,r))}class Xte{}function KD(t){return new q(n=>n.error(t))}class Yte{constructor(n,e,i,r,s,c){this.rootComponentType=n,this.config=e,this.urlTree=i,this.url=r,this.paramsInheritanceStrategy=s,this.relativeLinkResolution=c}recognize(){const n=J7(this.urlTree.root,[],[],this.config.filter(c=>void 0===c.redirectTo),this.relativeLinkResolution).segmentGroup,e=this.processSegmentGroup(this.config,n,pr);if(null===e)return null;const i=new X7([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},pr,this.rootComponentType,null,this.urlTree.root,-1,{}),r=new k4(i,e),s=new zD(this.url,r);return this.inheritParamsAndData(s._root),s}inheritParamsAndData(n){const e=n.value,i=ID(e,this.paramsInheritanceStrategy);e.params=Object.freeze(i.params),e.data=Object.freeze(i.data),n.children.forEach(r=>this.inheritParamsAndData(r))}processSegmentGroup(n,e,i){return 0===e.segments.length&&e.hasChildren()?this.processChildren(n,e):this.processSegment(n,e,e.segments,i)}processChildren(n,e){const i=[];for(const s of Object.keys(e.children)){const c=e.children[s],h=jD(n,s),g=this.processSegmentGroup(h,c,s);if(null===g)return null;i.push(...g)}const r=QD(i);return function(t){t.sort((n,e)=>n.value.outlet===pr?-1:e.value.outlet===pr?1:n.value.outlet.localeCompare(e.value.outlet))}(r),r}processSegment(n,e,i,r){for(const s of n){const c=this.processSegmentAgainstRoute(s,e,i,r);if(null!==c)return c}return qD(e,i,r)?[]:null}processSegmentAgainstRoute(n,e,i,r){if(n.redirectTo||!WD(n,e,i,r))return null;let s,c=[],h=[];if("**"===n.path){const F=i.length>0?yD(i).parameters:{};s=new X7(i,F,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,tA(n),Nl(n),n.component,n,JD(e),eA(e)+i.length,nA(n))}else{const F=Q7(e,n,i);if(!F.matched)return null;c=F.consumedSegments,h=i.slice(F.lastChild),s=new X7(c,F.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,tA(n),Nl(n),n.component,n,JD(e),eA(e)+c.length,nA(n))}const g=function(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(n),{segmentGroup:x,slicedSegments:S}=J7(e,c,h,g.filter(F=>void 0===F.redirectTo),this.relativeLinkResolution);if(0===S.length&&x.hasChildren()){const F=this.processChildren(g,x);return null===F?null:[new k4(s,F)]}if(0===g.length&&0===S.length)return[new k4(s,[])];const E=Nl(n)===r,A=this.processSegment(g,x,S,E?pr:r);return null===A?null:[new k4(s,A)]}}function Jte(t){const n=t.value.routeConfig;return n&&""===n.path&&void 0===n.redirectTo}function QD(t){const n=[],e=new Set;for(const i of t){if(!Jte(i)){n.push(i);continue}const r=n.find(s=>i.value.routeConfig===s.value.routeConfig);void 0!==r?(r.children.push(...i.children),e.add(r)):n.push(i)}for(const i of e){const r=QD(i.children);n.push(new k4(i.value,r))}return n.filter(i=>!e.has(i))}function JD(t){let n=t;for(;n._sourceSegment;)n=n._sourceSegment;return n}function eA(t){let n=t,e=n._segmentIndexShift?n._segmentIndexShift:0;for(;n._sourceSegment;)n=n._sourceSegment,e+=n._segmentIndexShift?n._segmentIndexShift:0;return e-1}function tA(t){return t.data||{}}function nA(t){return t.resolve||{}}function f_(t){return ri(n=>{const e=t(n);return e?Mn(e).pipe(Qt(()=>n)):Ni(n)})}class iA{}class one extends class{shouldDetach(n){return!1}store(n,e){}shouldAttach(n){return!1}retrieve(n){return null}shouldReuseRoute(n,e){return n.routeConfig===e.routeConfig}}{}const p_=new Xt("ROUTES");class rA{constructor(n,e,i,r){this.loader=n,this.compiler=e,this.onLoadStartListener=i,this.onLoadEndListener=r}load(n,e){if(e._loader$)return e._loader$;this.onLoadStartListener&&this.onLoadStartListener(e);const r=this.loadModuleFactory(e.loadChildren).pipe(Qt(s=>{this.onLoadEndListener&&this.onLoadEndListener(e);const c=s.create(n);return new u_(vD(c.injector.get(p_,void 0,Be.Self|Be.Optional)).map(h_),c)}),b0(s=>{throw e._loader$=void 0,s}));return e._loader$=new qr(r,()=>new lt).pipe(ga()),e._loader$}loadModuleFactory(n){return"string"==typeof n?Mn(this.loader.load(n)):L3(n()).pipe(Li(e=>e instanceof PT?Ni(e):Mn(this.compiler.compileModuleAsync(e))))}}class ane{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new qu,this.attachRef=null}}class qu{constructor(){this.contexts=new Map}onChildOutletCreated(n,e){const i=this.getOrCreateContext(n);i.outlet=e,this.contexts.set(n,i)}onChildOutletDestroyed(n){const e=this.getContext(n);e&&(e.outlet=null,e.attachRef=null)}onOutletDeactivated(){const n=this.contexts;return this.contexts=new Map,n}onOutletReAttached(n){this.contexts=n}getOrCreateContext(n){let e=this.getContext(n);return e||(e=new ane,this.contexts.set(n,e)),e}getContext(n){return this.contexts.get(n)||null}}class cne{shouldProcessUrl(n){return!0}extract(n){return n}merge(n,e){return n}}function une(t){throw t}function hne(t,n,e){return n.parse("/")}function sA(t,n){return Ni(null)}const dne={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},fne={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let rs=(()=>{class t{constructor(e,i,r,s,c,h,g,x){this.rootComponentType=e,this.urlSerializer=i,this.rootContexts=r,this.location=s,this.config=x,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.disposed=!1,this.lastLocationChangeInfo=null,this.navigationId=0,this.currentPageId=0,this.isNgZoneEnabled=!1,this.events=new lt,this.errorHandler=une,this.malformedUriErrorHandler=hne,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:sA,afterPreactivation:sA},this.urlHandlingStrategy=new cne,this.routeReuseStrategy=new one,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.canceledNavigationResolution="replace",this.ngModule=c.get(b3),this.console=c.get(u7);const A=c.get(pn);this.isNgZoneEnabled=A instanceof pn&&pn.isInAngularZone(),this.resetConfig(x),this.currentUrlTree=new w0(new Tr([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new rA(h,g,F=>this.triggerEvent(new fD(F)),F=>this.triggerEvent(new pD(F))),this.routerState=kD(this.currentUrlTree,this.rootComponentType),this.transitions=new S1({id:0,targetPageId:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}get browserPageId(){var e;return null===(e=this.location.getState())||void 0===e?void 0:e.\u0275routerPageId}setupNavigations(e){const i=this.events;return e.pipe(Ea(r=>0!==r.id),Qt(r=>Object.assign(Object.assign({},r),{extractedUrl:this.urlHandlingStrategy.extract(r.rawUrl)})),ri(r=>{let s=!1,c=!1;return Ni(r).pipe(v2(h=>{this.currentNavigation={id:h.id,initialUrl:h.currentRawUrl,extractedUrl:h.extractedUrl,trigger:h.source,extras:h.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign(Object.assign({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),ri(h=>{const g=this.browserUrlTree.toString(),x=!this.navigated||h.extractedUrl.toString()!==g||g!==this.currentUrlTree.toString();if(("reload"===this.onSameUrlNavigation||x)&&this.urlHandlingStrategy.shouldProcessUrl(h.rawUrl))return rg(h.source)&&(this.browserUrlTree=h.extractedUrl),Ni(h).pipe(ri(E=>{const A=this.transitions.getValue();return i.next(new U7(E.id,this.serializeUrl(E.extractedUrl),E.source,E.restoredState)),A!==this.transitions.getValue()?A6:Promise.resolve(E)}),function(t,n,e,i){return ri(r=>function(t,n,e,i,r){return new Ite(t,n,e,i,r).apply()}(t,n,e,r.extractedUrl,i).pipe(Qt(s=>Object.assign(Object.assign({},r),{urlAfterRedirects:s}))))}(this.ngModule.injector,this.configLoader,this.urlSerializer,this.config),v2(E=>{this.currentNavigation=Object.assign(Object.assign({},this.currentNavigation),{finalUrl:E.urlAfterRedirects})}),function(t,n,e,i,r){return Li(s=>function(t,n,e,i,r="emptyOnly",s="legacy"){try{const c=new Yte(t,n,e,i,r,s).recognize();return null===c?KD(new Xte):Ni(c)}catch(c){return KD(c)}}(t,n,s.urlAfterRedirects,e(s.urlAfterRedirects),i,r).pipe(Qt(c=>Object.assign(Object.assign({},s),{targetSnapshot:c}))))}(this.rootComponentType,this.config,E=>this.serializeUrl(E),this.paramsInheritanceStrategy,this.relativeLinkResolution),v2(E=>{"eager"===this.urlUpdateStrategy&&(E.extras.skipLocationChange||this.setBrowserUrl(E.urlAfterRedirects,E),this.browserUrlTree=E.urlAfterRedirects);const A=new Eee(E.id,this.serializeUrl(E.extractedUrl),this.serializeUrl(E.urlAfterRedirects),E.targetSnapshot);i.next(A)}));if(x&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:A,extractedUrl:F,source:j,restoredState:ie,extras:W}=h,Ee=new U7(A,this.serializeUrl(F),j,ie);i.next(Ee);const Se=kD(F,this.rootComponentType).snapshot;return Ni(Object.assign(Object.assign({},h),{targetSnapshot:Se,urlAfterRedirects:F,extras:Object.assign(Object.assign({},W),{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=h.rawUrl,this.browserUrlTree=h.urlAfterRedirects,h.resolve(null),A6}),f_(h=>{const{targetSnapshot:g,id:x,extractedUrl:S,rawUrl:E,extras:{skipLocationChange:A,replaceUrl:F}}=h;return this.hooks.beforePreactivation(g,{navigationId:x,appliedUrlTree:S,rawUrlTree:E,skipLocationChange:!!A,replaceUrl:!!F})}),v2(h=>{const g=new Dee(h.id,this.serializeUrl(h.extractedUrl),this.serializeUrl(h.urlAfterRedirects),h.targetSnapshot);this.triggerEvent(g)}),Qt(h=>Object.assign(Object.assign({},h),{guards:Vte(h.targetSnapshot,h.currentSnapshot,this.rootContexts)})),function(t,n){return Li(e=>{const{targetSnapshot:i,currentSnapshot:r,guards:{canActivateChecks:s,canDeactivateChecks:c}}=e;return 0===c.length&&0===s.length?Ni(Object.assign(Object.assign({},e),{guardsResult:!0})):function(t,n,e,i){return Mn(t).pipe(Li(r=>function(t,n,e,i,r){const s=n&&n.routeConfig?n.routeConfig.canDeactivate:null;return s&&0!==s.length?Ni(s.map(h=>{const g=ig(h,n,r);let x;if(function(t){return t&&Wu(t.canDeactivate)}(g))x=L3(g.canDeactivate(t,n,e,i));else{if(!Wu(g))throw new Error("Invalid CanDeactivate guard");x=L3(g(t,n,e,i))}return x.pipe(fi())})).pipe(p8()):Ni(!0)}(r.component,r.route,e,n,i)),fi(r=>!0!==r,!0))}(c,i,r,t).pipe(Li(h=>h&&function(t){return"boolean"==typeof t}(h)?function(t,n,e,i){return Mn(n).pipe(k6(r=>R7(function(t,n){return null!==t&&n&&n(new zee(t)),Ni(!0)}(r.route.parent,i),function(t,n){return null!==t&&n&&n(new Vee(t)),Ni(!0)}(r.route,i),function(t,n,e){const i=n[n.length-1],s=n.slice(0,n.length-1).reverse().map(c=>function(t){const n=t.routeConfig?t.routeConfig.canActivateChild:null;return n&&0!==n.length?{node:t,guards:n}:null}(c)).filter(c=>null!==c).map(c=>B7(()=>Ni(c.guards.map(g=>{const x=ig(g,c.node,e);let S;if(function(t){return t&&Wu(t.canActivateChild)}(x))S=L3(x.canActivateChild(i,t));else{if(!Wu(x))throw new Error("Invalid CanActivateChild guard");S=L3(x(i,t))}return S.pipe(fi())})).pipe(p8())));return Ni(s).pipe(p8())}(t,r.path,e),function(t,n,e){const i=n.routeConfig?n.routeConfig.canActivate:null;return i&&0!==i.length?Ni(i.map(s=>B7(()=>{const c=ig(s,n,e);let h;if(function(t){return t&&Wu(t.canActivate)}(c))h=L3(c.canActivate(n,t));else{if(!Wu(c))throw new Error("Invalid CanActivate guard");h=L3(c(n,t))}return h.pipe(fi())}))).pipe(p8()):Ni(!0)}(t,r.route,e))),fi(r=>!0!==r,!0))}(i,s,t,n):Ni(h)),Qt(h=>Object.assign(Object.assign({},e),{guardsResult:h})))})}(this.ngModule.injector,h=>this.triggerEvent(h)),v2(h=>{if(S0(h.guardsResult)){const x=e_(`Redirecting to "${this.serializeUrl(h.guardsResult)}"`);throw x.url=h.guardsResult,x}const g=new Aee(h.id,this.serializeUrl(h.extractedUrl),this.serializeUrl(h.urlAfterRedirects),h.targetSnapshot,!!h.guardsResult);this.triggerEvent(g)}),Ea(h=>!!h.guardsResult||(this.restoreHistory(h),this.cancelNavigationTransition(h,""),!1)),f_(h=>{if(h.guards.canActivateChecks.length)return Ni(h).pipe(v2(g=>{const x=new kee(g.id,this.serializeUrl(g.extractedUrl),this.serializeUrl(g.urlAfterRedirects),g.targetSnapshot);this.triggerEvent(x)}),ri(g=>{let x=!1;return Ni(g).pipe(function(t,n){return Li(e=>{const{targetSnapshot:i,guards:{canActivateChecks:r}}=e;if(!r.length)return Ni(e);let s=0;return Mn(r).pipe(k6(c=>function(t,n,e,i){return function(t,n,e,i){const r=Object.keys(t);if(0===r.length)return Ni({});const s={};return Mn(r).pipe(Li(c=>function(t,n,e,i){const r=ig(t,n,i);return L3(r.resolve?r.resolve(n,e):r(n,e))}(t[c],n,e,i).pipe(v2(h=>{s[c]=h}))),Jy(1),Li(()=>Object.keys(s).length===r.length?Ni(s):A6))}(t._resolve,t,n,i).pipe(Qt(s=>(t._resolvedData=s,t.data=Object.assign(Object.assign({},t.data),ID(t,e).resolve),null)))}(c.route,i,t,n)),v2(()=>s++),Jy(1),Li(c=>s===r.length?Ni(e):A6))})}(this.paramsInheritanceStrategy,this.ngModule.injector),v2({next:()=>x=!0,complete:()=>{x||(this.restoreHistory(g),this.cancelNavigationTransition(g,"At least one route resolver didn't emit any value."))}}))}),v2(g=>{const x=new Iee(g.id,this.serializeUrl(g.extractedUrl),this.serializeUrl(g.urlAfterRedirects),g.targetSnapshot);this.triggerEvent(x)}))}),f_(h=>{const{targetSnapshot:g,id:x,extractedUrl:S,rawUrl:E,extras:{skipLocationChange:A,replaceUrl:F}}=h;return this.hooks.afterPreactivation(g,{navigationId:x,appliedUrlTree:S,rawUrlTree:E,skipLocationChange:!!A,replaceUrl:!!F})}),Qt(h=>{const g=function(t,n,e){const i=Z7(t,n._root,e?e._root:void 0);return new AD(i,n)}(this.routeReuseStrategy,h.targetSnapshot,h.currentRouterState);return Object.assign(Object.assign({},h),{targetRouterState:g})}),v2(h=>{this.currentUrlTree=h.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(h.urlAfterRedirects,h.rawUrl),this.routerState=h.targetRouterState,"deferred"===this.urlUpdateStrategy&&(h.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,h),this.browserUrlTree=h.urlAfterRedirects)}),((t,n,e)=>Qt(i=>(new gte(n,i.targetRouterState,i.currentRouterState,e).activate(t),i)))(this.rootContexts,this.routeReuseStrategy,h=>this.triggerEvent(h)),v2({next(){s=!0},complete(){s=!0}}),function(t){return n=>n.lift(new See(t))}(()=>{var h;if(!s&&!c){const g=`Navigation ID ${r.id} is not equal to the current navigation id ${this.navigationId}`;"replace"===this.canceledNavigationResolution?(this.restoreHistory(r),this.cancelNavigationTransition(r,g)):this.cancelNavigationTransition(r,g)}(null===(h=this.currentNavigation)||void 0===h?void 0:h.id)===r.id&&(this.currentNavigation=null)}),b0(h=>{if(c=!0,function(t){return t&&t[gD]}(h)){const g=S0(h.url);g||(this.navigated=!0,this.restoreHistory(r,!0));const x=new dD(r.id,this.serializeUrl(r.extractedUrl),h.message);i.next(x),g?setTimeout(()=>{const S=this.urlHandlingStrategy.merge(h.url,this.rawUrlTree),E={skipLocationChange:r.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||rg(r.source)};this.scheduleNavigation(S,"imperative",null,E,{resolve:r.resolve,reject:r.reject,promise:r.promise})},0):r.resolve(!1)}else{this.restoreHistory(r,!0);const g=new Lee(r.id,this.serializeUrl(r.extractedUrl),h);i.next(g);try{r.resolve(this.errorHandler(h))}catch(x){r.reject(x)}}return A6}))}))}resetRootComponentType(e){this.rootComponentType=e,this.routerState.root.component=this.rootComponentType}getTransition(){const e=this.transitions.value;return e.urlAfterRedirects=this.browserUrlTree,e}setTransition(e){this.transitions.next(Object.assign(Object.assign({},this.getTransition()),e))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(e=>{const i=this.extractLocationChangeInfoFromEvent(e);this.shouldScheduleNavigation(this.lastLocationChangeInfo,i)&&setTimeout(()=>{const{source:r,state:s,urlTree:c}=i,h={replaceUrl:!0};if(s){const g=Object.assign({},s);delete g.navigationId,delete g.\u0275routerPageId,0!==Object.keys(g).length&&(h.state=g)}this.scheduleNavigation(c,r,s,h)},0),this.lastLocationChangeInfo=i}))}extractLocationChangeInfoFromEvent(e){var i;return{source:"popstate"===e.type?"popstate":"hashchange",urlTree:this.parseUrl(e.url),state:(null===(i=e.state)||void 0===i?void 0:i.navigationId)?e.state:null,transitionId:this.getTransition().id}}shouldScheduleNavigation(e,i){if(!e)return!0;const r=i.urlTree.toString()===e.urlTree.toString();return i.transitionId!==e.transitionId||!r||!("hashchange"===i.source&&"popstate"===e.source||"popstate"===i.source&&"hashchange"===e.source)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(e){this.events.next(e)}resetConfig(e){$D(e),this.config=e.map(h_),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.transitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0}createUrlTree(e,i={}){const{relativeTo:r,queryParams:s,fragment:c,queryParamsHandling:h,preserveFragment:g}=i,x=r||this.routerState.root,S=g?this.currentUrlTree.fragment:c;let E=null;switch(h){case"merge":E=Object.assign(Object.assign({},this.currentUrlTree.queryParams),s);break;case"preserve":E=this.currentUrlTree.queryParams;break;default:E=s||null}return null!==E&&(E=this.removeEmptyProps(E)),function(t,n,e,i,r){if(0===e.length)return a_(n.root,n.root,n,i,r);const s=function(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new OD(!0,0,t);let n=0,e=!1;const i=t.reduce((r,s,c)=>{if("object"==typeof s&&null!=s){if(s.outlets){const h={};return Ya(s.outlets,(g,x)=>{h[x]="string"==typeof g?g.split("/"):g}),[...r,{outlets:h}]}if(s.segmentPath)return[...r,s.segmentPath]}return"string"!=typeof s?[...r,s]:0===c?(s.split("/").forEach((h,g)=>{0==g&&"."===h||(0==g&&""===h?e=!0:".."===h?n++:""!=h&&r.push(h))}),r):[...r,s]},[]);return new OD(e,n,i)}(e);if(s.toRoot())return a_(n.root,new Tr([],{}),n,i,r);const c=function(t,n,e){if(t.isAbsolute)return new l_(n.root,!0,0);if(-1===e.snapshot._lastPathIndex){const s=e.snapshot._urlSegment;return new l_(s,s===n.root,0)}const i=Y7(t.commands[0])?0:1;return function(t,n,e){let i=t,r=n,s=e;for(;s>r;){if(s-=r,i=i.parent,!i)throw new Error("Invalid number of '../'");r=i.segments.length}return new l_(i,!1,r-s)}(e.snapshot._urlSegment,e.snapshot._lastPathIndex+i,t.numberOfDoubleDots)}(s,n,t),h=c.processChildren?K7(c.segmentGroup,c.index,s.commands):ND(c.segmentGroup,c.index,s.commands);return a_(c.segmentGroup,h,n,i,r)}(x,this.currentUrlTree,e,E,null!=S?S:null)}navigateByUrl(e,i={skipLocationChange:!1}){const r=S0(e)?e:this.parseUrl(e),s=this.urlHandlingStrategy.merge(r,this.rawUrlTree);return this.scheduleNavigation(s,"imperative",null,i)}navigate(e,i={skipLocationChange:!1}){return function(t){for(let n=0;n{const s=e[r];return null!=s&&(i[r]=s),i},{})}processNavigations(){this.navigations.subscribe(e=>{this.navigated=!0,this.lastSuccessfulId=e.id,this.currentPageId=e.targetPageId,this.events.next(new a8(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,e.resolve(!0)},e=>{this.console.warn(`Unhandled Navigation Error: ${e}`)})}scheduleNavigation(e,i,r,s,c){var h,g;if(this.disposed)return Promise.resolve(!1);const x=this.getTransition(),S=rg(i)&&x&&!rg(x.source),F=(this.lastSuccessfulId===x.id||this.currentNavigation?x.rawUrl:x.urlAfterRedirects).toString()===e.toString();if(S&&F)return Promise.resolve(!0);let j,ie,W;c?(j=c.resolve,ie=c.reject,W=c.promise):W=new Promise((Ze,xt)=>{j=Ze,ie=xt});const Ee=++this.navigationId;let Se;return"computed"===this.canceledNavigationResolution?(0===this.currentPageId&&(r=this.location.getState()),Se=r&&r.\u0275routerPageId?r.\u0275routerPageId:s.replaceUrl||s.skipLocationChange?null!==(h=this.browserPageId)&&void 0!==h?h:0:(null!==(g=this.browserPageId)&&void 0!==g?g:0)+1):Se=0,this.setTransition({id:Ee,targetPageId:Se,source:i,restoredState:r,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:e,extras:s,resolve:j,reject:ie,promise:W,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),W.catch(Ze=>Promise.reject(Ze))}setBrowserUrl(e,i){const r=this.urlSerializer.serialize(e),s=Object.assign(Object.assign({},i.extras.state),this.generateNgRouterState(i.id,i.targetPageId));this.location.isCurrentPathEqualTo(r)||i.extras.replaceUrl?this.location.replaceState(r,"",s):this.location.go(r,"",s)}restoreHistory(e,i=!1){var r,s;if("computed"===this.canceledNavigationResolution){const c=this.currentPageId-e.targetPageId;"popstate"!==e.source&&"eager"!==this.urlUpdateStrategy&&this.currentUrlTree!==(null===(r=this.currentNavigation)||void 0===r?void 0:r.finalUrl)||0===c?this.currentUrlTree===(null===(s=this.currentNavigation)||void 0===s?void 0:s.finalUrl)&&0===c&&(this.resetState(e),this.browserUrlTree=e.currentUrlTree,this.resetUrlToCurrentUrlTree()):this.location.historyGo(c)}else"replace"===this.canceledNavigationResolution&&(i&&this.resetState(e),this.resetUrlToCurrentUrlTree())}resetState(e){this.routerState=e.currentRouterState,this.currentUrlTree=e.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,e.rawUrl)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}cancelNavigationTransition(e,i){const r=new dD(e.id,this.serializeUrl(e.extractedUrl),i);this.triggerEvent(r),e.resolve(!1)}generateNgRouterState(e,i){return"computed"===this.canceledNavigationResolution?{navigationId:e,\u0275routerPageId:i}:{navigationId:e}}}return t.\u0275fac=function(e){return new(e||t)(Mt(sc),Mt(c8),Mt(qu),Mt(x0),Mt(U),Mt(d7),Mt(g0),Mt(void 0))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();function rg(t){return"imperative"!==t}let v8=(()=>{class t{constructor(e,i,r,s,c){this.router=e,this.route=i,this.commands=[],this.onChanges=new lt,null==r&&s.setAttribute(c.nativeElement,"tabindex","0")}ngOnChanges(e){this.onChanges.next(this)}set routerLink(e){this.commands=null!=e?Array.isArray(e)?e:[e]:[]}onClick(){const e={skipLocationChange:z6(this.skipLocationChange),replaceUrl:z6(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,e),!0}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:z6(this.preserveFragment)})}}return t.\u0275fac=function(e){return new(e||t)(B(rs),B(Mc),ho("tabindex"),B(q2),B(rn))},t.\u0275dir=Tn({type:t,selectors:[["","routerLink","",5,"a",5,"area"]],hostBindings:function(e,i){1&e&&ot("click",function(){return i.onClick()})},inputs:{routerLink:"routerLink",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state",relativeTo:"relativeTo"},features:[kn]}),t})(),m_=(()=>{class t{constructor(e,i,r){this.router=e,this.route=i,this.locationStrategy=r,this.commands=[],this.onChanges=new lt,this.subscription=e.events.subscribe(s=>{s instanceof a8&&this.updateTargetUrlAndHref()})}set routerLink(e){this.commands=null!=e?Array.isArray(e)?e:[e]:[]}ngOnChanges(e){this.updateTargetUrlAndHref(),this.onChanges.next(this)}ngOnDestroy(){this.subscription.unsubscribe()}onClick(e,i,r,s,c){if(0!==e||i||r||s||c||"string"==typeof this.target&&"_self"!=this.target)return!0;const h={skipLocationChange:z6(this.skipLocationChange),replaceUrl:z6(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,h),!1}updateTargetUrlAndHref(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:z6(this.preserveFragment)})}}return t.\u0275fac=function(e){return new(e||t)(B(rs),B(Mc),B(_0))},t.\u0275dir=Tn({type:t,selectors:[["a","routerLink",""],["area","routerLink",""]],hostVars:2,hostBindings:function(e,i){1&e&&ot("click",function(s){return i.onClick(s.button,s.ctrlKey,s.shiftKey,s.altKey,s.metaKey)}),2&e&&(m6("href",i.href,R1),St("target",i.target))},inputs:{routerLink:"routerLink",target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state",relativeTo:"relativeTo"},features:[kn]}),t})();function z6(t){return""===t||!!t}let oA=(()=>{class t{constructor(e,i,r,s,c,h){this.router=e,this.element=i,this.renderer=r,this.cdr=s,this.link=c,this.linkWithHref=h,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.routerEventsSubscription=e.events.subscribe(g=>{g instanceof a8&&this.update()})}ngAfterContentInit(){Ni(this.links.changes,this.linksWithHrefs.changes,Ni(null)).pipe(hs()).subscribe(e=>{this.update(),this.subscribeToEachLinkOnChanges()})}subscribeToEachLinkOnChanges(){var e;null===(e=this.linkInputChangesSubscription)||void 0===e||e.unsubscribe();const i=[...this.links.toArray(),...this.linksWithHrefs.toArray(),this.link,this.linkWithHref].filter(r=>!!r).map(r=>r.onChanges);this.linkInputChangesSubscription=Mn(i).pipe(hs()).subscribe(r=>{this.isActive!==this.isLinkActive(this.router)(r)&&this.update()})}set routerLinkActive(e){const i=Array.isArray(e)?e:e.split(" ");this.classes=i.filter(r=>!!r)}ngOnChanges(e){this.update()}ngOnDestroy(){var e;this.routerEventsSubscription.unsubscribe(),null===(e=this.linkInputChangesSubscription)||void 0===e||e.unsubscribe()}update(){!this.links||!this.linksWithHrefs||!this.router.navigated||Promise.resolve().then(()=>{const e=this.hasActiveLinks();this.isActive!==e&&(this.isActive=e,this.cdr.markForCheck(),this.classes.forEach(i=>{e?this.renderer.addClass(this.element.nativeElement,i):this.renderer.removeClass(this.element.nativeElement,i)}))})}isLinkActive(e){const i=function(t){return!!t.paths}(this.routerLinkActiveOptions)?this.routerLinkActiveOptions:this.routerLinkActiveOptions.exact||!1;return r=>e.isActive(r.urlTree,i)}hasActiveLinks(){const e=this.isLinkActive(this.router);return this.link&&e(this.link)||this.linkWithHref&&e(this.linkWithHref)||this.links.some(e)||this.linksWithHrefs.some(e)}}return t.\u0275fac=function(e){return new(e||t)(B(rs),B(rn),B(q2),B(zn),B(v8,8),B(m_,8))},t.\u0275dir=Tn({type:t,selectors:[["","routerLinkActive",""]],contentQueries:function(e,i,r){if(1&e&&(ur(r,v8,5),ur(r,m_,5)),2&e){let s;ai(s=li())&&(i.links=s),ai(s=li())&&(i.linksWithHrefs=s)}},inputs:{routerLinkActiveOptions:"routerLinkActiveOptions",routerLinkActive:"routerLinkActive"},exportAs:["routerLinkActive"],features:[kn]}),t})(),aA=(()=>{class t{constructor(e,i,r,s,c){this.parentContexts=e,this.location=i,this.resolver=r,this.changeDetector=c,this.activated=null,this._activatedRoute=null,this.activateEvents=new We,this.deactivateEvents=new We,this.name=s||pr,e.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const e=this.parentContexts.getContext(this.name);e&&e.route&&(e.attachRef?this.attach(e.attachRef,e.route):this.activateWith(e.route,e.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const e=this.activated;return this.activated=null,this._activatedRoute=null,e}attach(e,i){this.activated=e,this._activatedRoute=i,this.location.insert(e.hostView)}deactivate(){if(this.activated){const e=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(e)}}activateWith(e,i){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=e;const c=(i=i||this.resolver).resolveComponentFactory(e._futureSnapshot.routeConfig.component),h=this.parentContexts.getOrCreateContext(this.name).children,g=new gne(e,h,this.location.injector);this.activated=this.location.createComponent(c,this.location.length,g),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return t.\u0275fac=function(e){return new(e||t)(B(qu),B(Za),B(W2),ho("name"),B(zn))},t.\u0275dir=Tn({type:t,selectors:[["router-outlet"]],outputs:{activateEvents:"activate",deactivateEvents:"deactivate"},exportAs:["outlet"]}),t})();class gne{constructor(n,e,i){this.route=n,this.childContexts=e,this.parent=i}get(n,e){return n===Mc?this.route:n===qu?this.childContexts:this.parent.get(n,e)}}class lA{}class cA{preload(n,e){return e().pipe(b0(()=>Ni(null)))}}class uA{preload(n,e){return Ni(null)}}let hA=(()=>{class t{constructor(e,i,r,s,c){this.router=e,this.injector=s,this.preloadingStrategy=c,this.loader=new rA(i,r,x=>e.triggerEvent(new fD(x)),x=>e.triggerEvent(new pD(x)))}setUpPreloading(){this.subscription=this.router.events.pipe(Ea(e=>e instanceof a8),k6(()=>this.preload())).subscribe(()=>{})}preload(){const e=this.injector.get(b3);return this.processRoutes(e,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(e,i){const r=[];for(const s of i)if(s.loadChildren&&!s.canLoad&&s._loadedConfig){const c=s._loadedConfig;r.push(this.processRoutes(c.module,c.routes))}else s.loadChildren&&!s.canLoad?r.push(this.preloadConfig(e,s)):s.children&&r.push(this.processRoutes(e,s.children));return Mn(r).pipe(hs(),Qt(s=>{}))}preloadConfig(e,i){return this.preloadingStrategy.preload(i,()=>(i._loadedConfig?Ni(i._loadedConfig):this.loader.load(e.injector,i)).pipe(Li(s=>(i._loadedConfig=s,this.processRoutes(s.module,s.routes)))))}}return t.\u0275fac=function(e){return new(e||t)(Mt(rs),Mt(d7),Mt(g0),Mt(U),Mt(lA))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),g_=(()=>{class t{constructor(e,i,r={}){this.router=e,this.viewportScroller=i,this.options=r,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},r.scrollPositionRestoration=r.scrollPositionRestoration||"disabled",r.anchorScrolling=r.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(e=>{e instanceof U7?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=e.navigationTrigger,this.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof a8&&(this.lastId=e.id,this.scheduleScrollEvent(e,this.router.parseUrl(e.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(e=>{e instanceof mD&&(e.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(e.position):e.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(e.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(e,i){this.router.triggerEvent(new mD(e,"popstate"===this.lastSource?this.store[this.restoredId]:null,i))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(Mt(rs),Mt(GE),Mt(void 0))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();const T0=new Xt("ROUTER_CONFIGURATION"),dA=new Xt("ROUTER_FORROOT_GUARD"),Cne=[x0,{provide:c8,useClass:SD},{provide:rs,useFactory:function(t,n,e,i,r,s,c,h={},g,x){const S=new rs(null,t,n,e,i,r,s,vD(c));return g&&(S.urlHandlingStrategy=g),x&&(S.routeReuseStrategy=x),function(t,n){t.errorHandler&&(n.errorHandler=t.errorHandler),t.malformedUriErrorHandler&&(n.malformedUriErrorHandler=t.malformedUriErrorHandler),t.onSameUrlNavigation&&(n.onSameUrlNavigation=t.onSameUrlNavigation),t.paramsInheritanceStrategy&&(n.paramsInheritanceStrategy=t.paramsInheritanceStrategy),t.relativeLinkResolution&&(n.relativeLinkResolution=t.relativeLinkResolution),t.urlUpdateStrategy&&(n.urlUpdateStrategy=t.urlUpdateStrategy)}(h,S),h.enableTracing&&S.events.subscribe(E=>{var A,F;null===(A=console.group)||void 0===A||A.call(console,`Router Event: ${E.constructor.name}`),console.log(E.toString()),console.log(E),null===(F=console.groupEnd)||void 0===F||F.call(console)}),S},deps:[c8,qu,x0,U,d7,g0,p_,T0,[class{},new ws],[iA,new ws]]},qu,{provide:Mc,useFactory:function(t){return t.routerState.root},deps:[rs]},{provide:d7,useClass:gY},hA,uA,cA,{provide:T0,useValue:{enableTracing:!1}}];function vne(){return new fy("Router",rs)}let fA=(()=>{class t{constructor(e,i){}static forRoot(e,i){return{ngModule:t,providers:[Cne,pA(e),{provide:dA,useFactory:xne,deps:[[rs,new ws,new Lo]]},{provide:T0,useValue:i||{}},{provide:_0,useFactory:_ne,deps:[y0,[new V2(Ay),new ws],T0]},{provide:g_,useFactory:yne,deps:[rs,GE,T0]},{provide:lA,useExisting:i&&i.preloadingStrategy?i.preloadingStrategy:uA},{provide:fy,multi:!0,useFactory:vne},[C_,{provide:m0,multi:!0,useFactory:Sne,deps:[C_]},{provide:mA,useFactory:Tne,deps:[C_]},{provide:NL,multi:!0,useExisting:mA}]]}}static forChild(e){return{ngModule:t,providers:[pA(e)]}}}return t.\u0275fac=function(e){return new(e||t)(Mt(dA,8),Mt(rs,8))},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({}),t})();function yne(t,n,e){return e.scrollOffset&&n.setOffset(e.scrollOffset),new g_(t,n,e)}function _ne(t,n,e={}){return e.useHash?new OK(t,n):new EE(t,n)}function xne(t){return"guarded"}function pA(t){return[{provide:ei,multi:!0,useValue:t},{provide:p_,multi:!0,useValue:t}]}let C_=(()=>{class t{constructor(e){this.injector=e,this.initNavigation=!1,this.destroyed=!1,this.resultOfPreactivationDone=new lt}appInitializer(){return this.injector.get(zK,Promise.resolve(null)).then(()=>{if(this.destroyed)return Promise.resolve(!0);let i=null;const r=new Promise(h=>i=h),s=this.injector.get(rs),c=this.injector.get(T0);return"disabled"===c.initialNavigation?(s.setUpLocationChangeListener(),i(!0)):"enabled"===c.initialNavigation||"enabledBlocking"===c.initialNavigation?(s.hooks.afterPreactivation=()=>this.initNavigation?Ni(null):(this.initNavigation=!0,i(!0),this.resultOfPreactivationDone),s.initialNavigation()):i(!0),r})}bootstrapListener(e){const i=this.injector.get(T0),r=this.injector.get(hA),s=this.injector.get(g_),c=this.injector.get(rs),h=this.injector.get(w4);e===h.components[0]&&(("enabledNonBlocking"===i.initialNavigation||void 0===i.initialNavigation)&&c.initialNavigation(),r.setUpPreloading(),s.init(),c.resetRootComponentType(h.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}ngOnDestroy(){this.destroyed=!0}}return t.\u0275fac=function(e){return new(e||t)(Mt(U))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();function Sne(t){return t.appInitializer.bind(t)}function Tne(t){return t.bootstrapListener.bind(t)}const mA=new Xt("Router Initializer");class gA{}class CA{}class y2{constructor(n){this.normalizedNames=new Map,this.lazyUpdate=null,n?this.lazyInit="string"==typeof n?()=>{this.headers=new Map,n.split("\n").forEach(e=>{const i=e.indexOf(":");if(i>0){const r=e.slice(0,i),s=r.toLowerCase(),c=e.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(c):this.headers.set(s,[c])}})}:()=>{this.headers=new Map,Object.keys(n).forEach(e=>{let i=n[e];const r=e.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(e,r))})}:this.headers=new Map}has(n){return this.init(),this.headers.has(n.toLowerCase())}get(n){this.init();const e=this.headers.get(n.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(n){return this.init(),this.headers.get(n.toLowerCase())||null}append(n,e){return this.clone({name:n,value:e,op:"a"})}set(n,e){return this.clone({name:n,value:e,op:"s"})}delete(n,e){return this.clone({name:n,value:e,op:"d"})}maybeSetNormalizedName(n,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,n)}init(){this.lazyInit&&(this.lazyInit instanceof y2?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(n=>this.applyUpdate(n)),this.lazyUpdate=null))}copyFrom(n){n.init(),Array.from(n.headers.keys()).forEach(e=>{this.headers.set(e,n.headers.get(e)),this.normalizedNames.set(e,n.normalizedNames.get(e))})}clone(n){const e=new y2;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof y2?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([n]),e}applyUpdate(n){const e=n.name.toLowerCase();switch(n.op){case"a":case"s":let i=n.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(n.name,e);const r=("a"===n.op?this.headers.get(e):void 0)||[];r.push(...i),this.headers.set(e,r);break;case"d":const s=n.value;if(s){let c=this.headers.get(e);if(!c)return;c=c.filter(h=>-1===s.indexOf(h)),0===c.length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,c)}else this.headers.delete(e),this.normalizedNames.delete(e)}}forEach(n){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>n(this.normalizedNames.get(e),this.headers.get(e)))}}class Ene{encodeKey(n){return vA(n)}encodeValue(n){return vA(n)}decodeKey(n){return decodeURIComponent(n)}decodeValue(n){return decodeURIComponent(n)}}const Ane=/%(\d[a-f0-9])/gi,kne={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function vA(t){return encodeURIComponent(t).replace(Ane,(n,e)=>{var i;return null!==(i=kne[e])&&void 0!==i?i:n})}function yA(t){return`${t}`}class vs{constructor(n={}){if(this.updates=null,this.cloneFrom=null,this.encoder=n.encoder||new Ene,n.fromString){if(n.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(t,n){const e=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[c,h]=-1==s?[n.decodeKey(r),""]:[n.decodeKey(r.slice(0,s)),n.decodeValue(r.slice(s+1))],g=e.get(c)||[];g.push(h),e.set(c,g)}),e}(n.fromString,this.encoder)}else n.fromObject?(this.map=new Map,Object.keys(n.fromObject).forEach(e=>{const i=n.fromObject[e];this.map.set(e,Array.isArray(i)?i:[i])})):this.map=null}has(n){return this.init(),this.map.has(n)}get(n){this.init();const e=this.map.get(n);return e?e[0]:null}getAll(n){return this.init(),this.map.get(n)||null}keys(){return this.init(),Array.from(this.map.keys())}append(n,e){return this.clone({param:n,value:e,op:"a"})}appendAll(n){const e=[];return Object.keys(n).forEach(i=>{const r=n[i];Array.isArray(r)?r.forEach(s=>{e.push({param:i,value:s,op:"a"})}):e.push({param:i,value:r,op:"a"})}),this.clone(e)}set(n,e){return this.clone({param:n,value:e,op:"s"})}delete(n,e){return this.clone({param:n,value:e,op:"d"})}toString(){return this.init(),this.keys().map(n=>{const e=this.encoder.encodeKey(n);return this.map.get(n).map(i=>e+"="+this.encoder.encodeValue(i)).join("&")}).filter(n=>""!==n).join("&")}clone(n){const e=new vs({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(n),e}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(n=>this.map.set(n,this.cloneFrom.map.get(n))),this.updates.forEach(n=>{switch(n.op){case"a":case"s":const e=("a"===n.op?this.map.get(n.param):void 0)||[];e.push(yA(n.value)),this.map.set(n.param,e);break;case"d":if(void 0===n.value){this.map.delete(n.param);break}{let i=this.map.get(n.param)||[];const r=i.indexOf(yA(n.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(n.param,i):this.map.delete(n.param)}}}),this.cloneFrom=this.updates=null)}}class Ine{constructor(){this.map=new Map}set(n,e){return this.map.set(n,e),this}get(n){return this.map.has(n)||this.map.set(n,n.defaultValue()),this.map.get(n)}delete(n){return this.map.delete(n),this}keys(){return this.map.keys()}}function _A(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function xA(t){return"undefined"!=typeof Blob&&t instanceof Blob}function bA(t){return"undefined"!=typeof FormData&&t instanceof FormData}class y8{constructor(n,e,i,r){let s;if(this.url=e,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=n.toUpperCase(),function(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||r?(this.body=void 0!==i?i:null,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new y2),this.context||(this.context=new Ine),this.params){const c=this.params.toString();if(0===c.length)this.urlWithParams=e;else{const h=e.indexOf("?");this.urlWithParams=e+(-1===h?"?":hA.set(F,n.setHeaders[F]),x)),n.setParams&&(S=Object.keys(n.setParams).reduce((A,F)=>A.set(F,n.setParams[F]),S)),new y8(i,r,c,{params:S,headers:x,context:E,reportProgress:g,responseType:s,withCredentials:h})}}var Xo=(()=>((Xo=Xo||{})[Xo.Sent=0]="Sent",Xo[Xo.UploadProgress=1]="UploadProgress",Xo[Xo.ResponseHeader=2]="ResponseHeader",Xo[Xo.DownloadProgress=3]="DownloadProgress",Xo[Xo.Response=4]="Response",Xo[Xo.User=5]="User",Xo))();class v_{constructor(n,e=200,i="OK"){this.headers=n.headers||new y2,this.status=void 0!==n.status?n.status:e,this.statusText=n.statusText||i,this.url=n.url||null,this.ok=this.status>=200&&this.status<300}}class y_ extends v_{constructor(n={}){super(n),this.type=Xo.ResponseHeader}clone(n={}){return new y_({headers:n.headers||this.headers,status:void 0!==n.status?n.status:this.status,statusText:n.statusText||this.statusText,url:n.url||this.url||void 0})}}class sg extends v_{constructor(n={}){super(n),this.type=Xo.Response,this.body=void 0!==n.body?n.body:null}clone(n={}){return new sg({body:void 0!==n.body?n.body:this.body,headers:n.headers||this.headers,status:void 0!==n.status?n.status:this.status,statusText:n.statusText||this.statusText,url:n.url||this.url||void 0})}}class wA extends v_{constructor(n){super(n,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${n.url||"(unknown url)"}`:`Http failure response for ${n.url||"(unknown url)"}: ${n.status} ${n.statusText}`,this.error=n.error||null}}function __(t,n){return{body:n,headers:t.headers,context:t.context,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials}}let _2=(()=>{class t{constructor(e){this.handler=e}request(e,i,r={}){let s;if(e instanceof y8)s=e;else{let g,x;g=r.headers instanceof y2?r.headers:new y2(r.headers),r.params&&(x=r.params instanceof vs?r.params:new vs({fromObject:r.params})),s=new y8(e,i,void 0!==r.body?r.body:null,{headers:g,context:r.context,params:x,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const c=Ni(s).pipe(k6(g=>this.handler.handle(g)));if(e instanceof y8||"events"===r.observe)return c;const h=c.pipe(Ea(g=>g instanceof sg));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return h.pipe(Qt(g=>{if(null!==g.body&&!(g.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return g.body}));case"blob":return h.pipe(Qt(g=>{if(null!==g.body&&!(g.body instanceof Blob))throw new Error("Response is not a Blob.");return g.body}));case"text":return h.pipe(Qt(g=>{if(null!==g.body&&"string"!=typeof g.body)throw new Error("Response is not a string.");return g.body}));case"json":default:return h.pipe(Qt(g=>g.body))}case"response":return h;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(e,i={}){return this.request("DELETE",e,i)}get(e,i={}){return this.request("GET",e,i)}head(e,i={}){return this.request("HEAD",e,i)}jsonp(e,i){return this.request("JSONP",e,{params:(new vs).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,i={}){return this.request("OPTIONS",e,i)}patch(e,i,r={}){return this.request("PATCH",e,__(r,i))}post(e,i,r={}){return this.request("POST",e,__(r,i))}put(e,i,r={}){return this.request("PUT",e,__(r,i))}}return t.\u0275fac=function(e){return new(e||t)(Mt(gA))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();class MA{constructor(n,e){this.next=n,this.interceptor=e}handle(n){return this.interceptor.intercept(n,this.next)}}const SA=new Xt("HTTP_INTERCEPTORS");let Vne=(()=>{class t{intercept(e,i){return i.handle(e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();const Fne=/^\)\]\}',?\n/;let TA=(()=>{class t{constructor(e){this.xhrFactory=e}handle(e){if("JSONP"===e.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new q(i=>{const r=this.xhrFactory.build();if(r.open(e.method,e.urlWithParams),e.withCredentials&&(r.withCredentials=!0),e.headers.forEach((F,j)=>r.setRequestHeader(F,j.join(","))),e.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!e.headers.has("Content-Type")){const F=e.detectContentTypeHeader();null!==F&&r.setRequestHeader("Content-Type",F)}if(e.responseType){const F=e.responseType.toLowerCase();r.responseType="json"!==F?F:"text"}const s=e.serializeBody();let c=null;const h=()=>{if(null!==c)return c;const F=1223===r.status?204:r.status,j=r.statusText||"OK",ie=new y2(r.getAllResponseHeaders()),W=function(t){return"responseURL"in t&&t.responseURL?t.responseURL:/^X-Request-URL:/m.test(t.getAllResponseHeaders())?t.getResponseHeader("X-Request-URL"):null}(r)||e.url;return c=new y_({headers:ie,status:F,statusText:j,url:W}),c},g=()=>{let{headers:F,status:j,statusText:ie,url:W}=h(),Ee=null;204!==j&&(Ee=void 0===r.response?r.responseText:r.response),0===j&&(j=Ee?200:0);let Se=j>=200&&j<300;if("json"===e.responseType&&"string"==typeof Ee){const Ze=Ee;Ee=Ee.replace(Fne,"");try{Ee=""!==Ee?JSON.parse(Ee):null}catch(xt){Ee=Ze,Se&&(Se=!1,Ee={error:xt,text:Ee})}}Se?(i.next(new sg({body:Ee,headers:F,status:j,statusText:ie,url:W||void 0})),i.complete()):i.error(new wA({error:Ee,headers:F,status:j,statusText:ie,url:W||void 0}))},x=F=>{const{url:j}=h(),ie=new wA({error:F,status:r.status||0,statusText:r.statusText||"Unknown Error",url:j||void 0});i.error(ie)};let S=!1;const E=F=>{S||(i.next(h()),S=!0);let j={type:Xo.DownloadProgress,loaded:F.loaded};F.lengthComputable&&(j.total=F.total),"text"===e.responseType&&!!r.responseText&&(j.partialText=r.responseText),i.next(j)},A=F=>{let j={type:Xo.UploadProgress,loaded:F.loaded};F.lengthComputable&&(j.total=F.total),i.next(j)};return r.addEventListener("load",g),r.addEventListener("error",x),r.addEventListener("timeout",x),r.addEventListener("abort",x),e.reportProgress&&(r.addEventListener("progress",E),null!==s&&r.upload&&r.upload.addEventListener("progress",A)),r.send(s),i.next({type:Xo.Sent}),()=>{r.removeEventListener("error",x),r.removeEventListener("abort",x),r.removeEventListener("load",g),r.removeEventListener("timeout",x),e.reportProgress&&(r.removeEventListener("progress",E),null!==s&&r.upload&&r.upload.removeEventListener("progress",A)),r.readyState!==r.DONE&&r.abort()}})}}return t.\u0275fac=function(e){return new(e||t)(Mt(qE))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();const x_=new Xt("XSRF_COOKIE_NAME"),b_=new Xt("XSRF_HEADER_NAME");class LA{}let Nne=(()=>{class t{constructor(e,i,r){this.doc=e,this.platform=i,this.cookieName=r,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=NE(e,this.cookieName),this.lastCookieString=e),this.lastToken}}return t.\u0275fac=function(e){return new(e||t)(Mt(Cs),Mt(M1),Mt(x_))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),w_=(()=>{class t{constructor(e,i){this.tokenService=e,this.headerName=i}intercept(e,i){const r=e.url.toLowerCase();if("GET"===e.method||"HEAD"===e.method||r.startsWith("http://")||r.startsWith("https://"))return i.handle(e);const s=this.tokenService.getToken();return null!==s&&!e.headers.has(this.headerName)&&(e=e.clone({headers:e.headers.set(this.headerName,s)})),i.handle(e)}}return t.\u0275fac=function(e){return new(e||t)(Mt(LA),Mt(b_))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),Rne=(()=>{class t{constructor(e,i){this.backend=e,this.injector=i,this.chain=null}handle(e){if(null===this.chain){const i=this.injector.get(SA,[]);this.chain=i.reduceRight((r,s)=>new MA(r,s),this.backend)}return this.chain.handle(e)}}return t.\u0275fac=function(e){return new(e||t)(Mt(CA),Mt(U))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),Hne=(()=>{class t{static disable(){return{ngModule:t,providers:[{provide:w_,useClass:Vne}]}}static withOptions(e={}){return{ngModule:t,providers:[e.cookieName?{provide:x_,useValue:e.cookieName}:[],e.headerName?{provide:b_,useValue:e.headerName}:[]]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({providers:[w_,{provide:SA,useExisting:w_,multi:!0},{provide:LA,useClass:Nne},{provide:x_,useValue:"XSRF-TOKEN"},{provide:b_,useValue:"X-XSRF-TOKEN"}]}),t})(),Bne=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({providers:[_2,{provide:gA,useClass:Rne},TA,{provide:CA,useExisting:TA}],imports:[[Hne.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),t})();class EA{}const I4="*";function T1(t,n){return{type:7,name:t,definitions:n,options:{}}}function Ka(t,n=null){return{type:4,styles:n,timings:t}}function DA(t,n=null){return{type:2,steps:t,options:n}}function Lr(t){return{type:6,styles:t,offset:null}}function Qa(t,n,e=null){return{type:1,expr:t,animation:n,options:e}}function AA(t){Promise.resolve(null).then(t)}class P6{constructor(n=0,e=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=n+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}onStart(n){this._onStartFns.push(n)}onDone(n){this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){AA(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(n=>n()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(n){this._position=this.totalTime?n*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(n){const e="start"==n?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}}class kA{constructor(n){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=n;let e=0,i=0,r=0;const s=this.players.length;0==s?AA(()=>this._onFinish()):this.players.forEach(c=>{c.onDone(()=>{++e==s&&this._onFinish()}),c.onDestroy(()=>{++i==s&&this._onDestroy()}),c.onStart(()=>{++r==s&&this._onStart()})}),this.totalTime=this.players.reduce((c,h)=>Math.max(c,h.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}init(){this.players.forEach(n=>n.init())}onStart(n){this._onStartFns.push(n)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(n=>n()),this._onStartFns=[])}onDone(n){this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(n=>n.play())}pause(){this.players.forEach(n=>n.pause())}restart(){this.players.forEach(n=>n.restart())}finish(){this._onFinish(),this.players.forEach(n=>n.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(n=>n.destroy()),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}reset(){this.players.forEach(n=>n.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(n){const e=n*this.totalTime;this.players.forEach(i=>{const r=i.totalTime?Math.min(1,e/i.totalTime):1;i.setPosition(r)})}getPosition(){const n=this.players.reduce((e,i)=>null===e||i.totalTime>e.totalTime?i:e,null);return null!=n?n.getPosition():0}beforeDestroy(){this.players.forEach(n=>{n.beforeDestroy&&n.beforeDestroy()})}triggerCallback(n){const e="start"==n?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}}function IA(){return"undefined"!=typeof window&&void 0!==window.document}function S_(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Xu(t){switch(t.length){case 0:return new P6;case 1:return t[0];default:return new kA(t)}}function zA(t,n,e,i,r={},s={}){const c=[],h=[];let g=-1,x=null;if(i.forEach(S=>{const E=S.offset,A=E==g,F=A&&x||{};Object.keys(S).forEach(j=>{let ie=j,W=S[j];if("offset"!==j)switch(ie=n.normalizePropertyName(ie,c),W){case"!":W=r[j];break;case I4:W=s[j];break;default:W=n.normalizeStyleValue(j,ie,W,c)}F[ie]=W}),A||h.push(F),x=F,g=E}),c.length){const S="\n - ";throw new Error(`Unable to animate due to the following errors:${S}${c.join(S)}`)}return h}function T_(t,n,e,i){switch(n){case"start":t.onStart(()=>i(e&&L_(e,"start",t)));break;case"done":t.onDone(()=>i(e&&L_(e,"done",t)));break;case"destroy":t.onDestroy(()=>i(e&&L_(e,"destroy",t)))}}function L_(t,n,e){const i=e.totalTime,s=E_(t.element,t.triggerName,t.fromState,t.toState,n||t.phaseName,null==i?t.totalTime:i,!!e.disabled),c=t._data;return null!=c&&(s._data=c),s}function E_(t,n,e,i,r="",s=0,c){return{element:t,triggerName:n,fromState:e,toState:i,phaseName:r,totalTime:s,disabled:!!c}}function Z2(t,n,e){let i;return t instanceof Map?(i=t.get(n),i||t.set(n,i=e)):(i=t[n],i||(i=t[n]=e)),i}function PA(t){const n=t.indexOf(":");return[t.substring(1,n),t.substr(n+1)]}let D_=(t,n)=>!1,A_=(t,n)=>!1,VA=(t,n,e)=>[];const FA=S_();(FA||"undefined"!=typeof Element)&&(D_=IA()?(t,n)=>{for(;n&&n!==document.documentElement;){if(n===t)return!0;n=n.parentNode||n.host}return!1}:(t,n)=>t.contains(n),A_=(()=>{if(FA||Element.prototype.matches)return(t,n)=>t.matches(n);{const t=Element.prototype,n=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;return n?(e,i)=>n.apply(e,[i]):A_}})(),VA=(t,n,e)=>{let i=[];if(e){const r=t.querySelectorAll(n);for(let s=0;s{const i=e.replace(/([a-z])([A-Z])/g,"$1-$2");n[i]=t[e]}),n}let RA=(()=>{class t{validateStyleProperty(e){return k_(e)}matchesElement(e,i){return I_(e,i)}containsElement(e,i){return z_(e,i)}query(e,i,r){return P_(e,i,r)}computeStyle(e,i,r){return r||""}animate(e,i,r,s,c,h=[],g){return new P6(r,s)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),V_=(()=>{class t{}return t.NOOP=new RA,t})();const F_="ng-enter",og="ng-leave",ag="ng-trigger",lg=".ng-trigger",BA="ng-animating",O_=".ng-animating";function E0(t){if("number"==typeof t)return t;const n=t.match(/^(-?[\.\d]+)(m?s)/);return!n||n.length<2?0:N_(parseFloat(n[1]),n[2])}function N_(t,n){switch(n){case"s":return 1e3*t;default:return t}}function cg(t,n,e){return t.hasOwnProperty("duration")?t:function(t,n,e){let r,s=0,c="";if("string"==typeof t){const h=t.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===h)return n.push(`The provided timing value "${t}" is invalid.`),{duration:0,delay:0,easing:""};r=N_(parseFloat(h[1]),h[2]);const g=h[3];null!=g&&(s=N_(parseFloat(g),h[4]));const x=h[5];x&&(c=x)}else r=t;if(!e){let h=!1,g=n.length;r<0&&(n.push("Duration values below 0 are not allowed for this animation step."),h=!0),s<0&&(n.push("Delay values below 0 are not allowed for this animation step."),h=!0),h&&n.splice(g,0,`The provided timing value "${t}" is invalid.`)}return{duration:r,delay:s,easing:c}}(t,n,e)}function V6(t,n={}){return Object.keys(t).forEach(e=>{n[e]=t[e]}),n}function Zu(t,n,e={}){if(n)for(let i in t)e[i]=t[i];else V6(t,e);return e}function $A(t,n,e){return e?n+":"+e+";":""}function jA(t){let n="";for(let e=0;e{const r=H_(i);e&&!e.hasOwnProperty(i)&&(e[i]=t.style[r]),t.style[r]=n[i]}),S_()&&jA(t))}function D0(t,n){t.style&&(Object.keys(n).forEach(e=>{const i=H_(e);t.style[i]=""}),S_()&&jA(t))}function _8(t){return Array.isArray(t)?1==t.length?t[0]:DA(t):t}const R_=new RegExp("{{\\s*(.+?)\\s*}}","g");function GA(t){let n=[];if("string"==typeof t){let e;for(;e=R_.exec(t);)n.push(e[1]);R_.lastIndex=0}return n}function ug(t,n,e){const i=t.toString(),r=i.replace(R_,(s,c)=>{let h=n[c];return n.hasOwnProperty(c)||(e.push(`Please provide a value for the animation param ${c}`),h=""),h.toString()});return r==i?t:r}function hg(t){const n=[];let e=t.next();for(;!e.done;)n.push(e.value),e=t.next();return n}const Zne=/-+([a-z0-9])/g;function H_(t){return t.replace(Zne,(...n)=>n[1].toUpperCase())}function Yne(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function WA(t,n){return 0===t||0===n}function qA(t,n,e){const i=Object.keys(e);if(i.length&&n.length){let s=n[0],c=[];if(i.forEach(h=>{s.hasOwnProperty(h)||c.push(h),s[h]=e[h]}),c.length)for(var r=1;rfunction(t,n,e){if(":"==t[0]){const g=function(t,n){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,i)=>parseFloat(i)>parseFloat(e);case":decrement":return(e,i)=>parseFloat(i) *"}}(t,e);if("function"==typeof g)return void n.push(g);t=g}const i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return e.push(`The provided transition expression "${t}" is not supported`),n;const r=i[1],s=i[2],c=i[3];n.push(XA(r,c));"<"==s[0]&&!("*"==r&&"*"==c)&&n.push(XA(c,r))}(i,e,n)):e.push(t),e}const fg=new Set(["true","1"]),pg=new Set(["false","0"]);function XA(t,n){const e=fg.has(t)||pg.has(t),i=fg.has(n)||pg.has(n);return(r,s)=>{let c="*"==t||t==r,h="*"==n||n==s;return!c&&e&&"boolean"==typeof r&&(c=r?fg.has(t):pg.has(t)),!h&&i&&"boolean"==typeof s&&(h=s?fg.has(n):pg.has(n)),c&&h}}const eie=new RegExp("s*:selfs*,?","g");function U_(t,n,e){return new tie(t).build(n,e)}class tie{constructor(n){this._driver=n}build(n,e){const i=new rie(e);return this._resetContextStyleTimingState(i),Y2(this,_8(n),i)}_resetContextStyleTimingState(n){n.currentQuerySelector="",n.collectedStyles={},n.collectedStyles[""]={},n.currentTime=0}visitTrigger(n,e){let i=e.queryCount=0,r=e.depCount=0;const s=[],c=[];return"@"==n.name.charAt(0)&&e.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),n.definitions.forEach(h=>{if(this._resetContextStyleTimingState(e),0==h.type){const g=h,x=g.name;x.toString().split(/\s*,\s*/).forEach(S=>{g.name=S,s.push(this.visitState(g,e))}),g.name=x}else if(1==h.type){const g=this.visitTransition(h,e);i+=g.queryCount,r+=g.depCount,c.push(g)}else e.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:n.name,states:s,transitions:c,queryCount:i,depCount:r,options:null}}visitState(n,e){const i=this.visitStyle(n.styles,e),r=n.options&&n.options.params||null;if(i.containsDynamicStyles){const s=new Set,c=r||{};if(i.styles.forEach(h=>{if(mg(h)){const g=h;Object.keys(g).forEach(x=>{GA(g[x]).forEach(S=>{c.hasOwnProperty(S)||s.add(S)})})}}),s.size){const h=hg(s.values());e.errors.push(`state("${n.name}", ...) must define default values for all the following style substitutions: ${h.join(", ")}`)}}return{type:0,name:n.name,style:i,options:r?{params:r}:null}}visitTransition(n,e){e.queryCount=0,e.depCount=0;const i=Y2(this,_8(n.animation),e);return{type:1,matchers:Kne(n.expr,e.errors),animation:i,queryCount:e.queryCount,depCount:e.depCount,options:A0(n.options)}}visitSequence(n,e){return{type:2,steps:n.steps.map(i=>Y2(this,i,e)),options:A0(n.options)}}visitGroup(n,e){const i=e.currentTime;let r=0;const s=n.steps.map(c=>{e.currentTime=i;const h=Y2(this,c,e);return r=Math.max(r,e.currentTime),h});return e.currentTime=r,{type:3,steps:s,options:A0(n.options)}}visitAnimate(n,e){const i=function(t,n){let e=null;if(t.hasOwnProperty("duration"))e=t;else if("number"==typeof t)return $_(cg(t,n).duration,0,"");const i=t;if(i.split(/\s+/).some(s=>"{"==s.charAt(0)&&"{"==s.charAt(1))){const s=$_(0,0,"");return s.dynamic=!0,s.strValue=i,s}return e=e||cg(i,n),$_(e.duration,e.delay,e.easing)}(n.timings,e.errors);e.currentAnimateTimings=i;let r,s=n.styles?n.styles:Lr({});if(5==s.type)r=this.visitKeyframes(s,e);else{let c=n.styles,h=!1;if(!c){h=!0;const x={};i.easing&&(x.easing=i.easing),c=Lr(x)}e.currentTime+=i.duration+i.delay;const g=this.visitStyle(c,e);g.isEmptyStep=h,r=g}return e.currentAnimateTimings=null,{type:4,timings:i,style:r,options:null}}visitStyle(n,e){const i=this._makeStyleAst(n,e);return this._validateStyleAst(i,e),i}_makeStyleAst(n,e){const i=[];Array.isArray(n.styles)?n.styles.forEach(c=>{"string"==typeof c?c==I4?i.push(c):e.errors.push(`The provided style string value ${c} is not allowed.`):i.push(c)}):i.push(n.styles);let r=!1,s=null;return i.forEach(c=>{if(mg(c)){const h=c,g=h.easing;if(g&&(s=g,delete h.easing),!r)for(let x in h)if(h[x].toString().indexOf("{{")>=0){r=!0;break}}}),{type:6,styles:i,easing:s,offset:n.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(n,e){const i=e.currentAnimateTimings;let r=e.currentTime,s=e.currentTime;i&&s>0&&(s-=i.duration+i.delay),n.styles.forEach(c=>{"string"!=typeof c&&Object.keys(c).forEach(h=>{if(!this._driver.validateStyleProperty(h))return void e.errors.push(`The provided animation property "${h}" is not a supported CSS property for animations`);const g=e.collectedStyles[e.currentQuerySelector],x=g[h];let S=!0;x&&(s!=r&&s>=x.startTime&&r<=x.endTime&&(e.errors.push(`The CSS property "${h}" that exists between the times of "${x.startTime}ms" and "${x.endTime}ms" is also being animated in a parallel animation between the times of "${s}ms" and "${r}ms"`),S=!1),s=x.startTime),S&&(g[h]={startTime:s,endTime:r}),e.options&&function(t,n,e){const i=n.params||{},r=GA(t);r.length&&r.forEach(s=>{i.hasOwnProperty(s)||e.push(`Unable to resolve the local animation param ${s} in the given list of values`)})}(c[h],e.options,e.errors)})})}visitKeyframes(n,e){const i={type:5,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push("keyframes() must be placed inside of a call to animate()"),i;let s=0;const c=[];let h=!1,g=!1,x=0;const S=n.steps.map(Ee=>{const Se=this._makeStyleAst(Ee,e);let Ze=null!=Se.offset?Se.offset:function(t){if("string"==typeof t)return null;let n=null;if(Array.isArray(t))t.forEach(e=>{if(mg(e)&&e.hasOwnProperty("offset")){const i=e;n=parseFloat(i.offset),delete i.offset}});else if(mg(t)&&t.hasOwnProperty("offset")){const e=t;n=parseFloat(e.offset),delete e.offset}return n}(Se.styles),xt=0;return null!=Ze&&(s++,xt=Se.offset=Ze),g=g||xt<0||xt>1,h=h||xt0&&s{const Ze=A>0?Se==F?1:A*Se:c[Se],xt=Ze*W;e.currentTime=j+ie.delay+xt,ie.duration=xt,this._validateStyleAst(Ee,e),Ee.offset=Ze,i.styles.push(Ee)}),i}visitReference(n,e){return{type:8,animation:Y2(this,_8(n.animation),e),options:A0(n.options)}}visitAnimateChild(n,e){return e.depCount++,{type:9,options:A0(n.options)}}visitAnimateRef(n,e){return{type:10,animation:this.visitReference(n.animation,e),options:A0(n.options)}}visitQuery(n,e){const i=e.currentQuerySelector,r=n.options||{};e.queryCount++,e.currentQuery=n;const[s,c]=function(t){const n=!!t.split(/\s*,\s*/).find(e=>":self"==e);return n&&(t=t.replace(eie,"")),[t=t.replace(/@\*/g,lg).replace(/@\w+/g,e=>lg+"-"+e.substr(1)).replace(/:animating/g,O_),n]}(n.selector);e.currentQuerySelector=i.length?i+" "+s:s,Z2(e.collectedStyles,e.currentQuerySelector,{});const h=Y2(this,_8(n.animation),e);return e.currentQuery=null,e.currentQuerySelector=i,{type:11,selector:s,limit:r.limit||0,optional:!!r.optional,includeSelf:c,animation:h,originalSelector:n.selector,options:A0(n.options)}}visitStagger(n,e){e.currentQuery||e.errors.push("stagger() can only be used inside of query()");const i="full"===n.timings?{duration:0,delay:0,easing:"full"}:cg(n.timings,e.errors,!0);return{type:12,animation:Y2(this,_8(n.animation),e),timings:i,options:null}}}class rie{constructor(n){this.errors=n,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function mg(t){return!Array.isArray(t)&&"object"==typeof t}function A0(t){return t?(t=V6(t)).params&&(t.params=function(t){return t?V6(t):null}(t.params)):t={},t}function $_(t,n,e){return{duration:t,delay:n,easing:e}}function j_(t,n,e,i,r,s,c=null,h=!1){return{type:1,element:t,keyframes:n,preStyleProps:e,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:c,subTimeline:h}}class gg{constructor(){this._map=new Map}consume(n){let e=this._map.get(n);return e?this._map.delete(n):e=[],e}append(n,e){let i=this._map.get(n);i||this._map.set(n,i=[]),i.push(...e)}has(n){return this._map.has(n)}clear(){this._map.clear()}}const cie=new RegExp(":enter","g"),hie=new RegExp(":leave","g");function G_(t,n,e,i,r,s={},c={},h,g,x=[]){return(new die).buildKeyframes(t,n,e,i,r,s,c,h,g,x)}class die{buildKeyframes(n,e,i,r,s,c,h,g,x,S=[]){x=x||new gg;const E=new W_(n,e,x,r,s,S,[]);E.options=g,E.currentTimeline.setStyles([c],null,E.errors,g),Y2(this,i,E);const A=E.timelines.filter(F=>F.containsAnimation());if(A.length&&Object.keys(h).length){const F=A[A.length-1];F.allowOnlyTimelineStyles()||F.setStyles([h],null,E.errors,g)}return A.length?A.map(F=>F.buildKeyframes()):[j_(e,[],[],[],0,0,"",!1)]}visitTrigger(n,e){}visitState(n,e){}visitTransition(n,e){}visitAnimateChild(n,e){const i=e.subInstructions.consume(e.element);if(i){const r=e.createSubContext(n.options),s=e.currentTimeline.currentTime,c=this._visitSubInstructions(i,r,r.options);s!=c&&e.transformIntoNewTimeline(c)}e.previousNode=n}visitAnimateRef(n,e){const i=e.createSubContext(n.options);i.transformIntoNewTimeline(),this.visitReference(n.animation,i),e.transformIntoNewTimeline(i.currentTimeline.currentTime),e.previousNode=n}_visitSubInstructions(n,e,i){let s=e.currentTimeline.currentTime;const c=null!=i.duration?E0(i.duration):null,h=null!=i.delay?E0(i.delay):null;return 0!==c&&n.forEach(g=>{const x=e.appendInstructionToTimeline(g,c,h);s=Math.max(s,x.duration+x.delay)}),s}visitReference(n,e){e.updateOptions(n.options,!0),Y2(this,n.animation,e),e.previousNode=n}visitSequence(n,e){const i=e.subContextCount;let r=e;const s=n.options;if(s&&(s.params||s.delay)&&(r=e.createSubContext(s),r.transformIntoNewTimeline(),null!=s.delay)){6==r.previousNode.type&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=Cg);const c=E0(s.delay);r.delayNextStep(c)}n.steps.length&&(n.steps.forEach(c=>Y2(this,c,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>i&&r.transformIntoNewTimeline()),e.previousNode=n}visitGroup(n,e){const i=[];let r=e.currentTimeline.currentTime;const s=n.options&&n.options.delay?E0(n.options.delay):0;n.steps.forEach(c=>{const h=e.createSubContext(n.options);s&&h.delayNextStep(s),Y2(this,c,h),r=Math.max(r,h.currentTimeline.currentTime),i.push(h.currentTimeline)}),i.forEach(c=>e.currentTimeline.mergeTimelineCollectedStyles(c)),e.transformIntoNewTimeline(r),e.previousNode=n}_visitTiming(n,e){if(n.dynamic){const i=n.strValue;return cg(e.params?ug(i,e.params,e.errors):i,e.errors)}return{duration:n.duration,delay:n.delay,easing:n.easing}}visitAnimate(n,e){const i=e.currentAnimateTimings=this._visitTiming(n.timings,e),r=e.currentTimeline;i.delay&&(e.incrementTime(i.delay),r.snapshotCurrentStyles());const s=n.style;5==s.type?this.visitKeyframes(s,e):(e.incrementTime(i.duration),this.visitStyle(s,e),r.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=n}visitStyle(n,e){const i=e.currentTimeline,r=e.currentAnimateTimings;!r&&i.getCurrentStyleProperties().length&&i.forwardFrame();const s=r&&r.easing||n.easing;n.isEmptyStep?i.applyEmptyStep(s):i.setStyles(n.styles,s,e.errors,e.options),e.previousNode=n}visitKeyframes(n,e){const i=e.currentAnimateTimings,r=e.currentTimeline.duration,s=i.duration,h=e.createSubContext().currentTimeline;h.easing=i.easing,n.styles.forEach(g=>{h.forwardTime((g.offset||0)*s),h.setStyles(g.styles,g.easing,e.errors,e.options),h.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(h),e.transformIntoNewTimeline(r+s),e.previousNode=n}visitQuery(n,e){const i=e.currentTimeline.currentTime,r=n.options||{},s=r.delay?E0(r.delay):0;s&&(6===e.previousNode.type||0==i&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Cg);let c=i;const h=e.invokeQuery(n.selector,n.originalSelector,n.limit,n.includeSelf,!!r.optional,e.errors);e.currentQueryTotal=h.length;let g=null;h.forEach((x,S)=>{e.currentQueryIndex=S;const E=e.createSubContext(n.options,x);s&&E.delayNextStep(s),x===e.element&&(g=E.currentTimeline),Y2(this,n.animation,E),E.currentTimeline.applyStylesToKeyframe(),c=Math.max(c,E.currentTimeline.currentTime)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(c),g&&(e.currentTimeline.mergeTimelineCollectedStyles(g),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=n}visitStagger(n,e){const i=e.parentContext,r=e.currentTimeline,s=n.timings,c=Math.abs(s.duration),h=c*(e.currentQueryTotal-1);let g=c*e.currentQueryIndex;switch(s.duration<0?"reverse":s.easing){case"reverse":g=h-g;break;case"full":g=i.currentStaggerTime}const S=e.currentTimeline;g&&S.delayNextStep(g);const E=S.currentTime;Y2(this,n.animation,e),e.previousNode=n,i.currentStaggerTime=r.currentTime-E+(r.startTime-i.currentTimeline.startTime)}}const Cg={};class W_{constructor(n,e,i,r,s,c,h,g){this._driver=n,this.element=e,this.subInstructions=i,this._enterClassName=r,this._leaveClassName=s,this.errors=c,this.timelines=h,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=Cg,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=g||new vg(this._driver,e,0),h.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(n,e){if(!n)return;const i=n;let r=this.options;null!=i.duration&&(r.duration=E0(i.duration)),null!=i.delay&&(r.delay=E0(i.delay));const s=i.params;if(s){let c=r.params;c||(c=this.options.params={}),Object.keys(s).forEach(h=>{(!e||!c.hasOwnProperty(h))&&(c[h]=ug(s[h],c,this.errors))})}}_copyOptions(){const n={};if(this.options){const e=this.options.params;if(e){const i=n.params={};Object.keys(e).forEach(r=>{i[r]=e[r]})}}return n}createSubContext(n=null,e,i){const r=e||this.element,s=new W_(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,i||0));return s.previousNode=this.previousNode,s.currentAnimateTimings=this.currentAnimateTimings,s.options=this._copyOptions(),s.updateOptions(n),s.currentQueryIndex=this.currentQueryIndex,s.currentQueryTotal=this.currentQueryTotal,s.parentContext=this,this.subContextCount++,s}transformIntoNewTimeline(n){return this.previousNode=Cg,this.currentTimeline=this.currentTimeline.fork(this.element,n),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(n,e,i){const r={duration:null!=e?e:n.duration,delay:this.currentTimeline.currentTime+(null!=i?i:0)+n.delay,easing:""},s=new fie(this._driver,n.element,n.keyframes,n.preStyleProps,n.postStyleProps,r,n.stretchStartingKeyframe);return this.timelines.push(s),r}incrementTime(n){this.currentTimeline.forwardTime(this.currentTimeline.duration+n)}delayNextStep(n){n>0&&this.currentTimeline.delayNextStep(n)}invokeQuery(n,e,i,r,s,c){let h=[];if(r&&h.push(this.element),n.length>0){n=(n=n.replace(cie,"."+this._enterClassName)).replace(hie,"."+this._leaveClassName);let x=this._driver.query(this.element,n,1!=i);0!==i&&(x=i<0?x.slice(x.length+i,x.length):x.slice(0,i)),h.push(...x)}return!s&&0==h.length&&c.push(`\`query("${e}")\` returned zero elements. (Use \`query("${e}", { optional: true })\` if you wish to allow this.)`),h}}class vg{constructor(n,e,i,r){this._driver=n,this.element=e,this.startTime=i,this._elementTimelineStylesLookup=r,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(n){const e=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||e?(this.forwardTime(this.currentTime+n),e&&this.snapshotCurrentStyles()):this.startTime+=n}fork(n,e){return this.applyStylesToKeyframe(),new vg(this._driver,n,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(n){this.applyStylesToKeyframe(),this.duration=n,this._loadKeyframe()}_updateStyle(n,e){this._localTimelineStyles[n]=e,this._globalTimelineStyles[n]=e,this._styleSummary[n]={time:this.currentTime,value:e}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(n){n&&(this._previousKeyframe.easing=n),Object.keys(this._globalTimelineStyles).forEach(e=>{this._backFill[e]=this._globalTimelineStyles[e]||I4,this._currentKeyframe[e]=I4}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(n,e,i,r){e&&(this._previousKeyframe.easing=e);const s=r&&r.params||{},c=function(t,n){const e={};let i;return t.forEach(r=>{"*"===r?(i=i||Object.keys(n),i.forEach(s=>{e[s]=I4})):Zu(r,!1,e)}),e}(n,this._globalTimelineStyles);Object.keys(c).forEach(h=>{const g=ug(c[h],s,i);this._pendingStyles[h]=g,this._localTimelineStyles.hasOwnProperty(h)||(this._backFill[h]=this._globalTimelineStyles.hasOwnProperty(h)?this._globalTimelineStyles[h]:I4),this._updateStyle(h,g)})}applyStylesToKeyframe(){const n=this._pendingStyles,e=Object.keys(n);0!=e.length&&(this._pendingStyles={},e.forEach(i=>{this._currentKeyframe[i]=n[i]}),Object.keys(this._localTimelineStyles).forEach(i=>{this._currentKeyframe.hasOwnProperty(i)||(this._currentKeyframe[i]=this._localTimelineStyles[i])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(n=>{const e=this._localTimelineStyles[n];this._pendingStyles[n]=e,this._updateStyle(n,e)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const n=[];for(let e in this._currentKeyframe)n.push(e);return n}mergeTimelineCollectedStyles(n){Object.keys(n._styleSummary).forEach(e=>{const i=this._styleSummary[e],r=n._styleSummary[e];(!i||r.time>i.time)&&this._updateStyle(e,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();const n=new Set,e=new Set,i=1===this._keyframes.size&&0===this.duration;let r=[];this._keyframes.forEach((h,g)=>{const x=Zu(h,!0);Object.keys(x).forEach(S=>{const E=x[S];"!"==E?n.add(S):E==I4&&e.add(S)}),i||(x.offset=g/this.duration),r.push(x)});const s=n.size?hg(n.values()):[],c=e.size?hg(e.values()):[];if(i){const h=r[0],g=V6(h);h.offset=0,g.offset=1,r=[h,g]}return j_(this.element,r,s,c,this.duration,this.startTime,this.easing,!1)}}class fie extends vg{constructor(n,e,i,r,s,c,h=!1){super(n,e,c.delay),this.keyframes=i,this.preStyleProps=r,this.postStyleProps=s,this._stretchStartingKeyframe=h,this.timings={duration:c.duration,delay:c.delay,easing:c.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let n=this.keyframes,{delay:e,duration:i,easing:r}=this.timings;if(this._stretchStartingKeyframe&&e){const s=[],c=i+e,h=e/c,g=Zu(n[0],!1);g.offset=0,s.push(g);const x=Zu(n[0],!1);x.offset=KA(h),s.push(x);const S=n.length-1;for(let E=1;E<=S;E++){let A=Zu(n[E],!1);A.offset=KA((e+A.offset*i)/c),s.push(A)}i=c,e=0,r="",n=s}return j_(this.element,n,this.preStyleProps,this.postStyleProps,i,e,r,!0)}}function KA(t,n=3){const e=Math.pow(10,n-1);return Math.round(t*e)/e}class q_{}class mie extends q_{normalizePropertyName(n,e){return H_(n)}normalizeStyleValue(n,e,i,r){let s="";const c=i.toString().trim();if(gie[e]&&0!==i&&"0"!==i)if("number"==typeof i)s="px";else{const h=i.match(/^[+-]?[\d\.]+([a-z]*)$/);h&&0==h[1].length&&r.push(`Please provide a CSS unit value for ${n}:${i}`)}return c+s}}const gie=(()=>function(t){const n={};return t.forEach(e=>n[e]=!0),n}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function QA(t,n,e,i,r,s,c,h,g,x,S,E,A){return{type:0,element:t,triggerName:n,isRemovalTransition:r,fromState:e,fromStyles:s,toState:i,toStyles:c,timelines:h,queriedElements:g,preStyleProps:x,postStyleProps:S,totalTime:E,errors:A}}const X_={};class JA{constructor(n,e,i){this._triggerName=n,this.ast=e,this._stateStyles=i}match(n,e,i,r){return function(t,n,e,i,r){return t.some(s=>s(n,e,i,r))}(this.ast.matchers,n,e,i,r)}buildStyles(n,e,i){const r=this._stateStyles["*"],s=this._stateStyles[n],c=r?r.buildStyles(e,i):{};return s?s.buildStyles(e,i):c}build(n,e,i,r,s,c,h,g,x,S){const E=[],A=this.ast.options&&this.ast.options.params||X_,j=this.buildStyles(i,h&&h.params||X_,E),ie=g&&g.params||X_,W=this.buildStyles(r,ie,E),Ee=new Set,Se=new Map,Ze=new Map,xt="void"===r,Ut={params:Object.assign(Object.assign({},A),ie)},on=S?[]:G_(n,e,this.ast.animation,s,c,j,W,Ut,x,E);let Qn=0;if(on.forEach(bi=>{Qn=Math.max(bi.duration+bi.delay,Qn)}),E.length)return QA(e,this._triggerName,i,r,xt,j,W,[],[],Se,Ze,Qn,E);on.forEach(bi=>{const Ti=bi.element,$n=Z2(Se,Ti,{});bi.preStyleProps.forEach(jn=>$n[jn]=!0);const Xn=Z2(Ze,Ti,{});bi.postStyleProps.forEach(jn=>Xn[jn]=!0),Ti!==e&&Ee.add(Ti)});const hi=hg(Ee.values());return QA(e,this._triggerName,i,r,xt,j,W,on,hi,Se,Ze,Qn)}}class yie{constructor(n,e,i){this.styles=n,this.defaultParams=e,this.normalizer=i}buildStyles(n,e){const i={},r=V6(this.defaultParams);return Object.keys(n).forEach(s=>{const c=n[s];null!=c&&(r[s]=c)}),this.styles.styles.forEach(s=>{if("string"!=typeof s){const c=s;Object.keys(c).forEach(h=>{let g=c[h];g.length>1&&(g=ug(g,r,e));const x=this.normalizer.normalizePropertyName(h,e);g=this.normalizer.normalizeStyleValue(h,x,g,e),i[x]=g})}}),i}}class xie{constructor(n,e,i){this.name=n,this.ast=e,this._normalizer=i,this.transitionFactories=[],this.states={},e.states.forEach(r=>{this.states[r.name]=new yie(r.style,r.options&&r.options.params||{},i)}),ek(this.states,"true","1"),ek(this.states,"false","0"),e.transitions.forEach(r=>{this.transitionFactories.push(new JA(n,r,this.states))}),this.fallbackTransition=function(t,n,e){return new JA(t,{type:1,animation:{type:2,steps:[],options:null},matchers:[(c,h)=>!0],options:null,queryCount:0,depCount:0},n)}(n,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(n,e,i,r){return this.transitionFactories.find(c=>c.match(n,e,i,r))||null}matchStyles(n,e,i){return this.fallbackTransition.buildStyles(n,e,i)}}function ek(t,n,e){t.hasOwnProperty(n)?t.hasOwnProperty(e)||(t[e]=t[n]):t.hasOwnProperty(e)&&(t[n]=t[e])}const wie=new gg;class Mie{constructor(n,e,i){this.bodyNode=n,this._driver=e,this._normalizer=i,this._animations={},this._playersById={},this.players=[]}register(n,e){const i=[],r=U_(this._driver,e,i);if(i.length)throw new Error(`Unable to build the animation due to the following errors: ${i.join("\n")}`);this._animations[n]=r}_buildPlayer(n,e,i){const r=n.element,s=zA(0,this._normalizer,0,n.keyframes,e,i);return this._driver.animate(r,s,n.duration,n.delay,n.easing,[],!0)}create(n,e,i={}){const r=[],s=this._animations[n];let c;const h=new Map;if(s?(c=G_(this._driver,e,s,F_,og,{},{},i,wie,r),c.forEach(S=>{const E=Z2(h,S.element,{});S.postStyleProps.forEach(A=>E[A]=null)})):(r.push("The requested animation doesn't exist or has already been destroyed"),c=[]),r.length)throw new Error(`Unable to create the animation due to the following errors: ${r.join("\n")}`);h.forEach((S,E)=>{Object.keys(S).forEach(A=>{S[A]=this._driver.computeStyle(E,A,I4)})});const x=Xu(c.map(S=>{const E=h.get(S.element);return this._buildPlayer(S,{},E)}));return this._playersById[n]=x,x.onDestroy(()=>this.destroy(n)),this.players.push(x),x}destroy(n){const e=this._getPlayer(n);e.destroy(),delete this._playersById[n];const i=this.players.indexOf(e);i>=0&&this.players.splice(i,1)}_getPlayer(n){const e=this._playersById[n];if(!e)throw new Error(`Unable to find the timeline player referenced by ${n}`);return e}listen(n,e,i,r){const s=E_(e,"","","");return T_(this._getPlayer(n),i,s,r),()=>{}}command(n,e,i,r){if("register"==i)return void this.register(n,r[0]);if("create"==i)return void this.create(n,e,r[0]||{});const s=this._getPlayer(n);switch(i){case"play":s.play();break;case"pause":s.pause();break;case"reset":s.reset();break;case"restart":s.restart();break;case"finish":s.finish();break;case"init":s.init();break;case"setPosition":s.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(n)}}}const tk="ng-animate-queued",nk="ng-animate-disabled",ik=".ng-animate-disabled",Eie=[],rk={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Die={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Rl="__ng_removed";class Z_{constructor(n,e=""){this.namespaceId=e;const i=n&&n.hasOwnProperty("value");if(this.value=function(t){return null!=t?t:null}(i?n.value:n),i){const s=V6(n);delete s.value,this.options=s}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(n){const e=n.params;if(e){const i=this.options.params;Object.keys(e).forEach(r=>{null==i[r]&&(i[r]=e[r])})}}}const x8="void",Y_=new Z_(x8);class Aie{constructor(n,e,i){this.id=n,this.hostElement=e,this._engine=i,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+n,Hl(e,this._hostClassName)}listen(n,e,i,r){if(!this._triggers.hasOwnProperty(e))throw new Error(`Unable to listen on the animation trigger event "${i}" because the animation trigger "${e}" doesn't exist!`);if(null==i||0==i.length)throw new Error(`Unable to listen on the animation trigger "${e}" because the provided event is undefined!`);if(!function(t){return"start"==t||"done"==t}(i))throw new Error(`The provided animation trigger event "${i}" for the animation trigger "${e}" is not supported!`);const s=Z2(this._elementListeners,n,[]),c={name:e,phase:i,callback:r};s.push(c);const h=Z2(this._engine.statesByElement,n,{});return h.hasOwnProperty(e)||(Hl(n,ag),Hl(n,ag+"-"+e),h[e]=Y_),()=>{this._engine.afterFlush(()=>{const g=s.indexOf(c);g>=0&&s.splice(g,1),this._triggers[e]||delete h[e]})}}register(n,e){return!this._triggers[n]&&(this._triggers[n]=e,!0)}_getTrigger(n){const e=this._triggers[n];if(!e)throw new Error(`The provided animation trigger "${n}" has not been registered!`);return e}trigger(n,e,i,r=!0){const s=this._getTrigger(e),c=new K_(this.id,e,n);let h=this._engine.statesByElement.get(n);h||(Hl(n,ag),Hl(n,ag+"-"+e),this._engine.statesByElement.set(n,h={}));let g=h[e];const x=new Z_(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&g&&x.absorbOptions(g.options),h[e]=x,g||(g=Y_),x.value!==x8&&g.value===x.value){if(!function(t,n){const e=Object.keys(t),i=Object.keys(n);if(e.length!=i.length)return!1;for(let r=0;r{D0(n,W),E3(n,Ee)})}return}const A=Z2(this._engine.playersByElement,n,[]);A.forEach(ie=>{ie.namespaceId==this.id&&ie.triggerName==e&&ie.queued&&ie.destroy()});let F=s.matchTransition(g.value,x.value,n,x.params),j=!1;if(!F){if(!r)return;F=s.fallbackTransition,j=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:n,triggerName:e,transition:F,fromState:g,toState:x,player:c,isFallbackTransition:j}),j||(Hl(n,tk),c.onStart(()=>{F6(n,tk)})),c.onDone(()=>{let ie=this.players.indexOf(c);ie>=0&&this.players.splice(ie,1);const W=this._engine.playersByElement.get(n);if(W){let Ee=W.indexOf(c);Ee>=0&&W.splice(Ee,1)}}),this.players.push(c),A.push(c),c}deregister(n){delete this._triggers[n],this._engine.statesByElement.forEach((e,i)=>{delete e[n]}),this._elementListeners.forEach((e,i)=>{this._elementListeners.set(i,e.filter(r=>r.name!=n))})}clearElementCache(n){this._engine.statesByElement.delete(n),this._elementListeners.delete(n);const e=this._engine.playersByElement.get(n);e&&(e.forEach(i=>i.destroy()),this._engine.playersByElement.delete(n))}_signalRemovalForInnerTriggers(n,e){const i=this._engine.driver.query(n,lg,!0);i.forEach(r=>{if(r[Rl])return;const s=this._engine.fetchNamespacesByElement(r);s.size?s.forEach(c=>c.triggerLeaveAnimation(r,e,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(n,e,i,r){const s=this._engine.statesByElement.get(n);if(s){const c=[];if(Object.keys(s).forEach(h=>{if(this._triggers[h]){const g=this.trigger(n,h,x8,r);g&&c.push(g)}}),c.length)return this._engine.markElementAsRemoved(this.id,n,!0,e),i&&Xu(c).onDone(()=>this._engine.processLeaveNode(n)),!0}return!1}prepareLeaveAnimationListeners(n){const e=this._elementListeners.get(n),i=this._engine.statesByElement.get(n);if(e&&i){const r=new Set;e.forEach(s=>{const c=s.name;if(r.has(c))return;r.add(c);const g=this._triggers[c].fallbackTransition,x=i[c]||Y_,S=new Z_(x8),E=new K_(this.id,c,n);this._engine.totalQueuedPlayers++,this._queue.push({element:n,triggerName:c,transition:g,fromState:x,toState:S,player:E,isFallbackTransition:!0})})}}removeNode(n,e){const i=this._engine;if(n.childElementCount&&this._signalRemovalForInnerTriggers(n,e),this.triggerLeaveAnimation(n,e,!0))return;let r=!1;if(i.totalAnimations){const s=i.players.length?i.playersByQueriedElement.get(n):[];if(s&&s.length)r=!0;else{let c=n;for(;c=c.parentNode;)if(i.statesByElement.get(c)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(n),r)i.markElementAsRemoved(this.id,n,!1,e);else{const s=n[Rl];(!s||s===rk)&&(i.afterFlush(()=>this.clearElementCache(n)),i.destroyInnerAnimations(n),i._onRemovalComplete(n,e))}}insertNode(n,e){Hl(n,this._hostClassName)}drainQueuedTransitions(n){const e=[];return this._queue.forEach(i=>{const r=i.player;if(r.destroyed)return;const s=i.element,c=this._elementListeners.get(s);c&&c.forEach(h=>{if(h.name==i.triggerName){const g=E_(s,i.triggerName,i.fromState.value,i.toState.value);g._data=n,T_(i.player,h.phase,g,h.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):e.push(i)}),this._queue=[],e.sort((i,r)=>{const s=i.transition.ast.depCount,c=r.transition.ast.depCount;return 0==s||0==c?s-c:this._engine.driver.containsElement(i.element,r.element)?1:-1})}destroy(n){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,n)}elementContainsData(n){let e=!1;return this._elementListeners.has(n)&&(e=!0),e=!!this._queue.find(i=>i.element===n)||e,e}}class kie{constructor(n,e,i){this.bodyNode=n,this.driver=e,this._normalizer=i,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(r,s)=>{}}_onRemovalComplete(n,e){this.onRemovalComplete(n,e)}get queuedPlayers(){const n=[];return this._namespaceList.forEach(e=>{e.players.forEach(i=>{i.queued&&n.push(i)})}),n}createNamespace(n,e){const i=new Aie(n,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(i,e):(this.newHostElements.set(e,i),this.collectEnterElement(e)),this._namespaceLookup[n]=i}_balanceNamespaceList(n,e){const i=this._namespaceList.length-1;if(i>=0){let r=!1;for(let s=i;s>=0;s--)if(this.driver.containsElement(this._namespaceList[s].hostElement,e)){this._namespaceList.splice(s+1,0,n),r=!0;break}r||this._namespaceList.splice(0,0,n)}else this._namespaceList.push(n);return this.namespacesByHostElement.set(e,n),n}register(n,e){let i=this._namespaceLookup[n];return i||(i=this.createNamespace(n,e)),i}registerTrigger(n,e,i){let r=this._namespaceLookup[n];r&&r.register(e,i)&&this.totalAnimations++}destroy(n,e){if(!n)return;const i=this._fetchNamespace(n);this.afterFlush(()=>{this.namespacesByHostElement.delete(i.hostElement),delete this._namespaceLookup[n];const r=this._namespaceList.indexOf(i);r>=0&&this._namespaceList.splice(r,1)}),this.afterFlushAnimationsDone(()=>i.destroy(e))}_fetchNamespace(n){return this._namespaceLookup[n]}fetchNamespacesByElement(n){const e=new Set,i=this.statesByElement.get(n);if(i){const r=Object.keys(i);for(let s=0;s=0&&this.collectedLeaveElements.splice(c,1)}if(n){const c=this._fetchNamespace(n);c&&c.insertNode(e,i)}r&&this.collectEnterElement(e)}collectEnterElement(n){this.collectedEnterElements.push(n)}markElementAsDisabled(n,e){e?this.disabledNodes.has(n)||(this.disabledNodes.add(n),Hl(n,nk)):this.disabledNodes.has(n)&&(this.disabledNodes.delete(n),F6(n,nk))}removeNode(n,e,i,r){if(yg(e)){const s=n?this._fetchNamespace(n):null;if(s?s.removeNode(e,r):this.markElementAsRemoved(n,e,!1,r),i){const c=this.namespacesByHostElement.get(e);c&&c.id!==n&&c.removeNode(e,r)}}else this._onRemovalComplete(e,r)}markElementAsRemoved(n,e,i,r){this.collectedLeaveElements.push(e),e[Rl]={namespaceId:n,setForRemoval:r,hasAnimation:i,removedBeforeQueried:!1}}listen(n,e,i,r,s){return yg(e)?this._fetchNamespace(n).listen(e,i,r,s):()=>{}}_buildInstruction(n,e,i,r,s){return n.transition.build(this.driver,n.element,n.fromState.value,n.toState.value,i,r,n.fromState.options,n.toState.options,e,s)}destroyInnerAnimations(n){let e=this.driver.query(n,lg,!0);e.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(e=this.driver.query(n,O_,!0),e.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(n){const e=this.playersByElement.get(n);e&&e.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(n){const e=this.playersByQueriedElement.get(n);e&&e.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(n=>{if(this.players.length)return Xu(this.players).onDone(()=>n());n()})}processLeaveNode(n){const e=n[Rl];if(e&&e.setForRemoval){if(n[Rl]=rk,e.namespaceId){this.destroyInnerAnimations(n);const i=this._fetchNamespace(e.namespaceId);i&&i.clearElementCache(n)}this._onRemovalComplete(n,e.setForRemoval)}this.driver.matchesElement(n,ik)&&this.markElementAsDisabled(n,!1),this.driver.query(n,ik,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(n=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,r)=>this._balanceNamespaceList(i,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){const i=this._whenQuietFns;this._whenQuietFns=[],e.length?Xu(e).onDone(()=>{i.forEach(r=>r())}):i.forEach(r=>r())}}reportError(n){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${n.join("\n")}`)}_flushAnimations(n,e){const i=new gg,r=[],s=new Map,c=[],h=new Map,g=new Map,x=new Map,S=new Set;this.disabledNodes.forEach(vn=>{S.add(vn);const An=this.driver.query(vn,".ng-animate-queued",!0);for(let ni=0;ni{const ni=F_+ie++;j.set(An,ni),vn.forEach(Yn=>Hl(Yn,ni))});const W=[],Ee=new Set,Se=new Set;for(let vn=0;vnEe.add(Yn)):Se.add(An))}const Ze=new Map,xt=ak(A,Array.from(Ee));xt.forEach((vn,An)=>{const ni=og+ie++;Ze.set(An,ni),vn.forEach(Yn=>Hl(Yn,ni))}),n.push(()=>{F.forEach((vn,An)=>{const ni=j.get(An);vn.forEach(Yn=>F6(Yn,ni))}),xt.forEach((vn,An)=>{const ni=Ze.get(An);vn.forEach(Yn=>F6(Yn,ni))}),W.forEach(vn=>{this.processLeaveNode(vn)})});const Ut=[],on=[];for(let vn=this._namespaceList.length-1;vn>=0;vn--)this._namespaceList[vn].drainQueuedTransitions(e).forEach(ni=>{const Yn=ni.player,Ji=ni.element;if(Ut.push(Yn),this.collectedEnterElements.length){const Fo=Ji[Rl];if(Fo&&Fo.setForMove)return void Yn.destroy()}const wr=!E||!this.driver.containsElement(E,Ji),mr=Ze.get(Ji),za=j.get(Ji),gr=this._buildInstruction(ni,i,za,mr,wr);if(gr.errors&&gr.errors.length)on.push(gr);else{if(wr)return Yn.onStart(()=>D0(Ji,gr.fromStyles)),Yn.onDestroy(()=>E3(Ji,gr.toStyles)),void r.push(Yn);if(ni.isFallbackTransition)return Yn.onStart(()=>D0(Ji,gr.fromStyles)),Yn.onDestroy(()=>E3(Ji,gr.toStyles)),void r.push(Yn);gr.timelines.forEach(Fo=>Fo.stretchStartingKeyframe=!0),i.append(Ji,gr.timelines),c.push({instruction:gr,player:Yn,element:Ji}),gr.queriedElements.forEach(Fo=>Z2(h,Fo,[]).push(Yn)),gr.preStyleProps.forEach((Fo,ks)=>{const ol=Object.keys(Fo);if(ol.length){let On=g.get(ks);On||g.set(ks,On=new Set),ol.forEach(Ii=>On.add(Ii))}}),gr.postStyleProps.forEach((Fo,ks)=>{const ol=Object.keys(Fo);let On=x.get(ks);On||x.set(ks,On=new Set),ol.forEach(Ii=>On.add(Ii))})}});if(on.length){const vn=[];on.forEach(An=>{vn.push(`@${An.triggerName} has failed due to:\n`),An.errors.forEach(ni=>vn.push(`- ${ni}\n`))}),Ut.forEach(An=>An.destroy()),this.reportError(vn)}const Qn=new Map,hi=new Map;c.forEach(vn=>{const An=vn.element;i.has(An)&&(hi.set(An,An),this._beforeAnimationBuild(vn.player.namespaceId,vn.instruction,Qn))}),r.forEach(vn=>{const An=vn.element;this._getPreviousPlayers(An,!1,vn.namespaceId,vn.triggerName,null).forEach(Yn=>{Z2(Qn,An,[]).push(Yn),Yn.destroy()})});const bi=W.filter(vn=>ck(vn,g,x)),Ti=new Map;ok(Ti,this.driver,Se,x,I4).forEach(vn=>{ck(vn,g,x)&&bi.push(vn)});const Xn=new Map;F.forEach((vn,An)=>{ok(Xn,this.driver,new Set(vn),g,"!")}),bi.forEach(vn=>{const An=Ti.get(vn),ni=Xn.get(vn);Ti.set(vn,Object.assign(Object.assign({},An),ni))});const jn=[],ar=[],us={};c.forEach(vn=>{const{element:An,player:ni,instruction:Yn}=vn;if(i.has(An)){if(S.has(An))return ni.onDestroy(()=>E3(An,Yn.toStyles)),ni.disabled=!0,ni.overrideTotalTime(Yn.totalTime),void r.push(ni);let Ji=us;if(hi.size>1){let mr=An;const za=[];for(;mr=mr.parentNode;){const gr=hi.get(mr);if(gr){Ji=gr;break}za.push(mr)}za.forEach(gr=>hi.set(gr,Ji))}const wr=this._buildAnimation(ni.namespaceId,Yn,Qn,s,Xn,Ti);if(ni.setRealPlayer(wr),Ji===us)jn.push(ni);else{const mr=this.playersByElement.get(Ji);mr&&mr.length&&(ni.parentPlayer=Xu(mr)),r.push(ni)}}else D0(An,Yn.fromStyles),ni.onDestroy(()=>E3(An,Yn.toStyles)),ar.push(ni),S.has(An)&&r.push(ni)}),ar.forEach(vn=>{const An=s.get(vn.element);if(An&&An.length){const ni=Xu(An);vn.setRealPlayer(ni)}}),r.forEach(vn=>{vn.parentPlayer?vn.syncPlayerEvents(vn.parentPlayer):vn.destroy()});for(let vn=0;vn!wr.destroyed);Ji.length?Vie(this,An,Ji):this.processLeaveNode(An)}return W.length=0,jn.forEach(vn=>{this.players.push(vn),vn.onDone(()=>{vn.destroy();const An=this.players.indexOf(vn);this.players.splice(An,1)}),vn.play()}),jn}elementContainsData(n,e){let i=!1;const r=e[Rl];return r&&r.setForRemoval&&(i=!0),this.playersByElement.has(e)&&(i=!0),this.playersByQueriedElement.has(e)&&(i=!0),this.statesByElement.has(e)&&(i=!0),this._fetchNamespace(n).elementContainsData(e)||i}afterFlush(n){this._flushFns.push(n)}afterFlushAnimationsDone(n){this._whenQuietFns.push(n)}_getPreviousPlayers(n,e,i,r,s){let c=[];if(e){const h=this.playersByQueriedElement.get(n);h&&(c=h)}else{const h=this.playersByElement.get(n);if(h){const g=!s||s==x8;h.forEach(x=>{x.queued||!g&&x.triggerName!=r||c.push(x)})}}return(i||r)&&(c=c.filter(h=>!(i&&i!=h.namespaceId||r&&r!=h.triggerName))),c}_beforeAnimationBuild(n,e,i){const s=e.element,c=e.isRemovalTransition?void 0:n,h=e.isRemovalTransition?void 0:e.triggerName;for(const g of e.timelines){const x=g.element,S=x!==s,E=Z2(i,x,[]);this._getPreviousPlayers(x,S,c,h,e.toState).forEach(F=>{const j=F.getRealPlayer();j.beforeDestroy&&j.beforeDestroy(),F.destroy(),E.push(F)})}D0(s,e.fromStyles)}_buildAnimation(n,e,i,r,s,c){const h=e.triggerName,g=e.element,x=[],S=new Set,E=new Set,A=e.timelines.map(j=>{const ie=j.element;S.add(ie);const W=ie[Rl];if(W&&W.removedBeforeQueried)return new P6(j.duration,j.delay);const Ee=ie!==g,Se=function(t){const n=[];return lk(t,n),n}((i.get(ie)||Eie).map(Qn=>Qn.getRealPlayer())).filter(Qn=>!!Qn.element&&Qn.element===ie),Ze=s.get(ie),xt=c.get(ie),Ut=zA(0,this._normalizer,0,j.keyframes,Ze,xt),on=this._buildPlayer(j,Ut,Se);if(j.subTimeline&&r&&E.add(ie),Ee){const Qn=new K_(n,h,ie);Qn.setRealPlayer(on),x.push(Qn)}return on});x.forEach(j=>{Z2(this.playersByQueriedElement,j.element,[]).push(j),j.onDone(()=>function(t,n,e){let i;if(t instanceof Map){if(i=t.get(n),i){if(i.length){const r=i.indexOf(e);i.splice(r,1)}0==i.length&&t.delete(n)}}else if(i=t[n],i){if(i.length){const r=i.indexOf(e);i.splice(r,1)}0==i.length&&delete t[n]}return i}(this.playersByQueriedElement,j.element,j))}),S.forEach(j=>Hl(j,BA));const F=Xu(A);return F.onDestroy(()=>{S.forEach(j=>F6(j,BA)),E3(g,e.toStyles)}),E.forEach(j=>{Z2(r,j,[]).push(F)}),F}_buildPlayer(n,e,i){return e.length>0?this.driver.animate(n.element,e,n.duration,n.delay,n.easing,i):new P6(n.duration,n.delay)}}class K_{constructor(n,e,i){this.namespaceId=n,this.triggerName=e,this.element=i,this._player=new P6,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(n){this._containsRealPlayer||(this._player=n,Object.keys(this._queuedCallbacks).forEach(e=>{this._queuedCallbacks[e].forEach(i=>T_(n,e,void 0,i))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(n.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(n){this.totalTime=n}syncPlayerEvents(n){const e=this._player;e.triggerCallback&&n.onStart(()=>e.triggerCallback("start")),n.onDone(()=>this.finish()),n.onDestroy(()=>this.destroy())}_queueEvent(n,e){Z2(this._queuedCallbacks,n,[]).push(e)}onDone(n){this.queued&&this._queueEvent("done",n),this._player.onDone(n)}onStart(n){this.queued&&this._queueEvent("start",n),this._player.onStart(n)}onDestroy(n){this.queued&&this._queueEvent("destroy",n),this._player.onDestroy(n)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(n){this.queued||this._player.setPosition(n)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(n){const e=this._player;e.triggerCallback&&e.triggerCallback(n)}}function yg(t){return t&&1===t.nodeType}function sk(t,n){const e=t.style.display;return t.style.display=null!=n?n:"none",e}function ok(t,n,e,i,r){const s=[];e.forEach(g=>s.push(sk(g)));const c=[];i.forEach((g,x)=>{const S={};g.forEach(E=>{const A=S[E]=n.computeStyle(x,E,r);(!A||0==A.length)&&(x[Rl]=Die,c.push(x))}),t.set(x,S)});let h=0;return e.forEach(g=>sk(g,s[h++])),c}function ak(t,n){const e=new Map;if(t.forEach(h=>e.set(h,[])),0==n.length)return e;const r=new Set(n),s=new Map;function c(h){if(!h)return 1;let g=s.get(h);if(g)return g;const x=h.parentNode;return g=e.has(x)?x:r.has(x)?1:c(x),s.set(h,g),g}return n.forEach(h=>{const g=c(h);1!==g&&e.get(g).push(h)}),e}const _g="$$classes";function Hl(t,n){if(t.classList)t.classList.add(n);else{let e=t[_g];e||(e=t[_g]={}),e[n]=!0}}function F6(t,n){if(t.classList)t.classList.remove(n);else{let e=t[_g];e&&delete e[n]}}function Vie(t,n,e){Xu(e).onDone(()=>t.processLeaveNode(n))}function lk(t,n){for(let e=0;er.add(s)):n.set(t,i),e.delete(t),!0}class xg{constructor(n,e,i){this.bodyNode=n,this._driver=e,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(r,s)=>{},this._transitionEngine=new kie(n,e,i),this._timelineEngine=new Mie(n,e,i),this._transitionEngine.onRemovalComplete=(r,s)=>this.onRemovalComplete(r,s)}registerTrigger(n,e,i,r,s){const c=n+"-"+r;let h=this._triggerCache[c];if(!h){const g=[],x=U_(this._driver,s,g);if(g.length)throw new Error(`The animation trigger "${r}" has failed to build due to the following errors:\n - ${g.join("\n - ")}`);h=function(t,n,e){return new xie(t,n,e)}(r,x,this._normalizer),this._triggerCache[c]=h}this._transitionEngine.registerTrigger(e,r,h)}register(n,e){this._transitionEngine.register(n,e)}destroy(n,e){this._transitionEngine.destroy(n,e)}onInsert(n,e,i,r){this._transitionEngine.insertNode(n,e,i,r)}onRemove(n,e,i,r){this._transitionEngine.removeNode(n,e,r||!1,i)}disableAnimations(n,e){this._transitionEngine.markElementAsDisabled(n,e)}process(n,e,i,r){if("@"==i.charAt(0)){const[s,c]=PA(i);this._timelineEngine.command(s,e,c,r)}else this._transitionEngine.trigger(n,e,i,r)}listen(n,e,i,r,s){if("@"==i.charAt(0)){const[c,h]=PA(i);return this._timelineEngine.listen(c,e,h,s)}return this._transitionEngine.listen(n,e,i,r,s)}flush(n=-1){this._transitionEngine.flush(n)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function uk(t,n){let e=null,i=null;return Array.isArray(n)&&n.length?(e=Q_(n[0]),n.length>1&&(i=Q_(n[n.length-1]))):n&&(e=Q_(n)),e||i?new Nie(t,e,i):null}let Nie=(()=>{class t{constructor(e,i,r){this._element=e,this._startStyles=i,this._endStyles=r,this._state=0;let s=t.initialStylesByElement.get(e);s||t.initialStylesByElement.set(e,s={}),this._initialStyles=s}start(){this._state<1&&(this._startStyles&&E3(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(E3(this._element,this._initialStyles),this._endStyles&&(E3(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(t.initialStylesByElement.delete(this._element),this._startStyles&&(D0(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(D0(this._element,this._endStyles),this._endStyles=null),E3(this._element,this._initialStyles),this._state=3)}}return t.initialStylesByElement=new WeakMap,t})();function Q_(t){let n=null;const e=Object.keys(t);for(let i=0;ithis._handleCallback(g)}apply(){(function(t,n){const e=ex(t,"").trim();let i=0;e.length&&(function(t,n){let e=0;for(let i=0;i=this._delay&&i>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),mk(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(t,n){const i=ex(t,"").split(","),r=J_(i,n);r>=0&&(i.splice(r,1),bg(t,"",i.join(",")))}(this._element,this._name))}}function fk(t,n,e){bg(t,"PlayState",e,pk(t,n))}function pk(t,n){const e=ex(t,"");return e.indexOf(",")>0?J_(e.split(","),n):J_([e],n)}function J_(t,n){for(let e=0;e=0)return e;return-1}function mk(t,n,e){e?t.removeEventListener(dk,n):t.addEventListener(dk,n)}function bg(t,n,e,i){const r=hk+n;if(null!=i){const s=t.style[r];if(s.length){const c=s.split(",");c[i]=e,e=c.join(",")}}t.style[r]=e}function ex(t,n){return t.style[hk+n]||""}class gk{constructor(n,e,i,r,s,c,h,g){this.element=n,this.keyframes=e,this.animationName=i,this._duration=r,this._delay=s,this._finalStyles=h,this._specialStyles=g,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=c||"linear",this.totalTime=r+s,this._buildStyler()}onStart(n){this._onStartFns.push(n)}onDone(n){this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(n=>n()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(n=>n()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(n){this._styler.setPosition(n)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._state=0,this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new Uie(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(n){const e="start"==n?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}beforeDestroy(){this.init();const n={};if(this.hasStarted()){const e=this._state>=3;Object.keys(this._finalStyles).forEach(i=>{"offset"!=i&&(n[i]=e?this._finalStyles[i]:B_(this.element,i))})}this.currentSnapshot=n}}class Xie extends P6{constructor(n,e){super(),this.element=n,this._startingStyles={},this.__initialized=!1,this._styles=NA(e)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(n=>{this._startingStyles[n]=this.element.style[n]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(n=>this.element.style.setProperty(n,this._styles[n])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(n=>{const e=this._startingStyles[n];e?this.element.style.setProperty(n,e):this.element.style.removeProperty(n)}),this._startingStyles=null,super.destroy())}}class vk{constructor(){this._count=0}validateStyleProperty(n){return k_(n)}matchesElement(n,e){return I_(n,e)}containsElement(n,e){return z_(n,e)}query(n,e,i){return P_(n,e,i)}computeStyle(n,e,i){return window.getComputedStyle(n)[e]}buildKeyframeElement(n,e,i){i=i.map(h=>NA(h));let r=`@keyframes ${e} {\n`,s="";i.forEach(h=>{s=" ";const g=parseFloat(h.offset);r+=`${s}${100*g}% {\n`,s+=" ",Object.keys(h).forEach(x=>{const S=h[x];switch(x){case"offset":return;case"easing":return void(S&&(r+=`${s}animation-timing-function: ${S};\n`));default:return void(r+=`${s}${x}: ${S};\n`)}}),r+=`${s}}\n`}),r+="}\n";const c=document.createElement("style");return c.textContent=r,c}animate(n,e,i,r,s,c=[],h){const g=c.filter(W=>W instanceof gk),x={};WA(i,r)&&g.forEach(W=>{let Ee=W.currentSnapshot;Object.keys(Ee).forEach(Se=>x[Se]=Ee[Se])});const S=function(t){let n={};return t&&(Array.isArray(t)?t:[t]).forEach(i=>{Object.keys(i).forEach(r=>{"offset"==r||"easing"==r||(n[r]=i[r])})}),n}(e=qA(n,e,x));if(0==i)return new Xie(n,S);const E="gen_css_kf_"+this._count++,A=this.buildKeyframeElement(n,E,e);(function(t){var n;const e=null===(n=t.getRootNode)||void 0===n?void 0:n.call(t);return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot?e:document.head})(n).appendChild(A);const j=uk(n,e),ie=new gk(n,e,E,i,r,s,S,j);return ie.onDestroy(()=>function(t){t.parentNode.removeChild(t)}(A)),ie}}class _k{constructor(n,e,i,r){this.element=n,this.keyframes=e,this.options=i,this._specialStyles=r,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const n=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,n,this.options),this._finalKeyframe=n.length?n[n.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(n,e,i){return n.animate(e,i)}onStart(n){this._onStartFns.push(n)}onDone(n){this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(n=>n()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}setPosition(n){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=n*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const n={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(e=>{"offset"!=e&&(n[e]=this._finished?this._finalKeyframe[e]:B_(this.element,e))}),this.currentSnapshot=n}triggerCallback(n){const e="start"==n?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}}class Jie{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(xk().toString()),this._cssKeyframesDriver=new vk}validateStyleProperty(n){return k_(n)}matchesElement(n,e){return I_(n,e)}containsElement(n,e){return z_(n,e)}query(n,e,i){return P_(n,e,i)}computeStyle(n,e,i){return window.getComputedStyle(n)[e]}overrideWebAnimationsSupport(n){this._isNativeImpl=n}animate(n,e,i,r,s,c=[],h){if(!h&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(n,e,i,r,s,c);const S={duration:i,delay:r,fill:0==r?"both":"forwards"};s&&(S.easing=s);const E={},A=c.filter(j=>j instanceof _k);WA(i,r)&&A.forEach(j=>{let ie=j.currentSnapshot;Object.keys(ie).forEach(W=>E[W]=ie[W])});const F=uk(n,e=qA(n,e=e.map(j=>Zu(j,!1)),E));return new _k(n,e,S,F)}}function xk(){return IA()&&Element.prototype.animate||{}}let tre=(()=>{class t extends EA{constructor(e,i){super(),this._nextAnimationId=0,this._renderer=e.createRenderer(i.body,{id:"0",encapsulation:mi.None,styles:[],data:{animation:[]}})}build(e){const i=this._nextAnimationId.toString();this._nextAnimationId++;const r=Array.isArray(e)?DA(e):e;return bk(this._renderer,null,i,"register",[r]),new nre(i,this._renderer)}}return t.\u0275fac=function(e){return new(e||t)(Mt(d0),Mt(Cs))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();class nre extends class{}{constructor(n,e){super(),this._id=n,this._renderer=e}create(n,e){return new ire(this._id,n,e||{},this._renderer)}}class ire{constructor(n,e,i,r){this.id=n,this.element=e,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",i)}_listen(n,e){return this._renderer.listen(this.element,`@@${this.id}:${n}`,e)}_command(n,...e){return bk(this._renderer,this.element,this.id,n,e)}onDone(n){this._listen("done",n)}onStart(n){this._listen("start",n)}onDestroy(n){this._listen("destroy",n)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset"),this._started=!1}setPosition(n){this._command("setPosition",n)}getPosition(){var n,e;return null!==(e=null===(n=this._renderer.engine.players[+this.id])||void 0===n?void 0:n.getPosition())&&void 0!==e?e:0}}function bk(t,n,e,i,r){return t.setProperty(n,`@@${e}:${i}`,r)}const wk="@.disabled";let rre=(()=>{class t{constructor(e,i,r){this.delegate=e,this.engine=i,this._zone=r,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),i.onRemovalComplete=(s,c)=>{c&&c.parentNode(s)&&c.removeChild(s.parentNode,s)}}createRenderer(e,i){const s=this.delegate.createRenderer(e,i);if(!(e&&i&&i.data&&i.data.animation)){let S=this._rendererCache.get(s);return S||(S=new Mk("",s,this.engine),this._rendererCache.set(s,S)),S}const c=i.id,h=i.id+"-"+this._currentId;this._currentId++,this.engine.register(h,e);const g=S=>{Array.isArray(S)?S.forEach(g):this.engine.registerTrigger(c,h,e,S.name,S)};return i.data.animation.forEach(g),new sre(this,h,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(e,i,r){e>=0&&ei(r)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(s=>{const[c,h]=s;c(h)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([i,r]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return t.\u0275fac=function(e){return new(e||t)(Mt(d0),Mt(xg),Mt(pn))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();class Mk{constructor(n,e,i){this.namespaceId=n,this.delegate=e,this.engine=i,this.destroyNode=this.delegate.destroyNode?r=>e.destroyNode(r):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(n,e){return this.delegate.createElement(n,e)}createComment(n){return this.delegate.createComment(n)}createText(n){return this.delegate.createText(n)}appendChild(n,e){this.delegate.appendChild(n,e),this.engine.onInsert(this.namespaceId,e,n,!1)}insertBefore(n,e,i,r=!0){this.delegate.insertBefore(n,e,i),this.engine.onInsert(this.namespaceId,e,n,r)}removeChild(n,e,i){this.engine.onRemove(this.namespaceId,e,this.delegate,i)}selectRootElement(n,e){return this.delegate.selectRootElement(n,e)}parentNode(n){return this.delegate.parentNode(n)}nextSibling(n){return this.delegate.nextSibling(n)}setAttribute(n,e,i,r){this.delegate.setAttribute(n,e,i,r)}removeAttribute(n,e,i){this.delegate.removeAttribute(n,e,i)}addClass(n,e){this.delegate.addClass(n,e)}removeClass(n,e){this.delegate.removeClass(n,e)}setStyle(n,e,i,r){this.delegate.setStyle(n,e,i,r)}removeStyle(n,e,i){this.delegate.removeStyle(n,e,i)}setProperty(n,e,i){"@"==e.charAt(0)&&e==wk?this.disableAnimations(n,!!i):this.delegate.setProperty(n,e,i)}setValue(n,e){this.delegate.setValue(n,e)}listen(n,e,i){return this.delegate.listen(n,e,i)}disableAnimations(n,e){this.engine.disableAnimations(n,e)}}class sre extends Mk{constructor(n,e,i,r){super(e,i,r),this.factory=n,this.namespaceId=e}setProperty(n,e,i){"@"==e.charAt(0)?"."==e.charAt(1)&&e==wk?this.disableAnimations(n,i=void 0===i||!!i):this.engine.process(this.namespaceId,n,e.substr(1),i):this.delegate.setProperty(n,e,i)}listen(n,e,i){if("@"==e.charAt(0)){const r=function(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}(n);let s=e.substr(1),c="";return"@"!=s.charAt(0)&&([s,c]=function(t){const n=t.indexOf(".");return[t.substring(0,n),t.substr(n+1)]}(s)),this.engine.listen(this.namespaceId,r,s,c,h=>{this.factory.scheduleListenerCallback(h._data||-1,i,h)})}return this.delegate.listen(n,e,i)}}let lre=(()=>{class t extends xg{constructor(e,i,r){super(e.body,i,r)}ngOnDestroy(){this.flush()}}return t.\u0275fac=function(e){return new(e||t)(Mt(Cs),Mt(V_),Mt(q_))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();const Sk=new Xt("AnimationModuleType"),Tk=[{provide:EA,useClass:tre},{provide:q_,useFactory:function(){return new mie}},{provide:xg,useClass:lre},{provide:d0,useFactory:function(t,n,e){return new rre(t,n,e)},deps:[O7,xg,pn]}],Lk=[{provide:V_,useFactory:function(){return"function"==typeof xk()?new Jie:new vk}},{provide:Sk,useValue:"BrowserAnimations"},...Tk],Ek=[{provide:V_,useClass:RA},{provide:Sk,useValue:"NoopAnimations"},...Tk];let dre=(()=>{class t{static withConfig(e){return{ngModule:t,providers:e.disableAnimations?Ek:Lk}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({providers:Lk,imports:[Ky]}),t})();function Mg(t,n){return new q(e=>{const i=t.length;if(0===i)return void e.complete();const r=new Array(i);let s=0,c=0;for(let h=0;h{x||(x=!0,c++),r[h]=S},error:S=>e.error(S),complete:()=>{s++,(s===i||!x)&&(c===i&&e.next(n?n.reduce((S,E,A)=>(S[E]=r[A],S),{}):r),e.complete())}}))}})}let Dk=(()=>{class t{constructor(e,i){this._renderer=e,this._elementRef=i,this.onChange=r=>{},this.onTouched=()=>{}}setProperty(e,i){this._renderer.setProperty(this._elementRef.nativeElement,e,i)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}}return t.\u0275fac=function(e){return new(e||t)(B(q2),B(rn))},t.\u0275dir=Tn({type:t}),t})(),k0=(()=>{class t extends Dk{}return t.\u0275fac=function(){let n;return function(i){return(n||(n=ci(t)))(i||t)}}(),t.\u0275dir=Tn({type:t,features:[Ln]}),t})();const G1=new Xt("NgValueAccessor"),mre={provide:G1,useExisting:oe(()=>tx),multi:!0},Cre=new Xt("CompositionEventMode");let tx=(()=>{class t extends Dk{constructor(e,i,r){super(e,i),this._compositionMode=r,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const t=w3()?w3().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}())}writeValue(e){this.setProperty("value",null==e?"":e)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}}return t.\u0275fac=function(e){return new(e||t)(B(q2),B(rn),B(Cre,8))},t.\u0275dir=Tn({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(e,i){1&e&&ot("input",function(s){return i._handleInput(s.target.value)})("blur",function(){return i.onTouched()})("compositionstart",function(){return i._compositionStart()})("compositionend",function(s){return i._compositionEnd(s.target.value)})},features:[Gr([mre]),Ln]}),t})();function Yu(t){return null==t||0===t.length}function kk(t){return null!=t&&"number"==typeof t.length}const L1=new Xt("NgValidators"),Ku=new Xt("NgAsyncValidators");function Qu(t){return null}function Hk(t){return null!=t}function Bk(t){const n=Ef(t)?Mn(t):t;return Gm(n),n}function Uk(t){let n={};return t.forEach(e=>{n=null!=e?Object.assign(Object.assign({},n),e):n}),0===Object.keys(n).length?null:n}function $k(t,n){return n.map(e=>e(t))}function jk(t){return t.map(n=>function(t){return!t.validate}(n)?n:e=>n.validate(e))}function nx(t){return null!=t?function(t){if(!t)return null;const n=t.filter(Hk);return 0==n.length?null:function(e){return Uk($k(e,n))}}(jk(t)):null}function ix(t){return null!=t?function(t){if(!t)return null;const n=t.filter(Hk);return 0==n.length?null:function(e){return function(...t){if(1===t.length){const n=t[0];if(ne(n))return Mg(n,null);if(de(n)&&Object.getPrototypeOf(n)===Object.prototype){const e=Object.keys(n);return Mg(e.map(i=>n[i]),e)}}if("function"==typeof t[t.length-1]){const n=t.pop();return Mg(t=1===t.length&&ne(t[0])?t[0]:t,null).pipe(Qt(e=>n(...e)))}return Mg(t,null)}($k(e,n).map(Bk)).pipe(Qt(Uk))}}(jk(t)):null}function qk(t,n){return null===t?[n]:Array.isArray(t)?[...t,n]:[t,n]}function rx(t){return t?Array.isArray(t)?t:[t]:[]}function Sg(t,n){return Array.isArray(t)?t.includes(n):t===n}function Yk(t,n){const e=rx(n);return rx(t).forEach(r=>{Sg(e,r)||e.push(r)}),e}function Kk(t,n){return rx(n).filter(e=>!Sg(t,e))}let Qk=(()=>{class t{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=nx(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=ix(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e){this.control&&this.control.reset(e)}hasError(e,i){return!!this.control&&this.control.hasError(e,i)}getError(e,i){return this.control?this.control.getError(e,i):null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Tn({type:t}),t})(),W1=(()=>{class t extends Qk{get formDirective(){return null}get path(){return null}}return t.\u0275fac=function(){let n;return function(i){return(n||(n=ci(t)))(i||t)}}(),t.\u0275dir=Tn({type:t,features:[Ln]}),t})();class z4 extends Qk{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}let I0=(()=>{class t extends class{constructor(n){this._cd=n}is(n){var e,i,r;return"submitted"===n?!!(null===(e=this._cd)||void 0===e?void 0:e.submitted):!!(null===(r=null===(i=this._cd)||void 0===i?void 0:i.control)||void 0===r?void 0:r[n])}}{constructor(e){super(e)}}return t.\u0275fac=function(e){return new(e||t)(B(z4,2))},t.\u0275dir=Tn({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(e,i){2&e&&eo("ng-untouched",i.is("untouched"))("ng-touched",i.is("touched"))("ng-pristine",i.is("pristine"))("ng-dirty",i.is("dirty"))("ng-valid",i.is("valid"))("ng-invalid",i.is("invalid"))("ng-pending",i.is("pending"))},features:[Ln]}),t})();function b8(t,n){(function(t,n){const e=function(t){return t._rawValidators}(t);null!==n.validator?t.setValidators(qk(e,n.validator)):"function"==typeof e&&t.setValidators([e]);const i=function(t){return t._rawAsyncValidators}(t);null!==n.asyncValidator?t.setAsyncValidators(qk(i,n.asyncValidator)):"function"==typeof i&&t.setAsyncValidators([i]);const r=()=>t.updateValueAndValidity();Dg(n._rawValidators,r),Dg(n._rawAsyncValidators,r)})(t,n),n.valueAccessor.writeValue(t.value),function(t,n){n.valueAccessor.registerOnChange(e=>{t._pendingValue=e,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&eI(t,n)})}(t,n),function(t,n){const e=(i,r)=>{n.valueAccessor.writeValue(i),r&&n.viewToModelUpdate(i)};t.registerOnChange(e),n._registerOnDestroy(()=>{t._unregisterOnChange(e)})}(t,n),function(t,n){n.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&eI(t,n),"submit"!==t.updateOn&&t.markAsTouched()})}(t,n),function(t,n){if(n.valueAccessor.setDisabledState){const e=i=>{n.valueAccessor.setDisabledState(i)};t.registerOnDisabledChange(e),n._registerOnDestroy(()=>{t._unregisterOnDisabledChange(e)})}}(t,n)}function Dg(t,n){t.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(n)})}function eI(t,n){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),n.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function kg(t,n){const e=t.indexOf(n);e>-1&&t.splice(e,1)}const w8="VALID",Ig="INVALID",O6="PENDING",M8="DISABLED";function ux(t){return(dx(t)?t.validators:t)||null}function iI(t){return Array.isArray(t)?nx(t):t||null}function hx(t,n){return(dx(n)?n.asyncValidators:t)||null}function rI(t){return Array.isArray(t)?ix(t):t||null}function dx(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class fx{constructor(n,e){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=n,this._rawAsyncValidators=e,this._composedValidatorFn=iI(this._rawValidators),this._composedAsyncValidatorFn=rI(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(n){this._rawValidators=this._composedValidatorFn=n}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(n){this._rawAsyncValidators=this._composedAsyncValidatorFn=n}get parent(){return this._parent}get valid(){return this.status===w8}get invalid(){return this.status===Ig}get pending(){return this.status==O6}get disabled(){return this.status===M8}get enabled(){return this.status!==M8}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(n){this._rawValidators=n,this._composedValidatorFn=iI(n)}setAsyncValidators(n){this._rawAsyncValidators=n,this._composedAsyncValidatorFn=rI(n)}addValidators(n){this.setValidators(Yk(n,this._rawValidators))}addAsyncValidators(n){this.setAsyncValidators(Yk(n,this._rawAsyncValidators))}removeValidators(n){this.setValidators(Kk(n,this._rawValidators))}removeAsyncValidators(n){this.setAsyncValidators(Kk(n,this._rawAsyncValidators))}hasValidator(n){return Sg(this._rawValidators,n)}hasAsyncValidator(n){return Sg(this._rawAsyncValidators,n)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(n={}){this.touched=!0,this._parent&&!n.onlySelf&&this._parent.markAsTouched(n)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(n=>n.markAllAsTouched())}markAsUntouched(n={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(e=>{e.markAsUntouched({onlySelf:!0})}),this._parent&&!n.onlySelf&&this._parent._updateTouched(n)}markAsDirty(n={}){this.pristine=!1,this._parent&&!n.onlySelf&&this._parent.markAsDirty(n)}markAsPristine(n={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(e=>{e.markAsPristine({onlySelf:!0})}),this._parent&&!n.onlySelf&&this._parent._updatePristine(n)}markAsPending(n={}){this.status=O6,!1!==n.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!n.onlySelf&&this._parent.markAsPending(n)}disable(n={}){const e=this._parentMarkedDirty(n.onlySelf);this.status=M8,this.errors=null,this._forEachChild(i=>{i.disable(Object.assign(Object.assign({},n),{onlySelf:!0}))}),this._updateValue(),!1!==n.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},n),{skipPristineCheck:e})),this._onDisabledChange.forEach(i=>i(!0))}enable(n={}){const e=this._parentMarkedDirty(n.onlySelf);this.status=w8,this._forEachChild(i=>{i.enable(Object.assign(Object.assign({},n),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:n.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},n),{skipPristineCheck:e})),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(n){this._parent&&!n.onlySelf&&(this._parent.updateValueAndValidity(n),n.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(n){this._parent=n}updateValueAndValidity(n={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===w8||this.status===O6)&&this._runAsyncValidator(n.emitEvent)),!1!==n.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!n.onlySelf&&this._parent.updateValueAndValidity(n)}_updateTreeValidity(n={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(n)),this.updateValueAndValidity({onlySelf:!0,emitEvent:n.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?M8:w8}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(n){if(this.asyncValidator){this.status=O6,this._hasOwnPendingAsyncValidator=!0;const e=Bk(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(i=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(i,{emitEvent:n})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(n,e={}){this.errors=n,this._updateControlsErrors(!1!==e.emitEvent)}get(n){return function(t,n,e){if(null==n||(Array.isArray(n)||(n=n.split(".")),Array.isArray(n)&&0===n.length))return null;let i=t;return n.forEach(r=>{i=i instanceof px?i.controls.hasOwnProperty(r)?i.controls[r]:null:i instanceof Ire&&i.at(r)||null}),i}(this,n)}getError(n,e){const i=e?this.get(e):this;return i&&i.errors?i.errors[n]:null}hasError(n,e){return!!this.getError(n,e)}get root(){let n=this;for(;n._parent;)n=n._parent;return n}_updateControlsErrors(n){this.status=this._calculateStatus(),n&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(n)}_initObservables(){this.valueChanges=new We,this.statusChanges=new We}_calculateStatus(){return this._allControlsDisabled()?M8:this.errors?Ig:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(O6)?O6:this._anyControlsHaveStatus(Ig)?Ig:w8}_anyControlsHaveStatus(n){return this._anyControls(e=>e.status===n)}_anyControlsDirty(){return this._anyControls(n=>n.dirty)}_anyControlsTouched(){return this._anyControls(n=>n.touched)}_updatePristine(n={}){this.pristine=!this._anyControlsDirty(),this._parent&&!n.onlySelf&&this._parent._updatePristine(n)}_updateTouched(n={}){this.touched=this._anyControlsTouched(),this._parent&&!n.onlySelf&&this._parent._updateTouched(n)}_isBoxedValue(n){return"object"==typeof n&&null!==n&&2===Object.keys(n).length&&"value"in n&&"disabled"in n}_registerOnCollectionChange(n){this._onCollectionChange=n}_setUpdateStrategy(n){dx(n)&&null!=n.updateOn&&(this._updateOn=n.updateOn)}_parentMarkedDirty(n){return!n&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class zg extends fx{constructor(n=null,e,i){super(ux(e),hx(i,e)),this._onChange=[],this._applyFormState(n),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(n,e={}){this.value=this._pendingValue=n,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(i=>i(this.value,!1!==e.emitViewToModelChange)),this.updateValueAndValidity(e)}patchValue(n,e={}){this.setValue(n,e)}reset(n=null,e={}){this._applyFormState(n),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(n){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(n){this._onChange.push(n)}_unregisterOnChange(n){kg(this._onChange,n)}registerOnDisabledChange(n){this._onDisabledChange.push(n)}_unregisterOnDisabledChange(n){kg(this._onDisabledChange,n)}_forEachChild(n){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(n){this._isBoxedValue(n)?(this.value=this._pendingValue=n.value,n.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=n}}class px extends fx{constructor(n,e,i){super(ux(e),hx(i,e)),this.controls=n,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(n,e){return this.controls[n]?this.controls[n]:(this.controls[n]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(n,e,i={}){this.registerControl(n,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(n,e={}){this.controls[n]&&this.controls[n]._registerOnCollectionChange(()=>{}),delete this.controls[n],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(n,e,i={}){this.controls[n]&&this.controls[n]._registerOnCollectionChange(()=>{}),delete this.controls[n],e&&this.registerControl(n,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(n){return this.controls.hasOwnProperty(n)&&this.controls[n].enabled}setValue(n,e={}){this._checkAllValuesPresent(n),Object.keys(n).forEach(i=>{this._throwIfControlMissing(i),this.controls[i].setValue(n[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(n,e={}){null!=n&&(Object.keys(n).forEach(i=>{this.controls[i]&&this.controls[i].patchValue(n[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(n={},e={}){this._forEachChild((i,r)=>{i.reset(n[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(n,e,i)=>(n[i]=e instanceof zg?e.value:e.getRawValue(),n))}_syncPendingControls(){let n=this._reduceChildren(!1,(e,i)=>!!i._syncPendingControls()||e);return n&&this.updateValueAndValidity({onlySelf:!0}),n}_throwIfControlMissing(n){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[n])throw new Error(`Cannot find form control with name: ${n}.`)}_forEachChild(n){Object.keys(this.controls).forEach(e=>{const i=this.controls[e];i&&n(i,e)})}_setUpControls(){this._forEachChild(n=>{n.setParent(this),n._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(n){for(const e of Object.keys(this.controls)){const i=this.controls[e];if(this.contains(e)&&n(i))return!0}return!1}_reduceValue(){return this._reduceChildren({},(n,e,i)=>((e.enabled||this.disabled)&&(n[i]=e.value),n))}_reduceChildren(n,e){let i=n;return this._forEachChild((r,s)=>{i=e(i,r,s)}),i}_allControlsDisabled(){for(const n of Object.keys(this.controls))if(this.controls[n].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(n){this._forEachChild((e,i)=>{if(void 0===n[i])throw new Error(`Must supply a value for form control with name: '${i}'.`)})}}class Ire extends fx{constructor(n,e,i){super(ux(e),hx(i,e)),this.controls=n,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(n){return this.controls[n]}push(n,e={}){this.controls.push(n),this._registerControl(n),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}insert(n,e,i={}){this.controls.splice(n,0,e),this._registerControl(e),this.updateValueAndValidity({emitEvent:i.emitEvent})}removeAt(n,e={}){this.controls[n]&&this.controls[n]._registerOnCollectionChange(()=>{}),this.controls.splice(n,1),this.updateValueAndValidity({emitEvent:e.emitEvent})}setControl(n,e,i={}){this.controls[n]&&this.controls[n]._registerOnCollectionChange(()=>{}),this.controls.splice(n,1),e&&(this.controls.splice(n,0,e),this._registerControl(e)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(n,e={}){this._checkAllValuesPresent(n),n.forEach((i,r)=>{this._throwIfControlMissing(r),this.at(r).setValue(i,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(n,e={}){null!=n&&(n.forEach((i,r)=>{this.at(r)&&this.at(r).patchValue(i,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(n=[],e={}){this._forEachChild((i,r)=>{i.reset(n[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(n=>n instanceof zg?n.value:n.getRawValue())}clear(n={}){this.controls.length<1||(this._forEachChild(e=>e._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:n.emitEvent}))}_syncPendingControls(){let n=this.controls.reduce((e,i)=>!!i._syncPendingControls()||e,!1);return n&&this.updateValueAndValidity({onlySelf:!0}),n}_throwIfControlMissing(n){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(n))throw new Error(`Cannot find form control at index ${n}`)}_forEachChild(n){this.controls.forEach((e,i)=>{n(e,i)})}_updateValue(){this.value=this.controls.filter(n=>n.enabled||this.disabled).map(n=>n.value)}_anyControls(n){return this.controls.some(e=>e.enabled&&n(e))}_setUpControls(){this._forEachChild(n=>this._registerControl(n))}_checkAllValuesPresent(n){this._forEachChild((e,i)=>{if(void 0===n[i])throw new Error(`Must supply a value for form control at index: ${i}.`)})}_allControlsDisabled(){for(const n of this.controls)if(n.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(n){n.setParent(this),n._registerOnCollectionChange(this._onCollectionChange)}}const Vre={provide:z4,useExisting:oe(()=>Ju)},aI=(()=>Promise.resolve(null))();let Ju=(()=>{class t extends z4{constructor(e,i,r,s){super(),this.control=new zg,this._registered=!1,this.update=new We,this._parent=e,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=function(t,n){if(!n)return null;let e,i,r;return Array.isArray(n),n.forEach(s=>{s.constructor===tx?e=s:function(t){return Object.getPrototypeOf(t.constructor)===k0}(s)?i=s:r=s}),r||i||e||null}(0,s)}ngOnChanges(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),function(t,n){if(!t.hasOwnProperty("model"))return!1;const e=t.model;return!!e.isFirstChange()||!Object.is(n,e.currentValue)}(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?function(t,n){return[...n.path,t]}(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){b8(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(e){aI.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1})})}_updateDisabled(e){const i=e.isDisabled.currentValue,r=""===i||i&&"false"!==i;aI.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable()})}}return t.\u0275fac=function(e){return new(e||t)(B(W1,9),B(L1,10),B(Ku,10),B(G1,10))},t.\u0275dir=Tn({type:t,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[Gr([Vre]),Ln,kn]}),t})(),cI=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({}),t})();const gx=new Xt("NgModelWithFormControlWarning");function CI(t){return"number"==typeof t?t:parseInt(t,10)}const ese={provide:L1,useExisting:oe(()=>T8),multi:!0};let T8=(()=>{class t{constructor(){this._required=!1}get required(){return this._required}set required(e){this._required=null!=e&&!1!==e&&"false"!=`${e}`,this._onChange&&this._onChange()}validate(e){return this.required?function(t){return Yu(t.value)?{required:!0}:null}(e):null}registerOnValidatorChange(e){this._onChange=e}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Tn({type:t,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(e,i){2&e&&St("required",i.required?"":null)},inputs:{required:"required"},features:[Gr([ese])]}),t})();const ise={provide:L1,useExisting:oe(()=>Pg),multi:!0};let Pg=(()=>{class t{constructor(){this._validator=Qu}ngOnChanges(e){"minlength"in e&&(this._createValidator(),this._onChange&&this._onChange())}validate(e){return this.enabled()?this._validator(e):null}registerOnValidatorChange(e){this._onChange=e}_createValidator(){this._validator=this.enabled()?function(t){return n=>Yu(n.value)||!kk(n.value)?null:n.value.lengthL8),multi:!0};let L8=(()=>{class t{constructor(){this._validator=Qu}ngOnChanges(e){"maxlength"in e&&(this._createValidator(),this._onChange&&this._onChange())}validate(e){return this.enabled()?this._validator(e):null}registerOnValidatorChange(e){this._onChange=e}_createValidator(){this._validator=this.enabled()?function(t){return n=>kk(n.value)&&n.value.length>t?{maxlength:{requiredLength:t,actualLength:n.value.length}}:null}(CI(this.maxlength)):Qu}enabled(){return null!=this.maxlength}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Tn({type:t,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(e,i){2&e&&St("maxlength",i.enabled()?i.maxlength:null)},inputs:{maxlength:"maxlength"},features:[Gr([rse]),kn]}),t})(),MI=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[cI]]}),t})(),ose=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[MI]}),t})(),ase=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:gx,useValue:e.warnOnNgModelWithFormControl}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[MI]}),t})();function xn(t,n,e,i){var c,r=arguments.length,s=r<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,e,i);else for(var h=t.length-1;h>=0;h--)(c=t[h])&&(s=(r<3?c(s):r>3?c(n,e,s):c(n,e))||s);return r>3&&s&&Object.defineProperty(n,e,s),s}function P4(t,n){return function(e,i){n(e,i,t)}}function TI(t,n,e,i){return new(e||(e=Promise))(function(s,c){function h(S){try{x(i.next(S))}catch(E){c(E)}}function g(S){try{x(i.throw(S))}catch(E){c(E)}}function x(S){S.done?s(S.value):function(s){return s instanceof e?s:new e(function(c){c(s)})}(S.value).then(h,g)}x((i=i.apply(t,n||[])).next())})}var cse=ye(4086),use=(ye(9554),ye(7405),ye(7807)),hse=ye(9461),wx=ye(7585),N6=ye(2377),E8=ye(4001),D3=ye(5554),z0=ye(7053),eh=(ye(960),ye(3150));function D8(t,n,e,i){return be(e)&&(i=e,e=void 0),i?D8(t,n,e).pipe(Qt(r=>ne(r)?i(...r):i(r))):new q(r=>{DI(t,n,function(c){r.next(arguments.length>1?Array.prototype.slice.call(arguments):c)},r,e)})}function DI(t,n,e,i,r){let s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){const c=t;t.addEventListener(n,e,r),s=()=>c.removeEventListener(n,e,r)}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){const c=t;t.on(n,e),s=()=>c.off(n,e)}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){const c=t;t.addListener(n,e),s=()=>c.removeListener(n,e)}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let c=0,h=t.length;c"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(t):"function"==typeof requestAnimationFrame?requestAnimationFrame(t):setTimeout(t);let A8=(()=>{class t{constructor(e,i){this.injector=e,this.el=i,this.onChange=()=>{},this.onTouched=()=>{}}writeValue(e){this.el.nativeElement.value=this.lastValue=null==e?"":e,R6(this.el)}handleChangeEvent(e,i){e===this.el.nativeElement&&(i!==this.lastValue&&(this.lastValue=i,this.onChange(i)),R6(this.el))}_handleBlurEvent(e){e===this.el.nativeElement&&(this.onTouched(),R6(this.el))}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.el.nativeElement.disabled=e}ngOnDestroy(){this.statusChanges&&this.statusChanges.unsubscribe()}ngAfterViewInit(){let e;try{e=this.injector.get(z4)}catch(r){}if(!e)return;e.statusChanges&&(this.statusChanges=e.statusChanges.subscribe(()=>R6(this.el)));const i=e.control;i&&["markAsTouched","markAllAsTouched","markAsUntouched","markAsDirty","markAsPristine"].forEach(s=>{if(i[s]){const c=i[s].bind(i);i[s]=(...h)=>{c(...h),R6(this.el)}}})}}return t.\u0275fac=function(e){!function(){throw new Error("invalid")}()},t.\u0275dir=Tn({type:t,hostBindings:function(e,i){1&e&&ot("ionBlur",function(s){return i._handleBlurEvent(s.target)})}}),xn([b4("ionBlur",["$event.target"])],t.prototype,"_handleBlurEvent",null),t})();const R6=t=>{AI(()=>{const n=t.nativeElement,e=Tse(n);kI(n,e);const i=n.closest("ion-item");i&&kI(i,e)})},Tse=t=>{const n=t.classList,e=[];for(let i=0;i{const e=t.classList;["ion-valid","ion-invalid","ion-touched","ion-untouched","ion-dirty","ion-pristine"].forEach(i=>e.remove(i)),n.forEach(i=>e.add(i))},Lse=(t,n)=>t.substr(0,n.length)===n;var II;let P0=II=class extends A8{constructor(n,e){super(n,e)}writeValue(n){this.el.nativeElement.checked=this.lastValue=null!=n&&n,R6(this.el)}_handleIonChange(n){this.handleChangeEvent(n,n.checked)}};var zI;P0.\u0275fac=function(n){return new(n||P0)(B(U),B(rn))},P0.\u0275dir=Tn({type:P0,selectors:[["ion-checkbox"],["ion-toggle"]],hostBindings:function(n,e){1&n&&ot("ionChange",function(r){return e._handleIonChange(r.target)})},features:[Gr([{provide:G1,useExisting:II,multi:!0}]),Ln]}),P0.ctorParameters=()=>[{type:U},{type:rn}],xn([b4("ionChange",["$event.target"])],P0.prototype,"_handleIonChange",null);let th=zI=class extends A8{constructor(n,e){super(n,e)}_handleIonChange(n){this.handleChangeEvent(n,n.value)}registerOnChange(n){super.registerOnChange(e=>{n(""===e?null:parseFloat(e))})}};var PI;th.\u0275fac=function(n){return new(n||th)(B(U),B(rn))},th.\u0275dir=Tn({type:th,selectors:[["ion-input","type","number"]],hostBindings:function(n,e){1&n&&ot("ionChange",function(r){return e._handleIonChange(r.target)})},features:[Gr([{provide:G1,useExisting:zI,multi:!0}]),Ln]}),th.ctorParameters=()=>[{type:U},{type:rn}],xn([b4("ionChange",["$event.target"])],th.prototype,"_handleIonChange",null);let nh=PI=class extends A8{constructor(n,e){super(n,e)}_handleIonSelect(n){this.handleChangeEvent(n,n.checked)}};var VI;nh.\u0275fac=function(n){return new(n||nh)(B(U),B(rn))},nh.\u0275dir=Tn({type:nh,selectors:[["ion-radio"]],hostBindings:function(n,e){1&n&&ot("ionSelect",function(r){return e._handleIonSelect(r.target)})},features:[Gr([{provide:G1,useExisting:PI,multi:!0}]),Ln]}),nh.ctorParameters=()=>[{type:U},{type:rn}],xn([b4("ionSelect",["$event.target"])],nh.prototype,"_handleIonSelect",null);let A3=VI=class extends A8{constructor(n,e){super(n,e)}_handleChangeEvent(n){this.handleChangeEvent(n,n.value)}};var FI;A3.\u0275fac=function(n){return new(n||A3)(B(U),B(rn))},A3.\u0275dir=Tn({type:A3,selectors:[["ion-range"],["ion-select"],["ion-radio-group"],["ion-segment"],["ion-datetime"]],hostBindings:function(n,e){1&n&&ot("ionChange",function(r){return e._handleChangeEvent(r.target)})},features:[Gr([{provide:G1,useExisting:VI,multi:!0}]),Ln]}),A3.ctorParameters=()=>[{type:U},{type:rn}],xn([b4("ionChange",["$event.target"])],A3.prototype,"_handleChangeEvent",null);let Sc=FI=class extends A8{constructor(n,e){super(n,e)}_handleInputEvent(n){this.handleChangeEvent(n,n.value)}};Sc.\u0275fac=function(n){return new(n||Sc)(B(U),B(rn))},Sc.\u0275dir=Tn({type:Sc,selectors:[["ion-input",3,"type","number"],["ion-textarea"],["ion-searchbar"]],hostBindings:function(n,e){1&n&&ot("ionChange",function(r){return e._handleInputEvent(r.target)})},features:[Gr([{provide:G1,useExisting:FI,multi:!0}]),Ln]}),Sc.ctorParameters=()=>[{type:U},{type:rn}],xn([b4("ionChange",["$event.target"])],Sc.prototype,"_handleInputEvent",null);let Bl=class{constructor(n,e){this.doc=n,this.backButton=new lt,this.keyboardDidShow=new lt,this.keyboardDidHide=new lt,this.pause=new lt,this.resume=new lt,this.resize=new lt,e.run(()=>{let i;this.win=n.defaultView,this.backButton.subscribeWithPriority=function(r,s){return this.subscribe(c=>c.register(r,h=>e.run(()=>s(h))))},H6(this.pause,n,"pause"),H6(this.resume,n,"resume"),H6(this.backButton,n,"ionBackButton"),H6(this.resize,this.win,"resize"),H6(this.keyboardDidShow,this.win,"ionKeyboardDidShow"),H6(this.keyboardDidHide,this.win,"ionKeyboardDidHide"),this._readyPromise=new Promise(r=>{i=r}),this.win&&this.win.cordova?n.addEventListener("deviceready",()=>{i("cordova")},{once:!0}):i("dom")})}is(n){return(0,wx.a)(this.win,n)}platforms(){return(0,wx.g)(this.win)}ready(){return this._readyPromise}get isRTL(){return"rtl"===this.doc.dir}getQueryParam(n){return Ese(this.win.location.href,n)}isLandscape(){return!this.isPortrait()}isPortrait(){return this.win.matchMedia&&this.win.matchMedia("(orientation: portrait)").matches}testUserAgent(n){const e=this.win.navigator;return!!(e&&e.userAgent&&e.userAgent.indexOf(n)>=0)}url(){return this.win.location.href}width(){return this.win.innerWidth}height(){return this.win.innerHeight}};Bl.\u0275fac=function(n){return new(n||Bl)(Mt(Cs),Mt(pn))},Bl.\u0275prov=Jt({token:Bl,factory:function(t){return Bl.\u0275fac(t)},providedIn:"root"}),Bl.ngInjectableDef=Jt({factory:function(){return new Bl(Mt(Cs),Mt(pn))},token:Bl,providedIn:"root"}),Bl=xn([P4(0,V2(Cs))],Bl);const Ese=(t,n)=>{n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");const i=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(t);return i?decodeURIComponent(i[1].replace(/\+/g," ")):null},H6=(t,n,e)=>{n&&n.addEventListener(e,i=>{t.next(null!=i?i.detail:void 0)})};let x2=class{constructor(n,e,i,r){this.location=e,this.serializer=i,this.router=r,this.direction=OI,this.animated=NI,this.guessDirection="forward",this.lastNavId=-1,r&&r.events.subscribe(s=>{if(s instanceof U7){const c=s.restoredState?s.restoredState.navigationId:s.id;this.guessDirection=c{this.pop(),s()})}navigateForward(n,e={}){return this.setDirection("forward",e.animated,e.animationDirection,e.animation),this.navigate(n,e)}navigateBack(n,e={}){return this.setDirection("back",e.animated,e.animationDirection,e.animation),this.navigate(n,e)}navigateRoot(n,e={}){return this.setDirection("root",e.animated,e.animationDirection,e.animation),this.navigate(n,e)}back(n={animated:!0,animationDirection:"back"}){return this.setDirection("back",n.animated,n.animationDirection,n.animation),this.location.back()}pop(){return TI(this,void 0,void 0,function*(){let n=this.topOutlet;for(;n&&!(yield n.pop());)n=n.parentOutlet})}setDirection(n,e,i,r){this.direction=n,this.animated=Dse(n,e,i),this.animationBuilder=r}setTopOutlet(n){this.topOutlet=n}consumeTransition(){let e,n="root";const i=this.animationBuilder;return"auto"===this.direction?(n=this.guessDirection,e=this.guessAnimation):(e=this.animated,n=this.direction),this.direction=OI,this.animated=NI,this.animationBuilder=void 0,{direction:n,animation:e,animationBuilder:i}}navigate(n,e){if(Array.isArray(n))return this.router.navigate(n,e);{const i=this.serializer.parse(n.toString());return void 0!==e.queryParams&&(i.queryParams=Object.assign({},e.queryParams)),void 0!==e.fragment&&(i.fragment=e.fragment),this.router.navigateByUrl(i,e)}}};x2.\u0275fac=function(n){return new(n||x2)(Mt(Bl),Mt(x0),Mt(c8),Mt(rs,8))},x2.\u0275prov=Jt({token:x2,factory:function(t){return x2.\u0275fac(t)},providedIn:"root"}),x2.ngInjectableDef=Jt({factory:function(){return new x2(Mt(Bl),Mt(x0),Mt(c8),Mt(rs,8))},token:x2,providedIn:"root"}),x2=xn([P4(3,ws())],x2);const Dse=(t,n,e)=>{if(!1!==n){if(void 0!==e)return e;if("forward"===t||"back"===t)return t;if("root"===t&&!0===n)return"forward"}},OI="auto",NI=void 0,Ase=(t,n)=>{const e=t.prototype;n.forEach(i=>{Object.defineProperty(e,i,{get(){return this.el[i]},set(r){this.z.runOutsideAngular(()=>this.el[i]=r)}})})},kse=(t,n)=>{const e=t.prototype;n.forEach(i=>{e[i]=function(){const r=arguments;return this.z.runOutsideAngular(()=>this.el[i].apply(this.el,r))}})},Ds=(t,n,e)=>{e.forEach(i=>t[i]=D8(n,i))};function ti(t){return function(e){return t.inputs&&Ase(e,t.inputs),t.methods&&kse(e,t.methods),e}}let RI=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-app"]],ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t})(),Tc=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement,Ds(this,this.el,["ionFocus","ionBlur"])}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-button"]],inputs:{buttonType:"buttonType",color:"color",disabled:"disabled",download:"download",expand:"expand",fill:"fill",href:"href",mode:"mode",rel:"rel",routerAnimation:"routerAnimation",routerDirection:"routerDirection",shape:"shape",size:"size",strong:"strong",target:"target",type:"type"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["buttonType","color","disabled","download","expand","fill","href","mode","rel","routerAnimation","routerDirection","shape","size","strong","target","type"]})],t),t})(),V4=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-buttons"]],inputs:{collapse:"collapse"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["collapse"]})],t),t})(),ih=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-col"]],inputs:{offset:"offset",offsetLg:"offsetLg",offsetMd:"offsetMd",offsetSm:"offsetSm",offsetXl:"offsetXl",offsetXs:"offsetXs",pull:"pull",pullLg:"pullLg",pullMd:"pullMd",pullSm:"pullSm",pullXl:"pullXl",pullXs:"pullXs",push:"push",pushLg:"pushLg",pushMd:"pushMd",pushSm:"pushSm",pushXl:"pushXl",pushXs:"pushXs",size:"size",sizeLg:"sizeLg",sizeMd:"sizeMd",sizeSm:"sizeSm",sizeXl:"sizeXl",sizeXs:"sizeXs"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["offset","offsetLg","offsetMd","offsetSm","offsetXl","offsetXs","pull","pullLg","pullMd","pullSm","pullXl","pullXs","push","pushLg","pushMd","pushSm","pushXl","pushXs","size","sizeLg","sizeMd","sizeSm","sizeXl","sizeXs"]})],t),t})(),K2=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement,Ds(this,this.el,["ionScrollStart","ionScroll","ionScrollEnd"])}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-content"]],inputs:{color:"color",forceOverscroll:"forceOverscroll",fullscreen:"fullscreen",scrollEvents:"scrollEvents",scrollX:"scrollX",scrollY:"scrollY"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["color","forceOverscroll","fullscreen","scrollEvents","scrollX","scrollY"],methods:["getScrollElement","scrollToTop","scrollToBottom","scrollByPoint","scrollToPoint"]})],t),t})(),HI=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement,Ds(this,this.el,["ionCancel","ionChange","ionFocus","ionBlur"])}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-datetime"]],inputs:{cancelText:"cancelText",dayNames:"dayNames",dayShortNames:"dayShortNames",dayValues:"dayValues",disabled:"disabled",displayFormat:"displayFormat",displayTimezone:"displayTimezone",doneText:"doneText",hourValues:"hourValues",max:"max",min:"min",minuteValues:"minuteValues",mode:"mode",monthNames:"monthNames",monthShortNames:"monthShortNames",monthValues:"monthValues",name:"name",pickerFormat:"pickerFormat",pickerOptions:"pickerOptions",placeholder:"placeholder",readonly:"readonly",value:"value",yearValues:"yearValues"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["cancelText","dayNames","dayShortNames","dayValues","disabled","displayFormat","displayTimezone","doneText","hourValues","max","min","minuteValues","mode","monthNames","monthShortNames","monthValues","name","pickerFormat","pickerOptions","placeholder","readonly","value","yearValues"],methods:["open"]})],t),t})(),BI=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-footer"]],inputs:{mode:"mode",translucent:"translucent"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["mode","translucent"]})],t),t})(),F4=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-grid"]],inputs:{fixed:"fixed"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["fixed"]})],t),t})(),Ul=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-header"]],inputs:{collapse:"collapse",mode:"mode",translucent:"translucent"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["collapse","mode","translucent"]})],t),t})(),Q2=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-icon"]],inputs:{ariaHidden:"ariaHidden",ariaLabel:"ariaLabel",color:"color",flipRtl:"flipRtl",icon:"icon",ios:"ios",lazy:"lazy",md:"md",mode:"mode",name:"name",sanitize:"sanitize",size:"size",src:"src"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["ariaHidden","ariaLabel","color","flipRtl","icon","ios","lazy","md","mode","name","sanitize","size","src"]})],t),t})(),Fg=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement,Ds(this,this.el,["ionInput","ionChange","ionBlur","ionFocus"])}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-input"]],inputs:{accept:"accept",autocapitalize:"autocapitalize",autocomplete:"autocomplete",autocorrect:"autocorrect",autofocus:"autofocus",clearInput:"clearInput",clearOnEdit:"clearOnEdit",color:"color",debounce:"debounce",disabled:"disabled",enterkeyhint:"enterkeyhint",inputmode:"inputmode",max:"max",maxlength:"maxlength",min:"min",minlength:"minlength",mode:"mode",multiple:"multiple",name:"name",pattern:"pattern",placeholder:"placeholder",readonly:"readonly",required:"required",size:"size",spellcheck:"spellcheck",step:"step",type:"type",value:"value"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["accept","autocapitalize","autocomplete","autocorrect","autofocus","clearInput","clearOnEdit","color","debounce","disabled","enterkeyhint","inputmode","max","maxlength","min","minlength","mode","multiple","name","pattern","placeholder","readonly","required","size","spellcheck","step","type","value"],methods:["setFocus","getInputElement"]})],t),t})(),J2=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-item"]],inputs:{button:"button",color:"color",detail:"detail",detailIcon:"detailIcon",disabled:"disabled",download:"download",href:"href",lines:"lines",mode:"mode",rel:"rel",routerAnimation:"routerAnimation",routerDirection:"routerDirection",target:"target",type:"type"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["button","color","detail","detailIcon","disabled","download","href","lines","mode","rel","routerAnimation","routerDirection","target","type"]})],t),t})(),k3=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-item-group"]],ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t})(),el=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-label"]],inputs:{color:"color",mode:"mode",position:"position"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["color","mode","position"]})],t),t})(),Mx=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-list"]],inputs:{inset:"inset",lines:"lines",mode:"mode"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["inset","lines","mode"],methods:["closeSlidingItems"]})],t),t})(),UI=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement,Ds(this,this.el,["ionWillOpen","ionWillClose","ionDidOpen","ionDidClose"])}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-menu"]],inputs:{contentId:"contentId",disabled:"disabled",maxEdgeStart:"maxEdgeStart",menuId:"menuId",side:"side",swipeGesture:"swipeGesture",type:"type"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["contentId","disabled","maxEdgeStart","menuId","side","swipeGesture","type"],methods:["isOpen","isActive","open","close","toggle","setOpen"]})],t),t})(),O4=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-menu-button"]],inputs:{autoHide:"autoHide",color:"color",disabled:"disabled",menu:"menu",mode:"mode",type:"type"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["autoHide","color","disabled","menu","mode","type"]})],t),t})(),$I=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-menu-toggle"]],inputs:{autoHide:"autoHide",menu:"menu"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["autoHide","menu"]})],t),t})(),jI=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement,Ds(this,this.el,["ionFocus","ionBlur"])}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-radio"]],inputs:{color:"color",disabled:"disabled",mode:"mode",name:"name",value:"value"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["color","disabled","mode","name","value"]})],t),t})(),GI=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement,Ds(this,this.el,["ionChange"])}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-radio-group"]],inputs:{allowEmptySelection:"allowEmptySelection",name:"name",value:"value"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["allowEmptySelection","name","value"]})],t),t})(),Og=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement,Ds(this,this.el,["ionRefresh","ionPull","ionStart"])}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-refresher"]],inputs:{closeDuration:"closeDuration",disabled:"disabled",pullFactor:"pullFactor",pullMax:"pullMax",pullMin:"pullMin",snapbackDuration:"snapbackDuration"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["closeDuration","disabled","pullFactor","pullMax","pullMin","snapbackDuration"],methods:["complete","cancel","getProgress"]})],t),t})(),Ng=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-refresher-content"]],inputs:{pullingIcon:"pullingIcon",pullingText:"pullingText",refreshingSpinner:"refreshingSpinner",refreshingText:"refreshingText"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["pullingIcon","pullingText","refreshingSpinner","refreshingText"]})],t),t})(),N4=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-row"]],ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t})(),WI=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement,Ds(this,this.el,["ionChange"])}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-segment"]],inputs:{color:"color",disabled:"disabled",mode:"mode",scrollable:"scrollable",swipeGesture:"swipeGesture",value:"value"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["color","disabled","mode","scrollable","swipeGesture","value"]})],t),t})(),qI=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-segment-button"]],inputs:{disabled:"disabled",layout:"layout",mode:"mode",type:"type",value:"value"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["disabled","layout","mode","type","value"]})],t),t})(),XI=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement,Ds(this,this.el,["ionChange","ionCancel","ionFocus","ionBlur"])}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-select"]],inputs:{cancelText:"cancelText",compareWith:"compareWith",disabled:"disabled",interface:"interface",interfaceOptions:"interfaceOptions",mode:"mode",multiple:"multiple",name:"name",okText:"okText",placeholder:"placeholder",selectedText:"selectedText",value:"value"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["cancelText","compareWith","disabled","interface","interfaceOptions","mode","multiple","name","okText","placeholder","selectedText","value"],methods:["open"]})],t),t})(),ZI=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-select-option"]],inputs:{disabled:"disabled",value:"value"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["disabled","value"]})],t),t})(),YI=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement,Ds(this,this.el,["ionSplitPaneVisible"])}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-split-pane"]],inputs:{contentId:"contentId",disabled:"disabled",when:"when"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["contentId","disabled","when"]})],t),t})(),R4=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-text"]],inputs:{color:"color",mode:"mode"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["color","mode"]})],t),t})(),KI=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement,Ds(this,this.el,["ionChange","ionInput","ionBlur","ionFocus"])}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-textarea"]],inputs:{autoGrow:"autoGrow",autocapitalize:"autocapitalize",autofocus:"autofocus",clearOnEdit:"clearOnEdit",color:"color",cols:"cols",debounce:"debounce",disabled:"disabled",enterkeyhint:"enterkeyhint",inputmode:"inputmode",maxlength:"maxlength",minlength:"minlength",mode:"mode",name:"name",placeholder:"placeholder",readonly:"readonly",required:"required",rows:"rows",spellcheck:"spellcheck",value:"value",wrap:"wrap"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["autoGrow","autocapitalize","autofocus","clearOnEdit","color","cols","debounce","disabled","enterkeyhint","inputmode","maxlength","minlength","mode","name","placeholder","readonly","required","rows","spellcheck","value","wrap"],methods:["setFocus","getInputElement"]})],t),t})(),QI=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-thumbnail"]],ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t})(),Lc=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-title"]],inputs:{color:"color",size:"size"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["color","size"]})],t),t})(),$l=(()=>{let t=class{constructor(e,i,r){this.z=r,e.detach(),this.el=i.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(B(zn),B(rn),B(pn))},t.\u0275cmp=ht({type:t,selectors:[["ion-toolbar"]],inputs:{color:"color",mode:"mode"},ngContentSelectors:qn,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2,changeDetection:0}),t=xn([ti({inputs:["color","mode"]})],t),t})(),I3=class{get(n,e){const i=Rg();return i?i.get(n,e):null}getBoolean(n,e){const i=Rg();return!!i&&i.getBoolean(n,e)}getNumber(n,e){const i=Rg();return i?i.getNumber(n,e):0}set(n,e){console.warn("[DEPRECATION][Config]: The Config.set() method is deprecated and will be removed in Ionic Framework 6.0. Please see https://ionicframework.com/docs/angular/config for alternatives.");const i=Rg();i&&i.set(n,e)}};I3.\u0275fac=function(n){return new(n||I3)},I3.\u0275prov=Jt({token:I3,factory:function(t){return I3.\u0275fac(t)},providedIn:"root"}),I3.ngInjectableDef=Jt({factory:function(){return new I3},token:I3,providedIn:"root"});const JI=new Xt("USERCONFIG"),Rg=()=>{if("undefined"!=typeof window){const t=window.Ionic;if(t&&t.config)return t.config}return null};class Tx{constructor(n={}){this.data=n}get(n){return this.data[n]}}let Hg=(()=>{let t=class{constructor(e,i){this.zone=e,this.appRef=i}create(e,i,r){return new moe(e,i,r,this.appRef,this.zone)}};return t.\u0275fac=function(e){return new(e||t)(Mt(pn),Mt(w4))},t.\u0275prov=Jt({token:t,factory:function(n){return t.\u0275fac(n)}}),t})();class moe{constructor(n,e,i,r,s){this.resolver=n,this.injector=e,this.location=i,this.appRef=r,this.zone=s,this.elRefMap=new WeakMap,this.elEventsMap=new WeakMap}attachViewToDom(n,e,i,r){return this.zone.run(()=>new Promise(s=>{s(goe(this.zone,this.resolver,this.injector,this.location,this.appRef,this.elRefMap,this.elEventsMap,n,e,i,r))}))}removeViewFromDom(n,e){return this.zone.run(()=>new Promise(i=>{const r=this.elRefMap.get(e);if(r){r.destroy(),this.elRefMap.delete(e);const s=this.elEventsMap.get(e);s&&(s(),this.elEventsMap.delete(e))}i()}))}}const goe=(t,n,e,i,r,s,c,h,g,x,S)=>{const E=n.resolveComponentFactory(g),A=U.create({providers:voe(x),parent:e}),F=i?i.createComponent(E,i.length,A):E.create(A),j=F.instance,ie=F.location.nativeElement;if(x&&Object.assign(j,x),S)for(const Ee of S)ie.classList.add(Ee);const W=ez(t,j,ie);return h.appendChild(ie),i||r.attachView(F.hostView),F.changeDetectorRef.reattach(),s.set(ie,F),c.set(ie,W),ie},Coe=[E8.L,E8.a,E8.b,E8.c,E8.d],ez=(t,n,e)=>t.run(()=>{const i=Coe.filter(r=>"function"==typeof n[r]).map(r=>{const s=c=>n[r](c.detail);return e.addEventListener(r,s),()=>e.removeEventListener(r,s)});return()=>i.forEach(r=>r())}),tz=new Xt("NavParamsToken"),voe=t=>[{provide:tz,useValue:t},{provide:Tx,useFactory:yoe,deps:[tz]}],yoe=t=>new Tx(t),nz=(t,n)=>((t=t.filter(e=>e.stackId!==n.stackId)).push(n),t),Lx=(t,n)=>{const e=t.createUrlTree(["."],{relativeTo:n});return t.serializeUrl(e)},Moe=(t,n)=>{if(!t)return;const e=iz(n);for(let i=0;i=t.length)return e[i];if(e[i]!==t[i])return}},iz=t=>t.split("/").map(n=>n.trim()).filter(n=>""!==n),rz=t=>{t&&(t.ref.destroy(),t.unlistenEvents())};class Soe{constructor(n,e,i,r,s,c){this.containerEl=e,this.router=i,this.navCtrl=r,this.zone=s,this.location=c,this.views=[],this.skipTransition=!1,this.nextId=0,this.tabsPrefix=void 0!==n?iz(n):void 0}createView(n,e){const i=Lx(this.router,e),r=n&&n.location&&n.location.nativeElement,s=ez(this.zone,n.instance,r);return{id:this.nextId++,stackId:Moe(this.tabsPrefix,i),unlistenEvents:s,element:r,ref:n,url:i}}getExistingView(n){const e=Lx(this.router,n),i=this.views.find(r=>r.url===e);return i&&i.ref.changeDetectorRef.reattach(),i}setActive(n){const e=this.navCtrl.consumeTransition();let{direction:i,animation:r,animationBuilder:s}=e;const c=this.activeView,h=((t,n)=>!n||t.stackId!==n.stackId)(n,c);h&&(i="back",r=void 0);const g=this.views.slice();let x;const S=this.router;S.getCurrentNavigation?x=S.getCurrentNavigation():S.navigations&&S.navigations.value&&(x=S.navigations.value),x&&x.extras&&x.extras.replaceUrl&&this.views.length>0&&this.views.splice(-1,1);const E=this.views.includes(n),A=this.insertView(n,i);E||n.ref.changeDetectorRef.detectChanges();const F=n.animationBuilder;return void 0===s&&"back"===i&&!h&&void 0!==F&&(s=F),c&&(c.animationBuilder=s),this.zone.runOutsideAngular(()=>this.wait(()=>(c&&c.ref.changeDetectorRef.detach(),n.ref.changeDetectorRef.reattach(),this.transition(n,c,r,this.canGoBack(1),!1,s).then(()=>Toe(n,A,g,this.location)).then(()=>({enteringView:n,direction:i,animation:r,tabSwitch:h})))))}canGoBack(n,e=this.getActiveStackId()){return this.getStack(e).length>n}pop(n,e=this.getActiveStackId()){return this.zone.run(()=>{const i=this.getStack(e);if(i.length<=n)return Promise.resolve(!1);const r=i[i.length-n-1];let s=r.url;const c=r.savedData;if(c){const g=c.get("primary");g&&g.route&&g.route._routerState&&g.route._routerState.snapshot&&g.route._routerState.snapshot.url&&(s=g.route._routerState.snapshot.url)}const{animationBuilder:h}=this.navCtrl.consumeTransition();return this.navCtrl.navigateBack(s,Object.assign({},r.savedExtras,{animation:h})).then(()=>!0)})}startBackTransition(){const n=this.activeView;if(n){const e=this.getStack(n.stackId),i=e[e.length-2],r=i.animationBuilder;return this.wait(()=>this.transition(i,n,"back",this.canGoBack(2),!0,r))}return Promise.resolve()}endBackTransition(n){n?(this.skipTransition=!0,this.pop(1)):this.activeView&&sz(this.activeView,this.views,this.views,this.location)}getLastUrl(n){const e=this.getStack(n);return e.length>0?e[e.length-1]:void 0}getRootUrl(n){const e=this.getStack(n);return e.length>0?e[0]:void 0}getActiveStackId(){return this.activeView?this.activeView.stackId:void 0}hasRunningTask(){return void 0!==this.runningTask}destroy(){this.containerEl=void 0,this.views.forEach(rz),this.activeView=void 0,this.views=[]}getStack(n){return this.views.filter(e=>e.stackId===n)}insertView(n,e){return this.activeView=n,this.views=((t,n,e)=>"root"===e?nz(t,n):"forward"===e?((t,n)=>(t.indexOf(n)>=0?t=t.filter(i=>i.stackId!==n.stackId||i.id<=n.id):t.push(n),t))(t,n):((t,n)=>t.indexOf(n)>=0?t.filter(i=>i.stackId!==n.stackId||i.id<=n.id):nz(t,n))(t,n))(this.views,n,e),this.views.slice()}transition(n,e,i,r,s,c){if(this.skipTransition)return this.skipTransition=!1,Promise.resolve(!1);if(e===n)return Promise.resolve(!1);const h=n?n.element:void 0,g=e?e.element:void 0,x=this.containerEl;return h&&h!==g&&(h.classList.add("ion-page"),h.classList.add("ion-page-invisible"),h.parentElement!==x&&x.appendChild(h),x.commit)?x.commit(h,g,{deepWait:!0,duration:void 0===i?0:void 0,direction:i,showGoBack:r,progressAnimation:s,animationBuilder:c}):Promise.resolve(!1)}wait(n){return TI(this,void 0,void 0,function*(){void 0!==this.runningTask&&(yield this.runningTask,this.runningTask=void 0);const e=this.runningTask=n();return e.finally(()=>this.runningTask=void 0),e})}}const Toe=(t,n,e,i)=>"function"==typeof requestAnimationFrame?new Promise(r=>{requestAnimationFrame(()=>{sz(t,n,e,i),r()})}):Promise.resolve(),sz=(t,n,e,i)=>{e.filter(r=>!n.includes(r)).forEach(rz),n.forEach(r=>{const c=i.path().split("?")[0].split("#")[0];if(r!==t&&r.url!==c){const h=r.element;h.setAttribute("aria-hidden","true"),h.classList.add("ion-page-hidden"),r.ref.changeDetectorRef.detach()}})};let B6=(()=>{let t=class{constructor(e,i,r,s,c,h,g,x,S,E,A,F,j){this.parentContexts=e,this.location=i,this.resolver=r,this.config=h,this.navCtrl=g,this.parentOutlet=j,this.activated=null,this.activatedView=null,this._activatedRoute=null,this.proxyMap=new WeakMap,this.currentActivatedRoute$=new S1(null),this.stackEvents=new We,this.activateEvents=new We,this.deactivateEvents=new We,this.nativeEl=S.nativeElement,this.name=s||pr,this.tabsPrefix="true"===c?Lx(E,F):void 0,this.stackCtrl=new Soe(this.tabsPrefix,this.nativeEl,E,g,A,x),e.onChildOutletCreated(this.name,this)}set animation(e){this.nativeEl.animation=e}set animated(e){this.nativeEl.animated=e}set swipeGesture(e){this._swipeGesture=e,this.nativeEl.swipeHandler=e?{canStart:()=>this.stackCtrl.canGoBack(1)&&!this.stackCtrl.hasRunningTask(),onStart:()=>this.stackCtrl.startBackTransition(),onEnd:i=>this.stackCtrl.endBackTransition(i)}:void 0}ngOnDestroy(){this.stackCtrl.destroy()}getContext(){return this.parentContexts.getContext(this.name)}ngOnInit(){if(!this.activated){const e=this.getContext();e&&e.route&&this.activateWith(e.route,e.resolver||null)}new Promise(e=>(0,N6.c)(this.nativeEl,e)).then(()=>{void 0===this._swipeGesture&&(this.swipeGesture=this.config.getBoolean("swipeBackEnabled","ios"===this.nativeEl.mode))})}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){throw new Error("incompatible reuse strategy")}attach(e,i){throw new Error("incompatible reuse strategy")}deactivate(){if(this.activated){if(this.activatedView){const i=this.getContext();this.activatedView.savedData=new Map(i.children.contexts);const r=this.activatedView.savedData.get("primary");if(r&&i.route&&(r.route=Object.assign({},i.route)),this.activatedView.savedExtras={},i.route){const s=i.route.snapshot;this.activatedView.savedExtras.queryParams=s.queryParams,this.activatedView.savedExtras.fragment=s.fragment}}const e=this.component;this.activatedView=null,this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(e)}}activateWith(e,i){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=e;let r,s=this.stackCtrl.getExistingView(e);if(s){r=this.activated=s.ref;const c=s.savedData;c&&(this.getContext().children.contexts=c),this.updateActivatedRouteProxy(r.instance,e)}else{const g=(i=i||this.resolver).resolveComponentFactory(e._futureSnapshot.routeConfig.component),x=this.parentContexts.getOrCreateContext(this.name).children,S=new S1(null),E=this.createActivatedRouteProxy(S,e),A=new Loe(E,x,this.location.injector);r=this.activated=this.location.createComponent(g,this.location.length,A),S.next(r.instance),s=this.stackCtrl.createView(this.activated,e),this.proxyMap.set(r.instance,E),this.currentActivatedRoute$.next({component:r.instance,activatedRoute:e})}this.activatedView=s,this.stackCtrl.setActive(s).then(c=>{this.navCtrl.setTopOutlet(this),this.activateEvents.emit(r.instance),this.stackEvents.emit(c)})}canGoBack(e=1,i){return this.stackCtrl.canGoBack(e,i)}pop(e=1,i){return this.stackCtrl.pop(e,i)}getLastUrl(e){const i=this.stackCtrl.getLastUrl(e);return i?i.url:void 0}getLastRouteView(e){return this.stackCtrl.getLastUrl(e)}getRootView(e){return this.stackCtrl.getRootUrl(e)}getActiveStackId(){return this.stackCtrl.getActiveStackId()}createActivatedRouteProxy(e,i){const r=new Mc;return r._futureSnapshot=i._futureSnapshot,r._routerState=i._routerState,r.snapshot=i.snapshot,r.outlet=i.outlet,r.component=i.component,r._paramMap=this.proxyObservable(e,"paramMap"),r._queryParamMap=this.proxyObservable(e,"queryParamMap"),r.url=this.proxyObservable(e,"url"),r.params=this.proxyObservable(e,"params"),r.queryParams=this.proxyObservable(e,"queryParams"),r.fragment=this.proxyObservable(e,"fragment"),r.data=this.proxyObservable(e,"data"),r}proxyObservable(e,i){return e.pipe(Ea(r=>!!r),ri(r=>this.currentActivatedRoute$.pipe(Ea(s=>null!==s&&s.component===r),ri(s=>s&&s.activatedRoute[i]),e=>e.lift(new Cse(void 0,void 0)))))}updateActivatedRouteProxy(e,i){const r=this.proxyMap.get(e);if(!r)throw new Error("Could not find activated route proxy for view");r._futureSnapshot=i._futureSnapshot,r._routerState=i._routerState,r.snapshot=i.snapshot,r.outlet=i.outlet,r.component=i.component,this.currentActivatedRoute$.next({component:e,activatedRoute:i})}};return t.\u0275fac=function(e){return new(e||t)(B(qu),B(Za),B(W2),ho("name"),ho("tabs"),B(I3),B(x2),B(x0),B(rn),B(rs),B(pn),B(Mc),B(t,12))},t.\u0275dir=Tn({type:t,selectors:[["ion-router-outlet"]],inputs:{animated:"animated",animation:"animation",swipeGesture:"swipeGesture"},outputs:{stackEvents:"stackEvents",activateEvents:"activate",deactivateEvents:"deactivate"},exportAs:["outlet"]}),xn([Zf()],t.prototype,"stackEvents",void 0),xn([Zf("activate")],t.prototype,"activateEvents",void 0),xn([Zf("deactivate")],t.prototype,"deactivateEvents",void 0),t=xn([P4(3,z2("name")),P4(4,ws()),P4(4,z2("tabs")),P4(12,Lo()),P4(12,ws())],t),t})();class Loe{constructor(n,e,i){this.route=n,this.childContexts=e,this.parent=i}get(n,e){return n===Mc?this.route:n===qu?this.childContexts:this.parent.get(n,e)}}let oz=(()=>{let t=class{constructor(e,i,r,s,c){this.locationStrategy=e,this.navCtrl=i,this.elementRef=r,this.router=s,this.routerLink=c,this.routerDirection="forward"}ngOnInit(){this.updateTargetUrlAndHref()}ngOnChanges(){this.updateTargetUrlAndHref()}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}updateTargetUrlAndHref(){if(this.routerLink){const e=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.routerLink.urlTree));this.elementRef.nativeElement.href=e}}onClick(e){this.navCtrl.setDirection(this.routerDirection,void 0,void 0,this.routerAnimation),e.preventDefault()}};return t.\u0275fac=function(e){return new(e||t)(B(_0),B(x2),B(rn),B(rs),B(v8,8))},t.\u0275dir=Tn({type:t,selectors:[["","routerLink",""]],hostBindings:function(e,i){1&e&&ot("click",function(s){return i.onClick(s)})},inputs:{routerDirection:"routerDirection",routerAnimation:"routerAnimation"},features:[kn]}),xn([b4("click",["$event"])],t.prototype,"onClick",null),t=xn([P4(4,ws())],t),t})();class V0{constructor(n){this.ctrl=n}create(n){return this.ctrl.create(n||{})}dismiss(n,e,i){return this.ctrl.dismiss(n,e,i)}getTop(){return this.ctrl.getTop()}}let rh=class extends V0{constructor(){super(z0.b)}};rh.\u0275fac=function(n){return new(n||rh)},rh.\u0275prov=Jt({token:rh,factory:function(t){return rh.\u0275fac(t)},providedIn:"root"}),rh.ngInjectableDef=Jt({factory:function(){return new rh},token:rh,providedIn:"root"});let Io=class extends V0{constructor(){super(z0.a)}};Io.\u0275fac=function(n){return new(n||Io)},Io.\u0275prov=Jt({token:Io,factory:function(t){return Io.\u0275fac(t)},providedIn:"root"}),Io.ngInjectableDef=Jt({factory:function(){return new Io},token:Io,providedIn:"root"});let Zo=class extends V0{constructor(){super(z0.l)}};Zo.\u0275fac=function(n){return new(n||Zo)},Zo.\u0275prov=Jt({token:Zo,factory:function(t){return Zo.\u0275fac(t)},providedIn:"root"}),Zo.ngInjectableDef=Jt({factory:function(){return new Zo},token:Zo,providedIn:"root"});let Ec=class{open(n){return D3.m.open(n)}close(n){return D3.m.close(n)}toggle(n){return D3.m.toggle(n)}enable(n,e){return D3.m.enable(n,e)}swipeGesture(n,e){return D3.m.swipeGesture(n,e)}isOpen(n){return D3.m.isOpen(n)}isEnabled(n){return D3.m.isEnabled(n)}get(n){return D3.m.get(n)}getOpen(){return D3.m.getOpen()}getMenus(){return D3.m.getMenus()}};Ec.\u0275fac=function(n){return new(n||Ec)},Ec.\u0275prov=Jt({token:Ec,factory:function(t){return Ec.\u0275fac(t)},providedIn:"root"}),Ec.ngInjectableDef=Jt({factory:function(){return new Ec},token:Ec,providedIn:"root"});let sh=class extends V0{constructor(){super(z0.p)}};sh.\u0275fac=function(n){return new(n||sh)},sh.\u0275prov=Jt({token:sh,factory:function(t){return sh.\u0275fac(t)},providedIn:"root"}),sh.ngInjectableDef=Jt({factory:function(){return new sh},token:sh,providedIn:"root"});let Bg=(()=>{let t=class extends V0{constructor(e,i,r){super(z0.m),this.angularDelegate=e,this.resolver=i,this.injector=r}create(e){return super.create(Object.assign({},e,{delegate:this.angularDelegate.create(this.resolver,this.injector)}))}};return t.\u0275fac=function(e){return new(e||t)(Mt(Hg),Mt(W2),Mt(U))},t.\u0275prov=Jt({token:t,factory:function(n){return t.\u0275fac(n)}}),t})(),kx=(()=>{let t=class extends V0{constructor(e,i,r){super(z0.c),this.angularDelegate=e,this.resolver=i,this.injector=r}create(e){return super.create(Object.assign({},e,{delegate:this.angularDelegate.create(this.resolver,this.injector)}))}};return t.\u0275fac=function(e){return new(e||t)(Mt(Hg),Mt(W2),Mt(U))},t.\u0275prov=Jt({token:t,factory:function(n){return t.\u0275fac(n)}}),t})(),yo=class extends V0{constructor(){super(z0.t)}};yo.\u0275fac=function(n){return new(n||yo)},yo.\u0275prov=Jt({token:yo,factory:function(t){return yo.\u0275fac(t)},providedIn:"root"}),yo.ngInjectableDef=Jt({factory:function(){return new yo},token:yo,providedIn:"root"});let oh=class{read(n){az().read(n)}write(n){az().write(n)}};oh.\u0275fac=function(n){return new(n||oh)},oh.\u0275prov=Jt({token:oh,factory:function(t){return oh.\u0275fac(t)},providedIn:"root"}),oh.ngInjectableDef=Jt({factory:function(){return new oh},token:oh,providedIn:"root"});const az=()=>{const t="undefined"!=typeof window?window:null;if(null!=t){const n=t.Ionic;return n&&n.queue?n.queue:{read:e=>t.requestAnimationFrame(e),write:e=>t.requestAnimationFrame(e)}}return{read:n=>n(),write:n=>n()}};let ah=class{create(n){return(0,cse.c)(n)}easingTime(n,e,i,r,s){return(0,use.g)(n,e,i,r,s)}};ah.\u0275fac=function(n){return new(n||ah)},ah.\u0275prov=Jt({token:ah,factory:function(t){return ah.\u0275fac(t)},providedIn:"root"}),ah.ngInjectableDef=Jt({factory:function(){return new ah},token:ah,providedIn:"root"});let lh=class{constructor(n){this.zone=n}create(n,e=!1){return e&&Object.getOwnPropertyNames(n).forEach(i=>{if("function"==typeof n[i]){const r=n[i];n[i]=(...s)=>this.zone.run(()=>r(...s))}}),(0,hse.createGesture)(n)}};lh.\u0275fac=function(n){return new(n||lh)(Mt(pn))},lh.\u0275prov=Jt({token:lh,factory:function(t){return lh.\u0275fac(t)},providedIn:"root"}),lh.ngInjectableDef=Jt({factory:function(){return new lh(Mt(pn))},token:lh,providedIn:"root"});const Poe=(t,n,e)=>()=>{if(n.defaultView&&"undefined"!=typeof window){(t=>{const n=window,e=n.Ionic;e&&e.config&&"Object"!==e.config.constructor.name||(n.Ionic=n.Ionic||{},n.Ionic.config=Object.assign(Object.assign({},n.Ionic.config),t))})(Object.assign({},t,{_zoneGate:s=>e.run(s)}));const r="__zone_symbol__addEventListener"in n.body?"__zone_symbol__addEventListener":"addEventListener";return function(){var t=[];if("undefined"!=typeof window){var n=window;(!n.customElements||n.Element&&(!n.Element.prototype.closest||!n.Element.prototype.matches||!n.Element.prototype.remove||!n.Element.prototype.getRootNode))&&t.push(ye.e(6748).then(ye.t.bind(ye,5141,23))),("function"!=typeof Object.assign||!Object.entries||!Array.prototype.find||!Array.prototype.includes||!String.prototype.startsWith||!String.prototype.endsWith||n.NodeList&&!n.NodeList.prototype.forEach||!n.fetch||!function(){try{var i=new URL("b","http://a");return i.pathname="c%20d","http://a/c%20d"===i.href&&i.searchParams}catch(r){return!1}}()||"undefined"==typeof WeakMap)&&t.push(ye.e(2214).then(ye.t.bind(ye,7656,23)))}return Promise.all(t)}().then(()=>((t,n)=>"undefined"==typeof window?Promise.resolve():(eh.C&&eh.C.supports&&eh.C.supports("color","var(--c)")?(0,eh.a)():ye.e(1843).then(ye.t.bind(ye,5902,23)).then(()=>(eh.p.$cssShim$=eh.w.__cssshim)?eh.p.$cssShim$.i():0)).then(()=>(_se(),(0,eh.b)(JSON.parse('[["ion-select_3",[[2,"ion-select-popover",{"header":[1],"subHeader":[1,"sub-header"],"message":[1],"options":[16]},[[0,"ionChange","onSelect"]]],[33,"ion-select",{"disabled":[4],"cancelText":[1,"cancel-text"],"okText":[1,"ok-text"],"placeholder":[1],"name":[1],"selectedText":[1,"selected-text"],"multiple":[4],"interface":[1],"interfaceOptions":[8,"interface-options"],"compareWith":[1,"compare-with"],"value":[1032],"isExpanded":[32],"open":[64]}],[1,"ion-select-option",{"disabled":[4],"value":[8]}]]],["ion-menu_3",[[33,"ion-menu-button",{"color":[513],"disabled":[4],"menu":[1],"autoHide":[4,"auto-hide"],"type":[1],"visible":[32]},[[16,"ionMenuChange","visibilityChanged"],[16,"ionSplitPaneVisible","visibilityChanged"]]],[33,"ion-menu",{"contentId":[513,"content-id"],"menuId":[513,"menu-id"],"type":[1025],"disabled":[1028],"side":[513],"swipeGesture":[4,"swipe-gesture"],"maxEdgeStart":[2,"max-edge-start"],"isPaneVisible":[32],"isEndSide":[32],"isOpen":[64],"isActive":[64],"open":[64],"close":[64],"toggle":[64],"setOpen":[64]},[[16,"ionSplitPaneVisible","onSplitPaneChanged"],[2,"click","onBackdropClick"],[0,"keydown","onKeydown"]]],[1,"ion-menu-toggle",{"menu":[1],"autoHide":[4,"auto-hide"],"visible":[32]},[[16,"ionMenuChange","visibilityChanged"],[16,"ionSplitPaneVisible","visibilityChanged"]]]]],["ion-action-sheet",[[34,"ion-action-sheet",{"overlayIndex":[2,"overlay-index"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"buttons":[16],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"header":[1],"subHeader":[1,"sub-header"],"translucent":[4],"animated":[4],"htmlAttributes":[16],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-fab_3",[[33,"ion-fab-button",{"color":[513],"activated":[4],"disabled":[4],"download":[1],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"target":[1],"show":[4],"translucent":[4],"type":[1],"size":[1],"closeIcon":[1,"close-icon"]}],[1,"ion-fab",{"horizontal":[1],"vertical":[1],"edge":[4],"activated":[1028],"close":[64]}],[1,"ion-fab-list",{"activated":[4],"side":[1]}]]],["ion-refresher_2",[[0,"ion-refresher-content",{"pullingIcon":[1025,"pulling-icon"],"pullingText":[1,"pulling-text"],"refreshingSpinner":[1025,"refreshing-spinner"],"refreshingText":[1,"refreshing-text"]}],[32,"ion-refresher",{"pullMin":[2,"pull-min"],"pullMax":[2,"pull-max"],"closeDuration":[1,"close-duration"],"snapbackDuration":[1,"snapback-duration"],"pullFactor":[2,"pull-factor"],"disabled":[4],"nativeRefresher":[32],"state":[32],"complete":[64],"cancel":[64],"getProgress":[64]}]]],["ion-alert",[[34,"ion-alert",{"overlayIndex":[2,"overlay-index"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"cssClass":[1,"css-class"],"header":[1],"subHeader":[1,"sub-header"],"message":[1],"buttons":[16],"inputs":[1040],"backdropDismiss":[4,"backdrop-dismiss"],"translucent":[4],"animated":[4],"htmlAttributes":[16],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]},[[4,"keydown","onKeydown"]]]]],["ion-back-button",[[33,"ion-back-button",{"color":[513],"defaultHref":[1025,"default-href"],"disabled":[516],"icon":[1],"text":[1],"type":[1],"routerAnimation":[16]}]]],["ion-loading",[[34,"ion-loading",{"overlayIndex":[2,"overlay-index"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"message":[1],"cssClass":[1,"css-class"],"duration":[2],"backdropDismiss":[4,"backdrop-dismiss"],"showBackdrop":[4,"show-backdrop"],"spinner":[1025],"translucent":[4],"animated":[4],"htmlAttributes":[16],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-toast",[[33,"ion-toast",{"overlayIndex":[2,"overlay-index"],"color":[513],"enterAnimation":[16],"leaveAnimation":[16],"cssClass":[1,"css-class"],"duration":[2],"header":[1],"message":[1],"keyboardClose":[4,"keyboard-close"],"position":[1],"buttons":[16],"translucent":[4],"animated":[4],"htmlAttributes":[16],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-card_5",[[33,"ion-card",{"color":[513],"button":[4],"type":[1],"disabled":[4],"download":[1],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"target":[1]}],[32,"ion-card-content"],[33,"ion-card-header",{"color":[513],"translucent":[4]}],[33,"ion-card-subtitle",{"color":[513]}],[33,"ion-card-title",{"color":[513]}]]],["ion-item-option_3",[[33,"ion-item-option",{"color":[513],"disabled":[4],"download":[1],"expandable":[4],"href":[1],"rel":[1],"target":[1],"type":[1]}],[32,"ion-item-options",{"side":[1],"fireSwipeEvent":[64]}],[0,"ion-item-sliding",{"disabled":[4],"state":[32],"getOpenAmount":[64],"getSlidingRatio":[64],"open":[64],"close":[64],"closeOpened":[64]}]]],["ion-infinite-scroll_2",[[32,"ion-infinite-scroll-content",{"loadingSpinner":[1025,"loading-spinner"],"loadingText":[1,"loading-text"]}],[0,"ion-infinite-scroll",{"threshold":[1],"disabled":[4],"position":[1],"isLoading":[32],"complete":[64]}]]],["ion-reorder_2",[[33,"ion-reorder",null,[[2,"click","onClick"]]],[0,"ion-reorder-group",{"disabled":[4],"state":[32],"complete":[64]}]]],["ion-segment_2",[[33,"ion-segment-button",{"disabled":[4],"layout":[1],"type":[1],"value":[1],"checked":[32]}],[33,"ion-segment",{"color":[513],"disabled":[4],"scrollable":[4],"swipeGesture":[4,"swipe-gesture"],"value":[1025],"activated":[32]}]]],["ion-tab-bar_2",[[33,"ion-tab-button",{"disabled":[4],"download":[1],"href":[1],"rel":[1],"layout":[1025],"selected":[1028],"tab":[1],"target":[1]},[[8,"ionTabBarChanged","onTabBarChanged"]]],[33,"ion-tab-bar",{"color":[513],"selectedTab":[1,"selected-tab"],"translucent":[4],"keyboardVisible":[32]}]]],["ion-chip",[[33,"ion-chip",{"color":[513],"outline":[4],"disabled":[4]}]]],["ion-modal",[[34,"ion-modal",{"overlayIndex":[2,"overlay-index"],"delegate":[16],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"component":[1],"componentProps":[16],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"showBackdrop":[4,"show-backdrop"],"animated":[4],"swipeToClose":[4,"swipe-to-close"],"presentingElement":[16],"htmlAttributes":[16],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-popover",[[34,"ion-popover",{"delegate":[16],"overlayIndex":[2,"overlay-index"],"enterAnimation":[16],"leaveAnimation":[16],"component":[1],"componentProps":[16],"keyboardClose":[4,"keyboard-close"],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"event":[8],"showBackdrop":[4,"show-backdrop"],"translucent":[4],"animated":[4],"htmlAttributes":[16],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-searchbar",[[34,"ion-searchbar",{"color":[513],"animated":[4],"autocomplete":[1],"autocorrect":[1],"cancelButtonIcon":[1,"cancel-button-icon"],"cancelButtonText":[1,"cancel-button-text"],"clearIcon":[1,"clear-icon"],"debounce":[2],"disabled":[4],"inputmode":[1],"enterkeyhint":[1],"placeholder":[1],"searchIcon":[1,"search-icon"],"showCancelButton":[1,"show-cancel-button"],"showClearButton":[1,"show-clear-button"],"spellcheck":[4],"type":[1],"value":[1025],"focused":[32],"noAnimate":[32],"setFocus":[64],"getInputElement":[64]}]]],["ion-app_8",[[0,"ion-app"],[34,"ion-buttons",{"collapse":[4]}],[1,"ion-content",{"color":[513],"fullscreen":[4],"forceOverscroll":[1028,"force-overscroll"],"scrollX":[4,"scroll-x"],"scrollY":[4,"scroll-y"],"scrollEvents":[4,"scroll-events"],"getScrollElement":[64],"scrollToTop":[64],"scrollToBottom":[64],"scrollByPoint":[64],"scrollToPoint":[64]},[[8,"appload","onAppLoad"]]],[36,"ion-footer",{"translucent":[4]}],[36,"ion-header",{"collapse":[1],"translucent":[4]}],[1,"ion-router-outlet",{"mode":[1025],"delegate":[16],"animated":[4],"animation":[16],"swipeHandler":[16],"commit":[64],"setRouteId":[64],"getRouteId":[64]}],[33,"ion-title",{"color":[513],"size":[1]}],[33,"ion-toolbar",{"color":[513]},[[0,"ionStyle","childrenStyle"]]]]],["ion-route_4",[[0,"ion-route",{"url":[1],"component":[1],"componentProps":[16],"beforeLeave":[16],"beforeEnter":[16]}],[0,"ion-route-redirect",{"from":[1],"to":[1]}],[0,"ion-router",{"root":[1],"useHash":[4,"use-hash"],"canTransition":[64],"push":[64],"back":[64],"printDebug":[64],"navChanged":[64]},[[8,"popstate","onPopState"],[4,"ionBackButton","onBackButton"]]],[1,"ion-router-link",{"color":[513],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"target":[1]}]]],["ion-avatar_3",[[33,"ion-avatar"],[33,"ion-badge",{"color":[513]}],[1,"ion-thumbnail"]]],["ion-col_3",[[1,"ion-col",{"offset":[1],"offsetXs":[1,"offset-xs"],"offsetSm":[1,"offset-sm"],"offsetMd":[1,"offset-md"],"offsetLg":[1,"offset-lg"],"offsetXl":[1,"offset-xl"],"pull":[1],"pullXs":[1,"pull-xs"],"pullSm":[1,"pull-sm"],"pullMd":[1,"pull-md"],"pullLg":[1,"pull-lg"],"pullXl":[1,"pull-xl"],"push":[1],"pushXs":[1,"push-xs"],"pushSm":[1,"push-sm"],"pushMd":[1,"push-md"],"pushLg":[1,"push-lg"],"pushXl":[1,"push-xl"],"size":[1],"sizeXs":[1,"size-xs"],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]},[[9,"resize","onResize"]]],[1,"ion-grid",{"fixed":[4]}],[1,"ion-row"]]],["ion-nav_2",[[1,"ion-nav",{"delegate":[16],"swipeGesture":[1028,"swipe-gesture"],"animated":[4],"animation":[16],"rootParams":[16],"root":[1],"push":[64],"insert":[64],"insertPages":[64],"pop":[64],"popTo":[64],"popToRoot":[64],"removeIndex":[64],"setRoot":[64],"setPages":[64],"setRouteId":[64],"getRouteId":[64],"getActive":[64],"getByIndex":[64],"canGoBack":[64],"getPrevious":[64]}],[0,"ion-nav-link",{"component":[1],"componentProps":[16],"routerDirection":[1,"router-direction"],"routerAnimation":[16]}]]],["ion-slide_2",[[0,"ion-slide"],[36,"ion-slides",{"options":[8],"pager":[4],"scrollbar":[4],"update":[64],"updateAutoHeight":[64],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"getActiveIndex":[64],"getPreviousIndex":[64],"length":[64],"isEnd":[64],"isBeginning":[64],"startAutoplay":[64],"stopAutoplay":[64],"lockSwipeToNext":[64],"lockSwipeToPrev":[64],"lockSwipes":[64],"getSwiper":[64]}]]],["ion-tab_2",[[1,"ion-tab",{"active":[1028],"delegate":[16],"tab":[1],"component":[1],"setActive":[64]}],[1,"ion-tabs",{"useRouter":[1028,"use-router"],"selectedTab":[32],"select":[64],"getTab":[64],"getSelected":[64],"setRouteId":[64],"getRouteId":[64]}]]],["ion-checkbox",[[33,"ion-checkbox",{"color":[513],"name":[1],"checked":[1028],"indeterminate":[1028],"disabled":[4],"value":[1]}]]],["ion-img",[[1,"ion-img",{"alt":[1],"src":[1],"loadSrc":[32],"loadError":[32]}]]],["ion-input",[[34,"ion-input",{"fireFocusEvents":[4,"fire-focus-events"],"color":[513],"accept":[1],"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"autofocus":[4],"clearInput":[4,"clear-input"],"clearOnEdit":[4,"clear-on-edit"],"debounce":[2],"disabled":[4],"enterkeyhint":[1],"inputmode":[1],"max":[1],"maxlength":[2],"min":[1],"minlength":[2],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[4],"required":[4],"spellcheck":[4],"step":[1],"size":[2],"type":[1],"value":[1032],"hasFocus":[32],"setFocus":[64],"setBlur":[64],"getInputElement":[64]}]]],["ion-progress-bar",[[33,"ion-progress-bar",{"type":[1],"reversed":[4],"value":[2],"buffer":[2],"color":[513]}]]],["ion-range",[[33,"ion-range",{"color":[513],"debounce":[2],"name":[1],"dualKnobs":[4,"dual-knobs"],"min":[2],"max":[2],"pin":[4],"snaps":[4],"step":[2],"ticks":[4],"disabled":[4],"value":[1026],"ratioA":[32],"ratioB":[32],"pressedKnob":[32]}]]],["ion-split-pane",[[33,"ion-split-pane",{"contentId":[513,"content-id"],"disabled":[4],"when":[8],"visible":[32]}]]],["ion-text",[[1,"ion-text",{"color":[513]}]]],["ion-textarea",[[34,"ion-textarea",{"fireFocusEvents":[4,"fire-focus-events"],"color":[513],"autocapitalize":[1],"autofocus":[4],"clearOnEdit":[1028,"clear-on-edit"],"debounce":[2],"disabled":[4],"inputmode":[1],"enterkeyhint":[1],"maxlength":[2],"minlength":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"spellcheck":[4],"cols":[2],"rows":[2],"wrap":[1],"autoGrow":[4,"auto-grow"],"value":[1025],"hasFocus":[32],"setFocus":[64],"setBlur":[64],"getInputElement":[64]}]]],["ion-toggle",[[33,"ion-toggle",{"color":[513],"name":[1],"checked":[1028],"disabled":[4],"value":[1],"activated":[32]}]]],["ion-virtual-scroll",[[0,"ion-virtual-scroll",{"approxItemHeight":[2,"approx-item-height"],"approxHeaderHeight":[2,"approx-header-height"],"approxFooterHeight":[2,"approx-footer-height"],"headerFn":[16],"footerFn":[16],"items":[16],"itemHeight":[16],"headerHeight":[16],"footerHeight":[16],"renderItem":[16],"renderHeader":[16],"renderFooter":[16],"nodeRender":[16],"domRender":[16],"totalHeight":[32],"positionForItem":[64],"checkRange":[64],"checkEnd":[64]},[[9,"resize","onResize"]]]]],["ion-datetime_3",[[34,"ion-picker",{"overlayIndex":[2,"overlay-index"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"buttons":[16],"columns":[16],"cssClass":[1,"css-class"],"duration":[2],"showBackdrop":[4,"show-backdrop"],"backdropDismiss":[4,"backdrop-dismiss"],"animated":[4],"htmlAttributes":[16],"presented":[32],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64],"getColumn":[64]}],[33,"ion-datetime",{"name":[1],"disabled":[4],"readonly":[4],"min":[1025],"max":[1025],"displayFormat":[1,"display-format"],"displayTimezone":[1,"display-timezone"],"pickerFormat":[1,"picker-format"],"cancelText":[1,"cancel-text"],"doneText":[1,"done-text"],"yearValues":[8,"year-values"],"monthValues":[8,"month-values"],"dayValues":[8,"day-values"],"hourValues":[8,"hour-values"],"minuteValues":[8,"minute-values"],"monthNames":[1,"month-names"],"monthShortNames":[1,"month-short-names"],"dayNames":[1,"day-names"],"dayShortNames":[1,"day-short-names"],"pickerOptions":[16],"placeholder":[1],"value":[1025],"isExpanded":[32],"open":[64]}],[32,"ion-picker-column",{"col":[16]}]]],["ion-radio_2",[[33,"ion-radio",{"color":[513],"name":[1],"disabled":[4],"value":[8],"checked":[32],"buttonTabindex":[32],"setFocus":[64],"setButtonTabindex":[64]}],[0,"ion-radio-group",{"allowEmptySelection":[4,"allow-empty-selection"],"name":[1],"value":[1032]},[[4,"keydown","onKeydown"]]]]],["ion-spinner",[[1,"ion-spinner",{"color":[513],"duration":[2],"name":[1],"paused":[4]}]]],["ion-backdrop",[[33,"ion-backdrop",{"visible":[4],"tappable":[4],"stopPropagation":[4,"stop-propagation"]},[[2,"click","onMouseDown"]]]]],["ion-ripple-effect",[[1,"ion-ripple-effect",{"type":[1],"addRipple":[64]}]]],["ion-button_2",[[33,"ion-button",{"color":[513],"buttonType":[1025,"button-type"],"disabled":[516],"expand":[513],"fill":[1537],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"download":[1],"href":[1],"rel":[1],"shape":[513],"size":[513],"strong":[4],"target":[1],"type":[1]}],[1,"ion-icon",{"mode":[1025],"color":[1],"ariaLabel":[1537,"aria-label"],"ariaHidden":[513,"aria-hidden"],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[513],"src":[1],"icon":[8],"size":[1],"lazy":[4],"sanitize":[4],"svgContent":[32],"isVisible":[32]}]]],["ion-item_8",[[33,"ion-item-divider",{"color":[513],"sticky":[4]}],[32,"ion-item-group"],[33,"ion-note",{"color":[513]}],[1,"ion-skeleton-text",{"animated":[4]}],[49,"ion-item",{"color":[513],"button":[4],"detail":[4],"detailIcon":[1,"detail-icon"],"disabled":[4],"download":[1],"href":[1],"rel":[1],"lines":[1],"routerAnimation":[16],"routerDirection":[1,"router-direction"],"target":[1],"type":[1],"multipleInputs":[32],"focusable":[32]},[[0,"ionColor","labelColorChanged"],[0,"ionStyle","itemStyle"]]],[34,"ion-label",{"color":[513],"position":[1],"noAnimate":[32]}],[32,"ion-list",{"lines":[1],"inset":[4],"closeSlidingItems":[64]}],[33,"ion-list-header",{"color":[513],"lines":[1]}]]]]'),n))))(0,{exclude:["ion-tabs","ion-tab"],syncQueue:!0,raf:AI,jmp:s=>e.runOutsideAngular(s),ael(s,c,h,g){s[r](c,h,g)},rel(s,c,h,g){s.removeEventListener(c,h,g)}}))}};var lz;let U6=lz=class{static forRoot(n){return{ngModule:lz,providers:[{provide:JI,useValue:n},{provide:m0,useFactory:Poe,multi:!0,deps:[JI,Cs,pn]}]}}};U6.\u0275fac=function(n){return new(n||U6)},U6.\u0275mod=Xi({type:U6}),U6.\u0275inj=yi({providers:[Hg,Bg,kx],imports:[[S3]]});class Voe extends Xe{constructor(n,e){super()}schedule(n,e=0){return this}}class cz extends Voe{constructor(n,e){super(n,e),this.scheduler=n,this.work=e,this.pending=!1}schedule(n,e=0){if(this.closed)return this;this.state=n;const i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this}requestAsyncId(n,e,i=0){return setInterval(n.flush.bind(n,this),i)}recycleAsyncId(n,e,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return e;clearInterval(e)}execute(n,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(n,e);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(n,e){let r,i=!1;try{this.work(n)}catch(s){i=!0,r=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),r}_unsubscribe(){const n=this.id,e=this.scheduler,i=e.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=n&&(this.id=this.recycleAsyncId(e,n,null)),this.delay=null}}let uz=(()=>{class t{constructor(e,i=t.now){this.SchedulerAction=e,this.now=i}schedule(e,i=0,r){return new this.SchedulerAction(this,e).schedule(r,i)}}return t.now=()=>Date.now(),t})();class H4 extends uz{constructor(n,e=uz.now){super(n,()=>H4.delegate&&H4.delegate!==this?H4.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(n,e=0,i){return H4.delegate&&H4.delegate!==this?H4.delegate.schedule(n,e,i):super.schedule(n,e,i)}flush(n){const{actions:e}=this;if(this.active)return void e.push(n);let i;this.active=!0;do{if(i=n.execute(n.state,n.delay))break}while(n=e.shift());if(this.active=!1,i){for(;n=e.shift();)n.unsubscribe();throw i}}}const Noe=new class extends H4{}(class extends cz{constructor(n,e){super(n,e),this.scheduler=n,this.work=e}schedule(n,e=0){return e>0?super.schedule(n,e):(this.delay=e,this.state=n,this.scheduler.flush(this),this)}execute(n,e){return e>0||this.closed?super.execute(n,e):this._execute(n,e)}requestAsyncId(n,e,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(n,e,i):n.flush(this)}});function Ix(t,n){return new q(n?e=>n.schedule(Roe,0,{error:t,subscriber:e}):e=>e.error(t))}function Roe({error:t,subscriber:n}){n.error(t)}class b2{constructor(n,e,i){this.kind=n,this.value=e,this.error=i,this.hasValue="N"===n}observe(n){switch(this.kind){case"N":return n.next&&n.next(this.value);case"E":return n.error&&n.error(this.error);case"C":return n.complete&&n.complete()}}do(n,e,i){switch(this.kind){case"N":return n&&n(this.value);case"E":return e&&e(this.error);case"C":return i&&i()}}accept(n,e,i){return n&&"function"==typeof n.next?this.observe(n):this.do(n,e,i)}toObservable(){switch(this.kind){case"N":return Ni(this.value);case"E":return Ix(this.error);case"C":return H7()}throw new Error("unexpected notification kind value")}static createNext(n){return void 0!==n?new b2("N",n):b2.undefinedValueNotification}static createError(n){return new b2("E",void 0,n)}static createComplete(){return b2.completeNotification}}b2.completeNotification=new b2("C"),b2.undefinedValueNotification=new b2("N",void 0);class Ug extends at{constructor(n,e,i=0){super(n),this.scheduler=e,this.delay=i}static dispatch(n){const{notification:e,destination:i}=n;e.observe(i),this.unsubscribe()}scheduleMessage(n){this.destination.add(this.scheduler.schedule(Ug.dispatch,this.delay,new Boe(n,this.destination)))}_next(n){this.scheduleMessage(b2.createNext(n))}_error(n){this.scheduleMessage(b2.createError(n)),this.unsubscribe()}_complete(){this.scheduleMessage(b2.createComplete()),this.unsubscribe()}}class Boe{constructor(n,e){this.notification=n,this.destination=e}}class Uoe extends lt{constructor(n=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=n<1?1:n,this._windowTime=e<1?1:e,e===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(n){if(!this.isStopped){const e=this._events;e.push(n),e.length>this._bufferSize&&e.shift()}super.next(n)}nextTimeWindow(n){this.isStopped||(this._events.push(new $oe(this._getNow(),n)),this._trimBufferThenGetEvents()),super.next(n)}_subscribe(n){const e=this._infiniteTimeWindow,i=e?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,s=i.length;let c;if(this.closed)throw new Ce;if(this.isStopped||this.hasError?c=Xe.EMPTY:(this.observers.push(n),c=new Ye(this,n)),r&&n.add(n=new Ug(n,r)),e)for(let h=0;he&&(c=Math.max(c,s-e)),c>0&&r.splice(0,c),r}}class $oe{constructor(n,e){this.time=n,this.value=e}}class joe extends lt{constructor(){super(...arguments),this.value=null,this.hasNext=!1,this.hasCompleted=!1}_subscribe(n){return this.hasError?(n.error(this.thrownError),Xe.EMPTY):this.hasCompleted&&this.hasNext?(n.next(this.value),n.complete(),Xe.EMPTY):super._subscribe(n)}next(n){this.hasCompleted||(this.value=n,this.hasNext=!0)}error(n){this.hasCompleted||super.error(n)}complete(){this.hasCompleted=!0,this.hasNext&&super.next(this.value),super.complete()}}class hz{constructor(){}loadScript(n,e,i,r=null){if("undefined"!=typeof document&&!document.getElementById(n)){let s=document.createElement("script");s.async=!0,s.src=e,s.onload=i,r||(r=document.head),r.appendChild(s)}}}class $g{}let jg=(()=>{class t extends hz{constructor(e,i={scope:"email"}){super(),this.clientId=e,this.initOptions=i}initialize(){return new Promise((e,i)=>{try{this.loadScript(t.PROVIDER_ID,"https://apis.google.com/js/platform.js",()=>{gapi.load("auth2",()=>{this.auth2=gapi.auth2.init(Object.assign(Object.assign({},this.initOptions),{client_id:this.clientId})),this.auth2.then(()=>{e()}).catch(r=>{i(r)})})})}catch(r){i(r)}})}getLoginStatus(e){const i=Object.assign(Object.assign({},this.initOptions),e);return new Promise((r,s)=>{if(this.auth2.isSignedIn.get()){let c=new $g;const h=this.auth2.currentUser.get().getBasicProfile(),g=this.auth2.currentUser.get().getAuthResponse(!0);c.id=h.getId(),c.name=h.getName(),c.email=h.getEmail(),c.photoUrl=h.getImageUrl(),c.firstName=h.getGivenName(),c.lastName=h.getFamilyName(),c.response=g;const x=S=>{c.authToken=S.access_token,c.idToken=S.id_token,r(c)};i.refreshToken?this.auth2.currentUser.get().reloadAuthResponse().then(x):x(this.auth2.currentUser.get().getAuthResponse(!0))}else s(`No user is currently logged in with ${t.PROVIDER_ID}`)})}signIn(e){const i=Object.assign(Object.assign({},this.initOptions),e);return new Promise((r,s)=>{(i&&i.offline_access?this.auth2.grantOfflineAccess(e):this.auth2.signIn(e)).then(g=>{let x=new $g;if(g&&g.code)x.authorizationCode=g.code;else{let S=this.auth2.currentUser.get().getBasicProfile(),E=this.auth2.currentUser.get().getAuthResponse(!0),A=E.access_token,F=E.id_token;x.id=S.getId(),x.name=S.getName(),x.email=S.getEmail(),x.photoUrl=S.getImageUrl(),x.firstName=S.getGivenName(),x.lastName=S.getFamilyName(),x.authToken=A,x.idToken=F,x.response=E}r(x)},g=>{s(g)}).catch(g=>{s(g)})})}signOut(e){return new Promise((i,r)=>{let s;s=e?this.auth2.disconnect():this.auth2.signOut(),s.then(c=>{c?r(c):i()}).catch(c=>{r(c)})})}}return t.PROVIDER_ID="GOOGLE",t})(),Gg=(()=>{class t{constructor(e){this.providers=new Map,this.autoLogin=!1,this._user=null,this._authState=new Uoe(1),this.initialized=!1,this._initState=new joe,e instanceof Promise?e.then(i=>{this.initialize(i)}):this.initialize(e)}get authState(){return this._authState.asObservable()}get initState(){return this._initState.asObservable()}initialize(e){this.autoLogin=void 0!==e.autoLogin&&e.autoLogin;const{onError:i=console.error}=e;e.providers.forEach(r=>{this.providers.set(r.id,r.provider)}),Promise.all(Array.from(this.providers.values()).map(r=>r.initialize())).then(()=>{if(this.autoLogin){const r=[];let s=!1;this.providers.forEach((c,h)=>{let g=c.getLoginStatus();r.push(g),g.then(x=>{x.provider=h,this._user=x,this._authState.next(x),s=!0}).catch(console.debug)}),Promise.all(r).catch(()=>{s||(this._user=null,this._authState.next(null))})}}).catch(r=>{i(r)}).finally(()=>{this.initialized=!0,this._initState.next(this.initialized),this._initState.complete()})}refreshAuthToken(e){return new Promise((i,r)=>{if(this.initialized)if(e!==jg.PROVIDER_ID)r(t.ERR_NOT_SUPPORTED_FOR_REFRESH_TOKEN);else{const s=this.providers.get(e);s?s.getLoginStatus({refreshToken:!0}).then(c=>{c.provider=e,this._user=c,this._authState.next(c),i()}).catch(c=>{r(c)}):r(t.ERR_LOGIN_PROVIDER_NOT_FOUND)}else r(t.ERR_NOT_INITIALIZED)})}signIn(e,i){return new Promise((r,s)=>{if(this.initialized){let c=this.providers.get(e);c?c.signIn(i).then(h=>{h.provider=e,r(h),this._user=h,this._authState.next(h)}).catch(h=>{s(h)}):s(t.ERR_LOGIN_PROVIDER_NOT_FOUND)}else s(t.ERR_NOT_INITIALIZED)})}signOut(e=!1){return new Promise((i,r)=>{if(this.initialized)if(this._user){let c=this.providers.get(this._user.provider);c?c.signOut(e).then(()=>{i(),this._user=null,this._authState.next(null)}).catch(h=>{r(h)}):r(t.ERR_LOGIN_PROVIDER_NOT_FOUND)}else r(t.ERR_NOT_LOGGED_IN);else r(t.ERR_NOT_INITIALIZED)})}}return t.ERR_LOGIN_PROVIDER_NOT_FOUND="Login provider not found",t.ERR_NOT_LOGGED_IN="Not logged in",t.ERR_NOT_INITIALIZED="Login providers not ready yet. Are there errors on your console?",t.ERR_NOT_SUPPORTED_FOR_REFRESH_TOKEN="Chosen login provider is not supported for refreshing a token",t.\u0275fac=function(e){return new(e||t)(Mt("SocialAuthServiceConfig"))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),Goe=(()=>{class t{constructor(e){if(e)throw new Error("SocialLoginModule is already loaded. Import it in the AppModule only")}static initialize(e){return{ngModule:t,providers:[Gg,{provide:"SocialAuthServiceConfig",useValue:e}]}}}return t.\u0275fac=function(e){return new(e||t)(Mt(t,12))},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({providers:[Gg],imports:[[S3]]}),t})(),zx=(()=>{class t extends hz{constructor(e,i={}){super(),this.clientId=e,this.requestOptions={scope:"email,public_profile",locale:"en_US",fields:"name,email,picture,first_name,last_name",version:"v10.0"},this.requestOptions=Object.assign(Object.assign({},this.requestOptions),i)}initialize(){return new Promise((e,i)=>{try{this.loadScript(t.PROVIDER_ID,`//connect.facebook.net/${this.requestOptions.locale}/sdk.js`,()=>{FB.init({appId:this.clientId,autoLogAppEvents:!0,cookie:!0,xfbml:!0,version:this.requestOptions.version}),e()})}catch(r){i(r)}})}getLoginStatus(){return new Promise((e,i)=>{FB.getLoginStatus(r=>{if("connected"===r.status){let s=r.authResponse;FB.api(`/me?fields=${this.requestOptions.fields}`,c=>{let h=new $g;h.id=c.id,h.name=c.name,h.email=c.email,h.photoUrl="https://graph.facebook.com/"+c.id+"/picture?type=normal&access_token="+s.accessToken,h.firstName=c.first_name,h.lastName=c.last_name,h.authToken=s.accessToken,h.response=c,e(h)})}else i(`No user is currently logged in with ${t.PROVIDER_ID}`)})})}signIn(e){const i=Object.assign(Object.assign({},this.requestOptions),e);return new Promise((r,s)=>{FB.login(c=>{if(c.authResponse){let h=c.authResponse;FB.api(`/me?fields=${i.fields}`,g=>{let x=new $g;x.id=g.id,x.name=g.name,x.email=g.email,x.photoUrl="https://graph.facebook.com/"+g.id+"/picture?type=normal",x.firstName=g.first_name,x.lastName=g.last_name,x.authToken=h.accessToken,x.response=g,r(x)})}else s("User cancelled login or did not fully authorize.")},i)})}signOut(){return new Promise((e,i)=>{FB.logout(r=>{e()})})}}return t.PROVIDER_ID="FACEBOOK",t})();class Px{attach(n){return this._attachedHost=n,n.attach(this)}detach(){let n=this._attachedHost;null!=n&&(this._attachedHost=null,n.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(n){this._attachedHost=n}}class dz extends Px{constructor(n,e,i,r){super(),this.component=n,this.viewContainerRef=e,this.injector=i,this.componentFactoryResolver=r}}class fz extends Px{constructor(n,e,i){super(),this.templateRef=n,this.viewContainerRef=e,this.context=i}get origin(){return this.templateRef.elementRef}attach(n,e=this.context){return this.context=e,super.attach(n)}detach(){return this.context=void 0,super.detach()}}class Woe extends Px{constructor(n){super(),this.element=n instanceof rn?n.nativeElement:n}}class qoe extends class{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(n){return n instanceof dz?(this._attachedPortal=n,this.attachComponentPortal(n)):n instanceof fz?(this._attachedPortal=n,this.attachTemplatePortal(n)):this.attachDomPortal&&n instanceof Woe?(this._attachedPortal=n,this.attachDomPortal(n)):void 0}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(n){this._disposeFn=n}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}{constructor(n,e,i,r,s){super(),this.outletElement=n,this._componentFactoryResolver=e,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=c=>{const h=c.element,g=this._document.createComment("dom-portal");h.parentNode.insertBefore(g,h),this.outletElement.appendChild(h),this._attachedPortal=c,super.setDisposeFn(()=>{g.parentNode&&g.parentNode.replaceChild(h,g)})},this._document=s}attachComponentPortal(n){const i=(n.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(n.component);let r;return n.viewContainerRef?(r=n.viewContainerRef.createComponent(i,n.viewContainerRef.length,n.injector||n.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(n.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=n,r}attachTemplatePortal(n){let e=n.viewContainerRef,i=e.createEmbeddedView(n.templateRef,n.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=e.indexOf(i);-1!==r&&e.remove(r)}),this._attachedPortal=n,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(n){return n.hostView.rootNodes[0]}}function Ja(t,n,e,i){return new(e||(e=Promise))(function(s,c){function h(S){try{x(i.next(S))}catch(E){c(E)}}function g(S){try{x(i.throw(S))}catch(E){c(E)}}function x(S){S.done?s(S.value):function(s){return s instanceof e?s:new e(function(c){c(s)})}(S.value).then(h,g)}x((i=i.apply(t,n||[])).next())})}const qg=new H4(cz);class Qoe{constructor(n,e){this.dueTime=n,this.scheduler=e}call(n,e){return e.subscribe(new Joe(n,this.dueTime,this.scheduler))}}class Joe extends at{constructor(n,e,i){super(n),this.dueTime=e,this.scheduler=i,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(n){this.clearDebounce(),this.lastValue=n,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(eae,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:n}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(n)}}clearDebounce(){const n=this.debouncedSubscription;null!==n&&(this.remove(n),n.unsubscribe(),this.debouncedSubscription=null)}}function eae(t){t.debouncedNext()}function tae(){}function Fx(t){return null==t?tae:function(){return this.querySelector(t)}}function _z(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function iae(){return[]}function xz(t){return null==t?iae:function(){return this.querySelectorAll(t)}}function bz(t){return function(){return this.matches(t)}}function wz(t){return function(n){return n.matches(t)}}var oae=Array.prototype.find;function lae(){return this.firstElementChild}var uae=Array.prototype.filter;function hae(){return this.children}function Mz(t){return new Array(t.length)}function Xg(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function gae(t){return function(){return t}}function Cae(t,n,e,i,r,s){for(var h,c=0,g=n.length,x=s.length;cn?1:t>=n?0:NaN}Xg.prototype={constructor:Xg,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var Ox="http://www.w3.org/1999/xhtml";const Sz={svg:"http://www.w3.org/2000/svg",xhtml:Ox,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zg(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Sz.hasOwnProperty(n)?{space:Sz[n],local:t}:t}function zae(t){return function(){this.removeAttribute(t)}}function Pae(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Vae(t,n){return function(){this.setAttribute(t,n)}}function Fae(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Oae(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function Nae(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function Tz(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Hae(t){return function(){this.style.removeProperty(t)}}function Bae(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Uae(t,n,e){return function(){var i=n.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,e)}}function $6(t,n){return t.style.getPropertyValue(n)||Tz(t).getComputedStyle(t,null).getPropertyValue(n)}function jae(t){return function(){delete this[t]}}function Gae(t,n){return function(){this[t]=n}}function Wae(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Lz(t){return t.trim().split(/^|\s+/)}function Nx(t){return t.classList||new Ez(t)}function Ez(t){this._node=t,this._names=Lz(t.getAttribute("class")||"")}function Dz(t,n){for(var e=Nx(t),i=-1,r=n.length;++i=0&&(e=n.slice(i+1),n=n.slice(0,i)),{type:n,name:e}})}function w1e(t){return function(){var n=this.__on;if(n){for(var s,e=0,i=-1,r=n.length;e=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var zz=[null];function w2(t,n){this._groups=t,this._parents=n}function Pz(){return new w2([[document.documentElement]],zz)}w2.prototype=Pz.prototype={constructor:w2,select:function(t){"function"!=typeof t&&(t=Fx(t));for(var n=this._groups,e=n.length,i=new Array(e),r=0;r=Ze&&(Ze=Se+1);!(Ut=W[Ze])&&++Ze=0;)(c=i[r])&&(s&&4^c.compareDocumentPosition(s)&&s.parentNode.insertBefore(c,s),s=c);return this},sort:function(t){function n(E,A){return E&&A?t(E.__data__,A.__data__):!E-!A}t||(t=Tae);for(var e=this._groups,i=e.length,r=new Array(i),s=0;s1?this.each((null==n?Hae:"function"==typeof n?Uae:Bae)(t,n,null==e?"":e)):$6(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?jae:"function"==typeof n?Wae:Gae)(t,n)):this.node()[t]},classed:function(t,n){var e=Lz(t+"");if(arguments.length<2){for(var i=Nx(this.node()),r=-1,s=e.length;++r{}};function Vz(){for(var i,t=0,n=arguments.length,e={};t=0&&(i=e.slice(r+1),e=e.slice(0,r)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:i}})}function z1e(t,n){for(var r,e=0,i=t.length;e0)for(var r,s,e=new Array(r),i=0;i>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?Qg(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?Qg(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=O1e.exec(t))?new tl(n[1],n[2],n[3],1):(n=N1e.exec(t))?new tl(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=R1e.exec(t))?Qg(n[1],n[2],n[3],n[4]):(n=H1e.exec(t))?Qg(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=B1e.exec(t))?Gz(n[1],n[2]/100,n[3]/100,1):(n=U1e.exec(t))?Gz(n[1],n[2]/100,n[3]/100,n[4]):Rz.hasOwnProperty(t)?Uz(Rz[t]):"transparent"===t?new tl(NaN,NaN,NaN,0):null}function Uz(t){return new tl(t>>16&255,t>>8&255,255&t,1)}function Qg(t,n,e,i){return i<=0&&(t=n=e=NaN),new tl(t,n,e,i)}function j1e(t){return t instanceof I8||(t=F0(t)),t?new tl((t=t.rgb()).r,t.g,t.b,t.opacity):new tl}function V8(t,n,e,i){return 1===arguments.length?j1e(t):new tl(t,n,e,null==i?1:i)}function tl(t,n,e,i){this.r=+t,this.g=+n,this.b=+e,this.opacity=+i}function $z(){return"#"+Bx(this.r)+Bx(this.g)+Bx(this.b)}function jz(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Bx(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Gz(t,n,e,i){return i<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new P3(t,n,e,i)}function Wz(t){if(t instanceof P3)return new P3(t.h,t.s,t.l,t.opacity);if(t instanceof I8||(t=F0(t)),!t)return new P3;if(t instanceof P3)return t;var n=(t=t.rgb()).r/255,e=t.g/255,i=t.b/255,r=Math.min(n,e,i),s=Math.max(n,e,i),c=NaN,h=s-r,g=(s+r)/2;return h?(c=n===s?(e-i)/h+6*(e0&&g<1?0:c,new P3(c,h,g,t.opacity)}function P3(t,n,e,i){this.h=+t,this.s=+n,this.l=+e,this.opacity=+i}function Ux(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function qz(t,n,e,i,r){var s=t*t,c=s*t;return((1-3*t+3*s-c)*n+(4-6*s+3*c)*e+(1+3*t+3*s-3*c)*i+c*r)/6}Hx(I8,F0,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Hz,formatHex:Hz,formatHsl:function(){return Wz(this).formatHsl()},formatRgb:Bz,toString:Bz}),Hx(tl,V8,Nz(I8,{brighter:function(t){return t=null==t?Kg:Math.pow(Kg,t),new tl(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new tl(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){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:$z,formatHex:$z,formatRgb:jz,toString:jz})),Hx(P3,function(t,n,e,i){return 1===arguments.length?Wz(t):new P3(t,n,e,null==i?1:i)},Nz(I8,{brighter:function(t){return t=null==t?Kg:Math.pow(Kg,t),new P3(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new P3(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*n,r=2*e-i;return new tl(Ux(t>=240?t-240:t+120,r,i),Ux(t,r,i),Ux(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));const $x=t=>()=>t;function Zz(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):$x(isNaN(t)?n:t)}const Jg=function t(n){var e=function(t){return 1==(t=+t)?Zz:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(i){return Math.pow(t+i*n,e)}}(n,e,t):$x(isNaN(n)?e:n)}}(n);function i(r,s){var c=e((r=V8(r)).r,(s=V8(s)).r),h=e(r.g,s.g),g=e(r.b,s.b),x=Zz(r.opacity,s.opacity);return function(S){return r.r=c(S),r.g=h(S),r.b=g(S),r.opacity=x(S),r+""}}return i.gamma=t,i}(1);function Yz(t){return function(n){var c,h,e=n.length,i=new Array(e),r=new Array(e),s=new Array(e);for(c=0;c=1?(e=1,n-1):Math.floor(e*n),r=t[i],s=t[i+1];return qz((e-i/n)*n,i>0?t[i-1]:2*r-s,r,s,ie&&(s=n.slice(e,s),h[c]?h[c]+=s:h[++c]=s),(i=i[0])===(r=r[0])?h[c]?h[c]+=r:h[++c]=r:(h[++c]=null,g.push({i:c,x:Dc(i,r)})),e=Gx.lastIndex;return e=0&&t._call.call(null,n),t=t._next;--G6}()}finally{G6=0,function(){for(var t,e,n=e9,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:e9=e);N8=t,qx(i)}(),O0=0}}function s2e(){var t=R8.now(),n=t-t9;n>1e3&&(n9-=n,t9=t)}function qx(t){G6||(F8&&(F8=clearTimeout(F8)),t-O0>24?(t<1/0&&(F8=setTimeout(iP,t-R8.now()-n9)),O8&&(O8=clearInterval(O8))):(O8||(t9=R8.now(),O8=setInterval(s2e,1e3)),G6=1,tP(iP)))}function rP(t,n,e){var i=new i9;return i.restart(r=>{i.stop(),t(r+n)},n=null==n?0:+n,e),i}i9.prototype=nP.prototype={constructor:i9,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Wx():+e)+(null==n?0:+n),!this._next&&N8!==this&&(N8?N8._next=this:e9=this,N8=this),this._call=t,this._time=e,qx()},stop:function(){this._call&&(this._call=null,this._time=1/0,qx())}};var a2e=Oz("start","end","cancel","interrupt"),l2e=[];function o9(t,n,e,i,r,s){var c=t.__transition;if(c){if(e in c)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function c(x){var S,E,A,F;if(1!==e.state)return g();for(S in i)if((F=i[S]).name===e.name){if(3===F.state)return rP(c);4===F.state?(F.state=6,F.timer.stop(),F.on.call("interrupt",t,t.__data__,F.index,F.group),delete i[S]):+S0)throw new Error("too late; already scheduled");return e}function V3(t,n){var e=Ac(t,n);if(e.state>3)throw new Error("too late; already running");return e}function Ac(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var a9,lP=180/Math.PI,Qx={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function cP(t,n,e,i,r,s){var c,h,g;return(c=Math.sqrt(t*t+n*n))&&(t/=c,n/=c),(g=t*e+n*i)&&(e-=t*g,i-=n*g),(h=Math.sqrt(e*e+i*i))&&(e/=h,i/=h,g/=h),t*i180?S+=360:S-x>180&&(x+=360),A.push({i:E.push(r(E)+"rotate(",null,i)-2,x:Dc(x,S)})):S&&E.push(r(E)+"rotate("+S+i)}(x.rotate,S.rotate,E,A),function(x,S,E,A){x!==S?A.push({i:E.push(r(E)+"skewX(",null,i)-2,x:Dc(x,S)}):S&&E.push(r(E)+"skewX("+S+i)}(x.skewX,S.skewX,E,A),function(x,S,E,A,F,j){if(x!==E||S!==A){var ie=F.push(r(F)+"scale(",null,",",null,")");j.push({i:ie-4,x:Dc(x,E)},{i:ie-2,x:Dc(S,A)})}else(1!==E||1!==A)&&F.push(r(F)+"scale("+E+","+A+")")}(x.scaleX,x.scaleY,S.scaleX,S.scaleY,E,A),x=S=null,function(F){for(var W,j=-1,ie=A.length;++j=0&&(n=n.slice(0,e)),!n||"start"===n})}(n)?Yx:V3;return function(){var c=s(this,t),h=c.on;h!==i&&(r=(i=h).copy()).on(n,e),c.on=r}}var Z2e=k8.prototype.constructor;function dP(t){return function(){this.style.removeProperty(t)}}function nle(t,n,e){return function(i){this.style.setProperty(t,n.call(this,i),e)}}function ile(t,n,e){var i,r;function s(){var c=n.apply(this,arguments);return c!==r&&(i=(r=c)&&nle(t,c,e)),i}return s._value=n,s}function lle(t){return function(n){this.textContent=t.call(this,n)}}function cle(t){var n,e;function i(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&lle(r)),n}return i._value=t,i}var fle=0;function B4(t,n,e,i){this._groups=t,this._parents=n,this._name=e,this._id=i}function fP(){return++fle}var N0=k8.prototype;B4.prototype=function(t){return k8().transition(t)}.prototype={constructor:B4,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=Fx(t));for(var i=this._groups,r=i.length,s=new Array(r),c=0;c2&&i.state<5,i.state=6,i.timer.stop(),i.on.call(r?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete e[c]):s=!1;s&&delete t.__transition}}(this,t)})},k8.prototype.transition=function(t){var n,e;t instanceof B4?(n=t._id,t=t._name):(n=fP(),(e=gle).time=Wx(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,s=0;sn?1:t>=n?0:NaN}function ob(t){let n=t,e=t;function i(c,h,g,x){for(null==g&&(g=0),null==x&&(x=c.length);g>>1;e(c[S],h)<0?g=S+1:x=S}return g}return 1===t.length&&(n=(c,h)=>t(c)-h,e=function(t){return(n,e)=>u9(t(n),e)}(t)),{left:i,center:function(c,h,g,x){null==g&&(g=0),null==x&&(x=c.length);const S=i(c,h,g,x-1);return S>g&&n(c[S-1],h)>-n(c[S],h)?S-1:S},right:function(c,h,g,x){for(null==g&&(g=0),null==x&&(x=c.length);g>>1;e(c[S],h)>0?x=S:g=S+1}return g}}}["w","e"].map(H8),["n","s"].map(H8),["n","w","e","s","nw","ne","sw","se"].map(H8);var ab=Math.sqrt(50),lb=Math.sqrt(10),cb=Math.sqrt(2);function yP(t,n,e){var i=(n-t)/Math.max(0,e),r=Math.floor(Math.log(i)/Math.LN10),s=i/Math.pow(10,r);return r>=0?(s>=ab?10:s>=lb?5:s>=cb?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(s>=ab?10:s>=lb?5:s>=cb?2:1)}function ub(t,n,e){var i=Math.abs(n-t)/Math.max(0,e),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/r;return s>=ab?r*=10:s>=lb?r*=5:s>=cb&&(r*=2),n0))return g;do{g.push(x=new Date(+s)),n(s,h),t(s)}while(x=c)for(;t(c),!s(c);)c.setTime(c-1)},function(c,h){if(c>=c)if(h<0)for(;++h<=0;)for(;n(c,-1),!s(c););else for(;--h>=0;)for(;n(c,1),!s(c););})},e&&(r.count=function(s,c){return fb.setTime(+s),pb.setTime(+c),t(fb),t(pb),Math.floor(e(fb,pb))},r.every=function(s){return s=Math.floor(s),isFinite(s)&&s>0?s>1?r.filter(i?function(c){return i(c)%s==0}:function(c){return r.count(0,c)%s==0}):r:null}),r}var h9=Da(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});h9.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Da(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):h9:null};const Ile=h9;const B8=Da(function(t){t.setTime(t-t.getMilliseconds())},function(t,n){t.setTime(+t+n*$4)},function(t,n){return(n-t)/$4},function(t){return t.getUTCSeconds()});const wP=Da(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*$4)},function(t,n){t.setTime(+t+n*jl)},function(t,n){return(n-t)/jl},function(t){return t.getMinutes()});const SP=Da(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*$4-t.getMinutes()*jl)},function(t,n){t.setTime(+t+n*j4)},function(t,n){return(n-t)/j4},function(t){return t.getHours()});const d9=Da(t=>t.setHours(0,0,0,0),(t,n)=>t.setDate(t.getDate()+n),(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*jl)/R0,t=>t.getDate()-1);function H0(t){return Da(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(n,e){n.setDate(n.getDate()+7*e)},function(n,e){return(e-n-(e.getTimezoneOffset()-n.getTimezoneOffset())*jl)/hb})}var f9=H0(0),p9=H0(1),X6=(H0(2),H0(3),H0(4));const EP=(H0(5),H0(6),Da(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}));var mb=Da(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});mb.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Da(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};const B0=mb;const Ole=Da(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*jl)},function(t,n){return(n-t)/jl},function(t){return t.getUTCMinutes()});const Nle=Da(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+n*j4)},function(t,n){return(n-t)/j4},function(t){return t.getUTCHours()});const gb=Da(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/R0},function(t){return t.getUTCDate()-1});function U0(t){return Da(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCDate(n.getUTCDate()+7*e)},function(n,e){return(e-n)/hb})}var Cb=U0(0),m9=U0(1),Z6=(U0(2),U0(3),U0(4));const $le=(U0(5),U0(6),Da(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}));var vb=Da(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});vb.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Da(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};const Y6=vb;function zP(t,n,e,i,r,s){const c=[[B8,1,$4],[B8,5,5e3],[B8,15,15e3],[B8,30,3e4],[s,1,jl],[s,5,5*jl],[s,15,15*jl],[s,30,30*jl],[r,1,j4],[r,3,3*j4],[r,6,6*j4],[r,12,12*j4],[i,1,R0],[i,2,2*R0],[e,1,hb],[n,1,_P],[n,3,3*_P],[t,1,db]];function g(x,S,E){const A=Math.abs(S-x)/E,F=ob(([,,W])=>W).right(c,A);if(F===c.length)return t.every(ub(x/db,S/db,E));if(0===F)return Ile.every(Math.max(ub(x,S,E),1));const[j,ie]=c[A/c[F-1][2][n.toLowerCase(),e]))}function Yle(t,n,e){var i=Aa.exec(n.slice(e,e+1));return i?(t.w=+i[0],e+i[0].length):-1}function Kle(t,n,e){var i=Aa.exec(n.slice(e,e+1));return i?(t.u=+i[0],e+i[0].length):-1}function Qle(t,n,e){var i=Aa.exec(n.slice(e,e+2));return i?(t.U=+i[0],e+i[0].length):-1}function Jle(t,n,e){var i=Aa.exec(n.slice(e,e+2));return i?(t.V=+i[0],e+i[0].length):-1}function ece(t,n,e){var i=Aa.exec(n.slice(e,e+2));return i?(t.W=+i[0],e+i[0].length):-1}function VP(t,n,e){var i=Aa.exec(n.slice(e,e+4));return i?(t.y=+i[0],e+i[0].length):-1}function FP(t,n,e){var i=Aa.exec(n.slice(e,e+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),e+i[0].length):-1}function tce(t,n,e){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),e+i[0].length):-1}function nce(t,n,e){var i=Aa.exec(n.slice(e,e+1));return i?(t.q=3*i[0]-3,e+i[0].length):-1}function ice(t,n,e){var i=Aa.exec(n.slice(e,e+2));return i?(t.m=i[0]-1,e+i[0].length):-1}function OP(t,n,e){var i=Aa.exec(n.slice(e,e+2));return i?(t.d=+i[0],e+i[0].length):-1}function rce(t,n,e){var i=Aa.exec(n.slice(e,e+3));return i?(t.m=0,t.d=+i[0],e+i[0].length):-1}function NP(t,n,e){var i=Aa.exec(n.slice(e,e+2));return i?(t.H=+i[0],e+i[0].length):-1}function sce(t,n,e){var i=Aa.exec(n.slice(e,e+2));return i?(t.M=+i[0],e+i[0].length):-1}function oce(t,n,e){var i=Aa.exec(n.slice(e,e+2));return i?(t.S=+i[0],e+i[0].length):-1}function ace(t,n,e){var i=Aa.exec(n.slice(e,e+3));return i?(t.L=+i[0],e+i[0].length):-1}function lce(t,n,e){var i=Aa.exec(n.slice(e,e+6));return i?(t.L=Math.floor(i[0]/1e3),e+i[0].length):-1}function cce(t,n,e){var i=qle.exec(n.slice(e,e+1));return i?e+i[0].length:-1}function uce(t,n,e){var i=Aa.exec(n.slice(e));return i?(t.Q=+i[0],e+i[0].length):-1}function hce(t,n,e){var i=Aa.exec(n.slice(e));return i?(t.s=+i[0],e+i[0].length):-1}function RP(t,n){return Wr(t.getDate(),n,2)}function dce(t,n){return Wr(t.getHours(),n,2)}function fce(t,n){return Wr(t.getHours()%12||12,n,2)}function pce(t,n){return Wr(1+d9.count(B0(t),t),n,3)}function HP(t,n){return Wr(t.getMilliseconds(),n,3)}function mce(t,n){return HP(t,n)+"000"}function gce(t,n){return Wr(t.getMonth()+1,n,2)}function Cce(t,n){return Wr(t.getMinutes(),n,2)}function vce(t,n){return Wr(t.getSeconds(),n,2)}function yce(t){var n=t.getDay();return 0===n?7:n}function _ce(t,n){return Wr(f9.count(B0(t)-1,t),n,2)}function BP(t){var n=t.getDay();return n>=4||0===n?X6(t):X6.ceil(t)}function xce(t,n){return t=BP(t),Wr(X6.count(B0(t),t)+(4===B0(t).getDay()),n,2)}function bce(t){return t.getDay()}function wce(t,n){return Wr(p9.count(B0(t)-1,t),n,2)}function Mce(t,n){return Wr(t.getFullYear()%100,n,2)}function Sce(t,n){return Wr((t=BP(t)).getFullYear()%100,n,2)}function Tce(t,n){return Wr(t.getFullYear()%1e4,n,4)}function Lce(t,n){var e=t.getDay();return Wr((t=e>=4||0===e?X6(t):X6.ceil(t)).getFullYear()%1e4,n,4)}function Ece(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Wr(n/60|0,"0",2)+Wr(n%60,"0",2)}function UP(t,n){return Wr(t.getUTCDate(),n,2)}function Dce(t,n){return Wr(t.getUTCHours(),n,2)}function Ace(t,n){return Wr(t.getUTCHours()%12||12,n,2)}function kce(t,n){return Wr(1+gb.count(Y6(t),t),n,3)}function $P(t,n){return Wr(t.getUTCMilliseconds(),n,3)}function Ice(t,n){return $P(t,n)+"000"}function zce(t,n){return Wr(t.getUTCMonth()+1,n,2)}function Pce(t,n){return Wr(t.getUTCMinutes(),n,2)}function Vce(t,n){return Wr(t.getUTCSeconds(),n,2)}function Fce(t){var n=t.getUTCDay();return 0===n?7:n}function Oce(t,n){return Wr(Cb.count(Y6(t)-1,t),n,2)}function jP(t){var n=t.getUTCDay();return n>=4||0===n?Z6(t):Z6.ceil(t)}function Nce(t,n){return t=jP(t),Wr(Z6.count(Y6(t),t)+(4===Y6(t).getUTCDay()),n,2)}function Rce(t){return t.getUTCDay()}function Hce(t,n){return Wr(m9.count(Y6(t)-1,t),n,2)}function Bce(t,n){return Wr(t.getUTCFullYear()%100,n,2)}function Uce(t,n){return Wr((t=jP(t)).getUTCFullYear()%100,n,2)}function $ce(t,n){return Wr(t.getUTCFullYear()%1e4,n,4)}function jce(t,n){var e=t.getUTCDay();return Wr((t=e>=4||0===e?Z6(t):Z6.ceil(t)).getUTCFullYear()%1e4,n,4)}function Gce(){return"+0000"}function GP(){return"%"}function WP(t){return+t}function qP(t){return Math.floor(+t/1e3)}function ZP(t){return null===t?NaN:+t}(function(t){var n=t.dateTime,e=t.date,i=t.time,r=t.periods,s=t.days,c=t.shortDays,h=t.months,g=t.shortMonths,x=$8(r),S=j8(r),E=$8(s),A=j8(s),F=$8(c),j=j8(c),ie=$8(h),W=j8(h),Ee=$8(g),Se=j8(g),Ze={a:function(On){return c[On.getDay()]},A:function(On){return s[On.getDay()]},b:function(On){return g[On.getMonth()]},B:function(On){return h[On.getMonth()]},c:null,d:RP,e:RP,f:mce,g:Sce,G:Lce,H:dce,I:fce,j:pce,L:HP,m:gce,M:Cce,p:function(On){return r[+(On.getHours()>=12)]},q:function(On){return 1+~~(On.getMonth()/3)},Q:WP,s:qP,S:vce,u:yce,U:_ce,V:xce,w:bce,W:wce,x:null,X:null,y:Mce,Y:Tce,Z:Ece,"%":GP},xt={a:function(On){return c[On.getUTCDay()]},A:function(On){return s[On.getUTCDay()]},b:function(On){return g[On.getUTCMonth()]},B:function(On){return h[On.getUTCMonth()]},c:null,d:UP,e:UP,f:Ice,g:Uce,G:jce,H:Dce,I:Ace,j:kce,L:$P,m:zce,M:Pce,p:function(On){return r[+(On.getUTCHours()>=12)]},q:function(On){return 1+~~(On.getUTCMonth()/3)},Q:WP,s:qP,S:Vce,u:Fce,U:Oce,V:Nce,w:Rce,W:Hce,x:null,X:null,y:Bce,Y:$ce,Z:Gce,"%":GP},Ut={a:function(On,Ii,Ar){var _n=F.exec(Ii.slice(Ar));return _n?(On.w=j.get(_n[0].toLowerCase()),Ar+_n[0].length):-1},A:function(On,Ii,Ar){var _n=E.exec(Ii.slice(Ar));return _n?(On.w=A.get(_n[0].toLowerCase()),Ar+_n[0].length):-1},b:function(On,Ii,Ar){var _n=Ee.exec(Ii.slice(Ar));return _n?(On.m=Se.get(_n[0].toLowerCase()),Ar+_n[0].length):-1},B:function(On,Ii,Ar){var _n=ie.exec(Ii.slice(Ar));return _n?(On.m=W.get(_n[0].toLowerCase()),Ar+_n[0].length):-1},c:function(On,Ii,Ar){return hi(On,n,Ii,Ar)},d:OP,e:OP,f:lce,g:FP,G:VP,H:NP,I:NP,j:rce,L:ace,m:ice,M:sce,p:function(On,Ii,Ar){var _n=x.exec(Ii.slice(Ar));return _n?(On.p=S.get(_n[0].toLowerCase()),Ar+_n[0].length):-1},q:nce,Q:uce,s:hce,S:oce,u:Kle,U:Qle,V:Jle,w:Yle,W:ece,x:function(On,Ii,Ar){return hi(On,e,Ii,Ar)},X:function(On,Ii,Ar){return hi(On,i,Ii,Ar)},y:FP,Y:VP,Z:tce,"%":cce};function on(On,Ii){return function(Ar){var Y1,Zi,wo,_n=[],bo=-1,ss=0,Z1=On.length;for(Ar instanceof Date||(Ar=new Date(+Ar));++bo53)return null;"w"in _n||(_n.w=1),"Z"in _n?(Z1=(ss=_b(U8(_n.y,0,1))).getUTCDay(),ss=Z1>4||0===Z1?m9.ceil(ss):m9(ss),ss=gb.offset(ss,7*(_n.V-1)),_n.y=ss.getUTCFullYear(),_n.m=ss.getUTCMonth(),_n.d=ss.getUTCDate()+(_n.w+6)%7):(Z1=(ss=yb(U8(_n.y,0,1))).getDay(),ss=Z1>4||0===Z1?p9.ceil(ss):p9(ss),ss=d9.offset(ss,7*(_n.V-1)),_n.y=ss.getFullYear(),_n.m=ss.getMonth(),_n.d=ss.getDate()+(_n.w+6)%7)}else("W"in _n||"U"in _n)&&("w"in _n||(_n.w="u"in _n?_n.u%7:"W"in _n?1:0),Z1="Z"in _n?_b(U8(_n.y,0,1)).getUTCDay():yb(U8(_n.y,0,1)).getDay(),_n.m=0,_n.d="W"in _n?(_n.w+6)%7+7*_n.W-(Z1+5)%7:_n.w+7*_n.U-(Z1+6)%7);return"Z"in _n?(_n.H+=_n.Z/100|0,_n.M+=_n.Z%100,_b(_n)):yb(_n)}}function hi(On,Ii,Ar,_n){for(var Y1,Zi,bo=0,ss=Ii.length,Z1=Ar.length;bo=Z1)return-1;if(37===(Y1=Ii.charCodeAt(bo++))){if(Y1=Ii.charAt(bo++),!(Zi=Ut[Y1 in PP?Ii.charAt(bo++):Y1])||(_n=Zi(On,Ar,_n))<0)return-1}else if(Y1!=Ar.charCodeAt(_n++))return-1}return _n}Ze.x=on(e,Ze),Ze.X=on(i,Ze),Ze.c=on(n,Ze),xt.x=on(e,xt),xt.X=on(i,xt),xt.c=on(n,xt)})({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"]});const Kce=ob(u9).right,KP=(ob(ZP),Kce);function Qce(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}function e3e(t){return+t}var QP=[0,1];function Q6(t){return t}function xb(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:function(t){return function(){return t}}(isNaN(n)?NaN:.5)}function n3e(t,n,e){var i=t[0],r=t[1],s=n[0],c=n[1];return rn&&(e=t,t=n,n=e),function(i){return Math.max(t,Math.min(n,i))}}(t[0],t[A-1])),h=A>2?i3e:n3e,g=x=null,E}function E(A){return null==A||isNaN(A=+A)?s:(g||(g=h(t.map(i),n,e)))(i(c(A)))}return E.invert=function(A){return c(r((x||(x=h(n,t.map(i),Dc)))(A)))},E.domain=function(A){return arguments.length?(t=Array.from(A,e3e),S()):t.slice()},E.range=function(A){return arguments.length?(n=Array.from(A),S()):n.slice()},E.rangeRound=function(A){return n=Array.from(A),e=Qce,S()},E.clamp=function(A){return arguments.length?(c=!!A||Q6,S()):c!==Q6},E.interpolate=function(A){return arguments.length?(e=A,S()):e},E.unknown=function(A){return arguments.length?(s=A,E):s},function(A,F){return i=A,r=F,S()}}()(Q6,Q6)}function G8(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}var nV,l3e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function g9(t){if(!(n=l3e.exec(t)))throw new Error("invalid format: "+t);var n;return new bb({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function bb(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 C9(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,i=t.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+t.slice(e+1)]}function J6(t){return(t=C9(Math.abs(t)))?t[1]:NaN}function iV(t,n){var e=C9(t,n);if(!e)return t+"";var i=e[0],r=e[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}g9.prototype=bb.prototype,bb.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};const rV={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>iV(100*t,n),r:iV,s:function(t,n){var e=C9(t,n);if(!e)return t+"";var i=e[0],r=e[1],s=r-(nV=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,c=i.length;return s===c?i:s>c?i+new Array(s-c+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+C9(t,Math.max(0,n+s-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function sV(t){return t}var v9,wb,lV,oV=Array.prototype.map,aV=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function _3e(t){var n=t.domain;return t.ticks=function(e){var i=n();return function(t,n,e){var i,s,c,h,r=-1;if(e=+e,(t=+t)==(n=+n)&&e>0)return[t];if((i=n0){let g=Math.round(t/h),x=Math.round(n/h);for(g*hn&&--x,c=new Array(s=x-g+1);++rn&&--x,c=new Array(s=x-g+1);++r0;){if((x=yP(c,h,e))===g)return i[r]=c,i[s]=h,n(i);if(x>0)c=Math.floor(c/x)*x,h=Math.ceil(h/x)*x;else{if(!(x<0))break;c=Math.ceil(c*x)/x,h=Math.floor(h*x)/x}g=x}return t},t}function cs(){var t=eV();return t.copy=function(){return JP(t,cs())},G8.apply(t,arguments),_3e(t)}function cV(t,n,e){t=+t,n=+n,e=(r=arguments.length)<2?(n=t,t=0,1):r<3?1:+e;for(var i=-1,r=0|Math.max(0,Math.ceil((n-t)/e)),s=new Array(r);++i0&&h>0&&(g+h+1>i&&(h=Math.max(1,i-g)),s.push(e.substring(r-=h,r+h)),!((g+=h+1)>i));)h=t[c=(c+1)%t.length];return s.reverse().join(n)}}(oV.call(t.grouping,Number),t.thousands+""),e=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",r=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?sV:function(t){return function(n){return n.replace(/[0-9]/g,function(e){return t[+e]})}}(oV.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",h=void 0===t.minus?"\u2212":t.minus+"",g=void 0===t.nan?"NaN":t.nan+"";function x(E){var A=(E=g9(E)).fill,F=E.align,j=E.sign,ie=E.symbol,W=E.zero,Ee=E.width,Se=E.comma,Ze=E.precision,xt=E.trim,Ut=E.type;"n"===Ut?(Se=!0,Ut="g"):rV[Ut]||(void 0===Ze&&(Ze=12),xt=!0,Ut="g"),(W||"0"===A&&"="===F)&&(W=!0,A="0",F="=");var on="$"===ie?e:"#"===ie&&/[boxX]/.test(Ut)?"0"+Ut.toLowerCase():"",Qn="$"===ie?i:/[%p]/.test(Ut)?c:"",hi=rV[Ut],bi=/[defgprs%]/.test(Ut);function Ti($n){var ar,us,vn,Xn=on,jn=Qn;if("c"===Ut)jn=hi($n)+jn,$n="";else{var An=($n=+$n)<0||1/$n<0;if($n=isNaN($n)?g:hi(Math.abs($n),Ze),xt&&($n=function(t){e:for(var r,n=t.length,e=1,i=-1;e0&&(i=0)}return i>0?t.slice(0,i)+t.slice(r+1):t}($n)),An&&0==+$n&&"+"!==j&&(An=!1),Xn=(An?"("===j?j:h:"-"===j||"("===j?"":j)+Xn,jn=("s"===Ut?aV[8+nV/3]:"")+jn+(An&&"("===j?")":""),bi)for(ar=-1,us=$n.length;++ar(vn=$n.charCodeAt(ar))||vn>57){jn=(46===vn?r+$n.slice(ar+1):$n.slice(ar))+jn,$n=$n.slice(0,ar);break}}Se&&!W&&($n=n($n,1/0));var ni=Xn.length+$n.length+jn.length,Yn=ni>1)+Xn+$n+jn+Yn.slice(ni);break;default:$n=Yn+Xn+$n+jn}return s($n)}return Ze=void 0===Ze?6:/[gprs]/.test(Ut)?Math.max(1,Math.min(21,Ze)):Math.max(0,Math.min(20,Ze)),Ti.toString=function(){return E+""},Ti}return{format:x,formatPrefix:function(E,A){var F=x(((E=g9(E)).type="f",E)),j=3*Math.max(-8,Math.min(8,Math.floor(J6(A)/3))),ie=Math.pow(10,-j),W=aV[8+j/3];return function(Ee){return F(ie*Ee)+W}}}}({thousands:",",grouping:[3],currency:["$",""]}),wb=v9.format,lV=v9.formatPrefix;const uV=Symbol("implicit");function Mb(){var t=new Map,n=[],e=[],i=uV;function r(s){var c=s+"",h=t.get(c);if(!h){if(i!==uV)return i;t.set(c,h=n.push(s))}return e[(h-1)%e.length]}return r.domain=function(s){if(!arguments.length)return n.slice();n=[],t=new Map;for(const c of s){const h=c+"";t.has(h)||t.set(h,n.push(c))}return r},r.range=function(s){return arguments.length?(e=Array.from(s),r):e.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return Mb(n,e).unknown(i)},G8.apply(r,arguments),r}function ka(){var s,c,t=Mb().unknown(void 0),n=t.domain,e=t.range,i=0,r=1,h=!1,g=0,x=0,S=.5;function E(){var A=n().length,F=r=1)return+e(t[i-1],i-1,t);var i,r=(i-1)*n,s=Math.floor(r),c=+e(t[s],s,t);return c+(+e(t[s+1],s+1,t)-c)*(r-s)}}function fV(){var i,t=[],n=[],e=[];function r(){var c=0,h=Math.max(1,n.length);for(e=new Array(h-1);++c0?e[h-1]:t[0],h=0;)n+=e[i].value;else n=1;t.value=n}function DV(t,n){t instanceof Map?(t=[void 0,t],void 0===n&&(n=c4e)):void 0===n&&(n=l4e);for(var i,s,c,h,g,e=new Y8(t),r=[e];i=r.pop();)if((c=n(i.data))&&(g=(c=Array.from(c)).length))for(i.children=c,h=g-1;h>=0;--h)r.push(s=c[h]=new Y8(c[h])),s.parent=i,s.depth=i.depth+1;return e.eachBefore(AV)}function l4e(t){return t.children}function c4e(t){return Array.isArray(t)?t[1]:null}function u4e(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function AV(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function Y8(t){this.data=t,this.depth=this.height=0,this.parent=null}Eb.prototype=function(){return new Eb}.prototype={constructor:Eb,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,r,s){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,n,e,i,r){var s=this._x1,c=this._y1,h=(e=+e)-(t=+t),g=(i=+i)-(n=+n),x=s-t,S=c-n,E=x*x+S*S;if((r=+r)<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(E>W0)if(Math.abs(S*h-g*x)>W0&&r){var A=e-s,F=i-c,j=h*h+g*g,ie=A*A+F*F,W=Math.sqrt(j),Ee=Math.sqrt(E),Se=r*Math.tan((Tb-Math.acos((j+E-ie)/(2*W*Ee)))/2),Ze=Se/Ee,xt=Se/W;Math.abs(Ze-1)>W0&&(this._+="L"+(t+Ze*x)+","+(n+Ze*S)),this._+="A"+r+","+r+",0,0,"+ +(S*A>x*F)+","+(this._x1=t+xt*h)+","+(this._y1=n+xt*g)}else this._+="L"+(this._x1=t)+","+(this._y1=n)},arc:function(t,n,e,i,r,s){t=+t,n=+n,s=!!s;var c=(e=+e)*Math.cos(i),h=e*Math.sin(i),g=t+c,x=n+h,S=1^s,E=s?i-r:r-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+g+","+x:(Math.abs(this._x1-g)>W0||Math.abs(this._y1-x)>W0)&&(this._+="L"+g+","+x),e&&(E<0&&(E=E%Lb+Lb),E>b3e?this._+="A"+e+","+e+",0,1,"+S+","+(t-c)+","+(n-h)+"A"+e+","+e+",0,1,"+S+","+(this._x1=g)+","+(this._y1=x):E>W0&&(this._+="A"+e+","+e+",0,"+ +(E>=Tb)+","+S+","+(this._x1=t+e*Math.cos(r))+","+(this._y1=n+e*Math.sin(r))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}},yV.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:kb(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:kb(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}},function t(n){function e(i){return new yV(i,n)}return e.tension=function(i){return t(+i)},e}(0),_V.prototype={areaStart:vV,areaEnd:vV,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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:kb(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}},function t(n){function e(i){return new _V(i,n)}return e.tension=function(i){return t(+i)},e}(0),function(t){function n(e){return new xV(t(e))}n._curve=t}(function(t){return new pV(t)}),xV.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}},Math,Math,Math,Math,Math,Math,Math,Math,Math,ye(7960),function t(n){function e(i,r,s,c,h){!function(t,n,e,i,r,s){for(var g,x,F,j,W,Ee,Se,Ze,xt,Ut,on,c=[],h=n.children,S=0,E=0,A=h.length,ie=n.value;SSe&&(Se=x),on=W*W*Ut,(Ze=Math.max(Se/on,on/Ee))>xt){W-=x;break}xt=Ze}c.push(g={value:W,dice:F1?i:1)},e}((1+Math.sqrt(5))/2),Y8.prototype=DV.prototype={constructor:Y8,count:function(){return this.eachAfter(W3e)},each:function(t,n){let e=-1;for(const i of this)t.call(n,i,++e,this);return this},eachAfter:function(t,n){for(var s,c,h,e=this,i=[e],r=[],g=-1;e=i.pop();)if(r.push(e),s=e.children)for(c=0,h=s.length;c=0;--s)i.push(r[s]);return this},find:function(t,n){let e=-1;for(const i of this)if(t.call(n,i,++e,this))return i},sum:function(t){return this.eachAfter(function(n){for(var e=+t(n.data)||0,i=n.children,r=i&&i.length;--r>=0;)e+=i[r].value;n.value=e})},sort:function(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),i=n.ancestors(),r=null;for(t=e.pop(),n=i.pop();t===n;)r=t,t=e.pop(),n=i.pop();return r}(n,t),i=[n];n!==e;)i.push(n=n.parent);for(var r=i.length;t!==e;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t},links:function(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n},copy:function(){return DV(this).eachBefore(u4e)},[Symbol.iterator]:function*(){var n,i,r,s,t=this,e=[t];do{for(n=e.reverse(),e=[];t=n.pop();)if(yield t,i=t.children)for(r=0,s=i.length;r{class t{constructor(e,i,r){this.applicationRef=e,this.componentFactoryResolver=i,this.injector=r}static setGlobalRootViewContainer(e){t.globalRootViewContainer=e}getRootViewContainer(){if(this._container)return this._container;if(t.globalRootViewContainer)return t.globalRootViewContainer;if(this.applicationRef.components.length)return this.applicationRef.components[0];throw new Error("View Container not found! ngUpgrade needs to manually set this via setRootViewContainer or setGlobalRootViewContainer.")}setRootViewContainer(e){this._container=e}getComponentRootNode(e){return function(t){return t.element}(e)?e.element.nativeElement:e.hostView&&e.hostView.rootNodes.length>0?e.hostView.rootNodes[0]:e.location.nativeElement}getRootViewContainerNode(e){return this.getComponentRootNode(e)}projectComponentBindings(e,i){if(i){if(void 0!==i.inputs){const r=Object.getOwnPropertyNames(i.inputs);for(const s of r)e.instance[s]=i.inputs[s]}if(void 0!==i.outputs){const r=Object.getOwnPropertyNames(i.outputs);for(const s of r)e.instance[s]=i.outputs[s]}}return e}appendComponent(e,i={},r){r||(r=this.getRootViewContainer());const s=this.getComponentRootNode(r),c=new qoe(s,this.componentFactoryResolver,this.applicationRef,this.injector),h=new dz(e),g=c.attach(h);return this.projectComponentBindings(g,i),g}}return t.\u0275fac=function(e){return new(e||t)(Mt(w4),Mt(W2),Mt(U))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t.globalRootViewContainer=null,t})();function $0e(t,n,e){e=e||{};let i,r,s,c=null,h=0;function g(){h=!1===e.leading?0:+new Date,c=null,s=t.apply(i,r)}return function(){const x=+new Date;!h&&!1===e.leading&&(h=x);const S=n-(x-h);return i=this,r=arguments,S<=0?(clearTimeout(c),c=null,h=x,s=t.apply(i,r)):!c&&!1!==e.trailing&&(c=setTimeout(g,S)),s}}function j0e(t,n){return function(i,r,s){return{configurable:!0,enumerable:s.enumerable,get:function(){return Object.defineProperty(this,r,{configurable:!0,enumerable:s.enumerable,value:$0e(s.value,t,n)}),this[r]}}}}var ki=(()=>(function(t){t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right",t.Center="center"}(ki||(ki={})),ki))();function NV(t,n,e){return e===ki.Top?t.top-7:e===ki.Bottom?t.top+t.height-n.height+7:e===ki.Center?t.top+t.height/2-n.height/2:void 0}function RV(t,n,e){return e===ki.Left?t.left-7:e===ki.Right?t.left+t.width-n.width+7:e===ki.Center?t.left+t.width/2-n.width/2:void 0}class nl{static calculateVerticalAlignment(n,e,i){let r=NV(n,e,i);return r+e.height>window.innerHeight&&(r=window.innerHeight-e.height),r}static calculateVerticalCaret(n,e,i,r){let s;r===ki.Top&&(s=n.height/2-i.height/2+7),r===ki.Bottom&&(s=e.height-n.height/2-i.height/2-7),r===ki.Center&&(s=e.height/2-i.height/2);const c=NV(n,e,r);return c+e.height>window.innerHeight&&(s+=c+e.height-window.innerHeight),s}static calculateHorizontalAlignment(n,e,i){let r=RV(n,e,i);return r+e.width>window.innerWidth&&(r=window.innerWidth-e.width),r}static calculateHorizontalCaret(n,e,i,r){let s;r===ki.Left&&(s=n.width/2-i.width/2+7),r===ki.Right&&(s=e.width-n.width/2-i.width/2-7),r===ki.Center&&(s=e.width/2-i.width/2);const c=RV(n,e,r);return c+e.width>window.innerWidth&&(s+=c+e.width-window.innerWidth),s}static shouldFlip(n,e,i,r){let s=!1;return i===ki.Right&&n.left+n.width+e.width+r>window.innerWidth&&(s=!0),i===ki.Left&&n.left-e.width-r<0&&(s=!0),i===ki.Top&&n.top-e.height-r<0&&(s=!0),i===ki.Bottom&&n.top+n.height+e.height+r>window.innerHeight&&(s=!0),s}static positionCaret(n,e,i,r,s){let c=0,h=0;return n===ki.Right?(h=-7,c=nl.calculateVerticalCaret(i,e,r,s)):n===ki.Left?(h=e.width,c=nl.calculateVerticalCaret(i,e,r,s)):n===ki.Top?(c=e.height,h=nl.calculateHorizontalCaret(i,e,r,s)):n===ki.Bottom&&(c=-7,h=nl.calculateHorizontalCaret(i,e,r,s)),{top:c,left:h}}static positionContent(n,e,i,r,s){let c=0,h=0;return n===ki.Right?(h=i.left+i.width+r,c=nl.calculateVerticalAlignment(i,e,s)):n===ki.Left?(h=i.left-e.width-r,c=nl.calculateVerticalAlignment(i,e,s)):n===ki.Top?(c=i.top-e.height-r,h=nl.calculateHorizontalAlignment(i,e,s)):n===ki.Bottom&&(c=i.top+i.height+r,h=nl.calculateHorizontalAlignment(i,e,s)),{top:c,left:h}}static determinePlacement(n,e,i,r){if(nl.shouldFlip(i,e,n,r)){if(n===ki.Right)return ki.Left;if(n===ki.Left)return ki.Right;if(n===ki.Top)return ki.Bottom;if(n===ki.Bottom)return ki.Top}return n}}let G0e=(()=>{class t{constructor(e,i,r){this.element=e,this.renderer=i,this.platformId=r}get cssClasses(){let e="ngx-charts-tooltip-content";return e+=` position-${this.placement}`,e+=` type-${this.type}`,e+=` ${this.cssClass}`,e}ngAfterViewInit(){setTimeout(this.position.bind(this))}position(){if(!X2(this.platformId))return;const e=this.element.nativeElement,i=this.host.nativeElement.getBoundingClientRect();if(!i.height&&!i.width)return;const r=e.getBoundingClientRect();this.checkFlip(i,r),this.positionContent(e,i,r),this.showCaret&&this.positionCaret(i,r),setTimeout(()=>this.renderer.addClass(e,"animate"),1)}positionContent(e,i,r){const{top:s,left:c}=nl.positionContent(this.placement,r,i,this.spacing,this.alignment);this.renderer.setStyle(e,"top",`${s}px`),this.renderer.setStyle(e,"left",`${c}px`)}positionCaret(e,i){const r=this.caretElm.nativeElement,s=r.getBoundingClientRect(),{top:c,left:h}=nl.positionCaret(this.placement,i,e,s,this.alignment);this.renderer.setStyle(r,"top",`${c}px`),this.renderer.setStyle(r,"left",`${h}px`)}checkFlip(e,i){this.placement=nl.determinePlacement(this.placement,i,e,this.spacing)}onWindowResize(){this.position()}}return t.\u0275fac=function(e){return new(e||t)(B(rn),B(q2),B(M1))},t.\u0275cmp=ht({type:t,selectors:[["ngx-tooltip-content"]],viewQuery:function(e,i){if(1&e&&no(m4e,5),2&e){let r;ai(r=li())&&(i.caretElm=r.first)}},hostVars:2,hostBindings:function(e,i){1&e&&ot("resize",function(){return i.onWindowResize()},!1,Ad),2&e&&function(t){gc(Wa,x3,t,!0)}(i.cssClasses)},inputs:{placement:"placement",host:"host",showCaret:"showCaret",type:"type",alignment:"alignment",spacing:"spacing",cssClass:"cssClass",title:"title",template:"template",context:"context"},decls:6,vars:6,consts:[[3,"hidden"],["caretElm",""],[1,"tooltip-content"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"innerHTML"]],template:function(e,i){1&e&&(I(0,"div"),et(1,"span",0,1),I(3,"div",2),ft(4,v4e,2,4,"span",3),ft(5,y4e,1,1,"span",4),z(),z()),2&e&&(K(1),function(t,n,e){gc(Wa,x3,Il(un(),t,n,e),!0)}("tooltip-caret position-",i.placement,""),Q("hidden",!i.showCaret),K(3),Q("ngIf",!i.title),K(1),Q("ngIf",i.title))},directives:[di,M3],styles:[".ngx-charts-tooltip-content{position:fixed;border-radius:3px;z-index:5000;display:block;font-weight:normal;opacity:0;pointer-events:none!important}.ngx-charts-tooltip-content.type-popover{background:#fff;color:#060709;border:1px solid #72809b;box-shadow:0 1px 3px #0003,0 1px 1px #00000024,0 2px 1px -1px #0000001f;font-size:13px;padding:4px}.ngx-charts-tooltip-content.type-popover .tooltip-caret{position:absolute;z-index:5001;width:0;height:0}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-left{border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:7px solid #fff}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #fff}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-right{border-top:7px solid transparent;border-bottom:7px solid transparent;border-right:7px solid #fff}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-bottom{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #fff}.ngx-charts-tooltip-content.type-tooltip{color:#fff;background:rgba(0,0,0,.75);font-size:12px;padding:0 10px;text-align:center;pointer-events:auto}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-left{border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-right{border-top:7px solid transparent;border-bottom:7px solid transparent;border-right:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-bottom{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content .tooltip-label{display:block;line-height:1em;padding:8px 5px 5px;font-size:1em}.ngx-charts-tooltip-content .tooltip-val{display:block;font-size:1.3em;line-height:1em;padding:0 5px 8px}.ngx-charts-tooltip-content .tooltip-caret{position:absolute;z-index:5001;width:0;height:0}.ngx-charts-tooltip-content.position-right{transform:translate(10px)}.ngx-charts-tooltip-content.position-left{transform:translate(-10px)}.ngx-charts-tooltip-content.position-top{transform:translateY(-10px)}.ngx-charts-tooltip-content.position-bottom{transform:translateY(10px)}.ngx-charts-tooltip-content.animate{opacity:1;transition:opacity .3s,transform .3s;transform:translate(0);pointer-events:auto}.area-tooltip-container{padding:5px 0;pointer-events:none}.tooltip-item{text-align:left;line-height:1.2em;padding:5px 0}.tooltip-item .tooltip-item-color{display:inline-block;height:12px;width:12px;margin-right:5px;color:#5b646b;border-radius:3px}\n"],encapsulation:2}),function(t,n,e,i){var c,r=arguments.length,s=r<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,e,i);else for(var h=t.length-1;h>=0;h--)(c=t[h])&&(s=(r<3?c(s):r>3?c(n,e,s):c(n,e))||s);r>3&&s&&Object.defineProperty(n,e,s)}([j0e(100)],t.prototype,"onWindowResize",null),t})(),Pb=(()=>{class t extends class{constructor(n){this.injectionService=n,this.defaults={},this.components=new Map}getByType(n=this.type){return this.components.get(n)}create(n){return this.createByType(this.type,n)}createByType(n,e){e=this.assignDefaults(e);const i=this.injectComponent(n,e);return this.register(n,i),i}destroy(n){const e=this.components.get(n.componentType);if(e&&e.length){const i=e.indexOf(n);i>-1&&(e[i].destroy(),e.splice(i,1))}}destroyAll(){this.destroyByType(this.type)}destroyByType(n){const e=this.components.get(n);if(e&&e.length){let i=e.length-1;for(;i>=0;)this.destroy(e[i--])}}injectComponent(n,e){return this.injectionService.appendComponent(n,e)}assignDefaults(n){const e=Object.assign({},this.defaults.inputs),i=Object.assign({},this.defaults.outputs);return!n.inputs&&!n.outputs&&(n={inputs:n}),e&&(n.inputs=Object.assign(Object.assign({},e),n.inputs)),i&&(n.outputs=Object.assign(Object.assign({},i),n.outputs)),n}register(n,e){this.components.has(n)||this.components.set(n,[]),this.components.get(n).push(e)}}{constructor(e){super(e),this.type=G0e}}return t.\u0275fac=function(e){return new(e||t)(Mt(OV))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();var As=(()=>(function(t){t.Right="right",t.Below="below"}(As||(As={})),As))(),X0=(()=>(function(t){t.ScaleLegend="scaleLegend",t.Legend="legend"}(X0||(X0={})),X0))(),wt=(()=>(function(t){t.Time="time",t.Linear="linear",t.Ordinal="ordinal",t.Quantile="quantile"}(wt||(wt={})),wt))();let Bs=(()=>{class t{constructor(){this.showLegend=!1,this.animations=!0,this.legendLabelClick=new We,this.legendLabelActivate=new We,this.legendLabelDeactivate=new We,this.LegendPosition=As,this.LegendType=X0}ngOnChanges(e){this.update()}update(){let e=0;this.showLegend&&(this.legendType=this.getLegendType(),(!this.legendOptions||this.legendOptions.position===As.Right)&&(e=this.legendType===X0.ScaleLegend?1:2)),this.chartWidth=Math.floor(this.view[0]*(12-e)/12),this.legendWidth=this.legendOptions&&this.legendOptions.position!==As.Right?this.chartWidth:Math.floor(this.view[0]*e/12)}getLegendType(){return this.legendOptions.scaleType===wt.Linear?X0.ScaleLegend:X0.Legend}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=ht({type:t,selectors:[["ngx-charts-chart"]],inputs:{showLegend:"showLegend",animations:"animations",legendType:"legendType",view:"view",legendOptions:"legendOptions",activeEntries:"activeEntries"},outputs:{legendLabelClick:"legendLabelClick",legendLabelActivate:"legendLabelActivate",legendLabelDeactivate:"legendLabelDeactivate"},features:[Gr([Pb]),kn],ngContentSelectors:IV,decls:5,vars:6,consts:[[1,"ngx-charts-outer"],[1,"ngx-charts"],["class","chart-legend",3,"horizontal","valueRange","colors","height","width",4,"ngIf"],["class","chart-legend",3,"horizontal","data","title","colors","height","width","activeEntries","labelClick","labelActivate","labelDeactivate",4,"ngIf"],[1,"chart-legend",3,"horizontal","valueRange","colors","height","width"],[1,"chart-legend",3,"horizontal","data","title","colors","height","width","activeEntries","labelClick","labelActivate","labelDeactivate"]],template:function(e,i){1&e&&(Nn(),I(0,"div",0),ct(),I(1,"svg",1),Fn(2),z(),ft(3,_4e,1,5,"ngx-charts-scale-legend",2),ft(4,x4e,1,7,"ngx-charts-legend",3),z()),2&e&&(Dr("width",i.view[0],"px"),K(1),St("width",i.chartWidth)("height",i.view[1]),K(2),Q("ngIf",i.showLegend&&i.legendType===i.LegendType.ScaleLegend),K(1),Q("ngIf",i.showLegend&&i.legendType===i.LegendType.Legend))},directives:function(){return[di,JV,KV]},encapsulation:2,changeDetection:0}),t})(),q0e=(()=>{class t{constructor(e,i){this.element=e,this.zone=i,this.visible=new We,this.isVisible=!1,this.runCheck()}destroy(){clearTimeout(this.timeout)}onVisibilityChange(){this.zone.run(()=>{this.isVisible=!0,this.visible.emit(!0)})}runCheck(){const e=()=>{if(!this.element)return;const{offsetHeight:i,offsetWidth:r}=this.element.nativeElement;i&&r?(clearTimeout(this.timeout),this.onVisibilityChange()):(clearTimeout(this.timeout),this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>e(),100)}))};this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>e())})}}return t.\u0275fac=function(e){return new(e||t)(B(rn),B(pn))},t.\u0275dir=Tn({type:t,selectors:[["visibility-observer"]],outputs:{visible:"visible"}}),t})();function L9(t){return"[object Date]"===toString.call(t)}let Us=(()=>{class t{constructor(e,i,r,s){this.chartElement=e,this.zone=i,this.cd=r,this.platformId=s,this.scheme="cool",this.schemeType=wt.Ordinal,this.animations=!0,this.select=new We}ngOnInit(){i8(this.platformId)&&(this.animations=!1)}ngAfterViewInit(){this.bindWindowResizeEvent(),this.visibilityObserver=new q0e(this.chartElement,this.zone),this.visibilityObserver.visible.subscribe(this.update.bind(this))}ngOnDestroy(){this.unbindEvents(),this.visibilityObserver&&(this.visibilityObserver.visible.unsubscribe(),this.visibilityObserver.destroy())}ngOnChanges(e){this.update()}update(){if(this.results=this.results?this.cloneData(this.results):[],this.view)this.width=this.view[0],this.height=this.view[1];else{const e=this.getContainerDims();e&&(this.width=e.width,this.height=e.height)}this.width||(this.width=600),this.height||(this.height=400),this.width=Math.floor(this.width),this.height=Math.floor(this.height),this.cd&&this.cd.markForCheck()}getContainerDims(){let e,i;const r=this.chartElement.nativeElement;if(X2(this.platformId)&&null!==r.parentNode){const s=r.parentNode.getBoundingClientRect();e=s.width,i=s.height}return e&&i?{width:e,height:i}:null}formatDates(){for(let e=0;ee.lift(new Qoe(t,n))}(200)).subscribe(r=>{this.update(),this.cd&&this.cd.markForCheck()});this.resizeSubscription=i}cloneData(e){const i=[];for(const r of e){const s={name:r.name};if(void 0!==r.value&&(s.value=r.value),void 0!==r.series){s.series=[];for(const c of r.series){const h=Object.assign({},c);s.series.push(h)}}void 0!==r.extra&&(s.extra=JSON.parse(JSON.stringify(r.extra))),i.push(s)}return i}}return t.\u0275fac=function(e){return new(e||t)(B(rn),B(pn),B(zn),B(M1))},t.\u0275cmp=ht({type:t,selectors:[["base-chart"]],inputs:{scheme:"scheme",schemeType:"schemeType",animations:"animations",results:"results",view:"view",customColors:"customColors"},outputs:{select:"select"},features:[kn],decls:1,vars:0,template:function(e,i){1&e&&et(0,"div")},encapsulation:2}),t})();var Yo=(()=>(function(t){t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right"}(Yo||(Yo={})),Yo))();let Vb=(()=>{class t{constructor(e){this.textHeight=25,this.margin=5,this.element=e.nativeElement}ngOnChanges(e){this.update()}update(){switch(this.strokeWidth="0.01",this.textAnchor="middle",this.transform="",this.orient){case Yo.Top:case Yo.Bottom:this.y=this.offset,this.x=this.width/2;break;case Yo.Left:this.y=-(this.offset+this.textHeight+this.margin),this.x=-this.height/2,this.transform="rotate(270)";break;case Yo.Right:this.y=this.offset+this.margin,this.x=-this.height/2,this.transform="rotate(270)"}}}return t.\u0275fac=function(e){return new(e||t)(B(rn))},t.\u0275cmp=ht({type:t,selectors:[["g","ngx-charts-axis-label",""]],inputs:{orient:"orient",label:"label",offset:"offset",width:"width",height:"height"},features:[kn],attrs:b4e,decls:2,vars:6,template:function(e,i){1&e&&(ct(),I(0,"text"),gt(1),z()),2&e&&(St("stroke-width",i.strokeWidth)("x",i.x)("y",i.y)("text-anchor",i.textAnchor)("transform",i.transform),K(1),Qi(" ",i.label," "))},encapsulation:2,changeDetection:0}),t})();function hh(t,n=16){return"string"!=typeof t?"number"==typeof t?t+"":"":(t=t.trim()).length<=n?t:`${t.slice(0,n)}...`}function HV(t,n){if(t.length>n){const e=[],i=Math.floor(t.length/n);for(let r=0;r(function(t){t.Start="start",t.Middle="middle",t.End="end"}(k1||(k1={})),k1))();let BV=(()=>{class t{constructor(e){this.platformId=e,this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.rotateTicks=!0,this.dimensionsChanged=new We,this.verticalSpacing=20,this.rotateLabels=!1,this.innerTickSize=6,this.outerTickSize=6,this.tickPadding=3,this.textAnchor=k1.Middle,this.maxTicksLength=0,this.maxAllowedLength=16,this.height=0,this.approxHeight=10}ngOnChanges(e){this.update()}ngAfterViewInit(){setTimeout(()=>this.updateDims())}updateDims(){if(!X2(this.platformId))return void this.dimensionsChanged.emit({height:this.approxHeight});const e=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().height,10);e!==this.height&&(this.height=e,this.dimensionsChanged.emit({height:this.height}),setTimeout(()=>this.updateDims()))}update(){const e=this.scale;this.ticks=this.getTicks(),this.tickFormat=this.tickFormatting?this.tickFormatting:e.tickFormat?e.tickFormat.apply(e,this.tickArguments):function(r){return"Date"===r.constructor.name?r.toLocaleDateString():r.toLocaleString()};const i=this.rotateTicks?this.getRotationAngle(this.ticks):null;this.adjustedScale=this.scale.bandwidth?function(r){return this.scale(r)+.5*this.scale.bandwidth()}:this.scale,this.textTransform="",i&&0!==i?(this.textTransform=`rotate(${i})`,this.textAnchor=k1.End,this.verticalSpacing=10):this.textAnchor=k1.Middle,setTimeout(()=>this.updateDims())}getRotationAngle(e){let i=0;this.maxTicksLength=0;for(let x=0;xthis.maxTicksLength&&(this.maxTicksLength=E)}const c=7*Math.min(this.maxTicksLength,this.maxAllowedLength);let h=c;const g=Math.floor(this.width/e.length);for(;h>g&&i>-90;)i-=30,h=Math.cos(i*(Math.PI/180))*c;return this.approxHeight=Math.max(Math.abs(Math.sin(i*(Math.PI/180))*c),10),i}getTicks(){let e;const i=this.getMaxTicks(20),r=this.getMaxTicks(100);return this.tickValues?e=this.tickValues:this.scale.ticks?e=this.scale.ticks.apply(this.scale,[r]):(e=this.scale.domain(),e=HV(e,i)),e}getMaxTicks(e){return Math.floor(this.width/e)}tickTransform(e){return"translate("+this.adjustedScale(e)+","+this.verticalSpacing+")"}gridLineTransform(){return`translate(0,${-this.verticalSpacing-5})`}tickTrim(e){return this.trimTicks?hh(e,this.maxTickLength):e}}return t.\u0275fac=function(e){return new(e||t)(B(M1))},t.\u0275cmp=ht({type:t,selectors:[["g","ngx-charts-x-axis-ticks",""]],viewQuery:function(e,i){if(1&e&&no(zV,5),2&e){let r;ai(r=li())&&(i.ticksElement=r.first)}},inputs:{tickArguments:"tickArguments",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",showGridLines:"showGridLines",rotateTicks:"rotateTicks",scale:"scale",orient:"orient",tickValues:"tickValues",tickFormatting:"tickFormatting",gridLineHeight:"gridLineHeight",width:"width"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[kn],attrs:w4e,decls:4,vars:2,consts:[["ticksel",""],["class","tick",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"tick"],["stroke-width","0.01"],[4,"ngIf"],["y2","0",1,"gridline-path","gridline-path-vertical"]],template:function(e,i){1&e&&(ct(),I(0,"g",null,0),ft(2,M4e,5,7,"g",1),z(),ft(3,T4e,2,2,"g",2)),2&e&&(K(2),Q("ngForOf",i.ticks),K(1),Q("ngForOf",i.ticks))},directives:[tr,di],encapsulation:2,changeDetection:0}),t})(),q1=(()=>{class t{constructor(){this.rotateTicks=!0,this.showGridLines=!1,this.xOrient=Yo.Bottom,this.xAxisOffset=0,this.dimensionsChanged=new We,this.xAxisClassName="x axis",this.labelOffset=0,this.fill="none",this.stroke="stroke",this.tickStroke="#ccc",this.strokeWidth="none",this.padding=5,this.orientation=Yo}ngOnChanges(e){this.update()}update(){this.transform=`translate(0,${this.xAxisOffset+this.padding+this.dims.height})`,void 0!==this.xAxisTickCount&&(this.tickArguments=[this.xAxisTickCount])}emitTicksHeight({height:e}){const i=e+25+5;i!==this.labelOffset&&(this.labelOffset=i,setTimeout(()=>{this.dimensionsChanged.emit({height:e})},0))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=ht({type:t,selectors:[["g","ngx-charts-x-axis",""]],viewQuery:function(e,i){if(1&e&&no(BV,5),2&e){let r;ai(r=li())&&(i.ticksComponent=r.first)}},inputs:{rotateTicks:"rotateTicks",showGridLines:"showGridLines",xOrient:"xOrient",xAxisOffset:"xAxisOffset",xScale:"xScale",dims:"dims",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",showLabel:"showLabel",labelText:"labelText",ticks:"ticks",xAxisTickCount:"xAxisTickCount"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[kn],attrs:L4e,decls:3,vars:4,consts:[["ngx-charts-x-axis-ticks","",3,"trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","width","tickValues","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-x-axis-ticks","",3,"trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","width","tickValues","dimensionsChanged"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(e,i){1&e&&(ct(),I(0,"g"),ft(1,E4e,1,12,"g",0),ft(2,D4e,1,5,"g",1),z()),2&e&&(St("class",i.xAxisClassName)("transform",i.transform),K(1),Q("ngIf",i.xScale),K(1),Q("ngIf",i.showLabel))},directives:[di,BV,Vb],encapsulation:2,changeDetection:0}),t})();function kc(t,n,e,i,r,[s,c,h,g]){let x="";return x=`M${[t+r,n]}`,x+="h"+((e=0===(e=Math.floor(e))?1:e)-2*r),x+=c?`a${[r,r]} 0 0 1 ${[r,r]}`:`h${r}v${r}`,x+="v"+((i=0===(i=Math.floor(i))?1:i)-2*r),x+=g?`a${[r,r]} 0 0 1 ${[-r,r]}`:`v${r}h${-r}`,x+="h"+(2*r-e),x+=h?`a${[r,r]} 0 0 1 ${[-r,-r]}`:`h${-r}v${-r}`,x+="v"+(2*r-i),x+=s?`a${[r,r]} 0 0 1 ${[r,-r]}`:`v${-r}h${r}`,x+="z",x}let UV=(()=>{class t{constructor(e){this.platformId=e,this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.showRefLabels=!1,this.showRefLines=!1,this.dimensionsChanged=new We,this.innerTickSize=6,this.tickPadding=3,this.verticalSpacing=20,this.textAnchor=k1.Middle,this.width=0,this.outerTickSize=6,this.rotateLabels=!1,this.referenceLineLength=0,this.Orientation=Yo}ngOnChanges(e){this.update()}ngAfterViewInit(){setTimeout(()=>this.updateDims())}updateDims(){if(!X2(this.platformId))return this.width=this.getApproximateAxisWidth(),void this.dimensionsChanged.emit({width:this.width});const e=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().width,10);e!==this.width&&(this.width=e,this.dimensionsChanged.emit({width:e}),setTimeout(()=>this.updateDims()))}update(){let e;const i=this.orient===Yo.Top||this.orient===Yo.Right?-1:1;switch(this.tickSpacing=Math.max(this.innerTickSize,0)+this.tickPadding,e=this.scale,this.ticks=this.getTicks(),this.tickFormat=this.tickFormatting?this.tickFormatting:e.tickFormat?e.tickFormat.apply(e,this.tickArguments):function(r){return"Date"===r.constructor.name?r.toLocaleDateString():r.toLocaleString()},this.adjustedScale=e.bandwidth?function(r){return e(r)+.5*e.bandwidth()}:e,this.showRefLines&&this.referenceLines&&this.setReferencelines(),this.orient){case Yo.Top:case Yo.Bottom:this.transform=function(r){return"translate("+this.adjustedScale(r)+",0)"},this.textAnchor=k1.Middle,this.y2=this.innerTickSize*i,this.y1=this.tickSpacing*i,this.dy=i<0?"0em":".71em";break;case Yo.Left:this.transform=function(r){return"translate(0,"+this.adjustedScale(r)+")"},this.textAnchor=k1.End,this.x2=this.innerTickSize*-i,this.x1=this.tickSpacing*-i,this.dy=".32em";break;case Yo.Right:this.transform=function(r){return"translate(0,"+this.adjustedScale(r)+")"},this.textAnchor=k1.Start,this.x2=this.innerTickSize*-i,this.x1=this.tickSpacing*-i,this.dy=".32em"}setTimeout(()=>this.updateDims())}setReferencelines(){this.refMin=this.adjustedScale(Math.min.apply(null,this.referenceLines.map(e=>e.value))),this.refMax=this.adjustedScale(Math.max.apply(null,this.referenceLines.map(e=>e.value))),this.referenceLineLength=this.referenceLines.length,this.referenceAreaPath=kc(0,this.refMax,this.gridLineWidth,this.refMin-this.refMax,0,[!1,!1,!1,!1])}getTicks(){let e;const i=this.getMaxTicks(20),r=this.getMaxTicks(50);return this.tickValues?e=this.tickValues:this.scale.ticks?e=this.scale.ticks.apply(this.scale,[r]):(e=this.scale.domain(),e=HV(e,i)),e}getMaxTicks(e){return Math.floor(this.height/e)}tickTransform(e){return`translate(${this.adjustedScale(e)},${this.verticalSpacing})`}gridLineTransform(){return"translate(5,0)"}tickTrim(e){return this.trimTicks?hh(e,this.maxTickLength):e}getApproximateAxisWidth(){return 7*Math.max(...this.ticks.map(r=>this.tickTrim(this.tickFormat(r)).length))}}return t.\u0275fac=function(e){return new(e||t)(B(M1))},t.\u0275cmp=ht({type:t,selectors:[["g","ngx-charts-y-axis-ticks",""]],viewQuery:function(e,i){if(1&e&&no(zV,5),2&e){let r;ai(r=li())&&(i.ticksElement=r.first)}},inputs:{tickArguments:"tickArguments",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",showGridLines:"showGridLines",showRefLabels:"showRefLabels",showRefLines:"showRefLines",scale:"scale",orient:"orient",tickValues:"tickValues",tickFormatting:"tickFormatting",gridLineWidth:"gridLineWidth",height:"height",referenceLines:"referenceLines"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[kn],attrs:A4e,decls:6,vars:4,consts:[["ticksel",""],["class","tick",4,"ngFor","ngForOf"],["class","reference-area",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"tick"],["stroke-width","0.01"],[1,"reference-area"],[4,"ngIf"],["class","gridline-path gridline-path-horizontal","x1","0",4,"ngIf"],["x1","0",1,"gridline-path","gridline-path-horizontal"],["x1","0",1,"refline-path","gridline-path-horizontal"],[1,"refline-label"]],template:function(e,i){1&e&&(ct(),I(0,"g",null,0),ft(2,k4e,5,9,"g",1),z(),ft(3,I4e,1,2,"path",2),ft(4,F4e,2,2,"g",3),ft(5,R4e,2,1,"g",3)),2&e&&(K(2),Q("ngForOf",i.ticks),K(1),Q("ngIf",i.referenceLineLength>1&&i.refMax&&i.refMin&&i.showRefLines),K(1),Q("ngForOf",i.ticks),K(1),Q("ngForOf",i.referenceLines))},directives:[tr,di],encapsulation:2,changeDetection:0}),t})(),I1=(()=>{class t{constructor(){this.showGridLines=!1,this.yOrient=Yo.Left,this.yAxisOffset=0,this.dimensionsChanged=new We,this.yAxisClassName="y axis",this.labelOffset=15,this.fill="none",this.stroke="#CCC",this.tickStroke="#CCC",this.strokeWidth=1,this.padding=5}ngOnChanges(e){this.update()}update(){this.offset=-(this.yAxisOffset+this.padding),this.yOrient===Yo.Right?(this.labelOffset=65,this.transform=`translate(${this.offset+this.dims.width} , 0)`):(this.offset=this.offset,this.transform=`translate(${this.offset} , 0)`),void 0!==this.yAxisTickCount&&(this.tickArguments=[this.yAxisTickCount])}emitTicksWidth({width:e}){e!==this.labelOffset&&this.yOrient===Yo.Right?(this.labelOffset=e+this.labelOffset,setTimeout(()=>{this.dimensionsChanged.emit({width:e})},0)):e!==this.labelOffset&&(this.labelOffset=e,setTimeout(()=>{this.dimensionsChanged.emit({width:e})},0))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=ht({type:t,selectors:[["g","ngx-charts-y-axis",""]],viewQuery:function(e,i){if(1&e&&no(UV,5),2&e){let r;ai(r=li())&&(i.ticksComponent=r.first)}},inputs:{showGridLines:"showGridLines",yOrient:"yOrient",yAxisOffset:"yAxisOffset",yScale:"yScale",dims:"dims",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",ticks:"ticks",showLabel:"showLabel",labelText:"labelText",yAxisTickCount:"yAxisTickCount",referenceLines:"referenceLines",showRefLines:"showRefLines",showRefLabels:"showRefLabels"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[kn],attrs:H4e,decls:3,vars:4,consts:[["ngx-charts-y-axis-ticks","",3,"trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-y-axis-ticks","",3,"trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","dimensionsChanged"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(e,i){1&e&&(ct(),I(0,"g"),ft(1,B4e,1,14,"g",0),ft(2,U4e,1,5,"g",1),z()),2&e&&(St("class",i.yAxisClassName)("transform",i.transform),K(1),Q("ngIf",i.yScale),K(1),Q("ngIf",i.showLabel))},directives:[di,UV,Vb],encapsulation:2,changeDetection:0}),t})(),$V=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[S3]]}),t})();var z1=(()=>(function(t){t.popover="popover",t.tooltip="tooltip"}(z1||(z1={})),z1))(),dh=(()=>(function(t){t[t.all="all"]="all",t[t.focus="focus"]="focus",t[t.mouseover="mouseover"]="mouseover"}(dh||(dh={})),dh))();let Gl=(()=>{class t{constructor(e,i,r){this.tooltipService=e,this.viewContainerRef=i,this.renderer=r,this.tooltipCssClass="",this.tooltipAppendToBody=!0,this.tooltipSpacing=10,this.tooltipDisabled=!1,this.tooltipShowCaret=!0,this.tooltipPlacement=ki.Top,this.tooltipAlignment=ki.Center,this.tooltipType=z1.popover,this.tooltipCloseOnClickOutside=!0,this.tooltipCloseOnMouseLeave=!0,this.tooltipHideTimeout=300,this.tooltipShowTimeout=100,this.tooltipShowEvent=dh.all,this.tooltipImmediateExit=!1,this.show=new We,this.hide=new We}get listensForFocus(){return this.tooltipShowEvent===dh.all||this.tooltipShowEvent===dh.focus}get listensForHover(){return this.tooltipShowEvent===dh.all||this.tooltipShowEvent===dh.mouseover}ngOnDestroy(){this.hideTooltip(!0)}onFocus(){this.listensForFocus&&this.showTooltip()}onBlur(){this.listensForFocus&&this.hideTooltip(!0)}onMouseEnter(){this.listensForHover&&this.showTooltip()}onMouseLeave(e){if(this.listensForHover&&this.tooltipCloseOnMouseLeave){if(clearTimeout(this.timeout),this.component&&this.component.instance.element.nativeElement.contains(e))return;this.hideTooltip(this.tooltipImmediateExit)}}onMouseClick(){this.listensForHover&&this.hideTooltip(!0)}showTooltip(e){if(this.component||this.tooltipDisabled)return;const i=e?0:this.tooltipShowTimeout+(navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?300:0);clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.tooltipService.destroyAll();const r=this.createBoundOptions();this.component=this.tooltipService.create(r),setTimeout(()=>{this.component&&this.addHideListeners(this.component.instance.element.nativeElement)},10),this.show.emit(!0)},i)}addHideListeners(e){this.mouseEnterContentEvent=this.renderer.listen(e,"mouseenter",()=>{clearTimeout(this.timeout)}),this.tooltipCloseOnMouseLeave&&(this.mouseLeaveContentEvent=this.renderer.listen(e,"mouseleave",()=>{this.hideTooltip(this.tooltipImmediateExit)})),this.tooltipCloseOnClickOutside&&(this.documentClickEvent=this.renderer.listen("window","click",i=>{e.contains(i.target)||this.hideTooltip()}))}hideTooltip(e=!1){if(!this.component)return;const i=()=>{this.mouseLeaveContentEvent&&this.mouseLeaveContentEvent(),this.mouseEnterContentEvent&&this.mouseEnterContentEvent(),this.documentClickEvent&&this.documentClickEvent(),this.hide.emit(!0),this.tooltipService.destroy(this.component),this.component=void 0};clearTimeout(this.timeout),e?i():this.timeout=setTimeout(i,this.tooltipHideTimeout)}createBoundOptions(){return{title:this.tooltipTitle,template:this.tooltipTemplate,host:this.viewContainerRef.element,placement:this.tooltipPlacement,alignment:this.tooltipAlignment,type:this.tooltipType,showCaret:this.tooltipShowCaret,cssClass:this.tooltipCssClass,spacing:this.tooltipSpacing,context:this.tooltipContext}}}return t.\u0275fac=function(e){return new(e||t)(B(Pb),B(Za),B(q2))},t.\u0275dir=Tn({type:t,selectors:[["","ngx-tooltip",""]],hostBindings:function(e,i){1&e&&ot("focusin",function(){return i.onFocus()})("blur",function(){return i.onBlur()})("mouseenter",function(){return i.onMouseEnter()})("mouseleave",function(s){return i.onMouseLeave(s.target)})("click",function(){return i.onMouseClick()})},inputs:{tooltipCssClass:"tooltipCssClass",tooltipAppendToBody:"tooltipAppendToBody",tooltipSpacing:"tooltipSpacing",tooltipDisabled:"tooltipDisabled",tooltipShowCaret:"tooltipShowCaret",tooltipPlacement:"tooltipPlacement",tooltipAlignment:"tooltipAlignment",tooltipType:"tooltipType",tooltipCloseOnClickOutside:"tooltipCloseOnClickOutside",tooltipCloseOnMouseLeave:"tooltipCloseOnMouseLeave",tooltipHideTimeout:"tooltipHideTimeout",tooltipShowTimeout:"tooltipShowTimeout",tooltipShowEvent:"tooltipShowEvent",tooltipImmediateExit:"tooltipImmediateExit",tooltipTitle:"tooltipTitle",tooltipTemplate:"tooltipTemplate",tooltipContext:"tooltipContext"},outputs:{show:"show",hide:"hide"}}),t})(),jV=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({providers:[OV,Pb],imports:[[S3]]}),t})();function Ia(t){return t instanceof Date?t.toLocaleDateString():t.toLocaleString()}const GV={};function e1(){let t=("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4);return t=`a${t}`,GV[t]?e1():(GV[t]=!0,t)}var Yr=(()=>(function(t){t.Vertical="vertical",t.Horizontal="horizontal"}(Yr||(Yr={})),Yr))();let Rb,ph=(()=>{class t{constructor(){this.orientation=Yr.Vertical}ngOnChanges(e){this.x1="0%",this.x2="0%",this.y1="0%",this.y2="0%",this.orientation===Yr.Horizontal?this.x2="100%":this.orientation===Yr.Vertical&&(this.y1="100%")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=ht({type:t,selectors:[["g","ngx-charts-svg-linear-gradient",""]],inputs:{orientation:"orientation",name:"name",stops:"stops"},features:[kn],attrs:K4e,decls:2,vars:6,consts:[[3,"id"],[3,"stop-color","stop-opacity",4,"ngFor","ngForOf"]],template:function(e,i){1&e&&(ct(),I(0,"linearGradient",0),ft(1,Q4e,1,5,"stop",1),z()),2&e&&(Q("id",i.name),St("x1",i.x1)("y1",i.y1)("x2",i.x2)("y2",i.y2),K(1),Q("ngForOf",i.stops))},directives:[tr],encapsulation:2,changeDetection:0}),t})();"undefined"!=typeof window?Rb=window:"undefined"!=typeof global&&(Rb=global);let KV=(()=>{class t{constructor(e){this.cd=e,this.horizontal=!1,this.labelClick=new We,this.labelActivate=new We,this.labelDeactivate=new We,this.legendEntries=[]}ngOnChanges(e){this.update()}update(){this.cd.markForCheck(),this.legendEntries=this.getLegendEntries()}getLegendEntries(){const e=[];for(const i of this.data){const r=Ia(i);-1===e.findIndex(c=>c.label===r)&&e.push({label:i,formattedLabel:r,color:this.colors.getColor(i)})}return e}isActive(e){return!!this.activeEntries&&void 0!==this.activeEntries.find(r=>e.label===r.name)}activate(e){this.labelActivate.emit(e)}deactivate(e){this.labelDeactivate.emit(e)}trackBy(e,i){return i.label}}return t.\u0275fac=function(e){return new(e||t)(B(zn))},t.\u0275cmp=ht({type:t,selectors:[["ngx-charts-legend"]],inputs:{horizontal:"horizontal",data:"data",title:"title",colors:"colors",height:"height",width:"width",activeEntries:"activeEntries"},outputs:{labelClick:"labelClick",labelActivate:"labelActivate",labelDeactivate:"labelDeactivate"},features:[kn],decls:5,vars:9,consts:[["class","legend-title",4,"ngIf"],[1,"legend-wrap"],[1,"legend-labels"],["class","legend-label",4,"ngFor","ngForOf","ngForTrackBy"],[1,"legend-title"],[1,"legend-title-text"],[1,"legend-label"],[3,"label","formattedLabel","color","isActive","select","activate","deactivate"]],template:function(e,i){1&e&&(I(0,"div"),ft(1,cue,3,1,"header",0),I(2,"div",1),I(3,"ul",2),ft(4,uue,2,4,"li",3),z(),z(),z()),2&e&&(Dr("width",i.width,"px"),K(1),Q("ngIf",(null==i.title?null:i.title.length)>0),K(2),Dr("max-height",i.height-45,"px"),eo("horizontal-legend",i.horizontal),K(1),Q("ngForOf",i.legendEntries)("ngForTrackBy",i.trackBy))},directives:function(){return[di,tr,QV]},styles:[".chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .legend-title{white-space:nowrap;overflow:hidden;margin-left:10px;margin-bottom:5px;font-size:14px;font-weight:bold}.chart-legend ul,.chart-legend li{padding:0;margin:0;list-style:none}.chart-legend .horizontal-legend li{display:inline-block}.chart-legend .legend-wrap{width:calc(100% - 10px)}.chart-legend .legend-labels{line-height:85%;list-style:none;text-align:left;float:left;width:100%;border-radius:3px;overflow-y:auto;overflow-x:hidden;white-space:nowrap;background:rgba(0,0,0,.05)}.chart-legend .legend-label{cursor:pointer;font-size:90%;margin:8px;color:#afb7c8}.chart-legend .legend-label:hover{color:#000;transition:.2s}.chart-legend .legend-label .active .legend-label-text{color:#000}.chart-legend .legend-label-color{display:inline-block;height:15px;width:15px;margin-right:5px;color:#5b646b;border-radius:3px}.chart-legend .legend-label-text{display:inline-block;vertical-align:top;line-height:15px;font-size:12px;width:calc(100% - 20px);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.chart-legend .legend-title-text{vertical-align:bottom;display:inline-block;line-height:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"],encapsulation:2,changeDetection:0}),t})(),QV=(()=>{class t{constructor(){this.isActive=!1,this.select=new We,this.activate=new We,this.deactivate=new We,this.toggle=new We}get trimmedLabel(){return this.formattedLabel||"(empty)"}onMouseEnter(){this.activate.emit({name:this.label})}onMouseLeave(){this.deactivate.emit({name:this.label})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=ht({type:t,selectors:[["ngx-charts-legend-entry"]],hostBindings:function(e,i){1&e&&ot("mouseenter",function(){return i.onMouseEnter()})("mouseleave",function(){return i.onMouseLeave()})},inputs:{isActive:"isActive",color:"color",label:"label",formattedLabel:"formattedLabel"},outputs:{select:"select",activate:"activate",deactivate:"deactivate",toggle:"toggle"},decls:4,vars:6,consts:[["tabindex","-1",3,"title","click"],[1,"legend-label-color",3,"click"],[1,"legend-label-text"]],template:function(e,i){1&e&&(I(0,"span",0),ot("click",function(){return i.select.emit(i.formattedLabel)}),I(1,"span",1),ot("click",function(){return i.toggle.emit(i.formattedLabel)}),z(),I(2,"span",2),gt(3),z(),z()),2&e&&(eo("active",i.isActive),Q("title",i.formattedLabel),K(1),Dr("background-color",i.color),K(2),Qi(" ",i.trimmedLabel," "))},encapsulation:2,changeDetection:0}),t})(),JV=(()=>{class t{constructor(){this.horizontal=!1}ngOnChanges(e){const i=this.gradientString(this.colors.range(),this.colors.domain());this.gradient=`linear-gradient(to ${this.horizontal?"right":"bottom"}, ${i})`}gradientString(e,i){i.push(1);const r=[];return e.reverse().forEach((s,c)=>{r.push(`${s} ${Math.round(100*i[c])}%`)}),r.join(", ")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=ht({type:t,selectors:[["ngx-charts-scale-legend"]],inputs:{horizontal:"horizontal",valueRange:"valueRange",colors:"colors",height:"height",width:"width"},features:[kn],decls:8,vars:10,consts:[[1,"scale-legend"],[1,"scale-legend-label"],[1,"scale-legend-wrap"]],template:function(e,i){1&e&&(I(0,"div",0),I(1,"div",1),I(2,"span"),gt(3),z(),z(),et(4,"div",2),I(5,"div",1),I(6,"span"),gt(7),z(),z(),z()),2&e&&(Dr("height",i.horizontal?void 0:i.height,"px")("width",i.width,"px"),eo("horizontal-legend",i.horizontal),K(3),Ls(i.valueRange[1].toLocaleString()),K(1),Dr("background",i.gradient),K(3),Ls(i.valueRange[0].toLocaleString()))},styles:[".chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .scale-legend{text-align:center;display:flex;flex-direction:column}.chart-legend .scale-legend-wrap{display:inline-block;flex:1;width:30px;border-radius:5px;margin:0 auto}.chart-legend .scale-legend-label{font-size:12px}.chart-legend .horizontal-legend.scale-legend{flex-direction:row}.chart-legend .horizontal-legend .scale-legend-wrap{width:auto;height:30px;margin:0 16px}\n"],encapsulation:2,changeDetection:0}),t})(),Wl=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[S3,$V,jV],S3,$V,jV]}),t})();let tF=[{name:"vivid",selectable:!0,group:wt.Ordinal,domain:["#647c8a","#3f51b5","#2196f3","#00b862","#afdf0a","#a7b61a","#f3e562","#ff9800","#ff5722","#ff4514"]},{name:"natural",selectable:!0,group:wt.Ordinal,domain:["#bf9d76","#e99450","#d89f59","#f2dfa7","#a5d7c6","#7794b1","#afafaf","#707160","#ba9383","#d9d5c3"]},{name:"cool",selectable:!0,group:wt.Ordinal,domain:["#a8385d","#7aa3e5","#a27ea8","#aae3f5","#adcded","#a95963","#8796c0","#7ed3ed","#50abcc","#ad6886"]},{name:"fire",selectable:!0,group:wt.Ordinal,domain:["#ff3d00","#bf360c","#ff8f00","#ff6f00","#ff5722","#e65100","#ffca28","#ffab00"]},{name:"solar",selectable:!0,group:wt.Linear,domain:["#fff8e1","#ffecb3","#ffe082","#ffd54f","#ffca28","#ffc107","#ffb300","#ffa000","#ff8f00","#ff6f00"]},{name:"air",selectable:!0,group:wt.Linear,domain:["#e1f5fe","#b3e5fc","#81d4fa","#4fc3f7","#29b6f6","#03a9f4","#039be5","#0288d1","#0277bd","#01579b"]},{name:"aqua",selectable:!0,group:wt.Linear,domain:["#e0f7fa","#b2ebf2","#80deea","#4dd0e1","#26c6da","#00bcd4","#00acc1","#0097a7","#00838f","#006064"]},{name:"flame",selectable:!1,group:wt.Ordinal,domain:["#A10A28","#D3342D","#EF6D49","#FAAD67","#FDDE90","#DBED91","#A9D770","#6CBA67","#2C9653","#146738"]},{name:"ocean",selectable:!1,group:wt.Ordinal,domain:["#1D68FB","#33C0FC","#4AFFFE","#AFFFFF","#FFFC63","#FDBD2D","#FC8A25","#FA4F1E","#FA141B","#BA38D1"]},{name:"forest",selectable:!1,group:wt.Ordinal,domain:["#55C22D","#C1F33D","#3CC099","#AFFFFF","#8CFC9D","#76CFFA","#BA60FB","#EE6490","#C42A1C","#FC9F32"]},{name:"horizon",selectable:!1,group:wt.Ordinal,domain:["#2597FB","#65EBFD","#99FDD0","#FCEE4B","#FEFCFA","#FDD6E3","#FCB1A8","#EF6F7B","#CB96E8","#EFDEE0"]},{name:"neons",selectable:!1,group:wt.Ordinal,domain:["#FF3333","#FF33FF","#CC33FF","#0000FF","#33CCFF","#33FFFF","#33FF66","#CCFF33","#FFCC00","#FF6600"]},{name:"picnic",selectable:!1,group:wt.Ordinal,domain:["#FAC51D","#66BD6D","#FAA026","#29BB9C","#E96B56","#55ACD2","#B7332F","#2C83C9","#9166B8","#92E7E8"]},{name:"night",selectable:!1,group:wt.Ordinal,domain:["#2B1B5A","#501356","#183356","#28203F","#391B3C","#1E2B3C","#120634","#2D0432","#051932","#453080","#75267D","#2C507D","#4B3880","#752F7D","#35547D"]},{name:"nightLights",selectable:!1,group:wt.Ordinal,domain:["#4e31a5","#9c25a7","#3065ab","#57468b","#904497","#46648b","#32118d","#a00fb3","#1052a2","#6e51bd","#b63cc3","#6c97cb","#8671c1","#b455be","#7496c3"]}];class so{constructor(n,e,i,r){"string"==typeof n&&(n=tF.find(s=>s.name===n)),this.colorDomain=n.domain,this.scaleType=e,this.domain=i,this.customColors=r,this.scale=this.generateColorScheme(n,e,this.domain)}generateColorScheme(n,e,i){let r;switch("string"==typeof n&&(n=tF.find(s=>s.name===n)),e){case wt.Quantile:r=fV().range(n.domain).domain(i);break;case wt.Ordinal:r=Mb().range(n.domain).domain(i);break;case wt.Linear:{const s=[...n.domain];1===s.length&&(s.push(s[0]),this.colorDomain=s);const c=cV(0,1,1/s.length);r=cs().range(s).domain(c)}}return r}getColor(n){if(null==n)throw new Error("Value can not be null");if(this.scaleType===wt.Linear){const e=cs().domain(this.domain).range([0,1]);return this.scale(e(n))}{if("function"==typeof this.customColors)return this.customColors(n);const e=n.toString();let i;return this.customColors&&this.customColors.length>0&&(i=this.customColors.find(r=>r.name.toLowerCase()===e.toLowerCase())),i?i.value:this.scale(n)}}getLinearGradientStops(n,e){void 0===e&&(e=this.domain[0]);const i=cs().domain(this.domain).range([0,1]),r=ka().domain(this.colorDomain).range([0,1]),s=this.getColor(n),c=i(e),h=this.getColor(e),g=i(n);let x=1,S=c;const E=[];for(E.push({color:h,offset:c,originalOffset:c,opacity:1});S=(g-r.bandwidth()).toFixed(4))break;E.push({color:A,offset:F,opacity:1}),S=F,x++}}if(E[E.length-1].offset<100&&E.push({color:s,offset:g,opacity:1}),g===c)E[0].offset=0,E[1].offset=100;else if(100!==E[E.length-1].offset)for(const A of E)A.offset=(A.offset-c)/(g-c)*100;return E}}let Z0e=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[Wl]]}),t})(),Gb=(()=>{class t{constructor(e){this.roundEdges=!0,this.gradient=!1,this.offset=0,this.isActive=!1,this.animations=!0,this.noBarWhenZero=!0,this.select=new We,this.activate=new We,this.deactivate=new We,this.hasGradient=!1,this.hideBar=!1,this.element=e.nativeElement}ngOnChanges(e){e.roundEdges&&this.loadAnimation(),this.update()}update(){this.gradientId="grad"+e1().toString(),this.gradientFill=`url(#${this.gradientId})`,this.gradient||this.stops?(this.gradientStops=this.getGradient(),this.hasGradient=!0):this.hasGradient=!1,this.updatePathEl(),this.checkToHideBar()}loadAnimation(){this.path=this.getStartingPath(),setTimeout(this.update.bind(this),100)}updatePathEl(){const e=function(t){return"string"==typeof t?new w2([[document.querySelector(t)]],[document.documentElement]):new w2([[t]],zz)}(this.element).select(".bar"),i=this.getPath();this.animations?e.transition().duration(500).attr("d",i):e.attr("d",i)}getGradient(){return this.stops?this.stops:[{offset:0,color:this.fill,opacity:this.getStartOpacity()},{offset:100,color:this.fill,opacity:1}]}getStartingPath(){if(!this.animations)return this.getPath();let i,e=this.getRadius();return this.roundEdges?this.orientation===Yr.Vertical?(e=Math.min(this.height,e),i=kc(this.x,this.y+this.height,this.width,1,0,this.edges)):this.orientation===Yr.Horizontal&&(e=Math.min(this.width,e),i=kc(this.x,this.y,1,this.height,0,this.edges)):this.orientation===Yr.Vertical?i=kc(this.x,this.y+this.height,this.width,1,0,this.edges):this.orientation===Yr.Horizontal&&(i=kc(this.x,this.y,1,this.height,0,this.edges)),i}getPath(){let i,e=this.getRadius();return this.roundEdges?this.orientation===Yr.Vertical?(e=Math.min(this.height,e),i=kc(this.x,this.y,this.width,this.height,e,this.edges)):this.orientation===Yr.Horizontal&&(e=Math.min(this.width,e),i=kc(this.x,this.y,this.width,this.height,e,this.edges)):i=kc(this.x,this.y,this.width,this.height,e,this.edges),i}getRadius(){let e=0;return this.roundEdges&&this.height>5&&this.width>5&&(e=Math.floor(Math.min(5,this.height/2,this.width/2))),e}getStartOpacity(){return this.roundEdges?.2:.5}get edges(){let e=[!1,!1,!1,!1];return this.roundEdges&&(this.orientation===Yr.Vertical?e=this.data.value>0?[!0,!0,!1,!1]:[!1,!1,!0,!0]:this.orientation===Yr.Horizontal&&(e=this.data.value>0?[!1,!0,!1,!0]:[!0,!1,!0,!1])),e}onMouseEnter(){this.activate.emit(this.data)}onMouseLeave(){this.deactivate.emit(this.data)}checkToHideBar(){this.hideBar=this.noBarWhenZero&&(this.orientation===Yr.Vertical&&0===this.height||this.orientation===Yr.Horizontal&&0===this.width)}}return t.\u0275fac=function(e){return new(e||t)(B(rn))},t.\u0275cmp=ht({type:t,selectors:[["g","ngx-charts-bar",""]],hostBindings:function(e,i){1&e&&ot("mouseenter",function(){return i.onMouseEnter()})("mouseleave",function(){return i.onMouseLeave()})},inputs:{roundEdges:"roundEdges",gradient:"gradient",offset:"offset",isActive:"isActive",animations:"animations",noBarWhenZero:"noBarWhenZero",fill:"fill",data:"data",width:"width",height:"height",x:"x",y:"y",orientation:"orientation",stops:"stops",ariaLabel:"ariaLabel"},outputs:{select:"select",activate:"activate",deactivate:"deactivate"},features:[kn],attrs:Hue,decls:2,vars:8,consts:[[4,"ngIf"],["stroke","none","role","img","tabIndex","-1",1,"bar",3,"click"],["ngx-charts-svg-linear-gradient","",3,"orientation","name","stops"]],template:function(e,i){1&e&&(ft(0,Bue,2,3,"defs",0),ct(),I(1,"path",1),ot("click",function(){return i.select.emit(i.data)}),z()),2&e&&(Q("ngIf",i.hasGradient),K(1),eo("active",i.isActive)("hidden",i.hideBar),St("d",i.path)("aria-label",i.ariaLabel)("fill",i.hasGradient?i.gradientFill:i.fill))},directives:[di,ph],encapsulation:2,changeDetection:0}),t})();var Vo=(()=>(function(t){t.Standard="standard",t.Normalized="normalized",t.Stacked="stacked"}(Vo||(Vo={})),Vo))();let Y0e=(()=>{class t extends Us{constructor(){super(...arguments),this.legend=!1,this.legendTitle="Legend",this.legendPosition=As.Right,this.tooltipDisabled=!1,this.showGridLines=!0,this.activeEntries=[],this.trimXAxisTicks=!0,this.trimYAxisTicks=!0,this.rotateXAxisTicks=!0,this.maxXAxisTickLength=16,this.maxYAxisTickLength=16,this.barPadding=8,this.roundDomains=!1,this.roundEdges=!0,this.showDataLabel=!1,this.noBarWhenZero=!0,this.activate=new We,this.deactivate=new We,this.margin=[10,20,10,20],this.xAxisHeight=0,this.yAxisWidth=0,this.dataLabelMaxHeight={negative:0,positive:0}}update(){super.update(),this.showDataLabel||(this.dataLabelMaxHeight={negative:0,positive:0}),this.margin=[10+this.dataLabelMaxHeight.positive,20,10+this.dataLabelMaxHeight.negative,20],this.dims=function({width:t,height:n,margins:e,showXAxis:i=!1,showYAxis:r=!1,xAxisHeight:s=0,yAxisWidth:c=0,showXLabel:h=!1,showYLabel:g=!1,showLegend:x=!1,legendType:S=wt.Ordinal,legendPosition:E=As.Right,columns:A=12}){let F=e[3],j=t,ie=n-e[0]-e[2];if(x&&E===As.Right&&(A-=S===wt.Ordinal?2:1),j=j*A/12,j=j-e[1]-e[3],i&&(ie-=5,ie-=s,h&&(ie-=30)),r&&(j-=5,j-=c,F+=c,F+=10,g)){const W=30;j-=W,F+=W}return j=Math.max(0,j),ie=Math.max(0,ie),{width:Math.floor(j),height:Math.floor(ie),xOffset:Math.floor(F)}}({width:this.width,height:this.height,margins:this.margin,showXAxis:this.xAxis,showYAxis:this.yAxis,xAxisHeight:this.xAxisHeight,yAxisWidth:this.yAxisWidth,showXLabel:this.showXAxisLabel,showYLabel:this.showYAxisLabel,showLegend:this.legend,legendType:this.schemeType,legendPosition:this.legendPosition}),this.formatDates(),this.showDataLabel&&(this.dims.height-=this.dataLabelMaxHeight.negative),this.xScale=this.getXScale(),this.yScale=this.getYScale(),this.setColors(),this.legendOptions=this.getLegendOptions(),this.transform=`translate(${this.dims.xOffset} , ${this.margin[0]+this.dataLabelMaxHeight.negative})`}getXScale(){this.xDomain=this.getXDomain();const e=this.xDomain.length/(this.dims.width/this.barPadding+1);return ka().range([0,this.dims.width]).paddingInner(e).domain(this.xDomain)}getYScale(){this.yDomain=this.getYDomain();const e=cs().range([this.dims.height,0]).domain(this.yDomain);return this.roundDomains?e.nice():e}getXDomain(){return this.results.map(e=>e.label)}getYDomain(){const e=this.results.map(s=>s.value);let i=this.yScaleMin?Math.min(this.yScaleMin,...e):Math.min(0,...e);this.yAxisTicks&&!this.yAxisTicks.some(isNaN)&&(i=Math.min(i,...this.yAxisTicks));let r=this.yScaleMax?Math.max(this.yScaleMax,...e):Math.max(0,...e);return this.yAxisTicks&&!this.yAxisTicks.some(isNaN)&&(r=Math.max(r,...this.yAxisTicks)),[i,r]}onClick(e){this.select.emit(e)}setColors(){let e;e=this.schemeType===wt.Ordinal?this.xDomain:this.yDomain,this.colors=new so(this.scheme,this.schemeType,e,this.customColors)}getLegendOptions(){const e={scaleType:this.schemeType,colors:void 0,domain:[],title:void 0,position:this.legendPosition};return e.scaleType===wt.Ordinal?(e.domain=this.xDomain,e.colors=this.colors,e.title=this.legendTitle):(e.domain=this.yDomain,e.colors=this.colors.scale),e}updateYAxisWidth({width:e}){this.yAxisWidth=e,this.update()}updateXAxisHeight({height:e}){this.xAxisHeight=e,this.update()}onDataLabelMaxHeightChanged(e){e.size.negative?this.dataLabelMaxHeight.negative=Math.max(this.dataLabelMaxHeight.negative,e.size.height):this.dataLabelMaxHeight.positive=Math.max(this.dataLabelMaxHeight.positive,e.size.height),e.index===this.results.length-1&&setTimeout(()=>this.update())}onActivate(e,i=!1){e=this.results.find(s=>i?s.label===e.name:s.name===e.name),!(this.activeEntries.findIndex(s=>s.name===e.name&&s.value===e.value&&s.series===e.series)>-1)&&(this.activeEntries=[e,...this.activeEntries],this.activate.emit({value:e,entries:this.activeEntries}))}onDeactivate(e,i=!1){e=this.results.find(s=>i?s.label===e.name:s.name===e.name);const r=this.activeEntries.findIndex(s=>s.name===e.name&&s.value===e.value&&s.series===e.series);this.activeEntries.splice(r,1),this.activeEntries=[...this.activeEntries],this.deactivate.emit({value:e,entries:this.activeEntries})}}return t.\u0275fac=function(){let n;return function(i){return(n||(n=ci(t)))(i||t)}}(),t.\u0275cmp=ht({type:t,selectors:[["ngx-charts-bar-vertical"]],contentQueries:function(e,i,r){if(1&e&&ur(r,Po,5),2&e){let s;ai(s=li())&&(i.tooltipTemplate=s.first)}},inputs:{legend:"legend",legendTitle:"legendTitle",legendPosition:"legendPosition",tooltipDisabled:"tooltipDisabled",showGridLines:"showGridLines",activeEntries:"activeEntries",trimXAxisTicks:"trimXAxisTicks",trimYAxisTicks:"trimYAxisTicks",rotateXAxisTicks:"rotateXAxisTicks",maxXAxisTickLength:"maxXAxisTickLength",maxYAxisTickLength:"maxYAxisTickLength",barPadding:"barPadding",roundDomains:"roundDomains",roundEdges:"roundEdges",showDataLabel:"showDataLabel",noBarWhenZero:"noBarWhenZero",xAxis:"xAxis",yAxis:"yAxis",showXAxisLabel:"showXAxisLabel",showYAxisLabel:"showYAxisLabel",xAxisLabel:"xAxisLabel",yAxisLabel:"yAxisLabel",gradient:"gradient",schemeType:"schemeType",xAxisTickFormatting:"xAxisTickFormatting",yAxisTickFormatting:"yAxisTickFormatting",xAxisTicks:"xAxisTicks",yAxisTicks:"yAxisTicks",yScaleMax:"yScaleMax",yScaleMin:"yScaleMin",dataLabelFormatting:"dataLabelFormatting"},outputs:{activate:"activate",deactivate:"deactivate"},features:[Ln],decls:5,vars:25,consts:[[3,"view","showLegend","legendOptions","activeEntries","animations","legendLabelClick","legendLabelActivate","legendLabelDeactivate"],[1,"bar-chart","chart"],["ngx-charts-x-axis","",3,"xScale","dims","showGridLines","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","xAxisOffset","dimensionsChanged",4,"ngIf"],["ngx-charts-y-axis","",3,"yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","dimensionsChanged",4,"ngIf"],["ngx-charts-series-vertical","",3,"xScale","yScale","colors","series","dims","gradient","tooltipDisabled","tooltipTemplate","showDataLabel","dataLabelFormatting","activeEntries","roundEdges","animations","noBarWhenZero","activate","deactivate","select","dataLabelHeightChanged"],["ngx-charts-x-axis","",3,"xScale","dims","showGridLines","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","xAxisOffset","dimensionsChanged"],["ngx-charts-y-axis","",3,"yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","dimensionsChanged"]],template:function(e,i){1&e&&(I(0,"ngx-charts-chart",0),ot("legendLabelClick",function(s){return i.onClick(s)})("legendLabelActivate",function(s){return i.onActivate(s,!0)})("legendLabelDeactivate",function(s){return i.onDeactivate(s,!0)}),ct(),I(1,"g",1),ft(2,Jue,1,11,"g",2),ft(3,ehe,1,9,"g",3),I(4,"g",4),ot("activate",function(s){return i.onActivate(s)})("deactivate",function(s){return i.onDeactivate(s)})("select",function(s){return i.onClick(s)})("dataLabelHeightChanged",function(s){return i.onDataLabelMaxHeightChanged(s)}),z(),z(),z()),2&e&&(Q("view",function(t,n,e,i,r){return uL(un(),uo(),t,n,e,i,r)}(22,ys,i.width,i.height))("showLegend",i.legend)("legendOptions",i.legendOptions)("activeEntries",i.activeEntries)("animations",i.animations),K(1),St("transform",i.transform),K(1),Q("ngIf",i.xAxis),K(1),Q("ngIf",i.yAxis),K(1),Q("xScale",i.xScale)("yScale",i.yScale)("colors",i.colors)("series",i.results)("dims",i.dims)("gradient",i.gradient)("tooltipDisabled",i.tooltipDisabled)("tooltipTemplate",i.tooltipTemplate)("showDataLabel",i.showDataLabel)("dataLabelFormatting",i.dataLabelFormatting)("activeEntries",i.activeEntries)("roundEdges",i.roundEdges)("animations",i.animations)("noBarWhenZero",i.noBarWhenZero))},directives:function(){return[Bs,di,I9,q1,I1]},styles:[".ngx-charts-outer{-webkit-animation:chartFadeIn linear .6s;animation:chartFadeIn linear .6s}@-webkit-keyframes chartFadeIn{0%{opacity:0}20%{opacity:0}to{opacity:1}}@keyframes chartFadeIn{0%{opacity:0}20%{opacity:0}to{opacity:1}}.ngx-charts{float:left;overflow:visible}.ngx-charts .circle,.ngx-charts .cell,.ngx-charts .bar,.ngx-charts .arc{cursor:pointer}.ngx-charts .bar.active,.ngx-charts .bar:hover,.ngx-charts .cell.active,.ngx-charts .cell:hover,.ngx-charts .arc.active,.ngx-charts .arc:hover,.ngx-charts .card.active,.ngx-charts .card:hover{opacity:.8;transition:opacity .1s ease-in-out}.ngx-charts .bar:focus,.ngx-charts .cell:focus,.ngx-charts .arc:focus,.ngx-charts .card:focus{outline:none}.ngx-charts .bar.hidden,.ngx-charts .cell.hidden,.ngx-charts .arc.hidden,.ngx-charts .card.hidden{display:none}.ngx-charts g:focus{outline:none}.ngx-charts .line-series.inactive,.ngx-charts .line-series-range.inactive,.ngx-charts .polar-series-path.inactive,.ngx-charts .polar-series-area.inactive,.ngx-charts .area-series.inactive{transition:opacity .1s ease-in-out;opacity:.2}.ngx-charts .line-highlight{display:none}.ngx-charts .line-highlight.active{display:block}.ngx-charts .area{opacity:.6}.ngx-charts .circle:hover{cursor:pointer}.ngx-charts .label{font-size:12px;font-weight:normal}.ngx-charts .tooltip-anchor{fill:#000}.ngx-charts .gridline-path{stroke:#ddd;stroke-width:1;fill:none}.ngx-charts .refline-path{stroke:#a8b2c7;stroke-width:1;stroke-dasharray:5;stroke-dashoffset:5}.ngx-charts .refline-label{font-size:9px}.ngx-charts .reference-area{fill-opacity:.05;fill:#000}.ngx-charts .gridline-path-dotted{stroke:#ddd;stroke-width:1;fill:none;stroke-dasharray:1,20;stroke-dashoffset:3}.ngx-charts .grid-panel rect{fill:none}.ngx-charts .grid-panel.odd rect{fill:#0000000d}\n"],encapsulation:2,changeDetection:0}),t})();var il=(()=>(function(t){t.positive="positive",t.negative="negative"}(il||(il={})),il))();let I9=(()=>{class t{constructor(){this.type=Vo.Standard,this.tooltipDisabled=!1,this.animations=!0,this.showDataLabel=!1,this.noBarWhenZero=!0,this.select=new We,this.activate=new We,this.deactivate=new We,this.dataLabelHeightChanged=new We,this.barsForDataLabels=[],this.barOrientation=Yr}ngOnChanges(e){this.update()}update(){let e;this.updateTooltipSettings(),this.series.length&&(e=this.xScale.bandwidth()),e=Math.round(e);const i=Math.max(this.yScale.domain()[0],0),r={[il.positive]:0,[il.negative]:0};let c,s=il.positive;this.type===Vo.Normalized&&(c=this.series.map(h=>h.value).reduce((h,g)=>h+g,0)),this.bars=this.series.map((h,g)=>{let x=h.value;const S=this.getLabel(h),E=Ia(S);s=x>0?il.positive:il.negative;const F={value:x,label:S,roundEdges:this.roundEdges,data:h,width:e,formattedLabel:E,height:0,x:0,y:0};if(this.type===Vo.Standard)F.height=Math.abs(this.yScale(x)-this.yScale(i)),F.x=this.xScale(S),F.y=this.yScale(x<0?0:x);else if(this.type===Vo.Stacked){const ie=r[s],W=ie+x;r[s]+=x,F.height=this.yScale(ie)-this.yScale(W),F.x=0,F.y=this.yScale(W),F.offset0=ie,F.offset1=W}else if(this.type===Vo.Normalized){let ie=r[s],W=ie+x;r[s]+=x,c>0?(ie=100*ie/c,W=100*W/c):(ie=0,W=0),F.height=this.yScale(ie)-this.yScale(W),F.x=0,F.y=this.yScale(W),F.offset0=ie,F.offset1=W,x=(W-ie).toFixed(2)+"%"}this.colors.scaleType===wt.Ordinal?F.color=this.colors.getColor(S):this.type===Vo.Standard?(F.color=this.colors.getColor(x),F.gradientStops=this.colors.getLinearGradientStops(x)):(F.color=this.colors.getColor(F.offset1),F.gradientStops=this.colors.getLinearGradientStops(F.offset1,F.offset0));let j=E;return F.ariaLabel=E+" "+x.toLocaleString(),null!=this.seriesName&&(j=`${this.seriesName} \u2022 ${E}`,F.data.series=this.seriesName,F.ariaLabel=this.seriesName+" "+F.ariaLabel),F.tooltipText=this.tooltipDisabled?void 0:`\n ${function(t){return t.toLocaleString().replace(/[&'`"<>]/g,n=>({"&":"&","'":"'","`":"`",'"':""","<":"<",">":">"}[n]))}(j)}\n ${this.dataLabelFormatting?this.dataLabelFormatting(x):x.toLocaleString()}\n `,F}),this.updateDataLabels()}updateDataLabels(){if(this.type===Vo.Stacked){this.barsForDataLabels=[];const e={};e.series=this.seriesName;const i=this.series.map(s=>s.value).reduce((s,c)=>c>0?s+c:s,0),r=this.series.map(s=>s.value).reduce((s,c)=>c<0?s+c:s,0);e.total=i+r,e.x=0,e.y=0,e.height=this.yScale(e.total>0?i:r),e.width=this.xScale.bandwidth(),this.barsForDataLabels.push(e)}else this.barsForDataLabels=this.series.map(e=>{var i;const r={};return r.series=null!==(i=this.seriesName)&&void 0!==i?i:e.label,r.total=e.value,r.x=this.xScale(e.label),r.y=this.yScale(0),r.height=this.yScale(r.total)-this.yScale(0),r.width=this.xScale.bandwidth(),r})}updateTooltipSettings(){this.tooltipPlacement=this.tooltipDisabled?void 0:ki.Top,this.tooltipType=this.tooltipDisabled?void 0:z1.tooltip}isActive(e){return!!this.activeEntries&&void 0!==this.activeEntries.find(r=>e.name===r.name&&e.value===r.value)}onClick(e){this.select.emit(e)}getLabel(e){return e.label?e.label:e.name}trackBy(e,i){return i.label}trackDataLabelBy(e,i){return e+"#"+i.series+"#"+i.total}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=ht({type:t,selectors:[["g","ngx-charts-series-vertical",""]],inputs:{type:"type",tooltipDisabled:"tooltipDisabled",animations:"animations",showDataLabel:"showDataLabel",noBarWhenZero:"noBarWhenZero",dims:"dims",series:"series",xScale:"xScale",yScale:"yScale",colors:"colors",gradient:"gradient",activeEntries:"activeEntries",seriesName:"seriesName",tooltipTemplate:"tooltipTemplate",roundEdges:"roundEdges",dataLabelFormatting:"dataLabelFormatting"},outputs:{select:"select",activate:"activate",deactivate:"deactivate",dataLabelHeightChanged:"dataLabelHeightChanged"},features:[kn],attrs:phe,decls:2,vars:3,consts:[["ngx-charts-bar","","ngx-tooltip","",3,"width","height","x","y","fill","stops","data","orientation","roundEdges","gradient","ariaLabel","isActive","tooltipDisabled","tooltipPlacement","tooltipType","tooltipTitle","tooltipTemplate","tooltipContext","noBarWhenZero","animations","select","activate","deactivate",4,"ngFor","ngForOf","ngForTrackBy"],[4,"ngIf"],["ngx-charts-bar","","ngx-tooltip","",3,"width","height","x","y","fill","stops","data","orientation","roundEdges","gradient","ariaLabel","isActive","tooltipDisabled","tooltipPlacement","tooltipType","tooltipTitle","tooltipTemplate","tooltipContext","noBarWhenZero","animations","select","activate","deactivate"],["ngx-charts-bar-label","",3,"barX","barY","barWidth","barHeight","value","valueFormatting","orientation","dimensionsChanged",4,"ngFor","ngForOf","ngForTrackBy"],["ngx-charts-bar-label","",3,"barX","barY","barWidth","barHeight","value","valueFormatting","orientation","dimensionsChanged"]],template:function(e,i){1&e&&(ft(0,mhe,1,22,"g",0),ft(1,Che,2,2,"g",1)),2&e&&(Q("ngForOf",i.bars)("ngForTrackBy",i.trackBy),K(1),Q("ngIf",i.showDataLabel))},directives:function(){return[tr,di,Gb,Gl,nF]},encapsulation:2,data:{animation:[T1("animationState",[Qa(":leave",[Lr({opacity:1}),Ka(500,Lr({opacity:0}))])])]},changeDetection:0}),t})(),nF=(()=>{class t{constructor(e){this.dimensionsChanged=new We,this.horizontalPadding=2,this.verticalPadding=5,this.element=e.nativeElement}ngOnChanges(e){this.update()}getSize(){return{height:this.element.getBoundingClientRect().height,width:this.element.getBoundingClientRect().width,negative:this.value<0}}ngAfterViewInit(){this.dimensionsChanged.emit(this.getSize())}update(){this.formatedValue=this.valueFormatting?this.valueFormatting(this.value):Ia(this.value),"horizontal"===this.orientation?(this.x=this.barX+this.barWidth,this.value<0?(this.x=this.x-this.horizontalPadding,this.textAnchor="end"):(this.x=this.x+this.horizontalPadding,this.textAnchor="start"),this.y=this.barY+this.barHeight/2):(this.x=this.barX+this.barWidth/2,this.y=this.barY+this.barHeight,this.value<0?(this.y=this.y+this.verticalPadding,this.textAnchor="end"):(this.y=this.y-this.verticalPadding,this.textAnchor="start"),this.transform=`rotate(-45, ${this.x} , ${this.y})`)}}return t.\u0275fac=function(e){return new(e||t)(B(rn))},t.\u0275cmp=ht({type:t,selectors:[["g","ngx-charts-bar-label",""]],inputs:{value:"value",valueFormatting:"valueFormatting",barX:"barX",barY:"barY",barWidth:"barWidth",barHeight:"barHeight",orientation:"orientation"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[kn],attrs:vhe,decls:2,vars:5,consts:[["alignment-baseline","middle",1,"textDataLabel"]],template:function(e,i){1&e&&(ct(),I(0,"text",0),gt(1),z()),2&e&&(St("text-anchor",i.textAnchor)("transform",i.transform)("x",i.x)("y",i.y),K(1),Qi(" ",i.formatedValue," "))},styles:[".textDataLabel[_ngcontent-%COMP%]{font-size:11px}"],changeDetection:0}),t})(),iF=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[Wl]]}),t})(),J0e=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[Wl]]}),t})(),tde=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[Wl]]}),t})(),rde=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[Wl]]}),t})(),aF=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[Wl]]}),t})();Math;let qb=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[Wl]]}),t})(),cde=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[Wl,qb,aF]]}),t})(),fde=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[Wl]]}),t})(),gde=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[Wl]]}),t})(),yde=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[Wl,qb,iF]]}),t})(),xde=(()=>{class t{constructor(){"undefined"!=typeof SVGElement&&void 0===SVGElement.prototype.contains&&(SVGElement.prototype.contains=HTMLDivElement.prototype.contains)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[Wl,Z0e,iF,J0e,tde,rde,aF,cde,fde,qb,gde,yde]}),t})();const O3=["stripeElementRef"];function bde(t,n){1&t&&function(t,n,e){_1(t,n,e),x1()}(0,3),2&t&&Q("ngTemplateOutlet",ve().loadingTemplate)}let q4=(()=>{class t{constructor(e){this.templateRef=e}}return t.\u0275fac=function(e){return new(e||t)(B(vo))},t.\u0275dir=Tn({type:t,selectors:[["","ngxStripeLoadingTemplate",""]]}),t})();const z9=new Xt("Stripe Publishable Key"),P9=new Xt("Stripe Options"),V9=new Xt("NGX_STRIPE_VERSION");let ep=(()=>{class t{constructor(e){this.platformId=e}getNativeWindow(){return X2(this.platformId)?window:{}}}return t.\u0275fac=function(e){return new(e||t)(Mt(M1))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),Xb=(()=>{class t{constructor(e){this.platformId=e}getNativeDocument(){return X2(this.platformId)?document:{}}}return t.\u0275fac=function(e){return new(e||t)(Mt(M1))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),F9=(()=>{class t{constructor(e,i,r){this.platformId=e,this.window=i,this.document=r,this.status=new S1({error:!1,loaded:!1,loading:!1})}asStream(){return this.load(),this.status.asObservable()}isReady(){return this.status.getValue().loaded}load(){if(i8(this.platformId))return;const e=this.status.getValue();if(this.window.getNativeWindow().hasOwnProperty("Stripe"))this.status.next({error:!1,loaded:!0,loading:!1});else if(!e.loaded&&!e.loading){this.status.next(Object.assign(Object.assign({},e),{loading:!0}));const i=this.document.getNativeDocument().createElement("script");i.type="text/javascript",i.async=!0,i.defer=!0,i.src="https://js.stripe.com/v3/",i.onload=()=>{this.status.next({error:!1,loaded:!0,loading:!1})},i.onerror=()=>{this.status.next({error:!0,loaded:!1,loading:!1})},this.document.getNativeDocument().body.appendChild(i)}}}return t.\u0275fac=function(e){return new(e||t)(Mt(M1),Mt(ep),Mt(Xb))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();class Zb{constructor(n,e,i,r,s){this.version=n,this.loader=e,this.window=i,this.key=r,this.options=s,this.stripe$=new S1(void 0),this.stripe=this.stripe$.asObservable().pipe(Ea(c=>Boolean(c))),this.loader.asStream().pipe(Ea(c=>!0===c.loaded),fi(),Qt(()=>this.window.getNativeWindow().Stripe)).subscribe(c=>{const h=this.options?c(this.key,this.options):c(this.key);h.registerAppInfo(this.getNgxStripeAppInfo(this.version)),this.stripe$.next(h)})}getInstance(){return this.stripe$.getValue()}elements(n){return this.stripe$.asObservable().pipe(Ea(e=>Boolean(e)),Qt(e=>e.elements(n)),fi())}redirectToCheckout(n){return this.stripe.pipe(ri(e=>Mn(e.redirectToCheckout(n))),fi())}confirmPayment(n){return this.stripe.pipe(ri(e=>Mn(e.confirmPayment(n))),fi())}confirmAcssDebitPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmAcssDebitPayment(n,e,i))),fi())}confirmAlipayPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmAlipayPayment(n,e,i))),fi())}confirmAuBecsDebitPayment(n,e){return this.stripe.pipe(ri(i=>Mn(i.confirmAuBecsDebitPayment(n,e))),fi())}confirmBancontactPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmBancontactPayment(n,e,i))),fi())}confirmBoletoPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmBoletoPayment(n,e,i))),fi())}confirmCardPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmCardPayment(n,e,i))),fi())}confirmCustomerBalancePayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmCustomerBalancePayment(n,e,i))),fi())}confirmEpsPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmEpsPayment(n,e,i))),fi())}confirmFpxPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmFpxPayment(n,e,i))),fi())}confirmGiropayPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmGiropayPayment(n,e,i))),fi())}confirmGrabPayPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmGrabPayPayment(n,e,i))),fi())}confirmIdealPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmIdealPayment(n,e,i))),fi())}confirmKlarnaPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmKlarnaPayment(n,e,i))),fi())}confirmOxxoPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmOxxoPayment(n,e,i))),fi())}confirmP24Payment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmP24Payment(n,e,i))),fi())}confirmPayNowPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmPayNowPayment(n,e,i))),fi())}confirmPayPalPayment(n,e){return this.stripe.pipe(ri(i=>Mn(i.confirmPayPalPayment(n,e))),fi())}confirmPromptPayPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmPromptPayPayment(n,e,i))),fi())}confirmSepaDebitPayment(n,e){return this.stripe.pipe(ri(i=>Mn(i.confirmSepaDebitPayment(n,e))),fi())}confirmSofortPayment(n,e){return this.stripe.pipe(ri(i=>Mn(i.confirmSofortPayment(n,e))),fi())}confirmWechatPayPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmWechatPayPayment(n,e,i))),fi())}handleCardAction(n){return this.stripe.pipe(ri(e=>Mn(e.handleCardAction(n))),fi())}verifyMicrodepositsForPayment(n,e){return this.stripe.pipe(ri(i=>Mn(i.verifyMicrodepositsForPayment(n,e))),fi())}createPaymentMethod(n){return this.stripe.pipe(ri(e=>Mn(e.createPaymentMethod(n))),fi())}retrievePaymentIntent(n){return this.stripe.pipe(ri(e=>Mn(e.retrievePaymentIntent(n))),fi())}confirmSetup(n){return this.stripe.pipe(ri(e=>Mn(e.confirmSetup(n))),fi())}confirmAcssDebitSetup(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmAcssDebitSetup(n,e,i))),fi())}confirmAuBecsDebitSetup(n,e){return this.stripe.pipe(ri(i=>Mn(i.confirmAuBecsDebitSetup(n,e))),fi())}confirmBacsDebitSetup(n,e){return this.stripe.pipe(ri(i=>Mn(i.confirmBacsDebitSetup(n,e))),fi())}confirmBancontactSetup(n,e){return this.stripe.pipe(ri(i=>Mn(i.confirmBancontactSetup(n,e))),fi())}confirmCardSetup(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmCardSetup(n,e,i))),fi())}confirmIdealSetup(n,e){return this.stripe.pipe(ri(i=>Mn(i.confirmIdealSetup(n,e))),fi())}confirmPayPalSetup(n,e){return this.stripe.pipe(ri(i=>Mn(i.confirmPayPalSetup(n,e))),fi())}confirmSepaDebitSetup(n,e){return this.stripe.pipe(ri(i=>Mn(i.confirmSepaDebitSetup(n,e))),fi())}confirmSofortSetup(n,e){return this.stripe.pipe(ri(i=>Mn(i.confirmSofortSetup(n,e))),fi())}confirmAffirmPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmAffirmPayment(n,e,i))),fi())}confirmAfterpayClearpayPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmAfterpayClearpayPayment(n,e,i))),fi())}verifyMicrodepositsForSetup(n,e){return this.stripe.pipe(ri(i=>Mn(i.verifyMicrodepositsForSetup(n,e))),fi())}retrieveSetupIntent(n){return this.stripe.pipe(ri(e=>Mn(e.retrieveSetupIntent(n))),fi())}paymentRequest(n){const e=this.getInstance();return e?e.paymentRequest(n):void 0}createToken(n,e){return this.stripe.pipe(ri(i=>Mn(i.createToken(n,e))),fi())}createSource(n,e){return this.stripe.pipe(ri(i=>Mn(i.createSource(n,e))),fi())}retrieveSource(n){return this.stripe.pipe(ri(e=>Mn(e.retrieveSource(n))),fi())}verifyIdentity(n){return this.stripe.pipe(ri(e=>Mn(e.verifyIdentity(n))),fi())}handleCardPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.handleCardPayment(n,e,i))),fi())}confirmPaymentIntent(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmPaymentIntent(n,e,i))),fi())}handleCardSetup(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.handleCardSetup(n,e,i))),fi())}confirmSetupIntent(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.confirmSetupIntent(n,e,i))),fi())}handleFpxPayment(n,e,i){return this.stripe.pipe(ri(r=>Mn(r.handleFpxPayment(n,e,i))),fi())}getNgxStripeAppInfo(n){return{name:"ngx-stripe",url:"https://ngx-stripe.dev",partner_id:"pp_partner_JR4l1rmvUoPP4V",version:n}}}let O9=(()=>{class t{constructor(e,i,r,s,c){this.version=e,this.key=i,this.options=r,this.loader=s,this.window=c,i&&(this.stripe=new Zb(this.version,this.loader,this.window,i,r))}getStripeReference(){return this.loader.asStream().pipe(Ea(e=>!0===e.loaded),Qt(()=>this.window.getNativeWindow().Stripe))}getInstance(){return this.stripe.getInstance()}setKey(e,i){return this.changeKey(e,i)}changeKey(e,i){return this.stripe=new Zb(this.version,this.loader,this.window,e,i),this.stripe}elements(e){return this.stripe.elements(e)}redirectToCheckout(e){return this.stripe.redirectToCheckout(e)}confirmPayment(e){return this.stripe.confirmPayment(e)}confirmAcssDebitPayment(e,i,r){return this.stripe.confirmAcssDebitPayment(e,i,r)}confirmAlipayPayment(e,i,r){return this.stripe.confirmAlipayPayment(e,i,r)}confirmAuBecsDebitPayment(e,i){return this.stripe.confirmAuBecsDebitPayment(e,i)}confirmBancontactPayment(e,i,r){return this.stripe.confirmBancontactPayment(e,i,r)}confirmBoletoPayment(e,i,r){return this.stripe.confirmBoletoPayment(e,i,r)}confirmCardPayment(e,i,r){return this.stripe.confirmCardPayment(e,i,r)}confirmCustomerBalancePayment(e,i,r){return this.stripe.confirmCustomerBalancePayment(e,i,r)}confirmEpsPayment(e,i,r){return this.stripe.confirmEpsPayment(e,i,r)}confirmFpxPayment(e,i,r){return this.stripe.confirmFpxPayment(e,i,r)}confirmGiropayPayment(e,i,r){return this.stripe.confirmGiropayPayment(e,i,r)}confirmGrabPayPayment(e,i,r){return this.stripe.confirmGrabPayPayment(e,i,r)}confirmIdealPayment(e,i,r){return this.stripe.confirmIdealPayment(e,i,r)}confirmKlarnaPayment(e,i,r){return this.stripe.confirmKlarnaPayment(e,i,r)}confirmOxxoPayment(e,i,r){return this.stripe.confirmOxxoPayment(e,i,r)}confirmP24Payment(e,i,r){return this.stripe.confirmP24Payment(e,i,r)}confirmPayNowPayment(e,i,r){return this.stripe.confirmPayNowPayment(e,i,r)}confirmPayPalPayment(e,i){return this.stripe.confirmPayPalPayment(e,i)}confirmPromptPayPayment(e,i,r){return this.stripe.confirmPromptPayPayment(e,i,r)}confirmSepaDebitPayment(e,i){return this.stripe.confirmSepaDebitPayment(e,i)}confirmSofortPayment(e,i){return this.stripe.confirmSofortPayment(e,i)}confirmWechatPayPayment(e,i,r){return this.stripe.confirmWechatPayPayment(e,i,r)}handleCardAction(e){return this.stripe.handleCardAction(e)}verifyMicrodepositsForPayment(e,i){return this.stripe.verifyMicrodepositsForPayment(e,i)}createPaymentMethod(e){return this.stripe.createPaymentMethod(e)}retrievePaymentIntent(e){return this.stripe.retrievePaymentIntent(e)}confirmSetup(e){return this.stripe.confirmSetup(e)}confirmAcssDebitSetup(e,i,r){return this.stripe.confirmAcssDebitSetup(e,i,r)}confirmAuBecsDebitSetup(e,i){return this.stripe.confirmAuBecsDebitSetup(e,i)}confirmBacsDebitSetup(e,i){return this.stripe.confirmBacsDebitSetup(e,i)}confirmBancontactSetup(e,i){return this.stripe.confirmBancontactSetup(e,i)}confirmCardSetup(e,i,r){return this.stripe.confirmCardSetup(e,i,r)}confirmIdealSetup(e,i){return this.stripe.confirmIdealSetup(e,i)}confirmPayPalSetup(e,i){return this.stripe.confirmPayPalSetup(e,i)}confirmSepaDebitSetup(e,i){return this.stripe.confirmSepaDebitSetup(e,i)}confirmSofortSetup(e,i){return this.stripe.confirmSofortSetup(e,i)}confirmAffirmPayment(e,i,r){return this.stripe.confirmAffirmPayment(e,i,r)}confirmAfterpayClearpayPayment(e,i,r){return this.stripe.confirmAfterpayClearpayPayment(e,i,r)}verifyMicrodepositsForSetup(e,i){return this.stripe.verifyMicrodepositsForSetup(e,i)}retrieveSetupIntent(e){return this.stripe.retrieveSetupIntent(e)}paymentRequest(e){return this.stripe.paymentRequest(e)}createToken(e,i){return this.stripe.createToken(e,i)}createSource(e,i){return this.stripe.createSource(e,i)}retrieveSource(e){return this.stripe.retrieveSource(e)}verifyIdentity(e){return this.stripe.verifyIdentity(e)}handleCardPayment(e,i,r){return this.stripe.handleCardPayment(e,i,r)}confirmPaymentIntent(e,i,r){return this.stripe.confirmPaymentIntent(e,i,r)}handleCardSetup(e,i,r){return this.stripe.handleCardSetup(e,i,r)}confirmSetupIntent(e,i,r){return this.stripe.confirmSetupIntent(e,i,r)}handleFpxPayment(e,i,r){return this.stripe.handleFpxPayment(e,i,r)}}return t.\u0275fac=function(e){return new(e||t)(Mt(V9),Mt(z9),Mt(P9),Mt(F9),Mt(ep))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),rl=(()=>{class t{constructor(e){this.stripeService=e}elements(e,i={}){return e?Object.keys(i).length>0?e.elements(i):e.elements():Object.keys(i).length>0?this.stripeService.elements(i):this.stripeService.elements()}paymentRequest(e,i){return e?e.paymentRequest(i):this.stripeService.paymentRequest(i)}mergeOptions(e,i){return!i||e&&e.classes||e&&e.classes?e||{}:Object.assign(Object.assign({},e||{}),{classes:{base:i,complete:`${i}--complete`,empty:`${i}--empty`,focus:`${i}--focus`,invalid:`${i}--invalid`,webkitAutoFill:`${i}--webkit-autoFill`}})}}return t.\u0275fac=function(e){return new(e||t)(Mt(O9))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),Yb=(()=>{class t{constructor(e){this.stripeElementsService=e,this.load=new We,this.blur=new We,this.change=new We,this.focus=new We,this.ready=new We,this.escape=new We,this.state="notready"}ngOnChanges(e){return Ja(this,void 0,void 0,function*(){this.state="starting";const i=this.stripeElementsService.mergeOptions(this.options,this.containerClass);let r=!1;(e.elementsOptions||e.stripe||!this.elements)&&(this.elements=yield this.stripeElementsService.elements(this.stripe,this.elementsOptions).toPromise(),r=!0),(e.options||e.containerClass||!this.element||r)&&(this.element&&!r?this.update(i):this.elements&&r&&this.createElement(i)),this.state="ready"})}ngOnInit(){return Ja(this,void 0,void 0,function*(){"notready"===this.state&&(this.state="starting",this.elements=yield this.stripeElementsService.elements(this.stripe).toPromise(),this.createElement(),this.state="ready")})}ngOnDestroy(){this.element&&this.element.destroy()}update(e){this.element.update(e)}getCard(){return this.element}createElement(e={}){this.element=this.elements.create("card",e),this.element.on("change",i=>this.change.emit(i)),this.element.on("blur",()=>this.blur.emit()),this.element.on("focus",()=>this.focus.emit()),this.element.on("ready",()=>this.ready.emit()),this.element.on("escape",()=>this.escape.emit()),this.element.mount(this.stripeElementRef.nativeElement),this.load.emit(this.element)}}return t.\u0275fac=function(e){return new(e||t)(B(rl))},t.\u0275cmp=ht({type:t,selectors:[["ngx-stripe-card"]],contentQueries:function(e,i,r){if(1&e&&ur(r,q4,5,vo),2&e){let s;ai(s=li())&&(i.loadingTemplate=s.first)}},viewQuery:function(e,i){if(1&e&&no(O3,5),2&e){let r;ai(r=li())&&(i.stripeElementRef=r.first)}},inputs:{containerClass:"containerClass",options:"options",elementsOptions:"elementsOptions",stripe:"stripe"},outputs:{load:"load",blur:"blur",change:"change",focus:"focus",ready:"ready",escape:"escape"},features:[kn],decls:3,vars:1,consts:[[1,"field"],["stripeElementRef",""],[3,"ngTemplateOutlet",4,"ngIf"],[3,"ngTemplateOutlet"]],template:function(e,i){1&e&&(I(0,"div",0,1),ft(2,bde,1,1,"ng-container",2),z()),2&e&&(K(2),Q("ngIf","ready"!==i.state&&i.loadingTemplate))},directives:[di,M3],encapsulation:2}),t})(),gF=(()=>{class t{constructor(e,i,r,s,c){this.version=e,this.baseKey=i,this.baseOptions=r,this.loader=s,this.window=c}create(e,i){return e||this.baseKey?new Zb(this.version,this.loader,this.window,e||this.baseKey,i||this.baseOptions):null}}return t.\u0275fac=function(e){return new(e||t)(Mt(V9),Mt(z9),Mt(P9),Mt(F9),Mt(ep))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),Rde=(()=>{class t{static forRoot(e,i){return{ngModule:t,providers:[F9,O9,gF,rl,ep,Xb,{provide:z9,useValue:e},{provide:P9,useValue:i},{provide:V9,useValue:"12.7.2"}]}}static forChild(e,i){return{ngModule:t,providers:[F9,O9,gF,rl,ep,Xb,{provide:z9,useValue:e},{provide:P9,useValue:i},{provide:V9,useValue:"12.7.2"}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[S3]]}),t})();function vF(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,i)}return e}function Kn(t){for(var n=1;nt.length)&&(n=t.length);for(var e=0,i=new Array(n);e0;)n+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[62*Math.random()|0];return n}function i5(t){for(var n=[],e=(t||[]).length>>>0;e--;)n[e]=t[e];return n}function sw(t){return t.classList?i5(t.classList):(t.getAttribute("class")||"").split(" ").filter(function(n){return n})}function OF(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function G9(t){return Object.keys(t||{}).reduce(function(n,e){return n+"".concat(e,": ").concat(t[e].trim(),";")},"")}function ow(t){return t.size!==N3.size||t.x!==N3.x||t.y!==N3.y||t.rotate!==N3.rotate||t.flipX||t.flipY}function NF(){var t="fa",n=AF,e=xi.familyPrefix,i=xi.replacementClass,r=':root, :host {\n --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid";\n --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular";\n --fa-font-light: normal 300 1em/1 "Font Awesome 6 Light";\n --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin";\n --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";\n --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-li {\n width: var(--fa-li-width, 2em);\n top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: var(--fa-counter-background-color, #ff253a);\n border-radius: var(--fa-counter-border-radius, 1em);\n box-sizing: border-box;\n color: var(--fa-inverse, #fff);\n line-height: var(--fa-counter-line-height, 1);\n max-width: var(--fa-counter-max-width, 5em);\n min-width: var(--fa-counter-min-width, 1.5em);\n overflow: hidden;\n padding: var(--fa-counter-padding, 0.25em 0.5em);\n right: var(--fa-right, 0);\n text-overflow: ellipsis;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-counter-scale, 0.25));\n transform: scale(var(--fa-counter-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: var(--fa-bottom, 0);\n right: var(--fa-right, 0);\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: var(--fa-bottom, 0);\n left: var(--fa-left, 0);\n right: auto;\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n top: var(--fa-top, 0);\n right: var(--fa-right, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: var(--fa-left, 0);\n right: auto;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-2xs {\n font-size: 0.625em;\n line-height: 0.1em;\n vertical-align: 0.225em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n line-height: 0.0833333337em;\n vertical-align: 0.125em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n line-height: 0.0714285718em;\n vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n font-size: 1.25em;\n line-height: 0.05em;\n vertical-align: -0.075em;\n}\n\n.fa-xl {\n font-size: 1.5em;\n line-height: 0.0416666682em;\n vertical-align: -0.125em;\n}\n\n.fa-2xl {\n font-size: 2em;\n line-height: 0.03125em;\n vertical-align: -0.1875em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: var(--fa-li-margin, 2.5em);\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: calc(var(--fa-li-width, 2em) * -1);\n position: absolute;\n text-align: center;\n width: var(--fa-li-width, 2em);\n line-height: inherit;\n}\n\n.fa-border {\n border-color: var(--fa-border-color, #eee);\n border-radius: var(--fa-border-radius, 0.1em);\n border-style: var(--fa-border-style, solid);\n border-width: var(--fa-border-width, 0.08em);\n padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n float: left;\n margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n float: right;\n margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n -webkit-animation-name: fa-beat;\n animation-name: fa-beat;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n -webkit-animation-name: fa-bounce;\n animation-name: fa-bounce;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n -webkit-animation-name: fa-fade;\n animation-name: fa-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n -webkit-animation-name: fa-beat-fade;\n animation-name: fa-beat-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n -webkit-animation-name: fa-flip;\n animation-name: fa-flip;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n -webkit-animation-name: fa-shake;\n animation-name: fa-shake;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 2s);\n animation-duration: var(--fa-animation-duration, 2s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, steps(8));\n animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n -webkit-animation-delay: -1ms;\n animation-delay: -1ms;\n -webkit-animation-duration: 1ms;\n animation-duration: 1ms;\n -webkit-animation-iteration-count: 1;\n animation-iteration-count: 1;\n transition-delay: 0s;\n transition-duration: 0s;\n }\n}\n@-webkit-keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@-webkit-keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@-webkit-keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@-webkit-keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@-webkit-keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@-webkit-keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n -webkit-transform: rotate(var(--fa-rotate-angle, none));\n transform: rotate(var(--fa-rotate-angle, none));\n}\n\n.fa-stack {\n display: inline-block;\n vertical-align: middle;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse,\n.fa-duotone.fa-inverse {\n color: var(--fa-inverse, #fff);\n}';if(e!==t||i!==n){var s=new RegExp("\\.".concat(t,"\\-"),"g"),c=new RegExp("\\--".concat(t,"\\-"),"g"),h=new RegExp("\\.".concat(n),"g");r=r.replace(s,".".concat(e,"-")).replace(c,"--".concat(e,"-")).replace(h,".".concat(i))}return r}var RF=!1;function aw(){xi.autoAddCss&&!RF&&(function(t){if(t&&X4){var n=Fs.createElement("style");n.setAttribute("type","text/css"),n.innerHTML=t;for(var e=Fs.head.childNodes,i=null,r=e.length-1;r>-1;r--){var s=e[r],c=(s.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(c)>-1&&(i=s)}Fs.head.insertBefore(n,i)}}(NF()),RF=!0)}var v6e={mixout:function(){return{dom:{css:NF,insertCss:aw}}},hooks:function(){return{beforeDOMElementCreation:function(){aw()},beforeI2svg:function(){aw()}}}},Y4=mh||{};Y4[Z4]||(Y4[Z4]={}),Y4[Z4].styles||(Y4[Z4].styles={}),Y4[Z4].hooks||(Y4[Z4].hooks={}),Y4[Z4].shims||(Y4[Z4].shims=[]);var Ic=Y4[Z4],HF=[],W9=!1;function _6e(t){!X4||(W9?setTimeout(t,0):HF.push(t))}function rp(t){var n=t.tag,e=t.attributes,i=void 0===e?{}:e,r=t.children,s=void 0===r?[]:r;return"string"==typeof t?OF(t):"<".concat(n," ").concat(function(t){return Object.keys(t||{}).reduce(function(n,e){return n+"".concat(e,'="').concat(OF(t[e]),'" ')},"").trim()}(i),">").concat(s.map(rp).join(""),"")}function BF(t,n,e){if(t&&t[n]&&t[n][e])return{prefix:n,iconName:e,icon:t[n][e]}}X4&&((W9=(Fs.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Fs.readyState))||Fs.addEventListener("DOMContentLoaded",function t(){Fs.removeEventListener("DOMContentLoaded",t),W9=1,HF.map(function(n){return n()})}));var lw=function(n,e,i,r){var g,x,S,s=Object.keys(n),c=s.length,h=void 0!==r?function(n,e){return function(i,r,s,c){return n.call(e,i,r,s,c)}}(e,r):e;for(void 0===i?(g=1,S=n[s[0]]):(g=0,S=i);g=55296&&r<=56319&&e2&&void 0!==arguments[2]?arguments[2]:{},i=e.skipHooks,r=void 0!==i&&i,s=UF(n);"function"!=typeof Ic.hooks.addPack||r?Ic.styles[t]=Kn(Kn({},Ic.styles[t]||{}),s):Ic.hooks.addPack(t,UF(n)),"fas"===t&&uw("fa",n)}var sp=Ic.styles,M6e=Ic.shims,S6e=Object.values(zF),hw=null,$F={},jF={},GF={},WF={},qF={},T6e=Object.keys(rw);function E6e(t,n){var e=n.split("-"),i=e[0],r=e.slice(1).join("-");return i!==t||""===r||function(t){return~o6e.indexOf(t)}(r)?null:r}var XF=function(){var n=function(s){return lw(sp,function(c,h,g){return c[g]=lw(h,s,{}),c},{})};$F=n(function(r,s,c){return s[3]&&(r[s[3]]=c),s[2]&&s[2].filter(function(g){return"number"==typeof g}).forEach(function(g){r[g.toString(16)]=c}),r}),jF=n(function(r,s,c){return r[c]=c,s[2]&&s[2].filter(function(g){return"string"==typeof g}).forEach(function(g){r[g]=c}),r}),qF=n(function(r,s,c){var h=s[2];return r[c]=c,h.forEach(function(g){r[g]=c}),r});var e="far"in sp||xi.autoFetchSvg,i=lw(M6e,function(r,s){var c=s[0],h=s[1],g=s[2];return"far"===h&&!e&&(h="fas"),"string"==typeof c&&(r.names[c]={prefix:h,iconName:g}),"number"==typeof c&&(r.unicodes[c.toString(16)]={prefix:h,iconName:g}),r},{names:{},unicodes:{}});GF=i.names,WF=i.unicodes,hw=q9(xi.styleDefault)};function dw(t,n){return($F[t]||{})[n]}function r5(t,n){return(qF[t]||{})[n]}function ZF(t){return GF[t]||{prefix:null,iconName:null}}function Ch(){return hw}function q9(t){return $9[t]||$9[rw[t]]||(t in Ic.styles?t:null)||null}function X9(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=n.skipLookups,i=void 0!==e&&e,r=null,s=t.reduce(function(c,h){var g=E6e(xi.familyPrefix,h);if(sp[h]?(h=S6e.includes(h)?e6e[h]:h,r=h,c.prefix=h):T6e.indexOf(h)>-1?(r=h,c.prefix=q9(h)):g?c.iconName=g:h!==xi.replacementClass&&c.rest.push(h),!i&&c.prefix&&c.iconName){var x="fa"===r?ZF(c.iconName):{},S=r5(c.prefix,c.iconName);x.prefix&&(r=null),c.iconName=x.iconName||S||c.iconName,c.prefix=x.prefix||c.prefix,"far"===c.prefix&&!sp.far&&sp.fas&&!xi.autoFetchSvg&&(c.prefix="fas")}return c},{prefix:null,iconName:null,rest:[]});return("fa"===s.prefix||"fa"===r)&&(s.prefix=Ch()||"fas"),s}j9.push(function(t){hw=q9(t.styleDefault)}),XF();var k6e=function(){function t(){(function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")})(this,t),this.definitions={}}return function(t,n,e){n&&yF(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"add",value:function(){for(var e=this,i=arguments.length,r=new Array(i),s=0;s0&&S.forEach(function(E){"string"==typeof E&&(e[h][E]=x)}),e[h][g]=x}),e}}]),t}(),YF=[],s5={},o5={},I6e=Object.keys(o5);function pw(t,n){for(var e=arguments.length,i=new Array(e>2?e-2:0),r=2;r1?n-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:{};return X4?(K0("beforeI2svg",n),K4("pseudoElements2svg",n),K4("i2svg",n)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.autoReplaceSvgRoot;!1===xi.autoReplaceSvg&&(xi.autoReplaceSvg=!0),xi.observeMutations=!0,_6e(function(){O6e({autoReplaceSvgRoot:e}),K0("watch",n)})}},sl={noAuto:function(){xi.autoReplaceSvg=!1,xi.observeMutations=!1,K0("noAuto")},config:xi,dom:V6e,parse:{icon:function(n){if(null===n)return null;if("object"===R9(n)&&n.prefix&&n.iconName)return{prefix:n.prefix,iconName:r5(n.prefix,n.iconName)||n.iconName};if(Array.isArray(n)&&2===n.length){var e=0===n[1].indexOf("fa-")?n[1].slice(3):n[1],i=q9(n[0]);return{prefix:i,iconName:r5(i,e)||e}}if("string"==typeof n&&(n.indexOf("".concat(xi.familyPrefix,"-"))>-1||n.match(t6e))){var r=X9(n.split(" "),{skipLookups:!0});return{prefix:r.prefix||Ch(),iconName:r5(r.prefix,r.iconName)||r.iconName}}if("string"==typeof n){var s=Ch();return{prefix:s,iconName:r5(s,n)||n}}}},library:KF,findIconDefinition:mw,toHtml:rp},O6e=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.autoReplaceSvgRoot,i=void 0===e?Fs:e;(Object.keys(Ic.styles).length>0||xi.autoFetchSvg)&&X4&&xi.autoReplaceSvg&&sl.dom.i2svg({node:i})};function Z9(t,n){return Object.defineProperty(t,"abstract",{get:n}),Object.defineProperty(t,"html",{get:function(){return t.abstract.map(function(i){return rp(i)})}}),Object.defineProperty(t,"node",{get:function(){if(X4){var i=Fs.createElement("div");return i.innerHTML=t.html,i.children}}}),t}function gw(t){var n=t.icons,e=n.main,i=n.mask,r=t.prefix,s=t.iconName,c=t.transform,h=t.symbol,g=t.title,x=t.maskId,S=t.titleId,E=t.extra,A=t.watchable,F=void 0!==A&&A,j=i.found?i:e,ie=j.width,W=j.height,Ee="fak"===r,Se=[xi.replacementClass,s?"".concat(xi.familyPrefix,"-").concat(s):""].filter(function(bi){return-1===E.classes.indexOf(bi)}).filter(function(bi){return""!==bi||!!bi}).concat(E.classes).join(" "),Ze={children:[],attributes:Kn(Kn({},E.attributes),{},{"data-prefix":r,"data-icon":s,class:Se,role:E.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(ie," ").concat(W)})},xt=Ee&&!~E.classes.indexOf("fa-fw")?{width:"".concat(ie/W*16*.0625,"em")}:{};F&&(Ze.attributes[Z0]=""),g&&(Ze.children.push({tag:"title",attributes:{id:Ze.attributes["aria-labelledby"]||"title-".concat(S||ip())},children:[g]}),delete Ze.attributes.title);var Ut=Kn(Kn({},Ze),{},{prefix:r,iconName:s,main:e,mask:i,maskId:x,transform:c,symbol:h,styles:Kn(Kn({},xt),E.styles)}),on=i.found&&e.found?K4("generateAbstractMask",Ut)||{children:[],attributes:{}}:K4("generateAbstractIcon",Ut)||{children:[],attributes:{}},hi=on.attributes;return Ut.children=on.children,Ut.attributes=hi,h?function(t){var e=t.iconName,i=t.children,r=t.attributes,s=t.symbol,c=!0===s?"".concat(t.prefix,"-").concat(xi.familyPrefix,"-").concat(e):s;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:Kn(Kn({},r),{},{id:c}),children:i}]}]}(Ut):function(t){var n=t.children,e=t.main,i=t.mask,r=t.attributes,s=t.styles,c=t.transform;if(ow(c)&&e.found&&!i.found){var x={x:e.width/e.height/2,y:.5};r.style=G9(Kn(Kn({},s),{},{"transform-origin":"".concat(x.x+c.x/16,"em ").concat(x.y+c.y/16,"em")}))}return[{tag:"svg",attributes:r,children:n}]}(Ut)}function QF(t){var n=t.content,e=t.width,i=t.height,r=t.transform,s=t.title,c=t.extra,h=t.watchable,g=void 0!==h&&h,x=Kn(Kn(Kn({},c.attributes),s?{title:s}:{}),{},{class:c.classes.join(" ")});g&&(x[Z0]="");var S=Kn({},c.styles);ow(r)&&(S.transform=function(t){var n=t.transform,e=t.width,r=t.height,s=void 0===r?16:r,c=t.startCentered,h=void 0!==c&&c,g="";return g+=h&&EF?"translate(".concat(n.x/16-(void 0===e?16:e)/2,"em, ").concat(n.y/16-s/2,"em) "):h?"translate(calc(-50% + ".concat(n.x/16,"em), calc(-50% + ").concat(n.y/16,"em)) "):"translate(".concat(n.x/16,"em, ").concat(n.y/16,"em) "),(g+="scale(".concat(n.size/16*(n.flipX?-1:1),", ").concat(n.size/16*(n.flipY?-1:1),") "))+"rotate(".concat(n.rotate,"deg) ")}({transform:r,startCentered:!0,width:e,height:i}),S["-webkit-transform"]=S.transform);var E=G9(S);E.length>0&&(x.style=E);var A=[];return A.push({tag:"span",attributes:x,children:[n]}),s&&A.push({tag:"span",attributes:{class:"sr-only"},children:[s]}),A}function H6e(t){var n=t.content,e=t.title,i=t.extra,r=Kn(Kn(Kn({},i.attributes),e?{title:e}:{}),{},{class:i.classes.join(" ")}),s=G9(i.styles);s.length>0&&(r.style=s);var c=[];return c.push({tag:"span",attributes:r,children:[n]}),e&&c.push({tag:"span",attributes:{class:"sr-only"},children:[e]}),c}var Cw=Ic.styles;function vw(t){var n=t[0],e=t[1],s=Kb(t.slice(4),1)[0];return{found:!0,width:n,height:e,icon:Array.isArray(s)?{tag:"g",attributes:{class:"".concat(xi.familyPrefix,"-").concat("duotone-group")},children:[{tag:"path",attributes:{class:"".concat(xi.familyPrefix,"-").concat("secondary"),fill:"currentColor",d:s[0]}},{tag:"path",attributes:{class:"".concat(xi.familyPrefix,"-").concat("primary"),fill:"currentColor",d:s[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:s}}}}var B6e={found:!1,width:512,height:512};function yw(t,n){var e=n;return"fa"===n&&null!==xi.styleDefault&&(n=Ch()),new Promise(function(i,r){if(K4("missingIconAbstract"),"fa"===e){var c=ZF(t)||{};t=c.iconName||t,n=c.prefix||n}if(t&&n&&Cw[n]&&Cw[n][t])return i(vw(Cw[n][t]));(function(t,n){!IF&&!xi.showMissingIcons&&t&&console.error('Icon with name "'.concat(t,'" and prefix "').concat(n,'" is missing.'))})(t,n),i(Kn(Kn({},B6e),{},{icon:xi.showMissingIcons&&t&&K4("missingIconAbstract")||{}}))})}var JF=function(){},_w=xi.measurePerformance&&U9&&U9.mark&&U9.measure?U9:{mark:JF,measure:JF},op='FA "6.0.0"',xw_begin=function(n){return _w.mark("".concat(op," ").concat(n," begins")),function(){return function(n){_w.mark("".concat(op," ").concat(n," ends")),_w.measure("".concat(op," ").concat(n),"".concat(op," ").concat(n," begins"),"".concat(op," ").concat(n," ends"))}(n)}},Y9=function(){};function tO(t){return"string"==typeof(t.getAttribute?t.getAttribute(Z0):null)}function q6e(t){return Fs.createElementNS("http://www.w3.org/2000/svg",t)}function X6e(t){return Fs.createElement(t)}function nO(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=n.ceFn,i=void 0===e?"svg"===t.tag?q6e:X6e:e;if("string"==typeof t)return Fs.createTextNode(t);var r=i(t.tag);Object.keys(t.attributes||[]).forEach(function(c){r.setAttribute(c,t.attributes[c])});var s=t.children||[];return s.forEach(function(c){r.appendChild(nO(c,{ceFn:i}))}),r}var K9={replace:function(n){var e=n[0];if(e.parentNode)if(n[1].forEach(function(r){e.parentNode.insertBefore(nO(r),e)}),null===e.getAttribute(Z0)&&xi.keepOriginalSource){var i=Fs.createComment(function(t){var n=" ".concat(t.outerHTML," ");return"".concat(n,"Font Awesome fontawesome.com ")}(e));e.parentNode.replaceChild(i,e)}else e.remove()},nest:function(n){var e=n[0],i=n[1];if(~sw(e).indexOf(xi.replacementClass))return K9.replace(n);var r=new RegExp("".concat(xi.familyPrefix,"-.*"));if(delete i[0].attributes.id,i[0].attributes.class){var s=i[0].attributes.class.split(" ").reduce(function(h,g){return g===xi.replacementClass||g.match(r)?h.toSvg.push(g):h.toNode.push(g),h},{toNode:[],toSvg:[]});i[0].attributes.class=s.toSvg.join(" "),0===s.toNode.length?e.removeAttribute("class"):e.setAttribute("class",s.toNode.join(" "))}var c=i.map(function(h){return rp(h)}).join("\n");e.setAttribute(Z0,""),e.innerHTML=c}};function iO(t){t()}function rO(t,n){var e="function"==typeof n?n:Y9;if(0===t.length)e();else{var i=iO;"async"===xi.mutateApproach&&(i=mh.requestAnimationFrame||iO),i(function(){var r=!0===xi.autoReplaceSvg?K9.replace:K9[xi.autoReplaceSvg]||K9.replace,s=xw_begin("mutate");t.map(r),s(),e()})}}var bw=!1;function sO(){bw=!0}function ww(){bw=!1}var Q9=null;function oO(t){if(LF&&xi.observeMutations){var n=t.treeCallback,e=void 0===n?Y9:n,i=t.nodeCallback,r=void 0===i?Y9:i,s=t.pseudoElementsCallback,c=void 0===s?Y9:s,h=t.observeMutationsRoot,g=void 0===h?Fs:h;Q9=new LF(function(x){if(!bw){var S=Ch();i5(x).forEach(function(E){if("childList"===E.type&&E.addedNodes.length>0&&!tO(E.addedNodes[0])&&(xi.searchPseudoElements&&c(E.target),e(E.target)),"attributes"===E.type&&E.target.parentNode&&xi.searchPseudoElements&&c(E.target.parentNode),"attributes"===E.type&&tO(E.target)&&~s6e.indexOf(E.attributeName))if("class"===E.attributeName&&function(t){var n=t.getAttribute?t.getAttribute(nw):null,e=t.getAttribute?t.getAttribute(iw):null;return n&&e}(E.target)){var A=X9(sw(E.target)),j=A.iconName;E.target.setAttribute(nw,A.prefix||S),j&&E.target.setAttribute(iw,j)}else(function(t){return t&&t.classList&&t.classList.contains&&t.classList.contains(xi.replacementClass)})(E.target)&&r(E.target)})}}),X4&&Q9.observe(g,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function K6e(t){var n=t.getAttribute("style"),e=[];return n&&(e=n.split(";").reduce(function(i,r){var s=r.split(":"),c=s[0],h=s.slice(1);return c&&h.length>0&&(i[c]=h.join(":").trim()),i},{})),e}function Q6e(t){var n=t.getAttribute("data-prefix"),e=t.getAttribute("data-icon"),i=void 0!==t.innerText?t.innerText.trim():"",r=X9(sw(t));return r.prefix||(r.prefix=Ch()),n&&e&&(r.prefix=n,r.iconName=e),r.iconName&&r.prefix||r.prefix&&i.length>0&&(r.iconName=function(t,n){return(jF[t]||{})[n]}(r.prefix,t.innerText)||dw(r.prefix,cw(t.innerText))),r}function J6e(t){var n=i5(t.attributes).reduce(function(r,s){return"class"!==r.name&&"style"!==r.name&&(r[s.name]=s.value),r},{}),e=t.getAttribute("title"),i=t.getAttribute("data-fa-title-id");return xi.autoA11y&&(e?n["aria-labelledby"]="".concat(xi.replacementClass,"-title-").concat(i||ip()):(n["aria-hidden"]="true",n.focusable="false")),n}function aO(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{styleParser:!0},e=Q6e(t),i=e.iconName,r=e.prefix,s=e.rest,c=J6e(t),h=pw("parseNodeAttributes",{},t),g=n.styleParser?K6e(t):[];return Kn({iconName:i,title:t.getAttribute("title"),titleId:t.getAttribute("data-fa-title-id"),prefix:r,transform:N3,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:s,styles:g,attributes:c}},h)}var t5e=Ic.styles;function lO(t){var n="nest"===xi.autoReplaceSvg?aO(t,{styleParser:!1}):aO(t);return~n.extra.classes.indexOf(PF)?K4("generateLayersText",t,n):K4("generateSvgReplacementMutation",t,n)}function cO(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!X4)return Promise.resolve();var e=Fs.documentElement.classList,i=function(E){return e.add("".concat(kF,"-").concat(E))},r=function(E){return e.remove("".concat(kF,"-").concat(E))},s=Object.keys(xi.autoFetchSvg?rw:t5e),c=[".".concat(PF,":not([").concat(Z0,"])")].concat(s.map(function(S){return".".concat(S,":not([").concat(Z0,"])")})).join(", ");if(0===c.length)return Promise.resolve();var h=[];try{h=i5(t.querySelectorAll(c))}catch(S){}if(!(h.length>0))return Promise.resolve();i("pending"),r("complete");var g=xw_begin("onTree"),x=h.reduce(function(S,E){try{var A=lO(E);A&&S.push(A)}catch(F){IF||"MissingIcon"===F.name&&console.error(F)}return S},[]);return new Promise(function(S,E){Promise.all(x).then(function(A){rO(A,function(){i("active"),i("complete"),r("pending"),"function"==typeof n&&n(),g(),S()})}).catch(function(A){g(),E(A)})})}function n5e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;lO(t).then(function(e){e&&rO([e],n)})}function i5e(t){return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(n||{}).icon?n:mw(n||{}),r=e.mask;return r&&(r=(r||{}).icon?r:mw(r||{})),t(i,Kn(Kn({},e),{},{mask:r}))}}var r5e=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.transform,r=void 0===i?N3:i,s=e.symbol,c=void 0!==s&&s,h=e.mask,g=void 0===h?null:h,x=e.maskId,S=void 0===x?null:x,E=e.title,A=void 0===E?null:E,F=e.titleId,j=void 0===F?null:F,ie=e.classes,W=void 0===ie?[]:ie,Ee=e.attributes,Se=void 0===Ee?{}:Ee,Ze=e.styles,xt=void 0===Ze?{}:Ze;if(n){var Ut=n.prefix,on=n.iconName,Qn=n.icon;return Z9(Kn({type:"icon"},n),function(){return K0("beforeDOMElementCreation",{iconDefinition:n,params:e}),xi.autoA11y&&(A?Se["aria-labelledby"]="".concat(xi.replacementClass,"-title-").concat(j||ip()):(Se["aria-hidden"]="true",Se.focusable="false")),gw({icons:{main:vw(Qn),mask:g?vw(g.icon):{found:!1,width:null,height:null,icon:{}}},prefix:Ut,iconName:on,transform:Kn(Kn({},N3),r),symbol:c,title:A,maskId:S,titleId:j,extra:{attributes:Se,styles:xt,classes:W}})})}},s5e={mixout:function(){return{icon:i5e(r5e)}},hooks:function(){return{mutationObserverCallbacks:function(e){return e.treeCallback=cO,e.nodeCallback=n5e,e}}},provides:function(n){n.i2svg=function(e){var i=e.node,s=e.callback;return cO(void 0===i?Fs:i,void 0===s?function(){}:s)},n.generateSvgReplacementMutation=function(e,i){var r=i.iconName,s=i.title,c=i.titleId,h=i.prefix,g=i.transform,x=i.symbol,S=i.mask,E=i.maskId,A=i.extra;return new Promise(function(F,j){Promise.all([yw(r,h),S.iconName?yw(S.iconName,S.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(ie){var W=Kb(ie,2);F([e,gw({icons:{main:W[0],mask:W[1]},prefix:h,iconName:r,transform:g,symbol:x,maskId:E,title:s,titleId:c,extra:A,watchable:!0})])}).catch(j)})},n.generateAbstractIcon=function(e){var x,i=e.children,r=e.attributes,s=e.main,c=e.transform,g=G9(e.styles);return g.length>0&&(r.style=g),ow(c)&&(x=K4("generateAbstractTransformGrouping",{main:s,transform:c,containerWidth:s.width,iconWidth:s.width})),i.push(x||s.icon),{children:i,attributes:r}}}},o5e={mixout:function(){return{layer:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.classes,s=void 0===r?[]:r;return Z9({type:"layer"},function(){K0("beforeDOMElementCreation",{assembler:e,params:i});var c=[];return e(function(h){Array.isArray(h)?h.map(function(g){c=c.concat(g.abstract)}):c=c.concat(h.abstract)}),[{tag:"span",attributes:{class:["".concat(xi.familyPrefix,"-layers")].concat(B9(s)).join(" ")},children:c}]})}}}},a5e={mixout:function(){return{counter:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.title,s=void 0===r?null:r,c=i.classes,h=void 0===c?[]:c,g=i.attributes,x=void 0===g?{}:g,S=i.styles,E=void 0===S?{}:S;return Z9({type:"counter",content:e},function(){return K0("beforeDOMElementCreation",{content:e,params:i}),H6e({content:e.toString(),title:s,extra:{attributes:x,styles:E,classes:["".concat(xi.familyPrefix,"-layers-counter")].concat(B9(h))}})})}}}},l5e={mixout:function(){return{text:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.transform,s=void 0===r?N3:r,c=i.title,h=void 0===c?null:c,g=i.classes,x=void 0===g?[]:g,S=i.attributes,E=void 0===S?{}:S,A=i.styles,F=void 0===A?{}:A;return Z9({type:"text",content:e},function(){return K0("beforeDOMElementCreation",{content:e,params:i}),QF({content:e,transform:Kn(Kn({},N3),s),title:h,extra:{attributes:E,styles:F,classes:["".concat(xi.familyPrefix,"-layers-text")].concat(B9(x))}})})}}},provides:function(n){n.generateLayersText=function(e,i){var r=i.title,s=i.transform,c=i.extra,h=null,g=null;if(EF){var x=parseInt(getComputedStyle(e).fontSize,10),S=e.getBoundingClientRect();h=S.width/x,g=S.height/x}return xi.autoA11y&&!r&&(c.attributes["aria-hidden"]="true"),Promise.resolve([e,QF({content:e.innerHTML,width:h,height:g,transform:s,title:r,extra:c,watchable:!0})])}}},c5e=new RegExp('"',"ug"),uO=[1105920,1112319];function hO(t,n){var e="".concat("data-fa-pseudo-element-pending").concat(n.replace(":","-"));return new Promise(function(i,r){if(null!==t.getAttribute(e))return i();var c=i5(t.children).filter(function(on){return on.getAttribute(tw)===n})[0],h=mh.getComputedStyle(t,n),g=h.getPropertyValue("font-family").match(n6e),x=h.getPropertyValue("font-weight"),S=h.getPropertyValue("content");if(c&&!g)return t.removeChild(c),i();if(g&&"none"!==S&&""!==S){var E=h.getPropertyValue("content"),A=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(g[2])?$9[g[2].toLowerCase()]:i6e[x],F=function(t){var n=t.replace(c5e,""),e=function(t,n){var r,e=t.length,i=t.charCodeAt(0);return i>=55296&&i<=56319&&e>1&&(r=t.charCodeAt(1))>=56320&&r<=57343?1024*(i-55296)+r-56320+65536:i}(n),i=e>=uO[0]&&e<=uO[1],r=2===n.length&&n[0]===n[1];return{value:cw(r?n[0]:n),isSecondary:i||r}}(E),j=F.value,ie=F.isSecondary,W=g[0].startsWith("FontAwesome"),Ee=dw(A,j),Se=Ee;if(W){var Ze=function(t){var n=WF[t],e=dw("fas",t);return n||(e?{prefix:"fas",iconName:e}:null)||{prefix:null,iconName:null}}(j);Ze.iconName&&Ze.prefix&&(Ee=Ze.iconName,A=Ze.prefix)}if(!Ee||ie||c&&c.getAttribute(nw)===A&&c.getAttribute(iw)===Se)i();else{t.setAttribute(e,Se),c&&t.removeChild(c);var xt={iconName:null,title:null,titleId:null,prefix:null,transform:N3,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}},Ut=xt.extra;Ut.attributes[tw]=n,yw(Ee,A).then(function(on){var Qn=gw(Kn(Kn({},xt),{},{icons:{main:on,mask:{prefix:null,iconName:null,rest:[]}},prefix:A,iconName:Se,extra:Ut,watchable:!0})),hi=Fs.createElement("svg");"::before"===n?t.insertBefore(hi,t.firstChild):t.appendChild(hi),hi.outerHTML=Qn.map(function(bi){return rp(bi)}).join("\n"),t.removeAttribute(e),i()}).catch(r)}}else i()})}function h5e(t){return Promise.all([hO(t,"::before"),hO(t,"::after")])}function d5e(t){return!(t.parentNode===document.head||~Jde.indexOf(t.tagName.toUpperCase())||t.getAttribute(tw)||t.parentNode&&"svg"===t.parentNode.tagName)}function dO(t){if(X4)return new Promise(function(n,e){var i=i5(t.querySelectorAll("*")).filter(d5e).map(h5e),r=xw_begin("searchPseudoElements");sO(),Promise.all(i).then(function(){r(),ww(),n()}).catch(function(){r(),ww(),e()})})}var fO=!1,pO=function(n){return n.toLowerCase().split(" ").reduce(function(i,r){var s=r.toLowerCase().split("-"),c=s[0],h=s.slice(1).join("-");if(c&&"h"===h)return i.flipX=!0,i;if(c&&"v"===h)return i.flipY=!0,i;if(h=parseFloat(h),isNaN(h))return i;switch(c){case"grow":i.size=i.size+h;break;case"shrink":i.size=i.size-h;break;case"left":i.x=i.x-h;break;case"right":i.x=i.x+h;break;case"up":i.y=i.y-h;break;case"down":i.y=i.y+h;break;case"rotate":i.rotate=i.rotate+h}return i},{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0})},Mw={x:0,y:0,width:"100%",height:"100%"};function mO(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.attributes&&(t.attributes.fill||n)&&(t.attributes.fill="black"),t}function g5e(t){return"g"===t.tag?t.children:[t]}!function(t,n){var e=n.mixoutsTo;YF=t,s5={},Object.keys(o5).forEach(function(i){-1===I6e.indexOf(i)&&delete o5[i]}),YF.forEach(function(i){var r=i.mixout?i.mixout():{};if(Object.keys(r).forEach(function(c){"function"==typeof r[c]&&(e[c]=r[c]),"object"===R9(r[c])&&Object.keys(r[c]).forEach(function(h){e[c]||(e[c]={}),e[c][h]=r[c][h]})}),i.hooks){var s=i.hooks();Object.keys(s).forEach(function(c){s5[c]||(s5[c]=[]),s5[c].push(s[c])})}i.provides&&i.provides(o5)})}([v6e,s5e,o5e,a5e,l5e,{hooks:function(){return{mutationObserverCallbacks:function(e){return e.pseudoElementsCallback=dO,e}}},provides:function(n){n.pseudoElements2svg=function(e){var i=e.node;xi.searchPseudoElements&&dO(void 0===i?Fs:i)}}},{mixout:function(){return{dom:{unwatch:function(){sO(),fO=!0}}}},hooks:function(){return{bootstrap:function(){oO(pw("mutationObserverCallbacks",{}))},noAuto:function(){!Q9||Q9.disconnect()},watch:function(e){var i=e.observeMutationsRoot;fO?ww():oO(pw("mutationObserverCallbacks",{observeMutationsRoot:i}))}}}},{mixout:function(){return{parse:{transform:function(e){return pO(e)}}}},hooks:function(){return{parseNodeAttributes:function(e,i){var r=i.getAttribute("data-fa-transform");return r&&(e.transform=pO(r)),e}}},provides:function(n){n.generateAbstractTransformGrouping=function(e){var i=e.main,r=e.transform,c=e.iconWidth,h={transform:"translate(".concat(e.containerWidth/2," 256)")},g="translate(".concat(32*r.x,", ").concat(32*r.y,") "),x="scale(".concat(r.size/16*(r.flipX?-1:1),", ").concat(r.size/16*(r.flipY?-1:1),") "),S="rotate(".concat(r.rotate," 0 0)"),F={outer:h,inner:{transform:"".concat(g," ").concat(x," ").concat(S)},path:{transform:"translate(".concat(c/2*-1," -256)")}};return{tag:"g",attributes:Kn({},F.outer),children:[{tag:"g",attributes:Kn({},F.inner),children:[{tag:i.icon.tag,children:i.icon.children,attributes:Kn(Kn({},i.icon.attributes),F.path)}]}]}}}},{hooks:function(){return{parseNodeAttributes:function(e,i){var r=i.getAttribute("data-fa-mask"),s=r?X9(r.split(" ").map(function(c){return c.trim()})):{prefix:null,iconName:null,rest:[]};return s.prefix||(s.prefix=Ch()),e.mask=s,e.maskId=i.getAttribute("data-fa-mask-id"),e}}},provides:function(n){n.generateAbstractMask=function(e){var i=e.children,r=e.attributes,s=e.main,c=e.mask,h=e.maskId,S=s.icon,A=c.icon,F=function(t){var n=t.transform,i=t.iconWidth,r={transform:"translate(".concat(t.containerWidth/2," 256)")},s="translate(".concat(32*n.x,", ").concat(32*n.y,") "),c="scale(".concat(n.size/16*(n.flipX?-1:1),", ").concat(n.size/16*(n.flipY?-1:1),") "),h="rotate(".concat(n.rotate," 0 0)");return{outer:r,inner:{transform:"".concat(s," ").concat(c," ").concat(h)},path:{transform:"translate(".concat(i/2*-1," -256)")}}}({transform:e.transform,containerWidth:c.width,iconWidth:s.width}),j={tag:"rect",attributes:Kn(Kn({},Mw),{},{fill:"white"})},ie=S.children?{children:S.children.map(mO)}:{},W={tag:"g",attributes:Kn({},F.inner),children:[mO(Kn({tag:S.tag,attributes:Kn(Kn({},S.attributes),F.path)},ie))]},Ee={tag:"g",attributes:Kn({},F.outer),children:[W]},Se="mask-".concat(h||ip()),Ze="clip-".concat(h||ip()),xt={tag:"mask",attributes:Kn(Kn({},Mw),{},{id:Se,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[j,Ee]},Ut={tag:"defs",children:[{tag:"clipPath",attributes:{id:Ze},children:g5e(A)},xt]};return i.push(Ut,{tag:"rect",attributes:Kn({fill:"currentColor","clip-path":"url(#".concat(Ze,")"),mask:"url(#".concat(Se,")")},Mw)}),{children:i,attributes:r}}}},{provides:function(n){var e=!1;mh.matchMedia&&(e=mh.matchMedia("(prefers-reduced-motion: reduce)").matches),n.missingIconAbstract=function(){var i=[],r={fill:"currentColor"},s={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};i.push({tag:"path",attributes:Kn(Kn({},r),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var c=Kn(Kn({},s),{},{attributeName:"opacity"}),h={tag:"circle",attributes:Kn(Kn({},r),{},{cx:"256",cy:"364",r:"28"}),children:[]};return e||h.children.push({tag:"animate",attributes:Kn(Kn({},s),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:Kn(Kn({},c),{},{values:"1;0;1;1;0;1;"})}),i.push(h),i.push({tag:"path",attributes:Kn(Kn({},r),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:e?[]:[{tag:"animate",attributes:Kn(Kn({},c),{},{values:"1;0;0;0;0;1;"})}]}),e||i.push({tag:"path",attributes:Kn(Kn({},r),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:Kn(Kn({},c),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:i}}}},{hooks:function(){return{parseNodeAttributes:function(e,i){var r=i.getAttribute("data-fa-symbol");return e.symbol=null!==r&&(""===r||r),e}}}}],{mixoutsTo:sl});var gO=sl.parse,x5e=sl.findIconDefinition,b5e=sl.icon;const CO=["*"];let vO=(()=>{class t{constructor(){this.defaultPrefix="fas",this.fallbackIcon=null,this.globalLibrary=!1}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({factory:function(){return new t},token:t,providedIn:"root"}),t})(),S5e=(()=>{class t{constructor(){this.definitions={}}addIcons(...e){for(const i of e)i.prefix in this.definitions||(this.definitions[i.prefix]={}),this.definitions[i.prefix][i.iconName]=i}addIconPacks(...e){for(const i of e){const r=Object.keys(i).map(s=>i[s]);this.addIcons(...r)}}getIconDefinition(e,i){return e in this.definitions&&i in this.definitions[e]?this.definitions[e][i]:null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({factory:function(){return new t},token:t,providedIn:"root"}),t})();const yO=t=>{const n={"fa-spin":t.spin,"fa-pulse":t.pulse,"fa-fw":t.fixedWidth,"fa-border":t.border,"fa-inverse":t.inverse,"fa-layers-counter":t.counter,"fa-flip-horizontal":"horizontal"===t.flip||"both"===t.flip,"fa-flip-vertical":"vertical"===t.flip||"both"===t.flip,[`fa-${t.size}`]:null!==t.size,[`fa-rotate-${t.rotate}`]:null!==t.rotate,[`fa-pull-${t.pull}`]:null!==t.pull,[`fa-stack-${t.stackItemSize}`]:null!=t.stackItemSize};return Object.keys(n).map(e=>n[e]?e:null).filter(e=>e)};let A5e=(()=>{class t{constructor(){this.stackItemSize="1x"}ngOnChanges(e){if("size"in e)throw new Error('fa-icon is not allowed to customize size when used inside fa-stack. Set size on the enclosing fa-stack instead: ....')}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Tn({type:t,selectors:[["fa-icon","stackItemSize",""],["fa-duotone-icon","stackItemSize",""]],inputs:{stackItemSize:"stackItemSize",size:"size"},features:[kn]}),t})(),k5e=(()=>{class t{constructor(e,i){this.renderer=e,this.elementRef=i}ngOnInit(){this.renderer.addClass(this.elementRef.nativeElement,"fa-stack")}ngOnChanges(e){"size"in e&&(null!=e.size.currentValue&&this.renderer.addClass(this.elementRef.nativeElement,`fa-${e.size.currentValue}`),null!=e.size.previousValue&&this.renderer.removeClass(this.elementRef.nativeElement,`fa-${e.size.previousValue}`))}}return t.\u0275fac=function(e){return new(e||t)(B(q2),B(rn))},t.\u0275cmp=ht({type:t,selectors:[["fa-stack"]],inputs:{size:"size"},features:[kn],ngContentSelectors:CO,decls:1,vars:0,template:function(e,i){1&e&&(Nn(),Fn(0))},encapsulation:2}),t})(),_O=(()=>{class t{constructor(e,i,r,s,c){this.sanitizer=e,this.config=i,this.iconLibrary=r,this.stackItem=s,this.classes=[],null!=c&&null==s&&console.error('FontAwesome: fa-icon and fa-duotone-icon elements must specify stackItemSize attribute when wrapped into fa-stack. Example: .')}ngOnChanges(e){if(null==this.icon&&null==this.config.fallbackIcon)return(()=>{throw new Error("Property `icon` is required for `fa-icon`/`fa-duotone-icon` components.")})();let i=null;if(i=null==this.icon?this.config.fallbackIcon:this.icon,e){const r=this.findIconDefinition(i);if(null!=r){const s=this.buildParams();this.renderIcon(r,s)}}}render(){this.ngOnChanges({})}findIconDefinition(e){const i=((t,n)=>(t=>void 0!==t.prefix&&void 0!==t.iconName)(t)?t:Array.isArray(t)&&2===t.length?{prefix:t[0],iconName:t[1]}:"string"==typeof t?{prefix:n,iconName:t}:void 0)(e,this.config.defaultPrefix);if("icon"in i)return i;const r=this.iconLibrary.getIconDefinition(i.prefix,i.iconName);if(null!=r)return r;const s=x5e(i);if(null!=s){const c="Global icon library is deprecated. Consult https://github.com/FortAwesome/angular-fontawesome/blob/master/UPGRADING.md for the migration instructions.";if("unset"===this.config.globalLibrary)console.error("FontAwesome: "+c);else if(!this.config.globalLibrary)throw new Error(c);return s}return(t=>{throw new Error(`Could not find icon with iconName=${t.iconName} and prefix=${t.prefix} in the icon library.`)})(i),null}buildParams(){const e={flip:this.flip,spin:this.spin,pulse:this.pulse,border:this.border,inverse:this.inverse,size:this.size||null,pull:this.pull||null,rotate:this.rotate||null,fixedWidth:"boolean"==typeof this.fixedWidth?this.fixedWidth:this.config.fixedWidth,stackItemSize:null!=this.stackItem?this.stackItem.stackItemSize:null},i="string"==typeof this.transform?gO.transform(this.transform):this.transform;return{title:this.title,transform:i,classes:[...yO(e),...this.classes],mask:null!=this.mask?this.findIconDefinition(this.mask):null,styles:null!=this.styles?this.styles:{},symbol:this.symbol,attributes:{role:this.a11yRole}}}renderIcon(e,i){const r=b5e(e,i);this.renderedIconHTML=this.sanitizer.bypassSecurityTrustHtml(r.html.join("\n"))}}return t.\u0275fac=function(e){return new(e||t)(B(L4),B(vO),B(S5e),B(A5e,8),B(k5e,8))},t.\u0275cmp=ht({type:t,selectors:[["fa-icon"]],hostAttrs:[1,"ng-fa-icon"],hostVars:2,hostBindings:function(e,i){2&e&&(m6("innerHTML",i.renderedIconHTML,o3),St("title",i.title))},inputs:{classes:"classes",icon:"icon",title:"title",spin:"spin",pulse:"pulse",mask:"mask",styles:"styles",flip:"flip",size:"size",pull:"pull",border:"border",inverse:"inverse",symbol:"symbol",rotate:"rotate",fixedWidth:"fixedWidth",transform:"transform",a11yRole:"a11yRole"},features:[kn],decls:0,vars:0,template:function(e,i){},encapsulation:2}),t})(),I5e=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({}),t})();var J9=ye(2958);const O5e=new Xt("MapboxApiKey"),N5e=new Xt("MapboxApiKey");let R5e=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:O5e,useValue:e.accessToken},{provide:N5e,useValue:e.geocoderAccessToken||e.accessToken}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[S3]]}),t})();class H5e{}let X1=(()=>{class t{constructor(){}storeLogin(e){localStorage.setItem("photo","data:image/png;base64,"+e.profilePic),localStorage.setItem("token",e.token),localStorage.setItem("name",e.name),localStorage.setItem("validUntil",e.validUntil),localStorage.setItem("hasSubs",e.hasSubs?"true":"false")}logoutUser(){localStorage.removeItem("photo"),localStorage.removeItem("token"),localStorage.removeItem("name"),localStorage.removeItem("hasSubs"),localStorage.removeItem("validUntil")}getLoggedUser(){const e=new H5e;return e.name=localStorage.getItem("name"),e.token=localStorage.getItem("token"),e.profilePic=localStorage.getItem("photo"),e.hasSubs="true"===localStorage.getItem("hasSubs"),e}getToken(){return localStorage.getItem("token")}getName(){return localStorage.getItem("name")}getPhoto(){return localStorage.getItem("photo")}hasSubs(){return"true"===localStorage.getItem("hasSubs")}store(e,i){localStorage.setItem(e,i)}get(e){return localStorage.getItem(e)}contains(e){return null!==localStorage.getItem(e)}remove(e){localStorage.removeItem(e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),MO=(()=>{class t{constructor(e){this.storageService=e,this.optionsBrowse="location=yes,clearsessioncache=yes,clearcache=yes"}browseUrl(e){window.open(e,"_blank",this.optionsBrowse)}}return t.\u0275fac=function(e){return new(e||t)(Mt(X1))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const Q0=new q(D4);function SO(t){return t instanceof Date&&!isNaN(+t)}class $5e{constructor(n,e){this.delay=n,this.scheduler=e}call(n,e){return e.subscribe(new Sw(n,this.delay,this.scheduler))}}class Sw extends at{constructor(n,e,i){super(n),this.delay=e,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}static dispatch(n){const e=n.source,i=e.queue,r=n.scheduler,s=n.destination;for(;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(s);if(i.length>0){const c=Math.max(0,i[0].time-r.now());this.schedule(n,c)}else this.unsubscribe(),e.active=!1}_schedule(n){this.active=!0,this.destination.add(n.schedule(Sw.dispatch,this.delay,{source:this,destination:this.destination,scheduler:n}))}scheduleNotification(n){if(!0===this.errored)return;const e=this.scheduler,i=new j5e(e.now()+this.delay,n);this.queue.push(i),!1===this.active&&this._schedule(e)}_next(n){this.scheduleNotification(b2.createNext(n))}_error(n){this.errored=!0,this.queue=[],this.destination.error(n),this.unsubscribe()}_complete(){this.scheduleNotification(b2.createComplete()),this.unsubscribe()}}class j5e{constructor(n,e){this.time=n,this.notification=e}}const ap="Service workers are disabled or not supported by this browser";class eC{constructor(n){if(this.serviceWorker=n,n){const i=D8(n,"controllerchange").pipe(Qt(()=>n.controller)),s=R7(B7(()=>Ni(n.controller)),i);this.worker=s.pipe(Ea(S=>!!S)),this.registration=this.worker.pipe(ri(()=>n.getRegistration()));const x=D8(n,"message").pipe(Qt(S=>S.data)).pipe(Ea(S=>S&&S.type)).pipe(To(new lt));x.connect(),this.events=x}else this.worker=this.events=this.registration=B7(()=>Ix(new Error("Service workers are disabled or not supported by this browser")))}postMessage(n,e){return this.worker.pipe(E4(1),v2(i=>{i.postMessage(Object.assign({action:n},e))})).toPromise().then(()=>{})}postMessageWithStatus(n,e,i){const r=this.waitForStatus(i),s=this.postMessage(n,e);return Promise.all([r,s]).then(()=>{})}generateNonce(){return Math.round(1e7*Math.random())}eventsOfType(n){return this.events.pipe(Ea(i=>i.type===n))}nextEventOfType(n){return this.eventsOfType(n).pipe(E4(1))}waitForStatus(n){return this.eventsOfType("STATUS").pipe(Ea(e=>e.nonce===n),E4(1),Qt(e=>{if(!e.status)throw new Error(e.error)})).toPromise()}get isEnabled(){return!!this.serviceWorker}}let W5e=(()=>{class t{constructor(e){if(this.sw=e,this.subscriptionChanges=new lt,!e.isEnabled)return this.messages=Q0,this.notificationClicks=Q0,void(this.subscription=Q0);this.messages=this.sw.eventsOfType("PUSH").pipe(Qt(r=>r.data)),this.notificationClicks=this.sw.eventsOfType("NOTIFICATION_CLICK").pipe(Qt(r=>r.data)),this.pushManager=this.sw.registration.pipe(Qt(r=>r.pushManager));const i=this.pushManager.pipe(ri(r=>r.getSubscription()));this.subscription=ea(i,this.subscriptionChanges)}get isEnabled(){return this.sw.isEnabled}requestSubscription(e){if(!this.sw.isEnabled)return Promise.reject(new Error(ap));const i={userVisibleOnly:!0};let r=this.decodeBase64(e.serverPublicKey.replace(/_/g,"/").replace(/-/g,"+")),s=new Uint8Array(new ArrayBuffer(r.length));for(let c=0;cc.subscribe(i)),E4(1)).toPromise().then(c=>(this.subscriptionChanges.next(c),c))}unsubscribe(){return this.sw.isEnabled?this.subscription.pipe(E4(1),ri(i=>{if(null===i)throw new Error("Not subscribed to push notifications.");return i.unsubscribe().then(r=>{if(!r)throw new Error("Unsubscribe failed!");this.subscriptionChanges.next(null)})})).toPromise():Promise.reject(new Error(ap))}decodeBase64(e){return atob(e)}}return t.\u0275fac=function(e){return new(e||t)(Mt(eC))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})(),TO=(()=>{class t{constructor(e){if(this.sw=e,!e.isEnabled)return this.available=Q0,this.activated=Q0,void(this.unrecoverable=Q0);this.available=this.sw.eventsOfType("UPDATE_AVAILABLE"),this.activated=this.sw.eventsOfType("UPDATE_ACTIVATED"),this.unrecoverable=this.sw.eventsOfType("UNRECOVERABLE_STATE")}get isEnabled(){return this.sw.isEnabled}checkForUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(ap));const e=this.sw.generateNonce();return this.sw.postMessageWithStatus("CHECK_FOR_UPDATES",{statusNonce:e},e)}activateUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(ap));const e=this.sw.generateNonce();return this.sw.postMessageWithStatus("ACTIVATE_UPDATE",{statusNonce:e},e)}}return t.\u0275fac=function(e){return new(e||t)(Mt(eC))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac}),t})();class Tw{}const LO=new Xt("NGSW_REGISTER_SCRIPT");function q5e(t,n,e,i){return()=>{if(!X2(i)||!("serviceWorker"in navigator)||!1===e.enabled)return;let s;if(navigator.serviceWorker.addEventListener("controllerchange",()=>{null!==navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({action:"INITIALIZE"})}),"function"==typeof e.registrationStrategy)s=e.registrationStrategy();else{const[h,...g]=(e.registrationStrategy||"registerWhenStable:30000").split(":");switch(h){case"registerImmediately":s=Ni(null);break;case"registerWithDelay":s=EO(+g[0]||0);break;case"registerWhenStable":s=g[0]?ea(DO(t),EO(+g[0])):DO(t);break;default:throw new Error(`Unknown ServiceWorker registration strategy: ${e.registrationStrategy}`)}}t.get(pn).runOutsideAngular(()=>s.pipe(E4(1)).subscribe(()=>navigator.serviceWorker.register(n,{scope:e.scope}).catch(h=>console.error("Service worker registration failed with:",h))))}}function EO(t){return Ni(null).pipe(function(t,n=qg){const i=SO(t)?+t-n.now():Math.abs(t);return r=>r.lift(new $5e(i,n))}(t))}function DO(t){return t.get(w4).isStable.pipe(Ea(e=>e))}function X5e(t,n){return new eC(X2(n)&&!1!==t.enabled?navigator.serviceWorker:void 0)}let Z5e=(()=>{class t{static register(e,i={}){return{ngModule:t,providers:[{provide:LO,useValue:e},{provide:Tw,useValue:i},{provide:eC,useFactory:X5e,deps:[Tw,M1]},{provide:m0,useFactory:q5e,deps:[U,LO,Tw,M1],multi:!0}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({providers:[W5e,TO]}),t})(),Y5e=(()=>{class t{constructor(e,i){this.swUpdate=e,this.toastController=i}initialise(){this.swUpdate.available.subscribe(e=>{this.showMsg()})}showMsg(){this.toastController.create({header:"Update Available",message:"The app will update and reload now.",position:"middle",duration:3275}).then(i=>{i.onDidDismiss().then(r=>{this.updateApp()}),i.present().then()})}updateApp(){this.swUpdate.activateUpdate().then(e=>{document.location.reload()})}}return t.\u0275fac=function(e){return new(e||t)(Mt(TO),Mt(yo))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function K5e(t,n){if(1&t&&(_1(0),I(1,"ion-item",18),et(2,"img",19),I(3,"ion-label"),gt(4),z(),z(),x1()),2&t){const e=ve();K(2),Q("src",e.photo,R1),K(2),Ls(e.name)}}let Q5e=(()=>{class t{constructor(e,i,r,s,c,h){this.menuController=e,this.storageService=i,this.router=r,this.domSanitizer=s,this.browserService=c,this.updateService=h}ngOnInit(){this.updateService.initialise()}showMenu(){this.name=this.storageService.getName();const e=this.storageService.getPhoto();this.photo=this.domSanitizer.bypassSecurityTrustUrl(e)}logout(){this.name=void 0,this.photo=void 0,this.menuController.close(),this.storageService.logoutUser(),this.router.navigate(["login"]),this.menuController.enable(!1)}goToFaq(){this.browserService.browseUrl("https://www.wavestracker.com/faq")}}return t.\u0275fac=function(e){return new(e||t)(B(Ec),B(X1),B(rs),B(L4),B(MO),B(Y5e))},t.\u0275cmp=ht({type:t,selectors:[["app-root"]],decls:49,vars:18,consts:[["contentId","main-content"],["contentId","main-content","swipeGesture","false",3,"ionWillOpen"],[1,"toolbar-color"],[4,"ngIf"],["auto-hide","false"],["routerLinkActive","active",3,"routerDirection","routerLink"],["slot","start","name","home-outline"],["slot","start","name","list-outline"],["slot","start","name","trophy-outline"],["slot","start","name","locate-outline"],["slot","start","name","stats-chart-outline"],["slot","start","name","flash-outline"],["slot","start","name","settings-outline"],["slot","start","name","cloud-upload-outline"],[2,"cursor","pointer",3,"click"],["slot","start","name","help-circle-outline"],["expand","block","fill","outline",1,"logout-button",3,"click"],["main","","id","main-content",3,"swipeGesture"],["lines","none",1,"toolbar-color"],["slot","start","alt","",1,"profile-pic",3,"src"]],template:function(e,i){1&e&&(I(0,"ion-app"),I(1,"ion-split-pane",0),I(2,"ion-menu",1),ot("ionWillOpen",function(){return i.showMenu()}),I(3,"ion-header"),I(4,"ion-toolbar",2),ft(5,K5e,5,2,"ng-container",3),z(),z(),I(6,"ion-content"),I(7,"ion-list"),I(8,"ion-menu-toggle",4),I(9,"ion-item",5),et(10,"ion-icon",6),I(11,"ion-label"),gt(12,"Feed"),z(),z(),I(13,"ion-item",5),et(14,"ion-icon",7),I(15,"ion-label"),gt(16,"History"),z(),z(),I(17,"ion-item",5),et(18,"ion-icon",8),I(19,"ion-label"),gt(20,"Leaderboard"),z(),z(),I(21,"ion-item",5),et(22,"ion-icon",9),I(23,"ion-label"),gt(24,"Near Me"),z(),z(),I(25,"ion-item",5),et(26,"ion-icon",10),I(27,"ion-label"),gt(28,"Statistics"),z(),z(),I(29,"ion-item",5),et(30,"ion-icon",11),I(31,"ion-label"),gt(32,"Premium"),z(),z(),I(33,"ion-item",5),et(34,"ion-icon",12),I(35,"ion-label"),gt(36,"Settings"),z(),z(),I(37,"ion-item",5),et(38,"ion-icon",13),I(39,"ion-label"),gt(40,"Upload"),z(),z(),I(41,"ion-item",14),ot("click",function(){return i.goToFaq()}),et(42,"ion-icon",15),I(43,"ion-label"),gt(44,"Help"),z(),z(),z(),z(),z(),I(45,"ion-footer"),I(46,"ion-button",16),ot("click",function(){return i.logout()}),gt(47,"Logout"),z(),z(),z(),et(48,"ion-router-outlet",17),z(),z()),2&e&&(K(5),Q("ngIf",i.name),K(4),Q("routerDirection","root")("routerLink","/feed"),K(4),Q("routerDirection","root")("routerLink","/history"),K(4),Q("routerDirection","root")("routerLink","/leaderboard"),K(4),Q("routerDirection","root")("routerLink","/near"),K(4),Q("routerDirection","root")("routerLink","/statistics"),K(4),Q("routerDirection","root")("routerLink","/premium"),K(4),Q("routerDirection","root")("routerLink","/settings"),K(4),Q("routerDirection","root")("routerLink","/upload"),K(11),Q("swipeGesture",!1))},directives:[RI,YI,UI,Ul,$l,di,K2,Mx,$I,J2,oA,oz,v8,Q2,el,BI,Tc,B6],encapsulation:2}),t})();class zc{constructor(n,e,i,r,s,c){this.loadingController=n,this.alertController=e,this.toastController=i,this.storageService=r,this.errorsService=s,this.loginService=c}createLoading(){const n=new lt;return this.loadingController.create({message:"Please wait.."}).then(r=>{n.next(r)},r=>{this.showErrorMessage(JSON.stringify(r))}),n.asObservable()}showMessage(n){const e=new lt;return this.alertController.create({header:"Attention",message:n,buttons:["OK"]}).then(r=>{r.present(),r.onDidDismiss().then(s=>{e.next(!0)},s=>{e.next(!1)})}),e.asObservable()}showErrorMessage(n){this.alertController.create({header:"Oops!",message:"Something went wrong, you may try again.",buttons:[{text:"Send Error Report",handler:()=>{const i=this.storageService.getToken();this.errorsService.registerError(i,n).subscribe(r=>{this.toastController.create({message:"Error report sent, thank you.",duration:2500}).then(s=>s.present())})}},{text:"Ok",role:"cancel"}]}).then(i=>{i.present()})}safeDelete(){return this.createConfirmDialog("Delete","It cannot be undone","Are you sure?")}createConfirmDialog(n,e,i){const r=new lt;return this.alertController.create({header:n,subHeader:e,message:i,buttons:[{text:"Cancel",role:"cancel",handler:()=>{r.next("cancel")}},{text:"Okay",handler:()=>{r.next("okay")}}]}).then(c=>{c.present()}),r.asObservable()}showToast(n){this.toastController.create({message:n,duration:2500}).then(e=>e.present())}getCommentImage(n){return n&&n.trim().length>0?"/assets/images/has_comment.png":"/assets/images/comment.png"}doUserDetailsRefresh(){const n=this.storageService.getToken();this.loginService.getUserDetails(n).subscribe(e=>{this.storageService.storeLogin(e)})}}const J5e=(()=>{function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t})();class tfe{constructor(n,e,i,r){this.waitFor=n,this.absoluteTimeout=e,this.withObservable=i,this.scheduler=r}call(n,e){return e.subscribe(new Lw(n,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))}}class Lw extends Mo{constructor(n,e,i,r,s){super(n),this.absoluteTimeout=e,this.waitFor=i,this.withObservable=r,this.scheduler=s,this.scheduleTimeout()}static dispatchTimeout(n){const{withObservable:e}=n;n._unsubscribeAndRecycle(),n.add(Jo(e,new qi(n)))}scheduleTimeout(){const{action:n}=this;n?this.action=n.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(Lw.dispatchTimeout,this.waitFor,this))}_next(n){this.absoluteTimeout||this.scheduleTimeout(),super._next(n)}_unsubscribe(){this.action=void 0,this.scheduler=null,this.withObservable=null}}function xo(t,n=qg){return function(t,n,e=qg){return i=>{let r=SO(t),s=r?+t-e.now():Math.abs(t);return i.lift(new tfe(s,r,n,e))}}(t,Ix(new J5e),n)}let Pc=(()=>{class t{constructor(e){this.httpClient=e,this.errorsUrl="https://api.wavestracker.com/api/v3/mobile/error/register"}registerError(e,i){const r=(new vs).set("appKey",e).set("message",i);return this.httpClient.get(this.errorsUrl,{params:r}).pipe(xo(8e3))}}return t.\u0275fac=function(e){return new(e||t)(Mt(_2))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),Vc=(()=>{class t{constructor(e){this.httpClient=e,this.loginUrl="https://api.wavestracker.com/api/v3/mobile/login",this.userDetailsUrl="https://api.wavestracker.com/api/v3/mobile/userDetails"}loginUser(e){let i=new vs;return i=i.set("displayName",e.displayName),i=i.set("email",e.email),i=i.set("provider",e.provider),i=i.set("userId",e.userId),this.httpClient.get(this.loginUrl,{params:i}).pipe(xo(8e3))}getUserDetails(e){let i=new vs;return i=i.set("appKey",e),this.httpClient.get(this.userDetailsUrl,{params:i}).pipe(xo(8e3))}}return t.\u0275fac=function(e){return new(e||t)(Mt(_2))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),nfe=(()=>{class t{constructor(e){this.httpClient=e,this.productsUpdateUrl="https://api.wavestracker.com/api/v3/mobile/upgrade/update"}updateSubs(e,i){const r=(new vs).set("appKey",e).set("productId",i);return this.httpClient.get(this.productsUpdateUrl,{params:r}).pipe(xo(8e3))}}return t.\u0275fac=function(e){return new(e||t)(Mt(_2))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),ife=(()=>{class t extends zc{constructor(e,i,r,s,c,h,g,x,S){super(e,i,r,s,c,h),this.loadingController=e,this.alertController=i,this.toastController=r,this.storageService=s,this.errorsService=c,this.loginService=h,this.premiumService=g,this.stripeService=x,this.httpClient=S,this.cardOptions={style:{base:{iconColor:"#666EE8",color:"#31325F",fontWeight:"300",fontFamily:'Roboto, "Helvetica Neue", Helvetica, sans-serif',fontSize:"18px","::placeholder":{color:"#CFD7E0"}}}},this.elementsOptions={locale:"en"},this.stripeApiUrl="https://api.wavestracker.com/api/v3/mobile/upgrade/payment"}getAmount(e){return"3"===e?9.99:"6"===e?16.99:"12"===e?27.99:54.99}purchaseProduct(e){e&&this.cardName?super.createLoading().subscribe(i=>{i.present();const r=this.cardName,s=this.getAmount(e);this.createPaymentIntent(s).pipe(ri(c=>this.confirmCard(c,r))).subscribe(c=>{i.dismiss(),this.handleResult(c,e)},c=>{i.dismiss(),super.showErrorMessage("Something went wrong :: msg: "+JSON.stringify(c))})}):this.showMessage("Please provide all your card details.")}handleResult(e,i){e.error?this.showErrorMessage("Something went wrong, msg: "+e.error.message):this.handlePayment(e,i)}confirmCard(e,i){return this.stripeService.confirmCardPayment(e.client_secret,{payment_method:{card:this.card.element,billing_details:{name:i}}})}handlePayment(e,i){"succeeded"===e.paymentIntent.status?(super.showToast("Subscription purchased, thank you!"),this.enablePremiumSubs(i)):super.showErrorMessage("Something went wrong :: msg: "+JSON.stringify(e))}createPaymentIntent(e){const i=Math.round(100*e);return this.httpClient.get(this.stripeApiUrl+"?amount="+i)}enablePremiumSubs(e){const i=this.toPlayStoreProduct(e);if(i){const r=this.storageService.getToken();this.premiumService.updateSubs(r,i).subscribe(s=>{this.storageService.storeLogin(s)},s=>{this.showMessage("Something went wrong while updating your subs details, take a screenshot an contact us, thanks.");const c=this.storageService.getToken();this.errorsService.registerError(c,JSON.stringify(s)).subscribe()})}}toPlayStoreProduct(e){return"3"===e?"wt_subs_3m_2q_2k18":"6"===e?"wt_subs_12m_2q_2k18":"12"===e?"wt_subs_24m_2q_2k18":void 0}}return t.\u0275fac=function(e){return new(e||t)(B(Zo),B(Io),B(yo),B(X1),B(Pc),B(Vc),B(nfe),B(O9),B(_2))},t.\u0275cmp=ht({type:t,selectors:[["app-premium"]],viewQuery:function(e,i){if(1&e&&no(Yb,5),2&e){let r;ai(r=li())&&(i.card=r.first)}},features:[Ln],decls:83,vars:6,consts:[["color","primary"],["slot","start"],[1,"full-width","info-divider"],["lines","none"],["size","12"],["name","flash-outline"],["size","12",2,"margin-top","15px"],["slot","start","name","person-outline"],["placeholder","Name on your card",3,"ngModel","ngModelChange"],["size","12",2,"margin-left","15px","margin-right","5px","margin-bottom","35px"],[3,"options","elementsOptions"],[3,"click"],["expand","block","fill","outline",1,"button-height"],[1,"premium-button-inner"],["size","6",1,"text-left"],["size","6",1,"text-right"],["slot","end","src","/assets/images/right-arrow.png",1,"arrow-icon"],["lines","none",1,"thanks-padding"],[1,"ion-text-center"],["name","heart"],["name","card-outline"]],template:function(e,i){1&e&&(I(0,"ion-header"),I(1,"ion-toolbar",0),I(2,"ion-buttons",1),et(3,"ion-menu-button"),z(),I(4,"ion-title"),gt(5," Premium "),z(),z(),z(),I(6,"ion-content"),et(7,"div",2),I(8,"ion-item",3),I(9,"ion-label"),gt(10,"REASONS TO GO PREMIUM"),z(),z(),I(11,"ion-grid"),I(12,"ion-row"),I(13,"ion-col",4),I(14,"ion-label"),I(15,"p"),et(16,"ion-icon",5),gt(17,"Support the app dev."),z(),I(18,"p"),et(19,"ion-icon",5),gt(20,"Time a wave was surfed."),z(),I(21,"p"),et(22,"ion-icon",5),gt(23,"Unlock colored longest wave."),z(),I(24,"p"),et(25,"ion-icon",5),gt(26,"Unlock all of your surf session details."),z(),z(),et(27,"br"),z(),z(),I(28,"ion-row"),I(29,"ion-col",6),I(30,"ion-item",3),I(31,"ion-label"),gt(32,"Credit card details:"),z(),z(),I(33,"ion-item"),et(34,"ion-icon",7),I(35,"ion-input",8),ot("ngModelChange",function(s){return i.cardName=s}),z(),z(),z(),z(),I(36,"ion-row"),I(37,"ion-col",9),et(38,"ngx-stripe-card",10),z(),z(),I(39,"ion-row"),I(40,"ion-col",4),I(41,"ion-label",11),ot("click",function(){return i.purchaseProduct("3")}),I(42,"ion-button",12),I(43,"div",13),I(44,"ion-grid"),I(45,"ion-row"),I(46,"ion-col",14),gt(47," 3 MONTHS "),z(),I(48,"ion-col",15),gt(49),z(),z(),z(),z(),et(50,"img",16),z(),z(),z(),z(),I(51,"ion-row"),I(52,"ion-col",4),I(53,"ion-label",11),ot("click",function(){return i.purchaseProduct("6")}),I(54,"ion-button",12),I(55,"div",13),I(56,"ion-grid"),I(57,"ion-row"),I(58,"ion-col",14),gt(59," 6 MONTHS "),z(),I(60,"ion-col",15),gt(61),z(),z(),z(),z(),et(62,"img",16),z(),z(),z(),z(),I(63,"ion-row"),I(64,"ion-col",4),I(65,"ion-label",11),ot("click",function(){return i.purchaseProduct("12")}),I(66,"ion-button",12),I(67,"div",13),I(68,"ion-grid"),I(69,"ion-row"),I(70,"ion-col",14),gt(71," 12 MONTHS "),z(),I(72,"ion-col",15),gt(73),z(),z(),z(),z(),et(74,"img",16),z(),z(),z(),z(),z(),I(75,"ion-item",17),I(76,"ion-label",18),gt(77," Thanks "),et(78,"ion-icon",19),z(),z(),I(79,"ion-item",3),I(80,"ion-label",18),gt(81," Payments made via Stripe "),et(82,"ion-icon",20),z(),z(),z()),2&e&&(K(35),Q("ngModel",i.cardName),K(3),Q("options",i.cardOptions)("elementsOptions",i.elementsOptions),K(11),Qi(" Price: ",i.getAmount("3")," AUD "),K(12),Qi(" Price: ",i.getAmount("6")," AUD "),K(12),Qi(" Price: ",i.getAmount("12")," AUD "))},directives:[Ul,$l,V4,O4,Lc,K2,J2,el,F4,N4,ih,Q2,Fg,Sc,I0,Ju,Yb,Tc],styles:[".arrow-icon[_ngcontent-%COMP%]{max-width:8px;width:auto;height:auto;margin-right:10px;margin-left:10px}.subs-padding[_ngcontent-%COMP%]{padding-top:15px}.thanks-padding[_ngcontent-%COMP%]{padding-top:30px}.premium-button-inner[_ngcontent-%COMP%]{width:100%}.button-height[_ngcontent-%COMP%]{height:55px}.text-left[_ngcontent-%COMP%]{text-align:left}.text-right[_ngcontent-%COMP%]{text-align:right}"]}),t})(),rfe=(()=>{class t{constructor(e){this.httpClient=e,this.leaderboardListUrl="https://api.wavestracker.com/api/v3/mobile/leaderboard/list"}getLeaderboard(e){const i=(new vs).set("property",e);return this.httpClient.get(this.leaderboardListUrl,{params:i}).pipe(xo(8e3))}}return t.\u0275fac=function(e){return new(e||t)(Mt(_2))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function sfe(t,n){1&t&&(_1(0),I(1,"p",1),gt(2,"\xa0"),z(),x1())}function ofe(t,n){1&t&&(_1(0),I(1,"p",2),gt(2,"\xa0"),z(),x1())}function afe(t,n){1&t&&(_1(0),I(1,"p",3),gt(2,"\xa0"),z(),x1())}let a5=(()=>{class t{constructor(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=ht({type:t,selectors:[["app-nodata"]],inputs:{nearby:"nearby",followees:"followees"},decls:3,vars:3,consts:[[4,"ngIf"],[1,"no-nearby-background","no-padding","no-margin","full-screen"],[1,"no-followees-background","no-padding","no-margin","full-screen"],[1,"no-data-background","no-padding","no-margin","full-screen"]],template:function(e,i){1&e&&(ft(0,sfe,3,0,"ng-container",0),ft(1,ofe,3,0,"ng-container",0),ft(2,afe,3,0,"ng-container",0)),2&e&&(Q("ngIf",i.nearby),K(1),Q("ngIf",i.followees),K(1),Q("ngIf",!i.nearby&&!i.followees))},directives:[di],styles:[".no-data-background[_ngcontent-%COMP%]{background-image:url(/assets/images/no-data.png);background-repeat:no-repeat;background-position:center;background-size:cover}.no-nearby-background[_ngcontent-%COMP%]{background-image:url(/assets/images/no-surf-nearby.png);background-repeat:no-repeat;background-position:center;background-size:cover}.no-followees-background[_ngcontent-%COMP%]{background-image:url(/assets/images/no-followees.png);background-repeat:no-repeat;background-position:center;background-size:cover}.no-padding[_ngcontent-%COMP%]{padding:0}.no-margin[_ngcontent-%COMP%]{margin:0}.full-screen[_ngcontent-%COMP%]{width:100%;height:80vh}"]}),t})();function lfe(t,n){1&t&&(_1(0),I(1,"div",4),et(2,"div",5),z(),x1())}function cfe(t,n){if(1&t){const e=In();I(0,"div"),I(1,"ion-item",11),ot("click",function(){const s=bt(e).$implicit;return ve(2).viewDetail(s.uuid)}),et(2,"img",12),I(3,"ion-label"),I(4,"ion-text",13),I(5,"h2",14),gt(6),z(),z(),I(7,"p",14),et(8,"ion-icon",15),gt(9),z(),z(),I(10,"ion-label",16),et(11,"img",17),et(12,"img",18),z(),z(),z()}if(2&t){const e=n.$implicit,i=n.index,r=ve(2);K(2),Wm("src","data:image/png;base64,",e.profilePic,"",R1),K(4),zl(" ",i+1,". ",e.name," "),K(3),Qi(" ",e.location," "),K(2),Df("src",r.getAward(i+1),R1)}}function ufe(t,n){if(1&t){const e=In();I(0,"div"),I(1,"ion-item-group"),I(2,"ion-item"),I(3,"ion-label"),gt(4),z(),I(5,"ion-select",6),ot("ngModelChange",function(r){return bt(e),ve().selectedOption=r})("ionChange",function(){return bt(e),ve().loadLeaderboard()}),I(6,"ion-select-option",7),gt(7,"Time Surfed"),z(),I(8,"ion-select-option",8),gt(9,"Longest Wave"),z(),I(10,"ion-select-option",9),gt(11,"Wave Count"),z(),z(),z(),ft(12,cfe,13,5,"div",10),z(),z()}if(2&t){const e=ve();K(4),Ls(e.headingDate),K(1),Q("ngModel",e.selectedOption),K(7),Q("ngForOf",e.leaderBoardList)}}function hfe(t,n){1&t&&(I(0,"div"),et(1,"app-nodata"),z())}let dfe=(()=>{class t extends zc{constructor(e,i,r,s,c,h,g,x){super(e,i,r,s,c,h),this.loadingController=e,this.alertController=i,this.toastController=r,this.storageService=s,this.errorsService=c,this.loginService=h,this.leaderboardService=g,this.router=x,this.headingDate="N/A",this.leaderBoardList=new Array,this.selectedOption="longestWave"}ngOnInit(){const e=new Date;this.headingDate=this.headingDateFmt(e),this.hasSubs=this.storageService.hasSubs(),this.loadLeaderboard()}ngAfterViewInit(){super.doUserDetailsRefresh()}headingDateFmt(e){return(["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()]+" "+e.getFullYear()).toUpperCase()}loadLeaderboard(){const e=this.selectedOption;super.createLoading().subscribe(i=>{i.present(),this.leaderboardService.getLeaderboard(e).subscribe(r=>{this.leaderBoardList=r,i.dismiss()},r=>{i.dismiss(),super.showErrorMessage(JSON.stringify(r))})})}viewDetail(e){this.router.navigate(["/view/",e],{queryParams:{origin:"leaderboard"}})}getAward(e){return e>3?"/assets/images/ribbon.png":e>1?"/assets/images/medal.png":"/assets/images/trophy.png"}}return t.\u0275fac=function(e){return new(e||t)(B(Zo),B(Io),B(yo),B(X1),B(Pc),B(Vc),B(rfe),B(rs))},t.\u0275cmp=ht({type:t,selectors:[["app-leaderboard"]],features:[Ln],decls:12,vars:3,consts:[["color","primary"],["slot","start"],[1,"full-width","info-divider"],[4,"ngIf"],[1,"ion-text-center"],["id","div-gpt-ad-1635503602059-0",2,"min-width","300px","min-height","50px"],["okText","Ok","cancelText","Cancel",3,"ngModel","ngModelChange","ionChange"],["value","timeSurfed"],["value","longestWave"],["value","waveCount"],[4,"ngFor","ngForOf"],[3,"click"],[1,"profile-pic",3,"src"],["color","black"],[1,"elipsis-text"],["name","location-outline"],[1,"ion-text-right"],[1,"reward-icon",3,"src"],["src","/assets/images/right-arrow.png",1,"place-icon","place-icon-spacing"]],template:function(e,i){1&e&&(I(0,"ion-header"),I(1,"ion-toolbar",0),I(2,"ion-buttons",1),et(3,"ion-menu-button"),z(),I(4,"ion-title"),I(5,"ion-label"),gt(6,"Leaderboard"),z(),z(),z(),z(),I(7,"ion-content"),et(8,"div",2),ft(9,lfe,3,0,"ng-container",3),ft(10,ufe,13,3,"div",3),ft(11,hfe,2,0,"div",3),z()),2&e&&(K(9),Q("ngIf",!i.hasSubs),K(1),Q("ngIf",i.leaderBoardList.length>0),K(1),Q("ngIf",!(i.leaderBoardList.length>0)))},directives:[Ul,$l,V4,O4,Lc,el,K2,di,k3,J2,XI,A3,I0,Ju,ZI,tr,R4,Q2,a5],styles:[".place-icon[_ngcontent-%COMP%]{margin:0 auto;max-width:8px;width:auto;height:auto}.place-icon-spacing[_ngcontent-%COMP%]{margin-left:8px;margin-bottom:5px}.reward-icon[_ngcontent-%COMP%]{margin:0 auto;max-width:25px;width:auto;height:auto}.elipsis-text[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),t})(),ffe=(()=>{class t{constructor(e){this.httpClient=e,this.commentsUpdateUrl="https://api.wavestracker.com/api/v3/mobile/comment/update"}updateComment(e,i,r){const s={headers:new y2({"Content-Type":"application/json","Access-Control-Allow-Origin":"*"})},c={appKey:e,surfSessionUUID:i,comment:r};return console.log("[CommentsService] updateComment :: values: "+JSON.stringify(c)),this.httpClient.post(this.commentsUpdateUrl,c,s).pipe(xo(8e3))}}return t.\u0275fac=function(e){return new(e||t)(Mt(_2))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),pfe=(()=>{class t{constructor(e,i,r,s,c){this.modalController=e,this.toastController=i,this.commentsService=r,this.domSanitizer=s,this.storageService=c}ngOnInit(){this.token=this.storageService.getToken(),this.name=this.storageService.getName();const e=this.storageService.getPhoto();this.profilePic=this.domSanitizer.bypassSecurityTrustUrl(e)}dismiss(){this.modalController.dismiss()}save(){this.commentsService.updateComment(this.token,this.uuid,this.comment).subscribe(e=>{this.modalController.dismiss({success:!0,comment:this.comment}),this.showToast("Saved Successfully")},e=>{this.modalController.dismiss({success:!1}),this.showToast("Something went wrong, try again.")})}showToast(e){this.toastController.create({message:e,duration:2500}).then(i=>i.present())}}return t.\u0275fac=function(e){return new(e||t)(B(Bg),B(yo),B(ffe),B(L4),B(X1))},t.\u0275cmp=ht({type:t,selectors:[["app-comments"]],inputs:{uuid:"uuid",location:"location",when:"when",comment:"comment"},decls:26,vars:5,consts:[[1,"full-width","info-divider"],["lines","none"],["alt","",1,"profile-pic",3,"src"],["color","black"],["name","pin"],["type","text","maxlength","250","rows","8","placeholder","You may enter some information here about your surf session. Example: board used, break name, tide, weather, etc..",3,"ngModel","ngModelChange"],[1,"divider-alignment","divider-bottom"],["size","12","text-center","",1,"column-divider"],["expand","block","fill","outline",1,"save-button",3,"click"]],template:function(e,i){1&e&&(I(0,"ion-header"),I(1,"ion-toolbar"),I(2,"ion-title"),gt(3," Comment "),z(),z(),z(),I(4,"ion-content"),I(5,"ion-item-group"),et(6,"div",0),I(7,"ion-item",1),et(8,"img",2),I(9,"ion-label"),I(10,"ion-text",3),I(11,"h2"),gt(12),z(),z(),I(13,"p"),gt(14),z(),z(),z(),I(15,"ion-item",1),I(16,"ion-label"),I(17,"p"),et(18,"ion-icon",4),gt(19),z(),z(),z(),I(20,"ion-textarea",5),ot("ngModelChange",function(s){return i.comment=s}),z(),I(21,"ion-grid",6),I(22,"ion-row"),I(23,"ion-col",7),I(24,"ion-button",8),ot("click",function(){return i.save()}),gt(25," Save Changes "),z(),z(),z(),z(),z(),z()),2&e&&(K(8),Q("src",i.profilePic,R1),K(4),Ls(i.name),K(2),Ls(i.when),K(5),Qi(" ",i.location," "),K(1),Q("ngModel",i.comment))},directives:[Ul,$l,Lc,K2,k3,J2,el,R4,Q2,KI,Sc,L8,I0,Ju,F4,N4,ih,Tc],styles:[".save-button[_ngcontent-%COMP%]{padding-left:15px;padding-right:15px;margin-top:35px}"]}),t})();class AO{constructor(n){n&&(this.id=n.id,this.maxSpeed=n.maxSpeed,this.avgSpeed=n.avgSpeed,this.distance=n.distance,this.time=n.time)}toTimestamp(){const n=this.toValidTime(),e=new Date;return e.setHours(n[0],n[1],n[2],0),e.getTime()}toValidTime(){if(this.time){const n=this.time.split(" "),e=n[0].split(":");let r=e[0];const s=e[1],c=e[2];return"12"===r&&(r="00"),"PM"===n[1]&&(r=parseInt(r,10)+12+""),[parseInt(r,10),parseInt(s,10),parseInt(c,10)]}return[0,0,0]}}let mfe=(()=>{class t{constructor(e){this.httpClient=e,this.editViewUrl="https://api.wavestracker.com/api/v3/mobile/edit/view",this.editDeleteUrl="https://api.wavestracker.com/api/v3/mobile/edit/delete",this.updateSurfSessionUrl="https://api.wavestracker.com/api/v3/mobile/edit/update"}getSurfSession(e,i){const r=(new vs).set("appKey",e).set("uuid",i);return this.httpClient.get(this.editViewUrl,{params:r}).pipe(xo(38e3))}deleteWaveData(e,i){const r=""+i,s=(new vs).set("appKey",e).set("id",r);return this.httpClient.get(this.editDeleteUrl,{params:s}).pipe(xo(38e3))}updateSurfSession(e,i){const r={headers:new y2({"Content-Type":"application/json","Access-Control-Allow-Origin":"*",Token:e})};return this.httpClient.post(this.updateSurfSessionUrl,i,r).pipe(xo(8e3))}}return t.\u0275fac=function(e){return new(e||t)(Mt(_2))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function gfe(t,n){if(1&t){const e=In();I(0,"div"),I(1,"ion-item",14),I(2,"ion-label"),gt(3),z(),I(4,"ion-button",15),ot("click",function(){const r=bt(e),s=r.$implicit,c=r.index;return ve(2).deleteWaveData(s,c)}),gt(5,"Delete"),z(),z(),z()}if(2&t){const e=n.$implicit,i=n.index;K(3),bv("Wave: ",i+1," | Distance: ",e.distance," / Max Speed: ",e.maxSpeed," / Avg Speed: ",e.avgSpeed,"")}}function Cfe(t,n){if(1&t){const e=In();I(0,"div"),I(1,"ion-item-group"),et(2,"div",1),I(3,"ion-item",2),et(4,"img",3),I(5,"ion-label"),I(6,"ion-text",4),I(7,"h2"),gt(8),z(),z(),I(9,"p"),gt(10),z(),z(),z(),I(11,"ion-item",2),I(12,"ion-grid"),I(13,"ion-row"),I(14,"ion-col",5),et(15,"ion-icon",6),z(),I(16,"ion-col",7),I(17,"ion-input",8),ot("ngModelChange",function(r){return bt(e),ve().surfSession.location=r}),z(),z(),I(18,"ion-col",5),et(19,"img",9),z(),z(),z(),z(),ft(20,gfe,6,4,"div",10),I(21,"ion-grid",11),I(22,"ion-row"),I(23,"ion-col",12),I(24,"ion-button",13),ot("click",function(){return bt(e),ve().dismiss()}),gt(25," Save / Close "),z(),z(),z(),z(),z(),z()}if(2&t){const e=ve();K(4),Q("src",e.profilePic,R1),K(4),Ls(e.name),K(2),zl("Time: ",e.surfSession.timeSurfed," | Waves: ",e.surfSession.waveCount,""),K(7),Q("ngModel",e.surfSession.location),K(3),Q("ngForOf",e.surfSession.waveDataList)}}function vfe(t,n){1&t&&(I(0,"div"),et(1,"app-nodata"),z())}let yfe=(()=>{class t extends zc{constructor(e,i,r,s,c,h,g,x,S){super(i,e,r,c,s,h),this.alertController=e,this.loadingController=i,this.toastController=r,this.errorsService=s,this.storageService=c,this.loginService=h,this.editSurfService=g,this.domSanitizer=x,this.modalController=S}ngOnInit(){this.token=this.storageService.getToken(),this.name=this.storageService.getName();const e=this.storageService.getPhoto();this.profilePic=this.domSanitizer.bypassSecurityTrustUrl(e),this.loadSurfSessionData()}loadSurfSessionData(){this.createLoading().subscribe(e=>{e.present(),this.editSurfService.getSurfSession(this.token,this.uuid).subscribe(i=>{const r=this.sortWaveDataList(i);i.waveDataList=r,this.surfSession=i,e.dismiss()},i=>{e.dismiss(),this.showErrorMessage(JSON.stringify(i))})})}sortWaveDataList(e){const r=e.waveDataList.sort((s,c)=>{const h=new AO(s).toTimestamp(),g=new AO(c).toTimestamp();return h>g?1:g>h?-1:0});return e.waveDataList=r,r}deleteWaveData(e,i){this.surfSession.waveDataList.length>1?super.safeDelete().subscribe(r=>{"okay"===r&&this.deleteWave(e)},r=>{this.showErrorMessage(JSON.stringify(r))}):this.showToast("Only one wave left, delete the surf session.")}deleteWave(e){super.createLoading().subscribe(i=>{i.present(),this.editSurfService.deleteWaveData(this.token,e.id).subscribe(s=>{super.showToast("Wave Deleted Successfully."),this.surfSession.waveCount=this.surfSession.waveCount-1;const c=this.surfSession.waveDataList,h=c.findIndex(g=>g.id===s);h>-1&&(c.splice(h,1),this.surfSession.waveDataList=c),i.dismiss()},s=>{super.showErrorMessage(JSON.stringify(s)),i.dismiss()})})}dismiss(){this.surfSession&&this.surfSession.location.length>1&&this.editSurfService.updateSurfSession(this.token,this.surfSession).subscribe(i=>{super.showToast("Surf Session Updated Successfully.")},i=>{super.showErrorMessage(JSON.stringify(i))}),this.modalController.dismiss()}}return t.\u0275fac=function(e){return new(e||t)(B(Io),B(Zo),B(yo),B(Pc),B(X1),B(Vc),B(mfe),B(L4),B(Bg))},t.\u0275cmp=ht({type:t,selectors:[["app-edit-surf"]],inputs:{uuid:"uuid"},features:[Ln],decls:7,vars:2,consts:[[4,"ngIf"],[1,"full-width","info-divider"],["lines","none"],["alt","",1,"profile-pic",3,"src"],["color","black"],["size","1"],["name","location-outline",1,"pen-padding"],["size","10"],["placeholder","Surf Spot Name (Required)","maxlength","20","minlength","2","required","",1,"edit-field",3,"ngModel","ngModelChange"],["src","/assets/images/pencil.png",1,"icon-surf","pen-padding"],[4,"ngFor","ngForOf"],[1,"divider-alignment","divider-bottom"],["size","12","text-center","",1,"column-divider"],["expand","block","fill","outline",1,"close-button",3,"click"],[1,"small-font"],["fill","outline","color","danger","slot","end",3,"click"]],template:function(e,i){1&e&&(I(0,"ion-header"),I(1,"ion-toolbar"),I(2,"ion-title"),gt(3," Edit Surf Session "),z(),z(),z(),I(4,"ion-content"),ft(5,Cfe,26,6,"div",0),ft(6,vfe,2,0,"div",0),z()),2&e&&(K(5),Q("ngIf",null!=i.surfSession),K(1),Q("ngIf",!(null!=i.surfSession)))},directives:[Ul,$l,Lc,K2,di,k3,J2,el,R4,F4,N4,ih,Q2,Fg,Sc,L8,Pg,T8,I0,Ju,tr,Tc,a5],styles:[".small-font[_ngcontent-%COMP%]{font-size:11px!important}.close-button[_ngcontent-%COMP%]{padding-left:15px;padding-right:15px;margin-top:35px}.pen-padding[_ngcontent-%COMP%]{padding-top:10px}.edit-field[_ngcontent-%COMP%]{background-color:transparent;color:#000;outline:none;outline-style:none;border-top:none;border-left:none;border-right:none;border-bottom:solid #eeeeee 1px}"]}),t})(),kO=(()=>{class t{constructor(e){this.httpClient=e,this.historyListUrl="https://api.wavestracker.com/api/v3/mobile/history/list",this.historyStarUrl="https://api.wavestracker.com/api/v3/mobile/history/star",this.historyDeleteUrl="https://api.wavestracker.com/api/v3/mobile/history/delete"}getHistory(e,i){const r=(new vs).set("appKey",e).set("selectedDate",i);return this.httpClient.get(this.historyListUrl,{params:r}).pipe(xo(8e3))}starHistory(e,i){const r=(new vs).set("appKey",e).set("uuid",i);return this.httpClient.get(this.historyStarUrl,{params:r}).pipe(xo(8e3))}deleteHistory(e,i){const r=(new vs).set("appKey",e).set("uuid",i);return console.log("Deleting history: "+this.historyDeleteUrl+", params: "+r),this.httpClient.get(this.historyDeleteUrl,{params:r}).pipe(xo(8e3))}}return t.\u0275fac=function(e){return new(e||t)(Mt(_2))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),_fe=(()=>{class t{constructor(){this.viewUrl=window.location.origin+"/view/"}share(e){const i=new lt;return this.doShare(e,i),i.asObservable()}doShare(e,i){const s=this.createShareData(this.viewUrl+e);try{navigator.share(s).then(()=>{i.next(!0)}).catch(c=>i.error(c))}catch(c){i.error(c)}}createShareData(e){return{title:"Check out my latest surf session!",text:"Check out my latest surf session!",url:e}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),IO=(()=>{class t extends zc{constructor(e,i,r,s,c,h,g,x,S,E){super(e,i,r,c,h,g),this.loadingController=e,this.alertController=i,this.toastController=r,this.modalController=s,this.storageService=c,this.errorsService=h,this.loginService=g,this.historyService=x,this.socialShareService=S,this.navParams=E}ngOnInit(){this.historyItem=this.navParams.get("data"),this.popoverController=this.navParams.get("controller"),this.itemIndex=this.navParams.get("itemIndex")}share(e){super.createLoading().subscribe(i=>{i.present(),this.socialShareService.share(e).subscribe(r=>{i.dismiss(),this.popoverController.dismiss()},r=>{i.dismiss(),super.showErrorMessage(JSON.stringify(r))})})}showComment(e){this.modalController.create({component:pfe,componentProps:{uuid:e.uuid,when:e.when,location:e.location,comment:e.comment}}).then(r=>{r.onDidDismiss().then(s=>{const c=s.data;c.success&&(e.comment=c.comment,this.popoverController.dismiss())}),r.present()})}editSurf(e){this.storageService.hasSubs()?this.modalController.create({component:yfe,componentProps:{uuid:e}}).then(s=>{s.onDidDismiss().then(c=>{this.popoverController.dismiss()}),s.present()}):super.showMessage("Go Premium and unlock all the info collected and features.")}delete(e){this.storageService.hasSubs()?(this.popoverController.dismiss(),super.safeDelete().subscribe(r=>{"okay"===r&&this.deleteSurf(e)})):super.showMessage("Go Premium and unlock all the info collected and features.")}deleteSurf(e){const i=this.storageService.getToken();this.historyService.deleteHistory(i,e).subscribe(r=>{super.showToast("Surf session deleted, pull down to refresh.")},r=>{super.showErrorMessage(JSON.stringify(r))})}getCommentImage(e){return e&&e.trim().length>0?"/assets/images/has_comment.png":"/assets/images/comment.png"}}return t.\u0275fac=function(e){return new(e||t)(B(Zo),B(Io),B(yo),B(Bg),B(X1),B(Pc),B(Vc),B(kO),B(_fe),B(Tx))},t.\u0275cmp=ht({type:t,selectors:[["app-history-options"]],features:[Ln],decls:22,vars:1,consts:[[3,"click"],["slot","start",1,"thumbnail-option-size"],["src","/assets/images/share.png",1,"icon-surf"],["fill","clear"],[1,"icon-surf",3,"src"],["src","/assets/images/pencil.png",1,"icon-surf"],["src","/assets/images/rubbish.png",1,"icon-surf"]],template:function(e,i){1&e&&(I(0,"p"),I(1,"ion-list"),I(2,"ion-item",0),ot("click",function(){return i.share(i.historyItem.uuid)}),I(3,"ion-thumbnail",1),et(4,"img",2),z(),I(5,"ion-button",3),gt(6,"Share"),z(),z(),I(7,"ion-item",0),ot("click",function(){return i.showComment(i.historyItem)}),I(8,"ion-thumbnail",1),et(9,"img",4),z(),I(10,"ion-button",3),gt(11,"Comment"),z(),z(),I(12,"ion-item",0),ot("click",function(){return i.editSurf(i.historyItem.uuid)}),I(13,"ion-thumbnail",1),et(14,"img",5),z(),I(15,"ion-button",3),gt(16,"Edit"),z(),z(),I(17,"ion-item",0),ot("click",function(){return i.delete(i.historyItem.uuid)}),I(18,"ion-thumbnail",1),et(19,"img",6),z(),I(20,"ion-button",3),gt(21,"Delete"),z(),z(),z(),z()),2&e&&(K(9),Q("src",i.getCommentImage(i.historyItem.comment),R1))},directives:[Mx,J2,QI,Tc],styles:[".thumbnail-option-size[_ngcontent-%COMP%]{width:20px;height:20px}"]}),t})();function xfe(t,n){if(1&t){const e=In();I(0,"div"),I(1,"ion-item"),et(2,"img",12),I(3,"ion-label",13),ot("click",function(){const r=bt(e),s=r.$implicit,c=r.index;return ve(2).viewSurfSession(s.uuid,c)}),I(4,"ion-text",14),I(5,"h2"),gt(6),z(),z(),I(7,"p"),et(8,"ion-icon",15),gt(9),et(10,"img",16),gt(11),z(),z(),I(12,"ion-label",17),I(13,"p",13),ot("click",function(r){const s=bt(e),c=s.$implicit,h=s.index;return ve(2).moreOptions(r,c,h)}),gt(14," Options "),et(15,"ion-icon",18),z(),z(),z(),z()}if(2&t){const e=n.$implicit;K(6),Ls(e.location),K(3),Qi(" ",e.when," | "),K(2),Qi(" ",e.waves," ")}}function bfe(t,n){if(1&t&&(I(0,"div"),ft(1,xfe,16,3,"div",11),z()),2&t){const e=ve();K(1),Q("ngForOf",e.historyList)}}function wfe(t,n){1&t&&(I(0,"div"),et(1,"app-nodata"),z())}let Mfe=(()=>{class t extends zc{constructor(e,i,r,s,c,h,g,x,S){super(e,i,r,s,c,h),this.loadingController=e,this.alertController=i,this.toastController=r,this.storageService=s,this.errorsService=c,this.loginService=h,this.historyService=g,this.popoverController=x,this.router=S,this.selectedDate=(new Date).toISOString(),this.historyList=new Array}ngOnInit(){this.token=this.storageService.getToken(),this.loadHistory()}ngAfterViewInit(){super.doUserDetailsRefresh()}loadHistory(){const e=new Date(Date.parse(this.selectedDate)),i=this.queryDateFmt(e);super.createLoading().subscribe(r=>{r.present(),this.historyService.getHistory(this.token,i).subscribe(s=>{this.historyList=s,r.dismiss()},s=>{r.dismiss(),super.showErrorMessage(JSON.stringify(s))})})}queryDateFmt(e){return"01-"+["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()]+"-"+e.getFullYear()}viewSurfSession(e,i){this.router.navigate(["/view/",e],{queryParams:{origin:"history"}})}moreOptions(e,i,r){this.popoverController.create({component:IO,componentProps:{data:i,controller:this.popoverController,itemIndex:r},event:e,translucent:!0}).then(c=>{c.onDidDismiss().then(h=>{this.loadHistory()}),c.present()},c=>{super.showErrorMessage(JSON.stringify(c))})}doHistoryRefresh(e){this.loadHistory(),e.target.complete()}}return t.\u0275fac=function(e){return new(e||t)(B(Zo),B(Io),B(yo),B(X1),B(Pc),B(Vc),B(kO),B(kx),B(rs))},t.\u0275cmp=ht({type:t,selectors:[["app-history"]],features:[Ln],decls:23,vars:4,consts:[["color","primary"],["slot","start"],["slot","fixed",3,"ionRefresh"],[1,"full-width","info-divider"],["lines","none"],[1,"ion-no-padding","ion-no-margin"],["text-nowrap","","size","8",1,"ion-no-padding","ion-no-margin","ion-text-left"],["size","4",1,"ion-no-padding","ion-no-margin","ion-text-right"],["display-format","MMM, YYYY","picker-format","MMM, YYYY",1,"ion-no-padding","ion-no-margin","date-select-text",3,"ngModel","ionChange","ngModelChange"],["name","arrow-down-outline",1,"date-time-icon"],[4,"ngIf"],[4,"ngFor","ngForOf"],["src","/assets/images/surfer.png",1,"blue-surfer-icon"],[3,"click"],["color","black"],["name","alarm-outline",1,"history-icon-detail"],["src","/assets/images/wave.png",1,"wave-icon"],[1,"ion-text-right"],["name","ellipsis-vertical-outline",1,"more-opts-icon"]],template:function(e,i){1&e&&(I(0,"ion-header"),I(1,"ion-toolbar",0),I(2,"ion-buttons",1),et(3,"ion-menu-button"),z(),I(4,"ion-title"),I(5,"ion-label"),gt(6,"History"),z(),z(),z(),z(),I(7,"ion-content"),I(8,"ion-refresher",2),ot("ionRefresh",function(s){return i.doHistoryRefresh(s)}),et(9,"ion-refresher-content"),z(),I(10,"ion-item-group"),et(11,"div",3),I(12,"ion-item",4),I(13,"ion-grid",5),I(14,"ion-row",5),I(15,"ion-col",6),I(16,"ion-label"),gt(17),z(),z(),I(18,"ion-col",7),I(19,"ion-datetime",8),ot("ionChange",function(){return i.loadHistory()})("ngModelChange",function(s){return i.selectedDate=s}),z(),et(20,"ion-icon",9),z(),z(),z(),z(),ft(21,bfe,2,1,"div",10),ft(22,wfe,2,0,"div",10),z(),z()),2&e&&(K(17),Qi("",i.historyList.length," Surf Sessions"),K(2),Q("ngModel",i.selectedDate),K(2),Q("ngIf",i.historyList.length>0),K(1),Q("ngIf",!(i.historyList.length>0)))},directives:[Ul,$l,V4,O4,Lc,el,K2,Og,Ng,k3,J2,F4,N4,ih,HI,A3,I0,Ju,Q2,di,tr,R4,a5],styles:[".date-select-text[_ngcontent-%COMP%]{margin-right:15px}.date-time-icon[_ngcontent-%COMP%]{position:absolute!important;right:0px;top:3px}.history-icon-detail[_ngcontent-%COMP%]{margin-bottom:-2px}.more-opts-icon[_ngcontent-%COMP%]{font-size:24px;margin-bottom:-5px}.surf-sessions-label[_ngcontent-%COMP%]{color:#666}.wave-icon[_ngcontent-%COMP%]{max-width:15px;width:auto;height:auto;margin-bottom:-2px}"]}),t})(),vh=(()=>{class t{constructor(e){this.router=e}canActivate(){return!!this.isAuthenticated()||(this.router.navigate(["login"]),!1)}isAuthenticated(){return!!localStorage.getItem("token")}login(e,i){localStorage.setItem("token",e),localStorage.setItem("profilePic",i),this.router.navigate(this.isAuthenticated?["feed"]:["login"])}logout(){localStorage.removeItem("token"),localStorage.removeItem("profilePic"),this.router.navigate(["login"])}getToken(){return localStorage.getItem("token")}getProfilePic(){return localStorage.getItem("profilePic")}}return t.\u0275fac=function(e){return new(e||t)(Mt(rs))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();class zO{}let Sfe=(()=>{class t{constructor(e){this.authService=e}login(){return new q(e=>{this.authService.signIn(zx.PROVIDER_ID).then(i=>{const r=new zO;r.userId=i.id,r.email=i.email,r.displayName=i.name,r.provider="facebook",e.next(r)}).catch(i=>e.error(i))})}}return t.\u0275fac=function(e){return new(e||t)(Mt(Gg))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),Tfe=(()=>{class t{constructor(e){this.authService=e}login(){return new q(e=>{this.authService.signIn(jg.PROVIDER_ID).then(i=>{const r=new zO;r.userId=i.id,r.email=i.email,r.displayName=i.name,r.provider="google_oauth2",e.next(r)}).catch(i=>e.error(i))})}}return t.\u0275fac=function(e){return new(e||t)(Mt(Gg))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function Lfe(t,n){if(1&t){const e=In();_1(0,1),I(1,"p",2),I(2,"ion-button",3),ot("click",function(){return bt(e),ve().loginWithFacebook()}),et(3,"ion-icon",4),I(4,"ion-label"),gt(5,"Login with Facebook"),z(),z(),I(6,"ion-button",5),ot("click",function(){return bt(e),ve().loginWithGoogle()}),et(7,"ion-icon",6),I(8,"ion-label"),gt(9,"Login with Google"),z(),z(),I(10,"ion-button",7),ot("click",function(){return bt(e),ve().goToFAQ()}),et(11,"ion-icon",8),I(12,"ion-label"),gt(13,"Having trouble?"),z(),z(),z(),x1()}}function Efe(t,n){1&t&&(_1(0,1),et(1,"app-nodata"),x1())}let Dfe=(()=>{class t extends zc{constructor(e,i,r,s,c,h,g,x,S,E,A){super(e,i,r,s,c,h),this.loadingController=e,this.alertController=i,this.toastController=r,this.storageService=s,this.errorsService=c,this.loginService=h,this.facebookService=g,this.googleService=x,this.browserService=S,this.menu=E,this.router=A,this.tryAgainMsg="Something unexpected went wrong, you may try again.",this.tryAgain4g="Could not log you in, please try again using your mobile network or another wifi spot."}ngOnInit(){this.menu.enable(!1)}loginWithFacebook(){this.facebookService.login().subscribe(e=>{this.createLoadingDialog().subscribe(i=>{i.present(),this.loginService.loginUser(e).subscribe(r=>{this.menu.enable(!0),this.storageService.storeLogin(r),this.router.navigate(["feed"]),i.dismiss()},r=>{i.dismiss(),this.showErrorMessage(JSON.stringify(r))})})},e=>{this.showErrorMsg(JSON.stringify(e),this.tryAgain4g)})}loginWithGoogle(){this.googleService.login().subscribe(e=>{this.createLoadingDialog().subscribe(i=>{i.present(),this.loginService.loginUser(e).subscribe(r=>{this.menu.enable(!0),this.storageService.storeLogin(r),this.router.navigate(["feed"]),i.dismiss()},r=>{this.showErrorMessage(JSON.stringify(r)),i.dismiss()})})},e=>{this.showErrorMsg(JSON.stringify(e),this.tryAgain4g)})}createLoadingDialog(){const e=new lt;return this.loadingController.create({message:"Please wait.."}).then(s=>{e.next(s)},s=>{this.showErrorMessage(JSON.stringify(s))}),e.asObservable()}showErrorMessage(e){this.showErrorMsg(e,void 0)}showErrorMsg(e,i){this.alertController.create({header:"Oops!",message:i||this.tryAgainMsg,buttons:[{text:"Send Error Report",handler:()=>{let s=this.storageService.getToken();s||(s="LOGIN.PAGE"),this.errorsService.registerError(s,e).subscribe(c=>{this.toastController.create({message:"Error report sent, thank you.",duration:2500}).then(h=>h.present())})}},{text:"Ok",role:"cancel"}]}).then(s=>{s.present()})}goToFAQ(){this.browserService.browseUrl("https://www.wavestracker.com/faq")}}return t.\u0275fac=function(e){return new(e||t)(B(Zo),B(Io),B(yo),B(X1),B(Pc),B(Vc),B(Sfe),B(Tfe),B(MO),B(Ec),B(rs))},t.\u0275cmp=ht({type:t,selectors:[["app-login"]],features:[Ln],decls:2,vars:2,consts:[["class","full-screen no-padding no-margin",4,"ngIf"],[1,"full-screen","no-padding","no-margin"],[1,"login-background","no-padding","no-margin","full-screen"],["expand","block",1,"flex-margin","facebook-button","login-button-padding",3,"click"],["slot","start","name","logo-facebook",1,"login-social-icon"],["color","dark","expand","block","fill","outline",1,"login-button-padding","google-button",3,"click"],["slot","start","name","logo-google",1,"login-social-icon"],["color","medium","expand","block","fill","outline",1,"login-button-padding","google-button",3,"click"],["slot","start","name","help-circle-outline",1,"login-social-icon"]],template:function(e,i){1&e&&(ft(0,Lfe,14,0,"ng-container",0),ft(1,Efe,2,0,"ng-container",0)),2&e&&(Q("ngIf",!0),K(1),Q("ngIf",!1))},directives:[di,Tc,Q2,el,a5],styles:[".login-button-padding[_ngcontent-%COMP%]{padding-left:10%;padding-right:10%}.login-social-icon[_ngcontent-%COMP%]{position:absolute;right:var(--padding-end)}.facebook-button[_ngcontent-%COMP%]{--ion-color: #3a589e !important;--ion-color-base: #3a589e !important;--background: #3a589e !important;margin-top:125px}.google-button[_ngcontent-%COMP%]{margin-top:20px}.login-background[_ngcontent-%COMP%]{background-image:url(/assets/images/wt-background.jpg);background-attachment:fixed;background-size:cover;background-position:center;background-repeat:no-repeat}.no-padding[_ngcontent-%COMP%]{padding:0}.no-margin[_ngcontent-%COMP%]{margin:0}.full-screen[_ngcontent-%COMP%]{width:100%;height:100vh}"]}),t})();class Afe{}let kfe=(()=>{class t{constructor(e){this.httpClient=e,this.statsChartDataUrl="https://api.wavestracker.com/api/v3/mobile/stats/chart",this.statsDataUrl="https://api.wavestracker.com/api/v3/mobile/stats/data"}getChartData(e){const i=(new vs).set("appKey",e);return this.httpClient.get(this.statsChartDataUrl,{params:i}).pipe(xo(8e3))}getStatsData(e){const i=(new vs).set("appKey",e);return this.httpClient.get(this.statsDataUrl,{params:i}).pipe(xo(8e3))}}return t.\u0275fac=function(e){return new(e||t)(Mt(_2))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),Ife=(()=>{class t extends zc{constructor(e,i,r,s,c,h,g,x){super(e,i,r,s,c,h),this.loadingController=e,this.alertController=i,this.toastController=r,this.storageService=s,this.errorsService=c,this.loginService=h,this.statsService=g,this.router=x,this.chartData=[],this.chartSize=[350,200],this.showXAxis=!0,this.showXAxisLabel=!0,this.showYAxisLabel=!0,this.colorScheme="air",this.statsData=new Afe,this.currentYear=(new Date).getFullYear()}ngOnInit(){this.token=this.storageService.getToken(),this.hasSubs=this.storageService.hasSubs(),this.computeChartSize(),this.loadStats()}loadStats(){super.createLoading().subscribe(e=>{e.present(),this.statsService.getChartData(this.token).subscribe(i=>{this.statsService.getStatsData(this.token).subscribe(r=>{this.statsData=r,this.chartData=i,e.dismiss()},r=>{e.dismiss(),super.showErrorMessage(JSON.stringify(r))})},i=>{e.dismiss(),super.showErrorMessage(JSON.stringify(i))})})}computeChartSize(){const e=innerWidth/1.17,i=innerHeight/3.6;this.chartSize=[e,i]}viewSurfSession(e){e&&this.router.navigate(["/view/",e],{queryParams:{origin:"statistics"}})}}return t.\u0275fac=function(e){return new(e||t)(B(Zo),B(Io),B(yo),B(X1),B(Pc),B(Vc),B(kfe),B(rs))},t.\u0275cmp=ht({type:t,selectors:[["app-statistics"]],features:[Ln],decls:93,vars:19,consts:[["color","primary"],["slot","start"],[1,"full-width","info-divider"],["lines","none"],["name","calendar-outline",1,"statistic-icon-detail"],[1,"ion-no-margin","ion-no-padding"],["size","11",1,"ion-no-margin","ion-no-padding","stats-chart"],[3,"view","scheme","results","xAxis","showXAxisLabel","showYAxisLabel"],["size","1",1,"ion-no-margin","ion-no-padding"],[1,"details-text-rotate"],[1,"statics-personal-best"],["size","5",1,"box-color","first-col"],[1,"year-label"],[1,"stats-label"],[1,"detail-label"],["size","1"],["size","5",1,"box-color"],[1,"ion-no-padding","ion-no-margin"],["size","9"],["text-wrap",""],["color","black"],[1,"elipsis-text"],["src","/assets/images/ruler.png",1,"stats-icon"],["size","3"],[1,"ion-text-right",3,"click"],["fill","outline","color","primary"],["src","/assets/images/wave.png",1,"stats-icon"],["name","alarm-outline",1,"statistic-icon-detail"]],template:function(e,i){1&e&&(I(0,"ion-header"),I(1,"ion-toolbar",0),I(2,"ion-buttons",1),et(3,"ion-menu-button"),z(),I(4,"ion-title"),gt(5," Statistics "),z(),z(),z(),I(6,"ion-content"),et(7,"div",2),I(8,"ion-item-group"),I(9,"ion-item",3),I(10,"ion-label"),gt(11," SURF SESSIONS "),I(12,"p"),et(13,"ion-icon",4),gt(14," Last 4 months "),z(),z(),z(),I(15,"ion-item"),I(16,"ion-grid",5),I(17,"ion-row",5),I(18,"ion-col",6),et(19,"ngx-charts-bar-vertical",7),z(),I(20,"ion-col",8),I(21,"ion-label",9),gt(22," Tap to see details "),z(),z(),z(),z(),z(),I(23,"ion-item",10),I(24,"ion-grid"),I(25,"ion-row"),I(26,"ion-col",11),I(27,"ion-label",12),gt(28),z(),I(29,"ion-label",13),gt(30,"SURFED"),z(),I(31,"ion-label",14),gt(32),z(),z(),et(33,"ion-col",15),I(34,"ion-col",16),I(35,"ion-label",12),gt(36),z(),I(37,"ion-label",13),gt(38,"WAVES"),z(),I(39,"ion-label",14),gt(40),z(),z(),et(41,"ion-col",15),z(),z(),z(),z(),I(42,"ion-item-group"),I(43,"ion-item",3),I(44,"ion-label"),gt(45," PERSONAL BEST "),I(46,"p"),gt(47," Current Year "),z(),z(),z(),I(48,"ion-item"),I(49,"ion-grid",17),I(50,"ion-row"),I(51,"ion-col",18),I(52,"ion-label",19),I(53,"ion-text",20),I(54,"h2"),gt(55,"Longest Wave"),z(),z(),I(56,"p",21),et(57,"img",22),gt(58),z(),z(),z(),I(59,"ion-col",23),I(60,"ion-label",24),ot("click",function(){return i.viewSurfSession(i.statsData.bestLongestUuid)}),I(61,"ion-button",25),gt(62,"VIEW"),z(),z(),z(),z(),z(),z(),I(63,"ion-item"),I(64,"ion-grid",17),I(65,"ion-row"),I(66,"ion-col",18),I(67,"ion-label",19),I(68,"ion-text",20),I(69,"h2"),gt(70,"Waves Surfed"),z(),z(),I(71,"p",21),et(72,"img",26),gt(73),z(),z(),z(),I(74,"ion-col",23),I(75,"ion-label",24),ot("click",function(){return i.viewSurfSession(i.statsData.bestWavesUuid)}),I(76,"ion-button",25),gt(77,"VIEW"),z(),z(),z(),z(),z(),z(),I(78,"ion-item"),I(79,"ion-grid",17),I(80,"ion-row"),I(81,"ion-col",18),I(82,"ion-label",19),I(83,"ion-text",20),I(84,"h2"),gt(85,"Time Surfed"),z(),z(),I(86,"p",21),et(87,"ion-icon",27),gt(88),z(),z(),z(),I(89,"ion-col",23),I(90,"ion-label",24),ot("click",function(){return i.viewSurfSession(i.statsData.bestTimeUuid)}),I(91,"ion-button",25),gt(92,"VIEW"),z(),z(),z(),z(),z(),z(),z(),z()),2&e&&(K(19),Q("view",i.chartSize)("scheme",i.colorScheme)("results",i.chartData)("xAxis",i.showXAxis)("showXAxisLabel",i.showXAxisLabel)("showYAxisLabel",i.showYAxisLabel),K(9),Ls(i.currentYear),K(4),Ls(i.statsData.timesSurfedYear),K(4),Ls(i.currentYear),K(4),Ls(i.statsData.wavesCaughtYear),K(18),kf(" ",i.statsData.bestLongestWave||0," | ",i.statsData.bestLongestDate||0," | ",i.statsData.bestLongestLocation||0," "),K(15),kf(" ",i.statsData.bestWavesCaught||0," | ",i.statsData.bestWavesDate||0," | ",i.statsData.bestWavesLocation||0," "),K(15),kf(" ",i.statsData.bestTimeSurfed||0," | ",i.statsData.bestTimeDate||0," | ",i.statsData.bestTimeLocation||0," "))},directives:[Ul,$l,V4,O4,Lc,K2,k3,J2,el,Q2,F4,N4,ih,Y0e,R4,Tc],styles:[".details-text-rotate[_ngcontent-%COMP%]{writing-mode:vertical-lr;text-orientation:sideways-right;color:#666}.box-color[_ngcontent-%COMP%]{background-color:#699cfc}.first-col[_ngcontent-%COMP%]{margin-left:15px}.year-label[_ngcontent-%COMP%]{font-size:26px;color:#fff}.stats-label[_ngcontent-%COMP%]{font-size:22px;color:#fff}.detail-label[_ngcontent-%COMP%]{font-size:38px;color:#fff;font-weight:bold} .ngx-charts text{fill:#666!important;font-size:14px!important}.statics-personal-best[_ngcontent-%COMP%]{margin-top:10px}.statistic-icon-detail[_ngcontent-%COMP%]{margin-bottom:-2px}.stats-chart[_ngcontent-%COMP%]{display:grid}.stats-icon[_ngcontent-%COMP%]{max-width:15px!important;margin-bottom:-2px}.elipsis-text[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),t})();class zfe{}let Pfe=(()=>{class t{constructor(e){this.httpClient=e,this.settingsData="https://api.wavestracker.com/api/v3/mobile/settings/data",this.settingsUpdate="https://api.wavestracker.com/api/v3/mobile/settings/update",this.generateOtp="https://api.wavestracker.com/api/v3/mobile/generateOtp"}getOpt(e){const i=(new vs).set("appKey",e);return this.httpClient.get(this.generateOtp,{params:i}).pipe(xo(8e3))}getSettings(e){const i=(new vs).set("appKey",e);return this.httpClient.get(this.settingsData,{params:i}).pipe(xo(8e3))}updateSettings(e){const i={headers:new y2({"Content-Type":"application/json","Access-Control-Allow-Origin":"*"})};return this.httpClient.post(this.settingsUpdate,e,i).pipe(xo(8e3))}}return t.\u0275fac=function(e){return new(e||t)(Mt(_2))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var Q4=ye(8239),Vfe=ye(1741);class Ffe{constructor(n={}){this.settings=n}processXmlItem(n,e,i){if("attributes"!==e)if("email"!==e)i instanceof Date?n.ele(e,i.toISOString()):Array.isArray(i)&&"object"==typeof i[0]?i.forEach(r=>{this.generateXmlData(n.ele(e),r)}):Array.isArray(i)?n.ele(e,i.join(",")):"object"!=typeof i?n.ele(e,i):this.generateXmlData(n.ele(e),i);else{const r=i.split("@");n.ele(e,{id:r[0],domain:r[1]})}else Object.keys(i).forEach(r=>{n.attribute(r,i[r])})}generateXmlData(n,e){Object.keys(e).map(i=>({key:i,value:e[i]})).forEach(({key:i,value:r})=>{this.processXmlItem(n,i,r)})}toString(n){const e=(0,Vfe.create)("gpx",{encoding:"UTF-8"});return this.generateXmlData(e,n),e.end($t({allowEmpty:!0,indent:" ",newline:"\n",pretty:!0},this.settings))}}class Ofe{constructor(n,e,i,r){this.minlat=n,this.minlon=e,this.maxlat=i,this.maxlon=r}toObject(){const{minlat:n,minlon:e,maxlat:i,maxlon:r}=this;return{attributes:{minlat:n,minlon:e,maxlat:i,maxlon:r}}}}class Nfe{constructor(n,{text:e,type:i}){this.href=n,this.text=e||null,this.type=i||null}toObject(){const{href:n,text:e,type:i}=this;return $t($t({attributes:{href:n}},e?{text:e}:{}),i?{type:i}:{})}}class Rfe{constructor(n,{year:e,license:i}){this.author=n,this.year=e||null,this.license=i||null}toObject(){const{author:n,year:e,license:i}=this;return $t($t({attributes:{author:n}},e?{year:e}:{}),i?{license:i}:{})}}class Hfe{constructor({name:n,email:e,link:i}){this.name=n||null,this.email=e||null,this.link=i||null}toObject(){const{name:n,email:e,link:i}=this;return $t($t($t({},n?{name:n}:{}),e?{email:e}:{}),i?{link:i.toObject()}:{})}}class Bfe{constructor({name:n,desc:e,author:i,copyright:r,link:s,time:c,keywords:h,bounds:g,extensions:x}){this.name=n||null,this.desc=e||null,this.author=i||null,this.copyright=r||null,this.link=s||null,this.time=c||null,this.keywords=h||null,this.bounds=g||null,this.extensions=x||null}toObject(){const{name:n,desc:e,author:i,copyright:r,link:s,time:c,keywords:h,bounds:g,extensions:x}=this;return $t($t($t($t($t($t($t($t($t({},n?{name:n}:{}),e?{desc:e}:{}),i?{author:i.toObject()}:{}),r?{copyright:r.toObject()}:{}),s?{link:s.toObject()}:{}),c?{time:c}:{}),h?{keywords:h}:{}),g?{bounds:g.toObject()}:{}),x?{extensions:x}:{})}}class Ufe{constructor(n){this.cmt=n.cmt,this.desc=n.desc,this.extensions=n.extensions,this.link=n.link,this.name=n.name,this.number=n.number,this.rtept=n.rtept,this.src=n.src,this.type=n.type}toObject(){const{cmt:n,desc:e,src:i,link:r,number:s,type:c,extensions:h,rtept:g,name:x}=this;return $t($t($t($t($t($t($t($t($t({},n?{cmt:n}:{}),e?{desc:e}:{}),i?{src:i}:{}),r?{link:r}:{}),s?{number:s}:{}),c?{type:c}:{}),h?{extensions:h}:{}),g?{rtept:g.map(S=>S.toObject())}:{}),x?{name:x}:{})}}class PO{constructor(n,e,{ele:i,time:r,magvar:s,geoidheight:c,name:h,cmt:g,desc:x,src:S,link:E,sym:A,type:F,fix:j,sat:ie,hdop:W,vdop:Ee,pdop:Se,ageofdgpsdata:Ze,dgpsid:xt,extensions:Ut}={}){this.lat=n,this.lon=e,this.ele=i||null,this.time=r||null,this.magvar=s||null,this.geoidheight=c||null,this.name=h||null,this.cmt=g||null,this.desc=x||null,this.src=S||null,this.link=E||null,this.sym=A||null,this.type=F||null,this.fix=j||null,this.sat=ie||null,this.hdop=W||null,this.vdop=Ee||null,this.pdop=Se||null,this.ageofdgpsdata=Ze||null,this.dgpsid=xt||null,this.extensions=Ut||null}toObject(){const{lat:n,lon:e,ele:i,time:r,magvar:s,geoidheight:c,name:h,cmt:g,desc:x,src:S,link:E,sym:A,type:F,fix:j,sat:ie,hdop:W,vdop:Ee,pdop:Se,ageofdgpsdata:Ze,dgpsid:xt,extensions:Ut}=this;return $t($t($t($t($t($t($t($t($t($t($t($t($t($t($t($t($t($t($t({attributes:{lat:n,lon:e}},i?{ele:i}:{}),r?{time:r}:{}),s?{magvar:s}:{}),c?{geoidheight:c}:{}),h?{name:h}:{}),g?{cmt:g}:{}),x?{desc:x}:{}),S?{src:S}:{}),E?{link:E.toObject()}:{}),A?{sym:A}:{}),F?{type:F}:{}),j?{fix:j}:{}),ie?{sat:ie}:{}),W?{hdop:W}:{}),Ee?{vdop:Ee}:{}),Se?{pdop:Se}:{}),Ze?{ageofdgpsdata:Ze}:{}),xt?{dgpsid:xt}:{}),Ut&&Object.keys(Ut).length>0?{extensions:Ut}:{})}}class VO{constructor(n,{name:e,cmt:i,desc:r,src:s,link:c,number:h,type:g,extensions:x}={}){this.name=e||null,this.cmt=i||null,this.desc=r||null,this.src=s||null,this.link=c||null,this.number=h||null,this.type=g||null,this.extensions=x||null,this.trkseg=n||null}setSegments(n){return this.trkseg=n,this}toObject(){const{name:n,cmt:e,desc:i,src:r,link:s,number:c,type:h,extensions:g,trkseg:x}=this;return $t($t($t($t($t($t($t($t($t({},n?{name:n}:{}),e?{cmt:e}:{}),i?{desc:i}:{}),r?{src:r}:{}),s?{link:s.toObject()}:{}),c?{number:c}:{}),h?{type:h}:{}),g?{extensions:g}:{}),x?{trkseg:x.map(S=>S.toObject())}:{})}}class FO{constructor(n,e=null){this.trkpt=n,this.extensions=e||null}setPoints(n){return this.trkpt=n,this}toObject(){const{trkpt:n,extensions:e}=this;return $t({trkpt:n.map(i=>i.toObject())},e?{extensions:e}:{})}}let Ew=(()=>{class t{constructor(){this.data={},this.schemaLocation=["http://www.topografix.com/GPX/1/1","http://www.topografix.com/GPX/1/1/gpx.xsd"]}setMetadata(e){return this.data.metadata=e.toObject(),this}setWayPoints(e){return this.data.wpt=e.map(i=>i.toObject()),this}setRoutes(e){return this.data.rte=e.map(i=>i.toObject()),this}setTracks(e){return this.data.trk=e.map(i=>i.toObject()),this}setExtensions(e){return this.data.extensions=e,this}setSegmentPoints(e){return this.setTracks([new VO([new FO(e)])]),this}toObject(){return l5($t({},this.data),{attributes:$t({creator:"fabulator:gpx-builder",version:"1.1",xmlns:"http://www.topografix.com/GPX/1/1","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation":this.schemaLocation.join(" ")},this.data.attributes)})}}return t.MODELS=fe,t})();class OO extends PO{constructor(n,e,i={}){super(n,e,i);const{hr:r,cad:s,speed:c,atemp:h,wtemp:g,depth:x,course:S,bearing:E}=i,A="gpxtpx",F=`${A}:TrackPointExtension`,j=$t($t($t($t($t($t($t($t({},r?{[`${A}:hr`]:r}:{}),s?{[`${A}:cad`]:s}:{}),c?{[`${A}:speed`]:c}:{}),h?{[`${A}:atemp`]:h}:{}),g?{[`${A}:wtemp`]:g}:{}),x?{[`${A}:depth`]:x}:{}),S?{[`${A}:course`]:S}:{}),E?{[`${A}:bearing`]:E}:{});this.extensions=$t($t({},this.extensions),Object.keys(j).length>0?{[F]:j}:{})}}class Dw extends Ew{constructor(){super(),this.schemaLocation=[...this.schemaLocation,"http://www.garmin.com/xmlschemas/TrackPointExtension/v1","http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd","http://www.garmin.com/xmlschemas/GpxExtensions/v3","http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd"],this.data=l5($t({},this.data),{attributes:l5($t({},this.data.attributes),{"xmlns:gpxtpx":"http://www.garmin.com/xmlschemas/TrackPointExtension/v1","xmlns:gpxx":"http://www.garmin.com/xmlschemas/GpxExtensions/v3"})})}}Dw.MODELS=l5($t({},Ew.MODELS),{Point:OO}),class extends Dw{}.MODELS=l5($t({},Dw.MODELS),{Point:class extends OO{constructor(n,e,i={}){super(n,e,i);const{power:r,cad:s,distance:c}=i;this.extensions=$t($t($t($t({},this.extensions),null!=r?{power:r}:{}),null!=s?{cadence:s}:{}),null!=c?{distance:c}:{})}}});var Aw=ye(1262);class Wfe{constructor(){}toGpx(n){const e=new Ew,i=this.createMetadata(),r=this.createPoints(n);return e.setSegmentPoints(r),e.setMetadata(i),function(t,n){return(new Ffe).toString(t)}(e.toObject())}createPoints(n){const e=[];return n.forEach(i=>{const r=this.formatDate(i[2]),s=new Aw.E9(+i[0],+i[1],{time:r,desc:JSON.stringify(i)});e.push(s)}),e}formatDate(n){return(""+n).length>10?new Date(n):new Date(1e3*n)}createMetadata(){const n=(new Date).getFullYear();return new Aw.SF({name:"Activity",desc:"Strava - Activity",time:new Date,copyright:new Aw.wZ("WavesTracker",{year:n,license:"MIT"})})}}let kw=(()=>{class t{constructor(e,i){this.httpClient=e,this.storageService=i,this.uploadUrl="https://api.wavestracker.com/api/v3/web/upload",this.stravaUrl="https://www.strava.com/api/v3"}authenticate(){let i="https://www.strava.com/oauth/authorize?";i+="client_id=77178&",i=i+"redirect_uri="+window.location.origin+"/strava&",i+="response_type=code&approval_prompt=force&",i+="scope=read_all,profile:read_all,activity:read_all",console.log("stravaOauthUrl: ",i),window.location.href=i}exchangeToken(e){return this.httpClient.post("https://www.strava.com/oauth/token",null,{params:{client_id:"77178",client_secret:"9963eb6c888e9a18a86ca0dafaae23034d6cc172",grant_type:"authorization_code",code:e}})}refreshToken(e){return this.httpClient.post("https://www.strava.com/oauth/token",null,{params:{client_id:"77178",client_secret:"9963eb6c888e9a18a86ca0dafaae23034d6cc172",grant_type:"refresh_token",refresh_token:e}})}storeStravaAuth(e,i){localStorage.setItem("strava-access-token",e.access_token),localStorage.setItem("strava-token-expires_at",""+e.expires_at),localStorage.setItem("strava-refresh-token",e.refresh_token),i&&localStorage.setItem("strava-athlete-id",e.athlete.id)}deleteStravaCredentials(){localStorage.removeItem("strava-access-token"),localStorage.removeItem("strava-token-expires_at"),localStorage.removeItem("strava-refresh-token"),localStorage.removeItem("strava-athlete-id")}verifyToken(){var e=this;return(0,Q4.Z)(function*(){const i=localStorage.getItem("strava-token-expires_at");if(i){if(1e3*+i<=(new Date).getTime()){const c=localStorage.getItem("strava-refresh-token"),h=yield e.refreshToken(c).toPromise();return e.storeStravaAuth(h,!1),1}return 0}return-1})()}listActivities(){var e=this;return(0,Q4.Z)(function*(){if((yield e.verifyToken())>=0){const r=localStorage.getItem("strava-access-token");return e.httpClient.get(e.stravaUrl+"/athlete/activities",{headers:{Authorization:"Bearer "+r}}).toPromise()}return[]})()}uploadActivity(e){var i=this;return(0,Q4.Z)(function*(){if(e&&(yield i.verifyToken())>=0){const s=yield i.getStravaData(e);if(s.length>1){const c=i.toFormData(e,s);return i.uploadToWavesTracker(c)}}return"error"})()}getStravaData(e){var i=this;return(0,Q4.Z)(function*(){const r=e.id,s=i.stravaUrl+"/activities/"+r+"/streams/latlng",c=i.stravaUrl+"/activities/"+r+"/streams/time",g=(yield i.doStravaApiRequest(s)).filter(E=>"latlng"===E.type),S=(yield i.doStravaApiRequest(c)).filter(E=>"time"===E.type);return i.mergeStravaData(e,g[0].data,S[0].data)})()}doStravaApiRequest(e){var i=this;return(0,Q4.Z)(function*(){const r=localStorage.getItem("strava-access-token");return yield i.httpClient.get(e,{headers:{Authorization:"Bearer "+r}}).toPromise()})()}mergeStravaData(e,i,r){var s=this;return(0,Q4.Z)(function*(){const c=[];return i.forEach((h,g)=>{const S=s.fixTime(e,r[g]);h.push(S),c.push(h)}),c})()}fixTime(e,i){const c=new Date(e.start_date).getTime()+1e3*i;return new Date(c).getTime()}toFormData(e,i){const s=(new Wfe).toGpx(i),c=new Blob([s]),h="Strava-"+e.id+".gpx",g=new FormData;return g.append("file",c,h),g}uploadToWavesTracker(e){var i=this;return(0,Q4.Z)(function*(){const r=i.storageService.getToken(),s=yield i.httpClient.post(i.uploadUrl,e,{headers:{token:r},responseType:"text",observe:"response"}).toPromise();return s&&200===s.status?"success":"error"})()}}return t.\u0275fac=function(e){return new(e||t)(Mt(_2),Mt(X1))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),qfe=(()=>{class t extends zc{constructor(e,i,r,s,c,h,g,x){super(e,i,r,s,c,h),this.loadingController=e,this.alertController=i,this.toastController=r,this.storageService=s,this.errorsService=c,this.loginService=h,this.settingsService=g,this.stravaService=x,this.settings=new zfe,this.wavePreset="medium"}ngOnInit(){this.token=this.storageService.getToken(),this.validUntil=this.storageService.get("validUntil"),this.hasSubs=this.storageService.hasSubs(),this.loadSettings()}ngAfterViewInit(){this.doUserDetailsRefresh()}loadSettings(){super.createLoading().subscribe(e=>{e.present(),this.settingsService.getSettings(this.token).subscribe(i=>{this.settings=i,this.assignPresetString(),e.dismiss()},i=>{e.dismiss(),super.showErrorMessage(JSON.stringify(i))})})}assignPresetString(){this.wavePreset="medium",this.settings&&(18===this.settings.distance?this.wavePreset="extra-small":21===this.settings.distance?this.wavePreset="small":24===this.settings.distance?this.wavePreset="medium":28===this.settings.distance&&(this.wavePreset="large"))}updateSettings(){!this.settings.name||this.settings.name.length<3?super.showToast("Name must be at least 3 characters"):super.createLoading().subscribe(e=>{e.present(),this.assignValuesFromPreset(),this.settingsService.updateSettings(this.settings).subscribe(i=>{this.storageService.store("name",i.name),super.showToast("Saved successfully"),this.settings=i,e.dismiss()},i=>{e.dismiss(),super.showErrorMessage(JSON.stringify(i))})})}assignValuesFromPreset(){"small"===this.wavePreset?(this.settings.minSpeed=8,this.settings.distance=21):"medium"===this.wavePreset?(this.settings.minSpeed=9,this.settings.distance=24):"large"===this.wavePreset?(this.settings.minSpeed=11,this.settings.distance=28):(this.settings.minSpeed=6,this.settings.distance=18)}distanceUpdate(){this.settings.speedUnit="meters"===this.settings.distanceUnit?"kmh":"mph"}speedUpdate(){this.settings.distanceUnit="kmh"===this.settings.speedUnit?"meters":"yards"}}return t.\u0275fac=function(e){return new(e||t)(B(Zo),B(Io),B(yo),B(X1),B(Pc),B(Vc),B(Pfe),B(kw))},t.\u0275cmp=ht({type:t,selectors:[["app-settings"]],features:[Ln],decls:97,vars:7,consts:[["color","primary"],["slot","start"],[1,"full-width","info-divider"],[1,"lower-text-label"],["placeholder","Enter Your Name (Required)","maxlength","20","minlength","2","required","",3,"ngModel","ngModelChange"],["src","/assets/images/pencil.png",1,"icon-surf","pen-padding"],["readonly","",1,"light-gray",3,"value"],["lines","none"],["size","6"],[1,"label-padding"],[1,"ion-no-padding","ion-no-margin",3,"ngModel","ngModelChange","ionChange"],["value","meters"],["value","yards"],["value","kmh"],["value","mph"],[1,"ion-no-padding","ion-no-margin",3,"ngModel","ngModelChange"],["value","false"],["value","true"],[3,"ngModel","ngModelChange"],["slot","start","value","extra-small"],["slot","start","value","small"],["slot","start","value","medium"],["slot","start","value","large"],["type","number","placeholder","Default: 43kmh",3,"ngModel","ngModelChange"],[1,"full-width"],["expand","block","fill","outline",1,"save-button",3,"click"]],template:function(e,i){1&e&&(I(0,"ion-header"),I(1,"ion-toolbar",0),I(2,"ion-buttons",1),et(3,"ion-menu-button"),z(),I(4,"ion-title"),gt(5," Settings "),z(),z(),z(),I(6,"ion-content"),et(7,"div",2),I(8,"ion-item-group"),I(9,"ion-item"),I(10,"ion-label",3),gt(11,"Name:"),z(),I(12,"ion-input",4),ot("ngModelChange",function(s){return i.settings.name=s}),z(),et(13,"img",5),z(),I(14,"ion-item"),I(15,"ion-label",3),gt(16,"Premium:"),z(),et(17,"ion-input",6),z(),z(),et(18,"div",2),I(19,"ion-item-group"),I(20,"ion-item",7),I(21,"ion-label"),gt(22,"UNITS"),z(),z(),I(23,"ion-item"),I(24,"ion-grid"),I(25,"ion-row"),I(26,"ion-col",8),I(27,"ion-label",9),gt(28," Distance "),z(),z(),I(29,"ion-col",8),I(30,"ion-segment",10),ot("ngModelChange",function(s){return i.settings.distanceUnit=s})("ionChange",function(){return i.distanceUpdate()}),I(31,"ion-segment-button",11),I(32,"ion-label"),gt(33,"meters"),z(),z(),I(34,"ion-segment-button",12),I(35,"ion-label"),gt(36,"yards"),z(),z(),z(),z(),z(),z(),z(),I(37,"ion-item"),I(38,"ion-grid"),I(39,"ion-row"),I(40,"ion-col",8),I(41,"ion-label",9),gt(42," Speed "),z(),z(),I(43,"ion-col",8),I(44,"ion-segment",10),ot("ngModelChange",function(s){return i.settings.speedUnit=s})("ionChange",function(){return i.speedUpdate()}),I(45,"ion-segment-button",13),I(46,"ion-label"),gt(47,"kmh"),z(),z(),I(48,"ion-segment-button",14),I(49,"ion-label"),gt(50,"mph"),z(),z(),z(),z(),z(),z(),z(),I(51,"ion-item"),I(52,"ion-grid"),I(53,"ion-row"),I(54,"ion-col",8),I(55,"ion-label",9),gt(56," Private "),z(),z(),I(57,"ion-col",8),I(58,"ion-segment",15),ot("ngModelChange",function(s){return i.settings.privateSessions=s}),I(59,"ion-segment-button",16),I(60,"ion-label"),gt(61,"no"),z(),z(),I(62,"ion-segment-button",17),I(63,"ion-label"),gt(64,"yes"),z(),z(),z(),z(),z(),z(),z(),z(),et(65,"div",2),I(66,"ion-item-group"),I(67,"ion-item",7),I(68,"p"),I(69,"ion-label"),gt(70,"WAVE PRESET"),z(),z(),z(),I(71,"ion-radio-group",18),ot("ngModelChange",function(s){return i.wavePreset=s}),I(72,"ion-item"),I(73,"ion-label"),gt(74,"Extra Small Waves"),z(),et(75,"ion-radio",19),z(),I(76,"ion-item"),I(77,"ion-label"),gt(78,"Small Waves"),z(),et(79,"ion-radio",20),z(),I(80,"ion-item"),I(81,"ion-label"),gt(82,"Medium Waves"),z(),et(83,"ion-radio",21),z(),I(84,"ion-item"),I(85,"ion-label"),gt(86,"Large Waves"),z(),et(87,"ion-radio",22),z(),z(),I(88,"ion-item"),I(89,"ion-label",3),gt(90,"Max Speed (km/h):"),z(),I(91,"ion-input",23),ot("ngModelChange",function(s){return i.settings.maxSpeed=s}),z(),et(92,"img",5),z(),z(),et(93,"div",2),I(94,"ion-item-group",24),I(95,"ion-button",25),ot("click",function(){return i.updateSettings()}),gt(96," Save Changes "),z(),z(),z()),2&e&&(K(12),Q("ngModel",i.settings.name),K(5),Df("value",i.validUntil),K(13),Q("ngModel",i.settings.distanceUnit),K(14),Q("ngModel",i.settings.speedUnit),K(14),Q("ngModel",i.settings.privateSessions),K(13),Q("ngModel",i.wavePreset),K(20),Q("ngModel",i.settings.maxSpeed))},directives:[Ul,$l,V4,O4,Lc,K2,k3,J2,el,Fg,Sc,L8,Pg,T8,I0,Ju,F4,N4,ih,WI,A3,qI,GI,jI,nh,th,Tc],styles:[".label-padding[_ngcontent-%COMP%]{padding-top:10px}.save-button[_ngcontent-%COMP%]{padding-left:15px;padding-right:15px;margin-top:35px}.lower-text-label[_ngcontent-%COMP%]{margin-left:10px}.light-gray[_ngcontent-%COMP%]{color:#666}.pen-padding[_ngcontent-%COMP%]{padding-top:10px}"]}),t})(),NO=(()=>{class t{constructor(e){this.httpClient=e,this.feedListUrl="https://api.wavestracker.com/api/v3/mobile/feed/list",this.feedDeleteUrl="https://api.wavestracker.com/api/v3/mobile/feed/delete",this.feedPreviewUrl="https://api.wavestracker.com/api/v3/mobile/preview/image",this.nearByListUrl="https://api.wavestracker.com/api/v3/mobile/near/list",this.followeesListUrl="https://api.wavestracker.com/api/v3/mobile/follow/list",this.headers=new y2({"Content-Type":"application/json","Pragma-directive":"no-cache","Cache-directive":"no-cache","Cache-control":"no-cache",Pragma:"Pragma",Expires:"0"})}getFeed(e){const i=(new vs).set("appKey",e);return this.httpClient.get(this.feedListUrl,{params:i}).pipe(xo(38e3))}getNearByFeed(e){const i=(new vs).set("appKey",e);return this.httpClient.get(this.nearByListUrl,{params:i}).pipe(xo(38e3))}getFollowees(e){const i=(new vs).set("appKey",e);return this.httpClient.get(this.followeesListUrl,{params:i}).pipe(xo(38e3))}deleteFeed(e,i){const r=(new vs).set("appKey",e).set("uuid",i);return console.log("Deleting history: "+this.feedDeleteUrl+", params: "+r),this.httpClient.get(this.feedDeleteUrl,{params:r}).pipe(xo(38e3))}getSurfPreview(e){const i=(new vs).set("uuid",e);return this.httpClient.get(this.feedPreviewUrl,{params:i,headers:this.headers}).pipe(xo(38e3))}}return t.\u0275fac=function(e){return new(e||t)(Mt(_2))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function Xfe(t,n){if(1&t){const e=In();I(0,"div"),I(1,"ion-item"),et(2,"img",6),I(3,"ion-label",7),ot("click",function(){const r=bt(e),s=r.$implicit,c=r.index;return ve(2).viewSurfSession(s.uuid,c)}),I(4,"ion-text",8),I(5,"h2"),gt(6),z(),z(),I(7,"p"),et(8,"ion-icon",9),gt(9),et(10,"img",10),gt(11),z(),z(),z(),z()}if(2&t){const e=n.$implicit;K(6),Ls(e.surferName),K(3),zl(" ",e.location," | ",e.when," "),K(2),Qi(" ",e.waveCount," ")}}function Zfe(t,n){if(1&t&&(I(0,"div"),ft(1,Xfe,12,4,"div",5),z()),2&t){const e=ve();K(1),Q("ngForOf",e.nearByFeedList)("ngForTrackBy",e.trackByFn)}}function Yfe(t,n){1&t&&(I(0,"div"),et(1,"app-nodata",11),z()),2&t&&(K(1),Q("nearby",!0))}let Kfe=(()=>{class t extends zc{constructor(e,i,r,s,c,h,g,x){super(e,i,r,s,c,h),this.loadingController=e,this.alertController=i,this.toastController=r,this.storageService=s,this.errorsService=c,this.loginService=h,this.router=g,this.feedService=x,this.nearByFeedList=new Array,this.surfPreviewList=new Array}ngOnInit(){this.name=this.storageService.getName(),this.token=this.storageService.getToken(),this.hasSubs=this.storageService.hasSubs(),this.loadFeed()}ngAfterViewInit(){super.doUserDetailsRefresh()}loadFeed(){super.createLoading().subscribe(e=>{e.present(),this.feedService.getNearByFeed(this.token).subscribe(i=>{i&&i.length>0&&(this.nearByFeedList=i,this.loadSurfPreviews(i)),e.dismiss()},i=>{e.dismiss(),super.showErrorMessage(JSON.stringify(i))})})}loadSurfPreviews(e){null!=e&&e.length>0&&e.forEach(i=>{const s=new S1("/assets/images/loading_surf.gif");this.feedService.getSurfPreview(i.uuid).subscribe(h=>{s.next("data:image/png;base64,"+h.image)});const c=s.asObservable();this.surfPreviewList.push(c)})}viewSurfSession(e,i){this.router.navigate(["/view/",e],{queryParams:{origin:"near"}})}doFeedRefresh(e){this.loadFeed(),e.target.complete()}trackByFn(e,i){return i.uuid}}return t.\u0275fac=function(e){return new(e||t)(B(Zo),B(Io),B(yo),B(X1),B(Pc),B(Vc),B(rs),B(NO))},t.\u0275cmp=ht({type:t,selectors:[["app-near-by"]],features:[Ln],decls:13,vars:2,consts:[["color","primary"],["slot","start"],["slot","fixed",3,"ionRefresh"],[1,"full-width","info-divider"],[4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],["src","/assets/images/surfer.png",1,"blue-surfer-icon"],[3,"click"],["color","black"],["name","person-outline",1,"history-icon-detail"],["src","/assets/images/wave.png",1,"wave-icon"],[3,"nearby"]],template:function(e,i){1&e&&(I(0,"ion-header"),I(1,"ion-toolbar",0),I(2,"ion-buttons",1),et(3,"ion-menu-button"),z(),I(4,"ion-title"),gt(5," Near Me "),z(),z(),z(),I(6,"ion-content"),I(7,"ion-refresher",2),ot("ionRefresh",function(s){return i.doFeedRefresh(s)}),et(8,"ion-refresher-content"),z(),I(9,"ion-item-group"),et(10,"div",3),ft(11,Zfe,2,2,"div",4),ft(12,Yfe,2,1,"div",4),z(),z()),2&e&&(K(11),Q("ngIf",i.nearByFeedList.length>0),K(1),Q("ngIf",!(i.nearByFeedList.length>0)))},directives:[Ul,$l,V4,O4,Lc,K2,Og,Ng,k3,di,tr,J2,el,R4,Q2,a5],styles:[".wave-icon[_ngcontent-%COMP%]{max-width:15px;width:auto;height:auto;margin-bottom:-2px}.history-icon-detail[_ngcontent-%COMP%]{margin-bottom:-2px}"]}),t})();function Qfe(t,n){if(1&t){const e=In();_1(0),I(1,"ion-item-group",4),I(2,"ion-button",5),ot("click",function(){return bt(e),ve().authStrava()}),gt(3," Authenticate Strava "),z(),z(),x1()}}function Jfe(t,n){if(1&t){const e=In();_1(0),I(1,"ion-item"),et(2,"img",7),I(3,"ion-label"),I(4,"ion-text",8),I(5,"h2"),gt(6),z(),z(),I(7,"p",9),et(8,"ion-icon",10),gt(9),qv(10,"date"),qv(11,"date"),z(),z(),I(12,"ion-label",11),I(13,"p",12),ot("click",function(){const s=bt(e).$implicit;return ve(3).uploadActivity(s)}),gt(14," Upload "),et(15,"ion-icon",13),z(),z(),z(),x1()}if(2&t){const e=n.$implicit;K(6),Ls(e.name),K(3),zl(" ",Xv(10,3,e.start_date,"mediumDate")," - ",Xv(11,6,e.start_date,"shortTime")," ")}}function e8e(t,n){if(1&t&&(_1(0),ft(1,Jfe,16,9,"ng-container",6),x1()),2&t){const e=ve(2);K(1),Q("ngForOf",e.activities)}}function t8e(t,n){1&t&&(_1(0),I(1,"div"),et(2,"br"),et(3,"br"),I(4,"h4",14),gt(5," No activities received from Strava "),z(),z(),x1())}function n8e(t,n){if(1&t&&(_1(0),ft(1,e8e,2,1,"ng-container",3),ft(2,t8e,6,0,"ng-container",3),x1()),2&t){const e=ve();K(1),Q("ngIf",e.activities.length>0),K(1),Q("ngIf",!(e.activities.length>0))}}let i8e=(()=>{class t extends zc{constructor(e,i,r,s,c,h,g,x){super(e,i,r,s,c,h),this.loadingController=e,this.alertController=i,this.toastController=r,this.storageService=s,this.errorsService=c,this.loginService=h,this.stravaService=g,this.router=x,this.activities=[]}ngOnInit(){this.token=this.storageService.getToken(),this.stravaAthleteId=localStorage.getItem("strava-athlete-id"),this.stravaAthleteId&&this.listStravaActivities()}authStrava(){this.stravaService.authenticate()}listStravaActivities(){this.stravaService.verifyToken().then(e=>{e>=0?super.createLoading().subscribe(i=>{i.present(),this.stravaService.listActivities().then(r=>{this.activities=r,i.dismiss()})}):(this.stravaService.deleteStravaCredentials(),this.alertController.create({animated:!0,message:"You must authenticate with Strava on Upload."}).then(i=>i.present()),this.router.navigate(["/feed"]).then())})}uploadActivity(e){var i=this;return(0,Q4.Z)(function*(){const r=yield i.loadingController.create({message:"Please wait, this may take a while..",animated:!0});yield r.present();const s=yield i.stravaService.uploadActivity(e);yield r.dismiss(),"success"===s&&(yield i.toastController.create({animated:!0,duration:3725,message:"Success! Strava data uploaded into WavesTracker, please check the feed/history for details."})).present()})()}}return t.\u0275fac=function(e){return new(e||t)(B(Zo),B(Io),B(yo),B(X1),B(Pc),B(Vc),B(kw),B(rs))},t.\u0275cmp=ht({type:t,selectors:[["app-upload"]],features:[Ln],decls:10,vars:2,consts:[["color","primary"],["slot","start"],[1,"full-width","info-divider"],[4,"ngIf"],[1,"full-width"],["color","warning","expand","block","fill","outline",1,"save-button",3,"click"],[4,"ngFor","ngForOf"],["src","/assets/images/strava.png",1,"blue-surfer-icon"],["color","black"],[2,"white-space","nowrap","overflow","hidden","text-overflow","unset","font-size","11px"],["name","alarm-outline",1,"history-icon-detail"],[1,"ion-text-right"],[3,"click"],["name","cloud-upload-outline",1,"more-opts-icon"],[2,"width","100","text-align","center"]],template:function(e,i){1&e&&(I(0,"ion-header"),I(1,"ion-toolbar",0),I(2,"ion-buttons",1),et(3,"ion-menu-button"),z(),I(4,"ion-title"),gt(5," Upload Surf Session "),z(),z(),z(),I(6,"ion-content"),et(7,"div",2),ft(8,Qfe,4,0,"ng-container",3),ft(9,n8e,3,2,"ng-container",3),z()),2&e&&(K(8),Q("ngIf",!i.stravaAthleteId),K(1),Q("ngIf",i.stravaAthleteId))},directives:[Ul,$l,V4,O4,Lc,K2,di,k3,Tc,tr,J2,el,R4,Q2],pipes:[UE],styles:[".label-padding[_ngcontent-%COMP%]{padding-top:10px}.save-button[_ngcontent-%COMP%]{padding-left:15px;padding-right:15px;margin-top:35px}.lower-text-label[_ngcontent-%COMP%]{margin-left:10px}.light-gray[_ngcontent-%COMP%]{color:#666}.pen-padding[_ngcontent-%COMP%]{padding-top:10px}.date-select-text[_ngcontent-%COMP%]{margin-right:15px}.date-time-icon[_ngcontent-%COMP%]{position:absolute!important;right:0px;top:3px}.history-icon-detail[_ngcontent-%COMP%]{margin-bottom:-2px}.more-opts-icon[_ngcontent-%COMP%]{font-size:24px;margin-bottom:-5px}.surf-sessions-label[_ngcontent-%COMP%]{color:#666}.wave-icon[_ngcontent-%COMP%]{max-width:15px;width:auto;height:auto;margin-bottom:-2px}"]}),t})();class r8e{}function s8e(t,n){if(1&t){const e=In();I(0,"div"),I(1,"ion-item"),et(2,"img",10),I(3,"ion-label",11),ot("click",function(){const r=bt(e),s=r.$implicit,c=r.index;return ve(2).viewSurfSession(s.uuid,c)}),I(4,"ion-text",12),I(5,"h2"),gt(6),z(),z(),I(7,"p"),et(8,"ion-icon",13),gt(9),et(10,"img",14),gt(11),z(),z(),I(12,"ion-label",15),I(13,"p",11),ot("click",function(r){const s=bt(e),c=s.$implicit,h=s.index;return ve(2).moreOptions(r,c,h)}),gt(14," Options "),et(15,"ion-icon",16),z(),z(),z(),z()}if(2&t){const e=n.$implicit;K(6),Ls(e.location),K(3),Qi(" ",e.when," | "),K(2),Qi(" ",e.waves," ")}}function o8e(t,n){if(1&t&&(I(0,"div"),ft(1,s8e,16,3,"div",9),z()),2&t){const e=ve();K(1),Q("ngForOf",e.historyList)}}function a8e(t,n){1&t&&(I(0,"div"),et(1,"app-nodata"),z())}let l8e=(()=>{class t extends zc{constructor(e,i,r,s,c,h,g,x,S){super(e,i,r,s,c,h),this.loadingController=e,this.alertController=i,this.toastController=r,this.storageService=s,this.errorsService=c,this.loginService=h,this.feedService=g,this.popoverController=x,this.router=S,this.selectedDate=(new Date).toISOString(),this.historyList=new Array}ngOnInit(){this.token=this.storageService.getToken(),this.loadFeed()}ngAfterViewInit(){super.doUserDetailsRefresh()}loadFeed(){super.createLoading().subscribe(e=>{e.present(),this.feedService.getFeed(this.token).subscribe(i=>{this.historyList=this.toHistoryList(i),e.dismiss()},i=>{e.dismiss(),super.showErrorMessage(JSON.stringify(i))})})}toHistoryList(e){const i=[];return e&&e.length>0&&e.forEach(r=>{const s=new r8e;s.uuid=r.uuid,s.comment=r.comment,s.when=r.when,s.location=r.location,s.waves=""+r.waveCount,s.timeSurfed="N/A",i.push(s)}),i}viewSurfSession(e,i){this.router.navigate(["/view/",e],{queryParams:{origin:"feed"}})}moreOptions(e,i,r){this.popoverController.create({component:IO,componentProps:{data:i,controller:this.popoverController,itemIndex:r},event:e,translucent:!0}).then(c=>{c.onDidDismiss().then(h=>{this.loadFeed()}),c.present()},c=>{super.showErrorMessage(JSON.stringify(c))})}doFeedRefresh(e){this.loadFeed(),e.target.complete()}}return t.\u0275fac=function(e){return new(e||t)(B(Zo),B(Io),B(yo),B(X1),B(Pc),B(Vc),B(NO),B(kx),B(rs))},t.\u0275cmp=ht({type:t,selectors:[["app-feed"]],features:[Ln],decls:22,vars:3,consts:[["color","primary"],["slot","start"],["slot","fixed",3,"ionRefresh"],[1,"full-width","info-divider"],["lines","none"],[1,"ion-no-padding","ion-no-margin"],["text-nowrap","","size","8",1,"ion-no-padding","ion-no-margin","ion-text-left"],["size","4",1,"ion-no-padding","ion-no-margin","ion-text-right"],[4,"ngIf"],[4,"ngFor","ngForOf"],["src","/assets/images/surfer.png",1,"blue-surfer-icon"],[3,"click"],["color","black"],["name","alarm-outline",1,"history-icon-detail"],["src","/assets/images/wave.png",1,"wave-icon"],[1,"ion-text-right"],["name","ellipsis-vertical-outline",1,"more-opts-icon"]],template:function(e,i){1&e&&(I(0,"ion-header"),I(1,"ion-toolbar",0),I(2,"ion-buttons",1),et(3,"ion-menu-button"),z(),I(4,"ion-title"),I(5,"ion-label"),gt(6,"Feed"),z(),z(),z(),z(),I(7,"ion-content"),I(8,"ion-refresher",2),ot("ionRefresh",function(s){return i.doFeedRefresh(s)}),et(9,"ion-refresher-content"),z(),I(10,"ion-item-group"),et(11,"div",3),I(12,"ion-item",4),I(13,"ion-grid",5),I(14,"ion-row",5),I(15,"ion-col",6),I(16,"ion-label"),gt(17),z(),z(),I(18,"ion-col",7),gt(19," Latest "),z(),z(),z(),z(),ft(20,o8e,2,1,"div",8),ft(21,a8e,2,0,"div",8),z(),z()),2&e&&(K(17),Qi("",i.historyList.length," Surf Sessions"),K(3),Q("ngIf",i.historyList.length>0),K(1),Q("ngIf",!(i.historyList.length>0)))},directives:[Ul,$l,V4,O4,Lc,el,K2,Og,Ng,k3,J2,F4,N4,ih,di,tr,R4,Q2,a5],styles:[".date-select-text[_ngcontent-%COMP%]{margin-right:15px}.date-time-icon[_ngcontent-%COMP%]{position:absolute!important;right:0px;top:3px}.history-icon-detail[_ngcontent-%COMP%]{margin-bottom:-2px}.more-opts-icon[_ngcontent-%COMP%]{font-size:24px;margin-bottom:-5px}.surf-sessions-label[_ngcontent-%COMP%]{color:#666}.wave-icon[_ngcontent-%COMP%]{max-width:15px;width:auto;height:auto;margin-bottom:-2px}"]}),t})(),c8e=(()=>{class t{constructor(e,i,r,s,c,h){this.activatedRoute=e,this.router=i,this.stravaService=r,this.toastController=s,this.alertController=c,this.loadingController=h}ngOnInit(){var e=this;return(0,Q4.Z)(function*(){const r=e.activatedRoute.snapshot.queryParamMap.get("code"),s=yield e.loadingController.create({animated:!0,message:"Please wait.."});yield s.present();try{const c=yield e.stravaService.exchangeToken(r).toPromise();e.stravaService.storeStravaAuth(c,!0),yield s.dismiss(),yield(yield e.toastController.create({message:"Strava Account Linked you can now use it during Upload.",animated:!0,duration:5e3})).present(),yield e.router.navigate(["/feed"])}catch(c){yield s.dismiss(),yield(yield e.alertController.create({message:"Could not link your Strava account, error message:"+JSON.stringify(c),animated:!0})).present(),yield e.router.navigate(["/feed"])}})()}}return t.\u0275fac=function(e){return new(e||t)(B(Mc),B(rs),B(kw),B(yo),B(Io),B(Zo))},t.\u0275cmp=ht({type:t,selectors:[["app-strava"]],decls:3,vars:0,template:function(e,i){1&e&&(et(0,"br"),I(1,"h4"),gt(2,"Almost there, please wait.."),z())},styles:[""]}),t})();class h8e{constructor(n){this.resultSelector=n}call(n,e){return e.subscribe(new d8e(n,this.resultSelector))}}class d8e extends at{constructor(n,e,i=Object.create(null)){super(n),this.resultSelector=e,this.iterators=[],this.active=0,this.resultSelector="function"==typeof e?e:void 0}_next(n){const e=this.iterators;ne(n)?e.push(new p8e(n)):e.push("function"==typeof n[mt]?new f8e(n[mt]()):new m8e(this.destination,this,n))}_complete(){const n=this.iterators,e=n.length;if(this.unsubscribe(),0!==e){this.active=e;for(let i=0;ithis.index}hasCompleted(){return this.array.length===this.index}}class m8e extends Mo{constructor(n,e,i){super(n),this.parent=e,this.observable=i,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}[mt](){return this}next(){const n=this.buffer;return 0===n.length&&this.isComplete?{value:null,done:!0}:{value:n.shift(),done:!1}}hasValue(){return this.buffer.length>0}hasCompleted(){return 0===this.buffer.length&&this.isComplete}notifyComplete(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()}notifyNext(n){this.buffer.push(n),this.parent.checkIterators()}subscribe(){return Jo(this.observable,new qi(this))}}class Iw{constructor(n){n&&(this.avgSpeed=n.avgSpeed,this.maxSpeed=n.maxSpeed,this.distance=n.distance,this.time=n.time,this.data=n.data)}toTimestamp(){const n=this.toValidTime(),e=new Date;return e.setHours(n[0],n[1],n[2],0),e.getTime()}toValidTime(){if(this.time){const n=this.time.split(" "),e=n[0].split(":");let r=e[0];const s=e[1],c=e[2];return"12"===r&&(r="00"),"PM"===n[1]&&(r=parseInt(r,10)+12+""),[parseInt(r,10),parseInt(s,10),parseInt(c,10)]}return[0,0,0]}}var jN={prefix:"fas",iconName:"calendar-days",icon:[448,512,["calendar-alt"],"f073","M160 32V64H288V32C288 14.33 302.3 0 320 0C337.7 0 352 14.33 352 32V64H400C426.5 64 448 85.49 448 112V160H0V112C0 85.49 21.49 64 48 64H96V32C96 14.33 110.3 0 128 0C145.7 0 160 14.33 160 32zM0 192H448V464C448 490.5 426.5 512 400 512H48C21.49 512 0 490.5 0 464V192zM64 304C64 312.8 71.16 320 80 320H112C120.8 320 128 312.8 128 304V272C128 263.2 120.8 256 112 256H80C71.16 256 64 263.2 64 272V304zM192 304C192 312.8 199.2 320 208 320H240C248.8 320 256 312.8 256 304V272C256 263.2 248.8 256 240 256H208C199.2 256 192 263.2 192 272V304zM336 256C327.2 256 320 263.2 320 272V304C320 312.8 327.2 320 336 320H368C376.8 320 384 312.8 384 304V272C384 263.2 376.8 256 368 256H336zM64 432C64 440.8 71.16 448 80 448H112C120.8 448 128 440.8 128 432V400C128 391.2 120.8 384 112 384H80C71.16 384 64 391.2 64 400V432zM208 384C199.2 384 192 391.2 192 400V432C192 440.8 199.2 448 208 448H240C248.8 448 256 440.8 256 432V400C256 391.2 248.8 384 240 384H208zM320 432C320 440.8 327.2 448 336 448H368C376.8 448 384 440.8 384 432V400C384 391.2 376.8 384 368 384H336C327.2 384 320 391.2 320 400V432z"]},aR={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M224 480c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25l192-192c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L77.25 256l169.4 169.4c12.5 12.5 12.5 32.75 0 45.25C240.4 476.9 232.2 480 224 480z"]},lR={prefix:"fas",iconName:"chevron-right",icon:[320,512,[9002],"f054","M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"]},ZB={prefix:"fas",iconName:"location-dot",icon:[384,512,["map-marker-alt"],"f3c5","M168.3 499.2C116.1 435 0 279.4 0 192C0 85.96 85.96 0 192 0C298 0 384 85.96 384 192C384 279.4 267 435 215.7 499.2C203.4 514.5 180.6 514.5 168.3 499.2H168.3zM192 256C227.3 256 256 227.3 256 192C256 156.7 227.3 128 192 128C156.7 128 128 156.7 128 192C128 227.3 156.7 256 192 256z"]};let Gze=(()=>{class t{constructor(e){this.httpClient=e,this.surfSessionUrl="https://api.wavestracker.com/api/v3/web/show/",this.httpOptions={headers:new y2({"Content-Type":"application/json","Access-Control-Allow-Origin":"*"})}}getSurfSession(e){return this.httpClient.get(this.surfSessionUrl+e,this.httpOptions)}}return t.\u0275fac=function(e){return new(e||t)(Mt(_2))},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),Wze=(()=>{class t{constructor(){this.waveDataArray=new Array,this.geoJsonArray=[],this.hasValidSubs=!1}initialise(e){e&&(this.hasValidSubs=e.validSubs,this.waveDataArray=this.sortWaveDataList(e),e.waveDataList=this.waveDataArray,this.surfSession=JSON.parse(JSON.stringify(e)),this.processDataReceived())}sortWaveDataList(e){const r=e.waveDataList.sort((s,c)=>{const h=new Iw(s).toTimestamp(),g=new Iw(c).toTimestamp();return h>g?1:g>h?-1:0});return e.waveDataList=r,r}processDataReceived(){this.waveDataArray.forEach(e=>{const i=this.toGeoJSON(e),r=this.addMetadata(i,e);this.geoJsonArray.push(r)})}toGeoJSON(e){const i=[];return JSON.parse(e.data).forEach(s=>{i.push([s.lng,s.lat])}),this.asGeoJSON(i)}addMetadata(e,i){const r=this.getStrokeColour(i);return e.features[0].properties.colour=r,e.features[0].properties.lineWidth=4,e.features[0].properties.time=i.time,e}getStrokeColour(e){let i="#49A4D0";return this.hasValidSubs&&this.isLongestWave(e)&&(i="#EB452F"),i}isLongestWave(e){const i=e.distance;let r=!0;return this.waveDataArray.forEach(s=>{s.distance>i&&(r=!1)}),r}getSurfSession(){return this.surfSession}getAllWaves(){return this.geoJsonArray}asGeoJSON(e){return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}}]}}reset(){this.surfSession=void 0,this.hasValidSubs=!1,this.waveDataArray=[],this.geoJsonArray=[]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Jt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function qze(t,n){if(1&t){const e=In();_1(0),I(1,"ion-row"),I(2,"div",25),ot("click",function(){return bt(e),ve().closeSurfSession()}),gt(3," CLOSE "),et(4,"ion-icon",26),z(),z(),x1()}}function Xze(t,n){if(1&t&&(_1(0),I(1,"ion-row",27),I(2,"div",20),I(3,"span",21),gt(4," DETAILS "),z(),z(),I(5,"div",22),I(6,"span",23),gt(7),z(),z(),z(),I(8,"ion-row",7),I(9,"div",20),I(10,"span",23),gt(11),z(),z(),I(12,"div",22),I(13,"span",23),gt(14),z(),z(),z(),I(15,"ion-row",7),I(16,"div",20),I(17,"span",23),gt(18),z(),z(),I(19,"div",22),I(20,"span",23),gt(21),z(),z(),z(),x1()),2&t){const e=ve();K(7),Qi("Time: ",null==e.waveData?null:e.waveData.time,""),K(4),Qi("Time Riding: ",e.surfSession.timeRiding,"(s)"),K(3),zl("Wave Distance: ",null==e.waveData?null:e.waveData.distance,"",null==e.surfSession?null:e.surfSession.distanceUnit,""),K(4),zl("Avg Speed: ",null==e.waveData?null:e.waveData.avgSpeed,"",e.surfSession.speedUnit,""),K(3),zl("Max Speed: ",null==e.waveData?null:e.waveData.maxSpeed,"",e.surfSession.speedUnit,"")}}const Zze=[{path:"",redirectTo:"feed",pathMatch:"full"},{path:"login",component:Dfe},{path:"feed",component:l8e,canActivate:[vh]},{path:"history",component:Mfe,canActivate:[vh]},{path:"leaderboard",component:dfe,canActivate:[vh]},{path:"near",component:Kfe,canActivate:[vh]},{path:"statistics",component:Ife,canActivate:[vh]},{path:"premium",component:ife,canActivate:[vh]},{path:"settings",component:qfe,canActivate:[vh]},{path:"upload",component:i8e,canActivate:[vh]},{path:"view/:surfSessionId",component:(()=>{class t{constructor(e,i,r,s,c,h,g){this.route=e,this.pageTitle=i,this.httpService=r,this.mapService=s,this.alertController=c,this.menuController=h,this.router=g,this.faCalendar=jN,this.faMapMarkerAlt=ZB,this.faChevronRight=lR,this.faChevronLeft=aR,this.viewWaveIndex=-1,this.mapContainerId="",this.token=localStorage.getItem("token"),this.mapMarkers=[],this.mbKey="pk.eyJ1Ijoid2F2ZXN0cmFja2VyIiwiYSI6ImNrenMxN3ZvbTM4dnYydXBhaGQ3enY5NmkifQ.Ea0gjmvmmD--QGF5LGFang",this.origin="",this.surfSessionId="",this.watchRouterData()}watchRouterData(){(function(...t){const n=t[t.length-1];return"function"==typeof n&&t.pop(),ma(t,void 0).lift(new h8e(n))})(this.route.queryParams,this.route.params).subscribe(r=>{let s={surfSessionId:"",origin:""};r.forEach(c=>{s=Object.assign(Object.assign({},s),c)}),this.surfSessionId=s.surfSessionId,this.origin=s.origin})}ngOnInit(){this.mapContainerId=this.randomString(),this.hideAppMenu()}ngAfterViewInit(){this.initializeMap()}initializeMap(){J9.accessToken=this.mbKey;const e=new J9.Map({container:this.mapContainerId,style:"mapbox://styles/mapbox/satellite-v9",center:[151.2153,-33.8568],zoom:16});this.mapboxMap=e,e.on("load",()=>{this.retrieveSurfSession(),e.resize()})}retrieveSurfSession(){this.httpService.getSurfSession(this.surfSessionId).subscribe(e=>{this.initializeWithSurfData(e),this.addMapLayers(),this.centerMap()},e=>{this.openDialog("An unexpected error happened, details: "+JSON.stringify(e))})}initializeWithSurfData(e){const i=class{constructor(){}static toSurfSessionV3(n){const e=n.waveDataList;return e.forEach(i=>{const r=[];JSON.parse(i.data).forEach(c=>{c.latitude&&c.longitude&&(c.lat=c.latitude,c.lng=c.longitude,c.timestamp=c.dataTimestamp),r.push(c)}),i.data=JSON.stringify(r)}),n.waveDataList=e,n.waveDataList.sort((i,r)=>JSON.parse(i.data)[0].timestamp>JSON.parse(r.data)[0].timestamp?1:-1),n}}.toSurfSessionV3(e);this.surfSession=JSON.parse(JSON.stringify(i)),this.mapService.initialise(i),this.updatePageTitle(i)}addMapLayers(){this.mapService.getAllWaves().forEach((i,r)=>{const s=""+r;this.mapboxMap.addSource(s,{type:"geojson",data:i}),this.mapboxMap.addLayer({id:s,type:"line",source:s,paint:{"line-width":["get","lineWidth"],"line-color":["get","colour"]}}),this.addMarker(r)})}centerMap(e=0){const r=this.mapService.getAllWaves()[e].features[0].geometry.coordinates[0];this.mapboxMap.panTo(r)}updatePageTitle(e){this.pageTitle.setTitle(e.surferName+" @ "+e.location+" || WavesTracker - Track Your Surf Sessions")}nextWave(){this.surfSession.validSubs&&(this.increaseWaveIndex(),this.showWaveBasedOnIndex())}previousWave(){this.surfSession.validSubs&&(this.decreaseWaveIndex(),this.showWaveBasedOnIndex())}increaseWaveIndex(){const e=this.mapService.getAllWaves().length-1,i=this.viewWaveIndex+1;this.viewWaveIndex=i>e?-1:i}decreaseWaveIndex(){const e=this.mapService.getAllWaves().length-1,i=this.viewWaveIndex-1;this.viewWaveIndex=i<-1?e:i}showWaveBasedOnIndex(){this.viewWaveIndex>=0?(this.hideAllWaves(),this.removeAllMarkers(),this.showWave(this.viewWaveIndex),this.addMarker(this.viewWaveIndex),this.centerMap(this.viewWaveIndex),this.populateWaveData(this.viewWaveIndex)):(this.showAllWaves(),this.centerMap(),this.populateWaveData())}populateWaveData(e=-1){let i=new Iw;if(e>=0){const r=this.mapService.getSurfSession().waveCount;i=this.mapService.getSurfSession().waveDataList[e],this.surfSession.timeRiding=this.getTimeRiding(i),this.surfSession.waveCount=r+"/"+(e+1)}else i.avgSpeed=this.mapService.getSurfSession().avgSpeed,i.maxSpeed=this.mapService.getSurfSession().maxSpeed,i.distance=this.mapService.getSurfSession().totalDistanceSurfed,this.surfSession.waveCount=this.mapService.getSurfSession().waveCount,this.surfSession.timeRiding=void 0;this.waveData=i}showAllWaves(){this.mapService.getAllWaves().forEach((e,i)=>{this.mapboxMap.setLayoutProperty(""+i,"visibility","visible"),this.addMarker(i)})}hideAllWaves(){this.mapService.getAllWaves().forEach((e,i)=>{this.mapboxMap.setLayoutProperty(""+i,"visibility","none")})}showWave(e){this.mapboxMap.setLayoutProperty(""+e,"visibility","visible")}addMarker(e){const i=this.mapService.getAllWaves()[e].features[0],s=i.geometry.coordinates[i.geometry.coordinates.length-1],c=i.geometry.coordinates[0],h=document.createElement("div");h.className="marker-start";const g=document.createElement("div");g.className="marker-end";const x=new J9.Marker(h).setLngLat(c).addTo(this.mapboxMap),S=new J9.Marker(g).setLngLat(s).addTo(this.mapboxMap);this.mapMarkers.push(x),this.mapMarkers.push(S)}removeAllMarkers(){this.mapMarkers.forEach(e=>e.remove()),this.mapMarkers=[]}getTimeRiding(e){if(e){const i=JSON.parse(e.data);if(i)return this.calculateTimeRiding(i)}return 0}calculateTimeRiding(e){let r=e[0].timestamp,s=e[e.length-1].timestamp;10===(r+"").length&&(r*=1e3),10===(s+"").length&&(s*=1e3);const c=new Date(r);return(new Date(s).getTime()-c.getTime())/1e3}openDialog(e){this.alertController.create({header:"Attention",buttons:["OK"],message:e}).then(r=>r.present())}closeSurfSession(){this.menuController.enable(!0),this.router.navigate(["/"+this.origin])}hideAppMenu(){window.setTimeout(()=>{this.menuController.close(),this.menuController.enable(!1)},125)}randomString(){const i="ABCDEFGHIJKLMNOPQRSTUVZYWZ-9876543210";let r="";for(let s=0;s<14;s++){const c=Math.floor(Math.random()*i.length);r+=i.charAt(c)}return r}ngOnDestroy(){this.resetMap(),this.surfSession=void 0,this.waveData=void 0,this.mapService.reset()}resetMap(){this.mapService.getAllWaves().forEach((e,i)=>{const r=""+i;this.mapboxMap.removeLayer(r),this.mapboxMap.removeSource(r)})}}return t.\u0275fac=function(e){return new(e||t)(B(Mc),B(sD),B(Gze),B(Wze),B(Io),B(Ec),B(rs))},t.\u0275cmp=ht({type:t,selectors:[["app-view-surf-session"]],decls:70,vars:17,consts:[["id","viewSurfSessionWrapper"],["id","header"],[1,"map-overlay-header"],[4,"ngIf"],[1,"three-cols"],[1,"ion-text-center","text-light","header-column-value-size"],[1,"fa-lg","header-property",3,"icon"],[1,"row"],[1,"col-sm-12","header-property","text-center","text-truncate"],[1,"ion-text-center","header-column-logo-size"],["src","/assets/images/logo.png",1,"app-logo"],[1,"map-canvas",3,"id"],[1,"three-cols","text-left"],[3,"click"],["size","lg",2,"margin-right","10px",3,"icon"],[1,"three-cols","text-center"],[1,"three-cols","text-right","ion-text-right"],["size","lg",2,"margin-left","10px",3,"icon"],[1,"row","top-table-colour-separator"],[1,"row","data-container-info"],[1,"two-cols","left-data-info-space"],[1,"data-container-info-title"],[1,"two-cols"],[1,"bottom-value"],[1,"ion-text-center",2,"margin-top","10px"],[1,"ion-text-right","one-col",3,"click"],["name","close-outline"],[1,"details-container"]],template:function(e,i){1&e&&(I(0,"ion-content"),I(1,"div",0),I(2,"ion-row"),I(3,"div",1),I(4,"div",2),I(5,"ion-grid"),ft(6,qze,5,0,"ng-container",3),I(7,"ion-row"),I(8,"div",4),I(9,"div",5),et(10,"fa-icon",6),I(11,"div",7),I(12,"div",8),gt(13),z(),z(),z(),z(),I(14,"div",4),I(15,"div",9),et(16,"img",10),I(17,"div",7),I(18,"div",8),gt(19),z(),z(),z(),z(),I(20,"div",4),I(21,"div",5),et(22,"fa-icon",6),I(23,"div",7),I(24,"div",8),gt(25),z(),z(),z(),z(),z(),z(),z(),z(),z(),I(26,"ion-row"),et(27,"div",11),z(),I(28,"ion-grid"),I(29,"ion-row"),I(30,"div",12),I(31,"ion-button",13),ot("click",function(){return i.previousWave()}),et(32,"fa-icon",14),gt(33," PREV "),z(),z(),I(34,"div",15),et(35,"span"),z(),I(36,"div",16),I(37,"ion-button",13),ot("click",function(){return i.nextWave()}),gt(38," NEXT "),et(39,"fa-icon",17),z(),z(),z(),z(),I(40,"ion-grid"),et(41,"div",18),I(42,"ion-grid",19),I(43,"ion-grid"),I(44,"ion-row"),I(45,"div",20),I(46,"span",21),gt(47," STATS "),z(),z(),I(48,"div",22),I(49,"span",23),gt(50),z(),z(),z(),I(51,"ion-row",7),I(52,"div",20),I(53,"span",23),gt(54),z(),z(),I(55,"div",22),I(56,"span",23),gt(57),z(),z(),z(),I(58,"ion-row",7),I(59,"div",20),I(60,"span",23),gt(61),z(),z(),I(62,"div",22),I(63,"span",23),gt(64),z(),z(),z(),ft(65,Xze,22,8,"ng-container",3),z(),z(),I(66,"div"),I(67,"div",24),I(68,"span",23),gt(69," \xa9 Waves Tracker "),z(),z(),z(),z(),z(),z()),2&e&&(K(6),Q("ngIf",i.token),K(4),Q("icon",i.faMapMarkerAlt),K(3),Qi(" ",null==i.surfSession?null:i.surfSession.location," "),K(6),Qi(" ",null==i.surfSession?null:i.surfSession.surferName," "),K(3),Q("icon",i.faCalendar),K(3),Qi(" ",null==i.surfSession?null:i.surfSession.when," "),K(2),Df("id",i.mapContainerId),K(5),Q("icon",i.faChevronLeft),K(7),Q("icon",i.faChevronRight),K(11),Qi("Waves: ",null==i.surfSession?null:i.surfSession.waveCount,""),K(4),zl("Longest Wave: ",null==i.surfSession?null:i.surfSession.longestRide,"",null==i.surfSession?null:i.surfSession.distanceUnit,""),K(3),Qi("Time Surfing: ",null==i.surfSession?null:i.surfSession.timeSurfed,""),K(4),Qi("Calories: ",null==i.surfSession?null:i.surfSession.calories,"(avg)"),K(3),zl("Total Distance: ",null==i.surfSession?null:i.surfSession.totalDistanceSurfed,"",null==i.surfSession?null:i.surfSession.distanceUnit,""),K(1),Q("ngIf",i.viewWaveIndex>=0))},directives:[K2,N4,F4,di,_O,Tc,Q2],styles:[".map-canvas[_ngcontent-%COMP%]{max-width:100vw;width:100vw;max-height:75vh;height:65vh;min-height:55vh}.map-overlay-header[_ngcontent-%COMP%]{color:#fff;position:absolute;overflow:hidden;left:0;right:0;z-index:9876;background:rgba(0,0,0,.6);opacity:.6;height:50px!important;width:100%!important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.three-cols[_ngcontent-%COMP%]{width:33%}.two-cols[_ngcontent-%COMP%]{width:50%}.one-col[_ngcontent-%COMP%]{width:100%}.app-logo[_ngcontent-%COMP%]{width:25px}.header-top-space[_ngcontent-%COMP%]{padding-top:5px}.header-property[_ngcontent-%COMP%]{padding-left:5px;padding-right:5px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wt-prev-next-container[_ngcontent-%COMP%]{margin-top:10px}.wt-prev-arrow-spacing[_ngcontent-%COMP%]{margin-left:7px}.wt-next-arrow-spacing[_ngcontent-%COMP%]{margin-right:5px}.top-table-colour-separator[_ngcontent-%COMP%]{margin-top:5px;border-top:4px solid #0080ff}.bottom-value[_ngcontent-%COMP%]{font-size:14px;color:#666;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.bottom-divider-pipe[_ngcontent-%COMP%]{font-size:32px;font-weight:20;margin-top:-5px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.data-container-info-title[_ngcontent-%COMP%]{color:#000;font-weight:400;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.data-container-info[_ngcontent-%COMP%]{border-radius:5px;margin-right:10px;margin-left:10px;margin-top:10px;box-shadow:5px 5px 30px 5px #cecece54;padding-top:10px;padding-bottom:10px}.prev-next-container[_ngcontent-%COMP%]{border-radius:100px;margin-right:10px;margin-left:10px;margin-top:10px;box-shadow:5px 5px 30px 5px #cecece54;padding-top:10px;padding-bottom:10px}.left-data-info-space[_ngcontent-%COMP%]{padding-left:15px}.details-container[_ngcontent-%COMP%]{margin-top:10px}"]}),t})()},{path:"strava",component:c8e}];let Yze=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t}),t.\u0275inj=yi({imports:[[fA.forRoot(Zze,{preloadingStrategy:cA})],fA]}),t})();const Kze={provide:iA,useClass:class{shouldDetach(n){return!1}shouldAttach(n){return!1}store(n,e){}retrieve(n){return null}shouldReuseRoute(n,e){if(n.routeConfig!==e.routeConfig)return!1;const i=n.params,r=e.params,s=Object.keys(i),c=Object.keys(r);if(s.length!==c.length)return!1;for(const h of s)if(r[h]!==i[h])return!1;return!0}}},ePe={provide:"SocialAuthServiceConfig",useValue:{autoLogin:!1,providers:[{id:jg.PROVIDER_ID,provider:new jg("1058665419018-qikesoehlq41bsdtqp95pkcrnjleosb5.apps.googleusercontent.com")},{id:zx.PROVIDER_ID,provider:new zx("295404217542510")}]}},iPe={enabled:true,registrationStrategy:"registerWhenStable:5000"};let rPe=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Xi({type:t,bootstrap:[Q5e]}),t.\u0275inj=yi({providers:[Kze,ePe],imports:[[Ky,S3,ose,ase,dre,Bne,xde,U6.forRoot(),Yze,Rde.forRoot("pk_live_51LGor6I7YfTJxaN7y3I2XzHLMFrkF4f7Ha9HFxvF3k7fNYXrgXifhbQi2Pa1lJfpH723BeMy88DeoGR8oFPuapr600KL3od7KN"),Goe,I5e,R5e.withConfig({accessToken:"pk.eyJ1Ijoid2F2ZXN0cmFja2VyIiwiYSI6ImNrenMxN3ZvbTM4dnYydXBhaGQ3enY5NmkifQ.Ea0gjmvmmD--QGF5LGFang"}),Z5e.register("ngsw-worker.js",iPe)]]}),t})();(function(){if(GL)throw new Error("Cannot enable prod mode after platform setup.");jL=!1})(),HJ().bootstrapModule(rPe).catch(t=>console.error(t))},863:(kt,qt,ye)=>{var fe={"./ion-action-sheet.entry.js":[7321,8592,7321],"./ion-alert.entry.js":[6108,8592,6108],"./ion-app_8.entry.js":[1489,8592,1489],"./ion-avatar_3.entry.js":[305,8592,305],"./ion-back-button.entry.js":[5830,8592,5830],"./ion-backdrop.entry.js":[7757,7757],"./ion-button_2.entry.js":[392,8592,392],"./ion-card_5.entry.js":[6911,8592,6911],"./ion-checkbox.entry.js":[937,8592,937],"./ion-chip.entry.js":[8695,8592,8695],"./ion-col_3.entry.js":[6034,6034],"./ion-datetime_3.entry.js":[8837,8592,8837],"./ion-fab_3.entry.js":[4195,8592,4195],"./ion-img.entry.js":[1709,1709],"./ion-infinite-scroll_2.entry.js":[6490,8592,3087],"./ion-input.entry.js":[4513,8592,4513],"./ion-item-option_3.entry.js":[8056,8592,8056],"./ion-item_8.entry.js":[862,8592,862],"./ion-loading.entry.js":[7509,8592,7509],"./ion-menu_3.entry.js":[6272,8592,6272],"./ion-modal.entry.js":[1855,8592,1855],"./ion-nav_2.entry.js":[8708,8592,8708],"./ion-popover.entry.js":[3527,8592,3527],"./ion-progress-bar.entry.js":[4694,8592,4694],"./ion-radio_2.entry.js":[9222,8592,9222],"./ion-range.entry.js":[5277,8592,5277],"./ion-refresher_2.entry.js":[9921,8592,9921],"./ion-reorder_2.entry.js":[3122,8592,3122],"./ion-ripple-effect.entry.js":[1602,1602],"./ion-route_4.entry.js":[5174,8592,5174],"./ion-searchbar.entry.js":[7895,8592,7895],"./ion-segment_2.entry.js":[6164,8592,6164],"./ion-select_3.entry.js":[592,8592,592],"./ion-slide_2.entry.js":[7162,7162],"./ion-spinner.entry.js":[1374,8592,1374],"./ion-split-pane.entry.js":[7896,7896],"./ion-tab-bar_2.entry.js":[5043,8592,5043],"./ion-tab_2.entry.js":[7802,8592,7802],"./ion-text.entry.js":[9072,8592,9072],"./ion-textarea.entry.js":[2191,8592,2191],"./ion-toast.entry.js":[801,8592,801],"./ion-toggle.entry.js":[7110,8592,7110],"./ion-virtual-scroll.entry.js":[431,431]};function be(Me){if(!ye.o(fe,Me))return Promise.resolve().then(()=>{var Fe=new Error("Cannot find module '"+Me+"'");throw Fe.code="MODULE_NOT_FOUND",Fe});var p=fe[Me],Qe=p[0];return Promise.all(p.slice(1).map(ye.e)).then(()=>ye(Qe))}be.keys=()=>Object.keys(fe),be.id=863,kt.exports=be},8239:(kt,qt,ye)=>{"use strict";function fe(Me,p,Qe,Fe,ne,de,re){try{var pe=Me[de](re),Xe=pe.value}catch(ze){return void Qe(ze)}pe.done?p(Xe):Promise.resolve(Xe).then(Fe,ne)}function be(Me){return function(){var p=this,Qe=arguments;return new Promise(function(Fe,ne){var de=Me.apply(p,Qe);function re(Xe){fe(de,Fe,ne,re,pe,"next",Xe)}function pe(Xe){fe(de,Fe,ne,re,pe,"throw",Xe)}re(void 0)})}}ye.d(qt,{Z:()=>be})}},kt=>{kt(kt.s=1997)}]);