PageSourceSearch

https://www.hcahealthcare.co.uk/_next/static/chunks/3ctoegn4f_jto.js

js hcahealthcare.co.uk collected 2026-09-24 17:41:03 UTC 2,892,485 bytes, 148 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,464540,i=>{"use strict";var r=i.i(2317);i.s([],73391),i.i(73391);var n=i.i(675821),a=i.i(145255),o=i.i(8984),s=i.i(735918),l=i.i(288223),u=i.i(137820),c=i.i(623325);i.s(["ANALYTICS_PLUGIN_NAME",()=>u.ANALYTICS_PLUGIN_NAME,"API_VERSION",()=>o.API_VERSION,"BOT_DETECTION_COOKIE",()=>c.BOT_DETECTION_COOKIE,"CLIENT_ID_COOKIE_NAME",()=>o.CLIENT_ID_COOKIE_NAME,"COOKIE_NAME_PREFIX",()=>o.COOKIE_NAME_PREFIX,"CORRELATION_ID_HEADER",()=>o.CORRELATION_ID_HEADER,"DAILY_SECONDS",()=>o.DAILY_SECONDS,"DEFAULT_COOKIE_EXPIRY_DAYS",()=>o.DEFAULT_COOKIE_EXPIRY_DAYS,"LIBRARY_VERSION",()=>o.LIBRARY_VERSION,"fetchClientIdFromEdgeProxy",()=>s.fetchClientIdFromEdgeProxy,"generateCorrelationId",0,function(){return globalThis.crypto.randomUUID().replace(/-/g,"")},"getAnalyticsPlugin",()=>l.getAnalyticsPlugin,"getDefaultCookieAttributes",()=>n.getDefaultCookieAttributes,"isBot",()=>c.isBot,"isBotClientSide",()=>c.isBotClientSide,"isBotServerSide",()=>c.isBotServerSide,"language",()=>a.language,"pageName",()=>a.pageName],99129);var d=i.i(99129);i.s([],892561),i.i(892561),i.i(334357);var h=i.i(576368),f=i.i(563834),p=i.i(414887),m=i.i(134433);let{ERROR_MESSAGES:g}=f.constants,_=async(i,r,n)=>{if(!i)return m.default.form(`${g.MV_001}. Form was not able to render.`),"";let a=(0,p.getEdgeProxyFormsUrl)(i,r,n);try{m.default.form(`Fetching form data from ${a}`);let i=await fetch(a,{method:"GET",cache:"no-cache"});if(200!==i.status)throw Error(`Failed to fetch form data. ${g.CONTACT_SUPPORT}`);let r=await i.text();return m.default.form(`Form data fetch response: ${r}`),r}catch(i){throw m.default.form(`Form '${r}' was not able to render. ${g.CONTACT_SUPPORT}`,i),i}};i.s(["executeScriptElements",0,i=>{let r=i.querySelectorAll("script");r&&Array.from(r).forEach(i=>{var r;let n=document.createElement("script");Array.from(i.attributes).forEach(i=>{n.setAttribute(i.name,i.value)}),n.text=i.text,null==(r=null==i?void 0:i.parentNode)||r.replaceChild(n,i)})},"loadForm",0,_,"subscribeToFormSubmitEvent",0,(i,r)=>{i.addEventListener("form:engage",i=>{let{formId:n,name:a}=i.detail;n&&a&&(m.default.form("Sending form event",n,a),(0,h.form)(n,a,(null==r?void 0:r.replace(/-/g,""))||""))})}],184357);var y=i.i(184357),y=y,v=i.i(237498),x=i.i(885989);let{ERROR_MESSAGES:b}=f.constants,{executeScriptElements:w,loadForm:T,subscribeToFormSubmitEvent:E}=y,{isBotClientSide:S}=d;i.s(["Form",0,({params:i,rendering:n})=>{var a,o,s,l,u;let c=null==i?void 0:i.RenderingIdentifier,[d,h]=(0,r.useState)(!1),[f,p]=(0,r.useState)(""),m=(0,v.useSitecore)(),g=(0,r.useRef)(null),_=m.page.mode.isEditing;return((0,r.useEffect)(()=>{var r,n,a,o;if(!f){let s=null==(n=null==(r=m.api)?void 0:r.edge)?void 0:n.clientContextId;if(!s)return void console.warn(`${b.MV_006}. Form cannot be loaded properly on the client`);T(s,i.FormId,null==(o=null==(a=m.api)?void 0:a.edge)?void 0:o.edgeUrl).then(p).catch(()=>{_&&console.error(`Failed to load form with id ${i.FormId}. Check debug logs for content-sdk:form for more details. ${b.CONTACT_SUPPORT}`),h(!0)})}},[f,_,i.FormId,null==(o=null==(a=m.api)?void 0:a.edge)?void 0:o.clientContextId,null==(l=null==(s=m.api)?void 0:s.edge)?void 0:l.edgeUrl]),(0,r.useEffect)(()=>{f&&g.current&&(g.current.innerHTML=f,w(g.current),_||S()||E(g.current,n.uid))},[f,_,n.uid]),_&&d)?r.default.createElement(x.ErrorComponent,{message:"There was a problem loading this section"}):r.default.createElement("div",{ref:g,className:null==(u=i.styles)?void 0:u.trimEnd(),id:c||void 0})},"mockAnalyticsInternalModule",0,i=>{S=i.isBotClientSide},"mockFormModule",0,i=>{w=i.executeScriptElements,T=i.loadForm,E=i.subscribeToFormSubmitEvent}],464540)},733707,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(405133),s=i.i(770705),l=i.i(293715),u=i.i(898205),c=i.i(443107),d=i.i(257818),h=i.i(857690),f=i.i(869806),p=i.i(211452),m=i.i(907771),g=i.i(630077),_=i.i(304684),y=i.i(532328),v=i.i(751344),x=i.i(101943);let b=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})}),w=i=>{let y=i.params.RenderingIdentifier,w=(0,a.useRouter)(),[T,E]=(0,n.use
1State)([]),[S,A]=(0,n.useState)(!0),[C,I]=(0,n.useState)(!1),k=(0,a.useSearchParams)(),R=new URLSearchParams(k.toString()),M=i.fields.servicesFolder.id;(0,n.useEffect)(()=>{window.scrollTo({top:0,behavior:"smooth"});let i=k.get("scanId"),r=k.getAll("extraId"),n=k.get("locationId");n||w.push("/booking/location");let a=r.map(i=>`&extraId=${i}`).join(""),o=`/api/api-layer/tbcbooking/types?scanid=${i}&locationid=${n}&configurationid=${M}${a}`;s.default.get(o).then(i=>{A(!1),I(!1),E(i?.data||[])}).catch(i=>{I(!0),console.log(i)})},[w,k,M]);let L=T.map(n=>{let a;return"phone"===n.type?a=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.default,{variation:"body-bold-small",tag:"p",children:"Enquire Now:"}),(0,r.jsx)(p.default,{children:(0,r.jsxs)("a",{href:`tel:${n.link.url}`,children:[(0,r.jsx)(g.default,{iconName:"iconPhone"}),n.link.title]})})]}):"booking"===n.type?a=(0,r.jsx)(c.default,{size:"small",variation:"full",children:(0,r.jsxs)("button",{onClick:()=>{var r;return r=n.id,void(R.set("typeId",r),w.push(`${i?.fields?.NextLink?.value?.href}?${R}`))},children:[(0,r.jsx)("span",{children:(0,r.jsx)(g.default,{iconName:"iconCalendar"})}),(0,r.jsx)("span",{children:n.link.title})]})}):"cta"===n.type&&(a=(0,r.jsx)(c.default,{size:"small",variation:"full",children:(0,r.jsxs)("a",{href:n.link.url,children:[(0,r.jsx)("span",{children:(0,r.jsx)(g.default,{iconName:"iconCalendar"})}),(0,r.jsx)("span",{children:n.link.title})]})})),{title:(0,r.jsx)("span",{children:n.name}),copy:(0,r.jsx)("span",{children:n.description}),cta:a}});return i.fields?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,id:y||void 0,children:(0,r.jsxs)("div",{className:"component-content",children:[(0,r.jsx)(h.default,{logo:(0,r.jsx)(l.Image,{field:i?.fields?.HCALogo}),progress:(0,r.jsx)(f.default,{currentPage:i?.fields?.CurrentStep?.value,steps:i?.fields?.Steps})}),(0,r.jsx)(_.default,{children:(0,r.jsx)(d.default,{tag:"h1",variation:"heading-1",children:(0,r.jsx)(u.Text,{field:i?.fields?.Title})})}),S&&(0,r.jsx)(v.default,{}),!S&&!C&&(0,r.jsx)(x.default,{cards:L})]})}),(0,r.jsx)(m.default,{children:(0,r.jsx)("div",{children:(0,r.jsx)(p.default,{children:(0,r.jsxs)(o.default,{href:`${i?.fields?.BackLink?.value?.href}?${k.toString()}`,children:[(0,r.jsx)(g.default,{iconName:"iconArrowSmallLeft"}),(0,r.jsx)("span",{children:i.fields.BackLink.value.text||"Back"})]})})})})]}):(0,r.jsx)(b,{...i})};i.s(["Default",0,i=>(0,r.jsx)(y.TheBirthCompanyContextProvider,{children:(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(w,{...i})})}),"TbcLocations",0,w])},674834,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(405133),s=i.i(293715),l=i.i(443107),u=i.i(257818),c=i.i(857690),d=i.i(869806),h=i.i(532328),f=i.i(907771),p=i.i(211452),m=i.i(630077),g=i.i(190408),_=i.i(267770),y=i.i(357300);let v=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})}),x=i=>{let{setSelectedLocation:x,setSelectedTypeOfAppointment:b,setSelectedScanId:w,setSelectedExtras:T,setSelectedSlotId:E,selectedSlotId:S,selectedDate:A,selectedTime:C}=(0,n.useContext)(h.TheBirthCompanyContext),I=i.params.RenderingIdentifier,k=(0,a.useSearchParams)(),R=k.get("scanId"),M=k.get("locationId"),L=k.get("typeId"),P=k.get("slotId"),O=(0,n.useMemo)(()=>k.getAll("extraId"),[k]),[D,F]=(0,n.useState)(""),N=(0,a.useRouter)(),j=new URLSearchParams(k.toString());return(S&&j.set("slotId",S),(0,n.useEffect)(()=>{if(M&&x(M),R&&w(R),L&&b(L),P&&E(P),O&&O.length>0){let i;T(O),F((i=O.map(i=>`extraId=${encodeURIComponent(i)}`).join("&"),`&${i}`))}},[M,x,R,w,L,b,P,E,O,T]),(0,n.useEffect)(()=>{window.scrollTo({top:0,behavior:"smooth"}),R&&M&&L||N.push("/booking/location")},[N,R,M,L]),i.fields)?(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,id:I||void 0,children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.default,{logo:(0,r.jsx)(s.Image,{field:i?.fields?.HCALogo}),progress:(0,r.jsx)(d.default,{currentPage:i?.fields?.CurrentStep?.value,steps:i?.fields?.Steps})}),(0,r.jsx)(y.default,{titleText:i?.fields?.TitleText?.value||"Please select a slot",keyShortNoticeText:i?.fields?.KeyShortNoticeText?.value||"",keyBookOnlineText:i?.fields?.KeyBookOnlineText?.value||"",API_C2_GetConsultantSlots_L
1oadingMsg:i?.fields?.API_C2_GetConsultantSlots_LoadingMsg?.value||"",API_C2_GetConsultantSlots_BaseURL:i?.fields?.API_C2_GetConsultantSlots_BaseURL?.value||"https://api/C2/GetLDBConsultantSlots?",API_C2_GetConsultantSlots_NoResultsMsg:i?.fields?.API_C2_GetConsultantSlots_NoResultsMsg?.value||"No slots found",viewMapText:i?.fields?.ViewMapText?.value||"View location on Google Maps",chooseTimeHeading:i?.fields?.ChooseTimeHeading?.value||"Choose time",shortNoticeIcon:(0,r.jsx)(_.default,{children:i?.fields?.BookByPhoneIcon?.fields?.SvgMarkup?.value})}),(0,r.jsxs)(f.default,{hideTextMobile:!0,children:[(0,r.jsx)("div",{children:(0,r.jsx)(p.default,{children:(0,r.jsxs)(o.default,{href:`${i?.fields?.BackLink?.value?.href}?scanId=${R}&locationId=${M}&typeId=${L}&slotId=${S}${D}`,children:[(0,r.jsx)(m.default,{iconName:"iconArrowSmallLeft"}),(0,r.jsx)("span",{children:i.fields.BackLink.value.text||"Back"})]})})}),""!==A&&""!==C&&(0,r.jsx)(u.default,{tag:"p",variation:"body-medium-extra-large",children:`${i?.fields?.AppointmentSelectedText?.value||"Appointment selected on"} ${A} at ${C}`}),(0,r.jsx)(g.default,{children:(0,r.jsx)(l.default,{size:"small",variation:"full-dark",children:(0,r.jsx)("button",{disabled:""===A&&""===C,onClick:()=>N.push(`${i?.fields?.NextLink?.value?.href}?scanId=${R}&locationId=${M}&typeId=${L}&slotId=${S}${D}`),children:(0,r.jsx)("span",{children:i?.fields?.NextLink?.value?.text||"Book Slot"})})})})]})]})}):(0,r.jsx)(v,{...i})};i.s(["Default",0,i=>(0,r.jsx)(h.TheBirthCompanyContextProvider,{children:(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(x,{...i})})}),"TbcSlots",0,x])},380846,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(405133),s=i.i(770705),l=i.i(955950),u=i.i(293715),c=i.i(257818),d=i.i(857690),h=i.i(869806),f=i.i(211452),p=i.i(907771),m=i.i(630077),g=i.i(72829),_=i.i(304684),y=i.i(913843),v=i.i(573573),x=i.i(532328),b=i.i(751344),w=i.i(756913);let T=i=>i.page.mode.isEditing?(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"TBC Booking Select Location Step"})})}):(0,r.jsx)(r.Fragment,{}),E=i=>{let{selectedLocation:E,setSelectedLocation:S}=(0,n.useContext)(x.TheBirthCompanyContext),A=`booking-location-step-${i.params?.DynamicPlaceholderId}`,C=i.params.RenderingIdentifier,I=(0,a.useRouter)(),[k,R]=(0,n.useState)([]),[M,L]=(0,n.useState)(!0),[P,O]=(0,n.useState)(!1),D=(0,a.useSearchParams)(),F=D.get("scanId"),N=D.get("locationId"),j=i.fields.servicesFolder.id,z=new URLSearchParams(D.toString());return(E&&z.set("locationId",E),(0,n.useEffect)(()=>{N&&S(N)},[N,S]),(0,n.useEffect)(()=>{window.scrollTo({top:0,behavior:"smooth"});let i=`/api/api-layer/tbcbooking/locations?scanid=${F}&configurationId=${j}`;s.default.get(i).then(i=>{L(!1),O(!1),R(i?.data||[])}).catch(i=>{O(!0),console.log(i)})},[F,j]),i.fields)?(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,id:C||void 0,children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.default,{logo:(0,r.jsx)(u.Image,{field:i?.fields?.HCALogo}),progress:(0,r.jsx)(h.default,{currentPage:i?.fields?.CurrentStep?.value,steps:i?.fields?.Steps})}),(0,r.jsx)(_.default,{children:(0,r.jsx)(c.default,{tag:"h1",variation:"heading-1",children:i?.fields?.HeadingText?.value||"Please select a location"})}),M&&(0,r.jsx)(b.default,{}),!M&&!P&&(0,r.jsx)(v.default,{cta:(0,r.jsxs)(r.Fragment,{children:[i?.fields?.CantFindBannerText?.value&&(0,r.jsx)(g.default,{contentVariation:"the-birth-company",title:(0,r.jsx)(c.default,{tag:"p",variation:"body-medium-large",children:i?.fields?.CantFindBannerText?.value})}),i.rendering&&i.componentMap&&(0,r.jsx)(w.default,{children:(0,r.jsx)(l.AppPlaceholder,{name:A,rendering:i.rendering,page:i.page,componentMap:i.componentMap})})]}),children:(0,r.jsx)(r.Fragment,{children:k.map((n,a)=>(0,r.jsx)(y.default,{selected:E===n.id,name:(0,r.jsx)(c.default,{variation:"body-bold-large",children:n.name}),description:(0,r.jsx)(c.default,{variation:"body-small",children:n.description}),handleClick:()=>{var r;S(r=n.id),z.set("locationId",r),I.push(`${i?.fields?.NextLink?.value?.href}?${z.toString()}`)},children:n.nearestAvailability&&(0,r.jsxs)("span",{children:[(0,r.jsx)(m.default,{iconName:"iconClock"}),(0,r.jsx)(c.default,{variation:"body-small",tag:"p",children:n.nearestAvailability})]})},a))})}),(0,r.jsx)(p.default,{children:(0,r.jsx)("div",{children:(0,r.jsx)(f.default,{children:(0,r.jsxs)(o.default,{href:`${i?.fields?.BackLink?.value?.href}?${D.toString()}`,children:[(0,r.jsx)(m.default,{iconName:"iconArrowSmallLeft"}),(0,r.jsx)("span",{children:i.fields.BackLink.value.text||"Back"})]})})})})]})}):(0,r.jsx)(T,{...i})};i.s(["Default",0,i=>(0,r.jsx)(x.TheBirthCompanyContextProvider,{children:(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(E,{...i})})}),"TbcLocations",0,E])},243720,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(770705),s=i.i(249736),l=i.i(443107),u=i.i(301244),c=i.i(532328),d=i.i(257818),h=i.i(623420),f=i.i(190408),p=i.i(751344);let m=i=>i.page.mode.isEditing?(0,r.jsx)("div",{className:`component promo ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Tbc Booking Scans Search. Please click to select datasource"})})}):(0,r.jsx)(r.Fragment,{}),g=i=>{let g,_,y,{searchString:v,setSearchString:x,keywordId:b,setKeywordId:w,extrasList:T,setExtrasList:E,selectedExtras:S,setSelectedExtras:A}=(0,n.useContext)(c.TheBirthCompanyContext),C=(0,a.useRouter)(),[I,k]=(0,n.use
1State)([]),[R,M]=(0,n.useState)(!0),[L,P]=(0,n.useState)(!1),O=(0,a.useSearchParams)(),D=new URLSearchParams(O.toString()),F=i.fields?.data?.item?.servicesFolder.targetItem.id;if((0,n.useEffect)(()=>{let i=O.get("locationId"),r=O.get("typeId");i&&r&&F||C.push("/booking/location"),M(!0);let n=`/api/api-layer/tbcbooking/scans?&locationid=${i}&typeid=${r}&configurationid=${F}`;o.default.get(n).then(i=>{M(!1),P(!1),k(i?.data||[])}).catch(i=>{P(!0),console.log(i)})},[C,F,O]),(0,n.useEffect)(()=>{let i=O.get("scanId"),r=O.getAll("extraId");if(!i)return;w(i);let n=I.find(r=>r.id===i);n?.name&&x(n?.name),n?.extras&&(E(n?.extras),A(r))},[I,O,w,x,E,A]),!i?.fields?.data?.item)return(0,r.jsx)(m,{...i});let N=(_={},I.forEach(i=>{let r=i.area,n=i.subArea||"";r&&(_[r]||(_[r]={}),_[r][n]||(_[r][n]=[]),_[r][n].push(i))}),y={},Object.entries(_).forEach(([i,r])=>{let n=Object.entries(r).map(([i,r])=>({title:i&&i,scans:r}));y[i]=n}),y);return b&&v&&T&&(g=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f.default,{marginBottom:"spacing-4",children:(0,r.jsx)(d.default,{variation:"body-bold-extra-large",tag:"p",children:i.fields?.data?.item?.extrasLabel?.value})}),T.map((i,n)=>{let a,o=`${i.name} (${(a=i.price).endsWith("%")?`${a} scan price surcharge`:`\xa3${Math.round(parseFloat(a))}`})`;return(0,r.jsx)(f.default,{marginBottom:"spacing-2",children:(0,r.jsx)(h.default,{id:n.toString(),label:o,name:i.name,value:i.name,checked:S.includes(i.id),onChange:r=>{r.target.checked?A([...S,i.id]):A(S.filter(r=>r!==i.id))}})},n)})]})),(0,r.jsxs)(s.default,{theme:i.params?.Theme||"A-HCA-White",children:[R&&(0,r.jsx)(p.default,{}),!R&&!L&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.default,{placeholder:i?.fields?.data?.item?.searchPhrasePlaceholder?.value||"Type in a scan or test...",dropdownColumn1Label:Object.keys(N)[0],dropdownColumn1List:Object.values(N)[0]||[],dropdownColumn2Label:Object.keys(N)[1],dropdownColumn2List:Object.values(N)[1]||[]}),g,(0,r.jsx)(f.default,{width:"fit",marginTop:"spacing-5",children:(0,r.jsx)(l.default,{size:"large",variation:"full",children:(0,r.jsx)("button",{type:"submit",disabled:"0"===b,onClick:()=>{let r=i?.fields?.data?.item?.startBookingCTA.jsonValue?.value.href;D.set("scanId",b);let n=S.map(i=>`&extraId=${i}`).join("");C.push(`${r}?${D}${n}`)},children:i.fields.data.item.startBookingCTA?.jsonValue?.value.text})})})]})]})};i.s(["Default",0,i=>(0,r.jsx)(c.TheBirthCompanyContextProvider,{children:(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(g,{...i})})})])},846804,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(405133),s=i.i(257818),l=i.i(249736),u=i.i(335820),c=i.i(954519),d=i.i(443107),h=i.i(630077),f=i.i(518179),p=i.i(661279),m=i.i(62557),g=i.i(138279),_=i.i(511730),y=i.i(208024),v=i.i(359262),x=i.i(955950),b=i.i(314816),w=i.i(811846),T=i.i(785101),E=i.i(770705),S=i.i(705825),A=i.i(780798),C=i.i(252322),I=i.i(465958),k=i.i(751344),R=i.i(756913),M=i.i(782021),L=i.i(462907),P=i.i(649555),O=i.i(571900);let D=i=>{let D=(0,n.useRef)(null),[F,N]=(0,n.useState)(""),[j,z]=(0,n.useState)(""),[B,U]=(0,n.useState)(!1),V=`booking-step-aside-${i.params?.DynamicPlaceholderId}`,H=i.page.siteName,G=i.page.layout.sitecore.context.itemPath,q=(0,n.useRef)(null),$=(0,a.useRouter)(),[W,Y]=(0,n.use
1State)(new Map),[Z,K]=(0,n.useState)(!0),[X,Q]=(0,n.useState)(!0),[J,ee]=(0,n.useState)(!0),[et,ei]=(0,n.useState)(!1),[er,en]=(0,n.useState)(!1),[ea,eo]=(0,n.useState)([]),[es,el]=(0,n.useState)(),eu=(0,a.useSearchParams)();(0,n.useEffect)(()=>{window.scrollTo({top:0,behavior:"smooth"});let i=eu.get("scanId"),r=eu.getAll("extraId"),n=eu.get("locationId"),a=eu.get("typeId"),o=eu.get("slotId"),s=r.map(i=>`&extraId=${i}`).join("");i&&n&&o&&a||$.push("/booking/location");let l=`/api/api-layer/tbcbooking/details?scanid=${i}&locationid=${n}&typeid=${a}&slotid=${o}${s}`;E.default.get(l).then(i=>{ee(!1),ei(!1),el(i?.data||{})}).catch(i=>{ei(i.message||!0)})},[$,eu]);let ec=i=>{if(!i)return;let r=new Date(i),[n,a]=new Intl.DateTimeFormat("en-GB",{weekday:"long",day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit",hour12:!0}).format(r).replace(" at",",").split(", ");if(n&&a)return`${n} at ${a.replace(/\s/g,"")}`},ed=i.fields.data.item.pages.results[0],eh=i.fields.data.item.settings.results[0].children.results,ef=ed.children.results.filter(i=>["Section"].includes(i.template.name)),ep=[];ef.forEach(i=>{i.children.results.forEach(i=>{ep.push(i)})});let em="6LdGxCYjAAAAAMqSiKwfKfM36YnLDcvTt_lt37TX",eg=(0,g.default)(ep,!1),e_=p.z.object(eg),ey=(0,g.default)(ep,!0),ev=p.z.object({...eg,...ey,...{Recaptcha:p.z.string().min(1,"Please complete the reCAPTCHA verification")}}),ex=i=>{if(!q.current)return!1;let r=new FormData(q.current),n=Object.fromEntries(r);try{return"true"===r.get("sameAsPatientDetail")?e_.parse(n):ev.parse(n),Y(new Map),!0}catch(r){if(r instanceof p.z.ZodError){let n=new Map(W.entries());i&&n.delete(i);let a=i?n:new Map,o=r.errors.reduce((r,n)=>{let a=n.path[0];return i?.length&&a!==i||r.get(a)||r.set(a,n.message),r},a);o&&Y(o)}}return!1},eb=async i=>{if(i.preventDefault(),en(!0),U(!0),em&&!F){ex(),Y(i=>{let r=new Map(i);return r.set("Recaptcha","Please complete the reCAPTCHA verification"),r}),en(!1);return}if(!ex()){setTimeout(()=>{let i=document.querySelector('[class*="_error-message"]');i?.scrollIntoView({behavior:"smooth"})},500),en(!1);return}try{if(!q?.current)return;let i=eh?.find(i=>"SubmitAction"===i.name)?.value.value||"",r=new FormData(q?.current),n=await fetch(`${i}?site=${H}&itemPath=${G}`,{method:"POST",body:r}),a=await n.json();a.response.success?$.replace(a.response.redirectUrl):(eo(a.response.messages),a.response?.messages?.find(i=>"Recaptcha"===i.key)&&(D.current?.reset(),N(""),z(W.get("Recaptcha")||"reCAPTCHA validation failed"),U(!0),Y(i=>{let r=new Map(i);return r.set("Recaptcha",W.get("Recaptcha")||"Please complete the reCAPTCHA verification"),en(!1),r}))),en(!1)}catch(i){en(!1)}},ew=i=>ep.find(r=>r.name===i);if(et){let i=new URLSearchParams(eu.toString());return i.delete("slotId"),(0,r.jsx)(M.default,{fullHeight:!1,title:(0,r.jsx)(s.default,{variation:"display-3",tag:"h2",children:et||"Something went wrong"}),error:(0,r.jsx)(s.default,{children:"Please return to the calendar page and select the appointment time again"}),cta:(0,r.jsx)(d.default,{size:"large",variation:"full",children:(0,r.jsxs)(o.default,{href:`/booking/slot?${i}`,children:[(0,r.jsx)(h.default,{iconName:"iconArrowSmallLeft"}),(0,r.jsx)("span",{children:"Return to Calendar"})]})})})}return(0,r.jsx)(l.default,{theme:"A-HCA-White",children:(0,r.jsx)("form",{noValidate:!0,ref:q,method:"GET",onBlur:i=>{i.preventDefault();let r=i.target;r?.name&&!["radio","checkbox"].includes(r.type)&&ex(r?.name)},onChange:i=>{let r=i.target;["radio","checkbox"].includes(r.type)&&ex(r?.name)},onSubmit:eb,children:(0,r.jsxs)(u.default,{heading:(0,r.jsx)(s.default,{variation:"display-4",tag:"h1",children:ed.children.results.find(i=>"SectionTitle"===i.template.name)?.title.value}),copy:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.default,{variation:"body-extra-large",tag:"span",children:(0,r.jsx)(w.default,{children:(0,r.jsx)(b.RichText,{field:ed.children.results.find(i=>"Text"===i.template.name).text})})}),J||et||!es?void 0:(0,r.jsx)(C.default,{isMobile:!0,title:"Appointment summary",locationTitle:"Location",location:es.location,scanTitle:"Scan",scan:`${es.scanName} ${es.extras.length?"("+es.extras.join(", ")+")":""}
1`,appointmentTitle:"Appointment",appointment:es.appointmentType,dateTitle:"Date & time",date:`${ec(es.slot)} (${es.duration})`,priceTitle:"Price to pay",price:es.price})]}),aside:(0,r.jsx)(A.default,{children:(0,r.jsxs)(r.Fragment,{children:[J&&(0,r.jsx)(k.default,{}),J||et||!es?void 0:(0,r.jsx)(C.default,{title:"Appointment summary",locationTitle:"Location",location:es.location,scanTitle:"Scan",scan:`${es.scanName} ${es.extras.length?"("+es.extras.join(", ")+")":""}`,appointmentTitle:"Appointment",appointment:es.appointmentType,dateTitle:"Date & time",date:`${ec(es.slot)} (${es.duration})`,priceTitle:"Price to pay",price:es.price}),i.rendering&&i.componentMap&&(0,r.jsx)(R.default,{children:(0,r.jsx)(x.AppPlaceholder,{name:V,rendering:i.rendering,page:i.page,componentMap:i.componentMap})})]})}),children:[J&&(0,r.jsx)(k.default,{}),!J&&!et&&es?.formVariant?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(s.default,{variation:"heading-1",children:ew("About the pregnancy").title.value}),(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"lastMenstrualPeriod",type:"date"}),es?.formVariant==="pregnancy"&&(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"estimatedDueDate",type:"date"}),(0,r.jsx)(S.default,{getField:ew,formErrors:W,name:"hadAnUltrasoundScan"}),es?.formVariant==="pregnancy"&&(0,r.jsx)(S.default,{getField:ew,formErrors:W,name:"hadAPositivePregnancyTest"}),(0,r.jsx)(I.default,{getField:ew,formErrors:W,name:"pregnancyComments"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(s.default,{variation:"heading-1",children:ew("Patient details").title.value}),(0,r.jsx)(S.default,{getField:ew,formErrors:W,name:"title"}),(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"firstName"}),(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"lastName"}),(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"dateOfBirth",type:"date"}),(0,r.jsx)(S.default,{getField:ew,formErrors:W,name:"ethnicity"}),(0,r.jsx)(S.default,{getField:ew,formErrors:W,name:"returningPatient"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(s.default,{variation:"body-bold-extra-large",children:ew("Contact details").title.value}),(0,r.jsx)(m.default,{label:ew("telephone").title.value,name:"telephone",error:W.get("telephone"),helpText:ew("telephone")?.helperText?.value}),(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"email",type:"email"}),(0,r.jsx)(S.default,{getField:ew,formErrors:W,name:"isUKResident",onChange:i=>Q("Yes"===i.text)}),(0,r.jsx)(c.default,{defaultStep:X?"automatic":"manual",findAddressEndpoint:eh?.find(i=>"FindAddressEndpoint"===i.name)?.value.value||"",splitAddressEndpoint:eh?.find(i=>"SplitAddressEndpoint"===i.name)?.value.value||"",error:W.get("addressLine1")||W.get("addressLine2")||W.get("city")||W.get("postcode"),render:i=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"addressLine1",defaultValue:i?.address1||""}),(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"addressLine2",defaultValue:i?.address2||""}),(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"city",defaultValue:i?.town||""}),(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"postcode",defaultValue:i?.postcode||""}),(0,r.jsx)(S.default,{getField:ew,formErrors:W,name:"country",optionMapper:i=>({text:i.value.value,value:i.key.value})})]})}),(0,r.jsx)(_.default,{label:ew("sameAsPatientDetail")?.title?.value,name:"sameAsPatientDetail",value:"true",id:"sameAsPatientDetail",checked:Z,onChange:i=>{K(i.target.checked)}}),Z||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.default,{getField:ew,formErrors:W,name:"billingTitle"}),(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"billingFirstName"}),(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"billingLastName"}),(0,r.jsx)(c.default,{findAddressEndpoint:eh?.find(i=>"FindAddressEndpoint"===i.name)?.value.value||"",splitAddressEndpoint:eh?.find(i=>"SplitAddressEndpoint"===i.name)?.value.value||"",error:W.get("billingAddressLine1")||W.get("billingAddressLine2")||W.get("billingCity")||W.get("billingPostcode")||W.get("billingCountry"),render:i=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"billingAddressLine1",defaultValue:i?.address1||""}),(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"billingAddressLine2",defaultValue:i?.address2||""}),(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"billingCity",defaultValue:i?.town||""}),(0,r.jsx)(T.default,{getField:ew,formErrors:W,name:"billingPostcode",defaultValue:i?.postcode||""}),(0,r.jsx)(S.default,{getField:ew,formErrors:W,name:"billingCountry",optionMapper:i=>({text:i.value.value,value:i.key.value})})]})})]})]}),(0,r.jsx)(v.default,{title:(0,r.jsx)(s.default,{variation:"body-bold-extra-large",children:ew("Communication preferences").title.value}),preferences:(0,r.jsx)(y.default,{children:[(0,r.jsx)(_.default,{label:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:ew("privacyPolicy").title.value}}),name:`${ew("privacyPolicy").name}`,value:ew("privacyPolicy").name,id:ew("privacyPolicy").name,required:!!ew("privacyPolicy").validators.targetItems.length,errorMessage:ew("privacyPolicy").validators.targetItems[0].message.value},ew("privacyPolicy").name),(0,r.jsx)(_.default,{label:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:ew("attendanceConfirmation").title.value}}),name:`${ew("attendanceConfirmation").name}`,value:ew("attendanceConfirmation").name,id:ew("attendanceConfirmation").name,required:!!ew("attendanceConfirmation").validators.targetItems.length,errorMessage:ew("attendanceConfirmation").validators.targetItems[0].message.value},ew("attendanceConfirmation").name)]})}),(0,r.jsx)("input",{type:"hidden",name:"slotId",value:es?.slotId||""}),(0,r.jsx)("input",{type:"hidden",name:"serviceVariantId",value:es?.serviceVariantId||""}),(0,r.jsx)("input",{type:"hidden",name:"extrasIds",value:es?.extrasIds||""}),em&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(P.default,{className:f.default.recaptcha,ref:D,sitekey:em||"",onChange:i=>{N(i||""),z(""),Y(i=>{let r=new Map(i);return r.delete("Recaptcha"),r})},onErrored:()=>{console.error("payment form reCAPTCHA onErrored"),z("Something went wrong with reCAPTCHA")},onExpired:()=>{N(""),z("reCAPTCHA expired — please verify again"),U(!0)}}),B&&(!F||W.get("Recaptcha")||j)&&(0,r.jsxs)(O.default,{isErrorMsg:!0,children:[(0,r.jsx)(h.default,{iconName:"iconWarning"}),(0,r.jsx)(s.default,{variation:"body-medium-medium",children:W.get("Recaptcha")||j||"Please complete the reCAPTCHA verification"})]}),(0,r.jsx)("input",{name:"Recaptcha",type:"hidden",value:F})]}),ea.length>0&&(0,r.jsx)("div",{children:ea.map((i,n)=>(0,r.jsx)(L.default,{errorMessage:i.value},n))}),(0,r.jsx)("div",{children:(0,r.jsx)(d.default,{size:"large",variation:"full",children:(0,r.jsx)("button",{type:"submit",disabled:er,children:er?(0,r.jsx)(k.default,{}):ed.children.results.find(i=>"pay"===i.name).title.value})})})]}):void 0]})})})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(D,{...i})})])},226107,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(898205),o=i.i(159273),s=i.i(314816),l=i.i(496777),u=i.i(123768),c=i.i(257818),d=i.i(443107),h=i.i(960895),f=i.i(93379),p=i.i(782021),m=i.i(811846),g=i.i(335820),_=i.i(780798),y=i.i(760227);let v=i=>i.page.mode.isEditing?(0,r.jsx)("div",{className:`component promo ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Tbc Booking Confirmation please click to select datasource"})})}):(0,r.jsx)(r.Fragment,{}),x=i=>{l.debug.common("TBCBookingConfirmation Default Component started");let n=(0,u.useSearchParams)(),x=n.get("error"),b=i.page.mode.isEditing,w=b&&i.transactionStatus?{...i.transactionStatus,status:"failed"!==n.get("status")?"Successful":"failed"}:i.transactionStatus,T={...i,...w};if(l.debug.common("TbcBookingConfirmation transactionStatus",w),!i.fields)return(0,r.jsx)(v,{...i});let E=function(i,r,n){try{if(!i||!i.amount||!i.serviceName||!i.location)return"";let a=i.amount.replace(/[^\d.]/g,""),o=parseFloat(a).toFixed(2),s=i.serviceName+(i.extras?`,${i.extras}`:""),l=i.location;return(r?["window.dataLayer = window.dataLayer || [];","window.dataLayer.push({ ecommerce: null });",`window.dataLayer.push(${JSON.stringify({event:"purchase",ecommerce:{transaction_id:r,value:o,currency:"GBP",items:[{item_name:s,item_brand:l,item_id:r,price:o,quantity:"1"}]}})});`]:["window.dataLayer = window.dataLayer || [];",`window.dataLayer.push(${JSON.stringify({event:"birthCompanyBooking",goalType:"appointmentBooking",scanType:s,apptWith:i.type,location:l,apptCost:o,bookingID:n})});`]).join("\n")}catch(i){return console.error("Failed to generate ecommerce data layer:",i),""}}(T,w?.paymentTransactionId||"",w?.orderId||"");if(w?.status!=="Successful"||x)return(0,r.jsx)(p.default,{fullHeight:!1,title:(0,r.jsx)(c.default,{variation:i.params?.HeadingSize||"display-3",tag:i.params?.HeadingTag||"h2",children:(0,r.jsx)(a.Text,{field:i.fields?.ErrorTitle})}),error:(0,r.jsx)(a.Text,{field:i.fields?.ErrorMessage}),description:(0,r.jsx)(m.default,{children:(0,r.jsx)(s.RichText,{field:i.fields?.ErrorText})}),cta:b?(0,r.jsx)(o.Link,{field:i.fields?.ErrorCTALink}):i.fields.ErrorCTALink?.value.href&&i.fields?.ErrorCTALink?(0,r.jsx)(d.default,{size:"large",variation:"full",children:(0,r.jsxs)(o.Link,{href:`${i.fields.ErrorCTALink?.value.href}${T.retryQuerystring||""}`,field:i.fields?.ErrorCTALink,children:[i?.fields?.ErrorCTAIcon&&(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i.fields?.ErrorCTAIcon?.fields?.SvgMarkup?.value||""}}),i?.fields?.ErrorCTALink?.value?.text&&(0,r.jsx)(s.RichText,{field:{value:i.fields?.ErrorCTALink?.value?.text}})]})}):(0,r.jsx)(r.Fragment,{})});let S=new Date(T.appointmentDateTime||""),[A,C]=new Intl.DateTimeFormat("en-GB",{day:"2-digit",month:"2-digit",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}).format(S).split(", "),I=[{title:i.fields?.ServiceNameLabel?.value||"Scan",text:T.serviceName||""},{title:i.fields?.DateLabel?.value||"Date",text:A},{title:i.fields?.TimeLabel?.value||"Time",text:C.toLowerCase().replace(/\s/g,"")},{title:i.fields?.DurationLabel?.value||"Duration",text:`${T.duration||""} minutes`},{title:i.fields?.TypeLabel?.value||"Type",text:T.type||""},{title:i.fields?.LocationLabel?.value||"Location",text:T.location||""}];return T.extras&&I.splice(1,0,{title:"Extras",text:T.extras}),T.amount&&I.push({title:i.fields?.AmountLabel?.value||"Price paid",text:T.amount}),(0,r.jsxs)(r.Fragment,{children:[E&&(0,r.jsx)(y.default,{id:"tbc-booking-confirmation-data-layer",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:E}}),(0,r.jsx)(g.default,{heading:(0,r.jsx)(r.Fragment,{}),copy:(0,r.jsx)(h.default,{isFlex:!0,heading:(0,r.jsx)(c.default,{variation:i.params?.HeadingSize||"display-4",tag:i.params?.HeadingTag||"h2",children:(0,r.jsx)(a.Text,{field:i.fields?.Title})}),bodyText:(0,r.jsx)(m.default,{children:(0,r.jsx)(s.RichText,{field:i.fields?.Text})}),summary:(0,r.jsx)(f.default,{title:(0,r.jsx)(a.Text,{field:i.fields?.SummaryTitle}),optionalItems:I,noSpacing:!0})}),aside:(0,r.jsx)(_.default,{children:i.asidePlaceholder}),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.default,{children:(0,r.jsx)(s.RichText,{field:i.fields?.Info})}),(0,r.jsx)(d.default,{variation:"full-dark",size:"large",children:(0,r.jsx)(o.Link,{field:i.fields.StartLink})})]})})]})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(x,{...i})})])},711906,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(953102),o=i.i(443107),s=i.i(249736),l=i.i(257818),u=i.i(811846),c=i.i(335820),d=i.i(314816),h=i.i(898205);function f(i,r){let n=new Date(i);return n.setDate(n.getDate()+r),n}function p(i){return i.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}let m=i=>i.page.mode.isEditing?(0,r.jsx)("div",{className:`component promo ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Pregnancy Calculator. Please click to select datasource"})})}):(0,r.jsx)(r.Fragment,{});i.s(["Default",0,i=>
1{let[g,_]=(0,n.useState)(""),y=i.page.mode.isEditing;if(!i.fields)return(0,r.jsx)(m,{...i});let v=null,x=null,b=null,w=null,T=null,E=null,S=null,A=null,C=null,I=null,k=null;if(g)if(v=new Date(g),(I=Math.floor((new Date().getTime()-v.getTime())/864e5))<0)k="Your LMP date is from the future. Please enter a date from the past (at least 35 days ago).";else if(I<35){let i=35-I;k=`It's too early to say you're pregnant. Please wait another ${i} day${1===i?"":"s"} for a reliable calculation.`}else I>301?k="The date entered is over 43 weeks ago, which is beyond the normal pregnancy duration. Please check the date and try again.":(x=f(v,280),b=f(v,14),w=f(v,35),T=f(v,49),E=f(v,126),S=f(v,84),A=f(v,189),C=Math.floor(I/7));return(0,r.jsx)(s.default,{theme:"A-HCA-White",children:(0,r.jsx)("form",{onSubmit:i=>i.preventDefault(),children:(0,r.jsxs)(c.default,{heading:(0,r.jsxs)(r.Fragment,{children:[i.fields?.data?.item?.heading?.jsonValue&&(0,r.jsx)(l.default,{tag:"p",variation:"subheading-2",children:(0,r.jsx)(h.Text,{field:i.fields?.data?.item?.heading?.jsonValue})}),i.fields?.data?.item?.title?.jsonValue&&(0,r.jsx)(l.default,{tag:"h1",variation:"display-1",children:(0,r.jsx)(h.Text,{field:i.fields?.data?.item?.title?.jsonValue})})]}),copy:(0,r.jsx)(r.Fragment,{children:i?.fields?.data?.item?.text?.jsonValue&&(0,r.jsx)(u.default,{children:(0,r.jsx)(d.RichText,{tag:"span",field:i.fields.data.item.text.jsonValue})})}),children:[(0,r.jsx)(a.default,{id:"lmp",label:i?.fields?.data?.item?.lastMenstrualPeriodFieldLabel?.jsonValue?.value||"When did your last menstrual period start?",name:"lmp",type:"date",required:!0,errorMessage:"Please provide your LMP date."}),(0,r.jsx)(o.default,{variation:"full-dark",size:"large",children:(0,r.jsx)("button",{onClick:()=>{_(document.getElementById("lmp").value)},children:y||i.fields.data?.item?.cTAText?.jsonValue?.value?(0,r.jsx)(h.Text,{field:i.fields.data?.item?.cTAText?.jsonValue}):"Calculate"})}),g&&k&&(0,r.jsx)(l.default,{tag:"p",variation:"body-large",children:k}),g&&v&&!k&&(0,r.jsxs)("div",{children:[(0,r.jsxs)(l.default,{tag:"p",variation:"body-large",children:["Your last menstrual period started on"," ",(0,r.jsx)("strong",{children:p(v)})]}),(0,r.jsxs)(l.default,{tag:"p",variation:"body-large",children:["Congratulations! Your baby is estimated to arrive on"," ",(0,r.jsx)("strong",{children:x&&p(x)})]}),(0,r.jsxs)(l.default,{tag:"p",variation:"body-large",children:["Conception occurred around"," ",(0,r.jsx)("strong",{children:b&&p(b)})," ","and a reliable positive pregnancy test can be done around"," ",(0,r.jsx)("strong",{children:w&&p(w)})]}),(0,r.jsx)("br",{}),(0,r.jsx)(l.default,{tag:"p",variation:"body-large",children:"Useful information based on your LMP"}),(0,r.jsxs)(l.default,{tag:"p",variation:"body-large",children:["Based on your LMP, today you are"," ",(0,r.jsxs)("strong",{children:[C," weeks pregnant!"]})]}),(0,r.jsxs)(l.default,{tag:"p",variation:"body-large",children:["Your baby's heart will start beating"," ",(0,r.jsx)("strong",{children:T&&p(T)})]}),(0,r.jsxs)(l.default,{tag:"p",variation:"body-large",children:["Your baby's first move can be felt around"," ",(0,r.jsx)("strong",{children:E&&p(E)})]}),(0,r.jsxs)(l.default,{tag:"p",variation:"body-large",children:["End of first trimester is around"," ",(0,r.jsx)("strong",{children:S&&p(S)})]}),(0,r.jsxs)(l.default,{tag:"p",variation:"body-large",children:["End of second trimester is around"," ",(0,r.jsx)("strong",{children:A&&p(A)})]})]})]})})})}])},469554,i=>{i.v({hide:"VideoPlayer-module-scss-module__PN7Lbq__hide",highlight:"VideoPlayer-module-scss-module__PN7Lbq__highlight",overlay:"VideoPlayer-module-scss-module__PN7Lbq__overlay",play:"VideoPlayer-module-scss-module__PN7Lbq__play",player:"VideoPlayer-module-scss-module__PN7Lbq__player","sr-only":"VideoPlayer-module-scss-module__PN7Lbq__sr-only"})},962336,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(469554),o=i.i(630077),s=i.i(443107);i.s(["default",0,i=>{let{videoUrl:l,overlayImage:u}=i,c=(0,n.useRef)(null),[d,h]=(0,n.useState)(!1),[f,p]=(0,n.useState)(""),[m,g]=(0,n.use
1State)(""),_=!!l&&(l.includes("youtube.com")||l.includes("youtu.be")),y=l.match(/(?:youtube\.com\/watch\?v=|youtube\.com\/embed\/|youtu\.be\/)([^&?/]+)/)?.[1]||"",v=(0,n.useMemo)(()=>{if(!l||!_||!y)return"";let i=new URL(`https://www.youtube.com/embed/${y}`);return i.searchParams.set("autoplay","1"),i.searchParams.set("mute","0"),i.searchParams.set("playsinline","1"),i.searchParams.set("enablejsapi","1"),i.searchParams.set("rel","0"),i.toString()},[_,l]),x=async()=>{let i=c.current;if(_){p(v),h(!0),g("playing");return}if(i)try{await i.play(),i.muted=!1,h(!0),g("playing")}catch(i){console.error("Unable to play video:",i),h(!1),g("paused")}};return(0,r.jsxs)("div",{className:a.default.player,children:[(0,r.jsxs)("div",{className:[a.default.overlay,d?a.default.hide:""].join(" "),children:[u??(_&&y?(0,r.jsx)("img",{src:`https://img.youtube.com/vi/${y}/maxresdefault.jpg`,alt:"",className:a.default["overlay-image"]}):null),(0,r.jsx)("div",{className:a.default.play,children:(0,r.jsx)(s.default,{variation:"play",size:"small",children:(0,r.jsxs)("button",{type:"button",onClick:x,className:a.default["overlay-button"],children:[(0,r.jsx)(o.default,{iconName:"iconPlay"}),(0,r.jsx)("span",{className:"sr-only",children:"playing"===m?"Pause video":"Play video"})]})})})]}),_?f&&(0,r.jsx)("iframe",{src:f,title:"Video player",allow:"autoplay; fullscreen",allowFullScreen:!0,"aria-hidden":"true"}):(0,r.jsx)("video",{ref:c,muted:!0,loop:!0,playsInline:!0,controls:!0,preload:"metadata",onPlay:()=>g("playing"),onPause:()=>g("paused"),children:(0,r.jsx)("source",{src:l,type:"video/mp4"})})]})}])},509043,i=>{i.v({arrows:"TabsBlock-module-scss-module__Ht6xbG__arrows",col:"TabsBlock-module-scss-module__Ht6xbG__col","col-2":"TabsBlock-module-scss-module__Ht6xbG__col-2",container:"TabsBlock-module-scss-module__Ht6xbG__container",heading:"TabsBlock-module-scss-module__Ht6xbG__heading",highlight:"TabsBlock-module-scss-module__Ht6xbG__highlight",navigation:"TabsBlock-module-scss-module__Ht6xbG__navigation","slick-wrapper":"TabsBlock-module-scss-module__Ht6xbG__slick-wrapper","sr-only":"TabsBlock-module-scss-module__Ht6xbG__sr-only","tab-content":"TabsBlock-module-scss-module__Ht6xbG__tab-content",title:"TabsBlock-module-scss-module__Ht6xbG__title",wrapper:"TabsBlock-module-scss-module__Ht6xbG__wrapper"})},492719,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(509043),o=i.i(249736),s=i.i(34639),l=i.i(257818),u=i.i(519064),c=i.i(714443);i.s(["default",0,i=>{let{theme:d="D-HCA-Teal",title:h,tabsContent:f=[],id:p,tableOfContentTitle:m}=i,g=(0,n.useRef)(null),[_,y]=(0,n.useState)(0),v=f.length,x={speed:800,slidesToShow:1,slidesToScroll:1,infinite:!1,swipe:!1,arrows:!1,waitForAnimate:!1,accessibility:!1,className:a.default["slick-wrapper"],afterChange:i=>{y(i)}},b=i=>{i<0||i>=v||(g.current?.slickGoTo(i),y(i))},w=[],T=f.map((i,n)=>(w.push(i.tab),(0,r.jsx)("div",{className:a.default["tab-wrapper"],children:(0,r.jsxs)("div",{className:a.default["tab-content"],children:[(0,r.jsx)("div",{className:a.default.col,children:i.image}),(0,r.jsxs)("div",{className:a.default["col-2"],children:[i.title,i.bodyCopy]})]})},n))),E=(0,r.jsx)(u.default,{...x,ref:g,children:T});return(0,r.jsx)(o.default,{theme:d,id:p,tableOfContentTitle:m,children:(0,r.jsxs)("div",{className:a.default.wrapper,"data-navigation-type":"inpageNavigationClick",children:[(0,r.jsxs)("div",{className:a.default.container,children:[(0,r.jsxs)("div",{className:a.default.heading,children:[h&&(0,r.jsx)("span",{className:a.default.title,children:h}),(0,r.jsx)(s.default,{tabs:w,callback:({label:i})=>{let r=f.findIndex(r=>r.tab.label===i);-1!==r&&b(r)},overrideTabIndex:_})]}),E]}),v>0&&(0,r.jsxs)("div",{className:a.default.navigation,children:[(0,r.jsxs)(l.default,{variation:"body-medium-extra-large",children:[_+1,"/",v]}),(0,r.jsxs)("div",{className:a.default.arrows,children:[(0,r.jsx)(c.PrevArrow,{onClick:()=>{b(_-1)},disabled:0===_}),(0,r.jsx)(c.NextArrow,{onClick:()=>{b(_+1)},disabled:_===v-1})]})]})]})})}])},97856,i=>{i.v({children:"HomepageIntroBlock-module-scss-module__7nU7Ra__children",copy:"HomepageIntroBlock-module-scss-module__7nU7Ra__copy",cqc:"HomepageIntroBlock-module-scss-module__7nU7Ra__cqc",grid:"HomepageIntroBlock-module-scss-module__7nU7Ra__grid",highlight:"HomepageIntroBlock-module-scss-module__7nU7Ra__highlight",hr:"HomepageIntroBlock-module-scss-module__7nU7Ra__hr",image:"HomepageIntroBlock-module-scss-module__7nU7Ra__image","image-left":"HomepageIntroBlock-module-scss-module__7nU7Ra__image-left","image-right":"HomepageIntroBlock-module-scss-module__7nU7Ra__image-right","image-wrapper":"HomepageIntroBlock-module-scss-module__7nU7Ra__image-wrapper","intro-block":"HomepageIntroBlock-module-scss-module__7nU7Ra__intro-block","keep-aspect-ratio":"HomepageIntroBlock-module-scss-module__7nU7Ra__keep-aspect-ratio",mobile:"HomepageIntroBlock-module-scss-module__7nU7Ra__mobile",play:"HomepageIntroBlock-module-scss-module__7nU7Ra__play",reviews:"HomepageIntroBlock-module-scss-module__7nU7Ra__reviews","sr-only":"HomepageIntroBlock-module-scss-module__7nU7Ra__sr-only",stat:"HomepageIntroBlock-module-scss-module__7nU7Ra__stat",stats:"HomepageIntroBlock-module-scss-module__7nU7Ra__stats",tablet:"HomepageIntroBlock-module-scss-module__7nU7Ra__tablet","text-wrapper":"HomepageIntroBlock-module-scss-module__7nU7Ra__text-wrapper",title:"HomepageIntroBlock-module-scss-module__7nU7Ra__title"})},961027,i=>{i.v({closeButton:"VideoOverlay-module-scss-module__FwF4hG__closeButton",highlight:"VideoOverlay-module-scss-module__FwF4hG__highlight",overlay:"VideoOverlay-module-scss-module__FwF4hG__overlay",overlayVisible:"VideoOverlay-module-scss-module__FwF4hG__overlayVisible","sr-only":"VideoOverlay-module-scss-module__FwF4hG__sr-only",video:"VideoOverlay-module-scss-module__FwF4hG__video",videoContainer:"VideoOverlay-module-scss-module__FwF4hG__videoContainer",videoVisible:"VideoOverlay-module-scss-module__FwF4hG__videoVisible"})},523382,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(97856),o=i.i(257818),s=i.i(443107),l=i.i(249736),u=i.i(630077),c=i.i(309859),d=i.i(961027);let h=i=>{let{videoSrc:a,isOpen:o,onClose:s}
1=i,[l,h]=(0,n.useState)(o?"entering":"closed"),[f,p]=(0,n.useState)(o),m=!!a&&(a.includes("youtube.com")||a.includes("youtu.be")),g=a.match(/(?:youtube\.com\/watch\?v=|youtube\.com\/embed\/|youtu\.be\/)([^&?/]+)/)?.[1]||"",_=(0,n.useMemo)(()=>{if(!a||!m||!g)return"";let i=new URL(`https://www.youtube.com/embed/${g}`);return i.searchParams.set("autoplay","1"),i.searchParams.set("mute","0"),i.searchParams.set("playsinline","1"),i.searchParams.set("enablejsapi","1"),i.searchParams.set("rel","0"),i.toString()},[m,g,a]);f!==o&&(p(o),h(o?"entering":"exiting")),(0,n.useEffect)(()=>{if("entering"!==l)return;let i=requestAnimationFrame(()=>h("open"));return()=>cancelAnimationFrame(i)},[l]),(0,n.useEffect)(()=>{if("exiting"!==l)return;let i=setTimeout(()=>h("closed"),300);return()=>clearTimeout(i)},[l]);let y="closed"!==l,v="open"===l;return((0,n.useEffect)(()=>{if(!y)return;let i=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=i}},[y]),(0,n.useEffect)(()=>{if(!y)return;let i=i=>{"Escape"===i.key&&s()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[y,s]),y)?(0,c.createPortal)((0,r.jsx)("div",{className:`${d.default.overlay} ${v?d.default.overlayVisible:""}`,onClick:s,children:(0,r.jsxs)("div",{className:`${d.default.videoContainer} ${v?d.default.videoVisible:""}`,onClick:i=>i.stopPropagation(),children:[(0,r.jsx)("button",{className:d.default.closeButton,onClick:s,"aria-label":"Close video",children:(0,r.jsx)(u.default,{iconName:"iconCross"})}),m?(0,r.jsx)("iframe",{src:_,title:"Video player",allow:"autoplay; fullscreen",allowFullScreen:!0,"aria-hidden":"true",className:d.default.video}):(0,r.jsx)("video",{src:a,controls:!0,autoPlay:!0,playsInline:!0,className:d.default.video})]})}),document.body):(0,r.jsx)(r.Fragment,{})};i.s(["default",0,i=>{let{imageAlignment:c="right",title:d,subtitle:f,copy:p,stats:m,cta:g,image:_,video:y,cqc:v,doctify:x,children:b,i
1d:w,tableOfContentTitle:T,imageKeepAspectRatio:E=!1,theme:S="A-HCA-White"}=i,[A,C]=(0,n.useState)(!1),I=_;if(y){let i=!!y&&(y.includes("youtube.com")||y.includes("youtu.be")),n=y.match(/(?:youtube\.com\/watch\?v=|youtube\.com\/embed\/|youtu\.be\/)([^&?/]+)/)?.[1]||"";i&&!_&&(I=(0,r.jsx)("img",{src:`https://img.youtube.com/vi/${n}/maxresdefault.jpg`,alt:"",className:a.default["overlay-image"]}))}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.default,{theme:S,id:w,tableOfContentTitle:T,children:(0,r.jsx)("div",{className:[a.default["intro-block"],a.default[`image-${c}`]].join(" "),children:(0,r.jsxs)("div",{className:a.default.grid,children:[(0,r.jsxs)("div",{className:a.default["text-wrapper"],"data-animate":"l",children:[f&&(0,r.jsx)("div",{className:a.default.subtitle,children:f}),(0,r.jsx)("div",{className:a.default.title,children:d}),(0,r.jsx)("div",{className:a.default.copy,children:p}),m&&m.length>0&&(0,r.jsx)("ul",{className:a.default.stats,children:m.map((i,s)=>(0,r.jsxs)(n.default.Fragment,{children:[(0,r.jsx)("li",{children:(0,r.jsxs)("p",{className:a.default.stat,children:[(0,r.jsx)(o.default,{variation:"display-2",tag:"span",children:i.value}),(0,r.jsx)(o.default,{variation:"body-medium-large",tag:"span",children:i.label})]})}),(0,r.jsx)("li",{className:a.default.hr,"aria-hidden":"true",children:(0,r.jsx)("hr",{})})]},s))}),b&&(0,r.jsx)("div",{className:a.default.children,children:(0,r.jsx)(l.default,{theme:S,children:b})}),g&&(0,r.jsx)("div",{className:a.default.cta,children:(0,r.jsx)(l.default,{theme:S,children:(0,r.jsx)(s.default,{size:"large",variation:"full",children:g})})})]}),(0,r.jsxs)("div",{className:[a.default["image-wrapper"],E?a.default["keep-aspect-ratio"]:""].join(" "),"data-animate":"s",children:[I&&(0,r.jsx)("div",{className:a.default.image,children:I}),y&&(0,r.jsx)("div",{className:a.default.play,children:(0,r.jsx)(s.default,{variation:"play",size:"small",children:(0,r.jsxs)("button",{type:"button",onClick:()=>C(!0),className:a.default["overlay-button"],children:[(0,r.jsx)(u.default,{iconName:"iconPlay"}),(0,r.jsx)("span",{className:"sr-only",children:"Open video"})]})})}),(0,r.jsxs)("div",{className:a.default.reviews,children:[v&&(0,r.jsx)("div",{className:a.default.cqc,children:v}),x&&(0,r.jsx)("div",{className:a.default.mobile,children:x}),(0,r.jsx)("div",{className:a.default.tablet,children:(0,r.jsx)(l.default,{theme:["Chelsea-Beige","Chelsea-Navy-Blue","Chelsea-White"].includes(S)?S:"B-HCA-Navy-Blue",children:x&&x})})]})]})]})})}),y&&(0,r.jsx)(h,{videoSrc:y,isOpen:A,onClose:()=>C(!1)})]})}],523382)},575712,i=>{"use strict";var r=i.i(589295),n=i.i(677076),a=i.i(2317),o=i.i(898205),s=i.i(314816),l=i.i(273723),u=i.i(257818),c=i.i(208024),d=i.i(623420),h=i.i(922861),f=i.i(86164),p=i.i(215904),m=i.i(855963),g=i.i(924274),_=i.i(321767),y=i.i(580707),v=i.i(594967),x=i.i(385013),b=i.i(249736),w=i.i(267770),T=i.i(955679),E=i.i(82037
15),S=i.i(773293),A=i.i(752071),C=i.i(825477),I=i.i(398762);let k=`${r.default.env.INTEGRATION_LAYER_URL}/treatments`,R="/search",M=i=>(0,n.jsx)("div",{className:`component ${i.params?.styles}`,children:(0,n.jsx)("div",{className:"component-content",children:(0,n.jsx)("span",{className:"is-empty-hint",children:"TreatmentsSearch no datasource"})})}),L=i=>{let{fallbackData:r,fields:k,params:L}=i,P=(0,A.useTranslations)(i?.page?.siteName),{defaultLimit:O,defaultOffset:D,baselineParams:F,baselineAutocompleteParams:N}=(0,v.default)(i),j=(0,a.useRef)(null),{data:z,error:B,formHandlers:U,searchParams:V,autocompleteData:H,autocompleteError:G}=(0,_.default)({baseUrl:"/api/api-layer/treatments",searchPath:R,baselineParams:F,fallbackData:r,baselineAutocompleteParams:N});if(!k)return(0,n.jsx)(M,{...i});let q=Number(V.get("limit"))||O,$=Number(V.get("offset"))||D,W=z?.response.resultsCount||0,Y=Math.min($+q,W),Z=`${$+1}-${Y}`,K=i.fields?.FilterOptions?.map(i=>({title:i?.fields.Header?.value||i?.displayName||"",fields:i.fields?.Filters?.map(i=>{let{id:r,key:n,value:a,displayName:o}=(0,S.default)(i);return{id:r,value:a,name:n,label:o,defaultChecked:V.getAll(n).includes(a)}})})),X=K?.reduce((i,{fields:r})=>[...i,...r.filter(({defaultChecked:i})=>i)],[]);return(0,n.jsx)(b.default,{theme:L?.Theme||"J-HCA-Tangerine-20",children:(0,n.jsx)("form",{...U,children:(0,n.jsxs)(x.default,{ref:j,children:[k?.Heading?.value&&(0,n.jsx)(u.default,{variation:"subheading-1",children:(0,n.jsx)(o.Text,{field:k?.Heading})}),k?.Title?.value&&(0,n.jsx)(u.default,{variation:L?.HeadingSize||"display-3",tag:L?.HeadingTag||"h2",children:(0,n.jsx)(o.Text,{field:k?.Title})}),k?.Text?.value&&(0,n.jsx)(u.default,{variation:"body-large",tag:"div",children:(0,n.jsx)(s.RichText,{tag:"div",field:k?.Text})}),(0,n.jsxs)(l.default,{defaultValue:V.get("input")||void 0,name:"input",placeholder:k?.SearchPlaceholder?.value,suggestions:G?[]:H?.response.results?.map(i=>`${i.value}`),children:[(0,n.jsx)(h.default,{buttonText:(0,n.jsx)(o.Text,{field:k?.FilterOptionsText}),buttonIcon:(0,n.jsx)(w.default,{children:i?.fields?.FilterOptionsIcon?.fields?.SvgMarkup?.value}),resultsCount:W,filters:K?.map(i=>({title:i.title,contentVariation:"filters",children:(0,n.jsx)(c.default,{children:i.fields?.map(i=>(0,a.createElement)(d.default,{...i,key:i.id}))})}))}),(0,n.jsx)(T.default,{buttonText:(0,n.jsx)(o.Text,{field:k?.SortOptionsText}),buttonIcon:(0,n.jsx)(w.default,{children:i?.fields?.SortOptionsIcon?.fields?.SvgMarkup?.value}),options:i?.fields?.SortOptions?.map(i=>{let{key:r,value:n,displayName:a}=(0,S.default)(i);return{id:`${r}-${n}`,value:n,labelText:a,name:r,defaultChecked:V?.get(r)===n}})||[]})]}),(0,n.jsx)(E.default,{filters:X||[],clearFilters:()=>{X?.forEach(({id:i},r)=>{let n=document.getElementById(i);n&&(r===X.length-1?n.click():n.checked=!1)})}}),(0,n.jsx)(u.default,{tag:"h3",variation:"heading-1",children:(0,n.jsx)(C.default,{searchResultsTextWithInput:k?.SearchResultsTextWithInput?.value,searchResultsText:k?.SearchResultsText?.value,resultsCount:W,input:V.get("input")||V.get("autocomplete")||void 0})}),!!Y&&(0,n.jsx)(u.default,{variation:"body-medium",children:(0,n.jsxs)("span",{children:[P("showing")||"Showing"," ",Z]})}),B?(0,n.jsx)(g.default,{variant:"search-error",contentVariation:"no-container"}):W?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.default,{children:z?.response.results?.map((r,a)=>{let{data:o}=r,{abstractTitle:l,abstractText:c,abstractImageUrl:d,primaryImageUrl:h,title:m,description:g,imageUrl:_,url:y}=o,v=(0,I.default)(d,h,_);return(0,n.jsx)(f.default,{title:(0,n.jsx)(u.default,{variation:"heading-1",tag:"h4",children:l||m}),bodyCopy:(0,n.jsx)(u.default,{tag:"div",variation:"body-large",isHtml:!0,children:c||g}),image:void 0!==v?(0,n.jsx)(p.default,{src:v,alt:"",width:"363",height:"243"}):void 0,link:(0,n.jsx)("a",{href:y,children:(0,n.jsx)(s.RichText,{field:i.fields?.CTACardText})})},a)})}),(0,n.jsx)(y.default,{offset:$,limit:q,resultsCount:W,scrollToRef:j})]}):(0,n.jsx)(g.default,{contentVariation:"no-container"})]})})})},P=async i=>{let{baselineParams:r}=(0,v.default)(i),n=r.map(i=>`${i[0]}=${i[1]}`),a=new URL(`?${n.join("&")}`,`${k}${R}`);try{let r=await fetch(a.href);if(r.ok)return i.fallbackData=await r.json(),i;throw r.statusText}catch(i){return console.error({message:"TreatmentsSearch server-side data fetching error",error:i,requestUrl:a.href},i),{treatments:[]}}};i.s(["Default",0,i=>(0,n.jsx)(a.Suspense,{fallback:null,children:(0,n.jsx)(L,{...i})}),"getComponentServerProps",0,P])},692451,i=>{"use strict";var r=i.i(677076),n=i.i(237498),a=i.i(898205),o=i.i(314816);i.s(["default",0,i=>{let{field:s,isRichText:l}=i,{page:u}
1=(0,n.useSitecore)(),c=u.mode.isEditing,d=u.layout.sitecore.route,h=d?.fields?.EntityName?.value;return!c&&h&&s?(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s?.value?.replaceAll(/{{EntityName}}/gm,h)||""}}):l?(0,r.jsx)(o.RichText,{field:s}):(0,r.jsx)(a.Text,{field:s})}])},823642,i=>{i.v({carousel:"CarouselTestimonials-module-scss-module__W97z3q__carousel",container:"CarouselTestimonials-module-scss-module__W97z3q__container",controls:"CarouselTestimonials-module-scss-module__W97z3q__controls",highlight:"CarouselTestimonials-module-scss-module__W97z3q__highlight","slick-wrapper":"CarouselTestimonials-module-scss-module__W97z3q__slick-wrapper",slide:"CarouselTestimonials-module-scss-module__W97z3q__slide","slide-image":"CarouselTestimonials-module-scss-module__W97z3q__slide-image","slide-name":"CarouselTestimonials-module-scss-module__W97z3q__slide-name","slide-text":"CarouselTestimonials-module-scss-module__W97z3q__slide-text","sr-only":"CarouselTestimonials-module-scss-module__W97z3q__sr-only",thumbnail:"CarouselTestimonials-module-scss-module__W97z3q__thumbnail","thumbnail-image":"CarouselTestimonials-module-scss-module__W97z3q__thumbnail-image",title:"CarouselTestimonials-module-scss-module__W97z3q__title",wrapper:"CarouselTestimonials-module-scss-module__W97z3q__wrapper"})},264630,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(823642),o=i.i(249736),s=i.i(519064),l=i.i(630077);i.s(["default",0,i=>{let{id:u,theme:c,subtitle:d,title:h,slides:f,tableOfContentTitle:p}=i,[m,g]=(0,n.useState)(0),[_,y]=(0,n.useState)(0),[v,x]=(0,n.useState)(!1),b=(0,n.useRef)(null);(0,n.useEffect)(()=>{let i=setInterval(()=>{y(Math.floor(_+2.4))},100);return v&&clearInterval(i),_>360&&(clearInterval(i),b.current&&b.current.slickNext()),()=>clearInterval(i)},[_,v]);let w=()=>{x(!v)},T=f.map((i,o)=>(0,r.jsx)(n.default.Fragment,{children:(0,r.jsxs)("div",{className:a.default.slide,children:[(0,r.jsxs)("div",{className:a.default["slide-text"],children:[(0,r.jsx)(l.default,{iconName:"iconQuotes"}),i.body,(0,r.jsxs)("div",{className:a.default["slide-name"],children:[i.name,i.role]})]}),(0,r.jsx)("div",{className:a.default["slide-image"],children:i.image})]})},o)),E={speed:800,slidesToShow:1,slidesToScroll:1,arrows:!1,infinite:!0,waitForAnimate:!1,swipe:!1,className:a.default["slick-wrapper"],dots:!0,dotsClass:"slick-thumb",customPaging:i=>(0,r.jsxs)("button",{className:a.default.thumbnail,style:m===i?{"--carousel-degrees":`${_}deg`}:{},children:[(0,r.jsxs)("span",{className:"sr-only",children:["go to slide ",i+1]}),(0,r.jsxs)("div",{className:a.default["thumbnail-image"],children:[f[i].thumbnail,m===i&&(0,r.jsx)("button",{className:a.default.controls,onClick:w,children:v?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.default,{iconName:"iconPlay"}),(0,r.jsx)("span",{className:"sr-only",children:"Play carousel"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.default,{iconName:"iconPause"}),(0,r.jsx)("span",{className:"sr-only",children:"Pause carousel"})]})})]})]}),beforeChange:(i,r)=>{g(r),y(0)}},S=(0,r.jsx)(s.default,{...E,ref:b,children:T});return(0,r.jsx)(o.default,{theme:c||"B-HCA-Navy-Blue",id:u,tableOfContentTitle:p,children:(0,r.jsx)("div",{className:a.default.wrapper,children:(0,r.jsxs)("div",{className:a.default.container,children:[(0,r.jsxs)("div",{className:a.default.title,"data-animate":"xs",children:[d&&d,h&&h]}),(0,r.jsx)("div",{className:a.default.carousel,"data-animate":"s",children:S})]})})})}])},411663,i=>{"use strict";var r=i.i(589295),n=i.i(677076),a=i.i(2317),o=i.i(898205),s=i.i(314816),l=i.i(273723),u=i.i(257818),c=i.i(208024),d=i.i(623420),h=i.i(922861),f=i.i(86164),p=i.i(215904),m=i.i(855963),g=i.i(321767),_=i.i(580707),y=i.i(594967),v=i.i(385013),x=i.i(249736),b=i.i(267770),w=i.i(955679),T=i.i(820375),E=i.i(773293),S=i.i(924274),A=i.i(752071),C=i.i(825477),I=i.i(398762);let k=`${r.default.env.INTEGRATION_LAYER_URL}/scans`,R="/search",M=i=>(0,n.jsx)("div",{className:`component ${i.params?.styles}`,children:(0,n.jsx)("div",{className:"component-content",children:(0,n.jsx)("span",{className:"is-empty-hint",children:"TestAndScansSearch no datasource"})})}),L=i=>{let{fallbackData:r,fields:k,params:L}=i,P=(0,A.useTranslations)(),{defaultLimit:O,defaultOffset:D,baselineParams:F,baselineAutocompleteParams:N}=(0,y.default)(i),j=(0,a.useRef)(null),{data:z,error:B,formHandlers:U,searchParams:V,autocompleteData:H,autocompleteError:G}=(0,g.default)({baseUrl:"/api/api-layer/scans",searchPath:R,baselineParams:F,fallbackData:r,baselineAutocompleteParams:N});if(!k)return(0,n.jsx)(M,{...i});let q=Number(V.get("limit"))||O,$=Number(V.get("offset"))||D,W=z?.response.resultsCount||0,Y=Math.min($+q,W),Z=`${$+1}-${Y}`,K=i.fields?.FilterOptions?.map(i=>({title:i?.fields.Header?.value||i?.displayName||"",fields:i.fields?.Filters?.map(i=>{let{id:r,key:n,value:a,displayName:o}=(0,E.default)(i);return{id:r,value:a,name:n,label:o,defaultChecked:V.getAll(n).includes(a)}})})),X=K?.reduce((i,{fields:r})=>[...i,...r.filter(({defaultChecked:i})=>i)],[]);return(0,n.jsx)(x.default,{theme:L?.Theme||"J-HCA-Tangerine-20",children:(0,n.jsx)("form",{...U,children:(0,n.jsxs)(v.default,{ref:j,children:[k?.Heading?.value&&(0,n.jsx)(u.default,{variation:"subheading-1",children:(0,n.jsx)(o.Text,{field:k?.Heading})}),k?.Title?.value&&(0,n.jsx)(u.default,{variation:L?.HeadingSize||"display-3",tag:L?.HeadingTag||"h2",children:(0,n.jsx)(o.Text,{field:k?.Title})}),k?.Text?.value&&(0,n.jsx)(u.default,{variation:"body-large",tag:"div",children:(0,n.jsx)(s.RichText,{tag:"div",field:k?.Text})}),(0,n.jsxs)(l.default,{defaultValue:V.get("input")||void 0,name:"input",placeholder:k?.SearchPlaceholder?.value,suggestions:G?[]:H?.response.results?.map(i=>`${i.value}`),children:[(0,n.jsx)(h.default,{buttonText:(0,n.jsx)(o.Text,{field:k?.FilterOptionsText}),buttonIcon:(0,n.jsx)(b.default,{children:i?.fields?.FilterOptionsIcon?.fields?.SvgMarkup?.value}),resultsCount:W,filters:K?.map(i=>({title:i.title,contentVariation:"filters",children:(0,n.jsx)(c.default,{children:i.fields?.map(i=>(0,a.createElement)(d.default,{...i,key:i.id}))})}))}),(0,n.jsx)(w.default,{buttonText:(0,n.jsx)(o.Text,{field:k?.SortOptionsText}),buttonIcon:(0,n.jsx)(b.default,{children:i?.fields?.SortOptionsIcon?.fields?.SvgMarkup?.value}),options:i?.fields?.SortOptions?.map(i=>{let{id:r,key:n,value:a,displayName:o}=(0,E.default)(i);return{id:r,value:a,labelText:o,name:n,defaultChecked:V?.get(n)===a}})||[]})]}),(0,n.jsx)(T.default,{filters:X||[],clearFilters:()=>{X?.forEach(({id:i},r)=>{let n=document.getElementById(i);n&&(r===X.length-1?n.click():n.checked=!1)})}}),(0,n.jsx)(u.default,{tag:"h3",variation:"heading-1",children:(0,n.jsx)(C.default,{searchResultsTextWithInput:k?.SearchResultsTextWithInput?.value,searchResultsText:k?.SearchResultsText?.value,resultsCount:W,input:V.get("input")||V.get("autocomplete")||void 0})}),!!Y&&(0,n.jsx)(u.default,{variation:"body-medium",children:(0,n.jsxs)("span",{children:[P("showing")||"Showing"," ",Z]})}),B?(0,n.jsx)(S.default,{variant:"search-error",contentVariation:"no-container"}):W?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.default,{children:z?.response.results?.map((r,a)=>{let{data:o}=r,{abstractTitle:l,abstractText:c,abstractImageUrl:d,primaryImageUrl:h,title:m,description:g,imageUrl:_,url:y}=o,v=(0,I.default)(d,h,_);return(0,n.jsx)(f.default,{title:(0,n.jsx)(u.default,{variation:"heading-1",tag:"h4",children:l||m}),bodyCopy:(0,n.jsx)(u.default,{tag:"div",variation:"body-large",isHtml:!0,children:c||g}),image:void 0!==v?(0,n.jsx)(p.default,{src:v,alt:"",width:"363",height:"243"}):void 0,link:(0,n.jsx)("a",{href:y,children:(0,n.jsx)(s.RichText,{field:i.fields?.CTACardText})})},a)})}),(0,n.jsx)(_.default,{offset:$,limit:q,resultsCount:W,scrollToRef:j})]}):(0,n.jsx)(S.default,{contentVariation:"no-container"})]})})})},P=async i=>{let{baselineParams:r}=(0,y.default)({fields:i.fields}),n=r.map(i=>`${i[0]}=${i[1]}`),a=new URL(`?${n.join("&")}`,`${k}${R}`);try{let i=await fetch(a.href);if(i.ok)return{fallbackData:await i.json()};throw i.statusText}catch(i){return console.error({message:"TestAndScansSearch server-side data fetching error",error:i,requestUrl:a.href},i),{testandscans:[]}}};i.s(["Default",0,i=>(0,n.jsx)(a.Suspense,{fallback:null,children:(0,n.jsx)(L,{...i})}),"getComponentServerProps",0,P])},276077,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(898205),o=i.i(314816),s=i.i(443107),l=i.i(370777),u=i.i(257818),c=i.i(710171),d=i.i(405133),h=i.i(210822),f=i.i(829057),p=i.i(79022),m=i.i(595
1504),g=i.i(290089);let _=i=>{let{page:n}=i;return n.mode.isEditing?(0,r.jsx)("div",{className:`component promo ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Sticky CTA. Please click to select datasource."})})}):(0,r.jsx)(r.Fragment,{})};i.s(["Default",0,i=>{let y,v=(0,n.useRef)(null),x=(0,m.firstSelfOrAncestorByTemplate)(f.SITECORE_TEMPLATE_IDS.LocationPage,i?.fields?.data?.contextItem);if(x)y=x.doctifyPractice?.value;else{let r=(0,p.firstDoctifyMappedSelfOrAncestor)(i?.fields?.data?.contextItem);r?.type=="doctifyKeywordId"&&(y=r.value)}let b=(i,r,n)=>{"_blank"===n||r.includes("tel:")||r.includes("mailto:")||(i.preventDefault(),v.current?.close(),window.location.assign(r))};if(!i.fields)return(0,r.jsx)(_,{...i});if(!i.fields?.data?.item?.modalContent?.targetItems)return(0,r.jsx)(r.Fragment,{});let w=i.fields?.data?.item?.modalContent?.targetItems[0],T=i.fields?.data?.item?.modalContent?.targetItems[1],E=[{link:w?.primaryCTA,icon:w?.primaryCTAIcon,buttonVariation:w?.primaryCTAVariant?.targetItem?.name??"full"},{link:w?.secondaryCTA,icon:w?.secondaryCTAIcon,buttonVariation:w?.secondaryCTAVariant?.targetItem?.name??"outline"},{link:w?.tertiaryCTA,icon:w?.tertiaryCTAIcon,buttonVariation:w?.tertiaryCTAVariant?.targetItem?.name??"outline"},{link:w?.quaternaryCTA,icon:w?.quaternaryCTAIcon,buttonVariation:w?.quaternaryCTAVariant?.targetItem?.name??"outline"}],S=[{link:T?.primaryCTA,icon:T?.primaryCTAIcon,buttonVariation:T?.primaryCTAVariant?.targetItem?.name??"full"},{link:T?.secondaryCTA,icon:T?.secondaryCTAIcon,buttonVariation:T?.secondaryCTAVariant?.targetItem?.name??"outline"},{link:T?.tertiaryCTA,icon:T?.tertiaryCTAIcon,buttonVariation:T?.tertiaryCTAVariant?.targetItem?.name??"outline"},{link:T?.quaternaryCTA,icon:T?.quaternaryCTAIcon,buttonVariation:T?.quaternaryCTAVariant?.targetItem?.name??"outline"}];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.default,{theme:i.params?.Theme||"B-HCA-Navy-Blue",cta:i?.fields?.data?.item?.cTAText?.jsonValue&&(0,r.jsx)(s.default,{size:"large",variation:"full",children:(0,r.jsx)("button",{onClick:()=>{v?.current?.showModal()},children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i?.fields?.data?.item?.cTAIcon?.targetItem?.svgMarkup?.value||""}}),(0,r.jsx)(o.RichText,{tag:"span",field:i?.fields?.data?.item?.cTAText?.jsonValue})]})})}),children:i.fields.data?.item?.desktopCaption?.jsonValue&&(0,r.jsx)(u.default,{variation:"heading-1",children:(0,r.jsx)(a.Text,{field:i.fields.data?.item?.desktopCaption?.jsonValue})})}),(0,r.jsx)(l.default,{ref:v,title1:w&&(0,r.jsx)(u.default,{variation:"display-4",tag:"h2",children:(0,r.jsx)(a.Text,{field:w.title})}),copy1:w&&(0,r.jsx)(u.default,{variation:"body-large",tag:"div",children:(0,r.jsx)(o.RichText,{field:w?.text})}),cta1:w&&(0,r.jsx)(r.Fragment,{children:E.map(({link:i,icon:n,buttonVariation:a},l)=>{if(!i?.jsonValue.value.text)return null;if(-1!=(i?.jsonValue.value?.class||"").indexOf("optionalfinder")&&!y)return;let{href:u,text:c}=x?(0,h.withKeywordIdIfNeeded)(i.jsonValue,y,"practice"):(0,h.withKeywordIdIfNeeded)(i.jsonValue,y,"keywordId"),f=(0,g.normalizeHref)(u),p=(0,g.isValidNextLinkHref)(f),m=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:n?.targetItem?.svgMarkup?.value||""}}),(0,r.jsx)(o.RichText,{tag:"span",field:{value:c}})]});return(0,r.jsx)(s.default,{size:"large",contentVariation:"full-width",variation:a.toLowerCase(),children:p?(0,r.jsx)(d.default,{href:f,target:i?.jsonValue?.value?.target,onClick:r=>b(r,f,i?.jsonValue?.value?.target),children:m}):(0,r.jsx)("a",{href:f,target:i?.jsonValue?.value?.target,onClick:r=>b(r,f,i?.jsonValue?.value?.target),children:m})},l)})}),title2:T&&(0,r.jsx)(u.default,{variation:"display-4",tag:"h2",children:(0,r.jsx)(a.Text,{field:T?.title})}),copy2:T&&(0,r.jsx)(u.default,{variation:"body-large",tag:"div",children:(0,r.jsx)(a.Text,{field:T?.text})}),cta2:T&&(0,r.jsx)(r.Fragment,{children:S.map(({link:i,icon:n,buttonVariation:a},l)=>{if(!i?.jsonValue?.value?.text)return null;if(-1!=(i?.jsonValue?.value?.class||"").indexOf("optionalfinder")&&!y)return;let{href:u,text:c}=x?(0,h.withKeywordIdIfNeeded)(i?.jsonValue,y,"practice"):(0,h.withKeywordIdIfNeeded)(i?.jsonValue,y,"keywordId"),f=(0,g.normalizeHref)(u),p=(0,g.isValidNextLinkHref)(f),m=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:n?.targetItem?.svgMarkup?.value||""}}),(0,r.jsx)(o.RichText,{tag:"span",field:{value:c}})]});return(0,r.jsx)(s.default,{size:"large",contentVariation:"full-width",variation:a.toLowerCase(),children:p?(0,r.jsx)(d.default,{href:f,target:i.jsonValue?.value?.target,onClick:r=>b(r,f,i?.jsonValue?.value?.target),children:m}):(0,r.jsx)("a",{href:f,target:i.jsonValue?.value?.target,onClick:r=>b(r,f,i?.jsonValue?.value?.target),children:m})},l)})})})]})}])},44938,i=>{i.v({"body-copy":"StatsCards-module-scss-module__V1oJAG__body-copy",container:"StatsCards-module-scss-module__V1oJAG__container",highlight:"StatsCards-module-scss-module__V1oJAG__highlight","sr-only":"StatsCards-module-scss-module__V1oJAG__sr-only",stat:"StatsCards-module-scss-module__V1oJAG__stat",stats:"StatsCards-module-scss-module__V1oJAG__stats",subheader:"StatsCards-module-scss-module__V1oJAG__subheader",text:"StatsCards-module-scss-module__V1oJAG__text",wrapper:"StatsCards-module-scss-module__V1oJAG__wrapper"})},87635,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(44938),o=i.i(249736),s=i.i(257818);i.s(["default",0,i=>{let{theme:l="A-HCA-White",id:u,header:c,subheader:d,bodyCopy:h,stats:f,tableOfContentTitle:p}
1=i,[m,g]=(0,n.useState)(!1),_=(0,n.useRef)(null),[y,v]=(0,n.useState)(!1),x=(0,n.useCallback)(i=>{if(!i.textContent||!i.dataset.counter)return;let r=parseInt(i.textContent,10),n=parseInt(i.dataset.counter,10);if(r===n)return;let a=n-r,o=Date.now(),s=()=>{let n=Date.now()-o;n>2e3&&(n=2e3),i.textContent=Math.trunc(r+n/2e3*a).toString(),n<2e3&&requestAnimationFrame(s)};requestAnimationFrame(s)},[]),b=(0,n.useCallback)(([i])=>{if(i.isIntersecting&&!1===m){g(!0);let i=_.current?.querySelectorAll("[data-counter]");i&&Array.from(i).forEach(x)}},[m,x]);return(0,n.useEffect)(()=>{if(v(window.matchMedia("(prefers-reduced-motion)").matches),y)return;let i=new IntersectionObserver(b,{threshold:0}),r=_.current;return r&&i.observe(r),()=>{r&&i.unobserve(r)}},[b,_,y]),(0,r.jsx)(o.default,{theme:l,id:u,tableOfContentTitle:p,children:(0,r.jsx)("div",{className:a.default.wrapper,children:(0,r.jsxs)("div",{className:a.default.container,children:[(0,r.jsxs)("div",{className:a.default.text,"data-animate":"xs",children:[(0,r.jsx)("div",{children:d}),(0,r.jsx)("div",{className:a.default.header,children:c}),(0,r.jsx)("div",{className:a.default["body-copy"],children:h})]}),(0,r.jsx)("div",{className:a.default.stats,ref:_,"data-animate":"m",children:f.map((i,n)=>{var o;let l={numbers:(o=i.stat).replace(/\D/g,""),letters:o.replace(/\d/g,"")};return(0,r.jsxs)("div",{className:a.default.stat,children:[(0,r.jsxs)(s.default,{tag:"p",variation:"display-1",children:[(0,r.jsx)("span",{"data-counter":l.numbers,children:y?l.numbers:0}),l.letters]}),(0,r.jsx)(s.default,{tag:"p",variation:"body-large",children:i.text})]},n)})})]})})})}])},461216,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(898205),o=i.i(314816),s=i.i(491474),l=i.i(443107),u=i.i(630077),c=i.i(257818),d=i.i(906396);let h=i=>(0,r.jsx)("div",{className:`component ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"ShareCTA no datasource"})})});i.s(["Default",0,i=>
1{let f,[p,m]=(0,n.useState)(!1);if(!i.fields)return(0,r.jsx)(h,{...i});let g=(f=i.fields?.data.item.sharePlatforms.sharePlatformsList,i=>f?.find(r=>r?.template?.name===i)?.cTAText?.jsonValue),_=i.fields?.data.contextItem?.text?.value?(0,d.removeTags)(i.fields?.data.contextItem?.text?.value):"",y={url:i.fields?.data.contextItem?.url?.url||"",title:i.fields?.data.contextItem?.title?.value||"",text:_};return(0,r.jsxs)(s.default,{shareCtaText:(0,r.jsx)(o.RichText,{field:{value:i.fields?.data.item.cTALink?.jsonValue.value.text}}),shareCtaIcon:i.fields?.data?.item?.cTAIcon?.Icon?.svgMarkup?.value&&(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i.fields?.data?.item?.cTAIcon?.Icon?.svgMarkup?.value||""}}),shareData:y,heading:(0,r.jsx)(c.default,{tag:"h2",variation:"display-2",children:(0,r.jsx)(a.Text,{field:i.fields?.data?.item?.title?.jsonValue})}),subheading:(0,r.jsx)(c.default,{tag:"p",variation:"subheading-1",children:(0,r.jsx)(a.Text,{field:i.fields?.data?.item?.text?.jsonValue})}),children:[g("CopyLinkShare")&&(0,r.jsx)(l.default,{size:"large",variation:"square-outline",children:(0,r.jsx)("button",{onClick:()=>{navigator?.clipboard?.writeText?.(y.url),m(!0)},children:p?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.default,{iconName:"iconCheck"}),(0,r.jsx)("span",{children:"Copied"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.default,{iconName:"iconCopy"}),(0,r.jsx)(a.Text,{tag:"span",field:g("CopyLinkShare")})]})})}),g("EmailShare")&&(0,r.jsx)(l.default,{size:"large",variation:"square-outline",children:(0,r.jsxs)("a",{href:`mailto:?subject=${encodeURI(y.title)}&body=${encodeURI(y.text)}`,children:[(0,r.jsx)(u.default,{iconName:"iconEmail"}),(0,r.jsx)(a.Text,{tag:"span",field:g("EmailShare")})]})}),g("WhatsAppShare")&&(0,r.jsx)(l.default,{size:"large",variation:"square-outline",children:(0,r.jsxs)("a",{href:`https://wa.me/send?text=${y.url}`,rel:"nofollow noopener",target:"_blank",children:[(0,r.jsx)(u.default,{iconName:"iconWhatsapp"}),(0,r.jsx)(a.Text,{tag:"span",field:g("WhatsAppShare")})]})}),g("FacebookShare")&&(0,r.jsx)(l.default,{size:"large",variation:"square-outline",children:(0,r.jsxs)("a",{href:`https://www.facebook.com/sharer/sharer.php?u=${y.url}`,rel:"nofollow noopener",target:"_blank",children:[(0,r.jsx)(u.default,{iconName:"iconFacebook"}),(0,r.jsx)(a.Text,{tag:"span",field:g("FacebookShare")})]})}),g("MessengerShare")&&(0,r.jsx)(l.default,{size:"large",variation:"square-outline",children:(0,r.jsxs)("a",{href:`http://www.facebook.com/dialog/send?app_id=2003187033308504&link=${y.url}&redirect_uri=${y.url}`,rel:"nofollow noopener",target:"_blank",children:[(0,r.jsx)(u.default,{iconName:"iconMessenger"}),(0,r.jsx)(a.Text,{tag:"span",field:g("MessengerShare")})]})}),g("TwitterXShare")&&(0,r.jsx)(l.default,{size:"large",variation:"square-outline",children:(0,r.jsxs)("a",{href:`https://twitter.com/intent/tweet?text=${encodeURI(y.title)}&url=${y.url}`,rel:"nofollow noopener",target:"_blank",children:[(0,r.jsx)(u.default,{iconName:"iconX"}),(0,r.jsx)(a.Text,{tag:"span",field:g("TwitterXShare")})]})})]})}])},594225,i=>{"use strict";var r=i.i(589295),n=i.i(677076),a=i.i(2317),o=i.i(898205),s=i.i(314816),l=i.i(273723),u=i.i(257818),c=i.i(208024),d=i.i(623420),h=i.i(922861),f=i.i(86164),p=i.i(215904),m=i.i(855963),g=i.i(321767),_=i.i(580707),y=i.i(594967),v=i.i(385013),x=i.i(249736),b=i.i(267770),w=i.i(955679),T=i.i(820375),E=i.i(773293),S=i.i(924274),A=i.i(752071),C=i.i(825477),I=i.i(398762);let k=`${r.default.env.INTEGRATION_LAYER_URL}/servicelines`,R="/search",M=i=>(0,n.jsx)("div",{className:`component ${i.params?.styles}`,children:(0,n.jsx)("div",{className:"component-content",children:(0,n.jsx)("span",{className:"is-empty-hint",children:"ServiceLinesSearch no datasource"})})}),L=i=>{let{fallbackData:r,fields:k,params:L}=i,P=(0,A.useTranslations)(i.page?.siteName),{defaultLimit:O,defaultOffset:D,baselineParams:F,baselineAutocompleteParams:N}=(0,y.default)(i),j=(0,a.useRef)(null),{data:z,error:B,formHandlers:U,searchParams:V,autocompleteData:H,autocompleteError:G}=(0,g.default)({baseUrl:"/api/api-layer/servicelines",searchPath:R,baselineParams:F,fallbackData:r,baselineAutocompleteParams:N});if(!k)return(0,n.jsx)(M,{...i});let q=Number(V.get("limit"))||O,$=Number(V.get("offset"))||D,W=z?.response.resultsCount||0,Y=Math.min($+q,W),Z=`${$+1}-${Y}`,K=i.fields?.FilterOptions?.map(i=>({title:i?.fields.Header?.value||i?.displayName||"",fields:i.fields?.Filters?.map(i=>{let{id:r,key:n,value:a,displayName:o}=(0,E.default)(i);return{id:r,value:a,name:n,label:o,defaultChecked:V.getAll(n).includes(a)}})})),X=K?.reduce((i,{fields:r})=>[...i,...r.filter(({defaultChecked:i})=>i)],[]);return(0,n.jsx)(x.default,{theme:L?.Theme||"J-HCA-Tangerine-20",children:(0,n.jsx)("form",{...U,children:(0,n.jsxs)(v.default,{ref:j,children:[k?.Heading?.value&&(0,n.jsx)(u.default,{variation:"subheading-1",children:(0,n.jsx)(o.Text,{field:k?.Heading})}),k?.Title?.value&&(0,n.jsx)(u.default,{variation:L?.HeadingSize||"display-3",tag:L?.HeadingTag||"h2",children:(0,n.jsx)(o.Text,{field:k?.Title})}),k?.Text?.value&&(0,n.jsx)(u.default,{variation:"body-large",tag:"div",children:(0,n.jsx)(s.RichText,{tag:"div",field:k?.Text})}),(0,n.jsxs)(l.default,{defaultValue:V.get("input")||void 0,name:"input",placeholder:k?.SearchPlaceholder?.value,suggestions:G?[]:H?.response.results?.map(i=>`${i.value}`),children:[(0,n.jsx)(h.default,{buttonText:(0,n.jsx)(o.Text,{field:k?.FilterOptionsText}),buttonIcon:(0,n.jsx)(b.default,{children:i?.fields?.FilterOptionsIcon?.fields?.SvgMarkup?.value}),resultsCount:W,filters:K?.map(i=>({title:i.title,contentVariation:"filters",children:(0,n.jsx)(c.default,{children:i.fields?.map(i=>(0,a.createElement)(d.default,{...i,key:i.id}))})}))}),(0,n.jsx)(w.default,{buttonText:(0,n.jsx)(o.Text,{field:k?.SortOptionsText}),buttonIcon:(0,n.jsx)(b.default,{children:i?.fields?.SortOptionsIcon?.fields?.SvgMarkup?.value}),options:i?.fields?.SortOptions?.map(i=>{let{id:r,key:n,value:a,displayName:o}=(0,E.default)(i);return{id:r,value:a,labelText:o,name:n,defaultChecked:V?.get(n)===a}})||[]})]}),(0,n.jsx)(T.default,{filters:X||[],clearFilters:()=>{X?.forEach(({id:i},r)=>{let n=document.getElementById(i);n&&(r===X.length-1?n.click():n.checked=!1)})}}),(0,n.jsx)(u.default,{tag:"h3",variation:"heading-1",children:(0,n.jsx)(C.default,{searchResultsTextWithInput:k?.SearchResultsTextWithInput?.value,searchResultsText:k?.SearchResultsText?.value,resultsCount:W,input:V.get("input")||V.get("autocomplete")||void 0})}),!!Y&&(0,n.jsx)(u.default,{variation:"body-medium",children:(0,n.jsxs)("span",{children:[P("showing")||"Showing"," ",Z]})}),B?(0,n.jsx)(S.default,{variant:"search-error",contentVariation:"no-container"}):W?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.default,{children:z?.response.results?.map((r,a)=>{let{data:o}=r,{abstractTitle:l,abstractText:c,abstractImageUrl:d,primaryImageUrl:h,title:m,description:g,imageUrl:_,url:y}=o,v=(0,I.default)(d,h,_);return(0,n.jsx)(f.default,{title:(0,n.jsx)(u.default,{variation:"heading-1",tag:"h4",children:l||m}),bodyCopy:(0,n.jsx)(u.default,{tag:"div",variation:"body-large",isHtml:!0,children:c||g}),image:void 0!==v?(0,n.jsx)(p.default,{src:v,alt:"",quality:90,width:"560",height:"420"}):void 0,link:(0,n.jsx)("a",{href:y,children:(0,n.jsx)(s.RichText,{field:i.fields?.CTACardText})})},a)})}),(0,n.jsx)(_.default,{offset:$,limit:q,resultsCount:W,scrollToRef:j})]}):(0,n.jsx)(S.default,{contentVariation:"no-container"})]})})})},P=async i=>{let{baselineParams:r}=(0,y.default)(i),n=r.map(i=>`${i[0]}=${i[1]}`),a=new URL(`?${n.join("&")}`,`${k}${R}`);try{let r=await fetch(a.href);if(r.ok)return i.fallbackData=await r.json(),i;throw r.statusText}catch(i){return console.error({message:"ServiceLinesSearch server-side data fetching error",error:i,requestUrl:a.href},i),{serviceLines:[]}}};i.s(["Default",0,i=>(0,n.jsx)(a.Suspense,{fallback:null,children:(0,n.jsx)(L,{...i})}),"getComponentServerProps",0,P])},550360,i=>{"use strict";var r=i.i(677076),n=i.i(443107),a=i.i(630077);i.s(["default",0,()=>(0,r.jsx)(n.default,{variation:"full-dark",size:"large",children:(0,r.jsxs)("button",{onClick:()=>{window.print()},children:[(0,r.jsx)(a.default,{iconName:"iconPrint"}),"Print confirmation"]})})])},310351,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(257818),o=i.i(249736),s=i.i(335820),l=i.i(954519),u=i.i(443107),c=i.i(649555),d=i.i(630077),h=i.i(571900),f=i.i(518179),p=i.i(661279),m=i.i(62557),g=i.i(138279),_=i.i(511730),y=i.i(208024),v=i.i(359262),x=i.i(314816),b=i.i(811846),w=i.i(785101),T=i.i(259752),E=i.i(123768),S=i.i(705825);i.s(["Default",0,i=>
1{let A=(0,n.useRef)(null),[C,I]=(0,n.useState)(""),[k,R]=(0,n.useState)(""),[M,L]=(0,n.useState)(!1),P=i.page.siteName,O=i.page.layout.sitecore.context.itemPath,D=(0,n.useRef)(null),F=(0,E.useRouter)(),[N,j]=(0,n.useState)(new Map),[z,B]=(0,n.useState)(!0),[U,V]=(0,n.useState)(!0),[H,G]=(0,n.useState)([]),q=i.fields.data.item.pages.results[0],$=i.fields.data.item.settings.results[0].children.results,W=q.children.results.filter(i=>["Section"].includes(i.template.name)),Y=[];W.forEach(i=>{i.children.results.forEach(i=>{Y.push(i)})});let Z=(0,g.default)(Y,!1),K=p.z.object(Z),X=(0,g.default)(Y,!0),Q="6LdGxCYjAAAAAMqSiKwfKfM36YnLDcvTt_lt37TX",J=p.z.object({...Z,...X,...{Recaptcha:p.z.string().min(1,"Please complete the reCAPTCHA verification")}}),ee=i=>{if(!D.current)return!1;let r=new FormData(D.current),n=Object.fromEntries(r);try{return"true"===r.get("sameAsPatientDetail")?K.parse(n):J.parse(n),j(new Map),!0}catch(r){if(r instanceof p.z.ZodError){let n=new Map(N.entries());i&&n.delete(i);let a=i?n:new Map,o=r.issues.reduce((r,n)=>{let a=n.path[0];return i?.length&&a!==i||r.get(a)||r.set(a,n.message),r},a);o&&j(o)}}return!1},et=async i=>{if(i.preventDefault(),L(!0),Q&&!C){ee(),j(i=>{let r=new Map(i);return r.set("Recaptcha","Please complete the reCAPTCHA verification"),r});return}if(!ee())return void setTimeout(()=>{let i=document.querySelector('[class*="_error-message"]');i?.scrollIntoView({behavior:"smooth"})},500);try{if(!D?.current)return;let i=$?.find(i=>"SubmitAction"===i.name)?.value.value||"",r=new FormData(D?.current),n=await fetch(`${i}?site=${P}&itemPath=${O}`,{method:"POST",body:r}),a=await n.json();if(a.response.success)F.replace(a.response.redirectUrl);else{let i=a.response.messages||[];G(i),a.response?.messages?.find(i=>"Recaptcha"===i.key)&&(A.current?.reset(),I(""),R(N.get("Recaptcha")||"reCAPTCHA validation failed"),L(!0),j(i=>{let r=new Map(i);return r.set("Recaptcha",N.get("Recaptcha")||"Please complete the reCAPTCHA verification"),r}))}}catch(i){}},ei=i=>Y.find(r=>r.name===i);return(0,r.jsxs)("div",{className:f.default.payment,children:[(0,r.jsx)(T.default,{}),(0,r.jsx)(o.default,{theme:"A-HCA-White",children:(0,r.jsx)("form",{noValidate:!0,ref:D,method:"GET",onBlur:i=>{i.preventDefault();let r=i.target;r?.name&&!["radio","checkbox"].includes(r.type)&&ee(r?.name)},onChange:i=>{let r=i.target;["radio","checkbox"].includes(r.type)&&ee(r?.name)},onSubmit:et,children:(0,r.jsxs)(s.default,{heading:(0,r.jsx)(a.default,{variation:"display-4",tag:"h1",children:q.children.results.find(i=>"SectionTitle"===i.template.name)?.title.value}),copy:(0,r.jsx)(a.default,{variation:"body-large",tag:"span",children:(0,r.jsx)(b.default,{children:(0,r.jsx)(x.RichText,{field:q.children.results.find(i=>"Text"===i.template.name).text})})}),children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(a.default,{variation:"heading-1",children:ei("Patient details").title.value}),(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"invoiceNumber"}),(0,r.jsx)(S.default,{getField:ei,formErrors:N,name:"title"}),(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"firstName"}),(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"lastName"}),(0,r.jsx)(S.default,{getField:ei,formErrors:N,name:"isUKResident",onChange:i=>V("Yes"===i.text)}),(0,r.jsx)(l.default,{defaultStep:U?"automatic":"manual",findAddressEndpoint:$?.find(i=>"FindAddressEndpoint"===i.name)?.value.value||"",splitAddressEndpoint:$?.find(i=>"SplitAddressEndpoint"===i.name)?.value.value||"",error:N.get("addressLine1")||N.get("addressLine2")||N.get("city")||N.get("postcode"),render:i=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"addressLine1",defaultValue:i?.address1||""}),(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"addressLine2",defaultValue:i?.address2||""}),(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"city",defaultValue:i?.town||""}),(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"postcode",defaultValue:i?.postcode||""}),(0,r.jsx)(S.default,{getField:ei,formErrors:N,name:"country",optionMapper:i=>({text:i.value.value,value:i.key.value})})]})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(a.default,{variation:"heading-1",children:ei("Contact details").title.value}),(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"email",type:"email"}),(0,r.jsx)(m.default,{label:ei("telephone").title.value,name:"telephone",error:N.get("telephone"),helpText:ei("telephone")?.helperText?.value})]}),(0,r.jsxs)("div",{children:[ei("Invoice amount").title.value&&(0,r.jsx)(a.default,{variation:"heading-1",children:ei("Invoice amount").title.value}),(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"totalInvoice"}),(0,r.jsx)(_.default,{label:ei("sameAsPatientDetail")?.title?.value,name:"sameAsPatientDetail",value:"true",id:"sameAsPatientDetail",checked:z,onChange:i=>{B(i.target.checked)}}),z||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.default,{getField:ei,formErrors:N,name:"billingTitle"}),(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"billingFirstName"}),(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"billingLastName"}),(0,r.jsx)(l.default,{findAddressEndpoint:$?.find(i=>"FindAddressEndpoint"===i.name)?.value.value||"",splitAddressEndpoint:$?.find(i=>"SplitAddressEndpoint"===i.name)?.value.value||"",error:N.get("billingAddressLine1")||N.get("billingAddressLine2")||N.get("billingCity")||N.get("billingPostcode")||N.get("billingCountry"),render:i=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"billingAddressLine1",defaultValue:i?.address1||""}),(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"billingAddressLine2",defaultValue:i?.address2||""}),(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"billingCity",defaultValue:i?.town||""}),(0,r.jsx)(w.default,{getField:ei,formErrors:N,name:"billingPostcode",defaultValue:i?.postcode||""}),(0,r.jsx)(S.default,{getField:ei,formErrors:N,name:"billingCountry",optionMapper:i=>({text:i.value.value,value:i.key.value})})]})})]})]}),(0,r.jsx)(v.default,{title:(0,r.jsx)(a.default,{variation:"body-bold-extra-large",children:ei("Communication preferences").title.value}),bodyCopy:(0,r.jsx)(b.default,{children:(0,r.jsx)(x.RichText,{field:ei("consent").text})}),preferences:(0,r.jsx)(y.default,{children:[ei("communicationMode").datasource.targetItem.children.results.map(i=>(0,r.jsx)(_.default,{label:i.displayName,name:`${ei("communicationMode").name}`,value:i.name,id:i.name,required:!1},i.name))]})}),Q&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.default,{className:f.default.recaptcha,ref:A,sitekey:Q||"",onChange:i=>{I(i||""),R(""),j(i=>{let r=new Map(i);return r.delete("Recaptcha"),r})},onErrored:()=>{console.error("payment form reCAPTCHA onErrored"),R("Something went wrong with reCAPTCHA")},onExpired:()=>{I(""),R("reCAPTCHA expired — please verify again"),L(!0)}}),M&&(!C||N.get("Recaptcha")||k)&&(0,r.jsxs)(h.default,{isErrorMsg:!0,children:[(0,r.jsx)(d.default,{iconName:"iconWarning"}),(0,r.jsx)(a.default,{variation:"body-medium-medium",children:N.get("Recaptcha")||k||"Please complete the reCAPTCHA verification"})]}),(0,r.jsx)("input",{name:"Recaptcha",type:"hidden",value:C})]}),H.filter(i=>i?.value?.trim()).map((i,n)=>(0,r.jsxs)(h.default,{isErrorMsg:!0,children:[(0,r.jsx)(d.default,{iconName:"iconWarning"}),(0,r.jsxs)(a.default,{variation:"body-medium-medium",children:[i?.key?.trim()?`${i.key}: `:"",i.value]})]},n)),(0,r.jsx)("div",{className:f.default.button,children:(0,r.jsx)(u.default,{size:"large",variation:"full",children:(0,r.jsx)("button",{type:"submit",children:q.children.results.find(i=>"pay"===i.name).title.value})})})]})})})]})}])},668726,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(898205),o=i.i(314816),s=i.i(273723),l=i.i(257818),u=i.i(208024),c=i.i(623420),d=i.i(922861),h=i.i(86164),f=i.i(215904),p=i.i(855963),m=i.i(321767),g=i.i(580707),_=i.i(594967),y=i.i(249736),v=i.i(267770),x=i.i(955679),b=i.i(82037
15),w=i.i(586936),T=i.i(999386),E=i.i(773293),S=i.i(924274),A=i.i(752071),C=i.i(825477),I=i.i(398762),k=i.i(777912),R=i.i(751344);let M=i=>(0,r.jsx)("div",{className:`component ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"PatientStoriesSearch no datasource"})})}),L=i=>{let{fallbackData:L,fields:P,params:O}=i,D=(0,A.useTranslations)(i?.page?.siteName),{defaultLimit:F,defaultOffset:N,baselineParams:j,baselineAutocompleteParams:z}=(0,_.default)(i),B=(0,n.useRef)(null),{data:U,error:V,formHandlers:H,searchParams:G,isResultsLoading:q,autocompleteData:$,autocompleteError:W}=(0,m.default)({baseUrl:"/api/api-layer/patientstories",searchPath:"/search",baselineParams:j,fallbackData:L,baselineAutocompleteParams:z});if(!P)return(0,r.jsx)(M,{...i});let Y=Number(G.get("limit"))||F,Z=Number(G.get("offset"))||N,K=U?.response.resultsCount||0,X=Math.min(Z+Y,K),Q=`${Z+1}-${X}`,J=i.fields?.FilterOptions?.map(i=>({title:i?.fields.Header?.value||i?.displayName||"",fields:i.fields?.Filters?.map(i=>{let{id:r,key:n,value:a,displayName:o}=(0,E.default)(i);return{id:r,value:a,name:n,label:o,defaultChecked:G.getAll(n).includes(a)}})})),ee=J?.reduce((i,{fields:r})=>[...i,...r.filter(({defaultChecked:i})=>i)],[]),{headingTag:et,subheadingTag:ei}=(0,k.default)(i?.params,i.fields?.Heading?.value);return(0,r.jsxs)("form",{...H,children:[(0,r.jsx)(y.default,{theme:O?.Theme||"J-HCA-Tangerine-20",children:(0,r.jsx)(w.default,{metatitle:P?.Heading?.value&&(0,r.jsx)(l.default,{tag:ei,variation:"subheading-1",children:(0,r.jsx)(a.Text,{field:P?.Heading})}),heading:P?.Title?.value&&(0,r.jsx)(l.default,{variation:O?.HeadingSize||(0,w.getDynamicTitleStyle)(P?.Title.value.length),tag:et,children:(0,r.jsx)(a.Text,{field:P?.Title})}),description:(0,r.jsx)(l.default,{tag:"div",variation:"body-large",children:(0,r.jsx)(o.RichText,{tag:"span",field:i?.fields?.Text})}),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.default,{defaultValue:G.get("input")||void 0,name:"input",placeholder:P?.SearchPlaceholder?.value,suggestions:W?[]:$?.response.results?.map(i=>`${i.value}`),children:[(0,r.jsx)(d.default,{buttonText:(0,r.jsx)(a.Text,{field:P?.FilterOptionsText}),buttonIcon:(0,r.jsx)(v.default,{children:i?.fields?.FilterOptionsIcon?.fields?.SvgMarkup?.value}),resultsCount:K,filters:J?.map(i=>({title:i.title,contentVariation:"filters",children:(0,r.jsx)(u.default,{children:i.fields?.map(i=>(0,n.createElement)(c.default,{...i,key:i.id}))})}))}),(0,r.jsx)(x.default,{buttonText:(0,r.jsx)(a.Text,{field:P?.SortOptionsText}),buttonIcon:(0,r.jsx)(v.default,{children:i?.fields?.SortOptionsIcon?.fields?.SvgMarkup?.value}),options:i?.fields?.SortOptions?.map(i=>{let{id:r,key:n,value:a,displayName:o}=(0,E.default)(i);return{id:r,value:a,labelText:o,name:n,defaultChecked:G?.get(n)===a}})||[]})]}),(0,r.jsx)(b.default,{filters:ee||[],clearFilters:()=>{ee?.forEach(({id:i},r)=>{let n=document.getElementById(i);n&&(r===ee.length-1?n.click():n.checked=!1)})}})]})})}),(0,r.jsx)(y.default,{theme:O?.CardTheme||"A-HCA-White",children:q?(0,r.jsx)(R.default,{loadingMsg:D("loading")||"Loading..."}):V?(0,r.jsx)(S.default,{variant:"search-error"}):K?(0,r.jsxs)(T.default,{ref:B,searchDetail:(0,r.jsx)(l.default,{tag:"h3",variation:"heading-1",children:(0,r.jsx)(C.default,{searchResultsTextWithInput:P?.SearchResultsTextWithInput?.value,searchResultsText:P?.SearchResultsText?.value,resultsCount:K,input:G.get("input")||G.get("autocomplete")||void 0})}),showing:!!X&&(0,r.jsx)(l.default,{variation:"body-medium",children:(0,r.jsxs)("span",{children:[D("showing")||"Showing"," ",Q]})}),children:[(0,r.jsx)(p.default,{children:U?.response.results?.map((n,a)=>{let{data:s}=n,{abstractTitle:u,abstractText:c,abstractImageUrl:d,title:p,description:m,imageUrl:g,primaryImageUrl:_,url:y}=s,v=(0,I.default)(d,_,g);return(0,r.jsx)(h.default,{title:(0,r.jsx)(l.default,{variation:"heading-1",tag:"h4",children:u||p}),bodyCopy:(0,r.jsx)(l.default,{tag:"div",variation:"body-large",isHtml:!0,children:c||m}),image:void 0!==v?(0,r.jsx)(f.default,{src:v,alt:"",width:"363",height:"243"}):void 0,link:(0,r.jsx)("a",{href:y,children:(0,r.jsx)(o.RichText,{field:i.fields?.CTACardText})})},a)})}),(0,r.jsx)(g.default,{offset:Z,limit:Y,resultsCount:K,scrollToRef:B})]}):(0,r.jsx)(S.default,{})})]})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(L,{...i})})])},480681,i=>{i.v({cards:"SideScrollingCards-module-scss-module__ojfRRq__cards",highlight:"SideScrollingCards-module-scss-module__ojfRRq__highlight",intro:"SideScrollingCards-module-scss-module__ojfRRq__intro","intro-text":"SideScrollingCards-module-scss-module__ojfRRq__intro-text","side-scroll-section":"SideScrollingCards-module-scss-module__ojfRRq__side-scroll-section","sr-only":"SideScrollingCards-module-scss-module__ojfRRq__sr-only",wrapper:"SideScrollingCards-module-scss-module__ojfRRq__wrapper"})},750966,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(480681),o=i.i(257818),s=i.i(443107),l=i.i(249736),u=i.i(938954);i.s(["default",0,i=>{let{title:c,bodyCopy:d,link:h,children:f,id:p,tableOfContentTitle:m}
1=i,[g,_]=(0,n.useState)(),[y,v]=(0,n.useState)(),x=(0,n.useRef)(null),b=(0,n.useRef)(null),w=(0,n.useRef)(null),T=(()=>{let[i,r]=(0,n.useState)(document.activeElement),a=()=>{r(document.activeElement)};return(0,n.useEffect)(()=>(document.addEventListener("focusin",a),()=>{document.removeEventListener("focusin",a)}),[]),i})();(0,n.useEffect)(()=>{if(!T||!T.parentElement||!x.current||!x.current.parentElement||!x.current.contains(T))return;let i=T.parentElement.offsetWidth,r=Array.from(w.current.children),n=[b.current,...r],a=0;n.forEach((i,r)=>{i?.contains(T)&&(a=r)});let o=x.current.parentElement.offsetTop,s=o+x.current.parentElement.offsetHeight,l=o+i*a;l<o||l>s||window.scroll(0,l)},[T]);let E=()=>{if(!x.current)return;let i=x.current.offsetTop;0===i?_(0):_(i)},S=(0,u.useDebouncedCallback)(()=>{x.current&&(v(x.current.scrollWidth-x.current.offsetWidth+x.current.offsetHeight),E(),window.addEventListener("scroll",E))},100);return(0,n.useEffect)(()=>(S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)),[S]),(0,r.jsx)(l.default,{theme:"J-HCA-Tangerine-20",id:p,tableOfContentTitle:m,children:(0,r.jsx)("div",{className:a.default.wrapper,style:{height:`${y}px`},children:(0,r.jsxs)("div",{ref:x,className:a.default["side-scroll-section"],style:{transform:`translateX(-${g}px)`},children:[(0,r.jsxs)("div",{ref:b,className:a.default.intro,children:[(0,r.jsxs)("div",{className:a.default["intro-text"],children:[(0,r.jsx)(o.default,{variation:"display-2",tag:"h2",children:c}),(0,r.jsx)(o.default,{tag:"span",variation:"body-large",children:d})]}),(0,r.jsx)(s.default,{size:"large",variation:"outline-dark",children:h})]}),(0,r.jsx)("div",{ref:w,className:a.default.cards,children:f})]})})})}],750966)},450055,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(898205),o=i.i(314816),s=i.i(159273),l=i.i(443107),u=i.i(755953),c=i.i(257818),d=i.i(66441);let h=i=>i.page.mode.isEditing?(0,r.jsx)("div",{className:`component promo ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"More Information CTA please click to select datasource"})})}):(0,r.jsx)(r.Fragment,{});i.s(["Default",0,i=>{let f=(0,n.useRef)(null),p=i.page.mode.isEditing;return i.fields?i.fields?.ModalContent?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.default,{size:"large",variation:"full",children:(0,r.jsx)("button",{onClick:()=>f?.current?.showModal(),children:i?.fields?.CTALink?.value&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i?.fields?.CTAIcon?.fields?.SvgMarkup?.value||""}}),(0,r.jsx)(o.RichText,{tag:"span",field:{value:i?.fields?.CTALink?.value.text}})]})})}),(0,r.jsx)(u.default,{ref:f,title1:(0,r.jsx)(c.default,{tag:i.params?.HeadingTag||(0,d.default)(i.parentHeadingTag,"h3"),variation:i.params?.HeadingSize||"display-3",children:(0,r.jsx)(a.Text,{field:i.fields?.ModalContent[0]?.fields?.Title})}),copy1:(0,r.jsx)(o.RichText,{field:i.fields?.ModalContent[0]?.fields?.Text}),title2:(0,r.jsx)(c.default,{tag:i.params?.HeadingTag||(0,d.default)(i.parentHeadingTag,"h3"),variation:i.params?.HeadingSize||"display-3",children:(0,r.jsx)(a.Text,{field:i.fields?.ModalContent[1]?.fields?.Title})}),copy2:(0,r.jsx)(o.RichText,{field:i.fields?.ModalContent[1]?.fields?.Text}),cta1:p?i?.fields?.ModalContent[0]?.fields?.CTALink?.value&&(0,r.jsx)(s.Link,{field:i?.fields?.ModalContent[0]?.fields?.CTALink?.value}):i?.fields?.ModalContent[0]?.fields?.CTALink?.value?.href&&(0,r.jsxs)("a",{href:i?.fields?.ModalContent[0]?.fields?.CTALink.value.href,children:[i?.fields?.ModalContent[0]?.fields?.CTAIcon?.fields?.SvgMarkup?.value&&(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i?.fields?.ModalContent[0]?.fields?.CTAIcon?.fields?.SvgMarkup.value}}),i?.fields?.ModalContent[0]?.fields?.CTALink.value?.text&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(o.RichText,{field:{value:i?.fields?.ModalContent[0]?.fields?.CTALink.value?.text||""}})})]}),cta2:p?i?.fields?.ModalContent[1]?.fields?.CTALink?.value&&(0,r.jsx)(s.Link,{field:i?.fields?.ModalContent[1]?.fields?.CTALink?.value}):i?.fields?.ModalContent[1]?.fields?.CTALink?.value?.href&&(0,r.jsxs)("a",{href:i?.fields?.ModalContent[1]?.fields?.CTALink.value.href,children:[i?.fields?.ModalContent[1]?.fields?.CTAIcon?.fields?.SvgMarkup?.value&&(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i?.fields?.ModalContent[1]?.fields?.CTAIcon?.fields?.SvgMarkup.value}}),i?.fields?.ModalContent[1]?.fields?.CTALink.value?.text&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(o.RichText,{field:{value:i?.fields?.ModalContent[1]?.fields?.CTALink.value?.text||""}})})]})})]}):(0,r.jsx)(r.Fragment,{}):(0,r.jsx)(h,{...i})}])},158305,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(898205),o=i.i(159273),s=i.i(314816),l=i.i(443107),u=i.i(211452),c=i.i(370777),d=i.i(257818);let h=i=>(0,r.jsx)("div",{className:`component ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"ModalContent no datasource"})})});i.s(["Default",0,i=>{let f=(0,n.useRef)(null);return i.fields?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.default,{size:"large",variation:"full",children:(0,r.jsx)("button",{onClick:()=>f?.current?.showModal(),children:i.fields?.PrimaryCTA?.value?.text&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i.fields?.PrimaryCTAIcon?.fields?.SvgMarkup?.value||""}}),(0,r.jsx)(s.RichText,{tag:"span",field:{value:i?.fields?.PrimaryCTA.value.text}})]})})}),(0,r.jsx)(c.default,{ref:f,title1:(0,r.jsx)(d.default,{variation:i.params?.HeadingSize||"display-3",tag:i.params?.HeadingTag||"h2",children:(0,r.jsx)(a.Text,{field:i.fields?.Title})}),copy1:(0,r.jsx)(d.default,{variation:"body-large",children:(0,r.jsx)(s.RichText,{tag:"span",field:i.fields?.Text})}),cta1:(0,r.jsxs)(r.Fragment,{children:[i.fields?.PrimaryCTA?.value?.text&&(0,r.jsx)(l.default,{size:"large",contentVariation:"full-width",variation:"full",children:(0,r.jsxs)(o.Link,{field:i.fields?.PrimaryCTA,children:[(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i.fields?.PrimaryCTAIcon?.fields?.SvgMarkup?.value||""}}),(0,r.jsx)(s.RichText,{tag:"span",field:{value:i.fields?.PrimaryCTA.value.text}})]})}),i.fields?.SecondaryCTA?.value?.text&&(0,r.jsx)(u.default,{children:(0,r.jsxs)(o.Link,{field:i.fields?.SecondaryCTA,children:[(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i.fields?.SecondaryCTAIcon?.fields?.SvgMarkup?.value||""}}),(0,r.jsx)(s.RichText,{tag:"span",field:{value:i.fields?.SecondaryCTA?.value?.text}})]})})]})})]}):(0,r.jsx)(h,{...i})}])},418697,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(898205),o=i.i(314816),s=i.i(586936),l=i.i(273723),u=i.i(999386),c=i.i(257818),d=i.i(321767),h=i.i(955679),f=i.i(623420),p=i.i(208024),m=i.i(267770),g=i.i(82037
15),_=i.i(249736),y=i.i(630077),v=i.i(855963),x=i.i(580707),b=i.i(215904),w=i.i(683223),T=i.i(250905),E=i.i(922861),S=i.i(773293),A=i.i(443107),C=i.i(211452),I=i.i(924274),k=i.i(752071),R=i.i(825477),M=i.i(85670),L=i.i(398762),P=i.i(351272),O=i.i(777912),D=i.i(640666),F=i.i(254740),N=i.i(751344);let j=i=>(0,r.jsx)("div",{className:`component ${i?.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"LocationsSearch no datasource"})})}),z=i=>{let{fields:z,params:B,contentVariation:U}=i,V=(0,k.useTranslations)(i?.page?.siteName),{defaultLimit:H,defaultOffset:G,baselineParams:q}=(0,D.default)(i),$=(0,n.useRef)(null),{data:W,error:Y,formHandlers:Z,searchParams:K,isResultsLoading:X,autocompleteData:Q,autocompleteError:J}=(0,d.default)({baseUrl:"/api/api-layer",searchPath:"/locations/search",baselineParams:q,autocompletePath:"/locationApi/suggestLocation",autoCompleteSearchParamName:"searchTerm",inputFieldName:"near",baselineAutocompleteParams:[["provider","1"],["searchType","1"]],searchOnChange:!1});if(!z)return(0,r.jsx)(j,{...i});let ee=Number(K.get("limit"))||H,et=Number(K.get("offset"))||G,ei=W?.response?.resultsCount||0,er=Math.min(et+ee,ei),en=`${et+1}-${er}`,ea=i?.fields?.data?.item?.filterOptions?.targetItems?.map(i=>({title:i?.header?.value||i?.header?.value||"",fields:i.filters?.targetItems.map(i=>{let{id:r,key:n,value:a,displayName:o}=(0,S.unpackFilterOptionJson)(i);return{id:r,value:a,name:n,label:o,defaultChecked:K.getAll(n).includes(a)}})})),eo=ea?.reduce((i,{fields:r})=>[...i,...r.filter(({defaultChecked:i})=>i)],[]),{headingTag:es,subheadingTag:el}=(0,O.default)(i?.params,i?.fields?.data?.item?.heading?.jsonValue?.value);return(0,r.jsxs)("form",{...Z,children:[(0,r.jsx)(_.default,{theme:B?.Theme||"G-HCA-Orange",children:(0,r.jsx)(s.default,{contentVariation:U,heading:(0,r.jsx)(c.default,{variation:i.params?.HeadingSize||(0,s.getDynamicTitleStyle)(i?.fields?.data?.item?.title?.jsonValue?.value?.length),tag:es,children:(0,r.jsx)(a.Text,{field:i?.fields?.data?.item?.title?.jsonValue})}),metatitle:(0,r.jsx)(c.default,{tag:el,variation:"subheading-1",children:(0,r.jsx)(a.Text,{field:i?.fields?.data?.item?.heading?.jsonValue})}),description:(0,r.jsx)(c.default,{tag:"div",variation:"body-large",children:(0,r.jsx)(o.RichText,{tag:"span",field:i?.fields?.data?.item?.text?.jsonValue})}),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l.default,{defaultValue:K.get("near")||K.get("autocomplete")||void 0,name:"near",placeholder:z?.data?.item?.searchPlaceholder?.value,suggestions:J?[]:Q?.map(i=>`${i.LocationName}`),locationCta:(0,r.jsx)(M.default,{}),error:"Please select a location from the dropdown",scrollRef:$,children:[(0,r.jsx)(E.default,{submitOnClose:!0,buttonText:(0,r.jsx)(a.Text,{field:z?.data?.item?.filterOptionsText}),buttonIcon:(0,r.jsx)(m.default,{children:i?.fields?.data?.item?.filterOptionsIcon?.targetItem?.svgMarkup?.value}),resultsCount:ei,filters:ea?.map(i=>({title:i.title,contentVariation:"filters",children:(0,r.jsx)(p.default,{children:i.fields?.map(i=>(0,n.createElement)(f.default,{...i,key:i.id}))})}))}),(0,r.jsx)(h.default,{buttonText:(0,r.jsx)(a.Text,{field:z?.data?.item?.sortOptionsText}),buttonIcon:(0,r.jsx)(m.default,{children:i?.fields?.data?.item?.sortOptionsIcon?.targetItem?.svgMarkup?.value}),options:i?.fields?.data?.item?.sortOptions?.targetItems?.map(i=>{let{id:r,key:n,value:a,displayName:o}=(0,S.unpackFilterOptionJson)(i);return{id:r,value:a,labelText:o,name:n,defaultChecked:K?.get(n)===a}})||[]})]}),(0,r.jsx)(g.default,{filters:eo||[],clearFilters:()=>{eo?.forEach(({id:i},r)=>{let n=document.getElementById(i);n&&(r===eo.length-1?n.click():n.checked=!1)})}})]})})}),(0,r.jsx)(_.default,{theme:B?.CardTheme||"A-HCA-White",children:X?(0,r.jsx)(N.default,{loadingMsg:V("loading")||"Loading..."}):Y?(0,r.jsx)(I.default,{variant:"search-error"}):ei?(0,r.jsx)(u.default,{ref:$,searchDetail:(0,r.jsx)(c.default,{tag:"h3",variation:"heading-1",children:(0,r.jsx)(R.default,{searchResultsTextWithInput:z?.data?.item?.searchResultsTextWithInput?.value,searchResultsText:z?.data?.item?.searchResultsText?.value,resultsCount:ei,input
1:K.get("near")||K.get("autocomplete")||void 0})}),showing:!!er&&(0,r.jsx)(c.default,{variation:"body-medium",children:(0,r.jsxs)("span",{children:[V("showing")||"Showing"," ",en]})}),tabbedResults:[{tab:{icon:(0,r.jsx)(m.default,{children:i?.fields?.data?.item?.gridViewIcon?.targetItem?.svgMarkup?.value}),label:i?.fields?.data?.item?.gridViewText?.value},tabContent:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v.default,{children:W?.response?.results?.map(({data:n})=>{let{id:s,abstractTitle:l,abstractImageUrl:u,primaryImageUrl:d,title:h,description:f,imageUrl:p,url:m,directions:g,googlePlaceId:_,geocodedCoordinate:y}=n,v=(0,L.default)(u,d,p),x=(0,P.default)(_,g,y);return(0,r.jsx)(w.default,{title:(0,r.jsx)(c.default,{variation:"heading-1",tag:"h4",children:l||h}),address:f?(0,r.jsx)(c.default,{variation:"body-large",children:f}):void 0,image:void 0!==v?(0,r.jsx)(b.default,{src:(0,F.upsertQuerystringParam)(v||"","t","w750"),alt:"",quality:90,width:"560",height:"420"}):void 0,ctas:{button1:m?(0,r.jsx)(A.default,{size:"large",variation:"full",children:(0,r.jsx)("a",{href:m,children:(0,r.jsx)(o.RichText,{field:i?.fields?.data?.item?.cTACardText})})}):void 0,button2:x?(0,r.jsx)(C.default,{children:(0,r.jsx)("a",{href:x,target:"_blank",rel:"noopener noreferrer",children:(0,r.jsx)("span",{children:(0,r.jsx)(a.Text,{field:z.data?.item?.getDirectionsText})})})}):void 0}},s)})}),(0,r.jsx)(x.default,{offset:et,limit:ee,resultsCount:ei,scrollToRef:$})]})},{tab:{icon:(0,r.jsx)(m.default,{children:i?.fields?.data?.item?.mapViewIcon?.targetItem?.svgMarkup?.value}),label:i?.fields?.data?.item?.mapViewText?.value},tabContent:(0,r.jsx)(T.default,{apiKey:"AIzaSyCJu0aTsRYKOQVPsETLeTvI84jxDZjRGAg",locations:W?.response?.results.map(({data:n})=>({center:{lat:Number(n.lat)||0,lng:Number(n.lng)||0},card:s=>(0,r.jsx)(w.default,{title:(0,r.jsx)(c.default,{tag:"h3",variation:"heading-2",children:n.title}),address:(0,r.jsx)(c.default,{tag:"p",variation:"body-large",children:n.description}),ctas:{button1:(0,r.jsx)("a",{href:n.url,children:(0,r.jsx)(o.RichText,{field:i?.fields?.data?.item?.cTACardText})}),button2:(0,P.default)(n.googlePlaceId,n.directions,n.geocodedCoordinate)?(0,r.jsx)("a",{href:(0,P.default)(n.googlePlaceId,n.directions,n.geocodedCoordinate),children:(0,r.jsx)("span",{children:(0,r.jsx)(a.Text,{field:z?.data?.item?.getDirectionsText})})}):void 0,close:(0,r.jsxs)("button",{onClick:s,children:[(0,r.jsx)("span",{children:V("close")||"Close"}),(0,r.jsx)(y.default,{iconName:"iconCross"})]})}})}))||[]})}]}):(0,r.jsx)(I.default,{})})]})},B=i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(z,{...i})});i.s(["Default",0,B,"WithHeader",0,i=>i.fields?(0,r.jsx)(B,{...i,contentVariation:"padding-small"}):(0,r.jsx)(j,{...i})])},837365,i=>{"use strict";var r=i.i(677076),n=i.i(898205),a=i.i(159273),o=i.i(314816),s=i.i(257818),l=i.i(443107),u=i.i(249736),c=i.i(923152),d=i.i(267770),h=i.i(752792),f=i.i(450782),p=i.i(777912);let m=(0,h.default)(()=>i.A(96912),{loadableGenerated:{modules:[451427]},ssr:!1}),g=i=>(0,r.jsx)("div",{className:`component ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"LocationsMap no datasource"})})});i.s(["Default",0,i=>{let h=i.page.mode.isEditing;if(!i.fields)return(0,r.jsx)(g,{...i});let _=i?.fields?.Title?.value,y=f.inPageNavGlobalStore.addItem(i?.params,_),v=i?.params?.TableOfContentsLinkTitle||_,{headingTag:x,subheadingTag:b}=(0,p.default)(i?.params,i.fields?.Heading?.value),w={subtitle:(0,r.jsx)(s.default,{tag:b,variation:"subheading-1",children:(0,r.jsx)(n.Text,{field:i.fields?.Heading})}),title:(0,r.jsx)(s.default,{tag:x,variation:i.params?.HeadingSize||"display-3",children:(0,r.jsx)(n.Text,{field:i.fields?.Title})}),body:(0,r.jsx)(s.default,{tag:"p",variation:"body-large",children:(0,r.jsx)(o.RichText,{tag:"span",field:i.fields?.Text})}),ctas:h?i.fields?.CTALink&&(0,r.jsx)(l.default,{size:"large",variation:"full",children:(0,r.jsx)(a.Link,{field:i.fields?.CTALink})}):(0,r.jsx)(r.Fragment,{children:i.fields?.CTALink?.value?.text&&(0,r.jsx)(u.default,{theme:i.params?.Theme||"O-HCA-Teal-20",children:(0,r.jsx)(l.default,{size:"large",variation:"full-dark",children:(0,r.jsxs)("a",{href:i.fields?.CTALink?.value.href,children:[(0,r.jsx)("span",{children:(0,r.jsx)(d.default,{children:i?.fields?.CTAIcon?.fields?.SvgMarkup?.value})}),(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i.fields?.CTALink?.value.text||""}})]})})})})},T=[];return i.fields?.Cards?.map(i=>{let a={mapX:Number(i?.fields?.PinPositionX?.value)||.66,mapY:Number(i?.fields?.PinPositionY?.value)||.85,mapScale:Number(i?.fields?.MapScale?.value)||.5,theme:i?.fields?.Theme?.name||"B-HCA-Navy-Blue",card:(0,r.jsx)(c.default,{quantity:(0,r.jsx)(s.default,{tag:"p",variation:"display-1",children:(0,r.jsx)(n.Text,{field:i?.fields?.Number})}),title:(0,r.jsx)(s.default,{tag:"p",variation:"heading-2",children:(0,r.jsx)(o.RichText,{tag:"span",field:i?.fields?.Title})}),subtitle:i?.fields?.Text?.value?(0,r.jsx)(s.default,{tag:"p",variation:"subheading-2",children:(0,r.jsx)(n.Text,{field:i?.fields?.Text})}):void 0,icon:i?.fields?.Icon?.fields?.SvgMarkup?.value?(0,r.jsx)(d.default,{children:i?.fields?.Icon?.fields?.SvgMarkup?.value}):void 0,cta:i.fields?.CTALink?.value?(0,r.jsx)("a",{href:i.fields?.CTALink?.value.href,children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i.fields?.CTALink?.value.text||""}})}):(0,r.jsx)(r.Fragment,{})})};T.push(a)}),(0,r.jsx)(m,{id:y,...v&&i?.params?.ExcludeFromTableOfContents!=="1"?{tableOfContentTitle:v}:{},mapAspectRatio:3e3/3444,headerProps:w,locations:T})}])},862851,i=>{"use strict";var r=i.i(677076),n=i.i(898205),a=i.i(752071),o=i.i(250905),s=i.i(683223),l=i.i(257818),u=i.i(630077);let c=i=>i.page.mode.isEditing?(0,r.jsx)("div",{className:`component ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Location Map please click to select datasource"})})}):(0,r.jsx)(r.Fragment,{});i.s(["Default",0,i=>{let d=(0,a.useTranslations)(i?.page?.siteName);if(!i.fields?.data?.item)return(0,r.jsx)(c,{...i});let h=(i.fields.data.item.locations?.PagesList||[]).flatMap(a=>{let o=Number(a.lat?.value)||0,c=Number(a.lng?.value)||0;if(0===o&&0===c)return[];let h=a.directions?.value||void 0,f=a.url?.path||a.url?.url;return[{center:{lat:o,lng:c},card:o=>(0,r.jsx)(s.default,{title:(0,r.jsx)(l.default,{tag:"h3",variation:"heading-2",children:a.title?.value}),address:(0,r.jsx)(l.default,{tag:"p",variation:"body-large",children:[a.addressLine1?.value,a.addressLine2?.value,a.city?.value,a.postCode?.value].filter(i=>!!i).join(", ")}),ctas:{button1:f?(0,r.jsx)("a",{href:f,children:(0,r.jsx)(n.Text,{field:i.fields?.data?.item?.cTACardText?.jsonValue})}):void 0,button2:h?(0,r.jsx)("a",{href:h,children:(0,r.jsx)("span",{children:(0,r.jsx)(n.Text,{field:i.fields?.data?.item?.getDirectionsText?.jsonValue})})}):void 0,close:(0,r.jsxs)("button",{onClick:o,children:[(0,r.jsx)("span",{children:d("close")||"Close"}),(0,r.jsx)(u.default,{iconName:"iconCross"})]})}})}]}),f=h[0]?.center||{lat:51.5072,lng:-.1276};return(0,r.jsx)(o.default,{apiKey:"AIzaSyCJu0aTsRYKOQVPsETLeTvI84jxDZjRGAg",center:f,locations:h})}])},288178,i=>{i.v({container:"CarouselImages-module-scss-module__1FnumG__container","equal-size":"CarouselImages-module-scss-module__1FnumG__equal-size",highlight:"CarouselImages-module-scss-module__1FnumG__highlight",image:"CarouselImages-module-scss-module__1FnumG__image","sr-only":"CarouselImages-module-scss-module__1FnumG__sr-only",wrapper:"CarouselImages-module-scss-module__1FnumG__wrapper"})},821425,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(288178),o=i.i(906396);i.s(["default",0,i=>{let s,l,{images:u,contentVariation:c,id:d,tableOfContentTitle:h}
1=i,[f,p]=(0,n.useState)(!1),[m,g]=(0,n.useState)(0),[_,y]=(0,n.useState)(0),[v,x]=(0,n.useState)(0),b=(0,n.useRef)(null);(0,n.useEffect)(()=>{let i=b.current;i&&(i.scrollLeft=(i.scrollWidth-window.innerWidth)/2)},[]),(0,n.useEffect)(()=>{let i=b.current,r=()=>{if(!i)return;let r=window.scrollY,n=i.offsetTop,a=n-window.innerHeight,o=i.offsetHeight+n;r>a&&r<o&&(r>v?i.scrollLeft+=2:i.scrollLeft-=2),x(r)};return i&&window.addEventListener("scroll",r),()=>{i&&window.removeEventListener("scroll",r)}},[v]);let w=()=>{p(!1)};return h&&(l=h,s=(0,o.generateHtmlSafeId)(h)),(0,r.jsx)("div",{id:d,...h?{"data-subnav-link-title":l}:{},...h?{"data-subnav-link-id":s}:{},className:[a.default.wrapper,"equalSize"===c&&a.default["equal-size"]].join(" "),ref:b,onMouseDown:i=>{b.current&&(p(!0),g(i.pageX-b.current.offsetLeft),y(b.current.scrollLeft))},onMouseMove:i=>{if(!b.current||!f)return;i.preventDefault();let r=i.pageX-b.current.offsetLeft;b.current.scrollLeft=_-(r-m)},onMouseUp:w,onMouseLeave:w,children:(0,r.jsx)("div",{className:a.default.container,children:u.map((i,n)=>(0,r.jsx)("div",{className:a.default.image,children:i},n))})})}])},922028,i=>{"use strict";var r=i.i(677076),n=i.i(898205),a=i.i(955950),o=i.i(314816),s=i.i(137882),l=i.i(825233),u=i.i(257818),c=i.i(66441),d=i.i(229462),h=i.i(203828);let f=i=>(0,r.jsx)("div",{className:`component ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"HeroBannerWithSearch no datasource"})})});i.s(["Default",0,i=>{let p=`cta-buttons-${i.params?.DynamicPlaceholderId}`;return i.fields?(0,r.jsx)(s.default,{theme:i.params?.Theme||"H-HCA-Tangerine",title:(0,r.jsx)(u.default,{tag:i.params?.HeadingTag||"h1",variation:(0,s.getDynamicTitleStyle)(i.fields?.data?.contextItem?.title?.jsonValue?.value?.length),children:(0,r.jsx)(o.RichText,{field:i.fields?.data?.contextItem?.title?.jsonValue})}),search:(0,r.jsx)(l.default,{onClick:()=>{let i=document.getElementById(d.SEARCH_SUGGESTIONS_MODAL_ID);i?.showModal()},children:(0,r.jsx)(n.Text,{field:i.fields?.data?.item?.searchPlaceholder?.jsonValue})}),ctaTitle:(0,r.jsx)(u.default,{tag:(0,c.default)(i.params?.HeadingTag,"h2"),variation:"subheading-1",children:(0,r.jsx)(n.Text,{field:i.fields?.data?.item?.cTAHeading?.jsonValue})}),ctas:i.rendering&&i.componentMap?(0,r.jsx)(a.AppPlaceholder,{name:p,rendering:i.rendering,page:i.page,componentMap:i.componentMap,passThroughComponentProps:{contentVariation:"full-width"}}):(0,r.jsx)(r.Fragment,{}),image:(0,r.jsx)(h.default,{field:i.fields?.data?.contextItem?.image?.jsonValue,next:{fill:!0,sizes:"100vw",loading:"eager",priority:!0}})}):(0,r.jsx)(f,{...i})}])},541195,i=>{i.v({children:"VideoHero-module-scss-module__JdQKtq__children",content:"VideoHero-module-scss-module__JdQKtq__content",copy:"VideoHero-module-scss-module__JdQKtq__copy",highlight:"VideoHero-module-scss-module__JdQKtq__highlight",image:"VideoHero-module-scss-module__JdQKtq__image",inner:"VideoHero-module-scss-module__JdQKtq__inner",outer:"VideoHero-module-scss-module__JdQKtq__outer",overlay:"VideoHero-module-scss-module__JdQKtq__overlay",paused:"VideoHero-module-scss-module__JdQKtq__paused",playing:"VideoHero-module-scss-module__JdQKtq__playing","sr-only":"VideoHero-module-scss-module__JdQKtq__sr-only",subtitle:"VideoHero-module-scss-module__JdQKtq__subtitle",toggle:"VideoHero-module-scss-module__JdQKtq__toggle",video:"VideoHero-module-scss-module__JdQKtq__video"})},973253,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(541195),o=i.i(211452);i.s(["default",0,i=>{let{title:s,copy:l,children:u,image:c,subtitle:d,videoSrc:h,videoAspectRatio:f=16/9}=i,p=(0,n.useRef)(null),m=(0,n.useRef)(null),[g,_]=(0,n.useState)(h?"playing":""),y=!!h&&(h.includes("youtube.com")||h.includes("youtu.be")),v=!!h&&h.includes("vimeo.com"),x=y||v,b=(0,n.useMemo)(()=>{if(!h||!x)return null;let i=h;if(y){let r=h.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&]+)/)?.[1]||h.match(/embed\/([^?]+)/)?.[1],n=new URL(i=`https://www.youtube.com/embed/${r}`);return n.searchParams.set("autoplay","1"),n.searchParams.set("mute","1"),n.searchParams.set("controls","0"),n.searchParams.set("loop","1"),n.searchParams.set("playlist",r||""),n.searchParams.set("enablejsapi","1"),n.searchParams.set("rel","0"),n.href}if(v){let i=new URL(h);return i.searchParams.set("background","1"),i.searchParams.set("muted","1"),i.searchParams.set("loop","1"),i.searchParams.set("autoplay","1"),i.href}return i},[h,y,v,x]);return(0,r.jsxs)("div",{className:a.default.outer,style:{"--aspect-ratio":f},children:[c&&(0,r.jsx)("div",{className:a.default.image,children:c}),h&&(0,r.jsx)("div",{className:[a.default.video,a.default[g]].join(" "),children:x?(0,r.jsx)("iframe",{ref:p,src:b||"",onLoad:()=>_("playing"),allow:"autoplay; fullscreen",allowFullScreen:!0,"aria-hidden":"true"}):(0,r.jsx)("video",{ref:m,autoPlay:!0,muted:!0,loop:!0,playsInl
1ine:!0,preload:"metadata",onPlay:()=>_("playing"),onPause:()=>_("paused"),children:(0,r.jsx)("source",{src:h,type:"video/mp4"})})}),(0,r.jsx)("div",{className:a.default.overlay}),(0,r.jsxs)("div",{className:a.default.inner,children:[(0,r.jsxs)("div",{className:a.default.content,children:[d&&(0,r.jsx)("div",{className:a.default.subtitle,children:d}),s&&(0,r.jsx)("div",{className:a.default.title,children:s}),l&&(0,r.jsx)("div",{className:a.default.copy,children:l})]}),u&&(0,r.jsx)("div",{className:a.default.children,children:u})]}),!!g&&(0,r.jsx)("div",{className:a.default.toggle,children:(0,r.jsx)(o.default,{children:(0,r.jsx)("button",{onClick:()=>{if(x){let i=p.current;if(!i)return;y&&i.contentWindow?.postMessage(JSON.stringify({event:"command",func:"playing"===g?"pauseVideo":"playVideo",args:[]}),"*"),v&&i.contentWindow?.postMessage({method:"playing"===g?"pause":"play"},"*"),_("playing"===g?"paused":"playing");return}let i=m.current;i&&(i.paused?(i.play(),_("playing")):(i.pause(),_("paused")))},children:"playing"===g?"Pause video":"Play video"})})})]})}])},469321,(i,r,n)=>{r.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},275243,i=>{"use strict";var r,n;(n=r||(r={})).Standard="STANDARD",n.Overlay="OVERLAY",n.Autocomplete="AUTOCOMPLETE",i.s(["QuerySource",0,r])},565072,i=>{"use strict";var r,n;(n=r||(r={})).Universal="universal",n.Vertical="vertical",i.s(["SearchTypeEnum",0,r])},660128,(i,r,n)=>{"use strict";var a=i.r(2317),o=i.r(768546),s="function"==typeof Object.is?Object.is:function(i,r){return i===r&&(0!==i||1/i==1/r)||i!=i&&r!=r},l=o.useSyncExternalStore,u=a.useRef,c=a.useEffect,d=a.useMemo,h=a.useDebugValue;n.useSyncExternalStoreWithSelector=function(i,r,n,a,o){var f=u(null);if(null===f.current){var p={hasValue:!1,value:null};f.current=p}else p=f.current;var m=l(i,(f=d(function(){function i(i){if(!c){if(c=!0,l=i,i=a(i),void 0!==o&&p.hasValue){var r=p.value;if(o(r,i))return u=r}return u=i}if(r=u,s(l,i))return r;var n=a(i);return void 0!==o&&o(r,n)?(l=i,r):(l=i,u=n)}var l,u,c=!1,d=void 0===n?null:n;return[function(){return i(r())},null===d?void 0:function(){return i(d())}]},[r,n,a,o]))[0],f[1]);return c(function(){p.hasValue=!0,p.value=m},[m]),h(m),m}},95605,(i,r,n)=>{"use strict";r.exports=i.r(660128)},932626,699813,929313,334157,524238,693941,360227,278728,531018,633981,145166,142377,698626,i=>{"use strict";(l=c||(c={})).FeaturedSnippet="FEATURED_SNIPPET",l.FieldValue="FIELD_VALUE",i.s(["DirectAnswerType",0,c],699813),(u=d||(d={})).KnowledgeManager="KNOWLEDGE_MANAGER",u.Google="GOOGLE_CSE",u.Custom="CUSTOM_SEARCHER",u.DocumentVertical="DOCUMENT_VERTICAL",u.FunctionVertical="FUNCTION_VERTICAL",i.s(["Source",0,d],929313);var r,n,a,o,s,l,u,c,d,h,f,p,m,g,_=function(){function i(){}return i.create=function(i,r){var n=this;return i?i.map(function(i,a){var o=a+1;switch(r){case d.KnowledgeManager:return n.fromKnowledgeManager(i,o);case d.Google:return n.fromGoogleCustomSearchEngine(i,o);case d.DocumentVertical:return n.fromDocumentVertical(i,o);case d.FunctionVertical:return n.fromFunctionVertical(i,o);default:return n.fromCustomSource(i,o)}}):[]},i.fromKnowledgeManager=function(i,r){var n,a=null!=(n=i.data)?n:i;return{rawData:a,source:d.KnowledgeManager,index:r,name:a.name,description:a.description,link:a.website,id:a.id,distance:i.distance,distanceFromFilter:i.distanceFromFilter,highlightedFields:i.highlightedFields,entityType:a.type}},i.fromDocumentVertical=function(i,r){var n,a=null!=(n=i.data)?n:i;return{rawData:a,source:d.DocumentVertical,name:a.name,description:a.description,link:a.website,id:a.id,index:r,segment:i.segment,document:i.document,documents:i.documents}},i.fromGoogleCustomSearchEngine=function(i,r){var n,a=null!=(n=i.data)?n:i;return{rawData:a,source:d.Google,index:r,name:a.htmlTitle.replace(/(<([^>]+)>)/ig,""),description:a.htmlSnippet,link:a.link}},i.fromCustomSource=function(i,r){return this.fromCustomDataHelper(i,r,d.Custom)},i.fromFunctionVertical=function(i,r){return this.fromCustomDataHelper(i,r,d.FunctionVertical)},i.fromCustomDataHelper=function(i,r,n){var a,o=null!=(a=i.data)?a:i;return{rawData:o,source:n,index:r,name:o.name,description:o.description,link:o.website,id:o.id}},i.fromDirectAnswer=function(i){var r,n=null!=(r=i.fieldValues)?r:{};return{rawData:n,source:d.KnowledgeManager,name:n.name,description:n.description,link:i.website,id:i.id,entityType:i.type}},i}();i.s(["ResultsFactory",0,_],334157),(r=h||(h={})).URL="url",r.ComplexURL="complex_url",r.IOSAppURL="ios_app_url",r.AndroidAppURL="android_app_url",r.FacebookURL="facebook_url",r.Email="email",r.InstagramHandle="instagram_handle",r.TwitterHandle="twitter_handle",r.Phone="phone",r.Address="address",r.Hours="hours",r.Decimal="decimal",r.Integer="integer",r.SingleLineText="single_line_text",r.RichText="rich_text",r.MultiLineText="multi_line_text",r.RichText_v2="rich_text_v2",r.Html="html",r.Markdown="markdown",i.s(["BuiltInFieldType",0,h],524238);var y=function(){return(y=Object.assign||function(i){for(var r,n=1,a=arguments.length;n<a;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o]);return i}).apply(this,arguments)},v=[h.MultiLineText,h.RichText,h.RichText_v2,h.Markdown,h.Html];function x(i){var r=(null==i?void 0:i.type)===c.FieldValue,n=(null==i?void 0:i.type)===c.FeaturedSnippet,a={value:i.answer.value,relatedResult:_.fromDirectAnswer(i.relatedItem.data),verticalKey:i.relatedItem.verticalConfigId,fieldType:Object.values(h).includes(i.answer.fieldType)?i.answer.fieldType:"unknown"};if(r)return y(y({type:c.FieldValue},a),{entityName:i.answer.entityName,fieldName:i.answer.fieldName,fieldApiName:i.answer.fieldApiName});if(n){var o=a.fieldType;return v.includes(o)?y(y({type:c.FeaturedSnippet},a),{snippet:i.answer.snippet}):void console.warn("Unexpected fieldType for featured snippet direct answer: ".concat(o))}throw Error("The Search API returned an unknown direct answer type: ".concat(null==i?void 0:i.type))}i.s(["createDirectAnswer",0,x],693941),(n=f||(f={})).Equals="$eq",n.NotEquals="!$eq",n.LessThan="$lt",n.LessThanOrEqualTo="$le",n.GreaterThan="$gt",n.GreaterThanOrEqualTo="$ge",n.Near="$near",n.Between="$between",n.OpenAt="$openAt",i.s(["Matcher",0,f],360227);var b=function(){return(b=Object.assign||function(i){for(var r,n=1,a=arguments.length;n<a;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o]);return i}).apply(this,arguments)};function w(i){var r,n,a,o=i.filter,s=Object.keys(o)[0],l=Object.keys(o[s])[0];
1return a=l===f.Between?(r=o[s][l],n={},Object.keys(r).forEach(function(i){i===f.GreaterThan||i===f.GreaterThanOrEqualTo?n.start={matcher:i,value:r[i]}:(i===f.LessThan||i===f.LessThanOrEqualTo)&&(n.end={matcher:i,value:r[i]})}),n):l===f.Near?b(b({},o[s][l]),{name:i.value}):o[s][l],{fieldId:s,matcher:l,value:a}}function T(i){return{latitude:i.latitude,longitude:i.longitude,displayName:i.locationDisplayName,method:i.accuracy}}function E(i){return{originalQuery:i.originalQuery,correctedQuery:i.correctedQuery.value,type:i.type,matchedSubstrings:i.correctedQuery.matchedSubstrings}}i.s(["createFieldValueFilter",0,w],278728),i.s(["createLocationBias",0,T],531018),i.s(["createSpellCheck",0,E],633981);var S=function(){return(S=Object.assign||function(i){for(var r,n=1,a=arguments.length;n<a;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o]);return i}).apply(this,arguments)};function A(i){return S({displayKey:i.displayKey,displayValue:i.displayValue,filter:w(i),type:i.type},i.details&&{details:i.details})}function C(i){return{appliedQueryFilters:i.appliedQueryFilters?i.appliedQueryFilters.map(A):[],queryDurationMillis:i.queryDurationMillis,results:_.create(i.results,i.source),resultsCount:i.resultsCount,source:i.source,verticalKey:i.verticalConfigId}}i.s(["createVerticalResults",0,C],145166),i.s(["createVerticalSearchResponse",0,function i(r){var n,a,o,s;return{verticalResults:C(r.response),queryId:r.response.queryId,directAnswer:r.response.directAnswer&&x(r.response.directAnswer),searchIntents:r.response.searchIntents,facets:(s=r.response.facets)?s.map(function(i){return{fieldId:i.fieldId,displayName:i.displayName,options:i.options.map(function(i){var r=w(i);return{displayName:i.displayName,count:i.count,selected:i.selected,matcher:r.matcher,value:r.value}})}}):[],spellCheck:r.response.spellCheck&&E(r.response.spellCheck),locationBias:r.response.locationBias&&T(r.response.locationBias),allResultsForVertical:r.response.allResultsForVertical&&i({response:r.response.allResultsForVertical}),alternativeVerticals:null==(a=null==(n=r.response.alternativeVerticals)?void 0:n.modules)?void 0:a.map(C),uuid:null==(o=r.meta)?void 0:o.uuid,queryRulesActionsData:r.response.queryRulesActionsData}}],932626),(a=p||(p={})).PROD="prod",a.SANDBOX="sbx",a.QA="qa",a.DEV="dev",i.s(["Environment",0,p],142377),(o=m||(m={})).US="us",o.EU="eu",(s=g||(g={})).GLOBAL_MULTI="GLOBAL-MULTI",s.GLOBAL_GCP="GLOBAL-GCP";var I=function(){function i(i){this.environment=(null==i?void 0:i.environment)||p.PROD,this.cloudRegion=(null==i?void 0:i.cloudRegion)||m.US,this.cloudChoice=(null==i?void 0:i.cloudChoice)||g.GLOBAL_MULTI}return i.prototype.getDomain=function(){if(this.isInternalTestEnvironment()&&this.cloudRegion===m.US)return"https://liveapi-".concat(this.environment,".yext.com");switch(this.cloudChoice){case g.GLOBAL_GCP:return"https://".concat(this.environment,"-cdn-gcp.").concat(this.cloudRegion,".yextapis.com");case g.GLOBAL_MULTI:default:return"https://".concat(this.environment,"-cdn.").concat(this.cloudRegion,".yextapis.com")}},i.prototype.getCachedDomain=function(){if(this.isInternalTestEnvironment()&&this.cloudRegion===m.US)return"https://liveapi-".concat(this.environment,".yext.com");switch(this.cloudChoice){case g.GLOBAL_GCP:return"https://".concat(this.environment,"-cdn-cached-gcp.").concat(this.cloudRegion,".yextapis.com");case g.GLOBAL_MULTI:default:return"https://".concat(this.environment,"-cdn-cached.").concat(this.cloudRegion,".yextapis.com")}},i.prototype.getEndpoints=function(){return{universalSearch:"".concat(this.getDomain(),"/v2/accounts/me/search/query"),verticalSearch:"".concat(this.getDomain(),"/v2/accounts/me/search/vertical/query"),questionSubmission:"".concat(this.getDomain(),"/v2/accounts/me/createQuestion"),status:"https://answersstatus.pagescdn.com",universalAutocomplete:"".concat(this.getCachedDomain(),"/v2/accounts/me/search/autocomplete"),verticalAutocomplete:"".concat(this.getCachedDomain(),"/v2/accounts/me/search/vertical/autocomplete"),filterSearch:"".concat(this.getDomain(),"/v2/accounts/me/search/filtersearch"),generativeDirectAnswer:"".concat(this.getDomain(),"/v2/accounts/me/search/generateAnswer")}},i.prototype.isInternalTestEnvironment=function(){return this.environment===p.DEV||this.environment===p.QA},i}();
1new I({environment:p.SANDBOX,cloudRegion:m.US,cloudChoice:g.GLOBAL_MULTI}).getEndpoints(),i.s(["EndpointsFactory",0,I,"defaultApiVersion",0,0x1348a5f],698626)},842127,(i,r,n)=>{r.exports={name:"@yext/search-core",version:"2.8.0",description:"Typescript Networking Library for the Yext Search API",main:"./dist/commonjs/src/index.js",module:"./dist/esm/src/index.js",types:"./dist/bundle.d.ts",sideEffects:!1,keywords:["networking","search api","search","browser","nodejs","typescript","commonjs","es6","yext"],files:["dist","legacy","lib","src","THIRD-PARTY-NOTICES"],engines:{node:">=12"},scripts:{test:"npm run lint && jest",lint:"eslint . --max-warnings=0","tsc-cjs":"tsc -p tsconfig.cjs.json","tsc-esm":"tsc -p tsconfig.esm.json",tsc:"npm run tsc-cjs && npm run tsc-esm","build-legacy-bundle":"npx webpack",build:"rm -rf dist/** && npm run tsc && npm run build-legacy-bundle && npm run api-extractor && npm run generate-docs","build-ci":"npm run tsc-cjs && npm run api-extractor && npm run generate-docs",dev:"npm run tsc-esm -- --watch",prepublishOnly:"npm run build","api-extractor":"api-extractor run --local --verbose","generate-docs":"api-documenter markdown --input-folder temp --output-folder docs && rm -rf temp && npm run generate-notices","generate-notices":"generate-license-file --input package.json --output THIRD-PARTY-NOTICES --overwrite"},repository:{type:"git",url:"https://github.com/yext/search-core.git"},author:"[email protected]",license:"BSD-3-Clause",bugs:{url:"https://github.com/yext/search-core/issues"},homepage:"https://github.com/yext/search-core#readme",devDependencies:{"@babel/core":"^7.12.3","@babel/plugin-transform-runtime":"^7.23.2","@babel/preset-env":"^7.23.2","@babel/preset-typescript":"^7.12.1","@microsoft/api-documenter":"^7.13.76","@microsoft/api-extractor":"^7.19.2","@types/jest":"^28.1.1","@typescript-eslint/eslint-plugin":"^5.16.0","@typescript-eslint/parser":"^5.16.0","@yext/eslint-config-slapshot":"^0.4.0","@yext/eslint-plugin-export-star":"^1.0.2","babel-jest":"^28.1.0","babel-loader":"^8.3.0",eslint:"^8.11.0","eslint-config-react-app":"^7.0.1","eslint-plugin-tsdoc":"^0.2.14","generate-license-file":"^4.1.0",jest:"^28.1.0","jest-environment-jsdom":"^28.1.0","ts-loader":"^8.4.0",typescript:"^4.0.3",webpack:"^5.90.0","webpack-cli":"^4.4.0"},dependencies:{"@babel/runtime-corejs3":"^7.12.5","cross-fetch":"^3.1.5"},jest:{bail:0,collectCoverage:!0,collectCoverageFrom:["src/**","!src/models/**/*.ts"],verbose:!0,moduleFileExtensions:["js","ts"],moduleDirectories:["node_modules","<rootDir>"],testEnvironment:"jsdom",testPathIgnorePatterns:["./tests/mocks/*"],testMatch:["<rootDir>/tests/**/*.[jt]s"]}}},734133,(i,r,n)=>{"use strict";r.exports=function(){function i(i,r,n,a,o){return i<r||n<r?i>n?n+1:i+1:a===o?r:r+1}return function(r,n){if(r===n)return 0;if(r.length>n.length){var a,o,s,l,u,c,d,h,f,p,m,g,_=r;r=n,n=_}for(var y=r.length,v=n.length;y>0&&r.charCodeAt(y-1)===n.charCodeAt(v-1);)y--,v--;for(var x=0;x<y&&r.charCodeAt(x)===n.charCodeAt(x);)x++;if(y-=x,v-=x,0===y||v<3)return v;var b=0,w=[];for(a=0;a<y;a++)w.push(a+1),w.push(r.charCodeAt(x+a));for(var T=w.length-1;b<v-3;)for(a=0,f=n.charCodeAt(x+(o=b)),p=n.charCodeAt(x+(s=b+1)),m=n.charCodeAt(x+(l=b+2)),g=n.charCodeAt(x+(u=b+3)),c=b+=4;a<T;a+=2)o=i(d=w[a],o,s,f,h=w[a+1]),s=i(o,s,l,p,h),l=i(s,l,u,m,h),c=i(l,u,c,g,h),w[a]=c,u=l,l=s,s=o,o=d;for(;b<v;)for(a=0,f=n.charCodeAt(x+(o=b)),c=++b;a<T;a+=2)d=w[a],w[a]=c=i(d,o,c,f,w[a+1]),o=d;return c}}()},754014,260693,193637,545815,457623,i=>{"use strict";var r,n,a,o,s,l=i.i(932626),u=i.i(698626),c=i.i(275243),d=i.i(145166),h=i.i(693941),f=i.i(633981),p=i.i(531018);function m(i){return{verticalKey:i.verticalConfigId,errorType:i.errorType,queryDurationMillis:i.queryDurationMillis,details:i.details}}function g(i){var r,n,a,o={};return"object"==typeof(r=i.value)&&r&&("start"in r||"end"in r)?(i.value.start&&(o[i.value.start.matcher]=i.value.start.value),i.value.end&&(o[i.value.end.matcher]=i.value.end.value)):((n={})[i.matcher]=i.value,o=n),(a={})[i.fieldId]=o,a}var _=function(){return(_=Object.assign||function(i){for(var r,n=1,a=arguments.length;n<a;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o]);return i}).apply(this,arguments)},y=i.i(842127),v=function(){return(v=Object.assign||function(i){for(var r,n=1,a=arguments.length;n<a;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o]);return i}).apply(this,arguments)},x=y.default.version;function b(i){var r,n={ANSWERS_CORE:x};return i?Object.entries(null!=(r=i["Client-SDK"])?r:{}).reduce(function(i,r){var n,a=r[0],o=r[1];return o?v(v({},i),((n={})[a]=o,n)):i},n):n}var w=function(){return(w=Object.assign||function(i){for(var r,n=1,a=arguments.length;n<a;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o]);return i}).apply(this,arguments)}
1,T=function(i,r,n,a){return new(n||(n=Promise))(function(o,s){function l(i){try{c(a.next(i))}catch(i){s(i)}}function u(i){try{c(a.throw(i))}catch(i){s(i)}}function c(i){var r;i.done?o(i.value):((r=i.value)instanceof n?r:new n(function(i){i(r)})).then(l,u)}c((a=a.apply(i,r||[])).next())})},E=function(i,r){var n,a,o,s,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(u){return function(c){var d=[u,c];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,d[0]&&(l=0)),l;)try{if(n=1,a&&(o=2&d[0]?a.return:d[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,d[1])).done)return o;switch(a=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return l.label++,{value:d[1],done:!1};case 5:l.label++,a=d[1],d=[0];continue;case 7:d=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===d[0]||2===d[0])){l=0;continue}if(3===d[0]&&(!o||d[1]>o[0]&&d[1]<o[3])){l.label=d[1];break}if(6===d[0]&&l.label<o[1]){l.label=o[1],o=d;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(d);break}o[2]&&l.ops.pop(),l.trys.pop();continue}d=r.call(i,l)}catch(i){d=[6,i],a=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}},S=function(){function i(i,r,n){this.config=i,this.httpService=r,this.apiResponseValidator=n,this.universalSearchEndpoint=i.endpoints.universalSearch,this.verticalSearchEndpoint=i.endpoints.verticalSearch}return i.prototype.universalSearch=function(i){var r,n,a,o;return T(this,void 0,void 0,function(){var s,l,g,_;return E(this,function(y){switch(y.label){case 0:if(s=w(w(w({input:i.query,experienceKey:this.config.experienceKey},"apiKey"in this.config&&{api_key:this.config.apiKey}),{v:u.defaultApiVersion,version:this.config.experienceVersion,limit:JSON.stringify(i.limit),location:this.stringifyLatLong(i.location),locale:this.config.locale,skipSpellCheck:i.skipSpellCheck,session_id:i.sessionId,sessionTrackingEnabled:i.sessionTrackingEnabled,queryTrigger:i.queryTrigger,context:JSON.stringify(i.context),referrerPageUrl:i.referrerPageUrl,source:i.querySource||c.QuerySource.Standard,visitorId:null==(r=this.config.visitor)?void 0:r.id,visitorIdMethod:null==(n=this.config.visitor)?void 0:n.idMethod,restrictVerticals:null==(a=i.restrictVerticals)?void 0:a.join(",")}),null==(o=this.config)?void 0:o.additionalQueryParams),!("token"in this.config))return[3,2];return[4,this.httpService.get(this.universalSearchEndpoint,s,b(i.additionalHttpHeaders),this.config.token)];case 1:return g=y.sent(),[3,4];case 2:return[4,this.httpService.get(this.universalSearchEndpoint,s,b(i.additionalHttpHeaders))];case 3:g=y.sent(),y.label=4;case 4:var v;if(l=g,(_=this.apiResponseValidator.validate(l))instanceof Error)return[2,Promise.reject(_)];return[2,{verticalResults:Array.isArray(l.response.modules)?l.response.modules.map(d.createVerticalResults):[],queryId:l.response.queryId,directAnswer:l.response.directAnswer&&(0,h.createDirectAnswer)(l.response.directAnswer),searchIntents:l.response.searchIntents,spellCheck:l.response.spellCheck&&(0,f.createSpellCheck)(l.response.spellCheck),locationBias:l.response.locationBias&&(0,p.createLocationBias)(l.response.locationBias),uuid:l.meta.uuid,queryRulesActionsData:l.response.queryRulesActionsData,failedVerticals:null==(v=l.response.failedVerticals)?void 0:v.map(m)}]}})})},i.prototype.verticalSearch=function(i){var r,n,a,o,s;return T(this,void 0,void 0,function(){var d,h,f,p;return E(this,function(m){switch(m.label){case 0:if(d=w(w(w({experienceKey:this.config.experienceKey},"apiKey"in this.config&&{api_key:this.config.apiKey}),{v:u.defaultApiVersion,version:this.config.experienceVersion,locale:this.config.locale,input:i.query,location:this.stringifyLatLong(i.location),verticalKey:i.verticalKey,filters:i.staticFilter&&function(i){if("fieldValue"!==i.kind){var r=function i(r,n){for(var a,o=[],s=0;s<n.length;s++){var l=n[s];if("fieldValue"!==l.kind){var u=i(l.combinator,l.filters);u&&o.push(u)}else o.push(g(l))}return 0===o.length?void 0:1===o.length?o[0]:((a={})[r]=o,a)}(i.combinator,i.filters);return r&&JSON.stringify(r)}return JSON.stringify(g(i))}(i.staticFilter),limit:i.limit,offset:i.offset,retrieveFacets:i.retrieveFacets,facetFilters:i.facets&&JSON.stringify(i.facets.reduce(function(i,r){var n,a,o=r.fieldId,s=(n=r.options,a=o,n.map(function(i){return g(_(_({},i),{fieldId:a}))}));return i[o]=s,i},{})),skipSpellCheck:i.skipSpellCheck,queryTrigger:i.queryTrigger,session_id:i.sessionId,sessionTrackingEnabled:i.sessionTrackingEnabled,sortBys:JSON.stringify(i.sortBys||[]),context:JSON.stringify(i.context),referrerPageUrl:i.referrerPageUrl,source:i.querySource||c.QuerySource.Standard,locationRadius:null==(r=i.locationRadius)?void 0:r.toString(),queryId:i.queryId,visitorId:null==(n=this.config.visitor)?void 0:n.id,visitorIdMethod:null==(a=this.config.visitor)?void 0:a.idMethod,facetAllowlist:null==(o=i.facetAllowlist)?void 0:o.join(",")}),null==(s=this.config)?void 0:s.additionalQueryParams),!("token"in this.config))return[3,2];return[4,this.httpService.get(this.verticalSearchEndpoint,d,b(i.additionalHttpHeaders),this.config.token)];case 1:return f=m.sent(),[3,4];case 2:return[4,this.httpService.get(this.verticalSearchEndpoint,d,b(i.additionalHttpHeaders))];case 3:f=m.sent(),m.label=4;case 4:if(h=f,(p=this.apiResponseValidator.validate(h))instanceof Error)return[2,Promise.reject(p)];return[2,(0,l.createVerticalSearchResponse)(h)]}})})},i.prototype.stringifyLatLong=function(i){if(i)return"".concat(i.latitude,",").concat(i.longitude)},i}(),A=function(){return(A=Object.assign||function(i){for(var r,n=1,a=arguments.length;n<a;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o]);return i}).apply(this,arguments)},C=function(i,r){var n,a,o,s,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(u){return function(c){var d=[u,c];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,d[0]&&(l=0)),l;)try{if(n=1,a&&(o=2&d[0]?a.return:d[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,d[1])).done)return o;switch(a=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return l.label++,{value:d[1],done:!1};case 5:l.label++,a=d[1],d=[0];continue;case 7:d=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===d[0]||2===d[0])){l=0;continue}if(3===d[0]&&(!o||d[1]>o[0]&&d[1]<o[3])){l.label=d[1];break}if(6===d[0]&&l.label<o[1]){l.label=o[1],o=d;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(d);break}o[2]&&l.ops.pop(),l.trys.pop();continue}d=r.call(i,l)}catch(i){d=[6,i],a=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}},I=function(){function i(i,r,n){this.config=i,this.httpService=r,this.apiResponseValidator=n,this.endpoint=this.config.endpoints.questionSubmission}return i.prototype.submitQuestion=function(i){var r,n,a,o,s;return n=this,a=void 0,o=void 0,s=function(){var n,a,o,s,l;return C(this,function(c){switch(c.label){case 0:if(n=A(A(A({v:u.defaultApiVersion},"apiKey"in this.config&&{api_key:this.config.apiKey}),{sessionTrackingEnabled:i.sessionTrackingEnabled}),null==(r=this.config)?void 0:r.additionalQueryParams),a={email:i.email,entityId:i.entity
1Id,name:i.name,questionDescription:i.questionDescription,questionLanguage:this.config.locale,questionText:i.questionText,site:"FIRSTPARTY"},!("token"in this.config))return[3,2];return[4,this.httpService.post(this.endpoint,n,a,b(i.additionalHttpHeaders),this.config.token)];case 1:return s=c.sent(),[3,4];case 2:return[4,this.httpService.post(this.endpoint,n,a,b(i.additionalHttpHeaders))];case 3:s=c.sent(),c.label=4;case 4:if(o=s,(l=this.apiResponseValidator.validate(o))instanceof Error)return[2,Promise.reject(l)];return[2,{uuid:o.meta.uuid}]}})},new(o||(o=Promise))(function(i,r){function l(i){try{c(s.next(i))}catch(i){r(i)}}function u(i){try{c(s.throw(i))}catch(i){r(i)}}function c(r){var n;r.done?i(r.value):((n=r.value)instanceof o?n:new o(function(i){i(n)})).then(l,u)}c((s=s.apply(n,a||[])).next())})},i}(),k=i.i(664661);function R(i){return Object.keys(i).forEach(function(r){(void 0===i[r]||null===i[r])&&delete i[r]}),i}var M=function(){return(M=Object.assign||function(i){for(var r,n=1,a=arguments.length;n<a;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o]);return i}).apply(this,arguments)};(r=o||(o={})).GET="get",r.POST="post";var L=function(){function i(){}return i.prototype.get=function(i,r,n,a){return P(i,r,{method:o.GET,mode:"cors",credentials:"include",headers:M({"Client-SDK":O(n)},a&&{Authorization:"Bearer ".concat(a)})}).then(function(i){return i.json()})},i.prototype.post=function(i,r,n,a,s){var l=R(n);return P(i,r,M(M({method:o.POST,body:JSON.stringify(l),mode:"cors"},s&&{credentials:"include"}),{headers:M({"Client-SDK":O(a),"Content-Type":"application/json"},s&&{Authorization:"Bearer ".concat(s)})})).then(function(i){return i.json()})},i}();function P(i,r,n){var a=function(i,r){var n=new URL(i),a=new URLSearchParams(n.search.substring(1)),o=R(r);for(var s in o)a.append(s,o[s].toString());var l=n.origin+n.pathname,u=a.toString();return u&&(l+="?"+u),l}(i,r);return"u">typeof window&&window.fetch?window.fetch(a,n):(0,k.default)(a,n)}function O(i){return Object.keys(i).reduce(function(r,n){var a="".concat(n,"=").concat(i[n]);return r?"".concat(r,", ").concat(a):a},"")}var D=(n=function(i,r){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(i[n]=r[n])})(i,r)},function(i,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function a(){this.constructor=i}n(i,r),i.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}),F=function(i){function r(n,a,o){var s=i.call(this,n)||this;return s.message=n,s.code=a,s.type=o,Object.setPrototypeOf(s,r.prototype),s}return D(r,i),r}(Error),N=i.i(929313),j=i.i(278728),z=i.i(334157);function B(i){var r,n=i.relatedItem?z.ResultsFactory.create([i.relatedItem],N.Source.KnowledgeManager)[0]:i.relatedItem;return{filter:i.filter&&(0,j.createFieldValueFilter)(i),key:i.key,matchedSubstrings:i.matchedSubstrings||[],value:i.value,relatedItem:n,verticalKeys:i.verticalKeys,inputIntents:null!=(r=i.queryIntents)?r:[]}}function U(i){if(!i.response)throw Error("The autocomplete data does not contain a response property");if(!Object.keys(i.response).length)throw Error("The autocomplete response is empty");var r,n,a=i.response,o=a.results.map(B),s=null!=(n=null==(r=a.input)?void 0:r.queryIntents)?n:[];return{results:o,queryId:a.queryId,inputIntents:s||[],uuid:i.meta.uuid}}var V=function(){return(V=Object.assign||function(i){for(var r,n=1,a=arguments.length;n<a;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o]);return i}).apply(this,arguments)},H=function(i,r,n,a){return new(n||(n=Promise))(function(o,s){function l(i){try{c(a.next(i))}catch(i){s(i)}}function u(i){try{c(a.throw(i))}catch(i){s(i)}}function c(i){var r;i.done?o(i.value):((r=i.value)instanceof n?r:new n(function(i){i(r)})).then(l,u)}c((a=a.apply(i,r||[])).next())})},G=function(i,r){var n,a,o,s,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(u){return function(c){var d=[u,c];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,d[0]&&(l=0)),l;)try{if(n=1,a&&(o=2&d[0]?a.return:d[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,d[1])).done)return o;switch(a=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return l.label++,{value:d[1],done:!1};case 5:l.label++,a=d[1],d=[0];continue;case 7:d=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===d[0]||2===d[0])){l=0;continue}if(3===d[0]&&(!o||d[1]>o[0]&&d[1]<o[3])){l.label=d[1];break}if(6===d[0]&&l.label<o[1]){l.label=o[1],o=d;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(d);break}o[2]&&l.ops.pop(),l.trys.pop();continue}d=r.call(i,l)}catch(i){d=[6,i],a=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}},q=function(){function i(i,r,n){this.config=i,this.httpService=r,this.apiResponseValidator=n,this.universalEndpoint=this.config.endpoints.universalAutocomplete,this.verticalEndpoint=this.config.endpoints.verticalAutocomplete,this.filterEndpoint=this.config.endpoints.filterSearch}return i.prototype.universalAutocomplete=function(i){var r,n,a;return H(this,void 0,void 0,function(){var o,s,l,c;return G(this,function(d){switch(d.label){case 0:if(o=V(V(V({input:i.input,experienceKey:this.config.experienceKey},"apiKey"in this.config&&{api_key:this.config.apiKey}),{v:u.defaultApiVersion,version:this.config.experienceVersion,locale:this.config.locale,sessionTrackingEnabled:i.sessionTrackingEnabled,visitorId:null==(r=this.config.visitor)?void 0:r.id,visitorIdMethod:null==(n=this.config.visitor)?void 0:n.idMethod,limit:i.limit}),null==(a=this.config)?void 0:a.additionalQueryParams),!("token"in this.config))return[3,2];return[4,this.httpService.get(this.universalEndpoint,o,b(i.additionalHttpHeaders),this.config.token)];case 1:return l=d.sent(),[3,4];case 2:return[4,this.httpService.get(this.universalEndpoint,o,b(i.additionalHttpHeaders))];case 3:l=d.sent(),d.label=4;case 4:if(s=l,(c=this.apiResponseValidator.validate(s))instanceof Error)return[2,Promise.reject(c)];return[2,U(s)]}})})},i.prototype.verticalAutocomplete=function(i){var r,n,a;return H(this,void 0,void 0,function(){var o,s,l,c;return G(this,function(d){switch(d.label){case 0:if(o=V(V(V({input:i.input,experienceKey:this.config.experienceKey},"apiKey"in this.config&&{api_key:this.config.apiKey}),{v:u.defaultApiVersion,version:this.config.experienceVersion,locale:this.config.locale,verticalKey:i.verticalKey,sessionTrackingEnabled:i.sessionTrackingEnabled,visitorId:null==(r=this.config.visitor)?void 0:r.id,visitorIdMethod:null==(n=this.config.visitor)?void 0:n.idMethod,limit:i.limit}),null==(a=this.config)?void 0:a.additionalQueryParams),!("token"in this.config))return[3,2];return[4,this.httpService.get(this.verticalEndpoint,o,b(i.additionalHttpHeaders),this.config.token)];case 1:return l=d.sent(),[3,4];case 2:return[4,this.httpService.get(this.verticalEndpoint,o,b(i.additionalHttpHeaders))];case 3:l=d.sent(),d.label=4;case 4:if(s=l,(c=this.apiResponseValidator.validate(s))instanceof Error)return[2,Promise.reject(c)];return[2,U(s)]}})})},i.prototype.filterSearch=function(i){var r,n,a;return H(this,void 0,void 0,function(){var o,s,l,c,d;return G(this,function(h){switch(h.label){case 0:var f;if(o={sectioned:i.sectioned,fields:i.fields.map(function(i){return{fieldId:i.fieldApiName,entityTypeId:i.entityType,shouldFetchEntities:i.fetchEntities}})},s=V(V(V({input:i.input,experienceKey:this.config.experienceKey},"apiKey"in this.config&&{api_key:this.config.apiKey}),{v:u.defaultApiVersion,version:this.config.experienceVersion,locale:this.config.locale,search_parameters:JSON.stringify(o),verticalKey:i.verticalKey,sessionTrackingEnabled:i.sessionTrackingEnabled,visitorId:null==(r=this.config.visitor)?void 0:r.id,visitorIdMethod:null==(n=this.config.visitor)?void 0:n.idMethod,excluded:JSON.stringify(null==(f=i.excluded)?void 0:f.map(function(i){var r,n,a=i.fieldId,o=i.matcher,s=i.value;return(r={})[a]=((n={})[o]=s,n),r}))}),null==(a=this.config)?void 0:a.additionalQueryParams),!("token"in this.config))return[3,2];return[4,this.httpService.get(this.filterEndpoint,s,b(i.additionalHttpHeaders),this.config.token)];case 1:return c=h.sent(),[3,4];case 2:return[4,this.httpService.get(this.filterEndpoint,s,b(i.additionalHttpHeaders))];case 3:c=h.sent(),h.label=4;case 4:if(l=c,(d=this.apiResponseValidator.validate(l))instanceof Error)return[2,Promise.reject(d)];return[2,function(i){if(!i.response)throw Error("The autocomplete data does not contain a response property");if(!Object.keys(i.response).length)throw Error("The autocomplete response is empty");var r=i.response;if(r.failedVerticals&&0!=r.failedVerticals.length){var n=r.failedVerticals[0];throw new F(n.details.description,n.details.responseCode,n.errorType)}return{sections:r.sections.map(function(i){return{label:i.label,results:i.results.map(B)}}),queryId:r.queryId,businessId:r.businessId,uuid:i.meta.uuid}}(l)]}})})},i}(),$=function(){function i(){}return i.prototype.validate=function(i){return[this.validateResponseProp,this.validateMetaProp,this.checkForApiErrors].map(function(r){return r(i)}).find(function(i){return i})},i.prototype.validateResponseProp=function(i){if(!i.response)return new F("Malformed Search API response: missing response property.")},i.prototype.validateMetaProp=function(i){if(!i.meta)return new F("Malformed Search API response: missing meta property.")},i.prototype.checkForApiErrors=function(i){var r,n;if((null==(n=null==(r=i.meta)?void 0:r.errors)?void 0:n.length)>=1){var a=i.meta.errors[0];
1return new F(a.message,a.code,a.type)}},i}(),W=function(){function i(i,r,n,a){this.searchService=i,this.questionSubmissionService=r,this.autoCompleteService=n,this.generativeDirectAnswerService=a}return i.prototype.universalSearch=function(i){return this.searchService.universalSearch(i)},i.prototype.verticalSearch=function(i){return this.searchService.verticalSearch(i)},i.prototype.submitQuestion=function(i){return this.questionSubmissionService.submitQuestion(i)},i.prototype.universalAutocomplete=function(i){return this.autoCompleteService.universalAutocomplete(i)},i.prototype.verticalAutocomplete=function(i){return this.autoCompleteService.verticalAutocomplete(i)},i.prototype.filterSearch=function(i){return this.autoCompleteService.filterSearch(i)},i.prototype.generativeDirectAnswer=function(i){return this.generativeDirectAnswerService.generateAnswer(i)},i}(),Y=function(){return(Y=Object.assign||function(i){for(var r,n=1,a=arguments.length;n<a;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o]);return i}).apply(this,arguments)},Z=function(i,r){var n,a,o,s,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(u){return function(c){var d=[u,c];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,d[0]&&(l=0)),l;)try{if(n=1,a&&(o=2&d[0]?a.return:d[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,d[1])).done)return o;switch(a=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return l.label++,{value:d[1],done:!1};case 5:l.label++,a=d[1],d=[0];continue;case 7:d=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===d[0]||2===d[0])){l=0;continue}if(3===d[0]&&(!o||d[1]>o[0]&&d[1]<o[3])){l.label=d[1];break}if(6===d[0]&&l.label<o[1]){l.label=o[1],o=d;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(d);break}o[2]&&l.ops.pop(),l.trys.pop();continue}d=r.call(i,l)}catch(i){d=[6,i],a=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}},K=function(){function i(i,r,n){this.config=i,this.httpService=r,this.apiResponseValidator=n,this.endpoint=this.config.endpoints.generativeDirectAnswer}return i.prototype.generateAnswer=function(i){var r,n,a,o,s,l,c;return o=this,s=void 0,l=void 0,c=function(){var o,s,l,c,d,h;return Z(this,function(f){switch(f.label){case 0:if(o=Y(Y(Y({experienceKey:this.config.experienceKey},"apiKey"in this.config&&{api_key:this.config.apiKey}),{v:u.defaultApiVersion,version:this.config.experienceVersion,locale:this.config.locale,visitorId:null==(r=this.config.visitor)?void 0:r.id,visitorIdMethod:null==(n=this.config.visitor)?void 0:n.idMethod}),null==(a=this.config)?void 0:a.additionalQueryParams),s={},1===i.results.length?s=i.results[0]:i.results.length>1&&(s={verticals:i.results}),l={searchId:i.searchId,searchTerm:i.searchTerm,results:s},!("token"in this.config))return[3,2];return[4,this.httpService.post(this.endpoint,o,l,b(i.additionalHttpHeaders),this.config.token)];case 1:return d=f.sent(),[3,4];case 2:return[4,this.httpService.post(this.endpoint,o,l,b(i.additionalHttpHeaders))];case 3:d=f.sent(),f.label=4;case 4:if(c=d,(h=this.apiResponseValidator.validate(c))instanceof Error)return[2,Promise.reject(h)];return[2,{directAnswer:c.response.directAnswer,resultStatus:c.response.resultStatus,citations:c.response.citations}]}})},new(l||(l=Promise))(function(i,r){function n(i){try{u(c.next(i))}catch(i){r(i)}}function a(i){try{u(c.throw(i))}catch(i){r(i)}}function u(r){var o;r.done?i(r.value):((o=r.value)instanceof l?o:new l(function(i){i(o)})).then(n,a)}u((c=c.apply(o,s||[])).next())})},i}(),X=function(){return(X=Object.assign||function(i){for(var r,n=1,a=arguments.length;n<a;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o]);return i}).apply(this,arguments)};i.s(["provideCore",0,function(i){if("apiKey"in i&&"token"in i)throw Error("Both apiKey and token are present. Only one authentication method should be provided");var r=X(X({},i),{endpoints:X(X({},new u.EndpointsFactory(i).getEndpoints()),i.endpoints)}),n=new L,a=new $;return new W(new S(r,n,a),new I(r,n,a),new q(r,n,a),new K(r,n,a))}],754014);class Q{constructor(){this.latestRequestIds={universalQuery:0,verticalQuery:0,generativeDirectAnswer:0},this.latestResponseIds={universalQuery:0,verticalQuery:0,generativeDirectAnswer:0}}updateRequestId(i){return++this.latestRequestIds[i]}setResponseId(i,r){this.latestResponseIds[i]=r}getLatestResponseId(i){return this.latestResponseIds[i]}processRequestId(i,r){return r>this.getLatestResponseId(i)&&(this.setResponseId(i,r),!0)}}i.s(["default",()=>Q],260693);class J{constructor(i,r,n){this.store=i,this.headlessId=r,n.addAnswersReducer(this.headlessId),i.replaceReducer(n.getParentReducer())}getState(){return this.store.getState()[this.headlessId]}
1dispatchEvent(i,r){let n="set-state"===i?"set-state":this.headlessId+"/"+i;this.store.dispatch({type:n,payload:r,headlessId:this.headlessId})}addListener(i){let r=i.valueAccessor(this.getState());return this.store.subscribe(()=>{let n=i.valueAccessor(this.getState());n!==r&&(r=n,i.callback(n))})}}i.s(["default",()=>J],193637);var ee=i.i(734133);function et(i,r){var n,a;return n=i.toLowerCase(),a=r.toLowerCase(),!!n.includes(a)||!(a.length<3)&&1>=function(i,r){let n=[];for(let a=0;a<=i.length-r.length;a++)n.push(i.substr(a,r.length));let a=r.length;for(let i of n){let n=(0,ee.default)(i,r);n<a&&(a=n)}return a}(n,a)}function ei(i){return 1===i.length?i[0]:{kind:"disjunction",combinator:s.OR,filters:i}}i.s(["isCloseMatch",0,et,"searchThroughFacet",0,function(i,r){return Object.assign(Object.assign({},i),{options:i.options.filter(i=>et(i.displayName,r))})}],545815),(a=s||(s={})).AND="$and",a.OR="$or",i.s(["transformFiltersToCoreFormat",0,function(i){if(!i)return null;let r=i.filter(i=>i.selected).map(i=>i.filter);if(0===r.length)return null;if(1===r.length)return r[0];let n=[],a=Object.values(r.reduce((i,r)=>("fieldValue"!==r.kind?n.push(r):i[r.fieldId]?i[r.fieldId].push(r):i[r.fieldId]=[r],i),{}));return 1===a.length&&0===n.length?ei(a[0]):{kind:"conjunction",combinator:s.AND,filters:a.map(i=>ei(i)).concat(n)}}],457623)},631302,(i,r,n)=>{r.exports=function(){this.__data__=[],this.size=0}},459284,(i,r,n)=>{r.exports=function(i,r){return i===r||i!=i&&r!=r}},749153,(i,r,n)=>{var a=i.r(459284);r.exports=function(i,r){for(var n=i.length;n--;)if(a(i[n][0],r))return n;return -1}},6279,(i,r,n)=>{var a=i.r(749153),o=Array.prototype.splice;r.exports=function(i){var r=this.__data__,n=a(r,i);return!(n<0)&&(n==r.length-1?r.pop():o.call(r,n,1),--this.size,!0)}},96955,(i,r,n)=>{var a=i.r(749153);r.exports=function(i){var r=this.__data__,n=a(r,i);return n<0?void 0:r[n][1]}},312032,(i,r,n)=>{var a=i.r(749153);r.exports=function(i){return a(this.__data__,i)>-1}},81551,(i,r,n)=>{var a=i.r(749153);r.exports=function(i,r){var n=this.__data__,o=a(n,i);return o<0?(++this.size,n.push([i,r])):n[o][1]=r,this}},904261,(i,r,n)=>{var a=i.r(631302),o=i.r(6279),s=i.r(96955),l=i.r(312032),u=i.r(81551);function c(i){var r=-1,n=null==i?0:i.length;for(this.clear();++r<n;){var a=i[r];this.set(a[0],a[1])}}c.prototype.clear=a,c.prototype.delete=o,c.prototype.get=s,c.prototype.has=l,c.prototype.set=u,r.exports=c},177660,(i,r,n)=>{var a=i.r(904261);r.exports=function(){this.__data__=new a,this.size=0}},24181,(i,r,n)=>{r.exports=function(i){var r=this.__data__,n=r.delete(i);return this.size=r.size,n}},851870,(i,r,n)=>{r.exports=function(i){return this.__data__.get(i)}},738024,(i,r,n)=>{r.exports=function(i){return this.__data__.has(i)}},690679,(i,r,n)=>{r.exports=i.g&&i.g.Object===Object&&i.g},451217,(i,r,n)=>{var a=i.r(690679),o="object"==typeof self&&self&&self.Object===Object&&self;r.exports=a||o||Function("return this")()},908362,(i,r,n)=>{r.exports=i.r(451217).Symbol},139258,(i,r,n)=>{var a=i.r(908362),o=Object.prototype,s=o.hasOwnProperty,l=o.toString,u=a?a.toStringTag:void 0;r.exports=function(i){var r=s.call(i,u),n=i[u];try{i[u]=void 0;var a=!0}catch(i){}var o=l.call(i);return a&&(r?i[u]=n:delete i[u]),o}},239105,(i,r,n)=>{var a=Object.prototype.toString;r.exports=function(i){return a.call(i)}},202944,(i,r,n)=>{var a=i.r(908362),o=i.r(139258),s=i.r(239105),l=a?a.toStringTag:void 0;r.exports=function(i){return null==i?void 0===i?"[object Undefined]":"[object Null]":l&&l in Object(i)?o(i):s(i)}},467052,(i,r,n)=>{r.exports=function(i){var r=typeof i;return null!=i&&("object"==r||"function"==r)}},318500,(i,r,n)=>{var a=i.r(202944),o=i.r(467052);r.exports=function(i){if(!o(i))return!1;var r=a(i);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}},628840,(i,r,n)=>{r.exports=i.r(451217)["__core-js_shared__"]},634837,(i,r,n)=>{var a,o=i.r(628840),s=(a=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+a:"";r.exports=function(i){return!!s&&s in i}},114061,(i,r,n)=>{var a=Function.prototype.toString;r.exports=function(i){if(null!=i){try{return a.call(i)}catch(i){}try{return i+""}catch(i){}}return""}},674583,(i,r,n)=>{var a=i.r(318500),o=i.r(634837),s=i.r(467052),l=i.r(114061),u=/^\[object .+?Constructor\]$/,c=Object.prototype,d=Function.prototype.toString,h=c.hasOwnProperty,f=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");r.exports=function(i){return!(!s(i)||o(i))&&(a(i)?f:u).test(l(i))}},39501,(i,r,n)=>{r.exports=function(i,r){return null==i?void 0:i[r]}},630706,(i,r,n)=>{var a=i.r(674583),o=i.r(39501);r.exports=function(i,r){var n=o(i,r);return a(n)?n:void 0}},433400,(i,r,n)=>{r.exports=i.r(630706)(i.r(451217),"Map")},367437,(i,r,n)=>{r.exports=i.r(630706)(Object,"create")},723460,(i,r,n)=>{var a=i.r(367437);r.exports=function(){this.__data__=a?a(null):{},this.size=0}},824047,(i,r,n)=>{r.exports=function(i){var r=this.has(i)&&delete this.__data__[i];return this.size-=!!r,r}},601029,(i,r,n)=>{var a=i.r(367437),o=Object.prototype.hasOwnProperty;
1r.exports=function(i){var r=this.__data__;if(a){var n=r[i];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(r,i)?r[i]:void 0}},242829,(i,r,n)=>{var a=i.r(367437),o=Object.prototype.hasOwnProperty;r.exports=function(i){var r=this.__data__;return a?void 0!==r[i]:o.call(r,i)}},574903,(i,r,n)=>{var a=i.r(367437);r.exports=function(i,r){var n=this.__data__;return this.size+=+!this.has(i),n[i]=a&&void 0===r?"__lodash_hash_undefined__":r,this}},572027,(i,r,n)=>{var a=i.r(723460),o=i.r(824047),s=i.r(601029),l=i.r(242829),u=i.r(574903);function c(i){var r=-1,n=null==i?0:i.length;for(this.clear();++r<n;){var a=i[r];this.set(a[0],a[1])}}c.prototype.clear=a,c.prototype.delete=o,c.prototype.get=s,c.prototype.has=l,c.prototype.set=u,r.exports=c},615617,(i,r,n)=>{var a=i.r(572027),o=i.r(904261),s=i.r(433400);r.exports=function(){this.size=0,this.__data__={hash:new a,map:new(s||o),string:new a}}},183169,(i,r,n)=>{r.exports=function(i){var r=typeof i;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==i:null===i}},682635,(i,r,n)=>{var a=i.r(183169);r.exports=function(i,r){var n=i.__data__;return a(r)?n["string"==typeof r?"string":"hash"]:n.map}},475459,(i,r,n)=>{var a=i.r(682635);r.exports=function(i){var r=a(this,i).delete(i);return this.size-=!!r,r}},438651,(i,r,n)=>{var a=i.r(682635);r.exports=function(i){return a(this,i).get(i)}},238613,(i,r,n)=>{var a=i.r(682635);r.exports=function(i){return a(this,i).has(i)}},556989,(i,r,n)=>{var a=i.r(682635);r.exports=function(i,r){var n=a(this,i),o=n.size;return n.set(i,r),this.size+=+(n.size!=o),this}},881583,(i,r,n)=>{var a=i.r(615617),o=i.r(475459),s=i.r(438651),l=i.r(238613),u=i.r(556989);function c(i){var r=-1,n=null==i?0:i.length;for(this.clear();++r<n;){var a=i[r];this.set(a[0],a[1])}}c.prototype.clear=a,c.prototype.delete=o,c.prototype.get=s,c.prototype.has=l,c.prototype.set=u,r.exports=c},205439,(i,r,n)=>{var a=i.r(904261),o=i.r(433400),s=i.r(881583);r.exports=function(i,r){var n=this.__data__;if(n instanceof a){var l=n.__data__;if(!o||l.length<199)return l.push([i,r]),this.size=++n.size,this;n=this.__data__=new s(l)}return n.set(i,r),this.size=n.size,this}},27742,(i,r,n)=>{var a=i.r(904261),o=i.r(177660),s=i.r(24181),l=i.r(851870),u=i.r(738024),c=i.r(205439);function d(i){var r=this.__data__=new a(i);this.size=r.size}d.prototype.clear=o,d.prototype.delete=s,d.prototype.get=l,d.prototype.has=u,d.prototype.set=c,r.exports=d},850220,(i,r,n)=>{r.exports=function(i){return this.__data__.set(i,"__lodash_hash_undefined__"),this}},582090,(i,r,n)=>{r.exports=function(i){return this.__data__.has(i)}},743141,(i,r,n)=>{var a=i.r(881583),o=i.r(850220),s=i.r(582090);function l(i){var r=-1,n=null==i?0:i.length;for(this.__data__=new a;++r<n;)this.add(i[r])}l.prototype.add=l.prototype.push=o,l.prototype.has=s,r.exports=l},257e3,(i,r,n)=>{r.exports=function(i,r){for(var n=-1,a=null==i?0:i.length;++n<a;)if(r(i[n],n,i))return!0;return!1}},845896,(i,r,n)=>{r.exports=function(i,r){return i.has(r)}},417512,(i,r,n)=>{var a=i.r(743141),o=i.r(257e3),s=i.r(845896);r.exports=function(i,r,n,l,u,c){var d=1&n,h=i.length,f=r.length;if(h!=f&&!(d&&f>h))return!1;var p=c.get(i),m=c.get(r);if(p&&m)return p==r&&m==i;var g=-1,_=!0,y=2&n?new a:void 0;for(c.set(i,r),c.set(r,i);++g<h;){var v=i[g],x=r[g];if(l)var b=d?l(x,v,g,r,i,c):l(v,x,g,i,r,c);if(void 0!==b){if(b)continue;_=!1;break}if(y){if(!o(r,function(i,r){if(!s(y,r)&&(v===i||u(v,i,n,l,c)))return y.push(r)})){_=!1;break}}else if(!(v===x||u(v,x,n,l,c))){_=!1;break}}return c.delete(i),c.delete(r),_}},713966,(i,r,n)=>{r.exports=i.r(451217).Uint8Array},957768,(i,r,n)=>{r.exports=function(i){var r=-1,n=Array(i.size);return i.forEach(function(i,a){n[++r]=[a,i]}),n}},254264,(i,r,n)=>{r.exports=function(i){var r=-1,n=Array(i.size);return i.forEach(function(i){n[++r]=i}),n}},818588,(i,r,n)=>{var a=i.r(908362),o=i.r(713966),s=i.r(459284),l=i.r(417512),u=i.r(957768),c=i.r(254264),d=a?a.prototype:void 0,h=d?d.valueOf:void 0;r.exports=function(i,r,n,a,d,f,p){switch(n){case"[object DataView]":if(i.byteLength!=r.byteLength||i.byteOffset!=r.byteOffset)break;i=i.buffer,r=r.buffer;case"[object ArrayBuffer]":if(i.byteLength!=r.byteLength||!f(new o(i),new o(r)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return s(+i,+r);case"[object Error]":return i.name==r.name&&i.message==r.message;case"[object RegExp]":case"[object String]":return i==r+"";case"[object Map]":var m=u;case"[object Set]":var g=1&a;if(m||(m=c),i.size!=r.size&&!g)break;var _=p.get(i);if(_)return _==r;a|=2,p.set(i,r);var y=l(m(i),m(r),a,d,f,p);return p.delete(i),y;case"[object Symbol]":if(h)return h.call(i)==h.call(r)}return!1}},1410,(i,r,n)=>{r.exports=function(i,r){for(var n=-1,a=r.length,o=i.length;++n<a;)i[o+n]=r[n];return i}},407734,(i,r,n)=>{r.exports=Array.isArray},361714,(i,r,n)=>{var a=i.r(1410),o=i.r(407734);r.exports=function(i,r,n){var s=r(i);return o(i)?s:a(s,n(i))}},800282,(i,r,n)=>{r.exports=function(i,r){for(var n=-1,a=null==i?0:i.length,o=0,s=[];++n<a;){var l=i[n];r(l,n,i)&&(s[o++]=l)}return s}},309581,(i,r,n)=>{r.exports=function(){return[]}},933809,(i,r,n)=>{var a=i.r(800282),o=i.r(309581),s=Object.prototype.propertyIsEnumerable,l=Object.getOwnPropertySymbols;
1r.exports=l?function(i){return null==i?[]:a(l(i=Object(i)),function(r){return s.call(i,r)})}:o},908392,(i,r,n)=>{r.exports=function(i,r){for(var n=-1,a=Array(i);++n<i;)a[n]=r(n);return a}},598267,(i,r,n)=>{r.exports=function(i){return null!=i&&"object"==typeof i}},137986,(i,r,n)=>{var a=i.r(202944),o=i.r(598267);r.exports=function(i){return o(i)&&"[object Arguments]"==a(i)}},126088,(i,r,n)=>{var a=i.r(137986),o=i.r(598267),s=Object.prototype,l=s.hasOwnProperty,u=s.propertyIsEnumerable;r.exports=a(function(){return arguments}())?a:function(i){return o(i)&&l.call(i,"callee")&&!u.call(i,"callee")}},336548,(i,r,n)=>{r.exports=function(){return!1}},347485,(i,r,n)=>{var a=i.r(451217),o=i.r(336548),s=n&&!n.nodeType&&n,l=s&&r&&!r.nodeType&&r,u=l&&l.exports===s?a.Buffer:void 0;r.exports=(u?u.isBuffer:void 0)||o},45911,(i,r,n)=>{var a=/^(?:0|[1-9]\d*)$/;r.exports=function(i,r){var n=typeof i;return!!(r=null==r?0x1fffffffffffff:r)&&("number"==n||"symbol"!=n&&a.test(i))&&i>-1&&i%1==0&&i<r}},653737,(i,r,n)=>{r.exports=function(i){return"number"==typeof i&&i>-1&&i%1==0&&i<=0x1fffffffffffff}},478262,(i,r,n)=>{var a=i.r(202944),o=i.r(653737),s=i.r(598267),l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l["[object Arguments]"]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l["[object Function]"]=l["[object Map]"]=l["[object Number]"]=l["[object Object]"]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1,r.exports=function(i){return s(i)&&o(i.length)&&!!l[a(i)]}},171710,(i,r,n)=>{r.exports=function(i){return function(r){return i(r)}}},705399,(i,r,n)=>{var a=i.r(690679),o=n&&!n.nodeType&&n,s=o&&r&&!r.nodeType&&r,l=s&&s.exports===o&&a.process;r.exports=function(){try{var i=s&&s.require&&s.require("util").types;if(i)return i;return l&&l.binding&&l.binding("util")}catch(i){}}()},726870,(i,r,n)=>{var a=i.r(478262),o=i.r(171710),s=i.r(705399),l=s&&s.isTypedArray;r.exports=l?o(l):a},497881,(i,r,n)=>{var a=i.r(908392),o=i.r(126088),s=i.r(407734),l=i.r(347485),u=i.r(45911),c=i.r(726870),d=Object.prototype.hasOwnProperty;r.exports=function(i,r){var n=s(i),h=!n&&o(i),f=!n&&!h&&l(i),p=!n&&!h&&!f&&c(i),m=n||h||f||p,g=m?a(i.length,String):[],_=g.length;for(var y in i)(r||d.call(i,y))&&!(m&&("length"==y||f&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||u(y,_)))&&g.push(y);return g}},299545,(i,r,n)=>{var a=Object.prototype;r.exports=function(i){var r=i&&i.constructor;return i===("function"==typeof r&&r.prototype||a)}},218762,(i,r,n)=>{r.exports=function(i,r){return function(n){return i(r(n))}}},572574,(i,r,n)=>{r.exports=i.r(218762)(Object.keys,Object)},896703,(i,r,n)=>{var a=i.r(299545),o=i.r(572574),s=Object.prototype.hasOwnProperty;r.exports=function(i){if(!a(i))return o(i);var r=[];for(var n in Object(i))s.call(i,n)&&"constructor"!=n&&r.push(n);return r}},355041,(i,r,n)=>{var a=i.r(318500),o=i.r(653737);r.exports=function(i){return null!=i&&o(i.length)&&!a(i)}},171659,(i,r,n)=>{var a=i.r(497881),o=i.r(896703),s=i.r(355041);r.exports=function(i){return s(i)?a(i):o(i)}},395586,(i,r,n)=>{var a=i.r(361714),o=i.r(933809),s=i.r(171659);r.exports=function(i){return a(i,s,o)}},760140,(i,r,n)=>{var a=i.r(395586),o=Object.prototype.hasOwnProperty;r.exports=function(i,r,n,s,l,u){var c=1&n,d=a(i),h=d.length;if(h!=a(r).length&&!c)return!1;for(var f=h;f--;){var p=d[f];if(!(c?p in r:o.call(r,p)))return!1}var m=u.get(i),g=u.get(r);if(m&&g)return m==r&&g==i;var _=!0;u.set(i,r),u.set(r,i);for(var y=c;++f<h;){var v=i[p=d[f]],x=r[p];if(s)var b=c?s(x,v,p,r,i,u):s(v,x,p,i,r,u);if(!(void 0===b?v===x||l(v,x,n,s,u):b)){_=!1;break}y||(y="constructor"==p)}if(_&&!y){var w=i.constructor,T=r.constructor;w!=T&&"constructor"in i&&"constructor"in r&&!("function"==typeof w&&w instanceof w&&"function"==typeof T&&T instanceof T)&&(_=!1)}return u.delete(i),u.delete(r),_}},956095,(i,r,n)=>{r.exports=i.r(630706)(i.r(451217),"DataView")},229976,(i,r,n)=>{r.exports=i.r(630706)(i.r(451217),"Promise")},874681,(i,r,n)=>{r.exports=i.r(630706)(i.r(451217),"Set")},626465,(i,r,n)=>{r.exports=i.r(630706)(i.r(451217),"WeakMap")},363985,(i,r,n)=>{var a=i.r(956095),o=i.r(433400),s=i.r(229976),l=i.r(874681),u=i.r(626465),c=i.r(202944),d=i.r(114061),h="[object Map]",f="[object Promise]",p="[object Set]",m="[object WeakMap]",g="[object DataView]",_=d(a),y=d(o),v=d(s),x=d(l),b=d(u),w=c;(a&&w(new a(new ArrayBuffer(1)))!=g||o&&w(new o)!=h||s&&w(s.resolve())!=f||l&&w(new l)!=p||u&&w(new u)!=m)&&(w=function(i){var r=c(i),n="[object Object]"==r?i.constructor:void 0,a=n?d(n):"";if(a)switch(a){case _:return g;case y:return h;case v:return f;case x:return p;case b:return m}return r}),r.exports=w},261867,(i,r,n)=>{var a=i.r(27742),o=i.r(417512),s=i.r(818588),l=i.r(760140),u=i.r(363985),c=i.r(407734),d=i.r(347485),h=i.r(726870),f="[object Arguments]",p="[object Array]",m="[object Object]",g=Object.prototype.hasOwnProperty;
1r.exports=function(i,r,n,_,y,v){var x=c(i),b=c(r),w=x?p:u(i),T=b?p:u(r);w=w==f?m:w,T=T==f?m:T;var E=w==m,S=T==m,A=w==T;if(A&&d(i)){if(!d(r))return!1;x=!0,E=!1}if(A&&!E)return v||(v=new a),x||h(i)?o(i,r,n,_,y,v):s(i,r,w,n,_,y,v);if(!(1&n)){var C=E&&g.call(i,"__wrapped__"),I=S&&g.call(r,"__wrapped__");if(C||I){var k=C?i.value():i,R=I?r.value():r;return v||(v=new a),y(k,R,n,_,v)}}return!!A&&(v||(v=new a),l(i,r,n,_,y,v))}},858254,(i,r,n)=>{var a=i.r(261867),o=i.r(598267);r.exports=function i(r,n,s,l,u){return r===n||(null!=r&&null!=n&&(o(r)||o(n))?a(r,n,s,l,i,u):r!=r&&n!=n)}},529594,(i,r,n)=>{var a=i.r(858254);r.exports=function(i,r){return a(i,r)}},352635,(i,r,n)=>{r.exports={name:"@yext/search-headless",version:"2.8.1",description:"A library for powering UI components for Yext Search integrations",author:"[email protected]",license:"BSD-3-Clause",main:"./dist/commonjs/src/index.js",module:"./dist/esm/src/index.js",keywords:["search","yext","redux","state management"],files:["dist","lib","src","THIRD-PARTY-NOTICES"],scripts:{build:"rm -rf dist/** && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && npm run api-extractor && npm run generate-docs",lint:"eslint .",prepublishOnly:"npm run build",test:"jest","api-extractor":"api-extractor run --local --verbose","generate-docs":"api-documenter markdown --input-folder temp --output-folder docs && rm -rf temp","generate-notices":"generate-license-file --input package.json --output THIRD-PARTY-NOTICES --overwrite"},dependencies:{"@reduxjs/toolkit":"^1.8.1","@yext/search-core":"^2.8.0","js-levenshtein":"^1.1.6",lodash:"^4.17.21"},devDependencies:{"@babel/preset-env":"^7.23.2","@babel/preset-typescript":"^7.16.5","@microsoft/api-documenter":"^7.13.76","@microsoft/api-extractor":"^7.19.2","@types/jest":"^28.1.1","@types/lodash":"^4.14.178","@types/node":"^16.11.12","@typescript-eslint/eslint-plugin":"^5.16.0","@typescript-eslint/parser":"^5.16.0","@yext/eslint-config-slapshot":"^0.4.0","@yext/eslint-plugin-export-star":"^1.0.0","babel-jest":"^27.4.5",eslint:"^8.11.0","eslint-config-react-app":"^7.0.1","eslint-plugin-tsdoc":"^0.2.14","generate-license-file":"^1.3.0",jest:"^28.1.0","ts-node":"^10.4.0",typescript:"^4.5.4"},jest:{bail:0,verbose:!0,collectCoverage:!0,collectCoverageFrom:["src/**/*.ts","!src/models/**/*.ts"],moduleFileExtensions:["js","ts"],moduleDirectories:["node_modules","<rootDir>"],testMatch:["<rootDir>/tests/**/*.[jt]s"],testPathIgnorePatterns:["<rootDir>/tests/mocks/*","<rootDir>/tests/utils/*","<rootDir>/test-site-node/*"]},overrides:{"@babel/helper-define-polyfill-provider":"^0.4.3","@babel/plugin-transform-runtime":"^7.23.2","babel-plugin-polyfill-regenerator":"^0.5.3","babel-plugin-polyfill-corejs2":"^0.4.6","language-subtag-registry":"^0.3.23"},repository:{type:"git",url:"https://github.com/yext/search-headless.git"}}},956028,117243,i=>{"use strict";let r;var n,a=i.i(2317),o=i.i(95605),s=i.i(754014),l=i.i(260693),u=i.i(193637),c=i.i(545815),d=i.i(457623),h=i.i(565072);function f(i){for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];throw Error("[Immer] minified error nr: "+i+(n.length?" "+n.map(function(i){return"'"+i+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function p(i){return!!i&&!!i[Q]}function m(i){var r;return!!i&&(function(i){if(!i||"object"!=typeof i)return!1;var r=Object.getPrototypeOf(i);if(null===r)return!0;var n=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===J}(i)||Array.isArray(i)||!!i[X]||!!(null==(r=i.constructor)?void 0:r[X])||b(i)||w(i))}function g(i,r,n){void 0===n&&(n=!1),0===_(i)?(n?Object.keys:ee)(i).forEac
1h(function(a){n&&"symbol"==typeof a||r(a,i[a],i)}):i.forEach(function(n,a){return r(a,n,i)})}function _(i){var r=i[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(i)?1:b(i)?2:3*!!w(i)}function y(i,r){return 2===_(i)?i.has(r):Object.prototype.hasOwnProperty.call(i,r)}function v(i,r,n){var a=_(i);2===a?i.set(r,n):3===a?i.add(n):i[r]=n}function x(i,r){return i===r?0!==i||1/i==1/r:i!=i&&r!=r}function b(i){return W&&i instanceof Map}function w(i){return Y&&i instanceof Set}function T(i){return i.o||i.t}function E(i){if(Array.isArray(i))return Array.prototype.slice.call(i);var r=et(i);delete r[Q];for(var n=ee(r),a=0;a<n.length;a++){var o=n[a],s=r[o];!1===s.writable&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(r[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:i[o]})}return Object.create(Object.getPrototypeOf(i),r)}function S(i,r){return void 0===r&&(r=!1),C(i)||p(i)||!m(i)||(_(i)>1&&(i.set=i.add=i.clear=i.delete=A),Object.freeze(i),r&&g(i,function(i,r){return S(r,!0)},!0)),i}function A(){f(2)}function C(i){return null==i||"object"!=typeof i||Object.isFrozen(i)}function I(i){var r=ei[i];return r||f(18,i),r}i.i(589295);function k(i,r){r&&(I("Patches"),i.u=[],i.s=[],i.v=r)}function R(i){M(i),i.p.forEach(P),i.p=null}function M(i){i===q&&(q=i.l)}function L(i){return q={p:[],l:q,h:i,m:!0,_:0}}function P(i){var r=i[Q];0===r.i||1===r.i?r.j():r.g=!0}function O(i,r){r._=r.p.length;var n=r.p[0],a=void 0!==i&&i!==n;return r.h.O||I("ES5").S(r,i,a),a?(n[Q].P&&(R(r),f(4)),m(i)&&(i=D(r,i),r.l||N(r,i)),r.u&&I("Patches").M(n[Q].t,i,r.u,r.s)):i=D(r,n,[]),R(r),r.u&&r.v(r.u,r.s),i!==K?i:void 0}function D(i,r,n){if(C(r))return r;var a=r[Q];if(!a)return g(r,function(o,s){return F(i,a,r,o,s,n)},!0),r;if(a.A!==i)return r;if(!a.P)return N(i,a.t,!0),a.t;if(!a.I){a.I=!0,a.A._--;var o=4===a.i||5===a.i?a.o=E(a.k):a.o,s=o,l=!1;3===a.i&&(s=new Set(o),o.clear(),l=!0),g(s,function(r,s){return F(i,a,o,r,s,n,l)}),N(i,o,!1),n&&i.u&&I("Patches").N(a,n,i.u,i.s)}return a.o}function F(i,r,n,a,o,s,l){if(p(o)){var u=D(i,o,s&&r&&3!==r.i&&!y(r.R,a)?s.concat(a):void 0);if(v(n,a,u),!p(u))return;i.m=!1}else l&&n.add(o);if(m(o)&&!C(o)){if(!i.h.D&&i._<1)return;D(i,o),r&&r.A.l||N(i,o)}}function N(i,r,n){void 0===n&&(n=!1),!i.l&&i.h.D&&i.m&&S(r,n)}function j(i,r){var n=i[Q];return(n?T(n):i)[r]}function z(i,r){if(r in i)for(var n=Object.getPrototypeOf(i);n;){var a=Object.getOwnPropertyDescriptor(n,r);if(a)return a;n=Object.getPrototypeOf(n)}}function B(i){i.P||(i.P=!0,i.l&&B(i.l))}function U(i){i.o||(i.o=E(i.t))}function V(i,r,n){var a,o,s,l,u,c,d,h=b(r)?I("MapSet").F(r,n):w(r)?I("MapSet").T(r,n):i.O?(s=o={i:+!!(a=Array.isArray(r)),A:n?n.A:q,P:!1,I:!1,R:{},l:n,t:r,k:null,o:null,j:null,C:!1},l=er,a&&(s=[o],l=en),c=(u=Proxy.revocable(s,l)).revoke,o.k=d=u.proxy,o.j=c,d):I("ES5").J(r,n);return(n?n.A:q).p.push(h),h}function H(i,r){switch(r){case 2:return new Map(i);case 3:return Array.from(i)}return E(i)}var G,q,$="u">typeof Symbol&&"symbol"==typeof Symbol("x"),W="u">typeof Map,Y="u">typeof Set,Z="u">typeof Proxy&&void 0!==Proxy.revocable&&"u">typeof Reflect,K=$?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),X=$?Symbol.for("immer-draftable"):"__$immer_draftable",Q=$?Symbol.for("immer-state"):"__$immer_state",J=""+Object.prototype.constructor,ee="u">typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(i){return Object.getOwnPropertyNames(i).concat(Object.getOwnPropertySymbols(i))}:Object.getOwnPropertyNames,et=Object.getOwnPropertyDescriptors||function(i){var r={};return ee(i).forEach(function(n){r[n]=Object.getOwnPropertyDescriptor(i,n)}),r},ei={},er={get:function(i,r){if(r===Q)return i;var n,a,o=T(i);if(!y(o,r))return(a=z(o,r))?"value"in a?a.value:null==(n=a.get)?void 0:n.call(i.k):void 0;var s=o[r];return i.I||!m(s)?s:s===j(i.t,r)?(U(i),i.o[r]=V(i.A.h,s,i)):s},has:function(i,r){return r in T(i)},ownKeys:function(i){return Reflect.ownKeys(T(i))},set:function(i,r,n){var a=z(T(i),r);if(null==a?void 0:a.set)return a.set.call(i.k,n),!0;if(!i.P){var o=j(T(i),r),s=null==o?void 0:o[Q];if(s&&s.t===n)return i.o[r]=n,i.R[r]=!1,!0;if(x(n,o)&&(void 0!==n||y(i.t,r)))return!0;U(i),B(i)}return i.o[r]===n&&(void 0!==n||r in i.o)||Number.isNaN(n)&&Number.isNaN(i.o[r])||(i.o[r]=n,i.R[r]=!0),!0},deleteProperty:function(i,r){return void 0!==j(i.t,r)||r in i.t?(i.R[r]=!1,U(i),B(i)):delete i.R[r],i.o&&delete i.o[r],!0},getOwnPropertyDescriptor:function(i,r){var n=T(i),a=Reflect.getOwnPropertyDescriptor(n,r);return a?{writable:!0,configurable:1!==i.i||"length"!==r,enumerable:a.enumerable,value:n[r]}:a},defineProperty:function(){f(11)},getPrototypeOf:function(i){return Object.getPrototypeOf(i.t)},setPrototypeOf:function(){f(12)}},en={};g(er,function(i,r){en[i]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),en.deleteProperty=function(i,r){return en.set.call(this,i,r,void 0)},en.set=function(i,r,n){return er.set.call(this,i[0],r,n,i[0])};var ea=new(function(){function i(i){var r=this;this.O=Z,this.D=!0,this.produce=function(i,n,a){if("function"==typeof i&&"function"!=typeof n){var o,s=n;return n=i,function(i){var a=this;void 0===i&&(i=s);for(var o=arguments.length,l=Array(o>1?o-1:0),u=1;u<o;u++)l[u-1]=arguments[u];return r.produce(i,function(i){var r;return(r=n).call.apply(r,[a,i].concat(l))})}}if("function"!=typeof n&&f(6),void 0!==a&&"function"!=typeof a&&f(7),m(i)){var l=L(r),u=V(r,i,void 0),c=!0;try{o=n(u),c=!1}finally{c?R(l):M(l)}return"u">typeof Promise&&o instanceof Promise?o.then(function(i){return k(l,a),O(i,l)},function(i){throw R(l),i}):(k(l,a),O(o,l))}if(!i||"object"!=typeof i){if(void 0===(o=n(i))&&(o=i),o===K&&(o=void 0),r.D&&S(o,!0),a){var d=[],h=[];I("Patches").M(i,o,d,h),a(d,h)}return o}f(21,i)},this.produceWithPatches=function(i,n){if("function"==typeof i)return function(n){for(var a=arguments.length,o=Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];return r.produceWithPatches(n,function(r){return i.apply(void 0,[r].concat(o))})};var a,o,s=r.produce(i,n,function(i,r){a=i,o=r});return"u">typeof Promise&&s instanceof Promise?s.then(function(i){return[i,a,o]}):[s,a,o]},"boolean"==typeof(null==i?void 0:i.useProxies)&&this.setUseProxies(i.useProxies),"boolean"==typeof(null==i?void 0:i.autoFreeze)&&this.setAutoFreeze(i.autoFreeze)}
1var r=i.prototype;return r.createDraft=function(i){m(i)||f(8),p(i)&&(p(r=i)||f(22,r),i=function i(r){if(!m(r))return r;var n,a=r[Q],o=_(r);if(a){if(!a.P&&(a.i<4||!I("ES5").K(a)))return a.t;a.I=!0,n=H(r,o),a.I=!1}else n=H(r,o);return g(n,function(r,o){var s;a&&(s=a.t,(2===_(s)?s.get(r):s[r])===o)||v(n,r,i(o))}),3===o?new Set(n):n}(r));var r,n=L(this),a=V(this,i,void 0);return a[Q].C=!0,M(n),a},r.finishDraft=function(i,r){var n=(i&&i[Q]).A;return k(n,r),O(void 0,n)},r.setAutoFreeze=function(i){this.D=i},r.setUseProxies=function(i){i&&!Z&&f(20),this.O=i},r.applyPatches=function(i,r){for(n=r.length-1;n>=0;n--){var n,a=r[n];if(0===a.path.length&&"replace"===a.op){i=a.value;break}}n>-1&&(r=r.slice(n+1));var o=I("Patches").$;return p(i)?o(i,r):this.produce(i,function(i){return o(i,r)})},i}()),eo=ea.produce;ea.produceWithPatches.bind(ea),ea.setAutoFreeze.bind(ea),ea.setUseProxies.bind(ea),ea.applyPatches.bind(ea),ea.createDraft.bind(ea),ea.finishDraft.bind(ea);var es=i.i(966731);function el(i){return"Minified Redux error #"+i+"; visit https://redux.js.org/Errors?code="+i+" for the full message or use the non-minified dev environment for full errors. "}var eu="function"==typeof Symbol&&Symbol.observable||"@@observable",ec=function(){return Math.random().toString(36).substring(7).split("").join(".")},ed={INIT:"@@redux/INIT"+ec(),REPLACE:"@@redux/REPLACE"+ec(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ec()}};function eh(i){for(var r,n=Object.keys(i),a={},o=0;o<n.length;o++){var s=n[o];"function"==typeof i[s]&&(a[s]=i[s])}var l=Object.keys(a);try{Object.keys(a).forEach(function(i){var r=a[i];if(void 0===r(void 0,{type:ed.INIT}))throw Error(el(12));if(void 0===r(void 0,{type:ed.PROBE_UNKNOWN_ACTION()}))throw Error(el(13))})}catch(i){r=i}return function(i,n){if(void 0===i&&(i={}),r)throw r;for(var o=!1,s={},u=0;u<l.length;u++){var c=l[u],d=a[c],h=i[c],f=d(h,n);if(void 0===f)throw n&&n.type,Error(el(14));s[c]=f,o=o||f!==h}return(o=o||l.length!==Object.keys(i).length)?s:i}}function ef(){for(var i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];return 0===r.length?function(i){return i}:1===r.length?r[0]:r.reduce(function(i,r){return function(){return i(r.apply(void 0,arguments))}})}function ep(){for(var i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];return function(i){return function(){var n=i.apply(void 0,arguments),a=function(){throw Error(el(15))},o={getState:n.getState,dispatch:function(){return a.apply(void 0,arguments)}},s=r.map(function(i){return i(o)});return a=ef.apply(void 0,s)(n.dispatch),(0,es.default)((0,es.default)({},n),{},{dispatch:a})}}}function em(i){return function(r){var n=r.dispatch,a=r.getState;return function(r){return function(o){return"function"==typeof o?o(n,a,i):r(o)}}}}var eg=em();eg.withExtraArgument=em;var e_=(n=function(i,r){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(i[n]=r[n])})(i,r)},function(i,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function a(){this.constructor=i}n(i,r),i.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}),ey=function(i,r){var n,a,o,s,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){var c=[s,u];if(n)throw TypeError("Generator is already executing.");for(;l;)try{if(n=1,a&&(o=2&c[0]?a.return:c[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,c[1])).done)return o;switch(a=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,a=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=r.call(i,l)}catch(i){c=[6,i],a=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},ev=function(i,r){for(var n=0,a=r.length,o=i.length;n<a;n++,o++)i[o]=r[n];return i},ex=Object.defineProperty,eb=Object.defineProperties,ew=Object.getOwnPropertyDescriptors,eT=Object.getOwnPropertySymbols,eE=Object.prototype.hasOwnProperty,eS=Object.prototype.propertyIsEnumerable,eA=function(i,r,n){return r in i?ex(i,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[r]=n},eC=function(i,r){for(var n in r||(r={}))eE.call(r,n)&&eA(i,n,r[n]);if(eT)for(var a=0,o=eT(r);a<o.length;a++){var n=o[a];eS.call(r,n)&&eA(i,n,r[n])}return i},eI=function(i,r){return eb(i,ew(r))},ek="u">typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!=arguments.length)return"object"==typeof arguments[0]?ef:ef.apply(null,arguments)};function eR(i,r){function n(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(r){var o=r.apply(void 0,n);if(!o)throw Error("prepareAction did not return an object");return eC(eC({type:i,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:i,payload:n[0]}}return n.toString=function(){return""+i},n.type=i,n.match=function(r){return r.type===i},n}"u">typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var eM=function(i){function r(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];var o=i.apply(this,n)||this;return Object.setPrototypeOf(o,r.prototype),o}return e_(r,i),Object.defineProperty(r,Symbol.species,{get:function(){return r}
1,enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return i.prototype.concat.apply(this,r)},r.prototype.prepend=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return 1===i.length&&Array.isArray(i[0])?new(r.bind.apply(r,ev([void 0],i[0].concat(this)))):new(r.bind.apply(r,ev([void 0],i.concat(this))))},r}(Array),eL=function(i){function r(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];var o=i.apply(this,n)||this;return Object.setPrototypeOf(o,r.prototype),o}return e_(r,i),Object.defineProperty(r,Symbol.species,{get:function(){return r},enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return i.prototype.concat.apply(this,r)},r.prototype.prepend=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return 1===i.length&&Array.isArray(i[0])?new(r.bind.apply(r,ev([void 0],i[0].concat(this)))):new(r.bind.apply(r,ev([void 0],i.concat(this))))},r}(Array);function eP(i){return m(i)?eo(i,function(){}):i}function eO(i){var r,n={},a=[],o={addCase:function(i,r){var a="string"==typeof i?i:i.type;if(!a)throw Error("`builder.addCase` cannot be called with an empty action type");if(a in n)throw Error("`builder.addCase` cannot be called with two reducers for the same action type");return n[a]=r,o},addMatcher:function(i,r){return a.push({matcher:i,reducer:r}),o},addDefaultCase:function(i){return r=i,o}};return i(o),[n,a,r]}function eD(i){var r,n=i.name;if(!n)throw Error("`name` is a required option for createSlice");var a="function"==typeof i.initialState?i.initialState:eP(i.initialState),o=i.reducers||{},s=Object.keys(o),l={},u={},c={};function d(){var r="function"==typeof i.extraReducers?eO(i.extraReducers):[i.extraReducers],n=r[0],o=r[1],s=void 0===o?[]:o,l=r[2],c=void 0===l?void 0:l,d=eC(eC({},void 0===n?{}:n),u);return function(i,r,n){void 0===n&&(n=[]);var a,o="function"==typeof r?eO(r):[r,n,void 0],s=o[0],l=o[1],u=o[2];if("function"==typeof i)a=function(){return eP(i())};else{var c=eP(i);a=function(){return c}}function d(i,r){void 0===i&&(i=a());var n=ev([s[r.type]],l.filter(function(i){return(0,i.matcher)(r)}).map(function(i){return i.reducer}));return 0===n.filter(function(i){return!!i}).length&&(n=[u]),n.reduce(function(i,n){if(n)if(p(i)){var a=n(i,r);return void 0===a?i:a}else{if(m(i))return eo(i,function(i){return n(i,r)});var a=n(i,r);if(void 0===a){if(null===i)return i;throw Error("A case reducer on a non-draftable value must not return undefined")}return a}return i},i)}return d.getInitialState=a,d}(a,function(i){for(var r in d)i.addCase(r,d[r]);for(var n=0;n<s.length;n++){var a=s[n];i.addMatcher(a.matcher,a.reducer)}c&&i.addDefaultCase(c)})}return s.forEach(function(i){var r,a,s=o[i],d=n+"/"+i;"reducer"in s?(r=s.reducer,a=s.prepare):r=s,l[i]=r,u[d]=r,c[i]=a?eR(d,a):eR(d)}),{name:n,reducer:function(i,n){return r||(r=d()),r(i,n)},actions:c,caseReducers:l,getInitialState:function(){return r||(r=d()),r.getInitialState()}}}var eF=function(i){void 0===i&&(i=21);for(var r="",n=i;n--;)r+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return r},eN=["name","message","stack","code"],ej=function(i,r){this.payload=i,this.meta=r},ez=function(i,r){this.payload=i,this.meta=r},eB=function(i){if("object"==typeof i&&null!==i){for(var r={},n=0;n<eN.length;n++){var a=eN[n];"string"==typeof i[a]&&(r[a]=i[a])}return r}return{message:String(i)}};function eU(i,r,n){var a=eR(i+"/fulfilled",function(i,r,n,a){return{payload:i,meta:eI(eC({},a||{}),{arg:n,requestId:r,requestStatus:"fulfilled"})}}),o=eR(i+"/pending",function(i,r,n){return{payload:void 0,meta:eI(eC({},n||{}),{arg:r,requestId:i,requestStatus:"pending"})}}),s=eR(i+"/rejected",function(i,r,a,o,s){return{payload:o,error:(n&&n.serializeError||eB)(i||"Rejected"),meta:eI(eC({},s||{}),{arg:a,requestId:r,rejectedWithValue:!!o,requestStatus:"rejected",aborted:(null==i?void 0:i.name)==="AbortError",condition:(null==i?void 0:i.name)==="ConditionError"})}}),l="u">typeof AbortController?AbortController:function(){function i(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return i.prototype.abort=function(){},i}();return Object.assign(function(i){return function(u,c,d){var h,f=(null==n?void 0:n.idGenerator)?n.idGenerator(i):eF(),p=new l;function m(i){h=i,p.abort()}var g=function(){var l,g;return l=this,g=function(){var l,g,_,y,v,x;return ey(this,function(b){switch(b.label){case 0:var w;if(b.trys.push([0,4,,5]),null===(w=y=null==(l=null==n?void 0:n.condition)?void 0:l.call(n,i,{getState:c,extra:d}))||"object"!=typeof w||"function"!=typeof w.then)return[3,2];return[4,y];case 1:y=b.sent(),b.label=2;case 2:if(!1===y||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return v=new Promise(function(i,r){return p.signal.addEventListener("abort",function(){return r({name:"AbortError",message:h||"Aborted"})})}),u(o(f,i,null==(g=null==n?void 0:n.getPendingMeta)?void 0:g.call(n,{requestId:f,arg:i},{getState:c,extra:d}))),[4,Promise.race([v,Promise.resolve(r(i,{dispatch:u,getState:c,extra:d,requestId:f,signal:p.signal,abort:m,rejectWithValue:function(i,r){return new ej(i,r)},fulfillWithValue:function(i,r){return new ez(i,r)}})).then(function(r){if(r instanceof ej)throw r;return r instanceof ez?a(r.payload,f,i,r.meta):a(r,f,i)})])];case 3:return _=b.sent(),[3,5];case 4:return _=(x=b.sent())instanceof ej?s(null,f,i,x.payload,x.meta):s(x,f,i),[3,5];case 5:return n&&!n.dispatchConditionRejection&&s.match(_)&&_.meta.condition||u(_),[2,_]}})},new Promise(function(i,r){var n=function(i){try{o(g.next(i))}catch(i){r(i)}},a=function(i){try{o(g.throw(i))}catch(i){r(i)}},o=function(r){return r.done?i(r.value):Promise.resolve(r.value).then(n,a)};o((g=g.apply(l,null)).next())})}();return Object.assign(g,{abort:m,requestId:f,arg:i,unwrap:function(){return g.then(eV)}})}},{pending:o,rejected:s,fulfilled:a,typePrefix:i})}function eV(i){if(i.meta&&i.meta.rejectedWithValue)throw i.payload;if(i.error)throw i.error;return i.payload}eU.withTypes=function(){return eU};var eH="listenerMiddleware";eR(eH+"/add"),eR(eH+"/removeAll"),eR(eH+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("u">typeof window?window:i.g),"u">typeof window&&window.requestAnimationFrame&&window.requestAnimationFrame,function(){function i(i,r){var n=o[i];return n?n.enumerable=r:o[i]=n={configurable:!0,enumerable:r,get:function(){var r=this[Q];return er.get(r,i)},set:function(r){var n=this[Q];er.set(n,i,r)}},n}function r(i){for(var r=i.length-1;r>=0;r--){var o=i[r][Q];if(!o.P)switch(o.i){case 5:a(o)&&B(o);break;case 4:n(o)&&B(o)}}}function n(i){for(var r=i.t,n=i.k,a=ee(n),o=a.length-1;o>=0;o--){var s=a[o];if(s!==Q){var l=r[s];if(void 0===l&&!y(r,s))return!0;var u=n[s],c=u&&u[Q];if(c?c.t!==l:!x(u,l))return!0}}var d=!!r[Q];
1return a.length!==ee(r).length+ +!d}function a(i){var r=i.k;if(r.length!==i.t.length)return!0;var n=Object.getOwnPropertyDescriptor(r,r.length-1);if(n&&!n.get)return!0;for(var a=0;a<r.length;a++)if(!r.hasOwnProperty(a))return!0;return!1}var o={};ei.ES5||(ei.ES5={J:function(r,n){var a=Array.isArray(r),o=function(r,n){if(r){for(var a=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(a,""+o,i(o,!0));return a}var s=et(n);delete s[Q];for(var l=ee(s),u=0;u<l.length;u++){var c=l[u];s[c]=i(c,r||!!s[c].enumerable)}return Object.create(Object.getPrototypeOf(n),s)}(a,r),s={i:a?5:4,A:n?n.A:q,P:!1,I:!1,R:{},l:n,t:r,k:o,o:null,g:!1,C:!1};return Object.defineProperty(o,Q,{value:s,writable:!0}),o},S:function(i,n,o){o?p(n)&&n[Q].A===i&&r(i.p):(i.u&&function i(r){if(r&&"object"==typeof r){var n=r[Q];if(n){var o=n.t,s=n.k,l=n.R,u=n.i;if(4===u)g(s,function(r){r!==Q&&(void 0!==o[r]||y(o,r)?l[r]||i(s[r]):(l[r]=!0,B(n)))}),g(o,function(i){void 0!==s[i]||y(s,i)||(l[i]=!1,B(n))});else if(5===u){if(a(n)&&(B(n),l.length=!0),s.length<o.length)for(var c=s.length;c<o.length;c++)l[c]=!1;else for(var d=o.length;d<s.length;d++)l[d]=!0;for(var h=Math.min(s.length,o.length),f=0;f<h;f++)s.hasOwnProperty(f)||(l[f]=!0),void 0===l[f]&&i(s[f])}}}}(i.p[0]),r(i.p))},K:function(i){return 4===i.i?n(i):a(i)}})}();let eG={},eq={handleSearchResponse:(i,r)=>{var n,a,o,s,l,u,c,d,h,f,p,m,g,_;(null==(n=r.payload)?void 0:n.allResultsForVertical)&&(null==(a=r.payload)?void 0:a.alternativeVerticals)?i.noResults={allResultsForVertical:{facets:r.payload.allResultsForVertical.facets||[],results:null==(o=r.payload.allResultsForVertical.verticalResults)?void 0:o.results,resultsCount:null==(s=r.payload.allResultsForVertical.verticalResults)?void 0:s.resultsCount},alternativeVerticals:r.payload.alternativeVerticals}:i.noResults=void 0,i.appliedQueryFilters=null==(u=null==(l=r.payload)?void 0:l.verticalResults)?void 0:u.appliedQueryFilters,i.queryDurationMillis=null==(d=null==(c=r.payload)?void 0:c.verticalResults)?void 0:d.queryDurationMillis,i.results=null==(f=null==(h=r.payload)?void 0:h.verticalResults)?void 0:f.results,i.resultsCount=null==(m=null==(p=r.payload)?void 0:p.verticalResults)?void 0:m.resultsCount,i.source=null==(_=null==(g=r.payload)?void 0:g.verticalResults)?void 0:_.source},setDisplayName:(i,r)=>{i.displayName=r.payload},setLimit:(i,r)=>{i.limit=r.payload},setOffset:(i,r)=>{i.offset=r.payload},setSortBys:(i,r)=>{i.sortBys=r.payload},setVerticalKey:(i,r)=>{i.verticalKey=r.payload},setLocationRadius:(i,r)=>{i.locationRadius=r.payload},setFacetAllowList:(i,r)=>{i.facetAllowlist=r.payload},setAutocompleteLimit:(i,r)=>{i.autocompleteLimit=r.payload}},e$={},eW={setVerticals:(i,r)=>{i.verticals=r.payload},setLimit:(i,r)=>{i.limit=r.payload},setRestrictVerticals:(i,r)=>{i.restrictVerticals=r.payload},setAutocompleteLimit:(i,r)=>{i.autocompleteLimit=r.payload}};var eY=i.i(529594);let eZ={},eK={setStatic:(i,r)=>{i.static=r.payload},setFacets:(i,r)=>{i.facets=r.payload},resetFacets:i=>{var r;null==(r=i.facets)||r.forEach(i=>{i.options.forEach(i=>i.selected=!1)})},setFacetOption:(i,{payload:r})=>{if(!i.facets)return void console.warn("Trying to select a facet option when no facets exist.");let{fieldId:n,facetOption:a,shouldSelect:o}=r,s=i.facets.filter(i=>i.fieldId===n);0===s.length?console.warn(`Could not select a facet option for fieldId "${n}": the fieldId was not found.`):s.forEach(i=>{i.options=i.options.map(i=>i.matcher===a.matcher&&(0,eY.default)(i.value,a.value)?Object.assign(Object.assign({},i),{selected:o}):i)})},setFilterOption:(i,{payload:r})=>{i.static||(i.static=[]);let{selected:n,displayName:a,filter:o}=r,s=i.static.find(i=>(function i(r,n){if("fieldValue"===r.kind)return"fieldValue"===n.kind&&r.fieldId===n.fieldId&&r.matcher===n.matcher&&(0,eY.default)(r.value,n.value);return"fieldValue"!==n.kind&&r.combinator===n.combinator&&r.filters.length===n.filters.length&&r.filters.every(r=>n.filters.some(n=>i(r,n)))&&n.filters.every(n=>r.filters.some(r=>i(n,r)))})(i.filter,o));s?s.selected=n:n?i.static.push(r):console.warn(`Could not unselect a non-existing filter option in state with the following fields:
2${JSON.stringify(o)}.`)}},eX={},eQ={setResult:(i,r)=>{i.result=r.payload}},eJ={actions:[]},e1={setActions:(i,r)=>{i.actions=r.payload}},e0={},e2={setIsLoading:(i,r)=>{i.isLoading=r.payload}},e5={},e4={setIsLoading:(i,r)=>{i.isLoading=r.payload},setResponse:(i,r)=>{i.response=r.payload}};class e9{constructor(i,r,n,a,o){this.config=i,this.core=r,this.stateManager=n,this.httpManager=a,this.additionalHttpHeaders=o,this.utilities=c,this.stateManager.dispatchEvent("meta/setExperienceKey",i.experienceKey),this.stateManager.dispatchEvent("meta/setLocale",i.locale)}setIsPagination(i){this.stateManager.dispatchEvent("query/setIsPagination",i)}setQuery(i){this.stateManager.dispatchEvent("query/setInput",i)}setQueryTrigger(i){this.stateManager.dispatchEvent("query/setTrigger",i)}setQuerySource(i){this.stateManager.dispatchEvent("query/setSource",i)}setVertical(i){this._resetSearcherStates(),this.stateManager.dispatchEvent("vertical/setVerticalKey",i),this.stateManager.dispatchEvent("meta/setSearchType",h.SearchTypeEnum.Vertical)}setUniversal(){this._resetSearcherStates(),this.stateManager.dispatchEvent("vertical/setVerticalKey",void 0),this.stateManager.dispatchEvent("meta/setSearchType",h.SearchTypeEnum.Universal)}_resetSearcherStates(){this.stateManager.dispatchEvent("set-state",Object.assign(Object.assign({},this.state),{directAnswer:eX,filters:eZ,queryRules:eJ,searchStatus:e0,vertical:eG,universal:e$,generativeDirectAnswer:e5}))}setVerticalLimit(i){this.stateManager.dispatchEvent("vertical/setLimit",i)}setVerticalAutocompleteLimit(i){this.stateManager.dispatchEvent("vertical/setAutocompleteLimit",i)}setUniversalLimit(i){this.stateManager.dispatchEvent("universal/setLimit",i)}setUniversalAutocompleteLimit(i){this.stateManager.dispatchEvent("universal/setAutocompleteLimit",i)}setOffset(i){this.stateManager.dispatchEvent("vertical/setOffset",i)}setStaticFilters(i){this.stateManager.dispatchEvent("filters/setStatic",i)}setFacets(i){this.stateManager.dispatchEvent("filters/setFacets",i)}resetFacets(){this.stateManager.dispatchEvent("filters/resetFacets")}setSpellCheckEnabled(i){this.stateManager.dispatchEvent("spellCheck/setEnabled",i)}setSessionTrackingEnabled(i){this.stateManager.dispatchEvent("sessionTracking/setEnabled",i)}setSessionId(i){this.stateManager.dispatchEvent("sessionTracking/setSessionId",i)}setAlternativeVerticals(i){this.stateManager.dispatchEvent("vertical/setAlternativeVerticals",i)}setSortBys(i){this.stateManager.dispatchEvent("vertical/setSortBys",i)}setContext(i){this.stateManager.dispatchEvent("meta/setContext",i
2)}setReferrerPageUrl(i){this.stateManager.dispatchEvent("meta/setReferrerPageUrl",i)}setUserLocation(i){this.stateManager.dispatchEvent("location/setUserLocation",i)}setState(i){this.stateManager.dispatchEvent("set-state",i)}setRestrictVerticals(i){this.stateManager.dispatchEvent("universal/setRestrictVerticals",i)}setLocationRadius(i){this.stateManager.dispatchEvent("vertical/setLocationRadius",i)}setFacetAllowList(i){this.stateManager.dispatchEvent("vertical/setFacetAllowList",i)}get state(){return this.stateManager.getState()}addListener(i){return this.stateManager.addListener(i)}async submitQuestion(i){return this.core.submitQuestion(Object.assign(Object.assign({},i),{additionalHttpHeaders:this.additionalHttpHeaders}))}async executeUniversalQuery(){let i;if(this.state.meta.searchType!==h.SearchTypeEnum.Universal)return void console.error("The meta.searchType must be set to 'universal' for universal search. Set the searchType to universal by calling `setUniversal()`");let r=this.httpManager.updateRequestId("universalQuery");this.stateManager.dispatchEvent("searchStatus/setIsLoading",!0);let{input:n,querySource:a,queryTrigger:o}=this.state.query,s=!this.state.spellCheck.enabled,l=this.state.sessionTracking.enabled,{limit:u,restrictVerticals:c}=this.state.universal,d=this.state.sessionTracking.sessionId,{referrerPageUrl:f,context:p}=this.state.meta,{userLocation:m}=this.state.location,g=Object.assign(Object.assign({query:n||"",querySource:a,queryTrigger:o,skipSpellCheck:s},l&&{sessionId:d}),{sessionTrackingEnabled:l,limit:u,location:m,context:p,referrerPageUrl:f,restrictVerticals:c,additionalHttpHeaders:this.additionalHttpHeaders});try{i=await this.core.universalSearch(g)}catch(i){return this.httpManager.processRequestId("universalQuery",r)&&this.stateManager.dispatchEvent("searchStatus/setIsLoading",!1),Promise.reject(i)}return this.httpManager.processRequestId("universalQuery",r)&&(this.stateManager.dispatchEvent("universal/setVerticals",i.verticalResults),this.stateManager.dispatchEvent("query/setQueryId",
2i.queryId),this.stateManager.dispatchEvent("query/setMostRecentSearch",n),this.stateManager.dispatchEvent("spellCheck/setResult",i.spellCheck),this.stateManager.dispatchEvent("query/setSearchIntents",i.searchIntents||[]),this.stateManager.dispatchEvent("location/setLocationBias",i.locationBias),this.stateManager.dispatchEvent("searchStatus/setIsLoading",!1),this.stateManager.dispatchEvent("meta/setUUID",i.uuid),this.stateManager.dispatchEvent("directAnswer/setResult",i.directAnswer),this.stateManager.dispatchEvent("queryRules/setActions",i.queryRulesActionsData||[])),i}async executeUniversalAutocomplete(){let i=this.state.query.input||"",r=this.state.universal.autocompleteLimit;return this.core.universalAutocomplete({input:i,limit:r,additionalHttpHeaders:this.additionalHttpHeaders})}async executeVerticalQuery(){var i;let r;if(this.state.meta.searchType!==h.SearchTypeEnum.Vertical)return void console.error("The meta.searchType must be set to 'vertical' for vertical search. Set the searchType to vertical by calling `setVertical()`");let n=this.httpManager.updateRequestId("verticalQuery"),a=this.state.vertical.verticalKey;if(!a)return void console.error("no verticalKey supplied for vertical search");this.stateManager.dispatchEvent("searchStatus/setIsLoading",!0);let{input:o,isPagination:s,queryId:l,querySource:u,queryTrigger:c}=this.state.query,f=!this.state.spellCheck.enabled,p=this.state.sessionTracking.enabled,m=this.state.sessionTracking.sessionId,g=(0,d.transformFiltersToCoreFormat)(this.state.filters.static)||void 0,_=null==(i=this.state.filters)?void 0:i.facets,{limit:y,offset:v,sortBys:x,locationRadius:b,facetAllowlist:w}=this.state.vertical,{referrerPageUrl:T,context:E}=this.state.meta,{userLocation:S}=this.state.location,A=Object.assign(Object.assign({query:o||"",querySource:u,queryTrigger:c,verticalKey:a,staticFilter:g,facets:null==_?void 0:_.map(i=>({fieldId:i.fieldId,options:i.options.filter(i=>i.selected)})),retrieveFacets:!0,limit:y,offset:v,skipSpellCheck:f},p&&{sessionId:m}),{sessionTrackingEnabled:p,location:S,sortBys:x,context:E,referrerPageUrl:T,locationRadius:b,facetAllowlist:w,queryId:s?l:void 0,additionalHttpHeaders:this.additionalHttpHeaders});try{r=await this.core.verticalSearch(A)}catch(i){return this.httpManager.processRequestId("verticalQuery",n)&&this.stateManager.dispatchEvent("searchStatus/setIsLoading",!1),Promise.reject(i)}return this.httpManager.processRequestId("verticalQuery",n)&&(this.stateManager.dispatchEvent("query/setQueryId",r.queryId),this.stateManager.dispatchEvent("query/setMostRecentSearch",o),this.stateManager.dispatchEvent("query/setIsPagination",!1),this.stateManager.dispatchEvent("filters/setFacets",r.facets),this.stateManager.dispatchEvent("spellCheck/setResult",r.spellCheck),this.stateManager.dispatchEvent("query/setSearchIntents",r.searchIntents||[]),this.stateManager.dispatchEvent("location/setLocationBias",r.locationBias),this.stateManager.dispatchEvent("directAnswer/setResult",r.directAnswer),this.stateManager.dispatchEvent("meta/setUUID",r.uuid),this.stateManager.dispatchEvent("searchStatus/setIsLoading",!1),this.stateManager.dispatchEvent("vertical/handleSearchResponse",r),this.stateManager.dispatchEvent("queryRules/setActions",r.queryRulesActionsData||[])),r}async executeVerticalAutocomplete(){if(this.state.meta.searchType!==h.SearchTypeEnum.Vertical)return void console.error("The meta.searchType must be set to 'vertical' for vertical autocomplete. Set the searchType to vertical by calling `setVertical()`");let i=this.state.query.input||"",r=this.state.vertical.verticalKey;if(!r)return void console.error("no verticalKey supplied for vertical autocomplete");let n=this.state.vertical.autocompleteLimit;return this.core.verticalAutocomplete({input:i,verticalKey:r,limit:n,additionalHttpHeaders:this.additionalHttpHeaders})}async executeFilterSearch(i,r,n){if(this.state.meta.searchType!==h.SearchTypeEnum.Vertical)return void console.error("The meta.searchType must be set to 'vertical' for filter search. Set the searchType to vertical by calling `setVertical()`");let a=this.state.vertical.verticalKey;return a?this.core.filterSearch({input:i,verticalKey:a,sessionTrackingEnabled:this.state.sessionTracking.enabled,sectioned:r,fields:n,additionalHttpHeaders:this.additionalHttpHeaders}):void console.error("no verticalKey supplied for filter search")}setFacetOption(i,r,n){this.stateManager.dispatchEvent("filters/setFacetOption",{shouldSelect:n,fieldId:i,facetOption:r})}setFilterOption(i){this.stateManager.dispatchEvent("filters/setFilterOption",i)}async executeGenerativeDirectAnswer(){let i,r,n=this.httpManager.updateRequestId("generativeDirectAnswer"),a=this.state.meta.uuid,o=this.state.query.mostRecentSearch;if(this.state.meta.searchType===h.SearchTypeEnum.Vertical){var s;void 0!==(s=this.state.vertical).appliedQueryFilters&&void 0!==s.results&&void 0!==s.resultsCount&&void 0!==s.source&&void 0!==s.verticalKey&&(i=[this.state.vertical])}else i=this.state.universal.verticals;if(!a)return void console.error("no search id supplied for generative direct answer");if(!o)return void console.error("no search term supplied for generative direct answer");if(!i||0===i.length)return void console.error("no results supplied for generative direct answer");this.stateManager.dispatchEvent("generativeDirectAnswer/setIsLoading",!0);try{r=await this.core.generativeDirectAnswer({searchId:a,results:i,searchTerm:o,additionalHttpHeaders:this.additionalHttpHeaders})}catch(i){return this.httpManager.processRequestId("generativeDirectAnswer",n)&&(this.stateManager.dispatchEvent("generativeDirectAnswer/setResponse",void 0),this.stateManager.dispatchEvent("generativeDirectAnswer/setIsLoading",!1)),Promise.reject(i)}return this.httpManager.processRequestId("generativeDirectAnswer",n)&&(this.stateManager.dispatchEvent("generativeDirectAnswer/setResponse",r),this.stateManager.dispatchEvent("generativeDirectAnswer/setIsLoading",!1)),r}}let e3={},e8={setInput:(i,r)=>{i.input=r.payload},setIsPagination:(i,r)=>{i.isPagination=r.payload},setTrigger:(i,r)=>{i.queryTrigger=r.payload},setSource:(i,r)=>{i.querySource=r.payload},setQueryId:(i,r)=>{i.queryId=r.payload},setMostRecentSearch:(i,r)=>{i.mostRecentSearch=r.payload},setSearchIntents:(i,r)=>{i.searchIntents=r.payload}},e6={enabled:!0},e7={setResult:(i,r)=>Object.assign({enabled:i.enabled},r.payload),setEnabled:(i,r)=>{i.enabled=r.payload}},te={enabled:!0},tt={setEnabled:(i,r)=>{i.enabled=r.payload},setSessionId:(i,r)=>{i.sessionId=r.payload}},ti={searchType:h.SearchTypeEnum.Universal},tr={setContext:(i,r)=>{i.context=r.payload},setReferrerPageUrl:(i,r)=>{i.referrerPageUrl=r.payload},setUUID:(i,r)=>{i.uuid=r.payload},setSearchType:(i,r)=>{i.searchType=r.payload},setExperienceKey:(i,r)=>{i.experienceKey=r.payload}
2,setLocale:(i,r)=>{i.locale=r.payload}},tn={},ta={setUserLocation:(i,r)=>{i.userLocation=r.payload},setLocationBias:(i,r)=>{i.locationBias=r.payload}},to="main";var ts=i.i(352635);let tl="Client-SDK",{version:tu}=ts.default;var tc=function(i,r){var n={};for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&0>r.indexOf(a)&&(n[a]=i[a]);if(null!=i&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(i);o<a.length;o++)0>r.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(i,a[o])&&(n[a[o]]=i[a[o]]);return n};let td=function(i){var r,n=function(i){var r,n,a,o;return void 0===(r=i)&&(r={}),a=void 0===(n=r.thunk)||n,o=(r.immutableCheck,r.serializableCheck,r.actionCreatorCheck,new eM),a&&("boolean"==typeof a?o.push(eg):o.push(eg.withExtraArgument(a.extraArgument))),o},a=i||{},o=a.reducer,s=void 0===o?void 0:o,l=a.middleware,u=void 0===l?n():l,c=a.devTools,d=void 0===c||c,h=a.preloadedState,f=a.enhancers,p=void 0===f?void 0:f;if("function"==typeof s)r=s;else if(function(i){if("object"!=typeof i||null===i)return!1;var r=Object.getPrototypeOf(i);if(null===r)return!0;for(var n=r;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return r===n}(s))r=eh(s);else throw Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var m=u;"function"==typeof m&&(m=m(n));var g=ep.apply(void 0,m),_=ef;d&&(_=ek(eC({trace:!1},"object"==typeof d&&d)));var y=new eL(g),v=y;return Array.isArray(p)?v=ev([g],p):"function"==typeof p&&(v=p(y)),function i(r,n,a){if("function"==typeof n&&"function"==typeof a||"function"==typeof a&&"function"==typeof arguments[3])throw Error(el(0));if("function"==typeof n&&void 0===a&&(a=n,n=void 0),void 0!==a){if("function"!=typeof a)throw Error(el(1));return a(i)(r,n)}if("function"!=typeof r)throw Error(el(2));var o,s=r,l=n,u=[],c=u,d=!1;function h(){c===u&&(c=u.slice())}function f(){if(d)throw Error(el(3));return l}function p(i){if("function"!=typeof i)throw Error(el(4));if(d)throw Error(el(5));var r=!0;return h(),c.push(i),function(){if(r){if(d)throw Error(el(6));r=!1,h();var n=c.indexOf(i);c.splice(n,1),u=null}}}function m(i){if(!function(i){if("object"!=typeof i||null===i)return!1;for(var r=i;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(i)===r}(i))throw Error(el(7));if(void 0===i.type)throw Error(el(8));if(d)throw Error(el(9));try{d=!0,l=s(l,i)}finally{d=!1}for(var r=u=c,n=0;n<r.length;n++)(0,r[n])();return i}return m({type:ed.INIT}),(o={dispatch:m,subscribe:p,getState:f,replaceReducer:function(i){if("function"!=typeof i)throw Error(el(10));s=i,m({type:ed.REPLACE})}})[eu]=function(){var i;return(i={subscribe:function(i){if("object"!=typeof i||null===i)throw Error(el(11));function r(){i.next&&i.next(f())}return r(),{unsubscribe:p(r)}}})[eu]=function(){return this},i},o}(r,void 0===h?void 0:h,_.apply(void 0,v))}({middleware:i=>i({serializableCheck:!1}),reducer:i=>i||{},devTools:!1}),th=new class{constructor(){this.headlessIdToReducer={}}addAnswersReducer(i){var r;
2this.headlessIdToReducer[i]=eh({query:eD({name:(r=i+"/")+"query",initialState:e3,reducers:e8}).reducer,vertical:eD({name:r+"vertical",initialState:eG,reducers:eq}).reducer,universal:eD({name:r+"universal",initialState:e$,reducers:eW}).reducer,directAnswer:eD({name:r+"directAnswer",initialState:eX,reducers:eQ}).reducer,queryRules:eD({name:r+"queryRules",initialState:eJ,reducers:e1}).reducer,filters:eD({name:r+"filters",initialState:eZ,reducers:eK}).reducer,spellCheck:eD({name:r+"spellCheck",initialState:e6,reducers:e7}).reducer,sessionTracking:eD({name:r+"sessionTracking",initialState:te,reducers:tt}).reducer,searchStatus:eD({name:r+"searchStatus",initialState:e0,reducers:e2}).reducer,meta:eD({name:r+"meta",initialState:ti,reducers:tr}).reducer,location:eD({name:r+"location",initialState:tn,reducers:ta}).reducer,generativeDirectAnswer:eD({name:r+"generativeDirectAnswer",initialState:e5,reducers:e4}).reducer})}getParentReducer(){let i=eh(this.headlessIdToReducer);return(r,n)=>"set-state"===n.type?Object.assign(Object.assign({},r),{[n.headlessId]:n.payload}):i(r,n)}};function tf(i,r){i.addListener({valueAccessor:i=>i.sessionTracking,callback:i=>{r.setState(Object.assign(Object.assign({},r.state),{sessionTracking:i}))}})}i.s(["provideHeadless",0,function(i,n){let a,{verticalKey:o,headlessId:c}=i,d=tc(i,["verticalKey","headlessId"]);if(c===to)throw Error(`Cannot instantiate a SearchHeadless using the default headlessId "${c}". Specify a different headlessId.`);let h=(0,s.provideCore)(d),f=new e9(d,h,new u.default(td,c||to,th),new l.default,(a=Object.assign(Object.assign({},null==n?void 0:n[tl]),{ANSWERS_HEADLESS:tu}),Object.assign(Object.assign({},n),{[tl]:a})));return o?f.setVertical(o):f.setUniversal(),r?(tf(r,f),tf(f,r)):r=f,f}],117243);var tp=(0,a.createContext)({});i.s(["SearchHeadlessProvider",0,function(i){let{children:r,searcher:n}=i;return a.default.createElement(tp.Provider,{value:n},r)},"useSearchActions",0,function(){let i=(0,a.useContext)(tp);if(void 0===i.state)throw Error("Attempted to call useSearchActions() outside of SearchHeadlessProvider. Please ensure that 'useSearchActions()' is called within an SearchHeadlessProvider component.");return i},"useSearchState",0,function(i){let r=(0,a.useContext)(tp);if(void 0===r.state)throw Error("Attempted to call useSearchState() outside of SearchHeadlessProvider. Please ensure that 'useSearchState()' is called within an SearchHeadlessProvider component.");let n=(0,a.useCallback)(()=>r.state,[r.state]),s=(0,a.useRef)(!1);(0,a.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]);let l=(0,a.useCallback)(i=>r.addListener({valueAccessor:i=>i,callback:()=>{s.current&&i()}}),[r]);return(0,o.useSyncExternalStoreWithSelector)(l,n,n,i)},"useSearchUtilities",0,function(){return(0,a.useContext)(tp).utilities}],956028)},885025,(i,r,n)=>{"u">typeof self?self:i.e,r.exports=function(){var i=[function(i,r,n){"use strict";function a(i,r,n){return r in i?Object.defineProperty(i,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[r]=n,i}n.r(r);var o=function i(r){var n=this;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");a(this,"DATA",{}),a(this,"KEY",void 0),a(this,"DEFAULT_VALUE",void 0),a(this,"getItem",function(){return n.DATA[n.KEY]||n.DEFAULT_VALUE}),a(this,"setItem",function(i){return n.DATA[n.KEY]=i,!0});var o=r.key,s=r.defaultValue;this.DATA={},this.KEY=o||l,this.DEFAULT_VALUE=s};function s(i,r,n){return r in i?Object.defineProperty(i,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[r]=n,i}var l="__RECENT_SEARCHES__",u=function(){var i="__TEST__KEY__";try{return localStorage.setItem(i,""),localStorage.removeItem(i),!0}catch(i){return!1}},c=function(i,r){if(!i)return r;try{return JSON.parse(i)}catch(i){return r}},d=function i(r){var n=this;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");s(this,"KEY",void 0),s(this,"DEFAULT_VALUE",void 0),s(this,"getItem",function(){return c(localStorage.getItem(n.KEY),n.DEFAULT_VALUE)}),s(this,"setItem",function(i){try{return localStorage.setItem(n.KEY,JSON.stringify(i)),!0}catch(i){return!1}});var a=r.key,o=r.defaultValue;this.KEY=a||l,this.DEFAULT_VALUE=o},h=function(i,r,n,a){var o=String(r);switch(n){case"PROXIMITY":return i.query.indexOf(o);case"TIME":return Math.log10(new Date().getTime()-i.timestamp);default:var s=i.query.indexOf(o),l=Math.log2((new Date().getTime()-i.timestamp)/a+1),u=
2Math.log2(s+1)||1;if(-1===s)return s;return(.01+.49*u+.49*l)/1}},f=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/^\s*$/.test(i)},p=function(i){return"string"==typeof i&&!f(i)||"number"==typeof i};function m(i,r,n){return r in i?Object.defineProperty(i,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[r]=n,i}n.d(r,"RecentSearches",function(){return g});var g=function i(){var r,n=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!(this instanceof i))throw TypeError("Cannot call a class as a function");m(this,"TTL",void 0),m(this,"LIMIT",void 0),m(this,"STORAGE",void 0),m(this,"RANKING",void 0),m(this,"RECENT_SEARCHES",[]),m(this,"getRecentSearches",function(i){return p(i)?n.RECENT_SEARCHES.map(function(r){var a=h(r,i,n.RANKING,n.TTL);return{data:r.data,query:r.query,score:a,timestamp:r.timestamp}}).filter(n.filterScoredResults).sort(n.sortScoredResults).map(function(i){return{data:i.data,query:i.query,timestamp:i.timestamp}}):n.RECENT_SEARCHES}),m(this,"setRecentSearch",function(i,r){if(!p(i))return n.RECENT_SEARCHES;var a={data:r,query:String(i),timestamp:new Date().getTime()},o=n.RECENT_SEARCHES.findIndex(function(r){return r.query===i});return o>-1&&n.RECENT_SEARCHES.splice(o,1),n.RECENT_SEARCHES.unshift(a),n.RECENT_SEARCHES=n.RECENT_SEARCHES.slice(0,n.LIMIT),n.STORAGE.setItem(n.RECENT_SEARCHES),n.RECENT_SEARCHES}),m(this,"filterScoredResults",function(i){return"TIME"===n.RANKING||i.score>-1}),m(this,"sortScoredResults",function(i,r){return i.score-r.score}),m(this,"initializeStorageData",function(){var i=new Date().getTime(),r=n.STORAGE.getItem().filter(function(r){return r.timestamp+n.TTL>=i}).slice(0,n.LIMIT);return n.STORAGE.setItem(r),n.RECENT_SEARCHES=r,r}),this.TTL=a.ttl||864e5,this.LIMIT=a.limit||50,this.STORAGE=(r={defaultValue:[],key:a.namespace},u()?new d(r):new o(r)),this.RECENT_SEARCHES=this.initializeStorageData(),this.RANKING=a.ranking||"PROXIMITY_AND_TIME"};r.default=g}],r={};function n(a){if(r[a])return r[a].exports;var o=r[a]={i:a,l:!1,exports:{}};return i[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=i,n.c=r,n.d=function(i,r,a){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:a})},n.r=function(i){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&"object"==typeof i&&i&&i.__esModule)return i;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:i}),2&r&&"string"!=typeof i)for(var o in i)n.d(a,o,(function(r){return i[r]}).bind(null,o));return a},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=0)}()},376935,(i,r,n)=>{"use strict";r.exports=function(){}},279120,(i,r,n)=>{i.e,r.exports=function(){"use strict";let i,r,n;function a(a,o){if(i)if(r){let a={};i(void 0,a),n=o(a);let s="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 = {}; ("+i+")(undefined, sharedChunk); ("+r+")(undefined, sharedChunk); self.onerror = null;";"u">typeof window&&window&&window.URL&&window.URL.createObjectURL&&(n.workerUrl=window.URL.createObjectURL(new Blob([s],{type:"text/javascript"})))}else r=o;else i=o}return a(["require","exports"],function(i,r){let n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w,T,E,S,A,C,I,k,R,M,L,P,O,D,F,N,j,z;var B="u">typeof Float32Array?Float32Array:Array;function U(i,r){var n=r[0],a=r[1],o=r[2],s=r[3],l=n*s-o*a;return l?(i[0]=s*(l=1/l),i[1]=-a*l,i[2]=-o*l,i[3]=n*l,i):null}function V(){var i=new B(9);return B!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[5]=0,i[6]=0,i[7]=0),i[0]=1,i[4]=1,i[8]=1,i}function H(i,r){var n=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=r[6],d=r[7],h=r[8];return i[0]=l*h-u*d,i[1]=o*d-a*h,i[2]=a*u-o*l,i[3]=u*c-s*h,i[4]=n*h-o
vendor: 6,597 bytes, line 2
2*c,i[5]=o*s-n*u,i[6]=s*d-l*c,i[7]=a*c-n*d,i[8]=n*l-a*s,i}function G(i,r,n){var a=r[0],o=r[1],s=r[2],l=r[3],u=r[4],c=r[5],d=r[6],h=r[7],f=r[8],p=n[0],m=n[1],g=n[2],_=n[3],y=n[4],v=n[5],x=n[6],b=n[7],w=n[8];return i[0]=p*a+m*l+g*d,i[1]=p*o+m*u+g*h,i[2]=p*s+m*c+g*f,i[3]=_*a+y*l+v*d,i[4]=_*o+y*u+v*h,i[5]=_*s+y*c+v*f,i[6]=x*a+b*l+w*d,i[7]=x*o+b*u+w*h,i[8]=x*s+b*c+w*f,i}function q(){var i=new B(16);return B!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i}function $(i){var r=new B(16);return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7],r[8]=i[8],r[9]=i[9],r[10]=i[10],r[11]=i[11],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15],r}function W(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function Y(i,r){var n=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=r[6],d=r[7],h=r[8],f=r[9],p=r[10],m=r[11],g=r[12],_=r[13],y=r[14],v=r[15],x=n*u-a*l,b=n*c-o*l,w=n*d-s*l,T=a*c-o*u,E=a*d-s*u,S=o*d-s*c,A=h*_-f*g,C=h*y-p*g,I=h*v-m*g,k=f*y-p*_,R=f*v-m*_,M=p*v-m*y,L=x*M-b*R+w*k+T*I-E*C+S*A;return L?(i[0]=(u*M-c*R+d*k)*(L=1/L),i[1]=(o*R-a*M-s*k)*L,i[2]=(_*S-y*E+v*T)*L,i[3]=(p*E-f*S-m*T)*L,i[4]=(c*I-l*M-d*C)*L,i[5]=(n*M-o*I+s*C)*L,i[6]=(y*w-g*S-v*b)*L,i[7]=(h*S-p*w+m*b)*L,i[8]=(l*R-u*I+d*A)*L,i[9]=(a*I-n*R-s*A)*L,i[10]=(g*E-_*w+v*x)*L,i[11]=(f*w-h*E-m*x)*L,i[12]=(u*C-l*k-c*A)*L,i[13]=(n*k-a*C+o*A)*L,i[14]=(_*b-g*T-y*x)*L,i[15]=(h*T-f*b+p*x)*L,i):null}function Z(i,r,n){var a=r[0],o=r[1],s=r[2],l=r[3],u=r[4],c=r[5],d=r[6],h=r[7],f=r[8],p=r[9],m=r[10],g=r[11],_=r[12],y=r[13],v=r[14],x=r[15],b=n[0],w=n[1],T=n[2],E=n[3];return i[0]=b*a+w*u+T*f+E*_,i[1]=b*o+w*c+T*p+E*y,i[2]=b*s+w*d+T*m+E*v,i[3]=b*l+w*h+T*g+E*x,i[4]=(b=n[4])*a+(w=n[5])*u+(T=n[6])*f+(E=n[7])*_,i[5]=b*o+w*c+T*p+E*y,i[6]=b*s+w*d+T*m+E*v,i[7]=b*l+w*h+T*g+E*x,i[8]=(b=n[8])*a+(w=n[9])*u+(T=n[10])*f+(E=n[11])*_,i[9]=b*o+w*c+T*p+E*y,i[10]=b*s+w*d+T*m+E*v,i[11]=b*l+w*h+T*g+E*x,i[12]=(b=n[12])*a+(w=n[13])*u+(T=n[14])*f+(E=n[15])*_,i[13]=b*o+w*c+T*p+E*y,i[14]=b*s+w*d+T*m+E*v,i[15]=b*l+w*h+T*g+E*x,i}function K(i,r,n){var a,o,s,l,u,c,d,h,f,p,m,g,_=n[0],y=n[1],v=n[2];return r===i?(i[12]=r[0]*_+r[4]*y+r[8]*v+r[12],i[13]=r[1]*_+r[5]*y+r[9]*v+r[13],i[14]=r[2]*_+r[6]*y+r[10]*v+r[14],i[15]=r[3]*_+r[7]*y+r[11]*v+r[15]):(o=r[1],s=r[2],l=r[3],u=r[4],c=r[5],d=r[6],h=r[7],f=r[8],p=r[9],m=r[10],g=r[11],i[0]=a=r[0],i[1]=o,i[2]=s,i[3]=l,i[4]=u,i[5]=c,i[6]=d,i[7]=h,i[8]=f,i[9]=p,i[10]=m,i[11]=g,i[12]=a*_+u*y+f*v+r[12],i[13]=o*_+c*y+p*v+r[13],i[14]=s*_+d*y+m*v+r[14],i[15]=l*_+h*y+g*v+r[15]),i}function X(i,r,n){var a=n[0],o=n[1],s=n[2];return i[0]=r[0]*a,i[1]=r[1]*a,i[2]=r[2]*a,i[3]=r[3]*a,i[4]=r[4]*o,i[5]=r[5]*o,i[6]=r[6]*o,i[7]=r[7]*o,i[8]=r[8]*s,i[9]=r[9]*s,i[10]=r[10]*s,i[11]=r[11]*s,i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],i}function Q(i,r,n){var a=Math.sin(n),o=Math.cos(n),s=r[4],l=r[5],u=r[6],c=r[7],d=r[8],h=r[9],f=r[10],p=r[11];return r!==i&&(i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15]),i[4]=s*o+d*a,i[5]=l*o+h*a,i[6]=u*o+f*a,i[7]=c*o+p*a,i[8]=d*o-s*a,i[9]=h*o-l*a,i[10]=f*o-u*a,i[11]=p*o-c*a,i}function J(i,r,n){var a=Math.sin(n),o=Math.cos(n),s=r[0],l=r[1],u=r[2],c=r[3],d=r[8],h=r[9],f=r[10],p=r[11];return r!==i&&(i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15]),i[0]=s*o-d*a,i[1]=l*o-h*a,i[2]=u*o-f*a,i[3]=c*o-p*a,i[8]=s*a+d*o,i[9]=l*a+h*o,i[10]=u*a+f*o,i[11]=c*a+p*o,i}function ee(i,r,n){var a=Math.sin(n),o=Math.cos(n),s=r[0],l=r[1],u=r[2],c=r[3],d=r[4],h=r[5],f=r[6],p=r[7];return r!==i&&(i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15]),i[0]=s*o+d*a,i[1]=l*o+h*a,i[2]=u*o+f*a,i[3]=c*o+p*a,i[4]=d*o-s*a,i[5]=h*o-l*a,i[6]=f*o-u*a,i[7]=p*o-c*a,i}function et(i,r){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=r[0],i[13]=r[1],i[14]=r[2],i[15]=1,i}function ei(i,r){return i[0]=r[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=r[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=r[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function er(i,r,n){var a,o,s,l=n[0],u=n[1],c=n[2],d=Math.sqrt(l*l+u*u+c*c);return d<1e-6?null:(l*=d=1/d,u*=d,c*=d,a=Math.sin(r),o=Math.cos(r),i[0]=l*l*(s=1-o)+o,i[1]=u*l*s+c*a,i[2]=c*l*s-u*a,i[3]=0,i[4]=l*u*s-c*a,i[5]=u*u*s+o,i[6]=c*u*s+l*a,i[7]=0,i[8]=l*c*s+u*a,i[9]=u*c*s-l*a,i[10]=c*c*s+o,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i)}function en(i,r){var n=r[0],a=r[1],o=r[2],s=r[4],l=r[5],u=r[6],c=r[8],d=r[9],h=r[10];return i[0]=Math.sqrt(n*n+a*a+o*o),i[1]=Math.sqrt(s*s+l*l+u*u),i[2]=Math.sqrt(c*c+d*d+h*h),i}function ea(i,r){var n=r[0],a=r[1],o=r[2],s=r[3],l=n+n,u=a+a,c=o+o,d=n*l,h=a*l,f=a*u,p=o*l,m=o*u,g=o*c,_=s*l,y=s*u,v=s*c;return i[0]=1-f-g,i[1]=h+v,i[2]=p-y,i[3]=0,i[4]=h-v,i[5]=1-d-g,i[6]=m+_,i[7]=0,i[8]=p+y,i[9]=m-_,i[10]=1-d-f,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function eo(){var i=new B(3);return B!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i}function es(i){var r=new B(3);return r[0]=i[0],r[1]=i[1],r[2]=i[2],r}function el(i){var r=i[0],n=i[1],a=i[2];return Math.sqrt(r*r+n*n+a*a)}function eu(i,r,n){var a=new B(3);return a[0]=i,a[1]=r,a[2]=n,a}function ec(i,r,n,a){return i[0]=r,i[1]=n,i[2]=a,i}function ed(i,r,n){return i[0]=r[0]+n[0],i[1]=r[1]+n[1],i[2]=r[2]+n[2],i}function eh(i,r,n){return i[0]=r[0]-n[0],i[1]=r[1]-n[1],i[2]=r[2]-n[2],i}function ef(i,r,n){return i[0]=r[0]*n[0],i[1]=r[1]*n[1],i[2]=r[2]*n[2],i}function ep(i,r,n){return i[0]=Math.min(r[0],n[0]),i[1]=Math.min(r[1],n[1]),i[2]=Math.min(r[2],n[2]),i}function em(i,r,n){return i[0]=Math.max(r[0],n[0]),i[1]=Math.max(r[1],n[1]),i[2]=Math.max(r[2],n[2]),i}function eg(i,r,n){return i[0]=r[0]*n,i[1]=r[1]*n,i[2]=r[2]*n,i}function e_(i,r,n,a){return i[0]=r[0]+n[0]*a,i[1]=r[1]+n[1]*a,i[2]=r[2]+n[2]*a,i}function ey(i,r){var n=r[0]-i[0],a=r[1]-i[1],o=r[2]-i[2];return Math.sqrt(n*n+a*a+o*o)}function ev(i,r){var n=r[0]-i[0],a=r[1]-i[1],o=r[2]-i[2];return n*n+a*a+o*o}function ex(i){var r=i[0],n=i[1],a=i[2];return r*r+n*n+a*a}function eb(i,r){return i[0]=-r[0],i[1]=-r[1],i[2]=-r[2],i}function ew(i,r){var n=r[0],a=r[1],o=r[2],s=n*n+a*a+o*o;return s>0&&(s=1/Math.sqrt(s)),i[0]=r[0]*s,i[1]=r[1]*s,i[2]=r[2]*s,i}function eT(i,r){return i[0]*r[0]+i[1]*r[1]+i[2]*r[2]}function eE(i,r,n){var a=r[0],o=r[1],s=r[2],l=n[0],u=n[1],c=n[2];return i[0]=o*c-s*u,i[1]=s*l-a*c,i[2]=a*u-o*l,i}function eS(i,r,n,a){var o=r[0],s=r[1],l=r[2];return i[0]=o+a*(n[0]-o),i[1]=s+a*(n[1]-s),i[2]=l+a*(n[2]-l),i}function eA(i,r,n){var a=r[0],o=r[1],s=r[2],l=n[3]*a+n[7]*o+n[11]*s+n[15];
2return i[0]=(n[0]*a+n[4]*o+n[8]*s+n[12])/(l=l||1),i[1]=(n[1]*a+n[5]*o+n[9]*s+n[13])/l,i[2]=(n[2]*a+n[6]*o+n[10]*s+n[14])/l,i}function eC(i,r,n){var a=r[0],o=r[1],s=r[2];return i[0]=a*n[0]+o*n[3]+s*n[6],i[1]=a*n[1]+o*n[4]+s*n[7],i[2]=a*n[2]+o*n[5]+s*n[8],i}function eI(i,r,n){var a=n[0],o=n[1],s=n[2],l=n[3],u=r[0],c=r[1],d=r[2],h=o*d-s*c,f=s*u-a*d,p=a*c-o*u;return i[0]=u+l*(h+=h)+o*(p+=p)-s*(f+=f),i[1]=c+l*f+s*h-a*p,i[2]=d+l*p+a*f-o*h,i}function ek(i){return i[0]=0,i[1]=0,i[2]=0,i}function eR(i,r){return i[0]===r[0]&&i[1]===r[1]&&i[2]===r[2]}function eM(){var i=new B(4);return B!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0,i[3]=0),i}function eL(i,r,n){return i[0]=r[0]*n,i[1]=r[1]*n,i[2]=r[2]*n,i[3]=r[3]*n,i}function eP(i,r){var n=r[0],a=r[1],o=r[2],s=r[3],l=n*n+a*a+o*o+s*s;return l>0&&(l=1/Math.sqrt(l)),i[0]=n*l,i[1]=a*l,i[2]=o*l,i[3]=s*l,i}function eO(i,r,n){var a=r[0],o=r[1],s=r[2],l=r[3];return i[0]=n[0]*a+n[4]*o+n[8]*s+n[12]*l,i[1]=n[1]*a+n[5]*o+n[9]*s+n[13]*l,i[2]=n[2]*a+n[6]*o+n[10]*s+n[14]*l,i[3]=n[3]*a+n[7]*o+n[11]*s+n[15]*l,i}function eD(){var i=new B(4);return B!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i[3]=1,i}function eF(i){return i[0]=0,i[1]=0,i[2]=0,i[3]=1,i}function eN(i,r,n){n*=.5;var a=r[0],o=r[1],s=r[2],l=r[3],u=Math.sin(n),c=Math.cos(n);return i[0]=a*c+l*u,i[1]=o*c+s*u,i[2]=s*c-o*u,i[3]=l*c-a*u,i}function ej(i,r,n){n*=.5;var a=r[0],o=r[1],s=r[2],l=r[3],u=Math.sin(n),c=Math.cos(n);return i[0]=a*c-s*u,i[1]=o*c+l*u,i[2]=s*c+a*u,i[3]=l*c-o*u,i}eo(),eM();var ez,eB,eU,eV=(ez=eo(),eB=eu(1,0,0),eU=eu(0,1,0),function(i,r,n){var a,o,s=eT(r,n);return s<-.999999?(eE(ez,eB,r),1e-6>el(ez)&&eE(ez,eU,r),ew(ez,ez),o=Math.sin(a=.5*Math.PI),i[0]=o*ez[0],i[1]=o*ez[1],i[2]=o*ez[2],i[3]=Math.cos(a),i):s>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(eE(ez,r,n),i[0]=ez[0],i[1]=ez[1],i[2]=ez[2],i[3]=1+s,eP(i,i))});function eH(){var i=new B(2);return B!=Float32Array&&(i[0]=0,i[1]=0),i}function eG(i,r){var n=new B(2);return n[0]=i,n[1]=r,n}function eq(i,r,n){return i[0]=r[0]+n[0],i[1]=r[1]+n[1],i}function e$(i,r,n){return i[0]=r[0]-n[0],i[1]=r[1]-n[1],i}function eW(i,r,n){return i[0]=r[0]*n,i[1]=r[1]*n,i}function eY(i){var r=i[0],n=i[1];return Math.sqrt(r*r+n*n)}function eZ(i,r){var n=r[0],a=r[1],o=n*n+a*a;return o>0&&(o=1/Math.sqrt(o)),i[0]=r[0]*o,i[1]=r[1]*o,i}function eK(i,r){return i[0]*r[0]+i[1]*r[1]}function eX(i,r,n,a){let o=3*i,s=3*(n-i)-o,l=1-o-s,u=3*r,c=3*(a-r)-u,d=1-u-c;return function(i,r=1e-6){if(i<=0)return 0;if(i>=1)return 1;let n=i;for(let a=0;a<8;a++){let a=((l*n+s)*n+o)*n-i;if(Math.abs(a)<r)return((d*n+c)*n+u)*n;let h=(3*l*n+2*s)*n+o;if(1e-6>Math.abs(h))break;n-=a/h}let a=0,h=1;n=i;for(let u=0;u<20;u++){let u=((l*n+s)*n+o)*n;if(Math.abs(u-i)<r)break;
2i>u?a=n:h=n,n=.5*(a+h)}return((d*n+c)*n+u)*n}}function eQ(i,r){this.x=i,this.y=r}function eJ(i,r){if(Array.isArray(i)){if(!Array.isArray(r)||i.length!==r.length)return!1;for(let n=0;n<i.length;n++)if(!eJ(i[n],r[n]))return!1;return!0}if("object"==typeof i&&null!==i&&null!==r){if("object"!=typeof r||Object.keys(i).length!==Object.keys(r).length)return!1;for(let n in i)if(!eJ(i[n],r[n]))return!1;return!0}return i===r}function e1(i,r,n){let a=i[r];i[r]=i[n],i[n]=a}eD(),eD(),V();function e0(i,r){return r.area-i.area}function e2(i,r){let n,a,o=i.length;if(o<=1)return[i];let s=[];for(let r=0;r<o;r++){let o=function(i){let r=0;for(let n,a,o=0,s=i.length,l=s-1;o<s;l=o++)n=i[o],r+=((a=i[l]).x-n.x)*(n.y+a.y);return r}(i[r]);0!==o&&(i[r].area=Math.abs(o),void 0===a&&(a=o<0),a===o<0?(n&&s.push(n),n=[i[r]]):n.push(i[r]))}if(n&&s.push(n),r>1)for(let i=0;i<s.length;i++)s[i].length<=r||(function i(r,n,a=0,o=r.length-1,s=function(i,r){return i<r?-1:+(i>r)}){for(;o>a;){if(o-a>600){let l=o-a+1,u=n-a+1,c=Math.log(l),d=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*d*(l-d)/l)*(u-l/2<0?-1:1);i(r,n,Math.max(a,Math.floor(n-u*d/l+h)),Math.min(o,Math.floor(n+(l-u)*d/l+h)),s)}let l=r[n],u=a,c=o;for(e1(r,a,n),s(r[o],l)>0&&e1(r,a,o);u<c;){for(e1(r,u,c),u++,c--;0>s(r[u],l);)u++;for(;s(r[c],l)>0;)c--}0===s(r[a],l)?e1(r,a,c):e1(r,++c,o),c<=n&&(a=c+1),n<=c&&(o=c-1)}}(s[i],r,1,s[i].length-1,e0),s[i]=s[i].slice(0,r));return s}function e5(i,r){i[0]=Math.min(i[0],r[0]),i[1]=Math.min(i[1],r[1]),i[2]=Math.max(i[2],r[0]),i[3]=Math.max(i[3],r[1])}function e4(i,r){return!(i[0]<=r[0]||i[2]>=r[2]||i[1]<=r[1]||i[3]>=r[3])}function e9(i,r,n=!1){let a=!1;for(let o=0,s=r.length;o<s;o++){let s=r[o];for(let r=0,o=s.length,l=o-1;r<o;l=r++){let o=s[l],u=s[r];if(function(i,r,n){let a=i[0]-r[0],o=i[1]-r[1],s=i[0]-n[0],l=i[1]-n[1];return a*l-s*o==0&&a*s<=0&&o*l<=0}(i,o,u))return n;o[1]>i[1]!=u[1]>i[1]&&i[0]<(u[0]-o[0])*(i[1]-o[1])/(u[1]-o[1])+o[0]&&(a=!a)}}return a}function e3(i,r,n,a){let o=a[0]-n[0],s=a[1]-n[1],l=(i[0]-n[0])*s-o*(i[1]-n[1]),u=(r[0]-n[0])*s-o*(r[1]-n[1]);return l>0&&u<0||l<0&&u>0}function e8(i,r,n,a){var o,s;return 0!=(o=[a[0]-n[0],a[1]-n[1]])[0]*(s=[r[0]-i[0],r[1]-i[1]])[1]-o[1]*s[0]&&!(!e3(i,r,n,a)||!e3(n,a,i,r))}function e6(i){let r=new eQ(1/0,1/0),n=new eQ(-1/0,-1/0);for(let a of i[0])r.x>a.x&&(r.x=a.x),r.y>a.y&&(r.y=a.y),n.x<a.x&&(n.x=a.x),n.y<a.y&&(n.y=a.y);return{min:r,max:n}}eH(),eQ.prototype={clone(){return new eQ(this.x,this.y)},add(i){return this.clone()._add(i)},sub(i){return this.clone()._sub(i)},multByPoint(i){return this.clone()._multByPoint(i)},divByPoint(i){return this.clone()._divByPoint(i)},mult(i){return this.clone()._mult(i)},div(i){return this.clone()._div(i)},rotate(i){return this.clone()._rotate(i)},rotateAround(i,r){return this.clone()._rotateAround(i,r)},matMult(i){return this.clone()._matMult(i)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(i){return this.x===i.x&&this.y===i.y},dist(i){return Math.sqrt(this.distSqr(i))},distSqr(i){let r=i.x-this.x,n=i.y-this.y;return r*r+n*n},angle(){return Math.atan2(this.y,this.x)},angleTo(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith(i){return this.angleWithSep(i.x,i.y)},angleWithSep(i,r){return Math.atan2(this.x*r-this.y*i,this.x*i+this.y*r)},_matMult(i){let r=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=r,this},_add(i){return this.x+=i.x,this.y+=i.y,this},_sub(i){return this.x-=i.x,this.y-=i.y,this},_mult(i){return this.x*=i,this.y*=i,this},_div(i){return this.x/=i,this.y/=i,this},_multByPoint(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint(i){return this.x/=i.x,this.y/=i.y,this},_unit(){return this._div(this.mag()),this},_perp(){let i=this.y;return this.y=this.x,this.x=-i,this},_rotate(i){let r=Math.cos(i),n=Math.sin(i),a=n*this.x+r*this.y;return this.x=r*this.x-n*this.y,this.y=a,this},_rotateAround(i,r){let n=Math.cos(i),a=Math.sin(i),o=r.y+a*(this.x-r.x)+n*(this.y-r.y);return this.x=r.x+n*(this.x-r.x)-a*(this.y-r.y),this.y=o,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:eQ},eQ.convert=function(i){if(i instanceof eQ)return i;if(Array.isArray(i))return new eQ(+i[0],+i[1]);if(void 0!==i.x&&void 0!==i.y)return new eQ(+i.x,+i.y);throw Error("Expected [x, y] or {x, y} point format")};let e7=Math.PI/180,te=180/Math.PI,tt=/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,ti=/\b(iPad|iPhone|iPod)\b/,tr=/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/,tn=[[0,0],[1,0],[1,1],[0,1]];function ta(i){if(i<=0)return 0;if(i>=1)return 1;let r=i*i,n=r*i;return 4*(i<.5?n:3*(i-r)+n-.75)}let to=eX(.25,.1,.25,1);
2function ts(i,r,n){return Math.min(n,Math.max(r,i))}function tl(i,r,n){return(n=ts((n-i)/(r-i),0,1))*n*(3-2*n)}function tu(i,r,n){let a=n-r,o=((i-r)%a+a)%a+r;return o===r?n:o}function tc(i,r,n){if(!i.length)return n(null,[]);let a=i.length,o=Array(i.length),s=null;i.forEach((i,l)=>{r(i,(i,r)=>{i&&(s=i),o[l]=r,0==--a&&n(s,o)})})}function td(i,r){let n={};for(let a=0;a<r.length;a++){let o=r[a];o in i&&(n[o]=i[o])}return n}let th=1;function tf(){return th++}function tp(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log2(i)))}function tm(i,r){i.forEach(i=>{r[i]&&(r[i]=r[i].bind(r))})}function tg(i,r,n){let a={};for(let n in i)a[n]=r.call(this,i[n],n,i);return a}function t_(i,r,n){let a={};for(let n in i)r.call(this,i[n],n,i)&&(a[n]=i[n]);return a}function ty(i){return Array.isArray(i)?i.map(ty):"object"==typeof i&&i?tg(i,ty):i}function tv(i,r){for(let n=0;n<i.length;n++)if(r.includes(i[n]))return!0;return!1}let tx={};function tb(i){tx[i]||("u">typeof console&&console.warn(i),tx[i]=!0)}function tw(i,r,n){return(n.y-i.y)*(r.x-i.x)>(r.y-i.y)*(n.x-i.x)}function tT([i,r,n]){let a=(r+90)*e7,o=n*e7;return{x:i*Math.cos(a)*Math.sin(o),y:i*Math.sin(a)*Math.sin(o),z:i*Math.cos(o),azimuthal:r,polar:n}}function tE(i){return("u">typeof self||void 0!==i)&&"u">typeof WorkerGlobalScope&&(void 0!==i?i:self)instanceof WorkerGlobalScope}function tS(i){let r={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,n,a,o)=>{let s=a||o;return r[n]=!s||s.toLowerCase(),""}),r["max-age"]){let i=parseInt(r["max-age"],10);isNaN(i)?delete r["max-age"]:r["max-age"]=i}return r}let tA,tC,tI,tk,tR,tM,tL,tP=null;function tO(i,r){return[i[4*r],i[4*r+1],i[4*r+2],i[4*r+3]]}function tD(i,r,n,a){for(;r<n;){let o=r+n>>1;i[o]<a?r=o+1:n=o}return r}function tF(i,r,n,a){for(;r<n;){let o=r+n>>1;i[o]<=a?r=o+1:n=o}return r}function tN(i){return i>0?1/(1.001-i):1+i}function tj(i){return i>0?1-1/(1.001-i):-i}function tz(i,r,n){return(i-r.min)*(n.max-n.min)/(r.max-r.min)+n.min}function tB(){return null==tC&&(tC=self.OffscreenCanvas&&!!new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),tC}let tU={requestIdleCallback:i=>{if("u">typeof requestIdleCallback)return requestIdleCallback(i);setTimeout(()=>i({didTimeout:!1,timeRemaining:()=>50}),0)},now:()=>void 0!==tR?tR:performance.now(),setNow(i){tR=i},restoreNow(){tR=void 0},frame(i){let r=requestAnimationFrame(i);return{cancel:()=>cancelAnimationFrame(r)}},getImageData(i,r=0){let{width:n,height:a}=i;tM||(tM=document.createElement("canvas"));let o=tM.getContext("2d",{willReadFrequently:!0});if(!o)throw Error("failed to create canvas 2d context");return(n>tM.width||a>tM.height)&&(tM.width=n,tM.height=a),o.clearRect(-r,-r,n+2*r,a+2*r),o.drawImage(i,0,0,n,a),o.getImageData(-r,-r,n+2*r,a+2*r)},resolveURL:i=>(tI||(tI=document.createElement("a")),tI.href=i,tI.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==tk&&(tk=window.matchMedia("(prefers-reduced-motion: reduce)")),tk.matches)},hasCanvasFingerprintNoise(){if(void 0!==tL)return tL;if(!tB())return tL=!1,!1;let i=new OffscreenCanvas(85,1),r=i.getContext("2d",{willReadFrequently:!0}),n=0;for(let a=0;a<i.width;++a)r.fillStyle=`rgba(${n++},${n++},${n++}, 255)`,r.fillRect(a,0,1,1);let a=r.getImageData(0,0,i.width,i.height);n=0;for(let i=0;i<a.data.length;++i)if(i%4!=3&&n++!==a.data[i])return tL=!0,!0;return tL=!1,!1}},tV={API_URL:"https://api.mapbox.com",API_URL_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i,API_TILEJSON_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i,API_SPRITE_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i,API_FONTS_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i,API_STYLE_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i,API_CDN_URL_REGEX:/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i,get EVENTS_URL(){if(!tV.API_URL)return null;try{let i=new URL(tV.API_URL);return"api.mapbox.cn"===i.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===i.hostname?"https://events.mapbox.com/events/v2":null}catch(i){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MES
2HOPT_URL:"/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"/mapbox-gl-js/meshopt_simd_v0.20.wasm",BUILDING_GEN_URL:"/mapbox-gl-js/building-gen/building_gen_v1.2.4.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1",TILE_PROVIDER_URLS:Object.assign(Object.create(null),{pmtiles:"/mapbox-gl-js/plugins/mapbox-gl-pmtiles-provider/v0.0.2/mapbox-gl-pmtiles-provider.js"})};function tH(){return new URL(tV.DRACO_URL,tV.API_URL).href}function tG(){if("object"!=typeof WebAssembly)throw Error("WebAssembly not supported, cannot instantiate meshoptimizer");return new URL(!function(){if(void 0===tA){if("object"!=typeof WebAssembly)return!1;let i=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);tA=WebAssembly.validate(i)}return tA}()?tV.MESHOPT_URL:tV.MESHOPT_SIMD_URL,tV.API_URL).href}function tq(){return new URL(tV.BUILDING_GEN_URL,tV.API_URL).href}function t$(i){return tV.API_URL_REGEX.test(i)}function tW(i){return tV.API_SPRITE_REGEX.test(i)}function tY(i,r){let n=i.indexOf("?");if(n<0)return`${i}?${new URLSearchParams(r).toString()}`;let a=new URLSearchParams(i.slice(n));for(let i in r)a.set(i,r[i]);return`${i.slice(0,n)}?${a.toString()}`}
2function tZ(i,r={persistentParams:[]}){let n=i.indexOf("?");if(n<0)return i;let a=new URLSearchParams,o=new URLSearchParams(i.slice(n));for(let i of r.persistentParams){let r=o.get(i);r&&a.set(i,r)}let s=a.toString();return`${i.slice(0,n)}${s.length>0?`?${s}`:""}`}let tK="mapbox-tiles",tX=500,tQ=50,tJ=["language","worldview","jobid"];function t1(){try{return caches}catch(i){}}function t0(){let i=t1();i&&null==n&&(n=i.open(tK))}let t2=1/0,t5={supported:!1,testSupport:function(i){!t3&&t9&&(t8?t7(i):t4=i)}},t4,t9,t3=!1,t8=!1,t6="u">typeof self?self:{};function t7(i){let r=i.createTexture();i.bindTexture(i.TEXTURE_2D,r);try{if(i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,t9),i.isContextLost())return;t5.supported=!0}catch(i){}i.deleteTexture(r),t3=!0}t6.document&&((t9=t6.document.createElement("img")).onload=function(){t4&&t7(t4),t4=null,t8=!0},t9.onerror=function(){t3=!0,t4=null},t9.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");let ie={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};Object.freeze(ie);class it extends Error{constructor(i,r,n){401===r&&t$(n)&&(i+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(i),this.status=r,this.url=n}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}function ii(i){return"object"==typeof i&&null!==i&&"status"in i&&404===i.status}let ir=tE()?()=>self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,ia=/^\w+:/,io=/[\r\n]+/,is=function(i,r){var a,o;let s,l,u,c,d,h,f;return(a=i.url).startsWith("file:")||ir().startsWith("file:")&&!ia.test(a)?function(i,r){let n=new XMLHttpRequest;for(let r in n.open(i.method||"GET",i.url,!0),"arrayBuffer"===i.type&&(n.responseType="arraybuffer"),i.headers)n.setRequestHeader(r,i.headers[r]);return"json"===i.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===i.credentials,n.onerror=()=>{r(Error(n.statusText))},n.onload=()=>{if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let a=n.response;if("json"===i.type)try{a=JSON.parse(n.response)}catch(i){return r(i)}let o=new Headers;n.getAllResponseHeaders().trim().split(io).forEach(i=>{let r=i.split(": "),n=r.shift(),a=r.join(": ");o.append(n,a)}),r(null,a,o)}else r(new it(n.statusText,n.status,i.url))},n.send(i.body),{cancel:()=>n.abort()}}(i,r):(s=new AbortController,l=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,referrer:ir(),referrerPolicy:i.referrerPolicy,signal:s.signal}),u=!1,c=!1,d=(o=l.url).indexOf("sku=")>0&&t$(o),"json"===i.type&&l.headers.set("Accept","application/json"),h=(n,a,o)=>{if(c)return;if(n&&"SecurityError"!==n.message&&tb(n.toString()),a&&o)return f(a);let s=Date.now();fetch(l).then(n=>{if(n.ok){let i=d?n.clone():null;return f(n,i,s)}return r(new it(n.statusText,n.status,i.url))}).catch(n=>{"AbortError"!==n.name&&r(Error(`${n.message} ${i.url}`))})},f=(a,o,s)=>{("arrayBuffer"===i.type?a.arrayBuffer():"json"===i.type?a.json():a.text()).then(i=>{c||(o&&s&&function(i,r,a){var o;if(t0(),null==n)return;let s=tS(r.headers.get("cache-control")||"");if(s["no-store"])return;let l={status:r.status,statusText:r.statusText,headers:new Headers};r.headers.forEach((i,r)=>l.headers.set(r,i)),s["max-age"]&&l.headers.set("Expires",new Date(a+1e3*s["max-age"]).toUTCString());let u=l.headers.get("expires");if(!u||new Date(u).getTime()-a<42e4)return;
2let c=tZ(i.url,{persistentParams:tJ});if(206===r.status){let r=i.headers.get("Range");if(!r)return;l.status=200,c=tY(c,{range:r})}let d=new Response(200!==(o=r.status)&&404!==o&&[101,103,204,205,304].includes(o)?null:r.body,l);t0(),null!=n&&n.then(i=>i.put(c,d)).catch(i=>tb(i.message))}(l,o,s),u=!0,r(null,i,a.headers))}).catch(i=>{c||r(Error(i.message))})},d?function(i,r){if(t0(),null==n)return r(null);n.then(n=>{let a=tZ(i.url,{persistentParams:tJ}),o=i.headers.get("Range");o&&(a=tY(a,{range:o})),n.match(a).then(i=>{let o=function(i){if(!i)return!1;let r=new Date(i.headers.get("expires")||0),n=tS(i.headers.get("cache-control")||"");return Number(r)>Date.now()&&!n["no-cache"]}(i);n.delete(a).catch(r),o&&n.put(a,i.clone()).catch(r),r(null,i,o)}).catch(r)}).catch(r)}(l,h):h(null,null),{cancel:()=>{c=!0,u||s.abort()}})},il=function(i,r){return is(Object.assign(i,{type:"json"}),r)},iu=function(i,r){return is(Object.assign(i,{type:"arrayBuffer"}),r)};a=[],o=0;let ic=function(i,r){if(t5.supported&&(i.headers||(i.headers={}),i.headers.accept="image/webp,*/*"),o>=tV.MAX_PARALLEL_IMAGE_REQUESTS){let n={requestParameters:i,callback:r,cancelled:!1,cancel(){this.cancelled=!0}};return a.push(n),n}o++;let n=!1,s=()=>{if(!n)for(n=!0,o--;a.length&&o<tV.MAX_PARALLEL_IMAGE_REQUESTS;){let i=a.shift(),{requestParameters:r,callback:n,cancelled:o}=i;o||(i.cancel=ic(r,n).cancel)}},l=iu(i,(i,n,a)=>{s(),i?r(i):n&&createImageBitmap(new Blob([new Uint8Array(n)],{type:"image/png"})).then(i=>{((i,n)=>r(i,n,a))(null,i)}).catch(i=>{((i,n)=>r(i,n,a))(Error(`Could not load image because of ${i.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})});return{cancel:()=>{l.cancel(),s()}}};function id(i,r=0){let n=i.length,a=n-(3&n),o,s=0|r,l=0;for(;l<a;)o=255&i.charCodeAt(l)|(255&i.charCodeAt(l+1))<<8|(255&i.charCodeAt(l+2))<<16|(255&i.charCodeAt(l+3))<<24,l+=4,s^=o=Math.imul(o=(o=Math.imul(o,0xcc9e2d51))<<15|o>>>17,0x1b873593),s=Math.imul(s=s<<13|s>>>19,5)+0xe6546b64|0;o=0;let u=3&n;return u>0&&(u>=3&&(o^=(255&i.charCodeAt(l+2))<<16),u>=2&&(o^=(255&i.charCodeAt(l+1))<<8),o^=255&i.charCodeAt(l),s^=o=Math.imul(o=(o=Math.imul(o,0xcc9e2d51))<<15|o>>>17,0x1b873593)),s^=n,s^=s>>>16,s=Math.imul(s,0x85ebca6b),s^=s>>>13,s=Math.imul(s,0xc2b2ae35),(s^=s>>>16)>>>0}class ih{constructor(i,...r){Object.assign(this,r[0]||{}),this.type=i}}class ip extends ih{constructor(i,r={}){super("error",Object.assign({error:i},r))}}function im(i,r,n){n[i]&&n[i].includes(r)||(n[i]=n[i]||[],n[i].push(r))}function ig(i,r,n){if(n&&n[i]){let a=n[i].indexOf(r);-1!==a&&n[i].splice(a,1)}}class i_{on(i,r){return this._listeners=this._listeners||{},im(i,r,this._listeners),this}off(i,r){return ig(i,r,this._listeners),ig(i,r,this._oneTimeListeners),this}once(i,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},im(i,r,this._oneTimeListeners),this):new Promise(r=>{this.once(i,r)})}fire(i,r){let n="string"==typeof i?new ih(i,r):i,a=n.type;if(this.listens(a)){for(let i of(n.target=this,this._listeners&&this._listeners[a]?this._listeners[a].slice():[]))i.call(this,n);for(let i of this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[])ig(a,i,this._oneTimeListeners),i.call(this,n);let i=this._eventedParent;i&&(Object.assign(n,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(n))}else n instanceof ip&&console.error(n.error);return this}listens(i){return!!(this._listeners&&this._listeners[i]&&this._listeners[i].length>0||this._oneTimeListeners&&this._oneTimeListeners[i]&&this._oneTimeListeners[i].length>0||this._eventedParent&&this._eventedParent.listens(i))}setEventedParent(i,r){return this._eventedParent=i,this._eventedParentData=r,this}}class iy{constructor(i){"string"==typeof i?this.name=i:(this.name=i.name,this.iconsetId=i.iconsetId)}static from(i){return new iy(i)}static toString(i){return i.iconsetId?`${i.name}�${i.iconsetId}`:i.name}static parse(i){let[r,n]=i.split("\x1f");return new iy({name:r,iconsetId:n})}static isEqual(i,r){return i.name===r.name&&i.iconsetId===r.iconsetId}toString(){return iy.toString(this)}serialize(){return{name:this.name,iconsetId:this.iconsetId}}}var iv,ix={},ib=function(){if(iv)return ix;iv=1;var i={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 r(i){return(i=Math.round(i))<0?0:i>255?255:i}function n(i){return r("%"===i[i.length-1]?parseFloat(i)/100*255:parseInt(i))}function a(i){var r;return(r="%"===i[i.length-1]?parseFloat(i)/100:parseFloat(i))<0?0:r>1?1:r}function o(i,r,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?i+(r-i)*n*6:2*n<1?r:3*n<2?i+(r-i)*(2/3-n)*6:i}try{ix.parseCSSColor=function(s){var l,u=s.replace(/ /g,"").toLowerCase();if(u in i)return i[u].slice();if("#"===u[0])return 4===u.length?(l=parseInt(u.substr(1),16))>=0&&l<=4095?[(3840&l)>>4|(3840&l)>>8,240&l|(240&l)>>4,15&l|(15&l)<<4,1]:null:7===u.length&&(l=parseInt(u.substr(1),16))>=0&&l<=0xffffff?[(0xff0000&l)>>16,(65280&l)>>8,255&l,1]:null;var c=u.indexOf("("),d=u.indexOf(")");if(-1!==c&&d+1===u.length){var h=u.substr(0,c),f=u.substr(c+1,d-(c+1)).split(","),p=1;switch(h){case"rgba":if(4!==f.length)break;p=a(f.pop());case"rgb":return 3!==f.length?null:[n(f[0]),n(f[1]),n(f[2]),p];case"hsla":if(4!==f.length)break;p=a(f.pop());case"hsl":if(3!==f.length)break;var m=(parseFloat(f[0])%360+360)%360/360,g=a(f[1]),_=a(f[2]),y=_<=.5?_*(g+1):_+g-_*g,v=2*_-y;return[r(255*o(v,y,m+1/3)),r(255*o(v,y,m)),r(255*o(v,y,m-1/3)),p]}}return null}}catch(i){}return ix}();function iw(i,r,n){return i*(1-n)+r*n}let iT=new Map;class iE{constructor(i,r,n,a=1){this.r=i,this.g=r,this.b=n,this.a=a}static parse(i){if(!i)return;if(i instanceof iE)return i;if("string"!=typeof i)return;let r=iT.get(i);if(r)return r;let n=ib.parseCSSColor(i);if(!n)return;let a=new iE(n[0]/255,n[1]/255,n[2]/255,n[3]);return iT.set(i,a),a}toString(){let{r:i,g:r,b:n,a:a}=this;return`rgba(${Math.round(255*i)},${Math.round(255*r)},${Math.round(255*n)},${a})`}toNonPremultipliedRenderColor(i){let{r:r,g:n,b:a,a:o}=this;return new iA(i,r,n,a,o)}toPremultipliedRenderColor(i){let{r:r,g:n,b:a,a:o}=this;return new iC(i,r*o,n*o,a*o,o)}clone(){return new iE(this.r,this.g,this.b,this.a)}}class iS{constructor(i,r,n,a,o,s=!1){if(this.premultiplied=!1,this.premultiplied=s,i){const s=i.image.height,l=s*s;this.premultiplied?(r=0===o?0:r/o*(s-1),n=0===o?0:n/o*(s-1),a=0===o?0:a/o*(s-1)):(r*=s-1,n*=s-1,a*=s-1),r=M
2ath.max(0,Math.min(s-1,r)),n=Math.max(0,Math.min(s-1,n)),a=Math.max(0,Math.min(s-1,a));const u=Math.floor(r),c=Math.floor(n),d=Math.floor(a),h=Math.ceil(r),f=Math.ceil(n),p=Math.ceil(a),m=r-u,g=n-c,_=a-d,y=i.image.data,v=4*(u+c*l+d*s),x=4*(u+c*l+p*s),b=4*(u+f*l+d*s),w=4*(u+f*l+p*s),T=4*(h+c*l+d*s),E=4*(h+c*l+p*s),S=4*(h+f*l+d*s),A=4*(h+f*l+p*s);this.r=iw(iw(iw(y[v],y[x],_),iw(y[b],y[w],_),g),iw(iw(y[T],y[E],_),iw(y[S],y[A],_),g),m)/255*(this.premultiplied?o:1),this.g=iw(iw(iw(y[v+1],y[x+1],_),iw(y[b+1],y[w+1],_),g),iw(iw(y[T+1],y[E+1],_),iw(y[S+1],y[A+1],_),g),m)/255*(this.premultiplied?o:1),this.b=iw(iw(iw(y[v+2],y[x+2],_),iw(y[b+2],y[w+2],_),g),iw(iw(y[T+2],y[E+2],_),iw(y[S+2],y[A+2],_),g),m)/255*(this.premultiplied?o:1),this.a=o}else this.r=r,this.g=n,this.b=a,this.a=o}toArray(){let{r:i,g:r,b:n,a:a}=this;return[255*i,255*r,255*n,a]}toHslaArray(){let i,{r:r,g:n,b:a,a:o}=this;if(this.premultiplied){if(0===o)return[0,0,0,0];let i=1/o;r*=i,n*=i,a*=i}let s=Math.min(Math.max(r,0),1),l=Math.min(Math.max(n,0),1),u=Math.min(Math.max(a,0),1),c=Math.min(s,l,u),d=Math.max(s,l,u),h=d-c,f=.5*(c+d);if(0===h)return[0,0,100*f,o];switch(d){case s:i=60*((l-u)/h+6*(l<u));break;case l:i=60*((u-s)/h+2);break;default:i=60*((s-l)/h+4)}return[i,100*(f>.5?h/(2-d-c):h/(d+c)),100*f,o]}toArray01(){let{r:i,g:r,b:n,a:a}=this;return[i,r,n,a]}toArray01Scaled(i){let{r:r,g:n,b:a}=this;return[r*i,n*i,a*i]}toArray01Linear(){let{r:i,g:r,b:n,a:a}=this;return[Math.pow(i,2.2),Math.pow(r,2.2),Math.pow(n,2.2),a]}}class iA extends iS{constructor(i,r,n,a,o){super(i,r,n,a,o,!1)}}class iC extends iS{constructor(i,r,n,a,o){super(i,r,n,a,o,!0)}}function iI(i,r,n){return i.map((i,a)=>iw(i,r[a],n))}iE.black=new iE(0,0,0,1),iE.white=new iE(1,1,1,1),iE.transparent=new iE(0,0,0,0),iE.red=new iE(1,0,0,1),iE.blue=new iE(0,0,1,1);var ik=Object.freeze({__proto__:null,array:iI,color:function(i,r,n){return new iE(iw(i.r,r.r,n),iw(i.g,r.g,n),iw(i.b,r.b,n),iw(i.a,r.a,n))},number:iw});class iR extends Error{constructor(i,r){super(r),this.message=r,this.key=i}}class iM{constructor(i,r=[]){for(const[n,a]of(this.parent=i,this.bindings={},r))this.bindings[n]=a}concat(i){return new iM(this,i)}get(i){if(this.bindings[i])return this.bindings[i];if(this.parent)return this.parent.get(i);throw Error(`${i} not found in scope.`)}has(i){return!!this.bindings[i]||!!this.parent&&this.parent.has(i)}}let iL={kind:"null"},iP={kind:"number"},iO={kind:"string"},iD={kind:"boolean"},iF={kind:"color"},iN={kind:"object"},ij={kind:"value"},iz={kind:"collator"},iB={kind:"formatted"},iU={kind:"resolvedImage"};function iV(i,r){return{kind:"array",itemType:i,N:r}}function iH(i){if("array"===i.kind){let r=iH(i.itemType);return"number"==typeof i.N?`array<${r}, ${i.N}>`:"value"===i.itemType.kind?"array":`array<${r}>`}return i.kind}let iG=[iL,iP,iO,iD,iF,iB,iN,iV(ij),iU];function iq(i,r){if("error"===r.kind)return null;if("array"===i.kind){if("array"===r.kind&&(0===r.N&&"value"===r.itemType.kind||!iq(i.itemType,r.itemType))&&("number"!=typeof i.N||i.N===r.N))return null}else{if(i.kind===r.kind)return null;if("value"===i.kind){for(let i of iG)if(!iq(i,r))return null}}return`Expected ${iH(i)} but found ${iH(r)} instead.`}function i$(i,r){return r.some(r=>r.kind===i.kind)}function iW(i,r){return r.some(r=>"null"===r?null===i:"array"===r?Array.isArray(i):"object"===r?i&&!Array.isArray(i)&&"object"==typeof i:r===typeof i)}function iY(i,r){return"array"===i.kind&&"array"===r.kind?i.N===r.N&&iY(i.itemType,r.itemType):i.kind===r.kind}class iZ{constructor(i,r,n){this.sensitivity=i?r?"variant":"case":r?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(i,r){return this.collator.compare(i,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class iK{constructor(i,r,n,a,o){this.text=i.normalize?i.normalize():i,this.image=r,this.scale=n,this.fontStack=a,this.textColor=o}}class iX{constructor(i){this.sections=i}static fromString(i){return new iX([new iK(i,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(i=>0!==i.text.length||!!i.image&&i.image.hasPrimary())}static factory(i){return i instanceof iX?i:iX.fromString(i)}toString(){return 0===this.sections.length?"":this.sections.map(i=>i.text).join("")}serialize(){let i=["format"];for(let r of this.sections){if(r.image){let n=r.image.getPrimary().id.toString();i.push(["image",n]);continue}i.push(r.text);let n={};r.fontStack&&(n["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(n["font-scale"]=r.scale),r.textColor&&(n["text-color"]=["rgba"].concat(r.textColor.toNonPremultipliedRenderColor(null).toArray())),i.push(n)}return i}}class iQ{constructor(i,r={}){this.id=iy.from(i),this.params=r.params,this.sx=r.sx||1,this.sy=r.sy||1}toString(){return JSON.stringify(this)}static parse(i){let r,n,a,o;try{({id:r,params:n,sx:a,sy:o}=JSON.parse(i)||{})}catch(i){return null}return r?new iQ(r,{params:n,sx:a,sy:o}):null}scaleSelf(i,r=i){return this.sx*=i,this.sy*=r,this}}class iJ{constructor(i,r,n,a,o=!1){this.primaryId=iy.from(i),this.primaryOptions=r,n&&(this.secondaryId=iy.from(n)),this.secondaryOptions=a,this.available=o}toString(){return this.primaryId&&this.secondaryId?`[${this.primaryId.name},${this.secondaryId.name}]`:this.primaryId.name}hasPrimary(){return!!this.primaryId}getPrimary(){return new iQ(this.primaryId,this.primaryOptions)}hasSecondary(){return!!this.secondaryId}getSecondary(){return this.secondaryId?new iQ(this.secondaryId,this.secondaryOptions):null}static from(i){return"string"==typeof i?iJ.build({name:i}):i}static build(i,r,n,a){return i&&("object"!=typeof i||"name"in i)?new iJ(i,n,r,a):null}}function i1(i,r,n,a){return"number"==typeof i&&i>=0&&i<=255&&"number"==typeof r&&r>=0&&r<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===a||"number"==typeof a&&a>=0&&a<=1?null:`Invalid rgba value [${[i,r,n,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof a?[i,r,n,a]:[i,r,n]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function i0(i){if(null===i||"string"==typeof i||"boolean"==typeof i||"number"==typeof i||i instanceof iE||i instanceof iZ||i instanceof iX||i instanceof iJ)return!0;
2if(Array.isArray(i)){for(let r of i)if(!i0(r))return!1;return!0}if("object"==typeof i){for(let r in i)if(!i0(i[r]))return!1;return!0}return!1}function i2(i){if(null===i)return iL;if("string"==typeof i)return iO;if("boolean"==typeof i)return iD;if("number"==typeof i)return iP;if(i instanceof iE)return iF;if(i instanceof iZ)return iz;if(i instanceof iX)return iB;if(i instanceof iJ)return iU;if(Array.isArray(i)){let r,n=i.length;for(let n of i){let i=i2(n);if(r){if(r===i)continue;r=ij;break}r=i}return iV(r||ij,n)}return iN}function i5(i){return null===i?"":"string"==typeof i||"number"==typeof i||"boolean"==typeof i?String(i):i instanceof iX||i instanceof iJ||i instanceof iE?i.toString():JSON.stringify(i)}class i4{constructor(i,r){this.type=i,this.value=r}static parse(i,r){if(2!==i.length)return r.error(`'literal' expression requires exactly one argument, but found ${i.length-1} instead.`);if(!i0(i[1]))return r.error("invalid value");let n=i[1],a=i2(n),o=r.expectedType;return"array"===a.kind&&0===a.N&&o&&"array"===o.kind&&("number"!=typeof o.N||0===o.N)&&(a=o),new i4(a,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof iE?["rgba"].concat(this.value.toNonPremultipliedRenderColor(null).toArray()):this.value instanceof iX?this.value.serialize():this.value}}class i9{constructor(i){this.name="ExpressionEvaluationError",this.message=i}toJSON(){return this.message}}let i3={string:iO,number:iP,boolean:iD,object:iN};class i8{constructor(i,r){this.type=i,this.args=r}static parse(i,r){if(i.length<2)return r.error("Expected at least one argument.");let n,a=1,o=i[0];if("array"===o){let o,s;if(i.length>2){let n=i[1];if("string"!=typeof n||!(n in i3)||"object"===n)return r.error('The item type argument of "array" must be one of string, number, boolean',1);o=i3[n],a++}else o=ij;if(i.length>3){if(null!==i[2]&&("number"!=typeof i[2]||i[2]<0||i[2]!==Math.floor(i[2])))return r.error('The length argument to "array" must be a positive integer literal',2);s=i[2],a++}n=iV(o,s)}else n=i3[o];let s=[];for(;a<i.length;a++){let n=r.parse(i[a],a,ij);if(!n)return null;s.push(n)}return new i8(n,s)}evaluate(i){for(let r=0;r<this.args.length;r++){let n=this.args[r].evaluate(i);if(!iq(this.type,i2(n)))return n;if(r===this.args.length-1)throw new i9(`The expression ${JSON.stringify(this.args[r].serialize())} evaluated to ${iH(i2(n))} but was expected to be of type ${iH(this.type)}.`)}return null}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}serialize(){let i=this.type,r=[i.kind];if("array"===i.kind){let n=i.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){r.push(n.kind);let a=i.N;("number"==typeof a||this.args.length>1)&&r.push(a)}}return r.concat(this.args.map(i=>i.serialize()))}}class i6{constructor(i){this.type=iB,this.sections=i}static parse(i,r){if(i.length<2)return r.error("Expected at least one argument.");let n=i[1];if(!Array.isArray(n)&&"object"==typeof n)return r.error("First argument must be an image or text section.");let a=[],o=!1;for(let n=1;n<=i.length-1;++n){let s=i[n];if(o&&"object"==typeof s&&!Array.isArray(s)){o=!1;let i=null;if(s["font-scale"]&&!(i=r.parseObjectValue(s["font-scale"],n,"font-scale",iP)))return null;let l=null;if(s["text-font"]&&!(l=r.parseObjectValue(s["text-font"],n,"text-font",iV(iO))))return null;let u=null;if(s["text-color"]&&!(u=r.parseObjectValue(s["text-color"],n,"text-color",iF)))return null;let c=a.at(-1);c.scale=i,c.font=l,c.textColor=u}else{let s=r.parse(i[n],n,ij);if(!s)return null;let l=s.type.kind;if("string"!==l&&"value"!==l&&"null"!==l&&"resolvedImage"!==l)return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,a.push({content:s,scale:null,font:null,textColor:null})}}return new i6(a)}evaluate(i){return new iX(this.sections.map(r=>{let n=r.content.evaluate(i);return iY(i2(n),iU)?new iK("",n,null,null,null):new iK(i5(n),null,r.scale?r.scale.evaluate(i):null,r.font?r.font.evaluate(i).join(","):null,r.textColor?r.textColor.evaluate(i):null)}))}eachChild(i){for(let r of this.sections)i(r.content),r.scale&&i(r.scale),r.font&&i(r.font),r.textColor&&i(r.textColor)}outputDefined(){return!1}serialize(){let i=["format"];for(let r of this.sections){i.push(r.content.serialize());let n={};r.scale&&(n["font-scale"]=r.scale.serialize()),r.font&&(n["text-font"]=r.font.serialize()),r.textColor&&(n["text-color"]=r.textColor.serialize()),i.push(n)}return i}}class i7{constructor(i,r,n,a){this._imageWarnHistory={},this.type=iU,this.namePrimary=i,this.nameSecondary=r,n&&(this.paramsPrimary=n.params,this.iconsetIdPrimary=n.iconset?n.iconset.id:void 0),a&&(this.paramsSecondary=a.params,this.iconsetIdSecondary=a.iconset?a.iconset.id:void 0)}static parse(i,r){if(i.length<2)return r.error("Expected two or more arguments.");let n=1,a=[];for(let o=0;o<2;o++)if(!function(){if(n<i.length){let o=r.parse(i[n],n++,iO);return o?(a.push({image:o,options:{}}),!0):(r.error(a.length?"Secondary image variant is not a string.":"No image name provided."),!1)}return!0}()||!function(){if(n<i.length){let o=i[n];if(null===o||"object"!=typeof o||Array.isArray(o))return!0;let s=o.params,l=o.iconset,u=r.concat(n);if(!s&&!l)return n++,!0;if(s){if("object"!=typeof s||s.constructor!==Object)return u.error('Image options "params" should be an object'),!1;let i={},r=u.concat(void 0,"params");for(let n in s){if(!n)return r.error("Image parameter name should be non-empty"),!1;let a=r.concat(void 0,n).parse(s[n],void 0,iF,void 0,{typeAnnotation:"coerce"});if(!a)return!1;i[n]=a}a.at(-1).options.params=i}if(l){if("object"!=typeof l||l.constructor!==Object)return u.error('Image options "iconset" should be an object'),!1;if(!l.id)return u.error('Image options "iconset" should have an "i
2d" property'),!1;a.at(-1).options.iconset=l}return n++,!0}return!0}())return;return new i7(a[0].image,a[1]?a[1].image:void 0,a[0].options,a[1]?a[1].options:void 0)}evaluateParams(i,r){let n={};if(r){for(let a in r)if(r[a])try{n[a]=r[a].evaluate(i)}catch(i){continue}if(0!==Object.keys(n).length)return{params:n}}}evaluate(i){let r={name:this.namePrimary.evaluate(i),iconsetId:this.iconsetIdPrimary},n=this.nameSecondary?{name:this.nameSecondary.evaluate(i),iconsetId:this.iconsetIdSecondary}:void 0,a=iJ.build(r,n,this.paramsPrimary?this.evaluateParams(i,this.paramsPrimary):void 0,this.paramsSecondary?this.evaluateParams(i,this.paramsSecondary):void 0);if(a&&i.availableImages){let r=a.getPrimary().id;if(a.available=i.availableImages.some(i=>iy.isEqual(i,r)),a.available){let r=a.getSecondary()?a.getSecondary().id:null;r&&(a.available=i.availableImages.some(i=>iy.isEqual(i,r)))}}return a}eachChild(i){if(i(this.namePrimary),this.paramsPrimary)for(let r in this.paramsPrimary)this.paramsPrimary[r]&&i(this.paramsPrimary[r]);if(this.nameSecondary&&(i(this.nameSecondary),this.paramsSecondary))for(let r in this.paramsSecondary)this.paramsSecondary[r]&&i(this.paramsSecondary[r])}outputDefined(){return!1}serializeOptions(i,r){let n={};if(r&&(n.iconset={id:r}),i)for(let r in n.params={},i)i[r]&&(n.params[r]=i[r].serialize());return Object.keys(n).length>0?n:void 0}serialize(){let i=["image",this.namePrimary.serialize()];if(this.paramsPrimary||this.iconsetIdPrimary){let r=this.serializeOptions(this.paramsPrimary,this.iconsetIdPrimary);r&&i.push(r)}if(this.nameSecondary&&(i.push(this.nameSecondary.serialize()),this.paramsSecondary||this.iconsetIdSecondary)){let r=this.serializeOptions(this.paramsSecondary,this.iconsetIdSecondary);r&&i.push(r)}return i}}function re(i){return ri(i)?"string":rr(i)?"number":rn(i)?"boolean":Array.isArray(i)?"array":null===i?"null":rt(i)?"object":typeof i}function rt(i){return null!=i&&!Array.isArray(i)&&"function"!=typeof i&&!(i instanceof String||i instanceof Number||i instanceof Boolean)&&"object"==typeof i}function ri(i){return"string"==typeof i||i instanceof String}function rr(i){return"number"==typeof i||i instanceof Number}function rn(i){return"boolean"==typeof i||i instanceof Boolean}let ra={"to-boolean":iD,"to-color":iF,"to-number":iP,"to-string":iO};class ro{constructor(i,r){this.type=i,this.args=r}static parse(i,r){if(i.length<2)return r.error("Expected at least one argument.");let n=i[0],a=[],o=iL;if("to-array"===n){if(!Array.isArray(i[1]))return null;let n=i[1].length;if(r.expectedType){if("array"!==r.expectedType.kind)return r.error(`Expected ${r.expectedType.kind} but found array.`);o=iV(r.expectedType.itemType,n)}else{if(!(n>0&&i0(i[1][0])))return null;o=iV(i2(i[1][0]),n)}for(let s=0;s<n;s++){let n,l=i[1][s];if(Array.isArray(l))n=r.parse(l,void 0,o.itemType);else{let i=re(l);if(i!==o.itemType.kind)return r.error(`Expected ${o.itemType.kind} but found ${i}.`);n=r.registry.literal.parse(["literal",void 0===l?null:l],r)}if(!n)return null;a.push(n)}}else{if(("to-boolean"===n||"to-string"===n)&&2!==i.length)return r.error("Expected one argument.");o=ra[n];for(let n=1;n<i.length;n++){let o=r.parse(i[n],n,ij);if(!o)return null;a.push(o)}}return new ro(o,a)}evaluate(i){if("boolean"===this.type.kind)return!!this.args[0].evaluate(i);if("color"===this.type.kind){let r,n;for(let a of this.args){if(r=a.evaluate(i),n=null,r instanceof iE)return r;if("string"==typeof r){let n=i.parseColor(r);if(n)return n}else if(Array.isArray(r)&&!(n=r.length<3||r.length>4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:i1(r[0],r[1],r[2],r[3])))return new iE(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new i9(n||`Could not parse color from value '${"string"==typeof r?r:String(JSON.stringify(r))}'`)}if("number"===this.type.kind){let r=null;for(let n of this.args){if(null===(r=n.evaluate(i)))return 0;let a=Number(r);if(!isNaN(a))return a}throw new i9(`Could not convert ${JSON.stringify(r)} to number.`)}return"formatted"===this.type.kind?iX.fromString(i5(this.args[0].evaluate(i))):"resolvedImage"===this.type.kind?iJ.build(i5(this.args[0].evaluate(i))):"array"===this.type.kind?this.args.map(r=>r.evaluate(i)):i5(this.args[0].evaluate(i))}
2eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}serialize(){if("formatted"===this.type.kind)return new i6([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new i7(this.args[0]).serialize();let i="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild(r=>{i.push(r.serialize())}),i}}let rs=["Unknown","Point","LineString","Polygon"];class rl{constructor(i,r,n){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=i,this.options=r,this.iconImageUseTheme=n}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?rs[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}measureLight(i){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){let i=this.featureDistanceData.center,r=this.featureDistanceData.scale,{x:n,y:a}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(n*r-i[0])+this.featureDistanceData.bearing[1]*(a*r-i[1])}return 0}parseColor(i){return iE.parse(i)}getConfig(i){return this.options?this.options.get(i):null}}class ru{constructor(i,r,n,a,o){this.name=i,this.type=r,this._evaluate=n,this.args=a,this._overloadIndex=o}evaluate(i){if(!this._evaluate){let i=ru.definitions[this.name];this._evaluate=Array.isArray(i)?i[2]:i.overloads[this._overloadIndex][1]}return this._evaluate(i,this.args)}eachChild(i){this.args.forEach(i)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(i=>i.serialize()))}static parse(i,r){let n=i[0],a=ru.definitions[n];if(!a)return r.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);let o=Array.isArray(a)?a[0]:a.type,s=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,l=[],u=null,c=-1;for(let[a,d]of s){if(Array.isArray(a)&&a.length!==i.length-1)continue;l.push(a),c++,null===u?u=new r4(r.registry,r.path,null,r.scope,[],r._scope,r.options,r.iconImageUseTheme):u.errors.length=0;let s=[],h=!1;for(let r=1;r<i.length;r++){let n=i[r],o=Array.isArray(a)?a[r-1]:a.type,l=u.parse(n,1+s.length,o);if(!l){h=!0;break}s.push(l)}if(!h)if(Array.isArray(a)&&a.length!==s.length)u.error(`Expected ${a.length} arguments, but found ${s.length} instead.`);else{for(let i=0;i<s.length;i++){let r=Array.isArray(a)?a[i]:a.type;u.checkSubtype(r,s[i].type,i+1)}if(0===u.errors.length)return new ru(n,o,d,s,c)}}if(1===l.length)r.errors.push(...u.errors);else{let n=(l.length?l:s.map(([i])=>i)).map(rc).join(" | "),a=[];for(let n=1;n<i.length;n++){let o=r.parse(i[n],1+a.length);if(!o)return null;a.push(iH(o.type))}r.error(`Expected arguments of type ${n}, but found (${a.join(", ")}) instead.`)}return null}static register(i,r){for(let n in ru.definitions=r,r)i[n]=ru}}function rc(i){return Array.isArray(i)?`(${i.map(iH).join(", ")})`:`(${iH(i.type)}...)`}class rd{constructor(i,r,n){this.type=iz,this.locale=n,this.caseSensitive=i,this.diacriticSensitive=r}static parse(i,r){if(2!==i.length)return r.error("Expected one argument."),null;let n=i[1];if("object"!=typeof n||Array.isArray(n))return r.error("Collator options argument must be an object."),null;let a=void 0===n["case-sensitive"]?r.parse(!1,1,iD):r.parseObjectValue(n["case-sensitive"],1,"case-sensitive",iD);if(!a)return null;let o=void 0===n["diacritic-sensitive"]?r.parse(!1,1,iD):r.parseObjectValue(n["diacritic-sensitive"],1,"diacritic-sensitive",iD);if(!o)return null;let s=null;return!n.locale||(s=r.parseObjectValue(n.locale,1,"locale",iO))?new rd(a,o,s):null}evaluate(i){return new iZ(this.caseSensitive.evaluate(i),this.diacriticSensitive.evaluate(i),this.locale?this.locale.evaluate(i):null)}eachChild(i){i(this.caseSensitive),i(this.diacriticSensitive),this.locale&&i(this.locale)}outputDefined(){return!1}serialize(){let i={};return i["case-sensitive"]=this.caseSensitive.serialize(),i["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(i.locale=this.locale.serialize()),["collator",i]}}function rh(i){return(180+i)/360}function rf(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function rp(i){return 360*i-180}function rm(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180)
2)-90}function rg(i,r){for(let n=0;n<i.length;++n)if(!e9(i[n],r))return!1;for(let n=0;n<i.length-1;++n)if(function(i,r,n){for(let a of n)for(let n=0,o=a.length,s=o-1;n<o;s=n++)if(e8(i,r,a[s],a[n]))return!0;return!1}(i[n],i[n+1],r))return!1;return!0}function r_(i,r,n){let a=[];for(let o=0;o<i.length;o++){let s=[];for(let a=0;a<i[o].length;a++){let l=function(i,r){let n=rh(i[0]),a=rf(i[1]),o=Math.pow(2,r.z);return[Math.round(n*o*8192),Math.round(a*o*8192)]}(i[o][a],n);e5(r,l),s.push(l)}a.push(s)}return a}function ry(i,r,n){let a=[];for(let o=0;o<i.length;o++){let s=r_(i[o],r,n);a.push(s)}return a}function rv(i,r,n,a){if(i[0]<n[0]||i[0]>n[2]){let r=.5*a,o=i[0]-n[0]>r?-a:n[0]-i[0]>r?a:0;0===o&&(o=i[0]-n[2]>r?-a:n[2]-i[0]>r?a:0),i[0]+=o}e5(r,i)}function rx(i,r,n,a){let o=8192*Math.pow(2,a.z),s=[8192*a.x,8192*a.y],l=[];if(!i)return l;for(let a of i)for(let i of a){let a=[i.x+s[0],i.y+s[1]];rv(a,r,n,o),l.push(a)}return l}function rb(i,r,n,a){let o=8192*Math.pow(2,a.z),s=[8192*a.x,8192*a.y],l=[];if(!i)return l;for(let n of i){let i=[];for(let a of n){let n=[a.x+s[0],a.y+s[1]];e5(r,n),i.push(n)}l.push(i)}if(r[2]-r[0]<=o/2)for(let i of(r[0]=r[1]=1/0,r[2]=r[3]=-1/0,l))for(let a of i)rv(a,r,n,o);return l}class rw{constructor(i,r){this.type=iD,this.geojson=i,this.geometries=r}static parse(i,r){if(2!==i.length)return r.error(`'within' expression requires exactly one argument, but found ${i.length-1} instead.`);if(i0(i[1])){let r=i[1];if("FeatureCollection"===r.type)for(let i=0;i<r.features.length;++i){let n=r.features[i].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new rw(r,r.features[i].geometry)}else if("Feature"===r.type){let i=r.geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new rw(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new rw(r,r)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(i){if(null!=i.geometry()&&null!=i.canonicalID()){if("Point"===i.geometryType())return function(i,r){let n=[1/0,1/0,-1/0,-1/0],a=[1/0,1/0,-1/0,-1/0],o=i.canonicalID();if(!o)return!1;if("Polygon"===r.type){let s=r_(r.coordinates,a,o),l=rx(i.geometry(),n,a,o);if(!e4(n,a))return!1;for(let i of l)if(!e9(i,s))return!1}if("MultiPolygon"===r.type){let s=ry(r.coordinates,a,o),l=rx(i.geometry(),n,a,o);if(!e4(n,a))return!1;for(let i of l)if(!function(i,r){for(let n=0;n<r.length;n++)if(e9(i,r[n]))return!0;return!1}(i,s))return!1}return!0}(i,this.geometries);if("LineString"===i.geometryType())return function(i,r){let n=[1/0,1/0,-1/0,-1/0],a=[1/0,1/0,-1/0,-1/0],o=i.canonicalID();if(!o)return!1;if("Polygon"===r.type){let s=r_(r.coordinates,a,o),l=rb(i.geometry(),n,a,o);if(!e4(n,a))return!1;for(let i of l)if(!rg(i,s))return!1}if("MultiPolygon"===r.type){let s=ry(r.coordinates,a,o),l=rb(i.geometry(),n,a,o);if(!e4(n,a))return!1;for(let i of l)if(!function(i,r){for(let n=0;n<r.length;n++)if(rg(i,r[n]))return!0;return!1}(i,s))return!1}return!0}(i,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}let rT={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},rE=1/298.257223563*(2-1/298.257223563),rS=Math.PI/180;class rA{static fromTile(i,r,n){let a=Math.PI*(1-2*(i+.5)/Math.pow(2,r));return new rA(Math.atan(.5*(Math.exp(a)-Math.exp(-a)))/rS,n)}static get units(){return rT}constructor(i,r){if(void 0===i)throw Error("No latitude given.");if(r&&!rT[r])throw Error(`Unknown unit ${r}. Use one of: ${Object.keys(rT).join(", ")}`);const n=6378.137*rS*(r?rT[r]:1),a=Math.cos(i*rS),o=1/(1-rE*(1-a*a)),s=Math.sqrt(o);this.kx=n*s*a,this.ky=n*s*o*(1-rE)}distance(i,r){let n=rk(i[0]-r[0])*this.kx,a=(i[1]-r[1])*this.ky;return Math.sqrt(n*n+a*a)}bearing(i,r){return Math.atan2(rk(r[0]-i[0])*this.kx,(r[1]-i[1])*this.ky)/rS}destination(i,r,n){let a=n*rS;return this.offset(i,Math.sin(a)*r,Math.cos(a)*r)}offset(i,r,n){return[i[0]+r/this.kx,i[1]+n/this.ky]}lineDistance(i){let r=0;for(let n=0;n<i.length-1;n++)r+=this.distance(i[n],i[n+1]);return r}area(i){let r=0;for(let n=0;n<i.length;n++){let a=i[n];for(let i=0,o=a.length,s=o-1;i<o;s=i++)r+=rk(a[i][0]-a[s][0])*(a[i][1]+a[s][1])*(n?-1:1)}return Math.abs(r)/2*this.kx*this.ky}along(i,r){let n=0;if(r<=0)return i[0];for(let a=0;a<i.length-1;a++){let o=i[a],s=i[a+1],l=this.distance(o,s);if((n+=l)>r)return rI(o,s,(r-(n-l))/l)}return i[i.length-1]}pointToSegmentDistance(i,r,n){let[a,o]=r,s=rk(n[0]-a)*this.kx,l=(n[1]-o)*this.ky;if(0!==s||0!==l){let r=(rk(i[0]-a)*this.kx*s+(i[1]-o)*this.ky*l)/(s*s+l*l);r>1?(a=n[0],o=n[1]):r>0&&(a+=s/this.kx*r,o+=l/this.ky*r)}return Math.sqrt((s=rk(i[0]-a)*this.kx)*s+(l=(i[1]-o)*this.ky)*l)}pointOnLine(i,r){let n=1/0,a=i[0][0],o=i[0][1],s=0,l=0;for(let u=0;u<i.length-1;u++){let c=i[u][0],d=i[u][1],h=rk(i[u+1][0]-c)*this.kx,f=(i[u+1][1]-d)*this.ky,p=0;0===h&&0===f||((p=(rk(r[0]-c)*this.kx*h+(r[1]-d)*this.ky*f)/(h*h+f*f))>1?(c=i[u+1][0],d=i[u+1][1]):p>0&&(c+=h/this.kx*p,d+=f/this.ky*p));let m=(h=rk(r[0]-c)*this.kx)*h+(f=(r[1]-d)*this.ky)*f;m<n&&(n=m,a=c,o=d,s=u,l=p)}return{point:[a,o],index:s,t:Math.max(0,Math.min(1,l))}}lineSlice(i,r,n){let a=this.pointOnLine(n,i),o=this.pointOnLine(n,r);if(a.index>o.index||a.index===o.index&&a.t>o.t){let i=a;a=o,o=i}let s=[a.point],l=a.index+1,u=o.index;!rC(n[l],s[0])&&l<=u&&s.push(n[l]);for(let i=l+1;i<=u;i++)s.push(n[i]);return rC(n[u],o.point)||s.push(o.point),s}lineSliceAlong(i,r,n){let a=0,o=[];for(let s=0;s<n.length-1;s++){let l=n[s],u=n[s+1],c=this.distance(l,u);if((a+=c)>i&&0===o.length&&o.push(rI(l,u,(i-(a-c))/c)),a>=r)return o.push(rI(l,u,(r-(a-c))/c)),o;a>i&&o.push(u)}return o}bufferPoint(i,r){let n=r/this.ky,a=r/this.kx;return[i[0]-a,i[1]-n,i[0]+a,i[1]+n]}bufferBBox(i,r){let n=r/this.ky,a=r/this.kx;return[i[0]-a,i[1]-n,i[2]+a,i[3]+n]}insideBBox(i,r){return rk(i[0]-r[0])>=0&&0>=rk(i[0]-r[2])&&i[1]>=r[1]&&i[1]<=r[3]}}function rC(i,r){return i[0]===r[0]&&i[1]===r[1]}function rI(i,r,n){let a=rk(r[0]-i[0]);return[i[0]+a*n,i[1]+(r[1]-i[1])*n]}function rk(i){for(;i<-180;)i+=360;for(;i>180;)i-=360;return i}class rR{constructor(i=[],r=(i,r)=>i<r?-1:+(i>r)){if(this.data=i,this.length=this.data.length,this.compare=r,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(i){this.data.push(i),this._up(this.length++)}pop(){if(0===this.length)return;let i=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),i}peek(){return this.data[0]}_up(i){let{data:r,compare:n}=this,a=r[i];for(;i>0;){let o=i-1>>1,s=r[o];if(n(a,s)>=0)break;r[i]=s,i=o}r[i]=a}_down(i){let{data:r,compare:n}=this,a=this.length>>1,o=r[i];for(;i<a;){let a=1+(i<<1),s=a+1;if(s<this.length&&0>n(r[s],r[a])&&(a=s),n(r[a],o)>=0)break;r[i]=r[a],i=a}r[i]=o}}function rM(i,r){return r.dist-i.dist}function rL(i){let r=[1/0,1/0,-1/0,-1/0];if(r.length!==i.length)return!1;for(let n=0;n<r.length;n++)if(r[n]!==i[n])return!1;return!0}function rP(i){return i[1]-i[0]+1}function rO(i,r){let n=i[1]>=i[0]&&i[1]<r;return n||console.warn("Distance Expression: Index is out of range"),n}function rD(i,r){if(i[0]>
2i[1])return[null,null];let n=rP(i);if(r){if(2===n)return[i,null];let r=Math.floor(n/2);return[[i[0],i[0]+r],[i[0]+r,i[1]]]}{if(1===n)return[i,null];let r=Math.floor(n/2)-1;return[[i[0],i[0]+r],[i[0]+r+1,i[1]]]}}function rF(i,r){let n=[1/0,1/0,-1/0,-1/0];if(!rO(r,i.length))return n;for(let a=r[0];a<=r[1];++a)e5(n,i[a]);return n}function rN(i){let r=[1/0,1/0,-1/0,-1/0];for(let n=0;n<i.length;++n)for(let a=0;a<i[n].length;++a)e5(r,i[n][a]);return r}function rj(i,r,n){if(rL(i)||rL(r))return NaN;let a=0,o=0;return i[2]<r[0]&&(a=r[0]-i[2]),i[0]>r[2]&&(a=i[0]-r[2]),i[1]>r[3]&&(o=i[1]-r[3]),i[3]<r[1]&&(o=r[1]-i[3]),n.distance([0,0],[a,o])}function rz(i,r,n=8192){let a=Math.pow(2,r.z),o=(i.y/n+r.y)/a;return[rp((i.x/n+r.x)/a),rm(o)]}function rB(i,r,n){let a=n.pointOnLine(r,i).point;return n.distance(i,a)}function rU(i,r,n,a,o){let s=n.slice(a[0],a[1]+1),l=1/0;for(let n=r[0];n<=r[1];++n)if(0===(l=Math.min(l,rB(i[n],s,o))))return 0;return l}function rV(i,r,n,a,o){return Math.min(Math.min(o.pointToSegmentDistance(i,n,a),o.pointToSegmentDistance(r,n,a)),Math.min(o.pointToSegmentDistance(n,i,r),o.pointToSegmentDistance(a,i,r)))}function rH(i,r){for(let n of i)for(let i=0;i<=n.length-1;++i)if(e9(n[i],r,!0))return!0;return!1}function rG(i,r,n,a,o,s,l){if(null===s||null===l)return;let u=rj(rF(a,s),rF(o,l),n);u<r&&i.push({dist:u,range1:s,range2:l})}function rq(i,r,n,a,o,s=1/0){let l=Math.min(s,o.distance(i[0],n[0]));if(0===l)return l;let u=new rR([{dist:0,range1:[0,i.length-1],range2:[0,n.length-1]}],rM),c=r?50:100,d=a?50:100;for(;u.length;){let s=u.pop();if(s.dist>=l)continue;let h=s.range1,f=s.range2;if(rP(h)<=c&&rP(f)<=d){if(!rO(h,i.length)||!rO(f,n.length))return NaN;if(r&&a?l=Math.min(l,function(i,r,n,a,o){if(!rO(r,i.length)||!rO(a,n.length))return NaN;let s=1/0;for(let l=r[0];l<r[1];++l)for(let r=a[0];r<a[1];++r){if(e8(i[l],i[l+1],n[r],n[r+1]))return 0;s=Math.min(s,rV(i[l],i[l+1],n[r],n[r+1],o))}return s}(i,h,n,f,o)):r||a?r&&!a?l=Math.min(l,rU(n,f,i,h,o)):!r&&a&&(l=Math.min(l,rU(i,h,n,f,o))):l=Math.min(l,function(i,r,n,a,o){if(!rO(r,i.length)||!rO(a,n.length))return NaN;let s=1/0;for(let l=r[0];l<=r[1];++l)for(let r=a[0];r<=a[1];++r)if(0===(s=Math.min(s,o.distance(i[l],n[r]))))return s;return s}(i,h,n,f,o)),0===l)break}else{let s=rD(h,r),c=rD(f,a);rG(u,l,o,i,n,s[0],c[0]),rG(u,l,o,i,n,s[0],c[1]),rG(u,l,o,i,n,s[1],c[0]),rG(u,l,o,i,n,s[1],c[1])}}return l}function r$(i,r,n,a,o=1/0){let s=o,l=rF(i,[0,i.length-1]);for(let o of n)if(!(s!==1/0&&rj(l,rF(o,[0,o.length-1]),a)>=s)&&0===(s=Math.min(s,rq(i,r,o,!0,a,s))))break;return s}function rW(i,r,n,a,o=1/0){let s=o,l=rF(i,[0,i.length-1]);for(let o of n){if(s!==1/0&&rj(l,rN(o),a)>=s)continue;let n=function(i,r,n,a,o=1/0){let s=Math.min(a.distance(i[0],n[0][0]),o);if(0===s)return s;let l=new rR([{dist:0,range1:[0,i.length-1],range2:[0,0]}],rM),u=r?50:100,c=rN(n);for(;l.length;){let o=l.pop();if(o.dist>=s)continue;let d=o.range1;if(rP(d)<=u){if(!rO(d,i.length))return NaN;if(r){if(0===(s=Math.min(s,function(i,r,n,a){if(!rO(r,i.length))return NaN;for(let a=r[0];a<=r[1];++a)if(e9(i[a],n,!0))return 0;let o=1/0;for(let s=r[0];s<r[1];++s)for(let r of n)for(let n=0,l=r.length,u=l-1;n<l;u=n++){if(e8(i[s],i[s+1],r[u],r[n]))return 0;o=Math.min(o,rV(i[s],i[s+1],r[u],r[n],a))}return o}(i,d,n,a))))break}else for(let r=d[0];r<=d[1];++r)if(0===(s=Math.min(s,function(i,r,n){if(e9(i,r,!0))return 0;let a=1/0;for(let o of r){let r=o.length;if(r<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(o[0]!==o[r-1]&&0===(a=Math.min(a,n.pointToSegmentDistance(i,o[r-1],o[0])))||0===(a=Math.min(a,rB(i,o,n))))break}return a}(i[r],n,a))))return s}else{let n=rD(d,r);if(null!==n[0]){let r=rj(rF(i,n[0]),c,a);r<s&&l.push({dist:r,range1:n[0],range2:[0,0]})}if(null!==n[1]){let r=rj(rF(i,n[1]),c,a);r<s&&l.push({dist:r,range1:n[1],range2:[0,0]})}}}return s}(i,r,o,a,s);if(isNaN(n))return n;if(0===(s=Math.min(s,n)))break}return s}function rY(i){return"Point"===i||"MultiPoint"===i||"LineString"===i||"MultiLineString"===i||"Polygon"===i||"MultiPolygon"===i}class rZ{constructor(i,r){this.type=iP,this.geojson=i,this.geometries=r}static parse(i,r){if(2!==i.length)return r.error(`'distance' expression requires either one argument, but found ' ${i.length-1} instead.`);if(i0(i[1])){let r=i[1];if("FeatureCollection"===r.type){for(let i=0;i<r.features.length;++i)if(rY(r.features[i].geometry.type))return new rZ(r,r.features[i].geometry)}else if("Feature"===r.type){if(rY(r.geometry.type))return new rZ(r,r.geometry)}else if(rY(r.type))return new rZ(r,r)}return r.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}
2evaluate(i){let r=i.geometry(),n=i.canonicalID();if(null!=r&&null!=n){if("Point"===i.geometryType()){var a=this.geometries;let i=[];for(let a of r)for(let r of a)i.push(rz(r,n));let o=new rA(i[0][1],"meters");return"Point"===a.type||"MultiPoint"===a.type||"LineString"===a.type?rq(i,!1,"Point"===a.type?[a.coordinates]:a.coordinates,"LineString"===a.type,o):"MultiLineString"===a.type?r$(i,!1,a.coordinates,o):"Polygon"===a.type||"MultiPolygon"===a.type?rW(i,!1,"Polygon"===a.type?[a.coordinates]:a.coordinates,o):null}if("LineString"===i.geometryType())return function(i,r,n){let a=[];for(let n of i){let i=[];for(let a of n)i.push(rz(a,r));a.push(i)}let o=new rA(a[0][0][1],"meters");if("Point"===n.type||"MultiPoint"===n.type||"LineString"===n.type)return r$("Point"===n.type?[n.coordinates]:n.coordinates,"LineString"===n.type,a,o);if("MultiLineString"===n.type){let i=1/0;for(let r=0;r<n.coordinates.length;r++){let s=r$(n.coordinates[r],!0,a,o,i);if(isNaN(s))return s;if(0===(i=Math.min(i,s)))break}return i}if("Polygon"===n.type||"MultiPolygon"===n.type){let i=1/0;for(let r=0;r<a.length;r++){let s=rW(a[r],!0,"Polygon"===n.type?[n.coordinates]:n.coordinates,o,i);if(isNaN(s))return s;if(0===(i=Math.min(i,s)))break}return i}return null}(r,n,this.geometries);if("Polygon"===i.geometryType())return function(i,r,n){let a=[];for(let n of e2(i,0)){let i=[];for(let a=0;a<n.length;++a)i.push(function(i,r){let n=[];for(let a=0;a<i.length;++a)n.push(rz(i[a],r));return n}(n[a],r));a.push(i)}let o=new rA(a[0][0][0][1],"meters");if("Point"===n.type||"MultiPoint"===n.type||"LineString"===n.type)return rW("Point"===n.type?[n.coordinates]:n.coordinates,"LineString"===n.type,a,o);if("MultiLineString"===n.type){let i=1/0;for(let r=0;r<n.coordinates.length;r++){let s=rW(n.coordinates[r],!0,a,o,i);if(isNaN(s))return s;if(0===(i=Math.min(i,s)))break}return i}return"Polygon"===n.type||"MultiPolygon"===n.type?function(i,r,n){let a=1/0;for(let o of i)for(let i of r){let r=function(i,r,n,a=1/0){let o=rN(i),s=rN(r);if(a!==1/0&&rj(o,s,n)>=a)return a;if(e4(o,s)){if(rH(i,r))return 0}else if(rH(r,i))return 0;let l=a;for(let a of i)for(let i=0,o=a.length,s=o-1;i<o;s=i++)for(let o of r)for(let r=0,u=o.length,c=u-1;r<u;c=r++){if(e8(a[s],a[i],o[c],o[r]))return 0;l=Math.min(l,rV(a[s],a[i],o[c],o[r],n))}return l}(o,i,n,a);if(isNaN(r))return r;if(0===(a=Math.min(a,r)))return a}return a}("Polygon"===n.type?[n.coordinates]:n.coordinates,a,o):null}(r,n,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.")}else console.warn("Distance Expression: requires valid feature and canonical information.");return null}eachChild(){}outputDefined(){return!0}serialize(){return["distance",this.geojson]}}function rK(i){if(i instanceof ru&&("get"===i.name&&1===i.args.length||"feature-state"===i.name||"has"===i.name&&1===i.args.length||"properties"===i.name||"geometry-type"===i.name||"id"===i.name||i.name.startsWith("filter-"))||i instanceof rw||i instanceof rZ)return!1;if(i instanceof r2)return i.featureConstant;let r=!0;return i.eachChild(i=>{r&&!rK(i)&&(r=!1)}),r}function rX(i){if(i instanceof ru&&"feature-state"===i.name)return!1;let r=!0;return i.eachChild(i=>{r&&!rX(i)&&(r=!1)}),r}function rQ(i,r){if(i instanceof ru&&r.includes(i.name))return!1;let n=!0;return i.eachChild(i=>{n&&!rQ(i,r)&&(n=!1)}),n}function rJ(i,r,n){return[i,r,n].filter(Boolean).join("\x1f")}function r1(i,r){switch(i){case"string":return i5(r);case"number":return+r;case"boolean":return!!r;case"color":return iE.parse(r);case"formatted":return iX.fromString(i5(r));case"resolvedImage":return iJ.build(i5(r))}return r}function r0(i,r,n,a){return void 0!==a&&(i=a*Math.round(i/a)),void 0!==r&&i<r&&(i=r),void 0!==n&&i>n&&(i=n),i}class r2{constructor(i,r,n,a=!1){this.type=i,this.key=r,this.scope=n,this.featureConstant=a}static parse(i,r){let n=r.expectedType;if(null==n&&(n=ij),i.length<2||i.length>3)return r.error("Invalid number of arguments for 'config' expression.");let a=r.parse(i[1],1);if(!(a instanceof i4))return r.error("Key name of 'config' expression must be a string literal.");let o,s=!0,l=i5(a.value);if(i.length>=3){let n=r.parse(i[2],2);if(!(n instanceof i4))return r.error("Scope of 'config' expression must be a string literal.");o=i5(n.value)}if(r.options){let i=rJ(l,o,r._scope),n=r.options.get(i);n&&(s=rK(n.value||n.default))}return new r2(n,l,o,s)}evaluate(i){let r=rJ(this.key,this.scope,i.scope),n=i.getConfig(r);if(!n)return null;let{type:a,value:o,values:s,minValue:l,maxValue:u,stepValue:c}=n,d=n.default.evaluate(i),h=d;if(o){let r=i.scope;i.scope=(r||"").split("\x1f").slice(1).join("\x1f"),h=o.evaluate(i),i.scope=r}return a&&(h=r1(a,h)),void 0===h||void 0===l&&void 0===u&&void 0===c||("number"==typeof h?h=r0(h,l,u,c):Array.isArray(h)&&(h=h.map(i=>"number"==typeof i?r0(i,l,u,c):i))),void 0!==o&&void 0!==h&&s&&!s.includes(h)&&
2(h=d,a&&(h=r1(a,h))),(a&&a!==this.type||void 0!==h&&!iY(i2(h),this.type))&&(h=r1(this.type.kind,h)),h}eachChild(){}outputDefined(){return!1}serialize(){let i=["config",this.key];return this.scope&&i.concat(this.scope),i}}class r5{constructor(i,r){this.type=r.type,this.name=i,this.boundExpression=r}static parse(i,r){if(2!==i.length||"string"!=typeof i[1])return r.error("'var' expression requires exactly one string literal argument.");let n=i[1];return r.scope.has(n)?new r5(n,r.scope.get(n)):r.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(i){return this.boundExpression.evaluate(i)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class r4{constructor(i,r=[],n,a=new iM,o=[],s,l,u){this.registry=i,this.path=r,this.scope=a,this.errors=o,this.expectedType=n,this._scope=s,this.options=l,this.iconImageUseTheme=u}get key(){if(void 0===this._key){let i=this.path,r="";for(let n=0;n<i.length;n++){let a=i[n];r+="string"==typeof a?`['${a}']`:`[${a}]`}this._key=r}return this._key}parse(i,r,n,a,o={}){return r||n?this.concat(r,null,n,a)._parse(i,o):this._parse(i,o)}parseObjectValue(i,r,n,a,o,s={}){return this.concat(r,n,a,o)._parse(i,s)}_parse(i,r){function n(i,r,n){return"assert"===n?new i8(r,[i]):"coerce"===n?new ro(r,[i]):i}if(null!==i&&"string"!=typeof i&&"boolean"!=typeof i&&"number"!=typeof i||(i=["literal",i]),Array.isArray(i)){if(0===i.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let a="string"==typeof i[0]?this.registry[i[0]]:void 0;if(a){let o=a.parse(i,this);if(!o)return null;if(this.expectedType){let i=this.expectedType,a=o.type;if("string"!==i.kind&&"number"!==i.kind&&"boolean"!==i.kind&&"object"!==i.kind&&"array"!==i.kind||"value"!==a.kind)if("color"!==i.kind&&"formatted"!==i.kind&&"resolvedImage"!==i.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(i,a))return null}else o=n(o,i,r.typeAnnotation||"coerce");else o=n(o,i,r.typeAnnotation||"assert")}if(!(o instanceof i4)&&"resolvedImage"!==o.type.kind&&function i(r){if(r instanceof r5)return i(r.boundExpression);if(r instanceof ru&&"error"===r.name||r instanceof rd||r instanceof rw||r instanceof rZ||r instanceof r2)return!1;let n=r instanceof ro||r instanceof i8,a=!0;return r.eachChild(r=>{a=n?a&&i(r):a&&r instanceof i4}),!!a&&rK(r)&&rQ(r,["zoom","heatmap-density","worldview","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed","is-active-floor"])}(o)){let i=new rl(this._scope,this.options,this.iconImageUseTheme);try{o=new i4(o.type,o.evaluate(i))}catch(i){return this.error(i.message),null}}return o}return ro.parse(["to-array",i],this)}return this.error(void 0===i?"'undefined' value invalid. Use null instead.":"object"==typeof i?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof i} instead.`)}concat(i,r,n,a){let o="number"==typeof i?this.path.concat(i):this.path;o="string"==typeof r?o.concat(r):o;let s=a?this.scope.concat(a):this.scope;return new r4(this.registry,o,n||null,s,this.errors,this._scope,this.options,this.iconImageUseTheme)}error(i,...r){let n=`${this.key}${r.map(i=>`[${i}]`).join("")}`;this.errors.push(new iR(n,i))}checkSubtype(i,r,n){let a=iq(i,r);return a&&this.error(a,..."number"==typeof n?[n]:[]),a}}function r9(i,r){let n=i.length-1,a,o,s=0,l=n,u=0;for(;s<=l;)if(a=i[u=Math.floor((s+l)/2)],o=i[u+1],a<=r){if(u===n||r<o)return u;s=u+1}else{if(!(a>r))throw new i9("Input is not a number.");l=u-1}return 0}class r3{constructor(i,r,n){for(const[a,o]of(this.type=i,this.input=r,this.labels=[],this.outputs=[],n))this.labels.push(a),this.outputs.push(o)}static parse(i,r){if(i.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if((i.length-1)%2!=0)return r.error("Expected an even number of arguments.");let n=r.parse(i[1],1,iP);if(!n)return null;let a=[],o=null;r.expectedType&&"value"!==r.expectedType.kind&&(o=r.expectedType);for(let n=1;n<i.length;n+=2){let s=1===n?-1/0:i[n],l=i[n+1],u=n,c=n+1;if("number"!=typeof s)return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not c
2omputed expressions) for the input values.',u);if(a.length&&a.at(-1)[0]>=s)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);let d=r.parse(l,c,o);if(!d)return null;o=o||d.type,a.push([s,d])}return new r3(o,n,a)}evaluate(i){let r=this.labels,n=this.outputs;if(1===r.length)return n[0].evaluate(i);let a=this.input.evaluate(i);if(a<=r[0])return n[0].evaluate(i);let o=r.length;return a>=r[o-1]?n[o-1].evaluate(i):n[r9(r,a)].evaluate(i)}eachChild(i){for(let r of(i(this.input),this.outputs))i(r)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}serialize(){let i=["step",this.input.serialize()];for(let r=0;r<this.labels.length;r++)r>0&&i.push(this.labels[r]),i.push(this.outputs[r].serialize());return i}}let r8=4/29,r6=6/29,r7=6/29*3*(6/29),ne=6/29*(6/29)*(6/29),nt=Math.PI/180,ni=180/Math.PI;function nr(i){return i>ne?Math.pow(i,1/3):i/r7+r8}function nn(i){return i>r6?i*i*i:r7*(i-r8)}function na(i){return 255*(i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055)}function no(i){return(i/=255)<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function ns(i){let r=no(i.r),n=no(i.g),a=no(i.b),o=nr((.4124564*r+.3575761*n+.1804375*a)/.95047),s=nr((.2126729*r+.7151522*n+.072175*a)/1);return{l:116*s-16,a:500*(o-s),b:200*(s-nr((.0193339*r+.119192*n+.9503041*a)/1.08883)),alpha:i.a}}function nl(i){let r=(i.l+16)/116,n=isNaN(i.a)?r:r+i.a/500,a=isNaN(i.b)?r:r-i.b/200;return r=+nn(r),new iE(na(3.2404542*(n=.95047*nn(n))-1.5371385*r-.4985314*(a=1.08883*nn(a))),na(-.969266*n+1.8760108*r+.041556*a),na(.0556434*n-.2040259*r+1.0572252*a),i.alpha)}let nu={forward:ns,reverse:nl,interpolate:function(i,r,n){return{l:iw(i.l,r.l,n),a:iw(i.a,r.a,n),b:iw(i.b,r.b,n),alpha:iw(i.alpha,r.alpha,n)}}},nc={forward:function(i){let{l:r,a:n,b:a}=ns(i),o=Math.atan2(a,n)*ni;return{h:o<0?o+360:o,c:Math.sqrt(n*n+a*a),l:r,alpha:i.a}},reverse:function(i){let r=i.h*nt,n=i.c;return nl({l:i.l,a:Math.cos(r)*n,b:Math.sin(r)*n,alpha:i.alpha})},interpolate:function(i,r,n){var a,o;let s;return{h:(a=i.h,o=r.h,s=o-a,a+n*(s>180||s<-180?s-360*Math.round(s/360):s)),c:iw(i.c,r.c,n),l:iw(i.l,r.l,n),alpha:iw(i.alpha,r.alpha,n)}}};var nd=Object.freeze({__proto__:null,hcl:nc,lab:nu});class nh{constructor(i,r,n,a,o){for(const[s,l]of(this.type=i,this.operator=r,this.interpolation=n,this.input=a,this.labels=[],this.outputs=[],o))this.labels.push(s),this.outputs.push(l)}static interpolationFactor(i,r,n,a){let o=0;if("exponential"===i.name)o=nf(r,i.base,n,a);else if("linear"===i.name)o=nf(r,1,n,a);else if("cubic-bezier"===i.name){let s=i.controlPoints;o=eX(s[0],s[1],s[2],s[3])(nf(r,1,n,a))}return o}static parse(i,r){let[n,a,o,...s]=i;if(!Array.isArray(a)||0===a.length)return r.error("Expected an interpolation type expression.",1);if("linear"===a[0])a={name:"linear"};else if("exponential"===a[0]){let i=a[1];if("number"!=typeof i)return r.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:i}}else{if("cubic-bezier"!==a[0])return r.error(`Unknown interpolation type ${String(a[0])}`,1,0);{let i=a.slice(1);if(4!==i.length||i.some(i=>"number"!=typeof i||i<0||i>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:i}}}if(i.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if(i.length-1>3&&(i.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(!(o=r.parse(o,2,iP)))return null;let l=[],u=null;"interpolate-hcl"===n||"interpolate-lab"===n?u=iF:r.expectedType&&"value"!==r.expectedType.kind&&(u=r.expectedType);for(let i=0;i<s.length;i+=2){let n=s[i],a=s[i+1],o=i+3,c=i+4;if("number"!=typeof n)return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(l.length&&l.at(-1)[0]>=n)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);let d=r.parse(a,c,u);if(!d)return null;u=u||d.type,l.push([n,d])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new nh(u,n,a,o,l):r.error(`Type ${iH(u)} is not interpolatable.`)}evaluate(i){let r=this.labels,n=this.outputs;if(1===r.length)return n[0].evaluate(i);let a=this.input.evaluate(i);if(a<=r[0])return n[0].evaluate(i);let o=r.length;if(a>=r[o-1])return n[o-1].evaluate(i);let s=r9(r,a),l=nh.interpolationFactor(this.interpolation,a,r[s],r[s+1]),u=n[s].evaluate(i),c=n[s+1].evaluate(i);return"interpolate"===this.operator?ik[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?nc.reverse(nc.interpolate(nc.forward(u),nc.forward(c),l)):nu.reverse(nu.interpolate(nu.forward(u),nu.forward(c),l))}eachChild(i){for(let r of(i(this.input),this.outputs))i(r)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}serialize(){let i;i="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier",...this.interpolation.controlPoints];let r=[this.operator,i,this.input.serialize()];for(let i=0;i<this.labels.length;i++)r.push(this.labels[i],this.outputs[i].serialize());return r}}function nf(i,r,n,a){let o=a-n,s=i-n;return 0===o?0:1===r?s/o:(Math.pow(r,s)-1)/(Math.pow(r,o)-1)}class np{constructor(i,r){this.type=i,this.args=r}static parse(i,r){if(i.length<2)return r.error("Expectected at least one argument."),null;let n=null,a=r.expectedType;a&&"value"!==a.kind&&(n=a);let o=[];for(let a of i.slice(1)){let i=r.parse(a,1+o.length,n,void 0,{typeAnnotation:"omit"});if(!i)return null;n=n||i.type,o.push(i)}return new np(a&&o.some(i=>iq(a,i.type))?ij:n,o)}evaluate(i){let r,n=null,a=0;for(let o of this.args){if(a++,(n=o.evaluate(i))&&n instanceof iJ&&!n.available&&(r||(r=n),n=null,a===this.args.length))return r;if(null!==n)break}return n}
2eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}serialize(){let i=["coalesce"];return this.eachChild(r=>{i.push(r.serialize())}),i}}let nm=/[^a-zA-Z0-9_]/;class ng{constructor(i,r){this.type=r.type,this.bindings=[].concat(i),this.result=r}evaluate(i){return this.result.evaluate(i)}eachChild(i){for(let r of this.bindings)i(r[1]);i(this.result)}static parse(i,r){if(i.length<4)return r.error(`Expected at least 3 arguments, but found ${i.length-1} instead.`);let n=[];for(let a=1;a<i.length-1;a+=2){let o=i[a];if("string"!=typeof o)return r.error(`Expected string, but found ${typeof o} instead.`,a);if(nm.test(o))return r.error("Variable names must contain only alphanumeric characters or '_'.",a);let s=r.parse(i[a+1],a+1);if(!s)return null;n.push([o,s])}let a=r.parse(i.at(-1),i.length-1,r.expectedType,n);return a?new ng(n,a):null}outputDefined(){return this.result.outputDefined()}serialize(){let i=["let"];for(let[r,n]of this.bindings)i.push(r,n.serialize());return i.push(this.result.serialize()),i}}class n_{constructor(i,r,n){this.type=i,this.index=r,this.input=n}static parse(i,r){if(3!==i.length)return r.error(`Expected 2 arguments, but found ${i.length-1} instead.`);let n=r.parse(i[1],1,iP),a=r.parse(i[2],2,iV(r.expectedType||ij));return n&&a?new n_(a.type.itemType,n,a):null}evaluate(i){let r=this.index.evaluate(i),n=this.input.evaluate(i);if(r<0)throw new i9("Array index out of bounds: negative index");if(r>=n.length)throw new i9("Array index out of bounds: index exceeds array size");if(r!==Math.floor(r))throw new i9("Array index must be an integer. Use at-interpolated for fractional indices");return n[r]}eachChild(i){i(this.index),i(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class ny{constructor(i,r,n){this.type=i,this.index=r,this.input=n}static parse(i,r){if(3!==i.length)return r.error(`Expected 2 arguments, but found ${i.length-1} instead.`);let n=r.parse(i[1],1,iP),a=r.parse(i[2],2,iV(r.expectedType||ij));return n&&a?new ny(a.type.itemType,n,a):null}evaluate(i){let r=this.index.evaluate(i),n=this.input.evaluate(i);if(r<0)throw new i9(`Array index out of bounds: ${r} < 0.`);if(r>n.length-1)throw new i9(`Array index out of bounds: ${r} > ${n.length-1}.`);if(r===Math.floor(r))return n[r];let a=Math.floor(r),o=Math.ceil(r),s=n[a],l=n[o];if("number"!=typeof s||"number"!=typeof l)throw new i9(`Cannot interpolate between non-number values at index ${r}.`);return iw(s,l,r-a)}eachChild(i){i(this.index),i(this.input)}outputDefined(){return!1}serialize(){return["at-interpolated",this.index.serialize(),this.input.serialize()]}}class nv{constructor(i,r){this.type=iD,this.needle=i,this.haystack=r}static parse(i,r){if(3!==i.length)return r.error(`Expected 2 arguments, but found ${i.length-1} instead.`),null;let n=r.parse(i[1],1,ij),a=r.parse(i[2],2,ij);return n&&a?i$(n.type,[iD,iO,iP,iL,ij])?new nv(n,a):(r.error(`Expected first argument to be of type boolean, string, number or null, but found ${iH(n.type)} instead`),null):null}evaluate(i){let r=this.needle.evaluate(i),n=this.haystack.evaluate(i);if(null==n)return!1;if(!iW(r,["boolean","string","number","null"]))throw new i9(`Expected first argument to be of type boolean, string, number or null, but found ${iH(i2(r))} instead.`);if(!iW(n,["string","array"]))throw new i9(`Expected second argument to be of type array or string, but found ${iH(i2(n))} instead.`);return n.includes(r)}eachChild(i){i(this.needle),i(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class nx{constructor(i,r,n){this.type=iP,this.needle=i,this.haystack=r,this.fromIndex=n}static parse(i,r){if(i.length<=2||i.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`),null;let n=r.parse(i[1],1,ij),a=r.parse(i[2],2,ij);if(!n||!a)return null;if(!i$(n.type,[iD,iO,iP,iL,ij]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${iH(n.type)} instead`),null;if(4===i.length){let o=r.parse(i[3],3,iP);return o?new nx(n,a,o):null}return new nx(n,a)}evaluate(i){let r=this.needle.evaluate(i),n=this.haystack.evaluate(i);if(!iW(r,["boolean","string","number","null"]))throw new i9(`Expected first argument to be of type boolean, string, number or null, but found ${iH(i2(r))} instead.`);if(!iW(n,["string","array"]))throw new i9(`Expected second argument to be of type array or string, but found ${iH(i2(n))} instead.`);if(this.fromIndex){let a=this.fromIndex.evaluate(i);return n.indexOf(r,a)}return n.indexOf(r)}eachChild(i){i(this.needle),i(this.haystack),this.fromIndex&&i(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){let i=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),i]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class nb{constructor(i,r,n,a,o,s){this.inputType=i,this.type=r,this.input=n,this.cases=a,this.outputs=o,this.otherwise=s}static parse(i,r){let n,a;if(i.length<5)return r.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if(i.length%2!=1)return r.error("Expected an even number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(a=r.expectedType);let o={},s=[];for(let l=2;l<i.length-1;l+=2){let u=i[l],c=i[l+1];Array.isArray(u)||(u=[u]);let d=r.concat(l);
2if(0===u.length)return d.error("Expected at least one branch label.");for(let i of u){if("number"!=typeof i&&"string"!=typeof i)return d.error("Branch labels must be numbers or strings.");if("number"==typeof i&&Math.abs(i)>Number.MAX_SAFE_INTEGER)return d.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof i&&Math.floor(i)!==i)return d.error("Numeric branch labels must be integer values.");if(n){if(d.checkSubtype(n,i2(i)))return null}else n=i2(i);if(void 0!==o[String(i)])return d.error("Branch labels must be unique.");o[String(i)]=s.length}let h=r.parse(c,l,a);if(!h)return null;a=a||h.type,s.push(h)}let l=r.parse(i[1],1,ij);if(!l)return null;let u=r.parse(i.at(-1),i.length-1,a);return u?"value"!==l.type.kind&&r.concat(1).checkSubtype(n,l.type)?null:new nb(n,a,l,o,s,u):null}evaluate(i){let r=this.input.evaluate(i);return(iY(i2(r),this.inputType)&&this.outputs[this.cases[r]]||this.otherwise).evaluate(i)}eachChild(i){i(this.input),this.outputs.forEach(i),i(this.otherwise)}outputDefined(){return this.outputs.every(i=>i.outputDefined())&&this.otherwise.outputDefined()}serialize(){let i=["match",this.input.serialize()],r=Object.keys(this.cases).sort(),n=[],a={};for(let i of r){let r=a[this.cases[i]];void 0===r?(a[this.cases[i]]=n.length,n.push([this.cases[i],[i]])):n[r][1].push(i)}let o=i=>"number"===this.inputType.kind?Number(i):i;for(let[r,a]of n)i.push(1===a.length?o(a[0]):a.map(o)),i.push(this.outputs[r].serialize());return i.push(this.otherwise.serialize()),i}}class nw{constructor(i,r,n){this.type=i,this.branches=r,this.otherwise=n}static parse(i,r){let n;if(i.length<4)return r.error(`Expected at least 3 arguments, but found only ${i.length-1}.`),null;if(i.length%2!=0)return r.error("Expected an odd number of arguments."),null;r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);let a=[];for(let o=1;o<i.length-1;o+=2){let s=r.parse(i[o],o,iD);if(!s)return null;let l=r.parse(i[o+1],o+1,n);if(!l)return null;a.push([s,l]),n=n||l.type}let o=r.parse(i.at(-1),i.length-1,n);return o?new nw(n,a,o):null}evaluate(i){for(let[r,n]of this.branches)if(r.evaluate(i))return n.evaluate(i);return this.otherwise.evaluate(i)}eachChild(i){for(let[r,n]of this.branches)i(r),i(n);i(this.otherwise)}outputDefined(){return this.branches.every(([i,r])=>r.outputDefined())&&this.otherwise.outputDefined()}serialize(){let i=["case"];return this.eachChild(r=>{i.push(r.serialize())}),i}}class nT{constructor(i,r,n,a){this.type=i,this.input=r,this.beginIndex=n,this.endIndex=a}static parse(i,r){if(i.length<=2||i.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`),null;let n=r.parse(i[1],1,ij),a=r.parse(i[2],2,iP);if(!n||!a)return null;if(!i$(n.type,[iV(ij),iO,ij]))return r.error(`Expected first argument to be of type array or string, but found ${iH(n.type)} instead`),null;if(4===i.length){let o=r.parse(i[3],3,iP);return o?new nT(n.type,n,a,o):null}return new nT(n.type,n,a)}evaluate(i){let r=this.input.evaluate(i),n=this.beginIndex.evaluate(i);if(!iW(r,["string","array"]))throw new i9(`Expected first argument to be of type array or string, but found ${iH(i2(r))} instead.`);if(this.endIndex){let a=this.endIndex.evaluate(i);return r.slice(n,a)}return r.slice(n)}eachChild(i){i(this.input),i(this.beginIndex),this.endIndex&&i(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){let i=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),i]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}class nE{constructor(i,r){this.type=iV(iO),this.str=i,this.delimiter=r}static parse(i,r){if(3!==i.length)return r.error(`Expected 2 arguments, but found ${i.length-1} instead.`);let n=r.parse(i[1],1,iO),a=r.parse(i[2],2,iO);return n&&a?new nE(n,a):void 0}evaluate(i){let r=this.str.evaluate(i),n=this.delimiter.evaluate(i);return r.split(n)}eachChild(i){i(this.str),i(this.delimiter)}outputDefined(){return!1}serialize(){return["split",this.str.serialize(),this.delimiter.serialize()]}}function nS(i,r){return"=="===i||"!="===i?"boolean"===r.kind||"string"===r.kind||"number"===r.kind||"null"===r.kind||"value"===r.kind:"string"===r.kind||"number"===r.kind||"value"===r.kind}function nA(i,r,n,a){return 0===a.compare(r,n)}function nC(i,r,n){let a="=="!==i&&"!="!==i;return class o{constructor(i,r,n){this.type=iD,this.lhs=i,this.rhs=r,this.collator=n,this.hasUntypedArgument="value"===i.type.kind||"value"===r.type.kind}static parse(i,r){if(3!==i.length&&4!==i.length)return r.error("Expected two or three arguments.");let n=i[0],s=r.parse(i[1],1,ij);if(!s)return null;if(!nS(n,s.type))return r.concat(1).error(`"${n}" comparisons are not supported for type '${iH(s.type)}'.`);let l=r.parse(i[2],2,ij);if(!l)return null;if(!nS(n,l.type))return r.concat(2).error(`"${n}" comparisons are not supported for type '${iH(l.type)}'.`);if(s.type.kind!==l.type.kind&&"value"!==s.type.kind&&"value"!==l.type.kind)return r.error(`Cannot compare types '${iH(s.type)}' and '${iH(l.type)}'.`);a&&("value"===s.type.kind&&"value"!==l.type.kind?s=new i8(l.type,[s]):"value"!==s.type.kind&&"value"===l.type.kind&&(l=new i8(s.type,[l])));let u=null;if(4===i.length){if("string"!==s.type.kind&&"string"!==l.type.kind&&"value"!==s.type.kind&&"value"!==l.type.kind)return r.error("Cannot use collator to compare non-string types.");if(!(u=r.parse(i[3],3,iz)))return null}return new o(s,l,u)}evaluate(o){let s=this.lhs.evaluate(o),l=this.rhs.evaluate(o);if(a&&this.hasUntypedArgument){let r=i2(s),n=i2(l);if(r.kind!==n.kind||"string"!==r.kind&&"number"!==r.kind)throw new i9(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${r.kind}, ${n.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){let i=i2(s),n=i2(l);if("string"!==i.kind||"string"!==n.kind)return r(o,s,l)}return this.collator?n(o,s,l,this.collator.evaluate(o)):r(o,s,l)}eachChild(i){i(this.lhs),i(this.rhs),this.collator&&i(this.collator)}outputDefined(){return!0}serialize(){let r=[i];return this.eachChild(i=>{r.push(i.serialize())}),r}}}let nI=nC("==",function(i,r,n){return r===n},nA),nk=nC("!=",function(i,r,n){return r!==n},function(i,r,n,a){return!nA(0,r,n,a)}),nR=nC("<",function(i,r,n){return r<n},function(i,r,n,a){return 0>a.compare(r,n)}),nM=nC(">",function(i,r,n){return r>n},function(i,r,n,a){return a.compare(r,n)>0}
2),nL=nC("<=",function(i,r,n){return r<=n},function(i,r,n,a){return 0>=a.compare(r,n)}),nP=nC(">=",function(i,r,n){return r>=n},function(i,r,n,a){return a.compare(r,n)>=0});class nO{constructor(i,r,n,a,o,s){this.type=iO,this.number=i,this.locale=r,this.currency=n,this.unit=a,this.minFractionDigits=o,this.maxFractionDigits=s}static parse(i,r){if(3!==i.length)return r.error("Expected two arguments.");let n=r.parse(i[1],1,iP);if(!n)return null;let a=i[2];if("object"!=typeof a||Array.isArray(a))return r.error("NumberFormat options argument must be an object.");let o=null;if(a.locale&&!(o=r.parseObjectValue(a.locale,2,"locale",iO)))return null;let s=null;if(a.currency&&!(s=r.parseObjectValue(a.currency,2,"currency",iO)))return null;let l=null;if(a.unit&&!(l=r.parseObjectValue(a.unit,2,"unit",iO)))return null;let u=null;if(a["min-fraction-digits"]&&!(u=r.parseObjectValue(a["min-fraction-digits"],2,"min-fraction-digits",iP)))return null;let c=null;return!a["max-fraction-digits"]||(c=r.parseObjectValue(a["max-fraction-digits"],2,"max-fraction-digits",iP))?new nO(n,o,s,l,u,c):null}evaluate(i){return new Intl.NumberFormat(this.locale?this.locale.evaluate(i):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(i):void 0,unit:this.unit?this.unit.evaluate(i):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(i):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(i):void 0}).format(this.number.evaluate(i))}eachChild(i){i(this.number),this.locale&&i(this.locale),this.currency&&i(this.currency),this.unit&&i(this.unit),this.minFractionDigits&&i(this.minFractionDigits),this.maxFractionDigits&&i(this.maxFractionDigits)}outputDefined(){return!1}serialize(){let i={};return this.locale&&(i.locale=this.locale.serialize()),this.currency&&(i.currency=this.currency.serialize()),this.unit&&(i.unit=this.unit.serialize()),this.minFractionDigits&&(i["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(i["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),i]}}class nD{constructor(i){this.type=iP,this.input=i}static parse(i,r){if(2!==i.length)return r.error(`Expected 1 argument, but found ${i.length-1} instead.`),null;let n=r.parse(i[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?(r.error(`Expected argument of type string or array, but found ${iH(n.type)} instead.`),null):new nD(n):null}evaluate(i){let r=this.input.evaluate(i);if("string"==typeof r||Array.isArray(r))return r.length;throw new i9(`Expected value to be of type string or array, but found ${iH(i2(r))} instead.`)}eachChild(i){i(this.input)}outputDefined(){return!1}serialize(){let i=["length"];return this.eachChild(r=>{i.push(r.serialize())}),i}}function nF(i){return function(){let r=Math.imul((i=0x6d2b79f5+(i|=0)|0)^i>>>15,1|i);return(((r=r+Math.imul(r^r>>>7,61|r)^r)^r>>>14)>>>0)/0x100000000}}let nN={"==":nI,"!=":nk,">":nM,"<":nR,">=":nP,"<=":nL,array:i8,at:n_,"at-interpolated":ny,boolean:i8,case:nw,coalesce:np,collator:rd,format:i6,image:i7,in:nv,"index-of":nx,interpolate:nh,"interpolate-hcl":nh,"interpolate-lab":nh,length:nD,let:ng,literal:i4,match:nb,number:i8,"number-format":nO,object:i8,slice:nT,step:r3,string:i8,"to-boolean":ro,"to-color":ro,"to-number":ro,"to-string":ro,var:r5,within:rw,distance:rZ,config:r2,split:nE};function nj(i,[r,n,a,o]){r=r.evaluate(i),n=n.evaluate(i),a=a.evaluate(i);let s=o?o.evaluate(i):1,l=i1(r,n,a,s);if(l)throw new i9(l);return new iE(r/255,n/255,a/255,s)}function nz(i,[r,n,a,o]){var s,l,u;r=r.evaluate(i),n=n.evaluate(i),a=a.evaluate(i);let c=o?o.evaluate(i):1,d=(s=r,l=n,u=a,"number"==typeof s&&s>=0&&s<=360?"number"==typeof l&&l>=0&&l<=100&&"number"==typeof u&&u>=0&&u<=100?void 0===c||"number"==typeof c&&c>=0&&c<=1?null:`Invalid hsla value [${[s,l,u,c].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof c?[s,l,u,c]:[s,l,u]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof c?[s,l,u,c]:[s,l,u]).join(", ")}]: 'h' must be between 0 and 360.`);if(d)throw new i9(d);let h=`hsla(${r}, ${n}%, ${a}%, ${c})`,f=iE.parse(h);if(!f)throw new i9(`Failed to parse HSLA color: ${h}`);return f}function nB(i,r){let n=r[i];return void 0===n?null:n}function nU(i){return{type:i}}function nV(i){if(i instanceof r2)return new Set([i.key]);let r=new Set;return i.eachChild(i=>{r=new Set([...r,...nV(i)])}),r}function nH(i){if(i instanceof ru&&"is-active-floor"===i.name)return!0;let r=!1;return i.eachChild(i=>{!r&&nH(i)&&(r=!0)}),r}function nG(i){return{result:"success",value:i}}function nq(i){return{result:"error",value:i}}function n$(i,r){return!!i&&!!i.parameters&&i.parameters.includes(r)}function nW(i){return"data-driven"===i["property-type"]}function nY(i){return n$(i.expression,"measure-light")}function nZ(i){return n$(i.expression,"zoom")}function nK(i){return!!i.expression&&i.expression.interpolated}function nX(i){return"object"==typeof i&&null!==i&&!Array.isArray(i)}function nQ(i){return i}function nJ(i,r,n){return void 0!==i?i:void 0!==r?r:void 0!==n?n:void 0}function n1(i,r,n,a,o){return nJ(typeof n===o?a[n]:void 0,i.default,r.default)}function n0(i,r,n){if(!rr(n))return nJ(i.default,r.default);let a=i.stops.length;if(1===a||n<=i.stops[0][0])return i.stops[0][1];if(n>=i.stops[a-1][0])return i.stops[a-1][1];let o=r9(i.stops.map(i=>i[0]),n);return i.stops[o][1]}function n2(i,r,n){var a;let o,s,l=void 0!==i.base?i.base:1;if(!rr(n))return nJ(i.default,r.default);let u=i.stops.length;if(1===u||n<=i.stops[0][0])return i.stops[0][1];if(n>=i.stops[u-1][0])return i.stops[u-1][1];let c=r9(i.stops.map(i=>i[0]),n),d=(a=i.stops[c][0],o=i.stops[c+1][0]-a,s=n-a,0===o?0:1===l?s/o:(Math.pow(l,s)-1)/(Math.pow(l,o)-1)),h=i.stops[c][1],f=i.stops[c+1][1],p=ik[r.type]||nQ;if(i.colorSpace&&"rgb"!==i.colorSpace){let r=nd[i.colorSpace];p=(i,n)=>r.reverse(r.interpolate(r.forward(i),r.forward(n),d))}return"function"==typeof h.evaluate?{evaluate(...i){let r=h.evaluate.apply(void 0,i),n=f.evaluate.apply(void 0,i);if(void 0!==r&&void 0!==n)return p(r,n,d)}}:p(h,f,d)}function n5(i,r,n){return"color"===r.type?n=iE.parse(n):"formatted"===r.type?n=iX.fromString(n.toString()):"resolvedImage"===r.type?n=iJ.build(n.toString()):re(n)===r.type||"enum"===r.type&&r.values[n]||(n=void 0),nJ(n,i.default,r.default)}ru.register(nN,{error:[{kind:"error"},[iO],(i,[r])=>{throw new i9(r.evaluate(i))}],typeof:[iO,[ij],(i,[r])=>iH(i2(r.evaluate(i)))],"to-rgba":[iV(iP,4),[iF],(i,[r])=>r.evaluate(i).toNonPremultipliedRenderColor(null).toArray()],"to-hsla":[iV(iP,4),[iF],(i,[r])=>r.evaluate(i).toNonPremultipliedRenderColor(null).toHslaArray()],rgb:[iF,[iP,iP,iP],nj],rgba:[iF,[iP,iP,iP,iP],nj],hsl:[iF,[iP,iP,iP],nz],hsla:[iF,[iP,iP,iP,iP],nz],has:{type:iD,overloads:[[[iO],(i,[r])=>r.evaluate(i)in i.properties()],[[iO,iN],(i,[r,n])=>r.evaluate(i)in n.evaluate(i)]]},get:{type:ij,overloads:[[[iO],(i,[r])=>nB(r.evaluate(i),i.properties())],[[iO,iN],(i,[r,n])=>nB(r.evaluate(i),n.evaluate(i))]]},"feature-state":[ij,[iO],(i,[r])=>nB(r.evaluate(i),i.featureState||{})],properties:[iN,[],i=>i.properties()],"geometry-type":[iO,[],i=>i.geometryType()],worldview:[iO,[],i=>i.globals.worldview||""],"is-active-floor":[iD,nU(iO),(i,r)=>{if(!(i.globals&&i.globals.activeFloors&&i.globals.activeFloors.size>0))return!1;if(0===r.length)return!0;let n=i.globals.activeFloors;return r.some(r=>{let a=r.evaluate(i);return n.has(a)})}],id:[ij,[],i=>i.id()],zoom:[iP,[],i=>i.globals.zoom],pitch:[iP,[],i=>i.globals.pitch||0],"distance-from-center":[iP,[],i=>i.distanceFromCenter()],"measure-light":[iP,[iO],(i,[r])=>i.measureLight(r.evaluate(i))],"heatmap-density":[iP,[],i=>i.globals.heatmapDensity||0],"line-progress":[iP,[],i=>i.globals.lineProgress||0],"raster-value":[iP,[],i=>i.globals.rasterValue||0],"raster-particle-speed":[iP,[],i=>i.globals.rasterParticleSpeed||0],"sky-radial-progress":[iP,[],i=>i.globals.skyRadialProgress||0],accumulated:[ij,[],i=>void 0===i.globals.accumulated?null:i.globals.accumulated],"+":[iP,nU(iP),(i,r)=>{let n=0;for(let a of r)n+=a.evaluate(i);return n}],"*":[iP,nU(iP),(i,r)=>{let n=1;for(let a of r)n*=a.evaluate(i);return n}],"-":{type:iP,overloads:[[[iP,iP],(i,[r,n])=>r.evaluate(i)-n.evaluate(i)],[[iP],(i,[r])=>-r.evaluate(i)]]},"/":[iP,[iP,iP],(i,[r,n])=>r.evaluate(i)/n.evaluate(i)],"%":[iP,[iP,iP],(i,[r,n])=>r.evaluate(i)%n.evaluate(i)],ln2:[iP,[],()=>Math.LN2],pi:[iP,[],()=>Math.PI],e:[iP,[],()=>Math.E],"^":[iP,[iP,iP],(i,[r,n])=>Math.pow(r.evaluate(i),n.evaluate(i))],sqrt:[iP,[iP],(i,[r])=>Math.sqrt(r.evaluate(i))],log10:[iP,[iP],(i,[r])=>Math.log(r.evaluate(i))/Math.LN10],ln:[iP,[iP],(i,[r])=>Math.log(r.evaluate(i))],log2:[iP,[iP],(i,[r])=>Math.log2(r.evaluate(i))],sin:[iP,[iP],(i,[r])=>Math.sin(r.evaluate(i))],cos:[iP,[iP],(i,[r])=>Math.cos(r.evaluate(i))],tan:[iP,[iP],(i,[r])=>Math.tan(r.evaluate(i))],asin:[iP,[iP],(i,[r])=>Math.asin(r.evaluate(i))],acos:[iP,[iP],(i,[r])=>Math.acos(r.evaluate(i))],atan:[iP,[iP],(i,[r])=>Math.atan(r.evaluate(i))],min:[iP,nU(iP),(i,r)=>Math.min(...r.map(r=>r.evaluate(i)))],max:[iP,nU(iP),(i,r)=>Math.max(...r.map(r=>r.evaluate(i)))],abs:[iP,[iP],(i,[r])=>Math.abs(r.evaluate(i))],round:[iP,[iP],(i,[r])=>{let n=r.evaluate(i);return n<0?-Math.round(-n):Math.round(n)}],floor:[iP,[iP],(i,[r])=>Math.floor(r.evaluate(i))],ceil:[iP,[iP],(i,[r])=>Math.ceil(r.evaluate(i))],"filter-==":[iD,[iO,ij],(i,[r,n])=>i.properties()[r.value]===n.value],"filter-id-==":[iD,[ij],(i,[r])=>i.id()===r.value],"filter-type-==":[iD,[iO],(i,[r])=>i.geometryType()===r.value],"filter-<":[iD,[iO,ij],(i,[r,n])=>{let a=i.properties()[r.value],o=n.value;return typeof a==typeof o&&a<o}],"filter-id-<":[iD,[ij],(i,[r])=>{let n=i.id(),a=r.value;return typeof n==typeof a&&n<a}],"filter->":[iD,[iO,ij],(i,[r,n])=>{let a=i.properties()[r.value],o=n.value;return typeof a==typeof o&&a>o}],"filter-id->":[iD,[ij],(i,[r])=>{let n=i.id(),a=r.value;return typeof n==typeof a&&n>a}],"filter-<=":[iD,[iO,ij],(i,[r,n])=>{let a=i.properties()[r.value],o=n.value;return typeof a==typeof o&&a<=o}],"filter-id-<=":[iD,[ij],(i,[r])=>{let n=i.id(),a=r.value;return typeof n==typeof a&&n<=a}],"filter->=":[iD,[iO,ij],(i,[r,n])=>{let a=i.properties()[r.value],o=n.value;return typeof a==typeof o&&a>=o}],"filter-id->=":[iD,[ij],(i,[r])=>{let n=i.id(),a=r.value;return typeof n==typeof a&&n>=a}],"filter-has":[iD,[ij],(i,[r])=>
2r.value in i.properties()],"filter-has-id":[iD,[],i=>null!==i.id()&&void 0!==i.id()],"filter-type-in":[iD,[iV(iO)],(i,[r])=>r.value.includes(i.geometryType())],"filter-id-in":[iD,[iV(ij)],(i,[r])=>r.value.includes(i.id())],"filter-in-small":[iD,[iO,iV(ij)],(i,[r,n])=>n.value.includes(i.properties()[r.value])],"filter-in-large":[iD,[iO,iV(ij)],(i,[r,n])=>(function(i,r,n,a){for(;n<=a;){let o=n+a>>1;if(r[o]===i)return!0;r[o]>i?a=o-1:n=o+1}return!1})(i.properties()[r.value],n.value,0,n.value.length-1)],all:{type:iD,overloads:[[[iD,iD],(i,[r,n])=>r.evaluate(i)&&n.evaluate(i)],[nU(iD),(i,r)=>{for(let n of r)if(!n.evaluate(i))return!1;return!0}]]},any:{type:iD,overloads:[[[iD,iD],(i,[r,n])=>r.evaluate(i)||n.evaluate(i)],[nU(iD),(i,r)=>{for(let n of r)if(n.evaluate(i))return!0;return!1}]]},"!":[iD,[iD],(i,[r])=>!r.evaluate(i)],"is-supported-script":[iD,[iO],(i,[r])=>{let n=i.globals&&i.globals.isSupportedScript;return!n||n(r.evaluate(i))}],upcase:[iO,[iO],(i,[r])=>r.evaluate(i).toUpperCase()],downcase:[iO,[iO],(i,[r])=>r.evaluate(i).toLowerCase()],concat:[iO,nU(ij),(i,r)=>r.map(r=>i5(r.evaluate(i))).join("")],"resolved-locale":[iO,[iz],(i,[r])=>r.evaluate(i).resolvedLocale()],random:[iP,[iP,iP,ij],(i,r)=>{let n,[a,o,s]=r.map(r=>r.evaluate(i));if(a>o||a===o)return a;if("string"==typeof s)n=function(i){let r=0;if(0===i.length)return r;for(let n=0;n<i.length;n++)r=(r<<5)-r+i.charCodeAt(n),r&=r;return r}(s);else{if("number"!=typeof s)throw new i9(`Invalid seed input: ${s}`);n=s}return a+nF(n)()*(o-a)}]});class n4{constructor(i,r,n,a,o){this.expression=i,this._warningHistory={},this._scope=n,this._options=a,this._iconImageUseTheme=o,this._evaluator=new rl(n,a,o),this._defaultValue=r?function(i){return"color"===i.type&&(nX(i.default)||Array.isArray(i.default))?new iE(0,0,0,0):"color"===i.type?iE.parse(i.default)||null:void 0===i.default?null:i.default}(r):null,this._enumValues=r&&"enum"===r.type?r.values:null,this.configDependencies=nV(i),this.isIndoorDependent=nH(i)}evaluateWithoutErrorHandling(i,r,n,a,o,s,l,u){return this._evaluator.globals=i,this._evaluator.feature=r,this._evaluator.featureState=n,this._evaluator.canonical=a||null,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=s,this._evaluator.featureTileCoord=l||null,this._evaluator.featureDistanceData=u||null,this.expression.evaluate(this._evaluator)}evaluate(i,r,n,a,o,s,l,u,c){this._evaluator||(this._evaluator=new rl(this._scope,this._options,this._iconImageUseTheme)),this._evaluator.globals=i,this._evaluator.feature=r||null,this._evaluator.featureState=n||null,this._evaluator.canonical=a||null,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=s||null,this._evaluator.featureTileCoord=l||null,this._evaluator.featureDistanceData=u||null,this._evaluator.iconImageUseTheme=c||null;try{let i=this.expression.evaluate(this._evaluator);if(null==i||"number"==typeof i&&i!=i)return this._defaultValue;if(this._enumValues&&!(i in this._enumValues))throw new i9(`Expected value to be one of ${Object.keys(this._enumValues).map(i=>JSON.stringify(i)).join(", ")}, but found ${JSON.stringify(i)} instead.`);return i}catch(i){return this._warningHistory[i.message]||(this._warningHistory[i.message]=!0,"u">typeof console&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${i.message}`)),this._defaultValue}}}function n9(i){return Array.isArray(i)&&i.length>0&&"string"==typeof i[0]&&i[0]in nN}function n3(i,r,n,a,o){let s,l=new r4(nN,[],r?(s={color:iF,string:iO,number:iP,enum:iO,boolean:iD,formatted:iB,resolvedImage:iU},"array"===r.type?iV(s[r.value]||ij,r.length):s[r.type]):void 0,void 0,void 0,n,a,o),u=l.parse(i,void 0,void 0,void 0,r&&"string"===r.type?{typeAnnotation:"coerce"}:void 0);return u?nG(new n4(u,r,n,a,o)):nq(l.errors)}class n8{constructor(i,r,n,a){this.kind=i,this._styleExpression=r,this.isLightConstant=n,this.isLineProgressConstant=a,this.isStateDependent="constant"!==i&&!rX(r.expression),this.configDependencies=nV(r.expression),this.isIndoorDependent=nH(r.expression)}evaluateWithoutErrorHandling(i,r,n,a,o,s){return this._styleExpression.evaluateWithoutErrorHandling(i,r,n,a,o,s)}evaluate(i,r,n,a,o,s,l){return this._styleExpression.evaluate(i,r,n,a,o,s,void 0,void 0,l)}}class n6{constructor(i,r,n,a,o,s){this.kind=i,this.zoomStops=n,this._styleExpression=r,this.isStateDependent="camera"!==i&&!rX(r.expression),this.isIndo
2orDependent=nH(r.expression),this.isLightConstant=o,this.isLineProgressConstant=s,this.configDependencies=nV(r.expression),this.interpolationType=a}evaluateWithoutErrorHandling(i,r,n,a,o,s){return this._styleExpression.evaluateWithoutErrorHandling(i,r,n,a,o,s)}evaluate(i,r,n,a,o,s){return this._styleExpression.evaluate(i,r,n,a,o,s)}interpolationFactor(i,r,n){return this.interpolationType?nh.interpolationFactor(this.interpolationType,i,r,n):0}}function n7(i,r,n,a,o){if("error"===(i=n3(i,r,n,a,o)).result)return i;let s=i.value.expression,l=rK(s);if(!l&&!nW(r))return nq([new iR("","data expressions not supported")]);let u=rQ(s,["zoom","pitch","distance-from-center"]);if(!u&&!nZ(r))return nq([new iR("","zoom expressions not supported")]);let c=rQ(s,["measure-light"]);if(!c&&!nY(r))return nq([new iR("","measure-light expression not supported")]);let d=rQ(s,["line-progress"]);if(!d&&!n$(r.expression,"line-progress"))return nq([new iR("","line-progress expression not supported")]);let h=r.expression&&r.expression.relaxZoomRestriction,f=function i(r){let n=null;if(r instanceof ng)n=i(r.result);else if(r instanceof np){for(let a of r.args)if(n=i(a))break}else(r instanceof r3||r instanceof nh)&&r.input instanceof ru&&"zoom"===r.input.name&&(n=r);return n instanceof iR||r.eachChild(r=>{let a=i(r);a instanceof iR?n=a:n&&a&&n!==a&&(n=new iR("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),n}(s);return f||u||h?f instanceof iR?nq([f]):f instanceof nh&&!nK(r)?nq([new iR("",'"interpolate" expressions cannot be used with this property')]):nG(f?new n6(l&&d?"camera":"composite",i.value,f.labels,f instanceof nh?f.interpolation:void 0,c,d):new n8(l&&d?"constant":"source",i.value,c,d)):nq([new iR("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class ae{constructor(i,r){this._parameters=i,this._specification=r,Object.assign(this,function i(r,n){let a,o,s,l="color"===n.type,u=r.stops&&"object"==typeof r.stops[0][0],c=u||!(u||void 0!==r.property),d=r.type||(nK(n)?"exponential":"interval");if(l&&((r=Object.assign({},r)).stops&&(r.stops=r.stops.map(i=>[i[0],iE.parse(i[1])])),r.default=iE.parse(r.default?r.default:n.default)),r.colorSpace&&"rgb"!==r.colorSpace&&!nd[r.colorSpace])throw Error(`Unknown color space: ${r.colorSpace}`);if("exponential"===d)a=n2;else if("interval"===d)a=n0;else if("categorical"===d){for(let i of(a=n1,o=Object.create(null),r.stops))o[i[0]]=i[1];s=typeof r.stops[0][0]}else{if("identity"!==d)throw Error(`Unknown function type "${d}"`);a=n5}if(u){let a={},o=[];for(let i=0;i<r.stops.length;i++){let n=r.stops[i],s=n[0].zoom;void 0===a[s]&&(a[s]={zoom:s,type:r.type,property:r.property,default:r.default,stops:[]},o.push(s)),a[s].stops.push([n[0].value,n[1]])}let s=[];for(let r of o)s.push([a[r].zoom,i(a[r],n)]);let l={name:"linear"};return{kind:"composite",interpolationType:l,interpolationFactor:nh.interpolationFactor.bind(void 0,l),zoomStops:s.map(i=>i[0]),evaluate:({zoom:i},a)=>n2({stops:s,base:r.base},n,i).evaluate(i,a)}}if(c){let i="exponential"===d?{name:"exponential",base:void 0!==r.base?r.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:nh.interpolationFactor.bind(void 0,i),zoomStops:r.stops.map(i=>i[0]),evaluate:({zoom:i})=>a(r,n,i,o,s)}}return{kind:"source",evaluate(i,l){let u=l&&l.properties?l.properties[r.property]:void 0;return void 0===u?nJ(r.default,n.default):a(r,n,u,o,s)}}}(this._parameters,this._specification))}static deserialize(i){return new ae(i._parameters,i._specification)}static serialize(i){return{_parameters:i._parameters,_specification:i._specification}}}class at{constructor(i,r,n){if(this.boxSeen=new Uint32Array(0),this.circleSeen=new Uint32Array(0),this.generation=0,i instanceof ArrayBuffer){const r=new Int32Array(i);this.width=r[0],this.height=r[1],this.xCellCount=r[2],this.yCellCount=r[3],this.boxUid=r[4],this.circleUid=r[5];const n=this.xCellCount*this.yCellCount,a=[];for(let i=0;i<n;i++){const n=r[6+i],o=r[6+i+1];a.push(n===o?null:r.subarray(n,o))}const o=r[6+n],s=[];for(let i=0;i<n;
2i++){const n=r[o+i],a=r[o+i+1];s.push(n===a?null:r.subarray(n,a))}let l=r[o+n];this.boxCells=a,this.circleCells=s,this.boxKeys=r.subarray(l,l+this.boxUid),l+=this.boxUid,this.circleKeys=r.subarray(l,l+this.circleUid),l+=this.circleUid,this.bboxes=r.subarray(l,l+4*this.boxUid),l+=4*this.boxUid,this.circles=r.subarray(l,l+3*this.circleUid)}else{this.width=i,this.height=r,this.xCellCount=Math.ceil(i/n),this.yCellCount=Math.ceil(r/n);const a=this.xCellCount*this.yCellCount,o=[],s=[];for(let i=0;i<a;i++)o.push([]),s.push([]);this.boxCells=o,this.circleCells=s,this.boxKeys=[],this.circleKeys=[],this.bboxes=[],this.circles=[],this.boxUid=0,this.circleUid=0}this.xScale=this.xCellCount/this.width,this.yScale=this.yCellCount/this.height}keysLength(){return this.boxKeys.length+this.circleKeys.length}clear(){for(let i of this.boxCells)i&&(i.length=0);for(let i of this.circleCells)i&&(i.length=0);this.circleKeys.length=0,this.boxKeys.length=0,this.bboxes.length=0,this.circles.length=0,this.boxUid=0,this.circleUid=0}insert(i,r,n,a,o){let s=this.boxUid++,l=this._xCell(r),u=this._yCell(n),c=this._xCell(a),d=this._yCell(o);for(let i=l;i<=c;i++)for(let r=u;r<=d;r++)this.boxCells[this.xCellCount*r+i].push(s);this.boxKeys.push(i),this.bboxes.push(r,n,a,o)}insertCircle(i,r,n,a){let o=this.circleUid++,s=this._xCell(r-a),l=this._yCell(n-a),u=this._xCell(r+a),c=this._yCell(n+a);for(let i=s;i<=u;i++)for(let r=l;r<=c;r++)this.circleCells[this.xCellCount*r+i].push(o);this.circleKeys.push(i),this.circles.push(r,n,a)}query(i,r,n,a,o){let s=[];if(n<0||i>this.width||a<0||r>this.height)return s;let l=this._nextGen(),{boxCells:u,circleCells:c,boxKeys:d,circleKeys:h,bboxes:f,circles:p,boxSeen:m,circleSeen:g,xCellCount:_}=this,y=this._xCell(i),v=this._yCell(r),x=this._xCell(n),b=this._yCell(a);for(let w=y;w<=x;w++)for(let y=v;y<=b;y++){let v=_*y+w,x=u[v];if(x)for(let u=0;u<x.length;u++){let c=x[u];if(m[c]===l)continue;m[c]=l;let h=4*c,p=f[h],g=f[h+1],_=f[h+2],y=f[h+3];i<=_&&r<=y&&n>=p&&a>=g&&(!o||o(d[c]))&&s.push({key:d[c],x1:p,y1:g,x2:_,y2:y})}let b=c[v];if(b)for(let u=0;u<b.length;u++){let c=b[u];if(g[c]===l)continue;g[c]=l;let d=3*c,f=p[d],m=p[d+1],_=p[d+2];this._circleAndRectCollide(f,m,_,i,r,n,a)&&(!o||o(h[c]))&&s.push({key:h[c],x1:f-_,y1:m-_,x2:f+_,y2:m+_})}}return s}queryKeys(i,r,n,a,o){let s=[];if(n<0||i>this.width||a<0||r>this.height)return s;let l=this._nextGen(),{boxCells:u,boxKeys:c,bboxes:d,boxSeen:h,xCellCount:f,xScale:p,yScale:m}=this,g=this._xCell(i),_=this._yCell(r),y=this._xCell(n),v=this._yCell(a);for(let x=g;x<=y;x++)for(let g=_;g<=v;g++){if(o&&!o(x/p,g/m,(x+1)/p,(g+1)/m))continue;let _=u[f*g+x];if(_)for(let u=0;u<_.length;u++){let f=_[u];if(h[f]===l)continue;h[f]=l;let p=4*f,m=d[p],g=d[p+1],y=d[p+2],v=d[p+3];(o?o(m,g,y,v):i<=y&&r<=v&&n>=m&&a>=g)&&s.push(c[f])}}return s}hitTest(i,r,n,a,o){if(n<0||i>this.width||a<0||r>this.height)return!1;let s=this._nextGen(),{boxCells:l,circleCells:u,boxKeys:c,circleKeys:d,bboxes:h,circles:f,boxSeen:p,circleSeen:m,xCellCount:g}=this,_=this._xCell(i),y=this._yCell(r),v=this._xCell(n),x=this._yCell(a);for(let b=_;b<=v;b++)for(let _=y;_<=x;_++){let y=g*_+b,v=l[y];if(v)for(let l=0;l<v.length;l++){let u=v[l];if(p[u]===s)continue;p[u]=s;let d=4*u;if(i<=h[d+2]&&r<=h[d+3]&&n>=h[d]&&a>=h[d+1]&&(!o||o(c[u])))return!0}let x=u[y];if(x)for(let l=0;l<x.length;l++){let u=x[l];if(m[u]===s)continue;m[u]=s;let c=3*u;if(this._circleAndRectCollide(f[c],f[c+1],f[c+2],i,r,n,a)&&(!o||o(d[u])))return!0}}return!1}hitTestCircle(i,r,n,a){let o=i-n,s=r-n,l=i+n,u=r+n;if(l<0||o>this.width||u<0||s>this.height)return!1;let c=this._nextGen(),{boxCells:d,circleCells:h,boxKeys:f,circleKeys:p,bboxes:m,circles:g,boxSeen:_,circleSeen:y,xCellCount:v}=this,x=this._xCell(o),b=this._yCell(s),w=this._xCell(l),T=this._yCell(u);for(let o=x;o<=w;o++)for(let s=b;s<=T;s++){let l=v*s+o,u=d[l];if(u)for(let o=0;o<u.length;o++){let s=u[o];if(_[s]===c)continue;_[s]=c;let l=4*s;if(this._circleAndRectCollide(i,r,n,m[l],m[l+1],m[l+2],m[l+3])&&(!a||a(f[s])))return!0}let x=h[l];if(x)for(let o=0;o<x.length;o++){let s=x[o];if(y[s]===c)continue;y[s]=c;let l=3*s;if(this._circlesCollide(g[l],g[l+1],g[l+2],i,r,n)&&(!a||a(p[s])))return!0}}return!1}static serialize(i,r){let n=i.toArrayBuffer();return r&&r.add(n),{buffer:n}
2}static deserialize(i){return new at(i.buffer)}toArrayBuffer(){let i=this.xCellCount*this.yCellCount,r=0,n=0;for(let a=0;a<i;a++)r+=this.boxCells[a].length,n+=this.circleCells[a].length;let a=new Int32Array(6+(i+1)+r+(i+1)+n+this.boxUid+this.circleUid+4*this.boxUid+3*this.circleUid);a[0]=this.width,a[1]=this.height,a[2]=this.xCellCount,a[3]=this.yCellCount,a[4]=this.boxUid,a[5]=this.circleUid;let o=6+(i+1);for(let r=0;r<i;r++){a[6+r]=o;let i=this.boxCells[r];a.set(i,o),o+=i.length}a[6+i]=o;let s=o;o+=i+1;for(let r=0;r<i;r++){a[s+r]=o;let i=this.circleCells[r];a.set(i,o),o+=i.length}return a[s+i]=o,a.set(this.boxKeys,o),o+=this.boxUid,a.set(this.circleKeys,o),o+=this.circleUid,a.set(this.bboxes,o),o+=4*this.boxUid,a.set(this.circles,o),a.buffer}_xCell(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))}_yCell(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))}_nextGen(){return this.boxSeen.length<this.boxUid&&(this.boxSeen=new Uint32Array(this.boxUid)),this.circleSeen.length<this.circleUid&&(this.circleSeen=new Uint32Array(this.circleUid)),this.generation=this.generation+1>>>0,0===this.generation&&(this.boxSeen.fill(0),this.circleSeen.fill(0),this.generation=1),this.generation}_circlesCollide(i,r,n,a,o,s){let l=a-i,u=o-r,c=n+s;return c*c>l*l+u*u}_circleAndRectCollide(i,r,n,a,o,s,l){let u=(s-a)/2,c=Math.abs(i-(a+u));if(c>u+n)return!1;let d=(l-o)/2,h=Math.abs(r-(o+d));if(h>d+n)return!1;if(c<=u||h<=d)return!0;let f=c-u,p=h-d;return f*f+p*p<=n*n}}let ai={};function ar(i,r,n={}){Object.defineProperty(i,"_classRegistryKey",{value:r,writable:!1}),ai[r]={klass:i,omit:n.omit||[]}}for(let i in ar(Object,"Object"),ar(at,"Grid"),delete eQ.prototype.constructor,ar(iE,"Color"),ar(Error,"Error"),ar(iX,"Formatted"),ar(iK,"FormattedSection"),ar(it,"AJAXError"),ar(iJ,"ResolvedImage"),ar(ae,"StylePropertyFunction"),ar(n4,"StyleExpression",{omit:["_evaluator"]}),ar(iy,"ImageId"),ar(iQ,"ImageVariant"),ar(n6,"ZoomDependentExpression"),ar(n8,"ZoomConstantExpression"),ar(ru,"CompoundExpression",{omit:["_evaluate"]}),nN)ai[nN[i]._classRegistryKey]||ar(nN[i],`Expression${i}`);function an(i){return i&&(i instanceof ArrayBuffer||i.constructor&&"ArrayBuffer"===i.constructor.name)}function aa(i,r){if(null===i)return null;let n=typeof i;if("object"!==n)return"bigint"===n?{$name:"BigInt",value:i.toString()}:i;if(Array.isArray(i)){let n=i.length,a=[];a.length=n;for(let o=0;o<n;o++)a[o]=aa(i[o],r);return a}if(ArrayBuffer.isView(i))return r&&r.add(i.buffer),i;if(an(i)||i instanceof ImageBitmap)return r&&r.add(i),i;if(i instanceof ImageData)return r&&r.add(i.data.buffer),i;if(i instanceof Map){let n={$name:"Map",entries:[]};for(let[a,o]of i.entries())n.entries.push(aa(a),aa(o,r));return n}if(i instanceof Set){let r={$name:"Set"},n=0;for(let a of i.values())r[++n]=aa(a);return r}if(i instanceof Date||i instanceof RegExp||i instanceof Boolean||i instanceof Number||i instanceof String)return i;let a=i.constructor||Object,o=a._classRegistryKey;if(!o)throw Error(`Can't serialize object of unregistered class "${a.name}".`);let s=a.serialize?a.serialize(i,r):{};if(!a.serialize){let n=ai[o].omit;for(let a in i)Object.hasOwn(i,a)&&(n.includes(a)||(s[a]=aa(i[a],r)));i instanceof Error&&(s.message=i.message)}if(s.$name)throw Error("$name property is reserved for worker serialization logic.");return"Object"!==o&&(s.$name=o),s}function ao(i){if(null===i||"object"!=typeof i)return i;if(Array.isArray(i)){for(let r=0;r<i.length;r++)i[r]=ao(i[r]);return i}if(ArrayBuffer.isView(i)||an(i)||i instanceof ImageBitmap||i instanceof ImageData||i instanceof Date||i instanceof RegExp||i instanceof Boolean||i instanceof Number||i instanceof String)return i;let r=i.$name||"Object";if("Map"===r){let r=i.entries||[],n=new Map;for(let i=0;i<r.length;i+=2)n.set(ao(r[i]),ao(r[i+1]));return n}if("Set"===r){let r=new Set;for(let n in i)"$name"!==n&&r.add(ao(i[n]));return r}if("BigInt"===r)return BigInt(i.value);let{klass:n}=ai[r];if(!n)throw Error(`Can't deserialize unregistered class "${r}".`);if(n.deserialize)return n.deserialize(i);let a=Object.create(n.prototype);for(let r in i)"$name"!==r&&(a[r]=ao(i[r]));return a}let as=i=>i>=1536&&i<=1791,al=i=>i>=1872&&i<=1919,au=i=>i>=2208&&i<=2303,ac=i=>i>=11904&&i<=12031,ad=i=>i>=12032&&i<=12255,ah=i=>i>=12272&&i<=12287,af=i=>i>=12288&&i<=12351,ap=i=>i>=12352&&i<=12447,am=i=>i>=12448&&i<=12543,ag=i=>i>=12544&&i<=12591,a_=i=>i>=12704&&i<=12735,ay=i=>i>=12736&&i<=12783,av=i=>i>=12784&&i<=12799,ax=i=>i>=12800&&i<=13055,ab=i=>i>=13056&&i<=13311,aw=i=>i>=13312&&i<=19903,aT=i=>i>=19968&&i<=40959,aE=i=>
2i>=40960&&i<=42127,aS=i=>i>=42128&&i<=42191,aA=i=>i>=44032&&i<=55215,aC=i=>i>=63744&&i<=64255,aI=i=>i>=64336&&i<=65023,ak=i=>i>=65040&&i<=65055,aR=i=>i>=65072&&i<=65103,aM=i=>i>=65104&&i<=65135,aL=i=>i>=65136&&i<=65279,aP=i=>i>=65280&&i<=65519;function aO(i){for(let r of i)if(aD(r.charCodeAt(0)))return!0;return!1}function aD(i){return!(746!==i&&747!==i&&(i<4352||!(a_(i)||ag(i)||aR(i)&&!(i>=65097&&i<=65103)||aC(i)||ab(i)||ac(i)||ay(i)||!(!af(i)||i>=12296&&i<=12305||i>=12308&&i<=12319||12336===i)||aw(i)||aT(i)||ax(i)||i>=12592&&i<=12687||i>=43360&&i<=43391||i>=55216&&i<=55295||i>=4352&&i<=4607||aA(i)||ap(i)||ah(i)||i>=12688&&i<=12703||ad(i)||av(i)||am(i)&&12540!==i||!(!aP(i)||65288===i||65289===i||65293===i||i>=65306&&i<=65310||65339===i||65341===i||65343===i||i>=65371&&i<=65503||65507===i||i>=65512&&i<=65519)||!(!aM(i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||i>=5120&&i<=5759||i>=6320&&i<=6399||ak(i)||i>=19904&&i<=19967||aE(i)||aS(i))))}function aF(i){return!(aD(i)||i>=128&&i<=255&&(167===i||169===i||174===i||177===i||188===i||189===i||190===i||215===i||247===i)||i>=8192&&i<=8303&&(8214===i||8224===i||8225===i||8240===i||8241===i||8251===i||8252===i||8258===i||8263===i||8264===i||8265===i||8273===i)||i>=8448&&i<=8527||i>=8528&&i<=8591||i>=8960&&i<=9215&&(i>=8960&&i<=8967||i>=8972&&i<=8991||i>=8996&&i<=9e3||9003===i||i>=9085&&i<=9114||i>=9150&&i<=9165||9167===i||i>=9169&&i<=9179||i>=9186&&i<=9215)||i>=9216&&i<=9279&&9251!==i||i>=9280&&i<=9311||i>=9312&&i<=9471||i>=9632&&i<=9727||i>=9728&&i<=9983&&!(i>=9754&&i<=9759)||i>=11008&&i<=11263&&(i>=11026&&i<=11055||i>=11088&&i<=11097||i>=11192&&i<=11243)||af(i)||am(i)||i>=57344&&i<=63743||aR(i)||aM(i)||aP(i)||8734===i||8756===i||8757===i||i>=9984&&i<=10087||i>=10102&&i<=10131||65532===i||65533===i)}function aN(i){return i>=1424&&i<=2303||aI(i)||aL(i)}let aj={unavailable:"unavailable",deferred:"deferred",loading:"loading",parsing:"parsing",parsed:"parsed",loaded:"loaded",error:"error"},az=null,aB=aj.unavailable,aU=null,aV=function(i){i&&(aB=aj.error),az&&az(i)};function aH(){aG.fire(new ih("pluginStateChange",{pluginStatus:aB,pluginURL:aU}))}let aG=new i_,aq=function(){return aB},a$=function(){if(aB!==aj.deferred||!aU)throw Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");aB=aj.loading,aH(),aU&&iu({url:aU},i=>{i?aV(i):(aB=aj.loaded,aH())})},aW={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>aB===aj.loaded||null!=aW.applyArabicShaping,isLoading:()=>aB===aj.loading,setState(i){aB=i.pluginStatus,aU=i.pluginURL},isParsing:()=>aB===aj.parsing,isParsed:()=>aB===aj.parsed,getPluginURL:()=>aU},aY=function(){aW.isLoading()||aW.isLoaded()||"deferred"!==aq()||a$()};class aZ{constructor(i,r){this.zoom=i,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.transition=r.transition,this.pitch=r.pitch,this.brightness=r.brightness,this.worldview=r.worldview,this.activeFloors=r.activeFloors):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(i){var r=aW.isLoaded();for(let n of i)if(!function(i,r){return!(!r&&aN(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||i>=6016&&i<=6143)}(n.charCodeAt(0),r))return!1;return!0}}class aK{constructor(i,r,n,a,o){this.property=i,this.value=r,this.expression=function(i,r,n,a,o){if(nX(i))return new ae(i,r);if(n9(i)||Array.isArray(i)&&i.length>0){let s=n7(i,r,n,a,o);if("error"===s.result)throw Error(s.value.map(i=>`${i.key}: ${i.message}`).join(", "));return s.value}{let n=i;return"string"==typeof i&&"color"===r.type&&(n=iE.parse(i)),{kind:"constant",configDependencies:new Set,isIndoorDependent:!1,evaluate:()=>n}}}(void 0===r?i.specification.default:r,i.specification,n,a,o)}isIndoorDependent(){return this.expression.isIndoorDependent}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(i,r,n,a){return this.property.possiblyEvaluate(this,i,r,n,a)}}class aX{constructor(i,r,n,a){this.property=i,this.value=new aK(i,void 0,r,n,a)}transitioned(i,r){return new aJ(this.property,this.value,r,Object.assign({},i.transition,this.transition),i.now)}
2untransitioned(){return new aJ(this.property,this.value,null,{},0)}}class aQ{constructor(i,r,n,a){this._properties=i,this._values=Object.create(i.defaultTransitionablePropertyValues),this._scope=r,this._options=n,this._iconImageUseTheme=a,this._isIndoorDependent=!1,this.configDependencies=new Set}getValue(i){return ty(this._values[i].value.value)}setValue(i,r){Object.hasOwn(this._values,i)||(this._values[i]=new aX(this._values[i].property,this._scope,this._options,this._iconImageUseTheme)),this._values[i].value=new aK(this._values[i].property,null===r?void 0:ty(r),this._scope,this._options,this._iconImageUseTheme),this._values[i].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[i].value.expression.configDependencies]),this._isIndoorDependent=this._isIndoorDependent||this._values[i].value.isIndoorDependent())}setTransitionOrValue(i,r){r&&(this._options=r);let n=this._properties.properties;if(i)for(let r in i){let a=i[r];if(r.endsWith("-transition")){let i=r.slice(0,-11);n[i]&&this.setTransition(i,a)}else Object.hasOwn(n,r)&&this.setValue(r,a)}}getTransition(i){return ty(this._values[i].transition)}setTransition(i,r){Object.hasOwn(this._values,i)||(this._values[i]=new aX(this._values[i].property)),this._values[i].transition=ty(r)||void 0}serialize(){let i={};for(let r of Object.keys(this._values)){let n=this.getValue(r);void 0!==n&&(i[r]=n);let a=this.getTransition(r);void 0!==a&&(i[`${r}-transition`]=a)}return i}transitioned(i,r){let n=new a1(this._properties);for(let a of Object.keys(this._values))n._values[a]=this._values[a].transitioned(i,r._values[a]);return n}untransitioned(){let i=new a1(this._properties);for(let r of Object.keys(this._values))i._values[r]=this._values[r].untransitioned();return i}isIndoorDependent(){return this._isIndoorDependent}}class aJ{constructor(i,r,n,a,o){const s=a.delay||0,l=a.duration||0;o=o||0,this.property=i,this.value=r,this.begin=o+s,this.end=this.begin+l,i.specification.transition&&(a.delay||a.duration)&&(this.prior=n)}possiblyEvaluate(i,r,n){let a=i.now||0,o=this.value.possiblyEvaluate(i,r,n),s=this.prior;if(s){if(a>this.end||this.value.isDataDriven())return this.prior=null,o;if(a<this.begin)return s.possiblyEvaluate(i,r,n);{let l=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(s.possiblyEvaluate(i,r,n),o,ta(l))}}return o}}class a1{constructor(i){this._properties=i,this._values=Object.create(i.defaultTransitioningPropertyValues)}possiblyEvaluate(i,r,n){let a=new a5(this._properties);for(let o of Object.keys(this._values))a._values[o]=this._values[o].possiblyEvaluate(i,r,n);return a}hasTransition(){for(let i of Object.keys(this._values))if(this._values[i].prior)return!0;return!1}}class a0{constructor(i,r,n,a){this._properties=i,this._values=Object.create(i.defaultPropertyValues),this._scope=r,this._options=n,this._iconImageUseTheme=a,this._isIndoorDependent=!1,this.configDependencies=new Set}getValue(i){return ty(this._values[i].value)}setValue(i,r){this._values[i]=new aK(this._values[i].property,null===r?void 0:ty(r),this._scope,this._options,this._iconImageUseTheme),this._values[i].expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[i].expression.configDependencies]),this._isIndoorDependent=this._isIndoorDependent||this._values[i].isIndoorDependent())}serialize(){let i={};for(let r of Object.keys(this._values)){let n=this.getValue(r);void 0!==n&&(i[r]=n)}return i}possiblyEvaluate(i,r,n,a){let o=new a5(this._properties);for(let s of Object.keys(this._values))o._values[s]=this._values[s].possiblyEvaluate(i,r,n,a);return o}isIndoorDependent(){return this._isIndoorDependent}}class a2{constructor(i,r,n,a){this.property=i,this.value=r,this.parameters=n,this.iconImageUseTheme=a}isConstant(){return"constant"===this.value.kind}constantOr(i){return"constant"===this.value.kind?this.value.value:i}evaluate(i,r,n,a,o){return this.property.evaluate(this.value,this.parameters,i,r,n,a,this.iconImageUseTheme,o)}}class a5{constructor(i){this._properties=i,this._values=Object.create(i.defaultPossiblyEvaluatedValues)}get(i){return this._values[i]}}class a4{constructor(i){this.specification=i}possiblyEvaluate(i,r){return i.expression.evaluate(r)}interpolate(i,r,n){let a=ik[this.specification.type];return a?a(i,r,n):i}}class a9{constructor(i,r){this.specification=i,this.overrides=r}possiblyEvaluate(i,r,n,a,o){return"constant"===i.expression.kind||"camera"===i.expression.kind?new a2(this,{kind:"constant",value:i.expression.evaluate(r,null,{},n,a,void 0,o)},r):new a2(this,i.expression,r,o)}interpolate(i,r,n){if("constant"!==i.value.kind||"constant"!==r.value.kind)return i;if(void 0===i.value.value||void 0===r.value.value)return new a2(this,{kind:"constant",value:void 0},i.parameters);let a=ik[this.specification.type];return a?new a2(this,{kind:"constant",value:a(i.value.value,r.value.value,n)},i.parameters):i}evaluate(i,r,n,a,o,s,l,u){return"constant"===i.kind?i.value:i.evaluate(r,n,a,o,s,u,l)}}class a3{constructor(i){this.specification=i}possiblyEvaluate(i,r,n,a){return!!i.expression.evaluate(r,null,{},n,a)}interpolate(){return!1}}class a8{constructor(i){this.properties=i,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const r=new aZ(0,{});for(const n in i){const a=i[n],o=a.specification;o&&o.overridable&&this.overridableProperties.push(n);const s=this.defaultPropertyValues[n]=new aK(a,void 0),l=this.defaultTransitionablePropertyValues[n]=new aX(a);this.defaultTransitioningPropertyValues[n]=l.untransitioned(),this.defaultPossiblyEvaluatedValues[n]=s.possiblyEvaluate(r)}}}ar(a9,"DataDrivenProperty"),ar(a4,"DataConstantProperty"),ar(a3,"ColorRampProperty");var a6=JSON.parse('{"expression":1,"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"appearance":{"condition":{"type":"boolean","expression":{"interpolated":1,"parameters":["distance-from-center","feature","feature-state","measure-light","pitch","zoom"]},"property-type":"data-driven"},"name":{"type":"string"},"properties":{"type":"*"}},"function":{"type":{"type":"enum","default":"exponential","values":{"identity":1,"exponential":1,"interval":1,"categorical":1}},"default":{"type":"*"},"expression":1,"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"colorSpace":{"type":"enum","default":"rgb","values":{"rgb":1,"lab":1,"hcl":1}}},"$version":8,"$root":{"transition":{"type":"transition"},"version":{"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"snow":{"type":"snow"},"rain":{"type":"rain"},"camera":{"type":"camera"},"color-theme":{"type":"colorTheme"},"indoor":{"type":"indoor"},"imports":{"type":"array","value":"import"},"iconsets":{"type":"iconsets"},"schema":{"type":"schema"},"sources":{"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"projection":{"type":"projection"},"layers":{"type":"array","value":"layer"},"models":{"type":"models"},"featuresets":{"type":"featuresets"}},"featuresets":{"*":{"type":"featureset"}}
2,"featureset":{"metadata":{"type":"*"},"selectors":{"type":"array","value":"selector"}},"selector":{"layer":{"type":"string"},"properties":{"type":"selectorProperty"},"featureNamespace":{"type":"string"},"_uniqueFeatureID":{"type":"boolean"}},"selectorProperty":{"*":{"type":"*"}},"model":{"type":"string"},"import":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"config"},"data":{"type":"$root"},"color-theme":{"type":"colorTheme","optional":true}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"default":{"type":"*","expression":1},"values":{"type":"array","value":"*"},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}},"light-3d":{"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}},"id":{"type":"string"},"properties":{"type":"properties"}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"use-theme":1},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"cast-shadows":{"type":"boolean","default":false},"shadow-quality":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"parameters":["zoom"]}},"shadow-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"shadow-draw-before-layer":{"type":"string"}},"properties_light_ambient":{"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"use-theme":1},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"use-theme":1},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"iconsets":{"*":{"type":"iconset"}},"iconset":["iconset_sprite","iconset_source"],"iconset_sprite":{"type":{"type":"enum","values":{"sprite":1}},"url":{"type":"string"}},"iconset_source":{"type":{"type":"enum","values":{"source":1}},"source":{"type":"string"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"type":"enum","values":{"vector":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","default":[-180,-85.051129,180,85.051129],"length":4,"value":"number"},"extra_bounds":{"type":"array","value":{"type":"array","length":4,"value":"number"}},"scheme":{"type":"enum","default":"xyz","values":{"xyz":1,"tms":1}},"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":{"type":"enum","values":{"raster":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","default":[-180,-85.051129,180,85.051129],"length":4,"value":"number"},"extra_bounds":{"type":"array","value":{"type":"array","length":4,"value":"number"}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"scheme":{"type":"enum","default":"xyz","values":{"xyz":1,"tms":1}},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"type":"enum","values":{"raster-dem":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","default":[-180,-85.051129,180,85.051129],"length":4,"value":"number"},"extra_bounds":{"type":"array","value":{"type":"array","length":4,"value":"number"}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"encoding":{"type":"enum","default":"mapbox","values":{"terrarium":1,"mapbox":1}},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"type":{"type":"enum","values":{"raster-array":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","default":[-180,-85.051129,180,85.051129],"length":4,"value":"number"},"extra_bounds":{"type":"array","value":{"type":"array","length":4,"value":"number"}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"minimum":0,"maximum":512},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0}
2,"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"},"dynamic":{"type":"boolean","default":false}},"source_video":{"type":{"type":"enum","values":{"video":1}},"urls":{"type":"array","value":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"type":"enum","values":{"image":1}},"url":{"type":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"modelNodeOverride":{"orientation":{"type":"array","default":[0,0,0],"length":3,"value":"number"}},"modelNodeOverrides":{"*":{"type":"modelNodeOverride"}},"modelMaterialOverride":{"model-color":{"type":"color"},"model-color-mix-intensity":{"type":"number"},"model-opacity":{"type":"number"},"model-emissive-strength":{"type":"number"}},"modelMaterialOverrides":{"*":{"type":"modelMaterialOverride"}},"modelSourceModel":{"uri":{"type":"string"},"position":{"type":"array","default":[0,0],"minimum":[-180,-90],"maximum":[180,90],"length":2,"value":"number"},"orientation":{"type":"array","default":[0,0,0],"length":3,"value":"number"},"nodeOverrides":{"type":"modelNodeOverrides"},"materialOverrides":{"type":"modelMaterialOverrides"},"nodeOverrideNames":{"type":"array","value":"string"},"materialOverrideNames":{"type":"array","value":"string"},"featureProperties":{"type":"*"}},"modelSourceModels":{"*":{"type":"modelSourceModel"}},"source_model":{"type":{"type":"enum","values":{"model":1,"batched-model":1}},"url":{"type":"string"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"},"models":{"type":"modelSourceModels"}},"layer":{"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"building":{},"raster":{},"raster-particle":{},"hillshade":{},"model":{},"background":{},"sky":{},"slot":{},"clip":{}}},"id":{"type":"string"},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"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"},"appearances":{"type":"array","value":"appearance"}},"layout":["layout_clip","layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_building","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_sky":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_model":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1},"model-id":{"type":"string","default":"","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"model-allow-density-reduction":{"type":"boolean","default":true}},"layout_clip":{"clip-layer-types":{"type":"array","default":[],"value":"enum","values":{"model":1,"symbol":1},"expression":1},"clip-layer-scope":{"type":"array","default":[],"value":"string","expression":1},"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1},"fill-elevation-reference":{"type":"enum","default":"none","values":{"none":1,"hd-road-base":1,"hd-road-markup":1},"expression":1},"fill-construct-bridge-guard-rail":{"type":"boolean","default":"true","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"circle-elevation-reference":{"type":"enum","default":"none","values":{"none":1,"hd-road-markup":1},"expression":1},"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_heatmap":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_fill-extrusion":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1},"fill-extrusion-edge-radius":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"source-max-zoom":{"type":"number","minimum":0,"maximum":24}},"layout_building":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1},"building-facade":{"type":"boolean","default":false,"expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-facade-floors":{"type":"number","default":3,"minimum":1,"maximum":200,"expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-facade-unit-width":{"type":"number","default":3.1,"minimum":1,"maximum":20,"expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-facade-window":{"type":"array","default":[0.9,0.9],"minimum":0.1,"maximum":1,"length":2,"value":"number","expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-roof-shape":{"type":"enum","default":"flat","values":{"flat":1,"hipped":1,"gabled":1,"parapet":1,"mansard":1,"skillion":1,"pyramidal":1},"expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-height":{"type":"number","default":0,"minimum":0,"expression":1,"transition":1,"property-type":"data-driven"},"building-base":{"type":"number","default":0,"minimum":0,"expression":1,"transition":1,"property-type":"data-driven"},"building-flood-light-wall-radius":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"},"building-flood-light-ground-radius":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"},"building-flip-roof-orientation":{"type":"boolean","default":false,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"}},"layout_line":{"line-cap":{"type":"enum","default":"butt","values":{"butt":1,"round":1,"square":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"line-join":{"type":"enum","default":"miter","values":{"bevel":1,"round":1,"miter":1,"none":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":1,"parameters":["zoom"]}},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":1,"parameters":["zoom"]}},"line-sort-key":{"type":"number","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"line-z-offset":{"type":"number","default":0,"expression":{"parameters":["feature","line-progress","zoom"]},"property-type":"data-driven"},"line-elevation-reference":{"type":"enum","default":"none","values":{"none":1,"sea":1,"ground":1,"hd-road-markup":1},"expression":1},"line-cross-slope":{"type":"number","expression":1},"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1},"line-width-unit":{"type":"enum","default":"pixels","values":{"pixels":1,"meters":1},"expression":{"parameters":["zoom"]}},"line-elevation-ground-scale":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","line-progress","zoom"]},"transition":1,"property-type":"data-driven"}},"layout_symbol":{"symbol-placement":{"type":"enum","default":"point","values":{"point":1,"line":1,"line-center":1},"expression":{"parameters":["zoom"]}},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":1,"parameters":["zoom"]}},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-sort-key":{"type":"number","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","default":"auto","values":{"auto":1,"viewport-y":1,"source":1},"expression":{"parameters":["zoom"]}},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-elevation-reference":{"type":"enum","default":"ground","values":{"sea":1,"ground":1,"hd-road-markup":1},"expression":{"parameters":["zoom"]}},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-rotation-alignment":{"type":"enum","default":"auto","values":{"map":1,"viewport":1,"auto":1},"expression":{"parameters":["zoom"]}},"icon-size":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven","appearance":1},"icon-size-scale-range":{"type":"array","default":[0.8,2],"minimum":[0.1,0.1],"maximum":[10,10],"length":2,"value":"number","expression":1},"icon-text-fit":{"type":"enum","default":"none","values":{"none":1,"width":1,"height":1,"both":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","default":[0,0,0,0],"length":4,"value":"number","expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","expression":{"parameters":["feature","zoom"]},"use-theme":1,"property-type":"data-driven","appearance":1,"tokens":1},"icon-rotate":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven","appearance":1},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]}},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-offset":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven","appearance":1},"icon-anchor":{"type":"enum","default":"center","values":{"center":1,"left"
2:1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","default":"auto","values":{"map":1,"viewport":1,"auto":1},"expression":{"parameters":["zoom"]}},"text-pitch-alignment":{"type":"enum","default":"auto","values":{"map":1,"viewport":1,"auto":1},"expression":{"parameters":["zoom"]}},"text-rotation-alignment":{"type":"enum","default":"auto","values":{"map":1,"viewport":1,"auto":1},"expression":{"parameters":["zoom"]}},"text-field":{"type":"formatted","default":"","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven","tokens":1},"text-font":{"type":"array","default":["Open Sans Regular","Arial Unicode MS Regular"],"value":"string","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven","appearance":1},"text-size-scale-range":{"type":"array","default":[0.8,2],"minimum":[0.1,0.1],"maximum":[10,10],"length":2,"value":"number","expression":1},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-justify":{"type":"enum","default":"center","values":{"auto":1,"left":1,"center":1,"right":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]}},"text-anchor":{"type":"enum","default":"center","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":1,"parameters":["zoom"]}},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]}},"text-rotate":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven","appearance":1},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]}},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"text-transform":{"type":"enum","default":"none","values":{"none":1,"uppercase":1,"lowercase":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-offset":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven","appearance":1},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_raster":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_raster-particle":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_hillshade":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"expression":{"parameters":["distance-from-center","feature","pitch","zoom"]},"property-type":"data-driven"},"filter_fill":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_hillshade":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_raster":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_raster-particle":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_clip":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_model":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_line":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_circle":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_fill-extrusion":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_building":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_heatmap":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"function_stop":{"type":"array","minimum":0,"maximum":24,"length":2,"value":["number","color"]},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"high-color":{"type":"color","default":"#245cdf","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"space-color":{"type":"color","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"horizon-blend":{"type":"number","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"star-intensity":{"type":"number","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1}},"snow":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.85],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.3],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vignette-color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"center-thinning":{"type":"number","default":0.4,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"direction":{"type":"array","default":[0,50],"minimum":0,"maximum":360,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"flake-size":{"type":"number","default":0.71,"minimum":0,"maximum":5,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1}},"rain":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.5],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"],"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"opacity":{"type":"number","default":["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,1],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vignette-color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"],"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"center-thinning":{"type":"number","default":0.57,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"direction":{"type":"array","default":[0,80],"minimum":0,"maximum":360,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"droplet-size":{"type":"array","default":[2.6,18.2],"minimum":0,"maximum":50,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"distortion-strength":{"type":"number","default":0.7,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1}},"camera":{"camera-projection":{"type":"enum","default":"perspective","values":{"perspective":1,"orthographic":1},"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"colorTheme":{"data":{"type":"string","expression":1}},"indoor_source":{"sourceId":{"type":"string"},"sourceLayers":{"type":"array","value":"string"}},"indoor":{"*":{"type":"indoor_source"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"use-theme":1},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"projection":{"name":{"type":"enum","default":"mercator","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1}},"center":{"type":"array","minimum":[-180,-90],"maximum":[180,90],"length":2,"value":"number"},"parallels":{"type":"array","minimum":[-90,-90],"maximum":[90,90],"length":2,"value":"number"}},"terrain":{"source":{"type":"string"},"exaggeration":{"type":"number","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_building","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"fill-outline-color":{"type":"color","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"fill-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"fill-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1},"fill-z-offset":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"transition":1,"property-type":"data-driven"},"fill-bridge-guard-rail-color":{"type":"color","default":"rgba(241, 236, 225, 255)","expression":{"interpolated":1,"parameters":["feature","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"fill-tunnel-structure-color":{"type":"color","default":"rgba(241, 236, 225, 255)","expression":{"interpolated":1,"parameters":["feature","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"fill-extrusion-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transiti
2on":1,"property-type":"data-driven"},"fill-extrusion-height-alignment":{"type":"enum","default":"flat","values":{"terrain":1,"flat":1}},"fill-extrusion-base-alignment":{"type":"enum","default":"terrain","values":{"terrain":1,"flat":1}},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-ambient-occlusion-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-ambient-occlusion-wall-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-flood-light-color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"fill-extrusion-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1},"fill-extrusion-flood-light-wall-radius":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-flood-light-ground-radius":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-vertical-scale":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"fill-extrusion-front-cutoff":{"type":"array","default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]}},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-cast-shadows":{"type":"boolean","default":true}},"paint_building":{"building-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"parameters":[]},"transition":1},"building-ambient-occlusion-ground-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-vertical-scale":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-cast-shadows":{"type":"boolean","default":true},"building-color":{"type":"color","default":"rgba(193, 154, 127, 1)","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"use-theme":1,"property-type":"data-driven"},"building-emissive-strength":{"type":"number","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"property-type":"data-driven"},"building-facade-emissive-chance":{"type":"number","default":0.35,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"building-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"building-front-cutoff":{"type":"array","default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]}},"building-flood-light-color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"building-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1},"building-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"line-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"line-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"line-width":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","line-progress","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"}
2,"line-blur":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-dasharray":{"type":"array","minimum":0,"value":"number","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"line-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"line-gradient":{"type":"color","expression":{"interpolated":1,"parameters":["line-progress"]},"use-theme":1},"line-trim-offset":{"type":"array","default":[0,0],"minimum":[0,0],"maximum":[1,1],"length":2,"value":"number"},"line-trim-fade-range":{"type":"array","default":[0,0],"minimum":[0,0],"maximum":[1,1],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"line-trim-color":{"type":"color","default":"transparent","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["line-progress","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-border-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"line-border-color":{"type":"color","default":"rgba(0, 0, 0, 0)","expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"line-blend-mode":{"type":"enum","default":"default","values":{"default":1,"multiply":1,"additive":1},"expression":{"parameters":["zoom"]}},"line-blend-additive-clamp":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]}}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"circle-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"circle-pitch-scale":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"circle-pitch-alignment":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"expression":{"interpolated":1,"parameters":["heatmap-density"]},"use-theme":1},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven","appearance":1},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven","appearance":1},"icon-halo-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"appearance":1},"icon-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"icon-image-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven","appearance":1,"overridable":1},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven","appearance":1},"text-halo-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-halo-blur":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"appearance":1},"text-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":1},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":1},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":1},"symbol-z-offset":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"transition":1,"property-type":"data-driven","appearance":1}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-color":{"type":"color","expression":{"interpolated":1,"parameters":["raster-value"]},"use-theme":1},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-color-range":{"type":"array","length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-hue-rotate":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-resampling":{"type":"enum","default":"linear","values":{"linear":1,"nearest":1},"expression":{"parameters":["zoom"]}},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]}},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1},"raster-array-band":{"type":"string"},"raster-elevation":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-elevation-reference":{"type":"enum","default":"sea","values":{"sea":1,"ground":1},"expression":1}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string"},"raster-particle-count":{"type":"number","default":512,"minimum":1},"raster-particle-color":{"type":"color","expression":{"interpolated":1,"parameters":["raster-particle-speed"]},"use-theme":1},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":1,"parameters":["zoom"]}},"hillshade-illumination-anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"hillshade-shadow-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"hillshade-accent-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1}},"paint_background":{"background-pitch-alignment":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":[]}},"background-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]}},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1}},"paint_sky":{"sky-type":{"type":"enum","default":"atmosphere","values":{"gradient":1,"atmosphere":1},"expression":{"parameters":["zoom"]}},"sky-atmosphere-sun":{"type":"array","minimum":[0,0],"maximum":[360,180],"length":2,"value":"number","expression":{"parameters":["zoom"]}},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100},"sky-gradient-center":{"type":"array","default":[0,0],"minimum":[0,0],"maximum":[360,180],"length":2,"value":"number","expression":{"parameters":["zoom"]}},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]}},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":1,"parameters":["sky-radial-progress"]},"use-theme":1},"sky-atmosphere-halo-color":{"type":"color","default":"white","use-theme":1},"sky-atmosphere-color":{"type":"color","default":"white","use-theme":1},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"model-rotation":{"type":"array","default":[0,0,0],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"model-scale":{"type":"array","default":[1,1,1],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"model-translation":{"type":"array","default":[0,0,0],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"model-color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},
2"transition":1,"use-theme":1,"property-type":"data-driven"},"model-color-mix-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"transition":1,"property-type":"data-driven"},"model-type":{"type":"enum","default":"common-3d","values":{"common-3d":1,"location-indicator":1}},"model-cast-shadows":{"type":"boolean","default":true},"model-receive-shadows":{"type":"boolean","default":true},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"model-emissive-strength":{"type":"number","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"transition":1,"property-type":"data-driven"},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"transition":1,"property-type":"data-driven"},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"model-front-cutoff":{"type":"array","default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]}},"model-elevation-reference":{"type":"enum","default":"ground","values":{"sea":1,"ground":1,"hd-road-markup":1},"expression":1},"model-line-cutout-mode":{"type":"enum","default":"enabled","values":{"enabled":1,"disabled":1,"enabled-above-cutout":1},"expression":1}},"promoteId":{"*":{"type":"*"}}}');function a7(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function oe(i){if(Array.isArray(i))return i.map(oe);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){let r={};for(let n in i)r[n]=oe(i[n]);return r}return a7(i)}function ot(i){if(!0===i||!1===i)return!0;if(!Array.isArray(i)||0===i.length)return!1;switch(i[0]){case"has":return i.length>=2&&"$id"!==i[1]&&"$type"!==i[1];case"in":return i.length>=3&&("string"!=typeof i[1]||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==i.length||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(let r of i.slice(1))if(!ot(r)&&"boolean"!=typeof r)return!1;return!0;default:return!0}}function oi(i,r="",n=null,a="fill"){if(null==i)return{filter:()=>!0,needGeometry:!1,needFeature:!1};ot(i)||(i=function i(r){if(!r)return!0;let n=r[0];return r.length<=1?"any"!==n:"=="===n?oo(r[1],r[2],"=="):"!="===n?ou(oo(r[1],r[2],"==")):"<"===n||">"===n||"<="===n||">="===n?oo(r[1],r[2],n):"any"===n?["any"].concat(r.slice(1).map(i)):"all"===n?["all"].concat(r.slice(1).map(i)):"none"===n?["all"].concat(r.slice(1).map(i).map(ou)):"in"===n?os(r[1],r.slice(2)):"!in"===n?ou(os(r[1],r.slice(2))):"has"===n?ol(r[1]):"!has"!==n||ou(ol(r[1]))}(i));let o=i,s=!0;try{s=function(i){if(!or(i))return i;let r=oe(i);return function i(r){let n=!1,a=[];if("case"===r[0]){for(let i=1;i<r.length-1;i+=2)n=n||or(r[i]),a.push(r[i+1]);a.push(r.at(-1))}else if("match"===r[0]){n=n||or(r[1]);for(let i=2;i<r.length-1;i+=2)a.push(r[i+1]);a.push(r.at(-1))}else if("step"===r[0]){n=n||or(r[1]);for(let i=1;i<r.length-1;i+=2)a.push(r[i+1])}n&&(r.length=0,r.push("any",...a));for(let n=1;n<r.length;n++)i(r[n])}(r),r=function i(r){if(!Array.isArray(r))return r;let n=function(i){if(on.has(i[0])){for(let r=1;r<i.length;r++)if(or(i[r]))return!0}return i}(r);return!0===n?n:n.map(r=>i(r))}(r)}(o)}catch(i){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.
3This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md
4and paste the contents of this message in the report.
5Thank you!
6Filter Expression:
7${JSON.stringify(o,null,2)}
8        `)}let l=null,u=null;if("background"!==a&&"sky"!==a&&"slot"!==a){let i=n3(s,u=a6[`filter_${a}`],r,n);if("error"===i.result)throw Error(i.value.map(i=>`${i.key}: ${i.message}`).join(", "));l=(r,n,a)=>i.value.evaluate(r,n,{},a)}let c=null,d=null;if(s!==o){let i=n3(o,u,r,n);if("error"===i.result)throw Error(i.value.map(i=>`${i.key}: ${i.message}`).join(", "));c=(r,n,a,o,s)=>i.value.evaluate(r,n,{},a,void 0,void 0,o,s),d=!rK(i.value.expression)}return{filter:l,dynamicFilter:c||void 0,needGeometry:function i(r){if(!Array.isArray(r))return!1;if("within"===r[0]||"distance"===r[0])return!0;for(let n=1;n<r.length;n++)if(i(r[n]))return!0;return!1}(s),needFeature:!!d}}function or(i){var r;if(!Array.isArray(i))return!1;if("pitch"===(r=i[0])||"distance-from-center"===r)return!0;for(let r=1;r<i.length;r++)if(or(i[r]))return!0;return!1}let on=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function oa(i,r){return i<r?-1:+(i>r)}function oo(i,r,n){switch(i){case"$type":return[`filter-type-${n}`,r];case"$id":return[`filter-id-${n}`,r];default:return[`filter-${n}`,i,r]}}function os(i,r){if(0===r.length)return!1;switch(i){case"$type":return["filter-type-in",["literal",r]];case"$id":return["filter-id-in",["literal",r]];default:return r.length>200&&!r.some(i=>typeof i!=typeof r[0])?["filter-in-large",i,["literal",r.sort(oa)]]:["filter-in-small",i,["literal",r]]}}function ol(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function ou(i){return["!",i]}function oc(i,r){return r?`${i}�${r}`:i}function od(i){let r=i.indexOf("\x1f");return r>=0?i.slice(r+1):""}let oh=()=>s||(s=new a8({"icon-size":new a9(a6.layout_symbol["icon-size"]),"icon-image":new a9(a6.layout_symbol["icon-image"]),"icon-rotate":new a9(a6.layout_symbol["icon-rotate"]),"icon-offset":new a9(a6.layout_symbol["icon-offset"]),"text-size":new a9(a6.layout_symbol["text-size"]),"text-rotate":new a9(a6.layout_symbol["text-rotate"]),"text-offset":new a9(a6.layout_symbol["text-offset"])})),of=()=>l||(l=new a8({"icon-opacity":new a9(a6.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new a9(a6.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new a9(a6.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new a9(a6.paint_symbol["text-emissive-strength"]),"icon-color":new a9(a6.paint_symbol["icon-color"]),"icon-halo-color":new a9(a6.paint_symbol["icon-halo-color"]),"icon-halo-width":new a9(a6.paint_symbol["icon-halo-width"]),"icon-halo-blur":new a9(a6.paint_symbol["icon-halo-blur"]),"icon-translate":new a9(a6.paint_symbol["icon-translate"]),"text-opacity":new a9(a6.paint_symbol["text-opacity"]),"text-occlusion-opacity":new a9(a6.paint_symbol["text-occlusion-opacity"]),"text-color":new a9(a6.paint_symbol["text-color"],{runtimeType:iF,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new a9(a6.paint_symbol["text-halo-color"]),"text-halo-width":new a9(a6.paint_symbol["text-halo-width"]),"text-halo-blur":new a9(a6.paint_symbol["text-halo-blur"]),"text-translate":new a9(a6.paint_symbol["text-translate"]),"symbol-z-offset":new a9(a6.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}));class op{constructor(i,r,n,a,o,s){this._conditionSpec=i,this._propertiesSpec=n;const l=n3(i,a6.appearance.condition);if("success"===l.result&&(this.condition=l.value),this.name=r,n)for(const i in this.layoutProperties=new a5(oh()),this.unevaluatedLayout=new a0(oh(),a,o,s),this.paintProperties=new a5(of()),this.unevaluatedPaint=new a0(of(),a,o,""),n)i in this.unevaluatedLayout._values?this.unevaluatedLayout.setValue(i,n[i]):i in this.unevaluatedPaint._values&&this.unevaluatedPaint.setValue(i,n[i])}
8isActive(i){return!(this.condition||!i.isHidden||"hidden"!==this.name)||this.condition.evaluate(i.globals,i.feature,i.featureState,i.canonical)}getCondition(){return this.condition}getName(){return this.name}getLayoutProperty(i){return this.layoutProperties.get(i)}getPaintProperty(i){return this.paintProperties.get(i)}getUnevaluatedLayoutProperties(){return this.unevaluatedLayout}getUnevaluatedLayoutProperty(i){return this.unevaluatedLayout._values[i]}getUnevaluatedPaintProperty(i){return this.unevaluatedPaint._values[i]}recalculate(i,r,n){this.unevaluatedLayout&&(this.layoutProperties=this.unevaluatedLayout.possiblyEvaluate(i,void 0,r,n)),this.unevaluatedPaint&&(this.paintProperties=this.unevaluatedPaint.possiblyEvaluate(i,void 0,r,""))}serialize(){let i={};i.condition=this.condition.expression.serialize(),this.name&&(i.name=this.name);let r=Object.assign({},this.unevaluatedLayout?this.unevaluatedLayout.serialize():{},this.unevaluatedPaint?this.unevaluatedPaint.serialize():{});return Object.keys(r).length>0&&(i.properties=r),i}hasIconLayoutProperties(){let i=this.hasLayoutProperty("icon-image"),r=this.hasLayoutProperty("icon-size"),n=this.hasLayoutProperty("icon-offset"),a=this.hasLayoutProperty("icon-rotate");return i||r||n||a}hasTextLayoutProperties(){let i=this.hasLayoutProperty("text-size"),r=this.hasLayoutProperty("text-offset"),n=this.hasLayoutProperty("text-rotate");return i||r||n}hasIconPaintProperties(){return!!this.unevaluatedPaint&&Object.keys(this.unevaluatedPaint._values).filter(i=>!i.endsWith("-use-theme")).some(i=>(i.startsWith("icon-")||"symbol-z-offset"===i)&&this.hasPaintProperty(i))}hasTextPaintProperties(){return!!this.unevaluatedPaint&&Object.keys(this.unevaluatedPaint._values).filter(i=>!i.endsWith("-use-theme")).some(i=>(i.startsWith("text-")||"symbol-z-offset"===i)&&this.hasPaintProperty(i))}hasLayoutProperty(i){return this.unevaluatedLayout&&void 0!==this.unevaluatedLayout._values[i].value}hasPaintProperty(i){return this.unevaluatedPaint&&void 0!==this.unevaluatedPaint._values[i].value}}let om="-transition",og=new Set(["fill","line","background","hillshade","raster"]);class o_ extends i_{constructor(i,r,n,a,o,s){if(super(),this.id=i.id,this.fqid=oc(this.id,n),this.type=i.type,this.scope=n,this.lut=a,this.options=o,this.iconImageUseTheme=s,this.appearances=[],this.appearancesVersion=0,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.expressionDependencies={isIndoorDependent:!1,configDependencies:new Set},"custom"!==i.type){if(this.metadata=i.metadata,this.minzoom=i.minzoom,this.maxzoom=i.maxzoom,i.type&&"background"!==i.type&&"sky"!==i.type&&"slot"!==i.type){this.source=i.source,this.sourceLayer=i["source-layer"],this.filter=i.filter;const r=n3(this.filter,a6[`filter_${i.type}`]);"error"!==r.result&&(this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...r.value.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||r.value.isIndoorDependent)}if(i.slot&&(this.slot=i.slot),i.appearances&&this.setAppearances(i.appearances),r.layout&&(this._unevaluatedLayout=new a0(r.layout,this.scope,o,this.iconImageUseTheme),this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...this._unevaluatedLayout.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||this._unevaluatedLayout.isIndoorDependent()),r.paint){for(const n in this._transitionablePaint=new aQ(r.paint,this.scope,o),i.paint)this.setPaintProperty(n,i.paint[n]);for(const r in i.layout)this.setLayoutProperty(r,i.layout[r]);this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...this._transitionablePaint.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||this._transitionablePaint.isIndoorDependent(),this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new a5(r.paint)}}}onAdd(i){}onRemove(i){}isDraped(i){return!this.is3D(!0)&&og.has(this.type)}getLayoutProperty(i){return"visibility"===i?this.visibility:this._unevaluatedLayout.getValue(i)}setLayoutProperty(i,r){if("custom"===this.type&&"visibility"===i)return void(this.visibility=r);let n=this._unevaluatedLayout;n._properties.properties[i]&&(n.setValue(i,r),this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...n.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||n.isIndoorDependent(),"visibility"===i&&this.possiblyEvaluateVisibility())}
8setAppearances(i){this.appearances=[],i.forEach(i=>{this.appearances.push(new op(i.condition,i.name,i.properties,this.scope,this.options,this.iconImageUseTheme))}),this.appearancesVersion++}possiblyEvaluateVisibility(){this._unevaluatedLayout._values.visibility&&(this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0}))}getPaintProperty(i){return i.endsWith(om)?this._transitionablePaint.getTransition(i.slice(0,-11)):this._transitionablePaint.getValue(i)}isPaintProperty(i){return!!this._transitionablePaint._properties.properties[i]}setPaintProperty(i,r){let n=this._transitionablePaint,a=n._properties.properties;if(i.endsWith(om)){let o=i.slice(0,-11);return a[o]&&n.setTransition(o,r||void 0),!1}if(!a[i])return!1;let o=n._values[i],s=o.value.isDataDriven(),l=o.value;n.setValue(i,r),this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...n.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||n.isIndoorDependent(),this._handleSpecialPaintPropertyUpdate(i);let u=n._values[i].value,c=u.isDataDriven(),d=i.endsWith("pattern")||"line-dasharray"===i;return c||s||d||this._handleOverridablePaintPropertyUpdate(i,l,u)}_handleSpecialPaintPropertyUpdate(i){}getProgramIds(){return null}getDefaultProgramParams(i,r,n){return null}_handleOverridablePaintPropertyUpdate(i,r,n){return!1}isHidden(i){return!!(this.minzoom&&i<this.minzoom)||!!(this.maxzoom&&i>=this.maxzoom)||"none"===this.visibility}updateTransitions(i){this._transitioningPaint=this._transitionablePaint.transitioned(i,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(i,r){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(i,void 0,r,this.iconImageUseTheme)),this.paint=this._transitioningPaint.possiblyEvaluate(i,void 0,r)}
8serialize(){let i={id:this.id,type:this.type,slot:this.slot,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return 0!==this.appearances.length&&(i.appearances=this.appearances.map(i=>i.serialize())),t_(i,(i,r)=>!(void 0===i||"layout"===r&&!Object.keys(i).length||"paint"===r&&!Object.keys(i).length))}is3D(i){return!1}hasElevation(){return!1}mayUse(i){return!1}prepare(){return Promise.resolve()}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}_clear(){}isStateDependent(){for(let i in this.paint._values){let r=this.paint.get(i);if(r instanceof a2&&nW(r.property.specification)&&("source"===r.value.kind||"composite"===r.value.kind)&&r.value.isStateDependent)return!0}for(let i of this.appearances)if(!rX(i.condition.expression))return!0;return!1}compileFilter(i){this._filterCompiled||(this._featureFilter=oi(this.filter,this.scope,i),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}dynamicFilterNeedsGeometry(){return this._featureFilter.needGeometry}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(i){this._stats&&("shadow"===i.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}getAppearances(){return this.appearances}queryRenderedFeatures(i,r,n){return{}}queryRadius(i){}queryIntersectsFeature(i,r,n,a,o,s,l,u,c,d){}}function oy(i,r,n){if(!i._unevaluatedLayout)return!1;let a=i._unevaluatedLayout.getValue(r);return void 0!==a&&("string"!=typeof a||n(a))}function ov(i,r,n=2){let a,o,s,l=r&&r.length,u=l?r[0]*n:i.length,c=ox(i,0,u,n,!0),d=[];if(!c||c.next===c.prev)return d;if(l&&(c=function(i,r,n,a){let o=[];for(let n=0,s=r.length;n<s;n++){let l=ox(i,r[n]*a,n<s-1?r[n+1]*a:i.length,a,!1);l===l.next&&(l.steiner=!0),o.push(function(i){let r=i,n=i;do(r.x<n.x||r.x===n.x&&r.y<n.y)&&(n=r),r=r.next;while(r!==i)return n}(l))}o.sort(ow);for(let i=0;i<o.length;i++)n=function(i,r){let n=function(i,r){let n=r,a=i.x,o=i.y,s,l=-1/0;if(oC(i,n))return n;do{if(oC(i,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let i=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(i<=a&&i>l&&(l=i,s=n.x<n.next.x?n:n.next,i===a))return s}n=n.next}while(n!==r)if(!s)return null;let u=s,c=s.x,d=s.y,h=1/0;n=s;do{if(a>=n.x&&n.x>=c&&a!==n.x&&oE(o<d?a:l,o,c,d,o<d?l:a,o,n.x,n.y)){var f,p;let r=Math.abs(o-n.y)/(a-n.x);oM(n,i)&&(r<h||r===h&&(n.x>s.x||n.x===s.x&&(f=s,p=n,0>oA(f.prev,f,p.prev)&&0>oA(p.next,f,f.next))))&&(s=n,h=r)}n=n.next}while(n!==u)return s}(i,r);if(!n)return r;let a=oL(n,i);return ob(a,a.next),ob(n,n.next)}(o[i],n);return n}(i,r,c,n)),i.length>80*n){a=i[0],o=i[1];let r=a,l=o;for(let s=n;s<u;s+=n){let n=i[s],u=i[s+1];n<a&&(a=n),u<o&&(o=u),n>r&&(r=n),u>l&&(l=u)}s=0!==(s=Math.max(r-a,l-o))?32767/s:0}return function i(r,n,a,o,s,l,u){if(!r)return;!u&&l&&function(i,r,n,a){let o=i;do 0===o.z&&(o.z=oT(o.x,o.y,r,n,a)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==i)o.prevZ.nextZ=null,o.prevZ=null,function(i){let r,n=1;do{let a,o=i;i=null;let s=null;for(r=0;o;){r++;let l=o,u=0;for(let i=0;i<n&&(u++,l=l.nextZ);i++);let c=n;for(;u>0||c>0&&l;)0!==u&&(0===c||!l||o.z<=l.z)?(a=o,o=o.nextZ,u--):(a=l,l=l.nextZ,c--),s?s.nextZ=a:i=a,a.prevZ=s,s=a;o=l}s.nextZ=null,n*=2}while(r>1)}(o)}(r,o,s,l);let c=r;for(;r.prev!==r.next;){let d=r.prev,h=r.next;if(l?function(i,r,n,a){let o=i.prev,s=i.next;if(oA(o,i,s)>=0)return!1;let l=o.x,u=i.x,c=s.x,d=o.y,h=i.y,f=s.y,p=Math.min(l,u,c),m=Math.min(d,h,f),g=Math.max(l,u,c),_=Math.max(d,h,f),y=oT(p,m,r,n,a),v=oT(g,_,r,n,a),x=i.prevZ,b=i.nextZ;for(;x&&x.z>=y&&b&&b.z<=v;){if(x.x>=p&&x.x<=g&&x.y>=m&&x.y<=_&&x!==o&&x!==s&&oS(l,d,u,h,c,f,x.x,x.y)&&oA(x.prev,x,x.next)>=0||(x=x.prevZ,b.x>=p&&b.x<=g&&b.y>=m&&b.y<=_&&b!==o&&b!==s&&oS(l,d,u,h,c,f,b.x,b.y)&&oA(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;x&&x.z>=y;){if(x.x>=p&&x.x<=g&&x.y>=m&&x.y<=_&&x!==o&&x!==s&&oS(l,d,u,h,c,f,x.x,x.y)&&oA(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=g&&b.y>=m&&b.y<=_&&b!==o&&b!==s&&oS(l,d,u,h,c,f,b.x,b.y)&&oA(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}(r,o,s,l):function(i){let r=i.prev,n=i.next;if(oA(r,i,n)>=0)return!1;let a=r.x,o=i.x,s=n.x,l=r.y,u=i.y,c=n.y,d=Math.min(a,o,s),h=Math.min(l,u,c),f=Math.max(a,o,s),p=Math.max(l,u,c),m=n.next;for(;m!==r;){if(m.x>=d&&m.x<=f&&m.y>=h&&m.y<=p&&oS(a,l,o,u,s,c,m.x,m.y)&&oA(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}(r))n.push(d.i,r.i,h.i),oO(r),r=h.next,c=h.next;else if((r=h)===c){u?1===u?i(r=function(i,r){let n=i;do{let a=n.prev,o=n.next.next;!oC(a,o)&&oI(a,n,n.next,o)&&oM(a,o)&&oM(o,a)&&(r.push(a.i,n.i,o.i),oO(n),oO(n.next),n=i=o),n=n.next}while(n!==i)return ob(n)}(ob(r),n),n,a,o,s,l,2):2===u&&function(r,n,a,o,s,l){let u=r;do{let r=u.next.next;for(;r!==u.prev;){var c,d;if(u.i!==r.i&&(c=u,d=r,c.next.i!==d.i&&c.prev.i!==d.i&&!function(i,r){let n=i;do{if(n.i!==i.i&&n.next.i!==i.i&&n.i!==r.i&&n.next.i!==r.i&&oI(n,n.next,i,r))return!0;n=n.next}while(n!==i)return!1}(c,d)&&(oM(c,d)&&oM(d,c)&&function(i,r){let n=i,a=!1,o=(i.x+r.x)/2,s=(i.y+r.y)/2;do n.y>s!=n.next.y>s&&n.next.y!==n.y&&o<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(a=!a),n=n.next;while(n!==i)return a}(c,d)&&(oA(c.prev,c,d.prev)||oA(c,d.prev,d))||oC(c,d)&&oA(c.prev,c,c.next)>0&&oA(d.prev,d,d.next)>0))){let c=oL(u,r);return u=ob(u,u.next),c=ob(c,c.next),i(u,n,a,o,s,l,0),void i(c,n,a,o,s,l,0)}r=r.next}u=u.next}while(u!==r)}(r,n,a,o,s,l):i(ob(r),n,a,o,s,l,1);break}}}(c,d,n,a,o,s,0),d}function ox(i,r,n,a,o){let s;if(o===function(i,r,n,a){let o=0;for(let s=r,l=n-a;s<n;s+=a)o+=(i[l]-i[s])*(i[s+1]+i[l+1]),l=s;return o}(i,r,n,a)>0)for(let o=r;o<n;o+=a)s=oP(o/a|0,i[o],i[o+1],s);else for(let o=n-a;o>=r;o-=a)s=oP(o/a|0,i[o],i[o+1],s);return s&&oC(s,s.next)&&(oO(s),s=s.next),s}function ob(i,r){if(!i)return i;r||(r=i);let n,a=i;do if(n=!1,a.steiner||!oC(a,a.next)&&0!==oA(a.prev,a,a.next))a=a.next;else{if(oO(a),(a=r=a.prev)===a.next)break;n=!0}while(n||a!==r)return r}function ow(i,r){let n=i.x-r.x;return 0===n&&0==(n=i.y-r.y)&&(n=(i.next.y-i.y)/(i.next.x-i.x)-(r.next.y-r.y
8)/(r.next.x-r.x)),n}function oT(i,r,n,a,o){return(i=0x55555555&((i=0x33333333&((i=0xf0f0f0f&((i=0xff00ff&((i=(i-n)*o|0)|i<<8))|i<<4))|i<<2))|i<<1))|(r=0x55555555&((r=0x33333333&((r=0xf0f0f0f&((r=0xff00ff&((r=(r-a)*o|0)|r<<8))|r<<4))|r<<2))|r<<1))<<1}function oE(i,r,n,a,o,s,l,u){return(o-l)*(r-u)>=(i-l)*(s-u)&&(i-l)*(a-u)>=(n-l)*(r-u)&&(n-l)*(s-u)>=(o-l)*(a-u)}function oS(i,r,n,a,o,s,l,u){return(i!==l||r!==u)&&oE(i,r,n,a,o,s,l,u)}function oA(i,r,n){return(r.y-i.y)*(n.x-r.x)-(r.x-i.x)*(n.y-r.y)}function oC(i,r){return i.x===r.x&&i.y===r.y}function oI(i,r,n,a){let o=oR(oA(i,r,n)),s=oR(oA(i,r,a)),l=oR(oA(n,a,i)),u=oR(oA(n,a,r));return o!==s&&l!==u||!(0!==o||!ok(i,n,r))||!(0!==s||!ok(i,a,r))||!(0!==l||!ok(n,i,a))||!(0!==u||!ok(n,r,a))}function ok(i,r,n){return r.x<=Math.max(i.x,n.x)&&r.x>=Math.min(i.x,n.x)&&r.y<=Math.max(i.y,n.y)&&r.y>=Math.min(i.y,n.y)}function oR(i){return i>0?1:i<0?-1:0}function oM(i,r){return 0>oA(i.prev,i,i.next)?oA(i,r,i.next)>=0&&oA(i,i.prev,r)>=0:0>oA(i,r,i.prev)||0>oA(i,i.next,r)}function oL(i,r){let n=oD(i.i,i.x,i.y),a=oD(r.i,r.x,r.y),o=i.next,s=r.prev;return i.next=r,r.prev=i,n.next=o,o.prev=n,a.next=n,n.prev=a,s.next=a,a.prev=s,a}function oP(i,r,n,a){let o=oD(i,r,n);return a?(o.next=a.next,o.prev=a,a.next.prev=o,a.next=o):(o.prev=o,o.next=o),o}function oO(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function oD(i,r,n){return{i:i,x:r,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function oF(i,r,n=1){if(!i)return null;let a="string"==typeof i?iJ.from(i).getPrimary():i.getPrimary(),o="string"==typeof i?null:i.getSecondary();for(let i of[a,o]){if(!i)continue;let a=i.id.toString();r.has(a)||r.set(a,[]),i.scaleSelf(n),r.get(a).push(i)}return{primary:a.toString(),secondary:o?o.toString():null}}function oN(i,r,n,a){let o=a.patternDependencies,s=!1;for(let a of r){let r=a.paint.get(`${i}-pattern`);r.isConstant()||(s=!0),oF(r.constantOr(null),o,n)&&(s=!0)}return s}function oj(i,r,n,a,o,s){let l=s.patternDependencies;for(let u of r){let r=u.paint.get(`${i}-pattern`).value;if("constant"!==r.kind){let i=oF(r.evaluate({zoom:a},n,{},void 0,s.availableImages),l,o);if(!i)continue;let{primary:c,secondary:d}=i;c&&(n.patterns[u.id]=[c,d].filter(Boolean))}}return n}let oz=8192/Math.PI/2,oB=[64,32,16],oU=-oz;function oV(i,r,n,a=oz){return[i*Math.sin(n*=e7)*a,-r*a,i*Math.cos(n)*a]}function oH(i,r,n){return oV(Math.cos(i*e7),Math.sin(i*e7),r,n)}let oG=2*Math.PI*6371008.8;class oq{constructor(i,r){if(isNaN(i)||isNaN(r))throw Error(`Invalid LngLat object: (${i}, ${r})`);if(this.lng=+i,this.lat=+r,this.lat>90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new oq(tu(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(i){let r=Math.PI/180,n=this.lat*r,a=i.lat*r;return 6371008.8*Math.acos(Math.min(Math.sin(n)*Math.sin(a)+Math.cos(n)*Math.cos(a)*Math.cos((i.lng-this.lng)*r),1))}toBounds(i=0){let r=360*i/0x2637f09,n=r/Math.cos(Math.PI/180*this.lat);return new o$({lng:this.lng-n,lat:this.lat-r},{lng:this.lng+n,lat:this.lat+r})}toEcef(i){return oH(this.lat,this.lng,oz+i*oz/6371008.8)}static convert(i){if(i instanceof oq)return i;if(Array.isArray(i)&&(2===i.length||3===i.length))return new oq(Number(i[0]),Number(i[1]));if(!Array.isArray(i)&&"object"==typeof i&&null!==i)return new oq(Number("lng"in i?i.lng:i.lon),Number(i.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}class o${constructor(i,r){i&&(r?this.setSouthWest(i).setNorthEast(r):Array.isArray(i)&&4===i.length?this.setSouthWest([i[0],i[1]]).setNorthEast([i[2],i[3]]):this.setSouthWest(i[0]).setNorthEast(i[1]))}setNorthEast(i){return this._ne=i instanceof oq?new oq(i.lng,i.lat):oq.convert(i),this}setSouthWest(i){return this._sw=i instanceof oq?new oq(i.lng,i.lat):oq.convert(i),this}extend(i){let r,n,a=this._sw,o=this._ne;if(i instanceof oq)r=i,n=i;else{if(!(i instanceof o$))return Array.isArray(i)?4===i.length||i.every(Array.isArray)?this.extend(o$.convert(i)):this.extend(oq.convert(i)):"object"==typeof i&&null!==i&&Object.hasOwn(i,"lat")&&(Object.hasOwn(i,"lon")||Object.hasOwn(i,"lng"))?this.extend(oq.convert(i)):this;if(r=i._sw,n=i._ne,!r||!n)return this}return a||o?(a.lng=Math.min(r.lng,a.lng),a.lat=Math.min(r.lat,a.lat),o.lng=Math.max(n.lng,o.lng),o.lat=Math.max(n.lat,o.lat)):(this._sw=new oq(r.lng,r.lat),this._ne=new oq(n.lng,n.lat)),this}getCenter(){return new oq((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}
8getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new oq(this.getWest(),this.getNorth())}getSouthEast(){return new oq(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(i){let{lng:r,lat:n}=oq.convert(i),a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&a}static convert(i){if(i)return i instanceof o$?i:new o$(i)}}function oW(i){return oG*Math.cos(i*Math.PI/180)}function oY(i,r){return i*oW(rm(r))}function oZ(i){return Math.cos(ts(i,-85.051129,85.051129)*e7)}function oK(i,r){let n=Math.pow(2,ts(r,0,25.5));return oZ(i)*oG/(512*n)}function oX(i){return 1/Math.cos(i*Math.PI/180)}function oQ(i,r=0){let n=Math.exp(Math.PI*(1-(i.y+r/8192)/(1<<i.z)*2));return 0x4c6fe12*n/(n*n+1)/8192/(1<<i.z)}class oJ{constructor(i,r,n=0){this.x=+i,this.y=+r,this.z=+n}static fromLngLat(i,r=0){let n=oq.convert(i);return new oJ(rh(n.lng),rf(n.lat),r/oW(n.lat))}toLngLat(){return new oq(rp(this.x),rm(this.y))}toAltitude(){return oY(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/oG*oX(rm(this.y))}}function o1(i,r,n){let a=i[0],o=a.x,s=a.y;r(a);let l=[a];for(let u=1;u<i.length;u++){let c=i[u],{x:d,y:h}=c;r(c),function i(r,n,a,o,s,l,u,c,d){var h,f,p,m,g,_;let y,v,x=(n+o)/2,b=(a+s)/2,w=new eQ(x,b);c(w),(h=w.x,f=w.y,p=l.x,m=l.y,g=u.x,_=u.y,y=p-g,v=m-_,Math.abs((m-f)*y-(p-h)*v)/Math.hypot(y,v)>=d)?(i(r,n,a,x,b,l,w,c,d),i(r,x,b,o,s,w,u,c,d)):r.push(u)}(l,o,s,d,h,a,c,r,n),o=d,s=h,a=c}return l}let o0=-16383-1;function o2(i,r,n){let a=i.loadGeometry(),o=i.extent,s=8192/o;if(r&&n&&n.projection.isReprojectedInTileSpace){let s=1<<r.z,{scale:l,x:u,y:c,projection:d}=n,h=i=>{let n=rp((r.x+i.x/o)/s),a=rm((r.y+i.y/o)/s),h=d.project(n,a);i.x=(h.x*l-u)*o,i.y=(h.y*l-c)*o};for(let r=0;r<a.length;r++)if(1!==i.type)a[r]=o1(a[r],h,1);else{let i=[];for(let n of a[r])n.x<0||n.x>=o||n.y<0||n.y>=o||(h(n),i.push(n));a[r]=i}}for(let i of a)for(let r of i)!function(i,r){let n=Math.round(i.x*r),a=Math.round(i.y*r);i.x=ts(n,o0,16383),i.y=ts(a,o0,16383),(n<i.x||n>i.x+1||a<i.y||a>i.y+1)&&tb("Geometry exceeds allowed extent, reduce your vector tile buffer size")}(r,s);return a}function o5(i,r){return{type:i.type,id:i.id,properties:i.properties,geometry:r?o2(i):[]}}let o4={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class o9{constructor(i,r){this._structArray=i,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}let o3=new ArrayBuffer(0);class o8{constructor(){this._reallocCount=0,this.capacity=0,this.length=0}static serialize(i,r){return i._trim(),r&&i.arrayBuffer&&r.add(i.arrayBuffer),{length:i.length,arrayBuffer:i.arrayBuffer}}static deserialize(i){let r=Object.create(this.prototype);return r.arrayBuffer=i.arrayBuffer,r.length=i.length,i.arrayBuffer?r.capacity=i.arrayBuffer.byteLength/r.bytesPerElement:(r.capacity=0,r.arrayBuffer=o3),r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(i){this.reserve(i),this.length=i}resizeExact(i){this.reserveExact(i),this.length=i}reserve(i){i>this.capacity&&this._allocate(Math.max(i,Math.floor(5*this.capacity),128))}reserveExact(i){(i>this.capacity||!this.arrayBuffer)&&this._allocate(i)}_allocate(i){this._reallocCount++,this.capacity=i,this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}reserveForAdditional(i){this.reserve(this.length+i)}_refreshViews(){throw Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(){throw Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(){throw Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function o6(i,r=1){let n=0,a=0;return{members:i.map(i=>{let o=o4[i.type].BYTES_PER_ELEMENT,s=n=o7(n,Math.max(r,o)),l=i.components||1;return a=Math.max(a,o),n+=o*l,{name:i.name,type:i.type,components:l,offset:s}}
8),size:o7(n,Math.max(a,r)),alignment:r}}function o7(i,r){return Math.ceil(i/r)*r}class se extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,r){let n=this.length;return this.resize(n+1),this.emplace(n,i,r)}emplace(i,r,n){let a=2*i;return this.int16[a+0]=r,this.int16[a+1]=n,i}}se.prototype.bytesPerElement=4,ar(se,"StructArrayLayout2i4");class st extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,r,n){let a=this.length;return this.resize(a+1),this.emplace(a,i,r,n)}emplace(i,r,n,a){let o=3*i;return this.int16[o+0]=r,this.int16[o+1]=n,this.int16[o+2]=a,i}}st.prototype.bytesPerElement=6,ar(st,"StructArrayLayout3i6");class si extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,r,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,i,r,n,a)}emplace(i,r,n,a,o){let s=4*i;return this.int16[s+0]=r,this.int16[s+1]=n,this.uint16[s+2]=a,this.uint16[s+3]=o,i}}si.prototype.bytesPerElement=8,ar(si,"StructArrayLayout2i2ui8");class sr extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i){let r=this.length;return this.resize(r+1),this.emplace(r,i)}emplace(i,r){return this.float32[+i+0]=r,i}}sr.prototype.bytesPerElement=4,ar(sr,"StructArrayLayout1f4");class sn extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n){let a=this.length;return this.resize(a+1),this.emplace(a,i,r,n)}emplace(i,r,n,a){let o=4*i;return this.int16[o+0]=r,this.int16[o+1]=n,this.float32[2*i+1]=a,i}}sn.prototype.bytesPerElement=8,ar(sn,"StructArrayLayout2i1f8");class sa extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,r,n){let a=this.length;return this.resize(a+1),this.emplace(a,i,r,n)}emplace(i,r,n,a){let o=4*i;return this.int16[o+0]=r,this.int16[o+1]=n,this.int16[o+2]=a,i}}sa.prototype.bytesPerElement=8,ar(sa,"StructArrayLayout3i8");class so extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,r,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,i,r,n,a)}emplace(i,r,n,a,o){let s=4*i;return this.int16[s+0]=r,this.int16[s+1]=n,this.int16[s+2]=a,this.int16[s+3]=o,i}}so.prototype.bytesPerElement=8,ar(so,"StructArrayLayout4i8");class ss extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,i,r,n,a,o)}emplace(i,r,n,a,o,s){let l=5*i;return this.int16[l+0]=r,this.int16[l+1]=n,this.int16[l+2]=a,this.int16[l+3]=o,this.int16[l+4]=s,i}}ss.prototype.bytesPerElement=10,ar(ss,"StructArrayLayout5i10");class sl extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o,s,l){let u=this.length;return this.resize(u+1),this.emplace(u,i,r,n,a,o,s,l)}emplace(i,r,n,a,o,s,l,u){let c=6*i,d=12*i;return this.int16[c+0]=r,this.int16[c+1]=n,this.uint8[d+4]=a,this.uint8[d+5]=o,this.uint8[d+6]=s,this.uint8[d+7]=l,this.float32[3*i+2]=u,i}}sl.prototype.bytesPerElement=12,ar(sl,"StructArrayLayout2i4ub1f12");class su extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n){let a=this.length;return this.resize(a+1),this.emplace(a,i,r,n)}emplace(i,r,n,a){let o=3*i;return this.float32[o+0]=r,this.float32[o+1]=n,this.float32[o+2]=a,i}}su.prototype.bytesPerElement=12,ar(su,"StructArrayLayout3f12");class sc extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,i,r,n,a,o)}emplace(i,r,n,a,o,s){let l=6*i;return this.uint16[l+0]=r,this.uint16[l+1]=n,this.uint16[l+2]=a,this.uint16[l+3]=o,this.float32[3*i+2]=s,i}}sc.prototype.bytesPerElement=12,ar(sc,"StructArrayLayout4ui1f12");class sd extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,r,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,i,r,n,a)}emplace(i,r,n,a,o){let s=4*i;return this.uint16[s+0]=r,this.uint16[s+1]=n,this.uint16[s+2]=a,this.uint16[s+3]=o,i}}sd.prototype.bytesPerElement=8,ar(sd,"StructArrayLayout4ui8");class sh extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o,s){let l=this.length;return this.resize(l+1),this.emplace(l,i,r,n,a,o,s)}emplace(i,r,n,a,o,s,l){let u=6*i;return this.int16[u+0]=r,this.int16[u+1]=n,this.int16[u+2]=a,this.int16[u+3]=o,this.int16[u+4]=s,this.int16[u+5]=l,i}}sh.prototype.bytesPerElement=12,ar(sh,"StructArrayLayout6i12");class sf extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o,s,l,u,c,d,h,f){let p=this.length;return this.resize(p+1),this.emplace(p,i,r,n,a,o,s,l,u,c,d,h,f)}emplace(i,r,n,a,o,s,l,u,c,d,h,f,p){let m=12*i;return this.int16[m+0]=r,this.int16[m+1]=n,this.int16[m+2]=a,this.int16[m+3]=o,this.uint16[m+4]=s,this.uint16[m+5]=l,this.uint16[m+6]=u,this.uint16[m+7]=c,this.int16[m+8]=d,this.int16[m+9]=h,this.int16[m+10]=f,this.int16[m+11]=p,i}}sf.prototype.bytesPerElement=24,ar(sf,"StructArrayLayout4i4ui4i24");class sp extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o,s){let l=this.length;return this.resize(l+1),this.emplace(l,i,r,n,a,o,s)}emplace(i,r,n,a,o,s,l){let u=10*i,c=5*i;return this.int16[u+0]=r,this.int16[u+1]=n,this.int16[u+2]=a,this.float32[c+2]=o,this.float32[c+3]=s,this.float32[c+4]=l,i}}sp.prototype.bytesPerElement=20,ar(sp,"StructArrayLayout3i3f20");class sm extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,i,r,n,a)}emplace(i,r,n,a,o){let s=4*i;return this.float32[s+0]=r,this.float32[s+1]=n,this.float32[s+2]=a,this.float32[s+3]=o,i}}sm.prototype.bytesPerElement=16,ar(sm,"StructArrayLayout4f16");class sg extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(i){let r=this.length;return this.resize(r+1),this.emplace(r,i)}emplace(i,r){return this.uint32[+i+0]=r,i}}sg.prototype.bytesPerElement=4,ar(sg,"StructArrayLayout1ul4");class s_ extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,r){let n=this.length;return this.resize(n+1),this.emplace(n,i,r)}emplace(i,r,n){let a=2*i;return this.uint16[a+0]=r,this.uint16[a+1]=n,i}}s_.prototype.bytesPerElement=4,ar(s_,"StructArrayLayout2ui4");class sy extends o8{_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(i,r,n,a,o,s,l,u,c,d,h,f,p){let m=this.length;return this.resize(m+1),this.emplace(m,i,r,n,a,o,s,l,u,c,d,h,f,p)}emplace(i,r,n,a,o,s,l,u,c,d,h,f,p,m){let g=20*i,_=10*i;return this.int16[g+0]=r,this.int16[g+1]=n,this.int16[g+2]=a,this.int16[g+3]=o,this.int16[g+4]=s,this.float32[_+3]=l,this.float32[_+4]=u,this.float32[_+5]=c,this.float32[_+6]=d,this.int16[g+14]=h,this.uint32[_+8]=f,this.uint16[g+18]=p,this.uint16[g+19]=m,i}}sy.prototype.bytesPerElement=40,ar(sy,"StructArrayLayout5i4f1i1ul2ui40");class sv extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o,s,l){let u=this.length;return this.resize(u+1),this.emplace(u,i,r,n,a,o,s,l)}emplace(i,r,n,a,o,s,l,u){let c=8*i;return this.int16[c+0]=r,this.int16[c+1]=n,this.int16[c+2]=a,this.int16[c+4]=o,this.int16[c+5]=s,this.int16[c+6]=l,this.int16[c+7]=u,i}}sv.prototype.bytesPerElement=16,ar(sv,"StructArrayLayout3i2i2i16");class sx extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,i,r,n,a,o)}emplace(i,r,n,a,o,s){let l=4*i,u=8*i;return this.float32[l+0]=r,this.float32[l+1]=n,this.float32[l+2]=a,this.int16[u+6]=o,this.int16[u+7]=s,i}}sx.prototype.bytesPerElement=16,ar(sx,"StructArrayLayout2f1f2i16");class sb extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o,s){let l=this.length;return this.resize(l+1),this.emplace(l,i,r,n,a,o,s)}emplace(i,r,n,a,o,s,l){let u=20*i,c=5*i;return this.uint8[u+0]=r,this.uint8[u+1]=n,this.float32[c+1]=a,this.float32[c+2]=o,this.float32[c+3]=s,this.float32[c+4]=l,i}}sb.prototype.bytesPerElement=20,ar(sb,"StructArrayLayout2ub4f20");class sw extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,r,n){let a=this.length;return this.resize(a+1),this.emplace(a,i,r,n)}emplace(i,r,n,a){let o=3*i;return this.uint16[o+0]=r,this.uint16[o+1]=n,this.uint16[o+2]=a,i}}sw.prototype.bytesPerElement=6,ar(sw,"StructArrayLayout3ui6");class sT extends o8{_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(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w){let T=this.length;return this.resize(T+1),this.emplace(T,i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w)}emplace(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w,T){let E=30*i,S=15*i,A=60*i;return this.int16[E+0]=r,this.int16[E+1]=n,this.int16[E+2]=a,this.float32[S+2]=o,this.float32[S+3]=s,this.uint16[E+8]=l,this.uint16[E+9]=u,this.uint32[S+5]=c,this.uint32[S+6]=d,this.uint32[S+7]=h,this.uint16[E+16]=f,this.uint16[E+17]=p,this.uint16[E+18]=m,this.float32[S+10]=g,this.float32[S+11]=_,this.uint8[A+48]=y,this.uint8[A+49]=v,this.uint8[A+50]=x,this.uint32[S+13]=b,this.int16[E+28]=w,this.uint8[A+58]=T,i}}sT.prototype.bytesPerElement=60,ar(sT,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class sE extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w,T,E,S,A,C,I,k,R,M,L,P,O){let D=this.length;return this.resize(D+1),this.emplace(D,i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w,T,E,S,A,C,I,k,R,M,L,P,O)}emplace(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w,T,E,S,A,C,I,k,R,M,L,P,O,D){let F=20*i,N=40*i;return this.float32[F+0]=r,this.float32[F+1]=n,this.int16[N+4]=a,this.int16[N+5]=o,this.int16[N+6]=s,this.int16[N+7]=l,this.int16[N+8]=u,this.int16[N+9]=c,this.int16[N+10]=d,this.int16[N+11]=h,this.int16[N+12]=f,this.uint16[N+13]=p,this.uint16[N+14]=m,this.uint16[N+15]=g,this.uint16[N+16]=_,this.uint16[N+17]=y,this.uint16[N+18]=v,this.uint16[N+19]=x,this.uint16[N+20]=b,this.uint16[N+21]=w,this.uint16[N+22]=T,this.uint16[N+23]=E,this.uint16[N+24]=S,this.uint16[N+25]=A,this.uint16[N+26]=C,this.uint16[N+27]=I,this.uint32[F+14]=k,this.float32[F+15]=R,this.float32[F+16]=M,this.float32[F+17]=L,this.float32[F+18]=P,this.uint8[80*i+76]=O,this.uint16[N+39]=D,i}}sE.prototype.bytesPerElement=80,ar(sE,"StructArrayLayout2f9i15ui1ul4f1ub1ui80");class sS extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o,s){let l=this.length;return this.resize(l+1),this.emplace(l,i,r,n,a,o,s)}emplace(i,r,n,a,o,s,l){let u=6*i;return this.float32[u+0]=r,this.float32[u+1]=n,this.float32[u+2]=a,this.float32[u+3]=o,this.float32[u+4]=s,this.float32[u+5]=l,i}}sS.prototype.bytesPerElement=24,ar(sS,"StructArrayLayout6f24");class sA extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,i,r,n,a,o)}emplace(i,r,n,a,o,s){let l=5*i;return this.float32[l+0]=r,this.float32[l+1]=n,this.float32[l+2]=a,this.float32[l+3]=o,this.float32[l+4]=s,i}}sA.prototype.bytesPerElement=20,ar(sA,"StructArrayLayout5f20");class sC extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o,s,l){let u=this.length;return this.resize(u+1),this.emplace(u,i,r,n,a,o,s,l)}emplace(i,r,n,a,o,s,l,u){let c=7*i;return this.float32[c+0]=r,this.float32[c+1]=n,this.float32[c+2]=a,this.float32[c+3]=o,this.float32[c+4]=s,this.float32[c+5]=l,this.float32[c+6]=u,i}}sC.prototype.bytesPerElement=28,ar(sC,"StructArrayLayout7f28");class sI extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o,s,l,u,c,d,h){let f=this.length;return this.resize(f+1),this.emplace(f,i,r,n,a,o,s,l,u,c,d,h)}emplace(i,r,n,a,o,s,l,u,c,d,h,f){let p=11*i;return this.float32[p+0]=r,this.float32[p+1]=n,this.float32[p+2]=a,this.float32[p+3]=o,this.float32[p+4]=s,this.float32[p+5]=l,this.float32[p+6]=u,this.float32[p+7]=c,this.float32[p+8]=d,this.float32[p+9]=h,this.float32[p+10]=f,i}}sI.prototype.bytesPerElement=44,ar(sI,"StructArrayLayout11f44");class sk extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o,s,l,u,c){let d=this.length;return this.resize(d+1),this.emplace(d,i,r,n,a,o,s,l,u,c)}emplace(i,r,n,a,o,s,l,u,c,d){let h=9*i;return this.float32[h+0]=r,this.float32[h+1]=n,this.float32[h+2]=a,this.float32[h+3]=o,this.float32[h+4]=s,this.float32[h+5]=l,this.float32[h+6]=u,this.float32[h+7]=c,this.float32[h+8]=d,i}}sk.prototype.bytesPerElement=36,ar(sk,"StructArrayLayout9f36");class sR extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r){let n=this.length;return this.resize(n+1),this.emplace(n,i,r)}emplace(i,r,n){let a=2*i;return this.float32[a+0]=r,this.float32[a+1]=n,i}}sR.prototype.bytesPerElement=8,ar(sR,"StructArrayLayout2f8");class sM extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,r,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,i,r,n,a)}emplace(i,r,n,a,o){let s=6*i;return this.uint32[3*i+0]=r,this.uint16[s+2]=n,this.uint16[s+3]=a,this.uint16[s+4]=o,i}}sM.prototype.bytesPerElement=12,ar(sM,"StructArrayLayout1ul3ui12");class sL extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i){let r=this.length;return this.resize(r+1),this.emplace(r,i)}emplace(i,r){return this.uint16[+i+0]=r,i}}sL.prototype.bytesPerElement=2,ar(sL,"StructArrayLayout1ui2");class sP extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_){let y=this.length;return this.resize(y+1),this.emplace(y,i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_)}emplace(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y){let v=16*i;return this.float32[v+0]=r,this.float32[v+1]=n,this.float32[v+2]=a,this.float32[v+3]=o,this.float32[v+4]=s,this.float32[v+5]=l,this.float32[v+6]=u,this.float32[v+7]=c,this.float32[v+8]=d,this.float32[v+9]=h,this.float32[v+10]=f,this.float32[v+11]=p,
8this.float32[v+12]=m,this.float32[v+13]=g,this.float32[v+14]=_,this.float32[v+15]=y,i}}sP.prototype.bytesPerElement=64,ar(sP,"StructArrayLayout16f64");class sO extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,r,n,a,o,s,l){let u=this.length;return this.resize(u+1),this.emplace(u,i,r,n,a,o,s,l)}emplace(i,r,n,a,o,s,l,u){let c=10*i,d=5*i;return this.uint16[c+0]=r,this.uint16[c+1]=n,this.uint16[c+2]=a,this.uint16[c+3]=o,this.float32[d+2]=s,this.float32[d+3]=l,this.float32[d+4]=u,i}}sO.prototype.bytesPerElement=20,ar(sO,"StructArrayLayout4ui3f20");class sD extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i){let r=this.length;return this.resize(r+1),this.emplace(r,i)}emplace(i,r){return this.int16[+i+0]=r,i}}sD.prototype.bytesPerElement=2,ar(sD,"StructArrayLayout1i2");class sF extends o8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(i){let r=this.length;return this.resize(r+1),this.emplace(r,i)}emplace(i,r){return this.uint8[+i+0]=r,i}}sF.prototype.bytesPerElement=1,ar(sF,"StructArrayLayout1ub1");class sN extends o9{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]}}sN.prototype.size=40;class sj extends sy{get(i){return new sN(this,i)}}ar(sj,"CollisionBoxArray");class sz extends o9{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(i){this._structArray.uint8[this._pos1+49]=i}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(i){this._structArray.uint8[this._pos1+50]=i}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(i){this._structArray.uint32[this._pos4+13]=i}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(i){this._structArray.uint8[this._pos1+58]=i}}sz.prototype.size=60;class sB extends sT{get(i){return new sz(this,i)}}ar(sB,"PlacedSymbolArray");class sU extends o9{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}
vendor: 4,661 bytes, line 8
8get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(i){this._structArray.uint32[this._pos4+14]=i}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(i){this._structArray.float32[this._pos4+18]=i}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}get elevationFeatureIndex(){return this._structArray.uint16[this._pos2+39]}}sU.prototype.size=80;class sV extends sE{get(i){return new sU(this,i)}}ar(sV,"SymbolInstanceArray");class sH extends sr{getoffsetX(i){return this.float32[+i+0]}}ar(sH,"GlyphOffsetArray");class sG extends se{getx(i){return this.int16[2*i+0]}gety(i){return this.int16[2*i+1]}}ar(sG,"SymbolLineVertexArray");class sq extends o9{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]}}sq.prototype.size=12;class s$ extends sM{get(i){return new sq(this,i)}}ar(s$,"FeatureIndexArray");class sW extends s_{geta_centroid_pos0(i){return this.uint16[2*i+0]}geta_centroid_pos1(i){return this.uint16[2*i+1]}}ar(sW,"FillExtrusionCentroidArray");class sY extends o9{get a_join_normal_inside0(){return this._structArray.int16[this._pos2+0]}get a_join_normal_inside1(){return this._structArray.int16[this._pos2+1]}get a_join_normal_inside2(){return this._structArray.int16[this._pos2+2]}}sY.prototype.size=6;class sZ extends st{get(i){return new sY(this,i)}}ar(sZ,"FillExtrusionWallArray");let sK=o6([{name:"a_pos",components:2,type:"Int16"}],4),sX=o6([{name:"a_road_z_offset",components:1,type:"Float32"}],4),sQ=o6([{name:"a_pos",components:2,type:"Int16"},{name:"a_height",components:1,type:"Float32"}],4),sJ=o6([{name:"a_pos_normal_3",components:3,type:"Int16"}],4);class s1{constructor(i=[]){this.segments=i}_prepareSegment(i,r,n,a,o){let s=this.segments.at(-1);return i>s1.MAX_VERTEX_ARRAY_LENGTH&&tb(`Max vertices per segment is ${s1.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${i}`),(!s||s.vertexLength+i>s1.MAX_VERTEX_ARRAY_LENGTH||s.sortKey!==a||void 0!==o&&s&&void 0!==s.batchIndex&&s.batchIndex!==o)&&(s={vertexOffset:r,primitiveOffset:n,vertexLength:0,primitiveLength:0},void 0!==a&&(s.sortKey=a),void 0!==o&&(s.batchIndex=o),this.segments.push(s)),s}prepareSegment(i,r,n,a,o){return this._prepareSegment(i,r.length,n.length,a,o)}get(){return this.segments}destroy(){for(let i of this.segments)for(let r in i.vaos)i.vaos[r].destroy()}static simpleSegment(i,r,n,a){return new s1([{vertexOffset:i,primitiveOffset:r,vertexLength:n,primitiveLength:a,vaos:{},sortKey:0}])}}function s0(i,r){return 256*(i=ts(Math.floor(i),0,255))+ts(Math.floor(r),0,255)}s1.MAX_VERTEX_ARRAY_LENGTH=65535,ar(s1,"SegmentVector");let s2=o6([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),s5=o6([{name:"a_pattern_b",components:4,type:"Uint16"}]),s4=o6([{name:"a_dash",components:4,type:"Uint16"}]);class s9{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}
vendor: 7,734 bytes, line 8
8add(i,r,n,a){this.ids.push(s3(i)),this.positions.push(r,n,a)}eachPosition(i,r){let n=s3(i),a=0,o=this.ids.length-1;for(;a<o;){let i=a+o>>1;this.ids[i]>=n?o=i:a=i+1}for(;this.ids[a]===n;)r(this.positions[3*a],this.positions[3*a+1],this.positions[3*a+2]),a++}static serialize(i,r){let n=new Float64Array(i.ids),a=new Uint32Array(i.positions);return function i(r,n,a,o){for(;a<o;){let s=r[a+o>>1],l=a-1,u=o+1;for(;;){do l++;while(r[l]<s)do u--;while(r[u]>s)if(l>=u)break;s8(r,l,u),s8(n,3*l,3*u),s8(n,3*l+1,3*u+1),s8(n,3*l+2,3*u+2)}u-a<o-u?(i(r,n,a,u),a=u+1):(i(r,n,u+1,o),o=u)}}(n,a,0,n.length-1),r&&(r.add(n.buffer),r.add(a.buffer)),{ids:n,positions:a}}static deserialize(i){let r,n=new s9;for(let a of(n.ids=i.ids,n.positions=i.positions,n.ids))a!==r&&n.uniqueIds.push(a),r=a;return n.indexed=!0,n}}function s3(i){let r=+i;return Number.isSafeInteger(r)?r:id(String(i))}function s8(i,r,n){let a=i[r];i[r]=i[n],i[n]=a}ar(s9,"FeaturePositionMap");class s6{constructor(i){this.gl=i.gl,this.initialized=!1}fetchUniformLocation(i,r){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(i,r),this.initialized=!0),!!this.location}set(i,r,n){throw Error("Uniform#set() must be implemented by each concrete Uniform")}}class s7 extends s6{constructor(i){super(i),this.current=0}set(i,r,n){this.fetchUniformLocation(i,r)&&this.current!==n&&(this.current=n,this.gl.uniform1i(this.location,n))}}class le extends s6{constructor(i){super(i),this.current=0}set(i,r,n){this.fetchUniformLocation(i,r)&&this.current!==n&&(this.current=n,this.gl.uniform1f(this.location,n))}}class lt extends s6{constructor(i){super(i),this.current=[0,0]}set(i,r,n){this.fetchUniformLocation(i,r)&&(n[0]===this.current[0]&&n[1]===this.current[1]||(this.current=n,this.gl.uniform2f(this.location,n[0],n[1])))}}class li extends s6{constructor(i){super(i),this.current=[0,0,0]}set(i,r,n){this.fetchUniformLocation(i,r)&&(n[0]===this.current[0]&&n[1]===this.current[1]&&n[2]===this.current[2]||(this.current=n,this.gl.uniform3f(this.location,n[0],n[1],n[2])))}}class lr extends s6{constructor(i){super(i),this.current=[0,0,0,0]}set(i,r,n){this.fetchUniformLocation(i,r)&&(n[0]===this.current[0]&&n[1]===this.current[1]&&n[2]===this.current[2]&&n[3]===this.current[3]||(this.current=n,this.gl.uniform4ui(this.location,n[0],n[1],n[2],n[3])))}}class ln extends s6{constructor(i){super(i),this.current=[0,0,0,0]}set(i,r,n){this.fetchUniformLocation(i,r)&&(n[0]===this.current[0]&&n[1]===this.current[1]&&n[2]===this.current[2]&&n[3]===this.current[3]||(this.current=n,this.gl.uniform4f(this.location,n[0],n[1],n[2],n[3])))}}class la extends s6{constructor(i){super(i),this.current=iE.transparent.toPremultipliedRenderColor(null)}set(i,r,n){this.fetchUniformLocation(i,r)&&(n.r===this.current.r&&n.g===this.current.g&&n.b===this.current.b&&n.a===this.current.a||(this.current=n,this.gl.uniform4f(this.location,n.r,n.g,n.b,n.a)))}}class lo extends s6{constructor(i){super(i),this.current=new Float32Array(16)}set(i,r,n){if(!this.fetchUniformLocation(i,r))return;let a=this.current;if(n[12]!==a[12]||n[0]!==a[0])return a.set(n),void this.gl.uniformMatrix4fv(this.location,!1,a);for(let i=1;i<16;i++)if(n[i]!==a[i]){a.set(n),this.gl.uniformMatrix4fv(this.location,!1,a);break}}}class ls extends s6{constructor(i){super(i),this.current=new Float32Array(4)}set(i,r,n){if(!this.fetchUniformLocation(i,r))return;let a=this.current;for(let i=0;i<4;i++)if(n[i]!==a[i]){a.set(n),this.gl.uniformMatrix2fv(this.location,!1,a);break}}}function ll(i){return[s0(255*i.r,255*i.g),s0(255*i.b,255*i.a)]}function lu(i,r,n,a,o,s,l,u){return!!i&&("composite"===i.kind||"source"===i.kind?"none"===i.evaluate(new aZ(0,{brightness:s,worldview:u}),r,n,o,a,l):"none"===i.value)}class lc{constructor(i,r,n,a){this.value=i,this.uniformNames=r.map(i=>`u_${i}`),this.type=n,this.context=a}setUniform(i,r,n,a,o){let s=a.constantOr(this.value);r.set(i,o,s instanceof iE?s.toPremultipliedRenderColor(this.lutExpression&&"constant"===this.lutExpression.kind&&"none"===this.lutExpression.value?null:this.context.lut):s)}getBinding(i,r){return"color"===this.type?new la(i):new le(i)}}class ld{constructor(i,r){this.uniformNames=r.map(i=>`u_${i}`),this.pattern=null,this.patternTransition=null,this.pixelRatio=1}setConstantPatternPositions(i,r){this.pixelRatio=i.pixelRatio||1,this.pattern=i.tl.concat(i.br),this.patternTransition=r?r.tl.concat(r.br):this.pattern}setUniform(i,r,n,a,o){let s=null;"u_pattern"!==o&&"u_dash"!==o||(s=this.pattern),"u_pattern_b"===o&&(s=this.patternTransition),"u_pixel_ratio"===o&&(s=this.pixelRatio),s&&r.set(i,o,s)}getBinding(i,r){return"u_pattern"===r||"u_pattern_b"===r||"u_dash"===r?new lr(i):new le(i)}}class lh{constructor(i,r,n,a){this.expression=i,this.type=n,this.maxValue=0,this.paintVertexAttributes=r.map(i=>({name:`a_${i}`,type:"Float32",components:"color"===n?2:1,offset:0})),this.paintVertexArray=new a}populatePaintArray(i,r,n,a,o,s,l,u){let c=this.paintVertexArray.length,d="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate(new aZ(0,{brightness:s,worldview:u}),r,{},o,a,l):"constant"===this.expression.kind&&this.expression.value,h=lu(this.lutExpression,r,{},a,o,s,l,u);this.paintVertexArray.resize(i),this._setPaintValue(c,i,d,h?null:this.context.lut)}updatePaintArray(i,r,n,a,o,s,l,u){let c="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate({zoom:0,brightness:l,worldview:u},n,a,void 0,o):"constant"===this.expression.kind&&this.expression.value,d=lu(this.lutExpression,n,a,o,void 0,l,void 0,u);this._setPaintValue(i,r,c,d?null:this.context.lut)}_setPaintValue(i,r,n,a){if("color"===this.type){let o=ll(n.toPremultipliedRenderColor(a));for(let n=i;n<r;n++)this.paintVertexArray.emplace(n,o[0],o[1])}else{for(let a=i;a<r;a++)this.paintVertexArray.emplace(a,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(i){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=i.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.lutExpression&&"constant"!==this.lutExpression.kind&&(this.lutExpression.isStateDependent||!this.lutExpression.isLightConstant)||"constant"!==this.expression.kind&&(this.expression.isStateDependent||!this.expression.isLightConstant)))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class lf{constructor(i,r,n,a,o,s){this.expression=i,this.uniformNames=r.map(i=>`u_${i}_t`),this.type=n,this.useIntegerZoom=a,this.context=o,this.maxValue=0,this.paintVertexAttributes=r.map(i=>({name:`a_${i}`,type:"Float32",components:"color"===n?4:2,offset:0})),this.paintVertexArray=new s}populatePaintArray(i,r,n,a,o,s,l,u){let c=this.expression.evaluate(new aZ(this.context.zoom,{brightness:s,worldview:u}),r,{},o,a,l),d=this.expression.evaluate(new aZ(this.context.zoom+1,{brightness:s,worldview:u}),r,{},o,a,l),h=lu(this.lutExpression,r,{},a,o,s,l,u),f=this.paintVertexArray.length;this.paintVertexArray.resize(i),this._setPaintValue(f,i,c,d,h?null:this.context.lut)}updatePaintArray(i,r,n,a,o,s,l,u){let c=this.expression.evaluate({zoom:this.context.zoom,brightness:l,worldview:u},n,a,void 0,o),d=this.expression.evaluate({zoom:this.context.zoom+1,brightness:l,worldview:u},n,a,void 0,o),h=lu(this.lutExpression,n,a,o,void 0,l,void 0,u);this._setPaintValue(i,r,c,d,h?null:this.context.lut)}_setPaintValue(i,r,n,a,o){if("color"===this.type){let s=ll(n.toPremultipliedRenderColor(o)),l=ll(a.toPremultipliedRenderColor(o));for(let n=i;n<r;n++)this.paintVertexArray.emplace(n,s[0],s[1],l[0],l[1])}else{for(let o=i;o<r;o++)this.paintVertexArray.emplace(o,n,a);
8this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(a))}}upload(i){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=i.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(i,r,n,a,o){let s=this.useIntegerZoom?Math.floor(n.zoom):n.zoom,l=ts(this.expression.interpolationFactor(s,this.context.zoom,this.context.zoom+1),0,1);r.set(i,o,l)}getBinding(i,r){return new le(i)}}class lp{constructor(i,r,n,a,o){this.expression=i,this.layerId=o,this.paintVertexAttributes=("array"===n?s4:s2).members;for(let i=0;i<r.length;++i);this.paintVertexArray=new a,this.paintTransitionVertexArray=new sd}populatePaintArray(i,r,n,a){let o=this.paintVertexArray.length;this.paintVertexArray.resize(i),this._setPaintValues(o,i,r.patterns&&r.patterns[this.layerId],n)}updatePaintArray(i,r,n,a,o,s,l){this._setPaintValues(i,r,n.patterns&&n.patterns[this.layerId],s)}_setPaintValues(i,r,n,a){if(!a||!n)return;let o=a[n[0]],s=a[n[1]];if(o){if(o){let{tl:n,br:a,pixelRatio:s}=o;for(let o=i;o<r;o++)this.paintVertexArray.emplace(o,n[0],n[1],a[0],a[1],s)}if(s){this.paintTransitionVertexArray.resize(this.paintVertexArray.length);let{tl:n,br:a}=s;for(let o=i;o<r;o++)this.paintTransitionVertexArray.emplace(o,n[0],n[1],a[0],a[1])}}}upload(i){let r=this.expression.isStateDependent||!this.expression.isLightConstant;this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=i.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,r)),this.paintTransitionVertexArray&&this.paintTransitionVertexArray.length&&(this.paintTransitionVertexBuffer=i.createVertexBuffer(this.paintTransitionVertexArray,s5.members,r))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy(),this.paintTransitionVertexBuffer&&this.paintTransitionVertexBuffer.destroy()}}class lm{constructor(i,r,n=()=>!0){this.binders={},this._buffers=[],this.context=r;const a=[];for(const o in i.paint._values){const s=i.paint.get(o);if(o.endsWith("-use-theme")||!n(o)||!(s instanceof a2&&nW(s.property.specification)))continue;const l=function(i,r){return l_[i]||[i.replace(`${r}-`,"").replace(/-/g,"_")]}(o,i.type),u=s.value,c=s.property.specification.type,d=!!s.property.useIntegerZoom,h="line-dasharray"===o||o.endsWith("pattern"),f=i.paint.get(`${o}-use-theme`),p="line-dasharray"===o&&"constant"!==i.layout.get("line-cap").value.kind||f&&"constant"!==f.value.kind;if("constant"!==u.kind||p)if("source"===u.kind||p||h){const r=lx(o,c,"source");this.binders[o]=h?new lp(u,l,c,r,i.id):new lh(u,l,c,r),a.push(`/a_${o}`)}else{const i=lx(o,c,"composite");this.binders[o]=new lf(u,l,c,d,r,i),a.push(`/z_${o}`)}else this.binders[o]=h?new ld(u.value,l):new lc(u.value,l,c,r),a.push(`/u_${o}`);f&&(this.binders[o].lutExpression=f.value)}this.cacheKey=a.sort().join("")}updateExpressions(i){for(let r in this.binders){let n=this.binders[r];(n instanceof lh||n instanceof lf||n instanceof lp)&&(n.expression=i.paint.get(r).value)}}getMaxValue(i){let r=this.binders[i];return r instanceof lh||r instanceof lf?r.maxValue:0}populatePaintArrays(i,r,n,a,o,s,l,u){for(let c in this.binders){let d=this.binders[c];d.context=this.context,(d instanceof lh||d instanceof lf||d instanceof lp)&&d.populatePaintArray(i,r,n,a,o,s,l,u)}}setConstantPatternPositions(i,r){for(let n in this.binders){let a=this.binders[n];a instanceof ld&&a.setConstantPatternPositions(i,r)}}getPatternTransitionVertexBuffer(i){let r=this.binders[i];return r instanceof lp?r.paintTransitionVertexBuffer:null}updatePaintArrays(i,r,n,a,o,s,l,u,c,d){let h=!1,f=Object.keys(i),p=0!==f.length&&!u,m=p?f:r.uniqueIds;for(let u in this.context.lut=o.lut,this.binders){let f=this.binders[u];if(f.context=this.context,(f instanceof lh||f instanceof lf||f instanceof lp)&&f.expression&&f.expression.kind&&"constant"!==f.expression.kind&&(!0===f.expression.isStateDependent||!1===f.expression.isLightConstant)){for(let n of(f.expression=o.paint.get(u).value,m)){let o=i[n.toString()];r.eachPosition(n,(i,r,n)=>{let u=a.feature(i);f.updatePaintArray(r,n,u,o,s,l,c,d)})}if(!p)for(let r of n.uniqueIds){let o=i[r.toString()];n.eachPosition(r,(i,r,n)=>{let u=a.feature(i);f.updatePaintArray(r,n,u,o,s,l,c,d)})}h=!0}}return h}defines(){let i=[];for(let r in this.binders){let n=this.binders[r];(n instanceof lc||n instanceof ld)&&i.push(...n.uniformNames.map(i=>`#define HAS_UNIFORM_${i}`))}return i}getPaintVertexBuffers(){return this._buffers}getUniforms(i){let r=[];for(let n in this.binders){let a=this.binders[n];if(a instanceof lc||a instanceof ld||a instanceof lf)for(let o of a.uniformNames)r.push({name:o,property:n,binding:a.getBinding(i,o)})}return r}setUniforms(i,r,n,a,o){for(let{name:r,property:s,binding:l}of n)this.binders[s].setUniform(i,l,o,a.get(s),r)}updatePaintBuffers(){for(let i in this._buffers=[],this.binders){let r=this.binders[i];(r instanceof lh||r instanceof lf||r instanceof lp)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer),r instanceof lp&&r.paintTransitionVertexBuffer&&this._buffers.push(r.paintTransitionVertexBuffer)}}upload(i){for(let r in this.binders){let n=this.binders[r];(n instanceof lh||n instanceof lf||n instanceof lp)&&n.upload(i)}this.updatePaintBuffers()}destroy(){for(let i in this.binders){let r=this.binders[i];(r instanceof lh||r instanceof lf||r instanceof lp)&&r.destroy()}}}class lg{constructor(i,r,n=()=>!0){for(const a of(this.programConfigurations={},i))this.programConfigurations[a.id]=new lm(a,r,n);this.needsUpload=!1,this._featureMap=new s9,this._featureMapWithoutIds=new s9,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(i,r,n,a,o,s,l,u,c){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(i,r,a,o,s,l,u,c);void 0!==r.id?this._featureMap.add(r.id,n,this._bufferOffset,i):(this._featureMapWithoutIds.add(this._idlessCounter,n,this._bufferOffset,i),this._idlessCounter+=1),this._bufferOffset=i,this.needsUpload=!0}updatePaintArrays(i,r,n,a,o,s,l,u){for(let c of n)this.needsUpload=this.programConfigurations[c.id].updatePaintArrays(i,this._featureMap,this._featureMapWithoutIds,r,c,a,o,s,l||0,u)||this.needsUpload}get(i){return this.programConfigurations[i]}upload(i){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(i);this.needsUpload=!1}}destroy(){for(let i in this.programConfigurations)this.programConfigurations[i].destroy()}updateExpressions(i){let r=new Set;for(let n of i){let i=this.programConfigurations[n.id];i&&(i.updateExpressions(n),r.add(n.id))}for(let i in this.programConfigurations)r.has(i)||delete this.programConfigurations[i]}}let l_={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-occlusion-opacity":["occlusion_opacity"],"icon-occlusion-opacity":["occlusion_opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"symbol-z-offset":["z_offset"],"line-gap-width":["ga
8pwidth"],"line-pattern":["pattern","pixel_ratio","pattern_b"],"fill-pattern":["pattern","pixel_ratio","pattern_b"],"fill-extrusion-pattern":["pattern","pixel_ratio","pattern_b"],"line-dasharray":["dash"],"fill-bridge-guard-rail-color":["structure_color"],"fill-tunnel-structure-color":["structure_color"]},ly={"line-pattern":{source:sc,composite:sc},"fill-pattern":{source:sc,composite:sc},"fill-extrusion-pattern":{source:sc,composite:sc},"line-dasharray":{source:sd,composite:sd}},lv={color:{source:sR,composite:sm},number:{source:sr,composite:sR}};function lx(i,r,n){let a=ly[i];return a&&a[n]||lv[r][n]}ar(lc,"ConstantBinder"),ar(ld,"PatternConstantBinder"),ar(lh,"SourceExpressionBinder",{omit:["expression"]}),ar(lp,"PatternCompositeBinder",{omit:["expression"]}),ar(lf,"CompositeExpressionBinder",{omit:["expression"]}),ar(lm,"ProgramConfiguration",{omit:["_buffers"]}),ar(lg,"ProgramConfigurationSet");class lb{constructor(i,r,n){this.layoutVertexArray=new se,this.indexArray=new sw,this.lineIndexArray=new s_,this.triangleSegments=new s1,this.lineSegments=new s1,this.programConfigurations=new lg(i,{zoom:r,lut:n}),this.uploaded=!1}update(i,r,n,a,o,s,l,u){this.programConfigurations.updatePaintArrays(i,r,o,n,a,s,l,u)}isEmpty(){return 0===this.layoutVertexArray.length}needsUpload(){return this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,sK.members),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.lineIndexBuffer=i.createIndexBuffer(this.lineIndexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.lineIndexBuffer.destroy(),this.programConfigurations.destroy(),this.triangleSegments.destroy(),this.lineSegments.destroy())}populatePaintArrays(i,r,n,a,o,s,l){this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,r,n,a,o,s,void 0,l)}}ar(lb,"FillBufferData");class lw{constructor(i){this.zoom=i.zoom,this.pixelRatio=i.pixelRatio,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(i=>i.fqid),this.index=i.index,this.hasPattern=!1,this.patternFeatures=[],this.lut=i.lut,this.bufferData=new lb(i.layers,i.zoom,i.lut),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=i.projection,this.sourceLayerIndex=i.sourceLayerIndex,this.sourceLayerName=i.sourceLayerName||"",this.worldview=i.worldview,this.hasAppearances=null}updateFootprints(i,r){}updateAppearances(i,r,n,a){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(i,r,n,a){this.hasPattern=oN("fill",this.layers,this.pixelRatio,r);let o=this.layers[0].layout.get("fill-sort-key"),s=[];for(let{feature:l,id:u,index:c,sourceLayerIndex:d}of i){let i=this.layers[0]._featureFilter.needGeometry,h=o5(l,i);if(!this.layers[0]._featureFilter.filter(new aZ(this.zoom,{worldview:this.worldview,activeFloors:r.activeFloors}),h,n))continue;let f=o?o.evaluate(h,{},n,r.availableImages):void 0,p={id:u,properties:l.properties,type:l.type,sourceLayerIndex:d,index:c,geometry:i?h.geometry:o2(l,n,a),patterns:{},sortKey:f};s.push(p)}for(let a of(o&&s.sort((i,r)=>i.sortKey-r.sortKey),s)){let{geometry:o,index:s,sourceLayerIndex:l}=a;if(this.hasPattern){let i=oj("fill",this.layers,a,this.zoom,this.pixelRatio,r);this.patternFeatures.push(i)}else this.addFeature(a,o,s,n,{},r.availableImages,r.brightness,r.elevationFeatures);r.featureIndex.insert(i[s].feature,o,s,l,this.index)}!this.hasPattern&&this.hdExt&&this.hdExt.buildFrcSegments(this)}update(i,r,n,a,o,s,l){this.bufferData.update(i,r,n,a,o,s,l,this.worldview),this.hdExt&&this.hdExt.update(i,r,n,a,o,s,l,this.worldview)}updateExpressions(i){this.bufferData.programConfigurations.updateExpressions(i),this.hdExt&&this.hdExt.updateExpressions(i)}addFeatures(i,r,n,a,o,s){for(let o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,n,a,s,i.elevationFeatures);this.hdExt&&this.hdExt.buildFrcSegments(this)}isEmpty(){return this.bufferData.isEmpty()&&(!this.hdExt||this.hdExt.isEmpty())}uploadPending(){return!this.uploaded||this.bufferData.needsUpload()||null!=this.hdExt&&this.hdExt.needsUpload()}upload(i){this.bufferData.upload(i),this.hdExt&&this.hdExt.upload(i)}destroy(){this.bufferData.destroy(),this.hdExt&&this.hdExt.destroy()}
8addFeature(i,r,n,a,o,s=[],l,u){let c=this.hdExt?this.hdExt.trackFeatureFrc(i.properties):null,d=this.bufferData.indexArray.length,h=e2(r,500);null!=this.hdExt&&this.hdExt.handleFeature(i,h,n,a,u,this)||this.addGeometry(h,this.bufferData),this.bufferData.populatePaintArrays(i,n,o,s,a,l,this.worldview),this.hdExt&&this.hdExt.populatePaintArrays(i,n,o,s,a,l,this.worldview),this.hdExt&&this.hdExt.recordFeatureRange(this,d,this.bufferData.indexArray.length,c)}addGeometry(i,r,n,a){let o=1/0,s=-1/0,l=null;n&&null!=(l=n.elevationSampler.constantElevation(n.elevation,n.bias))&&(o=l,s=l);let u=n?r:null,c=(i,r,a)=>{if(null!=n)if(r.push(i),null!=l)u.elevatedLayoutVertexArray.emplaceBack(l),a.push(l);else{let r=n.elevationSampler.pointElevation(i,n.elevation,n.bias);u.elevatedLayoutVertexArray.emplaceBack(r),a.push(r),o=Math.min(o,r),s=Math.max(s,r)}};for(let o of i){let i=0;for(let r of o)i+=r.length;let s=r.triangleSegments.prepareSegment(i,r.layoutVertexArray,r.indexArray),l=s.vertexLength,u=[],d=[],h=[],f=[],p=[],m=r.layoutVertexArray.length;for(let i of o){if(0===i.length)continue;i!==o[0]&&d.push(u.length/2);let a=r.lineSegments.prepareSegment(i.length,r.layoutVertexArray,r.lineIndexArray),s=a.vertexLength;n&&p.push(r.layoutVertexArray.length-m),c(i[0],h,f),r.layoutVertexArray.emplaceBack(i[0].x,i[0].y),r.lineIndexArray.emplaceBack(s+i.length-1,s),u.push(i[0].x),u.push(i[0].y);for(let n=1;n<i.length;n++)c(i[n],h,f),r.layoutVertexArray.emplaceBack(i[n].x,i[n].y),r.lineIndexArray.emplaceBack(s+n-1,s+n),u.push(i[n].x),u.push(i[n].y);a.vertexLength+=i.length,a.primitiveLength+=i.length}let g=ov(u,d);for(let i=0;i<g.length;i+=3)r.indexArray.emplaceBack(l+g[i],l+g[i+1],l+g[i+2]);if(g.length>0&&n&&a){let i=n.elevation.isTunnel(),r=n.elevation.safeArea,o=a.addVertices(h,f);a.addTriangles(g,o,i);let s=p.length;if(s>0){for(let l=0;l<s-1;l++)a.addRenderableRing(n.index,p[l]+o,p[l+1]-p[l],i,r,n.featureInfo);a.addRenderableRing(n.index,p[s-1]+o,h.length-p[s-1],i,r,n.featureInfo)}}s.vertexLength+=i,s.primitiveLength+=g.length/3}return[o,s]}}ar(lw,"FillBucket",{omit:["layers","patternFeatures"]});let lT=o6([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),lE=o6([{name:"a_z_offset_width",components:4,type:"Float32"}],4),lS=o6([{name:"a_elevation_id_col",components:3,type:"Float32"}],4),lA=o6([{name:"a_elevation_ground_scale",components:1,type:"Float32"}],4),{members:lC}=lT,{members:lI}=o6([{name:"a_packed",components:3,type:"Float32"}]),{members:lk}=o6([{name:"a_pattern_data",components:3,type:"Float32"}]);class lR{constructor(i,r,n,a,o){for(this.properties=Object.create(null),this.extent=n,this.type=0,this.id=void 0,this._pbf=i,this._geometry=-1,this._keys=a,this._values=o;i.pos<r;){const r=i.readVarint();if(8===r)this.id=i.readVarint();else if(18===r){const r=i.readVarint()+i.pos;for(;i.pos<r;){const r=a[i.readVarint()],n=o[i.readVarint()];this.properties[r]=n}}else 24===r?this.type=i.readVarint():(34===r&&(this._geometry=i.pos),i.skip(r))}}loadGeometry(){if(this._geometry<0)throw Error("feature has no geometry");let i=this._pbf;i.pos=this._geometry;let r=i.readVarint()+i.pos,n=[],a,o=1,s=0,l=0,u=0;for(;i.pos<r;){if(s<=0){let r=i.readVarint();if(o=7&r,0==(s=r>>3))continue}if(s--,1===o)l+=i.readSVarint(),u+=i.readSVarint(),a&&n.push(a),a=[new eQ(l,u)];else if(2===o)l+=i.readSVarint(),u+=i.readSVarint(),a&&a.push(new eQ(l,u));else{if(7!==o)throw Error(`unknown command ${o}`);a&&a.push(a[0].clone())}}return a&&n.push(a),n}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let i=this._pbf;i.pos=this._geometry;let r=i.readVarint()+i.pos,n=1,a=0,o=0,s=0,l=1/0,u=-1/0,c=1/0,d=-1/0;for(;i.pos<r;){if(a<=0){let r=i.readVarint();if(n=7&r,0==(a=r>>3))continue}if(a--,1===n||2===n)o+=i.readSVarint(),s+=i.readSVarint(),o<l&&(l=o),o>u&&(u=o),s<c&&(c=s),s>d&&(d=s);else if(7!==n)throw Error(`unknown command ${n}`)}return[l,c,u,d]}toGeoJSON(i,r,n){let a,o=this.extent*Math.pow(2,n),s=this.extent*i,l=this.extent*r,u=this.loadGeometry();function c(i){return[360*(i.x+s)/o-180,360/Math.PI*Math.atan(Math.exp((1-2*(i.y+l)/o)*Math.PI))-90]}function d(i){return i.map(c)}if(1===this.type){let i=[];for(let r of u)i.push(r[0]);let r=d(i);a=1===i.length?{type:"Point",coordinates:r[0]}:{type:"MultiPoint",coordinates:r}}else if(2===this.type){let i=u.map(d);a=1===i.length?{type:"LineString",coordinates:i[0]}:{type:"MultiLineString",coordinates:i}}else{if(3!==this.type)throw Error("unknown feature type");{let i=function(i){let r,n,a=i.length;if(a<=1)return[i];let o=[];for(let s=0;s<a;s++){let a=function(i){let r=0;for(let n,a,o=0,s=i.length,l=s-1;o<s;l=o++)n=i[o],r+=((a=i[l]).x-n.x)*(n.y+a.y);return r}(i[s]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(r&&o.push(r),r=[i[s]]):r&&r.push(i[s]))}return r&&o.push(r),o}(u),r=[];for(let n of i)r.push(n.map(d));a=1===r.length?{type:"Polygon",coordinates:r[0]}:{type:"MultiPolygon",coordinates:r}}}let h={type:"Feature",geometry:a,properties:this.properties};return null!=this.id&&(h.id=this.id),h}}lR.types=["Unknown","Point","LineString","Polygon"];class lM{constructor(i,r){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=i,this._keys=[],this._values=[],this._features=[],void 0===r&&(r=i.length);i.pos<r;){const r=i.readVarint();10===r?this.name=i.readString():18===r?(this._features.push(i.pos),i.skip(r)):26===r?this._keys.push(i.readString()):34===r?this._values.push(function(i){let r=null,n=i.readVarint()+i.pos;for(;i.pos<n;){let n=i.readVarint();r=10===n?i.readString():21===n?i.readFloat():25===n?i.readDouble():32===n?i.readVarint(!0):40===n?i.readVarint():48===n?i.readSVarint():56===n?i.readBoolean():(i.skip(n),null)}if(null==r)throw Error("unknown feature value");return r}(i)):40===r?this.extent=i.readVarint():120===r?this.version=i.readVarint():i.skip(r)}this.length=this._features.length}feature(i){if(i<0||i>=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[i];let r=this._pbf.readVarint()+this._pbf.pos;return new lR(this._pbf,r,this.extent,this._keys,this._values)}}class lL{constructor(i,r=i.length){const n=Object.create(null);for(;i.pos<r;){const r=i.readVarint();if(26===r){const r=new lM(i,i.readVarint()+i.pos);r.length&&(n[r.name]=r)}else i.skip(r)}this.layers=n}}function lP(i,r){for(let n=0;n<i.length;n++)if(lB(r,i[n]))return!0;for(let n=0;n<r.length;n++)if(lB(i,r[n]))return!0;return!!lD(i,r)}function lO(i,r){if(1===i.length)return lz(r,i[0]);for(let n=0;n<r.length;n++){let a=r[n];for(let r=0;r<a.length;r++)if(lB(i,a[r]))return!0}for(let n=0;n<i.length;n++)if(lz(r,i[n]))return!0;for(let n=0;n<r.length;n++)if(lD(i,r[n]))return!0;return!1}function lD(i,r){if(0===i.length||0===r.length)return!1;for(let l=0;l<i.length-1;l++){let u=i[l],c=i[l+1];for(let i=0;i<r.length-1;i++){var n,a,o,s;if(n=u,a=c,o=r[i],tw(n,o,s=r[i+1])!==tw(a,o,s)&&tw(n,a,o)!==tw(n,a,s))return!0}}return!1}function lF(i,r,n){return(i.x-n.x)*(r.y-n.y)-(i.y-n.y)*(r.x-n.x)}function lN(i,r,n){let a=n*n;if(1===r.length)return i.distSqr(r[0])<a;for(let n=1;n<r.length;n++)if(lj(i,r[n-1],r[n])<a)return!0;return!1}function lj(i,r,n){let a=r.distSqr(n);if(0===a)return i.distSqr(r);let o=((i.x-r.x)*(n.x-r.x)+(i.y-r.y)*(n.y-r.y))/a;return i.distSqr(o<0?r:o>1?n:n.sub(r)._mult(o)._add(r))}function lz(i,r){let n,a,o,s=!1;for(let l=0;l<i.length;l++){n=i[l];for(let i=0,l=n.length-1;i<n.length;l=i++)a=n[i],o=n[l],a.y>r.y!=o.y>r.y&&r.x<(o.x-a.x)*(r.y-a.y)/(o.y-a.y)+a.x&&(s=!s)}return s}function lB(i,r){let n=!1;for(let a=0,o=i.length-1;a<i.length;o=a++){let s=i[a],l=i[o];s.y>r.y!=l.y>r.y&&r.x<(l.x-s.x)*(r.y-s.y)/(l.y-s.y)+s.x&&(n=!n)}return n}function lU(i,r,n,a,o){for(let s of i)if(r<=s.x&&n<=s.y&&a>=s.x&&o>=s.y)return!0;let s=[new eQ(r,n),new eQ(r,o),new eQ(a,o),new eQ(a,n)];if(i.length>2){for(let r of s)if(lB(i,r))return!0}for(let r=0;r<i.length-1;r++)if(lV(i[r],i[r+1],s))return!0;return!1}function lV(i,r,n){let a=n[0],o=n[2];if(i.x<a.x&&r.x<a.x||i.x>o.x&&r.x>o.x||i.y<a.y&&r.y<a.y||i.y>o.y&&r.y>o.y)return!1;let s=tw(i,r,n[0]);return s!==tw(i,r,n[1])||s!==tw(i,r,n[2])||s!==tw(i,r,n[3])}function lH(i,r,n,a,o,s){let l=r.y-i.y,u=i.x-r.x;if(s=s||0){let i=l*l+u*u;if(0===i)return!0;let r=Math.sqrt(i);l/=r,u/=r}return!((n.x-i.x)*l+(n.y-i.y)*u-s<0||(a.x-i.x)*l+(a.y-i.y)*u-s<0||(o.x-i.x)*l+(o.y-i.y)*u-s<0)}function lG(i,r,n,a,o,s,l){return!(lH(i,r,a,o,s,l)||lH(r,n,a,o,s,l)||lH(n,i,a,o,s,l)||lH(a,o,i,r,n,l)||lH(o,s,i,r,n,l)||lH(s,a,i,r,n,l))}class lq extends eQ{constructor(i,r,n){super(i,r),this.z=n}}class l$ extends lq{constructor(i,r,n,a){super(i,r,n),this.w=a}}function lW(i,r,n,a){let o="x"===n?"y":"x",s=(a-i[n])/(r[n]-i[n]);i[o]=Math.round(i[o]+(r[o]-i[o])*s),i[n]=a,Object.hasOwn(i,"z")&&(i.z=iw(i.z,r.z,s)),Object.hasOwn(i,"w")&&(i.w=iw(i.w,r.w,s))}function lY(i,r,n,a){for(let o of["x","y"]){let s=i,l=r;s[o]>=l[o]&&(s=r,l=i),s[o]<n&&l[o]>n&&lW(s,l,o,n),s[o]<a&&l[o]>a&&lW(l,s,o,a)}}function lZ(i,r,n,a,o,s){let l=[];for(let u=0;u<i.length;u++){let c,d=i[u],h=l.length,f=0;for(let i=0;i<d.length-1;i++){let h,p,m=d[i],g=d[i+1],_=0,y=f;s&&(f+=_=Math.hypot(g.x-m.x,g.y-m.y),h=m,p=g),m.x<r&&g.x<r||(m.x<r?m=new eQ(r,m.y+(r-m.x)/(g.x-m.x)*(g.y-m.y))._round():g.x<r&&(g=new eQ(r,m.y+(r-m.x)/(g.x-m.x)*(g.y-m.y))._round()),m.y<n&&g.y<n||(m.y<n?m=new eQ(m.x+(n-m.y)/(g.y-m.y)*(g.x-m.x),n)._round():g.y<n&&(g=new eQ(m.x+(n-m.y)/(g.y-m.y)*(g.x-m.x),n)._round()),m.x>=a&&g.x>=a||(m.x>
8=a?m=new eQ(a,m.y+(a-m.x)/(g.x-m.x)*(g.y-m.y))._round():g.x>=a&&(g=new eQ(a,m.y+(a-m.x)/(g.x-m.x)*(g.y-m.y))._round()),m.y>=o&&g.y>=o||(m.y>=o?m=new eQ(m.x+(o-m.y)/(g.y-m.y)*(g.x-m.x),o)._round():g.y>=o&&(g=new eQ(m.x+(o-m.y)/(g.y-m.y)*(g.x-m.x),o)._round()),c&&m.equals(c.at(-1))||(c=[m],l.push(c),s&&s.push({progress:{min:y+lK(h,p,m)*_,max:1},parentIndex:u,prevPoint:h,nextPoint:p})),c.push(g),s&&(s.at(-1).progress.max=y+lK(h,p,g)*_,s.at(-1).nextPoint=p)))))}if(s&&f>0)for(let i=h;i<l.length;i++)s[i].progress.min/=f,s[i].progress.max/=f}return l}function lK(i,r,n){return i.x!==r.x?(n.x-i.x)/(r.x-i.x):i.y!==r.y?(n.y-i.y)/(r.y-i.y):0}function lX(i,{width:r,height:n},a,o){if(o){if(o instanceof Uint8ClampedArray)o=new Uint8Array(o.buffer);else if(o.length!==r*n*a)throw RangeError("mismatched image size")}else o=new Uint8Array(r*n*a);return i.width=r,i.height=n,i.data=o,i}function lQ(i,r,n){let{width:a,height:o}=r;a===i.width&&o===i.height||(lJ(i,r,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,a),height:Math.min(i.height,o)},n,null),i.width=a,i.height=o,i.data=r.data)}function lJ(i,r,n,a,o,s,l,u){if(0===o.width||0===o.height)return r;if(o.width>i.width||o.height>i.height||n.x>i.width-o.width||n.y>i.height-o.height)throw RangeError("out of range source coordinates for image copy");if(o.width>r.width||o.height>r.height||a.x>r.width-o.width||a.y>r.height-o.height)throw RangeError("out of range destination coordinates for image copy");let c=i.data,d=r.data,h=4===s&&u;for(let u=0;u<o.height;u++){let f=((n.y+u)*i.width+n.x)*s,p=((a.y+u)*r.width+a.x)*s;if(h)for(let i=0;i<o.width;i++){let r=f+i*s+3,n=p+i*s;d[n+0]=255,d[n+1]=255,d[n+2]=255,d[n+3]=c[r]}else if(l)for(let i=0;i<o.width;i++){let r=f+i*s,n=p+i*s,a=new iE(c[r+0]/255,c[r+1]/255,c[r+2]/255,c[r+3]).toNonPremultipliedRenderColor(l).toArray();d[n+0]=a[0],d[n+1]=a[1],d[n+2]=a[2],d[n+3]=a[3]}else for(let i=0;i<o.width*s;i++)d[p+i]=c[f+i]}return r}class l1{constructor(i,r){lX(this,i,1,r)}resize(i){lQ(this,new l1(i),1)}clone(){return new l1({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(i,r,n,a,o){lJ(i,r,n,a,o,1,null)}}class l0{constructor(i,r){lX(this,i,4,r)}resize(i){lQ(this,new l0(i),4)}replace(i,r){r?this.data.set(i):this.data=i instanceof Uint8ClampedArray?new Uint8Array(i.buffer):i}clone(){return new l0({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(i,r,n,a,o,s,l){lJ(i,r,n,a,o,4,s,l)}}class l2{constructor(i,r){this.width=i.width,this.height=i.height,this.data=r instanceof Uint8Array?new Float32Array(r.buffer):r}}ar(l1,"AlphaImage"),ar(l0,"RGBAImage");class l5{constructor(i,r){this.width=i,this.height=r,this.nextRow=0,this.image=new l1({width:i,height:r}),this.positions={},this.uploaded=!1}getDash(i,r){let n=this.getKey(i,r);return this.positions[n]}trim(){let i=this.width,r=this.height=tp(this.nextRow);this.image.resize({width:i,height:r})}getKey(i,r){return i.join(",")+r}getDashRanges(i,r,n){let a=[],o=i.length%2==1?-i.at(-1)*n:0,s=i[0]*n,l=!0;a.push({left:o,right:s,isDash:l,zeroLength:0===i[0]});let u=i[0];for(let r=1;r<i.length;r++){l=!l;let c=i[r];o=u*n,u+=c,s=u*n,a.push({left:o,right:s,isDash:l,zeroLength:0===c})}return a}addRoundDash(i,r,n){let a=r/2;for(let r=-n;r<=n;r++){let o=this.width*(this.nextRow+n+r),s=0,l=i[0];for(let u=0;u<this.width;u++){let c;u/l.right>1&&(l=i[++s]);let d=Math.min(Math.abs(u-l.left),Math.abs(u-l.right)),h=r/n*(a+1);if(l.isDash){let i=a-Math.abs(h);c=Math.sqrt(d*d+i*i)}else c=a-Math.sqrt(d*d+h*h);this.image.data[o+u]=Math.max(0,Math.min(255,c+128))}}}addRegularDash(i,r){for(let r=i.length-1;r>=0;--r){let n=i[r],a=i[r+1];n.zeroLength?i.splice(r,1):a&&a.isDash===n.isDash&&(a.left=n.left,i.splice(r,1))}let n=i[0],a=i.at(-1);n.isDash===a.isDash&&(n.left=a.left-this.width,a.right=n.right+this.width);let o=this.width*this.nextRow,s=0,l=i[0];for(let n=0;n<this.width;n++){n/l.right>1&&(l=i[++s]);let a=Math.min(Math.abs(n-l.left),Math.abs(n-l.right));this.image.data[o+n]=Math.max(0,Math.min(255,(l.isDash?a:-a)+r+128))}}addDash(i,r){let n=this.getKey(i,r);if(this.positions[n])return this.positions[n];let a="round"===r,o=7*!!a,s=2*o+1;if(this.nextRow+s>this.height)return tb("LineAtlas out of space"),null;0===i.length&&i.push(1);let l=0;for(let r=0;r<i.length;r++)i[r]<0&&(tb("Negative value is found in line dasharray, replacing values with 0"),i[r]=0),l+=i[r];if(0!==l){let n=this.width/l,s=this.getDashRanges(i,this.width,n);a?this.addRoundDash(s,n,o):this.addRegularDash(s,"square"===r?.5*n:0)}let u=this.nextRow+o;this.nextRow+=s;let c=Math.floor(l),d={tl:[u,o],br:[c,Math.round(65535*(l-c))]};return this.positions[n]=d,d}}ar(l5,"LineAtlas");let l4="3d_elevation_id",l9="level",l3=lR.types,l8=Math.cos(Math.PI/180*37.5),l6=Math.cos(Math.PI/180*5);class l7{constructor(i){this.evaluationGlobals={zoom:0,lineProgress:void 0},this.elevationType="none",this.isSeaLevelReference=!1,this.showElevationIdDebug=!1,this.zoom=i.zoom,this.evaluationGlobals.zoom=this.zoom,this.overscaling=i.overscaling,this.pixelRatio=i.pixelRatio,this.layers=i.layers,this.layerIds=this.layers.map(i=>i.fqid),this.index=i.index,this.projection=i.projection,this.hasPattern=!1,this.hasCrossSlope=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={}
8,this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new sl,this.layoutVertexArray2=new su,this.patternVertexArray=new su,this.indexArray=new sw,this.programConfigurations=new lg(i.layers,{zoom:i.zoom,lut:i.lut}),this.segments=new s1,this.sourceLayerName=i.sourceLayerName||"",this.maxLineLength=0,this.zOffsetVertexArray=new sm,this.elevationIdColVertexArray=new su,this.elevationGroundScaleVertexArray=new sr,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.tessellationStep=i.tessellationStep?i.tessellationStep:128,this.worldview=i.worldview,this.hasAppearances=null}updateFootprints(i,r){}updateAppearances(i,r,n,a){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(i,r,n,a){this.showElevationIdDebug=r.showElevationIdDebug,this.hasPattern=oN("line",this.layers,this.pixelRatio,r);let o=this.layers[0].layout.get("line-sort-key");this.tileToMeter=oQ(n);let s=this.layers[0].layout.get("line-elevation-reference");if("hd-road-markup"===s)this.elevationType="road";else{let i=this.layers[0].layout.get("line-z-offset"),r=i.isConstant()&&!i.constantOr(0);this.elevationType="sea"!==s&&"ground"!==s&&r?"none":"offset","offset"===this.elevationType&&"none"===s&&tb(`line-elevation-reference: ground is used for the layer ${this.layerIds[0]} because non-zero line-z-offset value was found.`),this.isSeaLevelReference="sea"===s}let l=this.layers[0].layout.get("line-cross-slope");this.hasCrossSlope="offset"===this.elevationType&&void 0!==l;let u=[];for(let{feature:s,id:l,index:c,sourceLayerIndex:d}of i){let i=this.layers[0]._featureFilter.needGeometry,h=o5(s,i);if(!this.layers[0]._featureFilter.filter(new aZ(this.zoom,{worldview:this.worldview,activeFloors:r.activeFloors}),h,n))continue;let f=o?o.evaluate(h,{},n):void 0,p={id:l,properties:s.properties,type:s.type,sourceLayerIndex:d,index:c,geometry:i?h.geometry:o2(s,n,a),patterns:{},sortKey:f};u.push(p)}o&&u.sort((i,r)=>i.sortKey-r.sortKey);let{lineAtlas:c,featureIndex:d}=r,h=this.addConstantDashes(c);for(let a of u){let{geometry:o,index:s,sourceLayerIndex:l}=a;if(h&&this.addFeatureDashes(a,c),this.hasPattern){let i=oj("line",this.layers,a,this.zoom,this.pixelRatio,r);this.patternFeatures.push(i)}else this.addFeature(a,o,s,n,c.positions,r.availableImages,r.brightness,r.elevationFeatures);d.insert(i[s].feature,o,s,l,this.index)}!this.hasPattern&&this.hdExt&&this.hdExt.buildFrcSegments(this)}addConstantDashes(i){let r=!1;for(let n of this.layers){let a=n.paint.get("line-dasharray").value,o=n.layout.get("line-cap").value;if("constant"!==a.kind||"constant"!==o.kind)r=!0;else{let r=o.value,n=a.value;if(!n)continue;i.addDash(n,r)}}return r}addFeatureDashes(i,r){let n=this.zoom;for(let a of this.layers){let o,s,l=a.paint.get("line-dasharray").value,u=a.layout.get("line-cap").value;if("constant"!==l.kind||"constant"!==u.kind){if("constant"===l.kind){if(!(o=l.value))continue}else o=l.evaluate({zoom:n},i);s="constant"===u.kind?u.value:u.evaluate({zoom:n},i),r.addDash(o,s),i.patterns[a.id]=[r.getKey(o,s)]}}}update(i,r,n,a,o,s,l,u,c){this.programConfigurations.updatePaintArrays(i,r,o,n,a,s,l,c)}updateExpressions(i){this.programConfigurations.updateExpressions(i)}addFeatures(i,r,n,a,o,s){for(let o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,n,a,s,i.elevationFeatures);this.hdExt&&this.hdExt.buildFrcSegments(this)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=i.createVertexBuffer(this.layoutVertexArray2,lI)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=i.createVertexBuffer(this.patternVertexArray,lk)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=i.createVertexBuffer(this.zOffsetVertexArray,lE.members,!0)),!this.elevationIdColVertexBuffer&&this.elevationIdColVertexArray.length>0&&(this.elevationIdColVertexBuffer=i.createVertexBuffer(this.elevationIdColVertexArray,lS.members,!0)),!this.elevationGroundScaleVertexBuffer&&this.elevationGroundScaleVertexArray.length>0&&(this.elevationGroundScaleVertexBuffer=i.createVertexBuffer(this.elevationGroundScaleVertexArray,lA.members,!0)),this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,lC),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.elevationIdColVertexBuffer&&this.elevationIdColVertexBuffer.destroy(),this.elevationGroundScaleVertexBuffer&&this.elevationGroundScaleVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(i,r){let n,a;if(r&&r>0?(n=`mapbox_clip_start_${r}`,a=`mapbox_clip_end_${r}`):(n="mapbox_clip_start",a="mapbox_clip_end"),i.properties&&Object.hasOwn(i.properties,n)&&Object.hasOwn(i.properties,a))return{start:+i.properties[n],end:+i.properties[a]}}addFeature(i,r,n,a,o,s,l,u){let c=this.layers[0].layout,d=this.hdExt?this.hdExt.trackFeatureFrc(i.properties):null,h=this.indexArray.length,f=c.get("line-join").evaluate(i,{}),p=c.get("line-cap").evaluate(i,{}),m=c.get("line-miter-limit"),g=c.get("line-round-limit");this.lineClips=this.lineFeatureClips(i),this.lineFeature=i;let _=!(!i.properties||!Object.hasOwn(i.properties,"mapbox_line_metrics"))&&i.properties.mapbox_line_metrics;this.zOffsetValue=c.get("line-z-offset").value;let y=this.layers[0].paint,v=y.get("line-width").value;"constant"!==v.kind&&!1===v.isLineProgressConstant&&(this.variableWidthValue=v);let x=y.get("line-emissive-strength").value;if("constant"!==x.kind&&!1===x.isLineProgressConstant&&(this.variableEmissiveStrengthValue=x),this.isSeaLevelReference){let i=c.get("line-elevation-ground-scale").value;"constant"===i.kind&&0===i.value||(this.elevationGroundScaleValue=i)}
8if(null==this.hdExt||!this.hdExt.handleFeature(i,r,a,u,f,p,m,g,this))for(let n=0;n<r.length;n++)this.addLine(r[n],i,a,f,p,m,g,void 0,_&&n>0?n:null);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,n,o,s,a,l,void 0,this.worldview),this.hdExt&&this.hdExt.recordFeatureRange(this,h,this.indexArray.length,d)}fillNonElevatedRoadSegment(i){for(let r=i;r<this.layoutVertexArray.length;r++)this.zOffsetVertexArray.emplaceBack(0,0,0,0),this.showElevationIdDebug&&this.elevationIdColVertexArray.emplaceBack(0,0,0)}addLine(i,r,n,a,o,s,l,u,c){let d,h,f,p,m,g,_,y;this.distance=0,this.prevDistance=0,this.scaledDistance=0,this.totalDistance=0,this.totalFeatureLength=0,this.lineSoFar=0,this.currentVertex=void 0,this.lineClips=c?this.lineFeatureClips(r,c):this.lineClips;let v="none"===a;this.patternJoinNone=this.hasPattern&&v,this.currentLineJoinType=a,this.segmentStart=0,this.segmentStartf32=0,this.segmentPoints=[];let x=u&&u.progress.min>0,b=u&&u.progress.max<1;if(this.lineClips){let n={min:this.lineClips.start,max:this.lineClips.end},a=1;if(u){var w,T,E;let i=this.lineClips.end-this.lineClips.start;w=u.progress,T={min:0,max:1},E=n,n={min:tz(w.min,T,E),max:tz(w.max,T,E)},i>0&&(a=(n.max-n.min)/i)}let o=+r.properties.mapbox_clip_feature_len,s=+r.properties.mapbox_clip_seg_len;if(Number.isNaN(o)||Number.isNaN(s)){for(let r=0;r<i.length-1;r++)this.totalDistance+=i[r].dist(i[r+1]);let r=this.totalDistance/(n.max-n.min);this.totalFeatureLength=Number.isFinite(r)?r:0,this.lineClips.start=n.min,this.lineClips.end=n.max,this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}else this.totalFeatureLength=o,this.distance=s*a,this.lineClips.start=n.min,this.lineClips.end=n.max,this.maxLineLength=Math.max(this.maxLineLength,this.distance);this.lineClipsArray.push(this.lineClips),this.updateScaledDistance()}let S="Polygon"===l3[r.type],A=i.length;for(;A>=2&&i[A-1].equals(i[A-2]);)A--;let C=0;for(;C<A-1&&i[C].equals(i[C+1]);)C++;if(A<(S?3:2))return;"bevel"===a&&(s=1.05);let I=this.segments.prepareSegment(10*A,this.layoutVertexArray,this.indexArray);u&&u.prevDir&&(g=u.prevDir.perp()),u&&u.nextDir&&(_=u.nextDir.perp()),this.e1=this.e2=-1,S&&(d=i[A-2],m=i[C].sub(d)._unit()._perp());for(let r=C;r<A;r++){if((f=r===A-1?S?i[C+1]:void 0:i[r+1])&&i[r].equals(f))continue;m&&(p=m),d&&(h=d),d=i[r],y=this.evaluateLineProgressFeatures(h?h.dist(d):0),m=f?f.sub(d)._unit()._perp():p,p=p||m;let n=h&&f,u=n?a:S||v?"butt":o,c=p.x*m.x+p.y*m.y;if(v){let i=function(i){if(i.patternJoinNone){let r=i.segmentPoints.length/2,n=i.lineSoFar-i.segmentStart;for(let a=0;a<r;++a){let r=i.segmentPoints[2*a+1],o=Math.round(i.segmentPoints[2*a])+.5+.25*r;i.patternVertexArray.emplaceBack(o,n,i.segmentStart),i.patternVertexArray.emplaceBack(o,n,i.segmentStart)}i.segmentPoints.length=0}i.e1=i.e2=-1};if(n&&c<l6){this.updateDistance(h,d),this.addCurrentVertex(d,p,1,1,I,y),i(this),this.addCurrentVertex(d,m,-1,-1,I,y);continue}if(h){if(!f){this.updateDistance(h,d),this.addCurrentVertex(d,p,1,1,I,y),i(this);continue}u="miter"}}let w=p.add(m);0===w.x&&0===w.y||w._unit();let T=w.x*m.x+w.y*m.y,E=0!==T?1/T:1/0,k=2*Math.sqrt(2-2*T),R=T<l8&&h&&f,M=p.x*m.y-p.y*m.x>0,L=this.overscaling<=16?122880/(512*this.overscaling):0;if(n&&"round"===u){if(E<l)u="miter";else if(E<=2){let i=ue(d,-10,8202);u="offset"===this.elevationType&&(i||this.hasCrossSlope)?"miter":"fakeround"}}if("miter"===u&&E>s&&(u="bevel"),"bevel"===u&&(E>2&&(u="flipbevel"),E<s&&(u="miter")),h&&!("miter"===u&&R)&&this.updateDistance(h,d),"miter"===u)if(R){let i=d.dist(h);if(i>2*L){let r=d.sub(d.sub(h)._mult(L/i)._round());this.updateDistance(h,r),this.addCurrentVertex(r,p,0,0,I,y),h=r}this.updateDistance(h,d),w._mult(E),this.addCurrentVertex(d,w,0,0,I,y);let r=d.dist(f);if(r>2*L){let i=d.add(f.sub(d)._mult(L/r)._round());this.updateDistance(d,i),this.addCurrentVertex(i,m,0,0,I,y),d=i}}else w._mult(E),this.addCurrentVertex(d,w,0,0,I,y);else if("flipbevel"===u){if(E>100)w=m.mult(-1);else{let i=E*p.add(m).mag()/p.sub(m).mag();w._perp()._mult(i*(M?-1:1))}this.addCurrentVertex(d,w,0,0,I,y),this.addCurrentVertex(d,w.mult(-1),0,0,I,y)}
8else if("bevel"===u||"fakeround"===u){let i=d.dist(h),r=1;if("offset"===this.elevationType&&"bevel"===u&&"round"!==this.currentLineJoinType&&!this.patternJoinNone&&null!=y&&h&&f){let n=4*L;i<n&&(r=Math.max(0,i/n))}null!=y&&h&&this.addCurrentVertex(d,_||p,-r,-r,I,y);let n=i<=2*L&&"bevel"!==u,a=w.mult(M?1:-1);a._mult(E);let o=m.mult(M?-1:1),s=p.mult(M?-1:1),l=this.evaluateLineProgressFeatures(this.distance);if(null==y&&(this.addHalfVertex(d,a.x,a.y,!1,!M,0,I,l),n||this.addHalfVertex(d,a.x+2*s.x,a.y+2*s.y,!1,M,0,I,l)),"fakeround"===u){let i=Math.round(180*k/Math.PI/20);this.addHalfVertex(d,s.x,s.y,!1,M,0,I,l);for(let r=0;r<i;r++){let n=r/i;if(.5!==n){let i=n-.5;n+=n*i*(n-1)*((1.0904+c*(c*(3.55645-1.43519*c)-3.2452))*i*i+(.848013+c*(.215638*c-1.06021)))}let a=o.sub(s)._mult(n)._add(s)._unit();this.addHalfVertex(d,a.x,a.y,!1,M,0,I,l)}this.addHalfVertex(d,o.x,o.y,!1,M,0,I,l)}n||null!=y||this.addHalfVertex(d,a.x+2*o.x,a.y+2*o.y,!1,M,0,I,l),null!=y&&f&&this.addCurrentVertex(d,g||m,r,r,I,y)}else if("butt"===u)this.addCurrentVertex(d,w,0,0,I,y);else if("square"===u){if(!h){let i=x?0:-1;this.addCurrentVertex(d,w,i,i,I,y)}if(this.addCurrentVertex(d,w,0,0,I,y),h){let i=+!b;this.addCurrentVertex(d,w,i,i,I,y)}}else if("round"===u){if(h){let i=!n&&_?_:p;this.addCurrentVertex(d,i,0,0,I,y),!n&&b||this.addCurrentVertex(d,i,1,1,I,y,!0)}if(f){let i=!n&&g?g:m;!n&&x||this.addCurrentVertex(d,i,-1,-1,I,y,!0),this.addCurrentVertex(d,i,0,0,I,y)}}}}addVerticesTo(i,r,n,a,o,s,l,u,c,d){let h=(r.w-i.w)/this.tessellationStep|0,f=0,p=this.scaledDistance;if(h>1){this.lineSoFar=i.w;let n=(r.x-i.x)/h,a=(r.y-i.y)/h,o=(r.z-i.z)/h,s=(r.w-i.w)/h,l=r.x-i.x,u=r.y-i.y,p=Math.sqrt(l*l+u*u);if(0===p)return;let m=-u/p,g=l/p,_=-m,y=-g;for(let r=1;r<h;++r){i.x+=n,i.y+=a,i.z+=o,this.lineSoFar+=s,f+=s;let r=this.evaluateLineProgressFeatures(this.prevDistance+f);this.scaledDistance=(this.prevDistance+f)/this.totalDistance,this.addHalfVertex(i,m,g,d,!1,0,c,r),this.addHalfVertex(i,_,y,d,!0,0,c,r)}}this.lineSoFar=r.w,this.scaledDistance=p;let m=this.evaluateLineProgressFeatures(this.distance);this.addHalfVertex(r,n,a,d,!1,l,c,m),this.addHalfVertex(r,o,s,d,!0,-u,c,m)}evaluateLineProgressFeatures(i){if(!this.variableWidthValue&&!this.variableEmissiveStrengthValue&&"offset"!==this.elevationType)return null;this.evaluationGlobals.lineProgress=0,this.lineClips?this.evaluationGlobals.lineProgress=Math.min(1,(this.totalFeatureLength*this.lineClips.start+i)/this.totalFeatureLength):tb(`line-progress evaluation for ${this.layerIds[0]} requires enabling 'lineMetrics' for the source.`);let r=0;this.variableWidthValue&&"constant"!==this.variableWidthValue.kind&&(r=.5*(this.variableWidthValue.evaluate(this.evaluationGlobals,this.lineFeature)||0));let n=0;this.variableEmissiveStrengthValue&&"constant"!==this.variableEmissiveStrengthValue.kind&&(n=this.variableEmissiveStrengthValue.evaluate(this.evaluationGlobals,this.lineFeature)||0);let a=this.evaluateElevationGroundScale();return"offset"!==this.elevationType?{zOffset:0,variableWidth:r,elevationGroundScale:a,variableEmissiveStrength:n}:"constant"===this.zOffsetValue.kind?{zOffset:this.zOffsetValue.value,variableWidth:r,elevationGroundScale:a,variableEmissiveStrength:n}:{zOffset:this.zOffsetValue.evaluate(this.evaluationGlobals,this.lineFeature)||0,variableWidth:r,elevationGroundScale:a,variableEmissiveStrength:n}}evaluateElevationGroundScale(){return this.elevationGroundScaleValue?"constant"===this.elevationGroundScaleValue.kind?this.elevationGroundScaleValue.value:this.elevationGroundScaleValue.evaluate(this.evaluationGlobals,this.lineFeature)||0:0}addCurrentVertex(i,r,n,a,o,s,l=!1){let u=r.x+r.y*n,c=r.y-r.x*n,d=r.y*a-r.x,h=-r.y-r.x*a;if(null!=s){let r="offset"===this.elevationType,f="offset"===this.elevationType?2:10,p=-f,m=8192+f,g=s.zOffset,_=new l$(i.x,i.y,g,this.lineSoFar),y=!!r&&ue(i,p,m),v=this.lineSoFar,x=this.distance;if(this.currentVertex)if(y){let r=this.currentVertexIsOutside,s=this.currentVertex,f=new l$(i.x,i.y,g,this.lineSoFar);if(lY(s,f,p,m),!ue(f,p,m)){if(r){this.e1=this.e2=-1,this.distance-=s.dist(_),this.lineSoFar=s.w;let i=this.evaluateLineProgressFeatures(s.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(s,u,c,l,!1,n,o,i),this.addHalfVertex(s,d,h,l,!0,-a,o,i),this.prevDistance=this.distance}this.distance=this.prevDistance+s.dist(f),this.scaledDistance=this.distance/this.totalDistance,this.addVerticesTo(s,f,u,c,d,h,n,a,o,l),this.distance=x,this.scaledDistance=this.distance/this.totalDistance}}else{let i=this.currentVertex;if(this.currentVertexIsOutside){lY(i,_,p,m),this.e1=this.e2=-1,this.distance-=i.dist(_),this.scaledDistance=this.distance/this.totalDistance,this.lineS
8oFar=i.w;let r=this.evaluateLineProgressFeatures(i.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(i,u,c,l,!1,n,o,r),this.addHalfVertex(i,d,h,l,!0,-a,o,r),this.prevDistance=this.distance,this.distance=x,this.scaledDistance=this.distance/this.totalDistance}this.addVerticesTo(i,_,u,c,d,h,n,a,o,l)}else y||(this.addHalfVertex(i,u,c,l,!1,n,o,s),this.addHalfVertex(i,d,h,l,!0,-a,o,s));this.currentVertex=_,this.currentVertexIsOutside=y,this.lineSoFar=v}else this.addHalfVertex(i,u,c,l,!1,n,o,s),this.addHalfVertex(i,d,h,l,!0,-a,o,s)}addHalfVertex({x:i,y:r},n,a,o,s,l,u,c){if(this.patternJoinNone&&(0===this.segmentPoints.length&&(this.segmentStart=this.lineSoFar,this.segmentStartf32=Math.fround(this.lineSoFar)),s||this.segmentPoints.push(this.lineSoFar-this.segmentStart,l)),this.layoutVertexArray.emplaceBack((i<<1)+ +!!o,(r<<1)+ +!!s,Math.round(63*n)+128,Math.round(63*a)+128,1+(0===l?0:l<0?-1:1),0,this.lineSoFar-this.segmentStartf32),this.lineClips){let i=iw(this.lineClips.start,this.lineClips.end,this.scaledDistance);this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,i)}let d=u.vertexLength++;if(this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,d),u.primitiveLength++),s?this.e2=d:this.e1=d,null!=c&&(this.zOffsetVertexArray.emplaceBack(c.zOffset,c.variableWidth,c.variableWidth,c.variableEmissiveStrength),this.showElevationIdDebug&&this.elevationIdColVertexArray.emplaceBack(0,0,0)),this.elevationGroundScaleValue){let i=c?c.elevationGroundScale:this.evaluateElevationGroundScale();this.elevationGroundScaleVertexArray.emplaceBack(i)}}updateScaledDistance(){this.lineClips?(this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=this.totalFeatureLength*this.lineClips.start+this.distance):this.lineSoFar=this.distance}updateDistance(i,r){this.prevDistance=this.distance,this.distance+=i.dist(r),this.updateScaledDistance()}}function ue(i,r,n){return i.x<r||i.x>n||i.y<r||i.y>n}ar(l7,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});let ut=o6([{name:"a_pos",components:2,type:"Int16"}],4),ui=o6([{name:"a_circle_z_offset",components:1,type:"Float32"}],4),ur=o6([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class un{constructor(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(i=>i.fqid),this.index=i.index,this.hasPattern=!1,this.projection=i.projection,this.layoutVertexArray=new se,this.indexArray=new sw,this.segments=new s1,this.programConfigurations=new lg(i.layers,{zoom:i.zoom,lut:i.lut}),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.worldview=i.worldview,this.hasAppearances=null}updateFootprints(i,r){}updateAppearances(i,r,n,a){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(i,r,n,a){let o=this.layers[0],s=[],l=null;for(let{feature:u,id:c,index:d,sourceLayerIndex:h}of("circle"===o.type&&(l=o.layout.get("circle-sort-key")),i)){let i=this.layers[0]._featureFilter.needGeometry,o=o5(u,i);if(!this.layers[0]._featureFilter.filter(new aZ(this.zoom,{worldview:this.worldview,activeFloors:r.activeFloors}),o,n))continue;let f=l?l.evaluate(o,{},n):void 0,p={id:c,properties:u.properties,type:u.type,sourceLayerIndex:h,index:d,geometry:i?o.geometry:o2(u,n,a),patterns:{},sortKey:f};s.push(p)}l&&s.sort((i,r)=>i.sortKey-r.sortKey);let u=null;for(let o of("globe"===a.projection.name&&(this.globeExtVertexArray=new sh,u=a.projection),s)){let{geometry:a,index:s,sourceLayerIndex:l}=o,c=i[s].feature;this.addFeature(o,a,s,r.availableImages,n,u,r.brightness,r.elevationFeatures),r.featureIndex.insert(c,a,s,l,this.index)}this.hdExt&&this.hdExt.finalize()}update(i,r,n,a,o,s,l){this.programConfigurations.updatePaintArrays(i,r,o,n,a,s,l,this.worldview)}updateExpressions(i){this.programConfigurations.updateExpressions(i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,ut.members),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=i.createVertexBuffer(this.globeExtVertexArray,ur.members)),this.hdExt&&this.hdExt.upload(i)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.hdExt&&this.hdExt.destroy())}addFeature(i,r,n,a,o,s,l,u){for(let n of(this.hdExt&&this.hdExt.beginFeature(i,u),r))for(let r of n){let n=r.x,a=r.y;if(n<0||n>=8192||a<0||a>=8192)continue;if(s){let i=s.projectTilePoint(n,a,o),r=s.upVector(o,n,a);this.addGlobeExtVertex(i,r),this.addGlobeExtVertex(i,r),this.addGlobeExtVertex(i,r),this.addGlobeExtVertex(i,r)}let l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,i.sortKey),u=l.vertexLength;this.addCircleVertex(n,a,-1,-1),this.addCircleVertex(n,a,1,-1),this.addCircleVertex(n,a,1,1),this.addCircleVertex(n,a,-1,1),this.hdExt&&this.hdExt.writeVertexQuad(n,a),this.indexArray.emplaceBack(u,u+1,u+2),this.indexArray.emplaceBack(u,u+2,u+3),l.vertexLength+=4,l.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,n,{},a,o,l,void 0,this.worldview)}addCircleVertex(i,r,n,a){this.layoutVertexArray.emplaceBack(2*i+(n+1)/2,2*r+(a+1)/2)}addGlobeExtVertex(i,r){this.globeExtVertexArray.emplaceBack(i.x,i.y,i.z,16384*r[0],16384*r[1],16384*r[2])}}ar(un,"CircleBucket",{omit:["layers"]});let ua=o6([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),uo=o6([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),us=o6([{name:"a_projected_pos",components:4,type:"Float32"}],4);o6([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let ul=o6([{name:"a_auto_z_offset",components:1,type:"Float32"}],4),uu=o6([{name:"a_feature_index",components:1,type:"Float32"}],4),uc=o6([{name:"a_x_axis",components:3,type:"Float32"},{name:"a_y_axis",components:3,type:"Float32"}]),ud=o6([{name:"a_texb",components:2,type:"Uint16"}]),uh=o6([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_elevation_from_sea",components:2,type:"Float32"}]),uf=o6([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_auto_z_offset",components:1,type:"Float32"}]);o6([{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"}]);let up=o6([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),um=o6([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);o6([{name:"triangle",components:3,type:"Uint16"}]),o6([{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"}]),o6([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{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"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"},{type:"Uint16",name:"elevationFeatureIndex"}
8]),o6([{type:"Float32",name:"offsetX"}]),o6([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);let ug=class i{static getBlockIndices(r){let n=i._blockIndicesTemplate;if(!n){n=i._blockIndicesTemplate=new Uint32Array(r);for(let i=0;i<r;i++)n[i]=i}return n}constructor(i,r,n,a){this.batchIndex=r,this.headerBuffer=null,this.propertiesBuffer=null,this.blockIndicesBuffer=null,this.context=i||null,this.propsDwords=n,this.totalBytes=4*this.propsDwords,this.headerData=a,this.propertiesData=new Float32Array(this.propsDwords),this._headerDirty=!0,this._propsDirtyMin=-1,this._propsDirtyMax=-1,this._blockIndicesDirty=!0,i&&this._initBuffers(i)}_initBuffers(r){let n=r.gl;if(this.totalBytes>r.maxUniformBlockSize)throw Error(`UBO size ${this.totalBytes} exceeds device limit ${r.maxUniformBlockSize}`);if(this.headerBuffer=n.createBuffer(),!this.headerBuffer)throw Error("Failed to create header UBO buffer");if(n.bindBuffer(n.UNIFORM_BUFFER,this.headerBuffer),n.bufferData(n.UNIFORM_BUFFER,i.HEADER_BYTES,n.DYNAMIC_DRAW),this.propertiesBuffer=n.createBuffer(),!this.propertiesBuffer)throw Error("Failed to create properties UBO buffer");if(n.bindBuffer(n.UNIFORM_BUFFER,this.propertiesBuffer),n.bufferData(n.UNIFORM_BUFFER,this.totalBytes,n.DYNAMIC_DRAW),this.blockIndicesBuffer=n.createBuffer(),!this.blockIndicesBuffer)throw Error("Failed to create block-indices UBO buffer");n.bindBuffer(n.UNIFORM_BUFFER,this.blockIndicesBuffer),n.bufferData(n.UNIFORM_BUFFER,this.totalBytes,n.DYNAMIC_DRAW),n.bindBuffer(n.UNIFORM_BUFFER,null)}writeDataDrivenBlock(r,n){let a=this.headerData,o=4*a[2];if(0===o)return;let s=n*o;if(s+o>this.propertiesData.length)throw Error(`UBO write out of bounds: feature index ${n} exceeds propertiesData capacity`);let l=a[0],u=a[1];for(let n=0;n<9;n++)l&1<<n&&this._copyFromFlat(s+a[3+n],n,r,i.EVAL_FLAT_OFFSETS[n],u);(-1===this._propsDirtyMin||s<this._propsDirtyMin)&&(this._propsDirtyMin=s);let c=s+o;c>this._propsDirtyMax&&(this._propsDirtyMax=c)}rightSizeForTransfer(){let i=-1===this._propsDirtyMax?0:this._propsDirtyMax;i<this.propertiesData.length&&(this.propertiesData=this.propertiesData.slice(0,i))}_copyFromFlat(i,r,n,a,o){let s=8===r,l=!!(o&1<<r),u=r<2||s&&l?4:s||l?2:1;for(let r=0;r<u;r++)this.propertiesData[i+r]=n[a+r]}upload(r){this.context||(this.context=r);let n=r.gl;this.headerBuffer&&this.propertiesBuffer&&this.blockIndicesBuffer||this._initBuffers(r);let a=!1;if(this._headerDirty&&(n.bindBuffer(n.UNIFORM_BUFFER,this.headerBuffer),n.bufferSubData(n.UNIFORM_BUFFER,0,this.headerData),this._headerDirty=!1,a=!0),-1!==this._propsDirtyMin){let i=this._propsDirtyMin,r=this._propsDirtyMax;n.bindBuffer(n.UNIFORM_BUFFER,this.propertiesBuffer),n.bufferSubData(n.UNIFORM_BUFFER,4*i,this.propertiesData,i,r-i),this._propsDirtyMin=-1,this._propsDirtyMax=-1,a=!0}this._blockIndicesDirty&&(n.bindBuffer(n.UNIFORM_BUFFER,this.blockIndicesBuffer),n.bufferSubData(n.UNIFORM_BUFFER,0,i.getBlockIndices(this.propsDwords)),this._blockIndicesDirty=!1,a=!0),a&&n.bindBuffer(n.UNIFORM_BUFFER,null)}bind(i,r){let n=i.gl,a=(i,a,o)=>{if(!a)return;let s=n.getUniformBlockIndex(r,i);s!==n.INVALID_INDEX&&(n.uniformBlockBinding(r,s,o),n.bindBufferBase(n.UNIFORM_BUFFER,o,a))},o=3*this.batchIndex;a("SymbolPaintPropertiesHeaderUniform",this.headerBuffer,o),a("SymbolPaintPropertiesUniform",this.propertiesBuffer,o+1),a("SymbolPaintPropertiesIndexUniform",this.blockIndicesBuffer,o+2)}destroy(){if(this.context){let i=this.context.gl;this.headerBuffer&&(i.deleteBuffer(this.headerBuffer),this.headerBuffer=null),this.propertiesBuffer&&(i.deleteBuffer(this.propertiesBuffer),this.propertiesBuffer=null),this.blockIndicesBuffer&&(i.deleteBuffer(this.blockIndicesBuffer),this.blockIndicesBuffer=null)}}};function u_(i,r,n,a,o,s,l,u){return!!i&&("constant"===i.kind?"none"===i.value:"none"===i.evaluate({zoom:0,brightness:s,worldview:u},r,n,o,a,l))}function uy(i){if(!(i instanceof a2))return!1;let r=i.value;return("source"===r.kind||"composite"===r.kind)&&r.isStateDependent}ug.HEADER_DWORDS=12,ug.HEADER_BYTES=48,ug.EVAL_FLAT_OFFSETS=[0,4,8,10,12,14,16,18,20],ug.EVAL_FLAT_TOTAL=24,ug._blockIndicesTemplate=null,ar(ug,"SymbolPropertiesUBO",{omit:["headerBuffer","propertiesBuffer","blockIndicesBuffer"]});let uv=["icon","text"].map(i=>[`${i}-color`,`${i}-halo-color`,`${i}-opacity`,`${i}-halo-width`,`${i}-halo-blur`,`${i}-emissive-strength`,`${i}-occlusion-opacity`,"symbol-z-offset",`${i}-translate`]),ux=new Float32Array(ug.EVAL_FLAT_TOTAL),ub=[0,0];class uw{constructor(i,r,n,a,o="",s,l){this.layer=i,this.zoom=r,this.lut=n,this.isText=a,this.worldview=o,this.maxUniformBufferBindings=s||24,this.uboSizeDwords=l||4096,this.allFeatureVtIndices=[],this.allFeatureIds=[],this.featureVertexRangesFromId=null,this.featureVertexRangesFromVtIndex=null,this.ubos=[],this.featureCount=0,this.cachedConstantUniforms=null,this.cachedConstantRenderZoom=null,this.cachedConstantBrightness=void 0,this.activeAppearanceByVtIndex=null,this.sharedZoomRanges=new Float32Array(18),this.header=new Uint32Array(ug.HEADER_DWORDS),this.updateHeader(),this.isAllConstant=0===this.header[0];const u=4*this.header[2];this.maxFeaturesPerBatch=0===u?Number.MAX_SAFE_INTEGER:Math.floor(this.uboSizeDwords/u)}updateHeader(){let i=this.layer.paint,r=0,n=0,a=0,o=0,s=!0,l=uv[+this.isText];for(let u=0;u<9;u++){let c=l[u],d=u<2,h=8===u,f=i.get(c),p=!(!f||"function"!=typeof f.isConstant||f.isConstant()),m=this._appearancesHavePaintProperties(c),g=!(!f||!f.value||"composite"!==f.value.kind);if(!p&&!m){let i=this.layer._transitionablePaint._values[c];"camera"===(i&&i.value&&i.value.expression&&i.value.expression.kind)&&(a|=1<<u);continue}r|=1<<u,g&&(n|=1<<u);let _=f&&f.value;_&&!1===_.isLightConstant&&(s=!1);let y=d||h&&g,v=y?4:h||g?2:1;y&&o%4!=0?o=o+3&-4:h&&o%4==3&&o++,this.header[3+u]=o,o+=v,g&&f&&this._computeZoomRange(f,Math.floor(this.zoom),2*u)}let u=0===o?0:o+3&-4;this.header[0]=r,this.header[1]=n,this.header[2]=u/4,this.isLightConstant=s,this.cameraMask=a}evaluateAllProperties(i,r,n,a,o,s,l){let u={brightness:o,worldview:this.worldview},c={feature:i,featureState:r,canonical:n,availableImages:a,params:new aZ(this.zoom,u),paramsNext:new aZ(this.zoom+1,u),formattedSection:s,activeAppearance:l},d=this.header,h=uv[+this.isText];for(let i=0;i<9;i++){let r=h[i],n=8===i,a=!!(d[1]&1<<i),o=ug.EVAL_FLAT_OFFSETS[i];i<2?this._evaluateColorValue(r,a,c,o):n?this._evaluateTranslateValue(r,a,c,o):this._evaluateFloatValue(r,a,c,o)}return ux}_resolveProp(i,r){return r&&r.hasPaintProperty(i)?r.paintProperties.get(i):this.layer.paint.get(i)}_evalAt(i,r,n){return i.property.evaluate(i.value,r,n.feature,n.featureState,n.canonical,n.availableImages,i.iconImageUseTheme,n.formattedSection)}_evaluateColorValue(i,r,n,a){let o=this._resolveProp(i,n.activeAppearance);if(!o)return ux[a]=0,ux[a+1]=0,ux[a+2]=0,void(ux[a+3]=1);let s=this._resolveProp(`${i}-use-theme`,n.activeAppearance),l=u_(s&&"string"!=typeof s?s.value:void 0,n.feature,n.featureState,n.availableImages,n.canonical,n.params.brightness,n.formattedSection,this.worldview)?null:this.lut,u=(o.isConstant()?o.constantOr(iE.transparent):this._evalAt(o,n.params,n)||iE.transparent).toNonPremultipliedRenderColor(l);
8if(ux[a]=s0(255*u.r,255*u.g),ux[a+1]=s0(255*u.b,255*u.a),r){let i=(this._evalAt(o,n.paramsNext,n)||iE.transparent).toNonPremultipliedRenderColor(l);ux[a+2]=s0(255*i.r,255*i.g),ux[a+3]=s0(255*i.b,255*i.a)}else ux[a+2]=0,ux[a+3]=0}_computeZoomRange(i,r,n){let a=0,o=1,s=i&&i.value,l=s&&"composite"===s.kind?s.zoomStops:null;if(l&&l.length>0)if(null==s.interpolationType){for(let i of(a=o=1,l))if(i>r&&i<r+1){a=o=i-r;break}}else l[0]>r&&l[0]<r+1&&(a=l[0]-r);this.sharedZoomRanges[n]=a,this.sharedZoomRanges[n+1]=o}_evaluateFloatValue(i,r,n,a){let o=+!!i.endsWith("opacity"),s=this._resolveProp(i,n.activeAppearance),l=s?s.isConstant()?s.constantOr(o):this._evalAt(s,n.params,n):o;if(ux[a]=null!=l?l:o,r){let i=this._evalAt(s,n.paramsNext,n);ux[a+1]=null!=i?i:o}else ux[a+1]=0}_evaluateTranslateValue(i,r,n,a){let o=this._resolveProp(i,n.activeAppearance),s=o?"function"!=typeof o.isConstant?o:o.isConstant()?o.constantOr(ub):this._evalAt(o,n.params,n):void 0;if(ux[a]=s?s[0]:0,ux[a+1]=s?s[1]:0,r){let i=this._evalAt(o,n.paramsNext,n);ux[a+2]=i?i[0]:0,ux[a+3]=i?i[1]:0}else ux[a+2]=0,ux[a+3]=0}_appearancesHavePaintProperties(i){return this.layer.getAppearances().some(r=>r.hasPaintProperty(i))}hasStateDependentPaint(i){let r=i.paint,n=uv[+this.isText];for(let i of n)if(uy(r.get(i)))return!0;for(let r of i.getAppearances()||[])for(let i of n)if(r.hasPaintProperty(i)&&uy(r.paintProperties.get(i)))return!0;return!1}hasPerFeatureTranslate(){return!!(256&this.header[0])}getCurrentBatchIndex(){return 0===this.maxFeaturesPerBatch?0:Math.floor(this.featureCount/this.maxFeaturesPerBatch)}_writeFeatureBlock(i,r){let n=this.isAllConstant?0:i,a=Math.floor(n/this.maxFeaturesPerBatch),o=n%this.maxFeaturesPerBatch;this._batchExceedsDeviceLimit(a)&&(a=0,o=0);let s=this.ubos[a];return!!s&&(s.writeDataDrivenBlock(r,o),!0)}_batchExceedsDeviceLimit(i){return 3*i+2>=this.maxUniformBufferBindings}_reevaluateAt(i,r,n,a,o,s){if(!r)return;let l=this.allFeatureVtIndices[i],u=r.feature(l);if(!u)return;let c=this.allFeatureIds[i],d=null!=c&&o[c]||{},h={type:u.type,id:c,properties:u.properties||{},geometry:[]},f=this.activeAppearanceByVtIndex?this.activeAppearanceByVtIndex.get(l):void 0,p=this.evaluateAllProperties(h,d,n,a,s,void 0,f);this._writeFeatureBlock(i,p)}_ensureRangeMaps(){if(!this.featureVertexRangesFromId){this.featureVertexRangesFromId=new Map,this.featureVertexRangesFromVtIndex=new Map;for(let i=0;i<this.allFeatureVtIndices.length;i++){let r=this.allFeatureIds[i];if(null!=r){let n=this.featureVertexRangesFromId.get(r);n||this.featureVertexRangesFromId.set(r,n=[]),n.push(i)}let n=this.allFeatureVtIndices[i],a=this.featureVertexRangesFromVtIndex.get(n);a||this.featureVertexRangesFromVtIndex.set(n,a=[]),a.push(i)}}}populateUBO(i,r,n,a,o,s){let l,u,c=i.id,d=this.header,h=this.evaluateAllProperties(i,{},n,a,o,s);this.isAllConstant?(l=0,(u=0===this.featureCount)&&(this.featureCount=1)):(l=this.featureCount++,u=!0);let f=Math.floor(l/this.maxFeaturesPerBatch),p=l%this.maxFeaturesPerBatch;return u&&(this._batchExceedsDeviceLimit(f)?(tb(`Too many symbol features: batch ${f} requires binding points up to ${3*f+2}, device limit ${this.maxUniformBufferBindings}. Some features will render incorrectly.`),f=0,p=0):(this.ubos[f]||(this.ubos[f]=new ug(null,f,this.uboSizeDwords,d)),this.ubos[f].writeDataDrivenBlock(h,p))),this.allFeatureVtIndices.push(r),this.allFeatureIds.push(c),p}updateFeatures(i,r,n,a,o,s,l){for(let u of(this.layer=r,this.cachedConstantUniforms=null,this._ensureRangeMaps(),i)){let i=this.featureVertexRangesFromId.get(u);if(i)for(let r of i)this._reevaluateAt(r,n,a,o,s,l)}}updateDynamicExpressions(i,r,n,a,o,s){if(this.layer=i,this.cachedConstantUniforms=null,0!==this.header[0])for(let i=0;i<this.allFeatureVtIndices.length;i++)this._reevaluateAt(i,r,n,a,o,s)}updateFeaturePaintForAppearance(i,r,n,a,o,s,l){if(!this.layer||(this.activeAppearanceByVtIndex||(this.activeAppearanceByVtIndex=new Map),this.activeAppearanceByVtIndex.set(i,l||null),0===this.header[0]))return!1;this._ensureRangeMaps();let u=this.featureVertexRangesFromVtIndex.get(i);if(!u)return!1;let c=this.evaluateAllProperties(r,n,a,o,s,void 0,l),d=!1;for(let i of u)d=this._writeFeatureBlock(i,c)||d;return d}getConstantUniformValues(i,r){let n=this.header,a=!!this.cameraMask,o=!!n[1];if(this.cachedConstantUniforms&&this.cachedConstantBrightness===r&&(!a&&!o||this.cachedConstantRenderZoom===i))return this.cachedConstantUniforms;let s=this.layer.paint,l=a?new aZ(i,{brightness:r,worldview:this.worldview}):null,u={type:1,id:void 0,properties:{},geometry:[]},c=uv[+this.isText],d=i=>{let n=c[i],a=s.get(n);if(!a)return[0,0,0,1];let o=s.get(`${n}-use-theme`),d=u_(o&&"string"!=typeof o?o.value:void 0,u,{},[],void 0,r,void 0,this.worldview)?null:this.lut;return(this.cameraMask&1<<i&&l?a.property.evaluate(a.value,l,u,{},void 0,[])||iE.transparent:a.constantOr(iE.transparent)).toNonPremultipliedRenderColor(d).toArray01()},h=(i,r)=>{let n=s.get(c[i]);if(!n)return r;if(this.cameraMask&1<<i&&l){let i=n.property.evaluate(n.value,l,u,{},void 0,[]);return null!=i?i:r}return n.constantOr(r)},f=new Float32Array(9);if(o){let r=i-Math.floor(i);for(let i=0;i<9;i++){if(!(n[1]&1<<i))continue;let a=this.sharedZoomRanges[2*i],o=this.sharedZoomRanges[2*i+1];f[i]=a===o?+(r>=a):Math.max(0,Math.min(1,(r-a)/(o-a)))}}let p={fill_np_color:d(0),halo_np_color:d(1),opacity:h(2,1),halo_width:h(3,0),halo_blur:h(4,0),emissive_strength:h(5,0),occlusion_opacity:h(6,1),z_offset:h(7,0),zoomFactors:f};return this.cachedConstantUniforms=p,this.cachedConstantRenderZoom=i,this.cachedConstantBrightness=r,p}finalize(){for(let i of this.ubos)i.rightSizeForTransfer()}upload(i){for(let r of this.ubos)r.upload(i)}bind(i,r,n=0){this.ubos[n]&&this.ubos[n].bind(i,r)}destroy(){for(let i of this.ubos)i.destroy();this.ubos=[],this.featureVertexRangesFromId=null,this.featureVertexRangesFromVtIndex=null,this.allFeatureVtIndices=[],this.allFeatureIds=[],this.featureCount=0,this.maxFeaturesPerBatch=0}}ar(uw,"SymbolPropertyBinderUBO",{omit:["layer","cachedConstantUniforms","cachedConstantRenderZoom","cachedConstantBrightness","activeAppearanceByVtIndex","featureVertexRangesFromId","featureVertexRangesFromVtIndex"]});let uT={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"},uE="u"<typeof TextDecoder?null:new TextDecoder("utf-8");class uS{constructor(i){this.buf=ArrayBuffer.isView(i)?i:new Uint8Array(i),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(i,r,n=this.length){let a;for(;a=this.nextField(n);)i(a,r,this);return r}readMessage(i,r){return this.readFields(i,r,this.readVarint()+this.pos)}readFixed32(){let i=this.dataView.getUint32(this.pos,!0);return this.pos+=4,i}readSFixed32(){let i=this.dataView.getInt32(this.pos,!0);return this.pos+=4,i}readFixed64(){let i=this.dataView.getUint32(this.pos,!0)+0x100000000*this.dataView.getUint32(this.pos+4,!0);return this.pos+=8,i}readSFixed64(){let i=this.dataView.getUint32(this.pos,!0)+0x100000000*this.dataView.getInt32(this.pos+4,!0);return this.pos+=8,i}readFloat(){let i=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,i}readDouble(){let i=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,i}readVarint(i){let r=this.buf,n=r[this.pos++];if(n<128)return n;let a,o=127&n;return o|=(127&(a=r[this.pos++]))<<7,a<128?o:(o|=(127&(a=r[this.pos++]))<<14,a<128?o:(o|=(127&(a=r[this.pos++]))<<21,a<128?o:function(i,r,n){let a,o,s=n.buf;if(a=(112&(o=s[n.pos++]))>>4,o<128||(a|=(127&(o=s[n.pos++]))<<3,o<128)||(a|=(127&(o=s[n.pos++]))<<10,o<128)||(a|=(127&(o=s[n.pos++]))<<17,o<128)||(a|=(127&(o=s[n.pos++]))<<24,o<128)||(a|=(1&(o=s[n.pos++]))<<31,o<128))return function(i,r,n){return n?0x100000000*r+(i>>>0):0x100000000*(r>>>0)+(i>>>0)}(i,a,r);throw Error("Expected varint not more than 10 bytes")}(o|=(15&(a=r[this.pos]))<<28,i,this)))}readSVarint(){let i=this.readVarint();return i%2==1?-((i+1)/2):i/2}readBoolean(){return!!this.readVarint()}readString(){let i=this.readVarint()+this.pos,r=this.pos;return this.pos=i,i-r>=12&&uE?uE.decode(this.buf.subarray(r,i)):function(i,r,n){let a="",o=r;for(;o<n;){let r=i[o],s,l,u,c=null,d=r>239?4:r>223?3:r>191?2:1;if(o+d>n)break;1===d?r<128&&(c=r):2===d?128==(192&(s=i[o+1]))&&(c=(31&r)<<6|63&s)<=127&&(c=null):3===d?(s=i[o+1],l=i[o+2],128==(192&s)&&128==(192&l)&&((c=(15&r)<<12|(63&s)<<6|63&l)<=2047||c>=55296&&c<=57343)&&(c=null)):4===d&&(s=i[o+1],l=i[o+2],u=i[o+3],128==(192&s)&&128==(192&l)&&128==(192&u)&&((c=(15&r)<<18|(63&s)<<12|(63&l)<<6|63&u)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,d=1):c>65535&&(c-=65536,a+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),a+=String.fromCharCode(c),o+=d}return a}(this.buf,r,i)}readBytes(){let i=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,i);return this.pos=i,r}readPackedVarint(i=[],r){let n=this.readPackedEnd();for(;this.pos<n;)i.push(this.readVarint(r));return i}readPackedSVarint(i=[]){let r=this.readPackedEnd();for(;this.pos<r;)i.push(this.readSVarint());return i}readPackedBoolean(i=[]){let r=this.readPackedEnd();for(;this.pos<r;)i.push(this.readBoolean());return i}readPackedFloat(i=[]){let r=this.readPackedEnd();for(;this.pos<r;)i.push(this.readFloat());return i}readPackedDouble(i=[]){let r=this.readPackedEnd();for(;this.pos<r;)i.push(this.readDouble());return i}readPackedFixed32(i=[]){let r=this.readPackedEnd();for(;this.pos<r;)i.push(this.readFixed32());return i}readPackedSFixed32(i=[]){let r=this.readPackedEnd();for(;this.pos<r;)i.push(this.readSFixed32());return i}readPackedFixed64(i=[]){let r=this.readPackedEnd();for(;this.pos<r;)i.push(this.readFixed64());return i}readPackedSFixed64(i=[]){let r=this.readPackedEnd();for(;this.pos<r;)i.push(this.readSFixed64());return i}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}nextField(i=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=i)return 0;let r=this.readVarint();return this.type=7&r,this._valueStart=this.pos,r>>>3}skip(i){let r=7&i;if(0===r)for(;this.buf[this.pos++]>127;);else if(2===r)this.pos=this.readVarint()+this.pos;else if(5===r)this.pos+=4;else{if(1!==r)throw Error(`Unimplemented type: ${r}`);this.pos+=8}}}function uA(i,r,n){let a=r<=16383?1:r<=2097151?2:r<=0xfffffff?3:Math.floor(Math.log(r)/(7*Math.LN2));n.realloc(a),n.buf.copyWithin(i+a,i,n.pos)}function uC(i,r){for(let n=0;n<i.length;n++)r.writeVarint(i[n])}function uI(i,r){for(let n=0;n<i.length;n++)r.writeSVarint(i[n])}function uk(i,r){for(let n=0;n<i.length;n++)r.writeFloat(i[n])}function uR(i,r){for(let n=0;n<i.length;n++)r.writeDouble(i[n])}function uM(i,r){for(let n=0;n<i.length;n++)r.writeBoolean(i[n])}function uL(i,r){for(let n=0;n<i.length;n++)r.writeFixed32(i[n])}function uP(i,r){for(let n=0;n<i.length;n++)r.writeSFixed32(i[n])}function uO(i,r){for(let n=0;n<i.length;
8n++)r.writeFixed64(i[n])}function uD(i,r){for(let n=0;n<i.length;n++)r.writeSFixed64(i[n])}let uF={horizontal:1,vertical:2,horizontalOnly:3};class uN{constructor(){this.scale=1,this.fontStack="",this.image=null}static forText(i,r){let n=new uN;return n.scale=i||1,n.fontStack=r,n}static forImage(i){let r=new uN;return r.image=i,r}}class uj{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(i,r,n,a=1){let o=new uj;for(let s=0;s<i.sections.length;s++){let l=i.sections[s];l.image?o.addImageSection(l,n,a):o.addTextSection(l,r)}return o}length(){return this.text.length}getSection(i){return this.sections[this.sectionIndex[i]]}getSections(){return this.sections}getSectionIndex(i){return this.sectionIndex[i]}getCodePoint(i){return this.text.codePointAt(i)}verticalizePunctuation(i){this.text=function(i,r){let n="";for(let a=0;a<i.length;a++){let o=i.charCodeAt(a+1)||null,s=i.charCodeAt(a-1)||null;n+=!r&&(o&&aF(o)&&!uT[i[a+1]]||s&&aF(s)&&!uT[i[a-1]])||!uT[i[a]]?i[a]:uT[i[a]]}return n}(this.text,i)}trim(){let i=0;for(let r=0;r<this.text.length&&uB[this.text.charCodeAt(r)];r++)i++;let r=this.text.length;for(let n=this.text.length-1;n>=0&&n>=i&&uB[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(i,r),this.sectionIndex=this.sectionIndex.slice(i,r)}substring(i,r){let n=new uj;return n.text=this.text.substring(i,r),n.sectionIndex=this.sectionIndex.slice(i,r),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((i,r)=>Math.max(i,this.sections[r].scale),0)}addTextSection(i,r){this.text+=i.text,this.sections.push(uN.forText(i.scale,i.fontStack||r));let n=this.sections.length-1;for(let r=0;r<i.text.length;++r)this.sectionIndex.push(n)}addImageSection(i,r,n=1){let a=i.image?i.image.getPrimary():null;if(!a)return void tb("Can't add FormattedSection with an empty image.");a.scaleSelf(r*n);let o=this.getNextImageSectionCharCode();o?(this.text+=String.fromCodePoint(o),this.sections.push(uN.forImage(a)),this.sectionIndex.push(this.sections.length-1)):tb("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function uz(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_=1,y=1){let v=uj.fromFeature(i,o,_,y);f===uF.vertical&&v.verticalizePunctuation(p);let x=[],b=function(i,r,n,a,o,s,l=1){if(!i)return[];let u=[],c=function(i,r,n,a,o,s,l=1){let u=0;for(let n=0;n<i.length();n++){let c=i.getSection(n);u+=uV(i.getCodePoint(n),c,a,o,r,s,l)}return u/Math.max(1,Math.ceil(u/n))}(i,r,n,a,o,s,l),d=i.text.includes("​"),h=0;for(let n=0;n<i.length();n++){let f=i.getSection(n),p=i.getCodePoint(n);if(uB[p]||(h+=uV(p,f,a,o,r,s,l)),n<i.length()-1){let r=!(p<11904||!(a_(p)||ag(p)||aR(p)||aC(p)||ab(p)||ac(p)||ay(p)||af(p)||aw(p)||aT(p)||ax(p)||aP(p)||ap(p)||ah(p)||ad(p)||av(p)||am(p)||ak(p)||aS(p)||aE(p)));(uU[p]||r||f.image)&&u.push(uG(n+1,h,c,u,function(i,r,n){let a=0;return 10===i&&(a-=1e4),n&&(a+=150),40!==i&&65288!==i||(a+=50),41!==r&&65289!==r||(a+=50),a}(p,i.getCodePoint(n+1),r&&d),!1))}}return function i(r){return r?i(r.priorBreak).concat(r.index):[]}(uG(i.length(),h,c,u,0,!0))}(v,d,s,r,a,m,y),{processBidirectionalText:w,processStyledBidirectionalText:T}=aW;if(w&&1===v.sections.length)for(let i of w(v.toString(),b)){let r=new uj;r.text=i,r.sections=v.sections;for(let n=0;n<i.length;n++)r.sectionIndex.push(0);x.push(r)}else if(T)for(let i of T(v.text,v.sectionIndex,b)){let r=new uj;r.text=i[0],r.sectionIndex=i[1],r.sections=v.sections,x.push(r)}else x=function(i,r){let n=[],a=i.text,o=0;for(let a of r)n.push(i.substring(o,a)),o=a;return o<a.length&&n.push(i.substring(o,a.length)),n}(v,b);let E=[],S={positionedLines:E,text:v.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:f,iconsInText:!1,verticalizable:!1,hasBaseline:!1};if(function(i,r,n,a,o,s,l,u,c,d,h,f,p=1){let m=0,g=0,_=0,y="right"===u?1:.5*("left"!==u),v=!1;for(let i of o){for(let n of i.getSections()){if(n.image)continue;let i=r[n.fontStack];if(i&&!(v=void 0!==i.ascender&&void 0!==i.descender))break}if(!v)break}let x=0;for(let l of o){l.trim();let o=l.getMaxScale(),u=(o-1)*24,w={positionedGlyphs:[],lineOffset:0};i.positionedLines[x]=w;let T=w.positionedGlyphs,E=0;if(!l.length()){g+=s,++x;continue}let S=0,A=0;for(let s=0;s<l.length();s++){var b;let u=l.getSection(s),_=l.getSectionIndex(s),y=l.getCodePoint(s),x=u.scale,w=null,C=null,I=null,k=24,R=0,M=c;M===uF.vertical&&(12312===y||12313===y||12316===y||12540===y||12448===y)&&(M=uF.horizontal);
8let L=!(M===uF.horizontal||!h&&!aD(y)||h&&(uB[y]||as(b=y)||al(b)||au(b)||aI(b)||aL(b)));if(u.image){let r=a.get(u.image.toString());if(!r)continue;I=u.image,i.iconsInText=i.iconsInText||!0,C=r.paddedRect;let n=r.displaySize,s=n[0]*p,l=n[1]*p;x=24*x/f,w={width:s,height:l,left:0,top:-3,advance:L?l:s,localGlyph:!1},R=v?-w.height*x:24*o-17-l*x,k=w.advance;let c=(L?s:l)*x-24*o;c>0&&c>E&&(E=c)}else{let i=n[u.fontStack];if(!i)continue;i[y]&&(C=i[y]);let a=r[u.fontStack];if(!a)continue;let s=a.glyphs[y];if(!s)continue;if(w=s.metrics,k=24*(8203!==y),v){let i=void 0!==a.ascender?Math.abs(a.ascender):0,r=void 0!==a.descender?Math.abs(a.descender):0,n=(i+r)*x;S<n&&(S=n,A=(i-r)/2*x),R=-i*x}else R=(o-x)*24-17}L?(i.verticalizable=!0,T.push({glyph:y,image:I,x:m,y:g+R,vertical:L,scale:x,localGlyph:w.localGlyph,fontStack:u.fontStack,sectionIndex:_,metrics:w,rect:C}),m+=k*x+d):(T.push({glyph:y,image:I,x:m,y:g+R,vertical:L,scale:x,localGlyph:w.localGlyph,fontStack:u.fontStack,sectionIndex:_,metrics:w,rect:C}),m+=w.advance*x+d)}0!==T.length&&(_=Math.max(m-d,_),v?u$(T,y,E,A,s*o/2):u$(T,y,E,0,s/2)),m=0;let C=s*o+E;w.lineOffset=Math.max(E,u),g+=C,++x}let w=g,{horizontalAlign:T,verticalAlign:E}=uq(l);(function(i,r,n,a,o,s){let l=(r-n)*o,u=-s*a;for(let r of i)for(let i of r.positionedGlyphs)i.x+=l,i.y+=u})(i.positionedLines,y,T,E,_,w),i.top+=-E*w,i.bottom=i.top+w,i.left+=-T*_,i.right=i.left+_,i.hasBaseline=v}(S,r,n,a,x,l,u,c,f,d,p,g,y),!function(i){for(let r of i)if(0!==r.positionedGlyphs.length)return!1;return!0}(E))return S}let uB={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},uU={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function uV(i,r,n,a,o,s,l=1){if(r.image){let i=a.get(r.image.toString());return i?i.displaySize[0]*l*r.scale*24/s+o:0}{let a=n[r.fontStack],s=a&&a.glyphs[i];return s?s.metrics.advance*r.scale+o:0}}function uH(i,r,n,a){let o=Math.pow(i-r,2);return a?i<r?o/2:2*o:o+Math.abs(n)*n}
8function uG(i,r,n,a,o,s){let l=null,u=uH(r,n,o,s);for(let i of a){let a=uH(r-i.x,n,o,s)+i.badness;a<=u&&(l=i,u=a)}return{index:i,x:r,priorBreak:l,badness:u}}function uq(i){let r=.5,n=.5;switch(i){case"right":case"top-right":case"bottom-right":r=1;break;case"left":case"top-left":case"bottom-left":r=0}switch(i){case"bottom":case"bottom-right":case"bottom-left":n=1;break;case"top":case"top-right":case"top-left":n=0}return{horizontalAlign:r,verticalAlign:n}}function u$(i,r,n,a,o){if(!(r||n||a||o))return;let s=i.length-1,l=i[s],u=(l.x+l.metrics.advance*l.scale)*r;for(let r=0;r<=s;r++)i[r].x-=u,i[r].y+=n+a+o}function uW(i){return void 0!==i.imagePrimary&&void 0!==i.top&&void 0!==i.bottom&&void 0!==i.left&&void 0!==i.right}function uY(i,r,n,a){let{horizontalAlign:o,verticalAlign:s}=uq(a),l=n[0]-i.displaySize[0]*o,u=n[1]-i.displaySize[1]*s;return{imagePrimary:i,imageSecondary:r,top:u,bottom:u+i.displaySize[1],left:l,right:l+i.displaySize[0]}}function uZ(i,r,n,a,o,s){let l,u,c,d,h,f=i.imagePrimary;if(f.content){let i=f.content,r=f.pixelRatio||1;l=[i[0]/r,i[1]/r,f.displaySize[0]-i[2]/r,f.displaySize[1]-i[3]/r]}let p=r.left*s,m=r.right*s;"width"===n||"both"===n?(h=o[0]+p-a[3],c=o[0]+m+a[1]):c=(h=o[0]+(p+m-f.displaySize[0])/2)+f.displaySize[0];let g=r.top*s,_=r.bottom*s;return"height"===n||"both"===n?(u=o[1]+g-a[0],d=o[1]+_+a[2]):d=(u=o[1]+(g+_-f.displaySize[1])/2)+f.displaySize[1],{imagePrimary:f,imageSecondary:void 0,top:u,right:c,bottom:d,left:h,collisionPadding:l}}function uK(i){return!i.imagePrimary.stretchX}function uX(i){return!i.imagePrimary.stretchY}function uQ(i){return{width:i.right-i.left,height:i.bottom-i.top}}function uJ(i,r,n,a){let{expression:o}=r;if("constant"===o.kind)return{kind:"constant",layoutSize:o.evaluate(new aZ(i+1,{worldview:n}),void 0,void 0,void 0,a)};if("source"===o.kind)return{kind:"source"};{let{zoomStops:r,interpolationType:s}=o,l=0;for(;l<r.length&&r[l]<=i;)l++;let u=l=Math.max(0,l-1);for(;u<r.length&&r[u]<i+1;)u++;u=Math.min(r.length-1,u);let c=r[l],d=r[u];return"composite"===o.kind?{kind:"composite",minZoom:c,maxZoom:d,interpolationType:s}:{kind:"camera",minZoom:c,maxZoom:d,minSize:o.evaluate(new aZ(c,{worldview:n}),void 0,void 0,void 0,a),maxSize:o.evaluate(new aZ(d,{worldview:n}),void 0,void 0,void 0,a),interpolationType:s}}}function u1(i,{uSize:r,uSizeT:n},{lowerSize:a,upperSize:o}){return"source"===i.kind?a/128:"composite"===i.kind?iw(a/128,o/128,n):r}function u0(i,r,n=1){let a=0,o=0;if("constant"===i.kind)o=i.layoutSize*n;else if("source"!==i.kind){let{interpolationType:s,minZoom:l,maxZoom:u}=i,c=s?ts(nh.interpolationFactor(s,r,l,u),0,1):0;"camera"===i.kind?o=iw(i.minSize,i.maxSize,c)*n:a=c*n}return{uSizeT:a,uSize:o}}class u2 extends eQ{constructor(i,r,n,a,o){super(i,r),this.angle=a,this.z=n,void 0!==o&&(this.segment=o)}clone(){return new u2(this.x,this.y,this.z,this.angle,this.segment)}}function u5(i,r,n,a,o){if(void 0===r.segment)return!0;let s=r,l=r.segment+1,u=0;for(;u>-n/2;){if(--l<0)return!1;u-=i[l].dist(s),s=i[l]}u+=i[l].dist(i[l+1]),l++;let c=[],d=0;for(;u<n/2;){let r=i[l],n=i[l+1];if(!n)return!1;let s=i[l-1].angleTo(r)-r.angleTo(n);for(s=Math.abs((s+3*Math.PI)%(2*Math.PI)-Math.PI),c.push({distance:u,angleDelta:s}),d+=s;u-c[0].distance>a;)d-=c.shift().angleDelta;if(d>o)return!1;l++,u+=r.dist(n)}return!0}function u4(i){let r=0;for(let n=0;n<i.length-1;n++)r+=i[n].dist(i[n+1]);return r}function u9(i,r){return Math.max(i?i.right-i.left:0,r?r.right-r.left:0)}function u3(i){let r=0,n=0;for(let a of i)r+=a.w*a.h,n=Math.max(n,a.w);i.sort((i,r)=>r.h-i.h);let a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(r/.95)),n),h:1/0}],o=0,s=0;for(let r of i)for(let i=a.length-1;i>=0;i--){let n=a[i];if(!(r.w>n.w||r.h>n.h)){if(r.x=n.x,r.y=n.y,s=Math.max(s,r.y+r.h),o=Math.max(o,r.x+r.w),r.w===n.w&&r.h===n.h){let r=a.pop();r&&i<a.length&&(a[i]=r)}else r.h===n.h?(n.x+=r.w,n.w-=r.w):(r.w===n.w||a.push({x:n.x+r.w,y:n.y,w:n.w-r.w,h:r.h}),n.y+=r.h,n.h-=r.h);break}}return{w:o,h:s,fill:r/(o*s)||0}}function u8(i,r){return i.id<r.id?-1:i.id>r.id?1:i.version<r.version?-1:i.version>r.version?1:i.sx<r.sx?-1:i.sx>r.sx?1:i.sy<r.sy?-1:+(i.sy>r.sy)}function u6(i){let r=0;for(let n=0;n<i.length;n++)r=(r<<5)-r+i.charCodeAt(n),r&=r;return r}function u7(i,r){return(i<<5)-i+r}function ce(i,r,n,a){for(let[o]of i.entries()){let i=a&&a.get(o)||iQ.parse(o),s=i.id.toString(),l=r.get(s)||0;n.push({id:o,version:l,sx:i.sx,sy:i.sy})}}ar(u2,"Anchor");class ct{constructor(i,r,n,a,o){this.iconDescriptors=[],this.patternDescriptors=[],this.requiresMipMaps=r.size>0,ce(i,n,this.iconDescriptors,o),ce(r,n,this.patternDescriptors,o),this.iconDescriptors.sort(u8),this.patternDescriptors.sort(u8);let s=0;const l=a?a.data:"";for(const i of(l&&(s=u7(s,u6(l))),s=u7(s,1),this.iconDescriptors))s=u7(s,u6(i.id)),s=u7(s,i.version),s=u7(s,i.sx),s=u7(s,i.sy);for(const i of(s=u7(s,1),this.patternDescriptors))s=u7(s,u6(i.id)),s=u7(s,i.version),s=u7(s,i.sx),s=u7(s,i.sy);this.hash=s}subsetOf(i){return this.isSubsetArray(this.iconDescriptors,i.iconDescriptors,u8)&&this.isSubsetArray(this.patternDescriptors,i.patternDescriptors,u8)}isSubsetArray(i,r,n){let a=0,o=0;if(i.length>r.length)return!1;for(;a<i.length&&o<r.length;){let s=n(i[a],r[o]);if(0===s)a++,o++;else{if(s<0)return!1;o++}}return a===i.length}}function ci(i){switch(i){case WebGL2RenderingContext.RGBA8:case WebGL2RenderingContext.RGBA16F:return WebGL2RenderingContext.RGBA;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.DEPTH_COMPONENT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.DEPTH_STENCIL;case WebGL2RenderingContext.R8:case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.RED}}function cr(i){switch(i){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.RGBA16F:return WebGL2RenderingContext.HALF_FLOAT;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.UNSIGNED_SHORT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.UNSIGNED_INT_24_8;case WebGL2RenderingContext.R8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.FLOAT}}ar(ct,"AtlasContentDescriptor");class cn{constructor(i,r,n,a){this.context=i,this.format=n,this.useMipmap=a&&a.useMipmap,this.texture=i.gl.createTexture(),this.update(r,{premultiply:a&&a.premultiply})}update(i,r){let n=i&&i instanceof HTMLVideoElement&&0===i.width?i.videoWidth:i.width,a=i&&i instanceof HTMLVideoElement&&0===i.height?i.videoHeight:i.height,{context:o}=this,{gl:s}=o,{x:l,y:u}=r&&r.position?r.position:{x:0,y:0},c=l+n,d=u+a;this.size&&(this.size[0]!==c||this.size[1]!==d)&&(!r||void 0===r.recreateWhenResize||r.recreateWhenResize)&&(s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(this.texture),this.texture=s.createTexture(),this.size=null),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA8&&(!r||!1!==r.premultiply));let h=i instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageData||ImageBitmap&&i instanceof ImageBitmap;if(!this.size&&c>0&&d>0){let i=this.useMipmap?Math.floor(Math.log2(Math.max(c,d)))+1:1;s.texStorage2D(s.TEXTURE_2D,i,this.format,c,d),this.size=[c,d]}this.size&&(h?s.texSubImage2D(s.TEXTURE_2D,0,l,u,ci(this.format),cr(this.format),i):"data"in i&&i.data&&s.texSubImage2D(s.TEXTURE_2D,0,l,u,n,a,ci(this.format),cr(this.format),i.data)),this.useMipmap&&s.generateMipmap(s.TEXTURE_2D)}bind(i,r,n=!1){let{context:a}=this,{gl:o}=a;
8o.bindTexture(o.TEXTURE_2D,this.texture),i!==this.minFilter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,i),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,this.useMipmap&&!n?i===o.NEAREST?o.NEAREST_MIPMAP_NEAREST:o.LINEAR_MIPMAP_LINEAR:i),this.minFilter=i),r!==this.wrapS&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,r),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,r),this.wrapS=r)}bindExtraParam(i,r,n,a,o){let{context:s}=this,{gl:l}=s;l.bindTexture(l.TEXTURE_2D,this.texture),r!==this.magFilter&&(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,r),this.magFilter=r),i!==this.minFilter&&(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,this.useMipmap?i===l.NEAREST?l.NEAREST_MIPMAP_NEAREST:l.LINEAR_MIPMAP_LINEAR:i),this.minFilter=i),n!==this.wrapS&&(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,n),this.wrapS=n),a!==this.wrapT&&(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,a),this.wrapT=a),o!==this.compareMode&&(o?(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_COMPARE_MODE,l.COMPARE_REF_TO_TEXTURE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_COMPARE_FUNC,o)):l.texParameteri(l.TEXTURE_2D,l.TEXTURE_COMPARE_MODE,l.NONE),this.compareMode=o)}destroy(){let{gl:i}=this.context;i.deleteTexture(this.texture),this.texture=null}}class ca{constructor(i,r){this.context=i,this.texture=r}bind(i,r){let{context:n}=this,{gl:a}=n;a.bindTexture(a.TEXTURE_2D,this.texture),i!==this.minFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,i),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,i),this.minFilter=i),r!==this.wrapS&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,r),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,r),this.wrapS=r)}}class co{static getImagePositionScale(i,r,n){if(r&&i){let{sx:r,sy:n}=i;return{x:r,y:n}}return{x:n,y:n}}constructor(i,r,n,a){this.paddedRect=i;const{pixelRatio:o,version:s,stretchX:l,stretchY:u,content:c,sdf:d,usvg:h}=r;this.pixelRatio=o,this.stretchX=l,this.stretchY=u,this.content=c,this.version=s,this.padding=n,this.sdf=d,this.usvg=h,this.scale=co.getImagePositionScale(a,h,o)}get tl(){return[this.paddedRect.x+this.padding,this.paddedRect.y+this.padding]}get br(){return[this.paddedRect.x+this.paddedRect.w-this.padding,this.paddedRect.y+this.paddedRect.h-this.padding]}get displaySize(){return[(this.paddedRect.w-2*this.padding)/this.scale.x,(this.paddedRect.h-2*this.padding)/this.scale.y]}}function cs(i,r,n){let a=iQ.parse(i),o=function(i,r,n=[1,1]){return{x:0,y:0,w:(i.data?i.data.width:i.width*n[0])+2*r,h:(i.data?i.data.height:i.height*n[1])+2*r}}(r,n,[a.sx,a.sy]);return{bin:o,imagePosition:new co(o,r,n,a),imageVariant:a}}function cl(i,r){let n=[];for(let[a,o]of i.entries()){let i=iQ.parse(a);i&&(n.push({key:a,value:o,variant:i}),r&&r.set(a,i))}n.sort((i,r)=>{let n=i.variant.id.toString().localeCompare(r.variant.id.toString());return 0!==n?n:i.variant.sx!==r.variant.sx?i.variant.sx-r.variant.sx:i.variant.sy!==r.variant.sy?i.variant.sy-r.variant.sy:0});let a=new Map;for(let i of n)a.set(i.key,i.value);return a}class cu{constructor(i){this.sourceAtlasHash=i}}class cc{constructor(i,r,n,a){const o=new Map,s=new Map;this.haveRenderCallbacks=[];const l=[],u=void 0!==a,c=u?new Map:void 0,d=u?cl(i,c):i,h=u?cl(r,c):r;this.addImages(d,o,1,l),this.addImages(h,s,2,l);const{w:f,h:p}=u3(l),m=new l0({width:f||1,height:p||1});for(const[i,r]of d.entries()){const n=o.get(i).paddedRect;l0.copy(r.data,m,{x:0,y:0},{x:n.x+1,y:n.y+1},r.data,null,r.sdf)}for(const[i,r]of h.entries()){const a=s.get(i),o=a.paddedRect;let l=a.padding;const u=o.x+l,c=o.y+l,d=r.data.width,h=r.data.height;l=l>1?l-1:l,l0.copy(r.data,m,{x:0,y:0},{x:u,y:c},r.data,n),l0.copy(r.data,m,{x:0,y:h-l},{x:u,y:c-l},{width:d,height:l},n),l0.copy(r.data,m,{x:0,y:0},{x:u,y:c+h},{width:d,height:l},n),l0.copy(r.data,m,{x:d-l,y:0},{x:u-l,y:c},{width:l,height:h},n),l0.copy(r.data,m,{x:0,y:0},{x:u+d,y:c},{width:l,height:h},n),l0.copy(r.data,m,{x:d-l,y:h-l},{x:u-l,y:c-l},{width:l,height:l},n),l0.copy(r.data,m,{x:0,y:h-l},{x:u+d,y:c-l},{width:l,height:l},n),l0.copy(r.data,m,{x:0,y:0},{x:u+d,y:c+h},{width:l,height:l},n),l0.copy(r.data,m,{x:d-l,y:0},{x:u-l,y:c+h},{width:l,height:l},n)}this.lut=n,this.image=m,this.iconPositions=o,this.patternPositions=s,u&&(this.contentDescriptor=new ct(d,h,a,n,c))}addImages(i,r,n,a){for(let[o,s]of i.entries()){let{bin:i,imagePosition:l,imageVariant:u}=cs(o,s,n);r.set(o,l),a.push(i),s.hasRenderCallback&&this.haveRenderCallbacks.push(u.id)}}patchUpdatedImages(i,r,n,a){for(let o of(this.haveRenderCallbacks=this.haveRenderCallbacks.filter(r=>i.hasImage(r,n)),i.dispatchRenderCallbacks(this.haveRenderCallbacks,n),i.getUpd
8atedImages(n))){for(let a of this.iconPositions.keys()){let s=iQ.parse(a);if(iy.isEqual(s.id,o)){let s=i.getImage(o,n);this.patchUpdatedImage(this.iconPositions.get(a),s,r,null)}}for(let s of this.patternPositions.keys()){let l=iQ.parse(s);if(iy.isEqual(l.id,o)){let l=i.getImage(o,n);this.patchUpdatedImage(this.patternPositions.get(s),l,r,a||this.lut)}}}}patchUpdatedImage(i,r,n,a=null){if(!i||!r||i.version===r.version)return;i.version=r.version;let[o,s]=i.tl,l=i.sdf;if(this.lut||l){let i={width:r.data.width,height:r.data.height},u=new l0(i);l0.copy(r.data,u,{x:0,y:0},{x:0,y:0},i,a,l),n.update(u,{position:{x:o,y:s},recreateWhenResize:!1})}else n.update(r.data,{position:{x:o,y:s},recreateWhenResize:!1})}}ar(co,"ImagePosition"),ar(cc,"ImageAtlas",{omit:["lut"]}),ar(cu,"ImageAtlasReference");class cd{constructor(i){this.pendingRequests=new Map,this.cachedRanges=new Map,this.fontstackCompositing=i&&i.fontstackCompositing||"client"}loadGlyphRange(i,r,n,a,o){if("server"===this.fontstackCompositing)return void cd.loadGlyphRange(i,r,n,a,o);let s=i.split(",").map(i=>i.trim()).filter(i=>i.length>0);0!==s.length?1!==s.length?this._loadMultipleFonts(s,r,n,a,o):this._loadFont(s[0],r,n,a,o):o(Error("Empty fontstack"))}_loadMultipleFonts(i,r,n,a,o){let s=i.map(()=>null),l={completed:0,firstError:null,callbackCalled:!1},u=(r,n,a)=>{if(!l.callbackCalled&&(n&&!l.firstError&&(l.firstError=n),a&&(s[r]=a),l.completed++,l.completed===i.length)){l.callbackCalled=!0;let i=s.filter(i=>null!==i);if(0===i.length)return void o(l.firstError||Error("All fonts failed to load"));o(null,this._composeGlyphs(i))}};for(let o=0;o<i.length;o++)this._loadFont(i[o],r,n,a,(i,r)=>{u(o,i,r)})}_loadFont(i,r,n,a,o){let s=`${i}:${r}`;if(this.cachedRanges.has(s)){let i=this.cachedRanges.get(s);return void tU.frame(()=>o(null,i))}let l=this.pendingRequests.get(s);l?l.push(o):(this.pendingRequests.set(s,[o]),cd.loadGlyphRange(i,r,n,a,(i,r)=>{i||this.cachedRanges.set(s,r||null);let n=this.pendingRequests.get(s);if(this.pendingRequests.delete(s),n)for(let a of n)a(i,r)}))}_composeGlyphs(i){let r,n,a={};for(let o of i)if(void 0===r&&void 0!==o.ascender&&(r=o.ascender),void 0===n&&void 0!==o.descender&&(n=o.descender),o.glyphs)for(let i in o.glyphs)void 0===a[i]&&(a[i]=o.glyphs[i]);return{glyphs:a,ascender:r,descender:n}}}cd.loadGlyphRange=function(i,r,n,a,o){let s=256*r;iu(a.transformRequest(a.normalizeGlyphsURL(n).replace("{fontstack}",i).replace("{range}",`${s}-${s+255}`),ie.Glyphs),(i,r)=>{if(i)o(i);else if(r){let i={},n=function(i){let r;var n=new uS(i);let a={glyphs:[]};for(;r=n.nextField();)1===r&&function(i,r,n){let a;for(;a=i.nextField(r);)3===a?n.glyphs.push(function(i,r){let n,a,o=0,s=0,l=0,u=0,c=0,d=0;for(;a=i.nextField(r);)1===a?o=i.readVarint():2===a?n=i.readBytes():3===a?s=i.readVarint():4===a?l=i.readVarint():5===a?u=i.readSVarint():6===a?c=i.readSVarint():7===a&&(d=i.readVarint());return{id:o,bitmap:new l1({width:s+6,height:l+6},n),metrics:{width:s,height:l,left:u,top:c,advance:d}}}(i,i.readVarint()+i.pos)):4===a?n.ascender=i.readSVarint():5===a&&(n.descender=i.readSVarint())}(n,n.readVarint()+n.pos,a);return a}(r);for(let r of n.glyphs)i[r.id]=r;o(null,{glyphs:i,ascender:n.ascender,descender:n.descender})}})};let ch=new Float64Array(256);for(let i=0;i<256;i++){let r=.5-Math.pow(i/255,1/2.2);ch[i]=r*Math.abs(r)}function cf(i,r,n,a,o,s,l,u,c){for(let d=r;d<r+a;d++)cp(i,n*s+d,s,o,l,u,c);for(let d=n;d<n+o;d++)cp(i,d*s+r,1,a,l,u,c)}function cp(i,r,n,a,o,s,l){s[0]=0,l[0]=-1e20,l[1]=1e20,o[0]=i[r];for(let u=1,c=0,d=0;u<a;u++){o[u]=i[r+u*n];let a=u*u;do{let i=s[c];d=(o[u]-o[i]+a-i*i)/(u-i)/2}while(d<=l[c]&&--c>-1)s[++c]=u,l[c]=d,l[c+1]=1e20}for(let u=0,c=0;u<a;u++){for(;l[c+1]<u;)c++;let a=s[c],d=u-a;i[r+u*n]=o[a]+d*d}}ch[255]=-1e20;let cm=/bold/i,cg=/medium/i,c_=/light/i,cy={none:0,ideographs:1,all:2};class cv{constructor(i,r,n,a){this.requestManager=i,this.localGlyphMode=r,this.localFontFamily=n,this.url="",this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}},this.glyphLoader=new cd({fontstackCompositing:a})}setURL(i){this.url=i}prefetchRange(i,r){let n=this.url||tV.GLYPHS_URL;if(!n)return;let a=this.entries[i];a||(a=this.entries[i]={glyphs:{},requests:{},ranges:{}}),a.ranges[r]||a.requests[r]||(a.requests[r]=[],this.glyphLoader.loadGlyphRange(i,r,n,this.requestManager,(i,n)=>{if(n){for(let i in a.ascender=n.ascender,a.descender=n.descender,n.glyphs)this._doesCharSupportLocalGlyph(+i)||(a.glyphs[+i]=n.glyphs[+i]);a.ranges[r]=!0}for(let o of a.requests[r]||[])o(i,n);delete a.requests[r]}))}getGlyphs(i,r){let n=[],a=this.url||tV.GLYPHS_URL;for(let r in i)for(let a of i[r])n.push({stack:r,id:a});tc(n,({stack:i,id:r},n)=>{let o=this.entries[i];o||(o=this.entries[i]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let s=o.glyphs[r];if(void 0!==s)return void n(null,{stack:i,id:r,glyph:s});if(s=this._tinySDF(o,i,r))return o.glyphs[r]=s,void n(null,{stack:i,id:r,glyph:s});let l=Math.floor(r/256);if(256*l>65535)return tb("glyphs > 65535 not supported"),void n(null,{stack:i,id:r,glyph:s});if(o.ranges[l])return void n(null,{stack:i,id:r,glyph:s});let u=o.requests[l];u||(u=o.requests[l]=[],this.glyphLoader.loadGlyphRange(i,l,a,this.requestManager,(i,r)=>{if(r){for(let i in o.ascender=r.ascender,o.descender=r.descender,r.glyphs)this._doesCharSupportLocalGlyph(+i)||(o.glyphs[+i]=r.glyphs[+i]);o.ranges[l]=!0}for(let n of u)n(i,r);delete o.requests[l]})),u.push((a,o)=>{a?n(a):o&&n(null,{stack:i,id:r,glyph:o.glyphs[r]||null})})},(i,n)=>{if(i)r(i);else if(n){let i={};for(let{stack:r,id:a,glyph:o}of n)void 0===i[r]&&(i[r]={}),void 0===i[r].glyphs&&(i[r].glyphs={}),i[r].glyphs[a]=o&&{id:o.id,bitmap:o.bitmap.clone(),metrics:o.metrics},i[r].ascender=this.entries[r].ascender,i[r].descender=this.entries[r].descender;r(null,i)}})}_doesCharSupportLocalGlyph(i){return this.localGlyphMode!==cy.none&&(this.localGlyphMode===cy.all?!!this.localFontFamily:!!this.localFontFamily&&
8(aT(i)||aA(i)||ap(i)||am(i)||af(i)||aw(i)||i>=131072&&i<=173791||i>=66736&&i<=66815))}_tinySDF(i,r,n){let a=this.localFontFamily;if(!a||!this._doesCharSupportLocalGlyph(n))return;let o=i.tinySDF;if(!o){let n="400";cm.test(r)?n="900":cg.test(r)?n="500":c_.test(r)&&(n="200"),(o=i.tinySDF=new cv.TinySDF({fontFamily:a,fontWeight:n,fontSize:48,buffer:6,radius:16})).fontWeight=n}let s=o.fontWeight;if(this.localGlyphs[s][n])return this.localGlyphs[s][n];let l=String.fromCodePoint(n),{data:u,width:c,height:d,glyphWidth:h,glyphHeight:f,glyphLeft:p,glyphTop:m,glyphAdvance:g}=o.draw(l);return this.localGlyphs[s][n]={id:n,bitmap:new l1({width:c,height:d},u),metrics:{width:h/2,height:f/2,left:p/2,top:m/2-27,advance:g/2,localGlyph:!0}}}}function cx(i,r){return i+r[1]-r[0]}function cb(i,r,n,a,o=1){let s=[],l=i.imagePrimary,u=l.pixelRatio,c=l.paddedRect.w-2,d=l.paddedRect.h-2,h=(i.right-i.left)*o,f=(i.bottom-i.top)*o,p=l.stretchX||[[0,c]],m=l.stretchY||[[0,d]],g=p.reduce(cx,0),_=m.reduce(cx,0),y=c-g,v=d-_,x=0,b=g,w=0,T=_,E=0,S=y,A=0,C=v;if(l.content&&a){let i=l.content;x=cw(p,0,i[0]),w=cw(m,0,i[1]),b=cw(p,i[0],i[2]),T=cw(m,i[1],i[3]),E=i[0]-x,A=i[1]-w,S=i[2]-i[0]-b,C=i[3]-i[1]-T}let I=(a,s,c,d)=>{var p,m,y,v,I,k,R,M,L,P,O,D,F,N,j,z;let B=(p=a.stretch-x,p/b*h+i.left*o),U=(m=a.fixed-E,y=S,v=a.stretch,m-y*v/g),V=(I=s.stretch-w,I/T*f+i.top*o),H=(k=s.fixed-A,R=C,M=s.stretch,k-R*M/_),G=(L=c.stretch-x,L/b*h+i.left*o),q=(P=c.fixed-E,O=S,D=c.stretch,P-O*D/g),$=(F=d.stretch-w,F/T*f+i.top*o),W=(N=d.fixed-A,j=C,z=d.stretch,N-j*z/_),Y=new eQ(B,V),Z=new eQ(G,V),K=new eQ(G,$),X=new eQ(B,$),Q=new eQ(U/u,H/u),J=new eQ(q/u,W/u),ee=r*Math.PI/180;if(ee){let i=Math.sin(ee),r=Math.cos(ee),n=[r,-i,i,r];Y._matMult(n),Z._matMult(n),X._matMult(n),K._matMult(n)}let et=a.stretch+a.fixed,ei=c.stretch+c.fixed,er=s.stretch+s.fixed,en=d.stretch+d.fixed,ea=i.imageSecondary;return{tl:Y,tr:Z,bl:X,br:K,texPrimary:{x:l.paddedRect.x+1+et,y:l.paddedRect.y+1+er,w:ei-et,h:en-er},texSecondary:ea?{x:ea.paddedRect.x+1+et,y:ea.paddedRect.y+1+er,w:ei-et,h:en-er}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Q,pixelOffsetBR:J,minFontScaleX:S/u/h,minFontScaleY:C/u/f,isSDF:n}};if(l.stretchX||l.stretchY){let i=cT(p,y,g),r=cT(m,v,_);for(let n=0;n<i.length-1;n++){let a=i[n],o=i[n+1];for(let i=0;i<r.length-1;i++)s.push(I(a,r[i],o,r[i+1]))}}else s.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:c+1},{fixed:0,stretch:d+1}));return s}function cw(i,r,n){let a=0;for(let o of i)a+=Math.max(r,Math.min(n,o[1]))-Math.max(r,Math.min(n,o[0]));return a}function cT(i,r,n){let a=[{fixed:-1,stretch:0}];for(let[r,n]of i){let i=a.at(-1);a.push({fixed:r-i.stretch,stretch:i.stretch}),a.push({fixed:r-i.stretch,stretch:i.stretch+(n-r)})}return a.push({fixed:r+1,stretch:n}),a}function cE(i){return 2*i.length+1}function cS(i,r,n,a,o,s,l,u,c,d=1){let h,f,p,m=[];if(0===r.positionedLines.length)return m;let g=(void 0!==c?c:a.layout.get("text-rotate").evaluate(s,{}))*Math.PI/180,_=(h=n[0],(p=h*(f=n[1]))>0?[h,-f]:p<0?[-h,f]:0===h?[f,h]:[f,-h]),y=Math.abs(r.top-r.bottom);for(let i of r.positionedLines)y-=i.lineOffset;let v=r.positionedLines.length,x=y/v,b=r.top-n[1];for(let i=0;i<v;++i){let a=r.positionedLines[i];for(let s of(b=function(i,r,n,a){let o=r+i.positionedLines[a].lineOffset;return 0===a?n+o/2:n+(o+(r+i.positionedLines[a-1].lineOffset))/2}(r,x,b,i),a.positionedGlyphs)){let i,a,c,h;if(!s.rect)continue;let f=s.rect||{},p=4,y=!0,v=1,x=0;if(s.image){let i=l.get(s.image.toString());if(!i)continue;if(i.sdf){tb("SDF images are not supported in formatted text and will be ignored.");continue}y=!1,p=1/(v=i.pixelRatio),i.usvg||(v/=d)}let w=(o||u)&&s.vertical,T=s.metrics.advance*s.scale/2,E=s.metrics,S=s.rect;if(null===S)continue;u&&r.verticalizable&&(x=s.image?T-s.metrics.width*s.scale/2:0);let A=o?[s.x+T,s.y]:[0,0],C=[0,0],I=[0,0],k=!1;o||(w?(I=[s.x+T+_[0],s.y+_[1]-x],k=!0):C=[s.x+T+n[0],s.y+n[1]-x]);let R=S.w*s.scale/(v*(s.localGlyph?2:1)),M=S.h*s.scale/(v*(s.localGlyph?2:1));if(w){let r=s.y-b,n=new eQ(-T,T-r),o=-Math.PI/2,l=new eQ(...I);
8(i=new eQ(-T+C[0],C[1]))._rotateAround(o,n)._add(l),i.x+=-r+T,i.y-=(E.left-p)*s.scale;let u=s.image?E.advance*s.scale:24*s.scale,d=String.fromCodePoint(s.glyph);"︶"===d||"﹈"===d||"︸"===d||"﹄"===d||"﹂"===d||"︾"===d||"︼"===d||"︺"===d||"︘"===d||"﹀"===d||"︐"===d||"︓"===d||"︔"===d||"`"===d||" ̄"===d||"︑"===d||"︒"===d?i.x+=(1-p)*s.scale:"︵"===d||"﹇"===d||"︷"===d||"﹃"===d||"﹁"===d||"︽"===d||"︻"===d||"︹"===d||"︗"===d||"︿"===d?i.x+=u-E.height*s.scale+(-p-1)*s.scale:i.x+=s.image||E.width+2*p===S.w&&E.height+2*p===S.h?(u-M)/2:(u-(E.height+2*p)*s.scale)/2,a=new eQ(i.x,i.y-R),c=new eQ(i.x+M,i.y),h=new eQ(i.x+M,i.y-R)}else{let r=(E.left-p)*s.scale-T+C[0],n=(-E.top-p)*s.scale+C[1],o=r+R,l=n+M;i=new eQ(r,n),a=new eQ(o,n),c=new eQ(r,l),h=new eQ(o,l)}if(g){let r;r=o?new eQ(0,0):k?new eQ(_[0],_[1]):new eQ(n[0],n[1]),i._rotateAround(g,r),a._rotateAround(g,r),c._rotateAround(g,r),h._rotateAround(g,r)}let L=new eQ(0,0),P=new eQ(0,0);m.push({tl:i,tr:a,bl:c,br:h,texPrimary:f,texSecondary:void 0,writingMode:r.writingMode,glyphOffset:A,sectionIndex:s.sectionIndex,isSDF:y,pixelOffsetTL:L,pixelOffsetBR:P,minFontScaleX:0,minFontScaleY:0})}}return m}function cA(i,r){return r.max-i.max}cv.TinySDF=class{constructor({fontSize:i=24,buffer:r=3,radius:n=8,cutoff:a=.25,fontFamily:o="sans-serif",fontWeight:s="normal",fontStyle:l="normal",lang:u=null}={}){this.buffer=r,this.radius=n,this.cutoff=a,this.lang=u;const c=this.size=i+4*r,d=this._createCanvas(c),h=this.ctx=d.getContext("2d",{willReadFrequently:!0});h.font=`${l} ${s} ${i}px ${o}`,h.textBaseline="alphabetic",h.textAlign="left",h.fillStyle="black",this.gridOuter=new Float64Array(c*c),this.gridInner=new Float64Array(c*c),this.f=new Float64Array(c),this.z=new Float64Array(c+1),this.v=new Uint16Array(c)}_createCanvas(i){if("u">typeof OffscreenCanvas)return new OffscreenCanvas(i,i);let r=document.createElement("canvas");return r.width=r.height=i,r}draw(i){let{width:r,actualBoundingBoxAscent:n,actualBoundingBoxDescent:a,actualBoundingBoxLeft:o,actualBoundingBoxRight:s}=this.ctx.measureText(i),l=Math.ceil(n),u=Math.floor(-o),c=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(s)-u)),d=Math.max(0,Math.min(this.size-this.buffer,l+Math.ceil(a))),h=c+2*this.buffer,f=d+2*this.buffer,p=Math.max(h*f,0),m=new Uint8ClampedArray(p),g={data:m,width:h,height:f,glyphWidth:c,glyphHeight:d,glyphTop:l,glyphLeft:u,glyphAdvance:r};if(0===c||0===d)return g;let{ctx:_,buffer:y,gridInner:v,gridOuter:x}=this;this.lang&&(_.lang=this.lang),_.clearRect(y,y,c,d),_.fillText(i,y-u,y+l);let b=_.getImageData(y,y,c,d);x.fill(1e20,0,p),v.fill(0,0,p);let w=3;for(let i=0;i<d;i++){let r=(i+y)*h+y;for(let i=0;i<c;i++,w+=4,r++){let i=b.data[w];if(0===i)continue;let n=ch[i];x[r]=Math.max(0,n),v[r]=Math.max(0,-n)}}cf(x,0,0,h,f,h,this.f,this.v,this.z);let T=Math.min(y,1);cf(v,y-T,y-T,c+2*T,d+2*T,h,this.f,this.v,this.z);let E=255/this.radius,S=255*(1-this.cutoff);for(let i=0;i<p;i++){let r=Math.sqrt(x[i])-Math.sqrt(v[i]);m[i]=Math.round(S-E*r)}return g}};class cC{constructor(i,r,n,a){this.p=new eQ(i,r),this.h=n,this.d=function(i,r){let n=!1,a=1/0;for(let o=0;o<r.length;o++){let s=r[o];for(let r=0,o=s.length,l=o-1;r<o;l=r++){let o=s[r],u=s[l];o.y>i.y!=u.y>i.y&&i.x<(u.x-o.x)*(i.y-o.y)/(u.y-o.y)+o.x&&(n=!n),a=Math.min(a,lj(i,o,u))}}return(n?1:-1)*Math.sqrt(a)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}}let cI=Object.keys,ck=1/0,cR=Math.sqrt(2);function cM(i,r,n,a,o,s){let l=uW(i)&&i.collisionPadding?i.collisionPadding:[0,0,0,0],u={top:i.top-l[1],bottom:i.bottom+l[3],left:i.left-l[0],right:i.right+l[2],scaled:!1};return void 0!==a&&(u.top*=a,u.bottom*=a,u.left*=a,u.right*=a,u.scaled=!0),s&&(u.left+=s[0],u.right+=s[0],u.top+=s[1],u.bottom+=s[1]),n&&function(i,r,n){if(!r)return;let a=r*e7,o=new eQ(n?n[0]:0,n?n[1]:0),s=new eQ(i.left,i.top),l=new eQ(i.right,i.top),u=new eQ(i.left,i.bottom),c=new eQ(i.right,i.bottom);s._rotateAround(a,o),l._rotateAround(a,o),u._rotateAround(a,o),c._rotateAround(a,o),i.left=Math.min(s.x,l.x,u.x,c.x),i.right=Math.max(s.x,l.x,u.x,c.x),i.top=Math.min(s.y,l.y,u.y,c.y),i.bottom=Math.max(s.y,l.y,u.y,c.y)}
8(u,n,o),r?{top:Math.min(r.top,u.top),bottom:Math.max(r.bottom,u.bottom),left:Math.min(r.left,u.left),right:Math.max(r.right,u.right),scaled:r.scaled||u.scaled}:u}function cL(i,[r,n]){let a=0,o=0;if(n===ck){r<0&&(r=0);let n=r/cR;switch(i){case"top-right":case"top-left":o=n-7;break;case"bottom-right":case"bottom-left":o=7-n;break;case"bottom":o=7-r;break;case"top":o=r-7}switch(i){case"top-right":case"bottom-right":a=-n;break;case"top-left":case"bottom-left":a=n;break;case"left":a=r;break;case"right":a=-r}}else{switch(r=Math.abs(r),n=Math.abs(n),i){case"top-right":case"top-left":case"top":o=n-7;break;case"bottom-right":case"bottom-left":case"bottom":o=7-n}switch(i){case"top-right":case"bottom-right":case"right":a=-r;break;case"top-left":case"bottom-left":case"left":a=r}}return[a,o]}function cP(i,r,n,a,o,s,l,u){let c=i.hasLayoutProperty("icon-offset")?r.getAppearanceValueAndResolveTokens(i,"icon-offset",n,a,[]):null,d=c&&Array.isArray(c)?c:o,h=i.hasLayoutProperty("icon-rotate")?r.getAppearanceValueAndResolveTokens(i,"icon-rotate",n,a,[]):null,f=i.hasLayoutProperty("icon-size")?r.getAppearanceValueAndResolveTokens(i,"icon-size",n,a,[]):null;return{appearanceIconOffset:d,appearanceIconRotate:"number"==typeof h?h:s,appearanceIconSize:"number"==typeof f?f*u:l}}function cO(i,r,n,a,o,s,l){let u=i.hasLayoutProperty("text-offset")?r.getAppearanceValueAndResolveTokens(i,"text-offset",n,a,[]):null,c=u&&Array.isArray(u)?[24*u[0],24*u[1]]:o,d=i.hasLayoutProperty("text-rotate")?r.getAppearanceValueAndResolveTokens(i,"text-rotate",n,a,[]):null,h=i.hasLayoutProperty("text-size")?r.getAppearanceValueAndResolveTokens(i,"text-size",n,a,[]):null;return{appearanceTextOffset:c,appearanceTextRotate:"number"==typeof d?d:s,appearanceTextSize:"number"==typeof h?h:l}}function cD(i,r,n,a,o,s,l,u,c){if(!r||!r.usvg)return;let d=uQ(a),h=uQ(o),f=("both"===s||"width"===s)&&uK(a)?h.width/d.width:1,p=("both"===s||"height"===s)&&uX(a)?h.height/d.height:1;n.scaleSelf(f,p);let m=n.toString();l.set(m,n),u.set(m,r);let{imagePosition:g}=cs(m,r,1);c.set(m,g)}function cF(i,r,n,a,o,s,l,u,c,d){var h,f,p,m,g,_,y;if(!i)return;let v=(h=r,f=n,p=a,m=o,g=s,_=c,y=d,"camera"===h.kind?h.maxSize:"composite"===h.kind?Math.max(f.possiblyEvaluate(new aZ(h.maxZoom,{worldview:_}),p,y).evaluate(g,{},p,y),f.possiblyEvaluate(new aZ(h.minZoom,{worldview:_}),p,y).evaluate(g,{},p,y)):f.possiblyEvaluate(new aZ(m,{worldview:_}),p,y).evaluate(g,{},p,y));return i.scaleSelf(v*u*l)}function cN(i,r,n,a,o,s,l,u,c,d){return{iconPrimary:cF(i.getPrimary(),r,n,a,o,s,l,u,c,d),iconSecondary:cF(i.getSecondary(),r,n,a,o,s,l,u,c,d)}}function cj(i,r,n,a){if(!i)return;let o=r.get(n.toString());o&&(i.imagePrimary=o),a&&(i.imageSecondary=r.get(a.toString()))}function cz(i,r){if(i){for(let n of i.positionedLines)for(let i of n.positionedGlyphs)if(null!==i.image){let n=i.image.toString();i.rect=r.get(n).paddedRect}}}function cB(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function cU(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x){let b=cS(0,a,c,s,l,u,o,i.allowVerticalPlacement,void 0,g.textScaleFactor),w=s.layout.get("text-size").evaluate(u,{},y),T=g.compositeTextSizes?g.compositeTextSizes[0].evaluate(u,{},y):0,E=g.compositeTextSizes?g.compositeTextSizes[1].evaluate(u,{},y):0,S=cV(i.layerIds[0],i.textSizeData,w,g.textScaleFactor,T,E);for(let a of(i.addSymbols(i.text,b,S,c,l,u,h,r,n,d.lineStartIndex,d.lineLength,m,_,y,x,!1,v,b.length),f))p[a]=i.text.placedSymbolArray.length-1;return 4*b.length}function cV(i,r,n,a,o,s){let l=null;return"source"===r.kind?(l=[128*n*a])[0]>32640&&tb(`${i}: Value for "text-size" or "icon-size" is >= 255. Reduce your "text-size" or "icon-size".`):"composite"===r.kind&&((l=[128*o*a,128*s*a])[0]>32640||l[1]>32640)&&tb(`${i}: Value for "text-size" or "icon-size" is >= 255. Reduce your "text-size" or "icon-size".`),l}function cH(i){for(let r in i)return i[r];return null}function cG(i,r,n,a,o,s,l,u,c,d,h){let f,p,m,g;if(f=h?h.top:l.top,p=h?h.bottom:l.bottom,m=h?h.left:l.left,g=h?h.right:l.right,uW(l)&&l.collisionPadding){let i=l.collisionPadding;m-=i[0],f-=i[1],g+=i[2],p+=i[3]}if(c){let i=new eQ(m,f),r=new eQ(g,f),n=new eQ(m,p),a=new eQ(g,p),o=c*e7,s=new eQ(0,0);
8d&&(s=new eQ(d[0],d[1])),i._rotateAround(o,s),r._rotateAround(o,s),n._rotateAround(o,s),a._rotateAround(o,s),m=Math.min(i.x,r.x,n.x,a.x),g=Math.max(i.x,r.x,n.x,a.x),f=Math.min(i.y,r.y,n.y,a.y),p=Math.max(i.y,r.y,n.y,a.y)}return i.emplaceBack(r.x,r.y,r.z,n.x,n.y,m,f,g,p,u,a,o,s),i.length-1}function cq(i){uW(i)&&i.collisionPadding&&(i.top-=i.collisionPadding[1],i.bottom+=i.collisionPadding[3]);let r=i.bottom-i.top;return r>0?Math.max(10,r):null}let{members:c$}=o6([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),cW=o6([{name:"a_pos_3",components:3,type:"Int16"}]);var cY=o6([{name:"a_pos",type:"Int16",components:2}]);class cZ{constructor(i,r){this.pos=i,this.dir=r}intersectsPlane(i,r,n){let a=eK(r,this.dir);if(1e-6>Math.abs(a))return!1;let o=((i[0]-this.pos[0])*r[0]+(i[1]-this.pos[1])*r[1])/a;return n[0]=this.pos[0]+this.dir[0]*o,n[1]=this.pos[1]+this.dir[1]*o,!0}}class cK{constructor(i,r){this.pos=i,this.dir=r}intersectsPlane(i,r,n){let a=eT(r,this.dir);if(1e-6>Math.abs(a))return!1;let o=((i[0]-this.pos[0])*r[0]+(i[1]-this.pos[1])*r[1]+(i[2]-this.pos[2])*r[2])/a;return n[0]=this.pos[0]+this.dir[0]*o,n[1]=this.pos[1]+this.dir[1]*o,n[2]=this.pos[2]+this.dir[2]*o,!0}closestPointOnSphere(i,r,n){var a,o,s,l,u,c,d;if(a=this.pos,o=a[0],s=a[1],l=a[2],u=i[0],c=i[1],d=i[2],Math.abs(o-u)<=1e-6*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(l-d)<=1e-6*Math.max(1,Math.abs(l),Math.abs(d))||0===r)return n[0]=n[1]=n[2]=0,!1;let[h,f,p]=this.dir,m=this.pos[0]-i[0],g=this.pos[1]-i[1],_=this.pos[2]-i[2],y=h*h+f*f+p*p,v=2*(m*h+g*f+_*p),x=v*v-4*y*(m*m+g*g+_*_-r*r);if(x<0){let i=Math.max(-v/2,0),a=m+h*i,o=g+f*i,s=_+p*i,l=Math.hypot(a,o,s);return n[0]=a*r/l,n[1]=o*r/l,n[2]=s*r/l,!1}{let i=(-v-Math.sqrt(x))/(2*y);if(i<0){let i=Math.hypot(m,g,_);return n[0]=m*r/i,n[1]=g*r/i,n[2]=_*r/i,!1}return n[0]=m+h*i,n[1]=g+f*i,n[2]=_+p*i,!0}}}class cX{constructor(i,r,n,a,o){this.TL=i,this.TR=r,this.BR=n,this.BL=a,this.horizon=o}static fromInvProjectionMatrix(i,r,n){let a=[-1,1,1],o=[1,1,1],s=[1,-1,1],l=[-1,-1,1];return new cX(eA(a,a,i),eA(o,o,i),eA(s,s,i),eA(l,l,i),r/n)}}function cQ(i,r,n,a){let o=r[0],s=r[1],l=r[2],u=n[0],c=n[1],d=n[2],h=1/0,f=-1/0;for(let r=0;r<i.length;r++){let n=i[r],a=(n[0]-o)*u+(n[1]-s)*c+(n[2]-l)*d;a<h&&(h=a),a>f&&(f=a)}return a[0]=h,a[1]=f,a}function cJ(i,r){let n=!0;for(let a=0;a<i.planes.length;a++){let o=i.planes[a],s=0;for(let i=0;i<r.length;i++)s+=+(eT(o,r[i])+o[3]>=0);if(0===s)return 0;s!==r.length&&(n=!1)}return n?2:1}let c1=[0,0];function c0(i,r){for(let n of i.projections){let a=cQ(r,i.points[0],n.axis,c1);if(n.projection[1]<a[0]||n.projection[0]>a[1])return 0}return 1}function c2(i,r){let n=r[0],a=r[1],o=r[2],s=r[3];for(let r=0;r<i.length;r++){let l=i[r];if(n*l[0]+a*l[1]+o*l[2]+s>=0)return!0}return!1}class c5{constructor(i,r){for(const n of(this.points=i||Array(8).fill([0,0,0]),this.planes=r||Array(6).fill([0,0,0,0]),this.bounds=c4.fromPoints(this.points),this.projections=[],this.frustumEdges=[eh([],this.points[2],this.points[3]),eh([],this.points[0],this.points[3]),eh([],this.points[4],this.points[0]),eh([],this.points[5],this.points[1]),eh([],this.points[6],this.points[2]),eh([],this.points[7],this.points[3])],this.frustumEdges)){const i=[0,-n[2],n[1]],r=[n[2],0,-n[0]];this.projections.push({axis:i,projection:cQ(this.points,this.points[0],i,[0,0])}),this.projections.push({axis:r,projection:cQ(this.points,this.points[0],r,[0,0])})}}static fromInvProjectionMatrix(i,r,n,a){let o=Math.pow(2,n),s=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(n=>{var s;let l=eO([],n,i),u=1/l[3]/r*o;return l[0]=l[0]*(s=[u,u,a?1/l[3]:u,u])[0],l[1]=l[1]*s[1],l[2]=l[2]*s[2],l[3]=l[3]*s[3],l}),l=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(i=>{let r=ew([],eE([],eh([],s[i[0]],s[i[1]]),eh([],s[i[2]],s[i[1]]))),n=-eT(r,s[i[1]]);return r.concat(n)}),u=[];for(let i=0;i<s.length;i++)u.push([s[i][0],s[i][1],s[i][2]]);return new c5(u,l)}intersectsPrecise(i,r,n){for(let n=0;n<r.length;n++)if(!c2(i,r[n]))return 0;for(let r=0;r<this.planes.length;r++)if(!c2(i,this.planes[r]))return 0;let a=this.points,o=a[0][0],s=a[0][1],l=a[0][2];for(let r of n)for(let n of this.frustumEdges){let u=r[1]*n[2]-r[2]*n[1],c=r[2]*n[0]-r[0]*n[2],d=r[0]*n[1]-r[1]*n[0];if(0===u&&0===c&&0===d)continue;let h=1/0,f=-1/0;for(let i=0;i<a.length;i++){let r=a[i],n=(r[0]-o)*u+(r[1]-s)*c+(r[2]-l)*d;n<h&&(h=n),n>f&&(f=n)}let p=1/0,m=-1/0;for(let r=0;r<i.length;r++){let n=i[r],a=(n[0]-o)*u+(n[1]-s)*c+(n[2]-l)*d;a<p&&(p=a),a>m&&(m=a)}if(h>m||p>f)return 0}return 1}containsPoint(i){for(let r of this.planes){let n=r[3];if(eT([r[0],r[1],r[2]],i)+n<0)return!1}return!0}}class c4{static fromPoints(i){let r=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];for(let a of i)ep(r,r,a),em(n,n,a);return new c4(r,n)}static fromTileIdAndHeight(i,r,n){let a=1<<i.canonical.z,o=i.canonical.x,s=i.canonical.y;return new c4([o/a,s/a,r],[(o+1)/a,(s+1)/a,n])}static applyTransform(i,r){let n=i.getCorners();for(let i=0;i<n.length;++i)eA(n[i],n[i],r);return c4.fromPoints(n)}static applyTransformFast(i,r){let n=[r[12],r[13],r[14]],a=[...n];for(let o=0;o<3;o++)for(let s=0;s<3;s++){let l=r[4*s+o],u=l*i.min[s],c=l*i.max[s];n[o]+=Math.min(u,c),a[o]+=Math.max(u,c)}return new c4(n,a)}static projectAabbCorners(i,r){let n=i.getCorners();for(let i=0;i<n.length;++i)eA(n[i],n[i],r);return n}constructor(i,r){this.min=i,this.max=r,this.center=eg([],ed([],this.min,this.max),.5)}quadrant(i){let r=[i%2==0,i<2],n=es(this.min),a=es(this.max);for(let i=0;i<r.length;i++)n[i]=r[i]?this.min[i]:this.center[i],a[i]=r[i]?this.center[i]:this.max[i];return a[2]=this.max[2],new c4(n,a)}distanceX(i){return Math.max(Math.min(this.max[0],i[0]),this.min[0])-i[0]}distanceY(i){return Math.max(Math.min(this.max[1],i[1]),this.min[1])-i[1]}distanceZ(i){return Math.max(Math.min(this.max[2],i[2]),this.min[2])-i[2]}getCorners(){let i=this.min,r=this.max;return[[i[0],i[1],i[2]],[r[0],i[1],i[2]],[r[0],r[1],i[2]],[i[0],r[1],i[2]],[i[0],i[1],r[2]],[r[0],i[1],r[2]],[r[0],r[1],r[2]],[i[0],r[1],r[2]]]}intersects(i){return this.intersectsAabb(i.bounds)?cJ(i,this.getCorners()):0}intersectsFlat(i){return this.intersectsAabb(i.bounds)?cJ(i,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(i,r){return r||this.intersects(i)?c0(i,this.getCorners()):0}intersectsPreciseFlat(i,r){return r||this.intersectsFlat(i)?c0(i,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(i){for(let r=0;r<3;++r)if(this.min[r]>i.max[r]||i.min[r]>this.max[r])return!1;return!0}intersectsAabbXY(i){return!(this.min[0]>i.max[0]||i.min[0]>this.max[0]||this.min[1]>i.max[1]||i.min[1]>this.max[1])}encapsulate(i){for(let r=0;r<3;r++)this.min[r]=Math.min(this.min[r],i.min[r]),this.max[r]=Math.max(this.max[r],i.max[r])}encapsulatePoint(i){for(let r=0;r<3;r++)this.min[r]=Math.min(this.min[r],i[r]),this.max[r]=Math.max(this.max[r],i[r])}closestPoint(i){return[Math.max(Math.min(this.max[0],i[0]),this.min[0]),Math.max(Math.min(this.max[1],i[1]),this.min[1]),Math.max(Math.min(this.max[2],i[2]),this.min[2])]}}function c9(i){return i*oz/6371008.8}ar(c4,"Aabb");let c3=[new c4([oU,oU,oU],[oz,oz,oz]),new c4([oU,oU,oU],[0,0,oz]),new c4([0,oU,oU],[oz,0,oz]),new c4([oU,0,oU],[0,oz,oz]),new c4([0,0,oU],[oz,oz,oz])];function c8(i,r,n,a=!0){let o,s=eg([],i._camera.position,i.worldSize),l=[r,n,1,1];eO(l,l,i.pixelMatrixInverse),eL(l,l,1/l[3]);let u=ew([],eh([],l,s)),c=i.globeMatrix,d=[c[12],c[13],c[14]],h=eh([],d,s),f=el(h),p=ew([],h),m=i.worldSize/(2*Math.PI),g=eT(p,u),_=Math.asin(m/f);if(_<Math.acos(g)){if(!a)return null;let i=[],r=[];eg(i,u,f/g),ew(r,eh(r,i,h)),ew(u,ed(u,h,eg(u,r,Math.tan(_)*f)))}let y=[];new cK(s,u).closestPointOnSphere(d,m,y);let v=ew([],tO(c,0)),x=ew([],tO(c,1)),b=ew([],tO(c,2)),w=eT(v,y),T=eT(x,y),E=eT(b,y),S=Math.asin(-T/m)*te,A=Math.atan2(w,E)*te;return new oJ(rh(A=i.center.lng+((o=(A-i.center.lng+180)%360-180)<-180?o+360:o)),ts(rf(S),0,1))}class c6{constructor(i,r,n){this.a=eh([],i,n),this.b=eh([],r,n),this.center=n;const a=ew([],this.a),o=ew([],this.b);this.angle=Math.acos(eT(a,o))}}function c7(i,r){var n,a,o,s;let l,u;return 0===i.angle?null:(l=0===i.a[r]?1/i.angle*.5*Math.PI:1/i.angle*Math.atan(i.b[r]/i.a[r]/Math.sin(i.angle)-1/Math.tan(i.angle)))<0||l>1?null:(n=i.a[r],a=i.b[r],o=i.angle,s=ts(l,0,1),u=Math.sin(o),Math.sin((1-s)*o)/u*n+Math.sin(s*o)/u*a+i.center[r])}function de(i){if(i.z<=1)return c3[i.z+2*i.y+i.x];let r=ds(da(i));return c4.fromPoints(r)}
8function dt(i,r,n){return eg(i,i,1-n),e_(i,i,r,n)}function di(i,r){let n=dg(r.zoom);if(0===n)return de(i);let a=da(i),o=ds(a),s=rh(a.getWest())*r.worldSize,l=rh(a.getEast())*r.worldSize,u=rf(a.getNorth())*r.worldSize,c=rf(a.getSouth())*r.worldSize,d=[s,u,0],h=[l,u,0],f=[s,c,0],p=[l,c,0],m=Y([],r.globeMatrix);return eA(d,d,m),eA(h,h,m),eA(f,f,m),eA(p,p,m),o[0]=dt(o[0],f,n),o[1]=dt(o[1],p,n),o[2]=dt(o[2],h,n),o[3]=dt(o[3],d,n),c4.fromPoints(o)}function dr(i,r,n){for(let a of i)eA(a,a,r),eg(a,a,n)}function dn(i,r,n,a){let o=r/i.worldSize,s=i.globeMatrix;if(n.z<=1){let i=de(n).getCorners();return dr(i,s,o),c4.fromPoints(i)}let l=da(n,a),u=ds(l,oz+c9(i._tileCoverLift));dr(u,s,o);let c=Number.MAX_VALUE,d=[-c,-c,-c],h=[c,c,c];if(l.contains(i.center)){for(let i of u)ep(h,h,i),em(d,d,i);d[2]=0;let r=i.point,n=[r.x*o,r.y*o,0];return ep(h,h,n),em(d,d,n),new c4(h,d)}if(i._tileCoverLift>0){for(let i of u)ep(h,h,i),em(d,d,i);return new c4(h,d)}let f=[s[12]*o,s[13]*o,s[14]*o],p=l.getCenter(),m=ts(i.center.lat,-85.051129,85.051129),g=ts(p.lat,-85.051129,85.051129),_=rh(i.center.lng),y=rf(m),v=_-rh(p.lng),x=y-rf(g);v>.5?v-=1:v<-.5&&(v+=1);let b=0;Math.abs(v)>Math.abs(x)?b=v>=0?1:3:(b=x>=0?0:2,e_(f,f,[s[4]*o,s[5]*o,s[6]*o],-Math.sin((x>=0?l.getSouth():l.getNorth())*e7)*oz));let w=u[b],T=u[(b+1)%4],E=new c6(w,T,f),S=[c7(E,0)||w[0],c7(E,1)||w[1],c7(E,2)||w[2]],A=dg(i.zoom);if(A>0){let a=function({x:i,y:r,z:n},a,o,s,l){let u=1/(1<<n),c=i*u,d=c+u,h=r*u,f=h+u,p=0,m=(c+d)/2-s;return m>.5?p=-1:m<-.5&&(p=1),c=((c+p)*a-(s*=a))*o+s,d=((d+p)*a-s)*o+s,h=(h*a-(l*=a))*o+l,[[c,f=(f*a-l)*o+l,0],[d,f,0],[d,h,0],[c,h,0]]}(n,r,i._pixelsPerMercatorPixel,_,y);for(let i=0;i<u.length;i++)dt(u[i],a[i],A);let o=ed([],a[b],a[(b+1)%4]);eg(o,o,.5),dt(S,o,A)}for(let i of u)ep(h,h,i),em(d,d,i);return h[2]=Math.min(w[2],T[2]),ep(h,h,S),em(d,d,S),new c4(h,d)}function da({x:i,y:r,z:n},a=!1){let o=1/(1<<n);return new o$(new oq(rp(i*o),r===(1<<n)-1&&a?-90:rm((r+1)*o)),new oq(rp((i+1)*o),0===r&&a?90:rm(r*o)))}function ds(i,r=oz){let n=i.getNorth()*e7,a=i.getSouth()*e7,o=Math.cos(n),s=Math.cos(a),l=Math.sin(n),u=Math.sin(a),c=i.getWest(),d=i.getEast();return[oV(s,u,c,r),oV(s,u,d,r),oV(o,l,d,r),oV(o,l,c,r)]}function dl(i,r,n,a){let o=1<<n.z,s=(i/8192+n.x)/o;return oH(rm((r/8192+n.y)/o),rp(s),a)}function du({min:i,max:r}){return 16383/Math.max(r[0]-i[0],r[1]-i[1],r[2]-i[2])}let dc=new Float64Array(16);function dd(i){let r=du(i),n=ei(dc,[r,r,r]);return K(n,n,eb([],i.min))}function dh(i){let r=1/du(i);return et(dc,i.min),X(dc,dc,[r,r,r])}function df(i){return i/(2*Math.PI)/(8192/(2*Math.PI))}function dp(i,r){return 8192/(512*Math.pow(2,i))*du(de(r))}function dm(i,r,n,a,o){let s=df(n),l=[i,r,-n/(2*Math.PI)],u=W(new Float64Array(16));return K(u,u,l),X(u,u,[s,s,s]),Q(u,u,-o*e7),J(u,u,-a*e7),u}function dg(i){return tl(5,6,i)}function d_(i,r){var n,a,o,s,l,u,c,d;let h,f,p,m,g=oH(r.lat,r.lng);return a=(n=eh([],(h=oH(i._center.lat,i._center.lng),f=eE([],eu(0,1,0),h),f=eA(f,f,p=er([],-i.angle,h)),er(p,-i._pitch,f),eg(m=ew([],h),m,c9(i.cameraToCenterDistance/i.pixelsPerMeter)),eA(m,m,p),ed([],h,m)),g))[0],o=n[1],s=n[2],l=g[0],Math.acos(Math.min(Math.max((d=Math.sqrt((a*a+o*o+s*s)*(l*l+(u=g[1])*u+(c=g[2])*c)))&&eT(n,g)/d,-1),1))}function dy(i,r){return d_(i,r)>Math.PI/2*1.01}let dv=85*e7,dx=Math.cos(dv),db=Math.sin(dv);function dw(i,r){let n=i.fovAboveCenter,a=Math.min(i.elevation?i.elevation.getMinElevationBelowMSL()*r:0,i.isOrthographic?-10*r:0),o=(i._camera.position[2]*i.worldSize-a)/Math.cos(i._pitch),s=Math.sin(n)*o/Math.sin(Math.max(Math.PI/2-i._pitch-n,.01)),l=Math.sin(i._pitch)*s+o,u=o*(1/i._horizonShift);if(!i.elevation||0===i.elevation.exaggeration()){let r=Math.max(i.zoom-17,0);i.isOrthographic&&(r/=10),l*=1+r}return Math.min(1.01*l,u)}class dT{constructor(i,r,n){this.z=i,this.x=r,this.y=n,this.key=dA(0,i,i,r,n)}equals(i){return this.z===i.z&&this.x===i.x&&this.y===i.y}isChildOf(i){let r=this.z-i.z;return 0===i.z||i.z<this.z&&i.x===this.x>>r&&i.y===this.y>>r}url(i,r){var n,a,o;let s,l,u,c,d=(n=this.x,a=this.y,o=this.z,s=2**o,u=(l=2*Math.PI*6378137)*(n/s-.5),c=l*(.5-(a+1)/s),`${u},${c},${u+l/s},${c+l/s}`),h=function(i,r,n){let a,o="";for(let s=i;s>0;s--)o+=(r&(a=1<<s-1)?1:0)+(n&a?2:0);return o}(this.z,this.x,this.y);return i[(this.x+this.y)%i.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===r?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",h).replace("{bbox-epsg-3857}",d)}toString(){return`${this.z}/${this.x}/${this.y}`}}class dE{constructor(i,r){this.wrap=i,this.canonical=r,this.key=dA(i,r.z,r.z,r.x,r.y)}}class dS{constructor(i,r,n,a,o){this.overscaledZ=i,this.wrap=r,this.canonical=new dT(n,+a,+o),this.key=0===r&&i===n?this.canonical.key:dA(r,i,n,a,o)}equals(i){return this.overscaledZ===i.overscaledZ&&this.wrap===i.wrap&&this.canonical.equals(i.canonical)}scaledTo(i){let r=this.canonical.z-i;return i>this.canonical.z?new dS(i,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new dS(i,this.wrap,i,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(i,r=!0){if(this.overscaledZ===i&&r)return this.key;if(i>this.canonical.z)return dA(this.wrap*r,i,this.canonical.z,this.canonical.x,this.canonical.y);{let n=this.canonical.z-i;return dA(this.wrap*r,i,i,this.canonical.x>>n,this.canonical.y>>n)}}isChildOf(i){if(i.wrap!==this.wrap)return!1;let r=this.canonical.z-i.canonical.z;return 0===i.overscaledZ||i.overscaledZ<this.overscaledZ&&i.canonical.z<this.canonical.z&&i.canonical.x===this.canonical.x>>r&&i.canonical.y===this.canonical.y>>r}children(i){if(this.overscaledZ>=i)return[new dS(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,n=2*this.canonical.x,a=2*this.canonical.y;return[new dS(r,this.wrap,r,n,a),new dS(r,this.wrap,r,n+1,a),new dS(r,this.wrap,r,n,a+1),new dS(r,this.wrap,r,n+1,a+1)]}isLessThan(i){return this.wrap<i.wrap||!(this.wrap>i.wrap)&&(this.overscaledZ<i.overscaledZ||!(this.overscaledZ>
8i.overscaledZ)&&(this.canonical.x<i.canonical.x||!(this.canonical.x>i.canonical.x)&&this.canonical.y<i.canonical.y))}wrapped(){return new dS(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(i){return new dS(this.overscaledZ,i,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new dE(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function dA(i,r,n,a,o){let s=1<<Math.min(n,22),l=o%s*s+a%s;return i&&n<22&&(l+=s*s*((i<0?-2*i-1:2*i)%(1<<2*(22-n)))),16*(32*l+n)+(r-n)}let dC=[i=>{let r=i.canonical.x-1,n=i.wrap;return r<0&&(r=(1<<i.canonical.z)-1,n--),new dS(i.overscaledZ,n,i.canonical.z,r,i.canonical.y)},i=>{let r=i.canonical.x+1,n=i.wrap;return r===1<<i.canonical.z&&(r=0,n++),new dS(i.overscaledZ,n,i.canonical.z,r,i.canonical.y)},i=>new dS(i.overscaledZ,i.wrap,i.canonical.z,i.canonical.x,(0===i.canonical.y?1<<i.canonical.z:i.canonical.y)-1),i=>new dS(i.overscaledZ,i.wrap,i.canonical.z,i.canonical.x,i.canonical.y===(1<<i.canonical.z)-1?0:i.canonical.y+1)];function dI(i,r){if(!r.isReprojectedInTileSpace)return{scale:1<<i.z,x:i.x,y:i.y,x2:i.x+1,y2:i.y+1,projection:r};let n=Math.pow(2,-i.z),a=i.x*n,o=(i.x+1)*n,s=i.y*n,l=(i.y+1)*n,u=rp(a),c=rp(o),d=rm(s),h=rm(l),f=r.project(u,d),p=r.project(c,d),m=r.project(c,h),g=r.project(u,h),_=Math.min(f.x,p.x,m.x,g.x),y=Math.min(f.y,p.y,m.y,g.y),v=Math.max(f.x,p.x,m.x,g.x),x=Math.max(f.y,p.y,m.y,g.y),b=n/16;function w(i,n,a,o,s,l){let u=(a+s)/2,c=(o+l)/2,d=r.project(rp(u),rm(c)),h=Math.max(0,_-d.x,y-d.y,d.x-v,d.y-x);_=Math.min(_,d.x),v=Math.max(v,d.x),y=Math.min(y,d.y),x=Math.max(x,d.y),h>b&&(w(i,d,a,o,u,c),w(d,n,u,c,s,l))}w(f,p,a,s,o,s),w(p,m,o,s,o,l),w(m,g,o,l,a,l),w(g,f,a,l,a,s),_-=b,y-=b,v+=b,x+=b;let T=1/Math.max(v-_,x-y);return{scale:T,x:_*T,y:y*T,x2:v*T,y2:x*T,projection:r}}function dk(i,{x:r,y:n},a=0){return new eQ(((r-a)*i.scale-i.x)*8192,(n*i.scale-i.y)*8192)}ar(dT,"CanonicalTileID"),ar(dS,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});let dR=W(new Float32Array(16));class dM{constructor(i){this.spec=i,this.name=i.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(i,r){return{x:0,y:0,z:0}}unproject(i,r){return new oq(0,0)}projectTilePoint(i,r,n){return{x:i,y:r,z:0}}locationPoint(i,r,n,a=!0){return i._coordinatePoint(i.locationCoordinate(r,n),a)}pixelsPerMeter(i,r){return 1/oW(i)*r}pixelSpaceConversion(i,r,n){return 1}farthestPixelDistance(i){return dw(i,i.pixelsPerMeter)}pointCoordinate(i,r,n,a){let o=new eQ(r,Math.max(i.horizonLineFromTop(!1),n));return i.rayIntersectionCoordinate(i.pointRayIntersection(o,a))}pointCoordinate3D(i,r,n){let a=new eQ(r,n);if(i.elevation)return i.elevation.pointCoordinate(a);{let r=this.pointCoordinate(i,a.x,a.y,0);return[r.x,r.y,r.z]}}isPointAboveHorizon(i,r){if(i.elevation&&i.elevation.visibleDemTiles.length)return!this.pointCoordinate3D(i,r.x,r.y);let n=i.horizonLineFromTop();return r.y<n}createInversionMatrix(i,r){return dR}createTileMatrix(i,r,n){let a,o,s,l=n.canonical,u=W(new Float64Array(16));if(this.isReprojectedInTileSpace){let c=dI(l,this);a=1,o=c.x+n.wrap*c.scale,s=c.y,X(u,u,[a/c.scale,a/c.scale,i.pixelsPerMeter/r])}else a=r/i.zoomScale(l.z),o=(l.x+Math.pow(2,l.z)*n.wrap)*a,s=l.y*a;return K(u,u,[o,s,0]),X(u,u,[a/8192,a/8192,1]),u}upVector(i,r,n){return[0,0,1]}upVectorScale(i,r,n){return{metersToTile:1}}}class dL extends dM{constructor(i){super(i),this.range=[4,7],this.center=i.center||[-96,37.5];const[r,n]=this.parallels=i.parallels||[29.5,45.5],a=Math.sin(r*e7);this.n=(a+Math.sin(n*e7))/2,this.c=1+a*(2*this.n-a),this.r0=Math.sqrt(this.c)/this.n}project(i,r){let{n:n,c:a,r0:o}=this,s=(i-this.center[0])*e7,l=Math.sqrt(a-2*n*Math.sin(r*e7))/n;return{x:l*Math.sin(s*n),y:l*Math.cos(s*n)-o,z:0}}unproject(i,r){let{n:n,c:a,r0:o}=this,s=o+r,l=Math.atan2(i,Math.abs(s))*Math.sign(s);s*n<0&&(l-=Math.PI*Math.sign(i)*Math.sign(s));
8let u=this.center[0]*e7*n,c=ts((l=tu(l,-Math.PI-u,Math.PI-u))/n*te+this.center[0],-180,180),d=Math.asin(ts((a-(i*i+s*s)*n*n)/(2*n),-1,1));return new oq(c,ts(d*te,-85.051129,85.051129))}}let dP=Math.sqrt(3)/2;class dO extends dM{project(i,r){r=r/180*Math.PI,i=i/180*Math.PI;let n=Math.asin(dP*Math.sin(r)),a=n*n,o=a*a*a;return{x:.5*(i*Math.cos(n)/(dP*(1.340264+-.24331799999999998*a+o*(.0062510000000000005+.034164*a)))/Math.PI+.5),y:1-.5*(n*(1.340264+-.081106*a+o*(893e-6+.003796*a))/Math.PI+1),z:0}}unproject(i,r){i=(2*i-.5)*Math.PI;let n=r=(2*(1-r)-1)*Math.PI,a=n*n,o=a*a*a;for(let i,s,l=0;l<12&&(s=n*(1.340264+-.081106*a+o*(893e-6+.003796*a))-r,o=(a=(n=ts(n-(i=s/(1.340264+-.24331799999999998*a+o*(.0062510000000000005+.034164*a))),-Math.PI/3,Math.PI/3))*n)*a*a,!(1e-12>Math.abs(i)));++l);let s=dP*i*(1.340264+-.24331799999999998*a+o*(.0062510000000000005+.034164*a))/Math.cos(n),l=Math.asin(Math.sin(n)/dP);return new oq(ts(180*s/Math.PI,-180,180),ts(180*l/Math.PI,-85.051129,85.051129))}}class dD extends dM{constructor(i){super(i),this.wrap=!0,this.supportsWorldCopies=!0}project(i,r){return{x:.5+i/360,y:.5-r/360,z:0}}unproject(i,r){return new oq(360*(i-.5),ts(360*(.5-r),-85.051129,85.051129))}}let dF=Math.PI/2;function dN(i){return Math.tan((dF+i)/2)}class dj extends dM{constructor(i){super(i),this.center=i.center||[0,30];const[r,n]=this.parallels=i.parallels||[30,30];let a=r*e7,o=n*e7;this.southernCenter=a+o<0,this.southernCenter&&(a=-a,o=-o);const s=Math.cos(a),l=dN(a);this.n=a===o?Math.sin(a):Math.log(s/Math.cos(o))/Math.log(dN(o)/l),this.f=s*Math.pow(dN(a),this.n)/this.n}project(i,r){r*=e7,this.southernCenter&&(r=-r),i=(i-this.center[0])*e7;let{n,f:a}=this;a>0?r<-dF+1e-6&&(r=-dF+1e-6):r>dF-1e-6&&(r=dF-1e-6);let o=a/Math.pow(dN(r),n),s=o*Math.sin(n*i),l=a-o*Math.cos(n*i);return s=.5*(s/Math.PI+.5),l=.5*(l/Math.PI+.5),{x:s,y:this.southernCenter?l:1-l,z:0}}unproject(i,r){i=(2*i-.5)*Math.PI,this.southernCenter&&(r=1-r);let{n:n,f:a}=this,o=a-(r=(2*(1-r)-.5)*Math.PI),s=Math.sign(o),l=Math.sign(n)*Math.sqrt(i*i+o*o),u=Math.atan2(i,Math.abs(o))*s;o*n<0&&(u-=Math.PI*Math.sign(i)*s);let c=ts(u/n*te+this.center[0],-180,180),d=ts((2*Math.atan(Math.pow(a/l,1/n))-dF)*te,-85.051129,85.051129);return new oq(c,this.southernCenter?-d:d)}}class dz extends dM{constructor(i){super(i),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(i,r){return{x:rh(i),y:rf(r),z:0}}unproject(i,r){return new oq(rp(i),rm(r))}}let dB=85.051129*e7;class dU extends dM{project(i,r){let n=(r*=e7)*r,a=n*n;return{x:.5*((i*=e7)*(.8707-.131979*n+a*(a*(.003971*n-.001529*a)-.013791))/Math.PI+.5),y:1-.5*(r*(1.007226+n*(.015085+a*(.028874*n-.044475-.005916*a)))/Math.PI+1),z:0}}unproject(i,r){i=(2*i-.5)*Math.PI;let n=r=(2*(1-r)-1)*Math.PI,a=25,o=0,s=n*n;do{let i=(s=n*n)*s;o=(n*(1.007226+s*(.015085+i*(.028874*s-.044475-.005916*i)))-r)/(1.007226+s*(.045255+i*(.259866*s-.311325-.005916*11*i))),n=ts(n-o,-dB,dB)}while(Math.abs(o)>1e-6&&--a>0)return new oq(ts(i/(.8707+(s=n*n)*(s*(s*s*s*(.003971-.001529*s)-.013791)-.131979))*te,-180,180),n*te)}}let dV=85.051129*e7;class dH extends dM{project(i,r){r*=e7,i*=e7;let n=Math.cos(r),a=Math.acos(n*Math.cos(i/2)),o=Math.sin(a)/a;return{x:.5*((.5*(2/Math.PI*i+2*n*Math.sin(i/2)/o)||0)/Math.PI+.5),y:1-.5*((.5*(r+Math.sin(r)/o)||0)/Math.PI+1),z:0}}unproject(i,r){let n=i=(2*i-.5)*Math.PI,a=r=(2*(1-r)-1)*Math.PI,o=25,s=0,l=0;do{let o=Math.cos(a),u=Math.sin(a),c=2*u*o,d=u*u,h=o*o,f=Math.cos(n/2),p=Math.sin(n/2),m=2*f*p,g=p*p,_=1-h*f*f,y=_?1/_:0,v=_?Math.acos(o*f)*Math.sqrt(1/_):0,x=.5*(2*v*o*p+2*n/Math.PI)-i,b=.5*(v*u+a)-r,w=.5*y*(h*g+v*o*f*d)+1/Math.PI,T=y*(m*c/4-v*u*p),E=.125*y*(c*p-v*u*h*m),S=.5*y*(d*f+v*g*o)+.5,A=T*E-S*w;s=(b*T-x*S)/A,l=(x*E-b*w)/A,n=ts(n-s,-Math.PI,Math.PI),a=ts(a-l,-dV,dV)}while((Math.abs(s)>1e-6||Math.abs(l)>1e-6)&&--o>0)return new oq(n*te,a*te)}}class dG extends dM{constructor(i){super(i),this.center=i.center||[0,0],this.parallels=i.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(this.parallels[0]*e7)),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(i,r){let{scale:n,cosPhi:a}=this;return{x:i*e7*a*n+.5,y:-Math.sin(r*e7)/a*n+.5,z:0}}unproject(i,r){let{scale:n,cosPhi:a}=this,o=ts((i-.5)/n*te/a,-180,180),s=Math.asin(ts(-(r-.5)/n*a,-1,1));return new oq(o,ts(s*te,-85.051129,85.051129))}}class dq extends dz{constructor(i){super(i),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(i,r,n){let a=dl(i,r,n);return eA(a,a,dd(de(n))),{x:a[0],y:a[1],z:a[2]}}locationPoint(i,r,n){let a=oH(r.lat,r.lng),o=ew([],a),s=n?i._centerAltitude+n:i.elevation?i.elevation.getAtPointOrZero(i.locationCoordinate(r),i._centerAltitude):i._centerAltitude;e_(a,a,o,1/oW(0)*8192*s);let l=W(new Float64Array(16));return Z(l,i.pixelMatrix,i.globeMatrix),eA(a,a,l),new eQ(a[0],a[1])}pixelsPerMeter(i,r){return 1/oW(0)*r}pixelSpaceConversion(i,r,n){let a=1/oW(i)*r,o=iw(1/oW(45)*r,a,n);return this.pixelsPerMeter(i,r)/o}createTileMatrix(i,r,n){let a=dh(de(n.canonical));return Z(new Float64Array(16),i.globeMatrix,a)}createInversionMatrix(i,r){let{center:n}=i,a=dd(de(r));return J(a,a,n.lng*e7),Q(a,a,n.lat*e7),X(a,a,[i._pixelsPerMercatorPixel,i._pixelsPerMercatorPixel,1]),Float32Array.from(a)}pointCoordinate(i,r,n,a){return c8(i,r,n,!0)||new oJ(0,0)}pointCoordinate3D(i,r,n){let a=this.pointCoordinate(i,r,n,0);return[a.x,a.y,a.z]}isPointAboveHorizon(i,r){return!c8(i,r.x,r.y,!1)}farthestPixelDistance(i){let r=function(i,r){let n,a=i.cameraToCenterDistance,o=i._centerAltitude*r,s=i._camera,l=i._camera.forward(),u=ed([],eg([],l,-a),[0,0,o]),c=i.worldSize/(2*Math.PI),d=[0,0,-c],h=i.width/i.height,f=Math.tan(i.fovAboveCenter),p=eg([],s.up(),f),m=eg([],s.right(),f*h),g=ew([],ed([],ed([],l,p),m)),_=[];
8if(new cK(u,g).closestPointOnSphere(d,c,_)){let r=eh([],ed([],_,d),u);n=Math.cos(i.fovAboveCenter)*el(r)}else{let i=eh([],u,d),r=eh([],d,u);ew(r,r);let a=el(i)-c,o=Math.acos((n=Math.sqrt(a*(a+2*c)))/(c+a))-Math.acos(eT(l,r));n*=Math.cos(o)}return 1.01*n}(i,this.pixelsPerMeter(i.center.lat,i.worldSize)),n=dg(i.zoom);return n>0?iw(r,dw(i,1/oW(i.center.lat)*i.worldSize)+i.worldSize/(2*Math.PI)*(1-Math.cos(Math.max(i.width,i.height)/i.worldSize*Math.PI)),Math.pow(n,10)):r}upVector(i,r,n){return dl(r,n,i,1)}upVectorScale(i){return{metersToTile:c9(du(de(i)))}}}function d$(i){let r=i.parallels,n=!!r&&.01>Math.abs(r[0]+r[1]);switch(i.name){case"mercator":return new dz(i);case"equirectangular":return new dD(i);case"naturalEarth":return new dU(i);case"equalEarth":return new dO(i);case"winkelTripel":return new dH(i);case"albers":return n?new dG(i):new dL(i);case"lambertConformalConic":return n?new dG(i):new dj(i);case"globe":return new dq(i)}throw Error(`Invalid projection name: ${i.name}`)}let dW=Number.MAX_SAFE_INTEGER;function dY(i,r,n,a){return i.order<r||i.order===dW||!(i.clipMask&n)||function(i,r){if(0===r.length)return!1;let n=i;for(;""!==n;){if(r.includes(n))return!1;n=od(n)}return!0}(a,i.clipScope)}function dZ(i,r){return i.x-r.x||i.y-r.y}function dK(i,r){return 0===dZ(i.min,r.min)&&0===dZ(i.max,r.max)}function dX(i,r){return!(i.min.x>r.max.x||i.max.x<r.min.x||i.min.y>r.max.y||i.max.y<r.min.y)}function dQ(i,r){if(i.length!==r.length)return!1;for(let n=0;n<i.length;n++)if(i[n].sourceId!==r[n].sourceId||!dK(i[n],r[n])||i[n].order!==r[n].order||i[n].clipMask!==r[n].clipMask||!eJ(i[n].clipScope,r[n].clipScope))return!1;return!0}function dJ(i,r,n){let a=1/(1<<n.canonical.z),o=(1220703125e-13*r.x+n.canonical.x)*a+n.wrap,s=(1220703125e-13*r.y+n.canonical.y)*a;return{min:new eQ((1220703125e-13*i.x+n.canonical.x)*a+n.wrap,(1220703125e-13*i.y+n.canonical.y)*a),max:new eQ(o,s)}}function d1(i,r,n,a,o,s,l){let u=i.indices,c=i.vertices,d=[];for(let h=a;h<a+o;h+=3){let a=r[n[h+0]+s],o=r[n[h+1]+s],f=r[n[h+2]+s],p=Math.min(a.x,o.x,f.x),m=Math.max(a.x,o.x,f.x),g=Math.min(a.y,o.y,f.y),_=Math.max(a.y,o.y,f.y);d.length=0,i.grid.query(new eQ(p,g),new eQ(m,_),d);for(let i=0;i<d.length;i++){let r=d[i];if(lG(c[u[3*r+0]],c[u[3*r+1]],c[u[3*r+2]],a,o,f,l))return!0}}return!1}function d0(i,r,n,a){let o=Math.pow(2,a.z-n.z);return new eQ((i+8192*n.x)*o-8192*a.x,(r+8192*n.y)*o-8192*a.y)}function d2(i,r){let n=[];r.grid.queryPoint(i,n);let a=r.indices,o=r.vertices;for(let r=0;r<n.length;r++){let s=n[r];if(lB([o[a[3*s+0]],o[a[3*s+1]],o[a[3*s+2]]],i))return!0}return!1}class d5{constructor(i,r){this.lastParams=null,this.lastAllFeaturesIndex=-2,this.appearancesVersion=r,this.appearances=i;const n=i.map(i=>(function(i){if(!i.condition)return{featureDependent:!1,stateDependent:!1,zoomDependent:!1,pitchDependent:!1,brightnessDependent:!1,worldviewDependent:!1};let r=i.condition.expression;return{featureDependent:!rK(r),stateDependent:!rX(r),zoomDependent:!rQ(r,["zoom"]),pitchDependent:!rQ(r,["pitch"]),brightnessDependent:!rQ(r,["brightness","measure-light"]),worldviewDependent:!rQ(r,["worldview"])}})(i));this.anyFeatureDependent=n.some(i=>i.featureDependent),this.anyStateDependent=n.some(i=>i.stateDependent)}update(i,r){let n=this.lastParams,a=!n||n.zoom!==i.zoom||n.pitch!==(i.pitch||0)||n.brightness!==(i.brightness||0)||n.worldview!==i.worldview;this.lastParams={zoom:i.zoom,pitch:i.pitch||0,brightness:i.brightness||0,worldview:i.worldview};let o=r&&this.anyStateDependent;if(!a&&!o&&-2!==this.lastAllFeaturesIndex)return{kind:"no-changes"};if(!this.anyFeatureDependent&&!o){let r=this.evaluateAllFeatures(i);return r===this.lastAllFeaturesIndex?{kind:"no-changes"}:(this.lastAllFeaturesIndex=r,{kind:"all-features",appearanceIndex:r})}return{kind:"per-feature"}}evaluateAllFeatures(i){for(let r=0;r<this.appearances.length;r++){let n=this.appearances[r];if(n.condition&&n.condition.evaluate(i,void 0,void 0,void 0))return r}return -1}}let d4=lR.types,d9=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function d3(i,r,n,a,o,s,l,u,c,d,h,f,p){let m=u?Math.min(32640,Math.round(u[0])):0,g=u?Math.min(32640,Math.round(u[1])):0;i.emplaceBack(r,n,Math.round(32*a),Math.round(32*o),s,l,(m<<1)+ +!!c,0+(g<<1),16*d,16*h,256*f,256*p)}function d8(i,r,n){i.emplaceBack(r,n)}function d6(i,r,n,a,o,s,l){i.emplaceBack(r,n,a,o,s,l)}function d7(i,r,n,a,o){i.emplaceBack(r,n,a,o),i.emplaceBack(r,n,a,o),i.emplaceBack(r,n,a,o),i.emplaceBack(r,n,a,o)}class he{constructor(i){this.layoutVertexArray=new sf,this.indexArray=new sw,this.programConfigurations=i,this.segments=new s1,this.dynamicLayoutVertexArray=new sm,this.opacityVertexArray=new sg,this.placedSymbolArray=new sB,this.iconTransitioningVertexArray=new s_,this.globeExtVertexArray=new sp,this.zOffsetVertexArray=new sr,this.orientationVertexArray=new sS,this.symbolInstanceIndices=[],this.uboBinder=null,this.featureIdArray=new sr,this.featureIdBuffer=null,this.cachedBatchIndices=null,this.cachedBatchSegments=null}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length&&0===this.iconTransitioningVertexArray.length}getBatchGrouping(i){let r=i.get().length===this.segments.get().length;if(r&&this.cachedBatchIndices&&this.cachedBatchSegments)return{batchIndices:this.cachedBatchIndices,batchSegments:this.cachedBatchSegments};let n=new Map;for(let r of i.get()){let i=void 0!==r.batchIndex?r.batchIndex:0;n.has(i)||n.set(i,[]),n.get(i).push(r)}let a=Array.from(n.keys()).sort((i,r)=>i-r),o=new Map;for(let i of a){let r=n.get(i);o.set(i,new s1(r))}return r&&(this.cachedBatchIndices=a,this.cachedBatchSegments=o),{batchIndices:a,batchSegments:o}}
8snapshotSymbolVertexData(i,r){let n=12*i;return this.layoutVertexArray.uint16.slice(n,n+12*r)}restoreSymbolVertexData(i,r){this.layoutVertexArray.uint16.set(r,12*i)}updateSymbolVertexData(i,r,n,a,o,s,l,u,c,d,h,f,p){let m=this.layoutVertexArray.uint16,g=12*i;m[g]=r,m[g+1]=n,m[g+2]=a,m[g+3]=o,m[g+4]=s,m[g+5]=l,m[g+6]=u,m[g+7]=c,m[g+8]=d,m[g+9]=h,m[g+10]=f,m[g+11]=p}upload(i,r,n,a,o,s){this.isEmpty()||(n&&(this.cachedBatchIndices=null,this.cachedBatchSegments=null,this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,ua.members,!!s),this.indexBuffer=i.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=i.createVertexBuffer(this.dynamicLayoutVertexArray,us.members,!0),this.opacityVertexBuffer=i.createVertexBuffer(this.opacityVertexArray,d9,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=i.createVertexBuffer(this.iconTransitioningVertexArray,ud.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=i.createVertexBuffer(this.globeExtVertexArray,uo.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||o)&&(this.zOffsetVertexBuffer=i.createVertexBuffer(this.zOffsetVertexArray,ul.members,!0)),!this.orientationVertexBuffer&&this.orientationVertexArray&&this.orientationVertexArray.length>0&&(this.orientationVertexBuffer=i.createVertexBuffer(this.orientationVertexArray,uc.members,!0)),this.opacityVertexBuffer.itemSize=1,this.featureIdArray.length>0&&(this.featureIdBuffer=i.createVertexBuffer(this.featureIdArray,uu.members,!1))),(n||a)&&(this.programConfigurations.upload(i),this.uboBinder&&this.uboBinder.upload(i)))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.orientationVertexBuffer&&this.orientationVertexBuffer.destroy(),this.featureIdBuffer&&this.featureIdBuffer.destroy(),this.uboBinder&&this.uboBinder.destroy())}}ar(he,"SymbolBuffers",{omit:["cachedBatchIndices","cachedBatchSegments"]});class ht{constructor(i,r,n){this.layoutVertexArray=new i,this.layoutAttributes=r,this.indexArray=new n,this.segments=new s1,this.collisionVertexArray=new sb,this.collisionVertexArrayExt=new sm}upload(i){this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=i.createVertexBuffer(this.collisionVertexArray,uh.members,!0),this.collisionVertexBufferExt=i.createVertexBuffer(this.collisionVertexArrayExt,uf.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.de
8stroy())}}ar(ht,"CollisionBuffers");class hi{constructor(i){this.collisionBoxArray=i.collisionBoxArray,this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(i=>i.fqid),this.index=i.index,this.pixelRatio=i.pixelRatio,this.sourceLayerIndex=i.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=W([]),this.placementViewportMatrix=W([]);const r=this.layers[0]._unevaluatedLayout._values;this.worldview=i.worldview,this.localizable=i.localizable,this.maxUniformBufferBindings=i.maxUniformBufferBindings,this.maxUniformBlockSizeDwords=i.maxUniformBlockSizeDwords,this.disableSymbolUBO=i.disableSymbolUBO,this.textSizeData=uJ(this.zoom,r["text-size"],this.worldview,i.availableImages),this.iconSizeData=uJ(this.zoom,r["icon-size"],this.worldview,i.availableImages);const n=this.layers[0].layout,a=n.get("symbol-sort-key"),o=n.get("symbol-z-order");this.lut=i.lut,this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==o&&void 0!==a.constantOr(1),this.sortFeaturesByY=("viewport-y"===o||"auto"===o&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=n.get("text-writing-mode").map(i=>uF[i]),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.sourceID=i.sourceID,this.projection=i.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=!1,this.elevationType="none",this.activeReplacements=[],this.replacementUpdateTime=0,this.hasAnySecondaryIcon=!1,this.hasAppearances=null,this.featureAppearances=null,this.featureAppearanceData=new Map}hasAnyAppearanceLayoutProperty(i){let r=this.layers[0].getAppearances();if(!r||0===r.length)return!1;let n=Array.isArray(i)?i:[i];return r.some(i=>n.some(r=>i.hasLayoutProperty(r)))}getAppearanceFeatureData(i){return this.featureAppearanceData.get(i)}createArrays(){this.text=new he(new lg(this.layers,{zoom:this.zoom,lut:this.lut},i=>i.startsWith("text")||i.startsWith("symbol"))),this.icon=new he(new lg(this.layers,{zoom:this.zoom,lut:this.lut},i=>i.startsWith("icon")||i.startsWith("symbol"))),this.disableSymbolUBO||(this.text.uboBinder=new uw(this.layers[0],this.zoom,this.lut,!0,"",this.maxUniformBufferBindings,this.maxUniformBlockSizeDwords),this.icon.uboBinder=new uw(this.layers[0],this.zoom,this.lut,!1,"",this.maxUniformBufferBindings,this.maxUniformBlockSizeDwords)),this.glyphOffsetArray=new sH,this.lineVertexArray=new sG,this.symbolInstances=new sV}calculateGlyphDependencies(i,r,n,a,o){for(let n of i){let i=n.codePointAt(0);if(void 0===i)break;if(r[i]=!0,a&&o&&i<=65535){let i=uT[n];i&&(r[i.charCodeAt(0)]=!0)}}}calculateEffectiveAppearanceIconSize(i,r,n,a,o,s,l){if(!i.hasLayoutProperty("icon-size"))return l*s;let u=1,c=i.getUnevaluatedLayoutProperty("icon-size"),d=uJ(this.zoom,c,this.worldview,o),h=u0(d,r);if("constant"!==d.kind&&"camera"!==d.kind||(u=h.uSize),"composite"===d.kind){let{minZoom:i,maxZoom:r}=d,s=c.possiblyEvaluate(new aZ(i,{worldview:this.worldview}),a),l=c.possiblyEvaluate(new aZ(r,{worldview:this.worldview}),a),f=s.evaluate(n,{},a,o);u=f+(l.evaluate(n,{},a,o)-f)*h.uSizeT}return"source"===d.kind&&(u=c.possiblyEvaluate(new aZ(this.zoom,{worldview:this.worldview}),a).evaluate(n,{},a,o)),u*s}updateFootprints(i,r){}updateReplacement(i,r){if(r.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=r.updateTime;let n=r.getReplacementRegionsForTile(i.toUnwrapped(),!0);return!dQ(this.activeReplacements,n)&&(this.activeReplacements=n,!0)}getResolvedImageFromTokens(i){return"string"==typeof i?iJ.build(i):i}populate(i,r,n,a){let o=this.layers[0],s=o.layout,l="globe"===this.projection.name,u=s.get("text-font"),c=s.get("text-field"),d=s.get("icon-image"),[h,f]=s.get("icon-size-scale-range"),p=ts(r.scaleFactor||1,h,f),[m,g]=s.get("text-size-scale-range"),_=ts(r.scaleFactor||1,m,g),y=("constant"!==c.value.kind||c.value.value instanceof iX&&!c.value.value.isEmpty()||c.value.value.toString().length>0)&&("constant"!==u.value.kind||u.value.value.length>0),v="constant"!==d.value.kind||!!d.value.value||Object.keys(d.parameters).length>0,x=this.hasAnyAppearanceLayoutProperty("icon-image"),b=s.get("symbol-sort-key");if(this.features=[],this.featureAppearanceData=new Map,!y&&!v&&!x)return;let w=r.iconDependencies,T=r.glyphDependencies,E=r.availableImages,S=new aZ(this.zoom,{worldview:this.worldview,activeFloors:r.activeFloors}),A=i=>{let r=i.id.toString();w.has(r)?w.get(r).push(i):w.set(r,[i])};for(let r of i){let i,c,{feature:d,id:h,index:f,sourceLayerIndex:m}=r,g=o._featureFilter.needGeometry,C=o5(d,g);if(!o._featureFilter.filter(S,C,n))continue;if(g||(C.geometry=o2(d,n,a)),l&&1!==d.type&&n.z<=5){let i=C.geometry,r=(i,r)=>.98078528056>eT(dl(i.x,i.y,n,1),dl(r.x,r.y,n,1));for(let n=0;n<i.length;n++)i[n]=function(i,r){let n=i[0],a=[n];for(let o=1;o<i.length;o++){let s=i[o];(function i(r,n,a,o){if(o(n,a)){let s=n.add(a)._mult(.5);i(r,n,s,o),i(r,s,a,o)}else r.push(a)})(a,n,s,r),n=s}return a}(i[n],r)}if(y){let r=o.getValueAndResolveTokens("text-field",C,n,E),a=iX.factory(r);(function(i){for(let r of i.sections)if(function(i){for(let r of i)if(aN(r.charCodeAt(0)))return!0;return!1}(r.text))return!0;return!1})(a)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===aq()||this.hasRTLText&&aW.isParsed())&&(i=function(i,r,n){return i.sections.forEach(i=>
8{var a;let o;a=i.text,"uppercase"===(o=r.layout.get("text-transform").evaluate(n,{}))?a=a.toLocaleUpperCase():"lowercase"===o&&(a=a.toLocaleLowerCase()),aW.applyArabicShaping&&(a=aW.applyArabicShaping(a)),i.text=a}),i}(a,o,C))}if(v){let i=o.getValueAndResolveTokens("icon-image",C,n,E);c=this.getResolvedImageFromTokens(i)}let I=this.layers[0],k=!1;if(!c&&x){for(let i of I.getAppearances())if(i.getLayoutProperty("icon-image")){let r=I.getAppearanceValueAndResolveTokens(i,"icon-image",C,n,E);if(r){c=this.getResolvedImageFromTokens(r),k=!0;break}}}if(!i&&!c)continue;let R=this.sortFeaturesByKey?b.evaluate(C,{},n):void 0,M={id:h,text:i,icon:c,index:f,sourceLayerIndex:m,geometry:C.geometry,properties:d.properties,type:d4[d.type],sortKey:R};if(this.features.push(M),this.featureAppearanceData.set(f,{id:h,properties:d.properties,usesAppearanceIconAsPlaceholder:k}),c){let i=I._unevaluatedLayout._values,{iconPrimary:r,iconSecondary:a}=cN(c,this.iconSizeData,i["icon-size"],n,this.zoom,M,this.pixelRatio,p,this.worldview,E);A(r),a&&(this.hasAnySecondaryIcon=!0,A(a))}let L=I.getAppearances();if(0!==L.length&&L.forEach(i=>{if(!i.getLayoutProperty("icon-image"))return;let r=this.getCombinedIconPrimary(i,I,C,n,E,M,p);r&&A(r)}),i){let r=u.evaluate(C,{},n).join(","),a="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement");for(let n of(this.allowVerticalPlacement=this.writingModes&&this.writingModes.includes(uF.vertical),i.sections))if(n.image){let i=n.image.getPrimary().scaleSelf(this.pixelRatio*_),r=i.id.toString(),a=w.get(r)||[];a.push(i),w.set(r,a)}else{let o=aO(i.toString()),s=n.fontStack||r,l=T[s]=T[s]||{};this.calculateGlyphDependencies(n.text,l,a,this.allowVerticalPlacement,o)}}}"line"===s.get("symbol-placement")&&(this.features=function(i){let r={},n={},a=[],o=0;function s(r){a.push(i[r]),o++}function l(i,r,o){let s=n[i];return delete n[i],n[r]=s,a[s].geometry[0].pop(),a[s].geometry[0]=a[s].geometry[0].concat(o[0]),s}function u(i,n,o){let s=r[n];return delete r[n],r[i]=s,a[s].geometry[0].shift(),a[s].geometry[0]=o[0].concat(a[s].geometry[0]),s}function c(i,r,n){let a=n?r[0].at(-1):r[0][0];return`${i}:${a.x}:${a.y}`}for(let d=0;d<i.length;d++){let h=i[d],f=h.geometry,p=h.text?h.text.toString():null;if(!p){s(d);continue}let m=c(p,f),g=c(p,f,!0);if(m in n&&g in r&&n[m]!==r[g]){let i=u(m,g,f),o=l(m,g,a[i].geometry);delete r[m],delete n[g],n[c(p,a[o].geometry,!0)]=o,a[i].geometry=null}else m in n?l(m,g,f):g in r?u(m,g,f):(s(d),r[m]=o-1,n[g]=o-1)}return a.filter(i=>i.geometry)}(this.features)),"hd-road-markup"===s.get("symbol-elevation-reference")?(this.elevationType="road",this.hdExt&&r.elevationFeatures&&r.elevationFeatures.length>0&&this.hdExt.addElevationFeatures(r.elevationFeatures)):s.get("symbol-z-elevate")&&(this.elevationType="offset"),"none"!==this.elevationType&&(this.zOffsetBuffersNeedUpload=!0),this.sortFeaturesByKey&&this.features.sort((i,r)=>i.sortKey-r.sortKey)}getCombinedIconPrimary(i,r,n,a,o,s,l){let u,c;if(i.hasLayoutProperty("icon-image")){let s=r.getAppearanceValueAndResolveTokens(i,"icon-image",n,a,o);u=this.getResolvedImageFromTokens(s)}else{let i=r.getValueAndResolveTokens("icon-image",n,a,o);u=this.getResolvedImageFromTokens(i)}if(u){let n=i.hasLayoutProperty("icon-size")?i.getUnevaluatedLayoutProperty("icon-size"):r._unevaluatedLayout._values["icon-size"];c=cN(u,uJ(this.zoom,n,this.worldview,o),n,a,this.zoom,s,this.pixelRatio,l,this.worldview,o).iconPrimary}return c}updateSymbolInstanceIconVertices(i,r,n,a,o,s){let{canonical:l,availableImages:u,globalProperties:c,layer:d,iconScaleFactor:h,featureState:f,layoutIconOffset:p,layoutIconSize:m,layoutIconRotate:g}=s;if(i.placedIconSymbolIndex<0)return{vertexOffsetDelta:0,hasChanges:!1};if(r.activeAppearanceIndex===n)return{vertexOffsetDelta:i.numIconVertices,hasChanges:!1};let _=n>=0?d.appearances[n]:null;if(_){let n=this.getCombinedIconPrimary(_,d,a,l,u,{sortKey:void 0,text:void 0,icon:null,index:i.featureIndex,sourceLayerIndex:i.featureIndex,geometry:[],properties:r.properties,type:"Point",id:r.id},h);if(!n)return{vertexOffsetDelta:0,hasChanges:!1};let s=n.toString(),y=this.iconAtlasPositions&&this.iconAtlasPositions.get(s);if(y){let{appearanceIconOffset:n,appearanceIconRotate:s}=cP(_,d,a,l,p,g,m,h),v=uY(y,void 0,n,d.layout.get("icon-anchor").evaluate(a,f,l)),x=y.sdf,b=d.layout.get("icon-text-fit").constantOr("none");"none"!==b&&r.textShaping&&r.iconTextFitPadding&&r.fontScale&&(v=uZ(v,r.textShaping,b,r.iconTextFitPadding,n,r.fontScale));
8let w=1+(Math.min(32640,Math.round(128*this.calculateEffectiveAppearanceIconSize(_,c.zoom,a,l,u,h,m)))<<1),T=cb(v,s,x,"none"!==b,h);r.isUsingAppearanceIconVertexData||(r.isUsingAppearanceIconVertexData=!0,r.layoutBasedIconVertexData=this.icon.snapshotSymbolVertexData(o,i.numIconVertices));let E=Math.floor(i.numIconVertices/4),S=Math.min(T.length,E),A=o;for(let n=0;n<S;++n){let a=T[n],o=r.layoutBasedIconVertexData[0]||i.tileAnchorX,s=r.layoutBasedIconVertexData[1]||i.tileAnchorY,l=16*a.pixelOffsetTL.x,u=16*a.pixelOffsetTL.y,c=16*a.pixelOffsetBR.x,d=16*a.pixelOffsetBR.y,h=16*a.minFontScaleX,f=16*a.minFontScaleY;this.icon.updateSymbolVertexData(A,o,s,Math.round(32*a.tl.x),Math.round(32*a.tl.y),a.texPrimary.x,a.texPrimary.y,0,w,l,u,h,f),this.icon.updateSymbolVertexData(A+1,o,s,Math.round(32*a.tr.x),Math.round(32*a.tr.y),a.texPrimary.x+a.texPrimary.w,a.texPrimary.y,0,w,c,u,h,f),this.icon.updateSymbolVertexData(A+2,o,s,Math.round(32*a.bl.x),Math.round(32*a.bl.y),a.texPrimary.x,a.texPrimary.y+a.texPrimary.h,0,w,l,d,h,f),this.icon.updateSymbolVertexData(A+3,o,s,Math.round(32*a.br.x),Math.round(32*a.br.y),a.texPrimary.x+a.texPrimary.w,a.texPrimary.y+a.texPrimary.h,0,w,c,d,h,f),A+=4}let C=i.numIconVertices-4*S;for(let i=0;i<C;++i)this.icon.updateSymbolVertexData(A+i,0,0,0,0,0,0,0,0,0,0,0,0);return{vertexOffsetDelta:i.numIconVertices,hasChanges:!0}}}else{if(r.usesAppearanceIconAsPlaceholder)return this.icon.updateSymbolVertexData(o,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateSymbolVertexData(o+1,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateSymbolVertexData(o+2,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateSymbolVertexData(o+3,0,0,0,0,0,0,0,0,0,0,0,0),{vertexOffsetDelta:i.numIconVertices,hasChanges:!0};if(r.isUsingAppearanceIconVertexData)return this.icon.restoreSymbolVertexData(o,r.layoutBasedIconVertexData),r.isUsingAppearanceIconVertexData=!1,{vertexOffsetDelta:r.layoutBasedIconVertexData.length/12,hasChanges:!0}}return{vertexOffsetDelta:i.numIconVertices,hasChanges:!1}}updateSymbolInstanceTextVertices(i,r,n,a,o,s){let{canonical:l,layer:u,textScaleFactor:c,imageMap:d,featureState:h,layoutTextOffset:f,layoutTextSize:p,layoutTextRotate:m,layoutMinZoomSize:g,layoutMaxZoomSize:_,layoutTextSizeMinZoom:y,layoutTextSizeMaxZoom:v,availableImages:x}=s,b=i.numHorizontalGlyphVertices>0||i.numVerticalGlyphVertices>0;if(!b)return{vertexOffsetDelta:b?i.numHorizontalGlyphVertices+i.numVerticalGlyphVertices:0,hasChanges:!1};if(r.activeAppearanceIndex===n)return{vertexOffsetDelta:i.numHorizontalGlyphVertices+i.numVerticalGlyphVertices,hasChanges:!1};let w=n>=0?u.appearances[n]:null;if(w&&r.textShaping){let{appearanceTextOffset:n,appearanceTextRotate:s,appearanceTextSize:b}=cO(w,u,a,l,f,m,p);r.fontScale=b*r.textScaleFactor/24;let T=w.getUnevaluatedLayoutProperty("text-size"),E=this.textSizeData,S=y,A=v;w.hasLayoutProperty("text-size")&&(E=uJ(this.zoom,T,this.worldview,x),S="composite"===this.textSizeData.kind?this.textSizeData.minZoom:0,A="composite"===this.textSizeData.kind?this.textSizeData.maxZoom:0);let C=r.textShaping.bottom-f[1],I=r.textShaping.left-f[0],k=r.textShaping.right-f[0];r.textShaping.top=n[1]+(r.textShaping.top-f[1]),r.textShaping.bottom=n[1]+C,r.textShaping.left=n[0]+I,r.textShaping.right=n[0]+k;let R=cS(0,r.textShaping,n,u,!1,a,d,this.allowVerticalPlacement,s),M=b&&"composite"===E.kind?T.possiblyEvaluate(new aZ(S,{}),l).evaluate(a,h,l):g,L=b&&"composite"===E.kind?T.possiblyEvaluate(new aZ(A,{}),l).evaluate(a,h,l):_,P=cV(w.name,E,b,c,M,L),O=1+(Math.min(32640,Math.round((Array.isArray(P)?P[1]:b)*128))<<1);r.isUsingAppearanceTextVertexData||(r.isUsingAppearanceTextVertexData=!0,r.layoutBasedTextVertexData=this.text.snapshotSymbolVertexData(o,i.numHorizontalGlyphVertices+i.numVerticalGlyphVertices));for(let r=0;r<R.length&&r<(i.numHorizontalGlyphVertices+i.numVerticalGlyphVertices)/4;++r){let n=R[r],a=n.glyphOffset[1],s=i.tileAnchorX,l=i.tileAnchorY,u=o+4*r;this.text.updateSymbolVertexData(u,s,l,Math.round(32*n.tl.x),Math.round(32*(a+n.tl.y)),n.texPrimary.x,n.texPrimary.y,0,O,n.pixelOffsetTL.x,n.pixelOffsetTL.y,n.minFontScaleX,n.minFontScaleY),this.text.updateSymbolVertexData(u+1,s,l,Math.round(32*n.tr.x),Math.round(32*(a+n.tr.y)),n.texPrimary.x+n.texPrimary.w,n.texPrimary.y,0,O,n.pixelOffsetBR.x,n.pixelOffsetTL.y,n.minFontScaleX,n.minFontScaleY),this.text.updateSymbolVertexData(u+2,s,l,Math.round(32*n.bl.x),Math.round(32*(a+n.bl.y
8)),n.texPrimary.x,n.texPrimary.y+n.texPrimary.h,0,O,n.pixelOffsetTL.x,n.pixelOffsetBR.y,n.minFontScaleX,n.minFontScaleY),this.text.updateSymbolVertexData(u+3,s,l,Math.round(32*n.br.x),Math.round(32*(a+n.br.y)),n.texPrimary.x+n.texPrimary.w,n.texPrimary.y+n.texPrimary.h,0,O,n.pixelOffsetBR.x,n.pixelOffsetBR.y,n.minFontScaleX,n.minFontScaleY)}return{vertexOffsetDelta:i.numHorizontalGlyphVertices+i.numVerticalGlyphVertices,hasChanges:!0}}return r.isUsingAppearanceTextVertexData?(this.text.restoreSymbolVertexData(o,r.layoutBasedTextVertexData),r.isUsingAppearanceTextVertexData=!1,{vertexOffsetDelta:r.layoutBasedTextVertexData.length/12,hasChanges:!0}):{vertexOffsetDelta:i.numHorizontalGlyphVertices+i.numVerticalGlyphVertices,hasChanges:!1}}updateExpressions(i){this.text&&this.text.programConfigurations.updateExpressions(i),this.icon&&this.icon.programConfigurations.updateExpressions(i)}update(i,r,n,a,o,s,l,u){if(this.text.uboBinder||this.text.programConfigurations.updatePaintArrays(i,r,o,n,a,s,l,this.worldview),this.icon.uboBinder||this.icon.programConfigurations.updatePaintArrays(i,r,o,n,a,s,l,this.worldview),u){if(s)for(let a of[this.text.uboBinder,this.icon.uboBinder])a&&!a.isLightConstant&&a.updateDynamicExpressions(o[0],r,u,n,i,l);else if(Object.keys(i).length>0){let a=o[0],s=[this.text.uboBinder,this.icon.uboBinder].filter(i=>i&&i.hasStateDependentPaint(a));if(s.length>0){let o=new Set(Object.keys(i).map(i=>{let r=Number(i);return!isNaN(r)&&Number.isSafeInteger(r)&&String(r)===i?r:i}));for(let c of s)c.updateFeatures(o,a,r,u,n,i,l)}}}}updateZOffset(){let i=(i,r,a)=>{(n+=r)>i.length&&i.resize(n);for(let o=-r;o<0;o++)i.emplace(o+n,a)},r=(i,r,n)=>{(a+=r)>i.length&&i.resize(a);for(let o=-r;o<0;o++)i.emplace(o+a,n)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let n=0,a=0;for(let n=0;n<this.symbolInstances.length;n++){let a=this.symbolInstances.get(n),{numHorizontalGlyphVertices:o,numVerticalGlyphVertices:s,numIconVertices:l}=a,u=a.zOffset,c=l>0;if((o>0||s>0)&&(i(this.text.zOffsetVertexArray,o,u),i(this.text.zOffsetVertexArray,s,u)),c){let{placedIconSymbolIndex:i,verticalPlacedIconSymbolIndex:n}=a;i>=0&&r(this.icon.zOffsetVertexArray,l,u),n>=0&&r(this.icon.zOffsetVertexArray,a.numVerticalIconVertices,u)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(i,r,n,a,o){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(i),this.iconCollisionBox.upload(i)),this.text.upload(i,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload,this.hasAppearances),null===this.hasAppearances&&(this.hasAppearances=this.layers.some(i=>i.appearances&&i.appearances.length>0)),this.icon.upload(i,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload,this.hasAppearances),this.uploaded=!0}updateAppearances(i,r,n,a,o,s=!1){let l={hasLayoutChanges:!1,hasUboChanges:!1};if(!i||!n||!this.featureAppearanceData)return l;let u=r||{},c=this.icon.layoutVertexArray&&this.icon.layoutVertexArray.length>0&&this.icon.layoutVertexArray.arrayBuffer,d=this.text.layoutVertexArray&&this.text.layoutVertexArray.length>0&&this.text.layoutVertexArray.arrayBuffer;if(!c&&!d)return l;let h=this.layers[0],f=h.layout;this.featureAppearances&&this.featureAppearances.appearancesVersion===h.appearancesVersion||(this.featureAppearances=new d5(h.appearances,h.appearancesVersion));let p=this.featureAppearances.update(a,s);if("no-changes"===p.kind)return l;let m=1,g=0,_=!1,y=!1;if(c){let[i,r]=f.get("icon-size-scale-range");m=ts(1,i,r)}let v=1,x=0,b=!1;if(d){let[i,r]=f.get("text-size-scale-range");v=ts(1,i,r)}let w=new Map;if(o&&n)for(let i of n){let r=o.getImage(i,h.scope);if(r){let n=new iQ(i.toString());w.set(n.toString(),r)}}let T=[this.text.uboBinder,this.icon.uboBinder];for(let r=0;r<this.symbolInstances.length;r++){let o,s=this.symbolInstances.get(r),l=this.getAppearanceFeatureData(s.featureIndex);if(!l)continue;let E=l.id,S=void 0!==E?u[String(E)]:void 0,A={type:"Point",id:l.id,properties:l.properties,geometry:[]};if("all-features"===p.kind)o=p.appearanceIndex;else{let r=h.appearances?h.appearances.findIndex(r=>
8r.isActive({globals:a,feature:A,canonical:i,featureState:S})):-1;o=r>=0?r:-1}let C=l.activeAppearanceIndex!==o;if(d){let r=f.get("text-size"),a="composite"===this.textSizeData.kind?this.textSizeData.minZoom:0,u="composite"===this.textSizeData.kind?this.textSizeData.maxZoom:0,c={canonical:i,layer:h,featureState:S,availableImages:n,textScaleFactor:v,imageMap:w,layoutTextOffset:f.get("text-offset").evaluate(A,S,i).map(i=>24*i),layoutTextSize:r.evaluate(A,S,i),layoutTextRotate:f.get("text-rotate").evaluate(A,S,i),layoutMinZoomSize:r.evaluate(A,{zoom:a},i),layoutMaxZoomSize:r.evaluate(A,{zoom:u},i),layoutTextSizeMinZoom:a,layoutTextSizeMaxZoom:u},d=this.updateSymbolInstanceTextVertices(s,l,o,A,x,c);x+=d.vertexOffsetDelta,b=b||d.hasChanges}if(c){let r={canonical:i,layer:h,featureState:S,availableImages:n,globalProperties:a,iconScaleFactor:m,layoutIconOffset:f.get("icon-offset").evaluate(A,S,i),layoutIconSize:f.get("icon-size").evaluate(A,S,i,n),layoutIconRotate:f.get("icon-rotate").evaluate(A,S,i)},u=this.updateSymbolInstanceIconVertices(s,l,o,A,g,r);g+=u.vertexOffsetDelta,_=_||u.hasChanges}if(C){let r=s.featureIndex,l=a?a.brightness:null,u=S||{},c=o>=0?h.appearances[o]:null;for(let a of T)a&&(a.layer=h,y=a.updateFeaturePaintForAppearance(r,A,u,i,n,l,c)||y)}l.activeAppearanceIndex=o}return _&&this.icon.layoutVertexBuffer&&null!==this.icon.layoutVertexArray.arrayBuffer&&this.icon.layoutVertexArray.length===this.icon.layoutVertexBuffer.length&&this.icon.layoutVertexBuffer.updateData(this.icon.layoutVertexArray),b&&this.text.layoutVertexBuffer&&null!==this.text.layoutVertexArray.arrayBuffer&&this.text.layoutVertexArray.length===this.text.layoutVertexBuffer.length&&this.text.layoutVertexBuffer.updateData(this.text.layoutVertexArray),{hasLayoutChanges:_||b,hasUboChanges:y}}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=d$(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(i,r){let n=this.lineVertexArray.length;if(void 0!==i.segment)for(let{x:i,y:n}of r)this.lineVertexArray.emplaceBack(i,n);return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v){let x=i.indexArray,b=i.layoutVertexArray,w=i.globeExtVertexArray,T=i.uboBinder?i.uboBinder.getCurrentBatchIndex():void 0,E=i.segments.prepareSegment(4*v,b,x,this.canOverlap?s.sortKey:void 0,T),S=this.glyphOffsetArray.length,A=E.vertexLength,C=this.allowVerticalPlacement&&l===uF.vertical?Math.PI/2:0,I=s.text&&s.text.sections,k=b.length,R=-1;for(let a=0;a<r.length;a++){let{tl:o,tr:l,bl:d,br:h,texPrimary:f,texSecondary:y,pixelOffsetTL:v,pixelOffsetBR:T,minFontScaleX:S,minFontScaleY:A,glyphOffset:M,isSDF:L,sectionIndex:P}=r[a],O=E.vertexLength,D=M[1];if(d3(b,c.x,c.y,o.x,D+o.y,f.x,f.y,n,L,v.x,v.y,S,A),d3(b,c.x,c.y,l.x,D+l.y,f.x+f.w,f.y,n,L,T.x,v.y,S,A),d3(b,c.x,c.y,d.x,D+d.y,f.x,f.y+f.h,n,L,v.x,T.y,S,A),d3(b,c.x,c.y,h.x,D+h.y,f.x+f.w,f.y+f.h,n,L,T.x,T.y,S,A),u){let{x:r,y:n,z:a}=u.anchor,[o,s,l]=u.up;d6(w,r,n,a,o,s,l),d6(w,r,n,a,o,s,l),d6(w,r,n,a,o,s,l),d6(w,r,n,a,o,s,l),d7(i.dynamicLayoutVertexArray,r,n,a,C)}else d7(i.dynamicLayoutVertexArray,c.x,c.y,c.z,C);if(_){let r=y||f;d8(i.iconTransitioningVertexArray,r.x,r.y),d8(i.iconTransitioningVertexArray,r.x+r.w,r.y),d8(i.iconTransitioningVertexArray,r.x,r.y+r.h),d8(i.iconTransitioningVertexArray,r.x+r.w,r.y+r.h)}if(x.emplaceBack(O,O+1,O+2),x.emplaceBack(O+1,O+2,O+3),E.vertexLength+=4,E.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(M[0]),(a===r.length-1||P!==r[a+1].sectionIndex)&&(i.uboBinder||i.programConfigurations.populatePaintArrays(b.length,s,s.index,{},p,m,g,I&&I[P],this.worldview),i.uboBinder)){let r=i.uboBinder.populateUBO(s,s.index,m,p,g,I&&I[P]);R=r;let n=b.length-k;for(let a=0;a<n;a++)i.featureIdArray.emplaceBack(r);k=b.length}}let M=v-r.length;if(0!==M&&(this._addNullVertices(M,b,n,u,w,i,_,E,x),i.uboBinder&&R>=0)){let r=4*M;for(let n=0;n<r;n++)i.featureIdArray.emplaceBack(R)}let L=u?u.anchor:c;i.placedSymbolArray.emplaceBack(L.x,L.y,L.z,c.x,c.y,S,this.glyphOffsetArray.length-S,A,d,h,c.segment,n?n[0]:0,n?n[1]:0,a[0],a[1],l,0,0,0,f,0),i.symbolInstanceIndices.push(y)}_addNullVertices(i,r,n,a,o,s,l,u,c){for(let d=0;d<i;d++){for(let i=0;i<4;i++)d3(r,0,0,0,0,0,0,n,!1,0,0,0,0),a&&d6(o,0,0,0,0,0,0),d7(s.dynamicLayoutVertexArray,0,0,0,0),l&&d8(s.iconTransitioningVertexArray,0,0);let i=u.vertexLength;c.emplaceBack(i,i+1,i+2),c.emplaceBack(i+1,i+2,i+3),u.vertexLength+=4,u.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(0)}}_commitLayoutVertex(i,r,n,a,o,s,l){i.emplaceBack(r,n,a,o,s,Math.round(l.x),Math.round(l.y))}_addCollisionDebugVertices(i,r,n,a,o,s,l){let u=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),c=u.vertexLength,d=l.tileAnchorX,h=l.tileAnchorY;for(let i=0;i<4;i++)n.collisionVertexArray.emplaceBack(0,0,0,0,0,0);this._commitDebugCollisionVertexUpdate(n.collisionVertexArrayExt,r,i.padding,l.zOffset),this._commitLayoutVertex(n.layoutVertexArray,a,o,s,d,h,new eQ(i.x1,i.y1)),this._commitLayoutVertex(n.layoutVertexArray,a,o,s,d,h,new eQ(i.x2,i.y1)),this._commitLayoutVertex(n.layoutVertexArray,a,o,s,d,h,new eQ(i.x2,i.y2)),this._commitLayoutVertex(n.layoutVertexArray,a,o,s,d,h,new eQ(i.x1,i.y2)),u.vertexLength+=4;let f=n.indexArray;f.emplaceBack(c,c+1),f.emplaceBack(c+1,c+2),f.emplaceBack(c+2,c+3),f.emplaceBack(c+3,c),u.primitiveLength+=4}_addTextDebugCollisionBoxes(i,r,n,a,o,s){for(let l=a;l<o;l++){let a=n.get(l),o=this.getSymbolInstanceTextSize(i,s,r,l);this._addCollisionDebugVertices(a,o,this.textCollisionBox,a.projectedAnchorX,a.projectedAnchorY,a.projectedAnchorZ,s)}}_addIconDebugCollisionBoxes(i,r,n,a,o,s){for(let l=a;l<o;l++){let a=n.get(l),o=this.getSymbolInstanceIconSize(i,r,s.placedIconSymbolIndex);this._addCollisionDebugVertices(a,o,this.iconCollisionBox,a.projectedAnchorX,a.projectedAnchorY,a.projectedAnchorZ,s)}}generateCollisionDebugBuffers(i,r,n){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ht(sv,up.members,s_),this.iconCollisionBox=new ht(sv,up.members,s_);let a=u0(this.iconSizeData,i),o=u0(this.textSizeData,i,n);for(let n=0;n<this.symbolInstances.length;n++){let s=this.symbolInstances.get(n);this._addTextDebugCollisionBoxes(o,i,r,s.textBoxStartIndex,s.textBoxEndIndex,s),this._addTextDebugCollisionBoxes(o,i,r,s.verticalTextBoxStartIndex,s.verticalTextBoxEndIndex,s),this._addIconDebugCollisionBoxes(a,i,r,s.iconBoxStartIndex,s.iconBoxEndIndex,s),this._addIconDebugCollisionBoxes(a,i,r,s.verticalIconBoxStartIndex,s.verticalIconBoxEndIndex,s)}}getSymbolInstanceTextSize(i,r,n,a){let o=this.text.placedSymbolArray.get(r.rightJustifiedTextSymbolIndex>=0?r.rightJustifiedTextSymbolIndex:r.centerJustifiedTextSymbolIndex>=0?r.centerJustifiedTextSymbolIndex:r.leftJustifiedTextSymbolIndex>=0?r.leftJustifiedTextSymbolIndex:r.verticalPlacedTextSymbolIndex>=0?r.verticalPlacedTextSymbolIndex:a),s=u1(this.textSizeData,i,o)/24;return this.tilePixelRatio*s}getSymbolInstanceIconSize(i,r,n){let a=this.icon.placedSymbolArray.get(n),o=u1(this.iconSizeData,i,a);return this.tilePixelRatio*o}_commitDebugCollisionVertexUpdate(i,r,n,a){i.emplaceBack(r,-n,-n,a),i.emplaceBack(r,n,-n,a),i.emplaceBack(r,n,n,a),i.emplaceBack(r,-n,n,a)}_updateTextDebugCollisionBoxes(i,r,n,a,o,s,l){for(let l=a;l<o;l++){let a=n.get(l),o=this.getSymbolInstanceTextSize(i,s,r,l);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,o,a.padding,s.zOffset)}}_updateIconDebugCollisionBoxes(i,r,n,a,o,s,l){for(let l=a;l<o;l++){let a=n.get(l),o=this.getSymbolInstanceIconSize(i,r,s.placedIconSymbolIndex);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,o,a.padding,s.zOffset)}}updateCollisionDebugBuffers(i,r,n,a){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();let o=u0(this.iconSizeData,i,a),s=u0(this.textSizeData,i,n);for(let l=0;l<this.symbolInstances.length;l++){let u=this.symbolInstances.get(l);this._updateTextDebugCollisionBoxes(s,i,r,u.textBoxStartIndex,u.textBoxEndIndex,u,n),this._updateTextDebugCollisionBoxes(s,i,r,u.verticalTextBoxStartIndex,u.verticalTextBoxEndIndex,u,n),this._updateIconDebugCollisionBoxes(o,i,r,u.iconBoxStartIndex,u.iconBoxEndIndex,u,a),this._updateIconDebugCollisionBoxes(o,i,r,u.verticalIconBoxStartIndex,u.verticalIconBoxEndIndex,u,a)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(i,r,n,a,o,s,l,u,c){let d={};if(r<n){let{x1:n,y1:a,x2:o,y2:s,padding:l,projectedAnchorX:u,projectedAnchorY:c,projectedAnchorZ:h,tileAnchorX:f,tileAnchorY:p,featureIndex:m}=i.get(r);d.textBox={x1:n,y1:a,x2:o,y2:s,padding:l,projectedAnchorX:u,projectedAnchorY:c,projectedAnchorZ:h,tileAnchorX:f,tileAnchorY:p},d.textFeatureIndex=m}if(a<o){let{x1:r,y1:n,x2:o,y2:s,padding:l,projectedAnchorX:u,projectedAnchorY:c,projectedAnchorZ:h,tileAnchorX:f,tileAnchorY:p,featureIndex:m}=i.get(a);d.verticalTextBox={x1:r,y1:n,x2:o,y2:s,padding:l,projectedAnchorX:u,projectedAnchorY:c,projectedAnchorZ:h,tileAnchorX:f,tileAnchorY:p},d.verticalTextFeatureIndex=m}if(s<l){let{x1:r,y1:n,x2:a,y2:o,padding:l,projectedAnchorX:u,projectedAnchorY:c,projectedAnchorZ:h,tileAnchorX:f,tileAnchorY:p,featureIndex:m}=i.get(s);d.iconBox={x1:r,y1:n,x2:a,y2:o,padding:l,projectedAnchorX:u,projectedAnchorY:c,projectedAnchorZ:h,tileAnchorX:f,tileAnchorY:p},d.iconFeatureIndex=m}if(u<c){let{x1:r,y1:n,x2:a,y2:o,padding:s,projectedAnchorX:l,projectedAnchorY:c,projectedAnchorZ:h,tileAnchorX:f,tileAnchorY:p,featureIndex:m}=i.get(u);d.verticalIconBox={x1:r,y1:n,x2:a,y2:o,padding:s,projectedAnchorX:l,projectedAnchorY:c,projectedAnchorZ:h,tileAnchorX:f,tileAnchorY:p},d.verticalIconFeatureIndex=m}return d}deserializeCollisionBoxes(i){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){let n=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(i,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(i,r){let n=i.placedSymbolArray.get(r),a=n.vertexStartIndex+4*n.numGlyphs;for(let r=n.vertexStartIndex;r<a;r+=4)i.indexArray.emplaceBack(r,r+1,r+2),i.indexArray.emplaceBack(r+1,r+2,r+3)}
8getSortedSymbolIndexes(i){if(this.sortedAngle===i&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;let r=Math.sin(i),n=Math.cos(i),a=[],o=[],s=[];for(let i=0;i<this.symbolInstances.length;++i){s.push(i);let l=this.symbolInstances.get(i);a.push(0|Math.round(r*l.tileAnchorX+n*l.tileAnchorY)),o.push(l.featureIndex)}return s.sort((i,r)=>a[i]-a[r]||o[r]-o[i]),s}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let i=0;i<this.symbolInstances.length;++i)this.symbolInstanceIndexesSortedZOffset.push(i)}return this.zOffsetSortDirty=!1,this.symbolInstanceIndexesSortedZOffset.sort((i,r)=>this.symbolInstances.get(r).zOffset-this.symbolInstances.get(i).zOffset)}addToSortKeyRanges(i,r){let n=this.sortKeyRanges.at(-1);n&&n.sortKey===r?n.symbolInstanceEnd=i+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:i,symbolInstanceEnd:i+1})}sortFeatures(i){if(this.sortFeaturesByY&&this.sortedAngle!==i)if(this.text.segments.get().length>1||this.icon.segments.get().length>1)this.sortFeaturesWithinSegments();else{for(let r of(this.symbolInstanceIndexes=this.getSortedSymbolIndexes(i),this.sortedAngle=i,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[],this.symbolInstanceIndexes)){let i=this.symbolInstances.get(r);this.featureSortOrder.push(i.featureIndex);let{rightJustifiedTextSymbolIndex:n,centerJustifiedTextSymbolIndex:a,leftJustifiedTextSymbolIndex:o,verticalPlacedTextSymbolIndex:s,placedIconSymbolIndex:l,verticalPlacedIconSymbolIndex:u}=i;n>=0&&this.addIndicesForPlacedSymbol(this.text,n),a>=0&&a!==n&&this.addIndicesForPlacedSymbol(this.text,a),o>=0&&o!==a&&o!==n&&this.addIndicesForPlacedSymbol(this.text,o),s>=0&&this.addIndicesForPlacedSymbol(this.text,s),l>=0&&this.addIndicesForPlacedSymbol(this.icon,l),u>=0&&this.addIndicesForPlacedSymbol(this.icon,u)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}getOrCreateSortedSymbolsByBatch(i,r){let n=(this.text.uboBinder&&this.text.uboBinder.maxFeaturesPerBatch>0?this.text.uboBinder:this.icon.uboBinder&&this.icon.uboBinder.maxFeaturesPerBatch>0?this.icon.uboBinder:null).maxFeaturesPerBatch;if(this.symbolsByBatch)for(let n of this.symbolsByBatch.values())for(let a of n){let n=this.symbolInstances.get(a.index);a.rotatedY=0|Math.round(i*n.tileAnchorX+r*n.tileAnchorY)}else{this.symbolsByBatch=new Map;for(let a=0;a<this.symbolInstances.length;a++){let o=this.symbolInstances.get(a),s=Math.floor(a/n),l=0|Math.round(i*o.tileAnchorX+r*o.tileAnchorY);this.symbolsByBatch.has(s)||this.symbolsByBatch.set(s,[]),this.symbolsByBatch.get(s).push({index:a,rotatedY:l,featureIndex:o.featureIndex})}}for(let i of this.symbolsByBatch.values())i.sort((i,r)=>i.rotatedY-r.rotatedY||r.featureIndex-i.featureIndex);return this.symbolsByBatch}rebuildTextSegmentIndices(i,r){for(let n of i){let i=n.batchIndex;if(void 0===i)continue;let a=r.get(i);if(!a){n.primitiveOffset=this.text.indexArray.length,n.primitiveLength=0;continue}n.primitiveOffset=this.text.indexArray.length;let o=this.text.indexArray.length;for(let{index:i}of a){let{rightJustifiedTextSymbolIndex:r,centerJustifiedTextSymbolIndex:n,leftJustifiedTextSymbolIndex:a,verticalPlacedTextSymbolIndex:o}=this.symbolInstances.get(i);r>=0&&this.addIndicesForPlacedSymbol(this.text,r),n>=0&&n!==r&&this.addIndicesForPlacedSymbol(this.text,n),a>=0&&a!==n&&a!==r&&this.addIndicesForPlacedSymbol(this.text,a),o>=0&&this.addIndicesForPlacedSymbol(this.text,o)}n.primitiveLength=this.text.indexArray.length-o}}rebuildIconSegmentIndices(i,r){for(let n of i){let i=n.batchIndex;if(void 0===i)continue;let a=r.get(i);if(!a){n.primitiveOffset=this.icon.indexArray.length,n.primitiveLength=0;continue}n.primitiveOffset=this.icon.indexArray.length;let o=this.icon.indexArray.length;for(let{index:i}of a){let{placedIconSymbolIndex:r,verticalPlacedIconSymbolIndex:n}=this.symbolInstances.get(i);r>=0&&this.addIndicesForPlacedSymbol(this.icon,r),n>=0&&this.addIndicesForPlacedSymbol(this.icon,n)}n.primitiveLength=this.icon.indexArray.length-o}}sortFeaturesWithinSegments(){this.featureSortOrder=[];let i=Math.sin(this.sortedAngle),r=Math.cos(this.sortedAngle),n=this.getOrCreateSortedSymbolsByBatch(i,r);for(let i of Array.from(n.keys()).sort((i,r)=>i-r))for(let{index:r}of n.get(i)){let i=this.symbolInstances.get(r);this.featureSortOrder.push(i.featureIndex)}this.text.indexArray.clear(),this.icon.indexArray.clear(),this.rebuildTextSegmentIndices(this.text.segments.get(),n),this.rebuildIconSegmentIndices(this.icon.segments.get(),n),this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}ar(hi,"SymbolBucket",{omit:["layers","collisionBoxArray","compareText","features"]}),hi.addDynamicAttributes=d7;class hr extends lb{constructor(i,r,n){super(i,r,n),this.elevatedLayoutVertexArray=new sr}upload(i){let r=this.uploaded;super.upload(i),!r&&this.elevatedLayoutVertexArray.length>0&&(this.elevatedLayoutVertexBuffer=i.createVertexBuffer(this.elevatedLayoutVertexArray,sX.members))}destroy(){this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy(),super.destroy()}}ar(hr,"ElevatedFillBufferData");class hn{constructor(){this.portals=[]}static isOnBorder(i,r){return i<=0&&r<=0||i>=8192&&r>=8192}static evaluate(i){if(0===i.length)return new hn;let r=[];for(let n of i)r.push(...n.portals);if(0===r.length)return new hn;for(let i of r){let r=i.va,n=i.vb;(hn.isOnBorder(r.x,n.x)||hn.isOnBorder(r.y,n.y))&&(i.type="border")}let n=r.filter(i=>"unevaluated"!==i.type),a=r.filter(i=>
8"unevaluated"===i.type);if(0===a.length)return new hn;a.sort((i,r)=>i.hash===r.hash?i.isTunnel===r.isTunnel?0:i.isTunnel?-1:1:i.hash<r.hash?1:-1),r=n.concat(a);let o=n.length,s=o,l=o;do if(++s===r.length||r[o].hash!==r[s].hash){if(s-o==2){l<o&&(r[l]=r[o],r[o]=null);let i=r[l],n=r[s-1];i.type=i.isTunnel!==n.isTunnel?"tunnel":"polygon",i.connection={a:i.connection.a,b:n.connection.a},l++}o=s}while(o!==r.length)return r.splice(l),r.sort((i,r)=>i.hash<r.hash?1:-1),{portals:r}}}ar(hn,"ElevationPortalGraph");class ha{constructor(i,r,n){this.outPositions=i,this.outNormals=r,this.outIndices=n,this.vertexLookup=new Map}addVertex(i,r,n){let a=i[2];null!=n&&(a*=n);let o=`${i[0]},${i[1]},${i[2]},${r[0]},${r[1]},${r[2]}`,s=this.vertexLookup.get(o);if(null!=s)return s;let l=this.outPositions.length;this.vertexLookup.set(o,l);let u=Math.trunc(16384*r[0]),c=Math.trunc(16384*r[1]),d=Math.trunc(16384*r[2]);return this.outPositions.emplaceBack(i[0],i[1],a),this.outNormals.emplaceBack(u,c,d),l}addTriangle(i,r,n){this.outIndices.emplaceBack(i,r,n)}addTriangles(i,r,n,a=0){if(0===i.length)return;let o=eo(),s=eo();for(let l=0;l<i.length;l+=3){let u=r[i[l+0]],c=r[i[l+1]],d=r[i[l+2]],h=n[i[l+1]]+a,f=n[i[l+2]]+a;ec(o,u.x,u.y,n[i[l+0]]+a);let p=this.addVertex(o,s);ec(o,c.x,c.y,h);let m=this.addVertex(o,s);ec(o,d.x,d.y,f);let g=this.addVertex(o,s);this.outIndices.emplaceBack(p,m,g)}}addQuad(i,r,n,a,o,s){let l=this.addVertex(i,o,s),u=this.addVertex(r,o,s),c=this.addVertex(n,o,s),d=this.addVertex(a,o,s);this.addTriangle(l,u,c),this.addTriangle(c,d,l)}getVertexCount(){return this.outPositions.length}clearVertexLookup(){this.vertexLookup.clear()}}class ho{constructor(i,r,n,a){this.unevaluatedPortals=new hn,this.bridgeFeatureSections=[],this.tunnelFeatureSections=[],this.vertexHashLookup=new Map,this.unevalVertices=[],this.unevalHeights=[],this.unevalTriangles=[],this.unevalTunnelTriangles=[],this.unevalEdges=[],this.vertexPositions=new sn,this.vertexNormals=new sa,this.indexArray=new sw,this.tileToMeters=oQ(i),this.bridgeProgramConfigurations=new lg(r,{zoom:n,lut:a},i=>"fill-tunnel-structure-color"!==i),this.tunnelProgramConfigurations=new lg(r,{zoom:n,lut:a},i=>"fill-bridge-guard-rail-color"!==i)}addVertices(i,r){let n=this.unevalVertices.length;for(let n=0;n<i.length;n++)this.unevalVertices.push(i[n]),this.unevalHeights.push(r[n]);return n}addTriangles(i,r,n){let a=n?this.unevalTunnelTriangles:this.unevalTriangles;for(let n of i)a.push(n+r)}addRenderableRing(i,r,n,a,o,s){let l=[new eQ(o.min.x,o.min.y),new eQ(o.max.x,o.min.y),new eQ(o.max.x,o.max.y),new eQ(o.min.x,o.max.y)];for(let u=0;u<n-1;u++){let n=r+u,c=n+1,d=this.unevalVertices[n],h=this.unevalVertices[c];if(!(d.x>=o.min.x&&d.x<=o.max.x&&d.y>=o.min.y&&d.y<=o.max.y||h.x>=o.min.x&&h.x<=o.max.x&&h.y>=o.min.y&&h.y<=o.max.y||lV(d,h,l))||this.isOnBorder(d.x,h.x)||this.isOnBorder(d.y,h.y))continue;let f=ho.computeEdgeHash(this.unevalVertices[n],this.unevalVertices[c]),p,m=this.vertexHashLookup.get(ho.computePosHash(d));p=null!=m?m.next:null!=(m=this.vertexHashLookup.get(ho.computePosHash(h)))?m.prev:f,this.unevalEdges.push({polygonIdx:i,a:n,b:c,hash:f,portalHash:p,isTunnel:a,type:"unevaluated",featureInfo:s})}}addPortalCandidates(i,r,n,a,o){if(0!==r.length)for(let o of(this.vertexHashLookup.clear(),r)){if(0===o.length)continue;let r=o[0],s=ho.computeEdgeHash(r[r.length-2],r.at(-1));for(let o=0;o<r.length-1;o++){let l=r[o+0],u=r[o+1],c=eG(u.x-l.x,u.y-l.y),d=eY(c);if(0===d)continue;let h="unevaluated",f=a.pointElevation(l),p=a.pointElevation(u);.01>Math.abs(f)&&.01>Math.abs(p)?h="entrance":(this.isOnBorder(l.x,u.x)||this.isOnBorder(l.y,u.y))&&(h="border");let m=ho.computeEdgeHash(l,u);this.unevaluatedPortals.portals.push({connection:{a:i,b:void 0},va:l,vb:u,vab:c,length:d,hash:m,isTunnel:n,type:h});let g=ho.computePosHash(l);this.vertexHashLookup.set(g,{prev:s,next:m}),s=m}}}construct(i){if(0===this.unevalVertices.length)return;let r=()=>({vertexOffset:0,primitiveOffset:this.indexArray.length}),n=i=>{i.primitiveLength=this.indexArray.length-i.primitiveOffset},a=new ha(this.vertexPositions,this.vertexNormals,this.indexArray);this.prepareEdges(i.portals,this.unevalEdges);
8let o=r(),s=r(),l=r(),u=(i,r)=>{i.sort((i,n)=>i.type===r&&n.type!==r?-1:+(i.type!==r&&n.type===r));let n=i.findIndex(i=>i.type!==r);return n>=0?n:i.length},c=0;this.unevalEdges.length>0&&(c=u(this.unevalEdges,"none"),this.constructBridgeStructures(a,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:c},this.tileToMeters)),n(l);let d=r(),h=r();if(this.unevalEdges.length>0){let i=this.unevalEdges.splice(c),r=u(i,"tunnel")+c;this.unevalEdges.push(...i),this.constructTunnelStructures(a,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:c},{min:c,max:r})}n(d),a.addTriangles(this.unevalTriangles,this.unevalVertices,this.unevalHeights),n(h),a.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,this.unevalHeights),n(s),a.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,this.unevalHeights,4),n(o),this.maskSegments=s1.simpleSegment(0,h.primitiveOffset,0,h.primitiveLength),this.depthSegments=s1.simpleSegment(0,s.primitiveOffset,0,s.primitiveLength),this.renderableBridgeSegments=s1.simpleSegment(0,l.primitiveOffset,0,l.primitiveLength),this.renderableTunnelSegments=s1.simpleSegment(0,d.primitiveOffset,0,d.primitiveLength),this.shadowCasterSegments=s1.simpleSegment(0,o.primitiveOffset,0,o.primitiveLength)}update(i,r,n,a,o,s,l,u){this.bridgeProgramConfigurations.updatePaintArrays(i,r,o,n,a,s,l,u),this.tunnelProgramConfigurations.updatePaintArrays(i,r,o,n,a,s,l,u)}upload(i){this.vertexBuffer||0===this.vertexPositions.length||0===this.vertexNormals.length||0===this.indexArray.length||(this.vertexBuffer=i.createVertexBuffer(this.vertexPositions,sQ.members),this.vertexBufferNormal=i.createVertexBuffer(this.vertexNormals,sJ.members),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.bridgeProgramConfigurations.upload(i),this.tunnelProgramConfigurations.upload(i))}destroy(){this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBufferNormal.destroy(),this.indexBuffer.destroy()),this.maskSegments&&(this.maskSegments.destroy(),this.depthSegments.destroy(),this.renderableBridgeSegments.destroy(),this.renderableTunnelSegments.destroy(),this.shadowCasterSegments.destroy()),this.bridgeProgramConfigurations.destroy(),this.tunnelProgramConfigurations.destroy()}populatePaintArrays(i,r,n,a,o){let s=(s,l)=>{for(let u=0;u<l.length-1;u++){let c=l[u].featureIndex,d=l[u+1].vertexStart,h=i.feature(c);s.populatePaintArrays(d,h,c,{},n,r,a,void 0,o)}};s(this.bridgeProgramConfigurations,this.bridgeFeatureSections),s(this.tunnelProgramConfigurations,this.tunnelFeatureSections)}computeVertexConnections(i,r,n,a,o){let s=new Map;for(let l=a;l<o;l++){let a=n[l],o=a.a,u=a.b,c=ho.computePosHash(i[o]),d=ho.computePosHash(i[u]),h=s.get(c);h||(h={},s.set(c,h));let f=s.get(d);f||(f={},s.set(d,f)),r[o]<=0&&r[u]<=0||(h.to=u,f.from=o)}return s}isTerminalVertex(i,r){let n=ho.computePosHash(this.unevalVertices[i]),a=r.get(n);return!a||!a.from||!a.to}constructBridgeStructures(i,r,n,a,o,s){i.clearVertexLookup();let l=this.computeVertexConnections(r,n,a,o.min,o.max),u=1/s,c=.5*u,d=(i,a)=>ec(i,r[a].x,r[a].y,n[a]*u),h=eo(),f=eo(),p=eo(),m=eo(),g=eo(),_=(i,n)=>{let a=l.get(ho.computePosHash(r[n])),o=a.from,s=a.to;if(!o||!s)return;d(h,o),d(f,n),d(p,s),ek(m),eR(h,f)||(eh(g,f,h),ew(m,g)),eR(p,f)||(eh(g,p,f),ed(m,m,ew(g,g)));let u=el(m);return u>0?eg(i,m,1/u):void 0},y=1/0;this.sortSubarray(a,o.min,o.max,(i,r)=>i.featureInfo.featureIndex-r.featureInfo.featureIndex);let v=eo(),x=eo(),b=eo(),w=eo(),T=eo(),E=eo(),S=eo(),A=eo(),C=eo(),I=[eo(),eo(),eo(),eo()],k=[eo(),eo(),eo(),eo()],R=[{coord:new eQ(0,0),height:0},{coord:new eQ(0,0),height:0}],M=(i,r)=>i>r;for(let d=o.min;d<o.max;d++){let o=a[d];if(!o.featureInfo.guardRailEnabled||!this.prepareEdgePoints(R,r,n,o,M))continue;let[h,f]=R;if(ec(v,h.coord.x,h.coord.y,u*h.height),ec(x,f.coord.x,f.coord.y,u*f.height),eR(v,x))continue;eh(b,x,v),ew(b,b);let p=_(A,o.a)||b,m=_(C,o.b)||b;ec(w,p[1],-p[0],0),ew(w,w),ec(T,m[1],-m[0],0),ew(T,T),eE(A,w,p),ew(E,A),eE(A,T,m),ew(S,A),ed(I[0],v,eg(A,eh(A,w,E),c)),ed(I[1],v,eg(A,ed(A,w,E),c)),ed(I[2],v,eg(A,E,c)),I[3]=v,ed(k[0],x,eg(A,eh(A,T,S),c)),ed(k[1],x,eg(A,ed(A,T,S),c)),ed(k[2],x,eg(A,S,c)),k[3]=x,y=this.addFeatureSection(o.featureInfo.featureIndex,y,this.bridgeFeatureSections,i);let g=i.addVertex(I[0],w,s),L=i.addVertex(I[1],w,s),P=i.addVertex(k[0],T,s),O=i.addVertex(k[1],T,s);i.addTriangle(g,L,P),i.addTriangle(L,O,P);let D=i.addVertex(I[1],E,s),F=i.addVertex(I[2],E,s),N=i.addVertex(k[1],S,s),j=i.addVertex(k[2],S,s);i.addTriangle(D,F,N),i.addTriangle(F,j,N),eb(w,w),eb(T,T);let z=i.addVertex(I[2],w,s),B=i.addVertex(I[3],w,s),U=i.addVertex(k[2],T,s),V=i.addVertex(k[3],T,s);i.addTriangle(z,B,U),i.addTriangle(B,V,U);let H=this.isTerminalVertex(o.a,l),G=this.isTerminalVertex(o.b,l);h.height<.01&&H&&i.addQuad(I[3],I[2],I[1],I[0],eb(p,p),s),f.height<.01&&G&&i.addQuad(k[0],k[1],k[2],k[3],m,s)}this.bridgeFeatureSections.push({featureIndex:1/0,vertexStart:i.getVertexCount()})}constructTunnelStructures(i,r,n,a,o,s){i.clearVertexLookup();let l=1/0,u=(i,r)=>i.featureInfo.featureIndex-r.featureInfo.featureIndex;this.sortSubarray(a,o.min,o.max,u),this.sortSubarray(a,s.min,s.max,u);let c=i=>ew(i,i),d=[{coord:new eQ(0,0),height:0},{coord:new eQ(0,0),height:0}],h=(i,r)=>i<r,f=eo(),p=eo(),m=eo(),g=eo(),_=eo();for(let s=o.min;s<o.max;s++){if(!this.prepareEdgePoints(d,r,n,a[s],h))continue;let[o,u]=d,y=c(ec(_,-(u.coord.y-o.coord.y),u.coord.x-o.coord.x,0));l=this.addFeatureSection(a[s].featureInfo.featureIndex,l,this.tunnelFeatureSections,i),i.addQuad(ec(f,o.coord.x,o.coord.y,o.height),ec(p,u.coord.x,u.coord.y,u.height),ec(m,u.coord.x,u.coord.y,a[s].isTunnel?u.height+4:0),ec(g,o.coord.x,o.coord.y,a[s].isTunnel?o.height+4:0),y)}for(let o=s.min;o<s.max;o++){let s=a[o];s.isTunnel&&([s.a,s.b]=[s.b,s.a]);let u=r[s.a],d=r[s.b],h=c(ec(_,-(d.y-u.y),d.x-u.x,0));l=this.addFeatureSection(s.featureInfo.featureIndex,l,this.tunnelFeatureSections,i),i.addQuad(ec(f,d.x,d.y,0),ec(p,u.x,u.y,0),ec(m,u.x,u.y,n[s.a]+4),ec(g,d.x,d.y,n[s.b]+4),h),i.addQuad(ec(f,u.x,u.y,0),ec(p,d.x,d.y,0),ec(m,d.x,d.y,n[s.b]+4),ec(g,u.x,u.y,n[s.a]+4),h)}this.tunnelFeatureSections.push({featureIndex:1/0,vertexStart:i.getVertexCount()})}setElevatedPoint(i,r,n,a){i.coord.x=r,i.coord.y=n,i.height=a}prepareEdgePoints(i,r,n,a,o){let s=r[a.a].x,l=r[a.a].y,u=r[a.b].x,c=r[a.b].y,d=n[a.a],h=n[a.b],f=o(d,0),p=o(h,0);if(f&&p)return this.setElevatedPoint(i[0],s,l,d),this.setElevatedPoint(i[1],u,c,h),!0;if(!f&&!p)return!1;
8if(f){if(!p){let i=h/(h-d);u=iw(u,s,i),c=iw(c,l,i),h=iw(h,d,i)}}else{let i=d/(d-h);s=iw(s,u,i),l=iw(l,c,i),d=iw(d,h,i)}return this.setElevatedPoint(i[0],s,l,d),this.setElevatedPoint(i[1],u,c,h),!0}prepareEdges(i,r){if(0===r.length)return;r.sort((i,r)=>i.hash===r.hash?r.polygonIdx-i.polygonIdx:r.hash>i.hash?1:-1);let n=0,a=0,o=0,s=r[0].polygonIdx;do(++a===r.length||r[n].hash!==r[a].hash)&&((1==a-n||r[a-1].polygonIdx!==s)&&(o<n&&(r[o]=r[n],r[n]=null),r[o].type="none",o++),(n=a)!==r.length&&(s=r[n].polygonIdx));while(n!==r.length)if(r.splice(o),0!==r.length&&0!==i.length){r.sort((i,r)=>i.portalHash<r.portalHash?1:-1);let n=0,a=0;for(;n!==r.length&&a!==i.length;){let o=r[n],s=i[a];o.portalHash>s.hash?n++:s.hash>o.portalHash?a++:(o.type=s.type,n++)}}}isOnBorder(i,r){return i<=0&&r<=0||i>=8192&&r>=8192}addFeatureSection(i,r,n,a){return i!==r&&(r=i,n.push({featureIndex:i,vertexStart:a.getVertexCount()}),a.clearVertexLookup()),r}sortSubarray(i,r,n,a){let o=i.slice(r,n);o.sort(a),i.splice(r,o.length,...o)}static computeEdgeHash(i,r){return(i.y===r.y&&i.x>r.x||i.y>r.y)&&([i,r]=[r,i]),BigInt(ho.computePosHash(i))<<32n|BigInt(ho.computePosHash(r))}static computePosHash(i){return((65535&i.x)<<16|65535&i.y)>>>0}}class hs{constructor(){this._valid=!1}reset(i){return this.feature=i,this._valid=!0,this._geometry=i.loadGeometry(),0!==this._geometry.length&&0!==this._geometry[0].length||(this._valid=!1),this}geometry(i,r){return this._valid&&i(r(this._geometry)),this}require(i,r,n){return this.get(i,!0,r,n)}optional(i,r,n){return this.get(i,!1,r,n)}success(){return this._valid}get(i,r,n,a){let o=Object.hasOwn(this.feature.properties,i)?+this.feature.properties[i]:void 0;return this._valid&&void 0!==o&&!Number.isNaN(o)?n(a?a(o):o):r&&(this._valid=!1),this}}class hl{constructor(i,r){this.featureFunc=i,this.vertexFunc=r}parseFeature(i,r,n){return this.featureFunc(i,r,n)}parseVertex(i,r,n){return this.vertexFunc(i,r,n)}}let hu=new hl((i,r,n)=>i.reset(r).require(l4,i=>{n.id=i}).optional("fixed_height_relative",i=>{n.constantHeight=i},hd.decodeRelativeHeight).geometry(i=>{n.bounds=i},e6).success(),(i,r,n)=>i.reset(r).require(l4,i=>{n.id=i}).require("elevation_idx",i=>{n.idx=i}).require("extent",i=>{n.extent=i}).require("height_relative",i=>{n.height=i},hd.decodeRelativeHeight).geometry(i=>{n.position=i},hd.getPoint).success()),hc=new hl((i,r,n)=>i.reset(r).require(l4,i=>{n.id=i}).optional("fixed_height",i=>{n.constantHeight=i},hd.decodeMetricHeight).geometry(i=>{n.bounds=i},e6).success(),(i,r,n)=>i.reset(r).require(l4,i=>{n.id=i}).require("elevation_idx",i=>{n.idx=i}).require("extent",i=>{n.extent=i}).require("height",i=>{n.height=i},hd.decodeMetricHeight).geometry(i=>{n.position=i},hd.getPoint).success());class hd{static getPoint(i){return eG(i[0][0].x,i[0][0].y)}static decodeRelativeHeight(i){return 1e-4*i*5}static decodeMetricHeight(i){return 1e-4*i}static getVersionSchema(i){return i?"1.0.1"===i?hc:void 0:hu}static parse(i){let r=[],n=[],a=i.length,o=new hs;for(let s=0;s<a;s++){let a=i.feature(s),l=a.properties.version,u=hd.getVersionSchema(l);if(void 0===u){tb(`Unknown elevation feature version number ${l||"(unknown)"}`);continue}let c=a.properties.type;if(!c)continue;let d=lR.types[a.type];if("Point"===d&&"curve_point"===c){let i={};u.parseVertex(o,a,i)&&r.push(i)}else if("Polygon"===d&&"curve_meta"===c){let i={};u.parseFeature(o,a,i)&&n.push(i)}}return{vertices:r,features:n}}}class hh{constructor(i,r){this.feature=i,this.metersToTile=r,this.index=0}get(){let i=this.feature.vertices[this.index],r=this.feature.vertexProps[this.index].dir,n=r[1],a=-r[0],o=(i.extent+1)*this.metersToTile;return[new eQ(Math.trunc(i.position[0]+n*o),Math.trunc(i.position[1]+a*o)),new eQ(Math.trunc(i.position[0]-n*o),Math.trunc(i.position[1]-a*o))]}next(){this.index++}valid(){return this.index<this.feature.vertices.length}}class hf{constructor(i,r,n,a,o,s){if(this.vertices=[],this.vertexProps=[],this.edges=[],this.edgeProps=[],this._tmpVec2=[eH(),eH(),eH(),eH(),eH(),eH(),eH()],this.id=i,this.heightRange={min:n,max:n},this.safeArea=r,this.constantHeight=n,null==this.constantHeight&&(null!=this.constantHeight||0!==a.length)){for(const i of(this.vertices=a,this.edges=o,this.edges=this.edges.filter(i=>{var r,n;return i.a<this.vertices.length&&i.b<this.vertices.length&&((r=this.vertices[i.a].position)[0]!==(n=this.vertices[i.b].position)[0]||r[1]!==n[1])}),this.heightRange={min:1/0,max:-1/0},this.vertices))this.vertexProps.push({dir:eG(0,0)}),this.heightRange.min=Math.min(this.heightRange.min,i.height),this.heightRange.max=Math.max(this.heightRange.max,i.height);for(const i of this.edges){const r=this.vertices[i.a].position,n=this.vertices[i.b].position,a=e$(eH(),n,r),o=eY(
8a),s=eW(eH(),a,1/o);this.edgeProps.push({vec:a,dir:s,len:o});const l=this.vertexProps[i.a].dir,u=this.vertexProps[i.b].dir;eq(l,l,s),eq(u,u,s)}for(const i of this.vertexProps)0===i.dir[0]&&0===i.dir[1]||eZ(i.dir,i.dir);this.tessellate(s)}}pointElevation(i){if(null!=this.constantHeight)return this.constantHeight;let r=this.getClosestEdge(i);if(null==r)return 0;let[n,a]=r;return iw(this.vertices[this.edges[n].a].height,this.vertices[this.edges[n].b].height,a)}computeSlopeNormal(i,r){let n=this.getClosestEdge(i);if(!n)return eu(0,0,1);let a=n[0],o=this.edges[a],s=this.edgeProps[a].vec,l=eu(s[0],s[1],(this.vertices[o.b].height-this.vertices[o.a].height)*r),u=eu(l[1],-l[0],0);eE(u,u,l);let c=el(u);return c>0?eg(u,u,1/c):ec(u,0,0,1)}getSafeArea(){return this.safeArea}isTunnel(){return this.heightRange.max<=-5}getClosestEdge(i){var r,n,a,o;if(0===this.edges.length)return;let s=0,l=1/0,u=0,[c,d,h,f,p,m,g]=this._tmpVec2;r=i.x,n=i.y,g[0]=r,g[1]=n;let _=new cZ(g,null);for(let i=0;i<this.edges.length;i++){let r=this.edges[i],n=this.edgeProps[i].dir;_.dir=n;let y=this.vertices[r.a].position,v=this.vertices[r.b].position,x=_.intersectsPlane(y,this.vertexProps[r.a].dir,c),b=_.intersectsPlane(v,this.vertexProps[r.b].dir,d);if(!x||!b)continue;e$(h,d,c),e$(f,g,c);let w=eK(h,h),T=w>0?eK(f,h)/w:0,E=ts(T,0,1),S=Math.abs((T-E)*this.edgeProps[i].len);e$(p,g,y),a=n[1],o=-n[0],m[0]=a,m[1]=o;let A=S+Math.abs(eK(p,m));A<l&&(s=i,l=A,u=E)}return[s,u]}tessellate(i){let r=eo(),n=eo(),a=eo(),o=eo();for(let s=this.edges.length-1;s>=0;--s){let l=this.edges[s].a,u=this.edges[s].b,{position:c,height:d,extent:h}=this.vertices[l],{position:f,height:p,extent:m}=this.vertices[u],g=this.vertexProps[l].dir,_=this.vertexProps[u].dir;if(ec(r,c[0]/i,c[1]/i,d),ec(n,f[0]/i,f[1]/i,p),ec(a,g[1],-g[0],0),eg(a,a,h),ec(o,_[1],-_[0],0),eg(o,o,m),.0025000000000000005>=this.distSqLines(eu(r[0]+.5*a[0],r[1]+.5*a[1],r[2]+.5*a[2]),eu(n[0]-.5*o[0],n[1]-.5*o[1],n[2]-.5*o[2]),eu(r[0]-.5*a[0],r[1]-.5*a[1],r[2]-.5*a[2]),eu(n[0]+.5*o[0],n[1]+.5*o[1],n[2]+.5*o[2])))continue;let y=this.vertices.length,v=eq(eH(),c,f);this.vertices.push({position:eW(v,v,.5),height:.5*(d+p),extent:.5*(h+m)});let x=eq(eH(),g,_);this.vertexProps.push({dir:eZ(x,x)}),this.edges.splice(s,1),this.edgeProps.splice(s,1),this.edges.push({a:l,b:y}),this.edges.push({a:y,b:u});let b=e$(eH(),this.vertices[y].position,c),w=eY(b),T={vec:b,dir:eW(eH(),b,1/w),len:w};this.edgeProps.push(T),this.edgeProps.push(T)}}distSqLines(i,r,n,a){let o=eh(eo(),r,i),s=eh(eo(),a,n),l=eh(eo(),i,n),u=eT(o,o),c=eT(o,s),d=eT(o,l),h=eT(s,s),f=eT(s,l),p=u*h-c*c;return 0===p?ev(eS(o,n,a,eT(l,s)/eT(s,s)),i):ev(eS(o,i,r,(c*f-d*h)/p),eS(s,n,a,(u*f-c*d)/p))}}class hp{constructor(i,r){this.zScale=1,this.xOffset=0,this.yOffset=0,i.equals(r)||(this.zScale=Math.pow(2,r.z-i.z),this.xOffset=(i.x*this.zScale-r.x)*8192,this.yOffset=(i.y*this.zScale-r.y)*8192)}constantElevation(i,r){if(null!=i.constantHeight)return this.computeBiasedHeight(i.constantHeight,r)}pointElevation(i,r,n){let a=this.constantElevation(r,n);return null!=a?a:(i.x=i.x*this.zScale+this.xOffset,i.y=i.y*this.zScale+this.yOffset,this.computeBiasedHeight(r.pointElevation(i),n))}computeBiasedHeight(i,r){return r<=0?i:i+r*tl(0,r,i>=0?i:Math.abs(.5*i))}}function hm(i,r){if(!r)return;let n=+i.properties[l4];return Number.isNaN(n)?void 0:r.find(i=>i.id===n)}function hg(i,r){return i>r?1:i<r?-1:0}ar(hf,"ElevationFeature");class h_{constructor(i=hg,r=!1){this._compare=i,this._root=null,this._size=0,this._noDuplicates=!!r}rotateLeft(i){var r=i.right;r&&(i.right=r.left,r.left&&(r.left.parent=i),r.parent=i.parent),i.parent?i===i.parent.left?i.parent.left=r:i.parent.right=r:this._root=r,r&&(r.left=i),i.parent=r}rotateRight(i){var r=i.left;r&&(i.left=r.right,r.right&&(r.right.parent=i),r.parent=i.parent),i.parent?i===i.parent.left?i.parent.left=r:i.parent.right=r:this._root=r,r&&(r.right=i),i.parent=r}_splay(i){for(;i.parent;){var r=i.parent;r.parent?r.left===i&&r.parent.left===r?(this.rotateRight(r.parent),this.rotateRight(r)):r.right===i&&r.parent.right===r?(this.rotateLeft(r.parent),this.rotateLeft(r)):r.left===i&&r.parent.right===r?(this.rotateRight(r),this.rotateLeft(r)):(this.rotateLeft(r),this.rotateRight(r)):r.left===i?this.rotateRight(r):this.rotateLeft(r)}}splay(i){for(var r,n,a,o,s;i.parent;
8)(n=(r=i.parent).parent)&&n.parent?((a=n.parent).left===n?a.left=i:a.right=i,i.parent=a):(i.parent=null,this._root=i),o=i.left,s=i.right,i===r.left?(n&&(n.left===r?(r.right?(n.left=r.right,n.left.parent=n):n.left=null,r.right=n,n.parent=r):(o?(n.right=o,o.parent=n):n.right=null,i.left=n,n.parent=i)),s?(r.left=s,s.parent=r):r.left=null,i.right=r):(n&&(n.right===r?(r.left?(n.right=r.left,n.right.parent=n):n.right=null,r.left=n,n.parent=r):(s?(n.left=s,s.parent=n):n.left=null,i.right=n,n.parent=i)),o?(r.right=o,o.parent=r):r.right=null,i.left=r),r.parent=i}replace(i,r){i.parent?i===i.parent.left?i.parent.left=r:i.parent.right=r:this._root=r,r&&(r.parent=i.parent)}minNode(i=this._root){if(i)for(;i.left;)i=i.left;return i}maxNode(i=this._root){if(i)for(;i.right;)i=i.right;return i}insert(i,r){var n=this._root,a=null,o=this._compare;if(this._noDuplicates)for(;n;){if(a=n,0===o(n.key,i))return;n=0>o(n.key,i)?n.right:n.left}else for(;n;)a=n,n=0>o(n.key,i)?n.right:n.left;return n={key:i,data:r,left:null,right:null,parent:a},a?0>o(a.key,n.key)?a.right=n:a.left=n:this._root=n,this.splay(n),this._size++,n}find(i){for(var r=this._root,n=this._compare;r;){var a=n(r.key,i);if(a<0)r=r.right;else{if(!(a>0))return r;r=r.left}}return null}contains(i){for(var r=this._root,n=this._compare;r;){var a=n(i,r.key);if(0===a)return!0;r=a<0?r.left:r.right}return!1}remove(i){var r=this.find(i);if(!r)return!1;if(this.splay(r),r.left)if(r.right){var n=this.minNode(r.right);n.parent!==r&&(this.replace(n,n.right),n.right=r.right,n.right.parent=n),this.replace(r,n),n.left=r.left,n.left.parent=n}else this.replace(r,r.left);else this.replace(r,r.right);return this._size--,!0}removeNode(i){if(!i)return!1;if(this.splay(i),i.left)if(i.right){var r=this.minNode(i.right);r.parent!==i&&(this.replace(r,r.right),r.right=i.right,r.right.parent=r),this.replace(i,r),r.left=i.left,r.left.parent=r}else this.replace(i,i.left);else this.replace(i,i.right);return this._size--,!0}erase(i){var r=this.find(i);if(r){this.splay(r);var n=r.left,a=r.right,o=null;n&&(n.parent=null,o=this.maxNode(n),this.splay(o),this._root=o),a&&(n?o.right=a:this._root=a,a.parent=o),this._size--}}pop(){var i=this._root,r=null;if(i){for(;i.left;)i=i.left;r={key:i.key,data:i.data},this.remove(i.key)}return r}next(i){var r=i;if(r)if(r.right)for(r=r.right;r&&r.left;)r=r.left;else for(r=i.parent;r&&r.right===i;)i=r,r=r.parent;return r}prev(i){var r=i;if(r)if(r.left)for(r=r.left;r&&r.right;)r=r.right;else for(r=i.parent;r&&r.left===i;)i=r,r=r.parent;return r}forEach(i){for(var r=this._root,n=[],a=!1,o=0;!a;)r?(n.push(r),r=r.left):n.length>0?(i(r=n.pop(),o++),r=r.right):a=!0;return this}range(i,r,n,a){let o=[],s=this._compare,l=this._root;for(;0!==o.length||l;)if(l)o.push(l),l=l.left;else{if(s((l=o.pop()).key,r)>0)break;if(s(l.key,i)>=0&&n.call(a,l))return this;l=l.right}return this}keys(){for(var i=this._root,r=[],n=[],a=!1;!a;)i?(r.push(i),i=i.left):r.length>0?(n.push((i=r.pop()).key),i=i.right):a=!0;return n}values(){for(var i=this._root,r=[],n=[],a=!1;!a;)i?(r.push(i),i=i.left):r.length>0?(n.push((i=r.pop()).data),i=i.right):a=!0;return n}at(i){for(var r=this._root,n=[],a=!1,o=0;!a;)if(r)n.push(r),r=r.left;else if(n.length>0){if(r=n.pop(),o===i)return r;o++,r=r.right}else a=!0;return null}load(i=[],r=[],n=!1){if(0!==this._size)throw Error("bulk-load: tree is not empty");let a=i.length;return n&&function i(r,n,a,o,s){if(a>=o)return;let l=r[a+o>>1],u=a-1,c=o+1;for(;;){do u++;while(0>s(r[u],l))do c--;while(s(r[c],l)>0)if(u>=c)break;let i=r[u];r[u]=r[c],r[c]=i,i=n[u],n[u]=n[c],n[c]=i}i(r,n,a,c,s),i(r,n,c+1,o,s)}(i,r,0,a-1,this._compare),this._root=function i(r,n,a,o,s){let l=s-o;if(l>0){let u=o+Math.floor(l/2),c={key:n[u],data:a[u],parent:r};return c.left=i(c,n,a,o,u),c.right=i(c,n,a,u+1,s),c}return null}(null,i,r,0,a),this._size=a,this}min(){var i=this.minNode(this._root);return i?i.key:null}max(){var i=this.maxNode(this._root);return i?i.key:null}isEmpty(){return null===this._root}get size(){return this._size}static createTree(i,r,n,a,o){return new h_(n,o).load(i,r,a)}}let hy=(3+8881784197001252e-31)*11102230246251565e-32;function hv(i,r,n,a,o){let s,l,u,c,d=r[0],h=a[0],f=0,p=0;h>d==h>-d?(s=d,d=r[++f]):(s=h,h=a[++p]);let m=0;if(f<i&&p<n)for(h>d==h>-d?(l=d+s,u=s-(l-d),d=r[++f]):(l=h+s,u=s-(l-h),h=a[++p]),s=l,0!==u&&(o[m++]=u);f<i&&p<n;)h>d==h>-d?(c=(l=s+d)-s,u=s-(l-c)+(d-c),d=r[++f]):(c=(l=s+h)-s,u=s-(l-c)+(h-c),h=a[++p]),s=l,0!==u&&(o[m++]=u);for(;f<i;)c=(l=s+d)-s,u=s-(l-c)+(d-c),d=r[++f],s=l,0!==u&&(o[m++]=u);for(;p<n;)c=(l=s+h)-s,u=s-(l-c)+(h-c),h=a[++p],s=l,0!==u&&(o[m++]=u);return 0===s&&0!==m||(o[m++]=s),m}function hx(i){return new Float64Array(i)}
8let hb=hx(4),hw=hx(8),hT=hx(12),hE=hx(16),hS=hx(4);function hA(i,r,n){null===r?(i.inOut=!1,i.otherInOut=!0):(i.isSubject===r.isSubject?(i.inOut=!r.inOut,i.otherInOut=r.otherInOut):(i.inOut=!r.otherInOut,i.otherInOut=r.isVertical()?!r.inOut:r.inOut),r&&(i.prevInResult=!hC(r,n)||r.isVertical()?r.prevInResult:r)),i.resultTransition=hC(i,n)?function(i,r){let n,a=!i.inOut,o=!i.otherInOut;switch(r){case 0:n=a&&o;break;case 1:n=a||o;break;case 3:n=a!==o;break;case 2:n=i.isSubject?a&&!o:o&&!a}return n?1:-1}(i,n):0}function hC(i,r){switch(i.type){case 0:switch(r){case 0:return!i.otherInOut;case 1:return i.otherInOut;case 2:return i.isSubject&&i.otherInOut||!i.isSubject&&!i.otherInOut;case 3:return!0}break;case 2:return 0===r||1===r;case 3:return 2===r}return!1}class hI{constructor(i,r,n,a,o){this.left=r,this.point=i,this.otherEvent=n,this.isSubject=a??!1,this.type=o||0,this.inOut=!1,this.otherInOut=!1,this.prevInResult=null,this.resultTransition=0,this.otherPos=-1,this.outputContourId=-1,this.isExteriorRing=!0}isBelow(i){let r=this.point,n=this.otherEvent.point;return this.left?(r[0]-i[0])*(n[1]-i[1])-(n[0]-i[0])*(r[1]-i[1])>0:(n[0]-i[0])*(r[1]-i[1])-(r[0]-i[0])*(n[1]-i[1])>0}isAbove(i){return!this.isBelow(i)}isVertical(){return this.point[0]===this.otherEvent.point[0]}get inResult(){return 0!==this.resultTransition}clone(){let i=new hI(this.point,this.left,this.otherEvent,this.isSubject,this.type);return i.contourId=this.contourId,i.resultTransition=this.resultTransition,i.prevInResult=this.prevInResult,i.isExteriorRing=this.isExteriorRing,i.inOut=this.inOut,i.otherInOut=this.otherInOut,i}}function hk(i,r){return i[0]===r[0]&&i[1]===r[1]}function hR(i,r,n){let a=function(i,r,n,a,o,s){let l=(r-s)*(n-o),u=(i-o)*(a-s),c=l-u;if(0===l||0===u||l>0!=u>0)return c;let d=Math.abs(l+u);return Math.abs(c)>=33306690738754716e-32*d?c:-function(i,r,n,a,o,s,l){let u,c,d,h,f,p,m,g,_,y,v,x,b,w,T,E,S,A,C=i-o,I=n-o,k=r-s,R=a-s;w=C*R,m=(p=0x8000001*C)-(p-C),g=C-m,_=(p=0x8000001*R)-(p-R),T=g*(y=R-_)-(w-m*_-g*_-m*y),E=k*I,m=(p=0x8000001*k)-(p-k),g=k-m,_=(p=0x8000001*I)-(p-I),v=T-(S=g*(y=I-_)-(E-m*_-g*_-m*y)),f=T-v,hb[0]=T-(v+f)+(f-S),f=(x=w+v)-w,v=(b=w-(x-f)+(v-f))-E,f=b-v,hb[1]=b-(v+f)+(f-E),f=(A=x+v)-x,hb[2]=x-(A-f)+(v-f),hb[3]=A;let M=function(i){let r=i[0];for(let n=1;n<4;n++)r+=i[n];return r}(hb),L=22204460492503146e-32*l;if(M>=L||-M>=L||(f=i-C,u=i-(C+f)+(f-o),f=n-I,d=n-(I+f)+(f-o),f=r-k,c=r-(k+f)+(f-s),f=a-R,h=a-(R+f)+(f-s),0===u&&0===c&&0===d&&0===h)||(L=11093356479670487e-47*l+hy*Math.abs(M),(M+=C*h+R*u-(k*d+I*c))>=L||-M>=L))return M;w=u*R,m=(p=0x8000001*u)-(p-u),g=u-m,_=(p=0x8000001*R)-(p-R),T=g*(y=R-_)-(w-m*_-g*_-m*y),E=c*I,m=(p=0x8000001*c)-(p-c),g=c-m,_=(p=0x8000001*I)-(p-I),v=T-(S=g*(y=I-_)-(E-m*_-g*_-m*y)),f=T-v,hS[0]=T-(v+f)+(f-S),f=(x=w+v)-w,v=(b=w-(x-f)+(v-f))-E,f=b-v,hS[1]=b-(v+f)+(f-E),f=(A=x+v)-x,hS[2]=x-(A-f)+(v-f),hS[3]=A;let P=hv(4,hb,4,hS,hw);w=C*h,m=(p=0x8000001*C)-(p-C),g=C-m,_=(p=0x8000001*h)-(p-h),T=g*(y=h-_)-(w-m*_-g*_-m*y),E=k*d,m=(p=0x8000001*k)-(p-k),g=k-m,_=(p=0x8000001*d)-(p-d),v=T-(S=g*(y=d-_)-(E-m*_-g*_-m*y)),f=T-v,hS[0]=T-(v+f)+(f-S),f=(x=w+v)-w,v=(b=w-(x-f)+(v-f))-E,f=b-v,hS[1]=b-(v+f)+(f-E),f=(A=x+v)-x,hS[2]=x-(A-f)+(v-f),hS[3]=A;let O=hv(P,hw,4,hS,hT);w=u*h,m=(p=0x8000001*u)-(p-u),g=u-m,_=(p=0x8000001*h)-(p-h),T=g*(y=h-_)-(w-m*_-g*_-m*y),E=c*d,m=(p=0x8000001*c)-(p-c),g=c-m,_=(p=0x8000001*d)-(p-d),v=T-(S=g*(y=d-_)-(E-m*_-g*_-m*y)),f=T-v,hS[0]=T-(v+f)+(f-S),f=(x=w+v)-w,v=(b=w-(x-f)+(v-f))-E,f=b-v,hS[1]=b-(v+f)+(f-E),f=(A=x+v)-x,hS[2]=x-(A-f)+(v-f),hS[3]=A;let D=hv(O,hT,4,hS,hE);return hE[D-1]}(i,r,n,a,o,s,d)}(i[0],i[1],r[0],r[1],n[0],n[1]);return a>0?-1:+(a<0)}function hM(i,r){let n=i.point,a=r.point;return n[0]>a[0]?1:n[0]<a[0]?-1:n[1]!==a[1]?n[1]>a[1]?1:-1:i.left!==r.left?i.left?1:-1:0!==hR(n,i.otherEvent.point,r.otherEvent.point)?i.isBelow(r.otherEvent.point)?-1:1:!i.isSubject&&r.isSubject?1:-1}function hL(i,r,n){let a=new hI(r,!1,i,i.isSubject),o=new hI(r,!0,i.otherEvent,i.isSubject);return hk(i.point,i.otherEvent.point)&&console.warn("what is that, a collapsed segment?",i),a.contourId=o.contourId=i.contourId,hM(o,i.otherEvent)>
80&&(i.otherEvent.left=!0,o.left=!1),i.otherEvent.otherEvent=o,i.otherEvent=a,n.push(o),n.push(a),n}function hP(i,r){return i[0]*r[1]-i[1]*r[0]}function hO(i,r){return i[0]*r[0]+i[1]*r[1]}function hD(i,r,n){let a=function(i,r,n,a){let o=[r[0]-i[0],r[1]-i[1]],s=[a[0]-n[0],a[1]-n[1]];function l(i,r,n){return[i[0]+r*n[0],i[1]+r*n[1]]}let u=[n[0]-i[0],n[1]-i[1]],c=hP(o,s),d=c*c,h=hO(o,o);if(d>0){let r=hP(u,s)/c;if(r<0||r>1)return null;let a=hP(u,o)/c;return a<0||a>1?null:0===r||1===r?[l(i,r,o)]:0===a||1===a?[l(n,a,s)]:[l(i,r,o)]}if((d=(c=hP(u,o))*c)>0)return null;let f=hO(o,u)/h,p=f+hO(o,s)/h,m=Math.min(f,p),g=Math.max(f,p);return m<=1&&g>=0?1===m?[l(i,m>0?m:0,o)]:0===g?[l(i,g<1?g:1,o)]:[l(i,m>0?m:0,o),l(i,g<1?g:1,o)]:null}(i.point,i.otherEvent.point,r.point,r.otherEvent.point),o=a?a.length:0;if(0===o||1===o&&(hk(i.point,r.point)||hk(i.otherEvent.point,r.otherEvent.point))||2===o&&i.isSubject===r.isSubject)return 0;if(1===o)return hk(i.point,a[0])||hk(i.otherEvent.point,a[0])||hL(i,a[0],n),hk(r.point,a[0])||hk(r.otherEvent.point,a[0])||hL(r,a[0],n),1;let s=[],l=!1,u=!1;return hk(i.point,r.point)?l=!0:1===hM(i,r)?s.push(r,i):s.push(i,r),hk(i.otherEvent.point,r.otherEvent.point)?u=!0:1===hM(i.otherEvent,r.otherEvent)?s.push(r.otherEvent,i.otherEvent):s.push(i.otherEvent,r.otherEvent),l&&u||l?(r.type=1,i.type=r.inOut===i.inOut?2:3,l&&!u&&hL(s[1].otherEvent,s[0].point,n),2):(u?hL(s[0],s[1].point,n):s[0]!==s[3].otherEvent?(hL(s[0],s[1].point,n),hL(s[1],s[2].point,n)):(hL(s[0],s[1].point,n),hL(s[3].otherEvent,s[2].point,n)),3)}function hF(i,r){if(i===r)return 0;if(0!==hR(i.point,i.otherEvent.point,r.point)||0!==hR(i.point,i.otherEvent.point,r.otherEvent.point))return hk(i.point,r.point)?i.isBelow(r.otherEvent.point)?-1:1:i.point[0]===r.point[0]?i.point[1]<r.point[1]?-1:1:1===hM(i,r)?r.isAbove(i.point)?-1:1:i.isBelow(r.point)?-1:1;if(i.isSubject!==r.isSubject)return i.isSubject?-1:1;{let n=i.point,a=r.point;if(n[0]===a[0]&&n[1]===a[1])return n=i.otherEvent.point,a=r.otherEvent.point,n[0]===a[0]&&n[1]===a[1]?0:(i.contourId??0)>(r.contourId??0)?1:-1}return 1===hM(i,r)?1:-1}class hN{constructor(){this.points=[],this.holeIds=[],this.holeOf=null,this.depth=null}isExterior(){return null==this.holeOf}}let hj=Math.max,hz=Math.min,hB=0;function hU(i,r,n,a,o,s){let l,u,c,d,h,f;for(l=0,u=i.length-1;l<u;l++){if(c=i[l],d=i[l+1],h=new hI(c,!1,void 0,r),f=new hI(d,!1,h,r),h.otherEvent=f,c[0]===d[0]&&c[1]===d[1])continue;h.contourId=f.contourId=n,s||(h.isExteriorRing=!1,f.isExteriorRing=!1),hM(h,f)>0?f.left=!0:h.left=!0;let u=c[0],p=c[1];o[0]=hz(o[0],u),o[1]=hz(o[1],p),o[2]=hj(o[2],u),o[3]=hj(o[3],p),a.push(h),a.push(f)}}let hV=[];function hH(i,r,n){var a,o,s,l;let u,c,d=i,h=r;"number"==typeof i[0][0][0]&&(d=[i]),"number"==typeof r[0][0][0]&&(h=[r]);let f=(a=d,o=h,u=null,a.length*o.length==0&&(0===n?u=hV:2===n?u=a:(1===n||3===n)&&(u=0===a.length?o:a)),u);if(f)return f===hV?null:f;let p=[1/0,1/0,-1/0,-1/0],m=[1/0,1/0,-1/0,-1/0],g=function(i,r,n,a,o){let s,l,u,c,d,h,f=new rR(void 0,hM);for(u=0,c=i.length;u<c;u++)for(s=i[u],d=0,h=s.length;d<h;d++)(l=0===d)&&hB++,hU(s[d],!0,hB,f,n,l);for(u=0,c=r.length;u<c;u++)for(s=r[u],d=0,h=s.length;d<h;d++)l=0===d,2===o&&(l=!1),l&&hB++,hU(s[d],!1,hB,f,a,l);return f}(d,h,p,m,n);if(s=d,l=h,c=null,(p[0]>m[2]||m[0]>p[2]||p[1]>m[3]||m[1]>p[3])&&(0===n?c=hV:2===n?c=s:(1===n||3===n)&&(c=s.concat(l))),f=c)return f===hV?null:f;let _=function(i){let r,n,a=function(i){let r,n,a,o,s,l=[];for(n=0,a=i.length;n<a;n++)((r=i[n]).left&&r.inResult||!r.left&&r.otherEvent.inResult)&&l.push(r);let u=!1;for(;!u;)for(u=!0,n=0,a=l.length;n<a;n++)n+1<a&&1===hM(l[n],l[n+1])&&(o=l[n],l[n]=l[n+1],l[n+1]=o,u=!1);for(n=0,a=l.length;n<a;n++)(r=l[n]).otherPos=n;for(n=0,a=l.length;n<a;n++)(r=l[n]).left||(s=r.otherPos,r.otherPos=r.otherEvent.otherPos,r.otherEvent.otherPos=s);return l}(i),o={},s=[];for(r=0,n=a.length;r<n;r++){if(o[r])continue;let i=s.length,n=function(i,r,n){let a=new hN;if(null!=i.prevInResult){let o=i.prevInResult,s=o.outputContourId;if(o.resultTransition>0){let i=r[s];if(null!=i.holeOf){let o=i.holeOf;r[o].holeIds.push(n),a.holeOf=o,a.depth=r[s].depth}else r[s].holeIds.push(n),a.holeOf=s,a.depth=r[s].depth+1}else a.holeOf=null,a.depth=r[s].depth}else a.holeOf=null,a.depth=0;return a}(a[r],s,i),l=r=>{o[r]=!0,r<a.length&&a[r]&&(a[r].outputContourId=i)},u=r,c=r;for(n.points.push(a[r].point);l(u),l(u=a[u].otherPos),n.points.push(a[u].point),!((u=function(i,r,n,a){let o,s=i+1,l=r[i].point,u=r.length;for(s<u&&(o=r[s].point);s<u&&o[0]===l[0]&&o[1]===l[1];){if(!n[s])return s;++s<u&&(o=r[s].point)}for(s=i-1;n[s]&&s>a;)s--;return s}(u,a,o,c))==c||u>=a.length)&&a[u];);
8s.push(n)}return s}(function(i,r,n,a){let o,s,l,u=new h_(hF),c=[],d=Math.min(r[2],n[2]);for(;0!==i.length;){let n=i.pop();if(c.push(n),0===a&&n.point[0]>d||2===a&&n.point[0]>r[2])break;if(n.left){s=o=u.insert(n),o=o!==(l=u.minNode())?u.prev(o):null,s=u.next(s);let r=o?o.key:null;if(hA(n,r,a),s&&2===hD(n,s.key,i)&&(hA(n,r,a),hA(s.key,n,a)),o&&2===hD(o.key,n,i)){let i=o;hA(r,(i=i!==l?u.prev(i):null)?i.key:null,a),hA(n,r,a)}}else n=n.otherEvent,s=o=u.find(n),o&&s&&(o=o!==l?u.prev(o):null,s=u.next(s),u.remove(n),s&&o&&hD(o.key,s.key,i))}return c}(g,p,m,n)),y=[];for(let i=0;i<_.length;i++){let r=_[i];if(r.isExterior()){let i=[r.points];for(let n=0;n<r.holeIds.length;n++)i.push(_[r.holeIds[n]].points);y.push(i)}}return y}function hG(i,r=1){return[i.map(i=>i.map(i=>[i.x*r,i.y*r]))]}function hq(i,r){let n=Math.floor(i)+.5;return Math.abs(i-n)<=r?Math.round(n):Math.round(i)}class h${constructor(i){this.xs=[],this.ys=[],this.ixs=[],this.iys=[],this.buckets=new Map,this.tolerance=i}canonicalize(i,r){let n=this.tolerance,a=Math.floor(i/n),o=Math.floor(r/n);for(let s=-1;s<=1;s++){let l=this.buckets.get(a+s);if(l)for(let s=-1;s<=1;s++){let u=l.get(o+s);if(u){for(let s of u)if(Math.abs(this.xs[s]-i)<=n&&Math.abs(this.ys[s]-r)<=n){let n=this.ixs[s],l=this.iys[s];return this.xs[s]===i&&this.ys[s]===r||this.store(i,r,n,l,a,o),[n,l]}}}}let s=hq(i,n),l=hq(r,n);return this.store(i,r,s,l,a,o),[s,l]}store(i,r,n,a,o,s){let l=this.xs.length;this.xs.push(i),this.ys.push(r),this.ixs.push(n),this.iys.push(a);let u=this.buckets.get(o);u||(u=new Map,this.buckets.set(o,u));let c=u.get(s);c||(c=[],u.set(s,c)),c.push(l)}}function hW(i,r=1,n){let a=null!=n?new h$(n):null;return i.map(i=>i.map((i,n)=>{let o=i.map(i=>{let n=i[0]*r,o=i[1]*r;if(a){let[i,r]=a.canonicalize(n,o);return new eQ(i,r)}return new eQ(Math.round(n),Math.round(o))});return n>0&&o.reverse(),o}))}class hY{constructor(){this.frcCoverage=new Set,this.featureTriSegments=[],this.frcPerLevel=new Map,this.frcNonRoadSegments=new s1}empty(){return 0===this.frcCoverage.size}}function hZ(i,r,n){if(0===i.frcCoverage.size||0===i.featureTriSegments.length)return;let a=n.get(),o=r.uint16,s=[];i.featureTriSegments.sort((i,r)=>i.segIdx!==r.segIdx?i.segIdx-r.segIdx:null===i.frc&&null===r.frc?0:null===i.frc?-1:null===r.frc?1:r.frc-i.frc);let l=new Map,u=0,c=i.featureTriSegments[0].frc,d={vertexOffset:a[u].vertexOffset,primitiveOffset:0,vertexLength:a[u].vertexLength,primitiveLength:0,vaos:{},sortKey:void 0},h=()=>{d.primitiveLength>0&&(l.has(c)||l.set(c,[]),l.get(c).push(Object.assign({},d)))};for(let r of i.featureTriSegments){r.segIdx!==u&&(h(),u=r.segIdx,c=r.frc,d={vertexOffset:a[u].vertexOffset,primitiveOffset:s.length/3,vertexLength:a[u].vertexLength,primitiveLength:0,vaos:{},sortKey:void 0}),r.frc!==c&&(h(),c=r.frc,d=Object.assign({},d,{primitiveOffset:s.length/3,primitiveLength:0}));for(let i=r.start;i<r.end;i++)s.push(o[i]);d.primitiveLength+=(r.end-r.start)/3}h();for(let i=0;i<s.length;i++)o[i]=s[i];for(let[r,n]of l)null!==r?i.frcPerLevel.set(r,new s1(n)):i.frcNonRoadSegments=new s1(n);i.featureTriSegments=[]}ar(hY,"FrcSegmentData");let hK={motorway:0,motorway_link:0,trunk:1,trunk_link:1,primary:2,primary_link:2,secondary:3,secondary_link:3,tertiary:4,tertiary_link:4,unclassified:5,unclassified_link:5,street:6,street_limited:6,residential:6,service:7,living_street:7,pedestrian:8,track:8,path:8,footway:8,cycleway:8,sidewalk:8,crossing:8};function hX(i){let r=i.class;if("string"!=typeof r)return null;let n=hK[r];return void 0!==n?n:null}function hQ(i,r,n){for(let a of i)if(a.startsWith("(")){let i=a.indexOf(")");if(-1===i)continue;if(a.slice(1,i)===r&&a.slice(i+1)===n)return!0}else if(a===n)return!0;return!1}class hJ{constructor(i,r,n){this.elevationMode=r,r&&(this.elevationBufferData=new hr(i.layers,i.zoom,i.lut)),n&&(this.frcData=new hY)}isEmpty(){let i=!this.elevationBufferData||this.elevationBufferData.isEmpty(),r=!this.frcData||this.frcData.empty();return i&&r}needsUpload(){return!!this.elevationBufferData&&this.elevationBufferData.needsUpload()}trackFeatureFrc(i){if(!this.frcData)return null;let r=hX(i||{});return null!==r&&this.frcData.frcCoverage.add(r),r}recordFeatureRange(i,r,n,a){if(!this.frcData||n<=r)return;
8let o=i.bufferData.triangleSegments.get();this.frcData.featureTriSegments.push({start:3*r,end:3*n,segIdx:o.length>0?o.length-1:0,frc:a})}buildFrcSegments(i){this.frcData&&!this.frcData.empty()&&hZ(this.frcData,i.bufferData.indexArray,i.bufferData.triangleSegments)}handleFeature(i,r,n,a,o,s){let l=[];if(!this.elevationMode)return!1;let u=hm(i,o);if(!u)return!1;{let i=this.clipPolygonsToTile(r,1);i.length>0&&l.push({polygons:i,elevationFeature:u,elevationTileID:a})}let c={guardRailEnabled:s.layers[0].layout.get("fill-construct-bridge-guard-rail").evaluate(i,{},a),featureIndex:n};for(let r of l)if(r.elevationFeature){if("hd-road-base"===this.elevationMode){this.elevatedStructures||(this.elevatedStructures=new ho(r.elevationTileID,s.layers,s.zoom,s.lut));let n=r.elevationFeature.isTunnel(),a=0;Object.hasOwn(i.properties,l9)&&(a=+i.properties[l9]),this.elevatedStructures.addPortalCandidates(r.elevationFeature.id,r.polygons,n,r.elevationFeature,a)}null==r.elevationFeature.constantHeight&&(r.polygons=this.prepareElevatedPolygons(r.polygons,r.elevationFeature,r.elevationTileID));let o=new hp(a,r.elevationTileID);this.addElevatedGeometry(s,r.polygons,o,r.elevationFeature,.05*("hd-road-base"!==this.elevationMode),n,c)}return!0}populatePaintArrays(i,r,n,a,o,s,l){this.elevationBufferData&&this.elevationBufferData.populatePaintArrays(i,r,n,a,o,s,l)}update(i,r,n,a,o,s,l,u){this.elevationBufferData&&this.elevationBufferData.update(i,r,n,a,o,s,l,u),this.elevatedStructures&&this.elevatedStructures.update(i,r,n,a,o,s,l,u)}updateExpressions(i){this.elevationBufferData&&this.elevationBufferData.programConfigurations.updateExpressions(i),this.elevatedStructures&&(this.elevatedStructures.bridgeProgramConfigurations.updateExpressions(i),this.elevatedStructures.tunnelProgramConfigurations.updateExpressions(i))}upload(i){this.elevationBufferData&&this.elevationBufferData.upload(i),this.elevatedStructures&&this.elevatedStructures.upload(i)}destroy(){this.elevationBufferData&&this.elevationBufferData.destroy(),this.elevatedStructures&&this.elevatedStructures.destroy()}getUnevaluatedPortalGraph(){return this.elevatedStructures?this.elevatedStructures.unevaluatedPortals:void 0}setEvaluatedPortalGraph(i,r,n,a,o,s){this.elevatedStructures&&(this.elevatedStructures.construct(i),this.elevatedStructures.populatePaintArrays(r,n,a,o,s))}addElevatedGeometry(i,r,n,a,o,s,l){let[u,c]=i.addGeometry(r,this.elevationBufferData,{elevation:a,elevationSampler:n,bias:o,index:s,featureInfo:l},this.elevatedStructures);null==this.elevationBufferData.heightRange?this.elevationBufferData.heightRange={min:u,max:c}:(this.elevationBufferData.heightRange.min=Math.min(this.elevationBufferData.heightRange.min,u),this.elevationBufferData.heightRange.max=Math.max(this.elevationBufferData.heightRange.max,c))}prepareElevatedPolygons(i,r,n){let a=1/oQ(n),o=[];for(let n of i){let i=function(i,r,n=0){let a=hG(i,65536),o=[];for(;r.valid();r.next()){let[i,a]=r.get(),s=65536*i.x,l=65536*i.y,u=65536*a.x,c=65536*a.y,d=u-s,h=c-l,f=Math.hypot(d,h);if(0===f)continue;s-=d*n,l-=h*n,u+=d*n,c+=h*n;let p=Math.trunc(h/f*3),m=-Math.trunc(d/f*3);o.push([[[s,l],[u,c],[u+p,c+m],[s+p,l+m],[s,l]]])}return o.length>0&&(a=hH(a,o,2)),hW(a,152587890625e-16,.001)}(n,new hh(r,a),.1);o.push(...i)}return o}clipPolygonsToTile(i,r){let n=-r,a=-r,o=8192+r,s=8192+r,l=0,u=[],c=[];for(;l<i.length;l++){let r=i[l],d=e6(r);(d.min.x>=n&&d.max.x<=o&&d.min.y>=a&&d.max.y<=s?u:c).push(r)}if(u.length===i.length)return i;let d=[new eQ(n,a),new eQ(o,a),new eQ(o,s),new eQ(n,s),new eQ(n,a)];for(let i of c)u.push(...function(i,r){let n=hH(hG(i),hG([r]),0);return null==n?[]:hW(n)}(i,d));return u}}ar(hJ,"FillHDExtension"),ar(ho,"ElevatedStructures");class h1{constructor(i,r){this.elevationEnabled=i,r&&(this.frcData=new hY)}isEmpty(){let i=!this.elevationEnabled||void 0===this.heightRange,r=!this.frcData||this.frcData.empty();return i&&r}trackFeatureFrc(i){if(!this.frcData)return null;let r=hX(i||{});return null!==r&&this.frcData.frcCoverage.add(r),r}recordFeatureRange(i,r,n,a){if(!this.frcData||n<=r)return;let o=i.segments.get();this.frcData.featureTriSegments.push({start:3*r,end:3*n,segIdx:o.length>0?o.length-1:0,frc:a})}buildFrcSegments(i){this.frcData&&!this.frcData.empty()&&hZ(this.frcData,i.indexArray,i.segments)}
8handleFeature(i,r,n,a,o,s,l,u,c){if(!this.elevationEnabled)return!1;let d=hm(i,a);if(d){let a=lZ(r,-1,-1,8193,8193);for(let r of this.prepareElevatedLines(a,d,n)){let a=c.layoutVertexArray.length;c.addLine(r,i,n,o,s,l,u);let h=new hp(n,n),f=c.showElevationIdDebug?function(i){if(0===i)return[0,0,0];let r=nF(i);return[r(),r(),r()]}(d.id):null;for(let i=a;i<c.layoutVertexArray.length;i++){let r=new eQ(c.layoutVertexArray.int16[6*i]>>1,c.layoutVertexArray.int16[6*i+1]>>1),n=h.pointElevation(r,d,.05);this.updateHeightRange(n),c.zOffsetVertexArray.emplaceBack(n,0,0,0),f?c.elevationIdColVertexArray.emplaceBack(f[0],f[1],f[2]):c.showElevationIdDebug&&c.elevationIdColVertexArray.emplaceBack(0,0,0)}}return!0}let h=!(!i.properties||!Object.hasOwn(i.properties,"mapbox_line_metrics"))&&i.properties.mapbox_line_metrics,f=c.layoutVertexArray.length,p=[],m=lZ(r,-1,-1,8193,8193,p);for(let r=0;r<m.length;r++){let a=m[r],d=p[r],f={progress:{min:d.progress.min,max:d.progress.max},nextDir:d.nextPoint.sub(a.at(-2)).unit(),prevDir:a[1].sub(d.prevPoint).unit()};c.addLine(a,i,n,o,s,l,u,f,h&&d.parentIndex>0?d.parentIndex:null)}return c.fillNonElevatedRoadSegment(f),!0}prepareElevatedLines(i,r,n){if(null!=r.constantHeight)return i;let a=[],o=1/oQ(n);for(let n of i)!function(i,r,n){if(i.length<2)return n.push(i);let a=[];for(;r.valid();){let[n,o]=r.get();for(let r=0;r<i.length-1;r++){let s=i[r],l=i[r+1],u=function(i,r,n,a){let o=lF(i,r,a),s=lF(i,r,n);if(Math.sign(o)===Math.sign(s))return;let l=lF(n,a,i),u=l+s-o;return Math.sign(l)!==Math.sign(u)?[l/(l-u),s/(s-o)]:void 0}(s,l,n,o);if(u){let[i]=u,n=new eQ(iw(s.x,l.x,i),iw(s.y,l.y,i));a.push({t:r+i,distance:0,point:n})}}r.next()}if(0===a.length)return n.push(i);a.sort((i,r)=>i.t-r.t);let o=0,s=0,l=[];for(n.push(l);o!==i.length;){if(s===a.length){for(;o!==i.length;)0!==l.length&&l.at(-1).equals(i[o])||l.push(i[o]),o++;break}a[s].t<=o?(0!==l.length&&l.at(-1).equals(a[s].point)||l.push(a[s].point),a[s].t,s++):(0!==l.length&&l.at(-1).equals(i[o])||l.push(i[o]),o++)}}(n,new hh(r,o),a);return a}updateHeightRange(i){this.heightRange?(this.heightRange.min=Math.min(this.heightRange.min,i),this.heightRange.max=Math.max(this.heightRange.max,i)):this.heightRange={min:i,max:i}}}ar(h1,"LineHDExtension");class h0{constructor(){this.elevatedLayoutVertexArray=new sr,this.hasElevation=!1}beginFeature(i,r){this.currentFeatureElevation=hm(i,r)}writeVertexQuad(i,r){let n=this.currentFeatureElevation?this.currentFeatureElevation.pointElevation(new eQ(i,r)):0;this.hasElevation=this.hasElevation||0!==n;for(let i=0;i<4;i++)this.elevatedLayoutVertexArray.emplaceBack(n)}finalize(){this.hasElevation||(this.elevatedLayoutVertexArray=void 0)}upload(i){this.elevatedLayoutVertexArray&&!this.elevatedLayoutVertexBuffer&&(this.elevatedLayoutVertexBuffer=i.createVertexBuffer(this.elevatedLayoutVertexArray,ui.members))}destroy(){this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy()}}ar(h0,"CircleHDExtension");let h2=(i,r,n,a)=>{for(let o=0;o<r;o++)i.emplaceBack(n[0],n[1],n[2],a[0],a[1],a[2])};class h5{constructor(){this.elevationFeatures=[],this.elevationFeatureIdToIndex=new Map,this.elevationStateComplete=!1}addElevationFeatures(i){for(let r of i)this.elevationFeatureIdToIndex.set(r.id,this.elevationFeatures.length),this.elevationFeatures.push(r)}updateRoadElevation(i,r){if(this.elevationStateComplete)return;this.elevationStateComplete=!0,i.hasAnyZOffset=!1;let n=!1,a=oQ(r),o=1/a,s=!1,l=!1;for(let r=0;r<i.symbolInstances.length;r++){let u=i.symbolInstances.get(r),c=eu(1,0,0),d=eu(0,1,0),{numHorizontalGlyphVertices:h,numVerticalGlyphVertices:f,numIconVertices:p,numVerticalIconVertices:m}=u,g=h>0||f>0,_=p>0,y=this.elevationFeatures[u.elevationFeatureIndex];if(y){let r=new eQ(u.tileAnchorX,u.tileAnchorY),h=.075+y.pointElevation(r);u.zOffset!==h&&(n=!0,u.zOffset=h),0!==h&&(i.hasAnyZOffset=!0);let f=y.computeSlopeNormal(r,o),p=eV(eD(),eu(0,0,1),f);eI(c,c,p),eI(d,d,p),c[2]*=a,d[2]*=a,1===c[0]&&0===c[1]&&0===c[2]&&0===d[0]&&1===d[1]&&0===d[2]||(s=s||g,l=l||_)}if(g&&(h2(i.text.orientationVertexArray,h,c,d),h2(i.text.orientationVertexArray,f,c,d)),_){let{placedIconSymbolIndex:r,verticalPlacedIconSymbolIndex:n}=u;r>=0&&h2(i.icon.orientationVertexArray,p,c,d),n>=0&&h2(i.icon.orientationVertexArray,m,c,d)}}s||(i.text.orientationVertexArray=void 0),l||(i.icon.orientationVertexArray=void 0),n&&(i.zOffsetBuffersNeedUpload=!0,i.zOffsetSortDirty=!0)}getElevationFeatureForPlacedSymbol(i,r,n){let a=i.symbolInstances.get(r.symbolInstanceIndices[n]).elevationFeatureIndex;if(a<this.elevationFeatures.length)return this.elevationFeatures[a]}}ar(h5,"SymbolHDExtension");let h4=null,h9=null,h3=null,h8=null,h6={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},h7={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",5123:"DT_UINT16",5125:"DT_UINT32",5126:"DT_FLOAT32"},fe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function ft(i,r,n){let a=n.json.bufferViews.length,o=n.buffers.length;r.bufferView=a,n.json.bufferViews[a]={buffer:o,byteLength:i.byteLength},n.buffers[o]=i}let fi="KHR_draco_mesh_compression",fr="EXT_meshopt_compression",fn=new TextDecoder("utf8");function fa(i,r){return new URL(i,r).href}async function fo(i,r,n,a,o){let s=await fetch(fa(i.uri,a),{signal:o}),l=await s.arrayBuffer();r.buffers[n]=l}function fs(i,r){let n=i.json.bufferViews[r];return new Uint8Array(i.buffers[n.buffer],n.byteOffset||0,n.byteLength)}async function fl(i,r,n,a,o){if(i.uri){let s=fa(i.uri,a),l=await fetch(s,{signal:o}),u=await l.blob(),c=await createImageBitmap(u);r.images[n]=c}else if(void 0!==i.bufferView){let a=new Blob([fs(r,i.bufferView)],{type:i.mimeType}),o=await createImageBitmap(a);r.images[n]=o}}async function fu(i,r=0,n,a){let o={json:null,images:[],buffers:[]};if(0x46546c67===new Uint32Array(i,r,1)[0]){let n=new Uint32Array(i,r),a=2,s=(n[a++]>>2)-3,l=n[a++]>>2;if(a++,o.json=JSON.parse(fn.decode(n.subarray(a,a+l))),(a+=l)<s){let s=n[a++],l=r+(++a<<2);o.buffers[0]=i.slice(l,l+s)}}else o.json=JSON.parse(fn.decode(new Uint8Array(i,r)));let{buffers:s,images:l,meshes:u,extensionsUsed:c,bufferViews:d}=o.json;
8if(s){let i=[];for(let r=0;r<s.length;r++){let l=s[r];l.uri?i.push(fo(l,o,r,n,a)):o.buffers[r]||(o.buffers[r]=null)}await Promise.all(i)}if(a&&a.aborted)throw new DOMException("Aborted","AbortError");let h=[],f=c&&c.includes(fi),p=c&&c.includes(fr);if(f&&h.push(function(){if(!h4)return null!=h9||(h9=(function(i){let r,n=null;function a(){r=new Uint8Array(n.buffer)}function o(){throw Error("Unexpected Draco error.")}return WebAssembly.instantiateStreaming(i,{a:{a:o,d:function(i,n,a){return r.copyWithin(i,n,n+a)},c:function(i){let o=r.length,s=Math.ceil((Math.max(i>>>0,Math.ceil(1.2*o))-o)/65536);try{return n.grow(s),a(),!0}catch(i){return!1}},b:o}}).then(i=>{let o,s,l,u,{Rb:c,Qb:d,P:h,T:f,X:p,Ja:m,La:g,Qa:_,Va:y,Wa:v,eb:x,jb:b,f:w,e:T,yb:E,zb:S,Ab:A,Bb:C,Db:I,Gb:k}=i.instance.exports;n=T;let R=(o=0,s=0,l=0,u=0,i=>{l&&(c(u),c(o),s+=l,l=o=0),o||(s+=128,o=d(s));let n=i.length+7&-8,a=o;n>=s&&(l=n,a=u=d(n));for(let n=0;n<i.length;n++)r[a+n]=i[n];return a});return a(),w(),{memory:T,_free:c,_malloc:d,Mesh:class{constructor(){this.ptr=h()}destroy(){f(this.ptr)}},Decoder:class{constructor(){this.ptr=m()}destroy(){b(this.ptr)}DecodeArrayToMesh(i,r,n){let a=R(i);return!!p(g(this.ptr,a,r,n.ptr))}GetAttributeByUniqueId(i,r){return{ptr:_(this.ptr,i.ptr,r)}}GetTrianglesUInt16Array(i,r,n){y(this.ptr,i.ptr,r,n)}GetTrianglesUInt32Array(i,r,n){v(this.ptr,i.ptr,r,n)}GetAttributeDataArrayForAllPoints(i,r,n,a,o){x(this.ptr,i.ptr,r.ptr,n,a,o)}},DT_INT8:E(),DT_UINT8:S(),DT_INT16:A(),DT_UINT16:C(),DT_UINT32:I(),DT_FLOAT32:k()}})})(fetch(tH())).then(i=>{h4=i,h9=null})),h9}()),p&&h.push(function(){var i;if(!h3)return null!=h8||(h8=(i=fetch(tG()),WebAssembly.instantiateStreaming(i,{}).then(i=>{let{sbrk:r,memory:n,meshopt_decodeVertexBuffer:a,meshopt_decodeIndexBuffer:o,meshopt_decodeIndexSequence:s,meshopt_decodeFilterOct:l,meshopt_decodeFilterQuat:u,meshopt_decodeFilterExp:c}=i.instance.exports,d={ATTRIBUTES:a,TRIANGLES:o,INDICES:s},h={OCTAHEDRAL:l,QUATERNION:u,EXPONENTIAL:c};return i.instance.exports.__wasm_call_ctors(),{decodeGltfBuffer(i,a,o,s,l,u){let c=a+3&-4,f=r(c*o),p=r(s.length),m=new Uint8Array(n.buffer);m.set(s,p);let g=d[l](f,a,o,p,s.length);if(0===g&&h[u]&&h[u](f,c,o),i.set(m.subarray(f,f+a*o)),r(f-r(0)),0!==g)throw Error(`Malformed buffer data: ${g}`)}}})).then(i=>{h3=i,h8=null})),h8}()),l)for(let i=0;i<l.length;i++)h.push(fl(l[i],o,i,n,a));if(h.length&&await Promise.all(h),a&&a.aborted)throw new DOMException("Aborted","AbortError");if(f&&u)for(let{primitives:i}of u)for(let r of i)!function(i,r){let n=i.extensions&&i.extensions[fi];if(!n)return;let a=new h4.Decoder,o=fs(r,n.bufferView),s=new h4.Mesh;if(!a.DecodeArrayToMesh(o,o.byteLength,s))throw Error("Failed to decode Draco mesh");let l=r.json.accessors[i.indices],u=h6[l.componentType],c=l.count*u.BYTES_PER_ELEMENT,d=h4._malloc(c);for(let o of(u===Uint16Array?a.GetTrianglesUInt16Array(s,c,d):a.GetTrianglesUInt32Array(s,c,d),ft(h4.memory.buffer.slice(d,d+c),l,r),h4._free(d),Object.keys(n.attributes))){let l=a.GetAttributeByUniqueId(s,n.attributes[o]),u=r.json.accessors[i.attributes[o]],c=h7[u.componentType],d=u.count*fe[u.type]*h6[u.componentType].BYTES_PER_ELEMENT,h=h4._malloc(d);a.GetAttributeDataArrayForAllPoints(s,l,h4[c],d,h),ft(h4.memory.buffer.slice(h,h+d),u,r),h4._free(h)}a.destroy(),s.destroy(),delete i.extensions[fi]}(r,o);if(p&&u&&d)for(let i of d)!function(i,r){if(!i.extensions||!i.extensions[fr])return;let n=i.extensions[fr],a=new Uint8Array(r.buffers[n.buffer],n.byteOffset||0,n.byteLength||0),o=new Uint8Array(n.count*n.byteStride);h3.decodeGltfBuffer(o,n.count,n.byteStride,a,n.mode,n.filter),i.buffer=r.buffers.length,i.byteOffset=0,r.buffers[i.buffer]=o.buffer,delete i.extensions[fr]}(i,o);return o}async function fc(i,r){return fu(await async function(i,r){if(r&&r.aborted)throw new DOMException("Aborted","AbortError");return new Promise((n,a)=>{let o=is(i,(i,r)=>{i?a(i):n(r)});r&&r.addEventListener("abort",()=>{o.cancel(),a(new DOMException("Aborted","AbortError"))},{once:!0})})}({url:i,type:"arrayBuffer"},r),0,i,r)}class fd{constructor(i,r,n,a){if(this.triangleCount=r.length/3,this.min=new eQ(0,0),this.max=new eQ(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],0===this.triangleCount||0===i.length)return;const[o,s]=[i[0].clone(),i[0].clone()];for(let r=1;r<i.length;++r){const n=i[r];o.x=Math.min(o.x,n.x),o.y=Math.min(o.y,n.y),s.x=Math.max(s.x,n.x),s.y=Math.max(s.y,n.y)}if(a&&(n=Math.max(n,Math.ceil(Math.max(s.x-o.x,s.y-o.y)/a))),0===n)return;this.min=o,this.max=s;const l=this.max.sub(this.min);l.x=Math.max(l.x,1),l.y=Math.max(l.y,1);const u=Math.max(l.x,l.y)/n;this.cellsX=Math.max(1,Math.ceil(l.x/u)),this.cellsY=Math.max(1,Math.ceil(l.y/u)),this.xScale=1/u,this.yScale=1/u;const c=[];for(let n=0;n<this.triangleCount;n++){const a=i[r[3*n+0]].sub(this.min),o=i[r[3*n+1]].sub(this.min),s=i[r[3*n+2]].sub(this.min),l=fh(Math.floor(Math.min(a.x,o.x,s.x)),this.xScale,this.cellsX),d=fh(Math.floor(Math.max(a.x,o.x,s.x)),this.xScale,this.cellsX),h=fh(Math.floor(Math.min(a.y,o.y,s.y)),this.yScale,this.cellsY),f=fh(Math.floor(Math.max(a.y,o.y,s.y)),this.yScale,this.cellsY),p=new eQ(0,0),m=new eQ(0,0),g=new eQ(0,0),_=new eQ(0,0);for(let i=h;i<=f;++i){p.y=m.y=i*u,g.y=_.y=(i+1)*u;for(let r=l;r<=d;++r)p.x=g.x=r*u,m.x=_.x=(r+1)*u,(lG(a,o,s,p,m,_)||lG(a,o,s,p,_,g))&&c.push({cellIdx:i*this.cellsX+r,triIdx:n})}}if(0===c.length)return;c.sort((i,r)=>i.cellIdx-r.cellIdx||i.triIdx-r.triIdx);let d=0;for(;d<c.length;){const i=c[d].cellIdx,r={start:this.payload.length,len:0};for(;d<c.length&&c[d].cellIdx===i;)++r.len,this.payload.push(c[d++].triIdx);this.cells[i]=r}}_lazyInitLookup(){this.lookup||(this.lookup=new Uint8Array(Math.ceil(this.triangleCount/8))),this.lookup.fill(0)}queryPoint(i,r){if(0===this.triangleCount||0===this.cells.length||i.x>this.max.x||this.min.x>i.x||i.y>this.max.y||this.min.y>i.y)return;let n=fh(i.x-this.min.x,this.xScale,this.cellsX),a=fh(i.y-this.min.y,this.yScale,this.cellsY),o=this.cells[a*this.cellsX+n];if(o){this._lazyInitLookup();for(let i=0;i<o.len;i++){let n=this.payload[o.start+i],a=Math.floor(n/8),s=1<<n%8;if(!(this.lookup[a]&s)&&(this.lookup[a]|=s,r.push(n),r.length===this.triangleCount))return}}}query(i,r,n){if(0===this.triangleCount||0===this.cells.length||i.x>this.max.x||this.min.x>r.x||i.y>this.max.y||this.min.y>r.y)return;this._lazyInitLookup();let a=fh(i.x-this.min.x,this.xScale,this.cellsX),o=fh(r.x-this.min.x,this.xScale,this.cellsX),s=fh(i.y-this.min.y,this.yScale,this.cellsY),l=fh(r.y-this.min.y,this.yScale,this.cellsY);for(let i=s;i<=l;i++)for(let r=a;r<=o;r++){let a=this.cells[i*this.cellsX+r];if(a)for(let i=0;i<a.len;i++){let r=this.payload[a.start+i],o=Math.floor(r/8),s=1<<r%8;if(!(this.lookup[o]&s)&&(this.lookup[o]|=s,n.push(r),n.length===this.triangleCount))return}}}}function fh(i,r,n){return Math.max(0,Math.min(n-1,Math.floor(i*r)))}ar(fd,"TriangleGridIndex");let ff=o6([{name:"a_pos_3f",components:3,type:"Float32"}]),fp=o6([{name:"a_color_3f",components:3,type:"Float32"}]),fm=o6([{name:"a_color_4f",components:4,type:"Float32"}]),fg=o6([{name:"a_uv_2f",components:2,type:"Float32"}]),f_=o6([{name:"a_normal_3f",components:3,type:"Float32"}]),fy=o6([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),fv=o6([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]);function fx(i,r){var n,a;let o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w,T,E,S=fw(i.projection,i.zoom,i.width,i.height),A=(n=i.projection,a=i.center,o=new oq(a.lng-180*fT,a.lat),s=new oq(a.lng+180*fT,a.lat),l=n.project(o.lng,o.lat),c=-Math.atan2((u=n.project(s.lng,s.lat)).y-l.y,u.x-l.x),(d=oJ.fromLngLat(a)).y=ts(d.y,-1+fT,1-fT),h=d.toLngLat(),f=n.project(h.lng,h.lat),p=oJ.fromLngLat(h),p.x+=fT,m=p.toLngLat(),_=fS((g=n.project(m.lng,m.lat)).x-f.x,g.y-f.y,c),y=oJ.fromLngLat(h),y.y+=fT,v=y.toLngLat(),b=fS((x=n.project(v.lng,v.lat)).x-f.x,x.y-f.y,c),w=Math.abs(_.x)/Math.abs(b.y),ee(T=W([]),T,-c*(1-(r?0:S))),X(E=W([]),E,[1,1-(1-w)*S,1]),E[4]=-b.x/b.y*S,ee(E,E,c),Z(E,T,E),E),C=fb(i);return X(A,A,[C,C,1]),A}function fb(i){let r=i.projection,n=fw(i.projection,i.zoom,i.width,i.height);return Math.pow(2,fE(r,i.center)*n+(1-n)*fE(r,oq.convert(r.center)))}function fw(i,r,n,a,o=1/0){let s=i.range;if(!s)return 0;let l=Math.log2(Math.min(o,Math.max(n,a))/1024);
8return tl(s[0]+l,s[1]+l,r)}let fT=1/4e4;function fE(i,r){let n=ts(r.lat,-85.051129,85.051129),a=new oq(r.lng-180*fT,n),o=new oq(r.lng+180*fT,n),s=i.project(a.lng,n),l=i.project(o.lng,n),u=oJ.fromLngLat(a),c=oJ.fromLngLat(o),d=l.x-s.x,h=l.y-s.y,f=c.x-u.x,p=c.y-u.y;return Math.log2(Math.sqrt((f*f+p*p)/(d*d+h*h)))}function fS(i,r,n){let a=Math.cos(n),o=Math.sin(n);return{x:i*a-r*o,y:i*o+r*a}}let fA=new Float64Array([1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1]);function fC(i,r,n){W(i),ee(i,i,r[2]*e7),Q(i,i,r[0]*e7),J(i,i,r[1]*e7),X(i,i,n),Z(i,i,fA)}function fI(i,r,n,a,o,s,l,u){let c=[n[0]-r[0],n[1]-r[1],0],d=[a[0]-r[0],a[1]-r[1],0];if(1e-12>el(c)||1e-12>el(d))return eF(i);let h=eE([],c,d);return ew(h,h),eh(d,a,r),c[2]=(s-o)*u,d[2]=(l-o)*u,eE(c,c,d),ew(c,c),eV(i,h,c)}function fk(i,r,n=!1){let a=dg(r.zoom),o=function(i,r,n){let a,o,s,l=r.worldSize,u=[i[12],i[13],i[14]],c=rm(u[1]/l),d=rp(u[0]/l),h=W([]),f=1/oW(c)*l,p=1/oW(0)*l*oK(c,r.zoom),m=1/df(l),g=p*m;if(n){let i=fw(r.projection,r.zoom,r.width,r.height,1024);g=m*r.projection.pixelSpaceConversion(r.center.lat,l,i)}let _=oH(c,d);ed(_,_,eg([],ew([],_),f*g*u[2]));let y=(s=eE([],o=[0,1,0],a=[_[0],_[1],_[2]]),eE(o,a,s),0===ex(o)&&eE(s,a,o=[0,1,0]),ew(s,s),ew(o,o),ew(a,a),[s[0],s[1],s[2],0,o[0],o[1],o[2],0,a[0],a[1],a[2],0,_[0],_[1],_[2],1]);X(h,h,[g,g,g*f]),K(h,h,[-u[0],-u[1],-u[2]]);let v=Z([],r.globeMatrix,y);return Z(v,v,h),Z(v,v,i),v}(i,r,n);if(a>0){let n,s,l,u,c,d,h,f,p,m,g=(n=r.worldSize,s=1/oW(0)*n*oK(r.center.lat,r.zoom)/df(n),l=1/oW(r.center.lat)*n,J(u=W([]),u,r.center.lng*e7),Q(u,u,r.center.lat*e7),K(u,u,[0,0,oz]),X(u,u,[s,s,s*l]),K(u,u,[-(c=r.point).x,-c.y,0]),Z(u,u,i),Z(u,r.globeMatrix,u));return h=(d=(i,r,n)=>{let a=el(i),o=el(r),s=dt(i,r,n);return eg(s,s,1/el(s)*iw(a,o,n))})([o[0],o[1],o[2]],[g[0],g[1],g[2]],a),f=d([o[4],o[5],o[6]],[g[4],g[5],g[6]],a),p=d([o[8],o[9],o[10]],[g[8],g[9],g[10]],a),m=dt([o[12],o[13],o[14]],[g[12],g[13],g[14]],a),[h[0],h[1],h[2],0,f[0],f[1],f[2],0,p[0],p[1],p[2],0,m[0],m[1],m[2],1]}return o}function fR(i,r,n,a){let o=c4.projectAabbCorners(a,n),s=Number.MAX_VALUE;for(let i=0;i<o.length;++i){let n=o[i];n[0]=(.5*n[0]+.5)*r.width,n[1]=(.5-.5*n[1])*r.height,n[2]<s&&(s=n[2])}if(lP(i,function(i){let r=[],n=0;for(let r=1;r<i.length;r++)(i[r][0]<i[n][0]||i[r][0]===i[n][0]&&i[r][1]<i[n][1])&&(n=r);let a,o=n,s=new Uint8Array(i.length);do{if(s[o])break;r.push(new eQ(i[o][0],i[o][1])),s[o]=1,a=(o+1)%i.length;for(let r=0;r<i.length;r++){if(i[r][0]===i[a][0]&&i[r][1]===i[a][1]||i[r][0]===i[o][0]&&i[r][1]===i[o][1])continue;let n=[i[r][0]-i[o][0],i[r][1]-i[o][1]],s=[i[a][0]-i[o][0],i[a][1]-i[o][1]],l=n[0]*s[1]-n[1]*s[0];(l>0||0===l&&n[0]*s[0]+n[1]*s[1]>=0&&n[0]*n[0]+n[1]*n[1]>s[0]*s[0]+s[1]*s[1])&&(a=r)}o=a}while(o!==n)return r.length>0&&r.push(r[0]),r}(o)))return s}let fM={CoordinateSpaceTile:1,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function fL(i,r,n,a,o,s,l,u,c,d=!1){let h=n.zoom,f=n.project(a),p=oK(a.lat,h),m=1/p;W(i),K(i,i,[f.x+l[0]*m,f.y+l[1]*m,l[2]]);let g=1,_=1,y=n.worldSize;if(d){if("mercator"===n.projection.name){let i=0;n.elevation&&(i=n.elevation.getAtPointOrZero(new oJ(f.x/y,f.y/y),0));let r=eO([],[f.x,f.y,i,1],n.projMatrix)[3]/n.cameraToCenterDistance;g=r,_=r*oK(n.center.lat,h)}else if("globe"===n.projection.name){let r=fk(i,n),o=[0,0,0,1];eO(o,o,Z([],n.projMatrix,r));let s=o[3]/n.cameraToCenterDistance,l=dg(h),u=n.projection.pixelsPerMeter(a.lat,y)*oK(a.lat,h),c=n.projection.pixelsPerMeter(n.center.lat,y)*oK(n.center.lat,h);g=s/iw(u,oZ(n.center.lat),l),_=s*p/u,g*=c,_*=c}}else g=m;X(i,i,[g,g,_]);let v=[...i],x=r.orientation,b=[];if(fC(b,[x[0]+(o?o[0]:0),x[1]+(o?o[1]:0),x[2]+(o?o[2]:0)],s),Z(i,v,b),u&&n.elevation){let o=0,s=[];if(c&&n.elevation){o=function(i,r,n,a,o){let s=r.elevation;if(!s)return 0;let l=c4.projectAabbCorners(n,a),u=1/oW(o.lat)*r.worldSize,c=function(i,r){let n=[0,0,1],a=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(let o of a){let a=i[o.corners[0]],s=i[o.corners[1]],l=i[o.corners[2]],u=[s[0]-a[0],s[1]-a[1],r*(s[2]-a[2])],c=eE(u,u,[l[0]-a[0],l[1]-a[1],r*(l[2]-a[2])]);ew(c,c),o.dotProductWithUp=eT(c,n)}return a.sort((i,r)=>i.dotProductWithUp-r.dotProductWithUp),a[0].corners}(l,u),d=l[c[0]],h=l[c[1]],f=l[c[2]],p=l[c[3]],m=s.getAtPointOrZero(new oJ(d[0]/r.worldSize,d[1]/r.worldSize),0),g=s.getAtPointOrZero(new oJ(h[0]/r.worldSize,h[1]/r.worldSize),0),_=s.getAtPointOrZero(new oJ(f[0]/r.worldSize,f[1]/r.worldSize),0),y=s.getAtPointOrZero(new oJ(p[0]/r.worldSize,p[1]/r.worldSize),0),v=(m+y)/2,x=(g+_)/2;return v>x?g<_?fI(i,h,p,d,g,y,m,u):fI(i,f,d,p,_,m,y,u):m<y?fI(i,d,h,f,m,g,_,u):fI(i,p,f,h,y,_,g,u),Math.max(v,x)}(s,n,r.aabb,i,a);let l=Z([],ea([],s),b);Z(i,v,l)}else o=n.elevation.getAtPointOrZero(new oJ(f.x/y,f.y/y),0);0!==o&&(i[14]+=o)}}class fP{constructor(i,r,n,a,o){this.materialOverrides=new Map,this.nodeOverrides=new Map,this.materialOverrideNames=[],this.nodeOverrideNames=[],this.featureProperties={},this.id=i,this.uri=r,this.position=null!=n?new oq(n[0],n[1]):new oq(0,0),this.orientation=null!=a?a:[0,0,0],this.nodes=o,this.uploaded=!1,this.aabb=new c4([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(i,r){var n;Z(i.globalMatrix,r,i.localMatrix);let a=this.nodeOverrides.get(i.name);if(void 0!==a){if(a.orientation){let r=[];n=a.orientation,W(r),J(r,r,n[1]*e7),ee(r,r,n[2]*e7),Q(r,r,n[0]*e7),Z(i.globalMatrix,i.globalMatrix,r)}a.minZoom&&(i.minZoom=a.minZoom),a.maxZoom&&(i.maxZoom=a.maxZoom)}if(i.meshes)for(let r of i.meshes){let n=c4.applyTransformFast(r.aabb,i.globalMatrix);this.aabb.encapsulate(n)}if(i.children)for(let r of i.children)this._applyTransformations(r,i.globalMatrix)}computeBoundsAndApplyParent(){let i=W([]);for(let r of(this.aabb=new c4([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.nodes))this._applyTransformations(r,i)}computeModelMatrix(i,r,n,a,o,s,l=!1){fL(this.matrix,this,i.transform,this.position,r,n,a,o,s,l)}upload(i){if(!this.uploaded){for(let r of this.nodes)fF(r,i);for(let i of this.nodes)fj(i);this.uploaded=!0}}destroy(){for(let i of this.nodes)fB(i)}}function fO(i,r,n=!1){i.uploaded||(i.gfxTexture=new cn(r,i.image,n?r.gl.R8:r.gl.RGBA8,{useMipmap:i.sampler.minFilter>=r.gl.NEAREST_MIPMAP_NEAREST}),i.uploaded=!0,i.image=null)}function fD(i,r,n){i.indexBuffer=r.createIndexBuffer(i.indexArray,!1,!0),i.vertexBuffer=r.createVertexBuffer(i.vertexArray,ff.members,!1,!0),i.normalArray&&(i.normalBuffer=r.createVertexBuffer(i.normalArray,f_.members,!1,!0)),i.texcoordArray&&(i.texcoordBuffer=r.createVertexBuffer(i.texcoordArray,fg.members,!1,!0)),i.colorArray&&(i.colorBuffer=r.createVertexBuffer(i.colorArray,(12===i.colorArray.bytesPerElement?fp:fm).members,!1,!0)),i.featureArray&&(i.pbrBuffer=r.createVertexBuffer(i.featureArray,fv.members,!0)),i.segments=s1.simpleSegment(0,0,i.vertexArray.length,i.indexArray.length);let a=i.material;a.pbrMetallicRoughness.baseColorTexture&&fO(a.pbrMetallicRoughness.baseColorTexture,r),a.pbrMetallicRoughness.metallicRoughnessTexture&&fO(a.pbrMetallicRoughness.metallicRoughnessTexture,r),a.normalTexture&&fO(a.normalTexture,r),a.occlusionTexture&&fO(a.occlusionTexture,r,n),a.emissionTexture&&fO(a.emissionTexture,r)}function fF(i,r,n){if(i.meshes)for(let a of i.meshes)fD(a,r,n);if(i.lodMeshes)for(let a of i.lodMeshes)fD(a,r,n);
8if(i.children)for(let a of i.children)fF(a,r,n)}function fN(i){i.indexArray.destroy(),i.vertexArray.destroy(),i.colorArray&&i.colorArray.destroy(),i.normalArray&&i.normalArray.destroy(),i.texcoordArray&&i.texcoordArray.destroy(),i.featureArray&&i.featureArray.destroy()}function fj(i){if(i.meshes)for(let r of i.meshes)fN(r);if(i.lodMeshes)for(let r of i.lodMeshes)fN(r);if(i.children)for(let r of i.children)fj(r)}function fz(i){var r;i.vertexBuffer&&(i.vertexBuffer.destroy(),i.indexBuffer.destroy(),i.normalBuffer&&i.normalBuffer.destroy(),i.texcoordBuffer&&i.texcoordBuffer.destroy(),i.colorBuffer&&i.colorBuffer.destroy(),i.pbrBuffer&&i.pbrBuffer.destroy(),i.segments.destroy(),i.material&&((r=i.material).pbrMetallicRoughness.baseColorTexture&&r.pbrMetallicRoughness.baseColorTexture.gfxTexture&&r.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),r.pbrMetallicRoughness.metallicRoughnessTexture&&r.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&r.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),r.normalTexture&&r.normalTexture.gfxTexture&&r.normalTexture.gfxTexture.destroy(),r.emissionTexture&&r.emissionTexture.gfxTexture&&r.emissionTexture.gfxTexture.destroy(),r.occlusionTexture&&r.occlusionTexture.gfxTexture&&r.occlusionTexture.gfxTexture.destroy()))}function fB(i){if(i.meshes)for(let r of i.meshes)fz(r);if(i.lodMeshes)for(let r of i.lodMeshes)fz(r);if(i.footprintDebugMesh&&(i.footprintDebugMesh.vertexBuffer.destroy(),i.footprintDebugMesh.indexBuffer.destroy(),i.footprintDebugMesh.segments.destroy()),i.children)for(let r of i.children)fB(r)}function fU(i,r,n,a){return i[0]<=a[0]&&r[0]>=n[0]&&i[1]<=a[1]&&r[1]>=n[1]&&i[2]<=a[2]&&r[2]>=n[2]}let fV=[];class fH{serializeFromGltf(i,r,n,a){if(i.length<7)return;let o=0;if(109!==i[o++]||98!==i[o++]||120!==i[o++]||98!==i[o++]||118!==i[o++]||104!==i[o++]||43!==i[o++])return;let s=new DataView(i.buffer,i.byteOffset),l=s.getUint16(o,!0);if(o+=2,0===l)return;this._nodes=[];let u=0;for(let i=0;i<l;i++){let i=[r[3*u],r[3*u+1],r[3*u+2]],a=[n[3*u],n[3*u+1],n[3*u+2]];u++;let l=s.getUint16(o,!0);o+=2;let c=0,d=0;65535===l&&(c=s.getUint16(o,!0),o+=2,d=s.getUint32(o,!0),o+=4),this._nodes.push({aabbMin:i,aabbMax:a,backChild:l,indexCount:c,indexOffset:d})}let c=s.getUint32(o,!0);this._indices=a.slice(0,c)}setVertices(i){this._vertices=i}findHighestPoint(i,r){if(!this._nodes||0===this._nodes.length||!fU(this._nodes[0].aabbMin,this._nodes[0].aabbMax,i,r))return null;fV.length=0,fV.push(0);let n=-1/0;for(;fV.length>0;){let a=fV.pop(),o=this._nodes[a];if(o.aabbMax[2]<=n)continue;if(65535===o.backChild){for(let a=0;a<o.indexCount;a+=3){let s=3*this._indices[o.indexOffset+a],l=3*this._indices[o.indexOffset+a+1],u=3*this._indices[o.indexOffset+a+2];(function(i,r,n,a,o,s,l,u,c,d,h){let f,p,m,g,_,y,v=.5*(d[0]+h[0]),x=.5*(d[1]+h[1]),b=.5*(d[2]+h[2]),w=.5*(h[0]-d[0]),T=.5*(h[1]-d[1]),E=.5*(h[2]-d[2]),S=i-v,A=r-x,C=n-b,I=a-v,k=o-x,R=s-b,M=l-v,L=u-x,P=c-b,O=I-S,D=k-A,F=R-C,N=M-I,j=L-k,z=P-R,B=S-M,U=A-L,V=C-P;if(g=Math.min(f=C*D-A*F,p=R*D-k*F,m=P*D-L*F),_=Math.max(f,p,m),g>(y=Math.abs(F)*T+Math.abs(D)*E)||_<-y||(g=Math.min(f=C*j-A*z,p=R*j-k*z,m=P*j-L*z),_=Math.max(f,p,m),g>(y=Math.abs(z)*T+Math.abs(j)*E)||_<-y)||(g=Math.min(f=C*U-A*V,p=R*U-k*V,m=P*U-L*V),_=Math.max(f,p,m),g>(y=Math.abs(V)*T+Math.abs(U)*E)||_<-y)||(g=Math.min(f=S*F-C*O,p=I*F-R*O,m=M*F-P*O),_=Math.max(f,p,m),g>(y=Math.abs(F)*w+Math.abs(O)*E)||_<-y)||(g=Math.min(f=S*z-C*N,p=I*z-R*N,m=M*z-P*N),_=Math.max(f,p,m),g>(y=Math.abs(z)*w+Math.abs(N)*E)||_<-y)||(g=Math.min(f=S*V-C*B,p=I*V-R*B,m=
8M*V-P*B),_=Math.max(f,p,m),g>(y=Math.abs(V)*w+Math.abs(B)*E)||_<-y)||(g=Math.min(f=A*O-S*D,p=k*O-I*D,m=L*O-M*D),_=Math.max(f,p,m),g>(y=Math.abs(D)*w+Math.abs(O)*T)||_<-y)||(g=Math.min(f=A*N-S*j,p=k*N-I*j,m=L*N-M*j),_=Math.max(f,p,m),g>(y=Math.abs(j)*w+Math.abs(N)*T)||_<-y)||(g=Math.min(f=A*B-S*U,p=k*B-I*U,m=L*B-M*U),_=Math.max(f,p,m),g>(y=Math.abs(U)*w+Math.abs(B)*T)||_<-y)||(g=Math.min(S,I,M),_=Math.max(S,I,M),g>w||_<-w)||(g=Math.min(A,k,L),_=Math.max(A,k,L),g>T||_<-T)||(g=Math.min(C,R,P),_=Math.max(C,R,P),g>E||_<-E))return!1;let H=D*z-F*j,G=F*N-O*z,q=O*j-D*N;return y=w*Math.abs(H)+T*Math.abs(G)+E*Math.abs(q),!(Math.abs(-(H*S+G*A+q*C))>y)})(this._vertices[s],this._vertices[s+1],this._vertices[s+2],this._vertices[l],this._vertices[l+1],this._vertices[l+2],this._vertices[u],this._vertices[u+1],this._vertices[u+2],i,r)&&(n=Math.max(n,this._vertices[s+2],this._vertices[l+2],this._vertices[u+2]))}continue}let s=a+1,l=o.backChild,u=this._nodes[s],c=this._nodes[l],d=fU(u.aabbMin,u.aabbMax,i,r),h=fU(c.aabbMin,c.aabbMax,i,r);d&&h?u.aabbMax[2]<c.aabbMax[2]?(fV.push(s),fV.push(l)):(fV.push(l),fV.push(s)):d?fV.push(s):h&&fV.push(l)}return n>=0?n:null}}function fG(i,r){let n=i.json.bufferViews[r.bufferView],a=h6[r.componentType];return new a(i.buffers[n.buffer],(r.byteOffset||0)+(n.byteOffset||0),r.count*(n.byteStride&&n.byteStride!==fe[r.type]*a.BYTES_PER_ELEMENT?n.byteStride/a.BYTES_PER_ELEMENT:fe[r.type]))}function fq(i,r,n,a){let o=h6[r.componentType],s=function(i){switch(i){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(o),l=i.json.bufferViews[r.bufferView],u=l.byteStride?l.byteStride/o.BYTES_PER_ELEMENT:fe[r.type],c=n.float32,d=c.length/n.capacity,h=r.count*u;for(let i=0,r=0;i<h;i+=u,r+=d)for(let n=0;n<d;n++)c[r+n]=a[i+n]*s}function f$(i,r,n){var a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w,T,E,S,A,C;let{matrix:I,rotation:k,translation:R,scale:M,mesh:L,extras:P,children:O,name:D}=i,F={};if(F.name=D,F.localMatrix=I||(a=[],o=k||[0,0,0,1],s=R||[0,0,0],l=M||[1,1,1],u=o[0],c=o[1],d=o[2],h=o[3],f=u+u,p=c+c,m=d+d,g=u*f,_=u*p,y=u*m,v=c*p,x=c*m,b=d*m,w=h*f,T=h*p,E=h*m,S=l[0],A=l[1],C=l[2],a[0]=(1-(v+b))*S,a[1]=(_+E)*S,a[2]=(y-T)*S,a[3]=0,a[4]=(_-E)*A,a[5]=(1-(g+b))*A,a[6]=(x+w)*A,a[7]=0,a[8]=(y+T)*C,a[9]=(x-w)*C,a[10]=(1-(g+v))*C,a[11]=0,a[12]=s[0],a[13]=s[1],a[14]=s[2],a[15]=1,a),F.globalMatrix=$(F.localMatrix),void 0!==L){F.meshes=n[L];let i=F.anchor=[0,0];for(let r of F.meshes){let{min:n,max:a}=r.aabb;i[0]+=n[0]+a[0],i[1]+=n[1]+a[1]}i[0]=Math.floor(i[0]/F.meshes.length/2),i[1]=Math.floor(i[1]/F.meshes.length/2)}if(P&&(P.id&&(F.id=P.id),P.lights&&(F.lights=function(i){if(!i.length)return[];let r=function(i){let r=atob(i),n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.codePointAt(i);return n}(i),n=[],a=r.length/24,o=new Uint16Array(r.buffer),s=new Float32Array(r.buffer);for(let i=0;i<a;i++){let r=o[2*i*6]/30,a=o[2*i*6+1]/30,l=o[2*i*6+10]/100,u=s[6*i+1],c=s[6*i+2],d=s[6*i+3],h=s[6*i+4],f=d-u,p=h-c,m=Math.hypot(f,p);n.push({pos:[u+.5*f,c+.5*p,a],normal:[p/m,-f/m,0],width:m,height:r,depth:l,points:[u,c,d,h]})}return n}(P.lights)),P.MAPBOX_geometry_bloom&&(F.isGeometryBloom=P.MAPBOX_geometry_bloom),P.MAPBOX_zoom_min&&(F.minZoom=P.MAPBOX_zoom_min),P.MAPBOX_zoom_max&&(F.maxZoom=P.MAPBOX_zoom_max)),O){let i=[];for(let a of O)i.push(f$(r.json.nodes[a],r,n));F.children=i}if(i.extensions&&i.extensions.mbx_bvh&&(F.meshBVH=function(i,r,n){let a=r.binaryAccessor,o=r.positionMinAccessor,s=r.positionMaxAccessor,l=r.indexAccessor;if(!(Number.isInteger(a)&&Number.isInteger(o)&&Number.isInteger(s)&&Number.isInteger(l)))return null;let u=i.json.accessors;if(a>=u.length||o>=u.length||s>=u.length||l>=u.length)return null;let c=u[a],d=u[o],h=u[s],f=u[l];if(void 0===c.bufferView||void 0===d.bufferView||void 0===h.bufferView||void 0===f.bufferView)return null;let p=i.json.bufferViews;if(c.bufferView>=p.length||d.bufferView>=p.length||h.bufferView>=p.length||f.bufferView>=p.length)return null;let m=p[c.bufferView],g=p[d.bufferView],_=p[h.bufferView],y=p[f.bufferView];if(m.buffer>=i.buffers.length||g.buffer>=i.buffers.length||_.buffer>=i.buffers.length||y.buffer>=i.buffers.length)return null;let v=(i,r,n)=>i>=0&&i<=n&&r<=n-i,x=c.byteOffset||0,b=d.byteOffset||0,w=h.byteOffset||0,T=f.byteOffset||0;
8if(!(v(x,0,m.byteLength)&&v(b,3*d.count*4,g.byteLength)&&v(w,3*h.count*4,_.byteLength)&&v(T,4*f.count,y.byteLength)))return null;let E=new Uint8Array(i.buffers[m.buffer],(m.byteOffset||0)+x,m.byteLength-x),S=new Float32Array(i.buffers[g.buffer],(g.byteOffset||0)+b,3*d.count),A=new Float32Array(i.buffers[_.buffer],(_.byteOffset||0)+w,3*h.count),C=new Uint32Array(i.buffers[y.buffer],(y.byteOffset||0)+T,f.count),I=new fH;if(I.serializeFromGltf(E,S,A,C),void 0!==n&&i.json.meshes&&i.json.meshes[n]){let r=i.json.meshes[n].primitives[0];if(r&&void 0!==r.attributes.POSITION&&r.attributes.POSITION<u.length){let n=u[r.attributes.POSITION];if(void 0!==n.bufferView&&n.bufferView<p.length){let r=p[n.bufferView];if(r.buffer<i.buffers.length){let a=n.byteOffset||0,o=r.byteStride?r.byteStride/4:3;if(v(a,n.count*o*4,r.byteLength)){let s=(r.byteOffset||0)+a;if(3===o)I.setVertices(new Float32Array(i.buffers[r.buffer],s,3*n.count));else{let a=new Float32Array(i.buffers[r.buffer],s,n.count*o),l=new Float32Array(3*n.count);for(let i=0;i<n.count;i++)l[3*i]=a[i*o],l[3*i+1]=a[i*o+1],l[3*i+2]=a[i*o+2];I.setVertices(l)}}}}}}return I}(r,i.extensions.mbx_bvh,L)),!F.meshBVH&&F.children){for(let i of F.children)if(i.meshBVH){F.meshBVH=i.meshBVH;break}}return F}function fW(i,r){for(let n=0;n<i.length;n++)if(i[n].name===r)return n;return -1}function fY(i){let r=function(i,r){let n=[],a=WebGL2RenderingContext;if(i.json.textures)for(let o of i.json.textures){let s={magFilter:a.LINEAR,minFilter:a.NEAREST,wrapS:a.REPEAT,wrapT:a.REPEAT};void 0!==o.sampler&&Object.assign(s,i.json.samplers[o.sampler]),n.push({image:r[o.source],sampler:s,uploaded:!1})}return n}(i,i.images),n=function(i,r){let n=[];for(let a of i.json.meshes){let o=[];for(let n of a.primitives)o.push(function(i,r,n){let a=i.indices,o=i.attributes,s={};s.indexArray=new sw;let l=r.json.accessors[a],u=fG(r,l);s.indexArray.resizeExact(l.count/3),s.indexArray.uint16.set(u),s.vertexArray=new su;let c=r.json.accessors[o.POSITION],d=fG(r,c);s.vertexArray.resizeExact(c.count),s.vertexArray.float32.set(d),s.aabb=new c4(c.min,c.max);let[h,f,p]=c.min,[m,g,_]=c.max;if(s.centroid=[.5*(h+m),.5*(f+g),.5*(p+_)],void 0!==o.COLOR_0){let i=r.json.accessors[o.COLOR_0],n=fe[i.type],a=fG(r,i);s.colorArray=3===n?new su:new sm,s.colorArray.resizeExact(i.count),fq(r,i,s.colorArray,a)}if(void 0!==o.NORMAL){s.normalArray=new su;let i=r.json.accessors[o.NORMAL];s.normalArray.resizeExact(i.count);let n=fG(r,i);fq(r,i,s.normalArray,n)}if(void 0!==o.TEXCOORD_0&&n.length>0){s.texcoordArray=new sR;let i=r.json.accessors[o.TEXCOORD_0];s.texcoordArray.resizeExact(i.count);let n=fG(r,i);fq(r,i,s.texcoordArray,n)}if(void 0!==o._FEATURE_ID_RGBA4444){let i=r.json.accessors[o._FEATURE_ID_RGBA4444];r.json.extensionsUsed&&r.json.extensionsUsed.includes("EXT_meshopt_compression")&&(s.featureData=fG(r,i))}void 0!==o._FEATURE_RGBA4444&&(s.featureData=new Uint32Array(fG(r,r.json.accessors[o._FEATURE_RGBA4444]).buffer));let y=i.material;return s.material=function(i,r){let{emissiveFactor:n=[0,0,0],alphaMode:a="OPAQUE",alphaCutoff:o=.5,normalTexture:s,occlusionTexture:l,emissiveTexture:u,doubleSided:c,name:d}=i,{baseColorFactor:h=[1,1,1,1],metallicFactor:f=1,roughnessFactor:p=1,baseColorTexture:m,metallicRoughnessTexture:g}=i.pbrMetallicRoughness||{},_=l?r[l.index]:void 0;if(l&&l.extensions&&l.extensions.KHR_texture_transform&&_){let i=l.extensions.KHR_texture_transform;_.offsetScale=[i.offset[0],i.offset[1],i.scale[0],i.scale[1]]}return{name:d,pbrMetallicRoughness:{baseColorFactor:new iE(...h),metallicFactor:f,roughnessFactor:p,baseColorTexture:m?r[m.index]:void 0,metallicRoughnessTexture:g?r[g.index]:void 0},doubleSided:c,emissiveFactor:new iE(...n),alphaMode:a,alphaCutoff:o,normalTexture:s?r[s.index]:void 0,occlusionTexture:_,emissionTexture:u?r[u.index]:void 0,defined:void 0===i.defined}}(void 0!==y?r.json.materials[y]:{defined:!1},n),s}(n,i,r));n.push(o)}return n}(i,r),{scenes:a,scene:o,nodes:s}=i.json,l=a?fW(a,"Default Scene"):-1;l<0&&(l=o||0);let u=a?a[l].nodes:[...s.keys()],c=[];for(let r of u)c.push(f$(s[r],i,n));!function(i,r,n){let a={},o=new Set;for(let s=0;s<i.length;s++){let i=n[r[s]];if(!i.extras)continue;let l=i.extras["mapbox:footprint:version"],u=i.extras["mapbox:footprint:id"];(l||u)&&o.add(s),"1.0.0"===l&&u&&(a[u]=s)}for(let s=0;s<i.length;s++){if(o.has(s))continue;let l=i[s],u=n[r[s]];if(!u.extras)continue;let c=null;l.id in a&&(c=function(i,r){let n=[],a=[],o=0,s=[];for(let l of i){o=n.length;let i=l.vertexArray.float32,u=l.indexArray.uint16;for(let a=0;a<l.vertexArray.length;a++)s[0]=i[3*a+0],s[1]=i[3*a+1],s[2]=i[3*a+2],eA(s,s,r),n.push(new eQ(s[0],s[1]));for(let i=0;i<3*l.indexArray.length;i++)a.push(u[i]+o)}if(a.length%3!=0)return null;for(let i=0;i<a.length;i+=3){let r=n[a[i+0]],o=n[a[i+1]],s=n[a[i+2]];(r.x-o.x)*(s.y-o.y)-(s.x-o.x)*(r.y-o.y)>0&&([a[i+1],a[i+2]]=[a[i+2],a[i+1]])}return{vertices:n,indices:a}}(i[a[l.id]].meshes,l.localMatrix)),c||(c=function(i){if(!i.extras||!i.extras.ground)return null;let r=i.extras.ground;if(!r||!Array.isArray(r)||0===r.length)return null;let n=r[0];if(!n||!Array.isArray(n)||0===n.length)return null;let a=[];for(let i of n){if(!Array.isArray(i)||2!==i.length)continue;let r=i[0],n=i[1];"number"==typeof r&&"number"==typeof n&&a.push(new eQ(r,n))}if(a.length<3)return null;a.length>1&&a.at(-1).equals(a[0])&&a.pop();let o=0;for(let i=0;i<a.length;i++){let r=a[i],n=a[(i+1)%a.length],s=a[(i+2)%a.length];o+=(r.x-n.x)*(s.y-n.y)-(s.x-n.x)*(r.y-n.y)}o>0&&a.reverse();let s=ov(a.flatMap(i=>[i.x,i.y]),[]);return 0===s.length?null:{vertices:a,indices:s}}(u)),c&&(l.footprint=function(i){if(0===i.vertices.length||0===i.indices.length)return null;let r=new fd(i.vertices,i.indices,8,256),[n,a]=[r.min.clone(),r.max.clone()];return{vertices:i.vertices,indices:i.indices,grid:r,min:n,max:a}}(c))}if(o.size>0){let r=Array.from(o.values()).sort((i,r)=>i-r);for(let n=r.length-1;n>=0;n--)i.splice(r[n],1)}}(c,u,i.json.nodes);let d=a?fW(a,"LOD"):-1;if(d>=0){let r=a[d].nodes,o=new Map;for(let a of r){let r=f$(s[a],i,n);r.id&&o.set(r.id,r)}for(let i of c)if(i.id){let r=o.get(i.id);
8r&&r.meshes&&(i.lodMeshes=r.meshes,r.meshBVH&&(i.meshBVH=r.meshBVH))}}return c}function fZ(i,r,n,a,o){n.reserve(n.length+4*i.length),a.reserve(a.length+10*i.length),o.reserve(o.length+10*i.length);let s=a.length;for(let l of i){let i=Math.min(10,Math.max(4,1.3*l.height))*r,u=[-l.normal[1],l.normal[0],0],c=Math.min(.29,.1*l.width/l.depth),d=l.width-2*l.depth*r*(c+.01),h=e_([],l.pos,u,d/2),f=e_([],l.pos,u,-d/2),p=[h[0],h[1],h[2]+l.height],m=[f[0],f[1],f[2]+l.height],g=e_([],l.normal,u,c);eg(g,g,i);let _=e_([],l.normal,u,-c);eg(_,_,i),ed(g,h,g),ed(_,f,_),h[2]+=.1,f[2]+=.1,a.emplaceBack(g[0],g[1],g[2]),a.emplaceBack(_[0],_[1],_[2]),a.emplaceBack(h[0],h[1],h[2]),a.emplaceBack(f[0],f[1],f[2]),a.emplaceBack(p[0],p[1],p[2]),a.emplaceBack(m[0],m[1],m[2]),a.emplaceBack(h[0],h[1],h[2]),a.emplaceBack(f[0],f[1],f[2]),a.emplaceBack(g[0],g[1],g[2]),a.emplaceBack(_[0],_[1],_[2]);let y=d/i/2;o.emplaceBack(-y-c,-1,y,.8),o.emplaceBack(y+c,-1,y,.8),o.emplaceBack(-y,0,y,1.3),o.emplaceBack(y,0,y,1.3),o.emplaceBack(y+c,-.8,y,.7),o.emplaceBack(y+c,-.8,y,.7),o.emplaceBack(0,0,y,1.3),o.emplaceBack(0,0,y,1.3),o.emplaceBack(y+c,-1.2,y,.8),o.emplaceBack(y+c,-1.2,y,.8),n.emplaceBack(6+s,4+s,8+s),n.emplaceBack(7+s,9+s,5+s),n.emplaceBack(0+s,1+s,2+s),n.emplaceBack(1+s,3+s,2+s),s+=10}}ar(fH,"ModelBVH");let fK=o6([{name:"a_pos_3f",components:3,type:"Float32"}]),fX=o6([{name:"a_normal_3",components:3,type:"Int16"}]),fQ=o6([{name:"a_centroid_3",components:3,type:"Int16"}]),fJ=o6([{name:"a_part_color_emissive",components:2,type:"Uint16"}]),f1=o6([{name:"a_faux_facade_color_emissive",components:2,type:"Uint16"}]),f0=o6([{name:"a_faux_facade_data",components:4,type:"Uint16"}]),f2=o6([{name:"a_faux_facade_vertical_range",components:2,type:"Uint16"}]),f5=o6([{name:"a_bloom_attenuation",components:4,type:"Float32"}]),f4=o6([{name:"a_flood_light_wall_radius_1i16",components:1,type:"Int16"}]),f9=o6([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),f3=o6([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),f8=o6([{name:"a_flood_light_ground_radius",components:1,type:"Float32"}]),f6=o6([{name:"a_centroid_pos",components:2,type:"Uint16"}]),f7=o6([{name:"a_join_normal_inside",components:3,type:"Int16"}]),pe=o6([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),pt=o6([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:pi}=f9;function pr(i,r,n,a){let o=[],s=0===a?(i,r,n,a,o,s)=>{i.push(new eQ(s,n+(s-r)/(a-r)*(o-n)))}:(i,r,n,a,o,s)=>{i.push(new eQ(r+(s-n)/(o-n)*(a-r),s))};for(let l of i){let i=[];for(let o of l){if(o.length<=2)continue;let l=[];for(let i=0;i<o.length-1;i++){let u=o[i].x,c=o[i].y,d=o[i+1].x,h=o[i+1].y,f=0===a?u:c,p=0===a?d:h;f<r?p>r&&s(l,u,c,d,h,r):f>n?p<n&&s(l,u,c,d,h,n):l.push(o[i]),p<r&&f>=r&&s(l,u,c,d,h,r),p>n&&f<=n&&s(l,u,c,d,h,n)}let u=o.at(-1),c=0===a?u.x:u.y;c>=r&&c<=n&&l.push(u),l.length&&(u=l.at(-1),l[0].x===u.x&&l[0].y===u.y||l.push(l[0]),i.push(l))}i.length&&o.push(i)}return o}let pn={None:0,Model:1,Symbol:2,FillExtrusion:4},pa=[new eQ(0,0),new eQ(8192,0),new eQ(8192,8192),new eQ(0,8192)];function po(i,r){let n=[],a=[];if(!r||i.length<2)return[i];if(2===i.length)return lV(i[0],i[1],pa)?[i]:[];for(let r=0;r<i.length+2;r++){let o=0===r?i.at(-1):i[(r-1)%i.length],s=i[r%i.length],l=i[(r+1)%i.length],u=lV(o,s,pa),c=lV(s,l,pa),d=u||c;d&&a.push(s),d&&c||a.length>0&&(a.length>1&&n.push(a),a=[])}return a.length>1&&n.push(a),n}let ps=lR.types,pl=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius","fill-extrusion-line-width","fill-extrusion-emissive-strength"],pu=["fill-extrusion-flood-light-ground-radius"],pc=new eQ(0,1);function pd(i,r,n,a,o,s,l,u){i.emplaceBack((r<<1)+l,(n<<1)+s,(Math.floor(8192*a)<<1)+o,Math.round(u))}function ph(i,r,n){i.emplaceBack(8192*r.x,8192*r.y,+!!n)}function pf(i,r,n,a,o,s){i.emplaceBack(r.x,r.y,(n.x<<1)+a,(n.y<<1)+o,s)}function pp(i,r,n){i.emplaceBack(r.x,r.y,r.z,16384*n[0],16384*n[1],16384*n[2])}class pm{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class pg{constructor(){this.data=[]}get length(){return this.data.length}push(i){this.data.push(i)}get(i){return this.data[i]}static serialize(i,r){let n=i.data.length,a=new Uint32Array(4*n),o=[];o.length=n;for(let r=0;r<n;r++){let n=i.data[r],s=4*r;a[s]=n.vertexOffset,a[s+1]=n.vertexCount,a[s+2]=n.indexOffset,a[s+3]=n.indexCount,o[r]=n.ringIndices}return r&&r.add(a.buffer),{scalars:a,rings:o}}static deserialize(i){let{scalars:r,rings:n}=i,a=r.length/4,o=new pg,s=[];s.length=a,o.data=s;for(let i=0;i<a;i++){let a=4*i,s=new pm;s.vertexOffset=r[a],s.vertexCount=r[a+1],s.indexOffset=r[a+2],s.indexCount=r[a+3],s.ringIndices=n[i],o.data[i]=s}return o}}class p_{constructor(){this.centroidXY=new eQ(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new eQ(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new eQ(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0,this.buildingId=0,this.groupCentroidPos=new eQ(0,0)}span(){return new eQ(this.max.x-this.min.x,this.max.y-this.min.y)}}class py{constructor(){this.data=[],this.buffer=null}get length(){return this.data.length}push(i){this.data.push(i)}get(i){return this.data[i]}find(i){return this.data.find(i)}[Symbol.iterator](){return this.data[Symbol.iterator]()}static serialize(i,r){let n=i.data.length,a=new Float64Array(15*n);for(let r=0;r<n;
8r++){let n=i.data[r],o=15*r;a[o]=n.centroidXY.x,a[o+1]=n.centroidXY.y,a[o+2]=n.min.x,a[o+3]=n.min.y,a[o+4]=n.max.x,a[o+5]=n.max.y,a[o+6]=n.groupCentroidPos.x,a[o+7]=n.groupCentroidPos.y,a[o+8]=n.vertexArrayOffset,a[o+9]=n.vertexCount,a[o+10]=n.groundVertexArrayOffset,a[o+11]=n.groundVertexCount,a[o+12]=n.footprintSegLen,a[o+13]=n.height,a[o+14]=n.buildingId}return r&&r.add(a.buffer),{buffer:a}}static deserialize(i){let r=i.buffer,n=r.length/15,a=new py;a.buffer=r;let o=[];o.length=n,a.data=o;let s=0;for(let i=0;i<n;i++){let n=15*i,o=new p_;o.centroidXY=new eQ(r[n],r[n+1]),o.min=new eQ(r[n+2],r[n+3]),o.max=new eQ(r[n+4],r[n+5]),o.groupCentroidPos=new eQ(r[n+6],r[n+7]),o.vertexArrayOffset=r[n+8],o.vertexCount=r[n+9],o.groundVertexArrayOffset=r[n+10],o.groundVertexCount=r[n+11],o.footprintSegLen=r[n+12],o.height=r[n+13],o.buildingId=r[n+14],o.footprintSegIdx=s,s+=o.footprintSegLen,a.data[i]=o}return a}}class pv{constructor(){this.acc=new eQ(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(i,r){i.min.x===Number.MAX_VALUE&&(i.min.x=i.max.x=r.x,i.min.y=i.max.y=r.y)}appendEdge(i,r,n){this.accCount++,this.acc._add(r);let a=!!this.borders;r.x<i.min.x?(i.min.x=r.x,a=!0):r.x>i.max.x&&(i.max.x=r.x,a=!0),r.y<i.min.y?(i.min.y=r.y,a=!0):r.y>i.max.y&&(i.max.y=r.y,a=!0),((0===r.x||8192===r.x)&&r.x===n.x)!=((0===r.y||8192===r.y)&&r.y===n.y)&&this.processBorderOverlap(r,n),a&&this.checkBorderIntersection(r,n)}checkBorderIntersection(i,r){r.x<0!=i.x<0&&this.addBorderIntersection(0,iw(r.y,i.y,(0-r.x)/(i.x-r.x))),r.x>8192!=i.x>8192&&this.addBorderIntersection(1,iw(r.y,i.y,(8192-r.x)/(i.x-r.x))),r.y<0!=i.y<0&&this.addBorderIntersection(2,iw(r.x,i.x,(0-r.y)/(i.y-r.y))),r.y>8192!=i.y>8192&&this.addBorderIntersection(3,iw(r.x,i.x,(8192-r.y)/(i.y-r.y)))}addBorderIntersection(i,r){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]]);let n=this.borders[i];r<n[0]&&(n[0]=r),r>n[1]&&(n[1]=r)}processBorderOverlap(i,r){if(i.x===r.x){if(i.y===r.y)return;let n=+(0!==i.x);this.addBorderIntersection(n,r.y),this.addBorderIntersection(n,i.y)}else{let n=0===i.y?2:3;this.addBorderIntersection(n,r.x),this.addBorderIntersection(n,i.x)}}centroid(){return 0===this.accCount?new eQ(0,0):new eQ(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce((i,r)=>i+ +(r[0]!==Number.MAX_VALUE),0):0}}function px(i,r){let n=i.add(r)._unit();return Math.min(4,Math.max(-4,Math.tan(Math.acos(ts(i.x*n.x+i.y*n.y,-1,1)))))/4*32767*(i.x*r.y-i.y*r.x<0?-1:1)}let pb=[i=>i.x<0,i=>i.x>8192,i=>i.y<0,i=>i.y>8192];class pw{constructor(i){this.groundRadiusArray=null,this.groundRadiusBuffer=null,this.vertexArray=new ss,this.indexArray=new sw,this.programConfigurations=new lg(i.layers,{zoom:i.zoom,lut:i.lut},i=>pu.includes(i)),this._segments=new s1,this.hiddenByLandmarkVertexArray=new sF,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new s1}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(i,r,n,a=!1){let o=i.length;if(o>2){let s,l=Math.max(0,this._segments.get().length-1),u=this._segments._prepareSegment(4*o,this.vertexArray.length,2*this._segmentToGroundQuads[l].length);l!==this._segments.get().length-1&&(l++,this._segmentToGroundQuads[l]=[],this._segmentToRegionTriCounts[l]=[0,0,0,0,0]);{let r=i[0],n=i[1];s=px(r.sub(i[o-1])._perp()._unit(),n.sub(r)._perp()._unit())}for(let c=0;c<o;c++){let d=c===o-1?0:c+1,h=i[c],f=i[d],p=i[d===o-1?0:d+1],m=f.sub(h)._perp()._unit(),g=px(m,p.sub(f)._perp()._unit()),_=s;if(pA(h,f,r)||a&&pC(h,r)&&pC(f,r)){s=g;continue}let y=u.vertexLength;for(let i of(pf(this.vertexArray,h,f,1,1,_),pf(this.vertexArray,h,f,1,0,_),pf(this.vertexArray,h,f,0,1,g),pf(this.vertexArray,h,f,0,0,g),u.vertexLength+=4,function(i,r,n,a){let o=[4];if(0===a)return o;n._mult(a);let s=i.sub(n),l=r.sub(n),u=[i,r,s,l];for(let i=0;i<4;i++)for(let r of u)if(pb[i](r)){o.push(i);break}return o}(h,f,m,n)))this._segmentToGroundQuads[l].push({id:y,region:i}),this._segmentToRegionTriCounts[l][i]+=2,u.primitiveLength+=2;s=g}}}prepareBorderSegments(){if(!this.hasData())return;let i=this._segments.get(),r=i.length;for(let i=0;i<r;i++)this._segmentToGroundQuads[i].sort((i,r)=>i.region-r.region);for(let n=0;n<r;n++){let r=this._segmentToGroundQuads[n],a=i[n],o=this._segmentToRegionTriCounts[n];o.reduce((i,r)=>i+r,0);let s=0;for(let i=0;i<=4;i++){let r=o[i];if(0!==r){let n=this.regionSegments[i];n||(n=this.regionSegments[i]=new s1);let o={vertexOffset:a.vertexOffset,primitiveOffset:a.primitiveOffset+s,vertexLength:a.vertexLength,primitiveLength:r};n.get().push(o)}s+=r}for(let i=0;i<r.length;i++){let n=r[i].id;this.indexArray.emplaceBack(n,n+1,n+3),this.indexArray.emplaceBack(n,n+3,n+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(i,r,n,a,o,s,l){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,i,r,n,a,o,s,void 0,l)}upload(i){this.hasData()&&(this.vertexBuffer=i.createVertexBuffer(this.vertexArray,f3.members),this.indexBuffer=i.createIndexBuffer(this.indexArray),null!=this.groundRadiusArray&&(this.groundRadiusBuffer=i.createVertexBuffer(this.groundRadiusArray,f8.members)))}uploadPaintProperties(i){this.hasData()&&this.programConfigurations.upload(i)}update(i,r,n,a,o,s,l,u){this.hasData()&&this.programConfigurations.updatePaintArrays(i,r,n,a,o,s,l,u)}updateHiddenByLandmark(i){this.updateHiddenByLandmarkRange(i.groundVertexArrayOffset,i.groundVertexCount,!!(0x80000000&i.flags||0x40000000&i.flags))}updateHiddenByLandmarkRange(i,r,n){if(!this.hasData())return;let a=r+i;if(0!==r){for(let r=i;r<a;++r)this.hiddenByLandmarkVertexArray.emplace(r,+!!n);this._needsHiddenByLandmarkUpdate=!0}}uploadHiddenByLandmark(i){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=i.createVertexBuffer(this.hiddenByLandmarkVertexArray,pe.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this.groundRadiusBuffer&&this.groundRadiusBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let i=0;i<=4;i++){let r=this.regionSegments[i];r&&r.destroy()}}}}class pT{constructor(i){this.zoom=i.zoom,this.canonical=i.canonical,this.overscaling=i.overscaling,this.layers=i.layers,this.pixelRatio=i.pixelRatio,this.layerIds=this.layers.map(i=>i.fqid),this.index=i.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=i.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=new py,this.footprintIndices=new sw,this.footprintVertices=new se,this.footprintSegments=new pg,this.layoutVertexArray=new so,this.centroidVertexArray=new sW,this.wallVertexArray=new sZ,this.indexArray=new sw,this.programConfigurations=new lg(i.layers,{zoom:i.zoom,lut:i.lut},i=>pl.includes(i)),this.segments=new s1,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.groundEffect=new pw(i),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[],this.buildingGroups=new Map,this.worldview=i.worldview,this.hasAppearances=null}updateFootprints(i,r){}updateAppearances(i,r,n,a){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(i,r,n,a){for(let{feature:o,id:s,index:l,sourceLayerIndex:u}of(this.features=[],this.hasPattern=oN("fill-extrusion",this.layers,this.pixelRatio,r),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.selfDEMTileTimestamp=Number.MAX_VALUE,this.borderDEMTileTimestamp=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],this.tileToMeter=oQ(n),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=0!==this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1),i)){let i=this.layers[0]._featureFilter.needGeometry,c=o5(o,i);if(!this.layers[0]._featureFilter.filter(new aZ(this.zoom,{worldview:this.worldview,activeFloors:r.activeFloors}),c,n))continue;let d={id:s,sourceLayerIndex:u,index:l,geometry:i?c.geometry:o2(o,n,a),properties:o.properties,type:o.type,patterns:{}},h=this.layoutVertexArray.length,f="Polygon"===ps[d.type];if(this.hasPattern)this.features.push({featureId:o.id,feature:oj("fill-extrusion",this.layers,d,this.zoom,this.pixelRatio,r)});else if(this.wallMode)for(let i of d.geometry)for(let s of po(i,f))this.addFeature(o.id,d,[s],l,n,{},r.availableImages,a,r.brightness);else this.addFeature(o.id,d,d.geometry,l,n,{},r.availableImages,a,r.brightness);r.featureIndex.insert(o,d.geometry,l,u,this.index,h)}this._finalizeBuildingGroups(),this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(i,r,n,a,o,s){for(let{featureId:i,feature:l}of this.features){let u="Polygon"===ps[l.type],{geometry:c}=l;if(this.wallMode)for(let d of c)for(let c of po(d,u))this.addFeature(i,l,[c],l.index,r,n,a,o,s);else this.addFeature(i,l,c,l.index,r,n,a,o,s)}this._finalizeBuildingGroups(),this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(i,r,n,a,o,s,l){this.programConfigurations.updatePaintArrays(i,r,o,n,a,s,l,this.worldview),this.groundEffect.update(i,r,o,n,a,s,l,this.worldview)}updateExpressions(i){this.programConfigurations.updateExpressions(i),this.groundEffect.programConfigurations.updateExpressions(i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,pi),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.wallVertexBuffer=i.createVertexBuffer(this.wallVertexArray,f7.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=i.createVertexBuffer(this.layoutVertexExtArray,pt.members,!0)),this.groundEffect.upload(i)),this.groundEffect.uploadPaintProperties(i),this.programConfigurations.upload(i),this.uploaded=!0}uploadCentroid(i){this.groundEffect.uploadHiddenByLandmark(i),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=i.createVertexBuffer(this.centroidVertexArray,f6.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(i,r,n,a,o,s,l,u,c){let d,h,f=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(r,{})/this.tileToMeter,p=[new eQ(0,0),new eQ(8192,8192)],m=u.projection,g="globe"===m.name,_=this.wallMode||"Polygon"===ps[r.type],y=new pv;y.centroidDataIndex=this.centroidData.length;let v=new p_;v.buildingId=i,r.properties&&Object.hasOwn(r.properties,"building_id")&&(v.buildingId=Number(r.properties.building_id)),y.buildingId=v.buildingId;let x=0>=this.layers[0].paint.get("fill-extrusion-base").evaluate(r,{},o),b=this.layers[0].paint.get("fill-extrusion-height").evaluate(r,{},o);if(v.height=b,v.vertexArrayOffset=this.layoutVertexArray.length,v.groundVertexArrayOffset=this.groundEffect.vertexArray.length,g&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new sh),this.wallMode){if(g)return void tb("Non zero fill-extrusion-line-width is not yet supported on globe.");if(1!==n.length)return;n=[(d=function(i){let r=i[0].x===i.at(-1).x&&i[0].y===i.at(-1).y;(function(i){let r=0,n=i.length;for(let a=0;a<n;a++)r+=(i[(a+1)%n].x-i[a].x)*(i[(a+1)%n].y+i[a].y);return r>=0})(i)||(i=i.reverse());let n={geometry:[],joinNormals:[],indices:[]},a=[],o=[],s=[],l=i.length;for(;l>=2&&i[l-1].equals(i[l-2]);)l--;if(l<(r?3:2))return n;let u,c,d,h,f,p=0;for(;p<l-1&&i[p].equals(i[p+1]);)p++;r&&(u=i[l-2],f=i[p].sub(u)._unit()._perp());for(let n=p;n<l;
8n++){if((d=n===l-1?r?i[p+1]:void 0:i[n+1])&&i[n].equals(d))continue;f&&(h=f),u&&(c=u),u=i[n],f=d?d.sub(u)._unit()._perp():h;let m=(h=h||f).add(f);0===m.x&&0===m.y||m._unit();let g=m.x*f.x+m.y*f.y,_=0!==g?1/g:1/0,y=h.x*f.y-h.y*f.x>0,v="miter";"miter"===v&&_>2&&(v="bevel"),"bevel"===v&&(_>100&&(v="flipbevel"),_<2&&(v="miter"));let x=(i,r,n,l)=>{let u=new eQ(i.x,i.y),c=new eQ(i.x,i.y);u.x+=r.x*l,u.y+=r.y*l,c.x-=r.x*Math.max(n,1),c.y-=r.y*Math.max(n,1),s.push(r),a.push(u),o.push(c)};if("miter"===v)m._mult(_),x(u,m,0,0);else if("flipbevel"===v)x(u,m=f.mult(-1),0,0),x(u,m.mult(-1),0,0);else{let i=-Math.sqrt(_*_-1),r=y?i:0,n=y?0:i;c&&x(u,h,r,n),d&&x(u,f,r,n)}}n.geometry=[...a,...o.reverse(),a[0]],n.joinNormals=[...s,...s.reverse(),s.at(-1)];let m=n.geometry.length-1;for(let i=0;i<m/2;i++)if(i+1<m/2){let r=i,a=i+1,o=m-1-i,s=m-2-i;r=0===r?m-1:r-1,a=0===a?m-1:a-1,o=0===o?m-1:o-1,s=0===s?m-1:s-1,n.indices.push(o),n.indices.push(a),n.indices.push(r),n.indices.push(o),n.indices.push(s),n.indices.push(a)}return n}(n[0])).geometry]}let w=(i,r)=>i<(r.length-1)/2||i===r.length-1,T=this.wallMode?[n]:e2(n,500);for(let i=T.length-1;i>=0;i--){var E;let r=T[i];(0===r.length||(E=r[0]).every(i=>i.x<=0)||E.every(i=>i.x>=8192)||E.every(i=>i.y<=0)||E.every(i=>i.y>=8192))&&T.splice(i,1)}if(g)h=pM(T,p,o);else for(let i of(h=[],T))h.push({polygon:i,bounds:p});let S=_?this.edgeRadius:0,A=S>0&&this.zoom<17,C=(i,r)=>{if(0===i.length)return!1;let n=i.at(-1);return r.x===n.x&&r.y===n.y};for(let{polygon:i,bounds:r}of h){let n=0,a=0;for(let r of i)_&&!r[0].equals(r.at(-1))&&r.push(r[0]),a+=_?r.length-1:r.length;let s=this.segments.prepareSegment((_?5:4)*a,this.layoutVertexArray,this.indexArray);v.footprintSegIdx<0&&(v.footprintSegIdx=this.footprintSegments.length),v.polygonSegIdx<0&&(v.polygonSegIdx=this.polygonSegments.length);let l={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},u=new pm;if(u.vertexOffset=this.footprintVertices.length,u.indexOffset=3*this.footprintIndices.length,u.ringIndices=[],_){let a=[],l=[];n=s.vertexLength;for(let n=0;n<i.length;n++){let c,h,p=i[n];p.length&&0!==n&&l.push(a.length/2);let _=[];c=p[1].sub(p[0])._perp()._unit(),u.ringIndices.push(p.length-1);for(let i=1;i<p.length;i++){let r=p[i],n=p[i===p.length-1?1:i+1],l=r.clone();if(S){h=n.sub(r)._perp()._unit();let i=c.add(h)._unit(),a=S*Math.min(4,1/(c.x*i.x+c.y*i.y));l.x+=a*i.x,l.y+=a*i.y,l.x=Math.round(l.x),l.y=Math.round(l.y),c=h}if(!x||0!==S&&!A||C(_,l)||_.push(l),pd(this.layoutVertexArray,l.x,l.y,0,0,1,1,0),this.wallMode){let r=w(i,p);ph(this.wallVertexArray,d.joinNormals[i],!r)}s.vertexLength++,this.footprintVertices.emplaceBack(r.x,r.y),a.push(r.x,r.y),g&&pp(this.layoutVertexExtArray,m.projectTilePoint(l.x,l.y,o),m.upVector(o,l.x,l.y))}x&&(0===S||A)&&(0!==_.length&&C(_,_[0])&&_.pop(),this.groundEffect.addData(_,r,f))}let c=this.wallMode?d.indices:ov(a,l);for(let i=0;i<c.length;i+=3)this.footprintIndices.emplaceBack(u.vertexOffset+c[i+0],u.vertexOffset+c[i+1],u.vertexOffset+c[i+2]),this.indexArray.emplaceBack(n+c[i],n+c[i+2],n+c[i+1]),s.primitiveLength++;u.indexCount+=c.length,u.vertexCount+=this.footprintVertices.length-u.vertexOffset}for(let a=0;a<i.length;a++){let l,u,c,h=i[a];y.startRing(v,h[0]);let p=h.length>4&&pI(h[h.length-2],h[0],h[1]),b=S?function(i,r,n,a){let o=r.sub(i)._perp()._unit(),s=n.sub(r)._perp()._unit();return pS(i,r,n,pE(o,s),a)}(h[h.length-2],h[0],h[1],S):0,T=[];u=h[1].sub(h[0])._perp()._unit();let E=!0;for(let i=1,a=0;i<h.length;i++){let f=h[i-1],_=h[i],A=h[i===h.length-1?1:i+1];if(y.appendEdge(v,_,f),pA(_,f,r)){S&&(u=A.sub(_)._perp()._unit(),E=!E);continue}let I=_.sub(f)._perp(),k=I.x/(Math.abs(I.x)+Math.abs(I.y)),R=+(I.y>0),M=f.dist(_);if(a+M>32768&&(a=0),S){c=A.sub(_)._perp()._unit();let i=pS(f,_,A,pE(u,c),S);isNaN(i)&&(i=0);let r=_.sub(f)._unit();f=f.add(r.mult(b))._round(),_=_.add(r.mult(-i))._round(),b=i,u=c,x&&this.zoom>=17&&(C(T,f)||T.push(f),C(T,_)||T.push(_))}let L=s.vertexLength,P=h.length>4&&pI(f,_,A),O=pk(a,p,E);if(pd(this.layoutVertexArray,f.x,f.y,k,R,0,0,O),pd(this.layoutVertexArray,f.x,f.y,k,R,0,1,O),this.wallMode){let r=w(i-1,h),n=d.joinNormals[i-1];ph(this.wallVertexArray,n,r),ph(this.wallVertexArray,n,r)}if(a+=M,O=pk(a,P,!E),p=P,pd(this.layoutVertexArray,_.x,_.y,k,R,0,0,O),pd(this.layoutVertexArray,_.x,_.y,k,R,0,1,O),this.wallMode){let r=w(i,h),n=d.joinNormals[i];ph(this.wallVertexArray,n,r),ph(this.wallVertexArray,n,r)}if(s.vertexLength+=4,this.indexArray.emplaceBack(L+0,L+1,L+2),this.indexArray.emplaceBack(L+1,L+3,L+2),s.primitiveLength+=2,S){let a=n+(1===i?h.length-2:i-2),o=1===i?
8n:a+1;if(this.indexArray.emplaceBack(L+1,a,L+3),this.indexArray.emplaceBack(a,o,L+3),s.primitiveLength+=2,void 0===l&&(l=L),!pA(A,h[i],r)){let r=i===h.length-1?l:s.vertexLength;this.indexArray.emplaceBack(L+2,L+3,r),this.indexArray.emplaceBack(L+3,r+1,r),this.indexArray.emplaceBack(L+3,o,r+1),s.primitiveLength+=3}E=!E}if(g){let i=this.layoutVertexExtArray,r=m.projectTilePoint(f.x,f.y,o),n=m.projectTilePoint(_.x,_.y,o),a=m.upVector(o,f.x,f.y),s=m.upVector(o,_.x,_.y);pp(i,r,a),pp(i,r,a),pp(i,n,s),pp(i,n,s)}}_&&(n+=h.length-1),x&&S&&this.zoom>=17&&(0!==T.length&&C(T,T[0])&&T.pop(),this.groundEffect.addData(T,r,f,S>0))}this.footprintSegments.push(u),l.triangleCount=this.indexArray.length-l.triangleArrayOffset,this.polygonSegments.push(l),++v.footprintSegLen,++v.polygonSegLen}if(v.vertexCount=this.layoutVertexArray.length-v.vertexArrayOffset,v.groundVertexCount=this.groundEffect.vertexArray.length-v.groundVertexArrayOffset,0!==v.vertexCount){if(v.centroidXY=y.borders?pc:this.encodeCentroid(y,v),r.properties&&Object.hasOwn(r.properties,"building_id")){let i=v.buildingId,r=this.buildingGroups.get(i);r||(r={accX:0,accY:0,accCount:0,mergedMin:new eQ(Number.MAX_VALUE,Number.MAX_VALUE),mergedMax:new eQ(-Number.MAX_VALUE,-Number.MAX_VALUE),partIndices:[]},this.buildingGroups.set(i,r)),r.accX+=y.acc.x,r.accY+=y.acc.y,r.accCount+=y.accCount,r.mergedMin.x=Math.min(r.mergedMin.x,v.min.x),r.mergedMin.y=Math.min(r.mergedMin.y,v.min.y),r.mergedMax.x=Math.max(r.mergedMax.x,v.max.x),r.mergedMax.y=Math.max(r.mergedMax.y,v.max.y),r.partIndices.push(this.centroidData.length)}if(this.centroidData.push(v),y.borders){this.featuresOnBorder.push(y);let i=this.featuresOnBorder.length-1;for(let r=0;r<y.borders.length;r++)y.borders[r][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[r].push(i)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,r,a,s,l,o,c,void 0,this.worldview),this.groundEffect.addPaintPropertiesData(r,a,s,l,o,c,this.worldview),this.maxHeight=Math.max(this.maxHeight,b)}}_finalizeBuildingGroups(){for(let[,i]of this.buildingGroups){if(0===i.partIndices.length)continue;let r=new pv;r.acc=new eQ(i.accX,i.accY),r.accCount=i.accCount;let n=new p_;n.min=i.mergedMin,n.max=i.mergedMax;let a=this.encodeCentroid(r,n),o=r.centroid();for(let r of i.partIndices){let n=this.centroidData.get(r);n.centroidXY.x===pc.x&&n.centroidXY.y===pc.y||(n.centroidXY=a),n.min=i.mergedMin,n.max=i.mergedMax,n.groupCentroidPos=o}}this.buildingGroups.clear()}sortBorders(){for(let i=0;i<this.borderFeatureIndices.length;i++)this.borderFeatureIndices[i].sort((r,n)=>this.featuresOnBorder[r].borders[i][0]-this.featuresOnBorder[n].borders[i][0])}splitToSubtiles(){let i=[];for(let r=0;r<this.centroidData.length;r++){let n=this.centroidData.get(r),a=+(n.min.y+n.max.y>8192),o=2*a+(n.min.x+n.max.x>8192^a);for(let a=0;a<n.polygonSegLen;a++){let s=n.polygonSegIdx+a;i.push({centroidIdx:r,subtile:o,polygonSegmentIdx:s,triangleSegmentIdx:this.polygonSegments[s].triangleSegIdx})}}let r=new sw;i.sort((i,r)=>i.triangleSegmentIdx===r.triangleSegmentIdx?i.subtile-r.subtile:i.triangleSegmentIdx-r.triangleSegmentIdx);let n=0,a=0,o=0;for(let r of i){if(r.triangleSegmentIdx!==n)break;o++}let s=i.length;for(;a!==i.length;){n=i[a].triangleSegmentIdx;let l=0,u=a,c=a;for(let r=u;r<o&&i[r].subtile===l;r++)c++;for(;u!==o;){let a=i[u];l=a.subtile;let s=this.centroidData.get(a.centroidIdx).min.clone(),d=this.centroidData.get(a.centroidIdx).max.clone(),h={vertexOffset:this.segments.segments[n].vertexOffset,primitiveOffset:r.length,vertexLength:this.segments.segments[n].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let n=u;n<c;n++){let a=i[n],o=this.polygonSegments[a.polygonSegmentIdx],l=this.centroidData.get(a.centroidIdx).min,u=this.centroidData.get(a.centroidIdx).max,c=this.indexArray.uint16;for(let i=o.triangleArrayOffset;i<o.triangleArrayOffset+o.triangleCount;i++)r.emplaceBack(c[3*i],c[3*i+1],c[3*i+2]);h.primitiveLength+=o.triangleCount,s.x=Math.min(s.x,l.x),s.y=Math.min(s.y,l.y),d.x=Math.max(d.x,u.x),d.y=Math.max(d.y,u.y)}h.primitiveLength>0&&this.triangleSubSegments.push({segment:h,min:s,max:d}),u=c;for(let r=u;r<o&&i[r].subtile===i[u].subtile;r++)c++}a=o;for(let r=a;r<s&&i[r].triangleSegmentIdx===i[a].triangleSegmentIdx;r++)o++}r._trim(),this.indexArray=r}getVisibleSegments(i,r,n){let a,o=new s1;if(this.wallMode){for(let i of this.triangleSubSegments)o.segments.push(i.segment);return o}let s=0,l=0,u=1<<i.canonical.z;if(r){let n=r.getMinMaxForTile(i);n&&(s=n.min,l=n.max)}l+=this.maxHeight;
8let c=i.toUnwrapped(),d=[c.canonical.x/u+c.wrap,c.canonical.y/u],h=[(c.canonical.x+1)/u+c.wrap,(c.canonical.y+1)/u],f=(i,r,n)=>[iw(i[0],r[0],n[0]),iw(i[1],r[1],n[1])],p=[],m=[];for(let i of this.triangleSubSegments){p[0]=i.min.x/8192,p[1]=i.min.y/8192,m[0]=i.max.x/8192,m[1]=i.max.y/8192;let r=f(d,h,p),u=f(d,h,m);if(0===new c4([r[0],r[1],s],[u[0],u[1],l]).intersectsPrecise(n)){a&&(o.segments.push(a),a=void 0);continue}let c=i.segment;a&&a.vertexOffset!==c.vertexOffset&&(o.segments.push(a),a=void 0),a?(a.vertexLength+=c.vertexLength,a.primitiveLength+=c.primitiveLength):a={vertexOffset:c.vertexOffset,primitiveLength:c.primitiveLength,vertexLength:c.vertexLength,primitiveOffset:c.primitiveOffset,sortKey:void 0,vaos:{}}}return a&&o.segments.push(a),o}encodeCentroid(i,r){let n=i.centroid(),a=r.span(),o=Math.min(7,Math.round(a.x*this.tileToMeter/10)),s=Math.min(6,Math.round(a.y*this.tileToMeter/10));return new eQ(ts(n.x,1,8191)<<3|o,ts(n.y,1,8191)<<3|s)}encodeBorderCentroid(i){if(!i.borders)return new eQ(0,0);let r=i.borders,n=Number.MAX_VALUE;if(r[0][0]!==n||r[1][0]!==n){let i=+(r[0][0]===n);return new eQ(6|65528*(r[0][0]===n),(r[i][0]+r[i][1])/2<<3|6)}{let i=r[2][0]!==n?2:3;return new eQ((r[i][0]+r[i][1])/2<<3|6,6|65528*(r[2][0]===n))}}showCentroid(i){let r=this.centroidData.get(i.centroidDataIndex);if(r.flags&=0x80000000,0!==r.groupCentroidPos.x||0!==r.groupCentroidPos.y){let i=r.span(),n=Math.min(7,Math.round(i.x*this.tileToMeter/10)),a=Math.min(6,Math.round(i.y*this.tileToMeter/10));r.centroidXY=new eQ(ts(r.groupCentroidPos.x,1,8191)<<3|n,ts(r.groupCentroidPos.y,1,8191)<<3|a)}else r.centroidXY=new eQ(0,0);this.writeCentroidToBuffer(r)}writeCentroidToBuffer(i){this.groundEffect.updateHiddenByLandmark(i);let r=i.vertexArrayOffset,n=i.vertexCount+i.vertexArrayOffset,a=-0x40000000&i.flags?pc:i.centroidXY,o=this.centroidVertexArray.geta_centroid_pos0(r);if(this.centroidVertexArray.geta_centroid_pos1(r)!==a.y||o!==a.x){for(let i=r;i<n;++i)this.centroidVertexArray.emplace(i,a.x,a.y);this.needsCentroidUpdate=!0}}createCentroidsBuffer(){for(let i of(this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length),this.centroidData))this.writeCentroidToBuffer(i)}updateReplacement(i,r,n){if(r.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=r.updateTime;let a=r.getReplacementRegionsForTile(i.toUnwrapped());if(dQ(this.activeReplacements,a))return;if(this.activeReplacements=a,0===this.centroidVertexArray.length)this.createCentroidsBuffer();else for(let i of this.centroidData)i.flags&=0x3fffffff;let o=[];for(let r of this.activeReplacements){if(r.order<n)continue;let a=Math.max(1,Math.pow(2,r.footprintTileId.canonical.z-i.canonical.z));if(r.footprint.buildingIds)for(let i of this.centroidData)0x80000000&i.flags||0x40000000&i.flags||r.min.x>i.max.x||i.min.x>r.max.x||r.min.y>i.max.y||i.min.y>r.max.y||r.footprint.buildingIds.has(i.buildingId)&&(i.flags|=r.clipMask!==pn.None?-0x40000000:0x80000000);else for(let n of this.centroidData)if(!(0x80000000&n.flags||0x40000000&n.flags||r.min.x>n.max.x||n.min.x>r.max.x||r.min.y>n.max.y||n.min.y>r.max.y))for(let s=0;s<n.footprintSegLen;s++){let l=this.footprintSegments.get(n.footprintSegIdx+s);if(o.length=0,function(i,r,n,a,o,s){let l=Math.pow(2,a.z-o.z);for(let u=0;u<n;u++){let n=i.int16[2*(u+r)+0],c=i.int16[2*(u+r)+1];n=(n+8192*o.x)*l-8192*a.x,c=(c+8192*o.y)*l-8192*a.y,s.push(new eQ(n,c))}}(this.footprintVertices,l.vertexOffset,l.vertexCount,r.footprintTileId.canonical,i.canonical,o),d1(r.footprint,o,this.footprintIndices.uint16,l.indexOffset,l.indexCount,-l.vertexOffset,-a)){n.flags|=r.clipMask!==pn.None?-0x40000000:0x80000000;break}}}for(let i of this.centroidData)this.writeCentroidToBuffer(i);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(i,r,n){let a=!1;for(let o=0;o<n.footprintSegLen;o++){let s=this.footprintSegments.get(n.footprintSegIdx+o),l=0;for(let n of s.ringIndices){for(let o=l,u=n+l-1;o<n+l;u=o++){let n=this.footprintVertices.int16[2*(o+s.vertexOffset)+0],l=this.footprintVertices.int16[2*(o+s.vertexOffset)+1],c=this.footprintVertices.int16[2*(u+s.vertexOffset)+1];l>r!=c>r&&i<(this.footprintVertices.int16[2*(u+s.vertexOffset)+0]-n)*(r-l)/(c-l)+n&&(a=!a)}l=n}}return a}
8getHeightAtTileCoord(i,r){let n=-1/0,a=!0,o=4*(i+8192)*8192+(r+8192);if(Object.hasOwn(this.partLookup,o)){let i=this.partLookup[o];return i?{height:i.height,hidden:!!(0x80000000&i.flags)}:void 0}let s=this.centroidData.buffer,l=this.centroidData.length;for(let u=0;u<l;u++){let l=15*u;if(i>s[l+4]||s[l+2]>i||r>s[l+5]||s[l+3]>r)continue;let c=s[l+13];if(c<=n)continue;let d=this.centroidData.get(u);this.footprintContainsPoint(i,r,d)&&(n=c,this.partLookup[o]=d,a=!!(0x80000000&d.flags))}if(n!==-1/0)return{height:n,hidden:a};this.partLookup[o]=void 0}}function pE(i,r){let n=i.add(r)._unit();return i.x*n.x+i.y*n.y}function pS(i,r,n,a,o){let s=Math.sqrt(1-a*a);return Math.min(i.dist(r)/3,r.dist(n)/3,o*s/a)}function pA(i,r,n){return i.x<n[0].x&&r.x<n[0].x||i.x>n[1].x&&r.x>n[1].x||i.y<n[0].y&&r.y<n[0].y||i.y>n[1].y&&r.y>n[1].y}function pC(i,r){return i.x<r[0].x||i.x>r[1].x||i.y<r[0].y||i.y>r[1].y}function pI(i,r,n){if(i.x<0||i.x>=8192||r.x<0||r.x>=8192||n.x<0||n.x>=8192)return!1;let a=n.sub(r),o=a.perp(),s=i.sub(r);return(a.x*s.x+a.y*s.y)/Math.sqrt((a.x*a.x+a.y*a.y)*(s.x*s.x+s.y*s.y))>-.866&&o.x*s.x+o.y*s.y<0}function pk(i,r,n){let a=r?2|i:-3&i;return n?1|a:-2&a}function pR(){let i=Math.tan(Math.PI/32);return 6371008.8*Math.sqrt(1+2*i*i)-6371008.8}function pM(i,r,n){let a=1<<n.z,o=rp(n.x/a);return function(i,r,n,a,o=0,s){let l=[];if(!i.length||!n||!a)return l;let u=(i,r)=>{for(let n of i)l.push({polygon:n,bounds:r})},c=Math.ceil(Math.log2(n)),d=Math.ceil(Math.log2(a)),h=c-d,f=[];for(let i=0;i<Math.abs(h);i++)f.push(h>0?0:1);for(let i=0;i<Math.min(c,d);i++)f.push(0),f.push(1);let p=i;if(p=pr(p,r[0].y-o,r[1].y+o,1),!(p=pr(p,r[0].x-o,r[1].x+o,0)).length)return l;let m=[];for(f.length?m.push({polygons:p,bounds:r,depth:0}):u(p,r);m.length;){let i=m.pop(),r=i.depth,n=f[r],a=i.bounds[0],l=i.bounds[1],c=0===n?a.x:a.y,d=0===n?l.x:l.y,h=s(n,c,d),p=pr(i.polygons,c-o,h+o,n),g=pr(i.polygons,h-o,d+o,n);if(p.length){let i=[a,new eQ(0===n?h:l.x,1===n?h:l.y)];f.length>r+1?m.push({polygons:p,bounds:i,depth:r+1}):u(p,i)}if(g.length){let i=[new eQ(0===n?h:a.x,1===n?h:a.y),l];f.length>r+1?m.push({polygons:g,bounds:i,depth:r+1}):u(g,i)}}return l}(i,r,Math.ceil((rp((n.x+1)/a)-o)/11.25),Math.ceil((rm(n.y/a)-rm((n.y+1)/a))/11.25),1,(i,r,o)=>{if(0===i)return .5*(r+o);{let i=rm((n.y+r/8192)/a);return(rf(.5*(rm((n.y+o/8192)/a)+i))*a-n.y)*8192}})}ar(pT,"FillExtrusionBucket",{omit:["layers","features"]}),ar(p_,"PartData"),ar(py,"PartDataArray"),ar(pg,"FootprintSegmentArray"),ar(pv,"BorderCentroidData"),ar(pw,"GroundEffect");class pL{constructor(i){this.module=i,this.memoryStack=this.module.malloc(4096),this.memoryStackNextFree=this.memoryStack}createIntArray(i){let r=this.memoryStackNextFree;return this.memoryStackNextFree+=i.length*Int32Array.BYTES_PER_ELEMENT,this.memoryStackNextFree-this.memoryStack>4096?-1:(new Int32Array(this.module.heap32.buffer,r,i.length).set(i),r)}createFloatArray(i){let r=this.memoryStackNextFree;return this.memoryStackNextFree+=i.length*Float32Array.BYTES_PER_ELEMENT,this.memoryStackNextFree-this.memoryStack>4096?-1:(new Float32Array(this.module.heapF32.buffer,r,i.length).set(i),r)}readStringBuffer(i){let r="";for(;0!==this.module.heapU8[i];)r+=String.fromCharCode(this.module.heapU8[i]),++i;return r}setStyle(i){let r=i.normalScale;this.module.setStyle(r[0],r[1],r[2],i.tileToMeters)}setAOOptions(i,r){this.module.setAOOptions(+!!i,r)}setMetricOptions(i,r){this.module.setMetricOptions(+!!i,r)}setStructuralOptions(i){this.module.setStructuralOptions(+!!i)}setFacadeOptions(i,r){this.module.setFacadeOptions(i,+!!r)}setFauxFacadeOptions(i,r,n){this.module.setFauxFacadeOptions(+!!i,+!!r,n)}setFacadeClassifierOptions(i){this.module.setFacadeClassifierOptions(i)}generateMesh(i,r){for(let r of(this.memoryStackNextFree=this.memoryStack,i)){let i=this.createIntArray(r.ringIndices),n=this.createFloatArray(r.coordinates);if(-1===i||-1===n)return`building_gen: Out of stack memory: ${this.memoryStackNextFree-this.memoryStack}/4096`;this.module.addFeature(r.id,r.sourceId,r.minHeight,r.height,r.roofType,n,i,r.ringIndices.length-1)}for(let i of r){let r;r=i.entrances?JSON.parse(i.entrances):[];let n=this.createFloatArray(r),a=this.createFloatArray(i.coordinates);if(-1===n||-1===a)return`building_gen: Out of stack memory: ${this.memoryStackNextFree-this.memoryStack}/4096`;this.module.addFacade(i.sourceId,i.crossPerc,i.distanceToRoad,n,r.length,a,i.coordinates.length)}if(!this.module.generateMesh()){let i=this.module.getLastError();return this.readStringBuffer(i)}
8let n=this.module.getMeshCount(),a=Array(n);for(let i=0;i<n;i++){let r=this.module.getPositionsPtr(i),n=this.module.getPositionsLength(i),o=new Float32Array(this.module.heapF32.buffer,r,n),s=this.module.getNormalsPtr(i),l=this.module.getNormalsLength(i),u=new Float32Array(this.module.heapF32.buffer,s,l),c=this.module.getAOPtr(i),d=this.module.getAOLength(i),h=new Float32Array(this.module.heapF32.buffer,c,d),f=this.module.getUVPtr(i),p=this.module.getUVLength(i),m=new Float32Array(this.module.heapF32.buffer,f,p),g=this.module.getFauxFacadePtr(i),_=this.module.getFauxFacadeLength(i),y=new Uint8Array(this.module.heapU8.buffer,g,_),v=this.module.getIndicesPtr(i),x=this.module.getIndicesLength(i),b=new Int16Array(this.module.heap16.buffer,v,x),w=this.module.getBuildingPart(i);a[i]={positions:o,normals:u,ao:h,uv:m,isFauxFacade:y,indices:b,buildingPart:w}}let o=this.module.getRingCount(),s=[];for(let i=0;i<o;i++){let r=this.module.getRingPtr(i),n=this.module.getRingLength(i),a=new Float32Array(this.module.heapF32.buffer,r,n);s.push(a)}return{meshes:a,outerRingLength:this.module.getOuterRingLength(),modifiedPolygonRings:s}}}let pP=lR.types,pO,pD,pF=null,pN=null,pj=null;class pz{constructor(){this.layoutVertexArray=new su,this.layoutAttenuationArray=new sm,this.layoutColorArray=new s_,this.indexArray=new sw,this.indexArrayForConflation=new sw,this.segmentsBucket=new s1}}class pB{constructor(i){this.layoutFacadePaintArray=null,this.layoutFacadeDataArray=null,this.layoutFacadeVerticalRangeArray=null,this.segmentsBucket=new s1,this.entranceBloom=new pz,this.layoutVertexArray=new su,this.layoutVertexArray.reserve(66560),this.layoutNormalArray=new st,this.layoutNormalArray.reserve(66560),this.layoutCentroidArray=new st,this.layoutCentroidArray.reserve(66560),this.layoutColorArray=new s_,this.layoutColorArray.reserve(66560),this.layoutFloodLightDataArray=new sD,this.layoutFloodLightDataArray.reserve(66560),this.layoutAOArray=new sF,this.layoutAOArray.reserve(66560),this.indexArray=new sw,this.indexArray.reserve(66560),this.indexArrayForConflation=new sw,this.segmentsBucket=new s1,this.entranceBloom=new pz,i&&(this.layoutFacadePaintArray=new s_,this.layoutFacadeDataArray=new sd,this.layoutFacadeVerticalRangeArray=new s_)}reserve(i,r,n){this.layoutVertexArray.reserveForAdditional(i),this.layoutCentroidArray.reserveForAdditional(i),this.layoutFloodLightDataArray.reserveForAdditional(i),this.layoutNormalArray.reserveForAdditional(i),this.layoutAOArray.reserveForAdditional(i),this.layoutColorArray.reserveForAdditional(i),this.indexArray.reserveForAdditional(r),n&&(this.layoutFacadePaintArray.reserveForAdditional(i),this.layoutFacadeDataArray.reserveForAdditional(i),this.layoutFacadeVerticalRangeArray.reserveForAdditional(i))}}class pU{constructor(i){this.requiresHDRuntime=!0,this.colorBufferUploaded=!1,this.maxHeight=0,this.replacementUpdateTime=0,this.activeReplacements=[],this.footprints=[],this.footprintsVertices=new sR,this.footprintsIndices=new sL,this.footprintsMin=new eQ(1/0,1/0),this.footprintsMax=new eQ(-1/0,-1/0),this.featuresOnBorder=[],this.buildingWithoutFacade=new pB(!1),this.buildingWithFacade=new pB(!0),this.indexArrayForConflationUploaded=!1,this.featureFootprintLookup=new Map,this.buildingIds=new Set,this.footprintLookup={},this.zoom=i.zoom,this.canonical=i.canonical,this.layers=i.layers,this.layerIds=this.layers.map(i=>i.fqid),this.index=i.index,this.hasPattern=!1,this.worldview=i.worldview,this.lut=i.lut,this.programConfigurations=new lg(i.layers,{zoom:i.zoom,lut:i.lut}),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=i.projection,this.groundEffect=new pw(i),this.groundEffect.groundRadiusArray=new sr,this.hasAppearances=null}updateFootprints(i,r){let n=new fd([],[],1),a={vertices:[],indices:new Uint32Array(0),grid:n,min:this.footprintsMin,max:this.footprintsMax,buildingIds:this.buildingIds};r.push({footprint:a,id:i})}updateAppearances(i,r,n,a){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(i,r,n,a){if(!pj)return;let o=oQ(n);this.tileToMeter=o,this.brightness=r.brightness,pj.setStyle({normalScale:[1,-1,o],tileToMeters:o}),pj.setAOOptions(!1,.3),pj.setMetricOptions(!1,16),pj.setStructuralOptions(!0),pj.setFacadeClassifierOptions(3);let s=new Map,l=new Map,u=0;for(let{feature:r}of i){if("LineString"!==pP[r.type]){s.set(r.id,r.properties.source_id);continue}let i=this.layers[0]._featureFilter.needGeometry;if(i&&!this.layers[0]._featureFilter.filter(new aZ(this.zoom),r,n))continue;let o=o5(r,i);if(!i&&!this.layers[0]._featureFilter.filter(new aZ(this.zoom),o,n))continue;
8let c=i?o.geometry:o2(r,n,a),d=[];for(let i of c)for(let r of i)d.push(r.x),d.push(r.y);let h={coordinates:d,crossPerc:r.properties.cross_perc,distanceToRoad:r.properties.distance_to_road,entrances:r.properties.entrances,sourceId:0},f=r.properties.source_id,p=l.get(f);p||(p=[],l.set(f,p)),p.push(h),++u}this.maxHeight=0;let c=[],d=new Set,h=i=>{null!=i&&d.add(i)},f=(i,r)=>{null!=i&&c.push({buildingId:i,footprintIndex:r})},p=64*(i.length-u),m=p/2;for(let{feature:c,id:g,index:_,sourceLayerIndex:y}of(this.buildingWithFacade.reserve(p,m,!0),this.buildingWithoutFacade.reserve(2*p,2*m,!1),this.footprintsIndices.reserve(16*(i.length-u)),this.footprintsVertices.reserve(8*(i.length-u)),i)){if("LineString"===pP[c.type])continue;let i=this.layers[0]._featureFilter.needGeometry;if(i&&!this.layers[0]._featureFilter.filter(new aZ(this.zoom),c,n))continue;let u=null;if(c.properties&&Object.hasOwn(c.properties,"building_id")&&(u=Number(c.properties.building_id),d.has(u)))continue;let p=o5(c,i);if(!i&&!this.layers[0]._featureFilter.filter(new aZ(this.zoom),p,n))continue;let m=i?p.geometry:o2(c,n,a),v=e2(m,500),x=!1;for(let i of v)if(1!==i.length){x=!0;break}if(x||!function(i){for(let r of i)for(let i of r)if(i.x<-163||i.x>8355||i.y<-163||i.y>8355)return!1;return!0}(m)){h(u);continue}let b=this.layers[0],w=function(i){switch(i){case"flat":return 3;case"hipped":return 1;case"gabled":return 2;case"parapet":return 0;case"mansard":return 4;case"skillion":return 5;case"pyramidal":return 6;default:throw Error(`Unknown roof shape: ${i}`)}}(b.layout.get("building-roof-shape").evaluate(c,{},n)),T=b.layout.get("building-base").evaluate(c,{},n),E=b.layout.get("building-height").evaluate(c,{},n),S=b.layout.get("building-flood-light-ground-radius").evaluate(c,{},n),A=b.paint.get("building-ambient-occlusion-intensity"),C=S/this.tileToMeter;c.properties["building-part"]="roof";let I=b.paint.get("building-color").evaluate(c,{},this.canonical).toPremultipliedRenderColor(this.lut),k=b.paint.get("building-emissive-strength").evaluate(c,{},this.canonical);c.properties["building-part"]="wall";let R=b.paint.get("building-color").evaluate(c,{},this.canonical).toPremultipliedRenderColor(this.lut),M=b.paint.get("building-emissive-strength").evaluate(c,{},this.canonical);c.properties["building-part"]="window";let L=b.paint.get("building-color").evaluate(c,{},this.canonical).toPremultipliedRenderColor(this.lut),P=b.paint.get("building-emissive-strength").evaluate(c,{},this.canonical);c.properties["building-part"]="door";let O=b.paint.get("building-color").evaluate(c,{},this.canonical).toPremultipliedRenderColor(this.lut),D=b.paint.get("building-emissive-strength").evaluate(c,{},this.canonical),F=b.layout.get("building-flood-light-wall-radius").evaluate(c,{},n),N=(F=ts(F,0,2048))/2048*32767,j=s.get(g),z=l.get(j)||[],B=0!==z.length&&b.layout.get("building-facade").evaluate(c,{},n);pj.setFacadeOptions(4,!0),pj.setFauxFacadeOptions(B,!1,1);let U=0,V=0,H=0,G=0,q=0,$=0,W=0,Y=0,Z=0,K=0,X=0;if(B){let i=Math.round(b.layout.get("building-facade-floors").evaluate(c,{},n));if(0===T){i=Math.max(1,i-(z.length>0));let r=4;if(E>100){let i=[10,13,15];r=i[c.id?c.id%i.length:0]}else E<=10&&(r=3);pj.setFacadeOptions(r,!0),q=(E<15?1.3:1.61803)*r/o}else q=T/o;q=Math.min(q,$=E/o),H=b.layout.get("building-facade-unit-width").evaluate(c,{},n)/o,G=($-q)/i,pj.setFauxFacadeOptions(!0,!0,H);let r=b.layout.get("building-facade-window").evaluate(c,{},n);U=r[0],V=r[1],W=Math.floor(65535*Math.min(1,q/8192)),Y=Math.floor(65535*Math.min(1,$/8192)),Z=Math.floor(255*U)<<8|Math.floor(255*V),K=Math.floor(65535*Math.min(1,H/8192)),X=Math.floor(65535*Math.min(1,G/8192))}let Q=Array(v.length),J={x:1/0,y:1/0},ee={x:-1/0,y:-1/0},et={x:0,y:0},ei=0;for(let i=0;i<v.length;i++){let r=v[i];if(r.length>0){let n=[],a=Array(r.length+1);a[0]=0;for(let i=0;i<r.length;i++){let o=r[i];for(let i=0;i<o.length;i++){let r=o[o.length-i-1];J.x=Math.min(J.x,r.x),J.y=Math.min(J.y,r.y),ee.x=Math.max(ee.x,r.x),ee.y=Math.max(ee.y,r.y),et.x+=r.x,et.y+=r.y,ei++,n.push(r.x),n.push(r.y)}a[i+1]=n.length}Q[i]={id:c.id?c.id:0,height:E,minHeight:T,sourceId:0,roofType:w,coordinates:n,ringIndices:a}}}et.x/=ei||1,et.y/=ei||1;let er=pj.generateMesh(Q,z);if("string"==typeof er){tb(`Unable to generate building ${c.id}: ${er}`),h(u);continue}if(0===er.meshes.length||0===er.modifiedPolygonRings.length){h(u);continue}let en=B?this.buildingWithFacade:this.buildingWithoutFacade,ea=0;for(let i of er.meshes)ea+=i.positions.length/3;let eo=en.segmentsBucket.prepareSegment(ea,en.layoutVertexArray,en.indexArray),es=[],el=null,eu=0,ec=-1,ed=en.layoutVertexArray.length,eh=ed+ea;en.layoutVertexArray.resize(eh),en.layoutCentroidArray.resize(eh),en.layoutNormalArray.resize(eh),en.layoutAOArray.resize(eh),en.layoutColorArray.resize(eh),en.layoutFloodLightDataArray.resize(eh),B&&(en.layoutFacadePaintArray.resize(eh),en.layoutFacadeDataArray.resize(eh),en.layoutFacadeVerticalRangeArray.resize(eh));let ef=en.indexArray.length,ep=0,em=ed;for(let i of er.meshes){let r,n;if(1===i.buildingPart)r=I,n=k;else if(0===i.buildingPart)r=R,n=M;else if(2===i.buildingPart)r=L,n=P;else{if(3!==i.buildingPart)continue;r=O,n=D}if(n=ts(n,0,1),3===i.buildingPart){let r=[];for(let n=0;n<i.positions.length;n+=12){let a=i.positions[n+0],o=i.positions[n+1],s=i.positions[n+3],l=i.positions[n+4],u=i.positions[n+2],c=i.positions[n+8]-u,d=s-a,h=l-o,f=Math.hypot(d,h);r.push({pos:[a+.5*d,o+.5*h,u],normal:[h/f,-d/f,0],width:f,height:c,depth:1,points:[a,o,s,l]})}let n=en.entranceBloom.segmentsBucket.prepareSegment(10*r.length,en.entranceBloom.layoutVertexArray,en.entranceBloom.indexArray),a=en.entranceBloom.layoutVertexArray.length;eu=en.entranceBloom.indexArray.length,fZ(r,.5/this.tileToMeter,en.entranceBloom.indexArray,en.entranceBloom.layoutVertexArray,en.entranceBloom.layoutAttenuationArray);let o=en.entranceBloom.layoutVertexArray.length-a;ec=en.entranceBloom.indexArray.length-eu;for(let i=0;i<o;i++)en.entranceBloom.layoutColorArray.emplaceBack(255*O.r<<8|255*O.g,255*O.b<<8|51*D);n.vertexLength+=o,n.primitiveLength+=ec,el={part:i.buildingPart,vertexOffset:a,vertexLength:o}}en.layoutVertexArray.float32.set(i.positions,3*em);let a=i.positions.length/3;for(let o=0;o<a;++o){let a=3*o;ep=Math.max(ep,i.positions[a+2]);let s=32767*i.normals[a+1],l=32767*i.normals[a+2],u=3*(em+o);en.layoutNormalArray.int16[u]=32767*i.normals[a],en.layoutNormalArray.int16[u+1]=s,en.layoutNormalArray.int16[u+2]=l;let c=i.ao[o];en.layoutAOArray.uint8[em+o]=255*c;let d=1+(c-1)*A,h=255*r.b*d<<8|255*n;en.layoutColorArray.uint16[2*(em+o)]=255*r.r*d<<8|255*r.g*d,en.layoutColorArray.uint16[2*(em+o)+1]=h}let o=Math.min(8191,Math.max(0,Math.floor(et.x))),s=Math.min(8191,Math.max(0,Math.floor(et.y))),l=Math.floor(E),u=4*o+Math.min(3,Math.round((ee.x-J.x)*this.tileToMeter/20)),c=4*s+Math.min(3,Math.round((ee.y-J.y)*this.tileToMeter/20));for(let i=0;i<a;++i){let r=3*(em+i);en.layoutCentroidArray.int16[r]=u,en.layoutCentroidArray.int16[r+1]=c,en.layoutCentroidArray.int16[r+2]=l}if(en.layoutFloodLightDataArray.int16.fill(0===i.buildingPart?N:0,em,em+a),B){let r=255*L.r<<8|255*L.g,n=255*L.b<<8|255*P;for(let i=0;i<a;++i){let a=2*(em+i);en.layoutFacadePaintArray.uint16[a]=r,en.layoutFacadePaintArray.uint16[a+1]=n}for(let r=0;r<a;++r)if(i.isFauxFacade[r]){let n=Math.min(65535,Math.floor(i.uv[2*r]*er.outerRingLength));en.layoutFacadeDataArray.emplace(em+r,1|n,Z,K,X),en.layoutFacadeVerticalRangeArray.emplace(em+r,W,Y)}else en.layoutFacadeDataArray.emplace(em+r,0,0,0,0),en.layoutFacadeVerticalRangeArray.emplace(em+r,0,0)}let d=eo.vertexLength,h=i.indices.length/3,f=en.indexArray.length;en.indexArray.resize(f+h);for(let r=0;r<h;++r){let n=3*r,a=3*f+n;en.indexArray.uint16[a]=d+i.indices[n],en.indexArray.uint16[a+1]=d+i.indices[n+1],en.indexArray.uint16[a+2]=d+i.indices[n+2]}1!==i.buildingPart&&0!==i.buildingPart&&2!==i.buildingPart&&3!==i.buildingPart||es.push({part:i.buildingPart,vertexOffset:em,vertexLength:i.positions.length/3}),em+=a,eo.vertexLength+=a,eo.primitiveLength+=i.indices.length/3}this.maxHeight=Math.max(this.maxHeight,ep);let eg=en.indexArray.length-ef,e_=this.footprintsIndices.length,ey=this.footprintsVertices.length,ev=[],ex=new eQ(1/0,1/0),eb=new eQ(-1/0,-1/0),ew=this.groundEffect.vertexArray.length;for(let i of er.modifiedPolygonRings){let r=[],n=new eQ(1/0,1/0),a=new eQ(-1/0,-1/0);for(let o=0;o<i.length;o+=2){let s=i.length-o-2;n.x=Math.min(n.x,i[s]),n.y=Math.min(n.y,i[s+1]),a.x=Math.max(a.x,i[s]),a.y=Math.max(a.y,i[s+1]);let l=new eQ(i[s],i[s+1]);r.push(l),ev.push(l.x,l.y),this.footprintsVertices.emplaceBack(l.x,l.y)}ex.x=Math.min(ex.x,n.x),ex.y=Math.min(ex.y,n.y),eb.x=Math.max(eb.x,a.x),eb.y=Math.max(eb.y,a.y),this.groundEffect.addData(r,[n,a],C)}let eT=this.groundEffect.vertexArray.length-ew;this.groundEffect.groundRadiusArray.reserveForAdditional(eT);for(let i=0;i<eT;i++)this.groundEffect.groundRadiusArray.emplaceBack(S);(J.x<0||ee.x>8192||J.y<0||ee.y>8192)&&this.featuresOnBorder.push({featureId:c.id,footprintIndex:this.footprints.length});{let i=ov(ev,null,2);this.footprintsIndices.resize(this.footprintsIndices.length+i.length),this.footprintsIndices.uint16.set(i,e_),this.buildingIds.add(null!=u?u:c.id),this.footprintsMin.x=Math.min(this.footprintsMin.x,ex.x),this.footprintsMin.y=Math.min(this.footprintsMin.y,ex.y),this.footprintsMax.x=Math.max(this.footprintsMax.x,eb.x),this.footprintsMax.y=Math.max(this.footprintsMax.y,eb.y);let r={footprintVertexOffset:ey,footprintVertexLength:this.footprintsVertices.length-ey,footprintIndexOffset:e_,footprintIndexLength:this.footprintsIndices.length-e_,min:ex,max:eb,hiddenFlags:0,indicesOffset:ef,indicesLength:eg,bloomIndicesOffset:eu,bloomIndicesLength:ec,groundEffectVertexOffset:ew,groundEffectVertexLength:eT,hasFauxFacade:B,height:ep,promoteId:g,feature:p,parts:es,buildingBloom:el},n=this.footprints.length;void 0!==c.id&&this.featureFootprintLookup.set(c.id,n),f(u,n),this.footprints.push(r)}this.programConfigurations.populatePaintArrays(en.layoutVertexArray.length,c,_,{},r.availableImages,n,r.brightness),this.groundEffect.addPaintPropertiesData(c,_,{},r.availableImages,n,r.brightness),r.featureIndex.insert(c,m,_,y,this.index,ed)}c.forEach(({buildingId:i,footprintIndex:r})=>{d.has(i)&&(this.footprints[r].hiddenFlags|=4)});let g=new Set;this.buildingIds.forEach((i,r,n)=>{d.has(i)||g.add(i)}),this.buildingIds=g,this.groundEffect.prepareBorderSegments()}update(i,r,n,a,o,s,l){this.programConfigurations.updatePaintArrays(i,r,o,n,a,s,l),this.groundEffect.update(i,r,o,n,a,s,l),this.evaluate(this.layers[0],i),this.colorBufferUploaded=!1}updateExpressions(i){this.programConfigurations.updateExpressions(i),this.groundEffect.programConfigurations.updateExpressions(i)}isEmpty(){return 0===this.buildingWithoutFacade.layoutVertexArray.length&&0===this.buildingWithFacade.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(i){let r=r=>{r.layoutVertexBuffer=i.createVertexBuffer(r.layoutVertexArray,fK.members),r.layoutNormalBuffer=i.createVertexBuffer(r.layoutNormalArray,fX.members),r.layoutCentroidBuffer=i.createVertexBuffer(r.layoutCentroidArray,fQ.members),r.layoutFloodLightDataBuffer=i.createVertexBuffer(r.layoutFloodLightDataArray,f4.members),r.layoutFacadeDataArray&&r.layoutFacadeDataArray.length&&(r.layoutFacadeDataBuffer=i.createVertexBuffer(r.layoutFacadeDataArray,f0.members)),r.layoutFacadeVerticalRangeArray&&r.layoutFacadeVerticalRangeArray.length&&(r.layoutFacadeVerticalRangeBuffer=i.createVertexBuffer(r.layoutFacadeVerticalRangeArray,f2.members)),r.entranceBloom.layoutVertexArray.length&&(r.entranceBloom.layoutVertexBuffer=i.createVertexBuffer(r.entranceBloom.layoutVertexArray,fK.members),r.entranceBloom.layoutAttenuationBuffer=i.createVertexBuffer(r.entranceBloom.layoutAttenuationArray,f5.members)),this.uploadUpdatedColorBuffer(i),this.uploadUpdatedIndexBuffer(i)};this.uploaded||(r(this.buildingWithoutFacade),r(this.buildingWithFacade),this.groundEffect.upload(i)),this.groundEffect.uploadPaintProperties(i),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){let i=i=>{i.layoutVertexBuffer&&(i.layoutVertexBuffer.destroy(),i.layoutNormalBuffer.destroy(),i.layoutColorBuffer.destroy(),i.segmentsBucket.destroy(),i.indexBuffer&&i.indexBuffer.destroy(),i.entranceBloom.layoutVertexBuffer&&(i.entranceBloom.layoutVertexBuffer.destroy(),i.entranceBloom.layoutColorBuffer.destroy(),i.entranceBloom.layoutAttenuationBuffer.destroy(),i.entranceBloom.indexBuffer.destroy(),i.entranceBloom.segmentsBucket.destroy()))};i(this.buildingWithoutFacade),i(this.buildingWithFacade),this.groundEffect.destroy(),this.programConfigurations.destroy()}updateFootprintHiddenFlags(i,r,n=!0){let a=!1,o=n?r:0,s=0|(n?-1:~r);for(let r of(0===this.groundEffect.hiddenByLandmarkVertexArray.length&&this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length),i)){let i=this.footprints[r],n=i.hiddenFlags&s|o;i.hiddenFlags!==n&&(i.hiddenFlags=n,a=!0,this.groundEffect.updateHiddenByLandmarkRange(i.groundEffectVertexOffset,i.groundEffectVertexLength,0!==i.hiddenFlags))}return a&&(this.indexArrayForConflationUploaded=!1),a}uploadUpdatedIndexBuffer(i){if(this.groundEffect.uploadHiddenByLandmark(i),this.indexArrayForConflationUploaded)return;let r=i=>{0!==i.indexArray.length&&(i.indexArrayForConflation.resize(i.indexArray.length),i.indexArrayForConflation.uint16.set(i.indexArray.uint16),i.entranceBloom.indexArrayForConflation.resize(i.entranceBloom.indexArray.length),i.entranceBloom.indexArrayForConflation.uint16.set(i.entranceBloom.indexArray.uint16))};for(let i of(r(this.buildingWithoutFacade),r(this.buildingWithFacade),this.footprints)){let r=i.hasFauxFacade?this.buildingWithFacade:this.buildingWithoutFacade,n=i.indicesOffset+i.indicesLength;if(0!==i.hiddenFlags){for(let a=i.indicesOffset;a<n;a++)r.indexArrayForConflation.uint16[3*a+0]=0,r.indexArrayForConflation.uint16[3*a+1]=0,r.indexArrayForConflation.uint16[3*a+2]=0;let a=i.bloomIndicesOffset+i.bloomIndicesLength;for(let n=i.bloomIndicesOffset;n<a;n++)r.entranceBloom.indexArrayForConflation.uint16[3*n+0]=0,r.entranceBloom.indexArrayForConflation.uint16[3*n+1]=0,r.entranceBloom.indexArrayForConflation.uint16[3*n+2]=0}}let n=r=>{0!==r.indexArray.length&&(r.indexBuffer?r.indexBuffer.updateData(r.indexArrayForConflation):r.indexBuffer=i.createIndexBuffer(r.
8indexArrayForConflation,!0),r.entranceBloom.indexBuffer?r.entranceBloom.indexBuffer.updateData(r.entranceBloom.indexArrayForConflation):r.entranceBloom.indexBuffer=i.createIndexBuffer(r.entranceBloom.indexArrayForConflation,!0))};n(this.buildingWithoutFacade),n(this.buildingWithFacade),this.indexArrayForConflationUploaded=!0}uploadUpdatedColorBuffer(i){let r=r=>{r.layoutColorBuffer?r.layoutColorBuffer.updateData(r.layoutColorArray):r.layoutColorBuffer=i.createVertexBuffer(r.layoutColorArray,fJ.members,!0),r.layoutFacadePaintArray&&(r.layoutFacadePaintBuffer?r.layoutFacadePaintBuffer.updateData(r.layoutFacadePaintArray):r.layoutFacadePaintBuffer=i.createVertexBuffer(r.layoutFacadePaintArray,f1.members,!0)),r.entranceBloom.layoutColorBuffer?r.entranceBloom.layoutColorBuffer.updateData(r.entranceBloom.layoutColorArray):r.entranceBloom.layoutColorBuffer=i.createVertexBuffer(r.entranceBloom.layoutColorArray,fJ.members,!0)};r(this.buildingWithoutFacade),r(this.buildingWithFacade),this.colorBufferUploaded=!0}evaluate(i,r){let n=i.paint.get("building-ambient-occlusion-intensity");for(let a of this.footprints){if(4&a.hiddenFlags)continue;let o=r[a.promoteId],s=a.feature;s.properties["building-part"]="roof";let l=i.paint.get("building-color").evaluate(s,o,this.canonical).toPremultipliedRenderColor(this.lut),u=i.paint.get("building-emissive-strength").evaluate(s,o,this.canonical);s.properties["building-part"]="wall";let c=i.paint.get("building-color").evaluate(s,o,this.canonical).toPremultipliedRenderColor(this.lut),d=i.paint.get("building-emissive-strength").evaluate(s,o,this.canonical);s.properties["building-part"]="window";let h=i.paint.get("building-color").evaluate(s,o,this.canonical).toPremultipliedRenderColor(this.lut),f=i.paint.get("building-emissive-strength").evaluate(s,o,this.canonical);s.properties["building-part"]="door";let p=i.paint.get("building-color").evaluate(s,o,this.canonical).toPremultipliedRenderColor(this.lut),m=i.paint.get("building-emissive-strength").evaluate(s,o,this.canonical),g=a.hasFauxFacade?this.buildingWithFacade:this.buildingWithoutFacade;for(let i of a.parts){let r,o=l;1===i.part?(o=l,r=u):0===i.part?(o=c,r=d):2===i.part?(o=h,r=f):3===i.part&&(o=p,r=m),r=ts(r,0,1);for(let s=0;s<i.vertexLength;s++){let l=i.vertexOffset+s,u=1+(g.layoutAOArray.uint8[l]/255-1)*n;g.layoutColorArray.emplace(l,o.r*u*255<<8|o.g*u*255,o.b*u*255<<8|255*r),a.hasFauxFacade&&g.layoutFacadePaintArray.emplace(l,255*h.r<<8|255*h.g,255*h.b<<8|255*f)}}let _=a.buildingBloom;if(_)for(let i=0;i<_.vertexLength;i++)g.entranceBloom.layoutColorArray.emplace(_.vertexOffset+i,255*p.r<<8|255*p.g,255*p.b<<8|51*m)}}needsEvaluation(){return!this.colorBufferUploaded}updateReplacement(i,r,n){if(r.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=r.updateTime;let a=r.getReplacementRegionsForTile(i.toUnwrapped());if(dQ(this.activeReplacements,a))return;for(let i of(this.activeReplacements=a,this.footprints))i.hiddenFlags&=-2;let o=[];for(let r of this.activeReplacements){if(r.order<n)continue;let a=Math.max(1,Math.pow(2,r.footprintTileId.canonical.z-i.canonical.z));for(let n of this.footprints)n.min.x>r.max.x||n.max.x<r.min.x||n.min.y>r.max.y||n.max.y<r.min.y||(o.length=0,function(i,r,n,a,o,s){let l=Math.pow(2,a.z-o.z);for(let u=0;u<n;u++){let n=i.float32[2*(u+r)+0],c=i.float32[2*(u+r)+1];n=(n+8192*o.x)*l-8192*a.x,c=(c+8192*o.y)*l-8192*a.y,s.push(new eQ(n,c))}}(this.footprintsVertices,n.footprintVertexOffset,n.footprintVertexLength,r.footprintTileId.canonical,i.canonical,o),d1(r.footprint,o,this.footprintsIndices.uint16,n.footprintIndexOffset,n.footprintIndexLength,0,-a)&&(n.hiddenFlags|=1))}for(let i of(0===this.groundEffect.hiddenByLandmarkVertexArray.length&&this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length),this.footprints))this.groundEffect.updateHiddenByLandmarkRange(i.groundEffectVertexOffset,i.groundEffectVertexLength,0!==i.hiddenFlags);this.indexArrayForConflationUploaded=!1}getFootprint(i){if(void 0!==i.id){let r=this.featureFootprintLookup.get(i.id);return this.footprints[r]}return null}getHeightAtTileCoord(i,r){let n=-1/0,a=!0,o=4*(i+8192)*8192+(r+8192);if(Object.hasOwn(this.footprintLookup,o)){let i=this.footprintLookup[o];return i?{height:i.height,hidden:0!==i.hiddenFlags}:void 0}let s=new eQ(i,r);for(let l of this.footprints)i>l.max.x||l.min.x>i||r>l.max.y||l.min.y>r||l.height<=n||function(i,r,n){for(let a=0;a<n.length;a+=3){let o=n[a],s=n[a+1],l=n[a+2],u=r[2*o+0],c=r[2*o+1],d=r[2*s+0],h=r[2*s+1],f=r[2*l+0],p=r[2*l+1
8],m=(u-f)*(i.y-p)-(c-p)*(i.x-f),g=(d-u)*(i.y-c)-(h-c)*(i.x-u);if(m<0!=g<0&&0!==m&&0!==g)continue;let _=(f-d)*(i.y-h)-(p-h)*(i.x-d);if(0===_||_<0==m+g<=0)return!0}return!1}(s,this.footprintsVertices.float32.subarray(2*l.footprintVertexOffset,2*(l.footprintVertexOffset+l.footprintVertexLength)),this.footprintsIndices.uint16.subarray(l.footprintIndexOffset,l.footprintIndexOffset+l.footprintIndexLength))&&(n=l.height,this.footprintLookup[o]=l,a=0!==l.hiddenFlags);if(n!==-1/0)return{height:n,hidden:a};this.footprintLookup[o]=void 0}}ar(pU,"BuildingBucket",{omit:["layers"]}),ar(pB,"BuildingGeometry"),ar(pz,"BuildingBloomGeometry");class pV{constructor(i=0,r=[]){this.frcMask=i,this.rings=r}hasGeometry(){return this.rings.length>0&&this.rings[0].length>0}}async function pH(){}function pG(i,r,n){let a=r.paint.get(i).value;return"constant"===a.kind?a.value:n.programConfigurations.get(r.id).getMaxValue(i)}function pq(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function p$(i,r,n,a,o){if(!r[0]&&!r[1])return i;let s=eQ.convert(r)._mult(o);"viewport"===n&&s._rotate(-a);let l=[];for(let r=0;r<i.length;r++)l.push(i[r].sub(s));return l}function pW(i,r,n,a){let o=eQ.convert(i)._mult(a);return"viewport"===r&&o._rotate(-n),o}ar(pV,"FrcCoveragePolygon");let pY=q(),pZ=i=>{let r=[];return"map"===i.paint.get("circle-pitch-alignment")&&r.push("PITCH_WITH_MAP"),"map"===i.paint.get("circle-pitch-scale")&&r.push("SCALE_WITH_MAP"),r};function pK(i,r,n,a,o,s,l,u,c){if(s&&i.queryGeometry.isAboveHorizon)return!1;s&&(c*=i.pixelToTileUnitsFactor);let d=i.tileID.canonical,h=n.projection.upVectorScale(d,n.center.lat,n.worldSize).metersToTile;for(let p of r)for(let r of p){var f;let p=r.add(u),m=o&&n.elevation?n.elevation.exaggeration()*o.getElevationAt(p.x,p.y,!0):0,g=n.projection.projectTilePoint(p.x,p.y,d);if(m>0){let i=n.projection.upVector(d,p.x,p.y);g.x+=i[0]*h*m,g.y+=i[1]*h*m,g.z+=i[2]*h*m}let _=s?p:function(i,r,n,a){let o=eO([],[i,r,n,1],a);return new eQ(o[0]/o[3],o[1]/o[3])}(g.x,g.y,g.z,a),y=s?i.tilespaceRays.map(i=>(function(i,r){let n=eo();return pX[2]=r,i.intersectsPlane(pX,pQ,n),new eQ(n[0],n[1])})(i,m)):i.queryGeometry.screenGeometry,v=eO([],[g.x,g.y,g.z,1],a);if(!l&&s?c*=v[3]/n.cameraToCenterDistance:l&&!s&&(c*=n.cameraToCenterDistance/v[3]),s){let i=rm((r.y/8192+d.y)/(1<<d.z));c/=n.projection.pixelsPerMeter(i,1)/(1/oW(i))}if(f=c,lB(y,_)||lN(_,y,f))return!0}return!1}let pX=eu(0,0,0),pQ=eu(0,0,1);class pJ extends un{}function p1(i){let r={},n=i.resolution||256,a=i.clips?i.clips.length:1,o=i.image||new l0({width:n,height:a}),s=i.lut||null,l=(n,a,l)=>{r[i.evaluationKey]=l;let u=i.expression.evaluate(r),c=u?u.toNonPremultipliedRenderColor(s):null;c&&(o.data[n+a+0]=Math.floor(255*c.r),o.data[n+a+1]=Math.floor(255*c.g),o.data[n+a+2]=Math.floor(255*c.b),o.data[n+a+3]=Math.floor(255*c.a))};if(i.clips)for(let r=0,o=0;r<a;++r,o+=4*n)for(let a=0,s=0;a<n;a++,s+=4){let u=a/(n-1),{start:c,end:d}=i.clips[r];l(o,s,iw(c,d,u))}else for(let i=0,r=0;i<n;i++,r+=4)l(0,r,i/(n-1));return o}ar(pJ,"HeatmapBucket",{omit:["layers"]});class p0{constructor(i){this.zoom=i.zoom,this.layers=i.layers,this.layerIds=this.layers.map(i=>i.fqid),this.index=i.index,this.hasPattern=!1,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.footprints=[],this.worldview=i.worldview,this.hasAppearances=null}updateFootprints(i,r){for(let n of this.footprints)r.push({footprint:n,id:i})}updateAppearances(i,r,n,a){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(i,r,n,a){let o=[];for(let{feature:s,id:l,index:u,sourceLayerIndex:c}of i){let i=this.layers[0]._featureFilter.needGeometry,d=o5(s,i);if(!this.layers[0]._featureFilter.filter(new aZ(this.zoom,{worldview:this.worldview,activeFloors:r.activeFloors}),d,n))continue;let h={id:l,properties:s.properties,type:s.type,sourceLayerIndex:c,index:u,geometry:i?d.geometry:o2(s,n,a),patterns:{}};o.push(h)}for(let a of o){let{geometry:o,index:s,sourceLayerIndex:l}=a;this.addFeature(a,o,s,n,{},r.availableImages,r.brightness),r.featureIndex.insert(i[s].feature,o,s,l,this.index)}}isEmpty(){return 0===this.footprints.length}uploadPending(){return!1}upload(i){}update(i,r,n,a,o,s,l){}destroy(){}addFeature(i,r,n,a,o,s=[],l){for(let i of e2(r,2)){let r=[],n=[],a=[],o=new eQ(1/0,1/0),s=new eQ(-1/0,-1/0);for(let l of i)if(0!==l.length){l!==i[0]&&a.push(n.length/2);for(let i=0;i<l.length;i++)n.push(l[i].x),n.push(l[i].y),r.push(l[i]),o.x=Math.min(o.x,l[i].x),o.y=Math.min(o.y,l[i].y),s.x=Math.max(s.x,l[i].x),s.y=Math.max(s.y,l[i].y)}let l=ov(n,a),u=new fd(r,l,8,256);this.footprints.push({vertices:r,indices:l,grid:u,min:o,max:s})}}}function p2(i,r){return i.x*r.x+i.y*r.y}function p5(i,r){if(1===i.length){let n,a=0,o=r[a++];for(;!n||o.equals(n);)if(!(n=r[a++]))return 1/0;for(;a<r.length;
8a++){let s=r[a],l=i[0],u=n.sub(o),c=s.sub(o),d=l.sub(o),h=p2(u,u),f=p2(u,c),p=p2(c,c),m=p2(d,u),g=p2(d,c),_=h*p-f*f,y=(p*m-f*g)/_,v=(h*g-f*m)/_,x=o.z*(1-y-v)+n.z*y+s.z*v;if(isFinite(x))return x}return 1/0}{let i=1/0;for(let n of r)i=Math.min(i,n.z);return i}}function p4(i,r,n){let a=1/0;lO(n,r)&&(a=p5(n,r[0]));for(let o=0;o<r.length;o++){let s=r[o],l=i[o];for(let i=0;i<s.length-1;i++){let r=s[i],o=[r,s[i+1],l[i+1],l[i],r];lP(n,o)&&(a=Math.min(a,p5(n,o)))}}return a!==1/0&&a}function p9(i,r,n,a,o,s,l,u,c,d,h){return"globe"===i.projection.name?function(i,r,n,a,o,s,l,u,c,d,h){let f=[],p=[],m=i.projection.upVectorScale(h,i.center.lat,i.worldSize).metersToTile,g=[0,0,0,1],_=[0,0,0,1],y=(i,r,n,a)=>{i[0]=r,i[1]=n,i[2]=a,i[3]=1},v=pR();for(let x of(n>0&&(n+=v),a+=v,r)){let r=[],v=[];for(let f of x){let p=f.x+o.x,x=f.y+o.y,b=i.projection.projectTilePoint(p,x,h),w=i.projection.upVector(h,f.x,f.y),T=n,E=a;if(l){let i=p3(p,x,n,a,l,u,c,d);T+=i.base,E+=i.top}0!==n?y(g,b.x+w[0]*m*T,b.y+w[1]*m*T,b.z+w[2]*m*T):y(g,b.x,b.y,b.z),y(_,b.x+w[0]*m*E,b.y+w[1]*m*E,b.z+w[2]*m*E),eA(g,g,s),eA(_,_,s),r.push(new lq(g[0],g[1],g[2])),v.push(new lq(_[0],_[1],_[2]))}f.push(r),p.push(v)}return[f,p]}(i,r,n,a,o,s,l,u,c,d,h):l?function(i,r,n,a,o,s,l,u,c){let d=[],h=[],f=[0,0,0,1];for(let p of i){let i=[],m=[];for(let d of p){let h=d.x+a.x,p=d.y+a.y,g=p3(h,p,r,n,s,l,u,c);f[0]=h,f[1]=p,f[2]=g.base,f[3]=1,eO(f,f,o),f[3]=Math.max(f[3],1e-5);let _=new lq(f[0]/f[3],f[1]/f[3],f[2]/f[3]);f[0]=h,f[1]=p,f[2]=g.top,f[3]=1,eO(f,f,o),f[3]=Math.max(f[3],1e-5);let y=new lq(f[0]/f[3],f[1]/f[3],f[2]/f[3]);i.push(_),m.push(y)}d.push(i),h.push(m)}return[d,h]}(r,n,a,o,s,l,u,c,d):function(i,r,n,a,o){let s=[],l=[],u=o[8]*r,c=o[9]*r,d=o[10]*r,h=o[11]*r,f=o[8]*n,p=o[9]*n,m=o[10]*n,g=o[11]*n;for(let r of i){let i=[],n=[];for(let s of r){let r=s.x+a.x,l=s.y+a.y,_=o[0]*r+o[4]*l+o[12],y=o[1]*r+o[5]*l+o[13],v=o[2]*r+o[6]*l+o[14],x=o[3]*r+o[7]*l+o[15],b=_+u,w=y+c,T=v+d,E=Math.max(x+h,1e-5),S=_+f,A=y+p,C=v+m,I=Math.max(x+g,1e-5);i.push(new lq(b/E,w/E,T/E)),n.push(new lq(S/I,A/I,C/I))}s.push(i),l.push(n)}return[s,l]}(r,n,a,o,s)}function p3(i,r,n,a,o,s,l,u){var c,d;let h,f,p,m,g,_,y,v,x,b,w,T,E,S,A=l*o.getElevationAt(i,r,!0,!0),C=0!==s[0],I=C?0===s[1]?l*(s[0]/7-450):l*(h=Math.floor(s[0]/8),f=Math.floor(s[1]/8),p=10*(s[0]-8*h),m=10*(s[1]-8*f),g=o.getElevationAt(h,f,!0,!0),y=Math.floor(.5*(p*(_=o.getMeterToDEM(u))-1)),v=Math.floor(.5*(m*_-1)),x=o.tileCoordToPixel(h,f),b=2*y+1,w=2*v+1,c=x.x-y,d=x.y-v,E=Math.abs((T=[o.getElevationAtPixel(c,d,!0),o.getElevationAtPixel(c+w,d,!0),o.getElevationAtPixel(c,d+w,!0),o.getElevationAtPixel(c+b,d+w,!0)])[0]-T[1]),S=Math.abs(T[2]-T[3]),g+Math.max(Math.min(.25,.5*_*(E+S)/b)*p,Math.min(.25,.5*_*(Math.abs(T[0]-T[2])+Math.abs(T[1]-T[3]))/w)*m)):A;return{base:A+(0===n?-1:n),top:C?Math.max(I+a,A+n+2):A+a}}function p8(i,r,n){return r*(8192/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}function p6(i,r){return 1/p8(i,1,r.tileZoom)}function p7(i,r,n,a){return i.translatePosMatrix(a||r.tileID.projMatrix,r,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}ar(p0,"ClipBucket",{omit:["layers"]});let me=i=>{let r=[];mt(i)&&r.push("RENDER_LINE_DASH"),i.paint.get("line-gradient")&&r.push("RENDER_LINE_GRADIENT"),"multiply"===i.paint.get("line-blend-mode")&&r.push("LINE_BLEND_MULTIPLY"),"additive"===i.paint.get("line-blend-mode")&&r.push("LINE_BLEND_ADDITIVE");let n=i.paint.get("line-trim-offset");0===n[0]&&0===n[1]||r.push("RENDER_LINE_TRIM_OFFSET"),0!==i.paint.get("line-border-width").constantOr(1)&&r.push("RENDER_LINE_BORDER");let a="none"===i.layout.get("line-join").constantOr("miter"),o=!!i.paint.get("line-pattern").constantOr(1);return a&&o&&r.push("LINE_JOIN_NONE"),r};function mt(i){let r=i.paint.get("line-dasharray").value;return"constant"!==r.kind||r.value}let mi=()=>T||(T={layout:b||(b=new a8({"line-cap":new a9(a6.layout_line["line-cap"]),"line-join":new a9(a6.layout_line["line-join"]),"line-miter-limit":new a4(a6.layout_line["line-miter-limit"]),"line-round-limit":new a4(a6.layout_line["line-round-limit"]),"line-sort-key":new a9(a6.layout_line["line-sort-key"]),"line-z-offset":new a9(a6.layout_line["line-z-offset"]),"line-elevation-reference":new a4(a6.layout_line["line-elevation-reference"]),"line-cross-slope":new a4(a6.layout_line["line-cross-slope"]),visibility:new a4(a6.layout_line.visibility),"line-width-unit":new a4(a6.layout_line["line-width-unit"]),"line-elevation-ground-scale":new a9(a6.layout_line["line-elevation-ground-scale"])})),paint:w||(w=new a8({"line-opacity":new a9(a6.paint_line["line-opacity"]),"line-color":new a9(a6.paint_line["line-color"]),"line-translate":new a4(a6.paint_line["line-translate"]),"line-translate-anchor":new a4(a6.paint_line["line-translate-anchor"]),"line-width":new a9(a6.paint_line["line-width"]),"line-gap-width":new a9(a6.paint_line["line-gap-width"]),"line-offset":new a9(a6.paint_line["line-offset"]),"line-blur"
vendor: 7,830 bytes, line 8
8:new a9(a6.paint_line["line-blur"]),"line-dasharray":new a9(a6.paint_line["line-dasharray"]),"line-pattern":new a9(a6.paint_line["line-pattern"]),"line-pattern-cross-fade":new a4(a6.paint_line["line-pattern-cross-fade"]),"line-gradient":new a3(a6.paint_line["line-gradient"]),"line-trim-offset":new a4(a6.paint_line["line-trim-offset"]),"line-trim-fade-range":new a4(a6.paint_line["line-trim-fade-range"]),"line-trim-color":new a4(a6.paint_line["line-trim-color"]),"line-emissive-strength":new a9(a6.paint_line["line-emissive-strength"]),"line-border-width":new a9(a6.paint_line["line-border-width"]),"line-border-color":new a9(a6.paint_line["line-border-color"]),"line-occlusion-opacity":new a4(a6.paint_line["line-occlusion-opacity"]),"line-blend-mode":new a4(a6.paint_line["line-blend-mode"]),"line-blend-additive-clamp":new a4(a6.paint_line["line-blend-additive-clamp"]),"line-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"line-gradient-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"line-trim-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"line-border-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}))});class mr extends a9{possiblyEvaluate(i,r){return r=new aZ(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,transition:r.transition,worldview:r.worldview}),super.possiblyEvaluate(i,r)}evaluate(i,r,n,a){return r=Object.assign({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(i,r,n,a)}}function mn(i,r){return r.replace(/{([^{}]+)}/g,(r,n)=>n in i?String(i[n]):"")}class ma{constructor(i){this.type=i.property.overrides?i.property.overrides.runtimeType:iL,this.defaultValue=i}evaluate(i){if(i.formattedSection){let r=this.defaultValue.property.overrides;if(r&&r.hasOverride(i.formattedSection))return r.getOverride(i.formattedSection)}return i.feature&&i.featureState?this.defaultValue.evaluate(i.feature,i.featureState):this.defaultValue.property.specification.default}eachChild(i){this.defaultValue.isConstant()||i(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ar(ma,"FormatSectionOverride",{omit:["defaultValue"]});let mo=()=>C||(C={layout:S||(S=new a8({"symbol-placement":new a4(a6.layout_symbol["symbol-placement"]),"symbol-spacing":new a4(a6.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new a4(a6.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new a9(a6.layout_symbol["symbol-sort-key"]),"symbol-z-order":new a4(a6.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new a4(a6.layout_symbol["symbol-z-elevate"]),"symbol-elevation-reference":new a4(a6.layout_symbol["symbol-elevation-reference"]),"icon-allow-overlap":new a4(a6.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new a4(a6.layout_symbol["icon-ignore-placement"]),"icon-optional":new a4(a6.layout_symbol["icon-optional"]),"icon-rotation-alignment":new a4(a6.layout_symbol["icon-rotation-alignment"]),"icon-size":new a9(a6.layout_symbol["icon-size"]),"icon-size-scale-range":new a4(a6.layout_symbol["icon-size-scale-range"]),"icon-text-fit":new a9(a6.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new a9(a6.layout_symbol["icon-text-fit-padding"]),"icon-image":new a9(a6.layout_symbol["icon-image"]),"icon-image-use-theme":new a4({type:"string",default:"default","property-type":"data-constant"}),"icon-rotate":new a9(a6.layout_symbol["icon-rotate"]),"icon-padding":new a4(a6.layout_symbol["icon-padding"]),"icon-keep-upright":new a4(a6.layout_symbol["icon-keep-upright"]),"icon-offset":new a9(a6.layout_symbol["icon-offset"]),"icon-anchor":new a9(a6.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new a4(a6.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new a4(a6.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new a4(a6.layout_symbol["text-rotation-alignment"]),"text-field":new a9(a6.layout_symbol["text-field"]),"text-font":new a9(a6.layout_symbol["text-font"]),"text-size":new a9(a6.layout_symbol["text-size"]),"text-size-scale-range":new a4(a6.layout_symbol["text-size-scale-range"]),"text-max-width":new a9(a6.layout_symbol["text-max-width"]),"text-line-height":new a9(a6.layout_symbol["text-line-height"]),"text-letter-spacing":new a9(a6.layout_symbol["text-letter-spacing"]),"text-justify":new a9(a6.layout_symbol["text-justify"]),"text-radial-offset":new a9(a6.layout_symbol["text-radial-offset"]),"text-variable-anchor":new a4(a6.layout_symbol["text-variable-anchor"]),"text-anchor":new a9(a6.layout_symbol["text-anchor"]),"text-max-angle":new a4(a6.layout_symbol["text-max-angle"]),"text-writing-mode":new a4(a6.layout_symbol["text-writing-mode"]),"text-rotate":new a9(a6.layout_symbol["text-rotate"]),"text-padding":new a4(a6.layout_symbol["text-padding"]),"text-keep-upright":new a4(a6.layout_symbol["text-keep-upright"]),"text-transform":new a9(a6.layout_symbol["text-transform"]),"text-offset":new a9(a6.layout_symbol["text-offset"]),"text-allow-overlap":new a4(a6.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new a4(a6.layout_symbol["text-ignore-placement"]),"text-optional":new a4(a6.layout_symbol["text-optional"]),visibility:new a4(a6.layout_symbol.visibility)})),paint:A||(A=new a8({"icon-opacity":new a9(a6.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new a9(a6.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new a9(a6.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new a9(a6.paint_symbol["text-emissive-strength"]),"icon-color":new a9(a6.paint_symbol["icon-color"]),"icon-halo-color":new a9(a6.paint_symbol["icon-halo-color"]),"icon-halo-width":new a9(a6.paint_symbol["icon-halo-width"]),"icon-halo-blur":new a9(a6.paint_symbol["icon-halo-blur"]),"icon-translate":new a4(a6.paint_symbol["icon-translate"]),"icon-translate-anchor":new a4(a6.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new a4(a6.paint_symbol["icon-image-cross-fade"]),"text-opacity":new a9(a6.paint_symbol["text-opacity"]),"text-occlusion-opacity":new a9(a6.paint_symbol["text-occlusion-opacity"]),"text-color":new a9(a6.paint_symbol["text-color"],{runtimeType:iF,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new a9(a6.paint_symbol["text-halo-color"]),"text-halo-width":new a9(a6.paint_symbol["text-halo-width"]),"text-halo-blur":new a9(a6.paint_symbol["text-halo-blur"]),"text-translate":new a4(a6.paint_symbol["text-translate"]),"text-translate-anchor":new a4(a6.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new a4(a6.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new a4(a6.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new a4(a6.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new a4(a6.paint_symbol["icon-color-brightness-max"]),"symbol-z-offset":new a9(a6.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}))});class ms extends o_{constructor(i,r,n,a){super(i,mo(),r,n,a,i.layout?i.layout["icon-image-use-theme"]:null),this._colorAdjustmentMatrix=W([]),this.hasOcclusionOpacityProperties=void 0!==i.paint&&("icon-occlusion-opacity"in i.paint||"text-occlusion-opacity"in i.paint)}_handleSpecialPaintPropertyUpdate(i){"icon-occlusion-opacity"!==i&&"text-occlusion-opacity"!==i||(this.hasOcclusionOpacityProperties=!0)}recalculate(i,r){super.recalculate(i,r),this.appearances&&this.appearances.forEac
8h(n=>{n.recalculate(i,r,this.iconImageUseTheme)}),"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"));let n=this.layout.get("text-writing-mode");if(n){let i=[];for(let r of n)i.includes(r)||i.push(r);this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(i,r,n,a){var o,s;let l,u,c,d,h;return this._saturation===i&&this._contrast===r&&this._brightnessMin===n&&this._brightnessMax===a||(this._colorAdjustmentMatrix=(o=i,s=r,o=tj(o),s=tN(s),l=q(),c=1-2*(u=o/3),d=.5-.5*s,Z(l,[h=a-n,0,0,0,0,h,0,0,0,0,h,0,n,n,n,1],[s,0,0,0,0,s,0,0,0,0,s,0,d,d,d,1]),Z(l,l,[c,u,u,0,u,c,u,0,u,u,c,0,0,0,0,1]),l),this._saturation=i,this._contrast=r,this._brightnessMin=n,this._brightnessMax=a),this._colorAdjustmentMatrix}getValueAndResolveTokens(i,r,n,a){let o=this.layout.get(i).evaluate(r,{},n,a),s=this._unevaluatedLayout._values[i];return s.isDataDriven()||n9(s.value)||!o?o:mn(r.properties,o)}getAppearanceValueAndResolveTokens(i,r,n,a,o){let s=i.getLayoutProperty(r);if(!s)return;let l=s.evaluate(n,{},a,o),u=i.getUnevaluatedLayoutProperties()._values[r];return u.isDataDriven()||n9(u.value)||!l||"string"!=typeof l?l:mn(n.properties,l)}createBucket(i){return new hi(i)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(let i of mo().paint.overridableProperties){if(!ms.hasPaintOverride(this.layout,i))continue;let r=this.paint.get(i),n=new n4(new ma(r),r.property.specification,this.scope,this.options,this.layout.get("icon-image-use-theme")),a=null;a="constant"===r.value.kind||"source"===r.value.kind?new n8("source",n):new n6("composite",n,r.value.zoomStops,r.value.interpolationType),this.paint._values[i]=new a2(r.property,a,r.parameters)}}_handleOverridablePaintPropertyUpdate(i,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&ms.hasPaintOverride(this.layout,i)}static hasPaintOverride(i,r){let n=i.get("text-field"),a=mo().paint.properties[r],o=!1,s=i=>{for(let r of i)if(a.overrides&&a.overrides.hasOverride(r))return void(o=!0)};if("constant"===n.value.kind&&n.value.value instanceof iX)s(n.value.value.sections);else if("source"===n.value.kind){let i=r=>{o||(r instanceof i4&&i2(r.value)===iB?s(r.value.sections):r instanceof i6?s(r.sections):r.eachChild(i))},r=n.value;r._styleExpression&&i(r._styleExpression.expression)}return o}getProgramIds(){return["symbol"]}getDefaultProgramParams(i,r,n){return{config:new lm(this,{zoom:r,lut:n}),overrideFog:!1}}hasElevation(){return this.layout&&"hd-road-markup"===this.layout.get("symbol-elevation-reference")}mayUse(i){return"HD"===i&&oy(this,"symbol-elevation-reference",i=>"hd-road-markup"===i)}prepare(){return this.mayUse("HD")?pH():Promise.resolve()}}var ml=o6([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Uint16",components:2}]);function mu(i,r,n,a,o,s,l,u){let c=[i,r,1,n,a,1,o,s,1],d=[l,u,1],[h,f,p]=eC(d,d,H([],c));return G(c,c,[h,0,0,0,f,0,0,0,p])}function mc(i,r,n,a,o,s,l,u){let c,d,h=(c=mu(0,0,1,0,1,1,0,1),G(d=mu(i,r,n,a,o,s,l,u),d,H([],c)));return[h[2]/h[8]/8192,h[5]/h[8]/8192]}function md(i){return[i[0],Math.min(Math.max(i[1],-85.051129),85.051129)]}class mh extends i_{constructor(i,r,n,a){super(),this.id=i,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(a),this.options=r,this._dirty=!1}load(i,r){(this._loaded=r||!1,this.fire(new ih("dataloading",{dataType:"source"})),this.url=this.options.url,this.url)?this._imageRequest=ic(this.map._requestManager.transformRequest(this.url,ie.Image),(r,n)=>{this._imageRequest=null,this._loaded=!0,r?this.fire(new ip(r)):n&&(this.image=n,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,i&&(this.coordinates=i),this._finishLoading())}):(i&&(this.coordinates=i),this._loaded=!0,this._finishLoading())}loaded(){return this._loaded}updateImage(i){return i.url&&(this._imageRequest&&i.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=i.url,this.load(i.coordinates,this._loaded)),this}setTexture(i){if(!(i.handle instanceof WebGLTexture))throw Error("The provided handle is not a WebGLTexture instance");return this.texture=new ca(this.map.painter.context,i.handle),this.width=i.dimensions[0],this.height=i.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new ih("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(i){this.map=i,this.load()}onRemove(i){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof ca||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(i){if(this.coordinates=i,this._boundsArray=void 0,this._unsupportedCoords=!1,!i.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let r=i[0][1],n=i[0][1];for(let a of i)a[1]>n&&(n=a[1]),a[1]<r&&(r=a[1]);let a=(n+r)/2;if(a>85.051129?this.onNorthPole=!0:a<-85.051129&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){let r=i.map(oJ.fromLngLat);this.tileID=function(i){let r=1/0,n=1/0,a=-1/0,o=-1/0;for(let s of i)r=Math.min(r,s.x),n=Math.min(n,s.y),a=Math.max(a,s.x),o=Math.max(o,s.y);let s=Math.max(0,Math.floor(-Math.log2(Math.max(a-r,o-n)))),l=Math.pow(2,s),u=Math.floor((r+a)/2*l);return u>1&&(u-=1),new dT(s,u,Math.floor((n+o)/2*l))}(r),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new ih("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){!this.texture||this.texture instanceof ca||(this.texture.destroy(),this._dirty=!0),this.texture=null,this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(i){var r,n,a,o,s,l,u,c,d;let h,f,p,m,g,_,y,v,x,b,w,T;for(let i in this.tiles){let r=this.tiles[i];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;let E=dI(new dT(0,0,0),this.map.transform.projection),S=[E.projection.project(this.coordinates[0][0],this.coordinates[0][1]),E.projection.project(this.coordinates[1][0],this.coordinates[1][1]),E.projection.project(this.coordinates[2][0],this.coordinates[2][1]),E.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(h=S[1].x-S[0].x,f=S[1].y-S[0].y,p=S[2].x-S[1].x,m=S[2].y-S[1].y,g=S[3].x-S[2].x,_=S[3].y-S[2].y,y=S[0].x-S[3].x,v=S[0].y-S[3].y,x=h*m-p*f,b=p*_-g*m,w=g*v-y*_,T=y*f-h*v,(!(x>0)||!(b>0)||!(w>0)||!(T>0))&&(!(x<0)||!(b<0)||!(w<0)||!(T<0)))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);let A=dI(this.tileID,this.map.transform.projection),[C,I,k,R]=this.coordinates.map(i=>{let r=A.projection.project(i[0],i[1]);return dk(A,r)._round()});
8this.perspectiveTransform=mc(C.x,C.y,I.x,I.y,k.x,k.y,R.x,R.y);let M=this._boundsArray=new si;M.emplaceBack(C.x,C.y,0,0),M.emplaceBack(I.x,I.y,8192,0),M.emplaceBack(R.x,R.y,0,8192),M.emplaceBack(k.x,k.y,8192,8192),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=i.createVertexBuffer(M,ml.members),this.boundsSegments=s1.simpleSegment(0,0,4,2);let L=[],[P,O,D,F]=function(i){let r=i[0][0],n=r,a=i[0][1],o=a;for(let s=1;s<i.length;s++)i[s][0]<r?r=i[s][0]:i[s][0]>n&&(n=i[s][0]),i[s][1]<a?a=i[s][1]:i[s][1]>o&&(o=i[s][1]);return[r,a,n-r,o-a]}([md((r=this.coordinates)[0]),md(r[1]),md(r[2]),md(r[3])]);{let r,h=new si,[f,p,m,g]=function(i){let r=i[0].x,n=r,a=i[0].y,o=a;for(let s=1;s<i.length;s++)i[s].x<r?r=i[s].x:i[s].x>n&&(n=i[s].x),i[s].y<a?a=i[s].y:i[s].y>o&&(o=i[s].y);return[r,a,n-r,o-a]}(S),_=i=>[(i.x-f)/m,(i.y-p)/g],[y,v,x,b]=S.map(_),w=(n=y[0],a=y[1],o=v[0],s=v[1],l=x[0],u=x[1],c=b[0],d=b[1],G(r=mu(0,0,1,0,1,1,0,1),r,H([],mu(n,a,o,s,l,u,c,d))));this.elevatedGlobePerspectiveTransform=mc(y[0],y[1],v[0],v[1],x[0],x[1],b[0],b[1]);let T=(i,r)=>{L.push(i.lng);let n=Math.round((i.lng-P)/D*8192),a=Math.round((i.lat-O)/F*8192),o=_(r),s=eC([],[o[0],o[1],1],w),l=Math.round(s[0]/s[2]*8192),u=Math.round(s[1]/s[2]*8192);h.emplaceBack(n,a,l,u)},A=S[3].x-S[0].x,C=S[3].y-S[0].y,I=S[2].x-S[1].x,k=S[2].y-S[1].y;for(let i=0;i<65;i++){let r=i/64,n=[S[0].x+r*A,S[0].y+r*C],a=[S[1].x+r*I,S[1].y+r*k],o=a[0]-n[0],s=a[1]-n[1];for(let i=0;i<65;i++){let r=i/64,a={x:n[0]+o*r,y:n[1]+s*r};T(E.projection.unproject(a.x,a.y),a)}}this.elevatedGlobeVertexBuffer=i.createVertexBuffer(h,ml.members)}{this.maxLongitudeTriangleSize=0;let r=[],n=new sw,a=(i,a,o)=>{n.emplaceBack(i,a,o);let s=L[i],l=L[a],u=L[o],c=Math.min(Math.min(s,l),u),d=Math.max(Math.max(s,l),u)-c;d>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=d),r.push(c+d/2)};for(let i=0;i<64;i++)for(let r=0;r<64;r++){let n=65*i+r,o=n+1,s=n+65,l=s+1;a(n,s,o),a(o,s,l)}[r,n]=function(i,r){let n=Array.from({length:i.length},(i,r)=>r);n.sort((r,n)=>i[r]-i[n]);let a=[],o=new sw;for(let s=0;s<n.length;s++){let l=n[s];a.push(i[l]);let u=3*l,c=u+1;o.emplaceBack(r.uint16[u],r.uint16[c],r.uint16[c+1])}return[a,o]}(r,n),this.elevatedGlobeTrianglesCenterLongitudes=r,this.elevatedGlobeIndexBuffer=i.createIndexBuffer(n)}this.elevatedGlobeSegments=s1.simpleSegment(0,0,4225,8192),this.elevatedGlobeGridMatrix=new Float32Array([0,D/8192,0,F/8192,0,0,O,P,0])}prepare(){let i=0!==Object.keys(this.tiles).length;if(this.tileID&&!i)return;let r=this.map.painter.context,n=r.gl;!this._dirty||this.texture instanceof ca||(this.texture?this.texture.update(this.image):(this.texture=new cn(r,this.image,n.RGBA8),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this._dirty=!1),i&&this._prepareData(r)}loadTile(i,r){this.tileID&&this.tileID.equals(i.tileID.canonical)?(this.tiles[String(i.tileID.wrap)]=i,i.buckets={}):i.state="errored",r(null)}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}getSegmentsForLongitude(i){var r;let n=this.elevatedGlobeSegments;if(!this.elevatedGlobeTrianglesCenterLongitudes||!n)return null;let a=this.elevatedGlobeTrianglesCenterLongitudes,o=(r=i+180)+360*Math.round((a[0]-r)/360),s=new s1,l=(i,r)=>{s.segments.push({vertexOffset:0,primitiveOffset:i,vertexLength:n.segments[0].vertexLength,primitiveLength:r,sortKey:void 0,vaos:{}})},u=.51*this.maxLongitudeTriangleSize;if(Math.abs(a[0]-o)<=u){let i=tF(a,0,a.length,o+u);return i===a.length||l(i,tD(a,i+1,a.length,o+360-u)-i),s}o<a[0]&&(o+=360);let c=tD(a,0,a.length,o-u);if(c===a.length)return l(0,a.length),s;l(0,c-0);let d=tF(a,c+1,a.length,o+u);return d!==a.length&&l(d,a.length-d),s}}class mf extends o_{constructor(i,r,n,a){super(i,{layout:R||(R=new a8({visibility:new a4(a6.layout_raster.visibility)})),paint:M||(M=new a8({"raster-opacity":new a4(a6.paint_raster["raster-opacity"]),"raster-color":new a3(a6.paint_raster["raster-color"]),"raster-color-mix":ne
8w a4(a6.paint_raster["raster-color-mix"]),"raster-color-range":new a4(a6.paint_raster["raster-color-range"]),"raster-hue-rotate":new a4(a6.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new a4(a6.paint_raster["raster-brightness-min"]),"raster-brightness-max":new a4(a6.paint_raster["raster-brightness-max"]),"raster-saturation":new a4(a6.paint_raster["raster-saturation"]),"raster-contrast":new a4(a6.paint_raster["raster-contrast"]),"raster-resampling":new a4(a6.paint_raster["raster-resampling"]),"raster-fade-duration":new a4(a6.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new a4(a6.paint_raster["raster-emissive-strength"]),"raster-array-band":new a4(a6.paint_raster["raster-array-band"]),"raster-elevation":new a4(a6.paint_raster["raster-elevation"]),"raster-elevation-reference":new a4(a6.paint_raster["raster-elevation-reference"]),"raster-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}))},r,n,a),this.updateColorRamp(),this._curRampRange=[NaN,NaN]}getProgramIds(){return["raster"]}hasColorMap(){return!!this._transitionablePaint._values["raster-color"].value.value}tileCoverLift(){return this.paint.get("raster-elevation")}isDraped(i){return!(i&&i._source instanceof mh&&(i._source.onNorthPole||i._source.onSouthPole))&&0===this.paint.get("raster-elevation")}_handleSpecialPaintPropertyUpdate(i){"raster-color"!==i&&"raster-color-range"!==i||(this._curRampRange=[NaN,NaN],this.updateColorRamp())}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}updateColorRamp(i){if(!this.hasColorMap()||!this._curRampRange)return;let r=this._transitionablePaint._values["raster-color"].value.expression,[n,a]=i||this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0})||[NaN,NaN];isNaN(n)&&isNaN(a)||n===this._curRampRange[0]&&a===this._curRampRange[1]||(this.colorRamp=p1({expression:r,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:n,end:a}],resolution:1024}),this.colorRampTexture=null,this._curRampRange=[n,a])}is3D(i){return this.paint.get("raster-elevation")>0}}class mp extends o_{constructor(i,r,n,a){super(i,{layout:L||(L=new a8({visibility:new a4(a6["layout_raster-particle"].visibility)})),paint:P||(P=new a8({"raster-particle-array-band":new a4(a6["paint_raster-particle"]["raster-particle-array-band"]),"raster-particle-count":new a4(a6["paint_raster-particle"]["raster-particle-count"]),"raster-particle-color":new a3(a6["paint_raster-particle"]["raster-particle-color"]),"raster-particle-max-speed":new a4(a6["paint_raster-particle"]["raster-particle-max-speed"]),"raster-particle-speed-factor":new a4(a6["paint_raster-particle"]["raster-particle-speed-factor"]),"raster-particle-fade-opacity-factor":new a4(a6["paint_raster-particle"]["raster-particle-fade-opacity-factor"]),"raster-particle-reset-rate-factor":new a4(a6["paint_raster-particle"]["raster-particle-reset-rate-factor"]),"raster-particle-elevation":new a4(a6["paint_raster-particle"]["raster-particle-elevation"]),"raster-particle-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}))},r,n,a),this._updateColorRamp(),this.lastInvalidatedAt=tU.now()}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this.tileFramebuffer&&(this.tileFramebuffer.destroy(),this.tileFramebuffer=null),this.particleFramebuffer&&(this.particleFramebuffer.destroy(),this.particleFramebuffer=null)}onRemove(i){this.colorRampTexture&&this.colorRampTexture.destroy(),this.tileFramebuffer&&this.tileFramebuffer.destroy(),this.particleFramebuffer&&this.particleFramebuffer.destroy()}hasColorMap(){return!!this._transitionablePaint._values["raster-particle-color"].value.value}getProgramIds(){return["rasterParticle"]}hasOffscreenPass(){return"none"!==this.visibility}isDraped(i){return!1}_handleSpecialPaintPropertyUpdate(i){"raster-particle-color"!==i&&"raster-particle-max-speed"!==i||(this._updateColorRamp(),this._invalidateAnimationState()),"raster-particle-count"===i&&this._invalidateAnimationState()}_updateColorRamp(){if(!this.hasColorMap())return;let i=this._transitionablePaint._values["raster-particle-color"].value.expression,r=this._transitionablePaint._values["raster-particle-max-speed"].value.expression.evaluate({zoom:0});this.colorRamp=p1({expression:i,evaluationKey:"rasterParticleSpeed",image:this.colorRamp,clips:[{start:0,end:r}],resolution:256}),this.colorRampTexture=null}
8_invalidateAnimationState(){this.lastInvalidatedAt=tU.now()}tileCoverLift(){return this.paint.get("raster-particle-elevation")}}class mm extends o_{constructor(i,r){super(i,{},r,null),this.implementation=i,i.slot&&(this.slot=i.slot)}is3D(i){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isDraped(i){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(i){this.implementation.onAdd&&this.implementation.onAdd(i,i.painter.context.gl)}onRemove(i){this.implementation.onRemove&&this.implementation.onRemove(i,i.painter.context.gl)}}function mg(i,r,n){let a=[0,0,1],o=eF([]);return ej(o,o,n?-(i*e7)+Math.PI:i*e7),eN(o,o,-(r*e7)),eI(a,a,o),ew(a,a)}class m_{constructor(i,r){this.feature=i,this.instancedDataOffset=r,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class my{constructor(){this.maxScale=1,this.maxXYTranslationDistance=0,this.instancedDataArray=new sP,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}colorForInstance(i){let r=16*i,n=this.instancedDataArray.float32,a=Math.floor(n[r+2]),o=1.05*(n[r+2]-a);return a/=100,[n[r]%1*1.05,n[r+1]%1*1.05,o,a]}tileCoordinatesForInstance(i){let r=16*i,n=this.instancedDataArray.float32,a=n[r+0];return new eQ(Math.trunc(a=a>8192?a-8192:a),Math.trunc(n[r+1]))}translationForInstance(i){let r=16*i,n=this.instancedDataArray.float32;return[n[r+4],n[r+5],n[r+6]]}rotationScaleForInstance(i){let r=16*i,n=this.instancedDataArray.float32;return[n[r+7],n[r+8],n[r+9],n[r+10],n[r+11],n[r+12],n[r+13],n[r+14],n[r+15]]}transformForInstance(i){let r=16*i,n=this.instancedDataArray.float32;return[n[r+7],n[r+8],n[r+9],n[r+4],n[r+10],n[r+11],n[r+12],n[r+5],n[r+13],n[r+14],n[r+15],n[r+6],0,0,0,1]}}class mv{constructor(i){this.requiresStandardRuntime=!0,this.zoom=i.zoom,this.canonical=i.canonical,this.overscaledZ=this.canonical.z+Math.log2(i.overscaling),this.layers=i.layers,this.layerIds=this.layers.map(i=>i.fqid),this.projection=i.projection,this.index=i.index,this.worldview=i.worldview,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z+1?0:this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1,this.activeReplacements=[],this.replacementUpdateTime=0,this.styleDefinedModelURLs=i.styleDefinedModelURLs,this.hasAppearances=null}updateFootprints(i,r){}updateAppearances(i,r,n,a){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(i,r,n,a){this.tileToMeter=oQ(n);let o=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);let s="hd-road-markup"===this.layers[0].paint.get("model-elevation-reference")?r.elevationFeatures:void 0;for(let{feature:l,id:u,index:c,sourceLayerIndex:d}of i){let i=null!=u?u:l.properties&&Object.hasOwn(l.properties,"id")?l.properties.id:void 0,h=o5(l,o);if(!this.layers[0]._featureFilter.filter(new aZ(this.zoom,{worldview:this.worldview,activeFloors:r.activeFloors}),h,n))continue;let f={id:i,sourceLayerIndex:d,index:c,geometry:o?h.geometry:o2(l,n,a),properties:l.properties,type:l.type,patterns:{}},p=this.addFeature(f,f.geometry,h,s,n);p&&r.featureIndex.insert(l,f.geometry,c,d,this.index,this.instancesPerModel[p].instancedDataArray.length,256)}this.lookup=null}evaluateQueryRenderedFeaturePadding(){let i=this.layers[0].modelManager,r=this.layers[0].scope,n=0;for(let a of this.modelUris){let o=i.getModel(a,r);if(!o)continue;let s=this.instancesPerModel[a];s&&(n=Math.max(Math.min(8192,Math.max((.5*ey(o.aabb.max,o.aabb.min)*s.maxScale+s.maxXYTranslationDistance)/this.tileToMeter,256)),n))}return n}update(i,r,n,a){for(let r in this.instancesPerModel){let n=this.instancesPerModel[r];for(let r in i)Object.hasOwn(n.idToFeaturesIndex,r)&&(this.evaluate(n.features[n.idToFeaturesIndex[r]],i[r],n,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let i=!1;for(let r in this.instancesPerModel){let n=this.instancesPerModel[r];for(let r of n.features){let a=this.layers[0],o=r.feature,s=this.canonical,l=a.paint.get("model-rotation").evaluate(o,{},s),u=a.paint.get("model-scale").evaluate(o,{},s),c=a.paint.get("model-translation").evaluate(o,{},s);eR(r.rotation,l)&&eR(r.scale,u)&&eR(r.translation,c)||(this.evaluate(r,r.featureStates,n,!0),i=!0)}}return i}updateReplacement(i,r,n,a){if(r.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=r.updateTime;let o=r.getReplacementRegionsForTile(i.toUnwrapped(),!0);if(dQ(this.activeReplacements,o))return!1;this.activeReplacements=o;let s=!1;for(let r in this.instancesPerModel){let o=this.instancesPerModel[r],l=o.instancedDataArray;for(let r of o.features){let o=r.instancedDataOffset,u=r.instancedDataCount;for(let r=0;r<u;r++){let u=16*(r+o),c=l.float32[u+0],d=c>8192,h=Math.floor(c=d?c-8192:c),f=Math.floor(l.float32[u+1]),p=!1;for(let r of this.activeReplacements)if(!dY(r,n,pn.Model,a)&&!(r.min.x>h||h>r.max.x||r.min.y>f||f>r.max.y)&&(p=d2(d0(h,f,i.canonical,r.footprintTileId.canonical),r.footprint)))break;l.float32[u]=p?c+8192:c,s=s||p!==d}}}return s}isEmpty(){for(let i in this.instancesPerModel)if(0!==this.instancesPerModel[i].instancedDataArray.length)return!1;return!0}uploadPending(){return!this.uploaded}upload(i){if(!this.uploaded)for(let r in this.instancesPerModel){let n=this.instancesPerModel[r];n.instancedDataArray.length<0||0===n.instancedDataArray.length||(n.instancedDataBuffer?n.instancedDataBuffer.updateData(n.instancedDataArray):n.instancedDataBuffer=i.createVertexBuffer(n.instancedDataArray,fy.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(i){for(let i in this.instancesPerModel){let r=this.instancesPerModel[i];0!==r.instancedDataArray.length&&r.instancedDataBuffer&&r.instancedDataBuffer.destroy()}let r=this.layers[0].modelManager;if(i&&r&&this.modelUris&&this.modelsRequested)for(let i of this.modelUris)r.removeModel(i,"",!0)}addFeature(i,r,n,a,o){let s,l=this.layers[0],u=l.layout.get("model-id"),c=l.layout.get("model-allow-density-reduction"),d=u.evaluate(n,{},this.canonical);if(!d)return tb(`modelId is not evaluated for layer ${l.id} and it is not going to get rendered.`),d;!d.includes("://")&&!this.styleDefinedModelURLs[d]||this.modelUris.includes(d)||this.modelUris.push(d),this.instancesPerModel[d]||(this.instancesPerModel[d]=new my);let h=this.instancesPerModel[d],f=h.instancedDataArray,p=new m_(n,f.length);for(let n of(a&&(s=hm(i,a)),r))for(let i of n){if(i.x<0||i.x>=8192||i.y<0||i.y>=8192)continue;if(0!==this.lookupDim&&c){let r=(this.lookupDim-1)/8192,n=this.lookupDim*(i.y*r|0)+i.x*r|0;if(this.lookup){if(0!==this.lookup[n])continue;this.lookup[n]=1}}this.instanceCount++;let r=f.length;if(f.resize(r+1),a){h.instancesRoadElevation||(h.instancesRoadElevation=[]);let r=s?s.pointElevation(new eQ(i.x,i.y)):0;h.instancesRoadElevation.push(r)}h.instancesEvaluatedElevation.push(0),f.float32[16*r]=i.x,f.float32[16*r+1]=i.y}return p.instancedDataCount=h.instancedDataArray.length-p.instancedDataOffset,p.instancedDataCount>0&&(i.id&&(h.idToFeaturesIndex[i.id]=h.features.length),h.features.push(p),this.evaluate(p,{},h,!1)),d}getModelUris(){return this.modelUris}evaluate(i,r,n,a){let o=this.layers[0],s=i.feature,l=this.canonical,u=i.rotation=o.paint.get("model-rotation").evaluate(s,r,l),c=i.scale=o.paint.get("model-scale").evaluate(s,r,l),d=i.translation=o.paint.get("model-translation").evaluate(s,r,l),{r:h,g:f,b:p}=o.paint.get("model-color").evaluate(s,r,l),m=o.paint.get("model-color-mix-intensity").evaluate(s,r,l),g=[];this.maxVerticalOffset<d[2]&&(this.maxVerticalOffset=d[2]);let _=d[0]*d[0]+d[1]*d[1],y=_>0?Math.sqrt(_):0;n.maxScale=Math.max(Math.max(n.maxScale,c[0]),Math.max(c[1],c[2])),n.maxXYTranslationDistance=Math.max(n.maxXYTranslationDistance,y),this.maxScale=Math.max(Math.max(this.maxScale,c[0]),Math.max(c[1],c[2])),fC(g,u,c);let v=Math.round(100*m)+p/1.05;for(let r=0;r<i.instancedDataCount;++r){let o=i.instancedDataOffset+r,s=16*o,u=n.instancedDataArray.float32,c=0;a&&(c=u[s+6]-n.instancesEvaluatedElevation[o]);let p=0|u[s+1];u[s]=(0|u[s])+h/1.05,u[s+1]=p+f/1.05,u[s+2]=v,u[s+3]=1/(l.z>10?this.tileToMeter:oQ(l,p)),u[s+4]=d[0],u[s+5]=d[1],u[s+6]=d[2]+(n.instancesRoadElevation?n.instancesRoadElevation[o]:0)+c,u[s+7]=g[0],u[s+8]=g[1],u[s+9]=g[2],u[s+10]=g[4],u[s+11]=g[5],u[s+12]=g[6],u[s+13]=g[8],u[s+14]=g[9],u[s+15]=g[10
8],n.instancesEvaluatedElevation[o]=d[2]}}}ar(mv,"ModelBucket",{omit:["layers"]}),ar(my,"PerModelAttributes"),ar(m_,"ModelFeature");class mx{constructor(i,r,n){this._demTile=i,this._dem=this._demTile.dem,this._scale=r,this._offset=n}static create(i,r,n){let a=n||i.findDEMTileFor(r);if(!a||!a.dem)return;let o=a.dem,s=a.tileID,l=1<<r.canonical.z-s.canonical.z;return new mx(a,o.dim/8192/l,[(r.canonical.x/l-s.canonical.x)*o.dim,(r.canonical.y/l-s.canonical.y)*o.dim])}tileCoordToPixel(i,r){let n=r*this._scale+this._offset[1];return new eQ(Math.floor(i*this._scale+this._offset[0]),Math.floor(n))}getElevationAt(i,r,n,a){let o=i*this._scale+this._offset[0],s=r*this._scale+this._offset[1],l=Math.floor(o),u=Math.floor(s),c=this._dem;return a=!!a,n?iw(iw(c.get(l,u,a),c.get(l,u+1,a),s-u),iw(c.get(l+1,u,a),c.get(l+1,u+1,a),s-u),o-l):c.get(l,u,a)}getElevationAtPixel(i,r,n){return this._dem.get(i,r,!!n)}getMeterToDEM(i){return(1<<this._demTile.tileID.canonical.z)*(1/oW(i))*this._dem.stride}}let mb=new Float32Array(262144),mw=new Uint8Array(262144),mT=[0,0,0],mE=[0,0,0],mS=["","wall","door","roof","window","lamp","logo"];class mA{constructor(i){this.node=i,this.evaluatedRMEA=[[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[.4,1,0,1],[1,0,0,1],[1,0,0,1]],this.hiddenByReplacement=!1,this.evaluatedTranslation=[0,0,0],this.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.cameraCollisionOpacity=1,this.targetLod=-1,this.feature={type:"Point",id:i.id,geometry:[],properties:{height:function i(r){let n=0;if(r.meshes)for(let i of r.meshes)n=Math.max(n,i.aabb.max[2]);if(r.children)for(let a of r.children)n=Math.max(n,i(a));return n}(i)}},this.aabb=this._getLocalBounds(),this.state=null}_getLocalBounds(){if(!this.node.meshes)return new c4([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);if(!this.aabb){let i=0,r=new c4([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(let n of this.node.meshes)this.node.lightMeshIndex!==i&&(n.transformedAabb=c4.applyTransformFast(n.aabb,this.node.globalMatrix),r.encapsulate(n.transformedAabb)),i++;this.aabb=r}return this.aabb}}class mC{constructor(i,r,n,a,o,s,l,u){for(const c of(this.requiresStandardRuntime=!0,this.id=n,this.layers=i,this.layerIds=this.layers.map(i=>i.fqid),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.modelTraits|=fM.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,a&&(this.modelTraits|=fM.HasMapboxMeshFeatures),o&&(this.modelTraits|=fM.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=s,this.worldview=u,this.dirty=!0,this.needsUpload=!1,this.filter=null,this.nodesInfo=[],r))this.nodesInfo.push(new mA(c)),function i(r,n,a){if(r.meshes)for(let i of r.meshes){if(i.aabb.min[0]===1/0)continue;let o=c4.applyTransform(i.aabb,r.globalMatrix);a.insert(n,o.min[0],o.min[1],o.max[0],o.max[1])}if(r.children)for(let o of r.children)i(o,n,a)}(c,l.featureIndexArray.length,l.grid),l.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,l.bucketLayerIDs.length-1,0);this.states={},this.hasAppearances=null}updateFootprints(i,r){for(let n of this.getNodesInfo()){let a=n.node;a.footprint&&r.push({footprint:a.footprint,id:i})}}updateAppearances(i,r,n,a){return{hasLayoutChanges:!1,hasUboChanges:!1}}update(i){let r=0!==Object.keys(i).length;if(r&&!this.stateDependentLayers.length)return;let n=r?this.stateDependentLayers:this.layers;if(!eJ(i,this.states))for(let r of n)this.evaluate(r,i);this.states=structuredClone(i)}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(i){if(!this.needsUpload)return;let r=this.getNodesInfo();for(let n of r){let r=n.node;this.uploaded?this.updatePbrBuffer(r):fF(r,i,!0)}for(let i of r)fj(i.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(i){let r=!1;if(!i.meshes)return r;for(let n of i.meshes)n.pbrBuffer&&(n.pbrBuffer.updateData(n.featureArray),r=!0);if(i.lodMeshes)for(let n of i.lodMeshes)n.pbrBuffer&&(n.pbrBuffer.updateData(n.featureArray),r=!0);return r}needsReEvaluation(i,r,n){let a=i.transform.projectionOptions,o=i.style.getBrightness(),s=this.brightness!==o;if(!this.uploaded||this.dirty||a.name!==this.projection.name||mI(n.paint.get("model-color").value,s)||mI(n.paint.get("model-color-mix-intensity").value,s)||mI(n.paint.get("model-roughness").value,s)||mI(n.paint.get("model-emissive-strength").value,s)||mI(n.paint.get("model-height-based-emissive-strength-multiplier").value,s)){for(let i of(this.projection=a,this.brightness=o,this.getNodesInfo()))i.state=null;return!0}return!1}evaluateTransform(i,r){if(i.transform.zoom===this.zoom)return;this.zoom=i.transform.zoom;let n=this.getNodesInfo(),a=this.id.canonical;for(let i of n){let n=i.feature;i.evaluatedTranslation=r.paint.get("model-translation").evaluate(n,{},a),i.evaluatedScale=r.paint.get("model-scale").evaluate(n,{},a)}}
8evaluate(i,r){for(let n of this.getNodesInfo()){if(!n.node.meshes)continue;let a=n.feature,o=r&&r[a.id];if(eJ(o,n.state))continue;n.state=structuredClone(o);let s=n.node.meshes&&n.node.meshes[0].featureData,l=n.evaluatedColor[2],u=n.evaluatedRMEA[2],c=this.id.canonical;if(n.hasTranslucentParts=!1,s){for(let r=0;r<mS.length;r++){let s=mS[r];s.length&&(a.properties.part=s);let l=i.paint.get("model-color").evaluate(a,o,c).toPremultipliedRenderColor(null),u=i.paint.get("model-color-mix-intensity").evaluate(a,o,c);n.evaluatedColor[r]=[l.r,l.g,l.b,u],n.evaluatedRMEA[r][0]=i.paint.get("model-roughness").evaluate(a,o,c),n.evaluatedRMEA[r][2]=i.paint.get("model-emissive-strength").evaluate(a,o,c),n.evaluatedRMEA[r][3]=l.a,n.emissionHeightBasedParams[r]=i.paint.get("model-height-based-emissive-strength-multiplier").evaluate(a,o,c),!n.hasTranslucentParts&&l.a<1&&(n.hasTranslucentParts=!0)}delete a.properties.part,function(i,r,n){let a=i.node,o=n&fM.HasMeshoptCompression,s=16*!o,l=16*!!o;for(let n=0;n<a.meshes.length;n++)a.lights&&a.lightMeshIndex===n||mR(a.meshes[n],i,s,l,r);if(a.lodMeshes)for(let r of a.lodMeshes)mR(r,i,s,l,!1)}(n,l!==n.evaluatedColor[2]||u!==n.evaluatedRMEA[2],this.modelTraits)}else n.evaluatedRMEA[0][2]=i.paint.get("model-emissive-strength").evaluate(a,o,c);n.evaluatedTranslation=i.paint.get("model-translation").evaluate(a,o,c),n.evaluatedScale=i.paint.get("model-scale").evaluate(a,o,c),this.updatePbrBuffer(n.node)||(this.needsUpload=!0)}this.dirty=!1}elevationUpdate(i,r,n,a){let o=i.findDEMTileFor(n);if(o&&(o.tileID.canonical!==this.terrainTile||r!==this.terrainExaggeration)){if(o.dem&&o.tileID.overscaledZ!==this.elevationReadFromZ){this.elevationReadFromZ=o.tileID.overscaledZ;let r=mx.create(i,n,o);if(!r)return;for(let o of(this.modelTraits&fM.HasMapboxMeshFeatures&&this.updateDEM(i,r,n,a),this.getNodesInfo())){let i=o.node;if(!i.footprint||!i.footprint.vertices||!i.footprint.vertices.length)continue;let n=i.footprint.vertices,a=r.getElevationAt(n[0].x,n[0].y,!0,!0);for(let i=1;i<n.length;i++)a=Math.min(a,r.getElevationAt(n[i].x,n[i].y,!0,!0));i.elevation=a}}this.terrainTile=o.tileID.canonical,this.terrainExaggeration=r}}updateDEM(i,r,n,a){let o=r._dem._modifiedForSources[a];if(void 0===o&&(r._dem._modifiedForSources[a]=[],o=r._dem._modifiedForSources[a]),o.includes(n.canonical))return;let s=r._dem.dim;o.push(n.canonical);let l=!1;for(let i of this.getNodesInfo()){let n=i.node;if(!n.footprint||!n.footprint.grid)continue;let a=n.footprint.grid,o=r.tileCoordToPixel(a.min.x,a.min.y),u=r.tileCoordToPixel(a.max.x,a.max.y),c=Math.min(Math.min(s-u.y,o.x),Math.min(o.y,s-u.x));if(c<0)continue;let d=ts(c,2,5),h=Math.max(0,o.x-d),f=Math.max(0,o.y-d),p=Math.min(u.x+d,s-1),m=Math.min(u.y+d,s-1);for(let i=f;i<=m;++i)for(let r=h;r<=p;++r)mw[i*s+r]=255;let g=0,_=0;for(let i=0;i<a.cellsY;++i)for(let n=0;n<a.cellsX;++n){if(!a.cells[i*a.cellsX+n])continue;let o=r.tileCoordToPixel(a.min.x+n/a.xScale,a.min.y+i/a.yScale),l=r.tileCoordToPixel(a.min.x+(n+1)/a.xScale,a.min.y+(i+1)/a.yScale);for(let i=o.y;i<=Math.min(l.y+1,s-1);++i)for(let n=o.x;n<=Math.min(l.x+1,s-1);++n)255===mw[i*s+n]&&(mw[i*s+n]=0,g+=r.getElevationAtPixel(n,i),_++)}let y=g/_;h=Math.max(1,o.x-d),f=Math.max(1,o.y-d),p=Math.min(u.x+d,s-2),m=Math.min(u.y+d,s-2),l=!0;for(let i=f;i<=m;++i)for(let n=h;n<=p;++n)0===mw[i*s+n]&&(mb[i*s+n]=r._dem.set(n,i,y));for(let i=1;i<d;++i){h=Math.max(1,o.x-i),f=Math.max(1,o.y-i),p=Math.min(u.x+i,s-2),m=Math.min(u.y+i,s-2);for(let n=f;n<=m;++n)for(let a=h;a<=p;++a){let o=n*s+a;if(255===mw[o]){let l=0,u=0,c=-1,h=-1;for(let r=-1;r<=1;++r)for(let o=-1;o<=1;++o){let d=(n+r)*s+a+o;if(mw[d]>=i)continue;let f=mb[d],p=Math.abs(f);p>u&&(l=f,u=p,c=o,h=r)}if(u>.1){let s=1-(i+.5*Math.abs(c*h))/d,u=r._dem.get(a,n)+l*s,f=r._dem.get(a+c,n+h),p=r._dem.get(a-c,n-h,!0);(u-f)*(u-p)>0&&(u=(f+p)/2),mb[o]=r._dem.set(a,n,u),mw[o]=i}}}}}l&&(r._demTile.needsDEMTextureUpload=!0,r._dem._timestamp=tU.now())}setFilter(i){this.filter=i?oi(i):null}getNodesInfo(){return this.filter?this.nodesInfo.filter(i=>this.filter.filter(new aZ(this.id.overscaledZ,{worldview:this.worldview}),i.feature,this.id.canonical)):this.nodesInfo}destroy(){for(let i of this.getNodesInfo())fj(i.node),fB(i.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(i,r){if(r.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=r.updateTime;let n=r.getReplacementRegionsForTile(i.toUnwrapped());for(let i of this.getNodesInfo()){let r=i.node.footprint;i.hiddenByReplacement=!!r&&!n.some(i=>i.footprint===r)}}getHeightAtTileCoord(i,r){let n=[0,0,0],a=W([]);for(let o of this.getNodesInfo()){let s=o.node.meshes[0],l=s.transformedAabb;if(i<l.min[0]||r<l.min[1]||i>l.max[0]||r>l.max[1])continue;if(!0===o.node.hidden)return{height:1/0,maxHeight:o.feature.properties.height,hidden:!1,verticalScale:o.evaluatedScale[2]};if(Y(a,o.node.globalMatrix),n[0]=i,n[1]=r,n[2]=0,eA(n,n,a),o.node.meshBVH){let i=n[0],r=n[1];mT[0]=i-1,mT[1]=r-1,mT[2]=-1e3,mE[0]=i+1,mE[1]=r+1,mE[2]=1e3;let a=o.node.meshBVH.findHighestPoint(mT,mE);if(null!==a)return{height:a,maxHeight:o.feature.properties.height,hidden:o.hiddenByReplacement,verticalScale:o.evaluatedScale[2]};continue}let u=(n[0]-s.aabb.min[0])/(s.aabb.max[0]-s.aabb.min[0])*64|0,c=64*Math.min(63,(n[1]-s.aabb.min[1])/(s.aabb.max[1]-s.aabb.min[1])*64|0)+Math.min(63,u),d=s.heightmap[c];if(d<0&&o.node.footprint){let n=[];if(o.node.footprint.grid.query(new eQ(i,r),new eQ(i,r),n),n.length>0)return{height:void 0,maxHeight:o.feature.properties.height,hidden:o.hiddenByReplacement,verticalScale:o.evaluatedScale[2]};continue}if(o.hiddenByReplacement)return;return{height:d,maxHeight:o.feature.properties.height,hidden:!1,verticalScale:o.evaluatedScale[2]}}}}function mI(i,r){return i instanceof n8&&!i.isLightConstant&&r}let mk=new Float64Array(10*mS.length);function mR(i,r,n,a,o){if(!i.featureData)return;let s=i.featureArray=new sO;s.reserveExact(i.featureData.length),function(i,r,n){let a=n-r;for(let n=0;n<mS.length;n++){let o=i.evaluatedRMEA[n],s=i.evaluatedColor[n],l=i.emissionHeightBasedParams[n],u=ts(l[0],0,1),c=ts(l[1],0,1),d=65535,h=0,f=1,p=1;if(u!==c&&0!==a){let i=ts(l[2],0,1),n=ts(l[3],0,1),o=a*(c-u);h=1/o,f=-(r+a*u)/o,p=Math.pow(10,ts(l[4],-1,1)),d=255*i<<8|255*n}let m=10*n;mk[m]=255*s[0],mk[m+1]=255*s[1],mk[m+2]=255*s[2],mk[m+3]=s[3],mk[m+4]=Math.floor(255*o[3]),mk[m+5]=Math.min(Math.round(.5*ts(o[2],0,2)*255),255)<<8|15*o[0]<<4|15*o[1],mk[m+6]=d,mk[m+7]=h,mk[m+8]=f,mk[m+9]=p}}(r,i.aabb.min[2],i.aabb.max[2]);let l=r.node,u=o&&!!l.lights;for(let r of i.featureData){let i=r>>n&65535,o=r>>a&15,c=o<8?o:0,d=10*c,h=(61440&i|(61440&i)>>4)>>8,f=(3840&i|(3840&i)>>4)>>4,p=240&i|(240&i)>>4,m=(15&i|(15&i)<<4)/255,g=mk[d+3];g>0&&(h=iw(h,mk[d],g),f=iw(f,mk[d+1],g),p=iw(p,mk[d+2],g)),h*=m,f*=m,p*=m;let _=h<<8|f,y=p<<8|mk[d+4],v=mk[d+5],x=mk[d+6],b=mk[d+7],w=mk[d+8],T=mk[d+9];if(s.emplaceBack(_,y,v,x,b,w,T),u&&2===c){u=!1;let i=10*l.lights.length,r=new sO;r.reserveExact(i);for(let n=0;n<i;n++)r.emplaceBack(_,y,v,x,b,w,T);l.meshes[l.lightMeshIndex].featureArray=r}}}ar(mC,"Tiled3dModelBucket",{omit:["layers"]}),ar(mA,"Tiled3dModelFeature");let mM=["id","tile","layer","source","sourceLayer","state"];class mL{constructor(i,r,n,a,o){this.type="Feature",this._vectorTileFeature=i,this._z=r,this._x=n,this._y=a,this.properties=i?i.properties:{},this.id=o}clone(){let i=new mL(this._vectorTileFeature,this._z,this._x,this._y,this.id);return this.state&&(i.state=Object.assign({},this.state)),this.layer&&(i.layer=Object.assign({},this.layer)),this.source&&(i.source=this.source),this.sourceLayer&&(i.sourceLayer=this.sourceLayer),i}get geometry(){return void 0===this._geometry&&this._vectorTileFeature&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(i){this._geometry=i}toJSON(){let i={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};for(let r of mM)void 0!==this[r]&&(i[r]=this[r]);return i}}class mP extends i_{constructor(i,r,n,a){super(),this.id=i,this.type="model",this.models=[],this._options=r,this._modelsInfo=new Map,this._abortController=null}cancelModelRequests(){this._abortController&&(this._abortController.abort(),this._abortController=null)}loadGLTFFromURI(i,r){return fc(this.map._requestManager.transformRequest(i,ie.Model).url,r)}async loadModel(i,r,n){try{let a=await this.loadGLTFFromURI(r.uri,n);if(n.aborted)return;let o=this._modelsInfo.get(i);if(!o)return;let s=fY(a),l=o.modelSpec,u=new fP(i,l.uri,l.position,l.orientation,s);mP.applyModelSpecification(u,l),u.computeBoundsAndApplyParent(),this.models.push(u),o.model=u}catch(a){if(a instanceof Error&&"AbortError"===a.name)return;let n=a instanceof Error?a.message:"Unknown error";this.fire(new ip(Error(`Could not load model ${i} from ${r.uri}: ${n}`)))}}async load(){this._abortController||(this._abortController=new AbortController);let i=this._abortController.signal,r=[];for(let n in this._options.models){let a=this._options.models[n],o=this._modelsInfo.get(n);if(o&&o.model){o.modelSpec=a;let i=o.model;i.position=null!=a.position?new oq(a.position[0],a.position[1]):new oq(0,0),i.orientation=null!=a.orientation?a.orientation:[0,0,0],mP.applyModelSpecification(i,a),i.computeBoundsAndApplyParent(),this.models.push(i)}else o?o.modelSpec=a:(this._modelsInfo.set(n,{modelSpec:a,model:null}),r.push(this.loadModel(n,a,i)))}0!==r.length?(await Promise.allSettled(r),i.aborted||this.fire(new ih("data",{dataType:"source",sourceDataType:"metadata"}))):this.loaded()&&this.fire(new ih("data",{dataType:"source",sourceDataType:"metadata"}))}static applyModelSpecification(i,r){r.nodeOverrides&&mP.convertNodeOverrides(i,r.nodeOverrides),r.materialOverrides&&mP.convertMaterialOverrides(i,r.materialOverrides),r.nodeOverrideNames&&(i.nodeOverrideNames=[...r.nodeOverrideNames]),r.materialOverrideNames&&(i.materialOverrideNames=[...r.materialOverrideNames]),r.featureProperties&&(i.featureProperties=r.featureProperties)}static convertNodeOverrides(i,r){if(Array.isArray(r)&&r.every(i=>"string"==typeof i))for(let n of(i.nodeOverrideNames=[],r))i.nodeOverrideNames.push(n);else Object.entries(r).forEach(([r,n])=>{let a={orientation:[0,0,0],minZoom:void 0,maxZoom:void 0};if(Object.hasOwn(n,"orientation")){let i=n.orientation;i&&(a.orientation=i)}Object.hasOwn(n,"minzoom")&&(a.minZoom=n.minzoom),Object.hasOwn(n,"maxzoom")&&(a.maxZoom=n.maxzoom),i.nodeOverrides.set(r,a)})}static convertMaterialOverrides(i,r){if(Array.isArray(r)&&r.every(i=>"string"==typeof i))for(let n of(i.materialOverrideNames=[],r))i.materialOverrideNames.push(n);else Object.entries(r).forEach(([r,n])=>{let a=n["model-color"],o={color:void 0!==a?new iE(a[0],a[1],a[2]):new iE(1,1,1),colorMix:0,emissionStrength:0,opacity:1},s=n["model-color-mix-intensity"];void 0!==s&&(o.colorMix=s);let l=n["model-emissive-strength"];void 0!==l&&(o.emissionStrength=l);let u=n["model-opacity"];void 0!==u&&(o.opacity=u),i.materialOverrides.set(r,o)})}onAdd(i){this.map=i,this.load()}hasTransition(){return!1}loaded(){if(0===this._modelsInfo.size)return!0;for(let i of this._modelsInfo.values())if(null==i.model)return!1;return!0}getModels(){return this.models}loadTile(i,r){}serialize(){return this._options}setProperty(i,r){return!1}reload(){this.cancelModelRequests();let i=oc(this.id,this.scope);this.map.style.clearSource(i),this.models=[],this._modelsInfo.clear(),this.load()}onRemove(i){this.cancelModelRequests()}setModels(i){this.models=[];let r=new Map;for(let n in i){let a=i[n],o=this._modelsInfo.get(n);o&&o.modelSpec.uri===a.uri&&r.set(n,o)}if(this._modelsInfo.size!==r.size)for(let[i,n]of(this.cancelModelRequests(),r))n.model||r.delete(i);this._modelsInfo=r,this._options.models=i,this.load()}}function mO(i,r,n,a){let o=1<<i.z;r.lat=rm((a/8192+i.y)/o),r.lng=rp((n/8192+i.x)/o)}let mD={circle:class extends o_{constructor(i,r,n,a){super(i,{layout:pO||(pO=new a8({"circle-sort-key":new a9(a6.layout_circle["circle-sort-key"]),"circle-elevation-reference":new a4(a6.layout_circle["circle-elevation-reference"]),visibility:new a4(a6.layout_circle.visibility)})),paint:pD||(pD=new a8({"circle-radius":new a9(a6.paint_circle["circle-radius"]),"circle-color":new a9(a6.paint_circle["circle-color"]),"circle-blur":new a9(a6.paint_circle["circle-blur"]),"circle-opacity":new a9(a6.paint_circle["circle-opacity"]),"circle-translate":new a4(a6.paint_circle["circle-translate"]),"circle-translate-anchor":new a4(a6.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new a4(a6.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new a4(a6.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new a9(a6.paint_circle["circle-stroke-width"]),"circle-stroke-color":new a9(a6.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new a9(a6.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new a4(a6.paint_circle["circle-emissive-strength"]),"circle-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"circle-stroke-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}))},r,n,a)}createBucket(i){return new un(i)}queryRadius(i){return pG("circle-radius",this,i)+pG("circle-stroke-width",this,i)+pq(this.paint.get("circle-translate"))}queryIntersectsFeature(i,r,n,a,o,s,l,u){let c=pW(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),s.angle,i.pixelToTileUnitsFactor),d=this.paint.get("circle-radius").evaluate(r,n)+this.paint.get("circle-stroke-width").evaluate(r,n);return pK(i,a,s,l,u,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),c,d)}getProgramIds(){return["circle"]}getDefaultProgramParams(i,r,n){let a=pZ(this);return{config:new lm(this,{zoom:r,lut:n}),defines:a,overrideFog:!1}}
vendor: 10,286 bytes, line 8
8is3D(i){return!i&&!!this.layout&&"none"!==this.layout.get("circle-elevation-reference")}hasElevation(){return this.layout&&"none"!==this.layout.get("circle-elevation-reference")}mayUse(i){return"HD"===i&&oy(this,"circle-elevation-reference",i=>"hd-road-markup"===i)}prepare(){return this.mayUse("HD")?pH():Promise.resolve()}},heatmap:class extends o_{createBucket(i){return new pJ(i)}constructor(i,r,n,a){super(i,{layout:u||(u=new a8({visibility:new a4(a6.layout_heatmap.visibility)})),paint:c||(c=new a8({"heatmap-radius":new a9(a6.paint_heatmap["heatmap-radius"]),"heatmap-weight":new a9(a6.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new a4(a6.paint_heatmap["heatmap-intensity"]),"heatmap-color":new a3(a6.paint_heatmap["heatmap-color"]),"heatmap-opacity":new a4(a6.paint_heatmap["heatmap-opacity"]),"heatmap-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}))},r,n,a),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(i){"heatmap-color"===i&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=p1({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)}_clear(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}queryRadius(i){return pG("heatmap-radius",this,i)}queryIntersectsFeature(i,r,n,a,o,s,l,u){let c=this.paint.get("heatmap-radius").evaluate(r,n);return pK(i,a,s,l,u,!0,!0,new eQ(0,0),c)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getDefaultProgramParams(i,r,n){return"heatmap"===i?{config:new lm(this,{zoom:r,lut:n}),overrideFog:!1}:{}}},hillshade:class extends o_{constructor(i,r,n,a){super(i,{layout:d||(d=new a8({visibility:new a4(a6.layout_hillshade.visibility)})),paint:h||(h=new a8({"hillshade-illumination-direction":new a4(a6.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new a4(a6.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new a4(a6.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new a4(a6.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new a4(a6.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new a4(a6.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new a4(a6.paint_hillshade["hillshade-emissive-strength"]),"hillshade-shadow-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"hillshade-highlight-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"hillshade-accent-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}))},r,n,a)}shouldRedrape(){return this.hasOffscreenPass()&&"viewport"===this.paint.get("hillshade-illumination-anchor")}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getDefaultProgramParams(i,r,n){return{overrideFog:!1}}},fill:class extends o_{constructor(i,r,n,a){super(i,{layout:f||(f=new a8({"fill-sort-key":new a9(a6.layout_fill["fill-sort-key"]),visibility:new a4(a6.layout_fill.visibility),"fill-elevation-reference":new a4(a6.layout_fill["fill-elevation-reference"]),"fill-construct-bridge-guard-rail":new a9(a6.layout_fill["fill-construct-bridge-guard-rail"])})),paint:p||(p=new a8({"fill-antialias":new a4(a6.paint_fill["fill-antialias"]),"fill-opacity":new a9(a6.paint_fill["fill-opacity"]),"fill-color":new a9(a6.paint_fill["fill-color"]),"fill-outline-color":new a9(a6.paint_fill["fill-outline-color"]),"fill-translate":new a4(a6.paint_fill["fill-translate"]),"fill-translate-anchor":new a4(a6.paint_fill["fill-translate-anchor"]),"fill-pattern":new a9(a6.paint_fill["fill-pattern"]),"fill-pattern-cross-fade":new a4(a6.paint_fill["fill-pattern-cross-fade"]),"fill-emissive-strength":new a4(a6.paint_fill["fill-emissive-strength"]),"fill-z-offset":new a9(a6.paint_fill["fill-z-offset"]),"fill-bridge-guard-rail-color":new a9(a6.paint_fill["fill-bridge-guard-rail-color"]),"fill-tunnel-structure-color":new a9(a6.paint_fill["fill-tunnel-structure-color"]),"fill-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"fill-outline-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"fill-bridge-guard-rail-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"fill-tunnel-structure-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}))},r,n,a)}getProgramIds(){let i=this.paint.get("fill-pattern"),r=i&&i.constantOr(1),n=[r?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&n.push(r&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),n}getDefaultProgramParams(i,r,n){return{config:new lm(this,{zoom:r,lut:n}),overrideFog:!1}}recalculate(i,r){super.recalculate(i,r);let n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(i){return new lw(i)}queryRadius(){return pq(this.paint.get("fill-translate"))}queryIntersectsFeature(i,r,n,a,o,s){return!i.queryGeometry.isAboveHorizon&&lO(p$(i.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),s.angle,i.pixelToTileUnitsFactor),a)}isTileClipped(){return 0===this.paint.get("fill-z-offset").constantOr(1)}is3D(i){if(0!==this.paint.get("fill-z-offset").constantOr(1))return!0;let r=this.layout&&"none"!==this.layout.get("fill-elevation-reference");return null!=i?r&&!i:r}hasElevation(){return this.layout&&"none"!==this.layout.get("fill-elevation-reference")}mayUse(i){return"HD"===i&&oy(this,"fill-elevation-reference",i=>"none"!==i)}prepare(){return this.mayUse("HD")?pH():Promise.resolve()}hasShadowPass(){return this.layout&&"none"!==this.layout.get("fill-elevation-reference")}},"fill-extrusion":class extends o_{constructor(i,r,n,a){super(i,{layout:_||(_=new a8({visibility:new a4(a6["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new a4(a6["layout_fill-extrusion"]["fill-extrusion-edge-radius"]),"source-max-zoom":new a4(a6["layout_fill-extrusion"]["source-max-zoom"])})),paint:y||(y=new a8({"fill-extrusion-opacity":new a4(a6["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new a9(a6["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new a4(a6["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new a4(a6["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new a9(a6["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-pattern-cross-fade":new a4(a6["paint_fill-extrusion"]["fill-extrusion-pattern-cross-fade"]),"fill-extrusion-height":new a9(a6["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new a9(a6["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-height-alignment":new a4(a6["paint_fill-extrusion"]["fill-extrusion-height-alignment"]),"fill-extrusion-base-alignment":new a4(a6["paint_fill-extrusion"]["fill-extrusion-base-alignment"]),"fill-extrusion-vertical-gradient":new a4(a6["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new a4(a6["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new a4(a6["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new a4(a6["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new a4(a6["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new a4(a6["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new a4(a6["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new a4(a6["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new a9(a6["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new a9(a6["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new a4(a6["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new a4(a6["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new a4(a6["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new a4(a6["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-front-cutoff":new a4(a6["paint_fill-extrusion"]["fill-extrusion-front-cutoff"]),"fill-extrusion-emissive-strength":new a9(a6["paint_fill-extrusion"]["fill-extrusion-emissive-strength"]),"fill-extrusion-line-width":new a9(a6["paint_fill-extrusion"]["fill-extrusion-line-width"]),"fill-extrusion-cast-shadows":new a4(a6["paint_fill-extrusion"]["fill-extrusion-cast-shadows"]),"fill-extrusion-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"fill-extrusion-flood-light-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}))},r,n,a),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(i){return new pT(i)}queryRadius(){return pq(this.paint.get("fill-extrusion-translate"))}is3D(i){return!0}hasShadowPass(){return this.paint.get("fill-extrusion-cast-shadows")}cutoffRange(){return this.paint.get("fill-extrusion-cutoff-fade-range")}canCastShadows(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}
8queryIntersectsFeature(i,r,n,a,o,s,l,u,c){let d=pW(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,i.pixelToTileUnitsFactor),h=this.paint.get("fill-extrusion-height").evaluate(r,n),f=this.paint.get("fill-extrusion-base").evaluate(r,n),p=[0,0],m=u&&s.elevation,g=s.elevation?s.elevation.exaggeration():1,_=i.tile.getBucket(this);if(_ instanceof pT){let i=_.centroidData.find(i=>c>=i.vertexArrayOffset&&c<i.vertexArrayOffset+i.vertexCount);if(i&&0x40000000&i.flags)return!1;if(m){let i=_.centroidVertexArray,r=c+1;r<i.length&&(p[0]=i.geta_centroid_pos0(r),p[1]=i.geta_centroid_pos1(r))}}if(0===p[0]&&1===p[1])return!1;"globe"===s.projection.name&&(a=pM([a],[new eQ(0,0),new eQ(8192,8192)],i.tileID.canonical).map(i=>i.polygon).flat());let[y,v]=p9(s,a,f,h,d,l,m?u:null,p,g,s.center.lat,i.tileID.canonical),x=i.queryGeometry;return p4(y,v,x.isPointQuery()?x.screenBounds:x.screenGeometry)}},building:class extends o_{constructor(i,r,n,a){super(i,{layout:v||(v=new a8({visibility:new a4(a6.layout_building.visibility),"building-facade":new a9(a6.layout_building["building-facade"]),"building-facade-floors":new a9(a6.layout_building["building-facade-floors"]),"building-facade-unit-width":new a9(a6.layout_building["building-facade-unit-width"]),"building-facade-window":new a9(a6.layout_building["building-facade-window"]),"building-roof-shape":new a9(a6.layout_building["building-roof-shape"]),"building-height":new a9(a6.layout_building["building-height"]),"building-base":new a9(a6.layout_building["building-base"]),"building-flood-light-wall-radius":new a9(a6.layout_building["building-flood-light-wall-radius"]),"building-flood-light-ground-radius":new a9(a6.layout_building["building-flood-light-ground-radius"]),"building-flip-roof-orientation":new a9(a6.layout_building["building-flip-roof-orientation"])})),paint:x||(x=new a8({"building-opacity":new a4(a6.paint_building["building-opacity"]),"building-ambient-occlusion-intensity":new a4(a6.paint_building["building-ambient-occlusion-intensity"]),"building-ambient-occlusion-ground-intensity":new a4(a6.paint_building["building-ambient-occlusion-ground-intensity"]),"building-ambient-occlusion-ground-radius":new a4(a6.paint_building["building-ambient-occlusion-ground-radius"]),"building-ambient-occlusion-ground-attenuation":new a4(a6.paint_building["building-ambient-occlusion-ground-attenuation"]),"building-vertical-scale":new a4(a6.paint_building["building-vertical-scale"]),"building-cast-shadows":new a4(a6.paint_building["building-cast-shadows"]),"building-color":new a9(a6.paint_building["building-color"]),"building-emissive-strength":new a9(a6.paint_building["building-emissive-strength"]),"building-facade-emissive-chance":new a4(a6.paint_building["building-facade-emissive-chance"]),"building-cutoff-fade-range":new a4(a6.paint_building["building-cutoff-fade-range"]),"building-front-cutoff":new a4(a6.paint_building["building-front-cutoff"]),"building-flood-light-color":new a4(a6.paint_building["building-flood-light-color"]),"building-flood-light-intensity":new a4(a6.paint_building["building-flood-light-intensity"]),"building-flood-light-ground-attenuation":new a4(a6.paint_building["building-flood-light-ground-attenuation"]),"building-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"building-flood-light-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}))},r,n,a),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}mayUse(i){return"HD"===i}prepare(){return async function(){return tE(self)&&null==pj&&null==pN?null!=pF?pF:pF=(function(i){let r,n,a,o,s;function l(){r=new Uint8Array(s.buffer),n=new Int16Array(s.buffer),a=new Int32Array(s.buffer),o=new Float32Array(s.buffer)}function u(){throw Error("Unexpected BuildingGen error.")}let c=()=>{},d={a:{a:u,f:function(i){let n=r.length,a=Math.ceil((Math.max(i>>>0,Math.ceil(1.2*n))-n)/65536);try{return s.grow(a),l(),!0}catch(i){return!1}},g:u,b:c,c:c,d:c,e:c}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(i,d):i.then(i=>i.arrayBuffer()).then(i=>WebAssembly.instantiate(i,d))).then(i=>{let u=i.instance.exports;return(0,u.g)(),s=u.f,l(),new pL({setStyle:u.h,setAOOptions:u.i,setMetricOptions:u.j,setStructuralOptions:u.k,setFacadeOptions:u.l,setFauxFacadeOptions:u.m,setFacadeClassifierOptions:u.n,addFeature:u.o,addFacade:u.p,generateMesh:u.q,getLastError:u.r,getOuterRingLength:u.s,getMeshCount:u.t,getPositionsPtr:u.u,getPositionsLength:u.v,getNormalsPtr:u.w,getNormalsLength:u.x,getAOPtr:u.y,getAOLength:u.z,getUVPtr:u.A,getUVLength:u.B,getFauxFacadePtr:u.C,getFauxFacadeLength:u.D,getIndicesPtr:u.E,getIndicesLength:u.F,getBuildingPart:u.G,getRingCount:u.H,getRingPtr:u.I,getRingLength:u.J,malloc:u.K,free:u.L,heapU8:r,heap16:n,heap32:a,heapF32:o})})})(fetch(tq())).then(i=>{pF=null,pj=i}).catch(i=>{tb("Could not load building-gen"),pF=null,pN=i}):null}()}createBucket(i){return new pU(i)}cutoffRange(){return this.paint.get("building-cutoff-fade-range")}hasShadowPass(){return this.paint.get("building-cast-shadows")}hasLightBeamPass(){return!0}canCastShadows(){return!0}is3D(i){return!0}queryRadius(i){return 0}queryIntersectsFeature(i,r,n,a,o,s,l,u,c,d){let h=this.layout.get("building-height").evaluate(r,n),f=this.layout.get("building-base").evaluate(r,n),p=i.tile.getBucket(this).getFootprint(r);if(p){if(0!==p.hiddenFlags)return!1;h=p.height}let[m,g]=p9(s,a,f,h,new eQ(0,0),l,null,[0,0],1,s.center.lat,i.tileID.canonical),_=i.queryGeometry;return p4(m,g,_.isPointQuery()?_.screenBounds:_.screenGeometry)}},line:class extends o_{constructor(i,r,n,a){const o=mi();super(i,o,r,n,a),o.layout&&(this.layout=new a5(o.layout)),this.gradientVersion=0,this.hasElevatedBuckets=!1,this.hasNonElevatedBuckets=!1,this.lineBlendFbos=null,this.lineBlendDensityReadback=null}_handleSpecialPaintPropertyUpdate(i){if("line-gradient"===i){let i=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=i._styleExpression&&i._styleExpression.expression instanceof r3,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}
8else"line-gradient-use-theme"===i&&(this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER)}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}emissiveStrengthExpression(){return this._transitionablePaint._values["line-emissive-strength"].value.expression}recalculate(i,r){super.recalculate(i,r),this.paint._values["line-floorwidth"]=(E||((E=new mr(mi().paint.properties["line-width"].specification)).useIntegerZoom=!0),E).possiblyEvaluate(this._transitioningPaint._values["line-width"].value,i)}createBucket(i){return new l7(i)}getProgramIds(){let i=[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"];return"default"!==this.paint.get("line-blend-mode")&&i.push("lineBlendComposite"),i}getDefaultProgramParams(i,r,n){if("lineBlendComposite"===i)return{};let a=me(this);return{config:new lm(this,{zoom:r,lut:n}),defines:a,overrideFog:!1}}queryRadius(i){var r,n;return r=pG("line-width",this,i),((n=pG("line-gap-width",this,i))>0?n+2*r:r)/2+Math.abs(pG("line-offset",this,i))+pq(this.paint.get("line-translate"))}queryIntersectsFeature(i,r,n,a,o,s){var l,u;if(i.queryGeometry.isAboveHorizon)return!1;let c=p$(i.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,i.pixelToTileUnitsFactor),d=i.pixelToTileUnitsFactor/2*(l=this.paint.get("line-width").evaluate(r,n),(u=this.paint.get("line-gap-width").evaluate(r,n))>0?u+2*l:l),h=this.paint.get("line-offset").evaluate(r,n);return h&&(a=function(i,r){let n=[],a=new eQ(0,0);for(let o=0;o<i.length;o++){let s=i[o],l=[];for(let i=0;i<s.length;i++){let n=s[i],o=s[i+1],u=0===i?a:n.sub(s[i-1])._unit()._perp(),c=i===s.length-1?a:o.sub(n)._unit()._perp(),d=u._add(c)._unit();d._mult(1/(d.x*c.x+d.y*c.y)),l.push(d._mult(r)._add(n))}n.push(l)}return n}(a,h*i.pixelToTileUnitsFactor)),function(i,r,n){for(let a=0;a<r.length;a++){let o=r[a];if(i.length>=3){for(let r=0;r<o.length;r++)if(lB(i,o[r]))return!0}if(function(i,r,n){if(i.length>1){if(lD(i,r))return!0;for(let a=0;a<r.length;a++)if(lN(r[a],i,n))return!0}for(let a=0;a<i.length;a++)if(lN(i[a],r,n))return!0;return!1}(i,o,n))return!0}return!1}(c,a,d)}isTileClipped(){return this.hasNonElevatedBuckets}isDraped(i){return!this.hasElevatedBuckets||this.layout&&"hd-road-markup"===this.layout.get("line-elevation-reference")}hasElevation(){return this.layout&&"none"!==this.layout.get("line-elevation-reference")}mayUse(i){return"HD"===i&&oy(this,"line-elevation-reference",i=>"hd-road-markup"===i)}prepare(){return this.mayUse("HD")?pH():Promise.resolve()}hasOffscreenPass(){return"default"!==this.paint.get("line-blend-mode")&&0!==this.paint.get("line-opacity").constantOr(1)&&0!==this.paint.get("line-width").constantOr(1)&&"none"!==this.visibility}resize(){this._destroyLineBlendFbo()}onRemove(i){this._destroyLineBlendFbo(i.painter&&i.painter.context&&i.painter.context.gl||void 0)}_clear(){this._destroyLineBlendFbo()}_destroyLineBlendFbo(i){this.lineBlendFbos&&(this.lineBlendFbos.destroy(),this.lineBlendFbos=null),i&&this.lineBlendDensityReadback&&this.lineBlendDensityReadback.destroy(i),this.lineBlendDensityReadback=null}},symbol:ms,background:class extends o_{constructor(i,r,n,a){super(i,{layout:I||(I=new a8({visibility:new a4(a6.layout_background.visibility)})),paint:k||(k=new a8({"background-pitch-alignment":new a4(a6.paint_background["background-pitch-alignment"]),"background-color":new a4(a6.paint_background["background-color"]),"background-pattern":new a4(a6.paint_background["background-pattern"]),"background-opacity":new a4(a6.paint_background["background-opacity"]),"background-emissive-strength":new a4(a6.paint_background["background-emissive-strength"]),"background-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}))},r,n,a)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(i,r,n){return{overrideFog:!1}}is3D(i){return"viewport"===this.paint.get("background-pitch-alignment")}},raster:mf,"raster-particle":mp,sky:class extends o_{constructor(i,r,n,a){super(i,{layout:O||(O=new a8({visibility:new a4(a6.layout_sky.visibility)})),paint:D||(D=new a8({"sky-type":new a4(a6.paint_sky["sky-type"]),"sky-atmosphere-sun":new a4(a6.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new a4(a6.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new a4(a6.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new a4(a6.paint_sky["sky-gradient-radius"]),"sky-gradient":new a3(a6.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new a4(a6.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new a4(a6.paint_sky["sky-atmosphere-color"]),"sky-opacity":new a4(a6.paint_sky["sky-opacity"]),"sky-gradient-use
8-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-halo-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}))},r,n,a),this._updateColorRamp()}_clear(){this.skyboxFbo&&(this.skyboxFbo.destroy(),this.skyboxFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this._skyboxInvalidated=!0}_handleSpecialPaintPropertyUpdate(i){"sky-gradient"===i?this._updateColorRamp():"sky-atmosphere-sun"!==i&&"sky-atmosphere-halo-color"!==i&&"sky-atmosphere-color"!==i&&"sky-atmosphere-sun-intensity"!==i||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=p1({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(i){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){let r=i.style.light.properties.get("position");return this._lightPosition.azimuthal!==r.azimuthal||this._lightPosition.polar!==r.polar}return!1}getCenter(i,r){if("atmosphere"===this.paint.get("sky-type")){let n=this.paint.get("sky-atmosphere-sun"),a=!n,o=i.style.light,s=o.properties.get("position");return a&&"viewport"===o.properties.get("anchor")&&tb("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),a?mg(s.azimuthal,90-s.polar,r):mg(n[0],90-n[1],r)}let n=this.paint.get("sky-gradient-center");return mg(n[0],90-n[1],r)}isSky(){return!0}markSkyboxValid(i){this._skyboxInvalidated=!1,this._lightPosition=i.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){let i=this.paint.get("sky-type");return"atmosphere"===i?["skyboxCapture","skybox"]:"gradient"===i?["skyboxGradient"]:null}},slot:class extends o_{constructor(i,r,n,a){super(i,{paint:F||(F=new a8({}))},r,null)}},model:class extends o_{constructor(i,r,n,a){super(i,{layout:N||(N=new a8({visibility:new a4(a6.layout_model.visibility),"model-id":new a9(a6.layout_model["model-id"]),"model-allow-density-reduction":new a4(a6.layout_model["model-allow-density-reduction"])})),paint:j||(j=new a8({"model-opacity":new a9(a6.paint_model["model-opacity"]),"model-rotation":new a9(a6.paint_model["model-rotation"]),"model-scale":new a9(a6.paint_model["model-scale"]),"model-translation":new a9(a6.paint_model["model-translation"]),"model-color":new a9(a6.paint_model["model-color"]),"model-color-mix-intensity":new a9(a6.paint_model["model-color-mix-intensity"]),"model-type":new a4(a6.paint_model["model-type"]),"model-cast-shadows":new a4(a6.paint_model["model-cast-shadows"]),"model-receive-shadows":new a4(a6.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new a4(a6.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new a9(a6.paint_model["model-emissive-strength"]),"model-roughness":new a9(a6.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new a9(a6.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new a4(a6.paint_model["model-cutoff-fade-range"]),"model-front-cutoff":new a4(a6.paint_model["model-front-cutoff"]),"model-elevation-reference":new a4(a6.paint_model["model-elevation-reference"]),"model-line-cutout-mode":new a4(a6.paint_model["model-line-cutout-mode"]),"model-color-use-theme":new a9({type:"string",default:"default","property-type":"data-driven"})}))},r,n,a),this.layer=i,this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}mayUse(i){return"Standard"===i}prepare(){return async function(){return Promise.resolve()}()}createBucket(i){return new mv(i)}getProgramIds(){return["model"]}is3D(i){return!0}hasShadowPass(){return!0}canCastShadows(){return!0}hasLightBeamPass(){return!0}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(i){return 8191*(i instanceof mC)}queryRenderedFeatures(i,r,n){let a=r.getSource();if(!(a&&a instanceof mP))return{};let o={};o[this.id]=[];let s=o[this.id],l=0;for(let o of a.models){let a=r.getFeatureState(this.sourceLayer,o.id),u={type:"Unknown",id:o.id,properties:o.featureProperties},c=this.paint.get("model-rotation").evaluate(u,a),d=this.paint.get("model-scale").evaluate(u,a),h=this.paint.get("model-translation").evaluate(u,a),f=this.paint.get("model-elevation-reference"),p=[];fL(p,o,n,o.position,c,d,h,"ground"===f,"ground"===f,!1),"globe"===n.projection.name&&(p=fk(p,n));let m=Z([],n.projMatrix,p),g=fR(i.isPointQuery()?i.screenBounds:i.screenGeometry,n,m,o.aabb);if(null!=g){let i=new mL(void 0,0,0,0,o.id);i.layer=this.layer,i.properties=structuredClone(o.featureProperties),i.properties.layer=this.id,i.properties.uri=o.uri,i.properties.orientation=o.orientation,i.sourceLayer=this.sourceLayer,i.geometry={type:"Point",coordinates:[o.position.lng,o.position.lat]},i.state=a,i.source=this.source,s.push({featureIndex:l,feature:i,intersectionZ:g})}++l}return o}queryIntersectsFeature(i,r,n,a,o,s,l,u,c,d){if(!this.modelManager)return!1;let h=this.modelManager,f=i.tile.getBucket(this);if(!(f&&f instanceof mv))return!1;for(let n in f.instancesPerModel){let a=f.instancesPerModel[n],o=void 0!==r.id?r.id:r.properties&&Object.hasOwn(r.properties,"id")?r.properties.id:void 0;if(Object.hasOwn(a.idToFeaturesIndex,o)){let r=a.features[a.idToFeaturesIndex[o]],l=h.getModel(n,d||this.scope);if(!l)return!1;let u=[],c=new oq(0,0),p=f.canonical,m=Number.MAX_VALUE;for(let n=0;n<r.instancedDataCount;++n){let o=16*(r.instancedDataOffset+n),d=a.instancedDataArray.float32,h=[d[o+4],d[o+5],d[o+6]];mO(p,c,Math.floor(d[o]),Math.floor(d[o+1])),fL(u,l,s,c,r.rotation,r.scale,h,!1,!1,!1),"globe"===s.projection.name&&(u=fk(u,s));let f=Z([],s.projMatrix,u),g=i.queryGeometry,_=fR(g.isPointQuery()?g.screenBounds:g.screenGeometry,s,f,l.aabb);null!=_&&(m=Math.min(_,m))}return m!==Number.MAX_VALUE&&m}}return!1}_handleOverridablePaintPropertyUpdate(i,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven()||"model-color"!==i&&"model-color-mix-intensity"!==i&&"model-rotation"!==i&&"model-scale"!==i&&"model-translation"!==i&&"model-emissive-strength"!==i)}_isPropertyZoomDependent(i){let r=this._transitionablePaint._values[i];return null!=r&&null!=r.value&&null!=r.value.expression&&r.value.expression instanceof n6}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}},clip:class extends o_{constructor(i,r,n,a){super(i,{layout:m||(m=new a8({"clip-layer-types":ne
8w a4(a6.layout_clip["clip-layer-types"]),"clip-layer-scope":new a4(a6.layout_clip["clip-layer-scope"]),visibility:new a4(a6.layout_clip.visibility)})),paint:g||(g=new a8({}))},r,n,a)}recalculate(i,r){super.recalculate(i,r)}createBucket(i){return new p0(i)}is3D(i){return!0}}};class mF{constructor(i){this.capacity=i,this.cache=new Map}get(i){if(!this.cache.has(i))return;let r=this.cache.get(i);return this.cache.delete(i),this.cache.set(i,r),r}put(i,r){this.cache.has(i)?this.cache.delete(i):this.cache.size===this.capacity&&this.cache.delete(this.cache.keys().next().value),this.cache.set(i,r)}delete(i){this.cache.delete(i)}}ar(mF,"LRUCache");class mN{constructor(i){this._callback=i,this._triggered=!1,"u">typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel&&(this._channel.port1.close(),this._channel.port2.close()),this._callback=()=>{}}}class mj{constructor(i){this._stringToNumber={},this._numberToString=[];for(let r=0;r<i.length;r++){const n=i[r];this._stringToNumber[n]=r,this._numberToString[r]=n}}encode(i){return this._stringToNumber[i]}decode(i){return this._numberToString[i]}}class mz{constructor(i,r){this.tileID=i,this.x=i.canonical.x,this.y=i.canonical.y,this.z=i.canonical.z,this.grid=new at(8192,8192,512),this.featureIndexArray=new s$,this.promoteId=r,this.is3DTile=!1,this.serializedLayersCache=new Map}insert(i,r,n,a,o,s=0,l=0){let u=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,a,o,s);let c=this.grid;for(let i=0;i<r.length;i++){let n=r[i],a=[1/0,1/0,-1/0,-1/0];for(let i=0;i<n.length;i++){let r=n[i];a[0]=Math.min(a[0],r.x),a[1]=Math.min(a[1],r.y),a[2]=Math.max(a[2],r.x),a[3]=Math.max(a[3],r.y)}0!==l&&(a[0]-=l,a[1]-=l,a[2]+=l,a[3]+=l),a[0]<8192&&a[1]<8192&&a[2]>=0&&a[3]>=0&&c.insert(u,a[0],a[1],a[2],a[3])}}loadVTLayers(){if(!this.vtLayers)for(let i in this.vtLayers=new lL(new uS(this.rawTileData)).layers,this.sourceLayerCoder=new mj(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={},this.vtLayers)this.vtFeatures[i]=[];return this.vtLayers}query(i,r){let n,{tilespaceGeometry:a,transform:o,tileTransform:s,pixelPosMatrix:l,availableImages:u,worldview:c}=r;this.loadVTLayers(),this.serializedLayersCache.clear();let d=r.queryRadius?r.queryRadius:0,h=a.bufferedTilespaceBounds,f=this.grid.queryKeys(h.min.x,h.min.y,h.max.x,h.max.y,(i,r,n,o)=>lU(a.bufferedTilespaceGeometry,i-d,r-d,n+d,o+d));f.sort(mU);let p=null;o.elevation&&f.length>0&&(p=mx.create(o.elevation,this.tileID));let m={};for(let d=0;d<f.length;d++){let h=f[d];if(h===n)continue;n=h;let g=this.featureIndexArray.get(h),_=null;this.is3DTile?this.loadMatchingModelFeature(m,g,i,a,o,c):this.loadMatchingFeature(m,g,i,u,c,(i,n,u,c=0)=>(_||(_=o2(i,this.tileID.canonical,s)),n.queryIntersectsFeature(a,i,u,_,this.z,o,l,p,c,r.scope)))}return m}loadMatchingFeature(i,r,n,a,o,s){let{featureIndex:l,bucketIndex:u,sourceLayerIndex:c,layoutVertexArrayOffset:d}=r,h=this.bucketLayerIDs[u],f=n.layers,p=Object.keys(f);if(p.length&&!tv(p,h))return;let m=n.sourceCache,g=this.sourceLayerCoder.decode(c),_=this.vtLayers[g].feature(l),y=this.getId(_,g);for(let r=0;r<h.length;r++){let n=h[r];if(!f[n])continue;let{styleLayer:u,targets:c}=f[n],p={};void 0!==y&&(p=m.getFeatureState(u.sourceLayer,y));let g=!s||s(_,u,p,d);if(!g)continue;let v=new mL(_,this.z,this.x,this.y,y);v.tile=this.tileID.canonical,v.state=p;let x=this.serializedLayersCache.get(n);x||((x=u.serialize()).id=n,this.serializedLayersCache.set(n,x)),v.source=x.source,v.sourceLayer=x["source-layer"],v.layer=Object.assign({},x),v.layer.paint=mB(x.paint,u.paint,_,p,a),v.layer.layout=mB(x.layout,u.layout,_,p,a);let b=!1;for(let i of c){this.updateFeatureProperties(v,i);let{filter:r}=i;if(r){if(_.properties=v.properties,r.needGeometry){let i=o5(_,!0);if(!r.filter(new aZ(this.tileID.overscaledZ,{worldview:o}),i,this.tileID.canonical))continue}else if(!r.filter(new aZ(this.tileID.overscaledZ,{worldview:o}),_))continue}b=!0,i.targetId&&this.addFeatureVariant(v,i)}b&&this.appendToResult(i,n,l,v,g)}}
8loadMatchingModelFeature(i,r,n,a,o,s){let{featureIndex:l,bucketIndex:u}=r,c=this.bucketLayerIDs[u],d=n.layers,h=Object.keys(d);if(!h.length||tv(h,c))for(let r=0;r<c.length;r++){let u=c[r],{styleLayer:h,targets:f}=d[u];if("model"!==h.type)continue;let p=a.tile,m=p.getBucket(h);if(!(m&&m instanceof mC))continue;let g=function(i,r,n,a){let o=i.getNodesInfo()[r];if(!o||o.hiddenByReplacement||!o.node.meshes)return;let s=Number.MAX_VALUE,l=o.node,u=n.tile,c=a.calculatePosMatrix(u.tileID.toUnwrapped(),a.worldSize),d=o.evaluatedScale,h=0;a.elevation&&l.elevation&&(h=l.elevation*a.elevation.exaggeration()),K(c,c,[(l.anchor?l.anchor[0]:0)*(d[0]-1),(l.anchor?l.anchor[1]:0)*(d[1]-1),h]),X(c,c,d);let f=n.queryGeometry,p=f.isPointQuery()?f.screenBounds:f.screenGeometry,m=function(i){let r=Z([],c,i.globalMatrix);Z(r,a.expandedFarZProjMatrix,r);for(let n=0;n<i.meshes.length;++n){let o=i.meshes[n];if(n===i.lightMeshIndex)continue;let l=fR(p,a,r,o.aabb);null!=l&&(s=Math.min(l,s))}if(i.children)for(let r of i.children)m(r)};if(m(l),s===Number.MAX_VALUE)return;let g=new oq(0,0);return mO(u.tileID.canonical,g,o.node.anchor[0],o.node.anchor[1]),{intersectionZ:s,position:g,feature:o.feature}}(m,l,a,o);if(!g)continue;let{z:_,x:y,y:v}=p.tileID.canonical,{feature:x,intersectionZ:b,position:w}=g,T={};void 0!==x.id&&(T=n.sourceCache.getFeatureState(h.sourceLayer,x.id));let E=new mL({},_,y,v,x.id);E.tile=this.tileID.canonical,E.state=T,E.properties=x.properties,E.geometry={type:"Point",coordinates:[w.lng,w.lat]};let S=this.serializedLayersCache.get(u);S||((S=h.serialize()).id=u,this.serializedLayersCache.set(u,S)),E.source=S.source,E.sourceLayer=S["source-layer"],E.layer=Object.assign({},S);let A=!1;for(let i of f){this.updateFeatureProperties(E,i);let{filter:r}=i;if(r){if(x.properties=E.properties,r.needGeometry){if(!r.filter(new aZ(this.tileID.overscaledZ,{worldview:s}),x,this.tileID.canonical))continue}else if(!r.filter(new aZ(this.tileID.overscaledZ,{worldview:s}),x))continue}A=!0,i.targetId&&this.addFeatureVariant(E,i)}A&&this.appendToResult(i,u,l,E,b)}}updateFeatureProperties(i,r,n){if(r.properties){let a={};for(let o in r.properties){let s=r.properties[o].evaluate({zoom:this.z},i._vectorTileFeature,i.state,i.tile,n);null!=s&&(a[o]=s)}i.properties=a}}addFeatureVariant(i,r,n){let a={target:r.target,namespace:r.namespace,uniqueFeatureID:r.uniqueFeatureID};r.properties&&(a.properties=i.properties),i.variants=i.variants||{},i.variants[r.targetId]=i.variants[r.targetId]||[],i.variants[r.targetId].push(a)}appendToResult(i,r,n,a,o){let s=i[r];void 0===s&&(s=i[r]=[]),s.push({featureIndex:n,feature:a,intersectionZ:o})}lookupSymbolFeatures(i,r,n,a,o,s){let l={};for(let u of(this.loadVTLayers(),i))this.loadMatchingFeature(l,{bucketIndex:r,sourceLayerIndex:n,featureIndex:u,layoutVertexArrayOffset:0},a,o,s);return l}loadFeature(i){let{featureIndex:r,sourceLayerIndex:n}=i;this.loadVTLayers();let a=this.sourceLayerCoder.decode(n),o=this.vtFeatures[a];if(o[r])return o[r];let s=this.vtLayers[a].feature(r);return o[r]=s,s}hasLayer(i){for(let r of this.bucketLayerIDs)for(let n of r)if(i===n)return!0;return!1}getId(i,r){let n=i.id;if(this.promoteId){let a=Array.isArray(this.promoteId)||"object"!=typeof this.promoteId?this.promoteId:this.promoteId[r];if(null!=a)if(Array.isArray(a)){if(!this.promoteIdExpression){let i=n3(a);if("success"!==i.result){let r=i.value.map(i=>`${i.key}: ${i.message}`).join(", ");return void tb(`Failed to create expression for promoteId: ${r}`)}this.promoteIdExpression=i.value}n=this.promoteIdExpression.evaluate({zoom:0},i)}else n=i.properties[a];"boolean"==typeof n&&(n=Number(n))}return n}}function mB(i,r,n,a,o){return tg(i,(i,s)=>{let l=r instanceof a5?r.get(s):null;return l&&l.evaluate?l.evaluate(n,a,void 0,o):l})}function mU(i,r){return r-i}function mV(i,r){let n={};if(!r)return n;for(let a of i){let i=a.layerIds.map(i=>r.getLayer(i)).filter(Boolean);if(0!==i.length)for(let r of(a.layers=i,a.stateDependentLayerIds&&(a.stateDependentLayers=a.stateDependentLayerIds.map(r=>i.filter(i=>i.id===r)[0])),a.updateExpressions&&a.updateExpressions(i),i))n[r.fqid]=a}return n}ar(mz,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});let mH=new Uint16Array(8184);for(let i=0;i<2046;i++){let r=i+2,n=0,a=0,o=0,s=0,l=0,u=0;for(1&r?o=s=l=32:n=a=u=32;(r>>=1)>1;){let i=n+o>>1,c=a+s>>1;1&r?(o=n,s=a,n=l,a=u):(n=o,a=s,o=l,s=u),l=i,u=c}let c=4*i;mH[c+0]=n,mH[c+1]=a,mH[c+2]=o,mH[c+3]=s}let mG=new Uint16Array(2178),mq=new Uint8Array(1089),m$=new Uint16Array(1089);function mW(i){return 0===i?-.03125:.03125*(32===i)}let mY={Other:0,Symbol:1,FillExtrusion:2,HdRoadCoverage:3},mZ={type:2,extent:8192,loadGeometry:()=>[[new eQ(0,0),new eQ(8193,0),new eQ(8193,8193),new eQ(0,8193),new eQ(0,0)]]};class mK{constructor(){this.tasks=new Map,tm(["process"],this),this.invoker=new mN(this.process),this.nextId=0}add(i,r){let n=this.nextId++,a=function({type:i,renderSourceType:r,zoom:n}){n=n||0;let a=r===mY.Symbol;return"message"===i?0:"maybePrepare"!==i||a?"parseTile"!==i||a?"parseTile"===i&&a?300-n:"maybePrepare"===i&&a?400-n:500:200-n:100-n}(r);return 0===a?(i(),null):(this.tasks.set(n,{fn:i,metadata:r,priority:a,id:n}),this.invoker.trigger(),{cancel:()=>{this.tasks.delete(n)}})}process(){{let i=this.pick();if(!i)return;this.tasks.delete(i.id),this.tasks.size>0&&this.invoker.trigger(),i.fn()}}pick(){let i=null,r=1/0;for(let n of this.tasks.values())n.priority<r&&(r=n.priority,i=n);return i}
vendor: 1,437 bytes, line 8
8remove(){this.tasks.clear(),this.invoker.remove()}}var mX=Uint8Array,mQ=Uint16Array,mJ=Int32Array,m1=new mX([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),m0=new mX([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),m2=new mX([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),m5=function(i,r){for(var n=new mQ(31),a=0;a<31;++a)n[a]=r+=1<<i[a-1];var o=new mJ(n[30]);for(a=1;a<30;++a)for(var s=n[a];s<n[a+1];++s)o[s]=s-n[a]<<5|a;return{b:n,r:o}},m4=m5(m1,2),m9=m4.b,m3=m4.r;m9[28]=258,m3[258]=28;for(var m8=m5(m0,0).b,m6=new mQ(32768),m7=0;m7<32768;++m7){var ge=(43690&m7)>>1|(21845&m7)<<1;m6[m7]=((65280&(ge=(61680&(ge=(52428&ge)>>2|(13107&ge)<<2))>>4|(3855&ge)<<4))>>8|(255&ge)<<8)>>1}var gt=function(i,r,n){for(var a=i.length,o=0,s=new mQ(r);o<a;++o)i[o]&&++s[i[o]-1];var l,u=new mQ(r);for(o=1;o<r;++o)u[o]=u[o-1]+s[o-1]<<1;l=new mQ(1<<r);var c=15-r;for(o=0;o<a;++o)if(i[o])for(var d=o<<4|i[o],h=r-i[o],f=u[i[o]-1]++<<h,p=f|(1<<h)-1;f<=p;++f)l[m6[f]>>c]=d;return l},gi=new mX(288);for(m7=0;m7<144;++m7)gi[m7]=8;for(m7=144;m7<256;++m7)gi[m7]=9;for(m7=256;m7<280;++m7)gi[m7]=7;for(m7=280;m7<288;++m7)gi[m7]=8;var gr=new mX(32);for(m7=0;m7<32;++m7)gr[m7]=5;var gn=gt(gi,9),ga=gt(gr,5),go=function(i){for(var r=i[0],n=1;n<i.length;++n)i[n]>r&&(r=i[n]);return r},gs=function(i,r,n){var a=r/8|0;return(i[a]|i[a+1]<<8)>>(7&r)&n},gl=function(i,r){var n=r/8|0;return(i[n]|i[n+1]<<8|i[n+2]<<16)>>(7&r)}
8,gu=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],gc=function(i,r,n){var a=Error(r||gu[i]);if(a.code=i,Error.captureStackTrace&&Error.captureStackTrace(a,gc),!n)throw a;return a},gd=new mX(0),gh="u">typeof TextDecoder&&new TextDecoder;try{gh.decode(gd,{stream:!0})}catch(i){}let gf={gzip_data:"gzip"};class gp extends Error{constructor(i){super(i),this.name="MRTError"}}let gm={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},gg={uint32:1,uint16:2,uint8:4},g_={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};class gy{constructor(i=5){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=i}getLayer(i){let r=this.layers[i];if(!r)throw new gp(`Layer '${i}' not found`);return r}getHeaderLength(i){let r=new Uint8Array(i),n=new DataView(i);if(13!==r[0])throw new gp("File is not a valid MRT.");return n.getUint32(1,!0)}parseHeader(i){let r=new Uint8Array(i),n=this.getHeaderLength(i);if(r.length<n)throw new gp(`Expected header with length >= ${n} but got buffer of length ${r.length}`);let a=function(i){let r,n={headerLength:0,x:0,y:0,z:0,layers:[]};for(;r=i.nextField(void 0);)1===r?n.headerLength=i.readFixed32():2===r?n.x=i.readVarint():3===r?n.y=i.readVarint():4===r?n.z=i.readVarint():5===r&&n.layers.push(function(i,r){let n,a={version:0,name:"",units:"",tileSize:0,buffer:0,pixelFormat:0,dataIndex:[]};for(;n=i.nextField(r);)1===n?a.version=i.readVarint():2===n?a.name=i.readString():3===n?a.units=i.readString():4===n?a.tileSize=i.readVarint():5===n?a.buffer=i.readVarint():6===n?a.pixelFormat=i.readVarint():7===n&&a.dataIndex.push(function(i,r){let n={firstByte:0,lastByte:0,filters:[],codec:null,offset:0,scale:0,bands:[]},a,o=0,s=0;for(;a=i.nextField(r);)1===a?n.firstByte=i.readFixed64():2===a?n.lastByte=i.readFixed64():3===a?n.filters.push(function(i,r){let n,a={};for(;n=i.nextField(r);)1===n?(a.delta_filter=function(i,r){let n,a={blockSize:0};for(;n=i.nextField(r);)1===n&&(a.blockSize=i.readVarint());return a}(i,i.readVarint()+i.pos),a.filter="delta_filter"):2===n?(i.readVarint(),a.filter="zigzag_filter"):3===n?(i.readVarint(),a.filter="bitshuffle_filter"):4===n&&(i.readVarint(),a.filter="byteshuffle_filter");return a}(i,i.readVarint()+i.pos)):4===a?n.codec=function(i,r){let n,a={};for(;n=i.nextField(r);)1===n?(i.readVarint(),a.codec="gzip_data"):2===n?(i.readVarint(),a.codec="jpeg_image"):3===n?(i.readVarint(),a.codec="webp_image"):4===n&&(i.readVarint(),a.codec="png_image");return a}(i,i.readVarint()+i.pos):5===a?s=i.readFloat():6===a?o=i.readFloat():7===a?n.bands.push(i.readString()):8===a?n.offset=i.readDouble():9===a&&(n.scale=i.readDouble());return 0===n.offset&&(n.offset=s),0===n.scale&&(n.scale=o),n}(i,i.readVarint()+i.pos));return a}(i,i.readVarint()+i.pos));return n}(new z(r.subarray(0,n)));if(!isNaN(this.x)&&(this.x!==a.x||this.y!==a.y||this.z!==a.z))throw new gp(`Invalid attempt to parse header ${a.z}/${a.x}/${a.y} for tile ${this.z}/${this.x}/${this.y}`);for(let i of(this.x=a.x,this.y=a.y,this.z=a.z,a.layers))this.layers[i.name]=new gv(i,{cacheSize:this._cacheSize});return this}createDecodingTask(i){let r=[],n=this.getLayer(i.layerName);for(let a of i.blockIndices){let o=n.dataIndex[a],s=o.firstByte-i.firstByte,l=o.lastByte-i.firstByte;if(n._blocksInProgress.has(a))continue;let u={layerName:n.name,firstByte:s,lastByte:l,pixelFormat:n.pixelFormat,blockIndex:a,blockShape:[o.bands.length].concat(n.bandShape),buffer:n.buffer,codec:o.codec.codec,filters:o.filters.map(i=>i.filter)};n._blocksInProgress.add(a),r.push(u)}return new gx(r,()=>{r.forEach(i=>n._blocksInProgress.delete(i.blockIndex))},(i,a)=>{if(r.forEach(i=>n._blocksInProgress.delete(i.blockIndex)),i)throw i;a.forEach(i=>{this.getLayer(i.layerName).processDecodedData(i)})})}}class gv{constructor({version:i,name:r,units:n,tileSize:a,pixelFormat:o,buffer:s,dataIndex:l},u){if(this.version=i,1!==this.version)throw new gp(`Cannot parse raster layer encoded with MRT version ${i}`);this.name=r,this.units=n,this.tileSize=a,this.buffer=s,this.pixelFormat=gm[o],this.dataIndex=l,this.bandShape=[a+2*s,a+2*s,gg[this.pixelFormat]],this._decodedBlocks=new mF(u?u.cacheSize:5),this._blocksInProgress=new Set}get dimension(){return gg[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map(({bands:i})=>i).flat()}processDecodedData(i){let r=i.blockIndex.toString();this._decodedBlocks.get(r)||this._decodedBlocks.put(r,i.data)}getBlockForBand(i){let r=0;switch(typeof i){case"string":for(let[n,a]of this.dataIndex.entries()){for(let[o,s]of a.bands.entries())if(s===i)return{bandIndex:r+o,blockIndex:n,blockBandIndex:o};r+=a.bands.length}break;case"number":for(let[n,a]of this.dataIndex.entries()){if(i>=r&&i<r+a.bands.length)return{bandIndex:i,blockIndex:n,blockBandIndex:i-r};r+=a.bands.length}break;default:throw new gp(`Invalid band \`${JSON.stringify(i)}\`. Expected string or integer.`)}return{blockIndex:-1,blockBandIndex:-1}}getDataRange(i){let r=1/0,n=-1/0,a=[],o=new Set;for(let s of i){let{blockIndex:i}=this.getBlockForBand(s);if(i<0)throw new gp(`Invalid band: ${JSON.stringify(s)}`);let l=this.dataIndex[i];a.includes(i)||a.push(i),o.add(i),r=Math.min(r,l.firstByte),n=Math.max(n,l.lastByte)}if(o.size>this.cacheSize)throw new gp(`Number of blocks to decode (${o.size}) exceeds cache size (${this.cacheSize}).`);return{layerName:this.name,firstByte:r,lastByte:n,blockIndices:a}}hasBand(i){let{blockIndex:r}=this.getBlockForBand(i);return r>=0}hasDataForBand(i){let{blockIndex:r}=this.getBlockForBand(i);return r>=0&&!!this._decodedBlocks.get(r.toString())}getBandView(i){let{blockIndex:r,blockBandIndex:n}=this.getBlockForBand(i);if(r<0)throw new gp(`Band not found: ${JSON.stringify(i)}`);let a=this._decodedBlocks.get(r.toString());if(!a)throw new gp(`Data for band ${JSON.stringify(i)} of layer "${this.name}" not decoded.`);let o=this.dataIndex[r],s=this.bandShape.reduce((i,r)=>i*r,1),l=n*s,u=a.subarray(l,l+s);return{data:u,bytes:new Uint8Array(u.buffer).subarray(u.byteOffset,u.byteOffset+u.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:o.offset,scale:o.scale}}}gy.setPbf=function(i){z=i};class gx{constructor(i,r,n){this.tasks=i,this._onCancel=r,this._onComplete=n,this._finalized=!1}cancel(){this._finalized||(this._onCancel(),this._finalized=!0)}complete(i,r){this._finalized||(this._onComplete(i,r),this._finalized=!0)}}function gb(i,r,n){try{r=function(i){if(!i.variants)return i;
8if(!Array.isArray(i.variants))throw Error("variants must be an array");for(let r of i.variants){if(null==r||"object"!=typeof r||r.constructor!==Object)throw Error("variant must be an object");if(!Array.isArray(r.capabilities))throw Error("capabilities must be an array");if(1===r.capabilities.length&&"meshopt"===r.capabilities[0])return Object.assign(i,r)}return i}(r)}catch(i){return Error("Failed to process TileJSON variants",{cause:i})}let a=td(Object.assign({},r,i),["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","extra_bounds","scheme","tileSize","encoding","vector_layers","raster_layers","worldview_options","worldview_default","worldview"]);return i.url&&r.tiles&&i.tiles&&(a.tiles=r.tiles),a.tiles=n.canonicalizeTileset(a,i.url),a}gy.performDecoding=function(i,r){let n=new Uint8Array(i);return Promise.all(r.tasks.map(i=>{let{layerName:r,firstByte:a,lastByte:o,pixelFormat:s,blockShape:l,blockIndex:u,filters:c,codec:d}=i,h=n.subarray(a,o+1),f=new Uint32Array(l[0]*l[1]*l[2]);if("gzip_data"!==d)throw new gp(`Unhandled codec: ${d}`);return(function(i,r){var n,a,o;if(!globalThis.DecompressionStream&&"gzip_data"===r)return Promise.resolve(((o=function(i){31==i[0]&&139==i[1]&&8==i[2]||gc(6,"invalid gzip data");var r=i[3],n=10;4&r&&(n+=2+(i[10]|i[11]<<8));for(var a=(r>>3&1)+(r>>4&1);a>0;a-=!i[n++]);return n+(2&r)}(i))+8>i.length&&gc(6,"invalid gzip data"),function(i,r,n,a){var o,s,l=i.length;if(!l||r.f&&!r.l)return n||new mX(0);var u=!n,c=u||2!=r.i,d=r.i;u&&(n=new mX(3*l));var h=function(i){var r=n.length;if(i>r){var a=new mX(Math.max(2*r,i));a.set(n),n=a}},f=r.f||0,p=r.p||0,m=r.b||0,g=r.l,_=r.d,y=r.m,v=r.n,x=8*l;do{if(!g){f=gs(i,p,1);var b=gs(i,p+1,3);if(p+=3,!b){var w=i[(P=((p+7)/8|0)+4)-4]|i[P-3]<<8,T=P+w;if(T>l){d&&gc(0);break}c&&h(m+w),n.set(i.subarray(P,T),m),r.b=m+=w,r.p=p=8*T,r.f=f;continue}if(1==b)g=gn,_=ga,y=9,v=5;else if(2==b){var E=gs(i,p,31)+257,S=gs(i,p+10,15)+4,A=E+gs(i,p+5,31)+1;p+=14;for(var C=new mX(A),I=new mX(19),k=0;k<S;++k)I[m2[k]]=gs(i,p+3*k,7);p+=3*S;var R=go(I),M=(1<<R)-1,L=gt(I,R);for(k=0;k<A;){var P,O=L[gs(i,p,M)];if(p+=15&O,(P=O>>4)<16)C[k++]=P;else{var D=0,F=0;for(16==P?(F=3+gs(i,p,3),p+=2,D=C[k-1]):17==P?(F=3+gs(i,p,7),p+=3):18==P&&(F=11+gs(i,p,127),p+=7);F--;)C[k++]=D}}var N=C.subarray(0,E),j=C.subarray(E);y=go(N),v=go(j),g=gt(N,y),_=gt(j,v)}else gc(1);if(p>x){d&&gc(0);break}}c&&h(m+131072);for(var z=(1<<y)-1,B=(1<<v)-1,U=p;;U=p){var V=(D=g[gl(i,p)&z])>>4;if((p+=15&D)>x){d&&gc(0);break}if(D||gc(2),V<256)n[m++]=V;else{if(256==V){U=p,g=null;break}var H=V-254;V>264&&(H=gs(i,p,(1<<($=m1[k=V-257]))-1)+m9[k],p+=$);var G=_[gl(i,p)&B],q=G>>4;if(G||gc(3),p+=15&G,j=m8[q],q>3){var $=m0[q];j+=gl(i,p)&(1<<$)-1,p+=$}if(p>x){d&&gc(0);break}c&&h(m+131072);var W=m+H;if(m<j){var Y=0-j,Z=Math.min(j,W);for(Y+m<0&&gc(3);m<Z;++m)n[m]=a[Y+m]}for(;m<W;++m)n[m]=n[m-j]}}r.l=g,r.p=U,r.b=m,r.f=f,g&&(f=1,r.m=y,r.d=_,r.n=v)}while(!f)return m!=n.length&&u?(o=n,(null==(s=m)||s>o.length)&&(s=o.length),new mX(o.subarray(0,s))):n.subarray(0,m)}(i.subarray(o,-8),{i:2},new mX((i[(a=i.length)-4]|i[a-3]<<8|i[a-2]<<16|i[a-1]<<24)>>>0),n)));let s=gf[r];if(!s)throw Error(`Unhandled codec: ${r}`);let l=new globalThis.DecompressionStream(s);return new Response(new Blob([i]).stream().pipeThrough(l)).arrayBuffer().then(i=>new Uint8Array(i))})(h,d).then(i=>((function(i,r){let n;for(;n=i.nextField();)if(2===n)!function(i,r,n){let a;for(;a=i.nextField(r);)if(1===a){let r=0,a=i.readVarint()+i.pos;for(;i.pos<a;)n[r++]=i.readVarint()}}(i,i.readVarint()+i.pos,r);else if(3===n)throw Error("Not implemented")})(new z(i),f),new(0,g_[s])(f.buffer))).then(i=>{for(let r=c.length-1;r>=0;r--)switch(c[r]){case"delta_filter":!function(i,r){if(4!==r.length)throw Error(`Expected data of dimension 4 but got ${r.length}.`);let n=r[3];for(let a=2;a>=1;a--){let o=+(1===a),s=+(2===a);for(let a=0;a<r[0];a++){let l=r[1]*a;for(let a=o;a<r[1];a++){let o=r[2]*(a+l);for(let a=s;a<r[2];a++){let s=r[3]*(a+o);for(let a=0;a<r[3];a++){let r=s+a;i[r]+=i[r-n]}}}}n*=r[a]}}(i,l);break;case"zigzag_filter":var n=i;for(let i=0,r=n.length;i<r;i++)n[i]=n[i]>>>1^-(1&n[i]);break;case"bitshuffle_filter":!function(i,r){switch(r){case"uint32":return;case"uint16":for(let r=0;r<i.length;r+=2){let n=i[r],a=i[r+1];i[r]=(240&n)>>4|(61440&n)>>8|(240&a)<<4|61440&a,i[r+1]=15&n|(3840&n)>>4|(15&a)<<8|(3840&a)<<4}return;case"uint8":for(let r=0;r<i.length;r+=4){let n=i[r],a=i[r+1],o=i[r+2],s=i[r+3];i[r+0]=(192&n)>>6|(192&a)>>4|(192&o)>>2|192&s,i[r+1]=(48&n)>>4|(48&a)>>2|48&o|(48&s)<<2,i[r+2]=(12&n)>>2|12&a|(12&o)<<2|(12&s)<<4,i[r+3]=3&n|(3&a)<<2|(3&o)<<4|(3&s)<<6}return;default:throw Error(`Invalid pixel format, "${r}"`)}}(i,s);break;default:throw new gp(`Unhandled filter "${c[r]}"`)}return{layerName:r,blockIndex:u,data:i}}).catch(i=>{throw i})}))},ar(gx,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]}),ar(gy,"MapboxRasterTile"),ar(gv,"MapboxRasterLayer",{omit:["_blocksInProgress"]});let gw=new Map,gT=new Map;class gE{constructor(i){this.size=i,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(i,r){let n=this.toIdx(i,r);return{min:this.minimums[n],max:this.maximums[n]}}isLeaf(i,r){return this.leaves[this.toIdx(i,r)]}toIdx(i,r){return r*this.size+i}}function gS(i,r,n,a){let o=0,s=Number.MAX_VALUE;for(let l=0;l<3;l++)if(1e-15>Math.abs(a[l])){if(n[l]<i[l]||n[l]>r[l])return null}else{let u=1/a[l],c=(i[l]-n[l])*u,d=(r[l]-n[l])*u;if(c>d){let i=c;c=d,d=i}if(c>o&&(o=c),d<s&&(s=d),o>s)return null}return o}function gA(i,r,n,a,o,s,l,u,c,d,h){let f=a-i,p=o-r,m=s-n,g=l-i,_=u-r,y=c-n,v=h[1]*y-h[2]*_,x=h[2]*g-h[0]*y,b=h[0]*_-h[1]*g,w=f*v+p*x+m*b;if(1e-15>Math.abs(w))return null;let T=1/w,E=d[0]-i,S=d[1]-r,A=d[2]-n,C=(E*v+S*x+A*b)*T;if(C<0||C>1)return null;let I=S*m-A*p,k=A*f-E*m,R=E*p-S*f,M=(h[0]*I+h[1]*k+h[2]*R)*T;return M<0||C+M>1?null:(g*I+_*k+y*R)*T}function gC(i,r,n,a,o,s,l,u,c){let d=1<<n,h=s-a,f=l-o;u[0]=(i+0)/d*h+a,u[1]=(r+0)/d*f+o,c[0]=(i+1)/d*h+a,c[1]=(r+1)/d*f+o}class gI{constructor(i){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=i,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const r=function(i){let r=Math.ceil(Math.log2(i.dim/8)),n=[],a=Math.ceil(Math.pow(2,r)),o=1/a,s=(i,r,n,a,o)=>{let s=+!!a;o[0]=i*n,o[1]=r*n,o[2]=(i+1)*n-s,o[3]=(r+1)*n-s},l=new gE(a),u=[];for(let r=0;r<a*a;r++){s(r%a,Math.floor(r/a),o,!1,u);let n=gR(u[0],u[1],i),c=gR(u[2],u[1],i),d=gR(u[2],u[3],i),h=gR(u[0],u[3],i);l.minimums.push(Math.min(n,c,d,h)),l.maximums.push(Math.max(n,c,d,h)),l.leaves.push(1)}for(n.push(l),a/=2;a>=1;a/=2){let i=n.at(-1);
8l=new gE(a);for(let r=0;r<a*a;r++){s(r%a,Math.floor(r/a),2,!0,u);let n=i.getElevation(u[0],u[1]),o=i.getElevation(u[2],u[1]),c=i.getElevation(u[2],u[3]),d=i.getElevation(u[0],u[3]),h=i.isLeaf(u[0],u[1]),f=i.isLeaf(u[2],u[1]),p=i.isLeaf(u[2],u[3]),m=i.isLeaf(u[0],u[3]),g=Math.min(n.min,o.min,c.min,d.min),_=Math.max(n.max,o.max,c.max,d.max),y=h&&f&&p&&m;l.maximums.push(_),l.minimums.push(g),l.leaves.push(_-g<=5&&y?1:0)}n.push(l)}return n}(this.dem),n=r.length-1,a=r[n];this._addNode(a.minimums[0],a.maximums[0],a.leaves[0]),this._construct(r,0,0,n,0)}raycastRoot(i,r,n,a,o,s,l=1){return gS([i,r,-100],[n,a,this.maximums[0]*l],o,s)}raycast(i,r,n,a,o,s,l=1){if(!this.nodeCount)return null;let u=this.raycastRoot(i,r,n,a,o,s,l);if(null==u)return null;let c=[],d=[],h=[],f=[],p=[{idx:0,t:u,nodex:0,nodey:0,depth:0}];for(;p.length>0;){let{idx:u,t:v,nodex:x,nodey:b,depth:w}=p.pop();if(this.leaves[u]){gC(x,b,w,i,r,n,a,h,f);let u=1<<w,c=(x+0)/u,d=(x+1)/u,p=(b+0)/u,T=(b+1)/u,E=gR(c,p,this.dem)*l,S=gR(d,p,this.dem)*l,A=gR(d,T,this.dem)*l,C=gR(c,T,this.dem)*l,I=gA(h[0],h[1],E,f[0],h[1],S,f[0],f[1],A,o,s),k=gA(f[0],f[1],A,h[0],f[1],C,h[0],h[1],E,o,s),R=Math.min(null!==I?I:Number.MAX_VALUE,null!==k?k:Number.MAX_VALUE);if(R!==Number.MAX_VALUE)return R;{var m,g,_,y;let i=e_([],o,s,v);if(gk(E,S,C,A,(m=i[0],(m-(g=h[0]))/(f[0]-g)),(_=i[1],(_-(y=h[1]))/(f[1]-y)))>=i[2])return v}continue}let T=0;for(let p=0;p<this._siblingOffset.length;p++){gC((x<<1)+this._siblingOffset[p][0],(b<<1)+this._siblingOffset[p][1],w+1,i,r,n,a,h,f),h[2]=-100,f[2]=this.maximums[this.childOffsets[u]+p]*l;let m=gS(h,f,o,s);if(null!=m){c[p]=m;let i=!1;for(let r=0;r<T&&!i;r++)m>=c[d[r]]&&(d.splice(r,0,p),i=!0);i||(d[T]=p),T++}}for(let i=0;i<T;i++){let r=d[i];p.push({idx:this.childOffsets[u]+r,t:c[r],nodex:(x<<1)+this._siblingOffset[r][0],nodey:(b<<1)+this._siblingOffset[r][1],depth:w+1})}}return null}_addNode(i,r,n){return this.minimums.push(i),this.maximums.push(r),this.leaves.push(n),this.childOffsets.push(0),this.nodeCount++}_construct(i,r,n,a,o){if(1===i[a].isLeaf(r,n))return;this.childOffsets[o]||(this.childOffsets[o]=this.nodeCount);let s=a-1,l=i[s],u=0,c=0;for(let i=0;i<this._siblingOffset.length;i++){let a=2*r+this._siblingOffset[i][0],o=2*n+this._siblingOffset[i][1],s=l.getElevation(a,o),d=l.isLeaf(a,o),h=this._addNode(s.min,s.max,d);d&&(u|=1<<i),c||(c=h)}for(let a=0;a<this._siblingOffset.length;a++)u&1<<a||this._construct(i,2*r+this._siblingOffset[a][0],2*n+this._siblingOffset[a][1],s,c+a)}}function gk(i,r,n,a,o,s){return iw(iw(i,n,s),iw(r,a,s),o)}function gR(i,r,n){let a=n.dim,o=ts(i*a-.5,0,a-1),s=ts(r*a-.5,0,a-1),l=Math.floor(o),u=Math.floor(s),c=Math.min(l+1,a-1),d=Math.min(u+1,a-1);return gk(n.get(l,u),n.get(c,u),n.get(l,d),n.get(c,d),o-l,s-u)}let gM={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function gL(i,r,n){return(256*i*256+256*r+n)/10-1e4}function gP(i,r,n){return 256*i+r+n/256-32768}class gO{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(i,r,n,a=!1){if(this.uid=i,r.height!==r.width)throw RangeError("DEM tiles must be square");if(n&&"mapbox"!==n&&"terrarium"!==n)return void tb(`"${n}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=r.height;const o=this.dim=r.height-2,s=new Uint32Array(r.data.buffer);if(this.pixels=new Uint8Array(r.data.buffer),this.floatView=new Float32Array(r.data.buffer),this.borderReady=a,this._modifiedForSources={},!a){for(let i=0;i<o;i++)s[this._idx(-1,i)]=s[this._idx(0,i)],s[this._idx(o,i)]=s[this._idx(o-1,i)],s[this._idx(i,-1)]=s[this._idx(i,0)],s[this._idx(i,o)]=s[this._idx(i,o-1)];s[this._idx(-1,-1)]=s[this._idx(0,0)],s[this._idx(o,-1)]=s[this._idx(o-1,0)],s[this._idx(-1,o)]=s[this._idx(0,o-1)],s[this._idx(o,o)]=s[this._idx(o-1,o-1)]}const l="terrarium"===n?gP:gL;for(let i=0;i<s.length;++i){const r=4*i;this.floatView[i]=l(this.pixels[r],this.pixels[r+1],this.pixels[r+2])}this._timestamp=tU.now()}_buildQuadTree(){this._tree=new gI(this)}get(i,r,n=!1){n&&(i=ts(i,-1,this.dim),r=ts(r,-1,this.dim));let a=this._idx(i,r);return this.floatView[a]}set(i,r,n){let a=this._idx(i,r),o=this.floatView[a];return this.floatView[a]=n,n-o}static getUnpackVector(i){return gM[i]}_idx(i,r){if(i<-1||i>=this.dim+1||r<-1||r>=this.dim+1)throw RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(i+1)}static pack(i,r){let n=[0,0,0,0],a=gO.getUnpackVector(r),o=Math.floor((i+a[3])/a[2]);return n[2]=o%256,o=Math.floor(o/256),n[1]=o%256,o=Math.floor(o/256),n[0]=o,n}getPixels(){return new l2({width:this.stride,height:this.stride},this.pixels)}backfillBorder(i,r,n){if(this.dim!==i.dim)throw Error("dem dimension mismatch");let a=r*this.dim,o=r*this.dim+this.dim,s=n*this.dim,l=n*this.dim+this.dim;switch(r){case -1:a=o-1;break;case 1:o=a+1}switch(n){case -1:s=l-1;break;case 1:l=s+1}let u=-r*this.dim,c=-n*this.dim;for(let r=s;r<l;r++)for(let n=a;n<o;n++){let a=4*this._idx(n,r),o=4*this._idx(n+u,r+c);this.pixels[a+0]=i.pixels[o+0],this.pixels[a+1]=i.pixels[o+1],this.pixels[a+2]=i.pixels[o+2],this.pixels[a+3]=i.pixels[o+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}ar(gO,"DEMData"),ar(gI,"DemMinMaxQuadTree",{omit:["dem"]});let gD=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array
8],gF=new Uint32Array(96);class gN{static from(i){if(!i||void 0===i.byteLength||i.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[r,n]=new Uint8Array(i,0,2);if(219!==r)throw Error("Data does not appear to be in a KDBush format.");let a=n>>4;if(1!==a)throw Error(`Got v${a} data when expected v1.`);let o=gD[15&n];if(!o)throw Error("Unrecognized array type.");let[s]=new Uint16Array(i,2,1),[l]=new Uint32Array(i,4,1);return new gN(l,s,o,void 0,i)}constructor(i,r=64,n=Float64Array,a=ArrayBuffer,o){if(isNaN(i)||i<0)throw Error(`Unexpected numItems value: ${i}.`);this.numItems=+i,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=n,this.IndexArrayType=i<65536?Uint16Array:Uint32Array;const s=gD.indexOf(this.ArrayType),l=2*i*this.ArrayType.BYTES_PER_ELEMENT,u=i*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-u%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${n}.`);if(o)this.data=o,this.ids=new this.IndexArrayType(o,8,i),this.coords=new n(o,8+u+c,2*i),this._pos=2*i,this._finished=!0;else{const o=this.data=new a(8+l+u+c);this.ids=new this.IndexArrayType(o,8,i),this.coords=new n(o,8+u+c,2*i),this._pos=0,this._finished=!1,new Uint8Array(o,0,2).set([219,16+s]),new Uint16Array(o,2,1)[0]=r,new Uint32Array(o,4,1)[0]=i}}add(i,r){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=i,this.coords[this._pos++]=r,n}finish(){let i=this._pos>>1;if(i!==this.numItems)throw Error(`Added ${i} items when expected ${this.numItems}.`);return function i(r,n,a,o,s,l){if(s-o<=a)return;let u=o+s>>1;(function i(r,n,a,o,s,l){for(;s>o;){if(s-o>600){let u=s-o+1,c=a-o+1,d=Math.log(u),h=.5*Math.exp(2*d/3),f=.5*Math.sqrt(d*h*(u-h)/u)*(c-u/2<0?-1:1);i(r,n,a,Math.max(o,Math.floor(a-c*h/u+f)),Math.min(s,Math.floor(a+(u-c)*h/u+f)),l)}let u=n[2*a+l],c=o,d=s;for(gj(r,n,o,a),n[2*s+l]>u&&gj(r,n,o,s);c<d;){for(gj(r,n,c,d),c++,d--;n[2*c+l]<u;)c++;for(;n[2*d+l]>u;)d--}n[2*o+l]===u?gj(r,n,o,d):gj(r,n,++d,s),d<=a&&(o=d+1),a<=d&&(s=d-1)}})(r,n,u,o,s,l),i(r,n,a,o,u-1,1-l),i(r,n,a,u+1,s,1-l)}(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(i,r,n,a){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:l}=this;gF[0]=0,gF[1]=o.length-1,gF[2]=0;let u=3,c=[];for(;u>0;){let d=gF[--u],h=gF[--u],f=gF[--u];if(h-f<=l){for(let l=f;l<=h;l++){let u=s[2*l],d=s[2*l+1];u>=i&&u<=n&&d>=r&&d<=a&&c.push(o[l])}continue}let p=f+h>>1,m=s[2*p],g=s[2*p+1];m>=i&&m<=n&&g>=r&&g<=a&&c.push(o[p]),(0===d?i<=m:r<=g)&&(gF[u++]=f,gF[u++]=p-1,gF[u++]=1-d),(0===d?n>=m:a>=g)&&(gF[u++]=p+1,gF[u++]=h,gF[u++]=1-d)}return c}within(i,r,n){let a=[];return this.withinInto(i,r,n,a),a}withinInto(i,r,n,a){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:l}=this;gF[0]=0,gF[1]=o.length-1,gF[2]=0;let u=3,c=0,d=n*n;for(;u>0;){let h=gF[--u],f=gF[--u],p=gF[--u];if(f-p<=l){for(let n=p;n<=f;n++)gB(s[2*n],s[2*n+1],i,r)<=d&&(a[c++]=o[n]);continue}let m=p+f>>1,g=s[2*m],_=s[2*m+1];gB(g,_,i,r)<=d&&(a[c++]=o[m]),(0===h?i-n<=g:r-n<=_)&&(gF[u++]=p,gF[u++]=m-1,gF[u++]=1-h),(0===h?i+n>=g:r+n>=_)&&(gF[u++]=m+1,gF[u++]=f,gF[u++]=1-h)}return c}}function gj(i,r,n,a){gz(i,n,a),gz(r,2*n,2*a),gz(r,2*n+1,2*a+1)}function gz(i,r,n){let a=i[r];i[r]=i[n],i[n]=a}function gB(i,r,n,a){let o=i-n,s=r-a;return o*o+s*s}r.$=class{constructor(i){this.cache=new Map,this.textures=new Map,this.textureAccessTimes=new Map,this.textureMemoryUsed=0,this.maxTextureMemory=1024*(i&&i.maxTextureMemoryMB?i.maxTextureMemoryMB:256)*1024,this.currentFrameAtlases=new Set,this.finalizationRegistry=new FinalizationRegistry(i=>{this.cache.delete(i),this.clearExpiredTextures()})}beginFrame(){this.currentFrameAtlases.clear()}calculateTextureMemory(i){return i.image?Math.ceil(i.image.width*i.image.height*4*(i.patternPositions.size>0?1.33:1)):0}evictTexture(i){let r=this.textures.get(i);if(r){let n=this.calculateTextureMemory(i);r.destroy(),this.textures.delete(i),this.textureAccessTimes.delete(i),this.textureMemoryUsed-=n,i.uploaded=!1}}evictTexturesIfNeeded(i){for(;this.textureMemoryUsed+i>this.maxTextureMemory&&this.textures.size>0;){let i=null,r=1/0;for(let[n]of this.textures.entries()){if(this.currentFrameAtlases.has(n))continue;let a=this.textureAccessTimes.get(n)||0;a<r&&(r=a,i=n)}if(!i)break;this.evictTexture(i)}}findCachedAtlas(i){let r=this.cache.get(i.hash);if(r){let n=r.deref();
8if(n&&n.contentDescriptor&&this.isMipmapCompatible(i,n.contentDescriptor))return n}for(let[,r]of this.cache.entries()){let n=r.deref();if(n&&n.contentDescriptor){let r=i.subsetOf(n.contentDescriptor),a=this.isMipmapCompatible(i,n.contentDescriptor);if(r&&a)return n}}}getTextureForAtlas(i,r,n){this.textureAccessTimes.set(i,performance.now()),this.currentFrameAtlases.add(i);let a=this.textures.get(i);if(a)return a;if(i.image){let o=this.calculateTextureMemory(i);return this.evictTexturesIfNeeded(o),a=new cn(r,i.image,n,{useMipmap:!!i.patternPositions.size}),this.textures.set(i,a),this.textureMemoryUsed+=o,a}return null}clearExpiredTextures(){for(let[i]of this.textures.entries())if(!this.isAtlasCached(i)){let r=this.textures.get(i);if(r){let n=this.calculateTextureMemory(i);r.destroy(),this.textureMemoryUsed-=n}this.textures.delete(i),this.textureAccessTimes.delete(i)}}isAtlasCached(i){if(!i.contentDescriptor)return!1;let r=this.cache.get(i.contentDescriptor.hash);return!!r&&r.deref()===i}getOrCache(i){if(!("image"in i)){let r=this.cache.get(i.sourceAtlasHash);if(r){let i=r.deref();if(i)return i}return tb("ImageAtlasReference points to GC'd atlas - atlas may have been evicted"),null}if(!i.contentDescriptor)return i;let r=i.contentDescriptor,n=r.hash,a=this.cache.get(n);if(a){let i=a.deref();if(i&&i.contentDescriptor&&this.isMipmapCompatible(r,i.contentDescriptor))return i}return this.cache.set(n,new WeakRef(i)),this.finalizationRegistry.register(i,n,i),i}isMipmapCompatible(i,r){return!i.requiresMipMaps||r.requiresMipMaps}destroyTextures(){for(let i of this.textures.values())i&&i.destroy();this.textures.clear(),this.textureAccessTimes.clear(),this.textureMemoryUsed=0}clear(){for(let i of this.textures.values())i&&i.destroy();this.cache.clear(),this.textures.clear(),this.textureAccessTimes.clear(),this.textureMemoryUsed=0}},r.A=c4,r.B=2,r.C=.0039101094886591446,r.D=gO,r.E=450,r.F=7,r.G=4,r.H=5,r.I=mz,r.J=lw,r.K=pT,r.L=l2,r.M=pV,r.N=c5,r.O=cX,r.P=oz,r.Q=45,r.R=6,r.S=5,r.T=class{constructor(i){this._createGrid(i),this._createPoles(i)}destroy(){for(let i of(this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy(),this._poleSegments))i.destroy();for(let i of this._gridSegments)i.withSkirts.destroy(),i.withoutSkirts.destroy()}_fillGridMeshWithLods(i,r){let n=new se,a=new sw,o=[],s=i+1+2,l=r[0]+1,u=r[0]+1+(1+r.length),c=(i,r,n)=>{let a=i===s-1?i-2:0===i?i:i-1;return[a+=24575*!!n,r]};for(let i=0;i<s;++i)n.emplaceBack(...c(i,0,!0));for(let i=0;i<l;++i)for(let r=0;r<s;++r)n.emplaceBack(...c(r,i,0===r||r===s-1));for(let i=0;i<r.length;++i){let a=r[i];for(let i=0;i<s;++i)n.emplaceBack(...c(i,a,!0))}for(let i=0;i<r.length;++i){let l=a.length,c=r[i]+1+2,d=new sw;for(let n=0;n<c-1;n++){let o=n===c-2,l=o?s*(u-r.length+i-n):s;for(let i=0;i<s-1;i++){let r=n*s+i;0===n||o||0===i||i===s-2?(d.emplaceBack(r+1,r,r+l),d.emplaceBack(r+l,r+l+1,r+1)):(a.emplaceBack(r+1,r,r+l),a.emplaceBack(r+l,r+l+1,r+1))}}let h=s1.simpleSegment(0,l,n.length,a.length-l);for(let i=0;i<d.uint16.length;i+=3)a.emplaceBack(d.uint16[i],d.uint16[i+1],d.uint16[i+2]);let f=s1.simpleSegment(0,l,n.length,a.length-l);o.push({withoutSkirts:h,withSkirts:f})}return{vertices:n,indices:a,segments:o}}_createGrid(i){let r=this._fillGridMeshWithLods(64,oB);this._gridSegments=r.segments,this._gridBuffer=i.createVertexBuffer(r.vertices,cY.members),this._gridIndexBuffer=i.createIndexBuffer(r.
8indices,!0)}_createPoles(i){let r=new sw;for(let i=0;i<=64;i++)r.emplaceBack(0,i+1,i+2);this._poleIndexBuffer=i.createIndexBuffer(r,!0);let n=new sA,a=new sA,o=new sA,s=new sA;this._poleSegments=[];for(let i=0,r=0;i<6;i++){let l=360/(1<<i);n.emplaceBack(0,-oz,0,.5,0),a.emplaceBack(0,-oz,0,.5,1),o.emplaceBack(0,-oz,0,.5,.5),s.emplaceBack(0,-oz,0,.5,.5);for(let i=0;i<=64;i++){let r=i/64,u=0,c=iw(0,l,r),[d,h,f]=oV(dx,db,c,oz);n.emplaceBack(d,h,f,r,u),a.emplaceBack(d,h,f,r,1-u);let p=c*e7;r=.5+.5*Math.sin(p),u=.5+.5*Math.cos(p),o.emplaceBack(d,h,f,r,u),s.emplaceBack(d,h,f,r,1-u)}this._poleSegments.push(s1.simpleSegment(r,0,66,64)),r+=66}this._poleNorthVertexBuffer=i.createVertexBuffer(n,c$,!1),this._poleSouthVertexBuffer=i.createVertexBuffer(a,c$,!1),this._texturedPoleNorthVertexBuffer=i.createVertexBuffer(o,c$,!1),this._texturedPoleSouthVertexBuffer=i.createVertexBuffer(s,c$,!1)}getGridBuffers(i,r){return[this._gridBuffer,this._gridIndexBuffer,r?this._gridSegments[i].withSkirts:this._gridSegments[i].withoutSkirts]}getPoleBuffers(i,r){return[r?this._texturedPoleNorthVertexBuffer:this._poleNorthVertexBuffer,r?this._texturedPoleSouthVertexBuffer:this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[i]]}},r.U=cv,r.V=at,r.W="hd_road_elevation",r.X="hd_road_coverage",r.Y=0x80000000,r.Z=1,r._=cc,r.a=class{constructor(i,r,n){this.target=i,this.parent=r,this.mapId=n,this.callbacks={},this.cancelCallbacks={},tm(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.scheduler=new mK}send(i,r,n,a,o=!1,s){let l=Math.round(1e18*Math.random()).toString(36).substring(0,10);n&&(n.metadata=s,this.callbacks[l]=n);let u=new Set;return this.target.postMessage({id:l,type:i,hasCallback:!!n,targetMapId:a,mustQueue:o,sourceMapId:this.mapId,data:aa(r,u)},u),{cancel:()=>{n&&delete this.callbacks[l],this.target.postMessage({id:l,type:"<cancel>",targetMapId:a,sourceMapId:this.mapId})}}}receive(i){let r=i.data;if(!r)return;let n=r.id;if(n&&(!r.targetMapId||this.mapId===r.targetMapId))if("<cancel>"===r.type){let i=this.cancelCallbacks[n];delete this.cancelCallbacks[n],i&&i.cancel()}else if(r.mustQueue||tE(self)){let i=this.callbacks[n],a=this.scheduler.add(()=>this.processTask(n,r),i&&i.metadata||{type:"message"});a&&(this.cancelCallbacks[n]=a)}else this.processTask(n,r)}processTask(i,r){if(delete this.cancelCallbacks[i],"<response>"===r.type){let n=this.callbacks[i];delete this.callbacks[i],n&&(r.error?n(ao(r.error)):n(null,ao(r.data)))}else{let n=new Set,a=r.hasCallback?(r,a)=>{this.target.postMessage({id:i,type:"<response>",sourceMapId:this.mapId,error:r?aa(r):null,data:aa(a,n)},n)}:()=>{},o=ao(r.data);if(this.parent[r.type])this.parent[r.type](r.sourceMapId,o,a);else if(this.parent.getWorkerSource){let i=r.type.split("."),{source:n,scope:s}=o;this.parent.getWorkerSource(r.sourceMapId,{type:i[0],source:n,scope:s,uid:0})[i[1]](o,a)}else a(Error(`Could not find function ${r.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},r.a$=class{constructor(i,r,n,a){this.context=i,this.format=a,this.size=n,this.texture=i.gl.createTexture();const[o,s,l]=this.size,{gl:u}=i;u.bindTexture(u.TEXTURE_3D,this.texture),i.pixelStoreUnpackFlipY.set(!1),i.pixelStoreUnpack.set(1),i.pixelStoreUnpackPremultiplyAlpha.set(!1),"data"in r&&r.data&&u.texImage3D(u.TEXTURE_3D,0,this.format,o,s,l,0,ci(this.format),cr(this.format),r.data)}bind(i,r){let{context:n}=this,{gl:a}=n;a.bindTexture(a.TEXTURE_3D,this.texture),i!==this.minFilter&&(a.texParameteri(a.TEXTURE_3D,a.TEXTURE_MAG_FILTER,i),a.texParameteri(a.TEXTURE_3D,a.TEXTURE_MIN_FILTER,i),this.minFilter=i),r!==this.wrapS&&(a.texParameteri(a.TEXTURE_3D,a.TEXTURE_WRAP_S,r),a.texParameteri(a.TEXTURE_3D,a.TEXTURE_WRAP_T,r),this.wrapS=r)}destroy(){let{gl:i}=this.context;i.deleteTexture(this.texture),this.texture=null}},r.a0=cu,r.a1=iy,r.a2=co,r.a3=mh,r.a4=iQ,r.a5=class{static calculate(i,r,n){let a=new Set,o=new Map,s=new Set,l=new Set;for(let n of Object.values(i))for(let[i,u]of Object.entries(n.floors)){s.add(i),u.isDefault&&l.add(i),u.conflicts&&o.set(i,u.conflicts);let n=i===r,c=u.connections&&r&&u.connections.has(r);(n||c)&&a.add(i)}let u=i=>{let r=o.get(i)||new Set;for(let n of a)if((o.get(n)||new Set).has(i)||r.has(n))return!0;return!1};if(n)for(let i of n)s.has(i)&&(u(i)||a.add(i));for(let i of l)a.has(i)||u(i)||a.add(i);return a}},r.a6=gN,r.a7=mF,r.a8=pn,r.a9=l5,r.aA=mf,r.aB=cK,r.aC=mY,r.aD=dW-1,r.aE=dW,r.aF=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new eQ(1/0,1/0),max:new eQ(-1/0,-1/0)}}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(i,r=!1){let n=dJ(new eQ(0,0),new eQ(8192,8192),i),a=[];if(r&&!dX(n,this._globalClipBounds))return a;for(let r of this._activeRegions){if(r.hiddenByOverlap||!dX(n,r))continue;let o=function(i,r,n){let a=1<<n.canonical.z,o=((r.x-n.wrap)*a-n.canonical.x)*8192,s=(r.y*a-n.canonical.y)*8192;return{min:new eQ(((i.x-n.wrap)*a-n.canonical.x)*8192,(i.y*a-n.canonical.y)*8192),max:new eQ(o,s)}}(r.min,r.max,i);a.push({min:o.min,max:o.max,sourceId:this._sourceIds[r.priority],footprint:r.footprint,footprintTileId:r.tileId,order:r.order,clipMask:r.clipMask,clipScope:r.clipScope})}return a}setSources(i){this._setSources(i.map(i=>({getSourceId:()=>i.cache.id,getFootprints:()=>{let r=[];for(let n of i.cache.getVisibleCoordinates()){let a=i.cache.getTile(n).buckets[i.layer];a&&a.updateFootprints(n.toUnwrapped(),r)}return r},getOrder:()=>i.order,getClipMask:()=>i.clipMask,getClipScope:()=>i.clipScope})))}_addSource(i){let r=i.getFootprints();if(0===r.length)return;let n=i.getOrder(),a=i.getClipMask(),o=i.getClipScope();for(let i of r){if(!i.footprint)continue;let r=dJ(i.footprint.min,i.footprint.max,i.id);this._activeRegions.push({min:r.min,max:r.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:i.id,footprint:i.footprint,order:n,clipMask:a,clipScope:
8o})}this._sourceIds.push(i.getSourceId())}_computeReplacement(){this._activeRegions.sort((i,r)=>{var n,a;let o;return i.priority-r.priority||dZ(i.min,r.min)||dZ(i.max,r.max)||i.order-r.order||i.clipMask-r.clipMask||(n=i.clipScope,a=r.clipScope,o=(i,r)=>i+r,n.length-a.length||n.reduce(o,"").localeCompare(a.reduce(o,"")))});let i=this._activeRegions.length!==this._prevRegions.length;if(!i){let r=0;for(;!i&&r!==this._activeRegions.length;){let n=this._activeRegions[r],a=this._prevRegions[r];i=n.priority!==a.priority||!dK(n,a)||n.order!==a.order||n.clipMask!==a.clipMask||!eJ(n.clipScope,a.clipScope),this._activeRegions[r].hiddenByOverlap=a.hiddenByOverlap,++r}}if(i){for(let i of(++this._updateTime,this._activeRegions))i.order!==dW&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,i.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,i.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,i.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,i.max.y));let i=i=>{let r=this._activeRegions;if(i>=r.length)return i;let n=r[i].priority;for(;i<r.length&&r[i].priority===n;)++i;return i};if(this._sourceIds.length>1){let r=0,n=i(0);for(;r!==n;){let a=r,o=r;for(;a!==n;){let i=this._activeRegions[a];i.hiddenByOverlap=!1;for(let r=0;r<o;r++){let n=this._activeRegions[r];if(!n.hiddenByOverlap&&i.order===dW&&dX(i,n)&&(i.hiddenByOverlap=function i(r,n,a,o){if(!r||!a)return!1;let s=r.vertices;if(!n.canonical.equals(o.canonical)||n.wrap!==o.wrap){if(a.vertices.length<r.vertices.length)return i(a,o,r,n);let l=n.canonical,u=o.canonical,c=Math.pow(2,u.z-l.z);s=r.vertices.map(i=>new eQ((i.x+8192*l.x)*c-8192*u.x,(i.y+8192*l.y)*c-8192*u.y))}return d1(a,s,r.indices,0,r.indices.length,0,0)}(i.footprint,i.tileId,n.footprint,n.tileId),i.hiddenByOverlap))break}++a}n=i(r=n)}}}}_setSources(i){[this._prevRegions,this._activeRegions]=[this._activeRegions,[]],this._sourceIds=[];for(let r=i.length-1;r>=0;r--)this._addSource(i[r]);this._computeReplacement()}},r.aG=iJ,r.aH=ie,r.aI=2,r.aJ=s1,r.aK=sI,r.aL=sD,r.aM=sL,r.aN=sx,r.aO=sR,r.aP=si,r.aQ=se,r.aR=s_,r.aS=su,r.aT=sw,r.aU=sA,r.aV=sC,r.aW=sk,r.aX=hi,r.aY=/^(.*)-transition$/,r.aZ=class extends mL{constructor(i,r){super(i._vectorTileFeature,i._z,i._x,i._y,i.id),i.state&&(this.state=Object.assign({},i.state)),this.target=r.target,this.namespace=r.namespace,r.properties&&(this.properties=r.properties),this.target&&("featuresetId"in this.target&&!this.target.importId||"layerId"in this.target)&&(this.source=i.source,this.sourceLayer=i.sourceLayer,this.layer=i.layer)}toJSON(){let i=super.toJSON();return i.target=this.target,i.namespace=this.namespace,i}},r.a_=cn,r.aa=l7,r.ab=oq,r.ac=o$,r.ad=cy,r.ae=85.051129,r.af=gy,r.ag=oJ,r.ah=fP,r.ai=mP,r.aj=fM,r.ak=3,r.al=2,r.am=0,r.an=1,r.ao=24,r.ap=dS,r.aq=2,r.ar=l4,r.as=uS,r.at=class{constructor(i=new Uint8Array(16)){this.buf=ArrayBuffer.isView(i)?i:new Uint8Array(i),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.length=this.buf.length}writeTag(i,r){this.writeVarint(i<<3|r)}realloc(i){let r=this.length||16;for(;r<this.pos+i;)r*=2;if(r!==this.length){let i=new Uint8Array(r);i.set(this.buf),this.buf=i,this.dataView=new DataView(i.buffer),this.length=r}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(i){this.realloc(4),this.dataView.setInt32(this.pos,i,!0),this.pos+=4}writeSFixed32(i){this.realloc(4),this.dataView.setInt32(this.pos,i,!0),this.pos+=4}writeFixed64(i){this.realloc(8),this.dataView.setInt32(this.pos,-1&i,!0),this.dataView.setInt32(this.pos+4,Math.floor(23283064365386963e-26*i),!0),this.pos+=8}writeSFixed64(i){this.realloc(8),this.dataView.setInt32(this.pos,-1&i,!0),this.dataView.setInt32(this.pos+4,Math.floor(23283064365386963e-26*i),!0),this.pos+=8}writeVarint(i){(i=+i||0)>=0&&i<128?(this.pos>=this.length&&this.realloc(1),this.buf[this.pos++]=i):i>0xfffffff||i<0?function(i,r){var n,a;let o,s,l;if(i>=0?(o=i%0x100000000|0,s=i/0x100000000|0):(o=~(-i%0x100000000),s=~(-i/0x100000000),0xffffffff^o?o=o+1|0:(o=0,s=s+1|0)),i>=0xffffffffffffffff||i<-0xffffffffffffffff)throw Error("Given varint doesn't fit into 10 bytes");r.realloc(10),n=o,r.buf[r.pos++]=127&n|128,n>>>=7,r.buf[r.pos++]=127&n|128,n>>>=7,r.buf[r.pos++]=127&n|128,n>>>=7,r.buf[r.pos++]=127&n|128,r.buf[r.pos]=127&(n>>>=7),l=(7&(a=s))<<4,r.buf[r.pos++]|=l|128*!!(a>>>=3),a&&(r.buf[r.pos++]=127&a|128*!!(a>>>=7),a&&(r.buf[r.pos++]=127&a|128*!!(a>>>=7),a&&(r.buf[r.pos++]=127&a|128*!!(a>>>=7),a&&(r.buf[r.pos++]=127&a|128*!!(a>>>=7),a&&(r.buf[r.pos++]=127&a)))))}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|128*(i>127),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|128*(i>127),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|128*(i>127),i<=127||(this.buf[this.pos++]=i>>>7&127))))}writeSVarint(i){this.writeVarint(i<0?-(2*i)-1:2*i)}writeBoolean(i){this.writeVarint(+i)}writeString(i){i=String(i),this.realloc(4*i.length),this.pos++;let r=this.pos;this.pos=function(i,r,n){for(let a,o,s=0;s<r.length;s++){if((a=r.charCodeAt(s))>55295&&a<57344){if(!o){a>56319||s+1===r.length?(i[n++]=239,i[n++]=191,i[n++]=189):o=a;continue}if(a<56320){i[n++]=239,i[n++]=191,i[n++]=189,o=a;continue}a=o-55296<<10|a-56320|65536,o=null}else o&&(i[n++]=239,i[n++]=191,i[n++]=189,o=null);a<128?i[n++]=a:(a<2048?i[n++]=a>>6|192:(a<65536?i[n++]=a>>12|224:(i[n++]=a>>18|240,i[n++]=a>>12&63|128),i[n++]=a>>6&63|128),i[n++]=63&a|128)}return n}(this.buf,i,this.pos);let n=this.pos-r;n>=128&&uA(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n}writeFloat(i){this.realloc(4),this.dataView.setFloat32(this.pos,i,!0),this.pos+=4}writeDouble(i){this.realloc(8),this.dataView.setFloat64(this.pos,i,!0),this.pos+=8}writeBytes(i){let r=i.length;this.writeVarint(r),this.realloc(r),this.buf.set(i,this.pos),this.pos+=r}writeRawMessage(i,r){this.pos++;let n=this.pos;i(r,this);let a=this.pos-n;a>=128&&uA(n,a,this),this.pos=n-1,this.writeVarint(a),this.pos+=a}writeMessage(i,r,n){this.writeTag(i,2),this.writeRawMessage(r,n)}writePackedVarint(i,r){r.length&&this.writeMessage(i,uC,r)}writePackedSVarint(i,r){r.length&&this.writeMessage(i,uI,r)}writePackedBoolean(i,r){r.length&&this.writeMessage(i,uM,r)}writePackedFloat(i,r){r.length&&this.writeMessage(i,uk,r)}writePackedDouble(i,r){r.length&&this.writeMessage(i,uR,r)}writePackedFixed32(i,r){r.length&&this.writeMessage(i,uL,r)}writePackedSFixed32(i,r){r.length&&this.writeMessage(i,uP,r)}writePackedFixed64(i,r){r.length&&this.writeMessage(i,uO,r)}writePackedSFixed64(i,r){r.length&&this.writeMessage(i,uD,r)}writeBytesField(i,r){this.writeTag(i,2),this.writeBytes(r)}writeFixed32Field(i,r){this.writeTag(i,5),this.writeFixed32(r)}writeSFixed32Field(i,r){this.writeTag(i,5),this.writeSFixed32(r)}
8writeFixed64Field(i,r){this.writeTag(i,1),this.writeFixed64(r)}writeSFixed64Field(i,r){this.writeTag(i,1),this.writeSFixed64(r)}writeVarintField(i,r){this.writeTag(i,0),this.writeVarint(r)}writeSVarintField(i,r){this.writeTag(i,0),this.writeSVarint(r)}writeStringField(i,r){this.writeTag(i,2),this.writeString(r)}writeFloatField(i,r){this.writeTag(i,5),this.writeFloat(r)}writeDoubleField(i,r){this.writeTag(i,1),this.writeDouble(r)}writeBooleanField(i,r){this.writeVarintField(i,+r)}},r.au=eQ,r.av=class{constructor(i){this.specification=i}possiblyEvaluate(i,r){return tT(i.expression.evaluate(r))}interpolate(i,r,n){return{x:iw(i.x,r.x,n),y:iw(i.y,r.y,n),z:iw(i.z,r.z,n),azimuthal:iw(i.azimuthal,r.azimuthal,n),polar:iw(i.polar,r.polar,n)}}},r.aw=a5,r.ax=a8,r.ay=l0,r.az=mp,r.b=l1,r.b$=n7,r.b0=class{constructor(i,r,n,a,o,s){this.tileID=i,this.uid=tf(),this.uses=0,this.tileSize=r,this.tileZoom=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasTunnelGeometry=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=o,a&&a.style&&(this._lastUpdatedBrightness=a.style.getBrightness()),this._lastAvailableImagesCount=0,this._firstPrepareComplete=!1,this.expiredRequestCount=0,this.state="loading",a&&a.transform&&(this.projection=a.transform.projection),this.worldview=s,this._hasAppearances=null}registerFadeDuration(i){let r=i+this.timeAdded;r<tU.now()||void 0!==this.fadeEndTime&&r<this.fadeEndTime||(this.fadeEndTime=r)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}get tileTransform(){return this._tileTransform||(this._tileTransform=dI(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(i,r,n){if(this.unloadVectorData(),this.state="loaded",i){for(let a in i.featureIndex&&(this.latestFeatureIndex=i.featureIndex,i.rawTileData?(this.latestRawTileData=i.rawTileData,this.latestFeatureIndex.rawTileData=i.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=i.collisionBoxArray,this.buckets=mV(i.buckets,r.style),i.frcCoveragePolygons&&i.frcCoveragePolygons.length>0&&(this.frcCoveragePolygons=i.frcCoveragePolygons),this.hasDeferredRoadStructure=!!i.hasDeferredRoadStructure,this.hasSymbolBuckets=!1,this.hasTunnelGeometry=!!i.hasTunnelGeometry,this.buckets){let i=this.buckets[a];if(i instanceof hi){if(this.hasSymbolBuckets=!0,!n)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let i in this.buckets){let r=this.buckets[i];if(r instanceof hi&&r.hasRTLText){this.hasRTLText=!0,aY();break}}for(let i in this.queryPadding=0,this.buckets){let n=this.buckets[i],a=r.style.getOwnLayer(i);if(!a)continue;let o=a.queryRadius(n)||0;this.queryPadding=Math.max(this.queryPadding,o)}i.imageAtlas&&(this.imageAtlas=r.style.imageManager.imageAtlasCache.getOrCache(i.imageAtlas)),i.glyphAtlasImage&&(this.glyphAtlasImage=i.glyphAtlasImage),i.lineAtlas&&(this.lineAtlas=i.lineAtlas),this._lastUpdatedBrightness=i.brightness}else this.collisionBoxArray=new sj}unloadVectorData(){if(this.hasData()){for(let i in this.buckets)this.buckets[i].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&(this.imageAtlasTexture=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}loadModelData(i,r,n){i&&(i.resourceTiming&&(this.resourceTiming=i.resourceTiming),this.buckets=Object.assign({},this.buckets,mV(i.buckets,r.style)),i.featureIndex&&(this.latestFeatureIndex=i.featureIndex))}getBucket(i){return this.buckets[i.fqid]}upload(i,r){for(let n in this.buckets){let a=this.buckets[n];if(a.uploadPending()){let n={},o=[],s={zoom:0,pitch:0,brightness:0,worldview:""};if(r){if(r.style){o=r.style.listImages();let i=a.layers[0],s=i.sourceLayer||"_geojsonTileLayer",l=r.style.getLayerSourceCache(i);l&&(n=l._state.getState(s,void 0))}s={zoom:r.transform.zoom||0,pitch:r.transform.pitch||0,brightness:r.style.getBrightness()||0,worldview:r.worldview||""}}a.upload(i,this.tileID.canonical,n,o,s)}}let n=i.gl,a=this.imageAtlas;a&&r&&(this.imageAtlasTexture=r.style.imageManager.imageAtlasCache.getTextureForAtlas(a,i,n.RGBA8),a.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new cn(i,this.glyphAtlasImage,n.R8),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new cn(i,this.lineAtlas.image,n.R8),this.lineAtlas.uploaded=!0)}prepare(i,r,n){if(this.imageAtlas&&this.imageAtlasTexture&&r){let a=r.style.getLut(n);this.imageAtlas.patchUpdatedImages(i,this.imageAtlasTexture,n,a)}if(!r||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;let a=r.style.getBrightness(),o=r.style.listImages(),s=o.length,l=r.style._changes.getUpd
8atedPaintProperties(),u=Object.keys(this.buckets).some(i=>this.buckets[i].layers.some(i=>l.has(i.fqid))),c=Object.keys(this.buckets).some(i=>this.buckets[i].layers.some(i=>i.hasTransition&&i.hasTransition())),d=this._firstPrepareComplete&&s!==this._lastAvailableImagesCount;null===this._hasAppearances&&(this._hasAppearances=this.hasAppearances(r));let h=this._lastUpdatedBrightness!==a;this._lastAvailableImagesCount=s,this._firstPrepareComplete=!0,(this._lastUpdatedBrightness||a||this._hasAppearances||u||c||d)&&(!(this._hasAppearances||u||c||d)&&this._lastUpdatedBrightness&&a&&.001>Math.abs(this._lastUpdatedBrightness-a)||(this.updateBuckets(r,h,void 0,d||u||c,l,o),this._lastUpdatedBrightness=a))}evaluateQueryRenderedFeaturePadding(){let i=0;for(let r in this.buckets){let n=this.buckets[r];n.evaluateQueryRenderedFeaturePadding&&(i=Math.max(i,n.evaluateQueryRenderedFeaturePadding()))}return i}queryRenderedFeatures(i,r,n,a,o,s,l){var u;let c;if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData&&!this.latestFeatureIndex.is3DTile)return{};let d=this.evaluateQueryRenderedFeaturePadding(),h=(u=this.tileID,K(c=ei([],[.5*o.width,-(.5*o.height),1]),c,[1,-1,0]),Z(c,c,o.calculateProjMatrix(u.toUnwrapped())),Float32Array.from(c));return this.latestFeatureIndex.query(i,{tilespaceGeometry:r,pixelPosMatrix:h,transform:a,availableImages:n,tileTransform:this.tileTransform,worldview:this.worldview,queryRadius:d,scope:l})}querySourceFeatures(i,r){let n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;let a=n.loadVTLayers(),o=r?r.sourceLayer:"",s=a._geojsonTileLayer||a[o];if(!s)return;let l=oi(r&&r.filter),{z:u,x:c,y:d}=this.tileID.canonical,h={z:u,x:c,y:d};for(let r=0;r<s.length;r++){let a=s.feature(r);if(l.needGeometry){let i=o5(a,!0);if(!l.filter(new aZ(this.tileID.overscaledZ,{worldview:this.worldview}),i,this.tileID.canonical))continue}else if(!l.filter(new aZ(this.tileID.overscaledZ,{worldview:this.worldview}),a))continue;let f=n.getId(a,o),p=new mL(a,u,c,d,f);p.tile=h,i.push(p)}}loaded(){return"loaded"===this.state||"errored"===this.state}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return!!this.imageAtlas&&!!this.imageAtlas.patternPositions.size}setExpiryData(i){let r=this.expirationTime;if(i.cacheControl){let r=tS(i.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else i.expires&&(this.expirationTime=new Date(i.expires).getTime());if(this.expirationTime){let i=Date.now(),n=!1;if(this.expirationTime>i)n=!1;else if(r)if(this.expirationTime<r)n=!0;else{let a=this.expirationTime-r;a?this.expirationTime=i+Math.max(a,3e4):n=!0}else n=!0;n?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-Date.now(),0x7fffffff)}refreshFeatureState(i,r){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData&&!this.latestFeatureIndex.is3DTile||!i)return;let n=i.style.listImages();this.updateBuckets(i,!1,r,void 0,void 0,n)}hasAppearances(i){for(let r in this.buckets)if(i.style.hasLayer(r)&&this.buckets[r].layers.some(i=>i.appearances&&i.appearances.length>0))return!0;return!1}updateBuckets(i,r,n,a,o,s){if(!this.latestFeatureIndex||!i.style)return;let l=s||i.style.listImages(),u=i.style.getBrightness(),c=o||new Set;for(let o in this.buckets){if(!i.style.hasLayer(o))continue;let s=this.buckets[o],d=s.layers[0],h=d.sourceLayer||"_geojsonTileLayer",f=i.style.getLayerSourceCache(d),p=s.layers.some(i=>c.has(i.fqid)),m=(a||p)&&s instanceof hi?i.style.getOwnLayer(o):void 0,g=n&&n[h]||{};f&&!n&&(g=f._state.getState(h,void 0));let _=this.imageAtlas?Object.fromEntries(this.imageAtlas.patternPositions):{},y=Object.keys(g).length>0&&!r;s.hasAppearances=s.layers.some(i=>i.appearances&&i.appearances.length>0);let v=y?s.stateDependentLayers:s.layers;if(y&&0!==s.stateDependentLayers.length||r||p||a){let n=this.latestFeatureIndex.loadVTLayers()[h];if(s.update(g,n,l,_,v,r,u,this.tileID.canonical),(a||p)&&(!r||r&&s instanceof hi&&(!s.text.uboBinder||s.text.uboBinder.isLightConstant||!s.icon.uboBinder||s.icon.uboBinder.isLightConstant))&&s instanceof hi&&m&&"symbol"===m.type&&(s.text&&s.text.uboBinder&&s.text.uboBinder.updateDynamicExpressions(m,n,this.tileID.canonical,l,g,u),s.icon&&s.icon.uboBinder&&s.icon.uboBinder.updateDynamicExpressions(m,n,this.tileID.canonical,l,g,u)),s instanceof hi){let r=i.context;s.text&&s.text.uboBinder&&s.text.uboBinder.upload(r),s.icon&&s.icon.uboBinder&&s.icon.uboBinder.upload(r)}}if(y&&0!==s.stateDependentLayers.length||r||s.hasAppearances){let r={zoom:i.transform.zoom,pitch:i.transform.pitch,brightness:i.style.getBrightness()||0,worldview:i.worldview},n=s.updateAppearances(this.tileID.canonical,g,l,r,i.imageManager,y&&0!==s.stateDependentLayers.length);if(n&&n.hasUboChanges){let r=i.context;s instanceof hi&&s.text&&s.text.uboBinder&&s.text.uboBinder.upload(r),s instanceof hi&&s.icon&&s.icon.uboBinder&&s.icon.uboBinder.upload(r)}}(s instanceof l7||s instanceof lw)&&i._terrain&&i._terrain.enabled&&f&&s.uploadPending()&&i._terrain._clearRenderCacheForTile(f.i
8d,this.tileID);let x=i&&i.style&&i.style.getOwnLayer(o);x&&(this.queryPadding=Math.max(this.queryPadding,x.queryRadius(s)||0))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<tU.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(i){this.symbolFadeHoldUntil=tU.now()+i}setTexture(i,r){let n=r.context,a=n.gl;this.texture=this.texture||r.getTileTexture(i.width),this.texture&&this.texture instanceof cn?this.texture.update(i):(this.texture=new cn(n,i,a.RGBA8,{useMipmap:!0}),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE))}setDependencies(i,r){let n={};for(let i of r)n[i]=!0;this.dependencies[i]=n}hasDependency(i,r){for(let n of i){let i=this.dependencies[n];if(i){for(let n of r)if(i[n])return!0}}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(i,r){if(!r||"mercator"===r.name||this._tileDebugBuffer)return;let n=o2(mZ,this.tileID.canonical,this.tileTransform)[0],a=new se,o=new sL;for(let i=0;i<n.length;i++){let{x:r,y:s}=n[i];a.emplaceBack(r,s),o.emplaceBack(i)}o.emplaceBack(0),this._tileDebugIndexBuffer=i.createIndexBuffer(o),this._tileDebugBuffer=i.createVertexBuffer(a,cY.members),this._tileDebugSegments=s1.simpleSegment(0,0,a.length,o.length)}_makeTileBoundsBuffers(i,r){let n,a;if(this._tileBoundsBuffer||!r||"mercator"===r.name)return;let o=o2(mZ,this.tileID.canonical,this.tileTransform)[0];if(this.isRaster){let i=function(i,r){let n=dI(i,r),a=Math.pow(2,i.z);for(let o=0;o<33;o++)for(let s=0;s<33;s++){let l=rp((i.x+(s+mW(s))/32)/a),u=rm((i.y+(o+mW(o))/32)/a),c=r.project(l,u),d=33*o+s;mG[2*d+0]=Math.round((c.x*n.scale-n.x)*8192),mG[2*d+1]=Math.round((c.y*n.scale-n.y)*8192)}mq.fill(0),m$.fill(0);for(let i=2045;i>=0;i--){let r=4*i,n=mH[r+0],a=mH[r+1],o=mH[r+2],s=mH[r+3],l=n+o>>1,u=a+s>>1,c=l+u-a,d=u+n-l,h=33*a+n,f=33*s+o,p=33*u+l,m=Math.hypot((mG[2*h+0]+mG[2*f+0])/2-mG[2*p+0],(mG[2*h+1]+mG[2*f+1])/2-mG[2*p+1])>=16;mq[p]=mq[p]||+!!m,i<1022&&(mq[p]=mq[p]||mq[(a+d>>1)*33+(n+c>>1)]||mq[(s+d>>1)*33+(o+c>>1)])}let o=new si,s=new sw,l=0;function u(i,r){let n=33*r+i;return 0===m$[n]&&(o.emplaceBack(mG[2*n+0],mG[2*n+1],8192*i/32,8192*r/32),m$[n]=++l),m$[n]-1}function c(i,r,n,a,o,l){let d=i+n>>1,h=r+a>>1;if(Math.abs(i-o)+Math.abs(r-l)>1&&mq[33*h+d])c(o,l,i,r,d,h),c(n,a,o,l,d,h);else{let c=u(i,r),d=u(n,a),h=u(o,l);s.emplaceBack(c,d,h)}}return c(0,0,32,32,32,0),c(32,32,0,0,0,32),{vertices:o,indices:s}}(this.tileID.canonical,r);n=i.vertices,a=i.indices}else{for(let{x:i,y:r}of(n=new si,a=new sw,o))n.emplaceBack(i,r,0,0);let i=ov(n.int16.subarray(0,4*n.length),void 0,4);for(let r=0;r<i.length;r+=3)a.emplaceBack(i[r],i[r+1],i[r+2])}this._tileBoundsBuffer=i.createVertexBuffer(n,ml.members),this._tileBoundsIndexBuffer=i.createIndexBuffer(a),this._tileBoundsSegments=s1.simpleSegment(0,0,n.length,a.length)}_makeGlobeTileDebugBuffers(i,r){let n,a=r.projection;if(!a||"globe"!==a.name||r.freezeTileCoverage)return;let o=this.tileID.canonical,s=dd(di(o,r)),l=dg(r.zoom);l>0&&(n=Y(new Float64Array(16),r.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(i,o,r,s,n,l),this._makeGlobeTileDebugTextBuffer(i,o,r,s,n,l)}_globePoint(i,r,n,a,o,s,l){let u=dl(i,r,n);if(s){let o=1<<n.z,c=rh(a.center.lng),d=rf(a.center.lat),h=(n.x+.5)/o-c,f=0;h>.5?f=-1:h<-.5&&(f=1);let p=(i/8192+n.x)/o+f,m=(r/8192+n.y)/o;p=(p-c)*a._pixelsPerMercatorPixel+c,m=(m-d)*a._pixelsPerMercatorPixel+d;let g=[p*a.worldSize,m*a.worldSize,0];eA(g,g,s),u=dt(u,g,l)}return eA(u,u,o)}_makeGlobeTileDebugBorderBuffer(i,r,n,a,o,s){let l=new se,u=new sL,c=new st,d=(i,d,h,f,p)=>{let m=(h-i)/(p-1),g=(f-d)/(p-1),_=l.length;for(let h=0;h<p;h++){let f=i+h*m,p=d+h*g;l.emplaceBack(f,p);let y=this._globePoint(f,p,r,n,a,o,s);c.emplaceBack(y[0],y[1],y[2]),u.emplaceBack(_+h)}};d(0,0,8192,0,16),d(8192,0,8192,8192,16),d(8192,8192,0,8192,16),d(0,8192,0,0,16),this._tileDebugIndexBuffer=i.createIndexBuffer(u),this._tileDebugBuffer=i.createVertexBuffer(l,cY.members),this._globeTileDebugBorderBuffer=i.createVertexBuffer(c,cW.members),this._tileDebugSegments=s1.simpleSegment(0,0,l.length,u.length)}_makeGlobeTileDebugTextBuffer(i,r,n,a,o,s){let l=new se,u=new sw,c=new st;u.reserve(32),l.reserve(25),c.reserve(25);let d=(i,r)=>25*i+r;for(let i=0;i<25;i++){let u=2048*i;for(let i=0;i<25;i++){let d=2048*i;l.emplaceBack(d,u);let h=this._globePoint(d,u,r,n,a,o,s);c.emplaceBack(h[0],h[1],h[2])}}for(let i=0;i<4;i++)for(let r=0;r<4;r++){let n=d(i,r),a=d(i,r+1),o=d(i+1,r),s=d(i+1,r+1);u.emplaceBack(n,a,o),u.emplaceBack(o,a,s)}this._tileDebugTextIndexBuffer=i.createIndexBuffer(u),this._tileDebugTextBuffer=i.createVertexBuffer(l,cY.members),this._globeTileDebugTextBuffer=i.createVertexBuffer(c,cW.members),this._tileDebugTextSegments=s1.simpleSegment(0,0,25,32)}destroy(i=!0){for(let r in this.buckets)this.buckets[r].destroy(i);this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&delete this.imageAtlasTexture,this.glyphAtlasTexture&&(this.glyphAtlasTexture.destroy(),delete this.glyphAtlasTexture),this.lineAtlasTexture&&(this.lineAtlasTexture.destroy(),delete this.lineAtlasTexture),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),i&&this.texture&&this.texture instanceof cn&&(this.texture.destroy(),delete this.texture),this.emissiveTexture&&this.emissiveTexture instanceof cn&&(this.emissiveTexture.destroy(),delete this.emissiveTexture),this.hillshadeFBO&&(this.hillshadeFBO.destroy(),delete this.hillshadeFBO),this.dem&&delete this.dem,this.neighboringTiles&&delete this.neighboringTiles,this.demTexture&&(this.demTexture.destroy(),delete this.demTexture),this.rasterParticleState&&(this.rasterParticleState.destroy(),delete this.rasterParticleState),this.latestFeatureIndex=null,this.state="unloaded"}},r.b1=mC,r.b2=aQ,r.b3=/^(.*)-use-theme$/,r.b4=le,r.b5=s7,r.b6=lt,r.b7=li,r.b8=ln,r.b9=la,r.bA=fL,r.bB=function(i,r,n){let a=Math.sqrt(i*i+r*r+n*n),o=a>0?Math.acos(n/a)*te:0,s=0!==i||0!==r?Math.atan2(-r,-i)*te+90:0;return s<0&&(s+=360),[a,s,o]},r.bC=pZ,r.bD=(i,r,n,a,o,s)=>{let l,u=i.transform,c="globe"===u.projection.name;if("map"===s.paint.get("circle-pitch-alignment"))if(c){let i=dp(u.zoom,r.canonical)*u._pixelsPerMercatorPixel;l=Float32Array.from([i,0,0,i])}else l=u.calculatePixelsToTileUnitsMatrix(n);else l=new Float32Array([u.pixelsToGLUnits[0],0,0,u.pixelsToGLUnits[1]]);let d={u_camera_to_center_distance:i.transform.getCameraToCenterDistance(u.projection),u_matrix:i.translatePosMatrix(r.projMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_device_pixel_ratio:tU.devicePixelRatio,u_extrude_scale:l,u_inv_rot_matrix:pY,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:s.paint.get("circle-emissive-strength")};if(c){d.u_inv_rot_matrix=a,d.u_merc_center=o,d.u_tile_id=[r.canonical.x,r.canonical.y,1<<r.canonical.z],d.u_zoom_transition=dg(u.zoom);let i=8192*o[0],n=8192*o[1];d.u_up_dir=u.projection.upVector(new dT(0,0,0),i,n)}return d},r.bE=i=>({u_camera_to_center_distance:new le(i),u_extrude_scale:new ls(i),u_device_pixel_ratio:new le(i),u_matrix:new lo(i),u_inv_rot_matrix:new lo(i),u_merc_center:new lt(i),u_tile_id:new li(i),u_zoom_transition:new le(i),u_up_dir:new li(i),u_emissive_strength:new le(i)}),r.bF=oW,r.bG=ts,r.bH=function(i){let r=t1();if(!r)return;let n=r.delete(tK);i&&n.then(()=>i()).catch(i)},r.bI=lZ,r.bJ=$,r.bK=es,r.bL=ty,r.bM=um,r.bN=tV,r.bO=function(i,r){return i[0]=-r[0],i[1]=-r[1],i[2]=-r[2],i[3]=r[3],i},r.bP=tN,r.bQ=fY,r.bR=fk,r.bS=function(i,r){return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],i},r.bT=q,r.bU=eo,r.bV=V,r.bW=eD,r.bX=eM,r.bY=n3,r.bZ=oi,r.b_=o6,r.ba=class extends s6{constructor(i){super(i),this.current=ne
8w Float32Array(9)}set(i,r,n){if(!this.fetchUniformLocation(i,r))return;let a=this.current;for(let i=0;i<9;i++)if(n[i]!==a[i]){a.set(n),this.gl.uniformMatrix3fv(this.location,!1,a);break}}},r.bb=lo,r.bc=dE,r.bd=ca,r.be=lL,r.bf=lR,r.bg=uF,r.bh=n6,r.bi=dn,r.bj=ed,r.bk=eq,r.bl=d7,r.bm=function(i,r){if(!i||!r)throw Error("TileProvider name and URL are required");tV.TILE_PROVIDER_URLS[i]=tU.resolveURL(r)},r.bn=oY,r.bo=iI,r.bp=tc,r.bq=function(i){return decodeURIComponent(atob(i).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join(""))},r.br=function(i){return btoa(encodeURIComponent(i).replace(/%([0-9A-F]{2})/g,(i,r)=>String.fromCharCode(Number("0x"+r))))},r.bs=tm,r.bt=ml,r.bu=function(i,r){let n=[];for(let a=0;a<i.length;a++){let o=tu(a-1,-1,i.length-1),s=tu(a+1,-1,i.length-1),l=i[a],u=i[s],c=i[o].sub(l).unit(),d=u.sub(l).unit(),h=d.angleWithSep(c.x,c.y),f=c.add(d).unit().mult(-1*r/Math.sin(h/2));n.push(l.add(f))}return n},r.bv=function(i){++t2>tQ&&(i.getActor().send("enforceCacheSizeLimit",tX),t2=0)},r.bw=function(i,r){let{x:n,y:a}=i.point,o=dm(n,a,i.worldSize/i._pixelsPerMercatorPixel,0,0);return Z(o,o,dh(de(r)))},r.bx=function(i){let{x:r,y:n}=i.point,{lng:a,lat:o}=i._center;return dm(r,n,i.worldSize,a,o)},r.by=function(i){let r=i.pixelsPerMeter,n=r/(1/oW(i.center.lat)),a=W(new Float64Array(16));return K(a,a,[i.point.x,i.point.y,0]),X(a,a,[n,n,r]),Float32Array.from(a)},r.bz=dA,r.c=ct,r.c$=d$,r.c0=function(i,r,n,a){return"custom"===i.type?new mm(i,r):new mD[i.type](i,r,n,a)},r.c1=eE,r.c2=eJ,r.c3=oe,r.c4=function(i){return i*e7},r.c5=ey,r.c6=function(i,r,n){return i[0]=r[0]/n[0],i[1]=r[1]/n[1],i[2]=r[2]/n[2],i},r.c7=eT,r.c8=ov,r.c9=6371008.8,r.cA=function(i,r){var n=Math.sin(r),a=Math.cos(r);return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=a,i[6]=n,i[7]=0,i[8]=0,i[9]=-n,i[10]=a,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},r.cB=function(i,r){var n=Math.sin(r),a=Math.cos(r);return i[0]=a,i[1]=0,i[2]=-n,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=n,i[9]=0,i[10]=a,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},r.cC=function(i){return tn[Math.round((i+45+360)%360/90)%4]},r.cD=function(i,r,n){let a=0;for(let n=0;n<2;++n)i[n]>0&&(a+=(i[n]-0)*(i[n]-0)),r[n]<0&&(a+=(0-r[n])*(0-r[n]));return a},r.cE=uq,r.cF=cB,r.cG=iu,r.cH=function(i,r){var n=2*Math.acos(r[3]),a=Math.sin(n/2);return a>1e-6?(i[0]=r[0]/a,i[1]=r[1]/a,i[2]=r[2]/a):(i[0]=1,i[1]=0,i[2]=0),n},r.cI=function(i){let r=1/0,n=1/0,a=-1/0,o=-1/0;for(let s of i)r=Math.min(r,s.x),n=Math.min(n,s.y),a=Math.max(a,s.x),o=Math.max(o,s.y);return{min:new eQ(r,n),max:new eQ(a,o)}},r.cJ=function(){return{API_URL:tV.API_URL,DRACO_URL:tV.DRACO_URL,MESHOPT_URL:tV.MESHOPT_URL,MESHOPT_SIMD_URL:tV.MESHOPT_SIMD_URL,BUILDING_GEN_URL:tV.BUILDING_GEN_URL}},r.cK=tq,r.cL=tO,r.cM=function(i,r){return is(Object.assign(i,{method:"GET"}),r)},r.cN=tH,r.cO=function(i){return i?{cacheControl:i.get("cache-control"),expires:i.get("expires")}:{cacheControl:void 0,expires:void 0}},r.cP=function(i,r,n,a){let o=r.getNorth(),s=r.getSouth(),l=r.getWest(),u=r.getEast(),c=1<<i.z,d=u-l,h=o-s,f=d/64,p=-h/oB[n],m=[0,f,0,p,0,0,o,l,0];if(i.z>0){let i=180/a;G(m,m,[i/d+1,0,0,0,i/h+1,0,-.5*i/f,.5*i/p,1])}return m[2]=c,m[5]=i.x,m[8]=i.y,m},r.cQ=ic,r.cR=cs,r.cS=function(i){let r=i.lastIndexOf("\x1f");return r>=0?i.slice(r+1):""},r.cT=il,r.cU=function(i){return Math.round(Math.pow(Math.abs(Math.sin((i=ts(i,-80.051129,80.051129)/80.051129*90)*e7)),3)*(oB.length-1))},r.cV=rz,r.cW=tG,r.cX=oK,r.cY=function(i){let r=i.indexOf("\x1f");return r>=0?i.slice(0,r):i},r.cZ=od,r.c_=function(i,r){let{scale:n}=i.tileTransform,a=8192*n/(i.tileSize*Math.pow(2,r.zoom-i.tileID.overscaledZ+i.tileID.canonical.z)),o=r.inverseAdjustmentMatrix;return new Float32Array([o[0]*a,o[1]*a,o[2]*a,o[3]*a])},r.ca=to,r.cb=ta,r.cc=function(i){return i*i*i*i*i},r.cd=function([i,r,n]){let a=Math.hypot(i,r,n);return new oq(Math.atan2(i,n)*te,(.5*Math.PI-Math.acos(-r/a))*te)},r.ce=lV,r.cf=function(i){t0(),null!=n&&n.then(r=>{r.keys().then(n=>{for(let a=0;a<n.length-i;a++)r.delete(n[a]).catch(i=>tb(i.message))}).catch(i=>tb(i.message))}).catch(i=>tb(i.message))},r.cg=function(i){return i>>>=0,(i=Math.imul((i=Math.imul((i=Math.imul(0xa3c59ac3^i,0x9e3779b9)>>>0)^i>>>16,0x9e3779b9)>>>0)^i>>>16,0x9e3779b9)>>>0)/0x100000000},r.ch=u1,r.ci=u0,r.cj=cL,r.ck=aG,r.cl=function(i,r){return i[0]===r[0]&&i[1]===r[1]&&i[2]===r[2]&&i[3]===r[3]},r.cm=eR,r.cn=t5,r.co=tU,r.cp=hX,r.cq=pR,r.cr=t_,r.cs=function(i,r){return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[4],i[4]=r[5],i[5]=r[6],i[6]=r[8],i[7]=r[9],i[8]=r[10],i},r.ct=ea,r.cu=function(i,r){var n=Math.sin(r),a=Math.cos(r);return i[0]=a,i[1]=n,i[2]=0,i[3]=-n,i[4]=a,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i},r.cv=ei,r.cw=et,r.cx=eu,r.cy=function(i,r,n,a){var o=new B(4);return o[0]=i,o[1]=r,o[2]=n,o[3]=a,o},r.cz=eG,r.d=256,r.d$=me,r.d0=function(i){let r=fx(i,!0);return U([],[r[0],r[1],r[4],r[5]])},r.d1=fx,r.d2=fw,r.d3=aq,r.d4=ir,r.d5=function(i,r){var n=new B(3);en(n,r);var a=1/n[0],o=1/n[1],s=1/n[2],l=r[0]*a,u=r[1]*o,c=r[2]*s,d=r[4]*a,h=r[5]*o,f=r[6]*s,p=r[8]*a,m=r[9]*o,g=r[10]*s,_=l+h+g,y=0;return _>0?(y=2*Math.sqrt(_+1),i[3]=.25*y,i[0]=(f-m)/y,i[1]=(p-c)/y,i[2]=(u-d)/y):l>h&&l>g?(y=2*Math.sqrt(1+l-h-g),i[3]=(f-m)/y,i[0]=.25*y,i[1]=(u+d)/y,i[2]=(p+c)/y):h>g?(y=2*Math.sqrt(1+h-l-g),i[3]=(p-c)/y,i[0]=(u+d)/y,i[1]=.25*y,i[2]=(f+m)/y):(y=2*Math.sqrt(1+g-l-h),i[3]=(u-d)/y,i[0]=(p+c)/y,i[1]=(f+m)/y,i[2]=.25*y),i},r.d6=fb,r.d7=en,r.d8=dk,r.d9=function(i,r,n=0){return eu(((r.x-n)*i.scale-i.x)*8192,(r.y*i.scale-i.y)*8192,oY(r.z,r.y))},r.dA=function(){return!!document.fullscreenElement||!!document.webkitFullscreenElement},r.dB=nX,r.dC=rQ,r.dD=ii,r.dE=dy,r.dF=function(i){return tV.API_CDN_URL_REGEX.test(i)},r.dG=function(i){return tV.API_FONTS_REGEX.test(i)},r.dH=tW,r.dI=function(i){return tV.API_STYLE_REGEX.test(i)&&!tW(i)},r.dJ=function(i){return tV.API_TILEJSON_REGEX.test(i)},r.dK=t$,r.dL=function(i){return 0===i.indexOf("mapbox:")},r.dM=rr,r.dN=rt,r.dO=function(i){let r=i.navigator?i.navigator.userAgent:null;return!!function(i){if(null==tP){let r=i.navigator?i.navigator.userAgent:null;tP=!!i.safari||!(!r||!(ti.test(r)||r.match("Safari")&&!r.match("Chrome")))}return tP}(i)&&!(!r||!(r.match("Version/15.4")||r.match("Version/15.5")||r.match(tr)))},r.dP=rX,r.dQ=ri,r.dR=tE,r.dS=function(i,r){let n=[];for(let a in i)a in r||n.push(a);return n},r.dT=rm,r.dU=oH,r.dV=el,r.dW=el,r.dX=function(i){var r=i[0],n=i[1],a=i[2],o=i[3];return Math.sqrt(r*r+n*n+a*a+o*o)},r.dY=iw,r.dZ=eS,r.d_=function(i,r,n,a){var o=r[0],s=r[1],l=r[2],u=r[3];return i[0]=o+a*(n[0]-o),i[1]=s+a*(n[1]-s),i[2]=l+a*(n[2]-l),i[3]=u+a*(n[3]-u),i},r.da=re,r.db=function(i,r){let n=document.createElement("video");n.muted=!0,n.onloadstart=function(){r(null,n)};for(let r=0;r<i.length;r++){let a=document.createElement("source");(function(i){let r=document.createElement("a");return r.href=i,r.protocol===location.protocol&&r.host===location.host})(i[r])||(n.crossOrigin="Anonymous"),a.src=i[r],n.appendChild(a)}return{cancel:()=>{}}}
8,r.dc=fE,r.dd=function(i){let r=[0,0,0],n=W(new Float64Array(16));return Z(n,i.pixelMatrix,i.globeMatrix),eA(r,r,n),new eQ(r[0],r[1])},r.de=dh,r.df=function(i,r){let n=[0,0,0];return eA(n,n,dd(de(r.canonical))),eA(n,n,i),n},r.dg=c9,r.dh=dd,r.di=dp,r.dj=function(i,r,n){let a=W(new Float64Array(16)),o=(r/(1<<i)-.5)*Math.PI*2;return J(a,n.globeMatrix,o),Float32Array.from(a)},r.dk=de,r.dl=d_,r.dm=dg,r.dn=function(i,r,n){let a=dg(n.zoom),o=i.style.map._antialias,s=i.terrain&&i.terrain.exaggeration()>0;return 0===a&&!o&&!s},r.dp=eF,r.dq=W,r.dr=Y,r.ds=U,r.dt=function(i,r){var n=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=r[6],d=r[7],h=r[8],f=h*l-u*d,p=-h*s+u*c,m=d*s-l*c,g=n*f+a*p+o*m;return g?(i[0]=f*(g=1/g),i[1]=(-h*a+o*d)*g,i[2]=(u*a-o*l)*g,i[3]=p*g,i[4]=(h*n-o*c)*g,i[5]=(-u*n+o*s)*g,i[6]=m*g,i[7]=(-d*n+a*c)*g,i[8]=(l*n-a*s)*g,i):null},r.du=rn,r.dv=n9,r.dw=ot,r.dx=function(i){return i.includes("\x1f")},r.dy=rK,r.dz=function(i,r){let n=hX(i);return null!==n&&!!(r&1<<n)},r.e=1024,r.e$=p1,r.e0=(i,r,n,a,o,s,l,u,c,d)=>{let h=i.transform,f=h.pitch<15?iw(.07,.7,ts((14-h.zoom)/5,0,1)):.07,p="none"===n.paint.get("line-trim-color-use-theme").constantOr("default");return{u_matrix:p7(i,r,n,a),u_texsize:r.imageAtlasTexture?r.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:h.calculatePixelsToTileUnitsMatrix(r),u_device_pixel_ratio:o,u_width_scale:s,u_floor_width_scale:l,u_image:0,u_tile_units_to_pixels:p6(r,h),u_units_to_pixels:[1/h.pixelsToGLUnits[0],1/h.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:u,u_trim_fade_range:n.paint.get("line-trim-fade-range"),u_trim_gradient_mix_range:[1,1],u_trim_color:n.paint.get("line-trim-color").toPremultipliedRenderColor(p?null:n.lut).toArray01(),u_zbias_factor:f,u_tile_to_meter:oQ(r.tileID.canonical,0),u_ground_shadow_factor:c,u_pattern_transition:d,u_opacity_multiplier:1}},r.e1=i=>({u_matrix:new lo(i),u_texsize:new lt(i),u_pixels_to_tile_units:new ls(i),u_device_pixel_ratio:new le(i),u_width_scale:new le(i),u_floor_width_scale:new le(i),u_image:new s7(i),u_units_to_pixels:new lt(i),u_tile_units_to_pixels:new le(i),u_alpha_discard_threshold:new le(i),u_trim_offset:new lt(i),u_trim_fade_range:new lt(i),u_trim_gradient_mix_range:new lt(i),u_trim_color:new ln(i),u_zbias_factor:new le(i),u_tile_to_meter:new le(i),u_ground_shadow_factor:new li(i),u_pattern_transition:new le(i),u_opacity_multiplier:new le(i)}),r.e2=(i,r,n,a,o,s,l,u,c,d)=>{let h=i.transform,f=h.calculatePixelsToTileUnitsMatrix(r),p="none"===n.paint.get("line-trim-color-use-theme").constantOr("default"),m=h.pitch<15?iw(.07,.7,ts((14-h.zoom)/5,0,1)):.07;return{u_matrix:p7(i,r,n,a),u_pixels_to_tile_units:f,u_device_pixel_ratio:s,u_width_scale:l,u_floor_width_scale:u,u_units_to_pixels:[1/h.pixelsToGLUnits[0],1/h.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:o,u_texsize:mt(n)&&r.lineAtlasTexture?r.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:p6(r,i.transform),u_alpha_discard_threshold:0,u_trim_offset:c,u_trim_fade_range:n.paint.get("line-trim-fade-range"),u_trim_gradient_mix_range:[1,1],u_trim_color:n.paint.get("line-trim-color").toPremultipliedRenderColor(p?null:n.lut).toArray01(),u_zbias_factor:m,u_tile_to_meter:oQ(r.tileID.canonical,0),u_ground_shadow_factor:d,u_opacity_multiplier:1}},r.e3=i=>({u_matrix:new lo(i),u_pixels_to_tile_units:new ls(i),u_device_pixel_ratio:new le(i),u_width_scale:new le(i),u_floor_width_scale:new le(i),u_units_to_pixels:new lt(i),u_dash_image:new s7(i),u_gradient_image:new s7(i),u_image_height:new le(i),u_texsize:new lt(i),u_tile_units_to_pixels:new le(i),u_alpha_discard_threshold:new le(i),u_trim_offset:new lt(i),u_trim_fade_range:new lt(i),u_trim_gradient_mix_range:new lt(i),u_trim_color:new ln(i),u_zbias_factor:new le(i),u_tile_to_meter:new le(i),u_ground_shadow_factor:new li(i),u_opacity_multiplier:new le(i)}),r.e4=function(i){return[Math.pow(i[0],1/2.2),Math.pow(i[1],1/2.2),Math.pow(i[2],1/2.2)]},r.e5=function(i){let r=0;if(0x46546c67!==new Uint32Array(i,0,1)[0]){let n=new Uint32Array(i,0,7),[,,a,o,s,l]=n;r=n.byteLength+o+s+l+s,(a!==i.byteLength||r>=i.byteLength)&&tb("Invalid b3dm header information.")}return fu(i,r)},r.e6=fc,r.e7=function(i,r,n,a,o){let s=function(n,a){if(n)return o(n);if(a){i.url&&a.tiles&&i.tiles&&delete i.tiles;let n=gb(i,a,r);if(n instanceof Error)return o(n);o(null,n)}},l=function(i,r,n){if(!i)return null;if(!r&&!n)return i;n=n||i.worldview_default;let a=Object.values(i.language||{});if(0===a.length)return null;let o=Object.values(i.worldview||{});if(0===o.length)return null;let s=a.every(i=>i===r),l=o.every(i=>i===n);return s&&l?i:r in(i.language_options||{})||n in(i.worldview_options||{})?null:i.language_options&&i.worldview_options?i:null}(i.data,n,a);return l?tU.frame(()=>s(null,l)):i.url?il(r.transformRequest(r.normalizeSourceURL(i.url,null,n,a),ie.Source),s):tU.frame(()=>{let{data:r,...n}=i;s(null,n)})},r.e8=async function(i,r){let n=gT.get(i);if(n)return n;let a=gw.get(i);if(void 0!==a)return a;let o=import(r).catch(r=>{throw Error(`TileProvider "${i}" failed to load: ${r instanceof Error?r.message:String(r)}`)}).then(r=>{let n=r.default;if("function"!=typeof n)throw Error(`TileProvider "${i}" module must default-export a class`);if("function"!=typeof n.prototype.loadTile)throw Error(`TileProvider "${i}" class must have a loadTile method`);return gT.set(i,n),n}).finally(()=>{gw.delete(i)});return gw.set(i,o),o},r.e9=function(i,r,n){let a=JSON.stringify(i.request);return i.data&&(this.deduped.entries[a]={result:[null,i.data]}),this.deduped.request(a,{type:"parseTile",renderSourceType:i.renderSourceType,zoom:i.tileZoom},r=>{let a=iu(i.request,(i,a,o)=>{i?ii(i)?r(null,null):r(i):a&&r(null,{rawData:a,vectorTile:n?void 0:new lL(new uS(a)),responseHeaders:new Map(o.entries())})});return()=>{a.cancel(),r(null,null)}},r)},r.eA=tB,r.eB=function(i,r,n,a,o,s,l){var u=1/(r-n),c=1/(a-o),d=1/(s-l);return i[0]=-2*u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*c,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*d,i[11]=0,i[12]=(r+n)*u,i[13]=(o+a)*c,i[14]=(l+s)*d,i[15]=1,i},r.eC=function(i,r){let n=i.url&&!i.tiles?r.transformRequest(i.url,ie.Source):void 0;return{request:n,options:n?Object.assign({},i,{url:n.url}):i}},r.eD=function(i,r,n,a,o,s,l,u=1,c,d,h,f,p,m,g,_,y){i.createArrays(),i.tilePixelRatio=8192/(512*i.overscaling),i.compareText={},i.iconsNeedLinear=!1;let v=i.layers[0].layout,x=i.layers[0]._unevaluatedLayout._values,b={};b.scaleFactor=u,b.textSizeScaleRange=v.get("text-size-scale-range"),b.iconSizeScaleRange=v.get("icon-size-scale-range");let[w,T]=b.textSizeScaleRange,[E,S]=b.iconSizeScaleRange;b.textScaleFactor=ts(b.scaleFactor,w,T),b.iconScaleFactor=ts(b.scaleFactor,E,S);let A=x["text-size"],C=x["icon-size"];
8if("composite"===i.textSizeData.kind){let{minZoom:r,maxZoom:n}=i.textSizeData;b.compositeTextSizes=[A.possiblyEvaluate(new aZ(r,{worldview:h}),s),A.possiblyEvaluate(new aZ(n,{worldview:h}),s)]}if("composite"===i.iconSizeData.kind){let{minZoom:r,maxZoom:n}=i.iconSizeData;b.compositeIconSizes=[C.possiblyEvaluate(new aZ(r,{worldview:h}),s,f),C.possiblyEvaluate(new aZ(n,{worldview:h}),s,f)]}b.layoutTextSize=A.possiblyEvaluate(new aZ(l+1,{worldview:h}),s),b.layoutIconSize=C.possiblyEvaluate(new aZ(l+1,{worldview:h}),s,f),b.textMaxSize=A.possiblyEvaluate(new aZ(18,{worldview:h}),s);let I=v.get("symbol-placement"),k="map"===v.get("text-rotation-alignment")&&"point"!==I,R=v.get("text-size"),M=!1,L=[],P=null!=p&&0!==p;for(let l of i.features){if(P&&l.properties&&_&&_(l.properties,p))continue;let u=v.get("text-font").evaluate(l,{},s).join(","),m=R.evaluate(l,{},s)*b.textScaleFactor,g=b.layoutTextSize.evaluate(l,{},s)*b.textScaleFactor,y=b.layoutIconSize.evaluate(l,{},s,f)*b.iconScaleFactor,w={horizontal:{},vertical:void 0},T=l.text,E,S=[0,0];if(T){let a=T.toString(),d=24*v.get("text-letter-spacing").evaluate(l,{},s),h=24*v.get("text-line-height").evaluate(l,{},s),f=!function(i){for(let n of i){var r;if(as(r=n.charCodeAt(0))||al(r)||au(r)||aI(r)||aL(r))return!1}return!0}(a)?0:d,p=v.get("text-anchor").evaluate(l,{},s),_=v.get("text-variable-anchor");if(!_){let i=v.get("text-radial-offset").evaluate(l,{},s);if(i)S=cL(p,[24*i,ck]);else{let i=v.get("text-offset").evaluate(l,{},s);S=[24*i[0],24*i[1]]}}let y=k?"center":v.get("text-justify").evaluate(l,{},s),x="point"===I,E=x?24*v.get("text-max-width").evaluate(l,{},s):1/0,A=s=>{i.allowVerticalPlacement&&aO(a)&&(w.vertical=uz(T,r,n,o,u,E,h,p,s,f,S,uF.vertical,!0,g,m,c,b.textScaleFactor))};if(!k&&_){let i="auto"===y?_.map(i=>cB(i)):[y],a=!1;for(let s=0;s<i.length;s++){let l=i[s];if(!w.horizontal[l])if(a)w.horizontal[l]=w.horizontal[0];else{let i=uz(T,r,n,o,u,E,h,"center",l,f,S,uF.horizontal,!1,g,m,c,b.textScaleFactor);i&&(w.horizontal[l]=i,a=1===i.positionedLines.length)}}A("left")}else{if("auto"===y&&(y=cB(p)),x||v.get("text-writing-mode").includes("horizontal")||!aO(a)){let i=uz(T,r,n,o,u,E,h,p,y,f,S,uF.horizontal,!1,g,m,c,b.textScaleFactor);i&&(w.horizontal[y]=i)}A(x?"left":y)}}let A,C,O,D,F,N,j=!1,z=v.get("icon-text-fit").evaluate(l,{},s);if(l.icon&&l.icon.hasPrimary()){let r=cN(l.icon,i.iconSizeData,x["icon-size"],s,i.zoom,l,c,b.iconScaleFactor,h,f);A=r.iconPrimary,O=r.iconSecondary;let n=A.toString();if((C=a.get(n))&&(F=v.get("icon-offset").evaluate(l,{},s),N=v.get("icon-anchor").evaluate(l,{},s),E=uY(o.get(n),O?o.get(O.toString()):void 0,F,N),j=C.sdf,void 0===i.sdfIcons?i.sdfIcons=C.sdf:i.sdfIcons!==C.sdf&&tb("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(C.pixelRatio!==i.pixelRatio||0!==v.get("icon-rotate").constantOr(1))&&(i.iconsNeedLinear=!0)),O){let i=O.toString();D=a.get(i)}}M=M||!(!l.icon||!l.icon.hasSecondary());let B=cH(w.horizontal)||w.vertical;i.iconsInText||(i.iconsInText=!!B&&B.iconsInText);let{defaultShapedIcon:U,verticallyShapedIcon:V}=function(i,r,n,a,o,s,l,u,c){let d=cH(s.horizontal)||s.vertical,h=n.get("icon-text-fit-padding").evaluate(a,{},o),f,p=r;return r&&"none"!==c&&(i.allowVerticalPlacement&&s.vertical&&(f=uZ(r,s.vertical,c,h,u,l)),d&&(p=uZ(r,d,c,h,u,l))),{defaultShapedIcon:p,verticallyShapedIcon:f}}(i,E,v,l,s,w,g*b.textScaleFactor/24,F,z);"none"!==z&&E&&(uK(E)||uX(E))&&(cD(0,C,A,E,U,z,d,a,o),cD(0,D,O,E,U,z,d,a,o),V&&(cD(0,C,A,E,V,z,d,a,o),cD(0,D,O,E,V,z,d,a,o)));let{iconBBox:H,iconVerticalBBox:G,textBBox:q,textVerticalBBox:$}=function(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g){let _=i.layers[0],y=_.appearances;if(0===y.length)return{iconBBox:null,iconVerticalBBox:null,textBBox:null,textVerticalBBox:null};let v={iconBBox:null,iconVerticalBBox:null},x={textBBox:null,textVerticalBBox:null},{baseIconRotate:b,baseTextRotate:w,iconScaleFactor:T}=function(i,r,n){let a=i.get("icon-rotate").evaluate(r,{},n),o=i.get("text-rotate").evaluate(r,{},n),[s,l]=i.get("icon-size-scale-range");return{baseIconRotate:a,baseTextRotate:o,iconScaleFactor:ts(1,s,l)}}(a,o,s);r&&(v.iconBBox=cM(r,v.iconBBox,b),n)&&(v.iconVerticalBBox=cM(n,v.iconVerticalBBox,b+90));let E=cH(f.horizontal);for(let n of(E&&(x.textBBox=cM(E,x.textBBox,w,1,m)),f.vertical&&(x.textVerticalBBox=cM(f.vertical,x.textVerticalBBox,w+90,1,m)),y))n.hasIconLayoutProperties()&&function(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g){let{appearanceIconOffset:_,appearanceIconRotate:y,appearanceIconSize:v}=cP(a,n,o,s,l,u,c,d.iconScaleFactor),x=null,b=null,w=null;a.hasLayoutProperty("icon-image")?w=function(i,r,n,a,o,s,l,u){let c=null,d=r.getAppearanceValueAndResolveTokens(n,"icon-image",a,o,u);if(d){let h=i.getResolvedImageFromTokens(d),f=n.hasLayoutProperty("icon-size")?n.getUnevaluatedLayoutProperty("icon-size"):r._unevaluatedLayout._values["icon-size"],p=cN(h,uJ(i.zoom,f,i.worldview,u),f,o,i.zoom,a,i.pixelRatio,l,i.worldview,u);c=s.get(p.iconPrimary.toString())}return c}(r,n,a,o,s,f,p,g):h&&(w=h.imagePrimary),w&&(x=uY(w,null,_,m),r.allowVerticalPlacement&&(b=uY(w,null,_,m)));let T=c>0?v/c:1;x&&(i.iconBBox=cM(x,i.iconBBox,y,1!==T?T:void 0)),b&&(i.iconVerticalBBox=cM(b,i.iconVerticalBBox,y+90,1!==T?T:void 0))}(v,i,_,n,o,s,u,b,l,c,r,d,T,h,g),n.hasTextLayoutProperties()&&function(i,r,n,a,o,s,l,u,c,d){let{appearanceTextOffset:h,appearanceTextRotate:f,appearanceTextSize:p}=cO(n,r,a,o,s,l,u),m=p/u,g=[(h[0]-s[0])*m,(h[1]-s[1])*m],_=0!==g[0]||0!==g[1];c&&(i.textBBox=cM(c,i.textBBox,f,m,h,_?g:void 0)),d&&(i.textVerticalBBox=cM(d,i.textVerticalBBox,f+90,m,h,_?g:void 0))}(x,_,n,o,s,m,w,p,E,f.vertical);return{iconBBox:v.iconBBox,iconVerticalBBox:v.iconVerticalBBox,textBBox:x.textBBox,textVerticalBBox:x.textVerticalBBox}}(i,E=U,V,v,l,s,y,F,b,o,N,w,g,S,f);L.push({feature:l,shapedTextOrientations:w,shapedText:B,shapedIcon:E,iconPrimary:A,iconSecondary:O,iconOffset:F,iconAnchor:N,verticallyShapedIcon:V,layoutTextSize:g,layoutIconSize:y,textOffset:S,isSDFIcon:j,iconTextFit:z,iconCollisionBounds:H,iconVerticalCollisionBounds:G,textCollisionBounds:q,textVerticalCollisionBounds:$})}return{featureData:L,sizes:b,hasAnySecondaryIcon:M,textAlongLine:k,symbolPlacement:I,coverageFrcMask:p,coveragePolygons:m,coverageTileZoom:g,isFeatureCoveredByFrcMask:_,symbolAnchorInFrcCoverage:y}},r.eE=function(i,r,n,a,o){var s=1/Math.tan(r/2);if(i[0]=s/n,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,null!=o&&o!==1/0){var l=1/(a-o);i[10]=(o+a)*l,i[14]=2*o*a*l}else i[10]=-1,i[14]=-2*a;return i},r.eF=td,r.eG=p8,r.eH=aW,r.eI=d2,r.eJ=e9,r.eK=function(i){let r=W(new Float64Array(16));Z(r,i.pixelMatrix,i.globeMatrix);let n=[0,oU,0],a=[0,oz,0];return eA(n,n,r),eA(a,a,r),[n[0]>0&&n[0]<=i.width&&n[1]>0&&n[1]<=i.height&&!dy(i,new oq(i.center.lat,90)),a[0]>0&&a[0]<=i.width&&a[1]>0&&a[1]<=i.height&&!dy(i,new oq(i.center.lat,-90))]},r.eL=lB,r.eM=lU,r.eN=lO,r.eO=lP,r.eP=function(i,r,n=0,a=!0){let o=new eQ(n,n),s=i.sub(o),l=r.add(o),u=[s,new eQ(l.x,s.y),l,new eQ(s.x,l.y)];return a&&u.push(s.clone()),u},r.eQ=cY,r.eR=function(i,r){return is(Object.assign(i,{method:"POST"}),r)},r.eS=function(i,r,n,a,o,s,l,u,c,d){i.iconAtlasPositions=d.iconPositions;
8let{featureData:h,hasAnySecondaryIcon:f,sizes:p,textAlongLine:m,symbolPlacement:g,coveragePolygons:_,coverageTileZoom:y,symbolAnchorInFrcCoverage:v}=r;for(let r of h){let{shapedIcon:n,verticallyShapedIcon:s,feature:h,shapedTextOrientations:x,shapedText:b,layoutTextSize:w,textOffset:T,isSDFIcon:E,iconPrimary:S,iconSecondary:A,iconTextFit:C,iconOffset:I,iconCollisionBounds:k,iconVerticalCollisionBounds:R,textCollisionBounds:M}=r;cj(n,d.iconPositions,S,A),cj(s,d.iconPositions,S,A),function(i,r){for(let n in i.horizontal)cz(i.horizontal[n],r);cz(i.vertical,r)}(x,d.iconPositions),function(i,r,n){if(!r)return;let a=n.get(i.toString()),o=n.get(r.toString());a&&o&&(a.paddedRect.w===o.paddedRect.w&&a.paddedRect.h===o.paddedRect.h||tb(`Mismatch in icon variant sizes: ${i.toString()} and ${r.toString()}`),a.usvg!==o.usvg&&tb(`Mismatch in icon variant image types: ${i.id} and ${r.id}`))}(S,A,d.iconPositions),(b||n)&&function(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w,T,E,S,A){var C;let I=l.textMaxSize.evaluate(r,{},f);void 0===I?I=u*l.textScaleFactor:I*=l.textScaleFactor;let k=i.layers[0].layout,R=u*l.textScaleFactor/24,M=cH(n.horizontal)||n.vertical,L=i.hasAnyAppearanceLayoutProperty(["text-size","text-offset","text-rotate"]),P=i.getAppearanceFeatureData(r.index);("none"!==_||L)&&P&&(P.textShaping=M,P.iconTextFitPadding=k.get("icon-text-fit-padding").evaluate(r,{},f),P.fontScale=R,P.textScaleFactor=l.textScaleFactor);let O="globe"===p.name,D=i.tilePixelRatio*I/24,F=(C=i.overscaling,i.zoom>18&&C>2&&(C>>=1),Math.max(8192/(512*C),1)*k.get("symbol-spacing")),N=k.get("text-padding")*i.tilePixelRatio,j=k.get("icon-padding")*i.tilePixelRatio,z=k.get("text-max-angle")*e7,B="map"===k.get("icon-rotation-alignment")&&"point"!==x,U=F/2;!1===i.hasAnyIconTextFit&&"none"!==_&&(i.hasAnyIconTextFit=!0);let V=r.properties?+r.properties[l4]:null,H=i.hdExt?i.hdExt.elevationFeatureIdToIndex:void 0,G=V&&H?H.get(V):65535,q=(u,x,C)=>{if(x.x<0||x.x>=8192||x.y<0||x.y>=8192||E&&E.length>0&&r.properties&&A&&A(E,r.properties,x,f,S))return;let I=null;if(O){let{x:i,y:r,z:n}=p.projectTilePoint(x.x,x.y,C);I={anchor:new u2(i,r,n,0,void 0),up:p.upVector(C,x.x,x.y)}}!function(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w,T,E,S,A,C,I,k,R,M,L){let P=i.addToLineVertexArray(r,a),O,D,F,N,j,z,B,U=0,V=0,H=0,G=0,q=-1,$=-1,W={},Y=id(""),Z=n?n.anchor:r,K="none"!==I,X=0,Q=0;if(void 0===c._unevaluatedLayout.getValue("text-radial-offset")){let i=c.layout.get("text-offset").evaluate(b,{},S);X=24*i[0],Q=24*i[1]}else X=24*c.layout.get("text-radial-offset").evaluate(b,{},S),Q=ck;if(i.allowVerticalPlacement&&o.vertical){let i=o.vertical;if(g)z=cq(i),u&&(B=cq(u));else{let n=c.layout.get("text-rotate").evaluate(b,{},S)+90;F=cG(d,Z,r,h,f,p,i,m,n,_,L),u&&(N=cG(d,Z,r,h,f,p,u,y,n,null,M))}}if(s){let a=c.layout.get("icon-rotate").evaluate(b,{},S),o=cb(s,a,T,K,w.iconScaleFactor),l=u?cb(u,a,T,K,w.iconScaleFactor):void 0;D=cG(d,Z,r,h,f,p,s,y,a,null,R);let m=function(i,r,n,a,o,s,l,u,c){let d=i.layers[0],h=d.appearances,f=r.length;if(n&&(f=Math.max(f,n.length)),0===h.length)return f;let[p,m]=a.get("icon-size-scale-range"),g=ts(1,p,m);for(let r of h)if(r.hasLayoutProperty("icon-image")){let n=d.getAppearanceValueAndResolveTokens(r,"icon-image",s,l,c);if(n){let a=i.getResolvedImageFromTokens(n);if(a){let n=r.hasLayoutProperty("icon-size")?r.getUnevaluatedLayoutProperty("icon-size"):o._values["icon-size"],d=cN(a,uJ(i.zoom,n,i.worldview,c),n,l,i.zoom,s,i.pixelRatio,g,i.worldview,c),h=u.get(d.iconPrimary.toString());h&&(f=Math.max(f,function(i){let r=i.stretchY||[[0,i.paddedRect.h-2]];return i.stretchX||i.stretchY?cE(i.stretchX||[[0,i.paddedRect.w-2]])*cE(r):1}(h)))}}}return f}(i,o,l,c.layout,c._unevaluatedLayout,b,S,i.iconAtlasPositions,E);U=4*m;let g=c.layout.get("icon-size").evaluate(b,{},S,E),_=w.compositeIconSizes?w.compositeIconSizes[0].evaluate(b,{},S,E):0,I=w.compositeIconSizes?w.compositeIconSizes[1].evaluate(b,{},S,E):0,k=cV(i.layerIds[0],i.iconSizeData,g,s.imagePrimary.usvg?1:w.iconScaleFactor,_,I);i.addSymbols(i.icon,o,k,x,v,b,void 0,n,r,P.lineStartIndex,P.lineLength,-1,E,S,A,C,i.symbolInstances.length,m),q=i.icon.placedSymbolArray.length-1,l&&(V=4*m,i.addSymbols(i.icon,l,k,x,v,b,uF.vertical,n,r,P.lineStartIndex,P.lineLength,-1,E,S,A,C,i.symbolInstances.length,m),$=i.icon.placedSymbolArray.length-1)}for(let a in o.horizontal){let s=o.horizontal[a];O||(Y=id(s.text),g?j=cq(s):O=cG(d,Z,r,h,f,p,s,m,c.layout.get("text-rotate").evaluate(b,{},S),_,L));let u=1===s.positionedLines.length;if(H+=cU(i,n,r,s,l,c,g,b,_,P,o.vertical?uF.horizontal:uF.horizontalOnly,u?cI(o.horizontal):[a],W,q,w,E,S,i.symbolInstances.length,A),u)break}o.vertical&&(G+=cU(i,n,r,o.vertical,l,c,g,b,_,P,uF.vertical,["vertical"],W,$,w,E,S,i.symbolInstances.length,A));let J=-1,ee=(i,r)=>i?Math.max(i,r):r;J=ee(j,-1),J=ee(z,J);let et=+((J=ee(B,J))>-1);i.glyphOffsetArray.length>=65535&&tb("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&i.addToSortKey
8Ranges(i.symbolInstances.length,b.sortKey),i.symbolInstances.emplaceBack(r.x,r.y,Z.x,Z.y,Z.z,W.right>=0?W.right:-1,W.center>=0?W.center:-1,W.left>=0?W.left:-1,W.vertical>=0?W.vertical:-1,q,$,Y,void 0!==O?O:i.collisionBoxArray.length,void 0!==O?O+1:i.collisionBoxArray.length,void 0!==F?F:i.collisionBoxArray.length,void 0!==F?F+1:i.collisionBoxArray.length,void 0!==D?D:i.collisionBoxArray.length,void 0!==D?D+1:i.collisionBoxArray.length,N||i.collisionBoxArray.length,N?N+1:i.collisionBoxArray.length,h,H,G,U,V,et,0,X,Q,J,0,+!!K,k)}(i,x,I,u,n,a,s,o,i.layers[0],i.collisionBoxArray,r.index,r.sourceLayerIndex,i.index,N,v,c,j,B,y,r,l,d,h,f,m,g,_,G,b,w,T)};if("line"===x)for(let o of lZ(r.geometry,0,0,8192,8192))for(let r of function(i,r,n,a,o,s,l){let u=a?.6*24*s:0,c=u9(a,o),d=c*s,h=0===i[0].x||8192===i[0].x||0===i[0].y||8192===i[0].y;return r-d<r/4&&(r=d+r/4),function i(r,n,a,o,s,l,u,c,d){let h=l/2,f=u4(r),p=0,m=n-a,g=[];for(let i=0;i<r.length-1;i++){let n=r[i],u=r[i+1],c=n.dist(u),_=u.angleTo(n);for(;m+a<p+c;){let y=((m+=a)-p)/c,v=iw(n.x,u.x,y),x=iw(n.y,u.y,y);if(v>=0&&v<d&&x>=0&&x<d&&m-h>=0&&m+h<=f){let n=new u2(v,x,0,_,i);o&&!u5(r,n,l,o,s)||g.push(n)}}p+=c}return c||g.length||u||(g=i(r,p/2,a,o,s,l,u,!0,d)),g}(i,h?r/2*l%r:(c/2+48)*s*l%r,r,u,n,d,h,!1,8192)}(o,F,z,n.vertical||M,a,D,i.overscaling))M&&function(i,r,n,a){let o=i.compareText;if(r in o){let i=o[r];for(let r=i.length-1;r>=0;r--)if(a.dist(i[r])<n)return!0}else o[r]=[];return o[r].push(a),!1}(i,M.text,U,r)||q(o,r,f);else if("line-center"===x){for(let i of r.geometry)if(i.length>1){let r=function(i,r,n,a,o){let s=n?.6*24*o:0,l=u9(n,a)*o,u=0,c=u4(i)/2;for(let n=0;n<i.length-1;n++){let a=i[n],o=i[n+1],d=a.dist(o);if(u+d>c){let h=(c-u)/d,f=new u2(iw(a.x,o.x,h),iw(a.y,o.y,h),0,o.angleTo(a),n);return!s||u5(i,f,l,s,r)?f:void 0}u+=d}}(i,z,n.vertical||M,a,D);r&&q(i,r,f)}}else if("Polygon"===r.type)for(let i of e2(r.geometry,0)){let r=function(i,r=1,n=!1){let a=1/0,o=1/0,s=-1/0,l=-1/0,u=i[0];for(let i=0;i<u.length;i++){let r=u[i];(!i||r.x<a)&&(a=r.x),(!i||r.y<o)&&(o=r.y),(!i||r.x>s)&&(s=r.x),(!i||r.y>l)&&(l=r.y)}let c=Math.min(s-a,l-o),d=c/2,h=new rR([],cA);if(0===c)return new eQ(a,o);for(let r=a;r<s;r+=c)for(let n=o;n<l;n+=c)h.push(new cC(r+d,n+d,d,i));let f=function(i){let r=0,n=0,a=0,o=i[0];for(let i=0,s=o.length,l=s-1;i<s;l=i++){let s=o[i],u=o[l],c=s.x*u.y-u.x*s.y;n+=(s.x+u.x)*c,a+=(s.y+u.y)*c,r+=3*c}return new cC(n/r,a/r,0,i)}(i),p=h.length;for(;h.length;){let a=h.pop();(a.d>f.d||!f.d)&&(f=a,n&&console.log("found best %d after %d probes",Math.round(1e4*a.d)/1e4,p)),a.max-f.d<=r||(d=a.h/2,h.push(new cC(a.p.x-d,a.p.y-d,d,i)),h.push(new cC(a.p.x+d,a.p.y-d,d,i)),h.push(new cC(a.p.x-d,a.p.y+d,d,i)),h.push(new cC(a.p.x+d,a.p.y+d,d,i)),p+=4)}
8return n&&(console.log(`num probes: ${p}`),console.log(`best distance: ${f.d}`)),f.p}(i,16);q(i[0],new u2(r.x,r.y,0,0,void 0),f)}else if("LineString"===r.type)for(let i of r.geometry)q(i,new u2(i[0].x,i[0].y,0,0,void 0),f);else if("Point"===r.type)for(let i of r.geometry)for(let r of i)q([r],new u2(r.x,r.y,0,0,void 0),f)}(i,h,x,n,s,c,p,w,T,E,a,o,l,u,f,C,I,m,g,k,R,M,_,y,v)}n&&i.generateCollisionDebugBuffers(s,i.collisionBoxArray,p.textScaleFactor),i.text.uboBinder&&i.text.uboBinder.finalize(),i.icon.uboBinder&&i.icon.uboBinder.finalize()},r.eT=u3,r.eU=function(i){return i<=1?1:Math.pow(2,Math.floor(Math.log2(i)))},r.eV=function(i,r){let n=i.json.extensionsUsed&&i.json.extensionsUsed.includes("mbx_bvh"),a=fY(i);for(let i of a){if(!n)for(let r of i.meshes)!function(i){i.heightmap=new Float32Array(4096),i.heightmap.fill(-1);let r=i.vertexArray.float32,n=i.aabb.min[0]-1,a=i.aabb.min[1]-1,o=64/(i.aabb.max[0]-n+2),s=64/(i.aabb.max[1]-a+2);for(let l=0;l<r.length;l+=3){let u=r[l+2],c=(r[l+0]-n)*o|0,d=(r[l+1]-a)*s|0;u>i.heightmap[64*d+c]&&(i.heightmap[64*d+c]=u)}}(r);i.lights&&(i.lightMeshIndex=i.meshes.length,i.meshes.push(function(i,r){let n={};n.indexArray=new sw,n.vertexArray=new su,n.colorArray=new sm,n.indexArray.reserveExact(4*i.length),n.vertexArray.reserveExact(10*i.length),n.colorArray.reserveExact(10*i.length),fZ(i,r,n.indexArray,n.vertexArray,n.colorArray);let a={defined:!0};a.emissiveFactor=iE.black;let o={};return o.baseColorFactor=iE.white,a.pbrMetallicRoughness=o,n.material=a,n.aabb=new c4([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),n}(i.lights,r)))}return a},r.eW=function(i,r,n){return r?gb(i,r,n):i.tiles&&i.tiles.length>0?{tiles:i.tiles}:Error('TileJSON is missing required "tiles" property')},r.eX=function(i){return i*te},r.eY=["type","source","source-layer","minzoom","maxzoom","filter","layout"],r.eZ=ar,r.e_=function(i){return i({pluginStatus:aB,pluginURL:aU}),aG.on("pluginStateChange",i),i},r.ea=oc,r.eb=tg,r.ec=function(i,r,n,a,o){return ts((i-r)/(n-r)*(o-a)+a,a,o)},r.ed=hQ,r.ee=function(i,r,n){return i[0]=Math.max(r[0],n[0]),i[1]=Math.max(r[1],n[1]),i[2]=Math.max(r[2],n[2]),i[3]=Math.max(r[3],n[3]),i},r.ef=function(i){let r=i.layers[0];"circle"===r.type&&"hd-road-markup"===r.layout.get("circle-elevation-reference")&&(i.hdExt=new h0)},r.eg=function(i,r){let n=i.layers[0].layout.get("fill-elevation-reference"),a="hd-road-base"===n||"hd-road-markup"===n?n:null,o=!!r&&r.length>0&&hQ(r,i.layers[0].source,i.sourceLayerName);(a||o)&&(i.hdExt=new hJ(i,a,o))},r.eh=function(i,r){let n="hd-road-markup"===i.layers[0].layout.get("line-elevation-reference"),a=!!r&&r.length>0&&hQ(r,i.layers[0].source,i.sourceLayerName);(n||a)&&(i.hdExt=new h1(n,a))},r.ei=function(i){"hd-road-markup"===i.layers[0].layout.get("symbol-elevation-reference")&&(i.hdExt=new h5)},r.ej=oX,r.ek=rh,r.el=rf,r.em=function(i,r){return i/oW(r)},r.en=function(i,r,n){return i[0]=Math.min(r[0],n[0]),i[1]=Math.min(r[1],n[1]),i[2]=Math.min(r[2],n[2]),i[3]=Math.min(r[3],n[3]),i},r.eo=Z,r.ep=ef,r.eq=nF,r.er=Z,r.es=ef,r.et=id,r.eu=eb,r.ev=dC,r.ew=tp,r.ex=ew,r.ey=eP,r.ez=eP,r.f=dT,r.f$=tu,r.f0=o1,r.f1=function(i){let r;if("provider"in i&&!i.provider)return null;let n=i.provider;if(!n&&"url"in i&&i.url&&(n=function(i){try{let r=new URL(i).pathname.split("/").pop()||"",n=r.lastIndexOf(".");return n>=0?r.slice(n+1):""}catch{return""}}(i.url)),!n)return null;let a=tV.TILE_PROVIDER_URLS[n];if(!a)return null;try{r=new URL(a,tV.API_URL).href}catch(i){return Error(`TileProvider "${n}" has an invalid URL: "${a}"`)}return{name:n,url:r}},r.f2=eN,r.f3=Q,r.f4=ej,r.f5=function(i,r,n){n*=.5;var a=r[0],o=r[1],s=r[2],l=r[3],u=Math.sin(n),c=Math.cos(n);return i[0]=a*c+o*u,i[1]=o*c-a*u,i[2]=s*c+l*u,i[3]=l*c-s*u,i},r.f6=ee,r.f7=aj,r.f8=function(i,r){return[Math.pow(i[0],2.2)*r,Math.pow(i[1],2.2)*r,Math.pow(i[2],2.2)*r]},r.f9=tj,r.fA=nK,r.fB=nY,r.fC=nW,r.fD=nZ,r.fE=function(i,r,n,a,o,s,l,u,c){if("globe"===c.name)return dn(i,r,new dT(n,a,o),!1);let d=dI({z:n,x:a,y:o},c);return new c4([(s+d.x/d.scale)*r,r*(d.y/d.scale),l],[(s+d.x2/d.scale)*r,r*(d.y2/d.scale),u])},r.fF=da,r.fG=mO,r.fH=oQ,r.fI=dI,r.fJ=o5,r.fK=eC,r.fL=eA,r.fM=eO,r.fN=d0,r.fO=eI,r.fP=di,r.fQ=K,r.fR=function(i,r){if(i===r){var n=r[1],a=r[2],o=r[3],s=r[6],l=r[7],u=r[11];i[1]=r[4],i[2]=r[8],i[3]=r[12],i[4]=n,i[6]=r[9],i[7]=r[13],i[8]=a,i[9]=s,i[11]=r[14],i[12]=o,i[13]=l,i[14]=u}else i[0]=r[0],i[1]=r[4],i[2]=r[8],i[3]=r[12],i[4]=r[1],i[5]=r[5],i[6]=r[9],i[7]=r[13],i[8]=r[2],i[9]=r[6],i[10]=r[10],i[11]=r[14],i[12]=r[3],i[13]=r[7],i[14]=r[11],i[15]=r[15];return i},r.fS=aV,r.fT=a7,r.fU=tf,r.fV=eX,r.fW=function(i,r,n,a,o){let s=5*r+2;i.float32[s+0]=n,i.float32[s+1]=a,i.float32[s+2]=o},r.fX=function(){return function i(r){return r?(r^Math.random()*(16>>r/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,i)}()},r.fY=function(i){let r=[],n=i.id;return void 0===n&&r.push({message:`layers.${n}: missing required property "id"`}),void 0===i.render&&r.push({message:`layers.${n}: missing required method "render"`}),i.renderingMode&&"2d"!==i.renderingMode&&"3d"!==i.renderingMode&&r.push({message:`layers.${n}: property "renderingMode" must be either "2d" or "3d"`}),r},r.fZ=function(i){return!!i&&tt.test(i)},r.f_=tb,r.fa=eg,r.fb=eL,r.fc=X,r.fd=eW,r.fe=e_,r.ff=ec,r.fg=function(i){tV.ACCESS_TOKEN=i},r.fh=function(i){tV.API_URL=i},r.fi=function(i){tV.BUILDING_GEN_URL=tU.resolveURL(i)},r.fj=function(i,r){tX=i,tQ=r},r.fk=function(i,r,n){i[4*r+0]=n[0],i[4*r+1]=n[1],i[4*r+2]=n[2],i[4*r+3]=n[3]},r.fl=function(i){tV.DRACO_URL=tU.resolveURL(i)},r.fm=function(i){tV.MAX_PARALLEL_IMAGE_REQUESTS=i},r.fn=function(i){let r=tU.resolveURL(i);tV.MESHOPT_URL=r,tV.MESHOPT_SIMD_URL=r},r.fo=function(i,r,n=!1){if(aB===aj.deferred||aB===aj.loading||aB===aj.loaded)throw Error("setRTLTextPlugin cannot be called multiple times.");aU=tU.resolveURL(i),aB=aj.deferred,az=r,aH(),n||a$()},r.fp=dY,r.fq=tl,r.fr=cl,r.fs=a6,r.ft=tT,r.fu=ex,r.fv=function(i){try{let r=self[i];return r.setItem("_mapbox_test_",1),r.removeItem("_mapbox_test_"),!0}catch(i){return!1}},r.fw=tZ,r.fx=eh,r.fy=e$,r.fz=eh,r.g=un,r.g0=ek,r.h=sj,r.i=iE,r.j=ru,r.k=mx,r.l=a4,r.m=class{constructor(i){this.entries={}
8,this.scheduler=i}request(i,r,n,a){let o=this.entries[i]=this.entries[i]||{callbacks:[]};if(o.result){let[i,n]=o.result;return this.scheduler?this.scheduler.add(()=>{a(i,n)},r):a(i,n),()=>{}}return o.callbacks.push(a),o.cancel||(o.cancel=n((n,a)=>{for(let i of(o.result=[n,a],o.callbacks))this.scheduler?this.scheduler.add(()=>{i(n,a)},r):i(n,a);setTimeout(()=>delete this.entries[i],3e3)})),()=>{o.result||(o.callbacks=o.callbacks.filter(i=>i!==a),o.callbacks.length||(o.cancel(),delete this.entries[i]))}}},r.n=[1,1,1],r.o=mj,r.p=class{constructor(i){this.specification=i}possiblyEvaluate(i,r){return function([i,r]){let n=tT([1,i,r]);return{x:n.x,y:n.y,z:n.z}}(i.expression.evaluate(r))}interpolate(i,r,n){return{x:iw(i.x,r.x,n),y:iw(i.y,r.y,n),z:iw(i.z,r.z,n)}}},r.q=7,r.r=8192,r.s=class{isDataAvailableAtPoint(i){let r=this._source();if(this.isUsingMockSource()||!r||i.y<0||i.y>1)return!1;let n=r.getSource().maxzoom,a=1<<n,o=Math.floor(i.x),s=Math.floor((i.x-o)*a),l=Math.floor(i.y*a),u=this.findDEMTileFor(new dS(n,o,n,s,l));return!(!u||!u.dem)}
8getAtPointOrZero(i,r=0){return this.getAtPoint(i,r)||0}getAtPoint(i,r,n=!0){if(this.isUsingMockSource())return null;null==r&&(r=null);let a=this._source();if(!a||i.y<0||i.y>1)return r;let o=a.getSource().maxzoom,s=1<<o,l=Math.floor(i.x),u=i.x-l,c=new dS(o,l,o,Math.floor(u*s),Math.floor(i.y*s)),d=this.findDEMTileFor(c);if(!d||!d.dem)return r;let h=d.dem,f=1<<d.tileID.canonical.z,p=(u*f-d.tileID.canonical.x)*h.dim,m=(i.y*f-d.tileID.canonical.y)*h.dim,g=Math.floor(p),_=Math.floor(m);return(n?this.exaggeration():1)*iw(iw(h.get(g,_),h.get(g,_+1),m-_),iw(h.get(g+1,_),h.get(g+1,_+1),m-_),p-g)}static getAtTileOffset(i,r,n,a){let o=1<<i.canonical.z;return a?a.pointElevation(r):n?n.getAtPointOrZero(new oJ(i.wrap+(i.canonical.x+r.x/8192)/o,(i.canonical.y+r.y/8192)/o)):0}static getAtTileOffsetFunc(i,r,n,a){return(o,s,l)=>{let u=this.getAtTileOffset(i,o,s,l),c=a.upVector(i.canonical,o.x,o.y);return eg(c,c,u*a.upVectorScale(i.canonical,r,n).metersToTile),c}}getForTilePoints(i,r,n,a){if(this.isUsingMockSource())return!1;let o=mx.create(this,i,a);return!!o&&(r.forEach(i=>{i[2]=this.exaggeration()*o.getElevationAt(i[0],i[1],n,!0)}),!0)}getMinMaxForTile(i){if(this.isUsingMockSource())return null;let r=this.findDEMTileFor(i);if(!r||!r.dem)return null;let n=r.dem.tree,a=r.tileID,o=1<<i.canonical.z-a.canonical.z,s=i.canonical.x/o-a.canonical.x,l=i.canonical.y/o-a.canonical.y,u=0;for(let r=0;r<i.canonical.z-a.canonical.z&&!n.leaves[u];r++){let i=2*Math.floor(l*=2)+Math.floor(s*=2);u=n.childOffsets[u]+i,s%=1,l%=1}return{min:this.exaggeration()*n.minimums[u],max:this.exaggeration()*n.maximums[u]}}getMinElevationBelowMSL(){throw Error("Pure virtual method called.")}raycast(i,r,n){throw Error("Pure virtual method called.")}pointCoordinate(i){throw Error("Pure virtual method called.")}_source(){throw Error("Pure virtual method called.")}isUsingMockSource(){throw Error("Pure virtual method called.")}exaggeration(){throw Error("Pure virtual method called.")}findDEMTileFor(i){throw Error("Pure virtual method called.")}get visibleDemTiles(){throw Error("Getter must be implemented in subclass.")}getMinMaxForVisibleTiles(){let i=this.visibleDemTiles;if(0===i.length)return null;let r=!1,n=Number.MAX_VALUE,a=5e-324;for(let o of i){let i=this.getMinMaxForTile(o.tileID);i&&(n=Math.min(n,i.min),a=Math.max(a,i.max),r=!0)}return r?{min:n,max:a}:null}},r.t=class{static parseFrom(i,r){let n=hd.parse(i);if(!n)return[];let{vertices:a,features:o}=n,s=1/oQ(r);o.sort((i,r)=>i.id-r.id),a.sort((i,r)=>i.id-r.id||i.idx-r.idx);let l=[],u=0,c=(a=a.filter((i,r,n)=>r===n.findIndex(r=>
8r.id===i.id&&r.idx===i.idx))).length;for(let i of o){if(i.constantHeight){l.push(new hf(i.id,i.bounds,i.constantHeight));continue}for(;u!==c&&a[u].id<i.id;)u++;if(u===c||a[u].id!==i.id)continue;let r=[],n=[],o=u;for(;u!==c&&a[u].id===i.id;){let i=a[u];if(r.push({position:i.position,height:i.height,extent:i.extent}),u!==o&&a[u-1].idx===i.idx-1){let i=u-o;n.push({a:i-1,b:i})}u++}l.push(new hf(i.id,i.bounds,void 0,r,n,s))}return l}},r.u=hn,r.v=ip,r.w=aZ,r.x=ih,r.y=i_,r.z=6}),a(["require","./shared"],function(i,r){var n;function a(i){let r=i?i.url.toString():void 0;return r?performance.getEntriesByName(r):[]}function o(i,n){if(Object.hasOwn(i.layers,r.W))return r.t.parseFrom(i.layers[r.W],n)}function s({buckets:i,data:n,sourceLayerCoder:a,canonical:o,options:l}){if(!l.elevationFeatures||0===l.elevationFeatures.length)return;let u=[];for(let n of Object.values(i))if(n instanceof r.J&&n.hdExt){let i=n.hdExt.getUnevaluatedPortalGraph();i&&u.push(i)}let c=r.u.evaluate(u);for(let s of Object.values(i))if(s instanceof r.J&&s.hdExt){let i=n.layers[a.decode(s.sourceLayerIndex)];s.hdExt.setEvaluatedPortalGraph(c,i,o,l.availableImages,l.brightness,s.worldview)}}function l(i){let n=[];for(let a=0;a<i.length;a++){let o=i.feature(a),s=o.properties.frc_mask;if(null==s)continue;let l=Number(s);if(!l)continue;let u=o.loadGeometry();if(u.length>0){let i=!1;for(let n of u[0])if(n.x<0||n.x>r.r||n.y<0||n.y>r.r){i=!0;break}if(i)continue}let c=1===u.length&&5===u[0].length&&u[0].some(i=>i.x<=0&&i.y<=0)&&u[0].some(i=>i.x>=r.r&&i.y<=0)&&u[0].some(i=>i.x>=r.r&&i.y>=r.r)&&u[0].some(i=>i.x<=0&&i.y>=r.r);n.push(new r.M(l,c?[]:u))}return n}function u(i,n,a,o,s){let l=r.cp(n);if(null===l)return!1;let u=a.x,c=a.y,d=null!=s?s:o.z;if(o.z!==d){let i=1<<o.z-d,n=r.r/i;u=o.x%i*n+a.x/i,c=o.y%i*n+a.y/i}for(let n of i){if(!(n.hasGeometry()&&n.frcMask&1<<l))continue;let i=n.rings.map(i=>i.map(i=>[i.x,i.y]));if(r.eJ([u,c],i))return!0}return!1}function c(i,n,a,o){let s=n.indoorState.activeFloorsVisible;if(!n.sourceLayers)return s?n.indoorState.activeFloors:void 0;let l=function(i,n){if(!i)return r.f_("No source layers defined in indoor specification"),n;if(0===i.size)return n;for(let a of i.difference(n))r.f_(`Missing source layer required in indoor specification: ${a}`);return n.intersection(n)}(n.sourceLayers,new Set(Object.keys(i.layers))),u=n.indoorState,c=function(i,n,a,o,s){let l={};for(let a of n){let n=i.layers[a];if(n)for(let i=0;i<n.length;i++){let a=n.feature(i);if(h(u=a,["type","id","name"])&&"structure"===u.properties.type){let{id:i,center:r}={id:(c=a).properties.id.toString(),center:[c.properties.center_lon||0,c.properties.center_lat||0]};d(l,i,r);continue}if(h(f=a,["type","id","name","z_index"])&&"floor"===f.properties.type){let i=(p=a,m=s,{id:p.properties.id.toString(),isDefault:!!p.properties.is_default&&p.properties.is_default,connections:p.properties.connected_floor_ids?new Set(p.properties.connected_floor_ids.toString().split(";")):new Set,conflicts:p.properties.conflicted_floor_ids?new Set(p.properties.conflicted_floor_ids.toString().split(";")):new Set,buildings:p.properties.structure_ids?new Set(p.properties.structure_ids.toString().split(";")):new Set,name:p.properties.name.toString(),zIndex:p.properties.z_index,geometry:function(i,n){let a=i.loadGeometry();if(!a||0===a.length)return;let o=a.map(a=>a.map(a=>r.cV(a,n,i.extent)));return 0===o.length?void 0:{type:"Polygon",coordinates:[o[0]]}}(p,m)});var u,c,f,p,m,g=l,_=i.buildings,y=i.id,v=i;for(let i of _)d(g,i),g[i].floors[y]=v,g[i].floorIds.add(y)}}else r.f_(`indoor source layer not found: ${a}`)}return{buildings:l,activeFloors:r.a5.calculate(l,o,a)}}(i,l,u.activeFloors,u.selectedFloorId,o);return a.send("setIndoorData",c),s?c.activeFloors:void 0}function d(i,r,n){i[r]?n&&(i[r].center=n):i[r]={floorIds:new Set,center:n||[0,0],floors:{}}}function h(i,r){return r.every(r=>i.properties&&null!=i.properties[r])}function f(i,n){i instanceof r.J?r.eg(i,n):i instanceof r.aa?r.eh(i,n):i instanceof r.g?r.ef(i):i instanceof r.aX&&r.ei(i)}function p(i){if("number"==typeof i||"boolean"==typeof i||"string"==typeof i||null==i)return JSON.stringify(i);if(Array.isArray(i)){let r="[";for(let n of i)r+=`${p(n)},`;return`${r}]`}let r="{";for(let n of Object.keys(i).sort())r+=`${n}:${p(i[n])},`;return`${r}}`}function m(i,r){return function i(n){return"string"==typeof n&&n===r||(Array.isArray(n)?n.some(i):!(!n||"object"!=typeof n)&&Object.values(n).some(i))}(i)}class g{constructor(i){this.keyCache=Object.create(null),this._layers=Object.create(null),this._layerConfigs=Object.create(null),i&&this.replace(i)}replace(i,r){this._layerConfigs=Object.create(null),this._layers=Object.create(null),this.update(i,[],r)}update(i,n,a){for(let n of(this._options=a,i))this._layerConfigs[n.id]=n,(this._layers[n.id]=r.c0(n,this.scope,null,this._options)).compileFilter(a),this.keyCache[n.id]&&delete this.keyCache[n.id];for(let i of n)delete this.keyCache[i],delete this._layerConfigs[i],delete this._layers[i];for(let i of(this.familiesBySource=Object.create(null),function(i,n){let a=Object.create(null);for(let o=0;o<i.length;o++){let s=i[o],l=n&&n[s.id];l||("symbol"===s.type?l=s.id:(l=function(i){let n="";for(let a of r.eY)n+=`/${p(i[a])}`;return n}(s),"line"===s.type&&s.paint&&(m(s.paint["line-width"],"line-progress")&&(l+=`/${p(s.paint["line-width"])}`),m(s.paint["line-emissive-strength"],"line-progress")&&(l+=`/${p(s.paint["line-emissive-strength"])}`)))),n&&(n[s.id]=l);let u=a[l];u||(u=a[l]=[]),u.push(s)}let o=[];for(let i in a)o.push(a[i]);return o}(Object.values(this._layerConfigs),this.keyCache))){let r=i.map(i=>this._layers[i.id]),n=r[0];if("none"===n.visibility)continue;let a=n.source||"",o=this.familiesBySource[a];o||(o=this.familiesBySource[a]=Object.create(null));let s=n.sourceLayer||"_geojsonTileLayer",l=o[s];l||(l=o[s]=[]),l.push(r)}}}let _=+r.aI;class y{constructor(i){const n={},a=[];for(const r in i){const o=i[r],s=n[r]={};for(const i in o.glyphs){const r=o.glyphs[+i];if(!r||0===r.bitmap.width||0===r.bitmap.height)continue;const n=r.metrics.localGlyph?_:1,l={x:0,y:0,w:r.bitmap.width+2*n,h:r.bitmap.height+2*n};a.push(l),s[i]=l}}const{w:o,h:s}=r.eT(a),l=new r.b({width:o||1,height:s||1});for(const a in i){const o=i[a];for(const i in o.glyphs){const s=o.glyphs[+i];if(!s||0===s.bitmap.width||0===s.bitmap.height)continue;const u=n[a][i],c=s.metrics.localGlyph?_:1;r.b.copy(s.bitmap,l,{x:0,y:0},{x:u.x+c,y:u.y+c},s.bitmap)}}this.image=l,this.positions=n}}function v(i){for(let r of i)if(null!=r.hdExt||r.requiresHDRuntime)return!0;return!1}function x(i){for(let r of i)if(r.requiresStandardRuntime)return!0;return!1}r.eZ(y,"GlyphAtlas");class b{constructor(i){this.tileID=new r.ap(i.tileID.overscaledZ,i.tileID.wrap,i.tileID.canonical.z,i.tileID.canonical.x,i.tileID.canonical.y),this.tileZoom=i.tileZoom,this.uid=i.uid,this.zoom=i.zoom,this.lut=i.lut,this.canonical=i.tileID.canonical,this.pixelRatio=i.pixelRatio,this.tileSize=i.tileSize,this.source=i.source,this.scope=i.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=i.showCollisionBoxes,this.showElevationIdDebug=i.showElevationIdDebug,this.collectResourceTiming=!!i.request&&i.request.collectResourceTiming,this.promoteId=i.promoteId,this.renderSourceType=i.renderSourceType,this.frcCoverage=i.frcCoverage||null,this.deferRoadStructure=!1,this.tileTransform=r.fI(i.tileID.canonical,i.projection),this.projection=i.projection,this.worldview=i.worldview,this.localizableLayerIds=i.localizableLayerIds,this.brightness=i.brightness,this.extraShadowCaster=!!i.extraShadowCaster,this.tessellationStep=i.tessellationStep,this.scaleFactor=i.scaleFactor,this.worldview=i.worldview,this.indoor=i.indoor}isLayerActiveForTile(i){return!(this.renderSourceType===r.aC.Symbol&&"symbol"!==i.t
8ype||this.renderSourceType===r.aC.FillExtrusion&&"fill-extrusion"!==i.type||this.renderSourceType===r.aC.Other&&("symbol"===i.type||"fill-extrusion"===i.type)||i.minzoom&&this.zoom<Math.floor(i.minzoom)||i.maxzoom&&this.zoom>=i.maxzoom||"none"===i.visibility)}parse(i,r,n,a,o,s){this._parseAfterHD(i,r,n,a,o,s)}_parseAfterHD(i,n,a,d,h,p){let m;if(this.status="parsing",this.data=i,this.renderSourceType===r.aC.HdRoadCoverage){let n=i.layers[r.X];m=n&&l?l(n):[]}this.collisionBoxArray=new r.h;let g=new r.o(Object.keys(i.layers).sort()),_=new r.I(this.tileID,this.promoteId);_.bucketLayerIDs=[];let b={},T=new r.a9(256,256),E={featureIndex:_,iconDependencies:new Map,patternDependencies:new Map,glyphDependencies:{},lineAtlas:T,availableImages:a,brightness:this.brightness,scaleFactor:this.scaleFactor,showElevationIdDebug:this.showElevationIdDebug,elevationFeatures:void 0,activeFloors:void 0};this.indoor&&c&&(E.activeFloors=c(i,this.indoor,h,this.canonical));let S=[],A=n.familiesBySource[this.source];if(this.deferRoadStructure=!1,this.renderSourceType!==r.aC.HdRoadCoverage&&null!=this.frcCoverage&&!this.frcCoverage.resolved&&null===this.frcCoverage.frcMask){for(let i in A)if(r.ed&&r.ed(this.frcCoverage.sourceLayers,this.source,i)){this.deferRoadStructure=!0;break}}for(let n in A){let s=i.layers[n];if(!s)continue;let l=!1,u=!1,c=!1,h=!1;for(let i of A[n])"symbol"===i[0].type?l=!0:"fill-extrusion"===i[0].type?u=!0:c=!0,i[0].is3D()&&"model"!==i[0].type&&(h=!0);if(this.extraShadowCaster&&!h||this.renderSourceType===r.aC.Symbol&&!l||this.renderSourceType===r.aC.FillExtrusion&&!u||(this.renderSourceType===r.aC.Other||this.renderSourceType===r.aC.HdRoadCoverage)&&!c)continue;let p=null!=this.frcCoverage&&!!r.ed&&r.ed(this.frcCoverage.sourceLayers,this.source,n);if(this.deferRoadStructure&&p)continue;1===s.version&&r.f_(`Vector tile source "${this.source}" layer "${n}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let m=g.encode(n),y=[],v=this.localizableLayerIds&&this.localizableLayerIds.has(n),x=!1;for(let i=0,a=0;i<s.length;i++){let o=s.feature(i),l=_.getId(o,n),u=o.properties?o.properties.worldview:null;if(v&&this.worldview&&"string"==typeof u)if("all"===u)o.properties.$localized=!0;else{if(!u.split(",").includes(this.worldview))continue;o.properties.$localized=!0,o.properties.worldview=this.worldview}!x&&o.properties&&Object.hasOwn(o.properties,r.ar)&&(x=!0),p&&this.frcCoverage&&this.frcCoverage.frcMask&&o.properties&&r.dz&&r.dz(o.properties,this.frcCoverage.frcMask)||(y.push({feature:o,id:l,index:a,sourceLayerIndex:m}),a++)}for(let s of(x&&!E.elevationFeatures&&o&&(E.elevationFeatures=o(i,this.canonical)),A[n])){let i=s[0];if(this.extraShadowCaster&&(!i.is3D()||"model"===i.type)||this.renderSourceType===r.aC.Symbol&&"symbol"!==i.type||this.renderSourceType===r.aC.FillExtrusion&&"fill-extrusion"!==i.type||(this.renderSourceType===r.aC.Other||this.renderSourceType===r.aC.HdRoadCoverage)&&("symbol"===i.type||"fill-extrusion"===i.type)||!this.isLayerActiveForTile(i))continue;w(s,this.zoom,E.brightness,a,this.worldview,E.activeFloors);let o=_.bucketLayerIDs.length;_.bucketLayerIDs.push(s.map(i=>r.ea(i.id,i.scope)));let l=()=>{let r=b[i.id]=i.createBucket({index:o,layers:s,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:m,sourceLayerName:n,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep,styleDefinedModelURLs:d,worldview:this.worldview,localizable:v,availableImages:a,maxUniformBufferBindings:this.maxUniformBufferBindings,maxUniformBlockSizeDwords:this.maxUniformBlockSizeDwords,disableSymbolUBO:this.disableSymbolUBO});f&&f(r,this.frcCoverage?this.frcCoverage.sourceLayers:null),r.populate(y,E,this.tileID.canonical,this.tileTransform)};i.mayUse("HD")||i.mayUse("Standard")?S.push(i.prepare().then(()=>l())):l()}}let C=()=>{let n,o,l,c,d,f,S;T.trim();let A=!(!E.elevationFeatures||!E.elevationFeatures.some(i=>i.heightRange.min<0)),C={type:"maybePrepare",renderSourceType:this.renderSourceType,zoom:this.zoom},I=()=>
8{if(n)return this.status="done",p(n);if(this.extraShadowCaster){this.status="done";let i=Object.values(b).filter(i=>!i.isEmpty());p(null,{buckets:i,containsHdExt:v(i),containsStandardExt:x(i),featureIndex:_,collisionBoxArray:null,hasTunnelGeometry:A,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:E.brightness,glyphMap:null,iconMap:null,glyphPositions:null})}else if(o&&l&&c&&S){let i,n=new y(o),s=new Map;for(let[i,n]of l.entries()){let{imagePosition:a}=r.cR(i,n,r.Z);s.set(i,a)}let p={};for(let i in b){let c=b[i];c instanceof r.aX&&(w(c.layers,this.zoom,E.brightness,a,this.worldview,E.activeFloors),p[i]=r.eD(c,o,n.positions,l,s,this.tileID.canonical,this.tileZoom,this.scaleFactor,this.pixelRatio,d,this.worldview,a,this.frcCoverage?this.frcCoverage.frcMask:null,this.frcCoverage?this.frcCoverage.polygons:null,this.frcCoverage?this.frcCoverage.tileZoom:null,r.dz||null,u||null))}d.size||f.size?this.rasterizeTask=h.send("rasterizeImages",{scope:this.scope,iconTasks:d,patternTasks:f},(r,a)=>{if(!r)for(let[i,r]of a.entries())l.has(i)&&l.set(i,Object.assign(l.get(i),{data:r})),c.has(i)&&c.set(i,Object.assign(c.get(i),{data:r}));k(p,n,i,S)}):k(p,n,i,S)}},k=(i,n,o,s)=>{let u=l.size>0||c.size>0,d=Object.keys(i).length>0;if(!u&&!d){this.status="done";let i=Object.values(b).filter(i=>!i.isEmpty());return void p(null,{buckets:i,containsHdExt:v(i),containsStandardExt:x(i),featureIndex:_,collisionBoxArray:this.collisionBoxArray,hasTunnelGeometry:A,glyphAtlasImage:n.image,lineAtlas:T,imageAtlas:null,brightness:E.brightness,hasDeferredRoadStructure:this.deferRoadStructure,frcCoveragePolygons:m})}let f=(o,s)=>{for(let n in b){let o=b[n];if(n in i)r.eS(o,i[n],this.showCollisionBoxes,a,this.tileID.canonical,this.tileZoom,this.projection,this.brightness,l,s);else if(o.hasPattern&&(o instanceof r.aa||o instanceof r.J||o instanceof r.K)){w(o.layers,this.zoom,E.brightness,a,this.worldview,E.activeFloors);let i=Object.fromEntries(s.patternPositions);o.addFeatures(E,this.tileID.canonical,i,a,this.tileTransform,this.brightness)}}this.status="done";let u=Object.values(b).filter(i=>!i.isEmpty());p(null,{buckets:u,containsHdExt:v(u),containsStandardExt:x(u),featureIndex:_,collisionBoxArray:this.collisionBoxArray,hasTunnelGeometry:A,glyphAtlasImage:n.image,lineAtlas:T,imageAtlas:o,brightness:E.brightness,hasDeferredRoadStructure:this.deferRoadStructure,frcCoveragePolygons:m})};if(u){let i=new Map,n=r.fr(l,i),a=r.fr(c,i),o=new r.c(n,a,s,this.lut,i);h.send("checkAtlasCache",{descriptor:o,scope:this.scope},(i,n)=>{let a,o;if(i&&r.f_(`[Worker] Error checking atlas cache: ${i.message}`),n)a=new r.a0(n.sourceHash),o=n;else{let i=new r._(l,c,this.lut,s);a=i,o=i}f(a,o)})}else f(null,{iconPositions:new Map,patternPositions:new Map})};if(!this.extraShadowCaster){let i=r.eb(E.glyphDependencies,i=>Object.keys(i).map(Number));Object.keys(i).length?h.send("getGlyphs",{uid:this.uid,stacks:i},(i,r)=>{n||(n=i,o=r,I())},void 0,!1,C):o={},S=new Map;let a=Array.from(E.iconDependencies.keys()).map(i=>r.a1.parse(i)),s=Array.from(E.patternDependencies.keys()).map(i=>r.a1.parse(i));a.length||s.length?h.send("getImages",{icons:a,patterns:s,source:this.source,scope:this.scope,tileID:this.tileID},(i,r)=>{if(!n){for(let[a,o]of(n=i,l=new Map,c=new Map,d=this.updateImageMapAndGetImageTaskQueue(l,r.images,E.iconDependencies),f=this.updateImageMapAndGetImageTaskQueue(c,r.images,E.patternDependencies),r.versions.entries()))S.set(a,o);I()}},void 0,!1,C):(l=new Map,c=new Map,d=new Map,f=new Map)}s&&s({buckets:b,data:i,sourceLayerCoder:g,canonical:this.tileID.canonical,options:E}),I()};S.length>0?Promise.allSettled(S).then(C).catch(p):C()}updateParameters(i){this.scaleFactor=i.scaleFactor,this.showCollisionBoxes=i.showCollisionBoxes,this.showElevationIdDebug=i.showElevationIdDebug,this.projection=i.projection,this.brightness=i.brightness,this.tileTransform=r.fI(i.tileID.canonical,i.projection),this.extraShadowCaster=i.extraShadowCaster,this.lut=i.lut,this.worldview=i.worldview,this.indoor=i.indoor,this.frcCoverage=i.frcCoverage||null}updateImageMapAndGetImageTaskQueue(i,r,n){let a=new Map;for(let o of r.keys())for(let s of n.get(o)||[]){let n=s.toString(),o=r.get(s.id.toString());o.usvg?a.has(n)||(a.set(n,s),i.set(n,Object.assign({},o))):i.set(n,o)}return a}cancelRasterize(){this.rasterizeTask&&this.rasterizeTask.cancel()}}function w(i,n,a,o,s,l){let u=new r.w(n,{brightness:a,worldview:s,activeFloors:l});for(let r of i)r.recalculate(u,o)}class T extends r.y{constructor({actor:i,layerIndex:n,availableImages:a,availableModels:o,isSpriteLoaded:s,tileProvider:l,brightness:u,maxUniformBufferBindings:c,maxUniformBlockSizeDwords:d,disableSymbolUBO:h}){super(),this.actor=i,this.layerIndex=n,this.availableImages=a,this.availableModels=o,this.loadVectorData=r.e9,this.tileProvider=l,this.loading={},this.loaded={},this.deduped=new r.m(i.scheduler),this.isSpriteLoaded=s,this.scheduler
8=i.scheduler,this.brightness=u,this.maxUniformBufferBindings=c,this.maxUniformBlockSizeDwords=d,this.disableSymbolUBO=h}loadTileData(i,r){if(!this.tileProvider)return this.loadVectorData(i,r);let n=new AbortController;return this.loadTileWithProvider(this.tileProvider,i,n,r),()=>n.abort()}async loadTileWithProvider(i,r,n,a){let{z:o,x:s,y:l}=r.tileID.canonical;try{let u=await i.loadTile({z:o,x:s,y:l},{request:r.request,signal:n.signal});if(n.signal.aborted)return;if(null==u){let i=Error("Tile not found");return i.status=404,a(i)}if(null==u.data)return a(null,null);if(u.data instanceof ImageBitmap)return a(Error("Vector tiles require ArrayBuffer data"));let c=new Map;u.expires&&c.set("expires",u.expires),u.cacheControl&&c.set("cache-control",u.cacheControl),a(null,{rawData:u.data,responseHeaders:c})}catch(i){if(n.signal.aborted)return;a(i instanceof Error?i:Error(String(i)))}}loadTile(i,n){let o=i.uid,s=i&&i.request,l=s&&s.collectResourceTiming,u=this.loading[o]=new b(i);u.maxUniformBufferBindings=this.maxUniformBufferBindings,u.maxUniformBlockSizeDwords=this.maxUniformBlockSizeDwords,u.disableSymbolUBO=this.disableSymbolUBO,u.abort=this.loadTileData(i,(c,d)=>{let h=!this.loading[o];if(delete this.loading[o],u.cancelRasterize(),h||c||!d)return u.status="done",h||(this.loaded[o]=u),n(c);let f=d.rawData,p={},m=r.cO(d.responseHeaders);m&&m.expires&&(p.expires=m.expires),m&&m.cacheControl&&(p.cacheControl=m.cacheControl),u.vectorTile=d.vectorTile||new r.be(new r.as(f));let g=()=>{u.parse(u.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,(i,r)=>{if(i||!r)return n(i);let o={};if(l){let i=a(s);i.length>0&&(o.resourceTiming=JSON.parse(JSON.stringify(i)))}n(null,Object.assign({rawTileData:f.slice(0),responseHeaders:d.responseHeaders},r,p,o))})};this.isSpriteLoaded?g():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(g,{type:"parseTile",renderSourceType:i.renderSourceType,zoom:i.tileZoom}):g()}),this.loaded=this.loaded||{},this.loaded[o]=u})}reloadTile(i,r){let n=this.loaded,a=i.uid;if(n&&n[a]){let o=n[a];o.updateParameters(i);let s=(i,n)=>{let a=o.reloadCallback;a&&(delete o.reloadCallback,o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,a)),r(i,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,s):s())}else r(null,void 0)}abortTile(i,r){let n=i.uid,a=this.loading[n];a&&(a.abort&&a.abort(),delete this.loading[n]),r()}removeTile(i,r){let n=this.loaded,a=i.uid;n&&n[a]&&delete n[a],r()}}class E{constructor(i){this.tileProvider=i.tileProvider,this.loading={}}loadTile(i,n){let a=i.uid;if(this.tileProvider){let r=new AbortController;return this.loading[a]={cancel:()=>r.abort()},void this.loadTileWithProvider(this.tileProvider,a,i,r,n)}let{cancel:o}=r.cG(i.request,(o,s,l)=>{let u=!this.loading[a];if(delete this.loading[a],u||o||!s)return n(o);this.decodeTile(a,s,i.encoding).then(i=>{let{expires:a,cacheControl:o}=r.cO(l);n(null,Object.assign(i,{expires:a,cacheControl:o}))}).catch(i=>n(i))});this.loading[a]={cancel:o}}async decodeTile(i,n,a){let o=n instanceof ImageBitmap?n:await createImageBitmap(new Blob([new Uint8Array(n)],{type:"image/png"})),s=1-(o.width-r.eU(o.width))/2,l=s<1,u=this.getImageData(o,s);return o.close(),{dem:new r.D(i,u,a,l),borderReady:l}}async loadTileWithProvider(i,r,n,a,o){let{z:s,x:l,y:u}=n.tileID.canonical;try{let c=await i.loadTile({z:s,x:l,y:u},{request:n.request,signal:a.signal});if(a.signal.aborted)return o(null,null);if(null==c){let i=Error("Tile not found");return i.status=404,o(i)}if(null==c.data)return o(null,null);let d=await this.decodeTile(r,c.data,n.encoding);if(a.signal.aborted)return o(null,null);o(null,Object.assign(d,{expires:c.expires,cacheControl:c.cacheControl}))}catch(i){if(a.signal.aborted||i instanceof DOMException&&"AbortError"===i.name)return o(null,null);o(i instanceof Error?i:Error(String(i)))}finally{delete this.loading[r]}}reloadTile(i,r){r(null,null)}abortTile(i,r){let n=i.uid,a=this.loading[n];
8a&&(a.cancel(),delete this.loading[n]),r()}removeTile(i,r){r()}getImageData(i,r){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(i.width,i.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=i.width,this.offscreenCanvas.height=i.height,this.offscreenCanvasContext.drawImage(i,0,0,i.width,i.height);let n=this.offscreenCanvasContext.getImageData(-r,-r,i.width+2*r,i.height+2*r);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),n}}r.af.setPbf(r.as);class S{constructor(i){this._mrt=new r.af(i.partial?30:1/0),this._isHeaderLoaded=!1,this.uid=i.uid,this.tileID=i.tileID,this.source=i.source}parse(i,n){let a=this._mrt;this.status="parsing",this._entireBuffer=i;try{a.parseHeader(i),this._isHeaderLoaded=!0;let o=[];for(let n in a.layers){let s=a.getLayer(n),l=s.getDataRange(s.getBandList()),u=a.createDecodingTask(l),c=i.slice(l.firstByte,l.lastByte+1),d=r.af.performDecoding(c,u).then(i=>u.complete(null,i)).catch(i=>u.complete(i,null));o.push(d)}Promise.allSettled(o).then(()=>n(null,a)).catch(i=>n(i))}catch(i){n(i)}}}class A{constructor({actor:i}){this.actor=i,this.loading={},this.loaded={}}loadTile(i,n){let a=i.uid,o=i.request,s=this.loading[a]=new S(i),{cancel:l}=r.cG(o,(i,r,o)=>{let l=!this.loading[a];if(delete this.loading[a],l||i||!r)return s.status="done",l||(this.loaded[a]=s),n(i);s.parse(r,(i,r)=>{if(i||!r)return n(i);n(null,r,o)}),this.loaded[a]=s});s.abort=l}reloadTile(i,r){r(null,void 0)}abortTile(i,r){let n=i.uid,a=this.loading[n];a&&(a.abort&&a.abort(),delete this.loading[n]),r()}removeTile(i,r){let n=i.uid;this.loaded[n]&&delete this.loaded[n],r()}decodeRasterArray(i,n){r.af.performDecoding(i.buffer,i.task).then(i=>n(null,i)).catch(i=>n(i))}}let C=r.bf.prototype.toGeoJSON;class I{constructor(i){this._feature=i,this.extent=r.r,this.type=i.type,this.properties=i.tags,"id"in i&&!isNaN(i.id)&&(this.id=parseInt(i.id,10))}loadGeometry(){if(1===this._feature.type){let i=[];for(let n of this._feature.geometry)i.push([new r.au(n[0],n[1])]);return i}{let i=[];for(let n of this._feature.geometry){let a=[];for(let i of n)a.push(new r.au(i[0],i[1]));i.push(a)}return i}}toGeoJSON(i,r,n){return C.call(this,i,r,n)}}class k{constructor(i,n){this.name=i,this.extent=r.r,this.length=n.length,this._jsonFeatures=n}feature(i){return new I(this._jsonFeatures[i])}}class R{constructor(i){for(const n of(this.layers={},this.extent=r.r,Object.keys(i)))this.layers[n]=new k(n,i[n])}}let M=64/4096;class L{constructor(){this.features=new Map}clear(){this.features.clear()}load(i=[],r){for(let n of i){let i=n.id;if(null==i)continue;let a=this.features.get(i);a&&this.updateCache(a,r),n.geometry?(a=function(i){let{id:r,geometry:n,properties:a}=i;if(!n)return;if("GeometryCollection"===n.type)throw Error("GeometryCollection not supported in dynamic mode.");let{type:o,coordinates:s}=n,l={id:r,type:1,geometry:[],tags:a,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},u=l.geometry;if("Point"===o)O(s,u,l);else if("MultiPoint"===o)for(let i of s)O(i,u,l);else if("LineString"===o)l.type=2,D(s,u,l);else if("MultiLineString"===o)l.type=2,F(s,u,l);else if("Polygon"===o)l.type=3,F(s,u,l,!0);else{if("MultiPolygon"!==o)throw Error("Input data is not a valid GeoJSON object.");for(let i of(l.type=3,s))F(i,u,l,!0)}return l}(n),this.updateCache(a,r),this.features.set(i,a)):this.features.delete(i),this.updateCache(a,r)}}updateCache(i,r){for(let{canonical:n,uid:a}of Object.values(r)){let{z:o,x:s,y:l}=n;P(i,Math.pow(2,o),s,l)&&delete r[a]}}getTile(i,n,a){let o=Math.pow(2,i),s=[];for(let i of this.features.values())P(i,o,n,a)&&s.push(function(i,n,a,o){let{id:s,type:l,geometry:u,tags:c}=i,d=[];if(1===l)for(let i=0;i<u.length;i+=2){let s=Math.round(r.r*(u[i+0]*n-a)),l=Math.round(r.r*(u[i+1]*n-o));d.push([s,l])}else if(2===l)for(let i of u)!function(i,n,a,o,s){let l,u=r.r+128;for(let c=0;c<i.length-2;c+=2){let d=Math.round(r.r*(i[c+0]*n-a)),h=Math.round(r.r*(i[c+1]*n-o)),f=Math.round(r.r*(i[c+2]*n-a)),p=Math.round(r.r*(i[c+3]*n-o)),m=f-d,g=p-h;d<-128&&f<-128||(d<-128?(h+=Math.round((-128-d)/m*g),d=-128):f<-128&&(p=h+Math.round((-128-d)/m*g),f=-128),h<-128&&p<-128||(h<-128?(d+=Math.round((-128-h)/g*m),h=-128):p<-128&&(f=d+Math.round((-128-h)/g*m),p=-128),d>=u&&f>=u||(d>=u?(h+=Math.round((u-d)/m*g),d=u):f>=u&&(p=h+Math.round((u-d)/m*g),f=u),h>=u&&p>=u||(h>=u?(d+=Math.round((u-h)/g*m),h=u):p>=u&&(f=d+Math.round((u-h)/g*m),p=u),l&&d===l.at(-1)[0]&&h===l.at(-1)[1]||(l=[[d,h]],s.push(l)),l.push([f,p])))))}}(i,n,a,o,d);else if(3===l)for(let i of u)!function(i,n,a,o,s){let l=(a-M)/n,u=(o-M)/n,c=(a+1+M)/n,d=(o+1+M)/n;function h(i,r){let n=0;return i<l?n|=1:i>c&&(n|=2),r<u?n|=4:r>d&&(n|=8),n}let f=[];for(let r=1;r<=8;r*=2){let n=i[i.length-2],a=i.at(-1),o=!(h(n,a)&r);for(let s=0;s<i.length;s+=2){let p=i[s],m=i[s+1],g=!(h(p,m)&r);g!==o&&(8&r?f.push(n+(p-n)*(d-a)/(m-a),d):4&r?f.push(n+(p-n)*(u-a)/(m-a),u):2&r?f.push(c,a+(m-a)*(c-n)/(p-n)):1&r&&f.push(l,a+(m-a)*(l-n)/(p-n))),g&&f.push(p,m),n=p,a=m,o=g}if(!(i=f).length||8===r)break;f=[]}let p=[];for(let i=0;i<f.length;i+=2)p.push([Math.round(r.r*(f[i]*n-a)),Math.round(r.r*(f[i+1]*n-o))]);p.length&&s.push(p)}(i,n,a,o,d);return{id:s,type:l,geometry:d,tags:c}}(i,o,n,a));return{features:s}}getFeatures(){return[...this.features.values()]}}function P({minX:i,minY:r,maxX:n,maxY:a},o,s,l){return i<(s+1+M)/o&&r<(l+1+M)/o&&n>(s-M)/o&&a>(l-M)/o}function O([i,n],a,o){let s=r.ek(i),l=r.el(n);l=l<0?0:l>1?1:l,a.push(s,l),o.minX=Math.min(o.minX,s),o.minY=Math.min(o.minY,l),o.maxX=Math.max(o.maxX,s),o.maxY=Math.max(o.maxY,l)}function D(i,r,n,a=!1,o=!1){let s=[];for(let r of i)O(r,s,n);r.push(s),a&&function(i,r){let n=0;for(let r=0,a=i.length,o=a-2;r<a;o=r,r+=2)n+=(i[r]-i[o])*(i[r+1]+i[o+1]);if(n>0===r)for(let r=0,n=i.length;r<n/2;r+=2){let a=i[r],o=i[r+1];i[r]=i[n-2-r],i[r+1]=i[n-1-r],i[n-2-r]=a,i[n-1-r]=o}}(s,o)}function F(i,r,n,a=!1){for(let o=0;o<i.length;o++)D(i[o],r,n,a,0===o)}function N({name:i,features:n},a){a.writeStringField(1,i),a.writeVarintField(5,r.r);let o=new Map,s=new Map,l={keys:o,values:s,feature:null};for(let i of n)l.feature=i,a.writeMessage(2,j,l);for(let i of o.keys())a.writeStringField(3,i);for(let i of s.keys())a.writeMessage(4,H,i)}function j(i,r){let n=i.feature;
8void 0!==n.id&&Number.isSafeInteger(+n.id)&&r.writeVarintField(1,+n.id),n.tags&&r.writeMessage(2,z,i),r.writeVarintField(3,n.type),r.writeMessage(4,V,n)}function z({keys:i,values:r,feature:n},a){for(let o of Object.keys(n.tags)){let s=n.tags[o];if(null===s)continue;let l=i.get(o);void 0===l&&(l=i.size,i.set(o,l)),a.writeVarint(l);let u=typeof s;"string"!==u&&"boolean"!==u&&"number"!==u&&(s=JSON.stringify(s));let c=r.get(s);void 0===c&&(c=r.size,r.set(s,c)),a.writeVarint(c)}}function B(i,r){return(r<<3)+(7&i)}function U(i){return i<<1^i>>31}function V(i,r){let{geometry:n,type:a}=i,o=0,s=0;if(1===a)for(let i of(r.writeVarint(B(1,n.length)),n)){let n=i[0]-o,a=i[1]-s;r.writeVarint(U(n)),r.writeVarint(U(a)),o+=n,s+=a}else for(let i of n){if(0===i.length)continue;r.writeVarint(B(1,1));let n=i.length-(3===a);for(let a=0;a<n;a++){1===a&&r.writeVarint(B(2,n-1));let l=i[a][0]-o,u=i[a][1]-s;r.writeVarint(U(l)),r.writeVarint(U(u)),o+=l,s+=u}3===a&&r.writeVarint(B(7,1))}}function H(i,r){let n=typeof i;"string"===n?r.writeStringField(1,i):"boolean"===n?r.writeBooleanField(7,i):"number"===n&&(i%1!=0?r.writeDoubleField(3,i):i<0?r.writeSVarintField(6,i):r.writeVarintField(5,i))}let G={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:i=>i},q=Math.fround||(n=new Float32Array(1),i=>(n[0]=+i,n[0]));class ${constructor(i){this.options=Object.assign(Object.create(G),i),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(i){let{log:r,minZoom:n,maxZoom:a}=this.options;r&&console.time("total time");let o=`prepare ${i.length} points`;r&&console.time(o),this.points=i;let s=[];for(let r=0;r<i.length;r++){let n=i[r];if(!n.geometry)continue;let[a,o]=n.geometry.coordinates,l=q(Z(a)),u=q(K(o));s.push(l,u,1/0,r,-1,1),this.options.reduce&&s.push(0)}let l=this.trees[a+1]=this._createTree(s);r&&console.timeEnd(o);for(let i=a;i>=n;i--){let n=+Date.now();l=this.trees[i]=this._createTree(this._cluster(l,i)),r&&console.log("z%d: %d clusters in %dms",i,l.numItems,Date.now()-n)}return r&&console.timeEnd("total time"),this}getClusters(i,r){let n=((i[0]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,i[1])),o=180===i[2]?180:((i[2]+180)%360+360)%360-180,s=Math.max(-90,Math.min(90,i[3]));if(i[2]-i[0]>=360)n=-180,o=180;else if(n>o){let i=this.getClusters([n,a,180,s],r),l=this.getClusters([-180,a,o,s],r);return i.concat(l)}let l=this.trees[this._limitZoom(r)],u=l.range(Z(n),K(s),Z(o),K(a)),c=l.data,d=[];for(let i of u){let r=this.stride*i;d.push(c[r+5]>1?W(c,r,this.clusterProps):this.points[c[r+3]])}return d}getChildren(i){let r=this._getOriginId(i),n=this._getOriginZoom(i),a="No cluster with the specified id.",o=this.trees[n];if(!o)throw Error(a);let s=o.data;if(r*this.stride>=s.length)throw Error(a);let l=this.options.radius/(this.options.extent*Math.pow(2,n-1)),u=o.within(s[r*this.stride],s[r*this.stride+1],l),c=[];for(let r of u){let n=r*this.stride;s[n+4]===i&&c.push(s[n+5]>1?W(s,n,this.clusterProps):this.points[s[n+3]])}if(0===c.length)throw Error(a);return c}getLeaves(i,r,n){let a=[];return this._appendLeaves(a,i,r=r||10,n=n||0,0),a}getTile(i,r,n){let a=this.trees[this._limitZoom(i)],o=Math.pow(2,i),{extent:s,radius:l}=this.options,u=l/s,c=(n-u)/o,d=(n+1+u)/o,h={features:[]};return this._addTileFeatures(a.range((r-u)/o,c,(r+1+u)/o,d),a.data,r,n,o,h),0===r&&this._addTileFeatures(a.range(1-u/o,c,1,d),a.data,o,n,o,h),r===o-1&&this._addTileFeatures(a.range(0,c,u/o,d),a.data,-1,n,o,h),h.features.length?h:null}getClusterExpansionZoom(i){let r=this._getOriginZoom(i)-1;for(;r<=this.options.maxZoom;){let n=this.getChildren(i);if(r++,1!==n.length)break;i=n[0].properties.cluster_id}return r}_appendLeaves(i,r,n,a,o){for(let s of this.getChildren(r)){let r=s.properties;if(r&&r.cluster?o+r.point_count<=a?o+=r.point_count:o=this._appendLeaves(i,r.cluster_id,n,a,o):o<a?o++:i.push(s),i.length===n)break}return o}_createTree(i){let n=new r.a6(i.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<i.length;r+=this.stride)n.add(i[r],i[r+1]);return n.finish(),n.data=i,n}_addTileFeatures(i,r,n,a,o,s){for(let l of i){let i,u,c,d,h=l*this.stride,f=r[h+5]>1;if(f)i=Y(r,h,this.clusterProps),u=r[h],c=r[h+1];else{let n=this.points[r[h+3]];i=n.properties;let[a,o]=n.geometry.coordinates;u=Z(a),c=K(o)}let p={type:1,geometry:[[Math.round(this.options.extent*(u*o-n)),Math.round(this.options.extent*(c*o-a))]],tags:i};void 0!==(d=f||this.options.generateId?r[h+3]:this.points[r[h+3]].id)&&(p.id=d),s.features.push(p)}}_limitZoom(i){return Math.max(this.options.minZoom,Math.min(Math.floor(+i),this.options.maxZoom+1))}_cluster(i,r){let{radius:n,extent:a,reduce:o,minPoints:s}=this.options,l=n/(a*Math.pow(2,r)),u=i.data,c=[],d=this.stride;for(let n=0;n<u.length;n+=d){if(u[n+2]<=r)continue;u[n+2]=r;let a=u[n],h=u[n+1],f=i.within(u[n],u[n+1],l),p=u[n+5],m=p;for(let i of f){let n=i*d;u[n+2]>
8r&&(m+=u[n+5])}if(m>p&&m>=s){let i,s=a*p,l=h*p,g=-1,_=(n/d<<5)+(r+1)+this.points.length;for(let a of f){let c=a*d;if(u[c+2]<=r)continue;u[c+2]=r;let h=u[c+5];s+=u[c]*h,l+=u[c+1]*h,u[c+4]=_,o&&(i||(i=this._map(u,n,!0),g=this.clusterProps.length,this.clusterProps.push(i)),o(i,this._map(u,c)))}u[n+4]=_,c.push(s/m,l/m,1/0,_,-1,m),o&&c.push(g)}else{for(let i=0;i<d;i++)c.push(u[n+i]);if(m>1)for(let i of f){let n=i*d;if(!(u[n+2]<=r)){u[n+2]=r;for(let i=0;i<d;i++)c.push(u[n+i])}}}}return c}_getOriginId(i){return i-this.points.length>>5}_getOriginZoom(i){return(i-this.points.length)%32}_map(i,r,n){if(i[r+5]>1){let a=this.clusterProps[i[r+6]];return n?Object.assign({},a):a}let a=this.points[i[r+3]].properties,o=this.options.map(a);return n&&o===a?Object.assign({},o):o}}function W(i,r,n){return{type:"Feature",id:i[r+3],properties:Y(i,r,n),geometry:{type:"Point",coordinates:[360*(i[r]-.5),360*Math.atan(Math.exp((180-360*i[r+1])*Math.PI/180))/Math.PI-90]}}}function Y(i,r,n){let a=i[r+5],o=a>=1e4?`${Math.round(a/1e3)}k`:a>=1e3?Math.round(a/100)/10+"k":a,s=i[r+6];return Object.assign(-1===s?{}:Object.assign({},n[s]),{cluster:!0,cluster_id:i[r+3],point_count:a,point_count_abbreviated:o})}function Z(i){return i/360+.5}function K(i){let r=Math.sin(i*Math.PI/180),n=.5-.25*Math.log((1+r)/(1-r))/Math.PI;return n<0?0:n>1?1:n}function X(i,r,n,a){let o={id:i??null,type:r,geometry:n,tags:a,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===r||"MultiPoint"===r||"LineString"===r)Q(o,n);else if("Polygon"===r)Q(o,n[0]);else if("MultiLineString"===r)for(let i of n)Q(o,i);else if("MultiPolygon"===r)for(let i of n)Q(o,i[0]);return o}function Q(i,r){for(let n=0;n<r.length;n+=3)i.minX=Math.min(i.minX,r[n]),i.minY=Math.min(i.minY,r[n+1]),i.maxX=Math.max(i.maxX,r[n]),i.maxY=Math.max(i.maxY,r[n+1])}function J(i,r,n,a){if(!r.geometry)return;let o=r.geometry.coordinates;if(o&&0===o.length)return;let s=r.geometry.type,l=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),u=[],c=r.id;if(n.promoteId?c=r.properties[n.promoteId]:n.generateId&&(c=a||0),"Point"===s)ee(o,u);else if("MultiPoint"===s)for(let i of o)ee(i,u);else if("LineString"===s)et(o,u,l,!1);else if("MultiLineString"===s){if(n.lineMetrics){for(let n of o)et(n,u=[],l,!1),i.push(X(c,"LineString",u,r.properties));return}ei(o,u,l,!1)}else if("Polygon"===s)ei(o,u,l,!0);else{if("MultiPolygon"!==s){if("GeometryCollection"===s){for(let o of r.geometry.geometries)J(i,{id:c,geometry:o,properties:r.properties},n,a);return}throw Error("Input data is not a valid GeoJSON object.")}for(let i of o){let r=[];ei(i,r,l,!0),u.push(r)}}i.push(X(c,s,u,r.properties))}function ee(i,r){r.push(i[0]/360+.5,er(i[1]),0)}function et(i,r,n,a){let o,s,l=0;for(let n=0;n<i.length;n++){let u=i[n][0]/360+.5,c=er(i[n][1]);r.push(u,c,0),n>0&&(l+=a?(o*c-u*s)/2:Math.sqrt(Math.pow(u-o,2)+Math.pow(c-s,2))),o=u,s=c}let u=r.length-3;r[2]=1,function i(r,n,a,o){let s=o,l=n+(a-n>>1),u,c=a-n,d=r[n],h=r[n+1],f=r[a],p=r[a+1];for(let i=n+3;i<a;i+=3){let n=function(i,r,n,a,o,s){let l=o-n,u=s-a;if(0!==l||0!==u){let c=((i-n)*l+(r-a)*u)/(l*l+u*u);c>1?(n=o,a=s):c>0&&(n+=l*c,a+=u*c)}return(l=i-n)*l+(u=r-a)*u}(r[i],r[i+1],d,h,f,p);if(n>s)u=i,s=n;else if(n===s){let r=Math.abs(i-l);r<c&&(u=i,c=r)}
8}s>o&&(u-n>3&&i(r,n,u,o),r[u+2]=s,a-u>3&&i(r,u,a,o))}(r,0,u,n),r[u+2]=1,r.size=Math.abs(l),r.start=0,r.end=r.size}function ei(i,r,n,a){for(let o=0;o<i.length;o++){let s=[];et(i[o],s,n,a),r.push(s)}}function er(i){let r=Math.sin(i*Math.PI/180),n=.5-.25*Math.log((1+r)/(1-r))/Math.PI;return n<0?0:n>1?1:n}function en(i,r,n,a,o,s,l,u){if(a/=r,s>=(n/=r)&&l<a)return i;if(l<n||s>=a)return null;let c=[];for(let r of i){let i=r.geometry,s=r.type,l=0===o?r.minX:r.minY,g=0===o?r.maxX:r.maxY;if(l>=n&&g<a){c.push(r);continue}if(g<n||l>=a)continue;let _=[];if("Point"===s||"MultiPoint"===s){var d=i,h=_,f=n,p=a,m=o;for(let i=0;i<d.length;i+=3){let r=d[i+m];r>=f&&r<=p&&el(h,d[i],d[i+1],d[i+2])}}else if("LineString"===s)ea(i,_,n,a,o,!1,u.lineMetrics);else if("MultiLineString"===s)es(i,_,n,a,o,!1);else if("Polygon"===s)es(i,_,n,a,o,!0);else if("MultiPolygon"===s)for(let r of i){let i=[];es(r,i,n,a,o,!0),i.length&&_.push(i)}if(_.length){if(u.lineMetrics&&"LineString"===s){for(let i of _)c.push(X(r.id,s,i,r.tags));continue}"LineString"!==s&&"MultiLineString"!==s||(1===_.length?(s="LineString",_=_[0]):s="MultiLineString"),"Point"!==s&&"MultiPoint"!==s||(s=3===_.length?"Point":"MultiPoint"),c.push(X(r.id,s,_,r.tags))}}return c.length?c:null}function ea(i,r,n,a,o,s,l){let u=eo(i),c=0===o?eu:ec,d,h,f=i.start;for(let p=0;p<i.length-3;p+=3){let m=i[p],g=i[p+1],_=i[p+2],y=i[p+3],v=i[p+4],x=0===o?m:g,b=0===o?y:v,w=!1;l&&(d=Math.sqrt(Math.pow(m-y,2)+Math.pow(g-v,2))),x<n?b>=n&&(h=c(u,m,g,y,v,n),l&&(u.start=f+d*h)):x>a?b<=a&&(h=c(u,m,g,y,v,a),l&&(u.start=f+d*h)):el(u,m,g,_),b<n&&x>=n&&(h=c(u,m,g,y,v,n),w=!0),b>a&&x<=a&&(h=c(u,m,g,y,v,a),w=!0),!s&&w&&(l&&(u.end=f+d*h),r.push(u),u=eo(i)),l&&(f+=d)}let p=i.length-3,m=i[p],g=i[p+1],_=0===o?m:g;_>=n&&_<=a&&el(u,m,g,i[p+2]),p=u.length-3,s&&p>=3&&(u[p]!==u[0]||u[p+1]!==u[1])&&el(u,u[0],u[1],u[2]),u.length&&r.push(u)}function eo(i){let r=[];return r.size=i.size,r.start=i.start,r.end=i.end,r}function es(i,r,n,a,o,s){for(let l of i)ea(l,r,n,a,o,s,!1)}function el(i,r,n,a){i.push(r,n,a)}function eu(i,r,n,a,o,s){let l=(s-r)/(a-r);return el(i,s,n+(o-n)*l,1),l}function ec(i,r,n,a,o,s){let l=(s-n)/(o-n);return el(i,r+(a-r)*l,s,1),l}function ed(i,r){let n=[];for(let a=0;a<i.length;a++){let o,s=i[a],l=s.type;if("Point"===l||"MultiPoint"===l||"LineString"===l)o=eh(s.geometry,r);else if("MultiLineString"===l||"Polygon"===l)for(let i of(o=[],s.geometry))o.push(eh(i,r));else if("MultiPolygon"===l)for(let i of(o=[],s.geometry)){let n=[];for(let a of i)n.push(eh(a,r));o.push(n)}
8n.push(X(s.id,l,o,s.tags))}return n}function eh(i,r){let n=[];n.size=i.size,void 0!==i.start&&(n.start=i.start,n.end=i.end);for(let a=0;a<i.length;a+=3)n.push(i[a]+r,i[a+1],i[a+2]);return n}function ef(i,r){if(i.transformed)return i;let n=1<<i.z,a=i.x,o=i.y;for(let s of i.features){let i=s.geometry,l=s.type;if(s.geometry=[],1===l)for(let l=0;l<i.length;l+=2)s.geometry.push(ep(i[l],i[l+1],r,n,a,o));else for(let l=0;l<i.length;l++){let u=[];for(let s=0;s<i[l].length;s+=2)u.push(ep(i[l][s],i[l][s+1],r,n,a,o));s.geometry.push(u)}}return i.transformed=!0,i}function ep(i,r,n,a,o,s){return[Math.round(n*(i*a-o)),Math.round(n*(r*a-s))]}function em(i,r,n,a,o,s){let l=a*a;if(a>0&&r.size<(o?l:a))return void(n.numPoints+=r.length/3);let u=[];for(let i=0;i<r.length;i+=3)(0===a||r[i+2]>l)&&(n.numSimplified++,u.push(r[i],r[i+1])),n.numPoints++;o&&function(i,r){let n=0;for(let r=0,a=i.length,o=a-2;r<a;o=r,r+=2)n+=(i[r]-i[o])*(i[r+1]+i[o+1]);if(n>0===r)for(let r=0,n=i.length;r<n/2;r+=2){let a=i[r],o=i[r+1];i[r]=i[n-2-r],i[r+1]=i[n-1-r],i[n-2-r]=a,i[n-1-r]=o}}(u,s),i.push(u)}let eg={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class e_{constructor(i,r){const n=(r=this.options=function(i,r){for(let n in r)i[n]=r[n];return i}(Object.create(eg),r)).debug;if(n&&console.time("preprocess data"),r.maxZoom<0||r.maxZoom>24)throw Error("maxZoom should be in the 0-24 range");if(r.promoteId&&r.generateId)throw Error("promoteId and generateId cannot be used together.");let a=function(i,r){let n=[];if("FeatureCollection"===i.type)for(let a=0;a<i.features.length;a++)J(n,i.features[a],r,a);else J(n,"Feature"===i.type?i:{geometry:i},r);return n}(i,r);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",r.indexMaxZoom,r.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(a=function(i,r){let n=r.buffer/r.extent,a=i,o=en(i,1,-1-n,n,0,-1,2,r),s=en(i,1,1-n,2+n,0,-1,2,r);return(o||s)&&(a=en(i,1,-n,1+n,0,-1,2,r)||[],o&&(a=ed(o,1).concat(a)),s&&(a=a.concat(ed(s,-1)))),a}(a,r)).length&&this.splitTile(a,0,0,0),n&&(a.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(i,r,n,a,o,s,l){let u=[i,r,n,a],c=this.options,d=c.debug;for(;u.length;){a=u.pop(),n=u.pop(),r=u.pop(),i=u.pop();let h=1<<r,f=ey(r,n,a),p=this.tiles[f];if(!p&&(d>1&&console.time("creation"),p=this.tiles[f]=function(i,r,n,a,o){let s=r===o.maxZoom?0:o.tolerance/((1<<r)*o.extent),l={features:[],numPoints:0,numSimplified:0,numFeatures:i.length,source:null,x:n,y:a,z:r,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let r of i)!function(i,r,n,a){let o=r.geometry,s=r.type,l=[];if(i.minX=Math.min(i.minX,r.minX),i.minY=Math.min(i.minY,r.minY),i.maxX=Math.max(i.maxX,r.maxX),i.maxY=Math.max(i.maxY,r.maxY),"Point"===s||"MultiPoint"===s)for(let r=0;r<o.length;r+=3)l.push(o[r],o[r+1]),i.numPoints++,i.numSimplified++;else if("LineString"===s)em(l,o,i,n,!1,!1);else if("MultiLineString"===s||"Polygon"===s)for(let r=0;r<o.length;r++)em(l,o[r],i,n,"Polygon"===s,0===r);else if("MultiPolygon"===s)for(let r=0;r<o.length;r++){let a=o[r];for(let r=0;r<a.length;r++)em(l,a[r],i,n,!0,0===r)}if(l.length){let n=r.tags||null;if("LineString"===s&&a.lineMetrics){for(let i in n={},r.tags)n[i]=r.tags[i];n.mapbox_clip_start=o.start/o.size,n.mapbox_clip_end=o.end/o.size}let u={geometry:l,type:"Polygon"===s||"MultiPolygon"===s?3:"LineString"===s||"MultiLineString"===s?2:1,tags:n};null!==r.id&&(u.id=r.id),i.features.push(u)}}(l,r,s,o);return l}(i,r,n,a,c),this.tileCoords.push({z:r,x:n,y:a}),d)){d>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",r,n,a,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));let i=`z${r}`;this.stats[i]=(this.stats[i]||0)+1,this.total++}if(p.source=i,null==o){if(r===c.indexMaxZoom||p.numPoints<=c.indexMaxPoints)continue}else{if(r===c.maxZoom||r===o)continue;if(null!=o){let i=o-r;if(n!==s>
8>i||a!==l>>i)continue}}if(p.source=null,0===i.length)continue;d>1&&console.time("clipping");let m=.5*c.buffer/c.extent,g=.5-m,_=.5+m,y=1+m,v=null,x=null,b=null,w=null,T=en(i,h,n-m,n+_,0,p.minX,p.maxX,c),E=en(i,h,n+g,n+y,0,p.minX,p.maxX,c);T&&(v=en(T,h,a-m,a+_,1,p.minY,p.maxY,c),x=en(T,h,a+g,a+y,1,p.minY,p.maxY,c)),E&&(b=en(E,h,a-m,a+_,1,p.minY,p.maxY,c),w=en(E,h,a+g,a+y,1,p.minY,p.maxY,c)),d>1&&console.timeEnd("clipping"),u.push(v||[],r+1,2*n,2*a),u.push(x||[],r+1,2*n,2*a+1),u.push(b||[],r+1,2*n+1,2*a),u.push(w||[],r+1,2*n+1,2*a+1)}}getTile(i,r,n){i*=1,r*=1,n*=1;let{extent:a,debug:o}=this.options;if(i<0||i>24)return null;let s=1<<i,l=ey(i,r=r+s&s-1,n);if(this.tiles[l])return ef(this.tiles[l],a);o>1&&console.log("drilling down to z%d-%d-%d",i,r,n);let u,c=i,d=r,h=n;for(;!u&&c>0;)c--,d>>=1,h>>=1,u=this.tiles[ey(c,d,h)];return u&&u.source?(o>1&&(console.log("found parent tile z%d-%d-%d",c,d,h),console.time("drilling down")),this.splitTile(u.source,c,d,h,i,r,n),o>1&&console.timeEnd("drilling down"),this.tiles[l]?ef(this.tiles[l],a):null):null}}function ey(i,r,n){return 32*((1<<i)*n+r)+i}function ev(i,n){let a=i.tileID.canonical;if(!this._geoJSONIndex)return void n(null,null);let o=this._geoJSONIndex.getTile(a.z,a.x,a.y);if(!o)return void n(null,null);let s=i=>i.tags&&"3d_elevation_id"in i.tags&&"source"in i.tags&&"elevation"===i.tags.source,l=o.features.filter(i=>s(i)),u={_geojsonTileLayer:o.features};l.length>0&&(u={_geojsonTileLayer:o.features.filter(i=>!s(i)),hd_road_elevation:l}),n(null,{vectorTile:new R(u),rawData:function(i){let n=new r.at;for(let r of Object.keys(i))n.writeMessage(3,N,{name:r,features:i[r]});return n.finish()}(u).buffer})}class ex extends T{constructor(i){super(i),this.loadVectorData=ev,this._dynamicIndex=new L}loadData(i,n){let o=i&&i.request,s=o&&o.collectResourceTiming;this._geoJSONIndex=null,this.loadGeoJSON(i,(l,u)=>{if(l||!u)return n(l);if("object"!=typeof u)return n(Error(`Input data given to '${i.source}' is not a valid GeoJSON object.`));{try{var c,d;if(i.filter){let n=r.bY(i.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===n.result)throw Error(n.value.map(i=>`${i.key}: ${i.message}`).join(", "));u.features=u.features.filter(i=>n.value.evaluate({zoom:0},i))}i.dynamic?("Feature"===u.type&&(u={type:"FeatureCollection",features:[u]}),i.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(u.features,this.loaded),i.cluster&&(u.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=i.cluster?new $(function({superclusterOptions:i,clusterProperties:n}){if(!n||!i)return i;let a={},o={},s={accumulated:null,zoom:0},l={properties:null},u=Object.keys(n);for(let i of u){let[s,l]=n[i],u=r.bY(l),c=r.bY("string"==typeof s?[s,["accumulated"],["get",i]]:s);a[i]=u.value,o[i]=c.value}return i.map=i=>{l.properties=i;let r={};for(let i of u)r[i]=a[i].evaluate(s,l);return r},i.reduce=(i,r)=>{for(let n of(l.properties=r,u))s.accumulated=i[n],i[n]=o[n].evaluate(s,l)},i}(i)).load(u.features):i.dynamic?this._dynamicIndex:(c=u,d=i.geojsonVtOptions,new e_(c,d))}catch(i){return n(i)}let l={};if(s){let r=a(o);r&&(l.resourceTiming={},l.resourceTiming[i.source]=JSON.parse(JSON.stringify(r)))}n(null,l)}})}reloadTile(i,r){let n=this.loaded;return n&&n[i.uid]?i.partial?r(null,void 0):super.reloadTile(i,r):this.loadTile(i,r)}loadGeoJSON(i,n){if(i.request)r.cT(i.request,n);else{if("string"!=typeof i.data)return n(Error(`Input data given to '${i.source}' is not a valid GeoJSON object.`));setTimeout(()=>{try{return n(null,JSON.parse(i.data))}catch(r){return n(Error(`Input data given to '${i.source}' is not a valid GeoJSON object.`))}},0)}}getClusterExpansionZoom(i,r){try{r(null,this._geoJSONIndex.getClusterExpansionZoom(i.clusterId))}catch(i){r(i)}}getClusterChildren(i,r){try{r(null,this._geoJSONIndex.getChildren(i.clusterId))}catch(i){r(i)}}getClusterLeaves(i,r){try{r(null,this._geoJSONIndex.getLeaves(i.clusterId,i.limit,i.offset))}catch(i){r(i)}}}class eb{constructor(i,n,a){this.tileID=new r.ap(i.tileID.overscaledZ,i.tileID.wrap,i.tileID.canonical.z,i.tileID.canonical.x,i.tileID.canonical.y),this.tileZoom=i.tileZoom,this.uid=i.uid,this.zoom=i.zoom,this.canonical=i.tileID.canonical,this.pixelRatio=i.pixelRatio,this.tileSize=i.tileSize,this.source=i.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=i.projection,this.brightness=n,this.worldview=a}parse(i,n,a,o){this.status="parsing";let s=new r.ap(a.tileID.overscaledZ,a.tileID.wrap,a.tileID.canonical.z,a.tileID.canonical.x,a.tileID.canonical.y),l=[],u=n.familiesBySource[a.source],c=new r.I(s,a.promoteId);c.bucketLayerIDs=[],c.is3DTile=!0,r.e5(i).then(i=>{let n=i.json.extensionsUsed&&i.json.extensionsUsed.includes("MAPBOX_mesh_features")||i.json.asset.extras&&i.json.asset.extras.MAPBOX_mesh_features,d=i.json.extensionsUsed&&i.json.extensionsUsed.includes("EXT_meshopt_compression"),h=new r.w(this.zoom,{brightness:this.brightness,worldview:this.worldview});for(let o in u)for(let f of u[o]){let o=f[0];c.bucketLayerIDs.push(f.map(i=>r.ea(i.id,i.scope))),o.recalculate(h,[]);let u=r.eV(i,1/r.fH(a.tileID.canonical)),p=new r.b1(f,u,s,n,d,this.brightness,c,this.worldview);n||(p.needsUpload=!0),l.push(p),p.evaluate(o)}this.status="done",o(null,{buckets:l,featureIndex:c,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:null})}).catch(i=>o(Error(i.message)))}}class ew{constructor({actor:i,layerIndex:r,availableImages:n,availableModels:a,brightness:o,worldview:s}){this.actor=i,this.layerIndex=r,this.availableImages=n,this.availableModels=a,this.brightness=o,this.loading={},this.loaded={},this.worldview=s}loadTile(i,n){let a=i.uid,o=this.loading[a]=new eb(i,this.brightness,this.worldview);r.cG(i.request,(r,s)=>{let l=!this.loading[a];return delete this.loading[a],l||r?(o.status="done",l||(this.loaded[a]=o),n(r)):s&&0!==s.byteLength?void o.parse(s,this.layerIndex,i,(i,r)=>{o.status="done",this.loaded=this.loaded||{},this.loaded[a]=o,i||!r?n(i):n(null,r)}
8):(o.status="done",this.loaded[a]=o,n())})}reloadTile(i,r){let n=this.loaded,a=i.uid;if(n&&n[a]){let o=n[a];o.projection=i.projection,o.brightness=i.brightness;let s=(n,a)=>{o.reloadCallback&&(delete o.reloadCallback,this.loadTile(i,r)),r(n,a)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&this.loadTile(i,r)}}abortTile(i,r){let n=i.uid;this.loading[n]&&delete this.loading[n],r()}removeTile(i,r){let n=this.loaded,a=i.uid;n&&n[a]&&delete n[a],r()}}class eT{constructor(i){this.self=i,this.actor=new r.a(i,this),this.layerIndexes={},this.availableImages={},this.availableModels={},this.isSpriteLoaded={},this.rtlPluginParsingListeners=[],this.projections={},this.defaultProjection=r.c$({name:"mercator"}),this.workerSourceTypes={vector:T,geojson:ex,"raster-dem":E,"raster-array":A,"batched-model":ew},this.workerSources={},this.self.registerWorkerSource=(i,r)=>{if(this.workerSourceTypes[i])throw Error(`Worker source with name "${i}" already registered.`);this.workerSourceTypes[i]=r},this.self.registerRTLTextPlugin=i=>{if(r.eH.isParsed())throw Error("RTL text plugin already registered.");for(let n of(r.eH.setState({pluginStatus:r.f7.parsed,pluginURL:r.eH.getPluginURL()}),r.eH.applyArabicShaping=i.applyArabicShaping,r.eH.processBidirectionalText=i.processBidirectionalText,r.eH.processStyledBidirectionalText=i.processStyledBidirectionalText,this.rtlPluginParsingListeners))n(null,!0);this.rtlPluginParsingListeners=[]}}clearCaches(i,r,n){delete this.layerIndexes[i],delete this.availableImages[i],delete this.availableModels[i],delete this.workerSources[i],n()}checkIfReady(i,r,n){n()}setReferrer(i,r){this.referrer=r}spriteLoaded(i,n){this.isSpriteLoaded[i]||(this.isSpriteLoaded[i]={});let{scope:a,isLoaded:o}=n;if(this.isSpriteLoaded[i][a]=o,this.workerSources[i]&&this.workerSources[i][a])for(let n in this.workerSources[i][a]){let s=this.workerSources[i][a][n];for(let i in s){let n=s[i];n instanceof T&&(n.isSpriteLoaded=o,n.fire(new r.x("isSpriteLoaded")))}}}setImages(i,r,n){this.availableImages[i]||(this.availableImages[i]={});let{scope:a,images:o}=r;if(this.availableImages[i][a]=o,this.workerSources[i]&&this.workerSources[i][a]){for(let r in this.workerSources[i][a]){let n=this.workerSources[i][a][r];for(let i in n)n[i].availableImages=o}n()}else n()}setModels(i,{scope:r,models:n},a){if(this.availableModels[i]||(this.availableModels[i]={}),this.availableModels[i][r]=n,this.workerSources[i]&&this.workerSources[i][r]){for(let a in this.workerSources[i][r]){let o=this.workerSources[i][r][a];for(let i in o)o[i].availableModels=n}a()}else a()}setProjection(i,n){this.projections[i]=r.c$(n)}setBrightness(i,r,n){this.brightness=r,n()}setContextParams(i,r,n){this.maxUniformBufferBindings=r.maxBindingPoints,this.maxUniformBlockSizeDwords=r.maxUniformBlockSizeDwords,this.disableSymbolUBO=r.disableSymbolUBO,n()}setWorldview(i,r,n){this.worldview=r,n()}setLayers(i,r,n){this.getLayerIndex(i,r.scope).replace(r.layers,r.options),n()}updateLayers(i,r,n){this.getLayerIndex(i,r.scope).update(r.layers,r.removedIds,r.options),n()}loadTile(i,r,n){r.projection=this.projections[i]||this.defaultProjection,this.getWorkerSource(i,r).loadTile(r,n)}decodeRasterArray(i,r,n){this.getWorkerSource(i,r).decodeRasterArray(r,n)}reloadTile(i,r,n){r.projection=this.projections[i]||this.defaultProjection,this.getWorkerSource(i,r).reloadTile(r,n)}abortTile(i,r,n){this.getWorkerSource(i,r).abortTile(r,n)}removeTile(i,r,n){this.getWorkerSource(i,r).removeTile(r,n)}removeSource(i,r,n){if(!(this.workerSources[i]&&this.workerSources[i][r.scope]&&this.workerSources[i][r.scope][r.type]&&this.workerSources[i][r.scope][r.type][r.source]))return;let a=this.workerSources[i][r.scope][r.type][r.source];delete this.workerSources[i][r.scope][r.type][r.source],void 0!==a.removeSource?a.removeSource(r,n):n()}loadTileProvider(i,n,a){r.e8(n.name,n.url).then(r=>{let a=new r(n.options);return this.getWorkerSource(i,{type:n.type,source:n.source,scope:n.scope},a),a.load&&n.request?a.load({request:n.request}):null}).then(i=>a(null,i)).catch(i=>a(i instanceof Error?i:Error(String(i))))}async syncRTLPluginState(i,n,a){if(r.eH.isParsed())return void a(null,!0);if(r.eH.isParsing())return void this.rtlPluginParsingListeners.push(a);r.eH.setState(n);let o=r.eH.getPluginURL();if(!r.eH.isLoaded()||r.eH.isParsed()||r.eH.isParsing())a(null,!1);else{r.eH.setState({pluginStatus:r.f7.parsing,pluginURL:o});try{await import(o),r.eH.isParsed()?a(null,!0):this.rtlPluginParsingListeners.push(a)}catch(i){for(let n of(r.eH.setState({pluginStatus:r.f7.error,pluginURL:o}),a(i),this.rtlPluginParsingListeners))n(i);this.rtlPluginParsingListeners=[]}}}setConfig(i,n){Object.assign(r.bN,n)}getAvailableImages(i,r){this.availableImages[i]||(this.availableImages[i]={});let n=this.availableImages[i][r];return n||(n=[]),n}getAvailableModels(i,r){this.availableModels[i]||(this.availableModels[i]={});let n=this.availableModels[i][r];return n||(n={}),n}getLayerIndex(i,r){this.layerIndexes[i]||(this.layerIndexes[i]={});let n=this.layerIndexes[i][r];return n||((n=this.layerIndexes[i][r]=new g).scope=r),n}getWorkerSource(i,r,n){let{type:a,source:o,scope:s}=r,l=this.workerSources;if(l[i]||(l[i]={}),l[i][s]||(l[i][s]={}),l[i][s][a]||(l[i][s][a]={}),this.isSpriteLoaded[i]||(this.isSpriteLoaded[i]={}),l[i][s][a][o])n&&(l[i][s][a][o].tileProvider=n);else{let r={send:(r,n,a,o,s,l)=>this.actor.send(r,n,a,i,s,l),scheduler:this.actor.scheduler},u=this.workerSourceTypes[a];if(!u)throw Error(`Unknown worker source type "${a}".`);l[i][s][a][o]=new u({actor:r,layerIndex:this.getLayerIndex(i,s),availableImages:this.getAvailableImages(i,s),availableModels:this.getAvailableModels(i,s),isSpriteLoaded:this.isSpriteLoaded[i][s],tileProvider:n,brightness:this.brightness,worldview:this.worldview,maxUniformBufferBindings:this.maxUniformBufferBindings,maxUniformBlockSizeDwords:this.maxUniformBlockSizeDwords,disableSymbolUBO:this.disableSymbolUBO})}return l[i][s][a][o]}enforceCacheSizeLimit(i,n){r.cf(n)}getWorkerPerformanceMetrics(i,r,n){n(void 0,void 0)}}return r.dR(self)&&(self.worker=new eT(self)),eT}),a(["./shared"],function(i){let r,n,a,o,s,l,u,c,d;var h="3.25.0";let f={create:"create",load:"load",fullLoad:"fullLoad"},p={mark(i){performance.mark(i)},measure(i,r,n){performance.measure(i,r,n)}};function m(r){let n=r.name.split("?")[0];return i.dF(n)&&n.includes("mapbox-gl.js")?"javascript":i.dF(n)&&n.includes("mapbox-gl.css")?"css":i.dG(n)?"fontRange":i.dH(n)?"sprite":i.dI(n)?"style":i.dJ(n)?"tilejson":"other"}let g={antialias:!1,alpha:!0,stencil:!0,depth:!0};function _(i){let r,n=document.createElement("canvas"),a=Object.create(g);a.failIfMajorPerformanceCaveat=i;let o=n.getContext("webgl2",a);if(!o)return!1;try{r=o.createShader(o.VERTEX_SHADER)}catch(i){return!1}return!(!r||o.isContextLost())&&(o.shaderSource(r,"void main() {}"),o.compileShader(r),!0===o.getShaderParameter(r,o.COMPILE_STATUS))}let y=/firefox/i,v=/macintosh/i;function x(i,r,n){let a=document.createElement(i);return null!=r&&(a.className=r),n&&n.appendChild(a),a}function b(i,r,n){let a=document.createElementNS("http://www.w3.org/2000/svg",i);for(let i of Object.keys(r))a.setAttributeNS(null,i,String(r[i]));return n&&n.appendChild(a),a}let w="u">typeof document?document.documentElement&&document.documentElement.style:null,T=w&&void 0!==w.userSelect?"userSelect":"WebkitUserSelect";function E(){w&&T&&(a=w[T],w[T]="none")}function S(){w&&T&&(w[T]=a)}function A(i){i.preventDefault(),i.stopPropagation(),window.removeEventListener("click",A,!0)}function C(){window.addEventListener("click",A,!0),window.setTimeout(()=>{window.removeEventListener("click",A,!0)},0)}function I(i,r){let n=i.getBoundingClientRect();return M(i,n,r)}function k(i,r){let n=i.getBoundingClientRect(),a=[];for(let o=0;o<r.length;o++)a.push(M(i,n,r[o]));return a}function R(i){return y.test(navigator.userAgent)&&v.test(navigator.userAgent)&&2===i.button&&i.ctrlKey?0:i.button}function M(r,n,a){let o=r.offsetWidth===n.width?1:r.offsetWidth/n.width;return new i.au((a.clientX-n.left)*o,(a.clientY-n.top)*o)}
8let L=/(\.(png|jpg)\d*)(?=$)/,P=/^.+\/v4\//,O=/\.[\w]+$/,D=/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/,F=/^access_token=(.*)$/,N="NO_ACCESS_TOKEN";class j{constructor(i,r,n){this._transformRequestFn=i,this._customAccessToken=r,this._silenceAuthErrors=!!n,this._createSkuToken()}_createSkuToken(){let i=function(){let i="";for(let r=0;r<10;r++)i+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:"101"+i,tokenExpiresAt:Date.now()+432e5}}();this._skuToken=i.token,this._skuTokenExpiresAt=i.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(i,r){return this._transformRequestFn&&this._transformRequestFn(i,r)||{url:i}}normalizeStyleURL(r,n){if(!i.dL(r))return r;let a=B(r);return a.params.push(`sdk=js-${h}`),a.path=`/styles/v1${a.path}`,this._makeAPIURL(a,this._customAccessToken||n)}normalizeGlyphsURL(r,n){if(!i.dL(r))return r;let a=B(r);return a.path=`/fonts/v1${a.path}`,this._makeAPIURL(a,this._customAccessToken||n)}normalizeModelURL(r,n){if(!i.dL(r))return r;let a=B(r);return a.path=`/models/v1${a.path}`,this._makeAPIURL(a,this._customAccessToken||n)}normalizeSourceURL(r,n,a,o){if(!i.dL(r))return r;let s=B(r);return s.path=`/v4/${s.authority}.json`,s.params.push("secure"),a&&s.params.push(`language=${a}`),o&&s.params.push(`worldview=${o}`),this._makeAPIURL(s,this._customAccessToken||n)}normalizeIconsetURL(r,n){let a=B(r);return i.dL(r)?(a.path=`/styles/v1${a.path}/iconset.pbf`,this._makeAPIURL(a,this._customAccessToken||n)):U(a)}normalizeSpriteURL(r,n,a,o){let s=B(r);return i.dL(r)?(s.path=`/styles/v1${s.path}/sprite${n}${a}`,this._makeAPIURL(s,this._customAccessToken||o)):(s.path+=`${n}${a}`,U(s))}normalizeTileURL(r,n,a){if(this._isSkuTokenExpired()&&this._createSkuToken(),r&&!i.dL(r))return r;let o=B(r);o.path=o.path.replace(L,`${n||a&&"raster"!==o.authority&&512===a?"@2x":""}${i.cn.supported?".webp":"$1"}`),"raster"===o.authority?o.path=`/${i.bN.RASTER_URL_PREFIX}${o.path}`:"rasterarrays"===o.authority?o.path=`/${i.bN.RASTERARRAYS_URL_PREFIX}${o.path}`:"3dtiles"===o.authority?o.path=`/${i.bN.TILES3D_URL_PREFIX}${o.path}`:(o.path=o.path.replace(P,"/"),o.path=`/${i.bN.TILE_URL_VERSION}${o.path}`);let s=this._customAccessToken||function(i){for(let r of i){let i=r.match(F);if(i)return i[1]}return null}(o.params)||i.bN.ACCESS_TOKEN;return i.bN.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&o.params.push(`sku=${this._skuToken}`),this._makeAPIURL(o,s)}canonicalizeTileURL(r,n){let a=B(r);if(!D.test(a.path)||!O.test(a.path))return r;let o="mapbox://";a.path.startsWith("/raster/v1/")?o+=`raster/${a.path.replace(`/${i.bN.RASTER_URL_PREFIX}/`,"")}`:a.path.startsWith("/rasterarrays/v1/")?o+=`rasterarrays/${a.path.replace(`/${i.bN.RASTERARRAYS_URL_PREFIX}/`,"")}`:o+=`tiles/${a.path.replace(`/${i.bN.TILE_URL_VERSION}/`,"")}`;let s=a.params;return n&&(s=s.filter(i=>!i.match(F))),s.length&&(o+=`?${s.join("&")}`),o}canonicalizeTileset(r,n){let a=!!n&&i.dL(n),o=[];for(let n of r.tiles||[])i.dK(n)?o.push(this.canonicalizeTileURL(n,a)):o.push(n);return o}_makeAPIURL(r,n){let a="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",o=B(i.bN.API_URL);if(r.protocol=o.protocol,r.authority=o.authority,"http"===r.protocol){let i=r.params.indexOf("secure");i>=0&&r.params.splice(i,1)}if("/"!==o.path&&(r.path=`${o.path}${r.path}`),!i.bN.REQUIRE_ACCESS_TOKEN)return U(r);if(n=n||i.bN.ACCESS_TOKEN,!this._silenceAuthErrors){if(!n)throw Error(`An API access token is required to use Mapbox GL. ${a}`);if("s"===n[0])throw Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${a}`)}return r.params=r.params.filter(i=>!i.includes("access_token")),r.params.push(`access_token=${n||""}`),U(r)}}let z=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function B(i){let r=i.match(z);if(!r)throw Error("Unable to parse URL object");return{protocol:r[1],authority:r[2],path:r[3]||"/",params:r[4]?r[4].split("&"):[]}}function U(i){let r=i.params.length?`?${i.params.join("&")}`:"";return`${i.protocol}://${i.authority}${i.path}${r}`}let V="mapbox.eventData";function H(r){if(!r)return null;let n=r.split(".");if(!n||3!==n.length)return null;try{return JSON.parse(i.bq(n[1]))}catch(i){return null}}function G(r){return!(!i.bN.EVENTS_URL||!r&&!i.bN.ACCESS_TOKEN)}let q=/^[\w.+-]+(\/[\w.+-]+)?$/,$="other";class W{constructor(i){this.type=i,this.anonId=null,this.anonIdTimestamp=null,this.eventData={},this.queue=[],this.pendingRequest=null}
8getStorageKey(r){let n=H(i.bN.ACCESS_TOKEN),a="";return a=n&&n.u?i.br(n.u):i.bN.ACCESS_TOKEN||"",r?`${V}.${r}:${a}`:`${V}:${a}`}fetchEventData(){let r=i.fv("localStorage"),n=this.getStorageKey(),a=this.getStorageKey("uuid"),o=this.getStorageKey("uuidTimestamp");if(r)try{let i=localStorage.getItem(n);i&&(this.eventData=JSON.parse(i));let r=localStorage.getItem(a);r&&(this.anonId=r);let s=localStorage.getItem(o);s&&(this.anonIdTimestamp=Number(s));let l=Date.now()-864e5;(!this.anonIdTimestamp||this.anonIdTimestamp<l)&&this.refreshUUID()}catch(r){i.f_("Unable to read from LocalStorage")}}refreshUUID(){this.anonId=i.fX(),this.anonIdTimestamp=Date.now()}saveEventData(){let r=i.fv("localStorage"),n=this.getStorageKey(),a=this.getStorageKey("uuid"),o=this.getStorageKey("uuidTimestamp"),s=this.anonId,l=this.anonIdTimestamp;if(r&&s)try{localStorage.setItem(a,s),Object.keys(this.eventData).length>=1&&localStorage.setItem(n,JSON.stringify(this.eventData)),l&&localStorage.setItem(o,l.toString())}catch(r){i.f_("Unable to write to LocalStorage")}}processRequests(i){}postEvent(r,n,a,o){if(!i.bN.EVENTS_URL)return;let s=B(i.bN.EVENTS_URL);s.params.push(`access_token=${o||i.bN.ACCESS_TOKEN||""}`);let l={event:this.type,created:new Date(r).toISOString()},u=n?Object.assign(l,n):l,c={url:U(s),headers:{"Content-Type":"text/plain"},body:JSON.stringify([u])};this.pendingRequest=i.eR(c,i=>{this.pendingRequest=null,a(i),this.saveEventData(),this.processRequests(o)})}queueRequest(i,r){this.queue.push(i),this.processRequests(r)}}class Y extends W{constructor(i){super("metrics"),i&&(this.data=i)}postMetricsEvent(r){if(!G(r))return;this.anonId||this.fetchEventData(),i.fZ(this.anonId)||this.refreshUUID();let n=Object.assign({},this.data,{sessionId:this.anonId});this.queueRequest({timestamp:Date.now(),payload:n},r)}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;let{timestamp:r,payload:n}=this.queue.shift();this.postEvent(r,n,()=>{},i)}}let Z=new class extends W{constructor(i){super("appUserTurnstile"),this._customAccessToken=i}postTurnstileEvent(r,n){G(n)&&Array.isArray(r)&&r.some(r=>i.dL(r)||i.dK(r))&&this.queueRequest(Date.now(),n)}processRequests(r){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.anonIdTimestamp&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();let n=H(i.bN.ACCESS_TOKEN),a=n?n.u:i.bN.ACCESS_TOKEN,s=a!==this.eventData.tokenU;i.fZ(this.anonId)||(this.refreshUUID(),s=!0);let l=this.queue.shift();if(this.eventData.lastSuccess){let i=new Date(this.eventData.lastSuccess),r=new Date(l),n=(l-this.eventData.lastSuccess)/864e5;s=s||n>=1||n<-1||i.getDate()!==r.getDate()}else s=!0;if(!s)return void this.processRequests();let u={version:"2.2",sdkIdentifier:"mapbox-gl-js",sdkVersion:h,skuId:"01","enabled.telemetry":!1,userId:this.anonId,bundleFormat:"umd",bundleDistribution:$};o&&(u.sdkInfo=o),this.postEvent(l,u,i=>{i||(this.eventData.lastSuccess=l,this.eventData.tokenU=a)},r)}},K=Z.postTurnstileEvent.bind(Z),X=new class extends W{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(r,n,a,o){this.skuToken=n,this.errorCb=o,i.bN.EVENTS_URL&&(a||i.bN.ACCESS_TOKEN?this.queueRequest({id:r,timestamp:Date.now()},a):this.errorCb(Error(N)))}processRequests(r){if(this.pendingRequest||0===this.queue.length)return;let{id:n,timestamp:a}=this.queue.shift();if(n&&this.success[n])return;this.anonId&&this.anonIdTimestamp||this.fetchEventData(),i.fZ(this.anonId)||this.refreshUUID();let s={version:"2.2",sdkIdentifier:"mapbox-gl-js",sdkVersion:h,skuId:"01",skuToken:this.skuToken,userId:this.anonId,bundleFormat:"umd",bundleDistribution:$};o&&(s.sdkInfo=o),this.postEvent(a,s,i=>{i?this.errorCb(i):n&&(this.success[n]=!0)},r)}remove(){this.errorCb=null}},Q=X.postMapLoadEvent.bind(X),J=new class extends W{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(r){let n=this.mapInstanceIdMap.get(r);return n||(n=i.fX(),this.mapInstanceIdMap.set(r,n)),n}getEventId(i){let r=this.eventIdPerMapInstanceMap.get(i)||0;return this.eventIdPerMapInstanceMap.set(i,r+1),r}postStyleLoadEvent(i,r){let{map:n,style:a,importedStyles:o}=r;if(!G(i))return;let s=this.getMapInstanceId(n),l={mapInstanceId:s,eventId:this.getEventId(s),style:a};o.length&&(l.importedStyles=o),this.queueRequest({timestamp:Date.now(),payload:l},i)}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;let{timestamp:r,payload:n}=this.queue.shift();this.postEvent(r,n,()=>{},i)}},ee=J.postStyleLoadEvent.bind(J),et=new Y({attributes:[{name:"maps/js/layer
8-animations/style-with-appearances"}]}),ei=et.postMetricsEvent.bind(et),er=new Y({attributes:[{name:"maps/js/layer-animations/runtime-appearances"}]}),en=er.postMetricsEvent.bind(er),ea=new class extends W{constructor(){super("gljs.performance")}postPerformanceEvent(i,r){G(i)&&this.queueRequest({timestamp:Date.now(),performanceData:r},i)}processRequests(r){if(this.pendingRequest||0===this.queue.length)return;let{timestamp:n,performanceData:a}=this.queue.shift(),o=function(r){let n=performance.getEntriesByType("resource"),a=performance.getEntriesByType("mark"),o=function(i){let r={};if(i){for(let n in i)if("other"!==n)for(let a of i[n]){let i=`${n}ResolveRangeMin`,o=`${n}ResolveRangeMax`,s=`${n}RequestCount`,l=`${n}RequestCachedCount`;r[i]=Math.min(r[i]||1/0,a.startTime),r[o]=Math.max(r[o]||-1/0,a.responseEnd);let u=i=>{void 0===r[i]&&(r[i]=0),++r[i]};void 0!==a.transferSize&&0===a.transferSize&&u(l),u(s)}}return r}(function(i,r){let n={};if(i)for(let a of i){let i=r(a);void 0===n[i]&&(n[i]=[]),n[i].push(a)}return n}(n,m)),s=window.devicePixelRatio,l=navigator.connection||navigator.mozConnection||navigator.webkitConnection,u=l?l.effectiveType:void 0,c={counters:[],metadata:[],attributes:[]},d=(i,r,n)=>{null!=n&&i.push({name:r,value:n.toString()})};for(let i in o)d(c.counters,i,o[i]);if(r.interactionRange[0]!==1/0&&r.interactionRange[1]!==-1/0&&(d(c.counters,"interactionRangeMin",r.interactionRange[0]),d(c.counters,"interactionRangeMax",r.interactionRange[1])),a)for(let i of Object.values(f)){let r=a.find(r=>r.name===i);r&&d(c.counters,i,r.startTime)}return d(c.counters,"visibilityHidden",r.visibilityHidden),d(c.attributes,"style",function(r){if(r)for(let n of r){let r=n.name.split("?")[0];if(i.dI(r)){let i=r.split("/").slice(-2);if(2===i.length)return`mapbox://styles/${i[0]}/${i[1]}`}}}(n)),d(c.attributes,"terrainEnabled",r.terrainEnabled?"true":"false"),d(c.attributes,"fogEnabled",r.fogEnabled?"true":"false"),d(c.attributes,"projection",r.projection),d(c.attributes,"zoom",r.zoom),d(c.metadata,"devicePixelRatio",s),d(c.metadata,"connectionEffectiveType",u),d(c.metadata,"navigatorUserAgent",navigator.userAgent),d(c.metadata,"screenWidth",window.screen.width),d(c.metadata,"screenHeight",window.screen.height),d(c.metadata,"windowWidth",window.innerWidth),d(c.metadata,"windowHeight",window.innerHeight),d(c.metadata,"mapWidth",r.width/s),d(c.metadata,"mapHeight",r.height/s),d(c.metadata,"webglRenderer",r.renderer),d(c.metadata,"webglVendor",r.vendor),d(c.metadata,"sdkVersion",h),d(c.metadata,"sdkIdentifier","mapbox-gl-js"),c}(a);for(let i of o.metadata);for(let i of o.counters);for(let i of o.attributes);this.postEvent(n,o,()=>{},r)}},eo=ea.postPerformanceEvent.bind(ea),es=new class extends W{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(r,n,a,o){if(!i.bN.API_URL||!i.bN.SESSION_PATH)return;let s=B(i.bN.API_URL+i.bN.SESSION_PATH);s.params.push(`sku=${n||""}`),s.params.push(`access_token=${o||i.bN.ACCESS_TOKEN||""}`);let l={url:U(s),headers:{"Content-Type":"text/plain"}};this.pendingRequest=i.cM(l,i=>{this.pendingRequest=null,a(i),this.saveEventData(),this.processRequests(o)})}getSessionAPI(r,n,a,o){this.skuToken=n,this.errorCb=o,i.bN.EVENTS_URL&&i.bN.SESSION_PATH&&i.bN.API_URL&&(a||i.bN.ACCESS_TOKEN?this.queueRequest({id:r,timestamp:Date.now()},a):this.errorCb(Error(N)))}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;let{id:r,timestamp:n}=this.queue.shift();r&&this.success[r]||this.getSession(n,this.skuToken,i=>{i?this.errorCb(i):r&&(this.success[r]=!0)},i)}remove(){this.errorCb=null}},el=es.getSessionAPI.bind(es),eu=new Set;function ec(i,r){r?eu.add(i):eu.delete(i)}class ed{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages={}}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(i,r){this._updatedSourceCaches[i]=r,this.setDirty()}discardSourceCacheUpdate(i){delete this._updatedSourceCaches[i]}updateLayer(i){let r=i.scope;this._updatedLayers[r]=this._updatedLayers[r]||new Set,this._updatedLayers[r].add(i.id),this.setDirty()}removeLayer(i){let r=i.scope;this._removedLayers[r]=this._removedLayers[r]||{},this._updatedLayers[r]=this._updatedLayers[r]||new Set,this._removedLayers[r][i.id]=i,this._updatedLayers[r].delete(i.id),this._updatedPaintProps.delete(i.fqid),this.setDirty()}getRemovedLayer(i){return this._removedLayers[i.scope]?this._removedLayers[i.scope][i.id]:null}discardLayerRemoval(i){this._removedLayers[i.scope]&&delete this._removedLayers[i.scope][i.id]}getLayerUpdatesByScope(){let i={};for(let r in this._updatedLayers)i[r]=i[r]||{},i[r].updatedIds=Array.from(this._updatedLayers[r].values());for(let r in this._removedLayers)i[r]=i[r]||{},i[r].removedIds=Object.keys(this._removedLayers[r]);return i}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(i){this._updatedPaintProps.add(i.fqid),this.setDirty()}getUpdatedImages(i){return this._updatedImages[i]?Array.from(this._updatedImages[i].values()):[]}updateImage(r,n){this._updatedImages[n]=this._updatedImages[n]||new Set,this._updatedImages[n].add(i.a1.toString(r)),this.setDirty()}resetUpdatedImages(i){this._updatedImages[i]&&this._updatedImages[i].clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages={}}}let eh=new i.i(0,0,0);function ef(i,r){let n=[],a=i[`stretch_${r}`],o=null;for(let i=0;i<a.length;i++)null===o?o=0===n.length?a[0]:n.at(-1)[1]+a[i]:(n.push([o,o+a[i]]),o=null);i[`stretch_${r}_areas`]=n}function ep(i,r){let n,a={};for(;n=i.nextField(r);)1===n?a.left=i.readVarint():2===n?a.width=i.readVarint():3===n?a.top=i.readVarint():4===n&&(a.height=i.readVarint());return a}function em(i,r){let n,a={};for(;n=i.nextField(r);)1===n?(a.group=function(i,r){let n,a={opacity:255,children:[]};for(;n=i.nextField(r);)1===n?a.transform=eg(i,i.readVarint()+i.pos):2===n?a.opacity=i.readVarint():5===n?a.clip_path_idx=i.readVarint():6===n?a.mask_idx=i.readVarint():7===n&&a.children.push(em(i,i.readVarint()+i.pos));return a}(i,i.readVarint()+i.pos),a.node="group"):2===n&&(a.path=function(i,r){let n,a={paint_order:1,commands:[],step:1,diffs:[],rule:1};for(;n=i.nextField(r);)1===n?a.fill=function(i,r){let n,a={rgb_color:eh,paint:"rgb_color",opacity:255};for(;n=i.nextField(r);)1===n?(a.rgb_color=e_(i.readVarint()),a.paint="rgb_color"):2===n?(a.linear_gradient_idx=i.readVarint(),a.paint="linear_gradient_idx"):3===n?(a.radial_gradient_idx=i.readVarint(),a.paint="radial_gradient_idx"):5===n&&(a.opacity=i.readVarint());return a}(i,i.readVarint()+i.pos):2===n?a.stroke=function(i,r){let n,a={rgb_color:eh,paint:"rgb_color",dasharray:[],dashoffset:0,miterlimit:4,opacity:255,width:1,linecap:1,linejoin:1};for(;n=i.nextField(r);)1===n?(a.rgb_color=e_(i.readVarint()),a.paint="rgb_color"):2===n?(a.linear_gradient_idx=i.readVarint(),a.paint="linear_gradient_idx"):3===n?(a.radial_gradient_idx=i.readVarint(),a.paint="radial_gradient_idx"):5===n?i.readPackedFloat(a.dasharray):6===n?a.dashoffset=i.readFloat():7===n?a.miterlimit=i.readFloat():8===n?a.opacity=i.readVarint():9===n?a.width=i.readFloat():10===n?a.linecap=i.readVarint():11===n&&(a.linejoin=i.readVarint());return a}(i,i.readVarint()+i.pos):3===n?a.paint_order=i.readVarint():5===n?i.readPackedVarint(a.commands):6===n?a.step=i.readFloat():7===n?i.readPackedSVarint(a.diffs):8===n&&(a.rule=i.readVarint());return a}(i,i.readVarint()+i.pos),a.node="path");return a}function eg(i,r){let n,a={sx:1,ky:0,kx:0,sy:1,tx:0,ty:0};for(;n=i.nextField(r);)1===n?a.sx=i.readFloat():2===n?a.ky=i.readFloat():3===n?a.kx=i.readFloat():4===n?a.sy=i.readFloat():5===n?a.tx=i.readFloat():6===n&&(a.ty=i.readFloat());return a}function e_(r){return new i.i((r>>16&255)/255,(r>>8&255)/255,(255&r)/255,1)}function ey(i,r){let n,a={offset:0,opacity:255,rgb_color:eh};for(;n=i.nextField(r);)1===n?a.offset=i.readFloat():2===n?a.opacity=i.readVarint():3===n&&(a.rgb_color=e_(i.readVarint()));return a}class ev{static calculate(r={},n=[]){let a=new Map,o=new Map;if(0===Object.keys(r).length)return a;for(let[s,l]of(n.forEach(r=>{o.set(r.name,r.rgb_color||new i.i(0,0,0))}),Object.entries(r)))o.has(s)?a.set(o.get(s).toString(),l):console.warn(`Ignoring unknown image variable "${s}"`);return a}}function ex(r,n=255,a){let o=a.get(r.toString())||r;return 255===n?o.toString():new i.i(o.r,o.g,o.b,o.a*n/255).toString()}let eb=[],ew=0;function eT(r,n){if(ew>=eb.length){let a=i.eA()?new OffscreenCanvas(r,n).getContext("2d",{willReadFrequently:!0}):document.createElement("canvas").getContext("2d",{willReadFrequently:!0});eb.push(a)}let a=eb[ew++];return a.canvas.width=r,a.canvas.height=n,a}function eE(i,r,n,a,o){for(let s of a.children)(function i(r,n,a,o,s){var l;o.group?(r.save(),function(r,n,a,o,s){var l,u;let c=null!=o.mask_idx?a.masks[o.mask_idx]:null,d=null!=o.clip_path_idx?a.clip_paths[o.clip_path_idx]:null;if(o.transform&&(n=eR(o.transform).preMultiplySelf(n)),l=null!=d,u=null!=c,255===o.opacity&&!l&&!u)return eE(r,n,a,o,s);let h=eT(r.canvas.width,r.canvas.height);eE(h,n,a,o,s),d&&function i(r,n,a,o){let s=eT(r.canvas.width,r.canvas.height);(function r(n,a,o,s){let l=s.transform?eR(s.transform).preMultiplySelf(a):a,u=eT(n.canvas.width,n.canvas.height);for(let i of s.children)if(i.group)r(u,l,o,i.group);else if(i.path){let r=i.path,n=new Path2D;n.addPath(eL(r),l),u.fill(n,eA(r))}let c=null!=s.clip_path_idx?o.clip_paths[s.clip_path_idx]:null;c&&i(u,l,o,c),n.globalCompositeOperation="source-over",n.drawImage(u.canvas,0,0),ew--})(s,n,a,o),r.globalCompositeOperation="destination-in",r.drawImage(s.canvas,0,0),ew--}(h,n,a,d),c&&function r(n,a,o,s,l){if(0===s.children.length)return;let u=null!=s.mask_idx?o.masks[s.mask_idx]:null;u&&r(n,a,o,u,l);let c=n.canvas.width,d=n.canvas.height,h=eT(c,d),f=s.width,p=s.height,m=s.left,g=s.top,_=new Path2D,y=new Path2D;for(let r of(y.rect(m,g,f,p),_.addPath(y,a),h.clip(_),s.children))i(h,a,o,r,l);let v=h.getImageData(0,0,c,d),x=v.data;if(1===s.mask_type)for(let i=0;i<x.length;i+=4)x[i+3]=x[i+3]/255*(.2126*x[i]+.7152*x[i+1]+.0722*x[i+2]);h.putImageData(v,0,0),n.globalCompositeOperation="destination-in",n.drawImage(h.canvas,0,0),ew--}(h,n,a,c,s),r.globalAlpha=o.opacity/255,r.drawImage(h.canvas,0,0),ew--}
8(r,n,a,o.group,s),r.restore()):o.path&&(r.save(),l=o.path,r.setTransform(n),1===l.paint_order?(eS(r,a,l,s),eC(r,a,l,s)):(eC(r,a,l,s),eS(r,a,l,s)),r.restore())})(i,r,n,s,o)}function eS(i,r,n,a){let o=n.fill;if(!o)return;let s=o.opacity/255;switch(i.save(),i.beginPath(),eM(n,i),o.paint){case"rgb_color":i.fillStyle=ex(o.rgb_color,o.opacity,a);break;case"linear_gradient_idx":{let n=r.linear_gradients[o.linear_gradient_idx];n.transform&&i.setTransform(eR(n.transform).preMultiplySelf(i.getTransform())),i.fillStyle=eI(i,n,s,a);break}case"radial_gradient_idx":{let n=r.radial_gradients[o.radial_gradient_idx];n.transform&&i.setTransform(eR(n.transform).preMultiplySelf(i.getTransform())),i.fillStyle=ek(i,n,s,a)}}i.fill(eA(n)),i.restore()}function eA(i){return 1===i.rule?"nonzero":2===i.rule?"evenodd":void 0}function eC(i,r,n,a){let o=n.stroke;if(!o)return;let s=eL(n);i.lineWidth=o.width,i.miterLimit=o.miterlimit,i.setLineDash(o.dasharray),i.lineDashOffset=o.dashoffset;let l=o.opacity/255;switch(o.paint){case"rgb_color":i.strokeStyle=ex(o.rgb_color,o.opacity,a);break;case"linear_gradient_idx":i.strokeStyle=eI(i,r.linear_gradients[o.linear_gradient_idx],l,a,!0);break;case"radial_gradient_idx":i.strokeStyle=ek(i,r.radial_gradients[o.radial_gradient_idx],l,a,!0)}switch(o.linejoin){case 2:case 1:i.lineJoin="miter";break;case 3:i.lineJoin="round";break;case 4:i.lineJoin="bevel"}switch(o.linecap){case 1:i.lineCap="butt";break;case 2:i.lineCap="round";break;case 3:i.lineCap="square"}i.stroke(s)}function eI(i,r,n,a,o=!1){if(1===r.stops.length){let i=r.stops[0];return ex(i.rgb_color,i.opacity*n,a)}let{x1:s,y1:l,x2:u,y2:c}=r,d=new DOMPoint(s,l),h=new DOMPoint(u,c);if(o){let i=eR(r.transform);d=i.transformPoint(d),h=i.transformPoint(h)}let f=i.createLinearGradient(d.x,d.y,h.x,h.y);for(let i of r.stops)f.addColorStop(i.offset,ex(i.rgb_color,i.opacity*n,a));return f}function ek(i,r,n,a,o=!1){if(1===r.stops.length){let i=r.stops[0];return ex(i.rgb_color,i.opacity*n,a)}let s=eR(r.transform),{fx:l,fy:u,fr:c,cx:d,cy:h,r:f}=r,p=new DOMPoint(l,u),m=new DOMPoint(d,h),g=c,_=f;if(o){p=s.transformPoint(p),m=s.transformPoint(m);let i=(s.a+s.d)/2;g=c*i,_=r.r*i}let y=i.createRadialGradient(p.x,p.y,g,m.x,m.y,_);for(let i of r.stops)y.addColorStop(i.offset,ex(i.rgb_color,i.opacity*n,a));return y}function eR(i){return i?new DOMMatrix([i.sx,i.ky,i.kx,i.sy,i.tx,i.ty]):new DOMMatrix}function eM(i,r){let n=i.step,a=i.diffs[0]*n,o=i.diffs[1]*n;r.moveTo(a,o);for(let s=0,l=2;s<i.commands.length;s++)switch(i.commands[s]){case 1:a+=i.diffs[l++]*n,o+=i.diffs[l++]*n,r.moveTo(a,o);break;case 2:a+=i.diffs[l++]*n,o+=i.diffs[l++]*n,r.lineTo(a,o);break;case 3:{let s=a+i.diffs[l++]*n,u=o+i.diffs[l++]*n;a=s+i.diffs[l++]*n,o=u+i.diffs[l++]*n,r.quadraticCurveTo(s,u,a,o);break}case 4:{let s=a+i.diffs[l++]*n,u=o+i.diffs[l++]*n,c=s+i.diffs[l++]*n,d=u+i.diffs[l++]*n;a=c+i.diffs[l++]*n,o=d+i.diffs[l++]*n,r.bezierCurveTo(s,u,c,d,a,o);break}case 5:r.closePath()}return r}function eL(i){return eM(i,new Path2D)}class eP{constructor(){this.cacheMap=new Map,this.cacheDependenciesMap=new Map}static _getImage(r){return new i.ay(r,r.data)}getFromCache(r,n,a){return this.cacheMap.has(a)||this.cacheMap.set(a,new i.a7(150)),this.cacheMap.get(a).get(i.ea(r.toString(),n))}setInCache(r,n,a,o){this.cacheDependenciesMap.has(o)||this.cacheDependenciesMap.set(o,new Map),this.cacheMap.has(o)||this.cacheMap.set(o,new i.a7(150));let s=this.cacheDependenciesMap.get(o),l=i.ea(r.id.toString(),a);s.get(l)||s.set(l,new Set);let u=this.cacheMap.get(o),c=r.toString();s.get(l).add(c),u.put(i.ea(r.toString(),a),n)}removeImagesFromCacheByIds(r,n,a=0){if(!this.cacheMap.has(a)||!this.cacheDependenciesMap.has(a))return;let o=this.cacheMap.get(a),s=this.cacheDependenciesMap.get(a);for(let a of r){let r=i.ea(a.toString(),n);if(s.has(r)){for(let i of s.get(r))o.delete(i);s.delete(r)}}}rasterize(i,r,n,a){var o;let s,l,u,c,d,h,f,p,m,g=this.getFromCache(i,n,a);if(g)return g.clone();let _=(o=r.icon,s=ev.calculate(i.params,o.metadata?o.metadata.variables:[]),u=(l=o.usvg_tree).width,c=l.height,d=Math.max(1,Math.round(u*i.sx)),f=new DOMMatrix([d/u,0,0,(h=Math.max(1,Math.round(c*i.sy)))/c,0,0]),eE(p=eT(d,h),f,l,l,s),m=p.getImageData(0,0,d,h),ew--,m),y=eP._getImage(_);return this.setInCache(i,y,n,a),y.clone()}}class eO extends i.y{constructor(r){super(),this.imageProviders=new Map,this.images=new Map,this.updatedImages=new Map,this.callbackDispatchedThisFrame=new Map,this.imageVersions=new Map,this.loaded=new Map,this.requestors=[],this.patterns=new Map,this.patternsInFlight=new Set,this.atlasImage=new Map,this.atlasTexture=new Map,this.imageAtlasCache=new i.$,this.dirty=!0,this.spriteFormat=r,this.imageRasterizer=new eP}addScope(r){this.loaded.set(r,!1),this.imageProviders.set(r,new Map),this.images.set(r,new Map),this.updatedImages.set(r,new Set),this.callbackDispatchedThisFrame.set(r,new Set),this.imageVersions.set(r,new Map),this.patterns.set(r,new Map),this.atlasImage.set(r,new i.ay({width:1,height:1}))}removeScope(i){this.loaded.delete(i),this.imageProviders.delete(i),this.images.delete(i),this.updatedImages.delete(i),this.callbackDispatchedThisFrame.delete(i),this.imageVersions.delete(i),this.patterns.delete(i),this.atlasImage.delete(i);let r=this.atlasTexture.get(i);r&&(r.destroy(),this.atlasTexture.delete(i))}addImageProvider(i,r){this.imageProviders.has(r)||this.imageProviders.set(r,new Map),this.imageProviders.get(r).set(i.id,i)}removeImageProvider(i,r){this.imageProviders.has(r)&&this.imageProviders.get(r).delete(i)}getPendingImageProviders(){let i=[];for(let r of this.imageProviders.values())for(let n of r.values())n.hasPendingRequests()&&i.push(n);return i}isLoaded(){for(let i of this.loaded.keys())if(!this.loaded.get(i))return!1;return!0}setLoaded(i,r){if(this.loaded.get(r)!==i&&(this.loaded.set(r,i),i)){for(let{ids:i,callback:n}of this.requestors)this._notify(i,r,n);this.requestors=[]}}hasImage(i,r){return!!this.getImage(i,r)}getImage(i,r){return this.images.get(r).get(i.toString())}
8addImage(i,r,n){if(this._validate(i,n)){this.images.get(r).set(i.toString(),n);let a=this.imageVersions.get(r),o=a.get(i.toString())||0;a.set(i.toString(),o+1)}}_validate(r,n){let a=!0;return this._validateStretch(n.stretchX,n.data&&n.data.width)||(this.fire(new i.v(Error(`Image "${r.name}" has invalid "stretchX" value`))),a=!1),this._validateStretch(n.stretchY,n.data&&n.data.height)||(this.fire(new i.v(Error(`Image "${r.name}" has invalid "stretchY" value`))),a=!1),this._validateContent(n.content,n)||(this.fire(new i.v(Error(`Image "${r.name}" has invalid "content" value`))),a=!1),a}_validateStretch(i,r){if(!i)return!0;let n=0;for(let a of i){if(a[0]<n||a[1]<a[0]||r<a[1])return!1;n=a[1]}return!0}_validateContent(i,r){return!i||4===i.length&&(!!r.usvg||!(i[0]<0)&&!(r.data.width<i[0])&&!(i[1]<0)&&!(r.data.height<i[1])&&!(i[2]<0)&&!(r.data.width<i[2])&&!(i[3]<0)&&!(r.data.height<i[3]))&&!(i[2]<i[0]||i[3]<i[1])}updateImage(i,r,n){n.version=this.images.get(r).get(i.toString()).version+1,this.images.get(r).set(i.toString(),n),this.updatedImages.get(r).add(i);let a=this.imageVersions.get(r),o=a.get(i.toString())||0;a.set(i.toString(),o+1),this.removeFromImageRasterizerCache(i,r)}clearUpdatedImages(i){this.updatedImages.get(i).clear()}removeFromImageRasterizerCache(i,r){"raster"!==this.spriteFormat&&this.imageRasterizer.removeImagesFromCacheByIds([i],r)}removeImage(i,r){let n=this.images.get(r),a=n.get(i.toString());n.delete(i.toString());let o=this.imageVersions.get(r),s=o.get(i.toString())||0;o.set(i.toString(),s+1),this.patterns.get(r).delete(i.toString()),this.removeFromImageRasterizerCache(i,r),a.userImage&&a.userImage.onRemove&&a.userImage.onRemove()}listImages(r){return Array.from(this.images.get(r).keys()).map(r=>i.a1.from(r))}getImageVersions(i){return this.imageVersions.get(i)||new Map}getImages(i,r,n){let a=[],o=[],s=this.imageProviders.get(r);for(let n of i){if(!n.iconsetId){a.push(n);continue}let i=s.get(n.iconsetId);i&&(this.getImage(n,r)?o.push(n):i.addPendingRequest(n))}if(0===a.length)return void this._notify(o,r,n);let l=!0,u=!!this.loaded.get(r),c=this.images.get(r);if(!u)for(let i of a)c.has(i.toString())||(l=!1);u||l?this._notify(a,r,n):this.requestors.push({ids:a,scope:r,callback:n})}rasterizeImages(i,r){let n=new Map,{iconTasks:a,patternTasks:o,scope:s}=i;for(let i of[a,o])for(let[r,a]of i.entries()){let i=this.getImage(a.id,s);i&&n.set(r,{image:i,imageVariant:a})}r(null,this._rasterizeImages(s,n))}_rasterizeImages(i,r){let n=new Map;for(let[a,{image:o,imageVariant:s}]of r.entries())n.set(a,this.imageRasterizer.rasterize(s,o,i,0));return n}getUpdatedImages(i){return this.updatedImages.get(i)||new Set}_notify(r,n,a){let o=this.images.get(n),s=new Map;for(let n of r){if(!o.get(n.toString())){if(n.iconsetId)continue;this.fire(new i.x("styleimagemissing",{id:n.name}))}let r=o.get(n.toString());if(!r){i.f_(`Image "${n.name}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`);continue}let a={data:r.usvg?null:r.data.clone(),pixelRatio:r.pixelRatio,sdf:r.sdf,usvg:r.usvg,stretchX:r.stretchX,stretchY:r.stretchY,content:r.content,hasRenderCallback:!!(r.userImage&&r.userImage.render)};r.usvg&&Object.assign(a,{width:r.icon.usvg_tree.width,height:r.icon.usvg_tree.height}),s.set(i.a1.toString(n),a)}a(null,{images:s,versions:this.getImageVersions(n)})}getPixelSize(i){let{width:r,height:n}=this.atlasImage.get(i);return{width:r,height:n}}getPattern(r,n,a){let o=r.toString(),s=this.patterns.get(n),l=s.get(o),u=this.getImage(r,n);if(!u)return null;if(l){if(l.position.version===u.version)return l.position;l.position.version=u.version}else{if(u.usvg&&!u.data){let s=this.getPatternInFlightId(o,n);if(this.patternsInFlight.has(s))return null;this.patternsInFlight.add(s);let l=new i.a4(r).scaleSelf(i.co.devicePixelRatio),c=new Map([[l.toString(),{image:u,imageVariant:l}]]),d=this._rasterizeImages(n,c);return this.storePatternImage(l,n,u,a,d),null}this.storePattern(r,n,u)}return this._updatePatternAtlas(n,a),s.get(o).position}getPatternInFlightId(r,n){return i.ea(r,n)}hasPatternsInFlight(){return 0!==this.patternsInFlight.size}storePatternImage(i,r,n,a,o){let s=i.toString(),l=o?o.get(s):void 0;l&&(n.data=l,this.storePattern(i.id,r,n),this._updatePatternAtlas(r,a),this.patternsInFlight.delete(this.getPatternInFlightId(i.id.toString(),r)))}storePattern(r,n,a){let o={w:a.data.width+2*i.aq,h:a.data.height+2*i.aq,x:0,y:0},s=new i.a2(o,a,i.aq);this.patterns.get(n).set(r.toString(),{bin:o,position:s})}destroyAtlasTextures(){for(let i of this.atlasTexture.values())i&&i.destroy();this.atlasTexture.clear()}bind(r,n){let a=r.gl,o=this.atlasTexture.get(n);o?this.dirty&&(o.update(this.atlasImage.get(n)),this.dirty=!1):(o=new i.a_(r,this.atlasImage.get(n),a.RGBA8),this.atlasTexture.set(n,o)),o.bind(a.LINEAR,a.CLAMP_TO_EDGE)}_updatePatternAtlas(r,n){let a=this.patterns.get(r),o=Array.from(a.values()).map(({bin:i})=>i),{w:s,h:l}=i.eT(o),u=this.atlasImage.get(r);u.resize({width:s||1,height:l||1});let c=this.images.get(r);for(let[r,{bin:o,position:s}]of a.entries()){let a=s.padding,l=o.x+a,d=o.y+a,h=c.get(r).data,f=h.width,p=h.height;a=a>1?a-1:a,i.ay.copy(h,u,{x:0,y:0},{x:l,y:d},{width:f,height:p},n),i.ay.copy(h,u,{x:0,y:p-a},{x:l,y:d-a},{width:f,height:a},n),i.ay.copy(h,u,{x:0,y:0},{x:l,y:d+p},{width:f,height:a},n),i.ay.copy(h,u,{x:f-a,y:0}
8,{x:l-a,y:d},{width:a,height:p},n),i.ay.copy(h,u,{x:0,y:0},{x:l+f,y:d},{width:a,height:p},n),i.ay.copy(h,u,{x:f-a,y:p-a},{x:l-a,y:d-a},{width:a,height:a},n),i.ay.copy(h,u,{x:0,y:p-a},{x:l+f,y:d-a},{width:a,height:a},n),i.ay.copy(h,u,{x:0,y:0},{x:l+f,y:d+p},{width:a,height:a},n),i.ay.copy(h,u,{x:f-a,y:0},{x:l-a,y:d+p},{width:a,height:a},n)}this.dirty=!0}beginFrame(){for(let i of this.images.keys())this.callbackDispatchedThisFrame.set(i,new Set);this.imageAtlasCache.beginFrame()}dispatchRenderCallbacks(i,r){let n=this.images.get(r);for(let a of i){if(this.callbackDispatchedThisFrame.get(r).has(a.toString()))continue;this.callbackDispatchedThisFrame.get(r).add(a.toString());let i=n.get(a.toString());(function(i){let{userImage:r}=i;return!!(r&&r.render&&r.render())&&(i.data.replace(new Uint8Array(r.data.buffer)),!0)})(i)&&this.updateImage(a,r,i)}}}class eD{constructor(i,r,n,a){this.message=(i?`${i}: `:"")+n,a&&(this.identifier=a),null!=r&&r.__line__&&(this.line=r.__line__)}}class eF extends eD{}function eN(r){let n=r.value,a=r.valueSpec,o=r.style,s=r.styleSpec,l=r.key,u=r.arrayElementValidator||e3;if(!Array.isArray(n))return[new eD(l,n,`array expected, ${i.da(n)} found`)];if(a.length&&n.length!==a.length)return[new eD(l,n,`array length ${a.length} expected, length ${n.length} found`)];if(a["min-length"]&&n.length<a["min-length"])return[new eD(l,n,`array length at least ${a["min-length"]} expected, length ${n.length} found`)];let c={type:a.value,values:a.values,minimum:a.minimum,maximum:a.maximum,function:void 0};s.$version<7&&(c.function=a.function),i.dN(a.value)&&(c=a.value);let d=[];for(let i=0;i<n.length;i++)d=d.concat(u({array:n,arrayIndex:i,value:n[i],valueSpec:c,style:o,styleSpec:s,key:`${l}[${i}]`},!0));return d}function ej(r){let n=r.key,a=r.value,o=r.valueSpec;if(!i.dM(a))return[new eD(n,a,`number expected, ${i.da(a)} found`)];if(a!=a)return[new eD(n,a,"number expected, NaN found")];if("minimum"in o){let i=o.minimum;if(Array.isArray(o.minimum)&&(i=o.minimum[r.arrayIndex]),a<i)return[new eD(n,a,`${a} is less than the minimum value ${i}`)]}if("maximum"in o){let i=o.maximum;if(Array.isArray(o.maximum)&&(i=o.maximum[r.arrayIndex]),a>i)return[new eD(n,a,`${a} is greater than the maximum value ${i}`)]}return[]}function ez(r){let n,a=r.key,o=r.value;if(!i.dN(o))return[new eD(a,o,`object expected, ${i.da(o)} found`)];let s=r.valueSpec,l=i.fT(o.type),u,c,d,h={},f="categorical"!==l&&void 0===o.property,p=Array.isArray(n=o.stops)&&Array.isArray(n[0])&&i.dN(n[0][0]),m=e8({key:r.key,value:r.value,valueSpec:r.styleSpec.function,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(i){if("identity"===l)return[new eD(i.key,i.value,'identity function may not have a "stops" property')];let r=[],n=i.value;return r=r.concat(eN({key:i.key,value:n,valueSpec:i.valueSpec,style:i.style,styleSpec:i.styleSpec,arrayElementValidator:g})),Array.isArray(n)&&0===n.length&&r.push(new eD(i.key,n,"array must have at least one stop")),r},default:function(i){return e3({key:i.key,value:i.value,valueSpec:s,style:i.style,styleSpec:i.styleSpec})}}});return"identity"===l&&f&&m.push(new eD(r.key,r.value,'missing required property "property"')),"identity"===l||o.stops||m.push(new eD(r.key,r.value,'missing required property "stops"')),"exponential"===l&&s.expression&&!i.fA(s)&&m.push(new eD(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(f||i.fC(s)?f&&!i.fD(s)&&m.push(new eD(r.key,r.value,"zoom functions not supported")):m.push(new eD(r.key,r.value,"property functions not supported"))),("categorical"===l||p)&&void 0===o.property&&m.push(new eD(r.key,r.value,'"property" property is required')),m;function g(r){let n=[],a=r.value,o=r.key;if(!Array.isArray(a))return[new eD(o,a,`array expected, ${i.da(a)} found`)];if(2!==a.length)return[new eD(o,a,`array length 2 expected, length ${a.length} found`)];if(p){if(!i.dN(a[0]))return[new eD(o,a,`object expected, ${i.da(a[0])} found`)];let s=a[0];if(void 0===s.zoom)return[new eD(o,a,"object stop key must have zoom")];if(void 0===s.value)return[new eD(o,a,"object stop key must have value")];let l=i.fT(s.zoom);if("number"!=typeof l)return[new eD(o,s.zoom,"stop zoom values must be numbers")];if(d&&d>l)return[new eD(o,s.zoom,"stop zoom values must appear in ascending order")];l!==d&&(d=l,c=void 0,h={}),n=n.concat(e8({key:`${o}[0]`,value:a[0],valueSpec:{zoom:{}},style:r.style,styleSpec:r.styleSpec,objectElementValidators:{zoom:ej,value:_}}))}else n=n.concat(_({key:`${o}[0]`,value:a[0],style:r.style,styleSpec:r.styleSpec},a));return i.dv(i.c3(a[1]))?n.concat([new eD(`${o}[1]`,a[1],"expressions are not allowed in function stops.")]):n.
8concat(e3({key:`${o}[1]`,value:a[1],valueSpec:s,style:r.style,styleSpec:r.styleSpec}))}function _(r,n){let a=i.da(r.value),o=i.fT(r.value),d=null!==r.value?r.value:n;if(u){if(a!==u)return[new eD(r.key,d,`${a} stop domain type must match previous stop domain type ${u}`)]}else u=a;if("number"!==a&&"string"!==a&&"boolean"!==a&&"number"!=typeof o&&"string"!=typeof o&&"boolean"!=typeof o)return[new eD(r.key,d,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==l){let n=`number expected, ${a} found`;return i.fC(s)&&void 0===l&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new eD(r.key,d,n)]}return"categorical"!==l||"number"!==a||"number"==typeof o&&isFinite(o)&&Math.floor(o)===o?"categorical"!==l&&"number"===a&&"number"==typeof o&&"number"==typeof c&&void 0!==c&&o<c?[new eD(r.key,d,"stop domain values must appear in ascending order")]:(c=o,"categorical"===l&&o in h?[new eD(r.key,d,"stop domain values must be unique")]:(h[o]=!0,[])):[new eD(r.key,d,`integer expected, found ${String(o)}`)]}}function eB(r){let n=("property"===r.expressionContext?i.b$:i.bY)(i.c3(r.value),r.valueSpec);if("error"===n.result)return n.value.map(i=>new eD(`${r.key}${i.key}`,r.value,i.message));let a=n.value.expression||n.value._styleExpression.expression;if("property"===r.expressionContext&&"text-font"===r.propertyKey&&!a.outputDefined())return[new eD(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===r.expressionContext&&"layout"===r.propertyType&&!i.dP(a))return[new eD(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===r.expressionContext)return function r(n,a){let o=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(a.valueSpec&&a.valueSpec.expression)for(let i of a.valueSpec.expression.parameters)o.delete(i);if(0===o.size)return[];let s=[];return n instanceof i.j&&o.has(n.name)?[new eD(a.key,a.value,`["${n.name}"] expression is not supported in a filter for a ${a.object.type} layer with id: ${a.object.id}`)]:(n.eachChild(i=>{s.push(...r(i,a))}),s)}(a,r);if("appearance"===r.expressionContext)return function r(n,a){if(a.valueSpec&&a.valueSpec.expression)for(let i of a.valueSpec.expression.parameters)eV.delete(i);if(0===eV.size)return[];let o=[];if(n instanceof i.j){let i=eU.has(n.name)?"feature":n.name;if(eV.has(i))return[new eD(a.key,a.value,`["${n.name}"] is not an allowed parameter`)]}return n.eachChild(i=>{o.push(...r(i,a))}),o}(a,r);if(r.expressionContext&&0===r.expressionContext.indexOf("cluster")){if(!i.dC(a,["zoom","feature-state"]))return[new eD(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===r.expressionContext&&!i.dy(a))return[new eD(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}let eU=new Set(["get","has","properties","geometry-type","id"]),eV=new Set(["zoom","pitch","distance-from-center","feature","feature-state","measure-light","heatmap-density","line-progress","raster-value","raster-particle-speed","sky-radial-progress"]);function eH(r){let n=r.key,a=r.value,o=r.valueSpec,s=[];return Array.isArray(o.values)?o.values.includes(i.fT(a))||s.push(new eD(n,a,`expected one of [${o.values.join(", ")}], ${JSON.stringify(a)} found`)):Object.keys(o.values).includes(i.fT(a))||s.push(new eD(n,a,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(a)} found`)),s}function eG(r){return i.dw(i.c3(r.value))?eB(Object.assign({},r,{expressionContext:"filter",valueSpec:r.styleSpec[`filter_${r.layerType||"fill"}`]})):function r(n){let a=n.value,o=n.key;if(!Array.isArray(a))return[new eD(o,a,`array expected, ${i.da(a)} found`)];if(a.length<1)return[new eD(o,a,"filter array must have at least 1 element")];let s=n.styleSpec,l=eH({key:`${o}[0]`,value:a[0],valueSpec:s.filter_operator}),u=()=>{a.length>=2&&(i.dQ(a[1])||l.push(new eD(`${o}[1]`,a[1],`string expected, ${i.da(a[1])} found`)));for(let r=2;r<a.length;r++)"$type"===i.fT(a[1])?l=l.concat(eH({key:`${o}[${r}]`,value:a[r],valueSpec:s.geometry_type})):i.dQ(a[r])||i.dM(a[r])||i.du(a[r])||l.push(new eD(`${o}[${r}]`,a[r],`string, number, or boolean expected, ${i.da(a[r])} found.`))};switch(i.fT(a[0])){case"<":case"<=":case">":case">=":a.length>=2&&"$type"===i.fT(a[1])&&l.push(new eD(o,a,`"$type" cannot be use with operator "${a[0]}"`)),3!==a.length&&l.push(new eD(o,a,`filter array for operator "${a[0]}" must have 3 elements`)),u();break;case"==":case"!=":3!==a.length&&l.push(new eD(o,a,`filter array for operator "${a[0]}" must have 3 elements`)),u();break;case"in":case"!in":u();break;case"any":case"all":case"none":for(let i=1;i<a.length;i++)l=l.concat(r({key:`${o}[${i}]`,value:a[i],style:n.style,styleSpec:n.styleSpec}));break;case"has":case"!has":2!==a.length?l.push(new eD(o,a,`filter array for "${a[0]}" operator must have 2 elements`)):i.dQ(a[1])||l.push(new eD(`${o}[1]`,a[1],`string expected, ${i.da(a[1])} found`))}return l}(r)}let eq=/^{([^}]+)}$/;function e$(r,n){let a,o=r.key,s=r.style,l=r.layer,u=r.styleSpec,c=r.value,d=r.objectKey,h=u[`${n}_${r.layerType}`];if(!h)return[];let f=d.match(i.b3);if(f&&h[f[1]])return i.dv(i.c3(c))?[].concat(e3({key:o,value:c,valueSpec:{type:"string",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},style:s,styleSpec:u,expressionContext:"property",propertyType:n,propertyKey:d})):e3({key:o,value:c,valueSpec:{type:"string"},style:s,styleSpec:u});let p=d.match(i.aY);if("paint"===n&&p&&h[p[1]]&&h[p[1]].transition)return e3({key:o,value:c,valueSpec:u.transition,style:s,styleSpec:u});let m=r.valueSpec||h[d];if(!m)return[new eF(o,c,`unknown property "${d}"`)];if(i.dQ(c)&&i.fC(m)&&!m.tokens&&(a=eq.exec(c))){let i=`\`{ "type": "identity", "property": ${a?JSON.stringify(a[1]):'"_"'} }\``;return[new eD(o,c,`"${d}" does not support interpolation syntax
9Use an identity property function instead: ${i}.`)]}let g=[];if("symbol"===r.layerType)"text-field"!==d||!s||s.glyphs||s.imports||g.push(new eD(o,c,'use of "text-field" requires a style "glyphs" property')),"text-font"===d&&i.dB(i.c3(c))&&"identity"===i.fT(c.type)&&g.push(new eD(o,c,'"text-font" does not support identity functions'));else if("model"===r.layerType&&"paint"===n&&l&&l.layout&&Object.hasOwn(l.layout,"model-id")&&i.fC(m)&&(i.fB(m)||i.fD(m))){let r=i.b$(i.c3(c),m).value,
9n="expression"in r&&r.expression||"_styleExpression"in r&&r._styleExpression&&r._styleExpression.expression;n&&!i.dC(n,["measure-light"])&&("model-emissive-strength"===d&&i.dy(n)&&i.dP(n)||g.push(new eD(o,c,`${d} does not support measure-light expressions when the model layer source is vector tile or GeoJSON.`)))}return g.concat(e3({key:r.key,value:c,valueSpec:m,style:s,styleSpec:u,expressionContext:"property",propertyType:n,propertyKey:d}))}function eW(i){return e$(i,"paint")}function eY(i){return e$(i,"layout")}function eZ(r){let n=[],a=r.value,o=r.key,s=r.style,l=r.styleSpec;if(!i.dN(a))return[new eD(o,a,"object expected")];a.type||a.ref||n.push(new eD(o,a,'either "type" or "ref" is required'));let u=i.fT(a.type),c=i.fT(a.ref);if(a.id){let l=i.fT(a.id);for(let u=0;u<r.arrayIndex;u++){let r=s.layers[u];i.fT(r.id)===l&&n.push(new eD(o,a.id,`duplicate layer id "${l}", previously used at line ${r.id.__line__}`))}}if("ref"in a){let r;["type","source","source-layer","filter","layout"].forEach(i=>{i in a&&n.push(new eD(o,a[i],`"${i}" is prohibited for ref layers`))}),s.layers.forEach(n=>{i.fT(n.id)===c&&(r=n)}),r?r.ref?n.push(new eD(o,a.ref,"ref cannot reference another ref layer")):u=i.fT(r.type):"string"==typeof c&&n.push(new eD(o,a.ref,`ref layer "${c}" not found`))}else if("background"!==u&&"sky"!==u&&"slot"!==u)if(a.source)if(i.dQ(a.source)){let r=s.sources&&Object.hasOwn(s.sources,a.source)?s.sources[a.source]:void 0,l=r&&i.fT(r.type);r?"vector"===l&&"raster"===u?n.push(new eD(o,a.source,`layer "${a.id}" requires a raster source`)):"raster"===l&&"raster"!==u?n.push(new eD(o,a.source,`layer "${a.id}" requires a vector source`)):"vector"!==l||a["source-layer"]?"raster-dem"===l&&"hillshade"!==u?n.push(new eD(o,a.source,"raster-dem source can only be used with layer type 'hillshade'.")):"raster-array"!==l||["raster","raster-particle"].includes(u)?"line"===u&&a.paint&&a.paint["line-gradient"]&&"geojson"===l&&!r.lineMetrics?n.push(new eD(o,a,`layer "${a.id}" specifies a line-gradient, which requires the GeoJSON source to have \`lineMetrics\` enabled.`)):"line"===u&&a.paint&&a.paint["line-trim-offset"]&&"geojson"===l&&!r.lineMetrics?n.push(new eD(o,a,`layer "${a.id}" specifies a line-trim-offset, which requires the GeoJSON source to have \`lineMetrics\` enabled.`)):"raster-particle"===u&&"raster-array"!==l&&n.push(new eD(o,a.source,`layer "${a.id}" requires a 'raster-array' source.`)):n.push(new eD(o,a.source,"raster-array source can only be used with layer type 'raster'.")):n.push(new eD(o,a,`layer "${a.id}" must specify a "source-layer"`)):n.push(new eD(o,a.source,`source "${a.source}" not found`))}else n.push(new eD(`${o}.source`,a.source,'"source" must be a string'));else n.push(new eD(o,a,'missing required property "source"'));return n=n.concat(e8({key:o,value:a,valueSpec:l.layer,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{"*":()=>[],type:()=>e3({key:`${o}.type`,value:a.type,valueSpec:l.layer.type,style:r.style,styleSpec:r.styleSpec,object:a,objectKey:"type"}),filter:i=>eG(Object.assign({layerType:u},i)),layout:i=>e8({layer:a,key:i.key,value:i.value,valueSpec:{},style:i.style,styleSpec:i.styleSpec,objectElementValidators:{"*":i=>eY(Object.assign({layerType:u},i))}}),paint:i=>e8({layer:a,key:i.key,value:i.value,valueSpec:{},style:i.style,styleSpec:i.styleSpec,objectElementValidators:{"*":i=>eW(Object.assign({layerType:u,layer:a},i))}}),appearances(r){let n=eN({key:r.key,value:r.value,valueSpec:r.valueSpec,style:r.style,styleSpec:r.styleSpec,arrayElementValidator:r=>(function(r){let{key:n,layer:a,layerType:o}=r,s=i.fT(r.value),l=i.fT(s.name),u=i.fT(s.condition),c=e8({key:n,value:s,valueSpec:r.styleSpec.appearance,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{condition:r=>{var n;let s;return n=Object.assign({layer:a,layerType:o},r),(s=[]).push(...eB({key:n.key,value:n.object.condition,valueSpec:i.fs.appearance.condition,expressionContext:"appearance"})),s},properties:i=>(function(i){let r=[],{styleSpec:n,layer:a,layerType:o}=i,s=n[`paint_${o}`],l=n[`layout_${o}`],u=i.object[i.objectKey];for(let n in u){let c=n in s?"paint":n in l?"layout":void 0;if(!c){r.push(new eD(i.key,n,`unknown property "${n}" for layer type "${o}"`));continue}let d=Object.assign({},i,{key:`${i.key}.${n}`,object:u,objectKey:n,layer:a,layerType:o,value:u[n],valueSpec:"paint"===c?s[n]:l[n]});r.push(...e$(d,c))}return r})(Object.assign({layer:a,layerType:o},i))}});return"hidden"!==l&&void 0===u&&c.push(new eD(r.key,"name",'Appearance with name different than "hidden" must have a condition')),c})(Object.assign({layerType:u,layer:a},r))}),o=Array.isArray(r.value)?r.value:[],s=new Set;return o.forEach((o,l)=>{let u=i.fT(o.name);if(u)if(s.has(u)){let o=i.fT(a.id);n.push(new eD(r.key,u,`Duplicated appearance name "${u}" for layer "${o}"`))}else s.add(u)}),n}}}))}function eK({key:r,value:n}
9){return i.dQ(n)?[]:[new eD(r,n,`string expected, ${i.da(n)} found`)]}let eX={promoteId:function r({key:n,value:a}){if(i.dQ(a))return eK({key:n,value:a});if(Array.isArray(a)){let r=[],o=i.c3(a),s=i.bY(o);return"error"===s.result?s.value.forEach(i=>{r.push(new eD(`${n}${i.key}`,null,`${i.message}`))}):i.dC(s.value.expression,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])||r.push(new eD(`${n}`,null,"promoteId expression should be only feature dependent")),r}if(!i.dN(a))return[new eD(n,a,`string, expression or object expected, "${i.da(a)}" found`)];let o=[];for(let i in a)o.push(...r({key:`${n}.${i}`,value:a[i]}));return o}};function eQ(r){let n=r.value,a=r.key,o=r.styleSpec,s=r.style;if(!i.dN(n))return[new eD(a,n,`object expected, ${i.da(n)} found`)];if(!("type"in n))return[new eD(a,n,'"type" is required')];let l=i.fT(n.type),u=[];switch(["vector","raster","raster-dem","raster-array"].includes(l)&&("url"in n||"tiles"in n||u.push(new eF(a,n,'Either "url" or "tiles" is required.'))),l){case"vector":case"raster":case"raster-dem":case"raster-array":return u.concat(e8({key:a,value:n,valueSpec:o[`source_${l.replace("-","_")}`],style:r.style,styleSpec:o,objectElementValidators:eX}));case"geojson":if(u=e8({key:a,value:n,valueSpec:o.source_geojson,style:s,styleSpec:o,objectElementValidators:eX}),"cluster"in n&&"clusterProperties"in n){if(!i.dN(n.clusterProperties))return[new eD(`${a}.clusterProperties`,n,`object expected, ${i.da(n)} found`)];for(let i in n.clusterProperties){let r=n.clusterProperties[i];if(!Array.isArray(r))return[new eD(`${a}.clusterProperties.${i}`,r,"array expected")];let[o,s]=r,l="string"==typeof o?[o,["accumulated"],["get",i]]:o;u.push(...eB({key:`${a}.${i}.map`,value:s,expressionContext:"cluster-map"})),u.push(...eB({key:`${a}.${i}.reduce`,value:l,expressionContext:"cluster-reduce"}))}}return u;case"video":return e8({key:a,value:n,valueSpec:o.source_video,style:s,styleSpec:o});case"image":return e8({key:a,value:n,valueSpec:o.source_image,style:s,styleSpec:o});case"canvas":return[new eD(a,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:var c;return eH({key:`${a}.type`,value:n.type,valueSpec:{values:(c=o).source.reduce((i,r)=>{let n=c[r];return"enum"===n.type.type&&(i=i.concat(Object.keys(n.type.values||{}))),i},[])}})}}function eJ(i,r){let n=!i.includes("://");try{return new URL(i,n&&r?"http://example.com":void 0),!0}catch(i){return!1}}function e1(r){let n=r.value;return n?i.dQ(n)?eJ(n,!0)?[]:[new eD(r.key,n,`invalid url "${n}"`)]:[new eD(r.key,n,`string expected, "${i.da(n)}" found`)]:[]}function e0(r){let n=r.value,a=r.styleSpec,o=a.light,s=r.style;if(void 0===n)return[];if(!i.dN(n))return[new eD("light",n,`object expected, ${i.da(n)} found`)];let l=[];for(let r in n){let u=r.match(i.aY),c=r.match(i.b3);l=l.concat(c&&o[c[1]]?e3({key:r,value:n[r],valueSpec:{type:"string"},style:s,styleSpec:a}):u&&o[u[1]]&&o[u[1]].transition?e3({key:r,value:n[r],valueSpec:a.transition,style:s,styleSpec:a}):o[r]?e3({key:r,value:n[r],valueSpec:o[r],style:s,styleSpec:a}):[new eD(r,n[r],`unknown property "${r}"`)])}return l}function e2(r){let n=r.value;if(!n)return[];let a=r.key;if(!i.dN(n))return[new eD(a,n,`object expected, ${i.da(n)} found`)];let o=[],s=r.styleSpec,l=s["light-3d"],u=r.style,c=r.style.lights;for(let i of["type","id"])if(!(i in n))return o.concat([new eD(a,n,`missing property "${i}"`)]);if(!i.dQ(n.type))return o.concat([new eD(`${a}.type`,n.type,"string expected")]);if(c)for(let s=0;s<r.arrayIndex;s++){let r=i.fT(n.type),l=c[s];i.fT(l.type)===r&&o.push(new eD(a,n.id,`duplicate light type "${n.type}", previously defined at line ${l.id.__line__}`))}let d=`properties_light_${n.type}`;if(!(d in s))return o.concat([new eD(`${a}.type`,n,`Invalid light type ${n.type}`)]);let h=s[d];for(let a in n)if("properties"===a){let l=n[a];if(!i.dN(l))return o.concat([new eD("properties",l,`object expected, ${i.da(l)} found`)]);for(let c in l){let d=c.match(i.aY),f=c.match(i.b3);o=o.concat(f&&h[f[1]]?e3({key:a,value:l[c],valueSpec:{type:"string"},style:u,styleSpec:s}
9):d&&h[d[1]]&&h[d[1]].transition?e3({key:a,value:n[a],valueSpec:s.transition,style:u,styleSpec:s}):h[c]?e3({key:c,value:l[c],valueSpec:h[c],style:u,styleSpec:s}):[new eF(r.key,l[c],`unknown property "${c}"`)])}}else o=o.concat(l[a]?e3({key:a,value:n[a],valueSpec:l[a],style:u,styleSpec:s}):[new eF(a,n[a],`unknown property "${a}"`)]);return o}function e5(r){let n=r.value,a=r.key,o=r.style,s=r.styleSpec,l=s.terrain;if(null==n)return[];if(!i.dN(n))return[new eD("terrain",n,`object expected, ${i.da(n)} found`)];let u=[];for(let r in n){let a=r.match(i.aY),c=r.match(i.b3);u=u.concat(c&&l[c[1]]?e3({key:r,value:n[r],valueSpec:{type:"string"},style:o,styleSpec:s}):a&&l[a[1]]&&l[a[1]].transition?e3({key:r,value:n[r],valueSpec:s.transition,style:o,styleSpec:s}):l[r]?e3({key:r,value:n[r],valueSpec:l[r],style:o,styleSpec:s}):[new eF(r,n[r],`unknown property "${r}"`)])}if(n.source)if(i.dQ(n.source)){let r=o.sources&&Object.hasOwn(o.sources,n.source)?o.sources[n.source]:void 0,s=r&&i.fT(r.type);r?"raster-dem"!==s&&u.push(new eD(`${a}.source`,n.source,`terrain cannot be used with a source of type ${s}, it only be used with a "raster-dem" source type`)):u.push(new eD(`${a}.source`,n.source,`source "${n.source}" not found`))}else u.push(new eD(`${a}.source`,n.source,"source must be a string"));else u.push(new eD(a,n,'terrain is missing required property "source"'));return u}function e4(r){let n=r.value,a=r.style,o=r.styleSpec,s=o.fog;if(void 0===n)return[];if(!i.dN(n))return[new eD("fog",n,`object expected, ${i.da(n)} found`)];let l=[];for(let r in n){let u=r.match(i.aY),c=r.match(i.b3);l=l.concat(c&&s[c[1]]?e3({key:r,value:n[r],valueSpec:{type:"string"},style:a,styleSpec:o}):u&&s[u[1]]&&s[u[1]].transition?e3({key:r,value:n[r],valueSpec:o.transition,style:a,styleSpec:o}):s[r]?e3({key:r,value:n[r],valueSpec:s[r],style:a,styleSpec:o}):[new eF(r,n[r],`unknown property "${r}"`)])}return l}let e9={"*":()=>[],array:eN,boolean:function(r){let n=r.value,a=r.key;return i.du(n)?[]:[new eD(a,n,`boolean expected, ${i.da(n)} found`)]},number:ej,color:function({key:r,value:n}){return i.dQ(n)?void 0===i.i.parse(i.fT(n))?[new eD(r,n,`color expected, "${n}" found`)]:[]:[new eD(r,n,`color expected, ${i.da(n)} found`)]},enum:eH,filter:eG,function:ez,layer:eZ,object:e8,source:eQ,model:e1,light:e0,"light-3d":e2,terrain:e5,fog:e4,string:eK,formatted:function(i){return 0===eK(i).length?[]:eB(i)},resolvedImage:function(i){return 0===eK(i).length?[]:eB(i)},projection:function(r){let n=r.value,a=r.styleSpec,o=a.projection,s=r.style;if(i.dN(n)){let i=[];for(let r in n)i=i.concat(e3({key:r,value:n[r],valueSpec:o[r],style:s,styleSpec:a}));return i}return i.dQ(n)?[]:[new eD("projection",n,`object or string expected, ${i.da(n)} found`)]},import:function(r){let n=r.key,{value:a,styleSpec:o}=r;if(!i.dN(a))return[new eD(n,a,"import must be an object")];let{data:s,...l}=a;Object.defineProperty(l,"__line__",{value:a.__line__,enumerable:!1});let u=e8(Object.assign({},r,{value:l,valueSpec:o.import}));return""===i.fT(l.id)&&u.push(new eD(`${r.key}.id`,l,"import id can't be an empty string")),"__proto__"===i.fT(l.id)&&u.push(new eD(`${r.key}.id`,l,'import id can\'t be "__proto__"')),s&&(u=u.concat(e7(s,o,{key:`${r.key}.data`}))),u},iconset:function(r){let n=r.value,a=r.key,o=r.styleSpec,s=r.style;if(!i.dN(n))return[new eD(a,n,"object expected")];if(!n.type)return[new eD(a,n,'"type" is required')];let l=i.fT(n.type),u=[];if(u=u.concat(e8({key:a,value:n,valueSpec:o[`iconset_${l}`],style:s,styleSpec:o})),!("source"!==l||!n.source)){let r=s.sources&&Object.hasOwn(s.sources,n.source)?s.sources[n.source]:void 0,o=r&&i.fT(r.type);r?"raster-array"!==o&&u.push(new eD(a,n.source,`iconset cannot be used with a source of type ${String(o)}, it only be used with a "raster-array" source type`)):u.push(new eD(a,n.source,`source "${n.source}" not found`))}return u},option:function(r){let n=r.styleSpec,a=r.value,o=i.dN(a)&&!0===i.fT(a.array)||!i.dN(a)?void 0:i.fT(a.type);return e8(Object.assign({},r,{valueSpec:n.option,objectElementValidators:o?{default:i=>Array.isArray(i.value)?e3(Object.assign({},i,{valueSpec:Object.assign({},i.valueSpec,{type:o})})):e3(i)}:void 0}))}};function e3(r,n=!1){let a=r.value,o=r.valueSpec,s=r.styleSpec;if(o.expression){if(i.dB(i.fT(a)))return ez(r);if(i.dv(i.c3(a)))return eB(r)}if(o.type&&e9[o.type]){let i=e9[o.type](r);return!0===n&&i.length>0&&Array.isArray(r.value)?eB(r):i}return e8(Object.assign({},r,{valueSpec:o.type?s[o.type]:o}))}function e8(r){let n=r.key,a=r.value,o=r.valueSpec||{},s=r.objectElementValidators||{},l=r.style,u=r.styleSpec;if(!i.dN(a))return[new eD(n,a,`object expected, ${i.da(a)} found`)];let c=[];for(let i in a){let r;if(!Object.hasOwn(a,i))continue;let d=i.split(".")[0],h=Object.hasOwn(o,d),f=Object.hasOwn(o,"*"),p=h?o[d]:f?o["*"]:void 0;Object.hasOwn(s,d)?r=s[d]:h?r=e3:Object.hasOwn(s,"*")?r=s["*"]:f&&(r=e3),r?c=c.concat(r({key:(n?`${n}.`:n)+i,value:a[i],valueSpec:p,style:l,styleSpec:u,object:a,objectKey:i},a)):c.push(new eF(n,a[i],`unknown property "${i}"`))}for(let i in o){if(!Object.hasOwn(o,i)||Object.hasOwn(s,i))continue;let r=o[i];!r.required||void 0!==r.default||Object.hasOwn(a,i)&&void 0!==a[i]||c.push(new eD(n,a,`missing required property "${i}"`))}return c}function e6({key:i,value:r}){let n=eK({key:i,value:r});return n.length||(r.includes("{fontstack}")||n.push(new eD(i,r,'"glyphs" url must include a "{fontstack}" token')),r.includes("{range}")||n.push(new eD(i,r,'"glyphs" url must include a "{range}" token'))),n}function e7(r,n=i.fs,a={}){return e8({key:a.key||"",value:r,valueSpec:Object.assign({},n.$root,{"*":{type:"*"}}),styleSpec:n,style:r,objectElementValidators:{glyphs:e6}})}function te(r,n=i.fs){return tf(e7(r,n))}let tt=i=>tf(eQ(i)),ti=i=>tf(e0(i)),tr=i=>tf(e2(i)),tn=i=>tf(e5(i)),ta=i=>tf(e4(i)),to=r=>tf(function(r){let n=r.value,a=r.style,o=r.styleSpec,s=o.snow;if(void 0===n)return[];
9if(!i.dN(n))return[new eD("snow",n,`object expected, ${i.da(n)} found`)];let l=[];for(let r in n){let u=r.match(i.aY);l=l.concat(u&&s[u[1]]&&s[u[1]].transition?e3({key:r,value:n[r],valueSpec:o.transition,style:a,styleSpec:o}):s[r]?e3({key:r,value:n[r],valueSpec:s[r],style:a,styleSpec:o}):[new eF(r,n[r],`unknown property "${r}"`)])}return l}(r)),ts=r=>tf(function(r){let n=r.value,a=r.style,o=r.styleSpec,s=o.rain;if(void 0===n)return[];if(!i.dN(n))return[new eD("rain",n,`object expected, ${i.da(n)} found`)];let l=[];for(let r in n){let u=r.match(i.aY);l=l.concat(u&&s[u[1]]&&s[u[1]].transition?e3({key:r,value:n[r],valueSpec:o.transition,style:a,styleSpec:o}):s[r]?e3({key:r,value:n[r],valueSpec:s[r],style:a,styleSpec:o}):[new eF(r,n[r],`unknown property "${r}"`)])}return l}(r)),tl=i=>tf(eZ(i)),tu=i=>tf(eG(i)),tc=i=>tf(eW(i)),td=i=>tf(eY(i)),th=i=>tf(e1(i));function tf(i){return i.slice().sort((i,r)=>i.line&&r.line?i.line-r.line:0)}function tp(r,n){let a=!1;if(n&&n.length)for(let o of n)o instanceof eF?i.f_(o.message):(r.fire(new i.v(Error(o.message))),a=!0);return a}let tm=i.fs.light;class tg extends i.y{constructor(r,n="flat"){super(),this._transitionable=new i.b2(s||(s=new i.ax({anchor:new i.l(tm.anchor),position:new i.av(tm.position),color:new i.l(tm.color),intensity:new i.l(tm.intensity)}))),this.setLight(r,n),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(i,r,n={}){this._validate(ti,i,n)||(this._transitionable.setTransitionOrValue(i),this.id=r)}updateTransitions(i){this._transitioning=this._transitionable.transitioned(i,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(i){this.properties=this._transitioning.possiblyEvaluate(i)}_validate(r,n,a){return(!a||!1!==a.validate)&&tp(this,r.call(te,Object.assign({value:n,style:{glyphs:!0,sprite:!0},styleSpec:i.fs})))}}let t_=i.fs.terrain,ty=class extends i.y{constructor(r,n,a,o,s){super(),this.scope=a,this._transitionable=new i.b2(new i.ax({source:new i.l(t_.source),exaggeration:new i.l(t_.exaggeration)}),a,o),this._transitionable.setTransitionOrValue(r,o),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=n,this.worldview=s}get(){return this._transitionable.serialize()}set(i,r){this._transitionable.setTransitionOrValue(i,r)}updateTransitions(i){this._transitioning=this._transitionable.transitioned(i,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(i){this.properties=this._transitioning.possiblyEvaluate(i)}getExaggeration(r){return this._transitioning.possiblyEvaluate(new i.w(r,{worldview:this.worldview})).get("exaggeration")}getAttenuationRange(){if(!this.isZoomDependent())return null;let r=this._transitionable._values.exaggeration;if(!r)return null;let n=r.value.expression;if(!n)return null;let a=-1,o=-1,s=1;for(let r of n.zoomStops)(s=n.evaluate(new i.w(r,{worldview:this.worldview})))>.01?(a=r,o=-1):o=r;return s<.01&&a>0&&o>a?[a,o]:null}isZoomDependent(){let r=this._transitionable._values.exaggeration;return null!=r&&null!=r.value&&null!=r.value.expression&&r.value.expression instanceof i.bh}};function tv(r,n,a){let o=i.fq(45,65,a),[s,l]=r.range,u=1-Math.min(1,Math.exp(-((n-s)/(l-s)*6)));return u*=u*u,(u=Math.min(1,1.00747*u))*o*r.alpha}function tx(r,n,a,o,s){let l=i.fL([],[n,a,o],s.mercatorFogMatrix);return tv(r,i.dW(l),s.pitch)}function tb(r,n,a,o,s,l,u){let c=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let r of[[a,o,0],[s,o,0],[s,l,0],[a,l,0]]){let a=i.fL([],r,n),o=i.dW(a);c=Math.min(c,o),d=Math.max(d,o)}return[tv(r,c,u.pitch),tv(r,d,u.pitch)]}let tw=i.fs.fog;class tT extends i.y{constructor(r,n,a,o){super();const s=new i.ax({range:new i.l(tw.range),color:new i.l(tw.color),"color-use-theme":new i.l({type:"string","property-type":"data-constant",default:"default"}),"high-color":new i.l(tw["high-color"]),"high-color-use-theme":new i.l({type:"string","property-type":"data-constant",default:"default"}),"space-color":new i.l(tw["space-color"]),"space-color-use-theme":new i.l({type:"string","property-type":"data-constant",default:"default"}
9),"horizon-blend":new i.l(tw["horizon-blend"]),"star-intensity":new i.l(tw["star-intensity"]),"vertical-range":new i.l(tw["vertical-range"])});this._transitionable=new i.b2(s,a,o),this.set(r,o),this._transitioning=this._transitionable.untransitioned(),this._transform=n,this.properties=new i.aw(s),this.scope=a}get state(){let r=this._transform,n="globe"===r.projection.name,a=i.dm(r.zoom),o=this.properties.get("range"),s=.5/Math.tan(.5*r._fov),l=[o[0]+s,o[1]+s];return{range:n?[i.dY(2,l[0],a),i.dY(4.5,l[1],a)]:l,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(i,r,n={}){if(this._validate(ta,i,n))return;let a=Object.assign({},i);for(let i of Object.keys(tw))void 0===a[i]&&(a[i]=tw[i].default);this._options=a,this._transitionable.setTransitionOrValue(this._options,r)}getOpacity(r){if(!this._transform.projection.supportsFog)return 0;let n=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:i.fq(45,65,r))*n.a}getOpacityAtLatLng(r,n){var a;let o,s;return this._transform.projection.supportsFog?(a=this.state,o=i.ag.fromLngLat(r),s=n.elevation?n.elevation.getAtPointOrZero(o):0,tx(a,o.x,o.y,s,n)):0}getOpacityForTile(r){if(!this._transform.projection.supportsFog)return[1,1];let n=this._transform.calculateFogTileMatrix(r.toUnwrapped());return tb(this.state,n,0,0,i.r,i.r,this._transform)}getOpacityForBounds(i,r,n,a,o){return this._transform.projection.supportsFog?tb(this.state,i,r,n,a,o,this._transform):[1,1]}getRangeForProjection(){return this._transform.projection.supportsFog?this.state.range:[0,1]}isVisibleOnFrustum(r){if(!this._transform.projection.supportsFog)return!1;for(let n of[4,5,6,7]){let a,o=r.points[n];if(o[2]>=0)a=o;else{let s=r.points[n-4];a=i.bo(s,o,s[2]/(s[2]-o[2]))}if(tx(this.state,a[0],a[1],0,this._transform)>=.05)return!0}return!1}updateConfig(i){this._transitionable.setTransitionOrValue(this._options,i)}updateTransitions(i){this._transitioning=this._transitionable.transitioned(i,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(i){this.properties=this._transitioning.possiblyEvaluate(i)}_validate(r,n,a){return(!a||!1!==a.validate)&&tp(this,r.call(te,Object.assign({value:n,style:{glyphs:!0,sprite:!0},styleSpec:i.fs})))}}let tE,tS,tA=class extends i.y{constructor(r,n,a,o){super();const s=tE||(tE=new i.ax({density:new i.l(i.fs.snow.density),intensity:new i.l(i.fs.snow.intensity),color:new i.l(i.fs.snow.color),opacity:new i.l(i.fs.snow.opacity),vignette:new i.l(i.fs.snow.vignette),"vignette-color":new i.l(i.fs.snow["vignette-color"]),"center-thinning":new i.l(i.fs.snow["center-thinning"]),direction:new i.l(i.fs.snow.direction),"flake-size":new i.l(i.fs.snow["flake-size"])}));this._transitionable=new i.b2(s,a,o),this.set(r,o),this._transitioning=this._transitionable.untransitioned(),this.properties=new i.aw(s),this.scope=a}get state(){let r=this.properties.get("opacity"),n=this.properties.get("color"),a=this.properties.get("direction"),o=i.c4(a[0]),s=-Math.max(i.c4(a[1]),.01),l=[Math.cos(o)*Math.cos(s),Math.sin(o)*Math.cos(s),Math.sin(s)],u=this.properties.get("vignette"),c=this.properties.get("vignette-color"),d=new i.i(c.r,c.g,c.b,u);return{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new i.i(n.r,n.g,n.b,n.a*r),direction:l,centerThinning:this.properties.get("center-thinning"),flakeSize:this.properties.get("flake-size"),vignetteColor:d}}get(){return this._transitionable.serialize()}set(r,n,a={}){if(this._validate(to,r,a))return;let o=Object.assign({},r),s=i.fs.snow;for(let i of Object.keys(s))void 0===o[i]&&(o[i]=s[i].default);this._options=o,this._transitionable.setTransitionOrValue(this._options,n)}updateConfig(i){this._transitionable.setTransitionOrValue(this._options,i)}updateTransitions(i){this._transitioning=this._transitionable.transitioned(i,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(i){this.properties=this._transitioning.possiblyEvaluate(i)}
9_validate(r,n,a){return(!a||!1!==a.validate)&&tp(this,r.call(te,Object.assign({value:n,style:{glyphs:!0,sprite:!0},styleSpec:i.fs})))}},tC=class extends i.y{constructor(r,n,a,o){super();const s=tS||(tS=new i.ax({density:new i.l(i.fs.rain.density),intensity:new i.l(i.fs.rain.intensity),color:new i.l(i.fs.rain.color),opacity:new i.l(i.fs.rain.opacity),vignette:new i.l(i.fs.rain.vignette),"vignette-color":new i.l(i.fs.rain["vignette-color"]),"center-thinning":new i.l(i.fs.rain["center-thinning"]),direction:new i.l(i.fs.rain.direction),"droplet-size":new i.l(i.fs.rain["droplet-size"]),"distortion-strength":new i.l(i.fs.rain["distortion-strength"])}));this._transitionable=new i.b2(s,a,o),this.set(r,o),this._transitioning=this._transitionable.untransitioned(),this.properties=new i.aw(s),this.scope=a}get state(){let r=this.properties.get("opacity"),n=this.properties.get("color"),a=this.properties.get("direction"),o=i.c4(a[0]),s=-Math.max(i.c4(a[1]),.01),l=[Math.cos(o)*Math.cos(s),Math.sin(o)*Math.cos(s),Math.sin(s)],u=this.properties.get("vignette-color"),c=new i.i(u.r,u.g,u.b,this.properties.get("vignette"));return{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new i.i(n.r,n.g,n.b,n.a*r),direction:l,centerThinning:this.properties.get("center-thinning"),dropletSize:this.properties.get("droplet-size"),distortionStrength:this.properties.get("distortion-strength"),vignetteColor:c}}get(){return this._transitionable.serialize()}set(r,n,a={}){if(this._validate(ts,r,a))return;let o=Object.assign({},r),s=i.fs.rain;for(let i of Object.keys(s))void 0===o[i]&&(o[i]=s[i].default);this._options=o,this._transitionable.setTransitionOrValue(this._options,n)}updateConfig(i){this._transitionable.setTransitionOrValue(this._options,i)}updateTransitions(i){this._transitioning=this._transitionable.transitioned(i,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(i){this.properties=this._transitioning.possiblyEvaluate(i)}_validate(r,n,a){return(!a||!1!==a.validate)&&tp(this,r.call(te,Object.assign({value:n,style:{glyphs:!0,sprite:!0},styleSpec:i.fs})))}},tI={workerUrl:"",workerClass:null,workerParams:void 0},tk="mapboxgl_preloaded_worker_pool";class tR{constructor(i){this.active={},this.name=i}acquire(i,r=tR.workerCount){if(!this.workers)for(this.workers=[];this.workers.length<r;){var n;let r=(n=`${this.name||""}WorkerPool: ${i}-${this.workers.length}`,null!=tI.workerClass?new tI.workerClass:new self.Worker(tI.workerUrl,Object.assign({name:n},tI.workerParams)));this.workers.push(r)}return this.active[i]=!0,this.workers.slice()}release(i){delete this.active[i],this.workers&&0===this.numActive()&&(this.workers.forEach(i=>{i.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[tk]}numActive(){return Object.keys(this.active).length}}tR.workerCount=2;class tM{constructor(r,n,a="Worker",o=tR.workerCount){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=i.fU();const s=this.workerPool.acquire(this.id,o);for(let i=0;i<s.length;i++){const r=new tM.Actor(s[i],n,this.id);r.name=`${a} ${i}`,this.actors.push(r)}this.ready=!1,this.broadcast("checkIfReady",null,()=>{this.ready=!0})}broadcast(r,n,a){i.bp(this.actors,(i,a)=>{i.send(r,n,a)},a=a||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(i=>{i.remove()}),this.actors=[],this.workerPool.release(this.id)}}tM.Actor=i.a;class tL extends i.y{constructor(r,n,a,o){super(),this.scope=a,this._options=r,this.properties=new i.aw(n),this._transitionable=new i.b2(n,a,o),this._transitionable.setTransitionOrValue(r.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(i){this._transitionable.setTransitionOrValue(this._options.properties,i)}updateTransitions(i){this._transitioning=this._transitionable.transitioned(i,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(i){this.properties=this._transitioning.possiblyEvaluate(i)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(i,r){this._options=i,this._transitionable.setTransitionOrValue(i.properties,r)}shadowsEnabled(){return!!this.properties&&!0===this.properties.get("cast-shadows")}}let tP=()=>l||(l=new i.ax({color:new i.l(i.fs.properties_light_ambient.color),"color-use-theme":new i.l({type:"string",default:"default","property-type":"data-constant"}),intensity:new i.l(i.fs.properties_light_ambient.intensity)})),tO=()=>u||(u=new i.ax({direction:new i.p(i.fs.properties_light_directional.direction),color:new i.l(i.fs.properties_light_directional.color),"color-use-theme":new i.l({type:"string",default:"default","property-type":"data-constant"}),intensity:new i.l(i.fs.properties_light_directional.intensity),"cast-shadows":new i.l(i.fs.properties_light_directional["cast-shadows"]),"shadow-quality":new i.l(i.fs.properties_light_directional["shadow-quality"]),"shadow-intensity":new i.l(i.fs.properties_light_directional["shadow-intensity"]),"shadow-draw-before-layer":new i.l(i.fs.properties_light_directional["shadow-draw-before-layer"])})),tD=(i,r,n,a,o,s,l,u,c,d=[0,0,1])=>({u_matrix:i,u_normal_matrix:r,u_opacity:n,u_faux_facade_ao_intensity:a,u_camera_pos:o,u_tile_to_meter:s,u_facade_emissive_chance:l,u_flood_light_color:u,u_flood_light_intensity:c,u_front_cutoff_params:d}),tF=i=>({u_matrix:i}),tN=i=>({u_matrix:i});class tj{constructor(i,r,n){this.enable=i,this.mode=r,this.frontFace=n}}tj.disabled=new tj(!1,1029,2305),tj.backCCW=new tj(!0,1029,2305),tj.backCW=new tj(!0,1029,2304),tj.frontCW=new tj(!0,1028,2304),tj.frontCCW=new tj(!0,1028,2305);class tz{constructor(i,r,n){this.func=i,this.mask=r,this.range=n}}tz.ReadOnly=!1,tz.ReadWrite=!0,tz.disabled=new tz(519,tz.ReadOnly,[0,1]);class tB{constructor(i=0,r=0,n=0,a=0){if(isNaN(i)||i<0||isNaN(r)||r<0||isNaN(n)||n<0||isNaN(a)||a<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=r,this.left=n,this.right=a}interpolate(r,n,a){return null!=n.top&&null!=r.top&&(this.top=i.dY(r.top,n.top,a)),null!=n.bottom&&null!=r.bottom&&(this.bottom=i.dY(r.bottom,n.bottom,a)),null!=n.left&&null!=r.left&&(this.left=i.dY(r.left,n.left,a)),null!=n.right&&null!=r.right&&(this.right=i.dY(r.right,n.right,a)),this}getCenter(r,n){let a=i.bG((this.left+r-this.right)/2,0,r),o=i.bG((this.top+n-this.bottom)/2,0,n);return new i.au(a,o)}equals(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right}clone(){return new tB(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function tU(r,n){let a=i.cL(r,3);i.ct(r,n),i.fk(r,3,a)}function tV(r,n){let a=i.dp([]);return i.f5(a,a,-n),i.f2(a,a,-r),a}function tH(r,n){let a=[r[0],r[1],0],o=[n[0],n[1],0];if(i.dW(a)>=1e-15){let r=i.ex([],a);i.fa(o,r,i.c7(o,r)),n[0]=o[0],n[1]=o[1]}let s=i.c1([],n,r);if(1e-15>i.dV(s))return null;let l=Math.atan2(-s[1],s[0]);return tV(Math.atan2(Math.sqrt(r[0]*r[0]+r[1]*r[1]),-r[2]),l)}class tG{constructor(i,r){this.position=i,this.orientation=r}get position(){return this._position}set position(r){if(r){let n=r instanceof i.ag?r:new i.ag(r[0],r[1],r[2]);
9this._renderWorldCopies&&(n.x=i.f$(n.x,0,1)),this._position=n}else this._position=null}lookAtPoint(r,n,a){if(this.orientation=null,!this.position)return;let o=this.position,s=a||(this._elevation?this._elevation.getAtPointOrZero(i.ag.fromLngLat(r)):0),l=i.ag.fromLngLat(r,s),u=[l.x-o.x,l.y-o.y,l.z-o.z];n||(n=[0,0,1]),n[2]=Math.abs(n[2]),this.orientation=tH(u,n)}setPitchBearing(r,n){this.orientation=tV(i.c4(r),i.c4(-n))}}class tq{constructor(r,n){this._transform=i.dq([]),this.orientation=n,this.position=r}get mercatorPosition(){let r=this.position;return new i.ag(r[0],r[1],r[2])}get position(){let r=i.cL(this._transform,3);return[r[0],r[1],r[2]]}set position(r){r&&i.fk(this._transform,3,[r[0],r[1],r[2],1])}get orientation(){return this._orientation}set orientation(r){this._orientation=r||i.dp([]),r&&tU(this._transform,this._orientation)}getPitchBearing(){let i=this.forward(),r=this.right();return{bearing:Math.atan2(-r[1],r[0]),pitch:Math.atan2(Math.sqrt(i[0]*i[0]+i[1]*i[1]),-i[2])}}setPitchBearing(i,r){this._orientation=tV(i,r),tU(this._transform,this._orientation)}forward(){let r=i.cL(this._transform,2);return[-r[0],-r[1],-r[2]]}up(){let r=i.cL(this._transform,1);return[-r[0],-r[1],-r[2]]}right(){let r=i.cL(this._transform,0);return[r[0],r[1],r[2]]}getCameraToWorld(r,n){let a=new Float64Array(16);return i.dr(a,this.getWorldToCamera(r,n)),a}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(r,n,a){let o=this.position;i.fa(o,o,-r);let s=new Float64Array(16);return i.cv(s,[a,a,a]),i.fQ(s,s,o),s[10]*=n,s}getWorldToCamera(r,n){let a=new Float64Array(16),o=new Float64Array(4),s=this.position;return i.bO(o,this._orientation),i.fa(s,s,-r),i.ct(a,o),i.fQ(a,a,s),a[1]*=-1,a[5]*=-1,a[9]*=-1,a[13]*=-1,a[8]*=n,a[9]*=n,a[10]*=n,a[11]*=n,a}getCameraToClipPerspective(r,n,a,o){let s=new Float64Array(16);return i.eE(s,r,n,a,o),s}getCameraToClipOrthographic(r,n,a,o,s,l){let u=new Float64Array(16);return i.eB(u,r,n,a,o,s,l),u}getDistanceToElevation(r,n=!1){let a=0===r?0:i.em(r,n?i.dT(this.position[1]):this.position[1]),o=this.forward();return(a-this.position[2])/o[2]}clone(){return new tq([...this.position],[...this.orientation])}}let t$=Math.tan(85*Math.PI/180);function tW(r,n,a,o,s,l,u){let c=i.bT();if(a)if("globe"===l.name){let r=i.bw(s,n);i.er(c,c,r)}else{let r=i.ds([],u);c[0]=r[0],c[1]=r[1],c[4]=r[2],c[5]=r[3],o||i.f6(c,c,s.angle)}else i.er(c,s.labelPlaneMatrix,r);return c}function tY(i,r,n,a,o,s,l){let u=tW(i,r,n,a,o,s,l);return"globe"===s.name&&n||(u[2]=u[6]=u[10]=u[14]=0),u}function tZ(r,n,a,o,s,l,u){if(a){if("globe"===l.name){let c=tW(r,n,a,o,s,l,u);return i.dr(c,c),i.er(c,r,c),c}{let n=i.bJ(r),[a,l,c,d]=u,[h,f,p,m,g,_,y,v]=n;return n[0]=a*h+l*g,n[1]=a*f+l*_,n[2]=a*p+l*y,n[3]=a*m+l*v,n[4]=c*h+d*g,n[5]=c*f+d*_,n[6]=c*p+d*y,n[7]=c*m+d*v,o||i.f6(n,n,-s.angle),n}}return s.glCoordMatrix}function tK(r,n,a,o){let s=[r,n,a,1];a?i.fM(s,s,o):t3(s,s,o);let l=s[3];return s[0]/=l,s[1]/=l,s[2]/=l,s}function tX(i,r){return Math.min(.5+i/r*.5,1.5)}function tQ(r,n,a,o,s,l,u,c,d,h,f=1){let p=a.transform,m=o?r.textSizeData:r.iconSizeData,g=i.ci(m,a.transform.zoom,f),_="globe"===p.projection.name,y=[256/a.width*2+1,256/a.height*2+1],v=o?r.text.dynamicLayoutVertexArray:r.icon.dynamicLayoutVertexArray;v.clear();let x=null;_&&(x=o?r.text.globeExtVertexArray:r.icon.globeExtVertexArray);let b=r.lineVertexArray,w=o?r.text.placedSymbolArray:r.icon.placedSymbolArray,T=a.transform.width/a.transform.height,E,S=!1;for(let f=0;f<w.length;f++){let _=w.get(f),{numGlyphs:A,writingMode:C}=_;if(C!==i.bg.vertical||S||E===i.bg.horizontal||(S=!0),E=C,(_.hidden||C===i.bg.vertical)&&!S){t9(A,v);continue}S=!1;let I=new i.au(_.tileAnchorX,_.tileAnchorY),k="road"===r.elevationType,R=!!p.elevation||k,{x:M,y:L,z:P}=p.projection.projectTilePoint(I.x,I.y,h.canonical),O=null;if(R){let i=k&&r.hdExt?r.hdExt.getElevationFeatureForPlacedSymbol(r,o?r.text:r.icon,f):null;O={getElevation:d,elevation:p.elevation,elevationFeature:i};let[n,a,s]=d(I,p.elevation,i);M+=n,L+=a,P+=s}let D=[M,L,P,1];if(i.fM(D,D,n),!function(i,r){let n=i[0]/i[3],a=i[1]/i[3];return n>=-r[0]&&n<=r[0]&&a>=-r[1]&&a<=r[1]}(D,y)){t9(A,v);continue}let F=D[3],N=tX(a.transform.getCameraToCenterDistance(p.projection),F),j=i.
9ch(m,g,_),z=u?j/N:j*N,B=tK(M,L,P,s);if(B[3]<=0){t9(A,v);continue}let U={},V=Math.cos(i.c4(r.layers[0].layout.get("text-max-angle"))),H=u?null:O,G=t0(_,z,!1,c,n,s,l,r.glyphOffsetArray,b,v,x,B,I,U,T,H,p.projection,h,u,V);S=G.useVertical,H&&G.needsFlipping&&(U={}),(G.notEnoughRoom||S||G.needsFlipping&&t0(_,z,!0,c,n,s,l,r.glyphOffsetArray,b,v,x,B,I,U,T,H,p.projection,h,u,V).notEnoughRoom)&&t9(A,v)}o?(r.text.dynamicLayoutVertexBuffer.updateData(v),x&&r.text.globeExtVertexBuffer&&r.text.globeExtVertexBuffer.updateData(x)):(r.icon.dynamicLayoutVertexBuffer.updateData(v),x&&r.icon.globeExtVertexBuffer&&r.icon.globeExtVertexBuffer.updateData(x))}function tJ(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y){let{lineStartIndex:v,glyphStartIndex:x,segment:b}=u,w=x+u.numGlyphs,T=v+u.lineLength,E=r.getoffsetX(x),S=r.getoffsetX(w-1),A=t4(i*E,n,a,o,s,l,b,v,T,c,d,h,f,p,!0,m,g,_,y);if(!A)return null;let C=t4(i*S,n,a,o,s,l,b,v,T,c,d,h,f,p,!0,m,g,_,y);return C?{first:A,last:C}:null}function t1(r,n,a,o){return r===i.bg.horizontal&&Math.abs(o)>Math.abs(a)?{useVertical:!0}:r===i.bg.vertical?o>0?{needsFlipping:!0}:null:0!==n&&(0===a||Math.abs(o/a)>t$)?1===n?{needsFlipping:!0}:null:a<0?{needsFlipping:!0}:null}function t0(r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w){let T=n/24,E=r.lineOffsetX*T,S=r.lineOffsetY*T,{lineStartIndex:A,glyphStartIndex:C,numGlyphs:I,segment:k,writingMode:R,flipState:M}=r,L=A+r.lineLength,P=r=>{if(f){let[n,a,o]=r.up,s=h.length;i.fW(f,s+0,n,a,o),i.fW(f,s+1,n,a,o),i.fW(f,s+2,n,a,o),i.fW(f,s+3,n,a,o)}let[n,a,o]=r.point;i.bl(h,n,a,o,r.angle)};if(I>1){let i=tJ(T,c,E,S,a,p,m,r,d,l,g,y,!1,v,x,b,w);if(!i)return{notEnoughRoom:!0};if(o&&!a){let[n,a,o]=i.first.point,[s,l,c]=i.last.point;[n,a]=tK(n,a,o,u),[s,l]=tK(s,l,c,u);let d=t1(R,M,(s-n)*_,l-a);if(r.flipState=d&&d.needsFlipping?1:2,d)return d}P(i.first);for(let i=C+1;i<C+I-1;i++){let r=t4(T*c.getoffsetX(i),E,S,a,p,m,k,A,L,d,l,g,y,!1,!1,v,x,b,w);if(!r)return h.length-=4*(i-C),{notEnoughRoom:!0};P(r)}P(i.last)}else{if(o&&!a){let n=tK(m.x,m.y,0,s),a=A+k+1,o=new i.au(d.getx(a),d.gety(a)),l=tK(o.x,o.y,0,s),u=l[3]>0?l:t5(m,o,n,1,s,void 0,v,x.canonical),c=t1(R,M,(u[0]-n[0])*_,u[1]-n[1]);if(r.flipState=c&&c.needsFlipping?1:2,c)return c}let n=t4(T*c.getoffsetX(C),E,S,a,p,m,k,A,L,d,l,g,y,!1,!1,v,x,b,w);if(!n)return{notEnoughRoom:!0};P(n)}return{}}function t2(i,r,n,a,o){let{x:s,y:l,z:u}=a.projectTilePoint(i.x,i.y,r);if(!o)return tK(s,l,u,n);let[c,d,h]=o.getElevation(i,o.elevation,o.elevationFeature);return tK(s+c,l+d,u+h,n)}function t5(r,n,a,o,s,l,u,c){let d=t2(r.sub(n)._unit()._add(r),c,s,u,l);return i.fx(d,a,d),i.ex(d,d),i.fe(d,a,d,o)}function t4(r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b){let w=o?r-n:r+n,T=w>0?1:-1,E=0;o&&(T*=-1,E=Math.PI),T<0&&(E+=Math.PI);let S=c+u+(T>0?0:1)|0,A=s,C=s,I=0,k=0,R=Math.abs(w),M=[],L=[],P=l,O=P,D=i.g0([]),F=()=>t5(O,P,C,R-I+1,f,m,y,v.canonical);for(;I+k<=R;){if((S+=T)<c||S>=d)return null;if(C=A,O=P,M.push(C),g&&L.push(O),P=new i.au(h.getx(S),h.gety(S)),!(A=p[S])){let i=t2(P,v.canonical,f,y,m);A=i[3]>0?p[S]=i:F()}I+=k;let r=i.fx([],A,C),n=i.c5(C,A);if(a&&n>0&&k>0&&i.c7(D,r)/(k*n)<b)return null;k=n,D=r}_&&m&&(p[S]&&(A=F(),k=i.c5(C,A),D=i.fx([],A,C)),p[S]=A);let N=(R-I)/k,j=P.sub(O)._mult(N)._add(O),z=i.fe([],C,D,N),B=[0,0,1],U=D[0],V=D[1];if(x&&(0!==(B=y.upVector(v.canonical,j.x,j.y))[0]||0!==B[1]||1!==B[2])){let r=[B[2],0,-B[0]],n=i.
9c1([],B,r);i.ex(r,r),i.ex(n,n),U=i.c7(D,r),V=i.c7(D,n)}if(a){let r=i.c1([],B,D);i.ex(r,r),i.fe(z,z,r,a*T)}let H=E+Math.atan2(V,U);return M.push(z),g&&L.push(j),{point:z,angle:H,path:M,tilePath:L,up:B}}function t9(i,r){let n=r.length,a=n+4*i;r.resize(a),r.float32.fill(-1/0,4*n,4*a)}function t3(i,r,n){let a=r[0],o=r[1];return i[0]=n[0]*a+n[4]*o+n[12],i[1]=n[1]*a+n[5]*o+n[13],i[3]=n[3]*a+n[7]*o+n[15],i}class t8{constructor(r,n,a,o,s,l,u){this.tileSize=512,this._renderWorldCopies=void 0===s||s,this._minZoom=r||0,this._maxZoom=n||22,this._minPitch=a??0,this._maxPitch=o??60,this.setProjection(l),this.setMaxBounds(u),this.width=0,this.height=0,this._center=new i.ab(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._nearClipOffset=0,this._unmodified=!0,this._edgeInsets=new tB,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new tq,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._tileCoverLift=0,this.freezeTileCoverage=!1,this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1,this._allowWorldUnderZoom=!1,this.mercatorMatrix=new Float64Array(16),this.mercatorFogMatrix=new Float32Array(16),this.invProjMatrix=new Float64Array(16),this._expandedFarZProjMatrixBuf=new Float64Array(16),this.expandedFarZProjMatrix=this._expandedFarZProjMatrixBuf,this.starsProjMatrix=new Float32Array(16),this.skyboxMatrix=new Float32Array(16),this._mat4Scratch=new Float64Array(16),this.alignedProjMatrix=new Float64Array(16),this.labelPlaneMatrix=new Float32Array(16),this.glCoordMatrix=new Float32Array(16),this.pixelMatrix=new Float64Array(16),this.pixelMatrixInverse=new Float64Array(16)}clone(){let i=new t8(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection(),this.maxBounds);return i._elevation=this._elevation,i._centerAltitude=this._centerAltitude,i._centerAltitudeValidForE
9xaggeration=this._centerAltitudeValidForExaggeration,i.tileSize=this.tileSize,i.mercatorFromTransition=this.mercatorFromTransition,i.width=this.width,i.height=this.height,i.cameraElevationReference=this.cameraElevationReference,i._center=this._center,i._setZoom(this.zoom),i._seaLevelZoom=this._seaLevelZoom,i.angle=this.angle,i._fov=this._fov,i._pitch=this._pitch,i._nearZ=this._nearZ,i._farZ=this._farZ,i._nearClipOffset=this._nearClipOffset,i._averageElevation=this._averageElevation,i._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,i._unmodified=this._unmodified,i._edgeInsets=this._edgeInsets.clone(),i._camera=this._camera.clone(),i._calcMatrices(),i.freezeTileCoverage=this.freezeTileCoverage,i.frustumCorners=this.frustumCorners,i._allowWorldUnderZoom=this._allowWorldUnderZoom,i}get isOrthographic(){return"globe"!==this.projection.name&&this._orthographicProjectionAtLowPitch&&this.pitch<15}get elevation(){return this._elevation}set elevation(i){this._elevation!==i&&(this._elevation=i,this._updateCameraOnTerrain(),this._calcMatrices())}get nearClipOffset(){return this._nearClipOffset}set nearClipOffset(i){this._nearClipOffset=i,this._calcMatrices()}get depthOcclusionForSymbolsAndCircles(){return"globe"!==this.projection.name&&!this.isOrthographic}updateElevation(i,r=!1){let n=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForE
9xaggeration;(null==this._seaLevelZoom||n)&&this._updateCameraOnTerrain(),(i||n)&&this._constrainCamera(r),this._calcMatrices()}getProjection(){return i.eF(this.projection,["name","center","parallels"])}setProjection(r){this.projectionOptions=r||{name:"mercator"};let n=this.projection?this.getProjection():void 0;this.projection=i.c$(this.projectionOptions);let a=this.getProjection(),o=!i.c2(n,a);return o&&this._calcMatrices(),this.mercatorFromTransition=!1,o}setOrthographicProjectionAtLowPitch(i){return this._orthographicProjectionAtLowPitch!==i&&(this._orthographicProjectionAtLowPitch=i,this._calcMatrices(),!0)}setMercatorFromTransition(){let r=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=i.c$({name:"mercator"});let n=r!==this.projection.name;return n&&this._calcMatrices(),n}get minZoom(){return this._minZoom}set minZoom(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))}get maxZoom(){return this._maxZoom}set maxZoom(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))}get minPitch(){return this._minPitch}set minPitch(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))}get maxPitch(){return this._maxPitch}set maxPitch(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(i){void 0===i?i=!0:null===i&&(i=!1),this._renderWorldCopies=i}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){let i=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(i))}get cameraWorldSize(){let i=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(i))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return i.em(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new i.au(this.width,this.height)}get bearing(){return i.f$(this.rotation,-180,180)}set bearing(i){this.rotation=i}get rotation(){return-this.angle/Math.PI*180}set rotation(i){let r=-i*Math.PI/180;if(this.angle===r)return;this._unmodified=!1,this.angle=r,this._calcMatrices();let n=Math.sin(this.angle),a=Math.cos(this.angle);this.rotationMatrix=[a,n,-n,a]}get pitch(){return this._pitch/Math.PI*180}set pitch(r){let n=i.bG(r,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}set fov(r){r=Math.max(.01,Math.min(60,r)),this._fov!==r&&(this._unmodified=!1,this._fov=i.c4(r),this._calcMatrices())}get fovX(){return this._fov}get fovY(){let i=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/i)}get averageElevation(){return this._averageElevation}set averageElevation(i){this._averageElevation=i,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(i){let r=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==r&&(this._unmodified=!1,this._setZoom(r),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(i){this._zoom=i,this.scale=this.zoomScale(i),this.tileZoom=Math.floor(i),this.zoomFraction=i-this.tileZoom}get tileCoverLift(){return this._tileCoverLift}set tileCoverLift(i){this._tileCoverLift!==i&&(this._tileCoverLift=i)}_updateCameraOnTerrain(){let i=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),-1/0):-1/0,r=this.elevation&&i===-1/0&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>
90&&this._centerAltitudeValidForExaggeration;if(!this._elevation||i===-1/0&&(!r||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);let n=this._elevation;r||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&n.exaggeration()&&this._centerAltitudeValidForExaggeration!==n.exaggeration()?this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*n.exaggeration():this._centerAltitude=i||0,this._centerAltitudeValidForExaggeration=n.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){if(void 0===this._centerAltitudeValidForExaggeration)return;let i=Math.max(0,(this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize);this._seaLevelZoom=this._zoomFromMercatorZ(i)}sampleAverageElevation(){if(!this._elevation)return 0;let r=this._elevation,n=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],a=this.horizonLineFromTop(),o=0,s=0;for(let l=0;l<n.length;l++){let u=new i.au(n[l][0]*this.width,a+n[l][1]*(this.height-a)),c=r.pointCoordinate(u);if(!c)continue;let d=1/Math.hypot(c[0]-this._camera.position[0],c[1]-this._camera.position[1]);o+=c[3]*d,s+=d}return 0===s?NaN:o/s}get center(){return this._center}set center(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._seaLevelZoom||!this._elevation)return;let i=this._seaLevelZoom,r=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),n=this.pixelsPerMeter/this.worldSize*r,a=Math.max(this._mercatorZfromZoom(i)-n,this._mercatorZfromZoom(this._maxZoom));this._setZoom(this._zoomFromMercatorZ(a))}get padding(){return this._edgeInsets.toJSON()}set padding(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())}equals(i){let r=this.elevation,n=i.elevation,a=null!=r!=(null!=n)||r&&n&&r.exaggeration()!==n.exaggeration();return this.width===i.width&&this.height===i.height&&this.center.lng===i.center.lng&&this.center.lat===i.center.lat&&this.zoom===i.zoom&&this.bearing===i.bearing&&this.pitch===i.pitch&&this.fov===i.fov&&this.projection.name===i.projection.name&&this._edgeInsets.equals(i.padding)&&!a}computeZoomRelativeTo(r){let n,a=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,r.toAltitude()));n=r.z<this._camera.position[2]?[a.x,a.y,a.z]:[r.x,r.y,r.z];let o=i.dW(i.fx([],this._camera.position,n));return i.bG(this._zoomFromMercatorZ(o),this._minZoom,this._maxZoom)}setFreeCameraOptions(r){if(!this.height||!r.position&&!r.orientation)return;this._updateCameraState();let n=!1;if(r.orientation&&!i.cl(r.orientation,this._camera.orientation)&&(n=this._setCameraOrientation(r.orientation)),r.position){let a=[r.position.x,r.position.y,r.position.z];i.cm(a,this._camera.position)||(this._setCameraPosition(a),n=!0)}n&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();let r=this._camera.position,n=new tG;return n.position=new i.ag(r[0],r[1],r[2]),n.orientation=this._camera.orientation,n._elevation=this.elevation,n._renderWorldCopies=this.renderWorldCopies,n}_setCameraOrientation(r){if(!i.dX(r))return!1;i.ey(r,r);let n=i.fO([],[0,0,-1],r),a=i.fO([],[0,-1,0],r);if(a[2]<0)return!1;let o=tH(n,a);return!!o&&(this._camera.orientation=o,!0)}_setCameraPosition(r){let n=this.zoomScale(this.minZoom)*this.tileSize,a=this.zoomScale(this.maxZoom)*this.tileSize,o=this.cameraToCenterDistance;r[2]=i.bG(r[2],o/a,o/n),this._camera.position=r}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(i){return this._edgeInsets.equals(i)}interpolatePadding(i,r,n){this._unmodified=!1,this._edgeInsets.interpolate(i,r,n),this._constrain(),this._calcMatrices()}coveringZoomLevel(i){return Math.max(0,(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize)))}getVisibleUnwrappedCoordinates(r){let n=[new i.bc(0,r)];if(this.renderWorldCopies){let a=this.pointCoordinate(new i.au(0,0)),o=this.pointCoordinate(new i.au(this.width,0)),s=this.pointCoordinate(new i.au(this.width,this.height)),l=this.pointCoordinate(new i.au(0,this.height)),u=
9Math.floor(Math.min(a.x,o.x,s.x,l.x)),c=Math.floor(Math.max(a.x,o.x,s.x,l.x));for(let a=u-1;a<=c+1;a++)0!==a&&n.push(new i.bc(a,r))}return n}isLODDisabled(i){return(!i||this.pitch<=60)&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace}extendTileCover(r,n,a,o){let s=[],l=null!=a,u=!l;if(u&&this.zoom<n||l&&0===a[0]&&0===a[1])return s;let c=new Set,d=(r,n,a,o,l)=>{let u=i.bz(n,r,a,o,l);c.has(u)||(s.push(new i.ap(r,n,a,o,l)),c.add(u))};for(let i=0;i<r.length;i++){let s=r[i];if(u&&s.canonical.z!==n||l&&void 0!==o&&o>s.canonical.z)continue;let c=s.canonical,h=s.overscaledZ,f=s.wrap,p=1<<c.z,m=c.x+1<p,g=c.x>0,_=c.y+1<p,y=c.y>0,v=s.wrap-!g,x=s.wrap+ +!m,b=g?c.x-1:p-1,w=m?c.x+1:0;if(l)a[0]<0?(d(h,x,c.z,w,c.y),a[1]<0&&_&&(d(h,f,c.z,c.x,c.y+1),d(h,x,c.z,w,c.y+1)),a[1]>0&&y&&(d(h,f,c.z,c.x,c.y-1),d(h,x,c.z,w,c.y-1))):a[0]>0?(d(h,v,c.z,b,c.y),a[1]<0&&_&&(d(h,f,c.z,c.x,c.y+1),d(h,v,c.z,b,c.y+1)),a[1]>0&&y&&(d(h,f,c.z,c.x,c.y-1),d(h,v,c.z,b,c.y-1))):a[1]<0&&_?d(h,f,c.z,c.x,c.y+1):y&&d(h,f,c.z,c.x,c.y-1);else{let i=s.visibleQuadrants;1&i&&(d(h,v,c.z,b,c.y),y&&(d(h,f,c.z,c.x,c.y-1),d(h,v,c.z,b,c.y-1))),2&i&&(d(h,x,c.z,w,c.y),y&&(d(h,f,c.z,c.x,c.y-1),d(h,x,c.z,w,c.y-1))),4&i&&(d(h,v,c.z,b,c.y),_&&(d(h,f,c.z,c.x,c.y+1),d(h,v,c.z,b,c.y+1))),8&i&&(d(h,x,c.z,w,c.y),_&&(d(h,f,c.z,c.x,c.y+1),d(h,x,c.z,w,c.y+1)))}}let h=[];for(let i of s)s.some(r=>i.isChildOf(r))||h.push(i);if(s=h.filter(i=>!r.some(r=>!!(i.overscaledZ<n&&r.isChildOf(i))||i.equals(r)||i.isChildOf(r))),u){let i=1<<n,r="globe"===this.projection.name?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),a=[i*r.x,i*r.y];s=s.filter(i=>{let r=i.canonical.x+.5-a[0],n=i.canonical.y+.5-a[1];return r*r+n*n<16})}return s}extendTileCoverToNearPlane(r,n,a){let o=[],s=new Set;for(let i of r)s.add(i.key);let l=(r,n,a,l,u)=>{let c=i.bz(n,r,a,l,u);s.has(c)||(o.push(new i.ap(r,n,a,l,u)),s.add(c))},u=r.reduce((i,r)=>Math.max(i,r.overscaledZ),a),c=1<<a,d=[new i.au(0,0),new i.au(i.r,0),new i.au(i.r,i.r),new i.au(0,i.r)],h=new i.au(0,0),f=new i.au(0,0),p=(r,n)=>{let o=Math.floor(r[0]),s=Math.floor(r[1]),p=(r[0]-o)*i.r,m=(r[1]-s)*i.r,g=Math.floor(n[0]),_=Math.floor(n[1]),y=(n[0]-g)*i.r,v=(n[1]-_)*i.r;for(let r=-1;r<=1;r++){let n=o+r;if(!(n<0||n>=c)){h.x=p-r*i.r,f.x=y-(n-g)*i.r;for(let r=-1;r<=1;r++){let o=s+r;h.y=m-r*i.r,f.y=v-(o-_)*i.r,i.ce(h,f,d)&&l(u,0,a,n,o)}}}},m=n.points,g=m[i.ak],_=m[i.al],y=this._projectToGround(g,m[i.F]),v=this._projectToGround(_,m[i.z]);return p(g,y),p(_,v),o}_projectToGround(r,n){return i.dZ(i.bU(),r,n,r[2]/(r[2]-n[2]))}_projectToZ(r,n,a){let o=r[2]-n[2];return 1e-6>Math.abs(o)?i.bK(r):i.dZ(i.bU(),r,n,(r[2]-a)/o)}extendTileCoverForTunnels(r,n,a,o){if(a<18)return[];let s=n.points,l=s[i.am],u=s[i.an],c=s[i.G],d=s[i.H];if(c[2]>=0&&d[2]>=0||l[2]<=0||u[2]<=0)return[];let h=c[2]<0?this._projectToZ(l,c,0):c,f=d[2]<0?this._projectToZ(u,d,0):d,p=-o,m=c[2]<p?this._projectToZ(l,c,p):c,g=d[2]<p?this._projectToZ(u,d,p):d,_=this._findExtensionTilesInQuad(r,a,[g,m,f,h],[.5*(h[0]+f[0]),.5*(h[1]+f[1])]);return _.length>3&&(_.length=3),_}_findExtensionTilesInQuad(r,n,a,o){let s=[],l=new Set;for(let i of r)l.add(i.key);let u=r.reduce((i,r)=>Math.max(i,r.overscaledZ),n),c=1<<n,d=[new i.au(a[0][0],a[0][1]),new i.au(a[1][0],a[1][1]),new i.au(a[3][0],a[3][1]),new i.au(a[2][0],a[2][1]),new i.au(a[0][0],a[0][1])],h=a[0][0],f=a[1][0],p=a[2][0],m=a[3][0],g=a[0][1],_=a[1][1],y=a[2][1],v=a[3][1],x=Math.max(0,Math.floor(Math.min(h,f,p,m))),b=Math.min(c-1,Math.ceil(Math.max(h,f,p,m))-1),w=Math.max(0,Math.floor(Math.min(g,_,y,v))),T=Math.min(c-1,Math.ceil(Math.max(g,_,y,v))-1);for(let r=w;r<=T;r++)for(let a=x;a<=b;a++){if(!i.eM(d,a,r,a+1,r+1))continue;let o=i.bz(0,u,n,a,r);l.has(o)||(s.push(new i.ap(u,0,n,a,r)),l.add(o))}let E=o[0],S=o[1];return s.sort((i,r)=>{let n=i.canonical.x+.5-E,a=i.canonical.y+.5-S,o=r.canonical.x+.5-E,s=r.canonical.y+.5-S;return n*n+a*a-(o*o+s*s)||i.canonical.x-r.canonical.x||i.canonical.y-r.canonical.y}),s}coveringTiles(r){let n,a=this.coveringZoomLevel(r),o=a,s=this.elevation&&this.elevation.exaggeration(),l=s&&!r.isTerrainDEM,u="mercator"===this.projection.name;if(void 0!==r.minzoom&&a<r.minzoom)return[];void 0!==r.maxzoom&&a>r.maxzoom&&(a=r.maxzoom);let c=this.locationCoordinate(this.center),d=this.center.lat,h=1<<a,f=[h*c.x,h*c.y,0],p="globe"===this.projection.name,m=!p,g=i.N.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,a,m),_=p?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),y=h*i.em(1,this.center.lat),v=this._camera.position[2]/i.em(1,this.center.lat),x=[h*_.x,h*_.y,v*(m?1:y)],b=p||s,w=this.cameraToCenterDistance/r.tileSize*(r.roundZoom?1:.502),T=this.isLODDisabled(!0)?a:0;if(this._elevation&&r.isTerrainDEM)n=1e4*this._elevation.exaggeration();else if(this._elevation){let i=this._elevation.getMinMaxForVisibleTiles();n=i?i.max:this._centerAltitude}else n=this._centerAltitude;let E=r.isTerrainDEM?-n:this._elevation?this._elevation.getMinElevationBelowMSL():0,S=this.projection.isReprojectedInTileSpace?i.d6(this):1,A=r=>{let n=1/4e4,a=new i.ag(r.x+n,r.y,r.z),o=new i.ag(r.x,r.y+n,r.z),s=r.toLngLat(),l=a.toLngLat(),u=o.toLngLat(),c=this.locationCoordinate(s),d=this.locationCoordinate(l),h=this.locationCoordinate(u);return Math.sqrt(Math.hypot(d.x-c.x,d.y-c.y)*Math.hypot(h.x-c.x,h.y-c.y))*S/n}
9,C=r=>{let a=n;return{aabb:i.fE(this,h,0,0,0,r,E,a,this.projection),zoom:0,x:0,y:0,minZ:E,maxZ:a,wrap:r,fullyVisible:!1}},I=[],k=[],R=a,M=r.reparseOverscaled?o:a,L=(v-this._centerAltitude)*y,P=i=>{if(!this._elevation||!i.tileID||!u)return;let r=this._elevation.getMinMaxForTile(i.tileID),n=i.aabb;r?(n.min[2]=r.min,n.max[2]=r.max,n.center[2]=(n.min[2]+n.max[2])/2):(i.shouldSplit=D(i),i.shouldSplit||(n.min[2]=n.max[2]=n.center[2]=this._centerAltitude))},O=(i,r)=>{if(.707*r<i)return 1;let n=r/i;return n/(1.4144271570014144+(Math.pow(1.1,n-1.4144271570014144+1)-1)/(1.1-1)-1)},D=r=>{if(r.zoom<T)return!0;if(r.zoom===R)return!1;if(null!=r.shouldSplit)return r.shouldSplit;let n=r.aabb.distanceX(x),a=r.aabb.distanceY(x),s=L,c=1;if(p){s=r.aabb.distanceZ(x);let n=Math.pow(2,r.zoom),a=Math.min(Math.max(d,i.dT((r.y+1)/n)),i.dT(r.y/n)),o=i.bF(a)/i.bF(d);if(c=a===d?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,o/this._mercatorScaleRatio),this.zoom<=i.S&&r.zoom===R-1&&o>=.9)return!0}else if(l&&(s=r.aabb.distanceZ(x)*y),this.projection.isReprojectedInTileSpace&&o<=5){let n=Math.pow(2,r.zoom),a=A(new i.ag((r.x+.5)/n,(r.y+.5)/n));c=a>.85?1:a}if(!u&&!p){let i=Math.sqrt(n*n+a*a+s*s),o=(1<<R-r.zoom)*w*c;return o*=O(Math.max(s,L),i),i<o}let h=Number.MAX_VALUE,m=0,g=r.aabb.getCorners(),_=[0,0,0];for(let r of g){i.fx(_,r,x),p||(l?_[2]*=y:_[2]=L);let n=i.c7(_,this._camera.forward());n<h&&(h=n,m=Math.abs(_[2]))}let v=(1<<R-r.zoom)*w*c;if(v*=O(Math.max(m,L),h),h<v)return!0;let b=r.aabb.closestPoint(f);return b[0]===f[0]&&b[1]===f[1]};if(this.renderWorldCopies)for(let i=1;i<=3;i++)I.push(C(-i)),I.push(C(i));for(I.push(C(0));I.length>0;){let n=I.pop(),o=n.x,s=n.y,c=n.fullyVisible,d=()=>"globe"===this.projection.name&&(0===n.y||n.y===(1<<n.zoom)-1);if(!c){let r=b?n.aabb.intersects(g):n.aabb.intersectsFlat(g);if(0===r&&d()){let a=new i.f(n.zoom,o,s);r=i.bi(this,h,a,!0).intersects(g)}if(0===r)continue;c=2===r}if(n.zoom===R||!D(n)){let l=n.zoom===R?M:n.zoom;if(r.minzoom&&r.minzoom>l)continue;let u=0;if(!c){let a=b?n.aabb.intersectsPrecise(g):n.aabb.intersectsPreciseFlat(g);if(0===a&&d()){let r=new i.f(n.zoom,o,s);a=i.bi(this,h,r,!0).intersectsPrecise(g)}if(0===a)continue;if(r.calculateQuadrantVisibility)if(g.containsPoint(n.aabb.center))u=15;else for(let i=0;i<4;i++)0!==n.aabb.quadrant(i).intersects(g)&&(u|=1<<i)}let p=f[0]-(.5+o+(n.wrap<<n.zoom))*(1<<a-n.zoom),m=f[1]-.5-s,_=n.tileID?n.tileID:new i.ap(l,n.wrap,n.zoom,o,s);r.calculateQuadrantVisibility&&(_.visibleQuadrants=u),k.push({tileID:_,distanceSq:p*p+m*m});continue}for(let r=0;r<4;r++){let a=(o<<1)+r%2,d=(s<<1)+(r>>1),f={aabb:u?n.aabb.quadrant(r):i.fE(this,h,n.zoom+1,a,d,n.wrap,n.minZ,n.maxZ,this.projection),zoom:n.zoom+1,x:a,y:d,wrap:n.wrap,fullyVisible:c,tileID:void 0,shouldSplit:void 0,minZ:n.minZ,maxZ:n.maxZ};l&&!p&&(f.tileID=new i.ap(n.zoom+1===R?M:n.zoom+1,n.wrap,n.zoom+1,a,d),P(f)),I.push(f)}}if(this.fogCullDistSq){let a=this.fogCullDistSq,o=this.horizonLineFromTop();k=k.filter(s=>{let l=[0,0,0,1],u=[i.r,i.r,0,1],c=this.calculateFogTileMatrix(s.tileID.toUnwrapped());i.fM(l,l,c),i.fM(u,u,c);let d=i.en([],l,u),h=i.ee([],l,u),f=i.cD(d,h);if(0===f)return!0;let p=!1,m=this._elevation;if(m&&f>a&&0!==o){let a,l=this.calculateProjMatrix(s.tileID.toUnwrapped());r.isTerrainDEM||(a=m.getMinMaxForTile(s.tileID)),a||(a={min:E,max:n});let u=i.cC(this.rotation),c=[u[0]*i.r,u[1]*i.r,a.max];i.fL(c,c,l),p=(1-c[1])*this.height*.5<o}return f<a||p})}return k.sort((i,r)=>i.distanceSq-r.distanceSq).map(i=>i.tileID)}resize(i,r){this.width=i,this.height=r,this.pixelsToGLUnits=[2/i,-2/r],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(i){return Math.pow(2,i)}scaleZoom(i){return Math.log2(i)}project(r){let n=i.bG(r.lat,-i.ae,i.ae),a=this.projection.project(r.lng,n);return new i.au(a.x*this.worldSize,a.y*this.worldSize)}unproject(i){return this.projection.unproject(i.x/this.worldSize,i.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/i.em(1,this.center.lat)/this.worldSize}setLocationAtPoint(r,n){let a,o,s=this.centerPoint;if("globe"===this.projection.name){let i=this.worldSize;a=(n.x-s.x)/i,o=(n.y-s.y)/i}else{let i=this.pointCoordinate(n),r=this.pointCoordinate(s);a=i.x-r.x,o=i.y-r.y}let l=this.locationCoordinate(r);this.setLocation(new i.ag(l.x-a,l.y-o))}setLocation(i){this.center=this.coordinateLocation(i),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(i,r){return this.projection.locationPoint(this,i,r)}locationPoint3D(i,r){return this.projection.locationPoint(this,i,r,!0)}pointLocation(i){return this.coordinateLocation(this.pointCoordinate(i))}pointLocation3D(i,r){return this.coordinateLocation(this.pointCoordinate3D(i,r))}locationCoordinate(r,n){let a=n?i.em(n,r.lat):void 0,o=this.projection.project(r.lng,r.lat);return new i.ag(o.x,o.y,a)}coordinateLocation(i){return this.projection.unproject(i.x,i.y)}pointRayIntersection(r,n){let a=null!=n?n:this._centerAltitude,o=[r.x,r.y,0,1],s=[r.x,r.y,1,1];i.fM(o,o,this.pixelMatrixInverse),i.fM(s,s,this.pixelMatrixInverse);let l=s[3];i.fb(o,o,1/o[3]),i.fb(s,s,1/l);let u=o[2],c=s[2];return{p0:o,p1:s,t:u===c?0:(a-u)/(c-u)}}screenPointToMercatorRay(r){let n=[r.x,r.y,0,1],a=[r.x,r.y,1,1];return i.fM(n,n,this.pixelMatrixInverse),i.fM(a,a,this.pixelMatrixInverse),i.fb(n,n,1/n[3]),i.fb(a,a,1
9/a[3]),n[2]=i.em(n[2],this._center.lat)*this.worldSize,a[2]=i.em(a[2],this._center.lat)*this.worldSize,i.fb(n,n,1/this.worldSize),i.fb(a,a,1/this.worldSize),new i.aB([n[0],n[1],n[2]],i.ex([],i.fx([],a,n)))}rayIntersectionCoordinate(r){let{p0:n,p1:a,t:o}=r,s=i.em(n[2],this._center.lat),l=i.em(a[2],this._center.lat);return new i.ag(i.dY(n[0],a[0],o)/this.worldSize,i.dY(n[1],a[1],o)/this.worldSize,i.dY(s,l,o))}pointCoordinate(i,r=this._centerAltitude){return this.projection.pointCoordinate(this,i.x,i.y,r)}pointCoordinate3D(r,n){if(!this.elevation)return this.pointCoordinate(r,n);let a=this.projection.pointCoordinate3D(this,r.x,r.y);if(a)return new i.ag(a[0],a[1],a[2]);let o=0,s=this.horizonLineFromTop();if(r.y>s)return this.pointCoordinate(r,n);let l=.02*s,u=r.clone();for(let r=0;r<10&&s-o>l;r++){u.y=i.dY(o,s,.66);let r=this.projection.pointCoordinate3D(this,u.x,u.y);r?(s=u.y,a=r):o=u.y}return a?new i.ag(a[0],a[1],a[2]):this.pointCoordinate(r)}isPointAboveHorizon(i){return this.projection.isPointAboveHorizon(this,i)}isPointOnSurface(r){if(r.y<0||r.y>this.height||r.x<0||r.x>this.width)return!1;if(this.elevation||this.zoom>=i.R)return!this.isPointAboveHorizon(r);let n=this.pointCoordinate(r);return n.y>=0&&n.y<=1}_coordinatePoint(r,n){let a=n&&this.elevation?this.elevation.getAtPointOrZero(r,this._centerAltitude):this._centerAltitude,o=[r.x*this.worldSize,r.y*this.worldSize,a+r.toAltitude(),1];return i.fM(o,o,this.pixelMatrix),o[3]>0?new i.au(o[0]/o[3],o[1]/o[3]):new i.au(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){let{top:r,left:n}=this._edgeInsets,a=this.height-this._edgeInsets.bottom,o=this.width-this._edgeInsets.right,s=this.pointLocation3D(new i.au(n,r)),l=this.pointLocation3D(new i.au(o,r)),u=this.pointLocation3D(new i.au(o,a)),c=this.pointLocation3D(new i.au(n,a)),d=Math.min(s.lng,l.lng,u.lng,c.lng),h=Math.max(s.lng,l.lng,u.lng,c.lng),f=Math.min(s.lat,l.lat,u.lat,c.lat),p=Math.max(s.lat,l.lat,u.lat,c.lat),m=Math.pow(2,-this.zoom)/16*270,g="globe"===this.projection.name?1:4,_=(r,n,a,o,s)=>{let l=(r+a)/2,u=(n+o)/2,c=new i.au(l,u),{lng:y,lat:v}=this.pointLocation3D(c),x=Math.max(0,d-y,f-v,y-h,v-p);d=Math.min(d,y),h=Math.max(h,y),f=Math.min(f,v),p=Math.max(p,v),(s<g||x>m)&&(_(r,n,l,u,s+1),_(l,u,a,o,s+1))};if(_(n,r,o,r,1),_(o,r,o,a,1),_(o,a,n,a,1),_(n,a,n,r,1),"globe"===this.projection.name){let[r,n]=i.eK(this);r?(p=90,h=180,d=-180):n&&(f=-90,h=180,d=-180)}return new i.ac(new i.ab(d,f),new i.ab(h,p))}_getBoundsRectangular(r,n){let{top:a,left:o}=this._edgeInsets,s=this.height-this._edgeInsets.bottom,l=this.width-this._edgeInsets.right,u=new i.au(o,a),c=new i.au(l,a),d=new i.au(l,s),h=new i.au(o,s),f=this.pointCoordinate(u,r),p=this.pointCoordinate(c,r),m=this.pointCoordinate(d,n),g=this.pointCoordinate(h,n),_=(i,r)=>(r.y-i.y)/(r.x-i.x);return f.y>1&&p.y>=0?f=new i.ag((1-g.y)/_(g,f)+g.x,1):f.y<0&&p.y<=1&&(f=new i.ag(-g.y/_(g,f)+g.x,0)),p.y>1&&f.y>=0?p=new i.ag((1-m.y)/_(m,p)+m.x,1):p.y<0&&f.y<=1&&(p=new i.ag(-m.y/_(m,p)+m.x,0)),(new i.ac).extend(this.coordinateLocation(f)).extend(this.coordinateLocation(p)).extend(this.coordinateLocation(g)).extend(this.coordinateLocation(m))}_getBoundsRectangularTerrain(){let i=this.elevation;if(!i.visibleDemTiles.length||i.isUsingMockSource())return this._getBoundsRectangular(0,0);let r=i.visibleDemTiles.reduce((i,r)=>{if(r.dem){let n=r.dem.tree;i.min=Math.min(i.min,n.minimums[0]),i.max=Math.max(i.max,n.maximums[0])}return i},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(r.min*i.exaggeration(),r.max*i.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(i=!0){let r=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,n=this.height/2-r*(1-this._horizonShift);return i?Math.max(0,n):n}getMaxBounds(){return this.maxBounds}setMaxBounds(r){this.maxBounds=r,this.minLat=-i.ae,this.maxLat=i.ae,this.minLng=-180,this.maxLng=180,r&&(this.minLat=r.getSouth(),this.maxLat=r.getNorth(),this.minLng=r.getWest(),this.maxLng=r.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=i.ek(this.minLng)*this.tileSize,this.worldMaxX=i.ek(this.maxLng)*this.tileSize,this.worldMinY=i.el(this.maxLat)*this.tileSize,this.worldMaxY=i.el(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(i,r){return this.projection.createTileMatrix(this,r,i)}calculateDistanceTileData(r){let n=r.key,a=this._distanceTileDataCache;if(a[n])return a[n];let o=r.canonical,s=1/this.height,l=this.cameraWorldSize,u=l/this.zoomScale(o.z),c=(o.x+Math.pow(2,o.z)*r.wrap)*u,d=o.y*u,h=this.point;h.x*=l/this.worldSize,h.y*=l/this.worldSize;let f=this.angle,p=Math.sin(-f),m=-Math.cos(-f);return a[n]={bearing:[p,m],center:[(h.x-c)*s,(h.y-d)*s],scale:u/i.r*s},a[n]}calculateFogTileMatrix(r){let n=r.key,a=this._fogTileMatrixCache;if(a[n])return a[n];let o=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,r);return i.er(o,this.worldToFogMatrix,o),a[n]=new Float32Array(o),a[n]}calculateProjMatrix(r,n=!1,a=!1){let o,s,l=r.key;if((o=a?this._expandedProjMatrixCache:n?this._alignedProjMatrixCache:this._projMatrixCache)[l])return o[l];let u=this.calculatePosMatrix(r,this.worldSize);return s=this.projection.isReprojectedInTileSpace?this.mercatorMatrix:a?this.expandedFarZProjMatrix:n?this.alignedProjMatrix:this.projMatrix,i.er(u,s,u),o[l]=new Float32Array(u),o[l]}calculatePixelsToTileUnitsMatrix(r){let n=r.tileID.key,a=this._pixelsToTileUnitsCache;if(a[n])return a[n];let o=i.c_(r,this);return a[n]=o,a[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if("globe"===this.projection.name){let r=1/this.worldSize,n=i.cv([],[r,r,r]);return i.er(n,n,this.globeMatrix),n}}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;let r=this._elevation;this._updateCameraState();let n=i.em(1,this._center.lat)*this.worldSize,a=this._computeCameraPosition(n),o=this._camera.forward(),s=i.em(1,this._center.lat);a[2]/=s,o[2]/=s,i.ex(o,o);let l=r.raycast(a,o,r.exaggeration());if(l){let r=i.fe([],a,o,l),n=new i.ag(r[0],r[1],i.em(r[2],i.dT(r[1]))),u=(n.z+i.dW([n.x-a[0],n.y-a[1],n.z-a[2]*s]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(u),this._centerAltitude=n.toAltitude(),this._center=this.coordinateLocation(n),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(r=!1){if(!this._elevation)return;let n=this._elevation,a=i.em(1,this._center.lat)*this.worldSize,o=this._computeCameraPosition(a),s=n.getAtPointOrZero(new i.ag(...o)),l=this.pixelsPerMeter/this.worldSize*s,u=this._minimumHeightOverTerrain(),c=o[2]-l;if(c<=u)if(c<0||r){let r=this.locationCoordinate(this._center,this._centerAltitude),n=[o[0],o[1],r.z-o[2]],a=i.dW(n);n[2]-=(u-c)/this._pixelsPerMercatorPixel;let s=i.dW(n);if(0===s)return;i.fa(n,n,a/s*this._pixelsPerMercatorPixel),this._camera.position=[o[0],o[1],r.z*this._pixelsPerMercatorPixel-n[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let r="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||r){let n=this.center;return n.lat=i.bG(n.lat,this.minLat,this.maxLat),!this.maxBounds&&(this.renderWorldCopies||r)||(n.lng=i.bG(n.lng,this.minLng,this.maxLng)),this.center=n,void(this._constraining=!1)}let n=this._unmodified,{x:a,y:o}=this.point,s=0,l=a,u=o,c=this.width/2,d=this.height/2,h=this.worldMinY*this.scale,f=this.worldMaxY*this.scale;if(o-d<h&&(u=h+d),o+d>f&&(u=f-d),f-h<this.height&&(s=Math.max(s,this.height/(f-h)),u=(f+h)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){let i=this.worldMinX*this.scale,r=this.worldMaxX*this.scale,n=this.worldSize/2-(i+r)/2;
9(l=(a+n+this.worldSize)%this.worldSize-n)-c<i&&(l=i+c),l+c>r&&(l=r-c),r-i<this.width&&(s=Math.max(s,this.width/(r-i)),l=(r+i)/2)}l===a&&u===o||this._allowWorldUnderZoom||(this.center=this.unproject(new i.au(l,u))),s&&!this._allowWorldUnderZoom&&(this.zoom+=this.scaleZoom(s)),this._constrainCamera(),this._unmodified=n,this._constraining=!1}_minZoomForBounds(){let i=Math.max(0,this.scaleZoom(Math.max(0,this.height)/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(i=Math.max(i,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),i}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){let r;if(!this.height)return;let n=this.centerOffset,a="globe"===this.projection.name,o=this.pixelsPerMeter;"globe"===this.projection.name&&(this._mercatorScaleRatio=i.em(1,this.center.lat)/i.em(1,i.Q));let s=i.d2(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,s),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;let l="meters"===this.projection.zAxisUnit?o:1,u=this._camera.getWorldToCamera(this.worldSize,l),c=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);if(c[8]=-(2*n.x)/this.width,c[9]=2*n.y/this.height,this.isOrthographic){let a=.5*this.height/Math.tan(this._fov/2)*1*Math.tan(.5*this._fov),o=a*this.aspect,s=-o,l=-a;o-=n.x,s-=n.x,a+=n.y,l+=n.y,((r,n,a,o)=>{for(let s=0;s<16;s++)r[s]=i.dY(n[s],a[s],o)})(r=this._camera.getCameraToClipOrthographic(s,o,l,a,this._nearZ+this._nearClipOffset,this._farZ),r,c,i.cc(this.pitch>=15?1:this.pitch/15))}else r=c;let d=i.eo([],c,u),h=i.eo([],r,u);if(this.projection.isReprojectedInTileSpace){let r=this.locationCoordinate(this.center);i.dq(this._mat4Scratch);let n=this._mat4Scratch;i.fQ(n,n,[r.x*this.worldSize,r.y*this.worldSize,0]),i.er(n,n,i.d1(this)),i.fQ(n,n,[-r.x*this.worldSize,-r.y*this.worldSize,0]),i.er(h,h,n),i.er(d,d,n),this.inverseAdjustmentMatrix=i.d0(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(i.fc(this.mercatorMatrix,h,[this.worldSize,this.worldSize,this.worldSize/l,1]),this.projMatrix=h,i.dr(this.invProjMatrix,this.projMatrix),a){let r=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);r[8]=-(2*n.x)/this.width,r[9]=2*n.y/this.height,i.eo(this._expandedFarZProjMatrixBuf,r,u),this.expandedFarZProjMatrix=this._expandedFarZProjMatrixBuf}else this.expandedFarZProjMatrix=this.projMatrix;i.dr(this._mat4Scratch,r),this.frustumCorners=i.O.fromInvProjectionMatrix(this._mat4Scratch,this.horizonLineFromTop(),this.height),this.cameraFrustum=i.N.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!a),i.cv(this.skyboxMatrix,[1,-1,1]),i.f3(this.skyboxMatrix,this.skyboxMatrix,this._pitch),i.f6(this.skyboxMatrix,this.skyboxMatrix,this.angle),i.eE(this.starsProjMatrix,this._fov,this.width/this.height,this._nearZ,this._farZ);let f=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;i.bS(this._mat4Scratch,this.starsProjMatrix),this._mat4Scratch[8]=-(2*n.x)/this.width,this._mat4Scratch[9]=2*(n.y+f)/this.height,i.er(this.skyboxMatrix,this._mat4Scratch,this.skyboxMatrix);let p=this.point,m=p.x,g=p.y,_=this.width%2/2,y=this.height%2/2,v=Math.cos(this.angle),x=Math.sin(this.angle),b=m-Math.round(m)+v*_+x*y,w=g-Math.round(g)+v*y+x*_;if(i.bS(this.alignedProjMatrix,h),i.fQ(this.alignedProjMatrix,this.alignedProjMatrix,[b>.5?b-1:b,w>.5?w-1:w,0]),i.cv(this.labelPlaneMatrix,[this.width/2,-this.height/2,1]),i.fQ(this.labelPlaneMatrix,this.labelPlaneMatrix,[1,-1,0]),i.cv(this.glCoordMatrix,[1,-1,1]),i.fQ(this.glCoordMatrix,this.glCoordMatrix,[-1,-1,0]),i.fc(this.glCoordMatrix,this.glCoordMatrix,[2/this.width,2/this.height,1]),i.er(this.pixelMatrix,this.labelPlaneMatrix,d),this._calcFogMatrices(),this._distanceTileDataCache={},!i.dr(this.pixelMatrixInverse,this.pixelMatrix))throw Error("failed to invert matrix");if("globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=i.bx(this);let r=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=i.fL(r,r,u),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=this.pixelMatrixInverse;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};let r=this.cameraWorldSizeForFog,n=this.cameraPixelsPerMeter,a=this._camera.position,o=1/this.height/this._pixelsPerMercatorPixel,s=[r,r,n];i.fa(s,s,o),i.fa(a,a,-1),i.es(a,a,s),i.cw(this.mercatorFogMatrix,a),i.fc(this.mercatorFogMatrix,this.mercatorFogMatrix,s),this.worldToFogMatrix=this._camera.getWorldToCameraPosition(r,n,o)}_computeCameraPosition(i){let r=(i=i||this.pixelsPerMeter)/this.pixelsPerMeter,n=this._camera.forward(),a=this.point,o=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*r-i/this.worldSize*this._centerAltitude;return[a.x/this.worldSize-n[0]*o,a.y/this.worldSize-n[1]*o,i/this.worldSize*this._centerAltitude-n[2]*o]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(r){let n=this._maxCameraBoundsDistance()*Math.cos(this._pitch),a=this._camera.position[2],o=r[2],s=1;this.projection.wrap&&(this.center=this.center.wrap()),o>0&&(s=Math.min((n-a)/o,1)),this._camera.position=i.fe([],this._camera.position,r,s),this._updateStateFromCamera()}_updateStateFromCamera(){let r=this._camera.position,n=this._camera.forward(),{pitch:a,bearing:o}=this._camera.getPitchBearing(),s=i.em(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,l=this._mercatorZfromZoom(this._maxZoom)*Math.cos(i.c4(this._maxPitch)),u=Math.max((r[2]-s)/Math.cos(a),l),c=this._zoomFromMercatorZ(u);i.fe(r,r,n,u),this._pitch=i.bG(a,i.c4(this.minPitch),i.c4(this.maxPitch)),this.angle=i.f$(o,-Math.PI,Math.PI),this._setZoom(i.bG(c,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new i.ag(r[0],r[1],r[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(i){return Math.pow(2,i)*this.tileSize}_mercatorZfromZoom(i){return this.cameraToCenterDistance/this._worldSizeFromZoom(i)}_minimumHeightOverTerrain(){let i=Math.min(null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(i)}_zoomFromMercatorZ(i){return this.scaleZoom(this.cameraToCenterDistance/(Math.max(0,i)*this.tileSize))}zoomFromMercatorZAdjusted(r){let n=0,a=i.R,o=0,s=1/0;for(;a-n>1e-6&&a>n;){let i=n+.5*(a-n),l=this.tileSize*Math.pow(2,i),u=this.getCameraToCenterDistance(this.projection,i,l),c=this.scaleZoom(u/(Math.max(0,r)*this.tileSize)),d=Math.abs(i-c);d<s&&(s=d,o=i),i<c?n=i:a=i}return o}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(i.f_("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(r,n){let a=Math.min(r.x,n.x),o=Math.max(r.x,n.x),s=Math.min(r.y,n.y),l=Math.max(r.y,n.y);if(s<this.horizonLineFromTop(!1))return!0;
9if("mercator"!==this.projection.name)return!1;let u=[new i.au(a,s),new i.au(o,l),new i.au(a,l),new i.au(o,s)],c=this.renderWorldCopies?-3:0,d=this.renderWorldCopies?4:1;for(let i of u){let r=this.pointRayIntersection(i);if(r.t<0)return!0;let n=this.rayIntersectionCoordinate(r);if(n.x<c||n.y<0||n.x>d||n.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+i.eX(this.fovAboveCenter)>88||this.anyCornerOffEdge(new i.au(0,0),new i.au(this.width,this.height))}zoomDeltaToMovement(r,n){let a=i.dW(i.fx([],this._camera.position,r)),o=this._zoomFromMercatorZ(a)+n;return a-this._mercatorZfromZoom(o)}getCameraPoint(){if("globe"===this.projection.name){let r=function([r,n,a],o){let s=[r,n,a,1];i.fM(s,s,o);let l=s[3]=Math.max(s[3],1e-6);return s[0]/=l,s[1]/=l,s[2]/=l,s}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new i.au(r[0],r[1])}{let r=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new i.au(0,r))}}getCameraToCenterDistance(r,n=this.zoom,a=this.worldSize){let o=i.d2(r,n,this.width,this.height,1024),s=r.pixelSpaceConversion(this.center.lat,a,o),l=.5/Math.tan(.5*this._fov)*this.height*s;return this.isOrthographic&&(l=i.dY(1,l,i.cc(this.pitch>=15?1:this.pitch/15))),l}getWorldToCameraMatrix(){let r=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&i.er(r,r,this.globeMatrix),r}getFrustum(r){return i.N.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r,"meters"===this.projection.zAxisUnit)}}let t6=(r,n)=>{if(n<=0||r.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};let a=r.transform,o=a.pitch,s=a.isLODDisabled(!1)?60:30;if(o<s-15)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};let l=a._farZ-a._nearZ,u=n*a.height*1.3,c=Math.pow(2,.85*Math.max(a._zoom-r.minCutoffZoom,0)),d=1.4*a.cameraToCenterDistance*c,h=i.fq(s-15,s,o),f=i.dY(a._farZ+u,d,h),p=Math.min(u,f-a._nearZ);return{shouldRenderCutoff:h>0,uniformValues:{u_cutoff_params:[a._nearZ,a._farZ,(f-a._nearZ)/l,(f-p-a._nearZ)/l]}}};class t7{constructor(i,r,n,a,o,s){this.test=i,this.ref=r,this.mask=n,this.fail=a,this.depthFail=o,this.pass=s}}t7.disabled=new t7({func:519,mask:0},0,0,7680,7680,7680);class ie{constructor(i,r,n,a){this.blendFunction=i,this.blendColor=r.toNonPremultipliedRenderColor(null),this.mask=n,this.blendEquation=a}}function it(r,n,a=0){let o=Math.pow(2,n.tileID.overscaledZ),s=n.tileSize*Math.pow(2,r.transform.tileZoom)/o,l=s*(n.tileID.canonical.x+n.tileID.wrap*o),u=s*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture?n.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/i.eG(n,1,r.transform.tileZoom),u_pixel_coord_upper:[l>>16,u>>16],u_pixel_coord_lower:[65535&l,65535&u],u_pattern_transition:a}}ie.Replace=[1,0,1,0],ie.disabled=new ie(ie.Replace,i.i.transparent,[!1,!1,!1,!1]),ie.unblended=new ie(ie.Replace,i.i.transparent,[!0,!0,!0,!0]),ie.alphaBlended=new ie([1,771,1,771],i.i.transparent,[!0,!0,!0,!0]),ie.alphaBlendedNonPremultiplied=new ie([770,771,770,771],i.i.transparent,[!0,!0,!0,!0]),ie.multiply=new ie([774,0,774,0],i.i.transparent,[!0,!0,!0,!0]),ie.multiplyAccumulateAlpha=new ie([774,0,1,771],i.i.transparent,[!0,!0,!0,!0]),ie.additive=new ie([1,1,1,1],i.i.transparent,[!0,!0,!0,!0]),ie.additiveAlphaWeighted=new ie([770,1,773,1],i.i.transparent,[!0,!0,!0,!0]),ie.additiveAlphaWeightedUnboundedAlpha=new ie([770,1,1,1],i.i.transparent,[!0,!0,!0,!0]);let ii={terrain:0,flat:1},ir=i.bT(),ia=(r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b=[0,0,1])=>{let w=n.style.light,T=w.properties.get("position"),E=[T.x,T.y,T.z],S=i.bV();"viewport"===w.properties.get("anchor")&&(i.cu(S,-n.transform.angle),i.fK(E,E,S));let A=w.properties.get("color").toPremultipliedRenderColor(null),C=n.transform,I={u_matrix:r,u_lightpos:E,u_lightintensity:w.properties.get("intensity"),u_lightcolor:[A.r,A.g,A.b],u_vertical_gradient:+a,u_opacity:o,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:ir,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_height_type:ii[h],u_base_type:ii[f],u_ao:s,u_edge_radius:l,u_width_scale:u,u_flood_light_color:_,u_vertical_scale:y,u_flood_light_intensity:v,u_ground_shadow_factor:x,u_front_cutoff_params:b};return"globe"===C.projection.name&&(I.u_tile_id=[c.canonical.x,c.canonical.y,1<<c.canonical.z],I.u_zoom_transition=p,I.u_inv_rot_matrix=g,I.u_merc_center=m,I.u_up_dir=C.projection.upVector(new i.f(0,0,0),m[0]*i.r,m[1]*i.r),I.u_height_lift=d),I},io=(i,r,n,a,o,s)=>({u_matrix:i,u_edge_radius:r,u_width_scale:n,u_vertical_scale:a,u_height_type:ii[o],u_base_type:ii[s]}),is=(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v)=>{let x=ia(i,r,n,a,o,s,l,u,d,h,f,p,m,g,_,y,1,[0,0,0]),b={u_height_factor:-Math.pow(2,u.overscaledZ
9)/c.tileSize/8};return Object.assign(x,it(r,c,v),b)},il=(i,r)=>({u_matrix:i,u_ground_shadow_factor:r}),iu=[];function ic(i){return iu[i]=iu[i]||new Float64Array(16)}let id=[],ih=new Float32Array(16);class ip{constructor(i,r){this.aabb=i,this.lastCascade=r}}class im{add(i,r){let n=this.receivers[i.key];void 0!==n?(n.aabb.min[0]=Math.min(n.aabb.min[0],r.min[0]),n.aabb.min[1]=Math.min(n.aabb.min[1],r.min[1]),n.aabb.min[2]=Math.min(n.aabb.min[2],r.min[2]),n.aabb.max[0]=Math.max(n.aabb.max[0],r.max[0]),n.aabb.max[1]=Math.max(n.aabb.max[1],r.max[1]),n.aabb.max[2]=Math.max(n.aabb.max[2],r.max[2])):this.receivers[i.key]=new ip(r,null)}clear(){this.receivers={}}get(i){return this.receivers[i.key]}computeRequiredCascades(r,n,a){let o=i.A.fromPoints(r.points),s=0;for(let r in this.receivers){let l=this.receivers[r];if(!l||!o.intersectsAabb(l.aabb))continue;l.aabb.min=o.closestPoint(l.aabb.min),l.aabb.max=o.closestPoint(l.aabb.max);let u=l.aabb.getCorners();for(let r=0;r<a.length;r++){let o=!0;for(let s of u){let l=[s[0]*n,s[1]*n,s[2]];if(i.fL(l,l,a[r].matrix),l[0]<-1||l[0]>1||l[1]<-1||l[1]>1){o=!1;break}}if(l.lastCascade=r,s=Math.max(s,r),o)break}}return s+1}}class ig{constructor(i){this.painter=i,this._enabled=!1,this._drawShadowAfterLayer=-1,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new im,this._depthMode=new tz(i.context.gl.LEQUAL,tz.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=!1,this._devtoolsFolder=null,this.useNormalOffset=!1,this._shadowParameters={cascadeCount:2,normalOffset:3,shadowMapResolution:2048}}destroy(){for(let i of this._cascades)i.texture.destroy(),i.framebuffer.destroy();this._cascades=[]}updateShadowParameters(r,n){let a=this.painter;if(this._enabled=!1,this._drawShadowAfterLayer=-1,this._receivers.clear(),!n||!n.properties)return;let o=n.properties.get("shadow-intensity"),s=n.properties.get("shadow-draw-before-layer");if(!n.shadowsEnabled()||o<=0)return;let l=-1,u=0;for(let i of a.style.order){let n=a.style._mergedLayers[i];n.hasShadowPass()&&!n.isHidden(r.zoom)&&(l=u),s&&(s===i||s===n.slot)&&(this._drawShadowAfterLayer=u>0?u-1:0),u+=1}if(this._enabled=l>=0,!this.enabled)return;this._drawShadowAfterLayer<0&&(this._drawShadowAfterLayer=l);let c=a.context,d=this._shadowParameters.shadowMapResolution,h=this._shadowParameters.shadowMapResolution;if(0===this._cascades.length||this._shadowParameters.shadowMapResolution!==this._cascades[0].texture.size[0]){this._cascades=[];for(let r=0;r<this._shadowParameters.cascadeCount;++r){let r=c.gl,n=c.createFramebuffer(d,h,0,"texture"),a=new i.a_(c,{width:d,height:h,data:null},r.DEPTH_COMPONENT16);n.depthAttachment.set(a.texture),this._cascades.push({framebuffer:n,texture:a,matrix:[],far:0,boundingSphereRadius:0,frustum:new i.N,scale:0})}}this.shadowDirection=iy(n);let f=0;if(r.elevation){let i=r.elevation,n=[1e4,-1e4];i.visibleDemTiles.filter(i=>i.dem).forEach(i=>{let r=i.dem.tree;n[0]=Math.min(n[0],r.minimums[0]),n[1]=Math.max(n[1],r.maximums[0])}),1e4!==n[0]&&(f=(n[1]-n[0])*i.exaggeration())}let p=1.5*r.cameraToCenterDistance,m=3*p,g=new Float64Array(16);for(let n=0;n<this._cascades.length;++n){let a=this._cascades[n],o=r.height/50,s=1;1===this._shadowParameters.cascadeCount?s=m:0===n?s=p:(o=p,s=m);let[l,u]=function(r,n,a,o,s,l){let u,c,d=r.zoom,h=r.scale,f=r.worldSize,p=1/f,m=r.aspect,g=Math.sqrt(1+m*m)*Math.tan(.5*r.fovX),_=g*g,y=o-a,v=o+a;_>y/v?(u=o,c=o*g):(u=.5*v*(1+_),c=.5*Math.sqrt(y*y+2*(o*o+a*a)*_+v*v*_*_));let x=r.projection.pixelsPerMeter(r.center.lat,f),b=r._camera.getCameraToWorldMercator(),w=[0,0,-u*p];i.fL(w,w,b);let T=c*p,E=r._edgeInsets;if((0!==E.left||0!==E.top||0!==E.right||0!==E.bottom)&&(E.left!==E.right||E.top!==E.bottom)){let n=r._camera.getWorldToCamera(r.worldSize,"meters"===r.projection.zAxisUnit?x:1),s=r._camera.getCameraToClipPerspective(r._fov,r.width/r.height,a,o);s[8]=-(2*r.centerOffset.x)/r.width,s[9]=2*r.centerOffset.y/r.height;let l=new Float64Array(16);i.eo(l,s,n);let u=new Float64Array(16);for(let n of(i.dr(u,l),i.N.fromInvProjectionMatrix(u,f,d,!0).points)){let a=(n[0]/=h,n[1]/=h,n[2]=i.em(n[2],r._center.lat),n);T=Math.max(T,i.dV(i.fz([],w,a)))}}T*=s/(s-1);let S=Math.acos(n[2]),A=Math.atan2(-n[0],-n[1]),C=new tq;C.position=w,C.setPitchBearing(S,A);let I=C.getWorldToCamera(f,x),k=T*f,R=Math.min(-(r._mercatorZfromZoom(17)*f*2),-2*k),M=C.getCameraToClipOrthographic(-k,k,-k,k,R,(k+l*x)/n[2]),L=new Float64Array(16);i.er(L,M,I);let P=i.cx(Math.floor(1e6*w[0])/1e6*f,Math.floor(1e6*w[1])/1e6*f,0),O=.5*s,D=[0,0,0];i.fL(D,P,L),i.fa(D,D,O);let F=[Math.floor(D[0]),Math.floor(D[1]),Math.floor(D[2])],N=[0,0,0];i.fx(N,D,F),i.fa(N,N,-1/O);let j=new Float64Array(16);return i.dq(j),i.fQ(j,j,N),i.er(L,j,L),[L,k]}(r,this.shadowDirection,o,s,this._shadowParameters.shadowMapResolution,f);a.scale=r.scale,a.matrix=l,a.boundingSphereRadius=u,i.dr(g,a.matrix
9),a.frustum=i.N.fromInvProjectionMatrix(g,1,0,!0),a.far=s}let _=this._cascades.length-1;this._uniformValues.u_fade_range=[.75*this._cascades[_].far,this._cascades[_].far],this._uniformValues.u_shadow_intensity=o,this._uniformValues.u_shadow_direction=[this.shadowDirection[0],this.shadowDirection[1],this.shadowDirection[2]],this._uniformValues.u_shadow_texel_size=1/this._shadowParameters.shadowMapResolution,this._uniformValues.u_shadow_map_resolution=this._shadowParameters.shadowMapResolution,this._uniformValues.u_shadowmap_0=11,this._uniformValues.u_shadowmap_1=12,this._groundShadowTiles=a.transform.coveringTiles({tileSize:512,renderWorldCopies:!0});let y=a.transform.elevation;for(let i of this._groundShadowTiles){let r={min:0,max:0};if(y){let n=y.getMinMaxForTile(i);n&&(r=n)}this.addShadowReceiver(i.toUnwrapped(),r.min,r.max)}}get enabled(){return this._enabled&&!this._forceDisable}set enabled(i){this._enabled=i}drawShadowPass(r,n){if(!this.enabled)return;let a=this.painter,o=a.context;this._numCascadesToRender=this._receivers.computeRequiredCascades(a.transform.getFrustum(0),a.transform.worldSize,this._cascades),o.viewport.set([0,0,this._shadowParameters.shadowMapResolution,this._shadowParameters.shadowMapResolution]);for(let s=0;s<this._numCascadesToRender;++s)for(let l of(a.currentShadowCascade=s,o.bindFramebuffer.set(this._cascades[s].framebuffer.framebuffer),o.clear({color:i.i.white,depth:1}),r.order)){let i=r._mergedLayers[l];if(!i.hasShadowPass()||i.isHidden(a.transform.zoom))continue;let o=r.getLayerSourceCache(i),s=o?n[o.id]:void 0;("model"===i.type||s&&s.length)&&a.renderLayer(a,o,i,s)}a.currentShadowCascade=0}drawGroundShadows(){if(!this.enabled)return;let i=this.painter,r=i.style,n=i.context,a=n.gl,o=r.directionalLight,s=r.ambientLight;if(!o||!s)return;let l=[],u=t6(i,i.longestCutoffRange);u.shouldRenderCutoff&&l.push("RENDER_CUTOFF"),l.push("RENDER_SHADOWS"),this.useNormalOffset&&l.push("NORMAL_OFFSET");let c=iv(r,o,s),d=new tz(a.LEQUAL,tz.ReadOnly,i.depthRangeFor3D),h=new t7({func:a.EQUAL,mask:255},0,255,a.KEEP,a.KEEP,a.KEEP);for(let r of this._groundShadowTiles){let o=r.toUnwrapped(),s=i.isTileAffectedByFog(r),f=i.getOrCreateProgram("groundShadow",{defines:l,overrideFog:s});this.setupShadows(o,f),i.uploadCommonUniforms(n,f,o,null,u);let p=il(i.transform.calculateProjMatrix(o),c);f.draw(i,a.TRIANGLES,d,h,ie.multiply,tj.disabled,p,"ground_shadow",i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments,null,i.transform.zoom,null,null)}}getShadowPassDepthMode(){return this._depthMode}getGroundShadowLayerIndex(){return this._drawShadowAfterLayer}calculateShadowPassMatrixFromTile(r){let n=this.painter.transform,a=n.calculatePosMatrix(r,n.worldSize);return i.er(a,this._cascades[this.painter.currentShadowCascade].matrix,a),Float32Array.from(a)}calculateShadowPassMatrixFromMatrix(r){return i.er(ih,this._cascades[this.painter.currentShadowCascade].matrix,r)}setupShadows(r,n,a){if(!this.enabled)return;let o=this.painter.transform,s=this.painter.context,l=s.gl,u=this._uniformValues,c=o.calculatePosMatrix(r,o.worldSize);for(let r=0;r<this._cascades.length;r++){let n=ic(r);i.er(n,this._cascades[r].matrix,c),u[0===r?"u_light_matrix_0":"u_light_matrix_1"]=n,s.activeTexture.set(l.TEXTURE0+11+r),this._cascades[r].texture.bindExtraParam(l.LINEAR,l.LINEAR,l.CLAMP_TO_EDGE,l.CLAMP_TO_EDGE,l.GREATER)}if(this.useNormalOffset=!!a,this.useNormalOffset){var d;let n,s=i.fH(r.canonical),l=2/o.tileSize*i.r/this._shadowParameters.shadowMapResolution,c=l*this._cascades[0].boundingSphereRadius,h=l*this._cascades.at(-1).boundingSphereRadius,f=("vector-tile"===a?1:3)*(d=o.zoom,.125*(1-(n=i.bG(-((d-22)/22),0,1)))+4*n);u.u_shadow_normal_offset=[s,c*f,h*f],u.u_shadow_bias=[1e-4,.0012,.012]}else u.u_shadow_bias=[36e-5,.0012,.012];n.setShadowUniformValues(s,u)}computeCascadeTileMatrices(r){let n=this._shadowParameters.cascadeCount;for(let a=0;a<n;a++){let n=id[a]=id[a]||new Float64Array(16);i.er(n,this._cascades[a].matrix,r)}return id.length=n,id}setupShadowsFromMatrix(r,n,a=!1){if(!this.enabled)return;let o=this._shadowParameters.cascadeCount;for(let n=0;n<o;n++)i.er(ic(n),this._cascades[n].matrix,r);iu.length=o,this.setupShadowsFromCascadeMatrices(iu,n,a)}setupShadowsFromCascadeMatrices(i,r,n=!1){if(!this.enabled)return;let a=this.painter.context,o=a.gl,s=this._uniformValues;for(let r=0;r<this._shadowParameters.cascadeCount;r++)s[0===r?"u_light_matrix_0":"u_light_matrix_1"]=i[r],a.activeTexture.set(o.TEXTURE0+11+r),this._cascades[r].texture.bindExtraParam(o.LINEAR,o.LINEAR,o.CLAMP_TO_EDGE,o.CLAMP_TO_EDGE,o.GREATER);if(this.useNormalOffset=n,n){let i=this._shadowParameters.normalOffset;s.u_shadow_normal_offset=[1,i,i],s.u_shadow_bias=[6e-5,.0012,.012]}else s.u_shadow_bias=[36e-5,.0012,.012];r.setShadowUniformValues(a,s)}getShadowUniformValues(){return this._uniformValues}getCurrentCascadeFrustum(){return this._cascades[this.painter.currentShadowCascade].frustum}computeSimplifiedTileShadowVolume(r,n,a,o){let s;if(o[2]>=0)return{};let l=(s=a/(1<<r.canonical.z),new i.A([r.canonical.x*s+r.wrap*a,r.canonical.y*s+r.wrap*a,0],[(r.canonical.x+1)*s+r.wrap*a,(r.canonical.y+1)*s+r.wrap*a,n])).getCorners(),u=-(n/o[2]);o[0]<0?(i.bj(l[0],l[0],[o[0]*u,0,0]),i.bj(l[3],l[3],[o[0]*u,0,0])):o[0]>0&&(i.bj(l[1],l[1],[o[0]*u,0,0]),i.bj(l[2],l[2],[o[0]*u,0,0])),o[1]<0?(i.bj(l[0],l[0],[0,o[1]*u,0]),i.bj(l[1],l[1],[0,o[1]*u,0])):o[1]>0&&(i.bj(l[2],l[2],[0,o[1]*u,0]),i.bj(l[3],l[3],[0,o[1]*u,0]));let c={};return c.vertices=l,c.planes=[i_(l[1],l[0],l[4]),i_(l[2],l[1],l[5]),i_(l[3],l[2],l[6]),i_(l[0],l[3],l[7])],c}addShadowReceiver(r,n,a){this._receivers.add(r,i.A.fromTileIdAndHeight(r,n,a))}getMaxCascadeForTile(i){let r=this._receivers.get(i);
9return r&&r.lastCascade?r.lastCascade:0}}function i_(r,n,a){let o=i.fx([],a,n),s=i.fx([],r,n),l=i.c1([],o,s),u=i.dW(l);return 0===u?[0,0,1,0]:(i.fa(l,l,1/u),[l[0],l[1],l[2],-i.c7(l,n)])}function iy(r){let n=r.properties.get("direction"),a=i.bB(n.x,n.y,n.z);a[2]=i.bG(a[2],0,75);let o=i.ft([a[0],a[1],a[2]]);return i.cx(o.x,o.y,o.z)}function iv(r,n,a){let o="none"===n.properties.get("color-use-theme"),s=n.properties.get("color"),l=n.properties.get("intensity"),u=n.properties.get("direction"),c=[u.x,u.y,u.z],d="none"===a.properties.get("color-use-theme"),h=a.properties.get("color"),f=a.properties.get("intensity"),p=Math.max(i.c7([0,0,1],c),0),m=[0,0,0];i.fa(m,h.toPremultipliedRenderColor(d?null:r.getLut(n.scope)).toArray01Linear().slice(0,3),f);let g=[0,0,0];return i.fa(g,s.toPremultipliedRenderColor(o?null:r.getLut(a.scope)).toArray01Linear().slice(0,3),p*l),i.e4([m[0]>0?m[0]/(m[0]+g[0]):0,m[1]>0?m[1]/(m[1]+g[1]):0,m[2]>0?m[2]/(m[2]+g[2]):0])}let ix=new Float32Array(16);function ib(r,n,a,o,s,l,u,c){let d;a.resetLayerRenderingStats(r);let h=r.context,f=h.gl,p=r.transform,m=a.paint.get("fill-extrusion-pattern"),g=a.paint.get("fill-extrusion-pattern-cross-fade"),_=m.constantOr(null),y=m.constantOr(1),v=a.paint.get("fill-extrusion-opacity"),x=r.style.enable3dLights(),b=a.paint.get(x&&!y?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),w=[a.paint.get("fill-extrusion-ambient-occlusion-intensity"),b],T=a.layout.get("fill-extrusion-edge-radius"),E=T>0&&!a.paint.get("fill-extrusion-rounded-roof"),S=E?0:T,A="globe"===p.projection.name?i.cq():0,C="globe"===p.projection.name,I=C?i.dm(p.zoom):0,k=[i.ek(p.center.lng),i.el(p.center.lat)],R="none"===a.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),M=a.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(R?null:a.lut).toArray01().slice(0,3),L=a.paint.get("fill-extrusion-flood-light-intensity"),P=a.paint.get("fill-extrusion-vertical-scale"),O=0!==a.paint.get("fill-extrusion-line-width").constantOr(1),D=a.paint.get("fill-extrusion-height-alignment"),F=a.paint.get("fill-extrusion-base-alignment"),N=t6(r,a.paint.get("fill-extrusion-cutoff-fade-range")),j=a.paint.get("fill-extrusion-front-cutoff"),z=iT(p.pitch,j,!!r.terrain),B=z[2]<1;B&&(r.maxFrontCutoffRawStart=Math.max(r.maxFrontCutoffRawStart,j[0]));let U=[];C&&U.push("PROJECTION_GLOBE_VIEW"),w[0]>0&&U.push("FAUX_AO"),E&&U.push("ZERO_ROOF_RADIUS"),c&&U.push("HAS_CENTROID"),L>0&&U.push("FLOOD_LIGHT"),N.shouldRenderCutoff&&U.push("RENDER_CUTOFF"),B&&U.push("RENDER_FRONT_CUTOFF"),O&&U.push("RENDER_WALL_MODE");let V="shadow"===r.renderPass,H=r.shadowRenderer,G=V&&!!H,q=V?tj.disabled:tj.backCCW;r.shadowRenderer&&(r.shadowRenderer.useNormalOffset=!0);let $=[0,0,0];if(H){let i=r.style.directionalLight,n=r.style.ambientLight;i&&n&&($=iv(r.style,i,n)),V||(U.push("RENDER_SHADOWS"),H.useNormalOffset&&U.push("NORMAL_OFFSET")),d=U.concat(["SHADOWS_SINGLE_CASCADE"])}let W=G?"fillExtrusionDepth":y?"fillExtrusionPattern":"fillExtrusion",Y=a.getLayerRenderingStats();for(let m of o){let o,x=n.getTile(m),b=x.getBucket(a);if(!b||b.projection.name!==p.projection.name)continue;let T=!1;H&&(T=0===H.getMaxCascadeForTile(m.toUnwrapped()));let E=r.isTileAffectedByFog(m),R=b.programConfigurations.get(a.id),j=!1;if(_&&x.imageAtlas){let r=x.imageAtlas,n=i.aG.from(_),a=n.getPrimary().scaleSelf(i.co.devicePixelRatio).toString(),o=n.getSecondary(),s=r.patternPositions.get(a),l=o?r.patternPositions.get(o.scaleSelf(i.co.devicePixelRatio).toString()):null;j=!!s&&!!l,s&&R.setConstantPatternPositions(s,l)}g>0&&(j||R.getPatternTransitionVertexBuffer("fill-extrusion-pattern"))&&U.push("FILL_EXTRUSION_PATTERN_TRANSITION");let B=r.getOrCreateProgram(W,{config:R,defines:T?d:U,overrideFog:E});if(r.terrain&&r.terrain.setupElevationDraw(x,B,{useMeterToDem:!0}),!b.centroidVertexBuffer){let i=B.getAttributeLocation(f,"a_centroid_pos");-1!==i&&f.vertexAttribI4ui(i,0,0,0,0)}!V&&H&&H.setupShadows(x.tileID.toUnwrapped(),B,"vector-tile"),y&&(r.context.activeTexture.set(f.TEXTURE0),x.imageAtlasTexture&&x.imageAtlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),R.updatePaintBuffers());let G=a.paint.get("fill-extrusion-vertical-gradient"),Z=1/b.tileToMeter;if(V&&H){if(iI(x.tileID,b.maxHeight,r))continue;o=io(H.calculateShadowPassMatrixFromTile(x.tileID.toUnwrapped()),S,Z,P,D,F)}else{let i=r.translatePosMatrix(m.expandedProjMatrix,x,a.paint.get("fill-extrusion-translate"),a.paint.get("fill-extrusion-translate-anchor")),n=p.projection.createInversionMatrix(p,m.canonical);o=y?is(i,r,G,v,w,S,Z,m,x,A,D,F,I,k,n,M,P,g):ia(i,r,G,v,w,S,Z,m,A,D,F,I,k,n,M,P,L,$,z)}r.uploadCommonUniforms(h,B,m.toUnwrapped(),null,N);let K=b.segments;if("mercator"===p.projection.name&&!V&&!(K=b.getVisibleSegments(x.tileID,r.terrain,r.transform.getFrustum(0))).get().length)continue;if(Y)if(V)for(let i of K.get())Y.numRenderedVerticesInShadowPass+=i.primitiveLength;else for(let i of K.get())Y.numRenderedVerticesInTransparentPass+=i.primitiveLength;let X=[];(r.terrain||c)&&X.push(b.centroidVertexBuffer),C&&X.push(b.layoutVertexExtBuffer),O&&X.push(b.wallVertexBuffer),B.draw(r,h.gl.TRIANGLES,s,l,u,q,o,a.id,b.layoutVertexBuffer,b.indexBuffer,K,a.paint,r.transform.zoom,R,X)}r.shadowRenderer&&(r.shadowRenderer.useNormalOffset=!1)}class iw{constructor(){this.translate=[0,0],this.translateAnchor="map",this.edgeRadius=0,this.cutoffFadeRange=0}}function iT(i,r,n){if(!(r[2]<1)||n)return[0,0,1];let a=180*i/Math.PI;if(a<15)return[-.5,r[1],r[2]];let o=Math.min(1,Math.max(0,(a-15)/5)),s=o*o*(3-2*o);return[-.5*(1-s)+r[0]*s,r[1],r[2]]}function iE(r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w,T){let E=n.context,S=E.gl,A=n.transform,C=n.transform.zoom,I=[],k=r.translate,R=r.translateAnchor,M=r.edgeRadius,L=t6(n,r.cutoffFadeRange);"clear"===f?(I.push("CLEAR_SUBPASS"),w&&(I.push("CLEAR_FROM_TEXTURE"),E.activeTexture.set(S.TEXTURE0),w.bind(S.LINEAR,S.CLAMP_TO_EDGE))):"sdf"===f?I.push("SDF_SUBPASS"):"emissive"===f&&(I.push("USE_MRT1"),E.activeTexture.set(S.TEXTURE0),w.bind(S.LINEAR,S.CLAMP_TO_EDGE)),x&&I.push("HAS_CENTROID"),L.shouldRenderCutoff&&I.push("RENDER_CUTOFF");let P=(i,r,a,s,f)=>{let b=I;null!=r.groundRadiusBuffer&&(b=I.concat("HAS_ATTRIBUTE_a_flood_light_ground_radiu
9s"));let T=r.programConfigurations.get(o.id),S=n.isTileAffectedByFog(i),A=n.getOrCreateProgram("fillExtrusionGroundEffect",{config:T,defines:b,overrideFog:S}),k={u_matrix:s,u_opacity:p,u_ao_pass:+!!h,u_meter_to_tile:f,u_ao:[m,g*f],u_flood_light_intensity:_,u_flood_light_color:y,u_attenuation:v,u_edge_radius:C>=17?0:M*f,u_fb:0,u_fb_size:w?w.size[0]:0,u_dynamic_offset:1},R=[];x&&R.push(r.hiddenByLandmarkVertexBuffer),null!=r.groundRadiusBuffer&&R.push(r.groundRadiusBuffer),n.uploadCommonUniforms(E,A,i.toUnwrapped(),null,L),A.draw(n,E.gl.TRIANGLES,l,u,c,d,k,o.id,r.vertexBuffer,r.indexBuffer,a,o.paint,C,T,R)};for(let r of s){let s=a.getTile(r),l=s.getBucket(o);if(!l||l.projection.name!==A.projection.name||!l.groundEffect||l.groundEffect&&!l.groundEffect.hasData())continue;let u=l.groundEffect,c=1/l.tileToMeter;{let i=n.translatePosMatrix(r.projMatrix,s,k,R),a=u.getDefaultSegment();P(r,u,a,i,c)}if(b)for(let l=0;l<4;l++){let u,d,h=i.ev[l](r),f=a.getTile(h);if(!f)continue;let p=f.getBucket(o);if(!p||p.projection.name!==A.projection.name||!p.groundEffect||p.groundEffect&&!p.groundEffect.hasData())continue;let m=p.groundEffect;0===l?(u=[-i.r,0,0],d=1):1===l?(u=[i.r,0,0],d=0):2===l?(u=[0,-i.r,0],d=3):(u=[0,i.r,0],d=2);let g=m.regionSegments[d];g&&(i.fQ(ix,r.projMatrix,u),P(r,m,g,n.translatePosMatrix(ix,s,k,R),c))}}}let iS=[1,0,0],iA=[0,1,0],iC=[0,0,1];function iI(r,n,a){let o=a.transform,s=a.shadowRenderer;if(!s)return!0;let l=a.frameCounter,u=a.currentShadowCascade,c=a._shadowCullCache;if(!c||c.frame!==l||c.cascade!==u){let r=o.tileSize*s._cascades[u].scale,n=o.scaleZoom(r),d=s.shadowDirection,h=[d[0],d[1],-d[2]],f=[iS,iA,iC,h,[h[0],0,h[2]],[0,h[1],h[2]]];a._shadowCullCache=c={frame:l,cascade:u,cameraFrustum:i.N.fromInvProjectionMatrix(o.invProjMatrix,o.worldSize,n,"globe"!==o.projection.name),edges:f,shadowDir:h,ws:r,zoom:n}}let{cameraFrustum:d,edges:h,shadowDir:f,ws:p,zoom:m}=c,g=n;if(o.elevation){let i=o.elevation.getMinMaxForTile(r);i&&(g+=i.max)}g/=i.cX(o.center.lat,m);let _=s.computeSimplifiedTileShadowVolume(r.toUnwrapped(),g,p,f);if(!_)return!1;let{vertices:y,planes:v}=_;return 0===d.intersectsPrecise(y,v,h)||0===s.getCurrentCascadeFrustum().intersectsPrecise(y,v,h)}let ik=new Float32Array(16),iR=new Float32Array(16);function iM(r){let{painter:n,source:a,layer:o,coords:s}=r,l=r.defines,u=n.context,c="shadow"===n.renderPass,d="light-beam"===n.renderPass,h=n.shadowRenderer,f=i.cX(n.transform.center.lat,n.transform.zoom),p=t6(n,o.paint.get("building-cutoff-fade-range"));p.shouldRenderCutoff&&(l=l.concat("RENDER_CUTOFF"));let m=o.paint.get("building-front-cutoff"),g=m[2]<1&&!n.terrain,_=iT(n.transform.pitch,m,!!n.terrain);for(let y of(g&&(l=l.concat("RENDER_FRONT_CUTOFF"),n.maxFrontCutoffRawStart=Math.max(n.maxFrontCutoffRawStart,m[0])),r.floodLightIntensity>0&&(l=l.concat("FLOOD_LIGHT")),s)){let s,m,g,v=a.getTile(y),x=v.getBucket(o);if(!x)continue;h&&0===h.getMaxCascadeForTile(y.toUnwrapped())&&(l=l.concat("SHADOWS_SINGLE_CASCADE"));let b=x.programConfigurations.get(o.id),w=n.translatePosMatrix(y.expandedProjMatrix,v,[0,0],"map");if(i.fc(ik,w,[1,1,r.verticalScale]),c&&h){if(iI(v.tileID,x.maxHeight*f,n))continue;let a=h.calculateShadowPassMatrixFromTile(v.tileID.toUnwrapped());i.fc(a,a,[1,1,r.verticalScale]),g=tN(a),s=m=n.getOrCreateProgram("buildingDepth",{config:b,defines:l,overrideFog:!1})}else if(d)s=m=n.getOrCreateProgram("buildingBloom",{config:b,defines:l,overrideFog:!1}),g=tF(ik);else{let a=n.transform.calculatePosMatrix(y.toUnwrapped(),n.transform.worldSize);i.fc(a,a,[1,1,r.verticalScale]),i.fc(iR,a,[1,-1,1/f]),i.dr(iR,iR),i.fR(iR,iR);let o=n.transform.getFreeCameraOptions().position,c=1<<y.canonical.z;if(g=tD(ik,iR,r.opacity,r.facadeAOIntensity,[((o.x-y.wrap)*c-y.canonical.x)*i.r,(o.y*c-y.canonical.y)*i.r,o.z*c*i.r],x.tileToMeter,r.facadeEmissiveChance,r.floodLightColor,r.floodLightIntensity,_),m=n.getOrCreateProgram("building",{config:b,defines:l,overrideFog:!1}),!0===r.depthOnly)s=m;else{let i=l.concat(["BUILDING_FAUX_FACADE","HAS_ATTRIBUTE_a_faux_facade_color_emissive"]);s=n.getOrCreateProgram("building",{config:b,defines:i,overrideFog:!1})}
9h&&(h.setupShadowsFromMatrix(a,m,!0),s!==m&&s.setShadowUniformValues(u,h.getShadowUniformValues()))}let T=(i,a)=>{if(d){let s=i.entranceBloom;a.draw(n,u.gl.TRIANGLES,r.depthMode,t7.disabled,r.blendMode,tj.disabled,g,o.id,s.layoutVertexBuffer,s.indexBuffer,s.segmentsBucket,o.paint,n.transform.zoom,b,[s.layoutAttenuationBuffer,s.layoutColorBuffer])}else{let s=i.segmentsBucket,l=[i.layoutNormalBuffer,i.layoutCentroidBuffer,i.layoutColorBuffer,i.layoutFloodLightDataBuffer];i.layoutFacadePaintBuffer&&(l=l.concat([i.layoutFacadeDataBuffer,i.layoutFacadeVerticalRangeBuffer,i.layoutFacadePaintBuffer])),a.draw(n,u.gl.TRIANGLES,r.depthMode,t7.disabled,r.blendMode,c?tj.disabled:tj.backCW,g,o.id,i.layoutVertexBuffer,i.indexBuffer,s,o.paint,n.transform.zoom,b,l)}};n.uploadCommonUniforms(u,m,y.toUnwrapped(),null,p),x.buildingWithoutFacade&&T(x.buildingWithoutFacade,m),x.buildingWithFacade&&(s!==m&&n.uploadCommonUniforms(u,s,y.toUnwrapped(),null,p),T(x.buildingWithFacade,s))}}function iL(r,n,a,o,s,l,u,c,d,h,f,p,m,g){let _=r.context.gl,y=r.depthModeForSublayer(1,tz.ReadOnly,_.LEQUAL,!0),v=i.dY(.1,3,f),x=r._showOverdrawInspector,b=new iw;x||iE(b,r,n,a,o,y,new t7({func:_.ALWAYS,mask:255},255,255,_.KEEP,_.KEEP,_.REPLACE),new ie([_.ONE,_.ONE,_.ONE,_.ONE],i.i.transparent,[!1,!1,!1,!0],_.MIN),tj.disabled,s,"sdf",l,u,c,d,h,v,p,!1,void 0);{let f=x?t7.disabled:new t7({func:_.EQUAL,mask:255},255,255,_.KEEP,_.DECR,_.DECR),m=x?r.colorModeForRenderPass():new ie([_.ONE_MINUS_DST_ALPHA,_.DST_ALPHA,_.ONE,_.ONE],i.i.transparent,[!0,!0,!0,!0]);iE(b,r,n,a,o,y,f,m,tj.disabled,s,"color",l,u,c,d,h,v,p,!1,void 0)}}class iP{constructor(){this._previousClosestBuildingId=null,this._hysteresisRatio=.8,this._indoorMinimumZoom=16}findClosestBuilding(i,r,n,a,o){if(n<this._indoorMinimumZoom)return this._previousClosestBuildingId=null,null;let s=null,l=Number.MAX_VALUE,u=Number.MAX_VALUE,c=!1,d=this._previousClosestBuildingId?i[this._previousClosestBuildingId]:null;for(let[n,h]of(this._previousClosestBuildingId&&d&&this._isBuildingVisible(d,a,o)&&(c=!0,u=this._calculateDistance(r,d)),Object.entries(i))){if(!this._isBuildingVisible(h,a,o))continue;let i=this._calculateDistance(r,h);i<l&&(l=i,s=n)}return c&&s&&this._previousClosestBuildingId&&s!==this._previousClosestBuildingId?l>u*this._hysteresisRatio&&(s=this._previousClosestBuildingId):c&&!s&&(s=this._previousClosestBuildingId),this._previousClosestBuildingId=s,s}_calculateDistance(i,r){if(!r.center)return Number.MAX_VALUE;let n=i.lat-r.center[1],a=i.lng-r.center[0];return n*n+a*a}_isBuildingVisible(r,n,a){if(!a)return!1;for(let n of r.floorIds){let o=r.floors[n];if(!o.geometry)continue;let s=o.geometry;if("Polygon"===s.type){let r=this._convertRingToPoints(s.coordinates[0]);if(i.eO(r,a))return!0}else if("MultiPolygon"===s.type){let r=this._convertMultiPolygonToPoints(s.coordinates);if(i.eN(a,r))return!0}}return!1}_convertRingToPoints(r){return r.map(r=>new i.au(r[0],r[1]))}_convertMultiPolygonToPoints(r){return r.map(r=>0===r.length?[]:r[0].map(r=>new i.au(r[0],r[1])))}}let iO=(i,r,n,a,o,s,l,u,c,d,h,f)=>({u_matrix:i,u_normalize_matrix:r,u_globe_matrix:n,u_merc_matrix:a,u_grid_matrix:o,u_tl_parent:s,u_scale_parent:d,u_fade_t:h.mix,u_opacity:h.opacity,u_image0:0,u_image1:1,u_raster_elevation:f,u_zoom_transition:l,u_merc_center:u,u_cutoff_params:c}),iD=(i,r,n,a,o,s,l,u,c,d)=>({u_particle_texture:i,u_particle_texture_side_len:r,u_tile_offset:n,u_velocity:a,u_color_ramp:s,u_velocity_res:o,u_max_speed:l,u_uv_offset:u,u_data_scale:[255*c[0],255*c[1]],u_data_offset:d,u_particle_pos_scale:1.1,u_particle_pos_offset:[.05,.05]}),iF=(i,r,n,a,o,s,l,u,c,d)=>({u_particle_texture:i,u_particle_texture_side_len:r,u_velocity:n,u_velocity_res:a,u_max_speed:o,u_speed_factor:s,u_reset_rate:l,u_rand_seed:Math.random(),u_uv_offset:u,u_data_scale:[255*c[0],255*c[1]],u_data_offset:d,u_particle_pos_scale:1.1,u_particle_pos_offset:[.05,.05]});function iN(i,[r,n,a,o],[s,l]){if(s===l)return[0,0,0,0];let u=255*(i-1)/(i*(l-s));return[r*u,n*u,a*u,o*u]}function ij(i,r,[n,a]){return n===a?0:.5/i+(r-n)*(i-1)/(i*(a-n))}i.af.setPbf(i.as);class iz extends i.b0{constructor(i,r,n,a,o){super(i,r,n,a,o),this._workQueuePerLayer=new Map,this._fetchQueuePerLayer=new Map,this._taskQueue=new Map,this._isHeaderLoaded=!1,this.textureDescriptorPerLayer=new Map,this.texturePerLayer=new Map}
9getLayers(){return this._mrt?Object.values(this._mrt.layers):[]}getLayer(i){return this._mrt&&this._mrt.getLayer(i)}setTexturePerLayer(r,n,a){let o=a.context,s=o.gl,l=this.texturePerLayer.get(r)||a.getTileTexture(n.width);l&&l instanceof i.a_?l.update(n,{premultiply:!1}):l=new i.a_(o,n,s.RGBA8,{premultiply:!1}),this.texturePerLayer.has(r)||this.texturePerLayer.set(r,l)}flushQueues(i){let r=this._workQueuePerLayer.get(i)||[],n=this._fetchQueuePerLayer.get(i)||[];for(;r.length;)r.pop()();for(;n.length;)n.pop()()}flushAllQueues(){for(let i of this._workQueuePerLayer.keys()){let r=this._workQueuePerLayer.get(i)||[];for(;r.length;)r.pop()()}for(let i of this._fetchQueuePerLayer.keys()){let r=this._fetchQueuePerLayer.get(i)||[];for(;r.length;)r.pop()()}}fetchHeader(r=16384,n){let a=this._mrt=new i.af(30),o=Object.assign({},this.requestParams,{headers:{Range:"bytes=0-"+(r-1)}});return this.entireBuffer=null,this.request=i.cG(o,(i,o,s)=>{if(i)n(i);else try{let i=a.getHeaderLength(o);if(i>r)return void(this.request=this.fetchHeader(i,n));a.parseHeader(o),this._isHeaderLoaded=!0;let l=0;for(let i of Object.values(a.layers))l=Math.max(l,i.dataIndex.at(-1).lastByte);o.byteLength>=l&&(this.entireBuffer=o),n(null,this.entireBuffer||o,s)}catch(i){n(i)}}),this.request}fetchBandForRender(i,r,n,a){this.fetchBand(i,r,n,o=>{if(o)return void a(o);this.updateTextureDescriptor(i,r,n);let s=this.textureDescriptorPerLayer.get(r);a(null,s?s.img:null)})}fetchBand(r,n,a,o,s=!0){let l,u,c=this._mrt;if(!this._isHeaderLoaded||!c)return void o(Error("Tile header is not ready"));let d=this.actor;if(!d)return void o(Error("Can't fetch tile band without an actor"));let h=i.ea(String(a),i.ea(this.tileID.key,r)),f=this._taskQueue.get(h);f?f.add(o):((f=new Set).add(o),this._taskQueue.set(h,f));let p=(i,r)=>{l.complete(i,r),i?o(i):(f.forEach(i=>i(null,r)),this._taskQueue.delete(h))},m=(i,r)=>{if(i)return o(i);let a=d.send("decodeRasterArray",{type:"raster-array",source:this.source,scope:this.scope,tileID:this.tileID,uid:this.uid,buffer:r,task:l},p,void 0,!0);if(null!==n){let i=this._workQueuePerLayer.get(n)||[];
9i.push(()=>{a&&a.cancel(),l.cancel()}),this._workQueuePerLayer.has(n)||this._workQueuePerLayer.set(n,i)}};try{u=c.getLayer(r)}catch(i){if("reloading"===this.state)return;throw i}if(!u)return void o(Error(`Unknown sourceLayer "${r}"`));if(u.hasDataForBand(a))return f.forEach(i=>i(null,null)),void this._taskQueue.delete(h);let g=u.getDataRange([a]);if(!(l=c.createDecodingTask(g))||l.tasks.length)if(null!==n&&this.flushQueues(n),this.entireBuffer)m(null,this.entireBuffer.slice(g.firstByte,g.lastByte+1));else{let r=Object.assign({},this.requestParams,{headers:{Range:`bytes=${g.firstByte}-${g.lastByte}`}}),a=i.cG(r,m);if(null!==n){let i=this._fetchQueuePerLayer.get(n)||[];i.push(()=>{a.cancel(),l.cancel()}),this._fetchQueuePerLayer.has(n)||this._fetchQueuePerLayer.set(n,i)}}}updateNeeded(i,r){return(!this.textureDescriptorPerLayer.get(i)||this.textureDescriptorPerLayer.get(i).band!==r||this.refreshedUponExpiration)&&"errored"!==this.state}updateTextureDescriptor(r,n,a){if(!this._mrt)return;let o=this._mrt.getLayer(r);if(!o||!o.hasBand(a)||!o.hasDataForBand(a))return;let{bytes:s,tileSize:l,buffer:u,offset:c,scale:d}=o.getBandView(a),h=l+2*u,f=new i.ay({width:h,height:h},s),p=this.texturePerLayer.get(n);p&&p instanceof i.a_&&p.update(f,{premultiply:!1}),this.textureDescriptorPerLayer.set(n,{layer:r,band:a,img:f,buffer:u,offset:c,tileSize:l,format:o.pixelFormat,mix:[d,256*d,65536*d,0x1000000*d]})}destroy(r=!1){if(super.destroy(r),delete this._mrt,!r)for(let r of this.texturePerLayer.values())r&&r instanceof i.a_&&r.destroy();this.texturePerLayer.clear(),this.textureDescriptorPerLayer.clear(),this.fbo&&(this.fbo.destroy(),delete this.fbo),delete this.request,delete this.requestParams,this._isHeaderLoaded=!1}}function iB(r,n){let a=Math.pow(2,n.z),o=Math.floor(i.ek(r.getWest())*a),s=Math.floor(i.el(r.getNorth())*a),l=Math.ceil(i.ek(r.getEast())*a),u=Math.ceil(i.el(r.getSouth())*a);return n.x>=o&&n.x<l&&n.y>=s&&n.y<u}class iU{constructor(r,n,a){this.bounds=r?i.ac.convert(this.validateBounds(r)):null,this.minzoom=n||0,this.maxzoom=a||24}
9validateBounds(i){return Array.isArray(i)&&4===i.length?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]}addExtraBounds(r){if(r)for(let n of(this.extraBounds||(this.extraBounds=[]),r))this.extraBounds.push(i.ac.convert(this.validateBounds(n)))}contains(i){if(i.z>this.maxzoom||i.z<this.minzoom||this.bounds&&!iB(this.bounds,i))return!1;if(!this.extraBounds)return!0;for(let r of this.extraBounds)if(iB(r,i))return!0;return!1}static fromTileJSON(i){if(!i.bounds&&!i.extra_bounds)return null;let r=new iU(i.bounds,i.minzoom,i.maxzoom);return r.addExtraBounds(i.extra_bounds),r}}class iV extends i.y{constructor(r,n,a,o){super(),this.id=r,this.dispatcher=a,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=Object.assign({type:"raster"},n),Object.assign(this,i.eF(n,["url","scheme","tileSize"]))}load(r){this._loaded=!1,this.fire(new i.x("dataloading",{dataType:"source"}));let n=this.map.getWorldview(),a=(n,a)=>{this._tileJSONRequest=null,this._loaded=!0,n?this.fire(new i.v(n)):a&&(Object.assign(this,a),a.raster_layers&&(this.rasterLayers=a.raster_layers,this.rasterLayerIds=this.rasterLayers.map(i=>i.id)),this.tileBounds=iU.fromTileJSON(a),K(a.tiles),this.fire(new i.x("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new i.x("data",{dataType:"source",sourceDataType:"content"}))),r&&r(n)};this.provider="string"==typeof this._options.provider?this._options.provider:void 0,this._tileProvider=void 0;let o=i.f1(this._options);return o instanceof Error?(this._loaded=!0,this.fire(new i.v(o)),void(r&&r())):this.provider&&!o?(this._loaded=!0,this.fire(new i.v(Error(`TileProvider "${this.provider}" is not registered`))),void(r&&r())):void(this._tileJSONRequest=o?this.loadTileJSONWithProvider(o,a):i.e7(this._options,this.map._requestManager,null,n,a))}loadTileJSONWithProvider(r,n){this.provider=r.name;let{request:a,options:o}=i.eC(this._options,this.map._requestManager),s=new AbortController;return i.e8(r.name,r.url).then(i=>{if(s.signal.aborted)return;let r=new i(o);return r.load&&a?r.load({request:a}).then(i=>(this._tileProvider=r,i)):(this._tileProvider=r,null)}).then(r=>{if(s.signal.aborted)return;let a=i.eW(this._options,r,this.map._requestManager);a instanceof Error?n(a):n(null,a)}).catch(i=>{s.signal.aborted||n(i instanceof Error?i:Error(String(i)))}),{cancel:()=>s.abort()}}loaded(){return this._loaded}onAdd(i){this.map=i,this.load()}reload(){this.cancelTileJSONRequest();let r=i.ea(this.id,this.scope);this.load(()=>this.map.style.clearSource(r))}setTiles(i){return this._options.tiles=i,this.reload(),this}setUrl(i){return this.url=i,this._options.url=i,this.reload(),this}onRemove(i){this.cancelTileJSONRequest()}serialize(){return Object.assign({},this._options)}hasTile(i){return!this.tileBounds||this.tileBounds.contains(i.canonical)}loadTile(r,n){let a=i.co.devicePixelRatio>=2,o=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme),a,this.tileSize),s=this.map._requestManager.transformRequest(o,i.aH.Tile);if(this._tileProvider){let i=new AbortController;r.request={cancel:()=>i.abort()},this.loadTileWithProvider(r,this._tileProvider,s,i,n)}else r.request=i.cQ(s,(a,o,s)=>{if(delete r.request,r.aborted)return r.state="unloaded",n(null);if(a)return r.state="errored",n(a);if(!o)return n(null);let l=i.cO(s);this.map._refreshExpiredTiles&&r.setExpiryData(l),r.setTexture(o,this.map.painter),r.state="loaded",i.bv(this.dispatcher),n(null)})}async loadTileWithProvider(i,r,n,a,o){let{z:s,x:l,y:u}=i.tileID.canonical;try{let c=await r.loadTile({z:s,x:l,y:u},{request:n,signal:a.signal});if(a.signal.aborted)return i.state="unloaded",o(null);if(null==c){let r=Error("Tile not found");return r.status=404,i.state="errored",o(r)}if(null==c.data)return i.state="loaded",o(null);let d=c.data instanceof ImageBitmap?c.data:await createImageBitmap(new Blob([c.data]));if(a.signal.aborted)return i.state="unloaded",o(null);i.setTexture(d,this.map.painter),i.state="loaded",this.map._refreshExpiredTiles&&i.setExpiryData({cac
9heControl:c.cacheControl,expires:c.expires}),o(null)}catch(r){if(a.signal.aborted||r instanceof DOMException&&"AbortError"===r.name)return i.state="unloaded",o(null);i.state="errored",o(r instanceof Error?r:Error(String(r)))}finally{delete i.request}}abortTile(i,r){i.request&&(i.request.cancel(),delete i.request),r&&r()}unloadTile(r,n){r.texture&&r.texture instanceof i.a_?(r.destroy(!1),r.texture&&r.texture instanceof i.a_&&this.map.painter.saveTileTexture(r.texture)):r.destroy(),n&&n()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class iH extends iV{constructor(i,r,n,a){super(i,r,n,a),this.type="raster-array",this.maxzoom=22,this.partial=!0,this._loadTilePending={},this._loadTileLoaded={},this._options=Object.assign({type:"raster-array"},r)}triggerRepaint(i){let r=this.map.painter._terrain,n=this.map.style.getSourceCache(this.id);r&&r.enabled&&n&&r._clearRenderCacheForTile(n.id,i.tileID),this.map.triggerRepaint()}loadTile(r,n){let a=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),o=this.map._requestManager.transformRequest(a,i.aH.Tile),s={request:o,uid:r.uid,tileID:r.tileID,type:this.t
9ype,source:this.id,scope:this.scope,partial:this.partial};r.source=this.id,r.scope=this.scope,r.requestParams=o,r.actor||(r.actor=this.dispatcher.getActor());let l=(a,o,s)=>{if(delete r.request,r.aborted)return r.state="unloaded",n(null);if(a){if("AbortError"===a.name)return;return r.state="errored",n(a)}if(this.map._refreshExpiredTiles&&o){let n=i.cO(s);r.setExpiryData(n)}if(this.partial&&"expired"!==r.state)r.state="empty";else if(!this.partial){if(!o)return n(null);r.state="loaded",r._isHeaderLoaded=!0,r._mrt=o}n(null)};r.request=this.partial?r.fetchHeader(void 0,l.bind(this)):r.actor.send("loadTile",s,l.bind(this),void 0,!0)}abortTile(i){i.request&&(i.request.cancel(),delete i.request),i.actor&&i.actor.send("abortTile",{uid:i.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(i,r){let n=i.texturePerLayer;if(i.flushAllQueues(),n.size)for(let r of(i.destroy(!1),n.values()))this.map.painter.saveTileTexture(r);else i.destroy()}prepareTile(r,n,a,o){r._isHeaderLoaded&&("empty"!==r.state&&(r.state="reloading"),r.fetchBandForRender(n,a,o,(n,o)=>{n?(r.state="errored",this.fire(new i.v(n))):o&&(r._isHeaderLoaded=!0,r.setTexturePerLayer(a,o,this.map.painter),r.state="loaded"),this.triggerRepaint(r)}))}getInitialBand(i){if(!this.rasterLayers)return 0;let r=this.rasterLayers.find(({id:r})=>r===i),n=r&&r.fields,a=n&&n.bands&&n.bands;return a?a[0]:0}getTextureDescriptor(r,n,a){if(!r)return;let o=n.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!o)return;let s=null;n instanceof i.aA?s=n.paint.get("raster-array-band"):n instanceof i.az&&(s=n.paint.get("raster-particle-array-band"));let l=s||this.getInitialBand(o);return null==l?void 0:r.textureDescriptorPerLayer.get(n.id)?!r.updateNeeded(n.id,l)||a?Object.assign({},r.textureDescriptorPerLayer.get(n.id),{texture:r.texturePerLayer.get(n.id)}):void 0:void this.prepareTile(r,o,n.id,l)}getImages(r,n){let a=new Map;for(let o of r)for(let r of n){let[n,s]=r.split("/"),l=o.getLayer(n);if(!l||!l.hasBand(s)||!l.hasDataForBand(s))continue;let{bytes:u,tileSize:c,buffer:d}=l.getBandView(s),h=c+2*d,f={data:new i.ay({width:h,height:h},u),pixelRatio:2,sdf:!1,usvg:!1,version:0};a.set(r,f)}return a}queryRasterArrayValueByBandId(r,n,a){let o=n._mrt;return new Promise(s=>{let l={},u=new Set;for(let[c,d]of Object.entries(o.layers)){if(a.layerName&&c!==a.layerName)continue;let h={};for(let{bands:f}of(l[c]=h,d.dataIndex))for(let p of f)a.bands&&!a.bands.includes(p)||(u.add(i.ea(c,p)),n.fetchBand(c,null,p,n=>{i.co.frame(()=>{h[p]=n?null:function([r,n],a,o,{scaled:s=!0}={}){let{tileSize:l,buffer:u}=o,{x:c,y:d,z:h}=a;if(!isFinite(c)||!isFinite(d)||!isFinite(h))throw Error("Invalid MRT header");let f=2**h;return function([i,r],n,{scaled:a=!0}={}){if(!n)throw Error("bandView is undefined");let{data:o,tileSize:s,buffer:l,offset:u,scale:c,dimension:d}=n;if(i<-l||i>s+l||r<-l||r>s+l)throw Error(`Point (${i}, ${r}) out of bounds for tileSize=${s}, buffer=${l}`);let h=(r+l)*(s+2*l)+(i+l);if(0xffffffff===new Uint32Array(o.buffer)[h])return null;let f=[];f=a?[]:new(0,n.data.constructor)(d);for(let i=0;i<d;i++)f[i]=Math.round(1e12*(o[d*h+i]*c+u))/1e12;return f}([Math.min(Math.max(-u,Math.floor((f*i.ek(r)-c)*l)),l-1+u),Math.min(Math.max(-u,Math.floor((f*i.el(n)-d)*l)),l-1+u)],o,{scaled:s})}([r.lng,r.lat],o,d.getBandView(p)),u.delete(i.ea(c,p)),0===u.size&&s(l)})},!1))}0===u.size&&s(l)})}_loadTileForQuery(r,n){if(this._loadTileLoaded[r.uid])return void n(null,r._mrt);if(this._loadTilePending[r.uid])return void this._loadTilePending[r.uid].push(n);this._loadTilePending[r.uid]=[n];let a=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),o=this.map._requestManager.transformRequest(a,i.aH.Tile);r.actor.send("loadTile",{request:o,uid:r.uid,tileID:r.tileID,type:this.t
9ype,source:this.id,scope:this.scope,partial:!1},(n,a,o)=>{if(n)return this._loadTilePending[r.uid].forEach(i=>i(n,null)),void delete this._loadTilePending[r.uid];if(!a)return this._loadTilePending[r.uid].forEach(i=>i(null,null)),void delete this._loadTilePending[r.uid];if(this.map._refreshExpiredTiles&&a){let n=i.cO(o);r.setExpiryData(n)}r._mrt=a,r._isHeaderLoaded=!0,r.state="loaded",this._loadTilePending[r.uid].forEach(i=>i(null,a)),this._loadTileLoaded[r.uid]=!0,delete this._loadTilePending[r.uid]},void 0,!0)}queryRasterArrayValueByAllBands(i,r,n){return new Promise((a,o)=>{this._loadTileForQuery(r,(s,l)=>{s?o(s):a(l?this.queryRasterArrayValueByBandId(i,r,n):null)})})}queryRasterArrayValue(r,n){let a=i.ab.convert(r),o=this.findLoadedParent(a);return o&&o._mrt?n.bands||!this.partial?this.queryRasterArrayValueByBandId(a,o,n):this.queryRasterArrayValueByAllBands(a,o,n):Promise.resolve(null)}findLoadedParent(r){let n=i.ag.fromLngLat(r,this.map.transform.tileSize),a=this.maxzoom+1,o=1<<a,s=Math.floor(n.x),l=Math.floor((n.x-s)*o),u=Math.floor(n.y*o),c=this.map.style.getSourceCache(this.id),d=new i.ap(a,s,a,l,u);return c.findLoadedParent(d,this.minzoom)}}var iG=i.b_([{name:"a_index",type:"Int16",components:1}]);class iq{constructor(r,n,a,o){const s={width:a[0],height:a[1],data:null},l=r.gl;this.targetColorTexture=new i.a_(r,s,l.RGBA8,{useMipmap:!1}),this.backgroundColorTexture=new i.a_(r,s,l.RGBA8,{useMipmap:!1}),this.context=r,this.updateParticleTexture(n,o),this.lastInvalidatedAt=0}updateParticleTexture(r,n){if(this.particleTextureDimension===n.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());let a=this.context.gl,o=n.width*n.height;this.particleTexture0=new i.a_(this.context,n,a.RGBA8,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new i.a_(this.context,n,a.RGBA8,{premultiply:!1,useMipmap:!1});let s=new i.aL;s.reserve(o);for(let i=0;i<o;i++)s.emplaceBack(i);this.particleIndexBuffer=this.context.createVertexBuffer(s,iG.members,!0),this.particleSegment=i.aJ.simpleSegment(0,0,this.particleIndexBuffer.length,0),this.particleTextureDimension=n.width}update(r){return!(this.lastInvalidatedAt<r&&(this.lastInvalidatedAt=i.co.now(),1))}destroy(){this.targetColorTexture.destroy(),this.backgroundColorTexture.destroy(),this.particleIndexBuffer.destroy(),this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleSegment.destroy()}}function i$(r,n,a,o,s){if(s>0){let l=i.co.now(),u=(l-r.timeAdded)/s,c=n?(l-n.timeAdded)/s:-1,d=a.getSource(),h=o.coveringZoomLevel({tileSize:d.tileSize,roundZoom:d.roundZoom}),f=!n||Math.abs(n.tileID.overscaledZ-h)>Math.abs(r.tileID.overscaledZ-h),p=f&&r.refreshedUponExpiration?1:i.bG(f?u:1-c,0,1);return n?{opacity:1,mix:1-p,isFading:u<1}:{opacity:p,mix:0,isFading:u<1}}return{opacity:1,mix:0,isFading:!1}}var iW="#ifdef RASTER_ARRAY\nuniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec2 u_data_scale;ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=u_data_offset+vec2(dot(t.rg,u_data_scale),dot(t.ba,u_data_scale));velocity.y=-velocity.y;velocity/=max(u_max_speed,length(velocity));return velocity;}\n#endif\nuniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}",iY="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef RENDER_CUTOFF\nfloat cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);}\n#endif",iZ="\n#ifdef DUAL_SOURCE_BLENDING\nlayout(location=0,index=0) out vec4 glFragColor;layout(location=0,index=1) out vec4 glFragColorSrc1;\n#elif defined(FLOAT_RENDER_TARGET)\nlayout(location=0) out highp vec4 glFragColor;\n#else\nlayout(location=0) out vec4 glFragColor;\n#endif\n#ifdef USE_MRT1\nlayout(location=1) out vec4 out_Target1;\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\n#ifdef INDICATOR_CUTOUT\nuniform vec3 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params;\n#endif\nconst float DITHER_THRESHOLDS[16]=float[16](\n1.0/17.0, 9.0/17.0, 3.0/17.0,11.0/17.0,13.0/17.0, 5.0/17.0,15.0/17.0, 7.0/17.0,4.0/17.0,12.0/17.0, 2.0/17.0,10.0/17.0,16.0
9/17.0, 8.0/17.0,14.0/17.0, 6.0/17.0\n);vec4 applyCutout(vec4 color,float height) {\n#ifdef INDICATOR_CUTOUT\nfloat verticalFadeRange=u_indicator_cutout_centers.z*0.25;float holeMinOpacity=mix(1.0,u_indicator_cutout_params.x,smoothstep(u_indicator_cutout_centers.z,u_indicator_cutout_centers.z+verticalFadeRange,height));float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0);\n#else\nreturn color;\n#endif\n}float cutoutGroundRoofOpacity(vec4 groundRoof) {\n#ifdef INDICATOR_CUTOUT\nfloat fadeStartX=u_indicator_cutout_params.w;float holeRadius=u_indicator_cutout_params.y;float holeMinOpacity=mix(u_indicator_cutout_params.x,1.0,smoothstep(u_indicator_cutout_params.z,u_indicator_cutout_centers.z,groundRoof.y));float distX=abs(u_indicator_cutout_centers.x-groundRoof.x);float roofOpacity=mix(holeMinOpacity,1.0,smoothstep(fadeStartX,holeRadius,u_indicator_cutout_centers.y-groundRoof.w));float groundOpacity=min(smoothstep(fadeStartX,holeRadius,distX)+holeMinOpacity,1.0);return max(roofOpacity,groundOpacity);\n#else\nreturn 1.0;\n#endif\n}\n#ifdef DEBUG_WIREFRAME\n#define HANDLE_WIREFRAME_DEBUG \\\nglFragColor=vec4(0.7,0.0,0.0,0.7); \\\ngl_FragDepth=gl_FragCoord.z-0.0001;\n#else\n#define HANDLE_WIREFRAME_DEBUG\n#endif\n#ifdef RENDER_CUTOFF\nuniform highp vec4 u_cutoff_params;in float v_cutoff_opacity;\n#endif\nvec4 textureLodCustom(sampler2D image,highp vec2 pos,highp vec2 lod_coord) {highp vec2 size=vec2(textureSize(image,0));highp vec2 dx=dFdx(lod_coord.xy*size);highp vec2 dy=dFdy(lod_coord.xy*size);highp float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));highp float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}vec4 premultiplyColor(vec3 nonPremultipliedColor,float a) {return vec4(nonPremultipliedColor*a,a);}vec3 unpremultiplyColor(vec4 premultipliedColor) {if (premultipliedColor.a > 0.0) {return premultipliedColor.rgb/premultipliedColor.a;}return premultipliedColor.rgb;}vec3 applyLUT(highp sampler3D lut,vec3 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return texture(lut,uvw).rgb;}vec4 applyLUT(highp sampler3D lut,vec4 premultipliedColor) {return premultiplyColor(applyLUT(lut,unpremultiplyColor(premultipliedColor)),premultipliedColor.a);}",iK="\n#define EXTENT 8192.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}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 vec2 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);
9return (units_to_pixels*pos+offset)/pattern_size;}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) {return get_pattern_pos(pixel_coord_upper,pixel_coord_lower,pattern_size,vec2(tile_units_to_pixels),pos);}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}\n#ifdef RENDER_CUTOFF\nuniform vec4 u_cutoff_params;out float v_cutoff_opacity;\n#endif\nconst vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(ivec2 posWithComposedSkirt)\n{float skirt=float(float(posWithComposedSkirt.x) >=skirtOffset);vec2 pos=vec2(posWithComposedSkirt)-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}\n#ifndef HAS_SHADER_STORAGE_BLOCK_material_buffer\n#define GET_ATTRIBUTE_float(attrib,matInfo,attrib_id) attrib\n#define GET_ATTRIBUTE_vec4(attrib,matInfo,attrib_id) attrib\n#define GET_ATTRIBUTE_vec2(attrib,matInfo,attrib_id) attrib\n#define DECLARE_MATERIAL_TABLE_INFO\n#endif",iX="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",iQ="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\n#ifdef TERRAIN\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}
9\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nvec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }\n#endif\n#ifdef DEPTH_OCCLUSION\nuniform highp sampler2D u_depth;uniform highp vec2 u_depth_size_inv;uniform highp vec2 u_depth_range_unpack;uniform highp float u_occluder_half_size;uniform highp float u_occlusion_depth_offset;\n#ifdef DEPTH_D24\nfloat unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}vec4 unpack_depth4(vec4 depth) {return depth*u_depth_range_unpack.x+vec4(u_depth_range_unpack.y);}\n#else\nhighp float unpack_depth_rgba(vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;\n#ifdef CLIP_ZERO_TO_ONE\ncoord.z=-1.0+2.0*coord.z; \n#endif\n#ifdef DEPTH_D24\nfloat depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r);\n#else\nfloat depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5));\n#endif\nreturn coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_
9size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef DEPTH_D24\nhighp vec4 depth=vec4(\ntexture(u_depth,uv-df.xz).r,texture(u_depth,uv+df.xz).r,texture(u_depth,uv-df.zy).r,texture(u_depth,uv+df.zy).r\n);depth=unpack_depth4(depth);\n#else\nhighp vec4 depth=vec4(\nunpack_depth_rgba(texture(u_depth,uv-df.xz)),unpack_depth_rgba(texture(u_depth,uv+df.xz)),unpack_depth_rgba(texture(u_depth,uv-df.zy)),unpack_depth_rgba(texture(u_depth,uv+df.zy))\n);\n#endif\nreturn depth;}highp float occlusionFadeMultiSample(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef CLIP_ZERO_TO_ONE\ncoord.z=-1.0+2.0*coord.z; \n#endif\nint NX=3;int NY=4;highp vec2 df=u_occluder_half_size*u_depth_size_inv;highp vec2 oneStep=2.0*u_occluder_half_size*u_depth_size_inv/vec2(NX-1,NY-1);highp float res=0.0;for (int y=0; y < NY;++y) {for (int x=0; x < NX;++x) {\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)));\n#endif\nres+=1.0-clamp(300.0*(coord.z+u_occlusion_depth_offset-depth),0.0,1.0);}}res=clamp(2.0*res/float(NX*NY)-0.5,0.0,1.0);return res;}highp float occlusionFade(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;\n#ifdef CLIP_ZERO_TO_ONE\ncoord.z=-1.0+2.0*coord.z; \n#endif\nhighp vec4 depth=getCornerDepths(coord.xy);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z+u_occlusion_depth_offset)-depth),0.0,1.0));}\n#else\nbool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; }\n#endif",iJ="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",i1="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;\n#ifdef FLIP_Y\nuv.y=1.0-uv.y;\n#endif\nhighp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}
9vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {return color;}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif",i0="\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);}\n#endif",i2="#ifdef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}
9vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0)\n);}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0)\n);}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}\n#endif",i5="#ifdef RENDER_SHADOWS\nuniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {vec3 transformed_normal=vec3(-normal.xy,normal.z);float NDotL=dot(normalize(transformed_normal),u_shadow_direction);float dotScale=min(1.0-NDotL,1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];}\n#endif",i4="#ifdef RENDER_SHADOWS\nprecision highp sampler2DShadow;uniform sampler2DShadow u_shadowmap_0;uniform sampler2DShadow u_shadowmap_1;uniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;float shadow_sample(sampler2DShadow shadowmap,highp vec3 pos,highp float bias) {\n#ifdef CLIP_ZERO_TO_ONE\nhighp vec3 coord=vec3(pos.xy*0.5+0.5,pos.z-bias);\n#else\nhighp vec3 coord=vec3(pos.xy*0.5+0.5,pos.z*0.5+0.5-bias);\n#endif\nreturn texture(shadowmap,coord);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {light_view_pos0.xyz/=light_view_pos0.w;\n#ifdef SHADOWS_SINGLE_CASCADE\nvec2 abs_bounds=abs(light_view_pos0.xy);if (abs_bounds.x >=1.0 || abs_bounds.y >=1.0) {return 0.0;}return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias);\n#else\nlight_view_pos1.xyz/=light_view_pos1.w;vec4 abs_bounds=abs(vec4(light_view_pos0.xy,light_view_pos1.xy));if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}float occlusion1=shadow_sample(u_shadowmap_1,light_view_pos1.xyz,bias);return clamp(mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth)),0.0,1.0);\n#endif\n}highp float calculate_shadow_bias(float NDotL) {\n#ifdef NORMAL_OFFSET\nreturn 0.5*u_shadow_bias.x;\n#else\nreturn 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z));\n#endif\n}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_opacity(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,float shadow_opacity) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias)*shadow_opacity;return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}highp vec2 compute_receiver_plane_depth_bias(highp vec3 pos_dx,highp vec3 pos_dy)\n{highp vec2 biasUV=vec2(\npos_dy.y*pos_dx.z-pos_dx.y*pos_dy.z,pos_dx.x*pos_dy.z-pos_dy.x*pos_dx.z);biasUV*=1.0/((pos_dx.x*pos_dy.y)-(pos_dx.y*pos_dy.x));return biasUV;}float shadowed_light_factor_plane_bias(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {highp vec3 light_view_pos0_xyz=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;highp vec3 light_view_pos0_ddx=dFdx(light_view_pos0_xyz);highp vec3 light_view_pos0_ddy=dFdy(light_view_pos0_xyz);highp vec2 plane_depth_bias=compute_receiver_plane_depth_bias(light_view_pos0_ddx,light_view_pos0_ddy);highp float bias=dot(vec2(u_shadow_texel_size,u_shadow_texel_size),plane_depth_bias)+0.0001;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);}\n#endif";
9let i9=/#include\s+"([^"]+)"/g,i3=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g,i8=/\b[A-Za-z_][A-Za-z0-9_]*\b/g,i6=new Set(["ifdef","ifndef","elif","if","defined"]),i7=new Set;ru(iY,i7),ru(iK,i7),ru(iZ,i7);let re={"_prelude_fog.vertex.glsl":iJ,"_prelude_terrain.vertex.glsl":iQ,"_prelude_shadow.vertex.glsl":i5,"_prelude_material_table.vertex.glsl":"#ifdef HAS_SHADER_STORAGE_BLOCK_material_buffer\n#define MATERIAL_TABLE_DEBUG 0\nuniform int u_material_offset;uniform int u_vertex_offset;layout(std140,binding=0)readonly buffer material_buffer{uvec4 material_data[];};struct MaterialInfo{uint dataOffset;\n#if MATERIAL_TABLE_DEBUG\nvec4 colorDebug;\n#endif\n};uint read_buf_no_offset(uint iDword) {return material_data[iDword/4u][iDword % 4u];}uint read_buf(uint iDword) {iDword+=uint(u_material_offset/4);return read_buf_no_offset(iDword);}float read_buf_float(uint iDword){return uintBitsToFloat(read_buf(iDword));}uint read_buf_uint8(uint iDword,uint iUint8){uint dwordOffset=iDword+(iUint8/4u);uint byteOffset=iUint8 & 3u;uint bitOffset=8u*byteOffset;uint mask=0xffu << bitOffset;uint dwordVal=read_buf(dwordOffset);return (dwordVal & mask) >> bitOffset;}uint read_buf_uint16(uint iDword,uint iUint16){uint dwordOffset=iDword+(iUint16 >> 1u);uint bitOffset=(iUint16 & 1u)*16u;uint mask=0xffffu << bitOffset;uint dwordVal=read_buf(dwordOffset);return (dwordVal & mask) >> bitOffset;}uint nrDwordsForVertexIdEntries(uint nrMaterialLookupEntries) {return nrMaterialLookupEntries;}uint nrDwordsForMaterialIdEntries(uint nrMaterialLookupEntries) {return (nrMaterialLookupEntries*2u+3u)/4u;}uint findRangeBinarySearch(uint vertexId,uint numRanges,uint dwordOffset) {uint left=0u;uint right=numRanges-1u;for (uint i=0u; i < 16u; i++) { \nif (left > right) {break;}uint mid=(left+right)/2u;uint start=read_buf(dwordOffset+mid);uint nextStart=(mid+1u < numRanges) ? read_buf(dwordOffset+mid+1u) : 0xffffffffu;if (vertexId >=start && vertexId < nextStart) {return mid;} else if (vertexId < start) {if (mid==0u) {break;}right=mid-1u;} else {left=mid+1u;}}return 0u; \n}uint readVertexId(uint dwordOffset,uint iMaterialLookupEntry) {return read_buf(dwordOffset+iMaterialLookupEntry);}uint findRange(uint vertexId,uint numRanges,uint dwordOffset) {uint iRange;if(numRanges <=64u){uint vertexBegin;for(iRange=0u; iRange < numRanges;++iRange) {vertexBegin=readVertexId(dwordOffset,iRange);if(vertexBegin > vertexId) {break;}}iRange=iRange==0u? 0u : iRange-1u;} else { \niRange=findRangeBinarySearch(vertexId,numRanges,dwordOffset);}return iRange;}MaterialInfo read_material_info(uint vertex_id) {MaterialInfo info;\n#if MATERIAL_TABLE_DEBUG\nconst vec4 red=vec4(1.0,0.0,0.0,1.0);const vec4 orange=vec4(1.0,0.5,0.0,1.0);const vec4 yellow=vec4(1.0,1.0,0.0,1.0);const vec4 green=vec4(0.0,1.0,0.0,1.0);const vec4 indigo=vec4(0.294,0.0,0.510,1.0);const vec4 blue=vec4(0.0,0.0,1.0,1.0);const vec4 purple=vec4(0.5,0.0,0.5,1.0);const vec4 pink=vec4(1.0,0.0,1.0,1.0);info.colorDebug=green;\n#endif\nuint offset=0u;\n#if MATERIAL_TABLE_DEBUG\nbool keepFinding=true;uint magic=read_buf(offset);if(magic !=0xCAFEBABEu) {info.colorDebug=red;keepFinding=false;return info;}\n#endif\noffset++;\n#if MATERIAL_TABLE_DEBUG\nuint nrMaterials=read_buf(offset);uint nrVertices=read_buf(offset+1u);if(keepFinding && vertex_id >=nrVertices) {info.colorDebug=red;keepFinding=false;}\n#endif\noffset+=2u;uint nrMaterialLookupEntries=read_buf(offset++);uint perMaterialEntrySizeDwords=read_buf(offset++);\n#if MATERIAL_TABLE_DEBUG\nif(keepFinding && perMaterialEntrySizeDwords !=1u) {info.colorDebug=red;keepFinding=false;}\n#endif\nuint iMaterialLookup=findRange(vertex_id,nrMaterialLookupEntries,offset);\n#if MATERIAL_TABLE_DEBUG\nif(keepFinding)\n{uint vertexBeginCheck=readVertexId(offset,iMaterialLookup);if(vertexBeginCheck > vertex_id) {info.colorDebug=red;keepFinding=false;}if(iMaterialLookup < nrMaterialLookupEntries-1u) {uint vertexEndCheck=readVertexId(offset,iMaterialLookup+1u);if(vertexEndCheck <=vertex_id) {info.colorDebug=red;keepFinding=false;}}}\n#endif\noffset+=nrDwordsForVertexIdEntries(nrMaterialLookupEntries);uint materialId=iMaterialLookup;\n#if MATERIAL_TABLE_DEBUG\nif(keepFinding) {if(materialId >=nrMaterialLookupEntries) {info.colorDebug=red;}}\n#endif\ninfo.dataOffset=offset+materialId*perMaterialEntrySizeDwords;return info;}uint get_data_location(const MaterialInfo matInfo,uint attribOffsetBytes)\n{uint attribFieldOffsetDwords=attribOffsetBytes/4u;return matInfo.dataOffset+attribFieldOffsetDwords;}vec4 read_material_vec4(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return vec4(read_buf_float(loc),read_buf_float(loc+1u),read_buf_float(loc+2u),read_buf_float(loc+3u));}vec2 read_material_vec2(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return vec2(read_buf_float(loc),read_buf_float(loc+1u));}float read_material_float(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return read_buf_float(loc);}\n#define GET_ATTRIBUTE_float(attrib,matInfo,attrib_offset) read_material_float(matInfo,attrib_offset)\n#define GET_ATTRIBUTE_vec4(attrib,matInfo,attrib_offset) read_material_vec4(matInfo,attrib_offset)\n#define GET_ATTRIBUTE_vec2(attrib,matInfo,attrib_offset) read_material_vec2(matInfo,attrib_offset)\n#define DECLARE_MATERIAL_TABLE_INFO MaterialInfo materialInfo=read_material_info(uint(gl_VertexID));\n#define DECLARE_MATERIAL_TABLE_INFO_DEBUG(dbgColor) MaterialInfo materialInfo=read_material_info(uint(gl_VertexID)); dbgColor=materialInfo.colorDebug;\n#endif","_prelude_fog.fragment.glsl":i1,"_prelude_shadow.fragment.glsl":i4,"_prelude_lighting.glsl":i0,"_prelude_raster_array.glsl":i2},rt={},ri="precision highp float;",rr="precision mediump float;",rn="\n#if defined(GL_EXT_blend_func_extended) && defined(DUAL_SOURCE_BLENDING)\n#extension GL_EXT_blend_func_extended : require\n#endif",ra={preludeTerrain:rd("",iQ),preludeFog:rd(i1,iJ),preludeShadow:rd(i4,i5),preludeRasterArray:rd(i2,""),preludeLighting:rd(i0,i0),preludePrecisionQualifiers:rd(rr,ri),prelude:rd(iZ,iK),preludeExtensions:rd(rn,"")},ro=[rn,rr,iY,ra.prelude.fragmentSource].join("\n"),rs=[ri,iY,ra.prelude.vertexSource].join("\n");var rl={background:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec4 u_color;uniform float u_opacity;uniform mediump float u_emissive_strength;\n#ifdef LIGHTING_3D_MODE\nin vec4 v_color;\n#endif\nvoid main() {vec4 out_color;
9\n#ifdef FEATURE_CUTOUT\nvec2 uv=gl_FragCoord.xy*u_inv_viewport_size.xy;\n#ifdef FLIP_Y\nuv.y=1.0-uv.y;\n#endif\nfloat factorTex=min(texture(u_cutout_factor_image,uv).r,1.0);float cutoutFactor=(1.0-u_feature_cutout_params.x)*factorTex;out_color=u_color*(1.0-cutoutFactor);\n#else\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_lighting.glsl"\nin ivec2 a_pos;uniform mat4 u_matrix;uniform mediump float u_emissive_strength;\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec4 u_color;out vec4 v_color;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifndef FEATURE_CUTOUT\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n#endif\n}'),backgroundPattern:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in highp vec2 v_pos;void main() {highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec2 u_pattern_units_to_pixels;in ivec2 a_pos;out highp vec2 v_pos;void main() {vec2 pos=vec2(a_pos);gl_Position=u_matrix*vec4(pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_pattern_units_to_pixels,pos);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),circle:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float blur_positive=blur < 0.0 ? 0.0 : 1.0;lowp float antialiasblur=v_data.z;float extrude_length=length(extrude)+antialiasblur*(1.0-blur_positive);float antialiased_blur=-max(abs(blur),antialiasblur);float antialiase_blur_opacity=smoothstep(0.0,antialiasblur,extrude_length-1.0);float opacity_t=blur_positive==1.0 ? \nsmoothstep(0.0,-antialiased_blur,1.0-extrude_length) : \nsmoothstep(antialiased_blur,0.0,extrude_length-1.0)-antialiase_blur_opacity;float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\nglFragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in ivec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\n#ifdef ELEVATED_ROADS\nin float a_circle_z_offset;\n#endif\nout vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*v
9iew_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1.0,-1.0),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1.0,-1.0),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1.0,1.0),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1.0,1.0),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() {\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 pos2=vec2(a_pos);vec2 extrude=vec2(mod(pos2,2.0)*2.0-1.0);vec2 circle_center=floor(pos2*0.5);float height=circle_elevation(circle_center);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nsurface_vectors=globe_mercator_surface_vectors(vec3(a_pos_normal_3)/16384.0,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*height;vec3 globe_pos=vec3(a_pos_3)+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*height;vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);world_center=vec4(circle_center,height,1);\n#endif\n#ifdef ELEVATED_ROADS\nworld_center.z+=a_circle_z_offset+ELEVATION_BIAS;\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}'),clippingMask:rd("void main() {glFragColor=vec4(1.0);}","in ivec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:rd('#include "_prelude_fog.fragment.glsl"\nuniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);glFragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
9\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in ivec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(vec2(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(vec2(a_pos)*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=vec3(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=vec3(a_pos_3)+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),heatmapTexture:rd("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));glFragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in ivec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=vec2(a_pos)*0.5+0.5;}"),collisionBox:rd("in float v_placed;in float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",'#include "_prelude_terrain.vertex.glsl"\nin ivec4 a_pos;in ivec2 a_anchor_pos;in ivec2 a_extrude;in uvec2 a_placed;in vec2 a_shift;in vec2 a_elevation_from_sea;in float a_size_scale;in vec2 a_padding;in float a_auto_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform float u_zoom_transition;\n#endif\nout float v_placed;out float v_notUsed;void main() {vec2 anchor_pos=vec2(a_anchor_pos);float feature_elevation=a_elevation_from_sea.x+a_auto_z_offset;float terrain_elevation=(a_elevation_from_sea.y==1.0 ? 0.0 : elevation(anchor_pos));vec3 proj_pos=vec3(a_pos)+elevationVector(anchor_pos)*(feature_elevation+terrain_elevation);\n#ifdef PROJECTION_GLOBE_VIEW\n#ifndef PROJECTED_POS_ON_VIEWPORT\nvec3 globe_pos=proj_pos;vec3 mercator_pos=mercator_tile_position(u_inv_rot_matrix,anchor_pos,u_tile_id,u_merc_center);proj_pos=mix_globe_mercator(globe_pos,mercator_pos,u_zoom_transition);\n#endif\n#endif\nvec4 projectedPoint=u_matrix*vec4(proj_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+=(vec2(a_extrude)*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=float(a_placed.x);v_notUsed=float(a_placed.y);}'),collisionCircle:rd("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);glFragColor=color*alpha*opacity_t;}","in vec2 a_pos_2f;in float a_radius;in ivec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;int vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2)),mix(-1.0,1.0,float(vertexIdx >=1 && vertexIdx <=2)));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=float(a_flags.x);gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:rd("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",'#include "_prelude_terrain.vertex.glsl"\nin ivec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;\n#endif\nout vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {vec2 pos=vec2(a_pos);float h=elevation(pos);v_uv=pos/8192.0;
9\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(vec3(a_pos_3)+elevationVector(pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(pos*u_overlay_scale,h,1);\n#endif\n}'),fill:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nuniform float u_emissive_strength;uniform lowp float u_opacity_multiplier;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(opacity*u_opacity_multiplier);\n#ifdef INDICATOR_CUTOUT\nif (v_z_offset >=0.0) {out_color=applyCutout(out_color,v_z_offset);}\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x);\n#endif\nglFragColor=out_color;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin ivec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;uniform lowp float u_opacity_multiplier;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=z_offset;\n#endif\n}'),fillOutline:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nin highp vec2 v_pos;uniform float u_emissive_strength;uniform lowp float u_opacity_multiplier;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\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;vec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x);\n#endif\nglFragColor=out_color*(alpha*opacity*u_opacity_multiplier);\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
9\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin ivec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nuniform mat4 u_matrix;uniform vec2 u_world;uniform lowp float u_opacity_multiplier;out highp vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef FLIP_Y\nv_pos=(vec2(gl_Position.x,-gl_Position.y)/gl_Position.w+1.0)/2.0*u_world;\n#else\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n}'),fillOutlinePattern:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nuniform float u_emissive_strength;uniform lowp float u_opacity_multiplier;\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nin highp vec2 v_pos;in highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_PATTERN_TRANSITION\nvec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\nvec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity*u_opacity_multiplier);\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
9\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_world;uniform lowp float u_opacity_multiplier;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in ivec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;out highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);vec2 pos=vec2(a_pos);gl_Position=mix(u_matrix*vec4(pos,z_offset,1),AWAY,hidden);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);\n#ifdef FLIP_Y\nv_pos_world=(vec2(gl_Position.x,-gl_Position.y)/gl_Position.w+1.0)/2.0*u_world;\n#else\nv_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(pos,z_offset);vec3 shd_pos1=vec3(pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),fillPattern:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nin highp vec2 v_pos;uniform float u_emissive_strength;uniform lowp float u_opacity_multiplier;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_PATTERN_TRANSITION\nvec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\nvec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(opacity*u_opacity_multiplier);\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
9\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform lowp float u_opacity_multiplier;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in ivec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump uvec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);vec2 pos=vec2(a_pos);gl_Position=mix(u_matrix*vec4(pos,z_offset,1),AWAY,hidden);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(pos,z_offset);vec3 shd_pos1=vec3(pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),lineBlendComposite:rd("uniform highp sampler2D u_image;uniform float u_opacity;uniform int u_blend_mode;uniform highp float u_max_density;in vec2 v_pos;\n#define ADDITIVE 1\nvoid main() {vec4 color=texture(u_image,v_pos);if (u_blend_mode==ADDITIVE) {if (color.a <=0.0) {discard;}highp float density=color.a;vec3 avgColor=color.rgb/max(density,0.001);highp float n=density/max(u_max_density,0.001);highp float t=sqrt(n/(n+1.0));glFragColor=vec4(avgColor*t,t);} else {vec3 multiplyFactor=color.rgb*u_opacity+(1.0-u_opacity);glFragColor=vec4(multiplyFactor,1.0);}\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in ivec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=vec2(a_pos)*0.5+0.5;}"),lineBlendReduce:rd("uniform highp sampler2D u_image;uniform vec2 u_texel_size;uniform bool u_first_pass;in vec2 v_pos;void main() {vec2 o=u_texel_size*0.5;vec4 s0=texture(u_image,v_pos+vec2(-o.x,-o.y));vec4 s1=texture(u_image,v_pos+vec2( o.x,-o.y));vec4 s2=texture(u_image,v_pos+vec2(-o.x, o.y));vec4 s3=texture(u_image,v_pos+vec2( o.x, o.y));float r0; float g0;float r1; float g1;float r2; float g2;float r3; float g3;if (u_first_pass) {float a0=s0.a;float a1=s1.a;float a2=s2.a;float a3=s3.a;r0=a0; g0=a0 > 0.0 ? 1.0 : 0.0;r1=a1; g1=a1 > 0.0 ? 1.0 : 0.0;r2=a2; g2=a2 > 0.0 ? 1.0 : 0.0;r3=a3; g3=a3 > 0.0 ? 1.0 : 0.0;} else {r0=s0.r; g0=s0.g;r1=s1.r; g1=s1.g;r2=s2.r; g2=s2.g;r3=s3.r; g3=s3.g;}glFragColor=vec4((r0+r1+r2+r3)*0.25,(g0+g1+g2+g3)*0.25,0.0,0.0);}","in ivec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=vec2(a_pos)*0.5+0.5;}"),fillExtrusion:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec4 v_color;in vec4 v_flat;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\nuniform lowp float u_opacity;\n#ifdef RENDER_FRONT_CUTOFF\nin float v_front_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\nin vec4 v_ground_roof;\n#endif\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec2 v_ao;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nin vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nin highp vec3 v_normal;\n#endif\nuniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor;\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nin float v_flood_radiu
9s;in float v_has_floodlight;\n#endif\nin float v_height;\n#pragma mapbox: define highp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp float emissive_strength\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nvec3 normal=normalize(v_normal);\n#endif\nfloat z;vec4 color=v_color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);\n#ifdef LIGHTING_3D_MODE\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#else\ncolor=mix(v_color,v_roof_color,z);\n#endif\n#endif\nfloat h=max(0.0,v_height);float ao_shade=1.0;\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave);\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\ncolor.rgb*=mix(ao_shade,1.0,v_has_floodlight);\n#else\ncolor.rgb*=ao_shade;\n#endif\n#else\ncolor.rgb*=ao_shade;\n#endif\n#endif\n#ifdef LIGHTING_3D_MODE\nfloat flood_radiance=0.0;\n#ifdef FLOOD_LIGHT\nflood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef FLOOD_LIGHT\nfloat ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance);\n#else\nfloat shadowed_lighting_factor;\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\ncolor.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);\n#endif\n#else\ncolor.rgb=apply_lighting(color.rgb,normal);\n#ifdef FLOOD_LIGHT\ncolor.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance);\n#endif\n#endif\ncolor.rgb=mix(color.rgb,v_flat.rgb,emissive_strength);color*=u_opacity;\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h));\n#endif\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\n{float ditherOpacity=cutoutGroundRoofOpacity(v_ground_roof);if (ditherOpacity < 1.0) {int index=(int(gl_FragCoord.x) % 4)*4+(int(gl_FragCoord.y) % 4);if (ditherOpacity < DITHER_THRESHOLDS[index]) {discard;}}}\n#else\ncolor=applyCutout(color,h);\n#endif\n#endif\n#ifdef RENDER_FRONT_CUTOFF\nif (v_front_cutoff_opacity < 1.0) {int index=(int(gl_FragCoord.x) % 4)*4+(int(gl_FragCoord.y) % 4);if (v_front_cutoff_opacity < DITHER_THRESHOLDS[index]) {discard;}}\n#endif\n#ifdef FEATURE_CUTOUT\ncolor=apply_feature_cutout(color,gl_FragCoord,get_cutout_factors(gl_FragCoord).x);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;uniform float u_width_scale;in ivec4 a_pos_normal_ed;\n#if defined(HAS_CENTROID) || defined(TERRAIN)\nin uvec2 a_centroid_pos;\n#endif\n#ifdef RENDER_WALL_MODE\nin ivec4 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;in ivec4 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\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nuniform highp float u_vertical_scale;\n#ifdef RENDER_FRONT_CUTOFF\nuniform vec3 u_front_cutoff_params;out float v_front_cutoff_opacity;\n#endif\nout vec4 v_color;out vec4 v_flat;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nout vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nout highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec2 v_ao;\n#endif\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nout float v_flood_radiu
9s;out float v_has_floodlight;\n#endif\nout float v_height;\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\nout vec4 v_ground_roof;\n#endif\n#endif\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define highp float flood_light_wall_radius\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp float emissive_strength\nvoid main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize highp float flood_light_wall_radius\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp float emissive_strength\nbase*=u_vertical_scale;height*=u_vertical_scale;vec4 top_up_ny_start=vec4(a_pos_normal_ed & 1);vec4 pos_nx=vec4(a_pos_normal_ed >> 1);float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny_start.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny_start.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nv_normal=normal;\n#endif\nbase=max(0.0,base);float attr_height=height;height=max(0.0,top_up_ny_start.y==0.0 && top_up_ny_start.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny_start.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=vec2(a_centroid_pos);\n#endif\nfloat ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);bool is_elevation_encoded=centroid_pos.y==0.0 || (centroid_pos.y > 0.0 && (int(centroid_pos.y) & 7)==7);c_ele=is_flat_height || is_flat_base ? (is_elevation_encoded ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;\n#else\nh=t > 0.0 ? height : base;\n#endif\npos=vec3(pos_nx.xy,h);\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(vec3(a_pos_normal_3)/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=vec3(a_pos_3)+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat cutoff=1.0;vec3 scaled_pos=pos;\n#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF)\nvec2 centroid_decoded=pos.xy;bool isBorderCentroid=false;if (centroid_pos.x > 0.0 && centroid_pos.y > 0.0) {int iy=int(centroid_pos.y);int spanYbits=iy & 7;if (spanYbits==7) {isBorderCentroid=true;int borderID=(iy >> 3) & 3;float coordAlongBorder=float(iy >> 5)*4.0;if (borderID==0) centroid_decoded=vec2(0.0,coordAlongBorder);else if (borderID==1) centroid_decoded=vec2(EXTENT,coordAlongBorder);else if (borderID==2) centroid_decoded=vec2(coordAlongBorder,0.0);else centroid_decoded=vec2(coordAlongBorder,EXTENT);} else {centroid_decoded=floor(centroid_pos/8.0);}}\n#endif\n#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF)\nvec4 ground=u_matrix*vec4(centroid_decoded,ele,1.0);\n#endif\n#ifdef RENDER_CUTOFF\n#ifdef CLIP_ZERO_TO_ONE\ncutoff=cutoff_opacity(u_cutoff_params,ground.z*2.0-ground.w);\n#else\ncutoff=cutoff_opacity(u_cutoff_params,ground.z);\n#endif\nif (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_random/8.0;vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;v_cutoff_opacity=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale);\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0) || (color.a==0.0));\n#ifdef RENDER_FRONT_CUTOFF\nv_front_cutoff_opacity=1.0;if (centroid_pos.x > 0.0 && centroid_pos.y > 0.0) {hidden=max(hidden,float(ground.w <=0.0));
9float ndc_y=ground.y/max(ground.w,0.001);float threshold=u_front_cutoff_params.x*2.0-1.0;float range_ndc=u_front_cutoff_params.y*2.0;if (!isBorderCentroid) {hidden=max(hidden,float(ndc_y < threshold-range_ndc));}float t=clamp((ndc_y-(threshold-range_ndc))/max(range_ndc,0.001),0.0,1.0);v_front_cutoff_opacity=mix(u_front_cutoff_params.z,1.0,t);}\n#endif\n#ifdef RENDER_WALL_MODE\nvec3 join_normal_inside=vec3(a_join_normal_inside);vec2 wall_offset=u_width_scale*line_width*(join_normal_inside.xy/EXTENT);scaled_pos.xy+=(1.0-join_normal_inside.z)*wall_offset*0.5;scaled_pos.xy-=join_normal_inside.z*wall_offset*0.5;\n#endif\ngl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifndef LIGHTING_3D_MODE\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#endif\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(ce
9ntroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny_start.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\nfloat is_wall=1.0-float(t > 0.0 && top_up_ny_start.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale;\n#endif\nv_color=vec4(color.rgb,1.0);float ndotl=calculate_NdotL(normal);v_flat.rgb=sRGBToLinear(color.rgb);v_flat.rgb=v_flat.rgb*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);v_flat=vec4(linearTosRGB(v_flat.rgb),1.0);\n#else\nv_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\nvec4 pos_ground=u_matrix*vec4(pos.xy,ele,1.0);vec4 pos_roof=u_matrix*vec4(pos.xy,ele+height,1.0);v_ground_roof=vec4(pos_ground.xy/pos_ground.w,pos_roof.xy/pos_roof.w);\n#endif\n#endif\n}'),fillExtrusionDepth:rd("void main() {}",'#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_width_scale;uniform float u_vertical_scale;\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nin ivec4 a_pos_normal_ed;\n#if defined(HAS_CENTROID) || defined(TERRAIN)\nin uvec2 a_centroid_pos;\n#endif\n#ifdef RENDER_WALL_MODE\nin ivec4 a_join_normal_inside;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp vec4 color\nvoid main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp vec4 color\nbase*=u_vertical_scale;height*=u_vertical_scale;vec3 top_up_ny=vec3(a_pos_normal_ed.xyz & 1);vec3 pos_nx=vec3(a_pos_normal_ed.xyz >> 1);base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=vec2(a_centroid_pos);\n#endif\nvec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;float ele=elevation(pos_nx.xy);bool is_elevation_encoded=centroid_pos.y==0.0 || (centroid_pos.y > 0.0 && int(centroid_pos.y)-(int(centroid_pos.y)/8)*8==7);float c_ele=is_flat_height || is_flat_base ? (is_elevation_encoded ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);float h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h);\n#else\npos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\n#ifdef RENDER_WALL_MODE\nvec3 join_normal_inside=vec3(a_join_normal_inside);vec2 wall_offset=u_width_scale*line_width*(join_normal_inside.xy/EXTENT);pos.xy+=(1.0-join_normal_inside.z)*wall_offset*0.5;pos.xy-=join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);}'),fillExtrusionPattern:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nin vec3 v_normal;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\nin highp vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump uvec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\nvec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,normalize(v_normal))*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0
9),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,height);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_width_scale;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in ivec4 a_pos_normal_ed;\n#if defined(HAS_CENTROID) || defined(TERRAIN)\nin uvec2 a_centroid_pos;\n#endif\n#ifdef RENDER_WALL_MODE\nin ivec4 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;in ivec4 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\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nout highp vec2 v_pos;out vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nout vec3 v_normal;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump uvec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define highp float pixel_ratio\n#pragma mapbox: define highp float line_width\nvoid main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize highp float pixel_ratio\n#pragma mapbox: initialize highp float line_width\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);vec4 top_up_ny_start=vec4(a_pos_normal_ed & 1);vec4 pos_nx=vec4(a_pos_normal_ed >> 1);float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny_start.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny_start.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=float(a_pos_normal_ed.w);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny_start.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=vec2(a_centroid_pos);\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);bool is_elevation_encoded=centroid_pos.y==0.0 || (centroid_pos.y > 0.0 && int(centroid_pos.y)-(int(centroid_pos.y)/8)*8==7);c_ele=is_flat_height || is_flat_base ? (is_elevation_encoded ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(vec3(a_pos_normal_3)/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=vec3(a_pos_3)+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\n#ifdef RENDER_WALL_MODE\nvec3 join_normal_inside=vec3(a_join_normal_inside);vec2 wall_offset=u_width_scale*line_width*(join_normal_inside.xy/EXTENT);p.xy+=(1.0-join_normal_inside.z)*wall_offset*0.5;p.xy-=join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);
9\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny_start.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_normal=normal;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}'),groundShadow:rd('#include "_prelude_shadow.fragment.glsl"\nprecision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\nvoid main() {float light=shadowed_light_factor_plane_bias(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light);\n#ifdef RENDER_CUTOFF\nshadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w));\n#endif\n#ifdef FOG\nshadow=mix(shadow,vec3(1.0),v_fog_opacity);\n#endif\n#ifdef INDICATOR_CUTOUT\nshadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0),0.0).r);\n#endif\n#ifdef FEATURE_CUTOUT\nshadow=mix(shadow,vec3(1.0),get_cutout_factors(gl_FragCoord).y);\n#endif\nglFragColor=vec4(shadow,1.0);}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in ivec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0);\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));v_fog_opacity=fog(v_fog_pos);\n#endif\n}'),fillExtrusionGroundEffect:rd("uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size;\n#ifdef SDF_SUBPASS\nin highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);}\n#ifdef FOG\nin highp float v_fog;\n#endif\n#endif\nvoid main() {\n#ifdef CLEAR_SUBPASS\nvec4 color=vec4(1.0);\n#ifdef CLEAR_FROM_TEXTURE\ncolor=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size));\n#endif\nglFragColor=color;\n#else\n#ifdef SDF_SUBPASS\nhighp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0;\n#ifdef FOG\nfog=v_fog;\n#endif\n#ifdef RENDER_CUTOFF\nfog*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog));\n#else\n#ifdef USE_MRT1\nout_Target1=vec4(1.0-texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size)).a,0.0,0.0,0.0);\n#else\nvec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass);\n#ifdef OVERDRAW_INSPECTOR\ncolor=vec4(1.0);\n#endif\nglFragColor=color;\n#endif\n#endif\nHANDLE_WIREFRAME_DEBUG;\n#endif\n}",'#include "_prelude_fog.vertex.glsl"\nin highp ivec4 a_pos_end;in highp int a_angular_offset_factor;in highp uint a_hidden_by_landmark;\n#ifdef SDF_SUBPASS\nout highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao;\n#ifdef FOG\nout highp float v_fog;\n#endif\n#endif\nuniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp float u_dynamic_offset;uniform highp vec2 u_ao;
9\n#pragma mapbox: define highp float flood_light_ground_radius\nconst float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {\n#pragma mapbox: initialize highp float flood_light_ground_radius\nvec4 pos_end=vec4(a_pos_end);vec2 p=pos_end.xy;vec2 q=floor(pos_end.zw*0.5);vec2 start_bottom=pos_end.zw-q*2.0;float fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=float(a_angular_offset_factor)/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(u_dynamic_offset,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp;\n#ifdef SDF_SUBPASS\nv_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius);\n#ifdef FOG\nv_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos);\n#endif\n#endif\nfloat hidden_by_landmark=0.0;\n#ifdef HAS_CENTROID\nhidden_by_landmark=float(a_hidden_by_landmark);\n#endif\nfloat isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0));\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}'),hillshadePrepare:rd("precision highp float;uniform highp sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}","uniform mat4 u_matrix;uniform vec2 u_dimension;in ivec2 a_pos;in uvec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(vec2(a_texture_pos)/8192.0)*scale+epsilon;}"),hillshade:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);glFragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\nglFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength);\n#endif\n#ifdef FOG\nglFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos));\n#endif\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
9\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;in ivec2 a_pos;in uvec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=vec2(a_texture_pos)/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n}'),line:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform lowp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_floor_width_scale;uniform float u_alpha_discard_threshold;uniform lowp float u_opacity_multiplier;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform highp vec2 u_trim_gradient_mix_range;uniform lowp vec4 u_trim_color;uniform bool u_emissive_in_shadows;uniform bool u_clip_to_tile_borders;in vec4 v_width2_dilute;in vec2 v_normal;in float v_gamma_scale;in highp vec3 v_uv;in vec2 v_tile_pos;\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef VARIABLE_LINE_WIDTH\nin float stub_side;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;in vec2 v_tex;\n#endif\n#ifdef DEBUG_ELEVATION_ID\nin vec3 v_elevation_id_col;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nfloat luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump uvec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float side_z_offset\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\n#pragma mapbox: define lowp float emissive_strength\nfloat linearstep(float edge0,float edge1,float x) {return  clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump uvec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float side_z_offset\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\n#pragma mapbox: initialize lowp float emissive_strength\nfloat dist=length(v_normal)*v_width2_dilute.x;float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\n#ifdef RENDER_LINE_BORDER\n#ifndef VARIABLE_LINE_WIDTH\nANTIALIASING*=8.0;\n#endif\n#endif\n#ifdef VARIABLE_LINE_WIDTH\nblur=mix(blur,0.0,stub_side);\n#endif\nfloat diluted_opacity=opacity*v_width2_dilute.z;float blur2=(u_width_scale*blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2_dilute.y-blur2),v_width2_dilute.x-dist)/blur2,0.0,1.0);float pxStep;float delta;\n#ifdef RENDER_LINE_BORDER\n#ifndef VARIABLE_LINE_WIDTH\npxStep=fwidth(dist);float out_edge=v_width2_dilute.x-dist;float in_edge=dist-(v_width2_dilute.y-2.0*ANTIALIASING);delta=v_width2_dilute.y > 0.0 ? min(in_edge,out_edge) : out_edge;float edge=ANTIALIASING;alpha=delta > 0.0 ? smoothstep(edge-pxStep,u_width_scale*blur+edge+pxStep,delta) : 0.0;\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture(u_dash_image,v_tex).r;float sdfgamma=ANTIALIASING/(float(dash.z)+float(dash.w)/65535.0);float scaled_floorwidth=(floorwidth*u_floor_width_scale);alpha*=linearstep(0.5-sdfgamma/scaled_floorwidth,0.5+sdfgamma/scaled_floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trim_alpha=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);highp float gradient_trim_color_mix_factor=0.0;\n#ifdef RENDER_LINE_GRADIENT\ngradient_trim_color_mix_factor=smoothstep(u_trim_gradient_mix_range.x,u_trim_gradient_mix_range.y,line_progress);\n#endif\nhighp vec4 trim_color=mix(u_trim_color,out_color,gradient_trim_color_mix_factor);out_color=mix(u_trim_gradient_mix_range.x < 1.0 ? color : out_color,trim_color,transition_factor);trim_alpha=1.0-transition_factor;}\n#endif\nif (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}}\n#ifdef RENDER_LINE_BORDER\n#ifndef VARIABLE_LINE_WIDTH\nfloat edge2=border_width*u_width_scale+ANTIALIASING;float alpha2=smoothstep(edge2-pxStep,edge2+pxStep,delta);if (alpha2 < 1.) {if (border_color.a==0.0) {\n#ifndef RENDER_LINE_GRADIENT\nfloat Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;
9float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-alpha2));} else {out_color.rgb*=(0.6+0.4*alpha2);}\n#else\nout_color.rgb*=(0.6+0.4*alpha2);\n#endif\n} else {out_color=mix(border_color*trim_alpha,out_color,alpha2);}out_color*=v_width2_dilute.w;}\n#endif\n#endif\nvec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);light=u_emissive_in_shadows ? mix(light,1.0,emissive_strength) : light;\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(alpha*diluted_opacity*u_opacity_multiplier);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x);\n#endif\n#ifdef LINE_BLEND_ADDITIVE\n{float cov=alpha*diluted_opacity;glFragColor=vec4(cov > 0.0 ? out_color.rgb/cov : vec3(0.0),cov);}\n#else\n#ifdef LINE_BLEND_MULTIPLY\nglFragColor=vec4(out_color.rgb+(1.0-out_color.a),1.0);\n#else\nglFragColor=out_color;\n#endif\n#endif\n#ifdef DUAL_SOURCE_BLENDING\nglFragColorSrc1=vec4(vec3(0.0),emissive_strength);\n#else\n#ifdef USE_MRT1\nout_Target1=vec4(emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n#ifdef DEBUG_ELEVATION_ID\nglFragColor=vec4(v_elevation_id_col,1.0);\n#endif\nif (u_clip_to_tile_borders) {if (v_tile_pos.x > 1.0 || v_tile_pos.y > 1.0 || v_tile_pos.x < 0.0 || v_tile_pos.y < 0.0) {discard;}}HANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define EXTRUDE_SCALE 0.015873016\nin ivec2 a_pos_normal;in uvec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS) || defined(VARIABLE_LINE_WIDTH) || defined(VARIABLE_LINE_EMISSIVE_STRENGTH)\nin vec4 a_z_offset_width;\n#endif\n#ifdef DEBUG_ELEVATION_ID\nin vec3 a_elevation_id_col;\n#endif\n#ifdef DEBUG_ELEVATION_ID\nout vec3 v_elevation_id_col;\n#endif\n#ifdef ELEVATION_GROUND_SCALE\nin float a_elevation_ground_scale;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) || defined(RENDER_LINE_CURVE)\nin highp vec3 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nin float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_z_offset;uniform highp float u_floor_width_scale;\n#ifdef RENDER_LINE_CURVE\nuniform mat3 u_curve_points_x;uniform mat3 u_curve_points_y;uniform mat3 u_curve_points_z;uniform float u_curve_point_count;\n#endif\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec4 v_width2_dilute;out float v_gamma_scale;out highp vec3 v_uv;out vec2 v_tile_pos;\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef VARIABLE_LINE_WIDTH\nout float stub_side;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump uvec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float side_z_offset\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\n#pragma mapbox: define lowp float emissive_strength\n#ifdef RENDER_LINE_CURVE\nvec3 getCurvePoint(int index) {int row=index/3;int col=index-row*3;float x=u_curve_points_x[row][col];float y=u_curve_points_y[row][col];float z=u_curve_points_z[row][col];return vec3(x,y,z);}vec3 catmullRom(vec3 p0,vec3 p1,vec3 p2,vec3 p3,float t) {float t2
9=t*t;float t3=t2*t;return 0.5*(\n2.0*p1+(-p0+p2)*t+(2.0*p0-5.0*p1+4.0*p2-p3)*t2+(-p0+3.0*p1-3.0*p2+p3)*t3\n);}vec2 catmullRomTangent(vec2 p0,vec2 p1,vec2 p2,vec2 p3,float t) {float t2=t*t;return 0.5*(\n(-p0+p2)+(2.0*p0-5.0*p1+4.0*p2-p3)*2.0*t+(-p0+3.0*p1-3.0*p2+p3)*3.0*t2\n);}struct CurveResult {vec3 point;vec2 tangent;};CurveResult calculateCurve(float line_progress) {float curve_progress=line_progress*(u_curve_point_count-1.0);float curve_progress_local=fract(curve_progress);float curve_segment=floor(curve_progress);int seg=int(curve_segment);vec3 p1=getCurvePoint(seg);vec3 p2=getCurvePoint(seg+1);float is_first_seg=step(curve_segment,0.5);vec3 p0_extrapolated=p1-(p2-p1);vec3 p0_fetched=getCurvePoint(max(seg-1,0));vec3 p0=mix(p0_fetched,p0_extrapolated,is_first_seg);int last_seg=int(u_curve_point_count)-2;float is_last_seg=step(float(last_seg)-0.5,curve_segment);vec3 p3_extrapolated=p2+(p2-p1);vec3 p3_fetched=getCurvePoint(min(seg+2,int(u_curve_point_count)-1));vec3 p3=mix(p3_fetched,p3_extrapolated,is_last_seg);vec3 point=catmullRom(p0,p1,p2,p3,curve_progress_local);vec2 tangent=catmullRomTangent(p0.xy,p1.xy,p2.xy,p3.xy,curve_progress_local)*(u_curve_point_count-1.0);CurveResult result;result.point=point;result.tangent=tangent;return result;}\n#endif\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump uvec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float side_z_offset\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\n#pragma mapbox: initialize lowp float emissive_strength\n#ifdef VARIABLE_LINE_EMISSIVE_STRENGTH\nemissive_strength=a_z_offset_width.w;\n#endif\nfloat a_z_offset=u_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset+=a_z_offset_width.x;\n#endif\n#ifdef DEBUG_ELEVATION_ID\nv_elevation_id_col=a_elevation_id_col;\n#endif\nhighp float line_progress=0.0;\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) || defined(RENDER_LINE_CURVE)\nline_progress=a_packed[2];\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\n#ifdef RENDER_LINE_BORDER\n#ifndef VARIABLE_LINE_WIDTH\nANTIALIASING*=8.0;\n#endif\n#endif\nvec2 a_extrude=vec2(a_data.xy)-128.0;float a_direction=float(a_data.z & 3u)-1.0;vec2 pos_normal=vec2(a_pos_normal);vec2 pos=floor(pos_normal*0.5);mediump vec2 normal=pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;offset=-1.0*offset*u_width_scale;bool left=normal.y==1.0;\n#ifdef RENDER_LINE_CURVE\nCurveResult curve=calculateCurve(line_progress);pos=curve.point.xy*8192.0;a_extrude=length(a_extrude)*normalize(curve.tangent);a_extrude=left ? vec2(-a_extrude.y,a_extrude.x) : vec2(a_extrude.y,-a_extrude.x);a_z_offset+=curve.point.z;\n#endif\ngapwidth=gapwidth/2.0;float halfwidth;float dilute_scale=1.0;float dilute_border_scale=1.0;float symmetric_outset=0.0;\n#ifdef VARIABLE_LINE_WIDTH\nfloat left_width=a_z_offset_width.y;float right_width=a_z_offset_width.z;halfwidth=u_width_scale*(left ? left_width : right_width);if (side_z_offset !=0.0) {float left_f=step(1.0,normal.y);float is_negative=step(side_z_offset,0.0);float apply=mix(1.0-left_f,left_f,is_negative);a_extrude*=apply;a_z_offset+=abs(side_z_offset)*apply;v_normal*=apply;}offset=border_width > 0.0 ? (left_width+right_width)*u_width_scale : offset;halfwidth=border_width > 0.0 ? border_width*u_width_scale*0.5 : halfwidth;bool zero_right_width=border_width==0.0 && right_width==0.0;symmetric_outset=zero_right_width ? u_width_scale*left_width : halfwidth;stub_side=zero_right_width ?-normal.y : 0.0;v_normal=!left && zero_right_width ? vec2(0.0) : v_normal;ANTIALIASING=!left && zero_right_width ? 0.0 : ANTIALIASING;\n#else\nhalfwidth=(u_width_scale*width)/2.0;\n#endif\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth > 0.0 ? ANTIALIASING : 0.0);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);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;
9vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;v_tile_pos=pos+offset2*u_pixels_to_tile_units;gl_Position=u_matrix*vec4(v_tile_pos,a_z_offset,1.0);\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;float scaled_z_offset=a_z_offset;\n#ifdef ELEVATION_GROUND_SCALE\nscaled_z_offset=a_z_offset*mix(1.0,u_exaggeration,a_elevation_ground_scale);\n#endif\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=pos_normal.y-2.0*floor(pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+scaled_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+scaled_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+scaled_z_offset;\n#endif\n#endif\nv_tile_pos=offset_pos;gl_Position=u_matrix*vec4(v_tile_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\nv_tile_pos=pos+offset2*u_pixels_to_tile_units;gl_Position=u_matrix*vec4(v_tile_pos,0.0,1.0);\n#endif\n#endif\n#ifndef ELEVATED\n#ifndef VARIABLE_LINE_WIDTH\n#ifndef RENDER_TO_TEXTURE\nfloat base_w=gl_Position.w;vec2 screen_width=abs(projected_extrude.xy/base_w*u_units_to_pixels);float max_extrude_component=max(screen_width.x,screen_width.y);if (width >=1.0 && base_w > 0.0 && max_extrude_component > 0.0001) {float min_pixel=1.05;if (max_extrude_component < min_pixel) {vec2 abs_pos=abs(gl_Position.xy);float is_out=max(abs_pos.x,abs_pos.y)/base_w;dilute_scale=mix(max_extrude_component/min_pixel,1.0,smoothstep(2.5,4.5,is_out));projected_extrude/=dilute_scale;}else if (gapwidth > 0.0) {float visible_ratio=(halfwidth+ANTIALIASING)/outset;vec2 visible_screen_width=screen_width*visible_ratio;float max_visible_component=max(visible_screen_width.x,visible_screen_width.y);dilute_scale=min(1.0,max_visible_component/min_pixel);}else\n{\n#ifdef RENDER_LINE_BORDER\nfloat border_ratio=(border_width*u_width_scale+ANTIALIASING)/outset;screen_width*=border_ratio;float max_border_component=max(screen_width.x,screen_width.y);dilute_border_scale=min(1.0,max_border_component/min_pixel);\n#endif\n}}\n#endif\n#endif\nv_tile_pos=(v_tile_pos+extrude)/EXTENT;\n#ifdef ELEVATED_ROADS\ngl_Position=gl_Position+projected_extrude;\n#else\ngl_Position=mix(gl_Position+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat epsilon=0.0001;float extrude_length_without_perspective=max(length(dist),epsilon);float extrude_length_with_perspective=max(length(projected_extrude_xy/gl_Position.w*u_units_to_pixels),epsilon);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nhighp float a_uv_x=a_packed[0];float a_split_index=a_packed[1];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec3(a_uv_x,a_split_index*texel_height-half_texel_height,line_progress);\n#else\nv_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nvec4 dashf=vec4(dash);float totalLength=dashf.z+dashf.w/65535.0;float scale=totalLength==0.0 ? 0.0 : u_tile_units_to_pixels/totalLength;v_tex=vec2(a_linesofar*scale/(floorwidth*u_floor_width_scale),(-normal.y*dashf.y+dashf.x+0.5)/u_texsize.y);\n#endif\nv_width2_dilute=vec4(outset,inset,dilute_scale,dilute_border_scale);\n#ifdef VARIABLE_LINE_WIDTH\nv_width2_dilute.x=symmetric_outset;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),linePattern:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform highp float u_device_pixel_ratio;uniform highp float u_width_scale;
9uniform highp float u_alpha_discard_threshold;uniform lowp float u_opacity_multiplier;uniform highp vec2 u_texsize;uniform highp float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;uniform sampler2D u_image;\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef LINE_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nin vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef LINE_JOIN_NONE\nin vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#pragma mapbox: define mediump uvec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize lowp float emissive_strength\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;highp float pattern_size=display_size.x/u_tile_units_to_pixels;float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);highp float pattern_x=v_linesofar/pattern_size*aspect;highp float x=mod(pattern_x,1.0);highp float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;highp vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));highp vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\n#ifdef LINE_PATTERN_TRANSITION\nvec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl*texel_size-texel_size,pattern_b_br*texel_size+texel_size,vec2(x,y));vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);color=color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);color=mix(color,color.a*u_trim_color,transition_factor);}\n#endif\n#ifdef LINE_JOIN_NONE\nhighp float pattern_len=pattern_size/aspect;highp float segment_phase=pattern_len-mod(v_linesofar-v_pattern_data.x+pattern_len,pattern_len);highp float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;highp float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);}\n#endif\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting_with_emission_ground(color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\ncolor.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\ncolor.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=(alpha*opacity*u_opacity_multiplier);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}}\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,v_z_offset);\n#endif\nglFragColor=color;\n#ifdef DUAL_SOURCE_BLENDING\nglFragColorSrc1=vec4(vec3(0.0),emissive_strength);\n#else\n#ifdef USE_MRT1\nout_Target1=vec4(emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
9\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define scale 0.015873016\nin ivec2 a_pos_normal;in uvec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\nin vec4 a_z_offset_width;\n#endif\n#ifdef ELEVATION_GROUND_SCALE\nin float a_elevation_ground_scale;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 a_packed;\n#endif\nin highp float a_linesofar;\n#ifdef LINE_JOIN_NONE\nin highp vec3 a_pattern_data;out vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;uniform float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_floor_width_scale;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nout highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define mediump float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float floorwidth\n#pragma mapbox: define mediump uvec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize mediump float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float floorwidth\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize lowp float emissive_strength\nfloat a_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset=a_z_offset_width.x;\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(a_data.xy)-128.0;float a_direction=float(a_data.z & 3u)-1.0;vec2 pos_normal=vec2(a_pos_normal);vec2 pos=floor(pos_normal*0.5);vec2 normal=pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=(u_width_scale*width)/2.0;offset=-1.0*offset*u_width_scale;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);vec2 dist=outset*a_extrude*scale;float u=0.5*a_direction;float t=1.0-abs(u);vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;float scaled_z_offset=a_z_offset;\n#ifdef ELEVATION_GROUND_SCALE\nscaled_z_offset=a_z_offset*mix(1.0,u_exaggeration,a_elevation_ground_scale);\n#endif\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=pos_normal.y-2.0*floor(pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+scaled_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+scaled_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+scaled_z_offset;\n#endif\n#endif\ngl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude_xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float a_uv_x=a_packed[0];highp float line_progress=a_packed[2];v_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=(floorwidth*u_floor_width_scale);\n#ifdef LINE_JOIN_NONE\nv_width=(floorwidth*u_floor_width_scale)+ANTIALIASING;mediump float pixels_to_tile_units=1.0/u_tile_units_to_pixels;mediump float pixel_ratio_inverse=1.0/pixel_ratio;mediump float aspect=v_width/(float(pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=float(pattern.z-pattern.x)*pixel_ratio_inverse*pixels_to_tile_units*aspect*32.0;highp float subt=floor(a_pattern_data.z/subt_multiple)*subt_multiple;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5*pixels_to_tile_units;v_linesofar=(a_pattern_data.z-subt)+a_linesofar+line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),raster:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_raster_array.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nin float v_split_fade;\n#endif\nuniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength;\n#ifndef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;\n#endif\n#ifdef RASTER_COLOR\nuniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res;\n#endif\nvoid main() {vec4 color0,color1,color;vec2 value;\n#ifdef RASTER_COLOR\n#ifdef RASTER_ARRAY\n#ifdef RASTER_ARRAY_LINEAR\nvalue=mix(\nraTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#else\nvalue=mix(\nraTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#endif\nif (value.y > 0.0) value.x/=value.y;\n#else\ncolor=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a);\n#endif\ncolor=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y;\n#else\ncolor0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);\n#endif\ncolor.a*=u_opacity;\n#ifdef GLOBE_POLES\ncolor.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition);\n#endif\nvec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef PROJECTION_GLOBE_VIEW\nglFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade));\n#endif\n#ifdef RENDER_CUTOFF\nglFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);
9\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;\n#endif\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin ivec2 a_pos;in uvec2 a_texture_pos;\n#endif\nout vec2 v_pos0;out vec2 v_pos1;out float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nout float v_split_fade;\n#endif\nvoid main() {vec2 uv;\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;uv=a_uv;float ele=u_raster_elevation;\n#ifdef ELEVATION_REFERENCE_GROUND\nele+=elevation(uv*EXTENT);\n#endif\nglobe_pos+=normalize(globe_pos)*ele*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos,1.0);\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz);\n#endif\n#else\nvec4 world_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec2 texture_pos=vec2(a_texture_pos);uv=texture_pos/8192.0;vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);  \nfloat tiles=u_grid_matrix[0][2];
9if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}float ele=u_raster_elevation;\n#ifdef ELEVATION_REFERENCE_GROUND\nele+=elevation(uv*EXTENT)-decomposed_pos_and_skirt.z;\n#endif\nvec4 merc_world_pos=vec4(0.0);   \nv_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,ele,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*ele*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);world_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nfloat ele=0.0;vec2 decodedPos=vec2(a_pos);\n#ifdef ELEVATION_REFERENCE_GROUND\nvec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;decodedPos=decomposedPosAndSkirt.xy;uv=decodedPos/8192.0;ele=elevation(decodedPos)-skirt;\n#else\nuv=vec2(a_texture_pos)/8192.0;\n#endif\nworld_pos=vec4(decodedPos,(u_raster_elevation+ele),1.0);\n#ifdef FOG\nv_fog_pos=fog_position(decodedPos);\n#endif\n#endif\nfloat w=1.0+dot(uv*EXTENT,u_perspective_transform);gl_Position=u_matrix*world_pos*w;\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1;\n#ifdef ELEVATED\nfloat z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor);gl_Position.z-=(gl_Position.w*zbias);\n#endif\n#ifdef RENDER_CUTOFF\nv_depth=gl_Position.z;\n#endif\n}'),symbol:rd('#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;uniform lowp float u_scale_factor;uniform lowp float u_opacity_multiplier;\n#ifdef ICON_TRANSITION\nuniform float u_icon_transition;\n#endif\n#ifdef COLOR_ADJUSTMENT\nuniform mat4 u_color_adj_mat;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#else\n#ifdef RENDER_SHADOWS\nin highp float v_z_offset;\n#endif\n#endif\nin vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nin vec2 v_tex_b;\n#endif\nin float v_draw_halo;in vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nin float is_sdf;in vec2 v_tex_a_icon;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef USE_PAINT_PROPERTIES_UBO\nin lowp float v_opacity;\n#ifdef RENDER_SDF\nin lowp vec4 v_fill_np_color;in lowp vec4 v_halo_np_color;in lowp float v_halo_width;in lowp float v_halo_blur;\n#endif\n#ifdef LIGHTING_3D_MODE\nin lowp float v_emissive_strength;\n#endif\n#else\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\n#endif\nvoid main() {\n#ifdef USE_PAINT_PROPERTIES_UBO\nlowp float opacity=v_opacity;lowp vec4 fill_color=vec4(0.0);lowp vec4 halo_color=vec4(0.0);lowp float halo_width=0.0;lowp float halo_blur=0.0;\n#ifdef RENDER_SDF\nfill_color=vec4(v_fill_np_color.rgb*v_fill_np_color.a,v_fill_np_color.a);halo_color=vec4(v_halo_np_color.rgb*v_halo_np_color.a,v_halo_np_color.a);halo_width=v_halo_width;halo_blur=v_halo_blur;\n#endif\nlowp float emissive_strength=0.0;\n#ifdef LIGHTING_3D_MODE\nemissive_strength=v_emissive_strength;\n#endif\n#else\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\n#endif\nvec4 out_color;float fade_opacity=v_gamma_scale_size_fade_opacity[2];\n#ifdef RENDER_TEXT_AND_SYMBOL\nif (is_sdf==ICON) {vec2 tex_icon=v_tex_a_icon;lowp float alpha=opacity*fade_opacity*u_opacity_multiplier;
9glFragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nreturn;}\n#endif\nvec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\n#ifdef RENDER_SDF\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_gamma_scale_size_fade_opacity.x;float size=v_gamma_scale_size_fade_opacity.y;float fontScale=u_is_text ? size/24.0 : size;out_color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {out_color=halo_color;gamma=(halo_blur*u_scale_factor*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width*u_scale_factor/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,v_tex_a).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);out_color*=alpha;\n#else\n#ifdef ICON_TRANSITION\nvec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b);\n#else\nout_color=texture(u_texture,v_tex_a);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef COLOR_ADJUSTMENT\nout_color=u_color_adj_mat*out_color;\n#endif\n#endif\nout_color*=opacity*fade_opacity*u_opacity_multiplier;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);\n#ifdef TERRAIN\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#else\nout_color.rgb*=mix(v_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#define USING_APPEARANCE 1.0\nin ivec4 a_pos_offset;in uvec4 a_tex_size;in ivec4 a_pixeloffset;in vec4 a_projected_pos;in uint a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_auto_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_globe_anchor;in vec3 a_globe_normal;\n#endif\n#ifdef ICON_TRANSITION\nin uvec2 a_texb;\n#endif\n#ifdef OCCLUSION_QUERIES\nin float a_occlusion_query_opacity;\n#endif\n#ifdef ELEVATED_ROADS\nin vec3 a_x_axis;in vec3 a_y_axis;uniform float u_normal_scale;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#else\n#ifdef RENDER_SHADOWS\nout highp float v_z_offset;\n#endif\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_elevation_from_sea;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;uniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nout vec2 v_tex_b;\n#endif\nout float v_draw_halo;out vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nout float is_sdf;out vec2 v_tex_a_icon;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#ifdef USE_PAINT_PROPERTIES_UBO\n#ifndef MAX_UBO_SIZE_VEC4\n#define MAX_UBO_SIZE_VEC4 1024u\n#endif\n#define SPP_HEADER_SIZE_VEC4 3u\n#define DWORDS_PER_VEC4 4u\nstruct SymbolPaintProperties {vec4 fill_np_color;vec4 halo_np_color;float opacity;float halo_width;float halo_blur;float emissive_strength;float occlusion_opacity;float z_offset;vec2 translate;};struct PropertyType {bool isDataDriven;bool isZoomDependent;uint offsetDwords;float zoomFactor;};struct SymbolPropertyHeader {uint dataDrivenBlockSizeVec4;PropertyType fill_np_color;PropertyType halo_np_color;PropertyType opacity;PropertyType halo_width;PropertyType halo_blur;PropertyType emissive_strength;PropertyType occlusion_opacity;PropertyType z_offset;PropertyType translate;};uniform lowp vec4 u_spp_fill_np_color;uniform lowp vec4 u_spp_halo_np_color;uniform lowp float u_spp_opacity;uniform lowp float u_spp_halo_width;uniform lowp float u_spp_halo_blur;uniform lowp float u_spp_emissive_strength;uniform lowp float u_spp_occlusion_opacity;uniform highp float u_spp_z_offset;uniform lowp vec2 u_spp_translate_rotation;uniform highp float u_spp_fill_color_zoom_factor;uniform highp float u_spp_halo_color_zoom_factor;uniform highp float u_spp_opacity_zoom_factor;uniform highp float u_spp_halo_width_zoom_factor;uniform highp float u_spp_halo_blur_zoom_factor;uniform highp float u_spp_emissive_strength_zoom_factor;uniform highp float u_spp_occlusion_opacity_zoom_factor;uniform highp float u_spp_z_offset_zoom_factor;uniform highp float u_spp_translate_zoom_factor;in float a_feature_index;layout(std140) uniform SymbolPaintPropertiesHeaderUniform {uvec4 header[SPP_HEADER_SIZE_VEC4];} u_spp_header;layout(std140) uniform SymbolPaintPropertiesUniform {vec4 properties[MAX_UBO_SIZE_VEC4];} u_spp_properties;layout(std140) uniform SymbolPaintPropertiesIndexUniform {uvec4 block_indices[MAX_UBO_SIZE_VEC4];} u_spp_index;out lowp float v_opacity;\n#ifdef RENDER_SDF\nout lowp vec4 v_fill_np_color;out lowp vec4 v_halo_np_color;out lowp float v_halo_width;out lowp float v_halo_blur;\n#endif\n#ifdef LIGHTING_3D_MODE\nout lowp float v_emissive_strength;\n#endif\nPropertyType getPropertyType(uint propertyIndex,uint dataDrivenMask,uint zoomDependentMask,uint offsetDwords,float zoomFactor) {PropertyType type;type.isDataDriven=(dataDrivenMask & (1u << propertyIndex)) !=0u;type.isZoomDependent=(zoomDependentMask & (1u << propertyIndex)) !=0u;type.offsetDwords=offsetDwords;type.zoomFactor=zoomFactor;return type;}SymbolPropertyHeader readSymbolPropertiesHeader() {SymbolPropertyHeader header;uint dataDrivenMask           =u_spp_header.header[0][0];uint zoomDependentMask        =u_spp_header.header[0][1];header.dataDrivenBlockSizeVec4=u_spp_header.header[0][2];header.fill_np_color    =getPropertyType(0u,dataDrivenMask,zoomDependentMask,u_spp_header.header[0][3],u_spp_fill_color_zoom_factor);header.halo_np_color    =getPropertyType(1u,dataDrivenMask,zoomDependentMask,u_spp_header.header[1][0],u_spp_halo_color_zoom_factor);header.opacity          =getPropertyType(2u,dataDrivenMask,zoomDependentMask,u_spp_header.header[1][1],u_spp_opacity_zoom_factor);header.halo_width       =getPropertyType(3u,dataDrivenMask,zoomDependentMask,u_spp_header.header[1][2],u_spp_halo_width_zoom_factor);header.halo_blur        =getPropertyType(4u,dataDrivenMask,zoomDependentMask,u_spp_header.header[1][3],u_spp_halo_blur_zoom_factor);header.emissive_strength=getPropertyType(5u,dataDrivenMask,zoomDependentMask,u_spp_header.header[2][0],u_spp_emissive_strength_zoom_factor);header.occlusion_opacity=getPropertyType(6u,dataDrivenMask,zoomDependentMask,u_spp_header.header[2][1],u_spp_occlusion_opacity_zoom_factor);header.z_offset         =getPropertyType(7u,dataDrivenMask,zoomDependentMask,u_spp_header.header[2][2],u_spp_z_offset_zoom_factor);header.translate        =getPropertyType(8u,dataDrivenMask,zoomDependentMask,u_spp_header.header[2][3],u_spp_translate_zoom_factor);return header;}uint uvec4At(uvec4 v,uint index) {return (index==0u) ? v.x :\n(index==1u) ? v.y :\n(index==2u) ? v.z : v.w;}float vec4At(vec4 v,uint index) {return (index==0u) ? v.x :\n(index==1u) ? v.y :\n(index==2u) ? v.z : v.w;}vec4 readVec4(uint baseOffsetVec4,uint propertyOffsetDwords) {return u_spp_properties.properties[baseOffsetVec4+propertyOffsetDwords/DWORDS_PER_VEC4];}float readFloat(vec4 slot,uint propertyOffsetDwords) {return slot[propertyOffsetDwords % DWORDS_PER_VEC4];}uint readUint(uvec4 slot,uint offset) {return slot[offset % DWORDS_PER_VEC4];}vec2 readVec2(vec4 slot,uint propertyOffsetDwords) {float x=vec4At(slot,propertyOffsetDwords % DWORDS_PER_VEC4);float y=vec4At(slot,propertyOffsetDwords % DWORDS_PER_VEC4+1u);return vec2(x,y);}uint getDataDrivenBlockOffsetVec4(uint dataDrivenBlockSizeVec4) {uint featureIndex=uint(a_feature_index);uvec4 slot=u_spp_index.block_indices[featureIndex/DWORDS_PER_VEC4];uint blockIndex=uvec4At(slot,featureIndex % DWORDS_PER_VEC4);return blockIndex*dataDrivenBlockSizeVec4;}vec4 readColorProperty(PropertyType propertyType,uint dataDrivenBlockSizeVec4) {uint blockOffsetVec4=getDataDrivenBlockOffsetVec4(dataDrivenBlockSizeVec4);vec4 color=readVec4(blockOffsetVec4,propertyType.offsetDwords);if (propertyType.isZoomDependent) {color=unpack_mix_color(color,propertyType.zoomFactor);} else {vec2 packedColor=readVec2(color,propertyType.offsetDwords);color=decode_color(packedColor);}return color;}vec2 readVec2Property(PropertyType propertyType,uint dataDrivenBlockSizeVec4) {uint blockOffsetVec4=getDataDrivenBlockOffsetVec4(dataDrivenBlockSizeVec4);vec4 slot=readVec4(blockOffsetVec4,propertyType.offsetDwords);if (propertyType.isZoomDependent) {return mix(slot.xy,slot.zw,propertyType.zoomFactor);}return readVec2(slot,propertyType.offsetDwords);}float readFloatProperty(PropertyType propertyType,uint dataDrivenBlockSizeVec4) {uint blockOffsetVec4=getDataDrivenBlockOffsetVec4(dataDrivenBlockSizeVec4);vec4 slot=readVec4(blockOffsetVec4,propertyType.offsetDwords);float value;if (propertyType.isZoomDependent) {vec2 packedValues=readVec2(slot,propertyType.offsetDwords);value=unpack_mix_vec2(packedValues,propertyType.zoomFactor);} else {value=readFloat(slot,propertyType.offsetDwords);}return value;}SymbolPaintProperties readSymbolPaintProperties() {SymbolPropertyHeader header=readSymbolPropertiesHeader();uint sizeVec4=header.dataDrivenBlockSizeVec4;SymbolPaintProperties props;props.fill_np_color       =header.fill_np_color.isDataDriven     ? readColorProperty(header.fill_np_color,sizeVec4)     : u_spp_fill_np_color;props.halo_np_color       =header.halo_np_color.isDataDriven     ? readColorProperty(header.halo_np_color,sizeVec4)     : u_spp_halo_np_color;props.opacity             =header.opacity.isDataDriven           ? readFloatProperty(header.opacity,sizeVec4)           : u_spp_opacity;props.halo_width          =header.halo_width.isDataDriven        ? readFloatProperty(header.halo_width,sizeVec4)        : u_spp_halo_width;props.halo_blur           =header.halo_blur.isDataDriven         ? readFloatProperty(header.halo_blur,sizeVec4)         : u_spp_halo_blur;props.emissive_strength   =header.emissive_strength.isDataDriven ? readFloatProperty(header.emissive_strength,sizeVec4) : u_spp_emissive_strength;props.occlusion_opacity   =header.occlusion_opacity.isDataDriven ? readFloatProperty(header.occlusion_opacity,sizeVec4) : u_spp_occlusion_opacity;props.z_offset            =header.z_offset.isDataDriven          ? readFloatProperty(header.z_offset,sizeVec4)          : u_spp_z_offset;props.translate           =header.translate.isDataDriven         ? readVec2Property(header.translate,sizeVec4)          : vec2(0.0);return props;}\n#else\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\n#pragma mapbox: define lowp float occlusion_opacity\n#pragma mapbox: define highp float z_offset\n#endif\nvec2 unpack_opacity(uint packedOpacity) {return vec2(float(packedOpacity/2u)/127.0,float(packedOpacity & 1u));}
9void main() {\n#ifdef USE_PAINT_PROPERTIES_UBO\nSymbolPaintProperties paint_properties=readSymbolPaintProperties();lowp float opacity=paint_properties.opacity;v_opacity=opacity;\n#ifdef RENDER_SDF\nv_fill_np_color=paint_properties.fill_np_color;v_halo_np_color=paint_properties.halo_np_color;v_halo_width=paint_properties.halo_width;v_halo_blur=paint_properties.halo_blur;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_emissive_strength=paint_properties.emissive_strength;\n#endif\nlowp float occlusion_opacity=paint_properties.occlusion_opacity;highp float z_offset=paint_properties.z_offset;\n#else\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\n#pragma mapbox: initialize lowp float occlusion_opacity\n#pragma mapbox: initialize highp float z_offset\n#endif\nvec2 a_pos=vec2(a_pos_offset.xy);vec2 a_offset=vec2(a_pos_offset.zw);vec2 a_tex=vec2(a_tex_size.xy);vec2 a_size=vec2(a_tex_size.zw);float a_size_min=floor(a_size[0]*0.5);float a_size_max= floor(a_size[1]*0.5);float a_apperance=a_size[1]-2.0*a_size_max;vec2 a_pxoffset=vec2(a_pixeloffset.xy);vec2 a_min_font_scale=vec2(a_pixeloffset.zw)/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (a_apperance==USING_APPEARANCE) {size=a_size_max/128.0;} else if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size_max,u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=u_elevation_from_sea ? z_offset : z_offset+elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_auto_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=vec3(a_globe_anchor)+h;world_pos=mix_globe_mercator(world_pos_globe,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;vec2 a;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(vec3(a_globe_anchor)+displacement,1);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w;\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w;\n#endif\nvec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\n#ifdef PROJECTED_POS_ON_VIEWPORT\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xyz+h,1.0);\n#else\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz,mercator_pos,u_zoom_transition)+h;projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);    \n#endif\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\n#ifdef Z_OFFSET\nz+=u_pitch_with_map ? a_auto_z_offset+z_offset : 0.0;\n#else\nz+=u_pitch_with_map ? z_offset : 0.0;\n#endif\nfloat occlusion_fade=globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));\n#ifdef DEPTH_OCCLUSION\nfloat depth_occlusion=occlusionFadeMultiSample(projected_point);float depth_occlusion_multplier=mix(occlusion_opacity,1.0,depth_occlusion);out_fade_opacity*=depth_occlusion_multplier;\n#endif\n#ifdef OCCLUSION_QUERIES\nfloat occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier;\n#endif\n#ifdef Z_TEST_OCCLUSION\nout_fade_opacity*=occlusion_opacity;\n#endif\nfloat alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y;\n#else\n#ifdef ELEVATED_ROADS\nvec3 xAxis=vec3(a_x_axis.xy,a_x_axis.z*u_normal_scale);vec3 yAxis=vec3(a_y_axis.xy,a_y_axis.z*u_normal_scale);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y;\n#else\npos=vec3(projected_pos.xy/projected_pos.w+offset,z);\n#endif\n#endif\ngl_Position=mix(u_coord_matrix*vec4(pos,1.0),AWAY,hidden);
9\n#ifdef USE_PAINT_PROPERTIES_UBO\n{vec2 tr=paint_properties.translate;vec2 rotated_tr=vec2(\nu_spp_translate_rotation.x*tr.x-u_spp_translate_rotation.y*tr.y,u_spp_translate_rotation.y*tr.x+u_spp_translate_rotation.x*tr.y\n);gl_Position.xy+=(u_coord_matrix*vec4(rotated_tr,0.0,0.0)).xy;}\n#endif\nfloat gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_gamma_scale_size_fade_opacity=vec3(gamma_scale,size,out_fade_opacity);v_tex_a=a_tex/u_texsize;\n#ifdef RENDER_TEXT_AND_SYMBOL\nis_sdf=a_size[0]-2.0*a_size_min;v_tex_a_icon=a_tex/u_texsize_icon;\n#endif\n#ifdef ICON_TRANSITION\nv_tex_b=vec2(a_texb)/u_texsize;\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shd_pos=u_inv_matrix*vec4(pos,1.0);vec3 shd_pos0=shd_pos.xyz;vec3 shd_pos1=shd_pos.xyz;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=e;\n#else\n#ifdef RENDER_SHADOWS\nv_z_offset=e;\n#endif\n#endif\n}'),terrainRaster:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nuniform sampler2D u_image1;uniform float u_emissive_texture_available;\n#endif\nin vec2 v_pos0;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#endif\nuniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color;\n#ifdef LIGHTING_3D_MODE\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#ifdef RENDER_SHADOWS\nfloat cutoffOpacity=1.0;\n#ifdef RENDER_CUTOFF\ncutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w);\n#endif\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : image_color.a;vec3 unlit_base=image_color.rgb*(1.0-emissive_strength);vec3 emissive_base=image_color.rgb*emissive_strength;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0;\n#else\nfloat lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity));\n#endif\n#else\nfloat lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor);\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : image_color.a;color.rgb=mix(color.rgb,image_color.rgb,emissive_strength);color.a=1.0;\n#endif\n#endif\n#else\ncolor=image_color;\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_skirt_height;in ivec2 a_pos;out vec2 v_pos0;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#endif\nvoid main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);\n#endif\n}'),terrainDepth:rd("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;in ivec2 a_pos;out float v_depth;void main() {float elevation=elevation(vec2(a_pos));gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}'),skybox:rd('#include "_prelude_fog.fragment.glsl"\nin lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
9nd-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=texture(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',iX),skyboxGradient:rd('#include "_prelude_fog.fragment.glsl"\nin highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',iX),skyboxCapture:r
vendor: 3,804 bytes, line 9
9d("\nin highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;precision highp float;\n#define BETA_R                  vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M                  vec3(21e-6,21e-6,21e-6)\n#define MIE_G                   0.76\n#define DENSITY_HEIGHT_SCALE_R  8000.0\n#define DENSITY_HEIGHT_SCALE_M  1200.0\n#define PLANET_RADIUS           6360e3\n#define ATMOSPHERE_RADIUS       6420e3\n#define SAMPLE_STEPS            10\n#define DENSITY_STEPS           4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}","in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globe
9Raster:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nuniform sampler2D u_image1;uniform float u_emissive_texture_available;\n#endif\nuniform float u_far_z_cutoff;in vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nhighp vec2 uv=gl_FragCoord.xy/u_viewport;\n#ifdef FLIP_Y\nuv.y=1.0-uv.y;\n#endif\nhighp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;highp float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);highp float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : raster.a;raster=apply_lighting_with_emission_ground(raster,emissive_strength);color=vec4(clamp(raster.rgb,vec3(0),vec3(1))*antialias,antialias);\n#else\nraster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : color.a;color=apply_lighting_with_emission_ground(color,emissive_strength);color.a=1.0;\n#else\ncolor=apply_lighting_ground(color);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin ivec2 a_pos;\n#endif\nout vec2 v_pos0;void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);globe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}'),globeAtmosphere:rd('#include "_prelude_fog.fragment.glsl"\nuniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_atmosphere_fog_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {\n#ifdef ALPHA_PASS\nglFragColor=vec4(0,0,0,0);return;\n#else\n#ifdef NATIVE\nglFragColor=vec4(1,1,1,1);\n#else\nglFragColor=vec4(0,0,0,1);\n#endif\nreturn;\n#endif\n}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_atmosphere_fog_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_atmosphere_fog_color.rgb;vec3 color_stop_1=u_high_color.rgb;
9vec3 color_stop_2=u_space_color.rgb;\n#ifdef ALPHA_PASS\nfloat a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);glFragColor=vec4(1.0,1.0,1.0,a);\n#else\nvec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c=c2;glFragColor=vec4(c*t,t);\n#endif\n}',"in vec3 a_pos;in vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}"),stars:rd("in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv)\n{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}","\nin vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}"),occlusion:rd("uniform vec4 u_color;void main() {glFragColor=u_color;}",'#include "_prelude_terrain.vertex.glsl"\nin highp vec2 a_offset_xy;uniform highp vec3 u_anchorPos;uniform mat4 u_matrix;uniform vec2 u_screenSizePx;uniform vec2 u_occluderSizePx;void main() {vec3 world_pos=u_anchorPos;\n#ifdef TERRAIN\nfloat e=elevation(world_pos.xy);world_pos.z+=e;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1.0);projected_point.xy+=projected_point.w*a_offset_xy*0.5*u_occluderSizePx/u_screenSizePx;gl_Position=projected_point;}')};function ru(i,r){for(let n of i.split("\n")){if("#"!==(n=n.trimStart())[0]||!n.includes("if")||n.startsWith("#endif"))continue;let i=n.match(i8);if(i)for(let n of i)i6.has(n)||r.add(n)}}function rc(i){return new Set(["uint","int","uvec2","ivec2","uvec3","ivec3","uvec4","ivec4"]).has(i)}function rd(i,r){let n=new Set,a=[],o=[];i=i.replace(i9,(i,r)=>(o.push(r),"")),r=r.replace(i9,(i,r)=>(a.push(r),""));let s=new Set(i7);for(let n of(ru(i,s),ru(r,s),[...a,...o]))rt[n]||(rt[n]=new Set,ru(re[n],rt[n])),s=new Set([...s,...rt[n]]);return{fragmentSource:i=i.replace(i3,(i,r,a,o,s)=>(n.add(s),"define"===r?`
10#ifndef HAS_UNIFORM_u_${s}
11${rc(o)?"flat ":""}in ${a} ${o} ${s};
12#else
13uniform ${a} ${o} u_${s};
14#endif
15`:"initialize"===r?`
16#ifdef HAS_UNIFORM_u_${s}
17    ${a} ${o} ${s} = u_${s};
18#endif
19`:"define-attribute"===r?`
20#ifdef HAS_ATTRIBUTE_a_${s}
21    in ${a} ${o} ${s};
22#endif
23`:"initialize-attribute"===r?"":void 0)),vertexSource:r=r.replace(i3,(i,r,a,o,s)=>{let l=`MATERIAL_ATTRIBUTE_OFFSET_${s}`,u="float"===o?"vec2":o,c=`GET_ATTRIBUTE_${u}(a_${s}, materialInfo, ${l})`,d=s.includes("color")?"color":u;return"define-attribute-vertex-shader-only"===r?`
24#ifdef HAS_ATTRIBUTE_a_${s}
25in ${a} ${o} a_${s};
26#endif
27`:n.has(s)?"define"===r?`
28#ifndef HAS_UNIFORM_u_${s}
29uniform lowp float u_${s}_t;
30    #if !defined(${l})
31        in ${a} ${u} a_${s};
32    #endif
33${rc(o)?"flat ":""}out ${a} ${o} ${s};
34#else
35uniform ${a} ${o} u_${s};
36#endif
37`:"initialize"===r?"vec4"===d||"uvec4"===d?`
38#ifndef HAS_UNIFORM_u_${s}
39    ${s} = a_${s};
40#else
41    ${a} ${o} ${s} = u_${s};
42#endif
43`:`
44#if !defined(HAS_UNIFORM_u_${s})
45    #ifdef ${l}
46        ${s} = unpack_mix_${d}(${c}, u_${s}_t);
47    #else
48        ${s} = unpack_mix_${d}(a_${s}, u_${s}_t);
49    #endif
50#else
51    ${a} ${o} ${s} = u_${s};
52#endif
53`:"define-attribute"===r?`
54#ifdef HAS_ATTRIBUTE_a_${s}
55    in ${a} ${o} a_${s};
56    out ${a} ${o} ${s};
57#endif
58`:"initialize-attribute"===r?`
59#ifdef HAS_ATTRIBUTE_a_${s}
60    ${s} = a_${s};
61#endif
62`:void 0:"define"===r?`
63#ifndef HAS_UNIFORM_u_${s}
64uniform lowp float u_${s}_t;
65    #if !defined(${l})
66        in ${a} ${u} a_${s};
67    #endif
68#else
69uniform ${a} ${o} u_${s};
70#endif
71`:"define-instanced"===r?"mat4"===d?`
72#ifdef INSTANCED_ARRAYS
73in vec4 a_${s}0;
74in vec4 a_${s}1;
75in vec4 a_${s}2;
76in vec4 a_${s}3;
77#else
78uniform ${a} ${o} u_${s};
79#endif
80`:`
81#ifdef INSTANCED_ARRAYS
82in ${a} ${u} a_${s};
83#else
84uniform ${a} ${o} u_${s};
85#endif
86`:"initialize-attribute-custom"===r?`
87#ifdef HAS_ATTRIBUTE_a_${s}
88    ${a} ${o} ${s} = a_${s};
89#endif
90`:"vec4"===d||"uvec4"===d?`
91#ifndef HAS_UNIFORM_u_${s}
92    #ifdef ${l}
93        ${a} ${o} ${s} = ${c};
94    #else
95        ${a} ${o} ${s} = a_${s};
96    #endif
97#else
98    ${a} ${o} ${s} = u_${s};
99#endif
100`:`
101#ifndef HAS_UNIFORM_u_${s}
102    #ifdef ${l}
103        ${a} ${o} ${s} = unpack_mix_${d}(${c}, u_${s}_t);
104    #else
105        ${a} ${o} ${s} = unpack_mix_${d}(a_${s}, u_${s}_t);
106    #endif
107#else
108    ${a} ${o} ${s} = u_${s};
109#endif
110`}),usedDefines:s,vertexIncludes:a,fragmentIncludes:o}}re["_prelude_raster_particle.glsl"]||(re["_prelude_raster_particle.glsl"]=iW);var rh={building:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nconst float window_depth=0.5;const float ao_radius=0.2;in vec4 v_color;in highp vec3 v_normal;in highp vec3 v_pos;\n#ifdef RENDER_FRONT_CUTOFF\nin float v_front_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\nin vec4 v_ground_roof;\n#endif\n#endif\n#ifdef BUILDING_FAUX_FACADE\nin lowp float v_faux_facade;in highp float v_faux_facade_ed;in highp vec2 v_faux_facade_window;in highp vec2 v_faux_facade_floor;in highp vec2 v_faux_facade_range;in highp float v_aspect;in highp vec3 v_tbn_0;in highp vec3 v_tbn_1;in highp vec3 v_tbn_2;in highp vec4 v_faux_color_emissive;uniform float u_faux_facade_ao_intensity;\n#endif\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\n#ifdef FLOOD_LIGHT\nin highp float v_flood_radius;in float v_has_flood_light;\n#endif\nuniform lowp float u_opacity;uniform vec3 u_camera_pos;uniform highp float u_tile_to_meter;uniform float u_facade_emissive_chance;uniform vec3 u_flood_light_color;uniform float u_flood_light_intensity;vec3 linearTosRGB(in vec3 color) {return pow(color,vec3(1./2.2));}\n#ifdef BUILDING_FAUX_FACADE\nhighp float hash12(in highp vec2 p) {highp vec3 p3 =fract(vec3(p.xyx)*0.1031);p3+=dot(p3,p3.yzx+33.33);return fract((p3.x+p3.y)*p3.z);}float min3(in vec3 v) {return min(min(v.x,v.y),v.z);}highp vec2 get_uv_mask_id(in highp vec2 q,out highp float mask,out highp vec2 id) {highp vec2 p=q;mask=step(v_faux_facade_range.x,p.y)*step(p.y,v_faux_facade_range.y);p.y=p.y-v_faux_facade_range.x;highp vec2 uv=modf(p/v_faux_facade_floor,id);highp vec4 d=(v_faux_facade_floor.xyxy+vec4(-v_faux_facade_window,v_faux_facade_window))*0.5;highp vec4 edge=d/v_faux_facade_floor.xyxy;highp vec2 m=step(edge.xy,uv)*step(uv,edge.zw);mask*=m.x*m.y;uv-=vec2(0.5);uv*=vec2(0.5)/(vec2(0.5)-edge.xy);uv+=vec2(0.5);return uv;}highp float ray_unit_box(in highp vec3 ray_o,in highp vec3 ray_d,in highp vec3 bmin,in highp vec3 bmax) {highp vec3 planes=mix(bmin,bmax,step(0.0,ray_d));highp vec3 t=(planes-ray_o)/ray_d;return min3(t);}float get_emissive(in vec2 id) {if (u_facade_emissive_chance > 0.0) {return (step(hash12(id),u_facade_emissive_chance)+0.05)*v_faux_color_emissive.a;}return 0.0;}vec3 get_shade_info(in highp vec3 v,in highp vec3 v_normalized,in vec3 color,in vec2 id,in mat3 tbn,inout vec3 out_normal,inout float out_emissive) {vec3 out_color=color;highp vec3 abs_v=abs(v_normalized);bool x_major=abs_v.x >=abs_v.y && abs_v.x >=abs_v.z;bool y_major=abs_v.y >=abs_v.x && abs_v.y >=abs_v.z;bool z_major=abs_v.z >=abs_v.x && abs_v.z >=abs_v.y;\n#if 0\nif (x_major) {out_color=v.x > 0.0 ? vec3(1.0,0.0,0.0) : vec3(0.0,1.0,1.0);} else if (y_major) {out_color=v.y > 0.0 ? vec3(0.0,1.0,0.0) : vec3(1.0,0.0,1.0);} else if (z_major) {out_color=v.z > 0.0 ? vec3(0.0,0.0,1.0) : vec3(1.0,1.0,0.0);}out_emissive=1.0;\n#else\nif (x_major) {out_normal=-sign(v.x)*tbn[0];} else if (y_major) {out_normal=vec3(0.0,0.0,-sign(v.y));} else if (z_major) {out_color=v_faux_color_emissive.rgb;out_emissive=v.z <=0.0 ? get_emissive(id) : out_emissive;}float ao=1.0;if (u_faux_facade_ao_intensity > 0.0) {vec4 ao_range=v_faux_facade_window.xxyy*0.5-vec4(0,ao_radius,0,ao_radius);vec2 ao_range_z=vec2(window_depth*0.5)-vec2(0.0,ao_radius);if (x_major || y_major) {ao*=smoothstep(-ao_range_z.x,-ao_range_z.y,v.z);} else if (z_major) {ao*=smoothstep(-ao_range.x,-ao_range.y,v.x)*(1.0-smoothstep(ao_range.y,ao_range.x,v.x));
110ao*=smoothstep(-ao_range.z,-ao_range.w,v.y)*(1.0-smoothstep(ao_range.w,ao_range.z,v.y));}ao=mix(1.0,min(1.0,ao+0.25),u_faux_facade_ao_intensity);}out_color*=ao;\n#endif\nreturn out_color;}\n#endif\nvec3 apply_lighting_linear(in vec3 color,in vec3 normal,in float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return color*(ambient_contrib+directional_contrib);}void main() {vec3 normal=normalize(v_normal);vec3 base_color=v_color.rgb;float emissive=v_color.a;\n#ifdef BUILDING_FAUX_FACADE\nif (v_faux_facade > 0.0) {highp mat3 tbn=mat3(v_tbn_0,v_tbn_1,v_tbn_2);highp vec3 v=vec3(v_pos.xy,v_pos.z/u_tile_to_meter)-u_camera_pos;highp vec3 view_tangent=transpose(tbn)*v;highp vec2 q=vec2(v_faux_facade_ed,v_pos.z);float mask=0.0;vec2 id=vec2(0.0);highp vec2 uv=get_uv_mask_id(q,mask,id);uv*=v_faux_facade_window;highp vec3 bmin=vec3(0.0,0.0,-window_depth);highp vec3 bmax=bmin+vec3(v_faux_facade_window,window_depth);highp vec3 ray_o=vec3(uv,0.0);highp vec3 ray_d=normalize(view_tangent);highp float t_min=ray_unit_box(ray_o,ray_d,bmin,bmax);highp vec3 hit=ray_o+t_min*ray_d;highp vec3 r=vec3(v_faux_facade_window,-window_depth);hit-=r*0.5;highp vec3 normalized=hit/r;vec3 out_normal=normal;float out_emissive=emissive;vec3 room_color=get_shade_info(hit,normalized,base_color,id,tbn,out_normal,out_emissive);base_color=mix(base_color,room_color,mask);normal=mix(normal,out_normal,mask);emissive=mix(emissive,out_emissive,mask);}\n#endif\nvec4 color=vec4(base_color,1.0);vec3 xy_flipped_normal=vec3(-normal.xy,normal.z);float shadowed_lighting_factor=0.0;\n#ifdef RENDER_SHADOWS\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\n#else\nshadowed_lighting_factor=max(0.0,dot(xy_flipped_normal,u_lighting_directional_dir));\n#endif\ncolor.rgb=apply_lighting_linear(color.rgb,xy_flipped_normal,shadowed_lighting_factor);color.rgb=linearTosRGB(color.rgb);\n#ifdef FLOOD_LIGHT\nfloat flood_radiance=(1.0-min(v_pos.z/v_flood_radius,1.0))*u_flood_light_intensity*v_has_flood_light;color.rgb=mix(color.rgb,u_flood_light_color,flood_radiance);\n#endif\ncolor.rgb=mix(color.rgb,linearTosRGB(base_color.rgb),emissive);\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,v_pos.z));\n#endif\ncolor*=u_opacity;\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\n{float ditherOpacity=cutoutGroundRoofOpacity(v_ground_roof);if (ditherOpacity < 1.0) {int index=(int(gl_FragCoord.x) % 4)*4+(int(gl_FragCoord.y) % 4);if (ditherOpacity < DITHER_THRESHOLDS[index]) {discard;}}}\n#else\ncolor=applyCutout(color,v_pos.z);\n#endif\n#endif\n#ifdef RENDER_FRONT_CUTOFF\nif (v_front_cutoff_opacity < 1.0) {int index=(int(gl_FragCoord.x) % 4)*4+(int(gl_FragCoord.y) % 4);if (v_front_cutoff_opacity < DITHER_THRESHOLDS[index]) {discard;}}\n#endif\n#ifdef FEATURE_CUTOUT\ncolor=apply_feature_cutout(color,gl_FragCoord,get_cutout_factors(gl_FragCoord).x);\n#endif\nglFragColor=color;\n#ifdef DEBUG_SHOW_NORMALS\ncolor.rgb=xy_flipped_normal*0.5+vec3(0.5,0.5,0.5);color.a=1.0;glFragColor=color;\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;in ivec4 a_normal_3;in ivec4 a_centroid_3;\n#ifdef FLOOD_LIGHT\nin int a_flood_light_wall_radius_1i16;\n#endif\n#ifdef BUILDING_FAUX_FACADE\nin uvec4 a_faux_facade_data;in uvec2 a_faux_facade_vertical_range;\n#endif\nuniform mat4 u_matrix;uniform mat4 u_normal_matrix;uniform highp float u_tile_to_meter;\n#ifdef RENDER_FRONT_CUTOFF\nuniform vec3 u_front_cutoff_params;out float v_front_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\nout vec4 v_ground_roof;\n#endif\n#endif\nout vec4 v_color;out vec3 v_normal;out highp vec3 v_pos;\n#ifdef BUILDING_FAUX_FACADE\nout lowp float v_faux_facade;out highp float v_faux_facade_ed;out highp vec2 v_faux_facade_window;out highp vec2 v_faux_facade_floor;out highp vec2 v_faux_facade_range;out highp float v_aspect;out highp vec3 v_tbn_0;out highp vec3 v_tbn_1;out highp vec3 v_tbn_2;out highp vec4 v_faux_color_emissive;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;
110\n#endif\n#ifdef FLOOD_LIGHT\nout highp float v_flood_radius;out float v_has_flood_light;\n#endif\nconst float MAX_UINT_16=65535.0;const float MAX_INT_16=32767.0;const float MAX_UINT_8=255.0;const float TWO_POW_8=256.0;const float FLOOD_LIGHT_MAX_RADIUS_METER=2048.0;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#ifdef BUILDING_FAUX_FACADE\nmat3 get_tbn(in vec3 normal) {const vec3 bitangent=vec3(0.0,0.0,1.0);vec3 tangent=normalize(vec3(normal.y,-normal.x,0.0));return mat3(tangent,bitangent,normal);}\n#endif\n#pragma mapbox: define-attribute-vertex-shader-only highp uvec2 part_color_emissive\n#pragma mapbox: define-attribute-vertex-shader-only highp uvec2 faux_facade_color_emissive\nvoid main() {\n#pragma mapbox: initialize-attribute-custom highp uvec2 part_color_emissive\n#pragma mapbox: initialize-attribute-custom highp uvec2 faux_facade_color_emissive\n#ifdef FLOOD_LIGHT\nv_flood_radius=(float(a_flood_light_wall_radius_1i16)/MAX_INT_16*FLOOD_LIGHT_MAX_RADIUS_METER);v_has_flood_light=step(0.0,v_flood_radius);\n#endif\nvec4 color_emissive=decode_color(vec2(part_color_emissive));v_color=vec4(sRGBToLinear(color_emissive.rgb),color_emissive.a);vec3 a_normal_3f=vec3(a_normal_3)/MAX_INT_16;v_normal=vec3(u_normal_matrix*vec4(a_normal_3f,0.0));float hidden=0.0;float depth_offset=0.0;vec2 centroid_xy=vec2(a_centroid_3.xy >> 2);vec2 spanBits=vec2(a_centroid_3.xy & 3);\n#ifdef BUILDING_FAUX_FACADE\nvec4 faux_facade_data=vec4(a_faux_facade_data);v_faux_facade=faux_facade_data.x;if (v_faux_facade > 0.0) {v_faux_facade_ed=faux_facade_data.x *u_tile_to_meter;float window_x_perc=floor(faux_facade_data.y/TWO_POW_8);float window_y_perc=faux_facade_data.y-TWO_POW_8*window_x_perc;vec2 window_perc=vec2(window_x_perc,window_y_perc)/MAX_UINT_8;v_faux_facade_floor=(faux_facade_data.zw/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_faux_facade_window=window_perc*v_faux_facade_floor;v_faux_facade_range=(vec2(a_faux_facade_vertical_range)/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_aspect=v_faux_facade_window.x/v_faux_facade_window.y;mat3 tbn=get_tbn(normalize(v_normal));v_tbn_0=tbn[0];v_tbn_1=tbn[1];v_tbn_2=tbn[2];v_faux_color_emissive=decode_color(vec2(faux_facade_color_emissive));v_faux_color_emissive.rgb=sRGBToLinear(v_faux_color_emissive.rgb);depth_offset=min(1000.0,float(a_centroid_3.z))*0.0000002;}\n#endif\nv_pos=a_pos_3f;\n#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF)\nfloat halfSpanX=spanBits.x*10.0/u_tile_to_meter;float halfSpanY=spanBits.y*10.0/u_tile_to_meter;vec2 screenUpInTile=vec2(u_matrix[0][1],u_matrix[1][1]);vec2 spanOffset=vec2(halfSpanX,halfSpanY)*sign(screenUpInTile);vec2 cutoff_highestCorner=centroid_xy+spanOffset;vec2 cutoff_lowestCorner=centroid_xy-spanOffset;\n#endif\n#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF)\nvec4 ground=u_matrix*vec4(centroid_xy,0.0,1.0);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,ground.z);hidden=float(v_cutoff_opacity==0.0);v_pos.z*=v_cutoff_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shadow_pos=v_pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset_model(v_normal);shadow_pos+=offset*shadow_normal_offset_multiplier0();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shadow_pos,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(shadow_pos,1.0);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(v_pos);\n#endif\n#ifdef RENDER_FRONT_CUTOFF\nv_front_cutoff_opacity=1.0;{hidden=max(hidden,float(ground.w <=0.0));
110float ndc_y=ground.y/max(ground.w,0.001);float threshold=u_front_cutoff_params.x*2.0-1.0;float range_ndc=u_front_cutoff_params.y*2.0;hidden=max(hidden,float(ndc_y < threshold-range_ndc));float t=clamp((ndc_y-(threshold-range_ndc))/max(range_ndc,0.001),0.0,1.0);v_front_cutoff_opacity=mix(u_front_cutoff_params.z,1.0,t);}\n#endif\ngl_Position=mix(u_matrix*vec4(v_pos,1),AWAY,hidden);gl_Position.z-=depth_offset*gl_Position.w;\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\nvec4 ic_ground=u_matrix*vec4(v_pos.xy,0.0,1.0);vec4 ic_roof=u_matrix*vec4(v_pos.xy,v_pos.z,1.0);v_ground_roof=vec4(ic_ground.xy/ic_ground.w,ic_roof.xy/ic_roof.w);\n#endif\n#endif\n}'),buildingBloom:rd("in vec4 v_color_emissive;\n#pragma mapbox: define-attribute highp vec4 bloom_attenuation\n#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation\nfloat saturate(float val) {return clamp(val,0.0,1.0);}void main() {float emission=v_color_emissive.a;float opacity=1.0;\n#ifdef HAS_ATTRIBUTE_a_bloom_attenuation\nfloat distance=length(vec2(1.3*max(0.0,abs(bloom_attenuation.x)-bloom_attenuation.z),bloom_attenuation.y));distance+= mix(0.5,0.0,clamp(emission-1.0,0.0,1.0));opacity*=saturate(1.0-distance*distance);\n#endif\n#ifdef RENDER_CUTOFF\nopacity*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(v_color_emissive.rgb,1.0)*opacity;}","in vec3 a_pos_3f;\n#pragma mapbox: define-attribute-vertex-shader-only highp uvec2 part_color_emissive\n#pragma mapbox: define-attribute highp vec4 bloom_attenuation\nout vec4 v_color_emissive;uniform mat4 u_matrix;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute-custom highp uvec2 part_color_emissive\n#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation\n#ifdef HAS_ATTRIBUTE_a_part_color_emissive\nvec4 color_emissive=decode_color(vec2(part_color_emissive));float part_emissive=color_emissive.a*5.0;v_color_emissive=vec4(sRGBToLinear(color_emissive.rgb),part_emissive);\n#else\nv_color_emissive=vec4(1.0);\n#endif\ngl_Position=u_matrix*vec4(a_pos_3f,1.0);\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}"),buildingDepth:rd("void main() {}","in vec3 a_pos_3f;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos_3f,1.0);}"),rasterParticle:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),1.0).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\nin ivec2 a_pos;in uvec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nuv=vec2(a_texture_pos)/8192.0;
110gl_Position=u_matrix*vec4(vec2(a_pos)*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}'),rasterParticleDraw:rd("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",'#include "_prelude_raster_particle.glsl"\nin int a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2(\nmod(float(a_index),u_particle_texture_side_len),float(a_index)/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-1.0,0,1);v_particle_speed=length(velocity);}gl_PointSize=1.0;}'),rasterParticleTexture:rd("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in ivec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*vec2(a_pos)+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:rd('#include "_prelude_raster_particle.glsl"\nuniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;vec2 linearstep(vec2 edge0,vec2 edge1,vec2 x) {return  clamp((x-edge0)/(edge1-edge0),vec2(0),vec2(1));}const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp vec2 persist_rate=pow(\nlinearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4)\n);highp vec2 per_frame_persist=pow(persist_rate,abs(dp)/u_particle_pos_offset);highp float drop_rate=1.0-per_frame_persist.x*per_frame_persist.y;drop_rate=any(greaterThanEqual(abs(pos-0.5),vec2(0.5+u_particle_pos_offset))) ? 1.0 : drop_rate;highp float drop=step(1.0-drop_rate-u_reset_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}',"in ivec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*vec2(a_pos+ivec2(1));gl_Position=vec4(a_pos,0.0,1.0);}"),snowParticle:rd("in highp vec2 uv;in highp float alphaMultiplier;uniform vec4 u_particleColor;uniform vec2 u_simpleShapeParameters;void main() {float t=clamp((length(uv)-u_simpleShapeParameters.x)/(1.0-u_simpleShapeParameters.x),0.0,1.0);float alpha=1.0-pow(t,pow(10.0,u_simpleShapeParameters.y));alpha*=alphaMultiplier;alpha*=u_particleColor.a;vec3 color=u_particleColor.rgb*alpha;glFragColor=vec4(color,alpha) ;HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_snowParticleData;in highp vec4 a_snowParticleDataHorizontalOscillation;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform vec2 u_screenSize;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity;uniform vec3 u_direction;uniform float u_horizontalOscillationRadius; \nuniform float u_horizontalOscillationRate; \nuniform float u_billboardSize;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;out highp vec2 uv;out highp float alphaMultiplier;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos.xyz*=halfBoxSize;pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_snowParticleData.z;float coneAngleHeadingRad=a_snowParticleData.w*radians(360.0);vec3 localZ=normalize(u_direction);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 direction;direction.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.z=cos(coneAnglePichRad);direction=normalize(direction);vec3 simPosLocal=vec3(0,0,0);float velocityScale=(1.0+3.0*a_snowParticleData.y)*u_velocity;simPosLocal+=direction*velocityScale*u_time;float horizontalOscillationRadius=u_horizontalOscillationRadius*a_snowParticleDataHorizontalOscillation.x;float horizontalOscillationAngle=u_horizontalOscillationRate*u_time*(-1.0+2.0*a_snowParticleDataHorizontalOscillation.y);
110simPosLocal.xy+=horizontalOscillationRadius*vec2(cos(horizontalOscillationAngle),sin(horizontalOscillationAngle));vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);float clipZ=-u_cam_pos.z+pos.z;vec4 posView=u_modelview*vec4(pos,1.0);float size=u_billboardSize;alphaMultiplier=1.0;vec4 posScreen=u_projection*posView;posScreen/=posScreen.w;posScreen.xy=vec2(0.5)+posScreen.xy*0.5;posScreen.xy*=u_screenSize;vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=u_screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-posScreen.xy)/(0.5*u_screenSize));screenDist+=a_snowParticleData.x*u_thinningParticleOffset;float scaleFactorMode=0.0;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);if (a_snowParticleData.x < u_thinningAffectedRatio) {scaleFactorMode=1.0-thinningFadeRatio;alphaMultiplier=thinningFadeRatio;}}vec4 posScreen1=u_projection*vec4(posView.x-size,posView.yzw);posScreen1/=posScreen1.w;vec4 posScreen2=u_projection*vec4(posView.x+size,posView.yzw);posScreen2/=posScreen2.w;posScreen1.xy=vec2(0.5)+posScreen1.xy*0.5;posScreen1.xy*=u_screenSize;posScreen2.xy=vec2(0.5)+posScreen2.xy*0.5;posScreen2.xy*=u_screenSize;float screenLength=length(posScreen1.xy-posScreen2.xy);float screenEpsilon=3.0;float scaleFactor=1.0;if (screenLength < screenEpsilon) {scaleFactor=screenEpsilon/max(screenLength,0.01);scaleFactor=mix(scaleFactor,1.0,scaleFactorMode);}float screenEpsilon2=15.0;if (screenLength > screenEpsilon2) {scaleFactor=screenEpsilon2/max(screenLength,0.01);}size*=scaleFactor;vec2 right=size*vec2(1,0);vec2 up=size*vec2(0,1);posView.xy+=right*a_uv.x;posView.xy+=up*a_uv.y;uv=a_uv;gl_Position=u_projection*posView;}"),rainParticle:rd("in highp vec2 uv;in highp float particleRandomValue;uniform sampler2D u_texScreen;uniform float u_distortionStrength;uniform vec4 u_color;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;uniform float u_shapeDirectionalPower;uniform float u_mode;void main() {vec2 st=uv*0.5+vec2(0.5);vec2 uvm=uv;uvm.y=-1.0+2.0*pow(st.y,u_shapeDirectionalPower);float shape=clamp(1.0-length(uvm),0.0,1.0);float alpha=abs(shape)*u_color.a;vec2 screenSize=vec2(textureSize(u_texScreen,0));vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-gl_FragCoord.xy)/(0.5*screenSize));screenDist+=(0.5+0.5*particleRandomValue)*u_thinningParticleOffset;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;float thinningAlpha=1.0;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);thinningAlpha*=thinningFadeRatio;}vec2 offsetXY=normalize(uvm)*abs(shape);vec2 stScreen=(gl_FragCoord.xy+offsetXY*u_distortionStrength*thinningAlpha)/screenSize;vec3 colorScreen=texture(u_texScreen,stScreen).rgb;alpha*=thinningAlpha;glFragColor=mix(vec4(colorScreen,1.0),vec4(u_color.rgb*alpha,alpha),u_mode);HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_rainParticleData;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity; \nuniform vec2 u_rainDropletSize;uniform vec3 u_rainDirection;out highp vec2 uv;out highp float particleRandomValue;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos*=halfBoxSize; \npos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_rainParticleData.z;float coneAngleHeadingRad=a_rainParticleData.w*radians(360.0);vec3 localZ=normalize(u_rainDirection);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 directionLocal;directionLocal.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.z=cos(coneAnglePichRad);directionLocal=normalize(directionLocal);vec3 directionWorld=localX*directionLocal.x+localY*directionLocal.y+localZ*directionLocal.z;float velocityScale=(1.0+3.0*a_rainParticleData.y)*u_velocity;vec3 simPosLocal=vec3(0,0,0);simPosLocal+=directionLocal*velocityScale*u_time;vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);vec4 posView=u_modelview*vec4(pos,1.0);vec3 directionView=normalize((u_modelview*vec4(directionWorld,0.0)).xyz);vec3 side=cross(directionView,normalize(posView.xyz));posView.xyz+=side*a_uv.x*u_rainDropletSize.x;posView.xyz+=directionView*a_uv.y*u_rainDropletSize.y;uv=a_uv;particleRandomValue=a_rainParticleData.x;gl_Position=u_projection*posView;}"),vignette:rd("uniform vec3 u_vignetteShape;uniform vec4 u_vignetteColor;in vec2 st;void main() {float screenDist=length(st);float alpha=clamp((screenDist-u_vignetteShape.x)/u_vignetteShape.y,0.0,1.0);alpha=pow(alpha,u_vignetteShape.z)*u_vignetteColor.a;vec3 color=u_vignetteColor.rgb;glFragColor=vec4(color*alpha,alpha) ;}","in vec2 a_pos_2f;out vec2 st;void main() {st=a_pos_2f;gl_Position=vec4(a_pos_2f,0,1);}"),elevatedStructuresDepth:rd("void main() {}","in ivec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform float u_depth_bias;void main() {gl_Position=u_matrix*vec4(a_pos,a_height,1);gl_Position.z=gl_Position.z+u_depth_bias;}"),elevatedStructures:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nin vec3 v_normal;in float v_height;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth;\n#endif\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}
110vec3 compute_view_dependent_emissive_color(float ndotl,float emissive_strength,vec3 color)\n{color=sRGBToLinear(color);color=color*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);color=linearTosRGB(color.rgb);return color;}uniform float u_emissive_strength;uniform float u_opacity_multiplier;\n#pragma mapbox: define highp vec4 structure_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 structure_color\nvec3 color=structure_color.xyz;vec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\n#ifdef LIGHTING_3D_MODE\nvec3 normal=normalize(v_normal);vec3 transformed_normal=vec3(-normal.xy,normal.z);float ndotl=calculate_NdotL(transformed_normal);float emissive_strength=u_emissive_strength;emissive_strength=0.0;vec3 emissive_color=compute_view_dependent_emissive_color(ndotl,emissive_strength,color.xyz);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);color.rgb=apply_lighting(color.rgb,transformed_normal,light);\n#else\ncolor=apply_lighting(color,transformed_normal);\n#endif\ncolor=mix(color,emissive_color,emissive_strength);if (v_height < 0.0) {float penetration=max(v_height+7.5,0.0);float occlusion=1.0-1.0/PI*acos(1.0-penetration/4.0);color=color*(1.0-pow(occlusion,2.0)*0.3);}\n#endif\n#ifdef FOG\ncolor=fog_apply(color,v_fog_pos);\n#endif\nvec4 out_color=vec4(color,1.0);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_height);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x);\n#endif\nout_color*=u_opacity_multiplier;glFragColor=out_color;HANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin ivec2 a_pos;in float a_height;in ivec4 a_pos_normal_3;uniform mat4 u_matrix;out vec3 v_normal;out float v_height;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth;\n#endif\n#pragma mapbox: define highp vec4 structure_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 structure_color\nv_normal=vec3(a_pos_normal_3)/16384.0;v_height=a_height;vec3 pos=vec3(vec2(a_pos),a_height);gl_Position=u_matrix*vec4(pos,1);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(-v_normal.xy,v_normal.z));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n}'),elevatedStructuresDepthReconstruct:rd("#ifdef DEPTH_RECONSTRUCTION\nin float v_height;\n#endif\nvoid main() {\n#ifdef DEPTH_RECONSTRUCTION\nif (v_height >=0.0)\ndiscard;\n#else\n#ifdef FEATURE_CUTOUT\napply_feature_cutout(vec4(0.0,0.0,0.0,1.0),gl_FragCoord,get_cutout_factors(gl_FragCoord).x);\n#endif\n#endif\nglFragColor=vec4(1.0,0.0,0.0,1.0);}","in ivec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform vec3 u_camera_pos;uniform highp float u_depth_bias;uniform lowp float u_height_scale;uniform lowp float u_reset_depth;\n#ifdef DEPTH_RECONSTRUCTION\nout float v_height;\n#endif\nvoid main() {vec3 vpos=vec3(a_pos,a_height*u_height_scale);\n#ifdef DEPTH_RECONSTRUCTION\nif (u_camera_pos.z > vpos.z) {vpos-=(u_camera_pos-vpos)*(vpos.z/(u_camera_pos.z-vpos.z));}v_height=a_height;\n#endif\ngl_Position=u_matrix*vec4(vpos,1);gl_Position.z=u_reset_depth==1.0 ? gl_Position.w : gl_Position.z+u_depth_bias;}")};rd(iW,"");let rf=i.b_([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_rainParticleData",components:4}]),rp=i.b_([{type:"Float32",name:"a_pos_2f",components:2}]);class rm{destroy(){this.vignetteVx&&this.vignetteVx.destroy(),this.vignetteIdx&&this.vignetteIdx.destroy()}draw(r,n){var a;let o=r.getOrCreateProgram("vignette");
110if(!this.vignetteVx||!this.vignetteIdx){let n=new i.aO,a=new i.aT;n.emplaceBack(-1,-1),n.emplaceBack(1,-1),n.emplaceBack(1,1),n.emplaceBack(-1,1),a.emplaceBack(0,1,2),a.emplaceBack(0,2,3),this.vignetteVx=r.context.createVertexBuffer(n,rp.members),this.vignetteIdx=r.context.createIndexBuffer(a)}let s=i.aJ.simpleSegment(0,0,4,6);if(this.vignetteVx&&this.vignetteIdx){r.uploadCommonUniforms(r.context,o);let i={u_vignetteShape:(a={vignetteShape:[n.start,n.range,Math.pow(10,n.fadePower)],vignetteColor:[n.color.r,n.color.g,n.color.b,n.color.a*n.strength]}).vignetteShape,u_vignetteColor:a.vignetteColor};o.draw(r,r.context.gl.TRIANGLES,tz.disabled,t7.disabled,ie.alphaBlended,tj.disabled,i,"vignette",this.vignetteVx,this.vignetteIdx,s)}}}class rg{constructor(){this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0}update(r,n){let a=r.getFreeCameraOptions().position,o=a.toAltitude(),s=a.toLngLat(),l=i.c4(s.lng),u=i.c4(s.lat),c=r.pixelsPerMeter/n,d=l*i.c9,h=i.c9*Math.log(Math.tan(Math.PI/4+u/2));if(void 0===this._offsetXPrev)this._offsetXPrev=0,this._offsetYPrev=0,this._elevationPrev=0,this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0;else{let i=-this._offsetYPrev+h,r=-this._elevationPrev+o;this._accumulatedOffsetX+=(-this._offsetXPrev+d)*c,this._accumulatedOffsetY+=i*c,this._accumulatedElevation+=r*c,this._offsetXPrev=d,this._offsetYPrev=h,this._elevationPrev=o}}getPosition(){return[this._accumulatedOffsetX,this._accumulatedOffsetY,this._accumulatedElevation]}}function r_(i,r){return[-(i[0]-Math.floor(i[0]/r)*r),-(i[1]-Math.floor(i[1]/r)*r),-(i[2]-Math.floor(i[2]/r)*r)]}function ry(r){let n=i.eq(0x134104da55e),a=[];for(let o=0;o<r;++o){let r=2*n()-1,o=2*n()-1,s=2*n()-1;a.push(i.cx(r,o,s))}return a}function rv(r,n,a,o,s){let l=i.bG((s-a)/(o-a),0,1);return i.dY(r,n,l)}class rx{constructor(i){this._movement=new rg,this._accumulatedTimeFromStart=0,this._prevTime=Date.now()/1e3,this._vignette=new rm,this._ppmScaleFactor=i}destroy(){this.particlesVx&&this.particlesVx.destroy(),this.particlesIdx&&this.particlesIdx.destroy(),this._vignette&&this._vignette.destroy()}updateOnRender(r,n){let a=r.transform;this._movement.update(a,this._ppmScaleFactor);let o=a.starsProjMatrix,s=i.dp([]);i.f2(s,s,i.c4(90)-a._pitch),i.f5(s,s,-a.angle);let l=i.ct(new Float32Array(16),s),u=new Float32Array([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),c=i.fR([],u),d=i.er([],c,l),h=Date.now()/1e3;return this._accumulatedTimeFromStart+=(h-this._prevTime)*n,this._prevTime=h,{projectionMatrix:o,modelviewMatrix:d}}}let rb=i.b_([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_snowParticleData",components:4},{type:"Float32",name:"a_snowParticleDataHorizontalOscillation",components:2}]),rw=(i,r)=>({u_matrix:i,u_depth_bias:r}),rT=(i,r)=>({u_matrix:i,u_ground_shadow_factor:r,u_opacity_multiplier:1}),rE=(i,r,n,a,o)=>({u_matrix:i,u_camera_pos:[r[0],r[1],r[2]],u_depth_bias:n,u_height_scale:a,u_reset_depth:o});function rS(r,n){let a=1<<r.canonical.z,o=(n.x*a-r.canonical.x-r.wrap*a)*i.r,s=(n.y*a-r.canonical.y)*i.r,l=i.bn(n.z,n.y);return i.cx(o,s,l)}class rA{constructor(i=[]){this.tiles=i}getTile(i){for(let r of this.tiles)if(r.tileId.z===i.z&&r.tileId.x===i.x&&r.tileId.y===i.y)return r;return null}getTileOrParent(i){for(let r=i.z;r>0;--r){let n=Math.floor(i.x/(1<<i.z-r)),a=Math.floor(i.y/(1<<i.z-r));for(let i of this.tiles)if(i.tileId.z===r&&i.tileId.x===n&&i.tileId.y===a&&0!==i.frcMask)return i}return null}getFullCoverageMask(r){let n=null,a=0;for(let i=r.z;i>0;--i){let o=Math.floor(r.x/(1<<r.z-i)),s=Math.floor(r.y/(1<<r.z-i));for(let r of this.tiles)if(r.tileId.z===i&&r.tileId.x===o&&r.tileId.y===s){n=r,a=i;break}if(n)break}if(!n||0===n.frcMask)return null;let o=1<<r.z-a,s=i.r/o,l=r.x%o*s,u=r.y%o*s,c=l+s,d=u+s,h=0;for(let i of n.polygons)0!==i.frcMask&&(i.hasGeometry()?0===i.rings.length||r.z<=a||function(i,r,n,a,o){let s=[0,0,0,0],l=[r,a,a,r],u=[n,n,o,o];for(let c of i){let i=c.length;if(!(i<2))for(let d=0,h=i-1;d<i;h=d++){let i=c[h].x,f=c[h].y,p=c[d].x,m=c[d].y;for(let r=0;r<4;++r)f>u[r]!=m>u[r]&&l[r]<i+(p-i)*(u[r]-f)/(m-f)&&s[r]++;let g=0,_=0;if(i<r?g|=1:i>a&&(g|=2),f<n?g|=4:f>o&&(g|=8),p<r?_|=1:p>a&&(_|=2),m<n?_|=4:m>o&&(_|=8),!(g&_)&&(0===g||0===_||function(i,r,n,a,o,s,l,u){let c=(i,r,n,a,o,s,l,u)=>{let c=(n-i)*(s-r)-(a-r)*(o-i),d=(n-i)*(u-r)-(a-r)*(l-i);if(c>0&&d>0||c<0&&d<0)return!1;let h=(l-o)*(r-s)-(u-s)*(i-o),f=(l-o)*(a-s)-(u-s)*(n-o);return!(h>0&&f>0||h<0&&f<0)};return!!(c(i,r,n,a,o,s,l,s)||c(i,r,n,a,l,s,l,u)||c(i,r,n,a,o,u,l,u)||c(i,r,n,a,o,s,o,u))}(i,f,p,m,r,n,a,o)))return!1}}for(let i=0;i<4;++i)if(!(1&s[i]))return!1;return!0}(i.rings,l,u,c,d)&&(h|=i.frcMask):h|=i.frcMask);return 0!==h?h:null}equals(i){if(this.tiles.length!==i.length)return!1;for(let r=0;r<this.tiles.length;++r){let n=this.tiles[r],a=i[r];if(n.tileId.z!==a.tileId.z||n.tileId.x!==a.tileId.x||n.tileId.y!==a.tileId.y||n.frcMask!==a.frcMask||n.polygons.length!==a.polygons.length)return!1}return!0}empty(){return 0===this.tiles.length}}class rC{constructor(){this._tileCoverages=[],this._snapshot=new rA}clear(){this._tileCoverages=[]}addTileCoverage(i,r){this._tileCoverages.push({tileId:i,polygons:r,frcMask:function(i){let r=0;for(let n of i)r|=n.frcMask;return r}(r)})}empty(){return 0===this._tileCoverages.length}updateSnapshotIfNeeded(){if(this._snapshot.equals(this._tileCoverages))return this._snapshot;let i=this._tileCoverages.map(i=>({tileId:i.tileId,polygons:i.polygons,frcMask:i.frcMask}));return this._snapshot=new rA(i),this._snapshot}}class rI{constructor(i,r){this.max=i,this.onRemove=r,this.reset()}reset(){for(let i in this.data)for(let r of this.data[i])r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);return this.data={},this.order=[],this}add(i,r,n){let a=i.wrapped().key;void 0===this.data[a]&&(this.data[a]=[]);let o={value:r,timeout:void 0};if(void 0!==n&&(o.timeout=setTimeout(()=>{this.remove(i,o)},n)),this.data[a].push(o),this.order.push(a),this.order.length>this.max){let i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}has(i){return i.wrapped().key in this.data}getAndRemove(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null}_getAndRemoveByKey(i){let r=this.data[i].shift();return r.timeout&&clearTimeout(r.timeout),0===this.data[i].length&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),r.value}getByKey(i){let r=this.data[i];return r?r[0].value:null}get(i){return this.has(i)?this.data[i.wrapped().key][0].value:null}remove(i,r){if(!this.has(i))return this;let n=i.wrapped().key,a=void 0===r?0:this.data[n].indexOf(r),o=this.data[n][a];return this.data[n].splice(a,1),o.timeout&&clearTimeout(o.timeout),0===this.data[n].length&&delete this.data[n],this.onRemove(o.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(i){for(this.max=i;this.order.length>this.max;){let i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(i){let r=[];for(let n in this.data)for(let a of this.data[n])i(a.value)||r.push(a);for(let i of r)this.remove(i.value.tileID,i)}}class rk{constructor(){this.state=Object.create(null),this.stateChanges=Object.create(null),this.deletedStates=Object.create(null)}updateState(i,r,n){let a=String(r);if(this.stateChanges[i]=this.stateChanges[i]||Object.create(null),this.stateChanges[i][a]=this.stateChanges[i][a]||Object.create(null),Object.assign(this.stateChanges[i][a],n),null===this.deletedStates[i])for(let r in this.deletedStates[i]=Object.create(null),this.state[i])r!==a&&(this.deletedStates[i][r]=null);else if(this.deletedStates[i]&&null===this.deletedStates[i][a])for(let r in this.deletedStates[i][a]=Object.create(null),this.state[i][a])n[r]||(this.deletedStates[i][a][r]=null);else for(let r in n)this.deletedStates[i]&&this.deletedStates[i][a]&&null===this.deletedStates[i][a][r]&&delete this.deletedStates[i][a][r]}
110removeFeatureState(i,r,n){if(null===this.deletedStates[i])return;let a=String(r);if(this.deletedStates[i]=this.deletedStates[i]||Object.create(null),n&&void 0!==r)null!==this.deletedStates[i][a]&&(this.deletedStates[i][a]=this.deletedStates[i][a]||Object.create(null),this.deletedStates[i][a][n]=null);else if(void 0!==r)if(this.stateChanges[i]&&this.stateChanges[i][a])for(n in this.deletedStates[i][a]=Object.create(null),this.stateChanges[i][a])this.deletedStates[i][a][n]=null;else this.deletedStates[i][a]=null;else this.deletedStates[i]=null}getState(i,r){let n=this.state[i]||Object.create(null),a=this.stateChanges[i]||Object.create(null),o=this.deletedStates[i];if(null===o)return Object.create(null);if(void 0!==r){let i=String(r),s=Object.assign(Object.create(null),n[i],a[i]);if(o){let i=o[r];if(null===i)return Object.create(null);for(let r in i)delete s[r]}return s}let s=Object.assign(Object.create(null),n,a);if(o)for(let i in o)delete s[i];return s}initializeTileState(i,r){i.refreshFeatureState(r)}coalesceChanges(i,r){let n=Object.create(null);for(let i in this.stateChanges){this.state[i]=this.state[i]||Object.create(null);let r=Object.create(null);for(let n in this.stateChanges[i])this.state[i][n]||(this.state[i][n]=Object.create(null)),Object.assign(this.state[i][n],this.stateChanges[i][n]),r[n]=this.state[i][n];n[i]=r}for(let i in this.deletedStates){this.state[i]=this.state[i]||Object.create(null);let r=Object.create(null);if(null===this.deletedStates[i])for(let n in this.state[i])r[n]=Object.create(null),this.state[i][n]=Object.create(null);else for(let n in this.deletedStates[i]){if(null===this.deletedStates[i][n])this.state[i][n]=Object.create(null);else if(this.state[i][n])for(let r of Object.keys(this.deletedStates[i][n]))delete this.state[i][n][r];r[n]=this.state[i][n]}n[i]=n[i]||Object.create(null),Object.assign(n[i],r)}if(this.stateChanges=Object.create(null),this.deletedStates=Object.create(null),0!==Object.keys(n).length)for(let a in i)i[a].refreshFeatureState(r,n)}}class rR extends i.y{constructor(i,r,n){super(),this.id=i,this._renderSourceType=n,this._maxzoomOverride=null,r.on("data",i=>{"source"===i.dataType&&"metadata"===i.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===i.dataType&&"content"===i.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))}),r.on("error",()=>{this._sourceErrored=!0}),this._source=r,this._tiles={},this._cache=new rI(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=r.minTileCacheSize,this._maxTileCacheSize=r.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new rk,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"raster-array"===this._source.type||"custom"===this._source.type&&"_dataType"in this._source&&"raster"===this._source._dataType,this._supportsFading="raster"===this._source.type||"raster-array"===this._source.type||"image"===this._source.type||"video"===this._source.type||"custom"===this._source.type,this._isRasterElevatedOverTerrain=!1}onAdd(i){this.map=i,this._minTileCacheSize=void 0===this._minTileCacheSize&&i?i._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&i?i._maxTileC
110acheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(let i in this._tiles)if(!this._tiles[i].loaded())return!1;return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let i=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,i&&this.reload(),this.transform&&this.update(this.transform)}setMaxzoomOverride(i){this._maxzoomOverride=i}_loadTile(i,r){return i.renderSourceType=this._renderSourceType,i.isExtraShadowCaster=this._shadowCasterTiles[i.tileID.key],this._source.loadTile(i,r)}_unloadTile(i){if(this._source.unloadTile)return this._source.unloadTile(i)}_abortTile(i){if(this._source.abortTile)return this._source.abortTile(i)}serialize(){return this._source.serialize()}prepare(i){for(let r in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){let n=this._tiles[r];n.upload(i,this.map?this.map.painter:void 0),n.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return Object.values(this._tiles).map(i=>i.tileID).sort(rM).map(i=>i.key)}getRenderableIds(r,n){let a=[];for(let i in this._tiles)this._isIdRenderable(+i,r,n)&&a.push(this._tiles[i]);return r?a.sort((r,n)=>{let a=r.tileID,o=n.tileID,s=new i.au(a.canonical.x,a.canonical.y)._rotate(this.transform.angle),l=new i.au(o.canonical.x,o.canonical.y)._rotate(this.transform.angle);return a.overscaledZ-o.overscaledZ||l.y-s.y||l.x-s.x}).map(i=>i.tileID.key):a.map(i=>i.tileID).sort(rM).map(i=>i.key)}hasRenderableParent(i){let r=this.findLoadedParent(i,0);return!!r&&this._isIdRenderable(r.tileID.key)}_isIdRenderable(i,r,n){return this._tiles[i]&&this._tiles[i].hasData()&&!this._coveredTiles[i]&&(r||!this._tiles[i].holdingForFade())&&(n||!this._shadowCasterTiles[i])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else for(let i in this._cache.reset(),this._tiles)"errored"!==this._tiles[i].state&&this._reloadTile(+i,"reloading")}_reloadTile(i,r){let n=this._tiles[i];n&&("loading"!==n.state&&(n.state=r),this._loadTile(n,this._tileLoaded.bind(this,n,i,r)))}_tileLoaded(r,n,a,o,s){if(o){if(r.state="errored",i.dD(o)){if(this._source.fire(new i.x("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:r})),!(r.tileID.key in this._loadedParentTiles))return;if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){let i=this.map.painter.terrain;this.update(this.transform,i.getScaledDemTileSize(),!0),i.resetTileLookupCache(this.id)}else this.update(this.transform)}else this._source.fire(new i.v(o,{tile:r}));return}r.timeAdded=i.co.now(),"expired"===a&&(r.refreshedUponExpiration=!0),this._setTileReloadTimer(n,r),"raster-dem"===this._source.type&&r.dem&&this._backfillDEM(r),this._state.initializeTileState(r,this.map?this.map.painter:null);let l=new Map;s&&s.responseHeaders&&(l=s.responseHeaders),this._source.fire(new i.x("data",{dataType:"source",tile:r,coord:r.tileID,sourceCacheId:this.id,responseHeaders:l}))}_hasTunnelGeometry(){for(let i in this._tiles){let r=this._tiles[i];if(r&&r.hasTunnelGeometry)return!0}return!1}_backfillDEM(i){let r=this.getRenderableIds();for(let a=0;a<r.length;a++){let o=r[a];if(i.neighboringTiles&&i.neighboringTiles[o]){let r=this.getTileByID(o);n(i,r),n(r,i)}}function n(i,r){if(!i.dem||i.dem.borderReady)return;i.needsHillshadePrepare=!0,i.needsDEMTextureUpload=!0;let n=r.tileID.canonical.x-i.tileID.canonical.x,a=r.tileID.canonical.y-i.tileID.canonical.y,o=Math.pow(2,i.tileID.canonical.z),s=r.tileID.key;0===n&&0===a||Math.abs(a)>1||(Math.abs(n)>1&&(1===Math.abs(n+o)?n+=o:1===Math.abs(n-o)&&(n-=o)),r.dem&&i.dem&&(i.dem.backfillBorder(r.dem,n,a),i.neighboringTiles&&i.neighboringTiles[s]&&(i.neighboringTiles[s].backfilled=!0)))}}getTile(i){return this.getTileByID(i.key)}getTileByID(i){return this._tiles[i]}_retainLoadedChildren(i,r,n,a){for(let o in this._tiles){let s=this._tiles[o];if(a[o]||!s.hasData()||s.tileID.overscaledZ<=r||s.tileID.overscaledZ>n)continue;let l=s.tileID;for(;s&&s.tileID.overscaledZ>
110r+1;){let i=s.tileID.scaledTo(s.tileID.overscaledZ-1);(s=this._tiles[i.key])&&s.hasData()&&(l=i)}let u=l;for(;u.overscaledZ>r;)if(i[(u=u.scaledTo(u.overscaledZ-1)).key]){a[l.key]=l;break}}}findLoadedParent(i,r){if(i.key in this._loadedParentTiles){let n=this._loadedParentTiles[i.key];return n&&n.tileID.overscaledZ>=r?n:null}for(let n=i.overscaledZ-1;n>=r;n--){let r=i.scaledTo(n),a=this._getLoadedTile(r);if(a)return a}}_getLoadedTile(i){let r=this._tiles[i.key];return r&&r.hasData()?r:this._cache.getByKey(this._source.reparseOverscaled?i.wrapped().key:i.canonical.key)}updateCacheSize(i,r){r=r||this._source.tileSize;let n=Math.floor((Math.ceil(i.width/r)+1)*(Math.ceil(i.height/r)+1)*5),a="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,n):n,o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,a):a;this._cache.setMaxSize(o)}handleWrapJump(i){let r=Math.round((i-(void 0===this._prevLng?i:this._prevLng))/360);if(this._prevLng=i,r){let i={};for(let n in this._tiles){let a=this._tiles[n];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),i[a.tileID.key]=a}for(let r in this._tiles=i,this._timers)clearTimeout(this._timers[r]),delete this._timers[r];for(let i in this._tiles)this._setTileReloadTimer(+i,this._tiles[i])}}update(r,n,a,o,s){if(this.transform=r,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!a)return;this.updateCacheSize(r,n),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};let l="batched-model"===this._source.type,u,c=this._source.maxzoom;null!==this._maxzoomOverride&&(c=Math.min(c,this._maxzoomOverride));let d=this.map&&this.map.painter?this.map.painter._terrain:null;if(d&&d.sourceCache===this&&d.attenuationRange()){let i=Math.floor(d.attenuationRange()[0])-Math.log2(d.getDemUpscale());c>i&&(c=i)}let h=null===this._maxzoomOverride&&this._source.reparseOverscaled;if(this.used||this.usedForTerrain){if(this._source.tileID)u=r.getVisibleUnwrappedCoordinates(this._source.tileID).map(r=>new i.ap(r.canonical.z,r.wrap,r.canonical.z,r.canonical.x,r.canonical.y));else if(0!==this.tileCoverLift){let o=r.clone();o.tileCoverLift=this.tileCoverLift,u=o.coveringTiles({tileSize:n||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:c,roundZoom:this._source.roundZoom&&!a,reparseOverscaled:h,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:l}),this._source.minzoom<=1&&"globe"===r.projection.name&&(u.push(new i.ap(1,0,1,0,0)),u.push(new i.ap(1,0,1,1,0)),u.push(new i.ap(1,0,1,0,1)),u.push(new i.ap(1,0,1,1,1)))}else if(u=r.coveringTiles({tileSize:n||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:c,roundZoom:this._source.roundZoom&&!a,reparseOverscaled:h,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:l}),this._source.hasTile){let i=this._source.hasTile.bind(this._source);u=u.filter(r=>i(r))}}else u=[];if(u.length>0&&"globe"!==this.transform.projection.name&&!this.usedForTerrain&&!this._supportsFading){let i=Math.min(r.coveringZoomLevel({tileSize:n||this._source.tileSize,roundZoom:this._source.roundZoom&&!a}),c);if(l)for(let n of r.extendTileCover(u,i))u.push(n);else if(s){let n=this.transform.getFrustum(i);for(let a of r.extendTileCoverToNearPlane(u,n,i))u.push(a);if(i>=18&&this._hasTunnelGeometry())for(let a of r.extendTileCoverForTunnels(u,n,i,20))u.push(a)}else if(this.castsShadows&&o)for(let n of r.extendTileCover(u,i,o,16))this._shadowCasterTiles[n.key]=!0,u.push(n)}let f=this._updateRetainedTiles(u);if(this._supportsFading&&0!==u.length){let r={},n={},a=i.co.now();for(let i of Object.keys(f)){let o=f[i],s=this._tiles[i];if(!s||void 0!==s.fadeEndTime&&s.fadeEndTime<=a)continue;let l=this.findLoadedParent(o,Math.max(o.overscaledZ-rR.maxOverzooming,this._source.minzoom));l&&(this._addTile(l.tileID),r[l.tileID.key]=l.tileID),n[i]=o}let o=u.at(-1).overscaledZ;for(let i in this._tiles){let r=this._tiles[i];if(f[i]||!r.hasData())continue;let a=r.tileID;for(;a.overscaledZ>o;){a=a.scaledTo(a.overscaledZ-1);let o=this._tiles[a.key];
110if(o&&o.hasData()&&n[a.key]){f[i]=r.tileID;break}}}for(let i in r)f[i]||(this._coveredTiles[i]=!0,f[i]=r[i])}for(let i in f)this._tiles[i].clearFadeHold();for(let r of i.dS(this._tiles,f)){let i=this._tiles[r];i.hasSymbolBuckets&&!i.holdingForFade()?i.setHoldDuration(this.map._fadeDuration):i.hasSymbolBuckets&&!i.symbolFadeFinished()||this._removeTile(+r)}this._updateLoadedParentTileCache(),this._renderSourceType===i.aC.Symbol&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(let i in this._tiles)this._tiles[i].holdingForFade()&&this._removeTile(+i)}_updateRetainedTiles(i){let r={};if(0===i.length)return r;let n={},a=i.reduce((i,r)=>Math.min(i,r.overscaledZ),1/0),o=i[0].overscaledZ,s=Math.max(o-rR.maxOverzooming,this._source.minzoom),l=Math.max(o+rR.maxUnderzooming,this._source.minzoom),u={};for(let n of i){let i=this._addTile(n);r[n.key]=n,i.hasData()||a<this._source.maxzoom&&(u[n.key]=n)}for(let o of(this._retainLoadedChildren(u,a,l,r),i)){let i=this._tiles[o.key];if(i.hasData())continue;if(o.canonical.z>=this._source.maxzoom){let i=o.children(this._source.maxzoom)[0],n=this.getTile(i);if(n&&n.hasData()){r[i.key]=i;continue}}else{let i=o.children(this._source.maxzoom);if(r[i[0].key]&&r[i[1].key]&&r[i[2].key]&&r[i[3].key])continue}let a=i.wasRequested();for(let l=o.overscaledZ-1;l>=s;--l){let s=o.scaledTo(l);if(n[s.key]||(n[s.key]=!0,(i=this.getTile(s))||!a||(i=this._addTile(s)),i&&(r[s.key]=s,a=i.wasRequested(),i.hasData())))break}}return r}_updateLoadedParentTileCache(){for(let i in this._loadedParentTiles={},this._tiles){let r=[],n,a=this._tiles[i].tileID;for(;a.overscaledZ>0;){if(a.key in this._loadedParentTiles){n=this._loadedParentTiles[a.key];break}r.push(a.key);let i=a.scaledTo(a.overscaledZ-1);if(n=this._getLoadedTile(i))break;a=i}for(let i of r)this._loadedParentTiles[i]=n}}_addTile(r){let n=this._tiles[r.key];if(n)return!0!==n.isExtraShadowCaster||this._shadowCasterTiles[r.key]||this._reloadTile(r.key,"reloading"),n;(n=this._cache.getAndRemove(r))&&(this._setTileReloadTimer(r.key,n),n.tileID=r,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[r.key]&&(clearTimeout(this._cacheTimers[r.key]),delete this._cacheTimers[r.key],this._setTileReloadTimer(r.key,n)));let a=!!n;if(!a){let a=this.map?this.map.painter:null,o=this._source.tileSize*r.overscaleFactor();n="raster-array"===this._source.type?new iz(r,o,this.transform.tileZoom,a,this._isRaster):new i.b0(r,o,this.transform.tileZoom,a,this._isRaster,this._source.worldview),this._loadTile(n,this._tileLoaded.bind(this,n,r.key,n.state))}return n.uses++,this._tiles[r.key]=n,a||this._source.fire(new i.x("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(i,r){i in this._timers&&(clearTimeout(this._timers[i]),delete this._timers[i]);let n=r.getExpiryTimeout();n&&(this._timers[i]=setTimeout(()=>{this._reloadTile(i,"expired"),delete this._timers[i]},n))}_removeTile(i){let r=this._tiles[i];r&&(r.uses--,delete this._tiles[i],this._timers[i]&&(clearTimeout(this._timers[i]),delete this._timers[i]),r.uses>0||(r.hasData()&&"reloading"!==r.state||"empty"===r.state?this._cache.add(r.tileID,r,r.getExpiryTimeout()):(r.aborted=!0,this._abortTile(r),this._unloadTile(r))))}clearTiles(){for(let i in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(+i);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(r,n,a){let o=[],s=this.transform;if(!s)return o;let l="globe"===s.projection.name,u=i.ek(s.center.lng);for(let c in this._tiles){let d,h=this._tiles[c];if(a&&h.clearQueryDebugViz(),!h.holdingForFade()){if(l){let r=h.tileID.canonical;if(0===r.z){let n=[Math.abs(i.bG(u,...rL(r,-1))-u),Math.abs(i.bG(u,...rL(r,1))-u)];d=[0,2*n.indexOf(Math.min(...n))-1]}else{let n=[Math.abs(i.bG(u,...rL(r,-1))-u),Math.abs(i.bG(u,...rL(r,0))-u),Math.abs(i.bG(u,...rL(r,1))-u)];d=[n.indexOf(Math.min(...n))-1]}}else d=[0];for(let i of d){let a=r.containsTile(h,s,n,i);a&&o.push(a)}}}return o}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(i){return this._getRenderableCoordinates(i)}_getRenderableCoordinates(i,r){if(!this.transform)return[];let n=this.getRenderableIds(i,r).map(i=>this._tiles[i].tileID),a="globe"===this.transform.projection.name;for(let i of n)i.projMatrix=this.transform.calculateProjMatrix(i.toUnwrapped()),i.expandedProjMatrix=a?this.transform.calculateProjMatrix(i.toUnwrapped(),!1,!0):i.projMatrix;return n}sortCoordinatesByDistance(i){let r=i.slice(),n=this.transform._camera.position,a=this.transform._camera.forward(),o={};for(let i of r){let r=1/(1<<i.canonical.z);o[i.key]=((i.canonical.x+.5)*r+i.wrap-n[0])*a[0]+((i.canonical.y+.5)*r-n[1])*a[1]-n[2]*a[2]}return r.sort((i,r)=>o[i.key]-o[r.key]),r}hasTransition(){if(this._source.hasTransition())return!0;
110if(this._supportsFading){let r=i.co.now();for(let i in this._tiles){let n=this._tiles[i];if(void 0!==n.fadeEndTime&&n.fadeEndTime>=r)return!0}}return!1}setFeatureState(i,r,n){this._state.updateState(i=i||"_geojsonTileLayer",r,n)}removeFeatureState(i,r,n){this._state.removeFeatureState(i=i||"_geojsonTileLayer",r,n)}getFeatureState(i,r){return this._state.getState(i=i||"_geojsonTileLayer",r)}setDependencies(i,r,n){let a=this._tiles[i];a&&a.setDependencies(r,n)}reloadTilesForDependencies(i,r){for(let n in this._tiles)this._tiles[n].hasDependency(i,r)&&this._reloadTile(+n,"reloading");this._cache.filter(n=>!n.hasDependency(i,r))}_preloadTiles(r,n){if(!this._sourceLoaded){let i=()=>{this._sourceLoaded&&(this._source.off("data",i),this._preloadTiles(r,n))};return void this._source.on("data",i)}let a=new Map,o=Array.isArray(r)?r:[r],s=this.map.painter.terrain,l=this.usedForTerrain&&s?s.getScaledDemTileSize():this._source.tileSize;for(let i of o){for(let r of i.coveringTiles({tileSize:l,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}))a.set(r.key,r);this.usedForTerrain&&i.updateElevation(!1)}let u=Array.from(a.values());i.bp(u,(r,n)=>{let a=new i.b0(r,this._source.tileSize*r.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster,this._source.worldview);this._loadTile(a,i=>{"raster-dem"===this._source.type&&a.dem&&this._backfillDEM(a),n(i,a)})},n)}}function rM(i,r){let n=Math.abs(2*i.wrap)-(i.wrap<0),a=Math.abs(2*r.wrap)-(r.wrap<0);return i.overscaledZ-r.overscaledZ||a-n||r.canonical.y-i.canonical.y||r.canonical.x-i.canonical.x}function rL(i,r){let n=1<<i.z;return[i.x/n+r,(i.x+1)/n+r]}rR.maxOverzooming=10,rR.maxUnderzooming=3;let rP=i=>({u_matrix:i});function rO(r,n){if(!r.frcCoverageSnapshot||!r.frcCoverageRenderer)return null;let a=r.frcCoverageSnapshot.getTileOrParent(n.canonical);if(!a||0===a.frcMask)return null;let o=r.frcCoverageRenderer.getBuffers(a.tileId);if(!o)return null;let s=new i.f(a.tileId.z,a.tileId.x,a.tileId.y),l=new i.bc(n.wrap,s);return{buffers:o,projMatrix:r.transform.calculateProjMatrix(l),coverageTile:a}}function rD(i,r,n,a,o){if(0===r.length)return;let s=0;for(let i of r)s|=i.frcMask;let l=r.map(i=>i.coord);for(let u=0;u<9;++u)if(s&1<<u){if(function(i,r,n){if(!i.frcCoverageSnapshot)return;let a=i.context,o=a.gl,s=i.getOrCreateProgram("clippingMask");for(let l of(a.setColorMode(ie.disabled),a.setDepthMode(tz.disabled),r)){let r=rO(i,l);if(!r)continue;let a=r.buffers.frcLevelSegments[n];a&&s.draw(i,o.TRIANGLES,tz.disabled,new t7({func:o.EQUAL,mask:255},i._tileClippingMaskIDs[l.key]||0,255,o.KEEP,o.KEEP,o.INVERT),ie.disabled,tj.disabled,rP(r.projMatrix),`$frc_coverage_${n}`,r.buffers.vertexBuffer,r.buffers.indexBuffer,a)}}(i,l,u),a)for(let n of r)n.frcMask&1<<u&&a(n,u,function(i,r){let n=i.context.gl;return new t7({func:n.EQUAL,mask:255},i._tileClippingMaskIDs[r.key]||0,0,n.KEEP,n.KEEP,n.KEEP)}(i,n.coord));if(n>0&&o)for(let n of r)n.frcMask&1<<u&&o(n,u,function(i,r){let n=i.context.gl;return new t7({func:n.EQUAL,mask:255},255&~(i._tileClippingMaskIDs[r.key]||0),0,n.KEEP,n.KEEP,n.KEEP)}(i,n.coord));!function(i,r,n){if(!i.frcCoverageSnapshot)return;let a=i.context,o=a.gl,s=i.getOrCreateProgram("clippingMask");for(let l of(a.setColorMode(ie.disabled),a.setDepthMode(tz.disabled),r)){let r=rO(i,l);if(!r)continue;let a=r.buffers.frcLevelSegments[n];a&&s.draw(i,o.TRIANGLES,tz.disabled,new t7({func:o.EQUAL,mask:255},255&~(i._tileClippingMaskIDs[l.key]||0),255,o.KEEP,o.KEEP,o.INVERT),ie.disabled,tj.disabled,rP(r.projMatrix),`$frc_coverage_restore_${n}`,r.buffers.vertexBuffer,r.buffers.indexBuffer,a)}}(i,l,u)}}function rF(i){for(let r of i)if(r.rings.length>0&&r.rings[0].length>0)return!0;return!1}function rN(i){let r=i.frcCoverageFadeRange;return!r||r[1]<=r[0]?0:1-Math.max(0,Math.min(1,(i.transform.zoom-r[0])/(r[1]-r[0])))}let rj=function(i,r,n,a){i.currentLayer<i.firstLightBeamLayer&&(i.firstLightBeamLayer=i.currentLayer);let o=n.paint.get("building-ambient-occlusion-ground-intensity"),s=n.paint.get("building-ambient-occlusion-ground-radius"),l=n.paint.get("building-ambient-occlusion-ground-attenuation"),u=n.paint.get("building-opacity");if(u<=0)return;let c=o>0&&s>0,d=!0,h=n.paint.get("building-vertical-scale");if(h<=0)return;i.shadowRenderer||(d=!1);let f=i.conflationActive&&i.style.isLayerClipped(n,r.getSource()),p=i.style.order.indexOf(n.fqid);if(function(i,r,n,a,o,s){for(let l of s){let s=r.getTile(l).getBucket(n);s&&(o&&s.updateReplacement(l,i.replacementSource,a),s.uploadUpdatedIndexBuffer(i.context))}}(i,r,n,p,f,a),function(i,r,n,a){for(let o of a){let a=r.getTile(o).getBucket(n);a&&a.needsEvaluation()&&a.uploadUpdatedColorBuffer(i.context)}}(i,r,n,a),n.resetLayerRenderingStats(i),i.shadowRenderer&&(i.shadowRenderer.useNormalOffset=!0),"shadow"===i.renderPass&&i.shadowRenderer){let o=i.shadowRenderer.getShadowPassDepthMode();iM({painter:i,source:r,layer:n,coords:a,defines:[],blendMode:ie.disabled,depthMode:o,opacity:u,verticalScale:h,facadeEmissiveChance:0,facadeAOIntensity:0,floodLightIntensity:0,floodLightColor:[0,0,0]})}else if("translucent"===i.renderPass){let p=["HAS_ATTRIBUTE_a_part_color_emissive","LIGHTING_3D_MODE"];d&&(p=p.concat("RENDER_SHADOWS")),i.shadowRenderer&&i.shadowRenderer.useNormalOffset&&(p=p.concat("NORMAL_OFFSET"));let m=n.paint.get("building-facade-emissive-chance"),g=n.paint.get("building-ambient-occlusion-intensity"),_=n.paint.get("building-flood-light-intensity"),y="none"===n.paint.get("building-flood-light-color-use-theme").
110constantOr("default"),v=n.paint.get("building-flood-light-color").toNonPremultipliedRenderColor(y?null:n.lut).toArray01().slice(0,3),x=n.paint.get("building-flood-light-ground-attenuation"),b=_>0,w=new tz(i.context.gl.LEQUAL,tz.ReadWrite,i.depthRangeFor3D);u<1&&iM({painter:i,source:r,layer:n,coords:a,defines:p,blendMode:ie.disabled,depthMode:w,opacity:u,verticalScale:h,facadeEmissiveChance:m,facadeAOIntensity:g,floodLightIntensity:_,floodLightColor:v,depthOnly:!0});let T=i.colorModeForRenderPass();iM({painter:i,source:r,layer:n,coords:a,defines:p,blendMode:T,depthMode:w,opacity:u,verticalScale:h,facadeEmissiveChance:m,facadeAOIntensity:g,floodLightIntensity:_,floodLightColor:v});let E=n.paint.get("building-front-cutoff");iT(i.transform.pitch,E,!!i.terrain),c&&iL(i,r,n,a,!0,u,o,s,_,v,l,f),b&&iL(i,r,n,a,!1,u,o,s,_,v,x,f)}else if("light-beam"===i.renderPass){let o=new tz(i.context.gl.LEQUAL,tz.ReadOnly,i.depthRangeFor3D);iM({painter:i,source:r,layer:n,coords:a,defines:["HAS_ATTRIBUTE_a_part_color_emissive","HAS_ATTRIBUTE_a_bloom_attenuation"],blendMode:ie.alphaBlended,depthMode:o,opacity:u,verticalScale:h,facadeEmissiveChance:0,facadeAOIntensity:0,floodLightIntensity:0,floodLightColor:[0,0,0]})}i.shadowRenderer&&(i.shadowRenderer.useNormalOffset=!1),i.resetStencilClippingMasks()},rz=function(r,n,a,o,s,l){"offscreen"===r.renderPass&&function(r,n,a,o){if(!o.length)return;let s=r.context,l=s.gl,u=n.getSource();if(!(u instanceof iH))return;let c=Math.ceil(Math.sqrt(a.paint.get("raster-particle-count"))),d=a.particlePositionRGBAImage;if(!d||d.width!==c){let r=function(r){let n=r*r,a=new Uint8Array(4*n);for(let r=0;r<n;r++){let n=.9090909090909091*(i.cg(2*r+0)+.05),o=.9090909090909091*(i.cg(2*r+1)+.05),s=255*n%1,l=255*o%1,u=o-l/255;a[4*r+0]=255*(n-s/255),a[4*r+1]=255*s,a[4*r+2]=255*u,a[4*r+3]=255*l}return a}(c);d=a.particlePositionRGBAImage=new i.ay({width:c,height:c},r)}let h=a.particleFramebuffer;h?h.width!==c&&(h.destroy(),h=a.particleFramebuffer=s.createFramebuffer(c,c,1,null)):h=a.particleFramebuffer=s.createFramebuffer(c,c,1,null);let f=[];for(let r of o){let o=n.getTile(r);if(!(o instanceof iz))continue;let l=function(r,n,a){if(!r)return null;let o=n.getTextureDescriptor(r,a,!0);if(!o)return null;let{texture:s,mix:l,offset:u,tileSize:c,buffer:d,format:h}=o;if(!s||!h)return null;let f=!1;return"uint32"===h&&(f=!0,l[3]=0,l=iN(i.d,l,[0,a.paint.get("raster-particle-max-speed")]),u=ij(i.d,u,[0,a.paint.get("raster-particle-max-speed")])),{texture:s,textureOffset:[d/(c+2*d),c/(c+2*d)],tileSize:c,scalarData:f,scale:l,offset:u,defines:["RASTER_ARRAY",{uint8:"DATA_FORMAT_UINT8",uint16:"DATA_FORMAT_UINT16",uint32:"DATA_FORMAT_UINT32"}[h]]}}(o,u,a);if(!l)continue;let h=[o.tileSize,o.tileSize],p=a.tileFramebuffer;p||(p=a.tileFramebuffer=s.createFramebuffer(h[0],h[1],1,null));let m=o.rasterParticleState;m||(m=o.rasterParticleState=new iq(s,r,h,d));let g=m.update(a.lastInvalidatedAt);m.particleTextureDimension!==c&&m.updateParticleTexture(r,d);let _=m.targetColorTexture;m.targetColorTexture=m.backgroundColorTexture,m.backgroundColorTexture=_;let y=m.particleTexture0;m.particleTexture0=m.particleTexture1,m.particleTexture1=y,f.push([r,l,m,g])}if(0===f.length)return;let p=i.co.now(),m=a.previousDrawTimestamp?.001*(p-a.previousDrawTimestamp):.0167;if(a.previousDrawTimestamp=p,a.hasColorMap()){s.activeTexture.set(l.TEXTURE0+2);let r=a.colorRampTexture;r||(r=a.colorRampTexture=new i.a_(s,a.colorRamp,l.RGBA8)),r.bind(l.LINEAR,l.CLAMP_TO_EDGE)}s.bindFramebuffer.set(a.tileFramebuffer.framebuffer),function(r,n,a){var o;let s=r.context,l=s.gl,u=n.tileFramebuffer;s.activeTexture.set(l.TEXTURE0);let c={u_texture:0,u_opacity:1.05*(o=n.paint.get("raster-particle-fade-opacity-factor"))/(o+.05)},d=r.getOrCreateProgram("rasterParticleTexture",{defines:[],overrideFog:!1});for(let o of a){let[,,a,h]=o;u.colorAttachment0.set(a.targetColorTexture.texture),s.viewport.set([0,0,u.width,u.height]),s.clear({color:i.i.transparent}),h&&(a.backgroundColorTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE),d.draw(r,l.TRIANGLES,tz.disabled,t7.disabled,ie.alphaBlended,tj.disabled,c,n.id,r.viewportBuffer,r.quadTriangleIndexBuffer,r.viewportSegments))}}(r,a,f),function(r,n,a,o){let s=r.context,l=s.gl,u=a.tileFramebuffer,c="globe"===r.transform.projection.name,d=a.paint.get("raster-particle-max-speed");for(let h of o){let[o,f,p]=h;s.activeTexture.set(l.TEXTURE0+0),f.texture.bind(l.LINEAR,l.CLAMP_TO_EDGE),u.colorAttachment0.set(p.targetColorTexture.texture);let m=r.getOrCreateProgram("rasterParticleDraw",{defines:f.defines,overrideFog:!1});s.activeTexture.set(l.TEXTURE0+1);let g=f.scalarData?[]:[0,1,2,3].map(r=>i.ev[r](o));g.push(o);let _=o.canonical.x,y=o.canonical.y;for(let i of g){let s=n.getTile(c?i.wrapped():i);if(!s)continue;let u=s.rasterParticleState;if(!u)continue;let h=i.canonical.x+(1<<i.canonical.z)*(i.wrap-o.wrap),p=i.canonical.y;u.particleTexture0.bind(l.NEAREST,l.CLAMP_TO_EDGE);let g=iD(1,u.particleTexture0.size[0],[h-_,p-y],0,f.texture.size,2,d,f.textureOffset,f.scale,f.offset);m.draw(r,l.POINTS,tz.disabled,t7.disabled,ie.alphaBlended,tj.disabled,g,a.id,u.particleIndexBuffer,void 0,u.particleSegment)}}}(r,n,a,f),s.bindFramebuffer.set(a.particleFramebuffer.framebuffer),function(r,n,a,o){let s=r.context,l=s.gl,u=n.paint.get("raster-particle-max-speed"),c=o*n.paint.get("raster-particle-speed-factor")*.15,d=Math.pow(.01+ +n.paint.get("raster-particle-reset-rate-factor"),6),h=n.particleFramebuffer;for(let o of(s.viewport.set([0,0,h.width,h.height]),a)){let[,a,f]=o;s.activeTexture.set(l.TEXTURE0+0),a.texture.bind(l.LINEAR,l.CLAMP_TO_EDGE),s.activeTexture.set(l.TEXTURE0+1);let p=f.particleTexture0;p.bind(l.NEAREST,l.CLAMP_TO_EDGE);let m=iF(1,p.size[0],0,a.texture.size,u,c,d,a.textureOffset,a.scale,a.offset);h.colorAttachment0.set(f.particleTexture1.texture),s.clear({color:i.i.transparent}),r.getOrCreateProgram("rasterParticleUpdate",{defines:a.defines}).draw(r,l.TRIANGLES,tz.disabled,t7.disabled,ie.unblended,tj.disabled,m,n.id,r.viewportBuffer,r.quadTriangleIndexBuffer,r.viewportSegments)}}(r,a,f,m)}(r,n,a,o),"translucent"===r.renderPass&&(function(r,n,a,o){let s=r.context,l=s.gl,u=n.getSource().tileSize,c=5*(1-i.fq(i.R,i.R+1,r.transform.zoom))*u+a.paint.get("raster-particle-elevation"),d=!r.options.moving,h="globe"===r.transform.projection.name;if(!o.length)return;let[f,p]=r.stencilConfigForOverlap(o),m=[];h&&m.push("PROJECTION_GLOBE_VIEW");let g=r.stencilModeFor3D();for(let o of p){let u,p,_,y,v,x,b,w=o.toUnwrapped(),T=n.getTile(o);if(!T.rasterParticleState)continue;let E=T.rasterParticleState;T.registerFadeDuration(100);let S=n.findLoadedParent(o,0),A=i$(T,S,n,r.transform,100);r.terrain&&r.terrain.prepareDrawTile(),s.activeTexture.set(l.TEXTURE0),E.targetColorTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),s.activeTexture.set(l.TEXTURE1),S&&S.rasterParticleState?(S.rasterParticleState.targetColorTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),u=Math.pow(2,S.tileID.overscaledZ-T.tileID.overscaledZ
110),p=[T.tileID.canonical.x*u%1,T.tileID.canonical.y*u%1]):E.targetColorTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE);let C=h?r.transform.expandedFarZProjMatrix:r.transform.calculateProjMatrix(w,d),I=r.transform,k=function(i){let r=i._nearZ,n=i.projection.farthestPixelDistance(i),a=n-r,o=.2*i.height,s=r+o;return[r,n,(s-o-r)/a,(s-r)/a]}(I),R=i.fF(o.canonical),M=i.cU(R.getCenter().lat);h?(_=Float32Array.from(i.dh(i.dk(o.canonical))),y=Float32Array.from(I.globeMatrix),v=Float32Array.from(i.by(I)),x=[i.ek(I.center.lng),i.el(I.center.lat)],b=Float32Array.from(i.cP(o.canonical,R,M,I.worldSize/I._pixelsPerMercatorPixel))):(_=new Float32Array(16),y=new Float32Array(9),v=new Float32Array(16),x=[0,0],b=new Float32Array(9));let L=iO(C,_,y,v,b,p||[0,0],i.dm(r.transform.zoom),x,k,u||1,A,c),P=r.isTileAffectedByFog(o),O=r.getOrCreateProgram("rasterParticle",{defines:m,overrideFog:P});if(r.uploadCommonUniforms(s,O,w),h){let i=new tz(l.LEQUAL,tz.ReadOnly,r.depthRangeFor3D),n=r.globeSharedBuffers;if(n){let[o,s,u]=n.getGridBuffers(M,!1);O.draw(r,l.TRIANGLES,i,g,ie.alphaBlended,r.renderElevatedRasterBackface?tj.frontCCW:tj.backCCW,L,a.id,o,s,u)}}else{let i=r.depthModeForSublayer(0,tz.ReadOnly),n=f[o.overscaledZ],{tileBoundsBuffer:s,tileBoundsIndexBuffer:u,tileBoundsSegments:c}=r.getTileBoundsBuffers(T);O.draw(r,l.TRIANGLES,i,n,ie.alphaBlended,tj.disabled,L,a.id,s,u,c)}}r.resetStencilClippingMasks()}(r,n,a,o),r.style.map.triggerRepaint())},rB=function(i,r,n){let a=r.getSource();if(!(a instanceof iH&&a.loaded()))return;let o=i.sourceLayer||a.rasterLayerIds&&a.rasterLayerIds[0];if(!o)return;let s=i.paint.get("raster-particle-array-band")||a.getInitialBand(o);if(null!=s)for(let n of r.getIds().map(i=>r.getTileByID(i)))n.updateNeeded(i.id,s)&&a.prepareTile(n,o,i.id,s)},rU=class extends rx{constructor(){super(4.25),this._params={intensity:.5,timeFactor:1,velocityConeAperture:0,velocity:300,boxSize:2500,dropletSizeX:1,dropletSizeYScale:10,distortionStrength:70,screenThinning:{intensity:.57,start:.46,range:1.17,fadePower:.17,affectedRatio:1,particleOffset:-.2},color:{r:.66,g:.68,b:.74,a:.7},direction:{x:-50,y:-35},shapeDirPower:2,shapeNormalPower:1},this._vignetteParams={strength:1,start:.7,range:1,fadePower:.4,color:{r:.27,g:.27,b:.27,a:1}},this.particlesCount=16e3,this._devtoolsFolder=null,this._painter=null}destroy(){super.destroy()}update(r){let n=r.context;if(!this.particlesVx){let r=ry(this.particlesCount),a=new i.aW,o=new i.aT,s=0,l=i.eq(0x134104da55e);for(let i=0;i<r.length;++i){let n=r[i],u=[2*l()-1,l(),l(),l()];a.emplaceBack(n[0],n[1],n[2],-1,-1,...u),a.emplaceBack(n[0],n[1],n[2],1,-1,...u),a.emplaceBack(n[0],n[1],n[2],1,1,...u),a.emplaceBack(n[0],n[1],n[2],-1,1,...u),o.emplaceBack(s+0,s+1,s+2),o.emplaceBack(s+0,s+2,s+3),s+=4}this.particlesVx=n.createVertexBuffer(a,rf.members),this.particlesIdx=n.createIndexBuffer(o)}}getDrawParams(i){if(!i.style.rain)return null;let r=i.style.rain.state,n=structuredClone(this._params);n.intensity=r.density,n.timeFactor=r.intensity,n.color=structuredClone(r.color),n.screenThinning.intensity=r.centerThinning,n.dropletSizeX=r.dropletSize[0],n.dropletSizeYScale=r.dropletSize[1]/r.dropletSize[0],n.distortionStrength=100*r.distortionStrength;let a=structuredClone(this._vignetteParams);return a.strength=1,a.color=structuredClone(r.vignetteColor),{params:n,vignetteParams:a,revealParams:{revealStart:0,revealRange:.01},direction:structuredClone(r.direction)}}draw(r){let n=this.getDrawParams(r);if(!n)return;let{params:a,revealParams:o,direction:s,vignetteParams:l}=n,u=r.transform.zoom;if(o.revealStart>u)return;let c=rv(0,1,o.revealStart,o.revealStart+o.revealRange,u);if(!this.particlesVx||!this.particlesIdx)return;l.strength*=c;let d=this.updateOnRender(r,a.timeFactor),h=r.context,f=h.gl,p=r.transform;this.screenTexture&&this.screenTexture.size[0]===r.width&&this.screenTexture.size[1]===r.height||(this.screenTexture=new i.a_(h,{width:r.width,height:r.height,data:null},f.RGBA8)),a.distortionStrength>0&&(h.activeTexture.set(f.TEXTURE0),this.screenTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),f.copyTexSubImage2D(f.TEXTURE_2D,0,0,0,0,0,r.width,r.height));let m=r.getOrCreateProgram("rainParticle");r.uploadCommonUniforms(h,m),h.activeTexture.set(f.TEXTURE0),this.screenTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE);let g=[a.color.r,a.color.g,a.color.b,a.color.a],_=(n,o)=>{var l;
110let u=r_(this._movement.getPosition(),n),c=a.dropletSizeX,h=a.dropletSizeX*a.dropletSizeYScale,_=r.width/2,y=r.height/2,v=rv(0,a.screenThinning.start,0,1,a.screenThinning.intensity),x=rv(.001,a.screenThinning.range,0,1,a.screenThinning.intensity),b=rv(0,a.screenThinning.particleOffset,0,1,a.screenThinning.intensity),w=(l={modelview:d.modelviewMatrix,projection:d.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:u,velocityConeAperture:a.velocityConeAperture,velocity:a.velocity,boxSize:n,rainDropletSize:[c,h],distortionStrength:a.distortionStrength,rainDirection:s,color:g,screenSize:[p.width,p.height],thinningCenterPos:[_,y],thinningShape:[v,x,Math.pow(10,a.screenThinning.fadePower)],thinningAffectedRatio:a.screenThinning.affectedRatio,thinningParticleOffset:b,shapeDirectionalPower:a.shapeDirPower,shapeNormalPower:a.shapeNormalPower,mode:+!o},{u_modelview:Float32Array.from(l.modelview),u_projection:Float32Array.from(l.projection),u_time:l.time,u_cam_pos:l.camPos,u_texScreen:0,u_velocityConeAperture:l.velocityConeAperture,u_velocity:l.velocity,u_boxSize:l.boxSize,u_rainDropletSize:l.rainDropletSize,u_distortionStrength:l.distortionStrength,u_rainDirection:l.rainDirection,u_color:l.color,u_screenSize:l.screenSize,u_thinningCenterPos:l.thinningCenterPos,u_thinningShape:l.thinningShape,u_thinningAffectedRatio:l.thinningAffectedRatio,u_thinningParticleOffset:l.thinningParticleOffset,u_shapeDirectionalPower:l.shapeDirectionalPower,u_shapeNormalPower:l.shapeNormalPower,u_mode:l.mode}),T=Math.round(a.intensity*this.particlesCount),E=i.aJ.simpleSegment(0,0,4*T,2*T);m.draw(r,f.TRIANGLES,tz.disabled,t7.disabled,ie.alphaBlended,tj.disabled,w,"rain_particles",this.particlesVx,this.particlesIdx,E)};a.distortionStrength>0&&_(a.boxSize,!0),_(a.boxSize,!1),this._vignette.draw(r,l)}},rV=class extends rx{constructor(){super(2.25),this._params={intensity:.85,timeFactor:.75,velocityConeAperture:70,velocity:40,horizontalOscillationRadius:4,horizontalOscillationRate:1.5,boxSize:2e3,billboardSize:2,shapeFadeStart:.27,shapeFadePower:.21,screenThinning:{intensity:.4,start:.15,range:1.4,fadePower:.24,affectedRatio:1,particleOffset:-.2},color:{r:1,g:1,b:1,a:1},direction:{x:-50,y:-35}},this._vignetteParams={strength:.3,start:.78,range:.46,fadePower:.2,color:{r:1,g:1,b:1,a:1}},this.particlesCount=16e3,this._devtoolsFolder=null,this._painter=null}destroy(){super.destroy()}update(r){let n=r.context;if(!this.particlesVx){let r=ry(this.particlesCount),a=new i.aK,o=new i.aT,s=0,l=i.eq(0x134104da55e);for(let i=0;i<r.length;++i){let n=r[i],u=l(),c=l(),d=l(),h=[i/r.length,u,c,d],f=[l(),l()];a.emplaceBack(n[0],n[1],n[2],-1,-1,...h,...f),a.emplaceBack(n[0],n[1],n[2],1,-1,...h,...f),a.emplaceBack(n[0],n[1],n[2],1,1,...h,...f),a.emplaceBack(n[0],n[1],n[2],-1,1,...h,...f),o.emplaceBack(s+0,s+1,s+2),o.emplaceBack(s+0,s+2,s+3),s+=4}this.particlesVx=n.createVertexBuffer(a,rb.members),this.particlesIdx=n.createIndexBuffer(o)}}getDrawParams(i){if(!i.style.snow)return null;let r=i.style.snow.state,n=structuredClone(this._params);n.intensity=r.density,n.timeFactor=r.intensity,n.color=structuredClone(r.color),n.screenThinning.intensity=r.centerThinning,n.billboardSize=2.79*r.flakeSize;let a=structuredClone(this._vignetteParams);return a.strength=1,a.color=structuredClone(r.vignetteColor),{params:n,vignetteParams:a,revealParams:{revealStart:0,revealRange:.01},direction:structuredClone(r.direction)}}draw(r){var n,a;let o,s,l,u,c,d,h,f,p,m=this.getDrawParams(r);if(!m)return;let{params:g,revealParams:_,direction:y,vignetteParams:v}=m,x=r.transform.zoom;if(_.revealStart>x)return;let b=rv(0,1,_.revealStart,_.revealStart+_.revealRange,x);v.strength*=b;let w=this.updateOnRender(r,g.timeFactor);if(!this.particlesVx||!this.particlesIdx)return;let T=r.context,E=T.gl,S=r.transform,A=r.getOrCreateProgram("snowParticle");r.uploadCommonUniforms(T,A),n=g.boxSize,o=r_(this._movement.getPosition(),n),s=S.width/2,l=S.height/2,u=rv(0,g.screenThinning.start,0,1,g.screenThinning.intensity),c=rv(.001,g.screenThinning.range,0,1,g.screenThinning.intensity),d=rv(0,g.screenThinning.particleOffset,0,1,g.screenThinning.intensity),a={modelview:w.modelviewMatrix,projection:w.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:o,velocityConeAperture:g.velocityConeAperture,velocity:g.velocity,horizontalOscillationRadius:g.horizontalOscillationRadius,horizontalOscillationRate:g.horizontalOscillationRate,boxSize:n,billboardSize:+g.billboardSize,simpleShapeParameters:[g.shapeFadeStart,g.shapeFadePower],screenSize:[S.width,S.height],thinningCenterPos:[s,l],thinningShape:[u,c,Math.pow(10,g.screenThinning.fadePower)],thinningAffectedRatio:g.screenThinning.affectedRatio,thinningParticleOffset:d,color:[g.color.r,g.color.g,g.color.b,g.color.a],direction:y},h={u_modelview:Float32Array.from(a.modelview),u_projection:Float32Array.from(a.projection),u_time:a.time,u_cam_pos:a.camPos,u_velocityConeAperture:a.velocityConeAperture,u_velocity:a.velocity,u_horizontalOscillationRadius:a.horizontalOscillationRadius,u_horizontalOscillationRate:a.horizontalOscillationRate,u_boxSize:a.boxSize,u_billboardSize:a.billboardSize,u_simpleShapeParameters:a.simpleShapeParameters,u_screenSize:a.screenSize,u_thinningCenterPos:a.thinningCenterPos,u_thinningShape:a.thinningShape,u_thinningAffectedRatio:a.thinningAffectedRatio,u_thinningParticleOffset:a.thinningParticleOffset,u_particleColor:a.color,u_direction:a.direction},f=Math.round(g.intensity*this.particlesCount),p=i.aJ.simpleSegment(0,0,4*f,2*f),this.particlesVx&&this.particlesIdx&&A.draw(r,E.TRIANGLES,tz.disabled,t7.disabled,ie.alphaBlended,tj.disabled,h,"snow_particles",this.particlesVx,this.particlesIdx,p),this._vignette.draw(r,v)}},rH=rh,rG={building:r=>({u_matrix:new i.bb(r),u_normal_matrix:new i.bb(r),u_opacity:new i.b4(r),u_faux_facade_ao_intensity:new i.b4(r),u_camera_pos:new i.b7(r),u_tile_to_meter:new i.b4(r),u_facade_emissive_chance:new i.b4(r),u_flood_light_color:new i.b7(r),u_flood_light_intensity:new i.b4(r),u_front_cutoff_params:new i.b7(r)}),buildingBloom:r=>({u_matrix:new i.bb(r)}),buildingDepth:r=>({u_matrix:new i.bb(r)}),elevatedStructuresDepth:r=>({u_matrix:new i.bb(r),u_depth_bias:new i.b4(r)}),elevatedStructures:r=>({u_matrix:new i.bb(r),u_ground_shadow_factor:new i.b7(r),u_opacity_multiplier:new i.b4(r)}),elevatedStructuresDepthReconstruct:r=>({u_matrix:new i.bb(r),u_camera_pos:new i.b7(r),u_depth_bias:new i.b4(r),u_height_scale:new i.b4(r),u_reset_depth:new i.b4(r)}),rasterParticle:r=>({u_matrix:new i.bb(r),u_normalize_matrix:new i.bb(r),u_globe_matrix:new i.bb(r),u_merc_matrix:new i.bb(r),u_grid_matrix:new i.ba(r),u_tl_parent:new i.b6(r),u_scale_parent:new i.b4(r),u_fade_t:new i.b4(r),u_opacity:new i.b4(r),u_image0:new i.b5(r),u_image1:new i.b5(r),u_raster_elevation:new i.b4(r),u_zoom_transition:new i.b4(r),u_merc_center:new i.b6(r),u_cutoff_params:new i.b8(r)}),rasterParticleTexture:r=>({u_texture:new i.b5(r),u_opacity:new i.b4(r)}),rasterParticleDraw:r=>({u_particle_texture:new i.b5(r),u_particle_texture_side_len:new i.b4(r),u_tile_offset:new i.b6(r),u_velocity:new i.b5(r),u_color_ramp:new i.b5(r),u_velocity_res:new i.b6(r),u_max_speed:new i.b4(r),u_uv_offset:new i.b6(r),u_data_scale:new i.b6(r),u_data_offset:new i.b4(r),u_particle_pos_scale:new i.b4(r),u_particle_pos_offset:new i.b6(r)}),rasterParticleUpdate:r=>({u_particle_texture:new i.b5(r),u_particle_texture_side_len:new i.b4(r),u_velocity:new i.b5(r),u_velocity_res:new i.b6(r),u_max_speed:new i.b4(r),u_speed_factor:new i.b4(r),u_reset_rate:new i.b4(r),u_rand_seed:new i.b4(r),u_uv_offset:new i.b6(r),u_data_scale:new i.b6(r),u_data_offset:new i.b4(r),u_particle_pos_scale:new i.b4(r),u_particle_pos_offset:new i.b6(r)}),snowParticle:r=>({u_modelview:new i.bb(r),u_projection:new i.bb(r),u_time:new i.b4(r),u_cam_pos:new i.b7(r),u_velocityConeAperture:new i.b4(r),u_velocity:new i.b4(r),u_horizontalOscillationRadius:new i.b4(r),u_horizontalOscillationRate:new i.b4(r),u_boxSize:new i.b4(r),u_billboardSize:new i.b4(r),u_simpleShapeParameters:new i.b6(r),u_screenSize:new i.b6(r),u_thinningCenterPos:new i.b6(r),u_thinningShape:new i.b7(r),u_thinningAffectedRatio:new i.b4(r),u_thinningParticleOffset:new i.b4(r),u_particleColor:new i.b8(r),u_direction:new i.b7(r)}),rainParticle:r=>({u_modelview:new i.bb(r),u_projection:new i.bb(r),u_time:new i.b4(r),u_cam_pos:new i.b7(r),u_texScreen:new i.b5(r),u_velocityConeAperture:new i.b4(r),u_velocity:new i.b4(r),u_boxSize:new i.b4(r),u_rainDropletSize:new i.b6(r),u_distortionStrength:new i.b4(r),u_rainDirection:new i.b7(r),u_color:new i.b8(r),u_screenSize:new i.b6(r),u_thinningCenterPos:new i.b6(r),u_thinningShape:new i.b7(r),u_thinningAffectedRatio:new i.b4(r),u_thinningParticleOffset:new i.b4(r),u_shapeDirectionalPower:new i.b4(r),u_shapeNormalPower:new i.b4(r),u_mode:new i.b4(r)}),vignette:r=>({u_vignetteShape:new i.b7(r),u_vignetteColor:new i.b8(r)})},rq=function(i){let{painter:r,sourceCache:n,layer:a,coords:o,colorMode:s}=i,l=r.context.gl,u=i.painter.shadowRenderer,c=!!u&&u.enabled,d=new tz(r.context.gl.LEQUAL,tz.ReadOnly,r.depthRangeFor3D),h=[0,0,0];if(c){let i=r.style.directionalLight,n=r.style.ambientLight;i&&n&&(h=iv(r.style,i,n))}let f=i=>{for(let f of o){let o,p,m=n.getTile(f),g=m.getBucket(a);if(!g)continue;let _=g.hdExt?g.hdExt.elevatedStructures:void 0;if(!_||(i?(o=_.renderableBridgeSegments,p=_.bridgeProgramConfigurations.get(a.id)):(o=_.renderableTunnelSegments,p=_.tunnelProgramConfigurations.get(a.id)),!o||0===o.segments[0].primitiveLength))continue;p.updatePaintBuffers(),r.prepareDrawTile();let y=r.isTileAffectedByFog(f),v=[];c&&v.push("RENDER_SHADOWS","NORMAL_OFFSET");let x=r.getOrCreateProgram("elevatedStructures",{config:p,overrideFog:y,defines:v}),b=r.translatePosMatrix(f.projMatrix,m,a.paint.get("fill-translate"),a.paint.get("fill-translate-anchor"));c&&u.setupShadows(m.tileID.toUnwrapped(),x,"vector-tile");let w=rT(b,h);r.uploadCommonUniforms(r.context,x,f.toUnwrapped()),x.draw(r,l.TRIANGLES,d,t7.disabled,s,tj.backCCW,w,a.id,_.vertexBuffer,_.indexBuffer,o,a.paint,r.transform.zoom,p,[_.vertexBufferNormal])}};f(!0),f(!1)},r$=function(i){let{painter:r,sourceCache:n,layer:a,coords:o}=i,s=r.context.gl,l=i.painter.shadowRenderer;for(let i of o){let o=n.getTile(i),u=o.getBucket(a);if(!u)continue;let c=u.hdExt?u.hdExt.elevatedStructures:void 0;if(!c||!c.shadowCasterSegments||0===c.shadowCasterSegments.segments[0].primitiveLength)continue;r.prepareDrawTile();let d=u.bufferData.programConfigurations.get(a.id),h=r.isTileAffectedByFog(i),f=r.getOrCreateProgram("elevatedStructuresDepth",{config:d,overrideFog:h}),p=l.calculateShadowPassMatrixFromTile(o.tileID.toUnwrapped());r.uploadCommonUniforms(r.context,f,i.toUnwrapped());let m=rw(p,0);f.draw(r,s.TRIANGLES,l.getShadowPassDepthMode(),t7.disabled,ie.disabled,tj.disabled,m,a.id,c.vertexBuffer,c.indexBuffer,c.shadowCasterSegments,a.paint,r.transform.zoom,d)}}
110,rW=function(r,n,a,o,s){var l;let u;if(!n||!a.layout||"none"===a.layout.get("fill-elevation-reference")||0===a.paint.get("fill-opacity").constantOr(1))return;let c=r.context.gl,d=new tz(r.context.gl.LEQUAL,tz.ReadWrite,r.depthRangeFor3D),h=new tz(r.context.gl.GREATER,tz.ReadWrite,r.depthRangeFor3D),f=(l=r.transform,u=.01,l.isOrthographic&&(u=i.dY(1e-4,u,i.cc(l.pitch>=15?1:l.pitch/15))),2*u),p=r.transform.getFreeCameraOptions().position,m="elevatedStructuresDepthReconstruct",g=r.getOrCreateProgram(m,{defines:["DEPTH_RECONSTRUCTION"]}),_=r.getOrCreateProgram(m);for(let i of o){let o,l,u,m,y=n.getTile(i),v=y.getBucket(a);if(!v||!v.hdExt)continue;let x=v.hdExt.elevatedStructures,b=v.hdExt.elevationBufferData;if(!x||!x.depthSegments||!b)continue;let w=b.heightRange,T=rS(i.toUnwrapped(),p),E=r.translatePosMatrix(i.projMatrix,y,a.paint.get("fill-translate"),a.paint.get("fill-translate-anchor"));if("initialize"===s){if(!w||w.min>=1||0===x.depthSegments.segments[0].primitiveLength)continue;o=rE(E,T,f,1,0),l=d,u=x.depthSegments,m=g}else if("reset"===s){if(!w||w.min>=0||0===x.maskSegments.segments[0].primitiveLength)continue;o=rE(E,T,0,0,1),l=h,u=x.maskSegments,m=g}else if("geometry"===s){if(0===x.depthSegments.segments[0].primitiveLength)continue;o=rE(E,T,f,1,0),l=d,u=x.depthSegments,m=_}m.draw(r,c.TRIANGLES,l,t7.disabled,ie.disabled,tj.disabled,o,a.id,x.vertexBuffer,x.indexBuffer,u,a.paint,r.transform.zoom)}},rY=function(i,r,n,a){if(!r||!n.layout||"none"===n.layout.get("fill-elevation-reference")||0===n.paint.get("fill-opacity").constantOr(1))return;let o=i.context.gl,s=new tz(o.LEQUAL,tz.ReadOnly,i.depthRangeFor3D),l=new t7({func:o.ALWAYS,mask:255},255,255,o.KEEP,o.KEEP,o.REPLACE),u=i.transform.getFreeCameraOptions().position,c=i.getOrCreateProgram("elevatedStructuresDepthReconstruct");for(let d of a){let a=r.getTile(d),h=a.getBucket(n);if(!h)continue;let f=h.hdExt?h.hdExt.elevatedStructures:void 0;if(!f||!f.depthSegments||0===f.depthSegments.segments[0].primitiveLength)continue;let p=rS(d.toUnwrapped(),u),m=rE(i.translatePosMatrix(d.projMatrix,a,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor")),p,0,1,0);c.draw(i,o.TRIANGLES,s,l,ie.disabled,tj.disabled,m,n.id,f.vertexBuffer,f.indexBuffer,f.depthSegments,n.paint,i.transform.zoom)}},rZ=class extends i.y{constructor(r,n=!1){super(),this._style=r,this._buildings={},this._activeFloors=new Set,this._closestBuildingId=null,this._indoorState={selectedFloorId:null,activeFloorsVisible:!0,activeFloors:this._activeFloors},this._buildingDetectionStrategy=new iP,this._initialLoadDone=!1,i.bs(["_updateUI"],this);const a=()=>{this._style.isIndoorEnabled()&&(this._style.map.on("load",()=>{this._initialLoadDone=!0,this._indoorState&&this._indoorState.needsUpdate&&(this._indoorState.needsUpdate=!1,this._style.updateIndoorDependentLayers()),this._updateUI()}),this._style.map.on("move",this._updateUI),this._style.map.on("idle",this._updateUI))};n?(this._initialLoadDone=!0,a()):this._style.on("style.load",a)}destroy(){this._buildings={},this._activeFloors=new Set,this._indoorState=null}selectFloor(i){i===this._selectedFloorId&&this._indoorState&&this._indoorState.activeFloorsVisible||(this._selectedFloorId=i,this._recalculateActiveFloors())}setActiveFloorsVisibility(i){this._updateActiveFloors(i),this._updateIndoorSelector()}setIndoorData(i){let r=!1;for(let[n,a]of Object.entries(i.buildings))if(this._buildings[n])for(let i of a.floorIds)this._buildings[n].floorIds.add(i),this._buildings[n].floors[i]?this._mergeFloors(this._buildings[n].floors[i],a.floors[i]):(this._buildings[n].floors[i]=a.floors[i],r=!0);else this._buildings[n]=a,r=!0;r&&this._recalculateActiveFloors()}getIndoorTileOptions(i,r){return this._indoorState?{sourceLayers:this._style.getIndoorSourceLayers(i,r),indoorState:this._indoorState}:null}getControlState(){let i=this._buildings,r=this._closestBuildingId,n=r&&i?i[r]:void 0;if(!n)return{selectedFloorId:null,activeFloorsVisible:!!this._indoorState&&this._indoorState.activeFloorsVisible,floors:[]};let a=null;for(let i of n.floorIds)if(this._activeFloors&&this._activeFloors.has(i)){a=i;break}let o=Array.from(n.floorIds).map(i=>({id:i,name:n.floors[i].name,zIndex:n.floors[i].zIndex})).sort((i,r)=>r.zIndex-i.zIndex).filter((i,r,n)=>0===r||i.zIndex!==n[r-1].zIndex);
110return{selectedFloorId:a,activeFloorsVisible:!!this._indoorState&&this._indoorState.activeFloorsVisible,floors:o}}_updateUI(){this._initialLoadDone=!0;let i=this._style.map.transform,r=this._buildingDetectionStrategy.findClosestBuilding(this._buildings,i.center,i.zoom,i.getBounds(),this._makeViewportPolygon());if(r!==this._closestBuildingId){let i=this._closestBuildingId;this._closestBuildingId=r,this._onBuildingTransition(i,r),this._updateIndoorSelector()}}_onBuildingTransition(i,r){this._indoorState&&(!r&&i?(this._indoorState.activeFloors=new Set,this._indoorState.activeFloorsVisible=!1,this._style.updateIndoorDependentLayers()):r&&!i&&(this._recalculateActiveFloors(),this._updateActiveFloors(!0)))}_updateIndoorSelector(){this.fire(new i.x("selector-update",this.getControlState()))}_updateActiveFloors(i){this._indoorState={selectedFloorId:this._selectedFloorId,activeFloorsVisible:i,activeFloors:this._activeFloors},this._initialLoadDone?this._style.updateIndoorDependentLayers():this._indoorState.needsUpdate=!0}_recalculateActiveFloors(){if(!this._buildings)return;let r=i.a5.calculate(this._buildings,this._selectedFloorId,this._activeFloors);(function(i,r){if(i===r)return!0;if(!i||!r||i.size!==r.size)return!1;for(let n of i)if(!r.has(n))return!1;return!0})(r,this._activeFloors)||(this._activeFloors=r,this._updateActiveFloors(!!this._indoorState&&this._indoorState.activeFloorsVisible),this._updateIndoorSelector())}_mergeFloors(i,r){r.geometry&&(i.geometry?("Polygon"===i.geometry.type&&(i.geometry={type:"MultiPolygon",coordinates:[i.geometry.coordinates]}),"Polygon"===r.geometry.type?i.geometry.coordinates.push(r.geometry.coordinates):"MultiPolygon"===r.geometry.type&&i.geometry.coordinates.push(...r.geometry.coordinates)):i.geometry=r.geometry)}_makeViewportPolygon(){let r=this._style.map.transform,n=r.width,a=r.height;return[r.pointLocation(new i.au(0,0)),r.pointLocation(new i.au(n,0)),r.pointLocation(new i.au(n,a)),r.pointLocation(new i.au(0,a))].map(r=>new i.au(r.lng,r.lat))}},rK=class{constructor(){this.coverageSourceCaches={},this.manager=new rC}},rX=function(i,r){for(let n in r.manager.clear(),i._mergedHdRoadCoverageSourceCaches){let a=i._mergedHdRoadCoverageSourceCaches[n]._tiles;for(let i in a){let n=a[i];if(!n||!n.loaded())continue;let o=n.frcCoveragePolygons;r.manager.addTileCoverage(n.tileID.canonical,o&&o.length>0?o:[])}}let n=r.manager.updateSnapshotIfNeeded();if(i.map.painter&&(i.map.painter.frcCoverageSnapshot=n.empty()?null:n),!n.empty())for(let r of[i._mergedOtherSourceCaches,i._mergedSymbolSourceCaches])for(let i in r){let n=r[i];for(let i in n._tiles){let r=n._tiles[i];r&&r.hasDeferredRoadStructure&&(r.hasDeferredRoadStructure=!1,n._reloadTile(+i,"reloading"))}}},rQ=function(r,n,a){if("fill"!==a.type||a.sourceLayer!==i.X||n.coverageSourceCaches[a.source])return;let o=r.getOwnSource(a.source);if(!o||"vector"!==o.type)return;let s=`hd-road-coverage:${a.source}`,l=i.ea(s,r.scope),u=r._sourceCaches[s]=new rR(l,o,i.aC.HdRoadCoverage);n.coverageSourceCaches[a.source]=u,u.setMaxzoomOverride(14),u.onAdd(r.map);let c=r._otherSourceCaches[a.source];c&&c._sourceLoaded&&(u._sourceLoaded=!0)},rJ=function(r,n){let a=null,o=null,s={globals:{zoom:0}};r.forEachFragmentStyle(n=>{if(a)return;let l=n.stylesheet?n.stylesheet.schema:null;if(!l||!l.sdCoverageFadeRange)return;let u=i.ea("sdCoverageFadeRange",n.scope),c=n.options?n.options.get(u):void 0,d=c?c.value||c.default:null;if(d){let i=d.evaluate(s);Array.isArray(i)&&2===i.length&&(i[0]>0||i[1]>0)&&(a=[i[0],i[1]])}let h=i.ea("sdCoverageSourceLayers",n.scope),f=n.options?n.options.get(h):void 0,p=f?f.value||f.default:null;if(p){let i=p.evaluate(s);Array.isArray(i)&&i.length>0&&(o=i)}else for(let i of r.stylesheet&&r.stylesheet.imports||[])if(i.id===n.scope){let r=i.config?i.config.sdCoverageSourceLayers:void 0;Array.isArray(r)&&r.length>0&&(o=r);break}}),n.frcCoverageFadeRange=a,n.frcCoverageSourceLayers=null!=a?o||["road","structure"]:[]},r1=class{constructor(){this.tileBuffers=new Map,this._context=null}update(i,r){this._context=i;let n=new Set;for(let a of r){if(0===a.frcMask)continue;let r=!1;for(let i of a.polygons)if(i.hasGeometry()){r=!0;break}if(!r)continue;let o=`${a.tileId.z}/${a.tileId.x}/${a.tileId.y}`;if(n.add(o),!this.tileBuffers.has(o)){let r=this._createBuffers(i,a);r&&this.tileBuffers.set(o,r)}}for(let i of this.tileBuffers.keys())if(!n.has(i)){let r=this.tileBuffers.get(i);for(let i of(r.vertexBuffer.destroy(),r.indexBuffer.destroy(),r.frcLevelSegments))i&&i.destroy();this.tileBuffers.delete(i)}}getBuffers(i){return this.tileBuffers.get(`${i.z}/${i.x}/${i.y}`)||null}destroy(){for(let i of this.tileBuffers.values())for(let r of(i.vertexBuffer.destroy(),i.indexBuffer.destroy(),i.frcLevelSegments))r&&r.destroy();this.tileBuffers.clear()}_createBuffers(r,n){let a=new i.aQ,o=new i.aT,s=[];for(let r of n.polygons){if(!r.hasGeometry()||0===r.rings.length)continue;let n=a.length,l=o.length,u=a.length,c=[],d=[],h=0;for(let i=0;i<r.rings.length;i++){let n=r.rings[i];if(!(n.length<3))for(let r of(i>0&&d.push(h),n))a.emplaceBack(r.x,r.y),c.push(r.x,r.y),h++}let f=i.c8(c,d.length>0?d:void 0);for(let i=0;i<f.length;i+=3)o.emplaceBack(u+f[i],u+f[i+1],u+f[i+2]);s.push({vertexOffset:n,indexOffset:l,vertexCount:a.length-n,indexCount:o.length-l,frcMask:r.frcMask})}if(0===a.length)return null;let l=Array(9).fill(null);for(let r=0;r<9;++r){let a=1<<r;if(0==(n.frcMask&a))continue;let o=1/0,u=0,c=0,d=!1;for(let i of s)0!=(i.frcMask&a)&&(o=Math.min(o,i.indexOffset),u=Math.max(u,i.indexOffset+i.indexCount),c=Math.max(c,i.vertexOffset+i.vertexCount),d=!0);d&&(l[r]=i.aJ.simpleSegment(0,o,c,u-o))}return{vertexBuffer:r.createVertexBuffer(a,i.eQ.members),indexBuffer:r.createIndexBuffer(o),frcLevelSegments:l}}},r0=function(i){let{painter:r,bucket:n,coord:a,elevatedGeometry:o}=i,s="road"===n.sourceLayerName,l="structure"===n.sourceLayerName;if(!s&&!l||!r.frcCoverageSnapshot||o)return"fallthrough";let u=r.frcCoverageSnapshot.getTileOrParent(a.canonical);if(!u||0===u.frcMask)return"fallthrough";
110let c=n.hdExt&&n.hdExt.frcData,d=!!c&&!c.empty(),h=rF(u.polygons);if(l&&!h)return"skip";if(l&&h)return i.polygonCoverageTiles.push({coord:i.coord,bufferData:i.bufferData,program:i.program,programConfiguration:i.programConfiguration,uniformValues:i.uniformValues,depthMode:i.depthMode,dynamicBuffers:i.dynamicBuffers,indexBuffer:i.indexBuffer,segments:i.segments,frcMask:u.frcMask}),"deferred";if(s&&d&&c){let n=u.frcMask,a=r.transform.zoom;for(let[o,s]of c.frcPerLevel)n&1<<o||0!==s.segments.length&&i.program.draw(r,i.drawMode,i.depthMode,i.stencilMode,i.colorMode,tj.disabled,i.uniformValues,i.layer.id,i.bufferData.layoutVertexBuffer,i.indexBuffer,s,i.layer.paint,a,i.programConfiguration,i.dynamicBuffers);return c.frcNonRoadSegments.segments.length>0&&i.program.draw(r,i.drawMode,i.depthMode,i.stencilMode,i.colorMode,tj.disabled,i.uniformValues,i.layer.id,i.bufferData.layoutVertexBuffer,i.indexBuffer,c.frcNonRoadSegments,i.layer.paint,a,i.programConfiguration,i.dynamicBuffers),"drawn"}return"fallthrough"},r2=function(i,r,n,a,o){if(0===n.length)return;let s=rN(i),l=i.transform.zoom,u=(n,s,u)=>{1!==u&&(n.uniformValues.u_opacity_multiplier=u),n.program.draw(i,a,n.depthMode,s,o,tj.disabled,n.uniformValues,r.id,n.bufferData.layoutVertexBuffer,n.indexBuffer,n.segments,r.paint,l,n.programConfiguration,n.dynamicBuffers),1!==u&&(n.uniformValues.u_opacity_multiplier=1)};rD(i,n,s,(i,r,n)=>u(i,n,1),(i,r,n)=>u(i,n,s))},r5=function(i,r,n,a,o,s,l,u,c,d){let h=r.hdExt&&r.hdExt.frcData;if(!h||0===h.frcPerLevel.size||!i.frcCoverageSnapshot||a)return null;let f=i.frcCoverageSnapshot.getTileOrParent(n.canonical);if(!f||0===f.frcMask)return null;let p=rF(f.polygons),m=i.frcCoverageFadeRange,g=null!=m&&i.transform.zoom>=m[0];if(p&&g){let i=!1;for(let r of h.frcPerLevel.keys())if(f.frcMask&1<<r){i=!0;break}i&&d.push({coord:n,bucket:r,uniformValues:o,programConfiguration:s,program:l,depthMode:u,colorMode:c,frcMask:f.frcMask})}return{coverageTile:f,frcMask:f.frcMask,active:g,hasPolygonGeometry:p}},r4=function(i,r,n,a){let o=i.hdExt&&i.hdExt.frcData;if(!o)return;let s=r.frcMask;for(let[i,r]of o.frcPerLevel)s&1<<i||a(n,r);let l=o.frcNonRoadSegments;l.segments.length>0&&a(n,l)},r9=function(i,r,n,a,o,s,l){if(a.hasPolygonGeometry)return;let u=r.hdExt&&r.hdExt.frcData;if(!u||!i.frcCoverageFadeRange)return;let[c,d]=i.frcCoverageFadeRange;if(c>=d)return;let h=1-Math.max(0,Math.min(1,(i.transform.zoom-c)/(d-c)));if(h<=0)return;let f=o?s:i.stencilModeForClipping(n),p=a.frcMask;for(let[i,r]of u.frcPerLevel)p&1<<i&&l(f,r,h)},r3=function(i,r,n){if(0===n.length)return;let a=i.context.gl,o=rN(i),s=i.transform.zoom,l=(n,o,l,u)=>{let c=n.bucket.hdExt&&n.bucket.hdExt.frcData,d=c&&c.frcPerLevel.get(o);d&&0!==d.segments.length&&(1!==u&&(n.uniformValues.u_opacity_multiplier=u),n.program.draw(i,a.TRIANGLES,n.depthMode,l,n.colorMode,tj.disabled,n.uniformValues,r.id,n.bucket.layoutVertexBuffer,n.bucket.indexBuffer,d,r.paint,s,n.programConfiguration,[n.bucket.layoutVertexBuffer2,n.bucket.patternVertexBuffer,n.bucket.zOffsetVertexBuffer,n.bucket.elevationIdColVertexBuffer,n.bucket.elevationGroundScaleVertexBuffer]),1!==u&&(n.uniformValues.u_opacity_multiplier=1))};rD(i,n,o,(i,r,n)=>l(i,r,n,1),(i,r,n)=>l(i,r,n,o))};async function r8(){return Promise.resolve()}let r6=new Float32Array(i.dq([])),r7=(r,n,a,o,s,l,u,c,d,h,f,p,m,g=[0,0,0],_,y,v,x=1)=>{let b=s.style.light,w=b.properties.get("position"),T=[-w.x,-w.y,w.z],E=i.bV();"viewport"===b.properties.get("anchor")&&(i.cu(E,-s.transform.angle),i.fK(T,T,E));let S="MASK"===f.alphaMode,A=b.properties.get("color").toNonPremultipliedRenderColor(null),C=m.paint.get("model-ambient-occlusion-intensity"),I=m.paint.get("model-color").constantOr(i.i.white).toNonPremultipliedRenderColor(null);return I.a=m.paint.get("model-color-mix-intensity").constantOr(0),v&&(I.r=v[0],I.g=v[1],I.b=v[2],I.a=v[3]),y&&(I.r=y.color.r,I.g=y.color.g,I.b=y.color.b,I.a=y.colorMix,p=y.emissionStrength,l*=y.opacity),{u_matrix:r,u_lighting_matrix:n,u_normal_matrix:a,u_node_matrix:o||r6,u_lightpos:T,u_lightintensity:b.properties.get("intensity"),u_lightcolor:[A.r,A.g,A.b],u_camera_pos:g,u_opacity:l,u_baseTextureIsAlpha:0,u_alphaMask:+S,u_alphaCutoff:f.alphaCutoff,u_baseColorFactor:u.toNonPremultipliedRenderColor(null).toArray01(),u_emissiveFactor:c.toNonPremultipliedRenderColor(null).toArray01(),u_metallicFactor:d,u_roughnessFactor:h,u_baseColorTexture:5,u_metallicRoughnessTexture:6,u_normalTexture:7,u_occlusionTexture:8,u_emissionTexture:9,u_lutTexture:10,u_color_mix:I.toArray01(),u_aoIntensity:C,u_emissive_strength:p,u_occlusionTextureTransform:_||[0,0,0,0],u_dithered_discard_threshold:x}},ne=(i,r=r6,n=r6)=>({u_matrix:i,u_instance:r,u_node_matrix:n}),nt=(i,r,n=1)=>({u_matrix:i,u_color:r,u_overlay:0,u_overlay_scale:n}),ni=new Float64Array(16),nr=new Float64Array(16),nn=new Float64Array(16),na=new Float64Array(16),no=new Float64Array(16),ns=new Float64Array(16),nl=new Float64Array(16),nu=[0,0,0],nc=new Float32Array(16),nd=[0,0,0],nh=[0,0,0],nf=[];function np(r,n,a){let o=a.cameraWorldSizeForFog/a.worldSize;return i.fc(r,a.worldToFogMatrix,[o,o,1]),i.er(r,r,n),r}function nm(r,n,a,o){return i.fQ(r,n,a),i.cm(o,i.n)||i.fc(r,r,o),r}function ng(r,n,a,o,s){let l=a.material,u=o.context,{baseColorTexture:c,metallicRoughnessTexture:d}=l.pbrMetallicRoughness,{normalTexture:h,occlusionTexture:f,emissionTexture:p}=l;function m(i,n,a){if(i&&(r.push(n),u.activeTexture.set(u.gl.TEXTURE0+a),i.gfxTexture)){let{minFilter:r,magFilter:n,wrapS:a,wrapT:
110o}=i.sampler;i.gfxTexture.bindExtraParam(r,n,a,o)}}m(c,"HAS_TEXTURE_u_baseColorTexture",5),m(d,"HAS_TEXTURE_u_metallicRoughnessTexture",6),m(h,"HAS_TEXTURE_u_normalTexture",7),m(f,"HAS_TEXTURE_u_occlusionTexture",8),m(p,"HAS_TEXTURE_u_emissionTexture",9),s&&(s.texture||(s.texture=new i.a$(o.context,s.image,[s.image.height,s.image.height,s.image.height],u.gl.RGBA8)),u.activeTexture.set(u.gl.TEXTURE0+10),s.texture&&s.texture.bind(u.gl.LINEAR,u.gl.CLAMP_TO_EDGE),r.push("APPLY_LUT_ON_GPU")),a.texcoordBuffer&&(r.push("HAS_ATTRIBUTE_a_uv_2f"),n.push(a.texcoordBuffer)),a.colorBuffer&&(r.push(12===a.colorBuffer.itemSize?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),n.push(a.colorBuffer)),a.normalBuffer&&(r.push("HAS_ATTRIBUTE_a_normal_3f"),n.push(a.normalBuffer)),a.pbrBuffer&&(r.push("HAS_ATTRIBUTE_a_pbr"),r.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),n.push(a.pbrBuffer)),"OPAQUE"!==l.alphaMode&&"MASK"!==l.alphaMode||r.push("UNPREMULT_TEXTURE_IN_SHADER"),l.defined||r.push("DIFFUSE_SHADED");let g=o.shadowRenderer;g&&(r.push("RENDER_SHADOWS"),g.useNormalOffset&&r.push("NORMAL_OFFSET"))}function n_(r,n,a,o,s,l){let u=r.modelOpacity,c=n.context,d=new tz(n.context.gl.LEQUAL,r.isLightMesh?tz.ReadOnly:tz.ReadWrite,n.depthRangeFor3D),h=n.transform,f=r.mesh,p=f.material,m=p.pbrMetallicRoughness,g=n.style.fog;"pixels"===n.transform.projection.zAxisUnit?ni.set(r.nodeModelMatrix):i.er(ni,o.zScaleMatrix,r.nodeModelMatrix),i.er(ni,o.negCameraPosMatrix,ni),i.dr(nr,ni),i.fR(nr,nr);let _="none"===a.paint.get("model-color-use-theme").constantOr("default"),y=a.paint.get("model-emissive-strength").constantOr(0),v=r7(r.worldViewProjection,ni,nr,null,n,u,m.baseColorFactor,p.emissiveFactor,m.metallicFactor,m.roughnessFactor,p,y,a,void 0,void 0,r.materialOverride,r.modelColor),x={defines:[]},b=[],w=n.shadowRenderer;w&&(w.useNormalOffset=!1),ng(x.defines,b,f,n,_?null:a.lut);let T=null;if(g&&(T=np(nn,r.nodeModelMatrix,n.transform),"globe"!==h.projection.name)){let i=f.aabb.min,r=f.aabb.max,[n,a]=g.getOpacityForBounds(T,i[0],i[1],r[0],r[1]);x.overrideFog=n>=.05||a>=.05}let E=t6(n,a.paint.get("model-cutoff-fade-range"));E.shouldRenderCutoff&&x.defines.push("RENDER_CUTOFF");let S=n.getOrCreateProgram("model",x);n.uploadCommonUniforms(c,S,null,T,E),"shadow"!==n.renderPass&&w&&w.setupShadowsFromMatrix(r.nodeModelMatrix,S),S.draw(n,c.gl.TRIANGLES,d,s,l,f.material.doubleSided?tj.disabled:tj.backCCW,v,a.id,f.vertexBuffer,f.indexBuffer,f.segments,a.paint,n.transform.zoom,void 0,b)}function ny(i,r){return i.style._importedAsBasemap?"basemap":r.scope}function nv(r,n,a,o,s,l,u,c,d,h){let f=r.transform,p=!!n.isGeometryBloom&&n.isGeometryBloom;if(void 0!==n.minZoom&&r.transform.zoom<n.minZoom||void 0!==n.maxZoom&&r.transform.zoom>n.maxZoom||p&&"shadow"===r.renderPass)return;let m="globe"===f.projection.name?i.bR(a,f):[...a];i.er(m,m,n.globalMatrix);let g=i.er([],o,m);if(n.meshes)for(let r of n.meshes){let o=c.get(r.material.name);if(o&&o.opacity<=0)continue;if("BLEND"!==r.material.alphaMode){u.push({mesh:r,depth:0,modelIndex:s,worldViewProjection:g,nodeModelMatrix:m,isLightMesh:p,materialOverride:o,modelOpacity:d,modelColor:h,node:n,modelMatrix:a});continue}let _=i.fL([],r.centroid,g);!f.isOrthographic&&_[2]<=0||l.push({mesh:r,depth:_[2],modelIndex:s,worldViewProjection:g,nodeModelMatrix:m,isLightMesh:p,materialOverride:o,modelOpacity:d,modelColor:h,node:n,modelMatrix:a})}if(n.children)for(let i of n.children)nv(r,i,a,o,s,l,u,c,d,h)}function nx(i,r,n,a,o){let s=n.shadowRenderer;if(!s)return;let l=s.getShadowPassDepthMode(),u=ne(o||s.calculateShadowPassMatrixFromMatrix(r));n.getOrCreateProgram("modelDepth").draw(n,n.context.gl.TRIANGLES,l,t7.disabled,ie.disabled,tj.disabled,u,a.id,i.vertexBuffer,i.indexBuffer,i.segments,a.paint,n.transform.zoom,void 0,void 0)}function nb(r,n,a,o){let s=function(r,n){let a;if(n.footprintDebugMesh)return n.footprintDebugMesh;if(!n.footprint)return null;let o=r.context,s=n.footprint.vertices,l=n.footprint.indices,u=new i.aQ;for(let i of(u.reserve(s.length),s))u.emplaceBack(i.x,i.y);let c=new i.aT;c.reserve(l.length);for(let i=0;i<l.length;i+=3)c.emplaceBack(l[i],l[i+1],l[i+2]);let d=o.createVertexBuffer(u,i.eQ.members),h=o.createIndexBuffer(c),f=i.aJ.simpleSegment(0,0,s.length,l.length),p=n.id||n.name||"footprint",m=parseInt(p,10);a=isNaN(m)?function(i){let r=0;for(let n=0;n<i.length;n++)r=(r<<5)-r+i.charCodeAt(n)|0;return r}(p):m;let g=i.cg(a),_=i.cg(a+1),y=i.cg(a+2);return n.footprintDebugMesh={vertexBuffer:d,indexBuffer:h,segments:f,color:new i.i(g,_,y,.5)},n.footprintDebugMesh}(r,a);if(!s)return;let l=r.context,u=l.gl,c=r.getOrCreateProgram("debug"),d=s.color,h=tz.disabled;l.activeTexture.set(u.TEXTURE0),r.emptyTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),c.draw(r,u.TRIANGLES,h,t7.disabled,ie.alphaBlended,tj.disabled,nt(o,d.toPremultipliedRenderColor(null)),"$debug",s.vertexBuffer,s.indexBuffer,s.segments)}function nw(i,r,n,a,o){let s=!1;for(let n of a)1!==n.modelOpacity&&(n_(n,i,r,o[n.modelIndex],t7.disabled,ie.disabled),s=!0);for(let n of a)n_(n,i,r,o[n.modelIndex],1!==n.modelOpacity?i.stencilModeFor3D():t7.disabled,i.colorModeForRenderPass());s&&i.resetStencilClippingMasks();let l=ie.additive;for(let a of n)n_(a,i,r,o[a.modelIndex],t7.disabled,a.isLightMesh?l:i.colorModeForRenderPass())}let nT={shadowUniformsInitialized:!1,useSingleShadowCascade:!1,tileMatrix:new Float64Array(16),shadowTileMatrix:new Float32Array(16),aabb:new i.A([0,0,0],[i.r,i.r,0])},nE={drawModels:function(r,n,a,o){if("opaque"===r.renderPass)return;let s=a.paint.get("model-opacity").constantOr(1),l=a.paint.get("model-elevation-reference"),u="ground"===l,c="ground"===l;if(0===s)return;let d=a.paint.get("model-cast-shadows");
110if("shadow"===r.renderPass&&(!d||r.terrain&&s<.65&&a._transitionablePaint._values["model-opacity"].value.expression instanceof i.bh))return;let h=r.shadowRenderer,f=a.paint.get("model-receive-shadows");h&&(h.useNormalOffset=!0,f||(h.enabled=!1));let p=()=>{h&&(h.useNormalOffset=!0,f||(h.enabled=!0))},m=n.getSource();if("light-beam"===r.renderPass&&"batched-model"!==m.type)return;if("vector"===m.type||"geojson"===m.type)return function(r,n,a,o,s){let l=r.transform,u="globe"===l.projection.name,c=l.getFreeCameraOptions().position;if(!r.modelManager)return;let d=r.modelManager;a.modelManager=d;let h=r.shadowRenderer;if(!Object.hasOwn(a._unevaluatedLayout._values,"model-id"))return;let f=a._unevaluatedLayout._values["model-id"],p=Object.assign({},a.layout.get("model-id").parameters),m=r.style.order.indexOf(a.fqid),g=a.paint.get("model-opacity").constantOr(1);for(let _ of o){let o=n.getTile(_).getBucket(a);if(!o||o.projection.name!==l.projection.name)continue;let y=o.getModelUris();(y&&!o.modelsRequested&&(d.addModelsFromBucket(y,s),o.modelsRequested=!0),u)?p.zoom=_.overscaledZ:p.zoom=function(r,n){let a=1<<r.canonical.z,o=n.getFreeCameraOptions().position,s=n.elevation,l=r.canonical.x/a,u=(r.canonical.x+1)/a,c=r.canonical.y/a,d=(r.canonical.y+1)/a,h=n._centerAltitude;if(s){let i=s.getMinMaxForTile(r);i&&i.max>h&&(h=i.max)}let f=i.bG(o.x,l,u)-o.x,p=i.bG(o.y,c,d)-o.y,m=i.em(h,n.center.lat)-o.z;return n._zoomFromMercatorZ(Math.sqrt(f*f+p*p+m*m))}(_,l);let v=f.possiblyEvaluate(p);if(function(r,n,a){let o=n.updateZoomBasedPaintProperties(),s=function(r,n,a){let o,s,l,u=r.terrain?r.terrain.exaggeration():0;if(r.terrain&&u>0){let n=r.terrain,s=n.findDEMTileFor(a);s&&s.dem?o=i.k.create(n,a,s):u=0}if(0===u&&(n.terrainElevationMin=0,n.terrainElevationMax=0),u===n.validForExaggeration&&(0===u||o&&o._demTile&&o._demTile.tileID===n.validForDEMTile.id&&o._dem._timestamp===n.validForDEMTile.timestamp))return!1;for(let i in n.instancesPerModel){let r=n.instancesPerModel[i];for(let i=0;i<r.instancedDataArray.length;++i){let a=(o?u*o.getElevationAt(0|r.instancedDataArray.float32[16*i],0|r.instancedDataArray.float32[16*i+1],!0,!0):0)+r.instancesEvaluatedElevation[i];r.instancedDataArray.float32[16*i+6]=a,s=s?Math.min(n.terrainElevationMin,a):a,l=l?Math.max(n.terrainElevationMax,a):a}}return n.terrainElevationMin=s||0,n.terrainElevationMax=l||0,n.validForExaggeration=u,n.validForDEMTile=o&&o._demTile?{id:o._demTile.tileID,timestamp:o._dem._timestamp}:{id:void 0,timestamp:0},!0}(r,n,a);(o||s)&&(n.uploaded=!1,n.upload(r.context))}(r,o,_),nT.shadowUniformsInitialized=!1,nT.useSingleShadowCascade=!!h&&0===h.getMaxCascadeForTile(_.toUnwrapped()),"shadow"===r.renderPass&&h){if(1===r.currentShadowCascade&&o.isInsideFirstShadowMapFrustum)continue;let n=l.calculatePosMatrix(_.toUnwrapped(),l.worldSize);if(nT.tileMatrix.set(n),nT.shadowTileMatrix.set(h.calculateShadowPassMatrixFromMatrix(n)),nT.aabb.min=[0,0,0],nT.aabb.max[0]=nT.aabb.max[1]=i.r,nT.aabb.max[2]=0,function(r,n,a,o){if(!a.modelManager)return!0;let s=a.modelManager;if(!a.shadowRenderer)return!0;let l=a.shadowRenderer,u=n.aabb,c=!0,d=r.maxHeight;if(0===d){let i=0;for(let n in r.instancesPerModel){let r=s.getModel(n,o);r?i=Math.max(i,Math.max(Math.max(r.aabb.max[0],r.aabb.max[1]),r.aabb.max[2])):c=!1}d=r.maxScale*i*1.41+r.maxVerticalOffset,c&&(r.maxHeight=d)}u.max[2]=d,u.min[2]+=r.terrainElevationMin,u.max[2]+=r.terrainElevationMax,i.fL(u.min,u.min,n.tileMatrix),i.fL(u.max,u.max,n.tileMatrix);let h=u.intersects(l.getCurrentCascadeFrustum());return 0===a.currentShadowCascade&&(r.isInsideFirstShadowMapFrustum=2===h),0===h}(o,nT,r,a.scope))continue}let x=1<<_.canonical.z,b=[((c.x-_.wrap)*x-_.canonical.x)*i.r,(c.y*x-_.canonical.y)*i.r,c.z*x*i.r];r.conflationActive&&Object.keys(o.instancesPerModel).length>0&&r.style.isLayerClipped(a,n.getSource())&&o.updateReplacement(_,r.replacementSource,m,a.scope)&&(o.uploaded=!1,o.upload(r.context));let w=0,T=[],E=[],S=[];for(let n in o.instancesPerModel){let l=o.instancesPerModel[n];l.features.length>0&&!u&&(n=v.evaluate(l.features[0].feature,{}));let h=d.getModel(n,s);if(h||d.hasURLBeenRequested(n)||o.modelUris.includes(n)||(o.modelUris.push(n),o.modelsRequested=!1),h&&h.uploaded)if(u){let n=i.fa([],[c.x,c.y,c.z],r.transform.worldSize);i.eu(n,n);for(let a=0;a<l.instancedDataArray.length;++a){let s=[0,0,0],u=[1,1,1],c=i.bW(),d=l.tileCoordinatesForInstance(a),f=l.transformForInstance(a);i.d7(u,f),i.d5(c,f),i.cH(s,c);let p=l.translationForInstance(a),m=new i.ab(0,0);i.fG(o.canonical,m,d.x,d.y);let _=i.bT();i.bA(_,h,r.transform,m,s,u,p,!0,!1,!1);let y=l.colorForInstance(a),v=i.cw([],n),x=i.cX(m.lat,r.transform.zoom),b=i.cv([],[1,1,1/x]);for(let i of(S.push({zScaleMatrix:b,negCameraPosMatrix:v}),h.nodes))nv(r,i,_,r.transform.expandedFarZProjMatrix,w,T,E,h.materialOverrides,g,y);++w}}else for(let i of h.nodes)!function i(r,n,a,o,s,l,u){let c=r.context,d="shadow"===r.renderPass,h=r.shadowRenderer,f=
110d&&h?h.getShadowPassDepthMode():new tz(c.gl.LEQUAL,tz.ReadWrite,r.depthRangeFor3D),p=r.isTileAffectedByFog(l),m="globe"===r.transform.projection.name;if(a.meshes)for(let i of a.meshes){let g,_,y,v=m?[]:["MODEL_POSITION_ON_GPU"],x=[],b=!m&&o.instancedDataArray.length>20;b&&v.push("INSTANCED_ARRAYS");let w=t6(r,n.paint.get("model-cutoff-fade-range"));if(w.shouldRenderCutoff&&v.push("RENDER_CUTOFF"),d&&h)g=r.getOrCreateProgram("modelDepth",{defines:v}),_=ne(u.shadowTileMatrix,u.shadowTileMatrix,a.globalMatrix),y=ie.disabled;else{ng(v,x,i,r,"none"===n.paint.get("model-color-use-theme").constantOr("default")?null:n.lut),g=r.getOrCreateProgram("model",{defines:v,overrideFog:p});let o=i.material,d=o.pbrMetallicRoughness,f=n.paint.get("model-opacity").constantOr(1),m=n.paint.get("model-emissive-strength").constantOr(0);_=r7(l.expandedProjMatrix,a.globalMatrix,nc,null,r,f,d.baseColorFactor,o.emissiveFactor,d.metallicFactor,d.roughnessFactor,o,m,n,s),h&&(u.shadowUniformsInitialized?g.setShadowUniformValues(c,h.getShadowUniformValues()):(h.setupShadows(l.toUnwrapped(),g,"model-tile"),u.shadowUniformsInitialized=!0)),y=w.shouldRenderCutoff||f<1||"OPAQUE"!==o.alphaMode?ie.alphaBlended:ie.unblended}r.uploadCommonUniforms(c,g,l.toUnwrapped(),null,w);let T=i.material.doubleSided?tj.disabled:tj.backCCW;if(b)x.push(o.instancedDataBuffer),g.draw(r,c.gl.TRIANGLES,f,t7.disabled,y,T,_,n.id,i.vertexBuffer,i.indexBuffer,i.segments,n.paint,r.transform.zoom,void 0,x,o.instancedDataArray.length);else{let a=d?"u_instance":"u_normal_matrix";for(let s=0;s<o.instancedDataArray.length;++s)_[a]=new Float32Array(o.instancedDataArray.arrayBuffer,64*s,16),g.draw(r,c.gl.TRIANGLES,f,t7.disabled,y,T,_,n.id,i.vertexBuffer,i.indexBuffer,i.segments,n.paint,r.transform.zoom,void 0,x)}}if(a.children)for(let c of a.children)i(r,n,c,o,s,l,u)}(r,a,i,l,b,_,nT)}if(u)if("shadow"===r.renderPass){for(let i of E)nx(i.mesh,i.nodeModelMatrix,r,a);for(let i of T)nx(i.mesh,i.nodeModelMatrix,r,a)}else nw(r,a,T,E,S)}}(r,n,a,o,ny(r,a)),void p();if(!m.loaded())return;if("batched-model"===m.type)return function(r,n,a,o){a.resetLayerRenderingStats(r);let s=r.context,l=r.transform,u=r.style.fog,c=r.shadowRenderer;if("mercator"!==l.projection.name)return i.f_(`Drawing 3D landmark models for ${l.projection.name} projection is not yet implemented`);let d=r.transform.getFreeCameraOptions().position,h=i.fa([],[d.x,d.y,d.z],r.transform.worldSize),f=i.eu([],h),p=i.cw([],f),m=i.cX(l.center.lat,l.zoom),g=i.cv([],[1,1,1/m]),_=i.er([],p,g),y=a.paint.get("model-opacity").constantOr(1),v=new tz(s.gl.LEQUAL,tz.ReadWrite,r.depthRangeFor3D),x=new tz(s.gl.LEQUAL,tz.ReadOnly,r.depthRangeFor3D),b=new i.A([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),w="shadow"===r.renderPass,T="light-beam"===r.renderPass,E="none"===a.paint.get("model-color-use-theme").constantOr("default"),S=w&&c?c.getCurrentCascadeFrustum():l.getFrustum(l.scaleZoom(l.worldSize)),A=a.paint.get("model-front-cutoff"),C=A[2]<1,I=t6(r,a.paint.get("model-cutoff-fade-range")),k=a.getLayerRenderingStats();(function(i,r,n,a){let o=i.terrain?i.terrain.exaggeration():0,s=i.transform.zoom;for(let l of a){let a=r.getTile(l).getBucket(n);a&&(a.setFilter(n.filter),i.conflationActive&&a.updateReplacement(l,i.replacementSource),a.evaluateTransform(i,n),i.terrain&&o>0&&a.elevationUpdate(i.terrain,o,l,n.source),a.needsReEvaluation(i,s,n)&&a.evaluate(n))}})(r,n,a,o),function(){let d,f,p,g=new Map;C?(d=o.length-1,f=-1,p=-1):(d=0,f=o.length,p=1);let R=i.bU(),M=new i.au(0,0);for(let L=d;L!==f;L+=p){let d=o[L],f=n.getTile(d).getBucket(a);if(!f||!f.uploaded)continue;let p=!1;c&&(p=0===c.getMaxCascadeForTile(d.toUnwrapped()));let P=l.calculatePosMatrix(d.toUnwrapped(),l.worldSize),O=!!(f.modelTraits&i.aj.HasMapboxMeshFeatures);i.er(na,_,P),i.er(no,l.expandedFarZProjMatrix,P),i.dr(ns,na),i.fR(ns,ns);let D=!w&&c&&c.enabled?c.computeCascadeTileMatrices(P):null;!w&&C&&(i.dr(nr,P),i.fL(R,h,nr),M.x=R[0],M.y=R[1]);let F=[];for(let n of(f.setFilter(a.filter),f.getNodesInfo())){if(n.hiddenByReplacement||!n.node.meshes)continue;let a=n.node,o=0;r.terrain&&a.elevation&&(o=a.elevation*r.terrain.exaggeration());let s=(()=>{let r=n.aabb,a=b.min,s=b.max;return a[0]=r.min[0],a[1]=r.min[1],a[2]=r.min[2]+o,s[0]=r.max[0],s[1]=r.max[1],s[2]=r.max[2]+o,i.fL(a,a,P),i.fL(s,s,P),b})(),u=n.evaluatedScale;if(u[0]<=1&&u[1]<=1&&u[2]<=1&&0===s.intersects(S))continue;if(!w){let a=s.min,o=s.max;nd[0]=.5*(a[0]+o[0]),nd[1]=.5*(a[1]+o[1]),nd[2]=.5*(a[2]+o[2]),function(r,n,a,o,s){let l=r.node;if(l.lodMeshes&&l.lodMeshes.length>0)if(r.targetLod<0)r.targetLod=+(n>o);else{let l=s>0?a/1e3/s:1;r.targetLod=i.bG(n>o?r.targetLod+l:r.targetLod-l,0,1)}else r.targetLod=0}(n,i.c5(h,nd)*m,Math.min(r._debugParams.dt,1e3/30),r._debugParams.lodSwitchDistance,r._debugParams.lodSwitchFadeDuration)}if(!w&&C){let r=1/6;n.cameraCollisionOpacity=h[0]>s.min[0]&&h[0]<s.max[0]&&h[1]>s.min[1]&&h[1]<s.max[1]&&h[2]*m<s.max[2]&&a.footprint&&i.eI(M,a.footprint)?Math.max(n.cameraCollisionOpacity-r,0):Math.min(1,n.cameraCollisionOpacity+r)}
110let c=1/i.fH(d.canonical),f=a.anchor?a.anchor[0]:0,p=a.anchor?a.anchor[1]:0,g=[f*(u[0]-1)+n.evaluatedTranslation[0]*c,p*(u[1]-1)+n.evaluatedTranslation[1]*c,o+n.evaluatedTranslation[2]],_=nm(new Float64Array(16),P,g,u),v=i.er([],_,a.globalMatrix),x=i.er([],l.expandedFarZProjMatrix,v),T=x[2]*f+x[6]*p+x[10]*o+x[14];a.hidden=!1;let E=y;w||(C&&(E*=n.cameraCollisionOpacity*function(r,n,a,o){if(n.pitch<20)return 1;let s=n.getWorldToCameraMatrix();i.er(s,s,r);let l=i.cy(a.min[0],a.min[1],a.min[2],1),u=i.fM(i.bX(),l,s),c=u,d=u;l[1]=a.max[1],c=(u=i.fM(i.bX(),l,s))[1]<c[1]?u:c,d=u[1]>d[1]?u:d,l[0]=a.max[0],c=(u=i.fM(i.bX(),l,s))[1]<c[1]?u:c,d=u[1]>d[1]?u:d,l[1]=a.min[1],c=(u=i.fM(i.bX(),l,s))[1]<c[1]?u:c,d=u[1]>d[1]?u:d;let h=i.bG(o[0],0,1),f=100*n.pixelsPerMeter*i.bG(o[1],0,1),p=i.bG(o[2],0,1),m=i.d_(i.bX(),c,d,h),g=Math.tan(.5*n.fovX),_=-m[2]*g;if(0===f)return m[1]<-Math.abs(_)?p:1;let y=(-Math.abs(_)-m[1])/f,v=i.bG(i.dY(1,p,y),p,1);return i.dY(1,v,i.bG((n.pitch-20)/20,0,1))}(_,l,n.aabb,A)),E*=function(r,n){let a=r.uniformValues.u_cutoff_params[0],o=r.uniformValues.u_cutoff_params[1],s=r.uniformValues.u_cutoff_params[2],l=r.uniformValues.u_cutoff_params[3];return o===a||l===s?1:i.bG(((n-a)/(o-a)-s)/(l-s),0,1)}(I,T)),0!==E?F.push({nodeInfo:n,depth:T,opacity:E,wvpForNode:x,nodeModelMatrix:v,tileModelMatrix:_,tileTranslation:g}):a.hidden=!0}for(let n of(w||F.sort((i,r)=>C&&(1!==i.opacity||1!==r.opacity)?1===i.opacity?-1:1===r.opacity?1:i.depth>r.depth?-1:1:i.depth<r.depth?-1:1),F)){let o=n.nodeInfo,d=o.node,h=null;if(r._debugParams.show3DModelFootprints&&d.footprint){let i=d.id||d.name||"footprint";if(!g.has(i)){let r=nm(new Float64Array(16),no,n.tileTranslation,n.nodeInfo.evaluatedScale);g.set(i,{node:d,mvp:r})}}let f=n.nodeInfo.evaluatedScale;nm(ni,na,n.tileTranslation,f),nu[0]=1/f[0],nu[1]=-1/f[1],nu[2]=1/f[2],i.fc(nr,ns,nu),i.er(ni,ni,d.globalMatrix);let m=O?0:o.evaluatedRMEA[0][2],_=o.targetLod,y=d.lodMeshes&&d.lodMeshes.length>0,b=y&&_>0&&_<1;if(w&&y&&1===Math.round(_))continue;let S=!w&&u?np(nn,n.nodeModelMatrix,r.transform):null,A=w&&c?c.calculateShadowPassMatrixFromMatrix(n.nodeModelMatrix):null,C=b?2:1,I=y&&1===Math.round(_);for(let i=0;i<C;++i){let f=b?1===i:I,g=f?d.lodMeshes:d.meshes,y=b?f?-_:1-_:1;for(let i=0;i<g.length;++i){let _,C=g[i],I=!f&&i===d.lightMeshIndex,R=n.wvpForNode;if(I){if(!T&&!r.terrain&&r.shadowRenderer){r.currentLayer<r.firstLightBeamLayer&&(r.firstLightBeamLayer=r.currentLayer);continue}R=nm(nl,no,n.tileTranslation,n.nodeInfo.evaluatedScale)}else if(T)continue;let M={defines:[]},L=[],P=!!C.normalBuffer;if(!w&&c&&(c.useNormalOffset=P),ng(M.defines,L,C,r,E?null:a.lut),O||M.defines.push("DIFFUSE_SHADED"),p&&M.defines.push("SHADOWS_SINGLE_CASCADE"),k&&(w?k.numRenderedVerticesInShadowPass+=C.vertexArray.length:k.numRenderedVerticesInTransparentPass+=C.vertexArray.length),w){nx(C,n.nodeModelMatrix,r,a,A);continue}if(u&&"globe"!==l.projection.name){let i=C.aabb.min,r=C.aabb.max,[n,a]=u.getOpacityForBounds(S,i[0],i[1],r[0],r[1]);M.overrideFog=n>=.05||a>=.05}let F=C.material;F.occlusionTexture&&F.occlusionTexture.offsetScale&&(_=F.occlusionTexture.offsetScale,M.defines.push("OCCLUSION_TEXTURE_TRANSFORM")),b&&M.defines.push("DITHERED_DISCARD");let N=r.getOrCreateProgram("model",M);if(!w&&c&&c.enabled)if(h!==P){for(let i=0;i<D.length;i++)nm(nf[i]=nf[i]||new Float64Array(16),D[i],n.tileTranslation,n.nodeInfo.evaluatedScale);c.setupShadowsFromCascadeMatrices(nf,N,P),h=P}else N.setShadowUniformValues(s,c.getShadowUniformValues());r.uploadCommonUniforms(s,N,null,S);let j=F.pbrMetallicRoughness;j.metallicFactor=.9,j.roughnessFactor=.5;let z=r7(R,ni,nr,d.globalMatrix,r,n.opacity,j.baseColorFactor,F.emissiveFactor,j.metallicFactor,j.roughnessFactor,F,m,a,nh,_,void 0,void 0,y);!I&&(o.hasTranslucentParts||n.opacity<1)&&N.draw(r,s.gl.TRIANGLES,v,t7.disabled,ie.disabled,tj.backCCW,z,a.id,C.vertexBuffer,C.indexBuffer,C.segments,a.paint,r.transform.zoom,void 0,L),N.draw(r,s.gl.TRIANGLES,I?x:v,t7.disabled,I||n.opacity<1||o.hasTranslucentParts?ie.alphaBlended:ie.unblended,tj.backCCW,z,a.id,C.vertexBuffer,C.indexBuffer,C.segments,a.paint,r.transform.zoom,void 0,L)}}}}if(r._debugParams.show3DModelFootprints&&g.size>0)for(let i of Array.from(g.keys()).sort()){let{node:n,mvp:a}=g.get(i);nb(r,0,n,a)}}()}(r,n,a,o),void p();if("model"!==m.type)return;let g=m.getModels(),_=[],y=r.transform.getFreeCameraOptions().position,v=i.fa([],[y.x,y.y,y.z],r.transform.worldSize);i.eu(v,v);let x=[],b=[],w=0;for(let o of g){let s=n.getFeatureState("",o.id),l={type:"Unknown",id:o.id,properties:o.featureProperties},d=a.paint.get("model-rotation").evaluate(l,s),h=a.paint.get("model-scale").evaluate(l,s),f=a.paint.get("model-translation").evaluate(l,s),p=a.paint.get("model-opacity").evaluate(l,s);(function(i,r,n,a,o,s){for(let l of o){let o=Object.assign({},a);o.part=l;let u={type:"Unknown",id:r,properties:o},c={orientation:i.paint.get("model-rotation").evaluate(u,n)};s.set(l,c)}})(a,o.id,s,o.featureProperties,o.nodeOverrideNames,o.nodeOverrides),function(i,r,n,a,o,s){for(let l of o){let o=Object.assign({},a);o.part=l;let u={type:"Unknown",id:r,properties:o},c={color:i.paint.get("model-color").evaluate(u,n),colorMix:i.paint.get("model-color-mix-intensity").evaluate(u,n),opacity:i.paint.get("model-opacity").evaluate(u,n),emissionStrength:i.paint.get("model-emissive-strength").evaluate(u,n)};s.set(l,c)}}(a,o.id,s,o.featureProperties,o.materialOverrideNames,o.materialOverrides),o.nodeOverrides.size>0&&o.computeBoundsAndApplyParent(),o.computeModelMatrix(r,d,h,f,c,u,!1);let m=i.cw([],v),g=i.cX(o.position.lat,r.transform.zoom),y=i.cv([],[1,1,1/g]);for(let i of(_.push({zScaleMatrix:y,negCameraPosMatrix:m}),o.nodes))nv(r,i,o.matrix,r.transform.expandedFarZProjMatrix,w,x,b,o.materialOverrides,p);w++}if(x.sort((i,r)=>r.depth-i.depth),"shadow"!==r.renderPass){if(r._debugParams.show3DModelFootprints){let n=r.transform.projMatrix,a=new Map,o=(r,o)=>{if(r.footprint){let s=r.id||r.name||"footprint";if(!a.has(s)){let l=i.er([],n,o);a.set(s,{node:r,mvp:l})}}};for(let i of b)o(i.node,i.modelMatrix);for(let i of x)o(i.node,i.modelMatrix);for(let i of Array.from(a.keys()).sort()){let{node:n,mvp:o}=a.get(i);nb(r,0,n,o)}}nw(r,a,x,b,_),p()}else{for(let i of b)nx(i.mesh,i.nodeModelMatrix,r,a);for(let i of x)nx(i.mesh,i.nodeModelMatrix,r,a);p()}},prepare:function(i,r,n){let a=r.getSource();if(a.loaded()){if("vector"===a.type||"geojson"===a.type)return void(n.modelManager&&n.modelManager.upload(n,ny(n,i)));if("batched-model"!==a.type&&"model"===a.type)for(let i of a.getModels())i.upload(n.context)}},shaders:{model:rd('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_opacity;\n#ifdef DITHERED_DISCARD\nuniform float u_dithered_discard_threshold;\n#endif\nuniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows;\n#endif\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nuniform vec4 u_occlusionTextureTransform;\n#endif\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#ifdef HAS_ATTRIBUTE_a_pbr\nin lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params;\n#endif\n#ifdef HAS_TEXTURE_u_baseColorTexture\nuniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;
110uniform float u_alphaCutoff;\n#endif\n#ifdef HAS_TEXTURE_u_metallicRoughnessTexture\nuniform sampler2D u_metallicRoughnessTexture;\n#endif\n#ifdef HAS_TEXTURE_u_occlusionTexture\nuniform sampler2D u_occlusionTexture;uniform float u_aoIntensity;\n#endif\n#ifdef HAS_TEXTURE_u_normalTexture\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef HAS_TEXTURE_u_emissionTexture\nuniform sampler2D u_emissionTexture;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef FEATURE_CUTOUT_VERTEX\nin highp float v_cutout_factor;\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nin highp float v_depth;uniform highp sampler2D u_depthTexture;uniform highp vec2 u_inv_depth_size;uniform highp vec2 u_depth_range_unpack;\n#ifdef DEPTH_D24\nhighp float unpack_depth(highp float depth) {return  depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}\n#else\nhighp float unpack_depth_rgba(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded() {highp vec2 coord=gl_FragCoord.xy*u_inv_depth_size;\n#ifdef FLIP_Y\ncoord.y=1.0-coord.y;\n#endif\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depthTexture,coord).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depthTexture,coord));\n#endif\nreturn v_depth > depth+0.0005;}\n#endif\n#define saturate(_x) clamp(_x,0.,1.)\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor)\n{\n#ifdef LIGHTING_3D_MODE\nvec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir));\n#endif\nreturn apply_lighting(albedo,transformed_normal,lighting_factor);\n#else\nvec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-lightColor),vec3(1.0));return c3;\n#endif\n}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor;\n#ifdef HAS_ATTRIBUTE_a_color_3f\nalbedo*=vec4(color_3f,1.0);\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#else\n#ifdef HAS_ATTRIBUTE_a_color_4f\nalbedo*=color_4f;\n#endif\n#endif\n#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f)\nvec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}}\n#ifdef UNPREMULT_TEXTURE_IN_SHADER\ntexColor=vec4(unpremultiplyColor(texColor),1.0);\n#endif\nif(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;}\n#endif\nvec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\nreturn color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) {\n#ifdef HAS_TEXTURE_u_normalTexture\nhighp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;\n#ifdef FLIP_Y\nT=-T;B=-B;\n#endif\nhighp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res;\n#else\nreturn mat3(1.0);\n#endif\n}highp vec3 getNormal(){highp vec3 n;\n#ifdef HAS_ATTRIBUTE_a_normal_3f\nn=normalize(normal_3f);\n#else\nhighp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));\n#ifdef FLIP_Y\nn=normalize(cross(fdx,fdy));\n#else\nn=normalize(cross(fdx,fdy))*-1.0;\n#endif\n#endif\n#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap);\n#endif\nreturn n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor;\n#ifdef HAS_ATTRIBUTE_a_pbr
vendor: 4,256 bytes, line 110
110\nmat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w;\n#endif\n#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b;\n#endif\nconst float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness)\n{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH)\n{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH)\n{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness)\n{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV)\n{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat)\n{\n#ifdef LIGHTING_3D_MODE\nreturn mat.diffuseColor;\n#else\nreturn mat.diffuseColor/PI;\n#endif\n}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV)\n{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal)\n{vec3 env_light=vec3(0.65,0.65,0.65);\n#ifdef LIGHTING_3D_MODE\nfloat ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor;\n#endif\nvec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor)\n{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=NdotL;\n#endif\nvec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*lightColor;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0;\n#if !defined(LIGHTING_3D_MODE)\nconst vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL);\n#endif\ncolor*=intensityFactor;return color;}void main() {
110\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nif (isOccluded()) {discard;}\n#endif\nvec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor;\n#ifdef LIGHTING_3D_MODE\nlightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color;\n#endif\nvec4 finalColor;\n#ifdef DIFFUSE_SHADED\nvec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor);\n#ifdef HAS_TEXTURE_u_occlusionTexture\nfloat ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao;\n#endif\nfinalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity;\n#else\nMaterial mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0;\n#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nvec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy;\n#else\nvec2 uv=uv_2f;\n#endif\nao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao;\n#endif\nvec4 emissive=u_emissiveFactor;\n#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nemissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nfloat emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength;\n#endif\ncolor+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity;\n#ifdef HAS_ATTRIBUTE_a_pbr\nfloat resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);vec3 color_mix=v_color_mix.rgb;\n#ifdef APPLY_LUT_ON_GPU\ncolor_mix=applyLUT(u_lutTexture,color_mix);\n#endif\ncolor=mix(color,color_mix,min(1.0,resEmission));\n#ifdef HAS_ATTRIBUTE_a_color_4f\nfloat distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.
110y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance);\n#endif\n#endif\nvec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity);\n#endif\n#ifdef DITHERED_DISCARD\nif (abs(u_dithered_discard_threshold) < 1.0) {float ditherValue=fract(52.9829189*fract(0.06711056*gl_FragCoord.x+0.00583715*gl_FragCoord.y));float compareValue=mix(1.0-ditherValue,ditherValue,step(0.0,u_dithered_discard_threshold));if (abs(u_dithered_discard_threshold) < compareValue) {discard;}}\n#endif\n#ifdef FOG\nfinalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w));\n#endif\n#ifdef RENDER_CUTOFF\nfinalColor*=v_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\nfinalColor=applyCutout(finalColor,v_position_height.w);\n#endif\n#ifdef FEATURE_CUTOUT_VERTEX\napply_feature_cutout_dither(gl_FragCoord,v_cutout_factor);\n#else\n#ifdef FEATURE_CUTOUT\nfinalColor=apply_feature_cutout(finalColor,gl_FragCoord,get_cutout_factors(gl_FragCoord).x);\n#endif\n#endif\nglFragColor=finalColor;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute-vertex-shader-only highp uvec4 pbr\n#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength\nuniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix;\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_normal_matrix;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows;\n#endif\nout vec4 v_position_height;out lowp vec4 v_color_mix;\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nout highp float v_depth;\n#endif\n#ifdef FEATURE_CUTOUT_VERTEX\nout highp float v_cutout_factor;\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\nout lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params;\n#endif\nvec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute-custom highp uvec4 pbr\n#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength\nhighp mat4 normal_matrix;\n#ifdef INSTANCED_ARRAYS\nnormal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\nnormal_matrix=u_normal_matrix;\n#endif\n#ifdef FEATURE_CUTOUT_VERTEX\nv_cutout_factor=1.0;\n#endif\nvec3 local_pos;mat3 rs;\n#ifdef MODEL_POSITION_ON_GPU\nvec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float hidden=float(pos_a.x > EXTENT);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=mix(u_matrix*pos,AWAY,hidden);pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos;\n#ifdef FEATURE_CUTOUT_VERTEX\nhighp vec4 ground_pos=vec4(pos_a.xy,0.0,1.0);highp vec4 cutout_clip_pos=mix(u_matrix*ground_pos,AWAY,hidden);highp vec3 cutout_ndc=cutout_clip_pos.xyz/cutout_clip_pos.w;vec2 uv=cutout_ndc.xy*0.5+0.5;highp float fragDepthNDC=cutout_ndc.z*0.5+0.5;\n#ifdef FLIP_Y\nfragDepthNDC=cutout_ndc.z;\n#endif\nhighp float cutoutFactor=get_cutout_factors_vert(uv).x;highp float cutoutDepthNDC=sample_cutout_depth(u_cutout_depth_image,uv);highp float groundThreshold=0.001;
110highp float groundLimit=clamp((fragDepthNDC+groundThreshold-cutoutDepthNDC)/groundThreshold+0.5,0.0,1.0);v_cutout_factor=mix(1.0-cutoutFactor,1.0,groundLimit);\n#endif\n#else\nlocal_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a);\n#endif\nv_position_height.w=a_pos_3f.z;\n#ifdef HAS_ATTRIBUTE_a_pbr\nvec4 albedo_c=decode_color(vec2(pbr.xy));vec2 e_r_m=unpack_float(float(pbr.z));vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(float(pbr.w))/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(local_pos);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nv_depth=gl_Position.z/gl_Position.w;\n#ifdef CLIP_ZERO_TO_ONE\nv_depth=-1.0+2.0*v_depth; \n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nfloat x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f);\n#else\nnormal_3f=vec3(normal_matrix*vec4(normal_3f,0));\n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#ifdef HAS_ATTRIBUTE_a_color_4f\nv_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0);\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0);\n#ifdef NORMAL_OFFSET\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nvec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#else\nvec3 offset=shadow_normal_offset_model(normal_3f);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#endif\n#endif\n#endif\nv_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w;\n#endif\n}'),modelDepth:rd("void main() {}","in vec3 a_pos_3f;uniform mat4 u_matrix;\n#ifdef MODEL_POSITION_ON_GPU\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_instance;\n#endif\nuniform highp mat4 u_node_matrix;\n#endif\nvoid main() {\n#ifdef MODEL_POSITION_ON_GPU\nhighp mat4 instance;\n#ifdef INSTANCED_ARRAYS\ninstance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\ninstance=u_instance;\n#endif\nvec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float hidden=float(pos_a.x > EXTENT);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;
110rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=mix(u_matrix*pos,AWAY,hidden);\n#else\ngl_Position=u_matrix*vec4(a_pos_3f,1);\n#endif\n}")},programUniforms:{model:r=>({u_matrix:new i.bb(r),u_lighting_matrix:new i.bb(r),u_normal_matrix:new i.bb(r),u_node_matrix:new i.bb(r),u_lightpos:new i.b7(r),u_lightintensity:new i.b4(r),u_lightcolor:new i.b7(r),u_camera_pos:new i.b7(r),u_opacity:new i.b4(r),u_baseColorFactor:new i.b8(r),u_emissiveFactor:new i.b8(r),u_metallicFactor:new i.b4(r),u_roughnessFactor:new i.b4(r),u_baseTextureIsAlpha:new i.b5(r),u_alphaMask:new i.b5(r),u_alphaCutoff:new i.b4(r),u_baseColorTexture:new i.b5(r),u_metallicRoughnessTexture:new i.b5(r),u_normalTexture:new i.b5(r),u_occlusionTexture:new i.b5(r),u_emissionTexture:new i.b5(r),u_lutTexture:new i.b5(r),u_color_mix:new i.b8(r),u_aoIntensity:new i.b4(r),u_emissive_strength:new i.b4(r),u_occlusionTextureTransform:new i.b8(r),u_dithered_discard_threshold:new i.b4(r)}),modelDepth:r=>({u_matrix:new i.bb(r),u_instance:new i.bb(r),u_node_matrix:new i.bb(r)})}};async function nS(){return Promise.resolve()}class nA{constructor(i,r,n){this.screenBounds=i,this.cameraPoint=n.getCameraPoint(),this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=r,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,n)}static createFromScreenPoints(r,n){let a,o;if(r instanceof i.au||"number"==typeof r[0]){let s=i.au.convert(r);a=[s],o=n.isPointAboveHorizon(s)}else{let s=i.au.convert(r[0]),l=i.au.convert(r[1]),u=s.add(l)._div(2);a=[s,l],o=i.eP(s,l).every(i=>n.isPointAboveHorizon(i))&&n.isPointAboveHorizon(u)}return new nA(a,o,n)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(r){return i.eP(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],r)}bufferedCameraGeometry(r){let n=this.screenBounds[0],a=1===this.screenBounds.length?this.screenBounds[0].add(new i.au(1,1)):this.screenBounds[1],o=i.eP(n,a,0,!1);return this.cameraPoint.y>a.y&&(this.cameraPoint.x>n.x&&this.cameraPoint.x<a.x?o.splice(3,0,this.cameraPoint):this.cameraPoint.x>=a.x?o[2]=this.cameraPoint:this.cameraPoint.x<=n.x&&(o[3]=this.cameraPoint)),i.bu(o,r)}bufferedCameraGeometryGlobe(r){let n=this.screenBounds[0],a=1===this.screenBounds.length?this.screenBounds[0].add(new i.au(1,1)):this.screenBounds[1],o=i.eP(n,a,r),s=this.cameraPoint.clone(),l=Number(s.x>n.x)+Number(s.x>a.x);switch(3*(Number(s.y>n.y)+Number(s.y>a.y))+l){case 0:o[0]=s,o[4]=s.clone();break;case 1:o.splice(1,0,s);break;case 2:o[1]=s;break;case 3:o.splice(4,0,s);break;case 5:o.splice(2,0,s);break;case 6:o[3]=s;break;case 7:o.splice(3,0,s);break;case 8:o[2]=s}return o}containsTile(r,n,a,o=0){var s;let l=Math.max(r.queryPadding,r.evaluateQueryRenderedFeaturePadding())/n._pixelsPerMercatorPixel+1,u=a?this._bufferedCameraMercator(l,n):this._bufferedScreenMercator(l,n),c=r.tileID.wrap+(u.unwrapped?o:0),d=u.polygon.map(n=>i.d8(r.tileTransform,n,c));if(!i.eM(d,0,0,i.r,i.r))return;c=r.tileID.wrap+(this.screenGeometryMercator.unwrapped?o:0);let h=this.screenGeometryMercator.polygon.map(n=>i.d9(r.tileTransform,n,c)),f=h.map(r=>new i.au(r[0],r[1])),p=n.getFreeCameraOptions().position||new i.ag(0,0,0),m=i.d9(r.tileTransform,p,c),g=h.map(r=>{let n=i.fx(r,r,m);return i.ex(n,n),new i.aB(m,n)}),_=i.eG(r,1,n.zoom)*n._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:f,tilespaceRays:g,bufferedTilespaceGeometry:d,bufferedTilespaceBounds:((s=i.cI(d)).min.x=i.bG(s.min.x,0,i.r),s.min.y=i.bG(s.min.y,0,i.r),s.max.x=i.bG(s.max.x,
1100,i.r),s.max.y=i.bG(s.max.y,0,i.r),s),tile:r,tileID:r.tileID,pixelToTileUnitsFactor:_}}_bufferedScreenMercator(i,r){let n=100*i|0;if(this._screenRaycastCache[n])return this._screenRaycastCache[n];{let a;return a="globe"===r.projection.name?this._projectAndResample(this.bufferedScreenGeometry(i),r):{polygon:this.bufferedScreenGeometry(i).map(i=>r.pointCoordinate3D(i)),unwrapped:!0},this._screenRaycastCache[n]=a,a}}_bufferedCameraMercator(i,r){let n=100*i|0;if(this._cameraRaycastCache[n])return this._cameraRaycastCache[n];{let a;return a="globe"===r.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(i),r):{polygon:this.bufferedCameraGeometry(i).map(i=>r.pointCoordinate3D(i)),unwrapped:!0},this._cameraRaycastCache[n]=a,a}}_projectAndResample(r,n){let a=function(r,n){let a=i.er([],n.pixelMatrix,n.globeMatrix),o=[0,-i.P,0,1],s=[0,i.P,0,1],l=[0,0,0,1];i.fM(o,o,a),i.fM(s,s,a),i.fM(l,l,a);let u=new i.au(o[0]/o[3],o[1]/o[3]),c=new i.au(s[0]/s[3],s[1]/s[3]),d=i.eL(r,u)&&o[3]<l[3],h=i.eL(r,c)&&s[3]<l[3];if(!d&&!h)return null;let f=function(i,r,n){for(let a=1;a<i.length;a++){let o=nI(r.pointCoordinate3D(i[a-1]).x),s=nI(r.pointCoordinate3D(i[a]).x);if(n<0){if(o<s)return{idx:a,t:-o/(s-1-o)}}else if(s<o)return{idx:a,t:(1-o)/(s+1-o)}}return null}(r,n,d?-1:1);if(!f)return null;let{idx:p,t:m}=f,g=p>1?nC(r.slice(0,p),n):[],_=p<r.length?nC(r.slice(p),n):[];g=g.map(r=>new i.au(nI(r.x),r.y)),_=_.map(r=>new i.au(nI(r.x),r.y));let y=[...g];0===y.length&&y.push(_.at(-1));let v=y.at(-1),x=i.dY(v.y,(0===_.length?g[0]:_[0]).y,m);return y.push(...d?[new i.au(0,x),new i.au(0,0),new i.au(1,0),new i.au(1,x)]:[new i.au(1,x),new i.au(1,1),new i.au(0,1),new i.au(0,x)]),0===_.length?y.push(g[0]):y.push(..._),{polygon:y.map(r=>new i.ag(r.x,r.y)),unwrapped:!1}}(r,n);if(a)return a;let o=function(r,n){let a=!1,o=-1/0,s=0;for(let i=0;i<r.length-1;i++)r[i].x>o&&(o=r[i].x,s=i);for(let i=0;i<r.length-1;i++){let n=(s+i)%(r.length-1),o=r[n],l=r[n+1];Math.abs(o.x-l.x)>.5&&(o.x<l.x?(o.x+=1,0===n&&(r.at(-1).x+=1)):(l.x+=1,n+1===r.length-1&&(r[0].x+=1)),a=!0)}let l=i.ek(n.center.lng);return a&&l<Math.abs(l-1)&&r.forEach(i=>{i.x-=1}),{polygon:r,unwrapped:a}}(nC(r,n).map(r=>new i.au(nI(r.x),r.y)),n);return{polygon:o.polygon.map(r=>new i.ag(r.x,r.y)),unwrapped:o.unwrapped}}}function nC(r,n){return i.f0(r,i=>{let r=n.pointCoordinate3D(i);i.x=r.x,i.y=r.y},1/256)}function nI(i){return i<0?1+i%1:i%1}class nk extends i.y{constructor(r,n,a,o){if(super(),this.id=r,this.dispatcher=a,this.type="vector",this.provider=n.provider,this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,Object.assign(this,i.eF(n,["url","scheme","tileSize","promoteId"])),this._options=Object.assign({type:"vector"},n),this._collectResourceTiming=!!n.collectResourceTiming,512!==this.tileSize)throw Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o),this._tileWorkers={},this._deduped=new i.m}load(r){this._loaded=!1,this.fire(new i.x("dataloading",{dataType:"source"}));let n=Array.isArray(this.map._language)?this.map._language.join():this.map._language,a=this.map.getWorldview(),o=(o,s)=>{this._tileJSONRequest=null,this._loaded=!0,o?(n&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${n}`),a&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${a}`),this.fire(new i.v(o))):s&&(this._setTileJSON(s),K(s.tiles,this.map._requestManager._customAccessToken),this.fire(new i.x("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new i.x("data",{dataType:"source",sourceDataType:"content"}))),r&&r(o)};this.provider=this._options.provider;let s=i.f1(this._options);return s instanceof Error?(this._loaded=!0,this.fire(new i.v(s)),void(r&&r())):this.provider&&!s?(this._loaded=!0,this.fire(new i.v(Error(`TileProvider "${this.provider}" is not registered`))),void(r&&r())):void(this._tileJSONRequest=s?this.loadTileJSONWithProvider(s,o):i.e7(this._options,this.map._requestManager,n,a,o))}loadTileJSONWithProvider(r,n){this.provider=r.name;let{request:a,options:o}=i.eC(this._options,this.map._requestManager),s=new AbortController;return this.dispatcher.broadcast("loadTileProvider",{name:r.name,url:r.url,source:this.id,scope:this.scope,type:this.t
110ype,options:o,request:a},(r,a)=>{if(s.signal.aborted)return;if(r)return void n(r);let o=a?a.find(i=>null!=i):null,l=i.eW(this._options,o,this.map._requestManager);l instanceof Error?n(l):n(null,l)}),{cancel:()=>s.abort()}}_setTileJSON(i){if(Object.assign(this,i),this.hasWorldviews=!!i.worldview_options,i.worldview_default&&(this.worldviewDefault=i.worldview_default),i.vector_layers)for(let r of(this.vectorLayers=i.vector_layers,this.vectorLayerIds=[],this.localizableLayerIds=new Set,i.vector_layers))this.vectorLayerIds.push(r.id),i.worldview&&i.worldview[r.source]&&this.localizableLayerIds.add(r.id);this.tileBounds=iU.fromTileJSON(i)}loaded(){return this._loaded}hasTile(i){return!this.tileBounds||this.tileBounds.contains(i.canonical)}onAdd(i){this.map=i,this.load()}reload(){this.cancelTileJSONRequest();let r=i.ea(this.id,this.scope);this.load(()=>this.map.style.clearSource(r))}setTiles(i){return this._options.tiles=i,this.reload(),this}setUrl(i){return this.url=i,this._options.url=i,this.reload(),this}onRemove(i){this.cancelTileJSONRequest()}serialize(){return Object.assign({},this._options)}loadTile(r,n){let a=r.tileID.canonical.url(this.tiles,this.scheme),o=this.map._requestManager.normalizeTileURL(a),s=this.map._requestManager.transformRequest(o,i.aH.Tile),l=this.map.style?this.map.style.getLut(this.scope):null,u=l?{image:l.image.clone()}:null,c={request:s,data:void 0,uid:r.uid,tileID:r.tileID,tileZoom:r.tileZoom,zoom:r.tileID.overscaledZ,maxZoom:this.maxzoom,lut:u,tileSize:this.tileSize*r.tileID.overscaleFactor(),type:this.t
110ype,source:this.id,scope:this.scope,pixelRatio:i.co.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,showElevationIdDebug:!!this.map.painter&&this.map.painter._debugParams.showElevationIdDebug,promoteId:this.promoteId,renderSourceType:r.renderSourceType,frcCoverage:(()=>{let i=this.map.painter,n=i?i.frcCoverageFadeRange:null;if(null==n)return null;let a=i?i.frcCoverageSnapshot:null,o=this.map.transform.zoom<n[0],s=a?a.getTileOrParent(r.tileID.canonical):null,l=r.tileID.overscaledZ>=Math.ceil(n[1]),u=a&&l?a.getFullCoverageMask(r.tileID.canonical):null;return{frcMask:l&&null!=u?u:null,resolved:o||null!=a,polygons:s&&0!==s.frcMask?s.polygons:null,tileZoom:s&&0!==s.frcMask?s.tileId.z:null,sourceLayers:i?i.frcCoverageSourceLayers:["road","structure"]}})(),brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:r.isExtraShadowCaster,tessellationStep:this.map._tessellationStep,scaleFactor:this.map.getScaleFactor(),worldview:this.map.getWorldview()||this.worldviewDefault,indoor:this.map.getIndoorTileOptions(this.id,this.scope)};if(this.hasWorldviews&&i.dL(a)&&(c.localizableLayerIds=this.localizableLayerIds),c.request.collectResourceTiming=this._collectResourceTiming,r.actor&&"expired"!==r.state)"loading"===r.state?r.reloadCallback=n:r.request=r.actor.send("reloadTile",c,d.bind(this));else if(r.actor=this._tileWorkers[o]=this._tileWorkers[o]||this.dispatcher.getActor(),this.dispatcher.ready||this.provider)r.request=r.actor.send("loadTile",c,d.bind(this),void 0,!0);else{let n=i.e9.call({deduped:this._deduped},c,(n,a)=>{if(n||!a)d.call(this,n);else{let n=i.cO(a.responseHeaders);c.data={rawData:a.rawData.slice(0),expires:n.expires,cacheControl:n.cacheControl},r.actor&&r.actor.send("loadTile",c,d.bind(this),void 0,!0)}},!0);r.request={cancel:n}}function d(a,o){return delete r.request,r.aborted?n(null):a?n(a):(o&&o.resourceTiming&&(r.resourceTiming=o.resourceTiming),this.map._refreshExpiredTiles&&o&&r.setExpiryData(o),void(function(){if(r.aborted)return n(null);r.loadVectorData(o,this.map.painter),i.bv(this.dispatcher),n(null,o),r.reloadCallback&&(this.loadTile(r,r.reloadCallback),r.reloadCallback=null)}).call(this))}}abortTile(i){i.request&&(i.request.cancel(),delete i.request),i.actor&&i.actor.send("abortTile",{uid:i.uid,type:this.t
110ype,source:this.id,scope:this.scope})}unloadTile(i,r){i.actor&&i.actor.send("removeTile",{uid:i.uid,type:this.type,source:this.id,scope:this.scope}),i.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}let nR={vector:nk,raster:iV,"raster-dem":class extends iV{constructor(i,r,n,a){super(i,r,n,a),this.type="raster-dem",this.maxzoom=22,this._options=Object.assign({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox"}loadTileJSONWithProvider(r,n){this.provider=r.name;let{request:a,options:o}=i.eC(this._options,this.map._requestManager),s=new AbortController;return this.dispatcher.broadcast("loadTileProvider",{name:r.name,url:r.url,source:this.id,scope:this.scope,type:this.type,options:o,request:a},(r,a)=>{if(s.signal.aborted)return;if(r)return void n(r);let o=a?a.find(i=>null!=i):null,l=i.eW(this._options,o,this.map._requestManager);l instanceof Error?n(l):n(null,l)}),{cancel:()=>s.abort()}}loadTile(r,n){let a=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),o=this.map._requestManager.transformRequest(a,i.aH.Tile),s={uid:r.uid,tileID:r.tileID,source:this.id,type:this.t
110ype,scope:this.scope,request:o,encoding:this.encoding};r.actor&&"expired"!==r.state||(r.actor=this.dispatcher.getActor(),r.request=r.actor.send("loadTile",s,(function(i,a){return delete r.request,r.aborted?(r.state="unloaded",n(null)):i?(r.state="errored",n(i)):(a&&(this.map._refreshExpiredTiles&&r.setExpiryData(a),a.borderReady||r.neighboringTiles||(r.neighboringTiles=this._getNeighboringTiles(r.tileID)),r.dem=a.dem,r.dem.onDeserialize(),r.needsHillshadePrepare=!0,r.needsDEMTextureUpload=!0),r.state="loaded",void n(null))}).bind(this),void 0,!0))}abortTile(i,r){i.request&&(i.request.cancel(),delete i.request),i.actor&&i.actor.send("abortTile",{uid:i.uid,type:this.type,source:this.id,scope:this.scope}),r&&r()}_getNeighboringTiles(r){let n=r.canonical,a=Math.pow(2,n.z),o=(n.x-1+a)%a,s=0===n.x?r.wrap-1:r.wrap,l=(n.x+1+a)%a,u=n.x+1===a?r.wrap+1:r.wrap,c={};return c[new i.ap(r.overscaledZ,s,n.z,o,n.y).key]={backfilled:!1},c[new i.ap(r.overscaledZ,u,n.z,l,n.y).key]={backfilled:!1},n.y>0&&(c[new i.ap(r.overscaledZ,s,n.z,o,n.y-1).key]={backfilled:!1},c[new i.ap(r.overscaledZ,r.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},c[new i.ap(r.overscaledZ,u,n.z,l,n.y-1).key]={backfilled:!1}),n.y+1<a&&(c[new i.ap(r.overscaledZ,s,n.z,o,n.y+1).key]={backfilled:!1},c[new i.ap(r.overscaledZ,r.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},c[new i.ap(r.overscaledZ,u,n.z,l,n.y+1).key]={backfilled:!1}),c}},"raster-array":iH,geojson:class extends i.y{constructor(r,n,a,o){super(),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=a.getActor(),this.setEventedParent(o),this._data=n.data,this._options=Object.assign({},n),this._collectResourceTiming=n.collectResourceTiming,void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),void 0!==n.minzoom&&(this.minzoom=n.minzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;const s=i.r/this.tileSize;this.workerOptions=Object.assign({source:this.id,scope:this.scope,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*s,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*s,extent:i.r,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?n.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:i.r,radius:(void 0!==n.clusterRadius?n.clusterRadius:50)*s,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter,dynamic:n.dynamic},n.workerOptions)}onAdd(i){this.map=i,this.setData(this._data)}setData(i){return this._data=i,this._updateWorkerData(),this}updateData(r){if(!this._options.dynamic)return this.fire(new i.v(Error("Can't call updateData on a GeoJSON source with dynamic set to false.")));if("string"!=typeof r&&("Feature"===r.type&&(r={type:"FeatureCollection",features:[r]}),"FeatureCollection"!==r.type))return this.fire(new i.v(Error("Data to update should be a feature or a feature collection.")));if(this._coalesce&&"string"!=typeof r&&"string"!=typeof this._data&&"FeatureCollection"===this._data.type){let i=new Map;for(let r of this._data.features)i.set(r.id,r);for(let n of r.features)i.set(n.id,n);this._data.features=[...i.values()]}else this._data=r;return this._updateWorkerData(!0),this}getClusterExpansionZoom(i,r){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:i,source:this.id,scope:this.scope},r),this}getClusterChildren(i,r){return this.actor.send("geojson.getClusterChildren",{clusterId:i,source:this.id,scope:this.scope},r),this}getClusterLeaves(i,r,n,a){return this.actor.send("geojson.getClusterLeaves",{source:this.id,scope:this.scope,clusterId:i,limit:r,offset:n},a),this}_updateWorkerData(r=!1){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new i.x("dataloading",{dataType:"source"})),this._loaded=!1;let n=Object.assign({append:r},this.workerOptions);n.scope=this.scope;let a=this._data;"string"==typeof a?(n.request=this.map._requestManager.transformRequest(i.co.resolveURL(a),i.aH.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(a),this._pendingLoad=this.actor.send(`${this.type}.loadData`,n,(n,a)=>
110{if(this._loaded=!0,this._pendingLoad=null,n)this.fire(new i.v(n));else{let n={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&a&&a.resourceTiming&&a.resourceTiming[this.id]&&(n.resourceTiming=a.resourceTiming[this.id]),r&&(this._partialReload=!0),this.fire(new i.x("data",n)),this._partialReload=!1,this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(r),this._coalesce=!1)})}loaded(){return this._loaded}reload(){let r=i.ea(this.id,this.scope);this.map.style.clearSource(r),this._updateWorkerData()}loadTile(r,n){let a=r.actor?"reloadTile":"loadTile";r.actor=this.actor;let o=this.map.style?this.map.style.getLut(this.scope):null,s=o?{image:o.image.clone()}:null,l=this._partialReload,u={type:this.type,uid:r.uid,tileID:r.tileID,tileZoom:r.tileZoom,zoom:r.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,lut:s,scope:this.scope,pixelRatio:i.co.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,showElevationIdDebug:!!this.map.painter&&this.map.painter._debugParams.showElevationIdDebug,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:r.isExtraShadowCaster,scaleFactor:this.map.getScaleFactor(),partial:l,worldview:this.map.getWorldview(),indoor:this.map.getIndoorTileOptions(this.id,this.scope)};r.request=this.actor.send(a,u,(i,o)=>l&&!o?(r.state="loaded",n(null)):(delete r.request,r.destroy(!1),r.aborted?n(null):i?n(i):(r.loadVectorData(o,this.map.painter,"reloadTile"===a),n(null))),void 0,"loadTile"===a)}abortTile(i){i.request&&(i.request.cancel(),delete i.request),i.aborted=!0}unloadTile(i,r){this.actor.send("removeTile",{uid:i.uid,type:this.t
110ype,source:this.id,scope:this.scope}),i.destroy()}onRemove(i){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return Object.assign({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends i.a3{constructor(i,r,n,a){super(i,r,n,a),this.roundZoom=!0,this.type="video",this.options=r}load(){this._loaded=!1;let r=this.options;for(let n of(this.urls=[],r.urls))this.urls.push(this.map._requestManager.transformRequest(n,i.aH.Source).url);i.db(this.urls,(r,n)=>{this._loaded=!0,r?this.fire(new i.v(r)):n&&(this.video=n,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(r){if(this.video){let n=this.video.seekable;r<n.start(0)||r>n.end(0)?this.fire(new i.v(new eD(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=r}}getVideo(){return this.video}
110onAdd(i){this.map||(this.map=i,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;let r=this.map.painter.context,n=r.gl;this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new i.a_(r,this.video,n.RGBA8),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(r)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:i.a3,model:i.ai,"batched-model":class extends i.y{constructor(i,r,n,a){super(),this.type="batched-model",this.id=i,this.tileSize=512,this._options=r,this.tiles=this._options.tiles,this.maxzoom=r.maxzoom||19,this.minzoom=r.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=n,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(a)}onAdd(i){this.map=i,this.load()}reload(){this.cancelTileJSONRequest();let r=i.ea(this.id,this.scope);this.load(()=>this.map.style.clearSource(r))}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}load(r){this._loaded=!1,this.fire(new i.x("dataloading",{dataType:"source"}));let n=Array.isArray(this.map._language)?this.map._language.join():this.map._language,a=this.map.getWorldview();this._tileJSONRequest=i.e7(this._options,this.map._requestManager,n,a,(o,s)=>{this._tileJSONRequest=null,this._loaded=!0,o?(n&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${n}`),a&&2!==a.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${a}`),this.fire(new i.v(o))):s&&(Object.assign(this,s),s.bounds&&(this.tileBounds=new iU(s.bounds,this.minzoom,this.maxzoom)),K(s.tiles,this.map._requestManager._customAccessToken),this.fire(new i.x("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new i.x("data",{dataType:"source",sourceDataType:"content"}))),r&&r(o)})}hasTransition(){return!1}hasTile(i){return!this.tileBounds||this.tileBounds.contains(i.canonical)}loaded(){return this._loaded}loadTile(r,n){let a=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme)),o={request:this.map._requestManager.transformRequest(a,i.aH.Tile),data:void 0,uid:r.uid,tileID:r.tileID,tileZoom:r.tileZoom,zoom:r.tileID.overscaledZ,tileSize:this.tileSize*r.tileID.overscaleFactor(),type:this.t
110ype,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,renderSourceType:r.renderSourceType,brightness:this.map.style&&this.map.style.getBrightness()||0,pixelRatio:i.co.devicePixelRatio,promoteId:this.promoteId};if(r.actor&&"expired"!==r.state)if("loading"===r.state)r.reloadCallback=n;else{if(r.buckets){for(let i of Object.values(r.buckets))i.dirty=!0;return void(r.state="loaded")}r.request=r.actor.send("reloadTile",o,s.bind(this))}else r.actor=this.dispatcher.getActor(),r.request=r.actor.send("loadTile",o,s.bind(this),void 0,!0);function s(i,a){return r.aborted?n(null):i&&404!==i.status?n(i):(this.map._refreshExpiredTiles&&a&&r.setExpiryData(a),r.loadModelData(a,this.map.painter),r.state="loaded",void n(null))}}serialize(){return Object.assign({},this._options)}},canvas:class extends i.a3{constructor(r,n,a,o){super(r,n,a,o),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some(i=>!Array.isArray(i)||2!==i.length||i.some(i=>"number"!=typeof i))||this.fire(new i.v(new eD(`sources.${r}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new i.v(new eD(`sources.${r}`,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new i.v(new eD(`sources.${r}`,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof HTMLCanvasElement||this.fire(new i.v(new eD(`sources.${r}`,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 i.v(new eD(`sources.${r}`,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new i.v(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(i){this.map=i,this.load(),this.canvas&&this.animate&&this.play()}onRemove(i){this.pause()}prepare(){let r=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,r=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,r=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;let n=this.map.painter.context;this.texture?!r&&!this._playing||this.texture instanceof i.bd||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new i.a_(n,this.canvas,n.gl.RGBA8,{premultiply:!0}),this._prepareData(n)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let i of[this.canvas.width,this.canvas.height])if(isNaN(i)||i<=0)return!0;return!1}},custom:class extends i.y{constructor(r,n,a,o){super(),this.id=r,this.type="custom",this._dataType="raster",this._dispatcher=a,this._implementation=n,this.setEventedParent(o),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new i.v(Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new i.v(Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new iU(this._implementation.bounds,this.minzoom,this.maxzoom)),n.update=this._update.bind(this),n.clearTiles=this._clearTiles.bind(this),n.coveringTiles=this._coveringTiles.bind(this),Object.assign(this,i.eF(n,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return i.eF(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new i.x("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new i.x("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(r){this.map=r,this._loaded=!1,this.fire(new i.x("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(r),this.load()}onRemove(i){this._implementation.onRemove&&this._implementation.onRemove(i)}hasTile(i){if(this._implementation.hasTile){let{x:r,y:n,z:a}=i.canonical;return this._implementation.hasTile({x:r,y:n,z:a})}
110return!this.tileBounds||this.tileBounds.contains(i.canonical)}loadTile(i,r){let{x:n,y:a,z:o}=i.tileID.canonical,s=new AbortController,l=Promise.resolve(this._implementation.loadTile({x:n,y:a,z:o},{signal:s.signal})).then((function(n){return delete i.request,i.aborted?(i.state="unloaded",r(null)):void 0===n?(i.state="errored",r(null)):null===n?(this.loadTileData(i,{width:this.tileSize,height:this.tileSize,data:null}),i.state="loaded",r(null)):n instanceof ImageData||n instanceof HTMLCanvasElement||n instanceof ImageBitmap||n instanceof HTMLImageElement?(this.loadTileData(i,n),i.state="loaded",void r(null)):(i.state="errored",r(Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(n=>{"AbortError"!==n.name&&(i.state="errored",r(n))});l.cancel=()=>s.abort(),i.request=l}loadTileData(i,r){i.setTexture(r,this.map.painter)}unloadTile(r,n){if(r.texture&&r.texture instanceof i.a_?(r.destroy(!1),r.texture&&r.texture instanceof i.a_&&this.map.painter.saveTileTexture(r.texture)):r.destroy(),this._implementation.unloadTile){let{x:i,y:n,z:a}=r.tileID.canonical;this._implementation.unloadTile({x:i,y:n,z:a})}n&&n()}abortTile(i,r){i.request&&i.request.cancel&&(i.request.cancel(),delete i.request),r&&r()}hasTransition(){return!1}_coveringTiles(){return this.map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(i=>({x:i.canonical.x,y:i.canonical.y,z:i.canonical.z}))}_clearTiles(){let r=i.ea(this.id,this.scope);this.map.style.clearSource(r)}_update(){this.fire(new i.x("data",{dataType:"source",sourceDataType:"content"}))}}},nM=function(r,n,a,o){let s=new nR[n.type](r,n,a,o);if(s.id!==r)throw Error(`Expected Source id to be ${r} instead of ${s.id}`);return i.bs(["load","abort","unload","serialize","prepare"],s),s};function nL(i,r,n=""){return`${n}:${r.id||""}:${r.layer.id}:${function(i){if("layerId"in i)return`layer:${i.layerId}`;{let{featuresetId:r,importId:n}=i;return`featureset:${r}${n?`:import:${n}`:""}`}}(i.target)}`}function nP(i,r,n,a=""){if(i.uniqueFeatureID){let o=nL(i,r,a);if(n.has(o))return!0;n.add(o)}return!1}function nO(i,r){let n=i.tileID,a=r.tileID;return n.overscaledZ-a.overscaledZ||n.canonical.y-a.canonical.y||n.wrap-a.wrap||n.canonical.x-a.canonical.x}class nD{constructor(i){this.style=i,this.layersGotHidden=!1,this.layers=[]}processLayersChanged(){for(let i in this.layers=[],this.style._mergedLayers){let r=this.style._mergedLayers[i];if("fill-extrusion"===r.type||"building"===r.type)this.layers.push({layer:r,visible:!1,visibilityChanged:!1});else if("model"===r.type){let i=this.style.getLayerSource(r);i&&"batched-model"===i.type&&this.layers.push({layer:r,visible:!1,visibilityChanged:!1})}}}onNewFrame(i){for(let r of(this.layersGotHidden=!1,this.layers)){let n=r.layer,a=!1;"fill-extrusion"===n.type?a=!n.isHidden(i)&&n.paint.get("fill-extrusion-opacity")>0:"building"===n.type?a=!n.isHidden(i)&&n.paint.get("building-opacity")>0:"model"===n.type&&(a=!n.isHidden(i)&&n.paint.get("model-opacity").constantOr(1)>0),this.layersGotHidden=this.layersGotHidden||!a&&r.visible,r.visible=a}}updateZOffset(i,r){for(let i of(this.currentBuildingBuckets=[],this.layers)){let n=i.layer,a=this.style.getLayerSourceCache(n),o=1;"fill-extrusion"===n.type?o=i.visible?n.paint.get("fill-extrusion-vertical-scale"):0:"building"===n.type&&(o=i.visible?n.paint.get("building-vertical-scale"):0);let s=a?a.getTile(r):null;if(!s&&a)for(let i in a._tiles){let n=a._tiles[i];if(r.canonical.isChildOf(n.tileID.canonical)){s=n;break}}this.currentBuildingBuckets.push({bucket:s?s.getBucket(n):null,tileID:s?s.tileID:r,verticalScale:o})}i.hasAnyZOffset=!1;let n=!1;for(let a=0;a<i.symbolInstances.length;a++){let o=i.symbolInstances.get(a),s=o.zOffset,l=this._getHeightAtTileOffset(r,o.tileAnchorX,o.tileAnchorY);o.zOffset=l!==-1/0?l:s,n||s===o.zOffset||(n=!0),i.hasAnyZOffset||0===o.zOffset||(i.hasAnyZOffset=!0)}n&&(i.zOffsetBuffersNeedUpload=!0,i.zOffsetSortDirty=!0)}_mapCoordToOverlappingTile(r,n,a,o){let s=n,l=a;if(r.canonical.z!==o.canonical.z){let u=o.canonical,c=1/(1<<r.canonical.z-u.z);s=(n+r.canonical.x*i.r)*c-u.x*i.r|0,l=(a+r.canonical.y*i.r)*c-u.y*i.r|0}return{tileX:s,tileY:l}}_getHeightAtTileOffset(i,r,n){let a,o;for(let s=0;s<this.layers.length;++s){let l=this.layers[s].layer;if("fill-extrusion"!==l.type&&"building"!==l.type)continue;let{bucket:u,tileID:c,verticalScale:d}=this.currentBuildingBuckets[s];if(!u)continue;let{tileX:h,tileY:f}=this._mapCoordToOverlappingTile(i,r,n,c),p=u.getHeightAtTileCoord(h,f);p&&void 0!==p.height&&(p.hidden?a=p.height:o=Math.max(p.height*d,o||0))}if(void 0!==o)return o;for(let o=0;o<this.layers.length;++o){let s=this.layers[o];if("model"!==s.layer.type||!s.visible)continue;let{bucket:l,tileID:u}=this.currentBuildingBuckets[o];if(!l)continue;let{tileX:c,tileY:d}=this._mapCoordToOverlappingTile(i,r,n,u),h=l.getHeightAtTileCoord(c,d);if(h&&!h.hidden)return void 0===h.height&&void 0!==a?Math.min(h.maxHeight,a)*h.verticalScale:h.height?h.height*h.verticalScale:-1/0}return this.layersGotHidden?0:-1/0}}function nF(){return c||(c=new tR),c}function nN(r){r=r.slice();let n=Object.create(null);for(let i of r)n[i.id]=i;for(let a=0;a<r.length;a++){let o=r[a];if(o&&"ref"in o){let s=n[o.ref];
110s&&(r[a]=function(r,n){let a={};for(let i in r)"ref"!==i&&(a[i]=r[i]);return i.eY.forEach(i=>{i in n&&(a[i]=n[i])}),a}(o,s))}}return r}let nj={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setSlot:"setSlot",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setSnow:"setSnow",setRain:"setRain",setCamera:"setCamera",setLights:"setLights",setProjection:"setProjection",addImport:"addImport",removeImport:"removeImport",updateImport:"updateImport",addIconset:"addIconset",removeIconset:"removeIconset"};function nz(i,r,n){n.push({command:nj.addSource,args:[i,r[i]]})}function nB(i,r,n){r.push({command:nj.removeSource,args:[i]}),n[i]=!0}function nU(r,n,a,o,s,l){let u;for(u in n=n||{},r=r||{})Object.hasOwn(r,u)&&(i.c2(r[u],n[u])||a.push({command:l,args:[o,u,n[u],s]}));for(u in n)Object.hasOwn(n,u)&&!Object.hasOwn(r,u)&&(i.c2(r[u],n[u])||a.push({command:l,args:[o,u,n[u],s]}))}function nV(i){return i.id}function nH(i,r){return i[r.id]=r,i}function nG(r,n,a){let o=n.createTileMatrix(r,r.worldSize,a.toUnwrapped());return i.er(new Float32Array(16),r.projMatrix,o)}function nq(i,r,n){return r.name===n.projection.name?i.projMatrix:nG(n,r,i)}class n${constructor(i,r,n,a){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?r:-r))):a&&n?1:0,this.placed=n}isHidden(){return 0===this.opacity&&!this.placed}}class nW{constructor(i,r,n,a,o,s=!1){this.text=new n$(i?i.text:null,r,n,o),this.icon=new n$(i?i.icon:null,r,a,o),this.clipped=s}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class nY{constructor(i,r,n,a=!1){this.text=i,this.icon=r,this.skipFade=n,this.clipped=a}}class nZ{constructor(){this.invProjMatrix=i.bT(),this.viewportMatrix=i.bT(),this.circles=[]}}class nK{constructor(i,r,n,a,o){this.bucketInstanceId=i,this.featureIndex=r,this.sourceLayerIndex=n,this.bucketIndex=a,this.tileID=o}}class nX{constructor(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}}get(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){let r=++this.maxGroupID;this.collisionGroups[i]={ID:r,predicate:i=>i.collisionGroupID===r}}return this.collisionGroups[i]}}function nQ(r,n,a,o,s){let{horizontalAlign:l,verticalAlign:u}=i.cE(r),c=i.cj(r,o);return new i.au(-(l-.5)*n+c[0]*s,-(u-.5)*a+c[1]*s)}function nJ(r,n,a,o,s){let l=new i.au(r,n);return a&&l._rotate(o?s:-s),l}function n1(r,n,a,o){let{leftJustifiedTextSymbolIndex:s,centerJustifiedTextSymbolIndex:l,rightJustifiedTextSymbolIndex:u,verticalPlacedTextSymbolIndex:c,crossTileID:d}=a,h=i.cF(n),f=o===i.bg.vertical?c:"left"===h?s:"center"===h?l:"right"===h?u:-1;s>=0&&(r.text.placedSymbolArray.get(s).crossTileID=f>=0&&s!==f?0:d),l>=0&&(r.text.placedSymbolArray.get(l).crossTileID=f>=0&&l!==f?0:d),u>=0&&(r.text.placedSymbolArray.get(u).crossTileID=f>=0&&u!==f?0:d),c>=0&&(r.text.placedSymbolArray.get(c).crossTileID=f>=0&&c!==f?0:d)}function n0(r,n,a){let o=n===i.bg.horizontal||n===i.bg.horizontalOnly?n:0,s=n===i.bg.vertical?n:0,{leftJustifiedTextSymbolIndex:l,centerJustifiedTextSymbolIndex:u,rightJustifiedTextSymbolIndex:c,verticalPlacedTextSymbolIndex:d}=a,h=r.text.placedSymbolArray;l>=0&&(h.get(l).placedOrientation=o),u>=0&&(h.get(u).placedOrientation=o),c>=0&&(h.get(c).placedOrientation=o),d>=0&&(h.get(d).placedOrientation=s)}class n2{constructor(i,r,n,a,o,s,l,u){this.transform=i.clone(),this.projection=i.projection.name,this.algorithm=a,this.collisionIndex=this.algorithm.createCollisionDetector(this.transform,s,u),this.buildingIndex=l,this.frontCutoffStart=0,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=r,this.retainedQueryData={},this.collisionGroups=new nX(n),this.collisionCircleArrays={},this.prevPlacement=o,o&&(o.prevPlacement=void 0),this.placedOrientations={},this.lastReplacementSourceUpdateTime=0}getBucketParts(r,n,a,o,s=1){var l,u,c;let d=a.getBucket(n),h=a.latestFeatureIndex;if(!d||!h||n.fqid!==d.layerIds[0])return;let f=d.layers[0].layout,p=d.layers[0].paint,m=a.collisionBoxArray,g=Math.pow(2,this.transform.zoom-a.tileID.overscaledZ
110),_=a.tileSize/i.r,y=a.tileID.toUnwrapped();this.transform.setProjection(d.projection);let v=(l=a.tileID,u=d.getProjection(),c=this.transform,u.name===this.projection?c.calculateProjMatrix(l.toUnwrapped()):nG(c,u,l)),x="map"===f.get("text-pitch-alignment"),b="map"===f.get("text-rotation-alignment");n.compileFilter(n.options);let w=n.dynamicFilter(),T=n.dynamicFilterNeedsFeature(),E=n.dynamicFilterNeedsGeometry(),S=this.transform.calculatePixelsToTileUnitsMatrix(a),A=tY(v,a.tileID.canonical,x,b,this.transform,d.getProjection(),S),C=null,I=d.getProjection().createInversionMatrix(this.transform,a.tileID.canonical);if(x){let r=tZ(v,a.tileID.canonical,x,b,this.transform,d.getProjection(),S);C=i.er([],this.transform.labelPlaneMatrix,r)}let k=null;w&&a.latestFeatureIndex&&(k={unwrappedTileID:y,dynamicFilter:w,dynamicFilterNeedsFeature:T,needGeometry:E}),this.retainedQueryData[d.bucketInstanceId]=new nK(d.bucketInstanceId,h,d.sourceLayerIndex,d.index,a.tileID);let[R,M]=d.layers[0].layout.get("text-size-scale-range"),L=i.bG(s,R,M),[P,O]=f.get("icon-size-scale-range"),D=i.bG(s,P,O),F={bucket:d,layout:f,paint:p,posMatrix:v,invMatrix:I,mercatorCenter:[i.ek(this.transform.center.lng),i.el(this.transform.center.lat)],textLabelPlaneMatrix:A,labelToScreenMatrix:C,clippingData:k,scale:g,textPixelRatio:_,holdingForFade:a.holdingForFade(),collisionBoxArray:m,partiallyEvaluatedTextSize:i.ci(d.textSizeData,this.transform.zoom,L),partiallyEvaluatedIconSize:i.ci(d.iconSizeData,this.transform.zoom,D),collisionGroup:this.collisionGroups.get(d.sourceID),latestFeatureIndex:a.latestFeatureIndex};if(o)for(let i of d.sortKeyRanges){let{sortKey:n,symbolInstanceStart:a,symbolInstanceEnd:o}=i;r.push({sortKey:n,symbolInstanceStart:a,symbolInstanceEnd:o,parameters:F})}else r.push({symbolInstanceStart:0,symbolInstanceEnd:d.symbolInstances.length,parameters:F})}placeLayerBucketPart(i,r,n,a,o=1){this.algorithm.placeLayerBucketPart(this,i,r,n,a,o)}commit(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;let r=this.prevPlacement,n=!1;this.prevZoomAdjustment=r?r.zoomAdjustment(this.transform.zoom):0;let a=r?r.symbolFadeChange(i):1,o=r?r.opacities:{},s=r?r.variableOffsets:{},l=r?r.placedOrientations:{};for(let i in this.placements){let r=this.placements[i],s=o[i];s?(this.opacities[i]=new nW(s,a,r.text,r.icon,null,r.clipped),n=n||r.text!==s.text.placed||r.icon!==s.icon.placed):(this.opacities[i]=new nW(null,a,r.text,r.icon,r.skipFade,r.clipped),n=n||r.text||r.icon)}for(let i in o){let r=o[i];if(!this.opacities[i]){let o=new nW(r,a,!1,!1);o.isHidden()||(this.opacities[i]=o,n=n||r.text.placed||r.icon.placed)}}for(let i in s)this.variableOffsets[i]||!this.opacities[i]||this.opacities[i].isHidden()||(this.variableOffsets[i]=s[i]);for(let i in l)this.placedOrientations[i]||!this.opacities[i]||this.opacities[i].isHidden()||(this.placedOrientations[i]=l[i]);n?this.lastPlacementChangeTime=i:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=r?r.lastPlacementChangeTime:i)}updateLayerOpacities(i,r,n,a){a&&(this.lastReplacementSourceUpdateTime=a.updateTime);let o=new Set;for(let s of r){let r=s.getBucket(i);r&&s.latestFeatureIndex&&i.fqid===r.layerIds[0]&&(this.updateBucketOpacities(r,o,s,s.collisionBoxArray,n,a,s.tileID,i.scope),"offset"===r.elevationType&&this.buildingIndex&&this.buildingIndex.updateZOffset(r,s.tileID),"road"===r.elevationType&&r.hdExt&&r.hdExt.updateRoadElevation(r,s.tileID.canonical),r.updateZOffset())}}updateBucketOpacities(r,n,a,o,s,l,u,c){r.hasTextData()&&r.text.opacityVertexArray.clear(),r.hasIconData()&&r.icon.opacityVertexArray.clear(),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexArray.clear(),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexArray.clear();let d=r.layers[0].layout,h=r.layers[0].paint,f=!!r.layers[0].dynamicFilter(),p=new nW(null,0,!1,!1,!0),m=d.get("text-allow-overlap"),g=d.get("icon-allow-overlap"),_=d.get("text-variable-anchor"),y="map"===d.get("text-rotation-alignment"),v="map"===d.get("text-pitch-alignment"),x=h.get("symbol-z-offset"),b="sea"===d.get("symbol-elevation-reference"),w=!x.isConstant(),T=new nW(null,0,m&&(g||!r.hasIconData()||d.get("icon-optional")),g&&(m||!r.hasTextData()||d.get("text-optional")),!0);!r.collisionArrays&&o&&(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData())&&r.deserializeCollisionBoxes(o);let E=(i,r,n)=>{for(let a=0;a<r/4;a++)i.opacityVertexArray.emplaceBack(n)},S=0;l&&r.updateReplacement(u,l),this.collisionIndex.clearClippedSymbol
110sForBucket(r.bucketInstanceId);for(let o=0;o<r.symbolInstances.length;o++){let d=r.symbolInstances.get(o),{numHorizontalGlyphVertices:h,numVerticalGlyphVertices:m,crossTileID:g,numIconVertices:A,tileAnchorX:C,tileAnchorY:I}=d,k=null,R=this.retainedQueryData[r.bucketInstanceId];w&&d&&R&&(k=a.latestFeatureIndex.loadFeature({featureIndex:d.featureIndex,bucketIndex:R.bucketIndex,sourceLayerIndex:R.sourceLayerIndex,layoutVertexArrayOffset:0}));let M=x.evaluate(k,{}),L=n.has(g),P=this.opacities[g];L?P=p:P||(P=T,this.opacities[g]=P),n.add(g);let O=h>0||m>0,D=A>0,F=this.placedOrientations[g],N=F===i.bg.vertical,j=F===i.bg.horizontal||F===i.bg.horizontalOnly;!O&&!D||P.isHidden()||S++;let z=!1;if((O||D)&&l)for(let n of r.activeReplacements){if(i.fp(n,s,i.a8.Symbol,c)||n.min.x>C||C>n.max.x||n.min.y>I||I>n.max.y)continue;let r=i.fN(C,I,u.canonical,n.footprintTileId.canonical);if(z=i.eI(r,n.footprint))break}if(z&&this.collisionIndex.markSymbolAsClipped(r.bucketInstanceId,d.featureIndex),O){let i=z?n9:n4(P.text);E(r.text,h,N?n9:i),E(r.text,m,j?n9:i);let n=P.text.isHidden(),{leftJustifiedTextSymbolIndex:a,centerJustifiedTextSymbolIndex:o,rightJustifiedTextSymbolIndex:s,verticalPlacedTextSymbolIndex:l}=d,u=r.text.placedSymbolArray,c=n||N?1:0;a>=0&&(u.get(a).hidden=c),o>=0&&(u.get(o).hidden=c),s>=0&&(u.get(s).hidden=c),l>=0&&(u.get(l).hidden=n||j?1:0);let f=this.variableOffsets[g];f&&n1(r,f.anchor,d,F);let p=this.placedOrientations[g];p&&(n1(r,"left",d,p),n0(r,p,d))}if(D){let i=z?n9:n4(P.icon),{placedIconSymbolIndex:n,verticalPlacedIconSymbolIndex:a}=d,o=r.icon.placedSymbolArray,s=+!!P.icon.isHidden();n>=0&&(E(r.icon,A,N?n9:i),o.get(n).hidden=s),a>=0&&(E(r.icon,d.numVerticalIconVertices,j?n9:i),o.get(a).hidden=s)}if(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData()){let n=r.collisionArrays[o];if(n){let a=new i.au(0,0),o=!0;if(n.textBox||n.verticalTextBox){if(_){let i=this.variableOffsets[g];i?(a=nQ(i.anchor,i.width,i.height,i.textOffset,i.textScale),y&&a._rotate(v?this.transform.angle:-this.transform.angle)):o=!1}f&&(o=!P.clipped),n.textBox&&n5(r.textCollisionBox.collisionVertexArray,P.text.placed,!o||N,M,b,a.x,a.y),n.verticalTextBox&&n5(r.textCollisionBox.collisionVertexArray,P.text.placed,!o||j,M,b,a.x,a.y)}let s=o&&!!(!j&&n.verticalIconBox);n.iconBox&&n5(r.iconCollisionBox.collisionVertexArray,P.icon.placed,s,M,b,d.hasIconTextFit?a.x:0,d.hasIconTextFit?a.y:0),n.verticalIconBox&&n5(r.iconCollisionBox.collisionVertexArray,P.icon.placed,!s,M,b,d.hasIconTextFit?a.x:0,d.hasIconTextFit?a.y:0)}}}if(r.fullyClipped=0===S,r.sortFeatures(this.transform.angle),this.retainedQueryData[r.bucketInstanceId]&&(this.retainedQueryData[r.bucketInstanceId].featureSortOrder=r.featureSortOrder),r.hasTextData()&&r.text.opacityVertexBuffer&&r.text.opacityVertexBuffer.updateData(r.text.opacityVertexArray),r.hasIconData()&&r.icon.opacityVertexBuffer&&r.icon.opacityVertexBuffer.updateData(r.icon.opacityVertexArray),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexBuffer&&r.iconCollisionBox.collisionVertexBuffer.updateData(r.iconCollisionBox.collisionVertexArray),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexBuffer&&r.textCollisionBox.collisionVertexBuffer.updateData(r.textCollisionBox.collisionVertexArray),r.bucketInstanceId in this.collisionCircleArrays){let i=this.collisionCircleArrays[r.bucketInstanceId];r.placementInvProjMatrix=i.invProjMatrix,r.placementViewportMatrix=i.viewportMatrix,r.collisionCircleArray=i.circles,delete this.collisionCircleArrays[r.bucketInstanceId]}}symbolFadeChange(i){return 0===this.fadeDuration?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(i){return Math.max(0,(this.transform.zoom-i)/1.5)}hasTransitions(i){return i-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(i,r){let n=this.zoomAtLastRecencyCheck===r?1-this.zoomAdjustment(r):1;return this.zoomAtLastRecencyCheck=r,this.commitTime+this.fadeDuration*n>i}isStale(){return this.stale}setStale(){this.stale=!0}}function n5(i,r,n,a,o,s,l){i.emplaceBack(+!!r,+!!n,s||0,l||0,a,+!!o),i.emplaceBack(+!!r,+!!n,s||0,l||0,a,+!!o),i.emplaceBack(+!!r,+!!n,s||0,l||0,a,+!!o),i.emplaceBack(+!!r,+!!n,s||0,l||0,a,+!!o)}function n4(i){if(0===i.opacity&&!i.placed)return 0;if(1===i.opacity&&i.placed)return 0xffffffff;let r=+!!i.placed,n=Math.floor(127*i.opacity);return 0x2000000*n+0x1000000*r+131072*n+65536*r+512*n+256*r+2*n+r}let n9=0;class n3{constructor(i,r){this.reset(i,r)}reset(i,r){this.points=i||[],this._distances=[0];for(let i=1;i<this.points.length;i++)this._distances[i]=this._distances[i-1]+this.points[i].dist(this.points[i-1]);this.length=this._distances.at(-1),this.padding=Math.min(r||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(r){if(1===this.points.length)return this.points[0];r=i.bG(r,0,1);let n=1,a=this._distances[n],o=r*this.paddedLength+this.padding;
110for(;a<o&&n<this._distances.length;)a=this._distances[++n];let s=n-1,l=this._distances[s],u=a-l,c=u>0?(o-l)/u:0;return this.points[s].mult(1-c).add(this.points[n].mult(c))}}class n8{constructor(i,r){this.gridRightBoundary=0,this.gridBottomBoundary=0,this.clippedSymbols=new Map,this.reset(i,r)}reset(r,n){let a=r.width+200,o=r.height+200;a!==this.gridRightBoundary||o!==this.gridBottomBoundary?(this.grid=new i.V(a,o,25),this.ignoredGrid=new i.V(a,o,25)):(this.grid.clear(),this.ignoredGrid.clear()),this.transform=r,this.fogState=n,this.pitchfactor=Math.cos(r._pitch)*r.cameraToCenterDistance,this.screenRightBoundary=r.width+100,this.screenBottomBoundary=r.height+100,this.gridRightBoundary=a,this.gridBottomBoundary=o,this.clippedSymbols.clear()}clearClippedSymbolsForBucket(i){this.clippedSymbols.delete(i)}markSymbolAsClipped(i,r){let n=this.clippedSymbols.get(i);n||(n=new Set,this.clippedSymbols.set(i,n)),n.add(r)}placeCollisionBox(r,n,a,o,s,l,u,c,d,h,f){let p=a.projectedAnchorX,m=a.projectedAnchorY,g=a.projectedAnchorZ,_=a.tileAnchorX,y=a.tileAnchorY,v=a.elevation,x=a.tileID,b=r.getProjection();if(v&&x){let[i,r,n]=b.upVector(x.canonical,a.tileAnchorX,a.tileAnchorY),o=b.upVectorScale(x.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;p+=i*v*o,m+=r*v*o,g+=n*v*o}let w="globe"===r.projection.name,T="globe"===r.projection.name?i.dm(this.transform.zoom):0;if(x&&w&&T<1&&!l){let r=1<<x.canonical.z,n=i.cz(_,y);i.fd(n,n,1/i.r),i.bk(n,n,i.cz(x.canonical.x,x.canonical.y)),i.fd(n,n,1/r),i.fy(n,n,i.cz(o[0],o[1])),n[0]=i.f$(n[0],-.5,.5),i.fd(n,n,i.r);let a=i.cy(n[0],n[1],i.r/(2*Math.PI),1);i.fM(a,a,s),p=i.dY(p,a[0],T),m=i.dY(m,a[1],T),g=i.dY(g,a[2],T)}let E=this.projectAndGetPerspectiveRatio(h,p,m,g,a.tileID,"globe"===b.name||!!v||this.transform.pitch>0,b),S=d*E.perspectiveRatio,A=(a.x1*n+u.x-a.padding)*S+E.point.x,C=(a.y1*n+u.y-a.padding)*S+E.point.y,I=(a.x2*n+u.x+a.padding)*S+E.point.x,k=(a.y2*n+u.y+a.padding)*S+E.point.y,R=E.perspectiveRatio<=.55||E.occluded;return!this.isInsideGrid(A,C,I,k)||!c&&this.grid.hitTest(A,C,I,k,f)||R?{box:[],offscreen:!1,occluded:E.occluded}:{box:[A,C,I,k],offscreen:this.isOffscreen(A,C,I,k),occluded:!1}}placeCollisionCircles(r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y){let v=[],x=this.transform.elevation,b=r.getProjection(),w="road"===r.elevationType,T=!!x||w,E=i.s.getAtTileOffsetFunc(y,this.transform.center.lat,this.transform.worldSize,b),S=new i.au(a.tileAnchorX,a.tileAnchorY),A=new i.au(a.tileAnchorX,a.tileAnchorY),{x:C,y:I,z:k}=b.projectTilePoint(A.x,A.y,y.canonical),R=null;if(T){let i=w&&r.hdExt?r.hdExt.getElevationFeatureForPlacedSymbol(r,r.text,o):null;R={getElevation:E,elevation:x,elevationFeature:i};let[n,a,s]=E(S,x,i);C+=n,I+=a,k+=s}let M="globe"===b.name,L=this.projectAndGetPerspectiveRatio(c,C,I,k,y,M||!!x||this.transform.pitch>0,b),{perspectiveRatio:P}=L,O=(p?u/P:u*P)/i.ao,D=tK(C,I,k,d),F=a.lineOffsetX*O,N=a.lineOffsetY*O,j=Math.cos(i.c4(r.layers[0].layout.get("text-max-angle"))),z=L.signedDistanceFromCamera>0?tJ(O,l,F,N,w&&1===a.flipState,D,A,a,s,d,{},T&&!p?R:null,p&&T,b,y,p,j):null,B=!1,U=!1,V=!0;if(z&&!L.occluded){let r=.5*g*P+_,a=new i.au(-100,-100),o=new i.au(this.screenRightBoundary,this.screenBottomBoundary),s=new n3,{first:l,last:u}=z,c=l.path.length,d=[];for(let i=c-1;i>=1;i--)d.push(l.path[i]);for(let i=1;i<u.path.length;i++)d.push(u.path[i]);let p=2.5*r;h&&(d=d.map(([i,r,n],a)=>(T&&!M&&(n=E(a<c-1?l.tilePath[c-1-a]:u.tilePath[a-c+2],x,R.elevationFeature)[2]),tK(i,r,n,h)))).some(i=>i[3]<=0)&&(d=[]);let y=[];if(d.length>0){let r=1/0,n=-1/0,s=1/0,l=-1/0;for(let i of d)r=Math.min(r,i[0]),s=Math.min(s,i[1]),n=Math.max(n,i[0]),l=Math.max(l,i[1]);n>=a.x&&r<=o.x&&l>=a.y&&s<=o.y&&(y=[d.map(r=>new i.au(r[0],r[1]))],(r<a.x||n>o.x||s<a.y||l>o.y)&&(y=i.bI(y,a.x,a.y,o.x,o.y)))}for(let i of y){s.reset(i,.25*r);let a=0;a=s.length<=.5*r?1:Math.ceil(s.paddedLength/p)+1;for(let i=0;i<a;i++){let o=i/Math.max(a-1,1),l=s.lerp(o),u=l.x+100,c=l.y+100;v.push(u,c,r,0);let d=u-r,h=c-r,p=u+r,g=c+r;if(V=V&&this.isOffscreen(d,h,p,g),U=U||this.isInsideGrid(d,h,p,g),!n&&this.grid.hitTestCircle(u,c,r,m)&&(B=!0,!f))return{circles:[],offscreen:!1,collisionDetected:B,occluded:!1}}}}return{circles:(f||!B)&&U?v:[],offscreen:V,collisionDetected:B,occluded:L.occluded}}queryRenderedSymbols(r){if(0===r.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};let n=[],a=1/0,o=1/0,s=-1/0,l=-1/0;for(let u of r){let r=new i.au(u.x+100,u.y+100);a=Math.min(a,r.x),o=Math.min(o,r.y),s=Math.max(s,r.x),l=Math.max(l,r.y),n.push(r)}let u=this.grid.query(a,o,s,l).concat(this.ignoredGrid.query(a,o,s,l)),c={},d={};for(let r of u){let a=r.key;if(void 0===c[a.bucketInstanceId]&&(c[a.bucketInstanceId]={}),c[a.bucketInstanceId][a.featureIndex])continue;
110let o=this.clippedSymbols.get(a.bucketInstanceId);if(o&&o.has(a.featureIndex))continue;let s=[new i.au(r.x1,r.y1),new i.au(r.x2,r.y1),new i.au(r.x2,r.y2),new i.au(r.x1,r.y2)];i.eO(n,s)&&(c[a.bucketInstanceId][a.featureIndex]=!0,void 0===d[a.bucketInstanceId]&&(d[a.bucketInstanceId]=[]),d[a.bucketInstanceId].push(a.featureIndex))}return d}insertCollisionBox(i,r,n,a,o){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:a,collisionGroupID:o},i[0],i[1],i[2],i[3])}insertCollisionCircles(i,r,n,a,o){let s=r?this.ignoredGrid:this.grid,l={bucketInstanceId:n,featureIndex:a,collisionGroupID:o};for(let r=0;r<i.length;r+=4)s.insertCircle(l,i[r],i[r+1],i[r+2])}projectAndGetPerspectiveRatio(r,n,a,o,s,l,u){let c=[n,a,o,1],d=!1;if(o||this.transform.pitch>0){if(i.fM(c,c,r),this.fogState&&s&&"globe"!==u.name){var h,f,p;let r,l;h=this.fogState,f=s.toUnwrapped(),r=(p=this.transform).calculateFogTileMatrix(f),l=[n,a,o],i.fL(l,l,r),d=tv(h,i.dW(l),p.pitch)>.9}}else t3(c,c,r);let m=c[3];return{point:new i.au((c[0]/m+1)/2*this.transform.width+100,(-c[1]/m+1)/2*this.transform.height+100),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(u)/m*.5,1.5),signedDistanceFromCamera:m,occluded:l&&c[2]>m||d}}isOffscreen(i,r,n,a){return n<100||i>=this.screenRightBoundary||a<100||r>this.screenBottomBoundary}isInsideGrid(i,r,n,a){return n>=0&&i<this.gridRightBoundary&&a>=0&&r<this.gridBottomBoundary}getViewportMatrix(){let r=i.dq([]);return i.fQ(r,r,[-100,-100,0]),r}}let n6={default:new class{createCollisionDetector(i,r,n){return n instanceof n8?(n.reset(i,r),n):new n8(i,r)}shouldPause(i){return i>2}placeLayerBucketPart(r,n,a,o,s,l=1){let{bucket:u,layout:c,paint:d,posMatrix:h,textLabelPlaneMatrix:f,labelToScreenMatrix:p,clippingData:m,textPixelRatio:g,mercatorCenter:_,invMatrix:y,holdingForFade:v,collisionBoxArray:x,partiallyEvaluatedTextSize:b,partiallyEvaluatedIconSize:w,collisionGroup:T,latestFeatureIndex:E}=n.parameters,S=c.get("text-optional"),A=c.get("icon-optional"),C=c.get("text-allow-overlap"),I=c.get("icon-allow-overlap"),k="map"===c.get("text-rotation-alignment"),R="map"===c.get("icon-rotation-alignment"),M="map"===c.get("text-pitch-alignment"),L=d.get("symbol-z-offset"),P="sea"===c.get("symbol-elevation-reference"),O=c.get("symbol-placement"),[D,F]=c.get("text-size-scale-range"),[N,j]=c.get("icon-size-scale-range"),z=i.bG(l,D,F),B=i.bG(l,N,j),U=c.get("text-variable-anchor"),V=k&&"point"!==O,H=U&&u.hasTextData(),G=u.hasIconTextFit()&&H&&u.hasIconData();r.transform.setProjection(u.projection);let q=H||V,$=R&&"point"!==O||G,W=C&&(I||!u.hasIconData()||A),Y=I&&(C||!u.hasTextData()||S),Z=!L.isConstant();!u.collisionArrays&&x&&u.deserializeCollisionBoxes(x),o&&s&&u.updateCollisionDebugBuffers(r.transform.zoom,x,z,B);let K=(n,s,l)=>{let{crossTileID:d,numVerticalGlyphVertices:x}=n,R=null;if(m&&m.dynamicFilterNeedsFeature||Z){let a=r.retainedQueryData[u.bucketInstanceId],o=E.loadFeature({featureIndex:n.featureIndex,bucketIndex:a.bucketIndex,sourceLayerIndex:a.sourceLayerIndex,layoutVertexArrayOffset:0}),s=o.properties?o.properties.worldview:null;if(u.localizable&&u.worldview&&"string"==typeof s)if("all"===s)o.properties.$localized=!0;else{if(!s.split(",").includes(u.worldview))return;o.properties.$localized=!0,o.properties.worldview=u.worldview}R=m&&m.needGeometry?i.fJ(o,!0):o}if(m&&!(0,m.dynamicFilter)({zoom:r.transform.zoom,pitch:r.transform.pitch,worldview:u.worldview},R,r.retainedQueryData[u.bucketInstanceId].tileID.canonical,new i.au(n.tileAnchorX,n.tileAnchorY),r.transform.calculateDistanceTileData(m.unwrappedTileID)))return r.placements[d]=new nY(!1,!1,!1,!0),void a.add(d);let O=L.evaluate(R,{});if((n.zOffset||0)+(O||0)>0&&r.frontCutoffStart>0){let o=2*r.frontCutoffStart-1,s=[n.tileAnchorX,n.tileAnchorY,0,1],l=i.fM(i.bX(),s,h);if(l[1]/l[3]<o)return r.placements[d]=new nY(!1,!1,!1,!0),void a.add(d)}if(a.has(d))return;if(v)return void(r.placements[d]=new nY(!1,!1,!1));let D=!1,F=!1,N=!0,j=!1,z=!1,B=null,V={box:null,offscreen:null,occluded:null},H={box:null},G=null,K=null,X=null,Q=0,J=0,ee=0;l.textFeatureIndex?Q=l.textFeatureIndex:n.useRuntimeCollisionCircles&&(Q=n.featureIndex),l.verticalTextFeatureIndex&&(J=l.verticalTextFeatureIndex);let et=u.hdExt?u.hdExt.elevationFeatures[n.elevationFeatureIndex]:void 0,ei=a=>{a.tileID=r.retainedQueryData[u.bucketInstanceId].tileID;let o=r.transform.elevation;a.elevation=P?O:O+i.s.getAtTileOffset(a.tileID,new i.au(a.tileAnchorX,a.tileAnchorY),o,et),a.elevation+=n.zOffset},er=l.textBox;if(er){ei(er);let a=a=>{let o=i.bg.horizontal;if(u.allowVerticalPlacement&&!a&&r.prevPlacement){let i=r.prevPlacement.placedOrientations[d];i&&(r.placedOrientations[d]=i,n0(u,o=i,n))}return o},o=(r,n)=>{if(u.allowVerticalPlacement&&x>0&&l.verticalTextBox){for(let a of u.writingModes)if(a===i.bg.vertical?H=V=n():V=r(),V&&V.box&&V.box.length)break}else V=r()};if(U){let c=U;if(r.prevPlacement&&r.prevPlacement.variableOffsets[d]){let i=r.prevPlacement.variableOffsets[d];
110c.indexOf(i.anchor)>0&&(c=c.filter(r=>r!==i.anchor)).unshift(i.anchor)}let f=(i,a,o)=>{let l=u.getSymbolInstanceTextSize(b,n,r.transform.zoom,s),d=(i.x2-i.x1)*l+2*i.padding,f=(i.y2-i.y1)*l+2*i.padding,p=n.hasIconTextFit&&!I?a:null;p&&ei(p);let m={box:[],offscreen:!1,occluded:!1},v=C?2*c.length:c.length;for(let a=0;a<v;++a){let v=this.attemptAnchorPlacement(r,c[a%c.length],i,_,y,q,d,f,l,k,M,g,h,T,a>=c.length,n,s,u,o,p,b,w);if(v&&(m=v.placedGlyphBoxes)&&m.box&&m.box.length){D=!0,B=v.shift;break}}return m};o(()=>f(er,l.iconBox,i.bg.horizontal),()=>{let r=l.verticalTextBox;return r&&ei(r),u.allowVerticalPlacement&&!(V&&V.box&&V.box.length)&&x>0&&r?f(r,l.verticalIconBox,i.bg.vertical):{box:null,offscreen:null,occluded:null}}),V&&(D=V.box,N=V.offscreen,j=V.occluded);let p=a(!(!V||!V.box));if(!D&&r.prevPlacement){let i=r.prevPlacement.variableOffsets[d];i&&(r.variableOffsets[d]=i,n1(u,i.anchor,n,p))}}else{let c=(a,o)=>{let l=u.getSymbolInstanceTextSize(b,n,r.transform.zoom,s),c=r.collisionIndex.placeCollisionBox(u,l,a,_,y,q,new i.au(0,0),C,g,h,T.predicate);return c&&c.box&&c.box.length&&(n0(u,o,n),r.placedOrientations[d]=o),c};o(()=>c(er,i.bg.horizontal),()=>{let r=l.verticalTextBox;return u.allowVerticalPlacement&&x>0&&r?(ei(r),c(r,i.bg.vertical)):{box:null,offscreen:null,occluded:null}}),a(!!(V&&V.box&&V.box.length))}}if(D=(G=V)&&G.box&&G.box.length>0,N=G&&G.offscreen,j=G&&G.occluded,n.useRuntimeCollisionCircles){let a=n.centerJustifiedTextSymbolIndex>=0?n.centerJustifiedTextSymbolIndex:n.verticalPlacedTextSymbolIndex,s=u.text.placedSymbolArray.get(a),l=i.ch(u.textSizeData,b,s),d=c.get("text-padding");K=r.collisionIndex.placeCollisionCircles(u,C,s,a,u.lineVertexArray,u.glyphOffsetArray,l,h,f,p,o,M,T.predicate,n.collisionCircleDiameter*l/i.ao,d,r.retainedQueryData[u.bucketInstanceId].tileID),D=C||K.circles.length>0&&!K.collisionDetected,N=N&&K.offscreen,j=K.occluded}if(l.iconFeatureIndex&&(ee=l.iconFeatureIndex),l.iconBox){let a=a=>{ei(a);let o=n.hasIconTextFit&&B?nJ(B.x,B.y,k,M,r.transform.angle):new i.au(0,0),s=u.getSymbolInstanceIconSize(w,r.transform.zoom,n.placedIconSymbolIndex);return r.collisionIndex.placeCollisionBox(u,s,a,_,y,$,o,I,g,h,T.predicate)};F=H&&H.box&&H.box.length&&l.verticalIconBox?(X=a(l.verticalIconBox)).box.length>0:(X=a(l.iconBox)).box.length>0,N=N&&X.offscreen,z=X.occluded}let en=S||0===n.numHorizontalGlyphVertices&&0===x,ea=A||0===n.numIconVertices;if(en||ea?ea?en||(F=F&&D):D=F&&D:F=D=F&&D,D&&G&&G.box&&r.collisionIndex.insertCollisionBox(G.box,c.get("text-ignore-placement"),u.bucketInstanceId,H&&H.box&&J?J:Q,T.ID),F&&X&&r.collisionIndex.insertCollisionBox(X.box,c.get("icon-ignore-placement"),u.bucketInstanceId,ee,T.ID),K&&(D&&r.collisionIndex.insertCollisionCircles(K.circles,c.get("text-ignore-placement"),u.bucketInstanceId,Q,T.ID),o)){let i=u.bucketInstanceId,n=r.collisionCircleArrays[i];void 0===n&&(n=r.collisionCircleArrays[i]=new nZ);for(let i=0;i<K.circles.length;i+=4)n.circles.push(K.circles[i+0]),n.circles.push(K.circles[i+1]),n.circles.push(K.circles[i+2]),n.circles.push(+!!K.collisionDetected)}let eo="globe"!==u.projection.name;W=W&&(eo||!j),Y=Y&&(eo||!z),r.placements[d]=new nY(D||W,F||Y,N||u.justReloaded),a.add(d)},X=r.retainedQueryData[u.bucketInstanceId].tileID;if("offset"===u.elevationType&&r.buildingIndex&&r.buildingIndex.updateZOffset(u,X),"road"===u.elevationType&&u.hdExt&&u.hdExt.updateRoadElevation(u,X.canonical),u.updateZOffset(),u.sortFeaturesByY){let n=u.getSortedSymbolIndexes(r.transform.angle);for(let i=n.length-1;i>=0;--i){let r=n[i];K(u.symbolInstances.get(r),r,u.collisionArrays[r])}u.hasAnyZOffset&&i.f_(`${u.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(u.hasAnyZOffset){let i=u.getSortedIndexesByZOffset();for(let r=0;r<i.length;++r){let n=i[r];K(u.symbolInstances.get(n),n,u.collisionArrays[n])}}else for(let i=n.symbolInstanceStart;i<n.symbolInstanceEnd;i++)K(u.symbolInstances.get(i),i,u.collisionArrays[i]);if(o&&u.bucketInstanceId in r.collisionCircleArrays){let n=r.collisionCircleArrays[u.bucketInstanceId];i.dr(n.invProjMatrix,h),n.viewportMatrix=r.collisionIndex.getViewportMatrix()}u.justReloaded=!1}attemptAnchorPlacement(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w,T){let{textOffset0:E,textOffset1:S,crossTileID:A}=_,C=[E,S],I=nQ(r,l,u,C,c),k=i.collisionIndex.placeCollisionBox(v,c,n,a,o,s,nJ(I.x,I.y,d,h,i.transform.angle),g,f,p,m.predicate);if(b){let r=v.getSymbolInstanceIconSize(T,i.transform.zoom,_.placedIconSymbolIndex);if(0===i.collisionIndex.placeCollisionBox(v,r,b,a,o,s,nJ(I.x,I.y,d,h,i.transform.angle),g,f,p,m.predicate).box.length)return}if(k.box.length>0){let n;return i.prevPlacement&&i.prevPlacement.variableOffsets[A]&&i.prevPlacement.placements[A]&&i.prevPlacement.placements[A].text&&(n=i.prevPlacement.variableOffsets[A].anchor),i.variableOffsets[A]={textOffset:C,width:l,height:u,anchor:r,textScale:c,prevAnchor:n},n1(v,r,_,x),v.allowVerticalPlacement&&(n0(v,x,_),i.placedOrientations[A]=x),{shift:I,placedGlyphBoxes:k}}}}};
110class n7{constructor(i){this._sortAcrossTiles="viewport-y"!==i.layout.get("symbol-z-order")&&void 0!==i.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(i,r,n,a,o,s){let l=this._bucketParts;for(;this._currentTileIndex<i.length;)if(r.getBucketParts(l,a,i[this._currentTileIndex],this._sortAcrossTiles,s),this._currentTileIndex++,o())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,l.sort((i,r)=>i.sortKey-r.sortKey));this._currentPartIndex<l.length;){let i=l[this._currentPartIndex];if(r.placeLayerBucketPart(i,this._seenCrossTileIDs,n,0===i.symbolInstanceStart,s),this._currentPartIndex++,o())return!0}return!1}}class ae{constructor(){this._retiredCI=null}startNewPlacement(i,r,n,a,o,s,l,u,c){return this.placement=new n2(i,a,o,n6[c||"default"],s,l,u,this._retiredCI),this._retiredCI=null,this._currentPlacementIndex=r.length-1,this._forceFullPlacement=!1,this._showCollisionBoxes=n,this._fadeDuration=a,this._done=!1,this._inProgressLayer=null,this}requestFullPlacement(){this._forceFullPlacement=!0}isFullPlacementRequested(){return this._forceFullPlacement}setStale(){this.placement&&(this.placement.stale=!0)}isStale(){return!!this.placement&&this.placement.stale}isDone(){return this._done}continuePlacement(r,n,a,o,s){let l=i.co.now(),u=()=>!this.isFullPlacementRequested()&&0!==this._fadeDuration&&this.placement.algorithm.shouldPause(i.co.now()-l);for(;this._currentPlacementIndex>=0;){let l=n[r[this._currentPlacementIndex]],c=this.placement.collisionIndex.transform.zoom;if("symbol"===l.type&&"none"!==l.visibility&&(!l.minzoom||l.minzoom<=c)&&(!l.maxzoom||l.maxzoom>c)){let r=l.layout.get("symbol-z-elevate"),n=void 0!==l.layout.get("symbol-sort-key").constantOr(1),c=l.layout.get("symbol-z-order"),d="viewport-y"===c||"auto"===c&&!("viewport-y"!==c&&n),h=l.layout.get("text-allow-overlap")||l.layout.get("icon-allow-overlap")||l.layout.get("text-ignore-placement")||l.layout.get("icon-ignore-placement"),f=d&&h,p=this._inProgressLayer=this._inProgressLayer||new n7(l),m=i.ea(l.source,l.scope);if(p.continuePlacement(r||f?o[m]:a[m],this.placement,this._showCollisionBoxes,l,u,s))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._forceFullPlacement=!1,this._done=!0}commit(i){return this._retiredCI=this.placement.prevPlacement?this.placement.prevPlacement.collisionIndex:null,this.placement.commit(i),this.placement}}let at=512/i.r/2;class ai{constructor(r,n,a){this.tileID=r,this.bucketInstanceId=a,this.index=new i.a6(n.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const o=r.canonical.x*i.r,s=r.canonical.y*i.r;for(let i=0;i<n.length;i++){const{key:r,crossTileID:a,tileAnchorX:l,tileAnchorY:u}=n.get(i),c=Math.floor((o+l)*at),d=Math.floor((s+u)*at);this.index.add(c,d),this.keys.push(r),this.crossTileIDs.push(a)}this.index.finish()}findMatches(r,n,a){let o=this.tileID.canonical.z<n.canonical.z?1:Math.pow(2,this.tileID.canonical.z-n.canonical.z),s=at/Math.pow(2,n.canonical.z-this.tileID.canonical.z),l=n.canonical.x*i.r,u=n.canonical.y*i.r;for(let i=0;i<r.length;i++){let n=r.get(i);if(n.crossTileID)continue;let{key:c,tileAnchorX:d,tileAnchorY:h}=n,f=Math.floor((l+d)*s),p=Math.floor((u+h)*s);for(let i of this.index.range(f-o,p-o,f+o,p+o).sort((i,r)=>i-r)){let r=this.crossTileIDs[i];if(this.keys[i]===c&&!a.has(r)){a.add(r),n.crossTileID=r;break}}}}}class ar{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class an{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(i){let r=Math.round((i-this.lng)/360);if(0!==r)for(let i in this.indexes){let n=this.indexes[i],a={};for(let i in n){let o=n[i];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+r),a[o.tileID.key]=o}this.indexes[i]=a}this.lng=i}addBucket(i,r,n){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===r.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(let i=0;i<r.symbolInstances.length;i++)r.symbolInstances.get(i).crossTileID=0;this.usedCrossTileIDs[i.overscaledZ]||(this.usedCrossTileIDs[i.overscaledZ]=new Set);let a=this.usedCrossTileIDs[i.overscaledZ];for(let n in this.indexes){let o=this.indexes[n];if(Number(n)>
110i.overscaledZ)for(let n in o){let s=o[n];s.tileID.isChildOf(i)&&s.findMatches(r.symbolInstances,i,a)}else{let s=o[i.scaledTo(Number(n)).key];s&&s.findMatches(r.symbolInstances,i,a)}}for(let i=0;i<r.symbolInstances.length;i++){let o=r.symbolInstances.get(i);o.crossTileID||(o.crossTileID=n.generate(),a.add(o.crossTileID))}return void 0===this.indexes[i.overscaledZ]&&(this.indexes[i.overscaledZ]={}),this.indexes[i.overscaledZ][i.key]=new ai(i,r.symbolInstances,r.bucketInstanceId),!0}removeBucketCrossTileIDs(i,r){for(let n of r.crossTileIDs)this.usedCrossTileIDs[i].delete(n)}removeStaleBuckets(i){let r=!1;for(let n in this.indexes){let a=this.indexes[n];for(let o in a)i[a[o].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,a[o]),delete a[o],r=!0)}return r}}class aa{constructor(){this.layerIndexes={},this.crossTileIDs=new ar,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(i,r,n,a){let o=this.layerIndexes[i.fqid];void 0===o&&(o=this.layerIndexes[i.fqid]=new an);let s=!1,l={};for(let u of("globe"!==a.name&&o.handleWrapJump(n),r)){let r=u.getBucket(i);r&&i.fqid===r.layerIds[0]&&(r.bucketInstanceId||(r.bucketInstanceId=++this.maxBucketInstanceId),o.addBucket(u.tileID,r,this.crossTileIDs)&&(s=!0),l[r.bucketInstanceId]=!0)}return o.removeStaleBuckets(l)&&(s=!0),s}pruneUnusedLayers(i){let r={};for(let n in i.forEach(i=>{r[i]=!0}),this.layerIndexes)r[n]||delete this.layerIndexes[n]}}class ao extends i.y{constructor(i){super(),this.requestManager=i,this.models=Object.create(null),this.models[""]=Object.create(null),this.modelUris=Object.create(null),this.modelUris[""]=Object.create(null),this.modelByURL=Object.create(null),this.numModelsLoading=Object.create(null)}loadModel(r,n){return i.e6(this.requestManager.transformRequest(n,i.aH.Model).url).then(a=>{let o=i.bQ(a),s=new i.ah(r,n,void 0,void 0,o);return s.computeBoundsAndApplyParent(),s}).catch(a=>{if(a&&404===a.status)return null;this.fire(new i.v(Error(`Could not load model ${r} from ${n}: ${a.message}`)))})}load(r,n,a={forceReload:!1}){this.models[n]||(this.models[n]=Object.create(null));let o=Object.keys(r),s=[],l=[];for(let i of o){let o=r[i];this.hasURLBeenRequested(o)&&!a.forceReload||(this.modelByURL[o]={modelId:i,scope:n},s.push(this.loadModel(i,o)),l.push(i)),this.models[n][i]||(this.models[n][i]={model:null,numReferences:1})}this.numModelsLoading[n]=(this.numModelsLoading[n]||0)+l.length,Promise.allSettled(s).then(r=>{for(let i=0;i<r.length;i++){let{status:a}=r[i];if("rejected"===a)continue;let{value:o}=r[i];this.models[n][l[i]]||(this.models[n][l[i]]={model:null,numReferences:1}),this.models[n][l[i]].model=o}this.numModelsLoading[n]-=l.length,this.fire(new i.x("data",{dataType:"style"}))}).catch(r=>{this.fire(new i.v(Error(`Could not load models: ${r.message}`)))})}isLoaded(){for(let i in this.numModelsLoading)if(this.numModelsLoading[i]>0)return!1;return!0}hasModel(i,r,n={exactIdMatch:!1}){return!!(n.exactIdMatch?this.getModel(i,r):this.getModelByURL(this.modelUris[r][i]))}getModel(i,r){return this.models[r]||(this.models[r]=Object.create(null)),this.models[r][i]?this.models[r][i].model:void 0}getModelByURL(i){if(!i)return null;let r=this.modelByURL[i];return r?this.models[r.scope][r.modelId].model:null}hasModelBeenAdded(i,r){return this.models[r]&&void 0!==this.models[r][i]}getModelURIs(i){return this.modelUris[i]||Object.create(null)}addModel(i,r,n){this.models[n]||(this.models[n]=Object.create(null)),this.modelUris[n]||(this.modelUris[n]=Object.create(null));let a=this.requestManager.normalizeModelURL(r);if((this.hasModel(i,n,{exactIdMatch:!0})||this.hasModelBeenAdded(i,n))&&this.modelUris[n][i]===a)this.models[n][i].numReferences++;else if(this.hasURLBeenRequested(a)){let{scope:i,modelId:r}=this.modelByURL[a];this.models[i][r].numReferences++}else this.modelUris[n][i]=a,this.load({[i]:this.modelUris[n][i]},n)}addModelURLs(i,r){this.models[r]||(this.models[r]=Object.create(null)),this.modelUris[r]||(this.modelUris[r]=Object.create(null));let n=this.modelUris[r];for(let r of Object.keys(i))n[r]=this.requestManager.normalizeModelURL(i[r])}
110reloadModels(i){this.load(this.modelUris[i],i,{forceReload:!0})}addModelsFromBucket(i,r){this.models[r]||(this.models[r]=Object.create(null)),this.modelUris[r]||(this.modelUris[r]=Object.create(null));let n=Object.create(null);for(let a of i)this.hasModel(a,r,{exactIdMatch:!0})||this.hasURLBeenRequested(a)?this.models[r][a].numReferences++:this.modelUris[r][a]&&!this.hasURLBeenRequested(a)?n[a]=this.modelUris[r][a]:!this.hasURLBeenRequested(a)&&eJ(a,!1)&&(this.modelUris[r][a]=this.requestManager.normalizeModelURL(a),n[a]=this.modelUris[r][a]);this.load(n,r)}hasURLBeenRequested(i){return void 0!==this.modelByURL[i]}removeModel(i,r,n=!1,a=!1){if(this.models[r]&&this.models[r][i]&&(this.models[r][i].numReferences--,0===this.models[r][i].numReferences||a)){let a=this.modelUris[r][i];n||delete this.modelUris[r][i],delete this.modelByURL[a];let o=this.models[r][i].model;o&&(delete this.models[r][i],o.destroy())}}destroy(){for(let i of Object.keys(this.models))for(let r of Object.keys(this.models[i])){let n=this.models[i][r].model;delete this.models[i][r],n&&n.destroy()}this.models=Object.create(null),this.models[""]=Object.create(null),this.modelUris=Object.create(null),this.modelUris[""]=Object.create(null),this.modelByURL=Object.create(null),this.numModelsLoading=Object.create(null)}listModels(i){return this.models[i]||(this.models[i]=Object.create(null)),Object.keys(this.models[i])}upload(i,r){for(let n in this.models[r]||(this.models[r]=Object.create(null)),this.models[r])this.models[r][n].model&&this.models[r][n].model.upload(i.context)}}let as=["RENDER_SHADOWS","NORMAL_OFFSET"],al=new Set(["symbol","circle"]),au=class r{constructor(){this._queue=[],this._needsBuild=!0,this._idleHandle=null}needsBuild(){return this._needsBuild}buildQueue(i,r,n){null!=this._idleHandle&&"u">typeof cancelIdleCallback&&cancelIdleCallback(this._idleHandle),this._idleHandle=null,this._queue=[],this._needsBuild=!1;let a=n.stylesheet,o=!!n.fog,s=!!(n.getTerrain()||a&&a.terrain),l=!(!n.projection||"globe"!==n.projection.name),u=s||l,c=!(!n.directionalLight||!n.directionalLight.shadowsEnabled()),d=n.map&&n.map.painter,h=!d||!d.context.extParallelShaderCompile,f=!!d&&"mrt-fallback"===d.emissiveMode,p=(i,r=[],n={})=>{this._queue.push({programId:i,params:Object.assign({},n.params,{defines:r,overrideFog:!!n.fog,overrideTerrain:!!n.terrain,overrideGlobe:!!n.globe,overrideRtt:!!n.rtt,precompiled:!0})})};for(let a of i){if("none"===a.visibility)continue;let i=a.getProgramIds();if(i)for(let m of i){if(al.has(m))continue;let i=a.getDefaultProgramParams(m,r.zoom,n._styleColorTheme.lut);if(!i)continue;let g=d?d.getShaderSource(m):null,_=u&&(!g||g.usedDefines.has("RENDER_TO_TEXTURE")),y=f&&_?(i.defines||[]).concat("USE_MRT1"):i.defines;if(h){p(m,i.defines,{params:i}),_&&p(m,y,{params:i,rtt:!0});continue}let v=o&&(!g||g.usedDefines.has("FOG")),x=s&&!a.isDraped()&&(!g||g.usedDefines.has("TERRAIN")),b=l&&(!g||g.usedDefines.has("GLOBE"));for(let r of c&&a.hasElevation()&&(!g||g.usedDefines.has("RENDER_SHADOWS"))?[!1,!0]:[!1]){let n=r?(i.defines||[]).concat(as):i.defines||[];for(let r of x?[!1,!0]:[!1])for(let a of b?[!1,!0]:[!1])for(let o of v?[!1,!0]:[!1])p(m,n,{params:i,fog:o,terrain:r,globe:a})}_&&p(m,y,{params:i,rtt:!0})}}if(p("clippingMask"),s)for(let i of[!1,!0])p("terrainRaster",i?["TERRAIN_VERTEX_MORPHING"]:[],{terrain:!0,fog:o});if(!h){if(i.some(i=>"hillshade"===i.type)&&p("hillshadePrepare"),c)for(let i of[!1,!0])for(let r of[!1,!0]){let n=[];i&&n.push("RENDER_CUTOFF"),n.push("RENDER_SHADOWS"),r&&n.push("NORMAL_OFFSET"),p("groundShadow",n),o&&p("groundShadow",n,{fog:!0})}if(l){for(let i of[[],["TERRAIN_VERTEX_MORPHING"],["GLOBE_POLES"]])for(let r of[!1,!0]){let n=[...i,"PROJECTION_GLOBE_VIEW"];r&&n.push("CUSTOM_ANTIALIASING"),p("globeRaster",n,{terrain:s,globe:!0,fog:o})}for(let i of[!1,!0]){let r=i?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];p("globeAtmosphere",r,{fog:!0,terrain:s,globe:i}),p("globeAtmosphere",[...r,"ALPHA_PASS"],{fog:!0,terrain:s,globe:i})}p("stars",[],{fog:o,terrain:s,globe:!0})}}}_executeBatch(n,a,o){if(o.map&&o.map.isMoving())return void(this._idleHandle=i.co.requestIdleCallback(i=>this._executeBatch(i,a,o)));a.context.sweepPendingPrograms();let s=a.context.extParallelShaderCompile?r.DEADLINE_MARGIN_KHR_MS:r.DEADLINE_MARGIN_SYNC_MS,l=0;for(;this._queue.length>0;){let i=this._queue.shift();if(!i||(a.style=o,a._fogVisible=!!i.params.overrideFog,a.getOrCreateProgram(i.programId,i.params),l++,n.timeRemaining()<=s))break}let u=0===this._queue.length||n.timeRemaining()>s;l>0&&u&&a.context.gl.flush(),this._idleHandle=this._queue.length>0||a.context._pendingPrograms.size>0?i.co.requestIdleCallback(i=>this._executeBatch(i,a,o)):null}processQueue(r,n){0!==this._queue.length&&(null!=this._idleHandle&&"u">typeof cancelIdleCallback&&cancelIdleCallback(this._idleHandle),this._idleHandle=i.co.requestIdleCallback(i=>this._executeBatch(i,r,n)))}reset(){null!=this._idleHandle&&"u">typeof cancelIdleCallback&&cancelIdleCallback(this._idleHandle),this._queue=[],this._idleHandle=null,this._needsBuild=!0}};au.DEADLINE_MARGIN_KHR_MS=5,au.DEADLINE_MARGIN_SYNC_MS=25;let ac=i.fs.colorTheme,ad=new i.ax({data:new i.l(ac.data)});function ah(r){if(r)return r.map(([r,n])=>[r*i.co.devicePixelRatio,n*i.co.devicePixelRatio])}class af{constructor(i,r,n){this.id=i,this.scope=r,this.sourceCache=n,this.pendingRequests=new Set,this.missingRequests=new Set}addPendingRequest(i){this.missingRequests.has(i.name)||this.pendingRequests.has(i.name)||this.pendingRequests.add(i.name)}hasPendingRequests(){return this.pendingRequests.size>0}resolvePendingRequests(){let r=new Map;if(!this.sourceCache.loaded())return r;let n=this.sourceCache.getVisibleCoordinates();if(0===n.length)return r;let a=this.sourceCache.getSource();if(!(a instanceof iH))return r;let o=n.map(i=>this.sourceCache.getTile(i));for(let[n,s]of a.getImages(o,Array.from(this.pendingRequests)))r.set(i.a1.from({name:n,iconsetId:this.id}),s),this.pendingRequests.delete(n);for(let i of this.pendingRequests)this.missingRequests.add(i);return this.pendingRequests.clear(),r}}let ap=(i,r)=>tp(i,r&&r.filter(i=>"source.canvas"!==i.identifier)),am=(r,n)=>{let a=r.type&&!r.array&&Array.isArray(n)?{type:r.type,"property-type":"data-constant"}:void 0;return i.bY(n,a)},ag=i.eF(nj,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setLayerProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setSnow","setRain","setProjection","setCamera","addImport","removeImport","updateImport","addIconset","removeIconset"]),a_=i.eF(nj,["setCenter","setZoom","setBearing","setP
110itch"]),ay=new Set(["background","sky","slot","custom"]),av={version:8,layers:[],sources:{}},ax={duration:300,delay:0};class ab extends i.y{constructor(r,n={}){if(super(),this.map=r,this.scope=n.scope||"",this.globalId=null,this.fragments=[],this.importDepth=n.importDepth||0,this.importsCache=n.importsCache||new Map,this.resolvedImports=n.resolvedImports||new Set,this.transition=Object.assign({},ax),this._buildingIndex=new nD(this),this.crossTileSymbolIndex=new aa,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers=Object.create(null),this._mergedIndoor={},this._indoorEnabled=!1,this._mergedSourceCaches={},this._mergedOtherSourceCaches=Object.create(null),this._mergedSymbolSourceCaches=Object.create(null),this._mergedFillExtrusionSourceCaches=Object.create(null),this._mergedHdRoadCoverageSourceCaches=Object.create(null),this._hdCoverage=null,this._clipLayerPresent=!1,this._hasAppearances=!1,this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._importedAsBasemap=!1,this._changes=n.styleChanges||new ed,this._hasDataDrivenEmissive=!1,this.indoorManager=null,this.dispatcher=n.dispatcher?n.dispatcher:new tM(nF(),this),this.map.painter&&this.map.painter.context){const i=this.map.painter.context.maxUniformBufferBindings,r=Math.floor(this.map.painter.context.maxUniformBlockSize/4);this.dispatcher.broadcast("setContextParams",{maxBindingPoints:i,maxUniformBlockSizeDwords:r,disableSymbolUBO:this.map.painter.context.disableSymbolUBO})}n.imageManager?this.imageManager=n.imageManager:(this.imageManager=new eO(this.map._spriteFormat),this.imageManager.setEventedParent(this)),this.imageManager.addScope(this.scope),this.glyphManager=n.glyphManager?n.glyphManager:new i.U(r._requestManager,n.localFontFamily?i.ad.all:n.localIdeographFontFamily?i.ad.ideographs:i.ad.none,n.localFontFamily||n.localIdeographFontFamily,n.fontstackCompositing),n.modelManager?this.modelManager=n.modelManager:(this.modelManager=new ao(r._requestManager),this.modelManager.setEventedParent(this)),this._layers=Object.create(null),this._sourceCaches={},this._otherSourceCaches=Object.create(null),this._symbolSourceCaches=Object.create(null),this._fillExtrusionSourceCaches=Object.create(null),this._hdCoverage=null,this._loaded=!1,this._initialBroadcastDone=!1,this._programPrecompiler=this.map._precompilePrograms&&this.isRootStyle()?new au:null,this._availableImages=[],this._availableModels={},this._order=[],this._markersNeedUpdate=!1,this.options=n.configOptions?n.configOptions:new Map,this._configDependentLayers=n.configDependentLayers?n.configDependentLayers:new Set,this._indoorDependentLayers=n.indoorDependentLayers?n.indoorDependentLayers:new Set,this._config=n.config,this._styleColorTheme={lut:null,lutLoading:!1,lutLoadingCorrelationID:0,colorTheme:null,colorThemeOverride:n.colorThemeOverride},this._styleColorThemeForScope={},this._initialConfig=n.initialConfig,this.dispatcher.broadcast("setReferrer",i.d4()),this.dispatcher.broadcast("setConfig",i.cJ());const a=this;this._rtlTextPluginCallback=ab.registerForPluginStateChange(r=>{a.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:r.pluginStatus,pluginURL:r.pluginURL},(r,n)=>{if(i.fS(r),n&&n.every(i=>i))for(let i in a._sourceCaches){let r=a._sourceCaches[i],n=r.getSource().type;"vector"!==n&&"geojson"!==n||r.reload()}})}),this.on("data",i=>{if("source"!==i.dataType||"metadata"!==i.sourceDataType)return;let r=this.getOwnSource(i.sourceId);if(r&&r.vectorLayerIds)for(let i in this._layers){let n=this._layers[i];n.source===r.id&&this._validateLayer(n)}})}load(i){return i&&("string"==typeof i?this.loadURL(i):this.loadJSON(i)),this}_getGlobalId(r){if(!r)return null;if("string"==typeof r){if(i.dL(r))return r;let n=i.fw(r);if(!n.startsWith("http"))try{return new URL(n,location.href).toString()}catch(i){}return n}return`json://${i.et(JSON.stringify(r))}`}_diffStyle(r,n,a){this.globalId=this._getGlobalId(r);let o=(i,r)=>{try{r(null,this.setState(i,a))}catch(i){r(i,!1)}};if("string"==typeof r){let a=this.map._requestManager.normalizeStyleURL(r),s=this.map._requestManager.transformRequest(a,i.aH.Style);i.cT(s,(r,a)=>{r?this.fire(new i.v(r)):a&&o(a,n)})}else"object"==typeof r&&o(r,n)}loadURL(r,n={}){this.fire(new i.x("dataloading",{dataType:"style"}));let a="boolean"==typeof n.validate?n.validate:!i.dL(r);this.globalId=this._getGlobalId(r),r=this.map._requestManager.normalizeStyleURL(r,n.accessToken),this.resolvedImports.add(r);let o=this.importsCache.get(r);if(o)return this._load(o,a);let s=this.map._requestManager.transformRequest(r,i.aH.Style);this._request=i.cT(s,(n,o)=>
110{if(this._request=null,n)this.fire(new i.v(n));else if(o)return this.importsCache.set(r,o),this._load(o,a)})}loadJSON(r,n={}){this.fire(new i.x("dataloading",{dataType:"style"})),this.globalId=this._getGlobalId(r),this._request=i.co.frame(()=>{this._request=null,this._load(r,!1!==n.validate)})}loadEmpty(){this.fire(new i.x("dataloading",{dataType:"style"})),this._load(av,!1)}_loadImports(r,n,a){if(this.importDepth>=4)return i.f_("Style doesn't support nesting deeper than 5"),Promise.resolve();let o=[];for(let s of r){let r=this._createFragmentStyle(s),l=new Promise(i=>{r.once("style.import.load",i),r.once("error",i)}).then(()=>{this.mergeAll(),this.fire(new i.x("data",{dataType:"style"}))});if(o.push(l),this.resolvedImports.has(s.url)){r.loadEmpty();continue}let u=s.data||this.importsCache.get(s.url);u?(s.data?(r.fire(new i.x("dataloading",{dataType:"style"})),r.globalId=r._getGlobalId(u),queueMicrotask(()=>r._load(u,n))):r.loadJSON(u,{validate:n}),this._isInternalStyle(u)&&(r.globalId=null)):s.url?r.loadURL(s.url,{validate:n}):r.loadEmpty();let c={style:r,id:s.id,config:s.config};if(a){let i=this.fragments.findIndex(({id:i})=>i===a);this.fragments=this.fragments.slice(0,i).concat(c).concat(this.fragments.slice(i))}else this.fragments.push(c)}return Promise.allSettled(o)}getImportGlobalIds(i=this,r=new Set){for(let n of i.fragments)n.style.globalId&&r.add(n.style.globalId),this.getImportGlobalIds(n.style,r);return[...r.values()]}_createFragmentStyle(r){let n,a=this.scope?i.ea(r.id,this.scope):r.id,o=this._initialConfig&&this._initialConfig[a];(r.config||o)&&(n=Object.assign({},r.config,o));let s=new ab(this.map,{scope:a,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:n,configOptions:this.options,colorThemeOverride:r["color-theme"],configDependentLayers:this._configDependentLayers,indoorDependentLayers:this._indoorDependentLayers});return s.setEventedParent(this.map,{style:s}),s}_reloadImports(i=!1){this.mergeAll(),this._updateMapProjection(),i||this.updateConfigDependencies(),this._updateLayers(this._indoorDependentLayers),this.map._triggerCameraUpdate(this.camera),(!i||this.isRootStyle()||this.map.style._initialBroadcastDone)&&(i&&this.isRootStyle()?(this.forEachFragmentStyle(i=>{this.dispatcher.broadcast("setLayers",{layers:i._serializeLayers(i._order),scope:i.scope,options:i.options})}),this._initialBroadcastDone=!0):this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}))}_isInternalStyle(i){return this.isRootStyle()&&(i.fragment||!!i.schema&&!1!==i.fragment)}_load(r,n){if(this._isInternalStyle(r)){let i=Object.assign({},av,{imports:[{id:"basemap",data:r,url:""}]},r.center?{center:r.center}:{},r.bearing?{bearing:r.bearing}:{},r.pitch?{pitch:r.pitch}:{},r.zoom?{zoom:r.zoom}:{},r.light?{light:r.light}:{});return this._importedAsBasemap=!0,void this._load(i,n)}if(this.updateConfig(this._config,r.schema),n&&ap(this,te(r)))return;for(let i in this._loaded=!0,r.sources)this.addSource(i,r.sources[i],{validate:!1,isInitialLoad:!0});this.stylesheet=i.bL(r);let a=()=>{if(r.iconsets)for(let i in r.iconsets)this.addIconset(i,r.iconsets[i]);r.sprite?this._loadIconset(r.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),!this.glyphManager.url&&r.glyphs&&this.glyphManager.setURL(r.glyphs);let a=nN(this.stylesheet.layers);if(this._order=a.map(i=>i.id),this.stylesheet.light&&i.f_("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(1===this.stylesheet.lights.length&&"flat"===this.stylesheet.lights[0].type){let i=this.stylesheet.lights[0];this.light=new tg(i.properties,i.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new tg(this.stylesheet.light)),this._layers=Object.create(null);let o=!1;for(let r of a){let n=i.c0(r,this.scope,this._styleColorTheme.lut,this.options);0!==n.expressionDependencies.configDependencies.size&&this._configDependentLayers.add(n.fqid),n.expressionDependencies.isIndoorDependent&&this._indo
110orDependentLayers.add(n.fqid),this._hasAppearances=this._hasAppearances||0!==n.getAppearances().length,n.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=n,this._updateHdCoverageSourceCache(n)&&(o=!0);let a=this.getOwnLayerSourceCache(n),s=!!this.directionalLight&&this.directionalLight.shadowsEnabled();a&&n.canCastShadows()&&s&&(a.castsShadows=!0)}if(o&&r8().then(()=>{if(!this.map)return;for(let i in this._layers)this._updateHdCoverageSourceCache(this._layers[i]);this.map.style.mergeAll();let i=this.map.transform;for(let r in this.map.style._mergedHdRoadCoverageSourceCaches){let n=this.map.style._mergedHdRoadCoverageSourceCaches[r];n.used=!0,i&&n.update(i)}this.map._update()}),this.glyphManager.url){let i=new Set;for(let r in this._layers){let n=this._layers[r];if("symbol"===n.type&&n.layout){let r=n.layout.get("text-font");r&&r.value&&"constant"===r.value.kind&&i.add(r.value.value.join(","))}}for(let r of i)this.glyphManager.prefetchRange(r,0)}this.stylesheet.featuresets&&this.setFeaturesetSelectors(this.stylesheet.featuresets),this.stylesheet.models&&this.addModelURLs(this.stylesheet.models);let s=this.stylesheet.terrain;s&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||this._createTerrain(s,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.snow&&this._createSnow(this.stylesheet.snow),this.stylesheet.rain&&this._createRain(this.stylesheet.rain),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new i.x("data",{dataType:"style"}));let l=this.isRootStyle();r.imports?this._loadImports(r.imports,n).then(()=>{this._reloadImports(!0),this.fire(new i.x(l?"style.load":"style.import.load"))}).catch(r=>{this.fire(new i.v(Error("Failed to load imports",r))),this.fire(new i.x(l?"style.load":"style.import.load"))}):(this._reloadImports(!0),this.fire(new i.x(l?"style.load":"style.import.load")))};this._styleColorTheme.colorTheme=this.stylesheet["color-theme"];let o=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(o){let r=this._evaluateColorThemeData(o);this._loadColorTheme(r).then(()=>{a()}).catch(r=>{i.f_(`Couldn't load color theme from the stylesheet: ${r}`),a()})}else this._styleColorTheme.lut=null,a()}isRootStyle(){return 0===this.importDepth}hasAppearances(){return this._hasAppearances||this.fragments.some(i=>i.style.hasAppearances())}mergeAll(){let i,r,n,a,o,s,l,u,c,d,h={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(f=>{if(f.stylesheet){if(f.disableElevatedTerrain&&(this.disableElevatedTerrain=!0),null!=f.light&&(i=f.light),f.stylesheet.lights)for(let i of f.stylesheet.lights)"ambient"===i.type&&null!=f.ambientLight&&(r=f.ambientLight),"directional"===i.type&&null!=f.directionalLight&&(n=f.directionalLight);a=this._prioritizeTerrain(a,f.terrain,f.stylesheet.terrain),f.stylesheet.fog&&null!=f.fog&&(o=f.fog),f.stylesheet.snow&&null!=f.snow&&(s=f.snow),f.stylesheet.rain&&null!=f.rain&&(l=f.rain),null!=f.stylesheet.camera&&(d=f.stylesheet.camera),null!=f.stylesheet.projection&&(u=f.stylesheet.projection),null!=f.stylesheet.transition&&(c=f.stylesheet.transition),h[f.scope]=f._styleColorTheme}}),this.light=i,this.ambientLight=r,this.directionalLight=n,this.fog=o,this.snow=s,this.rain=l,this._styleColorThemeForScope=h,null===a?delete this.terrain:this.terrain=a,this.camera=d||{"camera-projection":"perspective"},this.projection=u||{name:"mercator"},this.transition=Object.assign({},ax,c),this.mergeSources(),this.mergeLayers(),this.mergeIndoor(),this._programPrecompiler&&this._programPrecompiler.reset()}forEachFragmentStyle(i){let r=n=>{for(let i of n.fragments)r(i.style);i(n)};r(this)}_prioritizeTerrain(i,r,n){let a=i&&0===i.drapeRenderMode;return null===n?r&&0===r.drapeRenderMode?r:a?i:null:null!=r&&(!i||a||r&&1===r.drapeRenderMode)?r:i}mergeTerrain(){let i;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(r=>{i=this._prioritizeTerrain(i,r.terrain,r.stylesheet.terrain)}),null===i?delete this.terrain:this.terrain=i,this._programPrecompiler&&this._programPrecompiler.reset()}mergeProjection(){let i;this.forEachFragmentStyle(r=>{null!=r.stylesheet.projection&&(i=r.stylesheet.projection)}),this.projection=i||{name:"mercator"},this._programPrecompiler&&this._programPrecompiler.reset()}mergeSources(){let r={},n=Object.create(null),a=Object.create(null),o=Object.create(null),s=Object.create(null);this.forEachFragmentStyle(l=>{for(let n in l._sourceCaches)r[i.ea(n,l.scope)]=l._sourceCaches[n];for(let r in l._otherSourceCaches)n[i.ea(r,l.scope)]=l._otherSourceCaches[r];for(let r in l._symbolSourceCaches)a[i.ea(r,l.scope)]=l._symbolSourceCaches[r];for(let r in l._fillExtrusionSourceCaches)o[i.ea(r,l.scope)]=l._fillExtrusionSourceCaches[r];if(l._hdCoverage){let r=l._hdCoverage.coverageSourceCaches;for(let n in r)s[i.ea(n,l.scope)]=r[n]}}),this._mergedSourceCaches=r,this._mergedOtherSourceCaches=n,this._mergedSymbolSourceCaches=a,this._mergedFillExtrusionSourceCaches=o,this._mergedHdRoa
110dCoverageSourceCaches=s,Object.keys(s).length>0&&!this._hdCoverage&&rK&&(this._hdCoverage=new rK)}mergeIndoor(){this._mergedIndoor={},this.forEachFragmentStyle(r=>{if(r.stylesheet&&r.stylesheet.indoor)for(let n of Object.values(r.stylesheet.indoor)){let a=i.ea(n.sourceId,r.scope);this._mergedIndoor[a]=new Set(n.sourceLayers||[])}}),this._updateIndoorEnabled()}_updateIndoorEnabled(){let r=this._indoorEnabled;if(this._indoorEnabled=!1,Object.keys(this._mergedIndoor).length>0)for(let r of this._mergedOrder){let n=this._mergedLayers[r];if("none"!==n.visibility&&this._mergedIndoor[i.ea(n.source,n.scope)]){this._indoorEnabled=!0;break}}!this._indoorEnabled||r||this.indoorManager||r8().then(()=>{this._initIndoorManager()})}_initIndoorManager(){if(!this.indoorManager&&rZ&&this.isRootStyle()&&0!==Object.keys(this._mergedIndoor).length&&(this.indoorManager=new rZ(this,this._loaded),this._loaded))for(let i of Object.keys(this._mergedIndoor)){let r=this._mergedSourceCaches[i]||this._mergedOtherSourceCaches[i];r&&r.reload()}}mergeLayers(){let r={},n=[],a=Object.create(null);this._mergedSlots=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle(a=>{for(let o of a._order){let s=a._layers[o];if("slot"===s.type){let n=i.cY(o);if(r[n])continue;r[n]=[]}s.slot&&r[s.slot]?r[s.slot].push(s):n.push(s)}}),this._mergedOrder=[];let o=-1,s=(n=[])=>{for(let l of n)if("slot"===l.type){let n=i.cY(l.id);r[n]&&s(r[n]),this._mergedSlots.push(n)}else{let r=i.ea(l.id,l.scope);this._mergedOrder.push(r),a[r]=l,l.is3D(!!this.terrain)&&(this._has3DLayers=!0,o=this._mergedOrder.length-1),"circle"===l.type&&(this._hasCircleLayers=!0),"symbol"===l.type&&(this._hasSymbolLayers=!0),"clip"===l.type&&(this._clipLayerPresent=!0)}};if(s(n),this._has3DLayers){let i={};for(let r=0;r<this._mergedOrder.length;++r){let n=this._mergedOrder[r];i[n]=r===o?1:r<o?2*!!a[n].hasOcclusionOpacityProperties:4}this._mergedOrder.sort((r,n)=>i[r]-i[n])}this._mergedLayers=a,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged(),this._updateDataDrivenEmissiveStrength()}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}getCamera(){return this.stylesheet.camera}setCamera(i){return this.stylesheet.camera=Object.assign({},this.stylesheet.camera,i),this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(r){return r.data?(function(r,n,a){let o=Object.assign({},n);for(let i of Object.keys(ac))void 0===o[i]&&(o[i]=ac[i].default);let s=new i.b2(ad,r,new Map(a));return s.setTransitionOrValue(o,a),s.untransitioned().possiblyEvaluate(new i.w(0,{worldview:void 0}))})(this.scope,r,this.options).get("data"):null}_loadColorTheme(r){this._styleColorTheme.lutLoading=!0,this._styleColorTheme.lutLoadingCorrelationID+=1;let n=this._styleColorTheme.lutLoadingCorrelationID;return new Promise((a,o)=>{let s="data:image/png;base64,";if(!r||0===r.length)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=!1,void a();let l=r;l.startsWith(s)||(l=s+l);let u=i.a1.from("mapbox-reserved-lut"),c=new Image;c.src=l,c.onerror=()=>{this._styleColorTheme.lutLoading=!1,o(Error("Failed to load image data"))},c.onload=()=>{if(this._styleColorTheme.lutLoadingCorrelationID!==n)return void a();this._styleColorTheme.lutLoading=!1;let{width:s,height:l,data:d}=i.co.getImageData(c);if(l>32)return void o(Error("The height of the image must be less than or equal to 32 pixels."));if(s!==l*l)return void o(Error("The width of the image must be equal to the height squared."));this.getImage(u)&&this.removeImage(u),this.addImage(u,{data:new i.ay({width:s,height:l},d),pixelRatio:1,sdf:!1,usvg:!1,version:0});let h=this.imageManager.getImage(u,this.scope);h?(this._styleColorTheme.lut={image:h.data,data:r},a()):o(Error("Missing LUT image."))}})}getLut(i){let r=this._styleColorThemeForScope[i];return r?r.lut:null}setProjection(i){i?this.stylesheet.projection=i:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?(this.getTerrain()||this.stylesheet.terrain)&&!this.disableElevatedTerrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(r){this._spriteRequest=function(r,n,a){let o,s,l,u=i.co.devicePixelRatio>1?"@2x":"",c=i.cT(n.transformRequest(n.normalizeSpriteURL(r,u,".json"),i.aH.SpriteJSON),(i,r)=>{c=null,l||(l=i,o=r,h())}),d=i.cQ(n.transformRequest(n.normalizeSpriteURL(r,u,".png"),i.aH.SpriteImage),(i,r)=>{d=null,l||(l=i,s=r,h())});function h(){if(l)a(l);else if(o&&s){let r=i.co.getImageData(s),n={};for(let a in o){let{width:s,height:l,x:u,y:c,sdf:d,pixelRatio:h,stretchX:f,stretchY:p,content:m}=o[a],g=new i.ay({width:s,height:l});i.ay.copy(r,g,{x:u,y:c},{x:0,y:0},{width:s,height:l},null),n[a]={data:g,pixelRatio:void 0!==h?h:1,sdf:void 0!==d&&d,stretchX:f,stretchY:p,content:m,usvg:!1,version:0}}a(null,n)}}return{cancel(){c&&(c.cancel(),c=null),d&&(d.cancel(),d=null)}}}(r,this.map._requestManager,(r,n)=>{if(this._spriteRequest=null,r)this.fire(new i.v(r));else if(n){let r=new Map;for(let a in n)r.set(i.a1.from(a),n[a]);this.addImages(r)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new i.x("data",{dataType:"style"}))})}addIconset(r,n){if("sprite"===n.type)return void this._loadSprite(n.url);let a=this.getOwnSourceCache(n.source);if(!a)return void this.fire(new i.v(Error(`Source "${n.source}" as specified by iconset "${r}" does not exist and cannot be used as an iconset source`)));let o=a.getSource();if("raster-array"!==o.type)return void this.fire(new i.v(Error(`Source "${n.source}" as specified by iconset "${r}" is not a "raster-array" source and cannot be used as an iconset source`)));o.partial=!1;let s=new af(r,this.scope,a);this.imageManager.addImageProvider(s,this.scope)}removeIconset(i){this.imageManager.removeImageProvider(i,this.scope)}_loadIconset(r){var n,a;if(!i.dL(r)&&"icon_set"!==this.map._spriteFormat||"raster"===this.map._spriteFormat)return void this._loadSprite(r);let o="auto"===this.map._spriteFormat;this._spriteRequest=(a=(n,a)=>
110{if(this._spriteRequest=null,n)o?this._loadSprite(r):this.fire(new i.v(n));else if(a){let r=new Map;for(let n in a)r.set(i.a1.from(n),a[n]);this.addImages(r)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new i.x("data",{dataType:"style"}))},i.cG((n=this.map._requestManager).transformRequest(n.normalizeIconsetURL(r),i.aH.Iconset),(r,n)=>{if(r)return void a(r);let o={};for(let r of function(i){let r,n={icons:[]};for(;r=i.nextField(void 0);)1===r&&n.icons.push(function(i,r){let n,a={name:void 0};for(;n=i.nextField(r);)1===n?a.name=i.readString():2===n?a.metadata=function(i,r){let n,a={stretch_x:null,stretch_y:null,stretch_x_areas:null,stretch_y_areas:null,variables:[]};for(;n=i.nextField(r);)1===n?a.stretch_x=i.readPackedVarint():2===n?a.stretch_y=i.readPackedVarint():3===n?a.content_area=ep(i,i.readVarint()+i.pos):4===n?a.variables.push(function(i,r){let n,a={name:void 0};for(;n=i.nextField(r);)1===n?a.name=i.readString():2===n&&(a.rgb_color=e_(i.readVarint()),a.value="rgb_color");return a}(i,i.readVarint()+i.pos)):5===n&&(a.text_placeholder=ep(i,i.readVarint()+i.pos));return a}(i,i.readVarint()+i.pos):3===n&&(a.usvg_tree=function(i,r){let n,a={width:20,children:[],linear_gradients:[],radial_gradients:[],clip_paths:[],masks:[],height:20};for(;n=i.nextField(r);)1===n?a.width=a.height=i.readVarint():2===n?a.height=i.readVarint():3===n?a.children.push(em(i,i.readVarint()+i.pos)):4===n?a.linear_gradients.push(function(i,r){let n,a={spread_method:1,stops:[],x1:0,y1:0,x2:1,y2:0};for(;n=i.nextField(r);)1===n?a.transform=eg(i,i.readVarint()+i.pos):2===n?a.spread_method=i.readVarint():3===n?a.stops.push(ey(i,i.readVarint()+i.pos)):4===n?a.x1=i.readFloat():5===n?a.y1=i.readFloat():6===n?a.x2=i.readFloat():7===n&&(a.y2=i.readFloat());return a}(i,i.readVarint()+i.pos)):5===n?a.radial_gradients.push(function(i,r){let n,a={spread_method:1,stops:[],cx:.5,cy:.5,r:.5,fx:.5,fy:.5,fr:0};for(;n=i.nextField(r);)1===n?a.transform=eg(i,i.readVarint()+i.pos):2===n?a.spread_method=i.readVarint():3===n?a.stops.push(ey(i,i.readVarint()+i.pos)):4===n?a.cx=i.readFloat():5===n?a.cy=i.readFloat():6===n?a.r=i.readFloat():7===n?a.fx=i.readFloat():8===n?a.fy=i.readFloat():9===n&&(a.fr=i.readFloat());return a}(i,i.readVarint()+i.pos)):7===n?a.clip_paths.push(function(i,r){let n,a={children:[]};for(;n=i.nextField(r);)1===n?a.transform=eg(i,i.readVarint()+i.pos):2===n?a.clip_path_idx=i.readVarint():3===n&&a.children.push(em(i,i.readVarint()+i.pos));return a}(i,i.readVarint()+i.pos)):8===n&&a.masks.push(function(i,r){let n,a={left:0,width:20,mask_type:1,children:[]};for(;n=i.nextField(r);)1===n?a.left=a.top=i.readFloat():2===n?a.width=a.height=i.readFloat():3===n?a.top=i.readFloat():4===n?a.height=i.readFloat():5===n?a.mask_type=i.readVarint():6===n?a.mask_idx=i.readVarint():7===n&&a.children.push(em(i,i.readVarint()+i.pos));return null==a.height&&(a.height=a.width),null==a.top&&(a.top=a.left),a}(i,i.readVarint()+i.pos));return a}(i,i.readVarint()+i.pos),a.data="usvg_tree");return function(i){if(i.usvg_tree.height||(i.usvg_tree.height=i.usvg_tree.width),!i.metadata)return i;let{metadata:r}=i;if(r.content_area){let{content_area:n}=r;null==n.left&&(n.left=0),null==n.top&&(n.top=n.left),null==n.width&&(n.width=i.usvg_tree.width),null==n.height&&(n.height=n.width)}if(r.text_placeholder){let{text_placeholder:i}=r;null==i.top&&(i.top=i.left),null==i.height&&(i.height=i.width)}return r.stretch_x&&r.stretch_x.length&&ef(r,"x"),r.stretch_y&&r.stretch_y.length&&ef(r,"y"),i}(a)}(i,i.readVarint()+i.pos));return n}(new i.as(n)).icons){let n={version:1,pixelRatio:i.co.devicePixelRatio,content:function(r){if(!r.metadata||!r.metadata.content_area)return;let n=i.co.devicePixelRatio,{left:a,top:o,width:s,height:l}=r.metadata.content_area,u=a*n,c=o*n;return[u,c,u+s*n,c+l*n]}(r),stretchX:r.metadata?ah(r.metadata.stretch_x_areas):void 0,stretchY:r.metadata?ah(r.metadata.stretch_y_areas):void 0,sdf:!1,usvg:!0,icon:r};o[r.name]=n}a(null,o)}))}_validateLayer(r){let n=this.getOwnSource(r.source);if(!n)return;let a=r.sourceLayer;a&&("geojson"===n.type||n.vectorLayerIds&&!n.vectorLayerIds.includes(a))&&this.fire(new i.v(Error(`Source layer "${a}" does not exist on source "${n.id}" as specified by style layer "${r.id}"`)))}
110loaded(){if(!this._loaded||Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(let i in this._sourceCaches)if(!this._sourceCaches[i].loaded())return!1;if(!this.imageManager.isLoaded()||this.imageManager.hasPatternsInFlight()||!this.modelManager.isLoaded()||this._styleColorTheme.lutLoading)return!1;for(let{style:i}of this.fragments)if(!i.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map((i,r)=>{let n=this.fragments[r];return n&&n.style&&(i.data=n.style.serialize()),i})}_serializeSources(){let i={};for(let r in this._sourceCaches){let n=this._sourceCaches[r].getSource();i[n.id]||(i[n.id]=n.serialize())}return i}_serializeLayers(i){let r=[];for(let n of i){let i=this._layers[n];i&&"custom"!==i.type&&r.push(i.serialize())}return r}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasSnowTransition(){return!!this.snow&&this.snow.hasTransition()}hasRainTransition(){return!!this.rain&&this.rain.hasTransition()}hasTransitions(){if(this.hasLightTransitions()||this.hasFogTransition()||this.hasSnowTransition()||this.hasRainTransition())return!0;for(let i in this._sourceCaches)if(this._sourceCaches[i].hasTransition())return!0;for(let i in this._layers)if(this._layers[i].hasTransition())return!0;return!1}_updateDataDrivenEmissiveStrength(){for(let i in this._mergedLayers){let r=this._mergedLayers[i];if(r._transitionablePaint&&r._transitionablePaint._values){let i=r._transitionablePaint._values["line-emissive-strength"];if(i&&i.value&&i.value.isDataDriven())return void(this._hasDataDrivenEmissive=!0)}}this._hasDataDrivenEmissive=!1}hasDataDrivenEmissiveStrength(){return this._hasDataDrivenEmissive}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}_getOrder(i){return i?this.order:this._mergedOrder}isLayerDraped(i){return!!this.terrain&&i.isDraped(this.getLayerSourceCache(i))}_checkLoaded(){if(!this._loaded)throw Error("Style is not done loading")}_checkLayer(r){let n=this.getOwnLayer(r);if(n)return n;this.fire(new i.v(Error(`The layer '${r}' does not exist in the map's style.`)))}_checkSource(r){let n=this.getOwnSource(r);if(n)return n;this.fire(new i.v(Error(`The source '${r}' does not exist in the map's style.`)))}handleIdle(){let i=this.map.painter;i&&(i.context.sweepPendingPrograms(),this._programPrecompiler&&this._programPrecompiler.processQueue(i,this))}handleContextLost(){this._programPrecompiler&&this._programPrecompiler.reset()}update(r){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(r),this.directionalLight&&this.directionalLight.recalculate(r);let n=this.calculateLightsBrightness();r.brightness=n||0,n!==this._brightness&&(this._brightness=n,this.dispatcher.broadcast("setBrightness",n)),r.worldview!==this._worldview&&(this._worldview=r.worldview,this.dispatcher.broadcast("setWorldview",this._worldview));let a=this._changes.isDirty(),o=!1;if(this._changes.isDirty()){let i=this._changes.getLayerUpdatesByScope();for(let r in i){let{updatedIds:n,removedIds:a}=i[r];(n||a)&&(this._updateWorkerLayers(r,n,a),o=!0)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(r),this.light&&this.light.updateTransitions(r),this.ambientLight&&this.ambientLight.updateTransitions(r),this.directionalLight&&this.directionalLight.updateTransitions(r),this.fog&&this.fog.updateTransitions(r),this.snow&&this.snow.updateTransitions(r),this.rain&&this.rain.updateTransitions(r),this._changes.reset()}let s={};for(let i in this._mergedSourceCaches){let r=this._mergedSourceCaches[i];s[i]=r.used,r.used=!1,r.tileCoverLift=0}let l={};for(let n of this._mergedOrder){let a=this._mergedLayers[n];if(("none"!==a.visibility||a.hasTransition())&&a.recalculate(r,this._availableImages),!a.isHidden(r.zoom)){a.mayUse("HD")&&(a.prepare(),r8()),a.mayUse("Standard")&&(a.prepare(),nS());let i=this.getLayerSourceCache(a);i&&(i.used=!0,i.tileCoverLift=Math.max(i.tileCoverLift,a.tileCoverLift()))}
110if(a.source){let r=i.ea(a.source,a.scope),n=this._mergedHdRoadCoverageSourceCaches[r];n&&!n.used&&(n.used=!0)}if("fill-extrusion"===a.type){let r=i.ea(a.source,a.scope);if(r in this._mergedFillExtrusionSourceCaches){let i=a.layout&&a.layout.get("source-max-zoom");if(null!=i){let n=l[r];l[r]=null==n?i:Math.min(n,i)}}}}if(this._programPrecompiler&&this._programPrecompiler.needsBuild()){let i=this._mergedOrder.map(i=>this._mergedLayers[i]);this._programPrecompiler.buildQueue(i,r,this)}for(let i in this._mergedFillExtrusionSourceCaches)this._mergedFillExtrusionSourceCaches[i].setMaxzoomOverride(null!=l[i]?l[i]:null);for(let i of(this.terrain&&o&&this.mergeLayers(),this.imageManager.getPendingImageProviders()))i.sourceCache.used=!0;for(let r in s){let n=this._mergedSourceCaches[r];s[r]!==n.used&&n.getSource().fire(new i.x("data",{sourceDataType:"visibility",dataType:"source",sourceId:n.getSource().id}))}this.light&&this.light.recalculate(r),this.terrain&&this.terrain.recalculate(r),this.fog&&this.fog.recalculate(r),this.snow&&this.snow.recalculate(r),this.rain&&this.rain.recalculate(r),this.z=r.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),this.imageManager.clearUpdatedImages(this.scope),a&&this.fire(new i.x("data",{dataType:"style"}))}updateImageProviders(){for(let i of this.imageManager.getPendingImageProviders()){let r=i.resolvePendingRequests(),n=this.getFragmentStyle(i.scope);n&&n.addImages(r)}}_updateTilesForChangedImages(){let i={};for(let r in this._mergedSourceCaches){let n=this._mergedSourceCaches[r].getSource().scope;i[n]=i[n]||this._changes.getUpdatedImages(n),0!==i[n].length&&this._mergedSourceCaches[r].reloadTilesForDependencies(["icons","patterns"],i[n])}for(let r in i)this._changes.resetUpdatedImages(r)}_updateWorkerLayers(i,r,n){let a=this.getFragmentStyle(i);a&&this.dispatcher.broadcast("updateLayers",{layers:r?a._serializeLayers(r):[],scope:i,removedIds:n||[],options:a.options})}setState(r,n){if(this._checkLoaded(),ap(this,te(r)))return!1;(r=i.bL(r)).layers=nN(r.layers);let a=(function(r,n){if(!r)return[{command:nj.setStyle,args:[n]}];let a=[];try{if(!i.c2(r.version,n.version)||(i.c2(r.center,n.center)||a.push({command:nj.setCenter,args:[n.center]}),i.c2(r.zoom,n.zoom)||a.push({command:nj.setZoom,args:[n.zoom]}),i.c2(r.bearing,n.bearing)||a.push({command:nj.setBearing,args:[n.bearing]}),i.c2(r.pitch,n.pitch)||a.push({command:nj.setPitch,args:[n.pitch]}),i.c2(r.sprite,n.sprite)||a.push({command:nj.setSprite,args:[n.sprite]}),i.c2(r.glyphs,n.glyphs)||a.push({command:nj.setGlyphs,args:[n.glyphs]}),i.c2(r.imports,n.imports)||function(r=[],n=[],a){let o,s,l,u;n=n||[];let c=(r=r||[]).map(nV),d=n.map(nV),h=r.reduce(nH,{}),f=n.reduce(nH,{}),p=c.slice();for(o=0,s=0;o<c.length;o++)l=c[o],Object.hasOwn(f,l)?s++:(a.push({command:nj.removeImport,args:[l]}),p.splice(p.indexOf(l,s),1));for(o=0,s=0;o<d.length;o++)l=d[d.length-1-o],p[p.length-1-o]!==l&&(Object.hasOwn(h,l)?(a.push({command:nj.removeImport,args:[l]}),p.splice(p.lastIndexOf(l,p.length-s),1)):s++,u=p[p.length-o],a.push({command:nj.addImport,args:[f[l],u]}),p.splice(p.length-o,0,l));for(let r of n){let n=h[r.id];n&&(delete n.data,i.c2(n,r)||a.push({command:nj.updateImport,args:[r.id,r]}))}}(r.imports,n.imports,a),i.c2(r.transition,n.transition)||a.push({command:nj.setTransition,args:[n.transition]}),i.c2(r.light,n.light)||a.push({command:nj.setLight,args:[n.light]}),i.c2(r.fog,n.fog)||a.push({command:nj.setFog,args:[n.fog]}),i.c2(r.snow,n.snow)||a.push({command:nj.setSnow,args:[n.snow]}),i.c2(r.rain,n.rain)||a.push({command:nj.setRain,args:[n.rain]}),i.c2(r.projection,n.projection)||a.push({command:nj.setProjection,args:[n.projection]}),i.c2(r.lights,n.lights)||a.push({command:nj.setLights,args:[n.lights]}),i.c2(r.camera,n.camera)||a.push({command:nj.setCamera,args:[n.camera]}),i.c2(r.iconsets,n.iconsets)||function(r,n,a){let o;for(o in n=n||{},r=r||{})Object.hasOwn(r,o)&&(Object.hasOwn(n,o)||a.push({command:nj.removeIconset,args:[o]}));for(o in n){if(!Object.hasOwn(n,o))continue;let s=n[o];Object.hasOwn(r,o)?i.c2(r[o],s)||(a.push({command:nj.removeIconset,args:[o]}),a.push({command:nj.addIconset,args:[o,s]})):a.push({command:nj.addIconset,args:[o,s]})}}(r.iconsets,n.iconsets,a),!i.c2(r["color-theme"],n["color-theme"])))return[{command:nj.setStyle,args:[n]}];let o={},s=[];!function(r,n,a,o){let s;for(s in n=n||{},r=r||{})Object.hasOwn(r,s)&&(Object.hasOwn(n,s)||nB(s,a,o));for(s in n){var l;if(!Object.hasOwn(n,s))continue;let u=n[s];Object.hasOwn(r,s)?i.c2(r[s],u)||("geojson"===r[s].type&&"geojson"===u.type&&function(r,n,a){let o;for(o in r[a])if(Object.hasOwn(r[a],o)&&"data"!==o&&!i.c2(r[a][o],n[a][o]))return!1;for(o in n[a])if(Object.hasOwn(n[a],o)&&"data"!==o&&!i.c2(r[a][o],n[a][o]))return!1;return!0}(r,n,s)?a.push({command:nj.setGeoJSONSourceData,args:[s,u.data]}):(l=n,nB(s,a,o),nz(s,l,a))):nz(s,n,a)}}(r.sources,n.sources,s,o);let l=[];
110r.layers&&r.layers.forEach(i=>{i.source&&o[i.source]?a.push({command:nj.removeLayer,args:[i.id]}):l.push(i)});let u=r.terrain;u&&o[u.source]&&(a.push({command:nj.setTerrain,args:[void 0]}),u=void 0),a=a.concat(s),i.c2(u,n.terrain)||a.push({command:nj.setTerrain,args:[n.terrain]}),function(r,n,a){let o,s,l,u,c,d,h;n=n||[];let f=(r=r||[]).map(nV),p=n.map(nV),m=r.reduce(nH,{}),g=n.reduce(nH,{}),_=f.slice(),y=Object.create(null);for(o=0,s=0;o<f.length;o++)l=f[o],Object.hasOwn(g,l)?s++:(a.push({command:nj.removeLayer,args:[l]}),_.splice(_.indexOf(l,s),1));for(o=0,s=0;o<p.length;o++)l=p[p.length-1-o],_[_.length-1-o]!==l&&(Object.hasOwn(m,l)?(a.push({command:nj.removeLayer,args:[l]}),_.splice(_.lastIndexOf(l,_.length-s),1)):s++,d=_[_.length-o],a.push({command:nj.addLayer,args:[g[l],d]}),_.splice(_.length-o,0,l),y[l]=!0);for(o=0;o<p.length;o++)if(u=m[l=p[o]],c=g[l],!y[l]&&!i.c2(u,c))if(i.c2(u.source,c.source)&&i.c2(u["source-layer"],c["source-layer"])&&i.c2(u.type,c.type)){for(h in nU(u.layout,c.layout,a,l,null,nj.setLayoutProperty),nU(u.paint,c.paint,a,l,null,nj.setPaintProperty),i.c2(u.slot,c.slot)||a.push({command:nj.setSlot,args:[l,c.slot]}),i.c2(u.filter,c.filter)||a.push({command:nj.setFilter,args:[l,c.filter]}),i.c2(u.minzoom,c.minzoom)&&i.c2(u.maxzoom,c.maxzoom)||a.push({command:nj.setLayerZoomRange,args:[l,c.minzoom,c.maxzoom]}),u)Object.hasOwn(u,h)&&"layout"!==h&&"paint"!==h&&"filter"!==h&&"metadata"!==h&&"minzoom"!==h&&"maxzoom"!==h&&"slot"!==h&&(0===h.indexOf("paint.")?nU(u[h],c[h],a,l,h.slice(6),nj.setPaintProperty):i.c2(u[h],c[h])||a.push({command:nj.setLayerProperty,args:[l,h,c[h]]}));for(h in c)Object.hasOwn(c,h)&&!Object.hasOwn(u,h)&&"layout"!==h&&"paint"!==h&&"filter"!==h&&"metadata"!==h&&"minzoom"!==h&&"maxzoom"!==h&&"slot"!==h&&(0===h.indexOf("paint.")?nU(u[h],c[h],a,l,h.slice(6),nj.setPaintProperty):i.c2(u[h],c[h])||a.push({command:nj.setLayerProperty,args:[l,h,c[h]]}))}else a.push({command:nj.removeLayer,args:[l]}),d=_[_.lastIndexOf(l)+1],a.push({command:nj.addLayer,args:[c,d]})}(l,n.layers,a)}catch(i){console.warn("Unable to compute style diff:",i),a=[{command:nj.setStyle,args:[n]}]}return a})(this.serialize(),r).filter(i=>!(i.command in a_));if(0===a.length)return!1;let o=a.filter(i=>!(i.command in ag));if(o.length>0)throw Error(`Unimplemented: ${o.map(i=>i.command).join(", ")}.`);let s=[];return a.forEach(i=>{s.push(this[i.command](...i.args))}),n&&Promise.all(s).then(n).catch(n),this.stylesheet=r,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}_updateWorkerImages(){this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages})}_updateWorkerModels(){this._availableModels=this.modelManager.getModelURIs(this.scope),this.dispatcher.broadcast("setModels",{scope:this.scope,models:this._availableModels})}addImages(r){if(0===r.size)return this;for(let[n,a]of r.entries()){if(this.getImage(n))return this.fire(new i.v(Error(`An image with the name "${n.name}" already exists.`)));this.imageManager.addImage(n,this.scope,a),this._changes.updateImage(n,this.scope)}return this._updateWorkerImages(),this.fire(new i.x("data",{dataType:"style"})),this}addImage(r,n){return this.getImage(r)?this.fire(new i.v(Error(`An image with the name "${r.name}" already exists.`))):(this.imageManager.addImage(r,this.scope,n),this._changes.updateImage(r,this.scope),this._updateWorkerImages(),this.fire(new i.x("data",{dataType:"style"})),this)}updateImage(r,n,a=!1){this.imageManager.updateImage(r,this.scope,n),a&&(this._changes.updateImage(r,this.scope),this._updateWorkerImages(),this.fire(new i.x("data",{dataType:"style"})))}getImage(i){return this.imageManager.getImage(i,this.scope)}removeImage(r){return this.getImage(r)?(this.imageManager.removeImage(r,this.scope),this._changes.updateImage(r,this.scope),this._updateWorkerImages(),this.fire(new i.x("data",{dataType:"style"})),this):this.fire(new i.v(Error("No image with this name exists.")))}listImages(){return this._checkLoaded(),this._availableImages.slice()}getActualScope(){return this._importedAsBasemap?"basemap":this.scope}addModelURLs(r){return this.modelManager.addModelURLs(r,this.getActualScope()),this._updateWorkerModels(),this.fire(new i.x("data",{dataType:"style"})),this}addModel(r,n,a={}
110){return this._checkLoaded(),this._validate(th,`models.${r}`,n,null,a)||(this.modelManager.addModel(r,n,this.getActualScope()),this.fire(new i.x("data",{dataType:"style"}))),this}hasModel(i){return this.modelManager.hasModel(i,this.getActualScope())}removeModel(r){return this.hasModel(r)?(this.modelManager.removeModel(r,this.getActualScope(),!1,!0),this.fire(new i.x("data",{dataType:"style"})),this):this.fire(new i.v(Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.getActualScope())}addSource(r,n,a={}){if(this._checkLoaded(),void 0!==this.getOwnSource(r))throw Error(`There is already a source with ID "${r}".`);if(!n.type)throw Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].includes(n.type)&&this._validate(tt,`sources.${r}`,n,null,a))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);let o=nM(r,n,this.dispatcher,this);o.scope=this.scope,o.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(o.id),source:o.serialize(),sourceId:o.id}));let s=r=>{let n=(r===i.aC.Symbol?"symbol:":r===i.aC.FillExtrusion?"fill-extrusion:":"other:")+o.id,a=i.ea(n,this.scope),s=this._sourceCaches[n]=new rR(a,o,r);r===i.aC.Symbol?this._symbolSourceCaches[o.id]=s:r===i.aC.FillExtrusion?this._fillExtrusionSourceCaches[o.id]=s:this._otherSourceCaches[o.id]=s,s.onAdd(this.map)};s(i.aC.Other),"vector"!==n.type&&"geojson"!==n.type||(s(i.aC.Symbol),"vector"===n.type&&s(i.aC.FillExtrusion)),o.onAdd&&o.onAdd(this.map),a.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(r){this._checkLoaded();let n=this.getOwnSource(r);if(!n)throw Error("There is no source with this ID");for(let n in this._layers)if(this._layers[n].source===r)return this.fire(new i.v(Error(`Source "${r}" cannot be removed while layer "${n}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===r)return this.fire(new i.v(Error(`Source "${r}" cannot be removed while terrain is using it.`)));if(this.stylesheet.iconsets){let n=Object.entries(this.stylesheet.iconsets).find(([i,n])=>"source"===n.type&&n.source===r);if(n)return this.fire(new i.v(Error(`Source "${r}" cannot be removed while iconset "${n[0]}" is using it.`)))}for(let n of this.getOwnSourceCaches(r)){let r=i.cY(n.id);delete this._sourceCaches[r],this._changes.discardSourceCacheUpdate(n.id),n.fire(new i.x("data",{sourceDataType:"metadata",dataType:"source",sourceId:n.getSource().id})),n.setEventedParent(null),n.clearTiles()}return delete this._otherSourceCaches[r],delete this._symbolSourceCaches[r],delete this._fillExtrusionSourceCaches[r],this._hdCoverage&&delete this._hdCoverage.coverageSourceCaches[r],this.mergeSources(),n.setEventedParent(null),n.onRemove&&n.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(i,r){this._checkLoaded(),this.getOwnSource(i).setData(r),this._changes.setDirty()}getOwnSource(i){let r=this.getOwnSourceCache(i);return r&&r.getSource()}getOwnSources(){let i=[];for(let r in this._otherSourceCaches){let n=this.getOwnSourceCache(r);n&&i.push(n.getSource())}return i}areTilesLoaded(){let i=this._mergedSourceCaches;for(let r in i){let n=i[r]._tiles;for(let i in n){let r=n[i];if("loaded"!==r.state&&"errored"!==r.state)return!1}}return!0}setLights(r){if(this._checkLoaded(),this._programPrecompiler&&this._programPrecompiler.reset(),!r)return delete this.ambientLight,void delete this.directionalLight;let n=this._getTransitionParameters();for(let i of r){if(this._validate(tr,"lights",i))return;switch(i.type){case"ambient":if(this.ambientLight){let r=this.ambientLight;r.set(i),r.updateTransitions(n)}else this.ambientLight=new tL(i,tP(),this.scope,this.options);break;case"directional":if(this.directionalLight){let r=this.directionalLight;r.set(i),r.updateTransitions(n)}else this.directionalLight=new tL(i,tO(),this.scope,this.options)}}let a=Object.assign(n,{worldview:this.map.getWorldview()}),o=new i.w(this.z||0,a);this.ambientLight&&this.ambientLight.recalculate(o),this.directionalLight&&this.directionalLight.recalculate(o),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness)}calculateLightsBrightness(){let r=this.directionalLight,n=this.ambientLight;if(!r||!n)return;let a=i=>.2126*(i[0]<=.03928?i[0]/12.92:Math.pow((i[0]+.055)/1.055,2.4))+.7152*(i[1]<=.03928?i[1]/12.92:Math.pow((i[1]+.055)/1.055,2.4))+.0722*(i[2]<=.03928?i[2]/12.92:Math.pow((i[2]+.055)/1.055,2.4)),o=r.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),s=r.properties.get("intensity"),l=r.properties.get("direction"),u=1-i.bB(l.x,l.y,l.z)[2]/90,c=a(o)*s*u,d=n.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),h=n.properties.get("intensity");return Number(((c+a(d)*h)/2).toFixed(6))}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;let i=[];return this.directionalLight&&i.push(this.directionalLight.get()),this.ambientLight&&i.push(this.ambientLight.get()),i}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(r){if(null==r||""===r&&this.isRootStyle())return this;if(i.dx(r)){let n=i.cS(r),a=this.fragments.find(({id:i})=>i===n);if(!a)return;let o=i.cY(r);return a.style.getFragmentStyle(o)}{let i=this.fragments.find(({id:i})=>i===r);return i?i.style:void 0}}setFeaturesetSelectors(r){if(!r)return;let n=(i,r="")=>`${i}::${r}`;for(let a in this._featuresetSelectors={},r){let o={},s=this._featuresetSelectors[a]=[];for(let l of r[a].selectors){let r;if(l.featureNamespace){let r=this.getOwnLayer(l.layer);if(!r){i.f_(`Layer is undefined for selector: ${l.layer}`);continue}let s=n(r.source,r.sourceLayer);
110if(s in o&&o[s]!==l.featureNamespace){i.f_(`"featureNamespace ${l.featureNamespace} of featureset ${a}'s selector is not associated to the same source, skip this selector`);continue}o[s]=l.featureNamespace}if(l.properties)for(let n in l.properties){let a=i.bY(l.properties[n]);"success"===a.result&&((r=r||{})[n]=a.value)}s.push({layerId:l.layer,namespace:l.featureNamespace,properties:r,uniqueFeatureID:l._uniqueFeatureID})}}}getFeaturesetDescriptors(i){let r=this.getFragmentStyle(i);if(!r||!r.stylesheet.featuresets)return[];let n=[];for(let i in r.stylesheet.featuresets)n.push({featuresetId:i,importId:r.scope?r.scope:void 0});return n}getFeaturesetLayers(r,n){let a=this.getFragmentStyle(n),o=a.stylesheet.featuresets;if(!o||!o[r])return this.fire(new i.v(Error(`The featureset '${r}' does not exist in the map's style and cannot be queried.`))),[];let s=[];for(let i of o[r].selectors){let r=a.getOwnLayer(i.layer);r&&s.push(r)}return s}getConfigProperty(r,n){let a=this.getFragmentStyle(r);if(!a)return null;let o=i.ea(n,a.scope),s=a.options.get(o),l=s?s.value||s.default:null;return l?l.serialize():null}isIndoorEnabled(){return this._indoorEnabled}getIndoorSourceLayers(r,n){let a=i.ea(r,n);return this._mergedIndoor[a]}setIndoorData(i,r){this.indoorManager&&this.indoorManager.setIndoorData(r)}updateIndoorDependentLayers(){this._updateLayers(this._indoorDependentLayers),this.map._styleDirty=!0,this.map.triggerRepaint()}setConfigProperty(r,n,a){let o,s=this.getFragmentStyle(r);if(!s)return;let l=s.stylesheet.schema;if(!l||!l[n])return;let u=am(l[n],a);if("success"!==u.result)return void ap(this,u.value);let c=u.value.expression,d=i.ea(n,s.scope),h=s.options.get(d);if(!h)return;let{minValue:f,maxValue:p,stepValue:m,type:g,values:_}=l[n],y=am(l[n],l[n].default);"success"===y.result&&(o=y.value.expression),o?(this.options.set(d,Object.assign({},h,{value:c,default:o,minValue:f,maxValue:p,stepValue:m,type:g,values:_})),this.updateConfigDependencies(n)):this.fire(new i.v(Error(`No schema defined for the config option "${n}" in the "${r}" fragment.`)))}getConfig(r){let n=this.getFragmentStyle(r);if(!n)return null;let a=n.stylesheet.schema;if(!a)return null;let o={};for(let r in a){let a=i.ea(r,n.scope),s=n.options.get(a),l=s?s.value||s.default:null;o[r]=l?l.serialize():null}return o}setConfig(i,r){let n=this.getFragmentStyle(i);n&&(n.updateConfig(r,n.stylesheet.schema),this.updateConfigDependencies())}getSchema(i){let r=this.getFragmentStyle(i);return r?r.stylesheet.schema:null}setSchema(i,r){let n=this.getFragmentStyle(i);n&&(n.stylesheet.schema=r,n.updateConfig(n._config,r),this.updateConfigDependencies())}updateConfig(r,n){if(this._config=r,r||n)if(n)for(let a in n){let o,s,l=am(n[a],n[a].default);if("success"===l.result&&(o=l.value.expression),r&&void 0!==r[a]){let i=am(n[a],r[a]);"success"===i.result&&(s=i.value.expression)}let{minValue:u,maxValue:c,stepValue:d,type:h,values:f}=n[a];if(o){let r=i.ea(a,this.scope);this.options.set(r,{default:o,value:s,minValue:u,maxValue:c,stepValue:d,type:h,values:f})}else this.fire(new i.v(Error(`No schema defined for config option "${a}".`)))}else this.fire(new i.v(Error("Attempting to set config for a style without schema.")))}_updateLayers(i,r=()=>!0){for(let n of i){let i=this.getLayer(n);i&&r(i)&&(i.possiblyEvaluateVisibility(),this._updateLayer(i),this._changes.setDirty())}}updateConfigDependencies(i){this._updateLayers(this._configDependentLayers,r=>!i||r.expressionDependencies.configDependencies.has(i)),this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this.snow&&this.snow.updateConfig(this.options),this.rain&&this.rain.updateConfig(this.options),this.forEachFragmentStyle(i=>{let r=i._styleColorTheme.colorThemeOverride?i._styleColorTheme.colorThemeOverride:i._styleColorTheme.colorTheme;if(r){let n=i._evaluateColorThemeData(r);(!i._styleColorTheme.lut&&""!==n||i._styleColorTheme.lut&&n!==i._styleColorTheme.lut.data)&&i.setColorTheme(r)}}),this._updateIndoorEnabled(),this._changes.setDirty()}addLayer(r,n,a={}){let o;this._checkLoaded();let s=r.id;if(this._layers[s])return void this.fire(new i.v(Error(`Layer with i
110d "${s}" already exists on this map`)));if("custom"===r.type){if(ap(this,i.fY(r)))return;o=i.c0(r,this.scope,this._styleColorTheme.lut,this.options)}else{if("object"==typeof r.source&&(this.addSource(s,r.source),r=Object.assign(r=i.bL(r),{source:s})),this._validate(tl,`layers.${s}`,r,{arrayIndex:-1},a))return;o=i.c0(r,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(o),o.setEventedParent(this,{layer:{id:s}})}let l=i.ea(o.source,o.scope);0!==o.expressionDependencies.configDependencies.size&&this._configDependentLayers.add(l),o.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(l);let u=this._order.length;if(n){let r=this._order.indexOf(n);if(-1===r)return void this.fire(new i.v(Error(`Layer with id "${n}" does not exist on this map.`)));o.slot&&o.slot!==this._layers[n].slot?i.f_(`Layer with id "${n}" has a different slot. Layers can only be rearranged within the same slot.`):u=r}this._order.splice(u,0,s),this._handleLayerOrderChange(),this._layers[s]=o;let c=this.getOwnLayerSourceCache(o),d=!!this.directionalLight&&this.directionalLight.shadowsEnabled();c&&o.canCastShadows()&&d&&(c.castsShadows=!0);let h=this._changes.getRemovedLayer(o);if(h&&o.source&&c&&"custom"!==o.type){this._changes.discardLayerRemoval(o);let r=i.ea(o.source,o.scope);h.type!==o.type?this._changes.updateSourceCache(r,"clear"):(this._changes.updateSourceCache(r,"reload"),c.pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map),o.scope=this.scope,this.mergeLayers()}moveLayer(r,n){this._checkLoaded();let a=this._checkLayer(r);if(!a||r===n)return;let o=this._order.indexOf(r);this._order.splice(o,1);let s=this._order.length;if(n){let r=this._order.indexOf(n);
110if(-1===r)return void this.fire(new i.v(Error(`Layer with id "${n}" does not exist on this map.`)));a.slot&&a.slot!==this._layers[n].slot?i.f_(`Layer with id "${n}" has a different slot. Layers can only be rearranged within the same slot.`):s=r}this._order.splice(s,0,r),this._changes.setDirty(),this._handleLayerOrderChange(),this.mergeLayers()}removeLayer(i){this._checkLoaded();let r=this._checkLayer(i);if(!r)return;r.setEventedParent(null);let n=this._order.indexOf(i);this._order.splice(n,1),delete this._layers[i],this._changes.setDirty(),this._handleLayerOrderChange(),this._configDependentLayers.delete(r.fqid),this._indoorDependentLayers.delete(r.fqid),this._changes.removeLayer(r);let a=this.getOwnLayerSourceCache(r);if(a&&a.castsShadows){let i=!1;for(let n in this._layers)if(this._layers[n].source===r.source&&this._layers[n].canCastShadows()){i=!0;break}a.castsShadows=i}r.onRemove&&r.onRemove(this.map),this.mergeLayers()}getOwnLayer(i){return this._layers[i]}hasLayer(i){return i in this._mergedLayers}hasLayerType(i){for(let r in this._layers)if(this._layers[r].type===i)return!0;return!1}setLayerZoomRange(i,r,n){this._checkLoaded();let a=this._checkLayer(i);a&&(a.minzoom===r&&a.maxzoom===n||(null!=r&&(a.minzoom=r),null!=n&&(a.maxzoom=n),this._updateLayer(a)))}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(i,r){this._checkLoaded();let n=this._checkLayer(i);n&&n.slot!==r&&(n.slot=r,this._updateLayer(n))}setFilter(r,n,a={}){this._checkLoaded();let o=this._checkLayer(r);if(o&&!i.c2(o.filter,n))return null==n?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(tu,`layers.${o.id}.filter`,n,{layerType:o.type},a)||(o.filter=i.bL(n),this._updateLayer(o)))}getFilter(r){let n=this._checkLayer(r);if(n)return i.bL(n.filter)}setLayoutProperty(r,n,a,o={}){this._checkLoaded();let s=this._checkLayer(r);if(s&&!i.c2(s.getLayoutProperty(n),a)){if(null!=a&&(!o||!1!==o.validate)&&ap(s,td.call(te,{key:`layers.${r}.layout.${n}`,layerType:s.type,objectKey:n,value:a,styleSpec:i.fs,style:{glyphs:!0,sprite:!0}})))return;s.setLayoutProperty(n,a),0!==s.expressionDependencies.configDependencies.size&&this._configDependentLayers.add(s.fqid),s.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(s.fqid),this._updateLayer(s)}}getLayerProperty(i,r){let n=this._checkLayer(i);if(n){switch(r){case"minzoom":return n.minzoom;case"maxzoom":return n.maxzoom;case"filter":return this.getFilter(i);case"slot":return n.slot;case"appearances":return n.getAppearances().map(i=>i.serialize())}return n.isPaintProperty(r)?this.getPaintProperty(i,r):this.getLayoutProperty(i,r)}}setLayerProperty(i,r,n,a={}){this._checkLoaded();let o=this._checkLayer(i);if(o){switch(r){case"appearances":return o.setAppearances(n),void this._updateLayer(o);case"minzoom":return this.setLayerZoomRange(i,n);case"maxzoom":return this.setLayerZoomRange(i,null,n);case"filter":return this.setFilter(i,n,a);case"slot":return this.setSlot(i,n)}o.isPaintProperty(r)?this.setPaintProperty(i,r,n,a):this.setLayoutProperty(i,r,n,a)}}getLayoutProperty(i,r){let n=this._checkLayer(i);if(n)return n.getLayoutProperty(r)}setPaintProperty(r,n,a,o={}){this._checkLoaded();let s=this._checkLayer(r);if(!s||i.c2(s.getPaintProperty(n),a)||null!=a&&(!o||!1!==o.validate)&&ap(s,tc.call(te,{key:`layers.${r}.paint.${n}`,layerType:s.type,objectKey:n,value:a,styleSpec:i.fs})))return;let l=s.setPaintProperty(n,a);0!==s.expressionDependencies.configDependencies.size&&this._configDependentLayers.add(s.fqid),s.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(s.fqid),l&&this._updateLayer(s),this._changes.updatePaintProperties(s)}getPaintProperty(i,r){let n=this._checkLayer(i);if(n)return n.getPaintProperty(r)}setFeatureState(r,n){if(this._checkLoaded(),"target"in r){if("featuresetId"in r.target){let{featuresetId:i,importId:a}=r.target,o=this.getFragmentStyle(a);for(let{source:a,sourceLayer:s}of o.getFeaturesetLayers(i))o.setFeatureState({id:r.id,source:a,sourceLayer:s},n)}else if("layerId"in r.target){let{layerId:i}=r.target,a=this.getLayer(i);this.setFeatureState({id:r.id,source:a.source,sourceLayer:a.sourceLayer},n)}return}let a=r.source,o=r.sourceLayer,s=this._checkSource(a);if(!s)return;let l=s.type;if("geojson"===l&&o)return void this.fire(new i.v(Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===l&&!o)return void this.fire(new i.v(Error("The sourceLayer parameter must be provided for vector source types.")));for(let s of(void 0===r.id&&this.fire(new i.v(Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(a)))s.setFeatureState(
110o,r.id,n)}removeFeatureState(r,n){if(this._checkLoaded(),"target"in r){if("featuresetId"in r.target){let{featuresetId:i,importId:a}=r.target,o=this.getFragmentStyle(a);for(let{source:a,sourceLayer:s}of o.getFeaturesetLayers(i))o.removeFeatureState({id:r.id,source:a,sourceLayer:s},n)}else if("layerId"in r.target){let{layerId:i}=r.target,a=this.getLayer(i);this.removeFeatureState({id:r.id,source:a.source,sourceLayer:a.sourceLayer},n)}return}let a=r.source,o=this._checkSource(a);if(!o)return;let s=o.type,l="vector"===s?r.sourceLayer:void 0;if("vector"===s&&!l)return void this.fire(new i.v(Error("The sourceLayer parameter must be provided for vector source types.")));if(n&&"string"!=typeof r.id&&"number"!=typeof r.id)return void this.fire(new i.v(Error("A feature id is required to remove its specific state property.")));for(let i of this.getOwnSourceCaches(a))i.removeFeatureState(l,r.id,n)}getFeatureState(r){if(this._checkLoaded(),"target"in r){let n;if("featuresetId"in r.target){let{featuresetId:a,importId:o}=r.target,s=this.getFragmentStyle(o);for(let{source:o,sourceLayer:l}of s.getFeaturesetLayers(a)){let a=s.getFeatureState({id:r.id,source:o,sourceLayer:l});if(a&&!n)n=a;else if(!i.c2(n,a))return void this.fire(new i.v(Error("The same feature id exists in multiple sources in the featureset, but their feature states are not consistent through the sources.")))}}else if("layerId"in r.target){let{layerId:i}=r.target,a=this.getLayer(i);n=this.getFeatureState({id:r.id,source:a.source,sourceLayer:a.sourceLayer})}return n}let n=r.source,a=r.sourceLayer,o=this._checkSource(n);if(o){if("vector"!==o.type||a)return void 0===r.id&&this.fire(new i.v(Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(n)[0].getFeatureState(a,r.id);this.fire(new i.v(Error("The sourceLayer parameter must be provided for vector source types.")))}}setTransition(i){return this.stylesheet.transition=Object.assign({},this.stylesheet.transition,i),this.transition=this.stylesheet.transition,this}getTransition(){return Object.assign({},this.stylesheet.transition)}setWorldview(i){i!==this._worldview&&(this._worldview=i,this.dispatcher.broadcast("setWorldview",this._worldview),this.reloadSources())}serialize(){this._checkLoaded();let r=this.getTerrain(),n=r&&this.terrain&&this.terrain.scope===this.scope?r:this.stylesheet.terrain;return i.cr({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,iconsets:this.stylesheet.iconsets,featuresets:this.stylesheet.featuresets,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:n,fog:this.stylesheet.fog,snow:this.stylesheet.snow,rain:this.stylesheet.rain,indoor:this.stylesheet.indoor,center:this.stylesheet.center,"color-theme":this.stylesheet["color-theme"],zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:this._serializeSources(),layers:this._serializeLayers(this._order)},i=>void 0!==i)}_updateFilteredLayers(i){for(let r of Object.values(this._mergedLayers))i(r)&&this._updateLayer(r)}_updateLayer(r){this._changes.updateLayer(r);let n=this.getLayerSourceCache(r),a=i.ea(r.source,r.scope),o=this._changes.getUpdatedSourceCaches();r.source&&!o[a]&&n&&"raster"!==n.getSource().type&&(this._changes.updateSourceCache(a,"reload"),n.pause()),r.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(i){let r=i=>this._mergedLayers[i].is3D(!!this.terrain),n=this.order,a={},o=[];for(let s=n.length-1;s>=0;s--){let l=n[s];if(r(l))for(let r of(a[l]=s,i)){let i=r[l];if(i)for(let r of i)o.push(r)}}o.sort((i,r)=>r.intersectionZ-i.intersectionZ);let s=[];for(let l=n.length-1;l>=0;l--){let u=n[l];if(r(u))for(let i=o.length-1;i>=0;i--){let r=o[i].feature;if(r.layer&&a[r.layer.id]<l)break;s.push(r),o.pop()}else for(let r of i){let i=r[u];if(i)for(let r of i)s.push(r.feature)}}return s}queryRasterValue(r,n,a){let o=this.getOwnSource(r);return o?"raster-array"!==o.type?(this.fire(new i.v(Error('queryRasterValue support only "raster-array" sources.'))),Promise.resolve(null)):o.queryRasterArrayValue(n,a):(this.fire(new i.v(Error(`Source with i
110d "${r}" does not exist in the style.`))),Promise.resolve(null))}queryRenderedFeatures(r,n,a){let o;n&&!Array.isArray(n)&&n.filter&&(this._validate(tu,"queryRenderedFeatures.filter",n.filter,null,n),o=i.bZ(n.filter));let s={},l=i=>{if(ay.has(i.type))return;let r=this.getOwnLayerSourceCache(i),n=s[r.id]=s[r.id]||{sourceCache:r,layers:{},has3DLayers:!1};i.is3D(!!this.terrain)&&(n.has3DLayers=!0),n.layers[i.fqid]=n.layers[i.fqid]||{styleLayer:i,targets:[]},n.layers[i.fqid].targets.push({filter:o})};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new i.v(Error("parameters.layers must be an Array."))),[];for(let r of n.layers){let n=this._layers[r];if(!n)return this.fire(new i.v(Error(`The layer '${r}' does not exist in the map's style and cannot be queried for features.`))),[];l(n)}}else for(let i in this._layers)l(this._layers[i]);let u=this._queryRenderedFeatures(r,s,a),c=this._flattenAndSortRenderedFeatures(u),d=[];for(let r of c)i.cZ(r.layer.id)===this.scope&&d.push(r);return d}queryRenderedFeatureset(r,n,a){let o;n&&!Array.isArray(n)&&n.filter&&(this._validate(tu,"queryRenderedFeatures.filter",n.filter,null,n),o=i.bZ(n.filter));let s="mock",l=[];if(n&&n.target)l.push(Object.assign({},n,{targetId:s,filter:o}));else{for(let i of this.getFeaturesetDescriptors())l.push({targetId:s,filter:o,target:i});for(let{style:i}of this.fragments)for(let r of i.getFeaturesetDescriptors())l.push({targetId:s,filter:o,target:r})}let u=this.queryRenderedTargets(r,l,a),c=[],d=new Set;for(let r of u)for(let n of r.variants[s])nP(n,r,d)||c.push(new i.aZ(r,n));return c}queryRenderedTargets(r,n,a){let o={},s=(i,r,n,a)=>{let s=o[r.id]=o[r.id]||{sourceCache:r,layers:{},has3DLayers:!1};(s.layers[i.fqid]=s.layers[i.fqid]||{styleLayer:i,targets:[]},i.is3D(!!this.terrain)&&(s.has3DLayers=!0),a)?s.layers[i.fqid].targets.push(Object.assign({},n,{namespace:a.namespace,properties:a.properties,uniqueFeatureID:a.uniqueFeatureID})):(n.uniqueFeatureID=!1,s.layers[i.fqid].targets.push(n))};for(let r of n)if("featuresetId"in r.target){let{featuresetId:n,importId:a}=r.target,o=this.getFragmentStyle(a);if(!o||!o._featuresetSelectors)continue;let l=o._featuresetSelectors[n];if(!l){this.fire(new i.v(Error(`The featureset '${n}' does not exist in the map's style and cannot be queried for features.`)));continue}for(let i of l){let n=o.getOwnLayer(i.layerId);n&&!ay.has(n.type)&&s(n,o.getOwnLayerSourceCache(n),r,i)}}else if("layerId"in r.target){let{layerId:i}=r.target,n=this.getLayer(i);if(!n||ay.has(n.type))continue;s(n,this.getLayerSourceCache(n),r)}let l=this._queryRenderedFeatures(r,o,a);return this._flattenAndSortRenderedFeatures(l)}_queryRenderedFeatures(r,n,a){let o=[],s=!!this.map._showQueryGeometry,l=nA.createFromScreenPoints(r,a);for(let i in n){let r=function(i,r,n,a,o=!1,s){let l=r.sourceCache.transform,u=r.sourceCache.tilesIn(i,r.has3DLayers,o);u.sort(nO);let c=[];for(let i of u){let u=i.tile.queryRenderedFeatures(r,i,n,a,l,o,s);Object.keys(u).length&&c.push({wrappedTileID:i.tile.tileID.wrapped().key,queryResults:u})}for(let n in r.layers){let o=r.layers[n];if(o.styleLayer){let n=o.styleLayer.queryRenderedFeatures(i,r.sourceCache,a);Object.keys(n).length&&c.push({wrappedTileID:0,queryResults:n})}}return 0===c.length?{}:function(i){let r={},n={};for(let a of i){let i=a.queryResults,o=a.wrappedTileID,s=n[o]=n[o]||{};for(let n in i){let a=i[n],o=s[n]=s[n]||{},l=r[n]=r[n]||[];for(let i of a)o[i.featureIndex]||(o[i.featureIndex]=!0,l.push(i))}}return r}(c)}(l,n[i],this._availableImages,a,s,this.getActualScope());Object.keys(r).length&&o.push(r)}if(this.placement)for(let r in n){if(n[r].sourceCache._renderSourceType!==i.aC.Symbol)continue;let a=function(i,r,n,a,o,s){let l={},u=a.queryRenderedSymbols(i),c=[];for(let i of Object.keys(u).map(Number))c.push(o[i]);for(let i of(c.sort(nO),c)){let a=i.featureIndex.lookupSymbolFeatures(u[i.bucketInstanceId],i.bucketIndex,i.sourceLayerIndex,r,n,s);for(let r in a){let n=l[r]=l[r]||[],o=a[r];for(let r of(o.sort((r,n)=>{let a=i.featureSortOrder;if(a){let i=a.indexOf(r.featureIndex);return a.indexOf(n.featureIndex)-i}return n.featureIndex-r.featureIndex}),o))n.push(r)}}return l}(l.screenGeometry,n[r],this._availableImages,this.placement.collisionIndex,this.placement.retainedQueryData,this.map.getWorldview());Object.keys(a).length&&o.push(a)}return o}querySourceFeatures(i,r){let n=r&&r.filter;
110n&&this._validate(tu,"querySourceFeatures.filter",n,null,r);let a=[];for(let n of this.getOwnSourceCaches(i))a=a.concat(function(i,r){let n=i.getRenderableIds().map(r=>i.getTileByID(r)),a=[],o={};for(let i=0;i<n.length;i++){let s=n[i],l=s.tileID.canonical.key;o[l]||(o[l]=!0,s.querySourceFeatures(a,r))}return a}(n,r));return a}addSourceType(i,r,n){return ab.getSourceType(i)?n(Error(`A source type called "${i}" already exists.`)):(ab.setSourceType(i,r),n(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(r,n,a={}){this._checkLoaded();let o=this.light.getLight(),s=!1;for(let n in r)if(!i.c2(r[n],o[n])){s=!0;break}if(!s)return;let l=this._getTransitionParameters();this.light.setLight(r,n,a),this.light.updateTransitions(l)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}checkCanvasFingerprintNoise(){void 0===this.disableElevatedTerrain&&(this.disableElevatedTerrain=i.co.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&i.f_("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."))}setTerrain(r,n=1){if(this._checkLoaded(),!r)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),0===n&&delete this.terrain,null===r?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);this.checkCanvasFingerprintNoise();let a=r,o=!("source"in r)||null==r.source;if(1===n){if(this.disableElevatedTerrain)return;if("source"in a&&"object"==typeof a.source){let r="terrain-dem-src";this.addSource(r,a.source),a=Object.assign(a=i.bL(a),{source:r})}let r=Object.assign({},a),n={};if(this.terrain&&o){r.source=this.terrain.get().source;let i=this.terrain?this.getFragmentStyle(this.terrain.scope):null;i&&(n.style=i.serialize())}if(this._validate(tn,"terrain",r,n))return}if(this.terrain&&(this.terrain.scope===this.scope||o)&&(!this.terrain||n===this.terrain.drapeRenderMode)){let n=this.terrain,o=n.get();for(let r of Object.keys(i.fs.terrain))!Object.hasOwn(a,r)&&i.fs.terrain[r].default&&(a[r]=i.fs.terrain[r].default);for(let a in r)if(!i.c2(r[a],o[a])){n.set(r,this.options),this.stylesheet.terrain=r;let a=this._getTransitionParameters({duration:0});n.updateTransitions(a),this.fire(new i.x("data",{dataType:"style"}));break}}else{if(!a)return;this._createTerrain(a,n),this.fire(new i.x("data",{dataType:"style"}))}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(i){let r=this.fog=new tT(i,this.map.transform,this.scope,this.options);this.stylesheet.fog=r.get();let n=this._getTransitionParameters({duration:0});r.updateTransitions(n)}_createSnow(i){let r=this.snow=new tA(i,this.map.transform,this.scope,this.options);this.stylesheet.snow=r.get();let n=this._getTransitionParameters({duration:0});r.updateTransitions(n)}_createRain(i){let r=this.rain=new tC(i,this.map.transform,this.scope,this.options);this.stylesheet.rain=r.get();let n=this._getTransitionParameters({duration:0});r.updateTransitions(n)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask(()=>{for(let i of this.map._markers)i._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(r){if(this._checkLoaded(),r)if(this.fog){let n=this.fog;if(!i.c2(n.get(),r)){n.set(r,this.options),this.stylesheet.fog=n.get();let i=this._getTransitionParameters({duration:0});n.updateTransitions(i)}}else this._createFog(r);else delete this.fog,delete this.stylesheet.fog;this._markersNeedUpdate=!0,this._programPrecompiler&&this._programPrecompiler.reset()}getSnow(){return this.snow?this.snow.get():null}setSnow(r){if(this._checkLoaded(),!r)return delete this.snow,void delete this.stylesheet.snow;if(this.snow){let n=this.snow;if(!i.c2(n.get(),r)){n.set(r,this.options),this.stylesheet.snow=n.get();let i=this._getTransitionParameters({duration:0});n.updateTransitions(i)}}else this._createSnow(r);
110this._markersNeedUpdate=!0}getRain(){return this.rain?this.rain.get():null}setRain(r){if(this._checkLoaded(),!r)return delete this.rain,void delete this.stylesheet.rain;if(this.rain){let n=this.rain;if(!i.c2(n.get(),r)){n.set(r,this.options),this.stylesheet.rain=n.get();let i=this._getTransitionParameters({duration:0});n.updateTransitions(i)}}else this._createRain(r);this._markersNeedUpdate=!0}_reloadColorTheme(){let r=()=>{for(let i in this._layers)this._layers[i].lut=this._styleColorTheme.lut;for(let i in this._sourceCaches)this._sourceCaches[i].clearTiles()},n=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(!n)return this._styleColorTheme.lut=null,void r();let a=this._evaluateColorThemeData(n);this._loadColorTheme(a).then(()=>{this.fire(new i.x("colorthemeset")),r()}).catch(r=>{i.f_(`Couldn't set color theme: ${r}`)})}setColorTheme(r){this._checkLoaded(),this._styleColorTheme.colorThemeOverride&&i.f_("Note: setColorTheme is called on a style with a color-theme override, the passed color-theme won't be visible."),this._styleColorTheme.colorTheme=r,this._reloadColorTheme()}setImportColorTheme(i,r){let n=this.getFragmentStyle(i);n&&(n._styleColorTheme.colorThemeOverride=r,n._reloadColorTheme())}_getTransitionParameters(r){return{now:i.co.now(),transition:Object.assign(this.transition,r)}}updateDrapeFirstLayers(){if(!this.terrain)return;let i=[],r=[];for(let n of this._mergedOrder)this.isLayerDraped(this._mergedLayers[n])?i.push(n):r.push(n);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...i),this._drapedFirstOrder.push(...r)}_createTerrain(i,r){let n=this.terrain=new ty(i,r,this.scope,this.options,this.map.getWorldview());1===r&&(this.stylesheet.terrain=i),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();let a=this._getTransitionParameters({duration:0});n.updateTransitions(a)}_force3DLayerUpdate(){for(let i in this._layers){let r=this._layers[i];"fill-extrusion"===r.type&&this._updateLayer(r)}}_forceSymbolLayerUpdate(){for(let i in this._layers){let r=this._layers[i];"symbol"===r.type&&this._updateLayer(r)}}_validate(r,n,a,o,s={}){if(s&&!1===s.validate)return!1;let l=Object.assign({},this.serialize());return ap(this,r.call(te,Object.assign({key:n,style:l,value:a,styleSpec:i.fs},o)))}_remove(){for(let r in this._programPrecompiler&&(this._programPrecompiler.reset(),this._programPrecompiler=null),this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),i.ck.off("pluginStateChange",this._rtlTextPluginCallback),this._mergedLayers)this._mergedLayers[r].setEventedParent(null);for(let i in this._mergedSourceCaches){let r=this._mergedSourceCaches[i];r.clearTiles(),r.setEventedParent(null);let n=r.getSource();n&&n.onRemove&&n.onRemove(this.map)}this.imageManager.removeScope(this.scope),this.imageManager.imageAtlasCache.clear(),this.setEventedParent(null),delete this.fog,delete this.snow,delete this.rain,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.indoorManager&&this.indoorManager.destroy(),this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.modelManager.setEventedParent(null),this.modelManager.destroy(),this.dispatcher.remove())}clearSource(i){for(let r of this.getSourceCaches(i))r.clearTiles()}clearSources(){for(let i in this._mergedSourceCaches)this._mergedSourceCaches[i].clearTiles()}clearLayers(){for(let i in this._mergedLayers){let r=this._mergedLayers[i];r._clear&&r._clear()}}reloadSource(i){for(let r of this.getSourceCaches(i))r.resume(),r.reload()}
110reloadSources(){for(let i of this.getSources())i.reload&&i.reload()}reloadModels(){this.modelManager.reloadModels(""),this.forEachFragmentStyle(i=>{i.modelManager.reloadModels(i.scope)})}updateSources(i){let r;this.directionalLight&&(r=iy(this.directionalLight));let n=new Set,a=new Set,o=new Set;for(let i in this._mergedLayers){let r=this._mergedLayers[i];"building"===r.type?n.add(r.source):"raster"===r.type&&r.paint&&"ground"===r.paint.get("raster-elevation-reference")&&o.add(r.source),r.hasElevation()&&!a.has(r.source)&&a.add(r.source)}for(let s in this.updateFrcCoverageFadeRange(),this._mergedSourceCaches){let l=this._mergedSourceCaches[s],u=a.has(l._source.id);l._isRasterElevatedOverTerrain=o.has(l._source.id),n.has(l._source.id)&&(l._source.reparseOverscaled=!1),l.update(i,void 0,void 0,r,u)}this.updateFrcCoverage()}_reloadSources(){for(let i in this._sourceCaches){let r=this._sourceCaches[i];r.resume(),r.reload()}}updateFrcCoverageFadeRange(){this.map.painter&&rJ&&rJ(this,this.map.painter)}updateFrcCoverage(){this._hdCoverage&&rX&&rX(this,this._hdCoverage)}_handleLayerOrderChange(){this._requestFullLabelPlacement(),this.fire(new i.x("neworder"))}_requestFullLabelPlacement(){this.pauseablePlacement||(this.pauseablePlacement=new ae),this.pauseablePlacement.requestFullPlacement()}_setLabelPlacementStale(){this.placement&&this.placement.setStale()}_updatePlacement(r,n,a,o,s,l){this.pauseablePlacement||(this.pauseablePlacement=new ae);let u=!1,c=!1,d={},h={};for(let n of this._mergedOrder){let a=this._mergedLayers[n];if("symbol"!==a.type)continue;let o=i.ea(a.source,a.scope),s=d[o];if(!s){let i=this.getLayerSourceCache(a);if(!i)continue;let r=i.getRenderableIds(!0).map(r=>i.getTileByID(r));h[o]=r.slice(),s=d[o]=r.sort((i,r)=>r.tileID.overscaledZ-i.tileID.overscaledZ||(i.tileID.isLessThan(r.tileID)?-1:1))}let l=this.crossTileSymbolIndex.addLayer(a,s,r.center.lng,r.projection);u=u||l}this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder);let f=!!(this.placement&&!r.equals(this.placement.transform)),p=!!(this.placement&&(0!==this.placement.lastReplacementSourceUpdateTime&&!s||this.placement.lastReplacementSourceUpdateTime!==s.updateTime)),m=f||p||u,g=(m||this.pauseablePlacement.isStale())&&0===a,_=this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.co.now(),r.zoom)&&0!==a;if((this.pauseablePlacement.isFullPlacementRequested()||!this.pauseablePlacement.placement||g||_)&&(this.pauseablePlacement=this.pauseablePlacement.startNewPlacement(r,this._mergedOrder,n,a,o,this.placement,this.fog&&r.projection.supportsFog?this.fog.state:null,this._buildingIndex,l),this.map.painter)){let i=this.map.painter.maxFrontCutoffRawStart;if(i>0){let n=180*r.pitch/Math.PI;if(n>=15){let r=Math.min(1,Math.max(0,(n-15)/5)),a=r*r*(3-2*r);this.pauseablePlacement.placement.frontCutoffStart=-.5*(1-a)+i*a}}}if(this.pauseablePlacement.isDone()?m&&0!==a&&this.pauseablePlacement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,d,h,this.map.painter.scaleFactor),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.co.now()),c=!0),u&&this.pauseablePlacement.setStale()),c||u){this._buildingIndex.onNewFrame(r.zoom);for(let r=0;r<this._mergedOrder.length;r++){let n=this._mergedLayers[this._mergedOrder[r]];if("symbol"!==n.type||"none"===n.visibility)continue;let a=this.isLayerClipped(n);this.placement.updateLayerOpacities(n,d[i.ea(n.source,n.scope)],r,a?s:null)}}return!this.pauseablePlacement.isDone()||this.placement.isStale()||this.placement.hasTransitions(i.co.now())}_releaseSymbolFadeTiles(){for(let i in this._sourceCaches)this._sourceCaches[i].releaseSymbolFadeTiles()}addImport(r,n){this._checkLoaded();let a=this.stylesheet.imports=this.stylesheet.imports||[];if(-1!==a.findIndex(({id:i})=>i===r.id))return void this.fire(new i.v(Error(`Import with id '${r.id}' already exists in the map's style.`)));if(!n)return a.push(r),this._loadImports([r],!0);let o=a.findIndex(({id:i})=>i===n);return -1===o&&this.fire(new i.v(Error(`Import with id "${n}" does not exist on this map.`))),this.stylesheet.imports=a.slice(0,o).c
110oncat(r).concat(a.slice(o)),this._loadImports([r],!0,n)}updateImport(r,n){this._checkLoaded();let a=this.stylesheet.imports||[],o=this.getImportIndex(r);return -1===o||("string"==typeof n?this.setImportUrl(r,n):(n.url&&n.url!==a[o].url&&this.setImportUrl(r,n.url),i.c2(n.config,a[o].config)||this.setImportConfig(r,n.config,n.data.schema),i.c2(n.data,a[o].data)||this.setImportData(r,n.data))),this}moveImport(i,r){this._checkLoaded();let n=this.stylesheet.imports||[],a=this.getImportIndex(i);if(-1===a)return this;let o=this.getImportIndex(r);if(-1===o)return this;let s=n[a],l=this.fragments[a];return n=n.filter(({id:r})=>r!==i),this.fragments=this.fragments.filter(({id:r})=>r!==i),this.stylesheet.imports=n.slice(0,o).concat(s).concat(n.slice(o)),this.fragments=this.fragments.slice(0,o).concat(l).concat(this.fragments.slice(o)),this.mergeLayers(),this}setImportUrl(i,r){this._checkLoaded();let n=this.stylesheet.imports||[],a=this.getImportIndex(i);if(-1===a)return this;n[a].url=r;let o=this.fragments[a];return o.style=this._createFragmentStyle(n[a]),o.style.on("style.import.load",()=>this.mergeAll()),o.style.loadURL(r),this}setImportData(i,r){this._checkLoaded();let n=this.getImportIndex(i),a=this.stylesheet.imports||[];return -1===n?this:r?(this.fragments[n].style.setState(r),this._reloadImports(),this):(delete a[n].data,this.setImportUrl(i,a[n].url))}setImportConfig(i,r,n){this._checkLoaded();let a=this.getImportIndex(i),o=this.stylesheet.imports||[];if(-1===a)return this;r?o[a].config=r:delete o[a].config;let s=this.fragments[a];n&&s.style.stylesheet&&(s.style.stylesheet.schema=n);let l=s.style.stylesheet&&s.style.stylesheet.schema;return s.config=r,s.style.updateConfig(r,l),this.updateConfigDependencies(),this}removeImport(i){this._checkLoaded();let r=this.stylesheet.imports||[],n=this.getImportIndex(i);-1!==n&&(r.splice(n,1),this.fragments[n].style._remove(),this.fragments.splice(n,1),this._reloadImports())}getImportIndex(r){let n=(this.stylesheet.imports||[]).findIndex(i=>i.id===r);return -1===n&&this.fire(new i.v(Error(`Import '${r}' does not exist in the map's style and cannot be updated.`))),n}getLayer(i){return this._mergedLayers[i]}getSources(){let i=[];for(let r in this._mergedOtherSourceCaches){let n=this._mergedOtherSourceCaches[r];n&&i.push(n.getSource())}return i}getSource(i,r){let n=this.getSourceCache(i,r);return n&&n.getSource()}getLayerSource(i){let r=this.getLayerSourceCache(i);return r&&r.getSource()}getSourceCache(r,n){let a=i.ea(r,n);return this._mergedOtherSourceCaches[a]}getLayerSourceCache(r){let n=i.ea(r.source,r.scope);return"symbol"===r.type?this._mergedSymbolSourceCaches[n]:"fill-extrusion"===r.type?this._mergedFillExtrusionSourceCaches[n]||this._mergedOtherSourceCaches[n]:"fill"===r.type&&r.sourceLayer===i.X&&this._mergedHdRoadCoverageSourceCaches[n]?this._mergedHdRoadCoverageSourceCaches[n]:this._mergedOtherSourceCaches[n]}getSourceCaches(i){if(null==i)return Object.values(this._mergedSourceCaches);let r=[];return this._mergedOtherSourceCaches[i]&&r.push(this._mergedOtherSourceCaches[i]),this._mergedSymbolSourceCaches[i]&&r.push(this._mergedSymbolSourceCaches[i]),this._mergedFillExtrusionSourceCaches[i]&&r.push(this._mergedFillExtrusionSourceCaches[i]),this._mergedHdRoadCoverageSourceCaches[i]&&r.push(this._mergedHdRoadCoverageSourceCaches[i]),r}updateSourceCaches(){let i=this._changes.getUpdatedSourceCaches();for(let r in i){let n=i[r];"reload"===n?this.reloadSource(r):"clear"===n&&this.clearSource(r)}}updateLayers(i){for(let r of this._changes.getUpdatedPaintProperties()){let n=this.getLayer(r);n&&n.updateTransitions(i)}}getGlyphsUrl(){return this.stylesheet.glyphs}setGlyphsUrl(i){this.stylesheet.glyphs=i,this.glyphManager.setURL(i)}getImages(r,n,a){this.imageManager.getImages(n.icons.concat(n.patterns),n.scope,a),this._updateTilesForChangedImages();let o=n.icons.map(r=>i.a1.toString(r)),s=n.patterns.map(r=>i.a1.toString(r)),l=i=>{i&&(i.setDependencies(n.tileID.key,"icons",o),i.setDependencies(n.tileID.key,"patterns",s))},u=i.ea(n.source,n.scope);l(this._mergedOtherSourceCaches[u]),l(this._mergedSymbolSourceCaches[u]),(n.icons.some(i=>i.iconsetId)||n.patterns.some(i=>i.iconsetId))&&this.fire(new i.x("data",{dataType:"style"}))}rasterizeImages(i,r,n){this.imageManager.rasterizeImages(r,n)}checkAtlasCache(i,r,n){let a=this.imageManager.imageAtlasCache.findCachedAtlas(r.descriptor);n(null,a&&a.contentDescriptor?{iconPositions:a.iconPositions,patternPositions:a.patternPositions,sourceHash:a.contentDescriptor.hash}:null)}getGlyphs(i,r,n){this.glyphManager.getGlyphs(r.stacks,n)}getOwnSourceCache(i){return this._otherSourceCaches[i]}getOwnLayerSourceCache(i){return"symbol"===i.type?this._symbolSourceCaches[i.source]:"fill-extrusion"===i.t
110ype&&this._fillExtrusionSourceCaches[i.source]||this._otherSourceCaches[i.source]}getOwnSourceCaches(i){let r=[];return this._otherSourceCaches[i]&&r.push(this._otherSourceCaches[i]),this._symbolSourceCaches[i]&&r.push(this._symbolSourceCaches[i]),this._fillExtrusionSourceCaches[i]&&r.push(this._fillExtrusionSourceCaches[i]),this._hdCoverage&&this._hdCoverage.coverageSourceCaches[i]&&r.push(this._hdCoverage.coverageSourceCaches[i]),r}_updateHdCoverageSourceCache(r){return rK&&rQ?(this._hdCoverage||(this._hdCoverage=new rK),rQ(this,this._hdCoverage,r),!1):"fill"===r.type&&r.sourceLayer===i.X}_isSourceCacheLoaded(r){let n=this.getOwnSourceCaches(r);return 0===n.length?(this.fire(new i.v(Error(`There is no source with ID '${r}'`))),!1):n.every(i=>i.loaded())}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(i,r){if(!this._clipLayerPresent&&"fill-extrusion"!==i.type&&"building"!==i.type)return!1;let n="fill-extrusion"===i.type&&("building"===i.sourceLayer||"procedural_buildings"===i.sourceLayer),a="building"===i.type;if(i.is3D(!!this.terrain)){if(n||a||r&&"batched-model"===r.type||"model"===i.type)return!0}else if("symbol"===i.type)return!0;return!1}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}getBOMObject(){}destroy(){this._clearWorkerCaches(),this.imageManager.imageAtlasCache.clear(),this.fragments.forEach(i=>{i.style._remove()}),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}ab.getSourceType=function(i){return nR[i]},ab.setSourceType=function(i,r){nR[i]=r},ab.registerForPluginStateChange=i.e_;class aw{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(i,r,n,a,o,s,l,u){this.context=i;let c=this.boundPaintVertexBuffers.length!==a.length;for(let i=0;!c&&i<a.length;i++)this.boundPaintVertexBuffers[i]!==a[i]&&(c=!0);let d=this.boundDynamicVertexBuffers.length!==l.length;for(let i=0;!d&&i<l.length;i++)this.boundDynamicVertexBuffers[i]!==l[i]&&(d=!0);if(!this.vao||this.boundProgram!==r||this.boundLayoutVertexBuffer!==n||c||d||this.boundIndexBuffer!==o||this.boundVertexOffset!==s)this.freshBind(r,n,a,o,s,l,u);else{for(let n of(i.bindVertexArrayOES.set(this.vao),l))n&&(n.bind(),u&&n.instanceCount&&n.setVertexAttribDivisor(i.gl,r,u));o&&o.dynamicDraw&&o.bind()}}freshBind(i,r,n,a,o,s,l){let u=this.context,c=u.gl;for(let l of(this.vao&&this.destroy(),this.vao=u.gl.createVertexArray(),u.bindVertexArrayOES.set(this.vao),this.boundProgram=i,this.boundLayoutVertexBuffer=r,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=a,this.boundVertexOffset=o,this.boundDynamicVertexBuffers=s,r.enableAttributes(c,i),r.bind(),r.setVertexAttribPointers(c,i,o),n))l.enableAttributes(c,i),l.bind(),l.setVertexAttribPointers(c,i,o);for(let r of s)r&&(r.enableAttributes(c,i),r.bind(),r.setVertexAttribPointers(c,i,o),l&&r.instanceCount&&r.setVertexAttribDivisor(c,i,l));a&&a.bind()}destroy(){this.vao&&(this.context.gl.deleteVertexArray(this.vao),this.vao=null)}}function aT(r,n,a){if(!n.needsDEMTextureUpload)return;let o=r.context,s=o.gl;o.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||r.getTileTexture(a.stride);let l=a.getPixels();n.demTexture?n.demTexture.update(l,{premultiply:!1}):n.demTexture=new i.a_(o,l,s.R32F,{premultiply:!1}),n.needsDEMTextureUpload=!1}class aE{constructor(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(i){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class aS extends aE{getDefault(){return i.i.transparent.toNonPremultipliedRenderColor(null)}set(i){let r=this.current;(i.r!==r.r||i.g!==r.g||i.b!==r.b||i.a!==r.a||this.dirty)&&(this.gl.clearColor(i.r,i.g,i.b,i.a),this.current=i,this.dirty=!1)}}class aA extends aE{getDefault(){return 1}set(i){(i!==this.current||this.dirty)&&(this.gl.clearDepth(i),this.current=i,this.dirty=!1)}}class aC extends aE{getDefault(){return 0}set(i){(i!==this.current||this.dirty)&&(this.gl.clearStencil(i),this.current=i,this.dirty=!1)}}
110class aI extends aE{getDefault(){return[!0,!0,!0,!0]}set(i){let r=this.current;(i[0]!==r[0]||i[1]!==r[1]||i[2]!==r[2]||i[3]!==r[3]||this.dirty)&&(this.gl.colorMask(i[0],i[1],i[2],i[3]),this.current=i,this.dirty=!1)}}class ak extends aE{getDefault(){return!0}set(i){(i!==this.current||this.dirty)&&(this.gl.depthMask(i),this.current=i,this.dirty=!1)}}class aR extends aE{getDefault(){return 255}set(i){(i!==this.current||this.dirty)&&(this.gl.stencilMask(i),this.current=i,this.dirty=!1)}}class aM extends aE{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(i){let r=this.current;(i.func!==r.func||i.ref!==r.ref||i.mask!==r.mask||this.dirty)&&(this.gl.stencilFunc(i.func,i.ref,i.mask),this.current=i,this.dirty=!1)}}class aL extends aE{getDefault(){let i=this.gl;return[i.KEEP,i.KEEP,i.KEEP]}set(i){let r=this.current;(i[0]!==r[0]||i[1]!==r[1]||i[2]!==r[2]||this.dirty)&&(this.gl.stencilOp(i[0],i[1],i[2]),this.current=i,this.dirty=!1)}}class aP extends aE{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;let r=this.gl;i?r.enable(r.STENCIL_TEST):r.disable(r.STENCIL_TEST),this.current=i,this.dirty=!1}}class aO extends aE{getDefault(){return[0,1]}set(i){let r=this.current;(i[0]!==r[0]||i[1]!==r[1]||this.dirty)&&(this.gl.depthRange(i[0],i[1]),this.current=i,this.dirty=!1)}}class aD extends aE{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;let r=this.gl;i?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST),this.current=i,this.dirty=!1}}class aF extends aE{getDefault(){return this.gl.LESS}set(i){(i!==this.current||this.dirty)&&(this.gl.depthFunc(i),this.current=i,this.dirty=!1)}}class aN extends aE{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;let r=this.gl;i?r.enable(r.BLEND):r.disable(r.BLEND),this.current=i,this.dirty=!1}}class aj extends aE{getDefault(){let i=this.gl;return[i.ONE,i.ZERO,i.ONE,i.ZERO]}set(i){let r=this.current;(i[0]!==r[0]||i[1]!==r[1]||i[2]!==r[2]||i[3]!==r[3]||this.dirty)&&(this.gl.blendFuncSeparate(i[0],i[1],i[2],i[3]),this.current=i,this.dirty=!1)}}class az extends aE{getDefault(){return i.i.transparent.toNonPremultipliedRenderColor(null)}set(i){let r=this.current;(i.r!==r.r||i.g!==r.g||i.b!==r.b||i.a!==r.a||this.dirty)&&(this.gl.blendColor(i.r,i.g,i.b,i.a),this.current=i,this.dirty=!1)}}class aB extends aE{getDefault(){return this.gl.FUNC_ADD}set(i){(i!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(i,i),this.current=i,this.dirty=!1)}}class aU extends aE{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;let r=this.gl;i?r.enable(r.CULL_FACE):r.disable(r.CULL_FACE),this.current=i,this.dirty=!1}}class aV extends aE{getDefault(){return this.gl.BACK}set(i){(i!==this.current||this.dirty)&&(this.gl.cullFace(i),this.current=i,this.dirty=!1)}}class aH extends aE{getDefault(){return this.gl.CCW}set(i){(i!==this.current||this.dirty)&&(this.gl.frontFace(i),this.current=i,this.dirty=!1)}}let aG=class extends aE{getDefault(){return null}set(i){(i!==this.current||this.dirty)&&(this.gl.useProgram(i),this.current=i,this.dirty=!1)}};class aq extends aE{getDefault(){return this.gl.TEXTURE0}set(i){(i!==this.current||this.dirty)&&(this.gl.activeTexture(i),this.current=i,this.dirty=!1)}}class a$ extends aE{getDefault(){let i=this.gl;return[0,0,i.drawingBufferWidth,i.drawingBufferHeight]}set(i){let r=this.current;(i[0]!==r[0]||i[1]!==r[1]||i[2]!==r[2]||i[3]!==r[3]||this.dirty)&&(this.gl.viewport(i[0],i[1],i[2],i[3]),this.current=i,this.dirty=!1)}}class aW extends aE{getDefault(){return null}set(i){if(i===this.current&&!this.dirty)return;let r=this.gl;r.bindFramebuffer(r.FRAMEBUFFER,i),this.current=i,this.dirty=!1}}class aY extends aE{getDefault(){return null}set(i){if(i===this.current&&!this.dirty)return;let r=this.gl;r.bindRenderbuffer(r.RENDERBUFFER,i),this.current=i,this.dirty=!1}}class aZ extends aE{getDefault(){return null}set(i){if(i===this.current&&!this.dirty)return;let r=this.gl;r.bindTexture(r.TEXTURE_2D,i),this.current=i,this.dirty=!1}}class aK extends aE{getDefault(){return null}set(i){if(i===this.current&&!this.dirty)return;let r=this.gl;r.bindBuffer(r.ARRAY_BUFFER,i),this.current=i,this.dirty=!1}}class aX extends aE{getDefault(){return null}set(i){let r=this.gl;r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,i),this.current=i,this.dirty=!1}}class aQ extends aE{getDefault(){return null}set(i){this.gl&&(i!==this.current||this.dirty)&&(this.gl.bindVertexArray(i),this.current=i,this.dirty=!1)}}class aJ extends aE{getDefault(){return 4}set(i){if(i===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,i),this.current=i,this.dirty=!1}}class a1 extends aE{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i),this.current=i,this.dirty=!1}}class a0 extends aE{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,i),this.current=i,this.dirty=!1}}class a2 extends aE{constructor(i,r){super(i),this.context=i,this.parent=r}getDefault(){return null}}class a5 extends a2{constructor(i,r,n=0){super(i,r),this.attachmentPoint=i.gl.COLOR_ATTACHMENT0+n}setDirty(){this.dirty=!0}set(i){if(i===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferTexture2D(r.FRAMEBUFFER,this.attachmentPoint,r.TEXTURE_2D,i,0),this.current=i,this.dirty=!1}}class a4 extends a2{attachment(){return this.gl.DEPTH_ATTACHMENT}set(i){if(i===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,this.attachment(),r.RENDERBUFFER,i),this.current=i,this.dirty=!1}}class a9 extends a2{attachment(){return this.gl.DEPTH_ATTACHMENT}set(i){if(i===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferTexture2D(r.FRAMEBUFFER,this.attachment(),r.TEXTURE_2D,i,0),this.current=i,this.dirty=!1}}class a3 extends a4{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}let a8=(i,r,n,a)=>({u_matrix:i,u_image0:0,u_image1:1,u_skirt_height:r,u_ground_shadow_factor:n,u_emissive_texture_available:a}),a6=(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y)=>({u_proj_matrix:Float32Array.from(i),u_globe_matrix:r,u_normalize_matrix:Float32Array.from(a),u_merc_matrix:n,u_zoom_transition:o,u_merc_center:s,u_image0:0,u_image1:1,u_frustum_tl:l,u_frustum_tr:u,u_frustum_br:c,u_frustum_bl:d,u_globe_pos:h,u_globe_radius:f,u_viewport:p,u_grid_matrix:y?Float32Array.from(y):new Float32Array(9),u_skirt_height:m,u_far_z_cutoff:g,u_emissive_texture_available:_});function a7(i,r){return null!=i&&null!=r&&!(!i.hasData()||!r.hasData())&&null!=i.demTexture&&null!=r.demTexture&&i.tileID.key!==r.tileID.key}let oe=new class{constructor(){this.operations={}}newMorphing(i,r,n,a,o){if(i in this.operations){let r=this.operations[i];r.to.tileID.key!==n.tileID.key&&(r.queued=n)}else this.operations[i]={startTime:a,phase:0,duration:o,from:r,to:n,queued:null}}getMorphValuesForProxy(i){if(!(i in this.operations))return null;let r=this.operations[i];return{from:r.from,to:r.to,phase:r.phase}}update(i){for(let r in this.operations){let n=this.operations[r];for(n.phase=(i-n.startTime)/n.duration;n.phase>
110=1||!this._validOp(n);)if(!this._nextOp(n,i)){delete this.operations[r];break}}}_nextOp(i,r){return!!i.queued&&(i.from=i.to,i.to=i.queued,i.queued=null,i.phase=0,i.startTime=r,!0)}_validOp(i){return i.from.hasData()&&i.to.hasData()}};function ot(i,r,n){return 0===r?0:6*Math.pow(1.5,22-i)*Math.max(r,1)*(r<1&&514===n?.25/r:1)}function oi(i,r){if(!i.style||!i.style.enable3dLights())return;let n=i.context,a=n.gl;n.activeTexture.set(a.TEXTURE1),r?r.bind(a.LINEAR,a.CLAMP_TO_EDGE):i.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE)}class or extends rR{constructor(i){const r=nM("mock-dem",{type:"raster-dem",maxzoom:Math.ceil(i.transform.maxZoom)},i.style.dispatcher,i.style);super("mock-dem",r,null),r.setEventedParent(this),this._sourceLoaded=!0}_loadTile(i,r){i.state="loaded",r(null)}}class on extends rR{constructor(i){const r=nM("proxy",{type:"geojson",maxzoom:Math.ceil(i.transform.maxZoom)},i.style.dispatcher,i.style);super("proxy",r,null),r.setEventedParent(this),this.map=this.getSource().map=i,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(r,n,a){if(r.freezeTileCoverage)return;this.transform=r;let o=r.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((n,a)=>{if(n[a.key]="",!this._tiles[a.key]){let n=new i.b0(a,this._source.tileSize*a.overscaleFactor(),r.tileZoom,void 0,void 0,this._source.worldview);n.state="loaded",this._tiles[a.key]=n}return n},{});for(let i in this._tiles)i in o||(this.freeFBO(i),this._tiles[i].unloadVectorData(),delete this._tiles[i])}freeFBO(i){let r=this.proxyCachedFBO[i];if(void 0!==r){let n=Object.values(r);this.renderCachePool.push(...n),delete this.proxyCachedFBO[i]}}deallocRenderCache(){this.renderCache.forEach(i=>i.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class oa extends i.ap{constructor(i,r,n){super(i.overscaledZ,i.wrap,i.canonical.z,i.canonical.x,i.canonical.y),this.proxyTileKey=r,this.projMatrix=n}}class oo extends i.s{constructor(r,n){super(),this.painter=r,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[a,o,s]=function(){let r=new i.aQ,n=new i.aT;r.reserve(17161),n.reserve(33800);let a=i.r/128,o=i.r+a/2,s=o+a;for(let n=-a;n<s;n+=a)for(let l=-a;l<s;l+=a){let a=24575*(l<0||l>o||n<0||n>o),s=i.bG(Math.round(l),0,i.r),u=i.bG(Math.round(n),0,i.r);r.emplaceBack(s+a,u)}let l=(i,r)=>{let a=131*r+i;n.emplaceBack(a+1,a,a+131),n.emplaceBack(a+131,a+131+1,a+1)};for(let i=1;i<129;i++)for(let r=1;r<129;r++)l(r,i);return[0,129].forEach(i=>{for(let r=0;r<130;r++)l(r,i),l(i,r)}),[r,n,32768]}(),l=r.context;this.gridBuffer=l.createVertexBuffer(a,i.eQ.members),this.gridIndexBuffer=l.createIndexBuffer(o),this.gridSegments=i.aJ.simpleSegment(0,0,a.length,o.length),this.gridNoSkirtSegments=i.aJ.simpleSegment(0,0,a.length,s),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new on(n.map),this.orthoMatrix=i.bT(),i.eB(this.orthoMatrix,.015*("globe"===this.painter.transform.projection.name),i.r,0,i.r,0,1);const u=l.gl;this._overlapStencilMode=new t7({func:u.GEQUAL,mask:255},0,255,u.KEEP,u.KEEP,u.REPLACE),this._previousZoom=r.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=n,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new or(n.map),this._pendingGroundEffectLayers=[],this._emissiveTexture=!1,this._devtoolsFolder=null}set style(i){i.on("data",this._onStyleDataEvent.bind(this)),this._style=i,this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(r,n,a){if(r&&r.terrain){this._style!==r&&(this.style=r,this._evaluationZoom=void 0);let o=r.terrain.properties,s=0===r.terrain.drapeRenderMode,l=r.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=i.co.now();let u=r.terrain&&r.terrain.scope,c=o.get("source"),d=s?this._mockSourceCache:r.getSourceCache(c,u);if(!d)return void i.f_(`Couldn't find terrain source "${c}".`);if(this.sourceCache=d,this._attenuationRange=r.terrain.getAttenuationRange(),this._exaggeration=l?this.calculateExaggeration(n):o.get("exaggeration"),!n.projection.requiresDraping&&l&&0===this._exaggeration)return void this._disable();this.enabled=!0;let h=()=>{this.sourceCache.used&&i.f_(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.
111This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);let r=this.getScaledDemTileSize();this.sourceCache.update(n,r,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,h(),this._initializing=!0),h(),n.updateElevation(!0,a),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(n),this._emptyDEMTextureDirty=!0,this._previousZoom=n.zoom}else this._disable()}calculateExaggeration(r){if(this._attenuationRange&&r.zoom>=Math.ceil(this._attenuationRange[1]))return this._style.terrain.getExaggeration(r.zoom);let n=this._previousCameraAltitude,a=r.getFreeCameraOptions().position.z/r.pixelsPerMeter*r.worldSize;this._previousCameraAltitude=a;let o=null!=n?a-n:Number.MAX_VALUE;if(2>Math.abs(o))return this._exaggeration;let s=r.zoom,l=this._style.terrain;if(!this._previousUpdateTimestamp)return l.getExaggeration(s);let u=s-this._previousZoom,c=this._previousUpdateTimestamp,d=s;null!=this._evaluationZoom&&(Math.abs(s-(d=this._evaluationZoom))>.5&&(u=.5*(s-d+u)),u*o<0&&(d+=u)),this._evaluationZoom=d;let h=l.getExaggeration(d),f=h===l.getExaggeration(Math.max(0,d-.1));if(f&&.01>Math.abs(h-this._exaggeration))return h;let p=Math.min(.1,.00375*(this._updateTimestamp-c));return(f||h<.1||1e-4>Math.abs(u))&&(p=Math.min(.2,4*p)),i.dY(this._exaggeration,h,p)}resetTileLookupCache(i){this._findCoveringTileCache[i]={}}attenuationRange(){return this._attenuationRange}getDemUpscale(){return this.proxySourceCache.getSource().tileSize/128}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(i){"source"===i.dataType&&i.coord?this._clearRenderCacheForTile(i.sourceCacheId,i.coord):"style"===i.dataType&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=!1,this._emptyDEMTextureDirty=!0,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(let i in this._style._mergedSourceCaches)this._style._mergedSourceCaches[i].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach(i=>
111i.fb.destroy()),this.pool=[],this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this.enabled?this._exaggeration:0}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){let i=2*this.proxySourceCache.getSource().tileSize;return[i,i]}set useVertexMorphing(i){this._useVertexMorphing=i}updateTileBinding(r){var n;let a,o;if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;let s=this.proxySourceCache,l=this.painter.transform;this._initializing&&(this._initializing=0===l._centerAltitude&&-1===this.getAtPointOrZero(i.ag.fromLngLat(l.center),-1),this._emptyDEMTextureDirty=!this._initializing);let u=this.proxyCoords=s.getIds().map(i=>{let r=s.getTileByID(i).tileID;return r.projMatrix=l.calculateProjMatrix(r.toUnwrapped()),r});a=(n=this.painter).transform.pointCoordinate(n.transform.getCameraPoint()),o=new i.au(a.x,a.y),u.sort((r,n)=>{if(n.overscaledZ-r.overscaledZ)return n.overscaledZ-r.overscaledZ;let a=new i.au(r.canonical.x+(1<<r.canonical.z)*r.wrap,r.canonical.y),s=new i.au(n.canonical.x+(1<<n.canonical.z)*n.wrap,n.canonical.y),l=o.mult(1<<r.canonical.z);return l.x-=.5,l.y-=.5,l.distSqr(a)-l.distSqr(s)});let c=this.proxyToSource||{};this.proxyToSource={},u.forEach(i=>{this.proxyToSource[i.key]={}}),this.terrainTileForTile={};let d=this._style._mergedSourceCaches;for(let i in d){let n=d[i];if(!n.used||(n!==this.sourceCache&&this.resetTileLookupCache(n.id),this._setupProxiedCoordsForOrtho(n,r[i],c),n.usedForTerrain))continue;let a=r[i];(n.getSource().reparseOverscaled||n._isRasterElevatedOverTerrain)&&this._assignTerrainTiles(a)}this.proxiedCoords[s.id]=u.map(i=>new oa(i,i.key,this.orthoMatrix)),this._assignTerrainTiles(u),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(c),this.renderingToTexture=!1;let h={};for(let i of(this._visibleDemTiles=[],this.proxyCoords)){let r=this.terrainTileForTile[i.key];if(!r)continue;let n=r.tileID.key;n in h||(this._visibleDemTiles.push(r),h[n]=n)}}_assignTerrainTiles(i){this._initializing||i.forEach(i=>{if(this.terrainTileForTile[i.key])return;let r=this._findTileCoveringTileID(i,this.sourceCache);r&&(this.terrainTileForTile[i.key]=r)})}_prepareDEMTextures(){let i=this.painter.context,r=i.gl;for(let n in this.terrainTileForTile){let a=this.terrainTileForTile[n],o=a.dem;o&&(!a.demTexture||a.needsDEMTextureUpload)&&(i.activeTexture.set(r.TEXTURE1),aT(this.painter,a,o))}}_prepareDemTileUniforms(i,r,n,a){if(!r||null==r.demTexture)return!1;let o=i.tileID.canonical,s=Math.pow(2,r.tileID.canonical.z-o.z),l=a||"";return n[`u_dem_tl${l}`]=[o.x*s%1,o.y*s%1],n[`u_dem_scale${l}`]=s,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let i=0,r=this._visibleDemTiles.reduce((r,n)=>{if(!n.dem)return r;let a=n.dem.tree.minimums[0];return a>0&&i++,r+a},0);return i?r/i:0}_updateEmptyDEMTexture(){let r=this.painter.context,n=r.gl;r.activeTexture.set(n.TEXTURE2);let a=this._getLoadedAreaMinimum(),o=new i.L({width:1,height:1},new Float32Array([a]));this._emptyDEMTextureDirty=!1;let s=this._emptyDEMTexture;return s?s.update(o,{premultiply:!1}):s=this._emptyDEMTexture=new i.a_(r,o,n.R32F,{premultiply:!1}),s}setupElevationDraw(r,n,a){var o;let s=this.painter.context,l=s.gl,u={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0};u.u_exaggeration=this.exaggeration();let c=null,d=null,h=1;if(a&&a.morphing&&this._useVertexMorphing){let i=a.morphing.srcDemTile,n=a.morphing.dstDemTile;
111h=a.morphing.phase,i&&n&&(this._prepareDemTileUniforms(r,i,u,"_prev")&&(d=i),this._prepareDemTileUniforms(r,n,u)&&(c=n))}let f=i=>i&&i.demTexture&&this.painter.linearFloatFilteringSupported()?l.LINEAR:l.NEAREST,p=null;if(this.enabled?d&&c?(p=c.demTexture,s.activeTexture.set(l.TEXTURE4),d.demTexture.bind(f(d),l.CLAMP_TO_EDGE),u.u_dem_lerp=h):(c=this.terrainTileForTile[r.tileID.key],p=this._prepareDemTileUniforms(r,c,u)?c.demTexture:this.emptyDEMTexture):p=this.emptyDEMTexture,s.activeTexture.set(l.TEXTURE2),p&&(u.u_dem_size=1===(o=p).size[0]?1:o.size[0]-2,p.bind(f(c),l.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(a&&a.useDepthForOcclusion,n,u),a&&a.useMeterToDem&&c&&(u.u_meter_to_dem=(1<<c.tileID.canonical.z)*i.em(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize),a&&a.labelPlaneMatrixInv&&(u.u_label_plane_matrix_inv=a.labelPlaneMatrixInv),n.setTerrainUniformValues(s,u),"globe"===this.painter.transform.projection.name){let i=this.globeUniformValues(this.painter.transform,r.tileID.canonical,a&&a.useDenormalizedUpVectorScale);n.setGlobeUniformValues(s,i)}}globeUniformValues(r,n,a){let o=r.projection;return{u_tile_tl_up:o.upVector(n,0,0),u_tile_tr_up:o.upVector(n,i.r,0),u_tile_br_up:o.upVector(n,i.r,i.r),u_tile_bl_up:o.upVector(n,0,i.r),u_tile_up_scale:a?i.dg(1):o.upVectorScale(n,r.center.lat,r.worldSize).metersToTile}}renderToBackBuffer(r){let n=this.painter,a=this.painter.context;0!==r.length&&(a.bindFramebuffer.set(null),a.viewport.set([0,0,n.width,n.height]),n.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(r,n,a,o,s){if("globe"===r.transform.projection.name)!function(r,n,a,o,s){let l,u,c=r.context,d=c.gl,h=r.transform,f=i.dn(r,c,h),p=(i,n)=>{if(u===n)return;let a=[];1===n&&a.push("TERRAIN_VERTEX_MORPHING"),a.push("PROJECTION_GLOBE_VIEW"),f&&a.push("CUSTOM_ANTIALIASING");let o=r.isTileAffectedByFog(i);l=r.getOrCreateProgram("globeRaster",{defines:a,overrideFog:o}),u=n},m=r.colorModeForRenderPass(),g=new tz(d.LEQUAL,tz.ReadWrite,r.depthRangeFor3D);oe.update(s);let _=i.by(h),y=[i.ek(h.center.lng),i.el(h.center.lat)],v=r.globeSharedBuffers,x=[h.width*i.co.devicePixelRatio,h.height*i.co.devicePixelRatio],b=Float32Array.from(h.globeMatrix),w={useDenormalizedUpVectorScale:!0};{let h=r.transform,f=ot(h.zoom,n.exaggeration(),n.sourceCache._source.tileSize);u=-1;let T=d.TRIANGLES;for(let u of o){let o=a.getTile(u),E=t7.disabled,S=n.prevTerrainTileForTile[u.key],A=n.terrainTileForTile[u.key];a7(S,A)&&oe.newMorphing(u.key,S,A,s,250),oi(r,o.emissiveTexture),c.activeTexture.set(d.TEXTURE0),o.texture&&o.texture.bind(d.LINEAR,d.CLAMP_TO_EDGE);let C=oe.getMorphValuesForProxy(u.key),I=+!!C;C&&Object.assign(w,{morphing:{srcDemTile:C.from,dstDemTile:C.to,phase:i.cb(C.phase)}});let k=i.fF(u.canonical),R=i.cU(k.getCenter().lat),M=i.cP(u.canonical,k,R,h.worldSize/h._pixelsPerMercatorPixel),L=i.dh(i.dk(u.canonical)),P=+("mrt-fallback"===r.emissiveMode),O=a6(h.expandedFarZProjMatrix,b,_,L,i.dm(h.zoom),y,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,x,f,h._farZ,P,M);if(p(u,I),l&&(n.setupElevationDraw(o,l,w),r.uploadCommonUniforms(c,l,u.toUnwrapped()),v)){let[i,n,a]=v.getGridBuffers(R,0!==f);l.draw(r,T,g,E,m,tj.backCCW,O,"globe_raster",i,n,a)}}}if(v&&(r.renderDefaultNorthPole||r.renderDefaultSouthPole)){let s=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];for(let u of(f&&s.push("CUSTOM_ANTIALIASING"),l=r.getOrCreateProgram("globeRaster",{defines:s}),o)){let{x:o,y:s,z:f}=u.canonical,p=0===s,_=s===(1<<f)-1,[b,T,E,S]=v.getPoleBuffers(f,!1);if(S&&(p||_)){let s=a.getTile(u);oi(r,s.emissiveTexture),c.activeTexture.set(d.TEXTURE0),s.texture&&s.texture.bind(d.LINEAR,d.CLAMP_TO_EDGE);let v=i.dj(f,o,h),A=i.dh(i.dk(u.canonical)),C=+("mrt-fallback"===r.emissiveMode),I=(i,n)=>i.draw(r,d.TRIANGLES,g,t7.disabled,m,tj.disabled,a6(h.expandedFarZProjMatrix,v,v,A,0,y,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,x,0,h._farZ,C),"globe_pole_raster",n,E,S);n.setupElevationDraw(s,l,w),r.uploadCommonUniforms(c,l,u.toUnwrapped()),p&&r.renderDefaultNorthPole&&I(l,b),_&&r.renderDefaultSouthPole&&(v=i.fc(i.bT(),v,[1,-1,1]),I(l,T))}}}}(r,n,a,o,s);else{let l,u,c=r.context,d=c.gl,h=r.shadowRenderer,f=t6(r,r.longestCutoffRange),p=i=>{if(u===i)return;let n=[];1===i&&n.push("TERRAIN_VERTEX_MORPHING"),f.shouldRenderCutoff&&n.push("RENDER_CUTOFF"),h&&(n.push("RENDER_SHADOWS"),h.useNormalOffset&&n.push("NORMAL_OFFSET")),l=r.getOrCreateProgram("terrainRaster",{defines:n}),u=i},m=r.colorModeForRenderPass(),g=new tz(d.LEQUAL,tz.ReadWrite,r.depthRangeFor3D);oe.update(s);let _=r.transform,y=ot(_.zoom,n.exaggeration(),n.sourceCache._source.tileSize),v=[0,0,0];if(h){let i=r.style.directionalLight,n=r.style.ambientLight;i&&n&&(v=iv(r.style,i,n))}{u=-1;let x=d.TRIANGLES,[b,w]=[n.gridIndexBuffer,n.gridSegments];for(let u of o){let o,T=a.getTile(u),E=t7.disabled,S=n.prevTerrainTileForTile[u.key],A=n.terrainTileForTile[u.key];a7(S,A)&&oe.newMorphing(u.key,S,A,s,250),oi(r,T.emissiveTexture),c.activeTexture.set(d.TEXTURE0),T.texture&&T.texture.bind(d.LINEAR,d.CLAMP_TO_EDGE);let C=oe.getMorphValuesForProxy(u.key),I=+!!C;C&&(o={morphing:{srcDemTile:C.from,dstDemTile:C.to,phase:i.cb(C.phase)}});let k=+("mrt-fallback"===r.emissiveMode),R=a8(u.projMatrix,!function(i,r){let n=1<<i.z;return!r&&(0===i.x||i.x===n-1)||0===i.y||i.y===n-1}(u.canonical,_.renderWorldCopies)?y:y/10,v,k);if(p(I),!l)continue;n.setupElevationDraw(T,l,o);let M=u.toUnwrapped();h&&h.setupShadows(M,l),r.uploadCommonUniforms(c,l,M,null,f),l.draw(r,x,g,E,m,tj.backCCW,R,"terrain_raster",n.gridBuffer,b,w)}}}}(n,this,this.proxySourceCache,r,this._updateTimestamp),this.renderingToTexture=!0,n.gpuTimingDeferredRenderEnd(),r.splice(0,r.length))}renderBatch(r){if(0===this._drapedRenderBatches.length)return r+1;this.renderingToTexture=!0;let n=this.painter,a=this.painter.context,o=this.proxySourceCache,s=this.proxiedCoords[o.id],l=this._drapedRenderBatches.shift(),u=n.style.order,c=[];this._updateFBOs("mrt-fallback"===n.emissiveMode);let d=0;for(let h of s){let s,f=o.getTileByID(h.proxyTileKey),p=o.proxyCachedFBO[h.key]?o.proxyCachedFBO[h.key][r]:void 0,m=void 0!==p?o.renderCache[p]:this.pool[d++],g=void 0!==p;if(f.texture=m.tex,f.emissiveTexture=m.emissiveTex,g&&!m.dirty){c.push(f.tileID);continue}a.bindFramebuffer.set(m.fb.framebuffer);let _=a.gl;_.drawBuffers("mrt-fallback"===n.emissiveMode?[_.COLOR_ATTACHMENT0,_.COLOR_ATTACHMENT1]:[_.COLOR_ATTACHMENT0]),this.renderedToTile=!1,m.dirty&&(a.clear({color:i.i.transparent,stencil:0}),m.dirty=!1);for(let i=l.start;i<=l.end;++i){let r=n.style._mergedLayers[u[i]];if(r.isHidden(n.transform.zoom))continue;let o=n.style.getLayerSourceCache(r),l=o?this.proxyToSource[h.key][o.id]:[h];l&&(a.viewport.set([0,0,m.fb.width,m.fb.height]),s!==(o?o.id:null)&&(this._setupStencil(m,l,r,o),s=o?o.id:null),n.renderLayer(n,o,r,l))}if(_.drawBuffers([_.COLOR_ATTACHMENT0]),0===this._drapedRenderBatches.length)for(let i of this._pendingGroundEffectLayers){let r=n.style._mergedLayers[u[i]];if(r.isHidden(n.transform.zoom))continue;let o=n.style.getLayerSourceCache(r),l=o?this.proxyToSource[h.key][o.id]:[h];l&&(a.viewport.set([0,0,m.fb.width,m.fb.height]),s!==(o?o.id:null)&&(this._setupStencil(m,l,r,o),s=o?o.id:null),n.renderLayer(n,o,r,l))}this.renderedToTile?(m.dirty=!0,c.push(f.tileID)):g||--d,5===d&&(d=0,this.renderToBackBuffer(c))}return this.renderToBackBuffer(c),this.renderingToTexture=!1,a.bindFramebuffer.set(null),a.viewport.set([0,0,n.width,n.height]),l.end+1}postRender(){}isLayerOrderingCorrect(i){let r=i.order.length,n=-1,a=r;for(let o=0;o<r;++o)this._style.isLayerDraped(i._mergedLayers[i.order[o]])?n=Math.max(n,o):a=Math.min(a,o);return a>n}
111getMinElevationBelowMSL(){let i=0;return this._visibleDemTiles.filter(i=>i.dem).forEach(r=>{i=Math.min(i,r.dem.tree.minimums[0])}),0===i?i:(i-30)*this._exaggeration}raycast(i,r,n){if(!this._visibleDemTiles)return null;let a=this._visibleDemTiles.filter(i=>i.dem).map(a=>{let o=a.tileID,s=1<<o.overscaledZ,{x:l,y:u}=o.canonical,c=l/s,d=(l+1)/s,h=u/s,f=(u+1)/s;return{minx:c,miny:h,maxx:d,maxy:f,t:a.dem.tree.raycastRoot(c,h,d,f,i,r,n),tile:a}});for(let o of(a.sort((i,r)=>(null!==i.t?i.t:Number.MAX_VALUE)-(null!==r.t?r.t:Number.MAX_VALUE)),a)){if(null==o.t)break;let a=o.tile.dem.tree.raycast(o.minx,o.miny,o.maxx,o.maxy,i,r,n);if(null!=a)return a}return null}_createFBO(){let r,n=this.painter.context,a=n.gl,o=this.drapeBufferSize;n.activeTexture.set(a.TEXTURE0);let s=new i.a_(n,{width:o[0],height:o[1],data:null},a.RGBA8);s.bind(a.LINEAR,a.CLAMP_TO_EDGE);let l=n.createFramebuffer(o[0],o[1],1,null);return l.colorAttachment0.set(s.texture),this._emissiveTexture&&((r=new i.a_(n,{width:o[0],height:o[1],data:null},a.R8)).bind(a.LINEAR,a.CLAMP_TO_EDGE),l.createColorAttachment(n,1),l.colorAttachment1.set(r.texture)),l.depthAttachment=new a3(n,l.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=n.createRenderbuffer(n.gl.DEPTH_STENCIL,o[0],o[1]),this._stencilRef=0,l.depthAttachment.set(this._sharedDepthStencil),n.clear({stencil:0})):l.depthAttachment.set(this._sharedDepthStencil),n.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,n.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,n.extTextureFilterAnisotropicMax),{fb:l,tex:s,emissiveTex:r,dirty:!1}}_updateFBOs(i){if(this._emissiveTexture!==i){for(let r of this.pool)this._updateFBO(r,i);for(let r of this.proxySourceCache.renderCache)this._updateFBO(r,i);this._emissiveTexture=i}}_updateFBO(r,n){let a=r.fb,o=this.painter.context,s=o.gl,l=this.drapeBufferSize;if(n){let n=new i.a_(o,{width:l[0],height:l[1],data:null},s.R8);n.bind(s.LINEAR,s.CLAMP_TO_EDGE),r.emissiveTex=n,a.createColorAttachment(o,1),a.colorAttachment1.set(n.texture)}else r.emissiveTex=void 0,a.removeColorAttachment(o,1);r.dirty=!0}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._style.hasLightTransitions())return!0;for(let i in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[i].hasTransition())return!0;return this._style.order.some(i=>{let r=this._style._mergedLayers[i],n=r.isHidden(this.painter.transform.zoom);return"hillshade"===r.type||"custom"===r.type?!n&&r.shouldRedrape():!n&&r.hasTransition()})}_clearLineLayersFromRenderCache(){let r=!1;for(let i of this._style.getSources())if(i instanceof nk){r=!0;break}if(!r)return;let n={};for(let r=0;r<this._style.order.length;++r){let a=this._style._mergedLayers[this._style.order[r]],o=this._style.getLayerSourceCache(a);if(!o||n[o.id]||a.isHidden(this.painter.transform.zoom)||"line"!==a.type)continue;let s=a.widthExpression(),l=a.emissiveStrengthExpression();if(s instanceof i.bh||l instanceof i.bh)for(let i of(n[o.id]=!0,this.proxyCoords)){let r=this.proxyToSource[i.key][o.id];if(r)for(let i of r)this._clearRenderCacheForTile(o.id,i)}}}_clearRasterLayersFromRenderCache(){let i=!1;for(let r in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[r]._source instanceof iV){i=!0;break}if(!i)return;let r={};for(let i=0;i<this._style.order.length;++i){let n=this._style._mergedLayers[this._style.order[i]],a=this._style.getLayerSourceCache(n);if(!a||r[a.id]||n.isHidden(this.painter.transform.zoom)||"raster"!==n.type)continue;let o=n.paint.get("raster-fade-duration");for(let i of this.proxyCoords){let r=this.proxyToSource[i.key][a.id];if(r)for(let i of r){let r=i$(a.getTile(i),a.findLoadedParent(i,0),a,this.painter.transform,o);(1!==r.opacity||0!==r.mix)&&this._clearRenderCacheForTile(a.id,i)}}}}_setupDrapedRenderBatches(){this._style.updateDrapeFirstLayers();let r=this._style.order,n=r.length;if(0===n)return;let a=[];this._pendingGroundEffectLayers=[];let o,s=0,l=this._style._mergedLayers[r[s]];for(;!this._style.isLayerDraped(l)&&l.isHidden(this.painter.transform.zoom)&&++s<n;)l=this._style._mergedLayers[r[s]];for(;s<n;++s){let i=this._style._mergedLayers[r[s]];i.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(i)?void 0===o&&(o=s):("fill-extrusion"===i.t
111ype&&this._pendingGroundEffectLayers.push(s),void 0!==o&&(a.push({start:o,end:s-1}),o=void 0)))}if(void 0!==o&&a.push({start:o,end:s-1}),0!==a.length){let r=a.at(-1);this._pendingGroundEffectLayers.every(i=>i>r.end)||i.f_("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=a}_setupRenderCache(i){let r=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,r.renderCache.length>r.renderCachePool.length){let i=Object.values(r.proxyCachedFBO);r.proxyCachedFBO={};for(let n=0;n<i.length;++n){let a=Object.values(i[n]);r.renderCachePool.push(...a)}}return}this._clearRasterLayersFromRenderCache();let n=this.proxyCoords,a=this._tilesDirty;for(let o=n.length-1;o>=0;o--){let s=n[o];if(r.getTileByID(s.key),void 0!==r.proxyCachedFBO[s.key]){let n=i[s.key],o=this.proxyToSource[s.key],l=0;for(let i in o){let r=o[i],s=n[i];if(!s||s.length!==r.length||r.some((r,n)=>r!==s[n]||a[i]&&Object.hasOwn(a[i],r.key))){l=-1;break}++l}for(let i in r.proxyCachedFBO[s.key])r.renderCache[r.proxyCachedFBO[s.key][i]].dirty=l<0||l!==Object.values(n).length}}let o=[...this._drapedRenderBatches];for(let i of(o.sort((i,r)=>r.end-r.start-(i.end-i.start)),o))for(let a of n){if(r.proxyCachedFBO[a.key])continue;let n=r.renderCachePool.pop();void 0===n&&r.renderCache.length<50&&(n=r.renderCache.length,r.renderCache.push(this._createFBO())),void 0!==n&&(r.proxyCachedFBO[a.key]={},r.proxyCachedFBO[a.key][i.start]=n,r.renderCache[n].dirty=!0)}this._tilesDirty={}}_setupStencil(i,r,n,a){let o;if(!a||!this._sourceTilesOverlap[a.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));let s=this.painter.context,l=s.gl;if(r.length<=1)return void(this._overlapStencilType=!1);if(n.isTileClipped())o=r.length,this._overlapStencilMode.test={func:l.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(r[0].overscaledZ>r.at(-1).overscaledZ))return void(this._overlapStencilType=!1);o=1,this._overlapStencilMode.test={func:l.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+o>255&&(s.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=o,this._overlapStencilMode.ref=this._stencilRef,n.isTileClipped()&&this._renderTileClippingMasks(r,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(i){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[i.key]),this._overlapStencilMode):t7.disabled}_renderTileClippingMasks(i,r){let n=this.painter,a=this.painter.context,o=a.gl;n._tileClippingMaskIDs={},a.setColorMode(ie.disabled),a.setDepthMode(tz.disabled);let s=n.getOrCreateProgram("clippingMask");for(let a of i){let i=n._tileClippingMaskIDs[a.key]=--r;s.draw(n,o.TRIANGLES,tz.disabled,new t7({func:o.ALWAYS,mask:0},i,255,o.KEEP,o.KEEP,o.REPLACE),ie.disabled,tj.disabled,rP(a.projMatrix),"$clipping",n.tileExtentBuffer,n.quadTriangleIndexBuffer,n.tileExtentSegments)}}pointCoordinate(r){let n=this.painter.transform;if(r.x<0||r.x>n.width||r.y<0||r.y>n.height)return null;let a=[r.x,r.y,1,1];i.fM(a,a,n.pixelMatrixInverse),i.fb(a,a,1/a[3]),a[0]/=n.worldSize,a[1]/=n.worldSize;let o=n._camera.position,s=i.em(1,n.center.lat),l=[o[0],o[1],o[2]/s,0],u=i.fz([],a.slice(0,3),l);i.ex(u,u);let c=this.raycast(l,u,this._exaggeration);return null!==c&&c?(i.fe(l,l,u,c),l[3]=l[2],l[2]*=s,l):null}_setupProxiedCoordsForOrtho(r,n,a){if(r.getSource()instanceof i.a3)return this._setupProxiedCoordsForImageSource(r,n,a);this._findCoveringTileCache[r.id]=this._findCoveringTileCache[r.id]||{};let o=this.proxiedCoords[r.id]=[],s=this.proxyCoords;for(let i=0;i<s.length;i++){let n=s[i],l=this._findTileCoveringTileID(n,r);if(l){let i=this._createProxiedId(n,l,a[n.key]&&a[n.key][r.id]);o.push(i),this.proxyToSource[n.key][r.id]=[i]}}let l=!1,u=new Set;for(let i=0;i<n.length;i++){let s=r.getTile(n[i]);if(!s||!s.hasData())continue;let c=this._findTileCoveringTileID(s.tileID,this.proxySourceCache);
111if(c&&c.tileID.canonical.z!==s.tileID.canonical.z){let i=this.proxyToSource[c.tileID.key][r.id],n=this._createProxiedId(c.tileID,s,a[c.tileID.key]&&a[c.tileID.key][r.id]);i?i.splice(i.length-1,0,n):this.proxyToSource[c.tileID.key][r.id]=[n];let d=this.proxyToSource[c.tileID.key][r.id];u.has(d)||u.add(d),o.push(n),l=!0}}if(this._sourceTilesOverlap[r.id]=l,l)for(let i of u)i.sort((i,r)=>r.overscaledZ-i.overscaledZ)}_setupProxiedCoordsForImageSource(r,n,a){if(!r.getSource().loaded())return;let o=this.proxiedCoords[r.id]=[],s=this.proxyCoords,l=r.getSource(),u=l.tileID;if(!u)return;let c=new i.au(u.x,u.y)._div(1<<u.z),d=l.coordinates.map(i.ag.fromLngLat).reduce((i,r)=>(i.min.x=Math.min(i.min.x,r.x-c.x),i.min.y=Math.min(i.min.y,r.y-c.y),i.max.x=Math.max(i.max.x,r.x-c.x),i.max.y=Math.max(i.max.y,r.y-c.y),i),{min:new i.au(Number.MAX_VALUE,Number.MAX_VALUE),max:new i.au(-Number.MAX_VALUE,-Number.MAX_VALUE)}),h=(r,n)=>{let a=r.wrap+r.canonical.x/(1<<r.canonical.z),o=r.canonical.y/(1<<r.canonical.z),s=i.r/(1<<r.canonical.z),l=n.wrap+n.canonical.x/(1<<n.canonical.z),u=n.canonical.y/(1<<n.canonical.z);return a+s<l+d.min.x||a>l+d.max.x||o+s<u+d.min.y||o>u+d.max.y};for(let i=0;i<s.length;i++){let l=s[i];for(let i=0;i<n.length;i++){let s=r.getTile(n[i]);if(!s||!s.hasData()||h(l,s.tileID))continue;let u=this._createProxiedId(l,s,a[l.key]&&a[l.key][r.id]),c=this.proxyToSource[l.key][r.id];c?c.push(u):this.proxyToSource[l.key][r.id]=[u],o.push(u)}}}_createProxiedId(r,n,a){let o=this.orthoMatrix;if(a){let i=a.find(i=>i.key===n.tileID.key);if(i)return i}if(n.tileID.key!==r.key){let a,s,l,u=r.canonical.z-n.tileID.canonical.z;o=i.bT();let c=n.tileID.wrap-r.wrap<<r.overscaledZ;u>0?(s=(a=i.r>>u)*((n.tileID.canonical.x<<u)-r.canonical.x+c),l=a*((n.tileID.canonical.y<<u)-r.canonical.y)):(a=i.r<<-u,s=i.r*(n.tileID.canonical.x-(r.canonical.x+c<<-u)),l=i.r*(n.tileID.canonical.y-(r.canonical.y<<-u))),i.eB(o,0,a,0,a,0,1),i.fQ(o,o,[s,l,0])}return new oa(n.tileID,r.key,o)}_findTileCoveringTileID(r,n){let a=n.getTile(r);if(a&&a.hasData())return a;let o=this._findCoveringTileCache[n.id],s=o[r.key];if((a=s?n.getTileByID(s):null)&&a.hasData()||null===s)return a;let l=a?a.tileID:r,u=l.overscaledZ,c=n.getSource().minzoom,d=[];if(!s){let o=n.getSource().maxzoom;if(r.canonical.z>=o){let a=r.canonical.z-o;n.getSource().reparseOverscaled?(u=Math.max(r.canonical.z+2,n.transform.tileZoom),l=new i.ap(u,r.wrap,o,r.canonical.x>>a,r.canonical.y>>a)):0!==a&&(u=o,l=new i.ap(u,r.wrap,o,r.canonical.x>>a,r.canonical.y>>a))}l.key!==r.key&&(d.push(l.key),a=n.getTile(l))}let h=i=>{d.forEach(r=>{o[r]=i}),d.length=0};for(u-=1;u>=c&&(!a||!a.hasData());u--){a&&h(a.tileID.key);let i=l.calculateScaledKey(u);if((a=n.getTileByID(i))&&a.hasData())break;let r=o[i];if(null===r)break;void 0===r?d.push(i):a=n.getTileByID(r)}return h(a?a.tileID.key:null),a&&a.hasData()?a:null}findDEMTileFor(i){return this.enabled?this._findTileCoveringTileID(i,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(i,r){let n=this._tilesDirty[i];n||(n=this._tilesDirty[i]={}),n[r.key]=!0}}let os=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],ol=["stars","rainParticle","snowParticle","fillExtrusion","fillExtrusionGroundEffect","building","buildingBloom","elevatedStructures","model","symbol"];class ou{static cacheKey(i,r,n,a){let o=[r];for(let r of(a&&o.push(a.cacheKey),n))("string"==typeof r&&r.includes(" ")||i.usedDefines.has(r))&&o.push(r);return o.join("/")}constructor(i,r,n,a,o,s,l=!1){const u=i.gl;this.program=u.createProgram(),this._context=i,this._fixedUniformsFn=o,this._pending=!0,this._precompiled=l,this.attributes={},this.configuration=a,this.name=r,this.fixedDefines=[...s],l?i._compileStats.precompiled++:i._compileStats.onDemand++;const c=`#version 300 es
112${(a?a.defines():[]).concat(s.map(i=>`#define ${i}`)).join("\n")}`,d=[c,ro];for(const i of n.fragmentIncludes)d.push(re[i]);d.push(n.fragmentSource);const h=d.join("\n"),f=[c,rs];for(const i of n.vertexIncludes)f.push(re[i]);this.forceManualRenderingForInstanceIDShaders=i.forceManualRenderingForInstanceIDShaders&&n.vertexSource.includes("gl_InstanceID"),this.forceManualRenderingForInstanceIDShaders&&f.push("uniform int u_instanceID;"),f.push(n.vertexSource);let p=f.join("\n");this.forceManualRenderingForInstanceIDShaders&&(p=p.replaceAll("gl_InstanceID","u_instanceID"));const m=u.createShader(u.FRAGMENT_SHADER);if(u.isContextLost())return this.failedToCreate=!0,void(this._pe
112nding=!1);u.shaderSource(m,h),u.compileShader(m),u.attachShader(this.program,m);const g=u.createShader(u.VERTEX_SHADER);if(u.isContextLost())return this.failedToCreate=!0,void(this._pending=!1);u.shaderSource(g,p),u.compileShader(g),u.attachShader(this.program,g),u.linkProgram(this.program),this._fragmentShader=m,this._vertexShader=g,i.extParallelShaderCompile?i._pendingPrograms.add(this):this._finalize()}_finalize(){if(!this._pending)return;this._pending=!1;let r=this._context,n=r.gl;r._pendingPrograms.delete(this);let a=i.co.now(),o=n.getProgramParameter(this.program,n.LINK_STATUS),s=i.co.now()-a,l=r._compileStats;if(l.totalStallMs+=s,s>l.maxStallMs&&(l.maxStallMs=s),s>1){l.framesMissed+=Math.floor(60*s/1e3);let i=this.fixedDefines.join(",");l.stalls.push({name:`${this.name}${i?"/":""}${i}`,ms:s,timestamp:a})}if(this._fragmentShader&&(o||i.f_(`Fragment shader '${this.name}': ${n.getShaderInfoLog(this._fragmentShader)}`),n.deleteShader(this._fragmentShader),this._fragmentShader=null),this._vertexShader&&(o||i.f_(`Vertex shader '${this.name}': ${n.getShaderInfoLog(this._vertexShader)}`),n.deleteShader(this._vertexShader),this._vertexShader=null),!o)return i.f_(`Failed to link program '${this.name}': ${n.getProgramInfoLog(this.program)}`),void(this.failedToCreate=!0);this.fixedUniforms=this._fixedUniformsFn(r),this.fixedUniformsEntries=Object.entries(this.fixedUniforms),this.binderUniforms=this.configuration?this.configuration.getUniforms(r):[],this.forceManualRenderingForInstanceIDShaders&&(this.instancingUniforms={u_instanceID:new i.b5(r)});let u=this.fixedDefines,c=this.name;(u.includes("TERRAIN")||u.includes("ELEVATED")||c.includes("symbol")||c.includes("circle"))&&(this.terrainUniforms={u_dem:new i.b5(r),u_dem_prev:new i.b5(r),u_dem_tl:new i.b6(r),u_dem_scale:new i.b4(r),u_dem_tl_prev:new i.b6(r),u_dem_scale_prev:new i.b4(r),u_dem_size:new i.b4(r),u_dem_lerp:new i.b4(r),u_exaggeration:new i.b4(r),u_depth:new i.b5(r),u_depth_size_inv:new i.b6(r),u_depth_range_unpack:new i.b6(r),u_occluder_half_size:new i.b4(r),u_occlusion_depth_offset:new i.b4(r),u_meter_to_dem:new i.b4(r),u_label_plane_matrix_inv:new i.bb(r)}),u.includes("GLOBE")&&(this.globeUniforms={u_tile_tl_up:new i.b7(r),u_tile_tr_up:new i.b7(r),u_tile_br_up:new i.b7(r),u_tile_bl_up:new i.b7(r),u_tile_up_scale:new i.b4(r)}),u.includes("FOG")&&(this.fogUniforms={u_fog_matrix:new i.bb(r),u_fog_range:new i.b6(r),u_fog_color:new i.b8(r),u_fog_horizon_blend:new i.b4(r),u_fog_vertical_limit:new i.b6(r),u_fog_temporal_offset:new i.b4(r),u_frustum_tl:new i.b7(r),u_frustum_tr:new i.b7(r),u_frustum_br:new i.b7(r),u_frustum_bl:new i.b7(r),u_globe_pos:new i.b7(r),u_globe_radius:new i.b4(r),u_globe_transition:new i.b4(r),u_is_globe:new i.b5(r),u_viewport:new i.b6(r)}),u.includes("RENDER_CUTOFF")&&(this.cutoffUniforms={u_cutoff_params:new i.b8(r)}),u.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms={u_lighting_ambient_color:new i.b7(r),u_lighting_directional_dir:new i.b7(r),u_lighting_directional_color:new i.b7(r),u_ground_radiance:new i.b7(r)}),u.includes("RENDER_SHADOWS")&&(this.shadowUniforms={u_light_matrix_0:new i.bb(r),u_light_matrix_1:new i.bb(r),u_fade_range:new i.b6(r),u_shadow_normal_offset:new i.b7(r),u_shadow_intensity:new i.b4(r),u_shadow_texel_size:new i.b4(r),u_shadow_map_resolution:new i.b4(r),u_shadow_direction:new i.b7(r),u_shadow_bias:new i.b7(r),u_shadowmap_0:new i.b5(r),u_shadowmap_1:new i.b5(r)})}maybeFinalize(){if(!this._pending)return;let i=this._context.extParallelShaderCompile;i&&!this._context.gl.getProgramParameter(this.program,i.COMPLETION_STATUS_KHR)||this._finalize()}_ensureReady(){this._pending&&(this._finalize(),this._context.sweepPendingPrograms())}getAttributeLocation(i,r){this._ensureReady();let n=this.attributes[r];return void 0===n&&(n=this.attributes[r]=i.getAttribLocation(this.program,r)),n}setTerrainUniformValues(i,r){if(this._ensureReady(),!this.terrainUniforms)return;let n=this.terrainUniforms;if(!this.failedToCreate)for(let a in i.program.set(this.program),r)n[a]&&n[a].set(this.program,a,r[a])}setGlobeUniformValues(i,r){if(this._ensureReady(),!this.globeUniforms)return;let n=this.globeUniforms;if(!this.failedToCreate)for(let a in i.program.set(this.program),r)n[a]&&n[a].set(this.program,a,r[a])}setFogUniformValues(i,r){if(this._ensureReady(),!this.fogUniforms)return;let n=this.fogUniforms;if(!this.failedToCreate)for(let a in i.program.set(this.program),r)n[a].set(this.program,a,r[a])}setCutoffUniformValues(i,r){if(this._ensureReady(),!this.cutoffUniforms)return;let n=this.cutoffUniforms;if(!this.failedToCreate)for(let a in i.program.set(this.program),r)n[a].set(this.program,a,r[a])}setLightsUniformValues(i,r){if(this._ensureReady(),!this.lightsUniforms)return;let n=this.lightsUniforms;if(!this.failedToCreate)for(let a in i.program.set(this.program),r)n[a].set(this.program,a,r[a])}setShadowUniformValues(i,r){if(this._ensureReady(),this.failedToCreate||!this.shadowUniforms)return;let n=this.shadowUniforms;for(let a in i.program.set(this.program),r)n[a].set(this.program,a,r[a])}_drawDebugWireframe(r,n,a,o,s,l,u,c,d,h){let f=r.options.wireframe;if(!1===f.terrain&&!1===f.layers2D&&!1===f.layers3D)return;let p=r.context;if(!(!(!f.terrain||"terrainRaster"!==this.name&&"globeRaster"!==this.name)||!(!f.layers2D||r._terrain&&r._terrain.renderingToTexture||!os.includes(this.name))||!(!f.layers3D||!ol.includes(this.name))))return;let m=p.gl,g=r.wireframeDebugCache.getLinesFromTrianglesBuffer(r.frameCounter,s,p);if(!g)return;
112let _=[...this.fixedDefines,"DEBUG_WIREFRAME"],y=r.getOrCreateProgram(this.name,{config:this.configuration,defines:_});y._ensureReady(),p.program.set(y.program);let v=(i,r,n)=>{if(r[i]&&n[i])for(let a in r[i])n[i][a]&&n[i][a].set(n.program,a,r[i][a].current)};d&&d.setUniforms(y.program,p,y.binderUniforms,u,{zoom:c}),v("fixedUniforms",this,y),v("terrainUniforms",this,y),v("globeUniforms",this,y),v("fogUniforms",this,y),v("lightsUniforms",this,y),v("shadowUniforms",this,y),g.bind(),p.setColorMode(new ie([m.ONE,m.ONE_MINUS_SRC_ALPHA,m.ZERO,m.ONE],i.i.transparent,[!0,!0,!0,!1])),p.setDepthMode(new tz(n.func===m.LESS?m.LEQUAL:n.func,tz.ReadOnly,n.range)),p.setStencilMode(t7.disabled);let x=3*l.primitiveLength*2,b=3*l.primitiveOffset*4;if(this.forceManualRenderingForInstanceIDShaders){let i=h||1;for(let r=0;r<i;++r)y.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",r),m.drawElements(m.LINES,x,m.UNSIGNED_SHORT,b)}else h&&h>1?m.drawElementsInstanced(m.LINES,x,m.UNSIGNED_SHORT,b,h):m.drawElements(m.LINES,x,m.UNSIGNED_SHORT,b);s.bind(),p.program.set(this.program),p.setDepthMode(n),p.setStencilMode(a),p.setColorMode(o)}checkUniforms(i,r,n){if(this.fixedDefines.includes(r)){for(let a of Object.keys(n))if(!n[a].initialized)throw Error(`Program '${this.name}', from draw '${i}': uniform ${a} not set but required by ${r} being defined`)}}draw(i,r,n,a,o,s,l,u,c,d,h,f,p,m,g,_){let y=i.context,v=y.gl;if(this._ensureReady(),this.failedToCreate)return;for(let[i,r]of(y.program.set(this.program),y.setDepthMode(n),y.setStencilMode(a),y.setColorMode(o),y.setCullFace(s),this.fixedUniformsEntries))r.set(this.program,i,l[i]);m&&m.setUniforms(this.program,y,this.binderUniforms,f,{zoom:p});let x={[v.POINTS]:1,[v.LINES]:2,[v.TRIANGLES]:3,[v.LINE_STRIP]:1}[r];this.checkUniforms(u,"RENDER_SHADOWS",this.shadowUniforms);let b=g||[],w=m?m.getPaintVertexBuffers():[],T=r===v.TRIANGLES&&d,E=_&&_>0?1:void 0;for(let s of h.get()){let l=s.vaos||(s.vaos={});if((l[u]||(l[u]=new aw)).bind(y,this,c,w,d,s.vertexOffset,b,E),this.forceManualRenderingForInstanceIDShaders){let i=_||1;for(let n=0;n<i;++n)this.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",n),d?v.drawElements(r,s.primitiveLength*x,v.UNSIGNED_SHORT,s.primitiveOffset*x*2):v.drawArrays(r,s.vertexOffset,s.vertexLength)}else _&&_>1?v.drawElementsInstanced(r,s.primitiveLength*x,v.UNSIGNED_SHORT,s.primitiveOffset*x*2,_):d?v.drawElements(r,s.primitiveLength*x,v.UNSIGNED_SHORT,s.primitiveOffset*x*2):v.drawArrays(r,s.vertexOffset,s.vertexLength);T&&this._drawDebugWireframe(i,n,a,o,d,s,f,p,m,_)}}}let oc=(i,r,n)=>({u_matrix:i,u_emissive_strength:r,u_ground_shadow_factor:n,u_opacity_multiplier:1}),od=(i,r,n,a,o,s=0)=>Object.assign(oc(i,r,o),it(n,a,s)),oh=(i,r,n,a)=>({u_matrix:i,u_world:n,u_emissive_strength:r,u_ground_shadow_factor:a,u_opacity_multiplier:1}),of=(i,r,n,a,o,s,l=0)=>Object.assign(od(i,r,n,a,s,l),{u_world:o}),op=(i,r,n)=>({u_image:i,u_texel_size:r,u_first_pass:+!!n}),om=(r,n,a,o,s,l,u,c)=>{let d=i.r/l.tileSize;return{u_matrix:r,u_inv_rot_matrix:n,u_camera_to_center_distance:a.getCameraToCenterDistance(c),u_extrude_scale:[a.pixelsToGLUnits[0]/d,a.pixelsToGLUnits[1]/d],u_zoom_transition:o,u_tile_id:u,u_merc_center:s}},og=(i,r,n,a)=>({u_matrix:i,u_inv_matrix:r,u_camera_to_center_distance:n.getCameraToCenterDistance(a),u_viewport_size:[n.width,n.height]}),o_=i.bT(),oy=(r,n,a,o,s,l,u)=>{let c=r.transform,d="globe"===c.projection.name,h=d?i.di(c.zoom,n.canonical)*c._pixelsPerMercatorPixel:i.eG(a,1,l),f={u_matrix:n.projMatrix,u_extrude_scale:h,u_intensity:u,u_inv_rot_matrix:o_,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(d){f.u_inv_rot_matrix=o,f.u_merc_center=s,f.u_tile_id=[n.canonical.x,n.canonical.y,1<<n.canonical.z],f.u_zoom_transition=i.dm(c.zoom);let r=s[0]*i.r,a=s[1]*i.r;f.u_up_dir=c.projection.upVector(new i.f(0,0,0),r,a)}return f},ov=(r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w,T,E)=>{var S;let A,C,I;return{u_matrix:n,u_normalize_matrix:a,u_globe_matrix:o,u_merc_matrix:s,u_grid_matrix:l,u_tl_parent:u,u_scale_parent:f,u_fade_t:p.mix,u_opacity:p.opacity*m.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:m.paint.get("raster-brightness-min"),u_brightness_high:m.paint.get("raster-brightness-max"),u_saturation_factor:i.f9(m.paint.get("raster-saturation")),u_contrast_factor:i.bP(m.paint.get("raster-contrast")),u_spin_weights:(C=Math.sin(S=m.paint.get("raster-hue-rotate")*(Math.PI/180)
112),[(2*(I=Math.cos(S))+1)/3,(-Math.sqrt(3)*C-I+1)/3,(Math.sqrt(3)*C-I+1)/3]),u_perspective_transform:g,u_raster_elevation:_,u_zoom_transition:c,u_merc_center:d,u_cutoff_params:h,u_colorization_mix:iN(i.e,v,b),u_colorization_offset:ij(i.e,x,b),u_color_ramp:y,u_texture_offset:[T/(w+2*T),w/(w+2*T)],u_texture_res:[w+2*T,w+2*T],u_emissive_strength:E,u_zbias_factor:(A=r.terrain?r.terrain.exaggeration():1,(r.transform.pitch<15?i.dY(.07,.7,i.bG((14-r.transform.zoom)/5,0,1)):.07)*A)}},ox=i.bT(),ob=(r,n,a,o,s,l,u,c,d,h,f,p,m,g,_,y,v,x,b,w,T,E,S,A)=>{let C=s.transform,I={u_is_size_zoom_constant:+("constant"===r||"source"===r),u_is_size_feature_constant:+("constant"===r||"camera"===r),u_size_t:n?n.uSizeT:0,u_size:n?n.uSize:0,u_camera_to_center_distance:C.getCameraToCenterDistance(b),u_rotate_symbol:+a,u_aspect_ratio:C.width/C.height,u_fade_change:s.options.fadeDuration?s.symbolFadeChange:1,u_matrix:l,u_label_plane_matrix:u,u_coord_matrix:c,u_is_text:+h,u_elevation_from_sea:+!!d,u_pitch_with_map:+o,u_texsize:f,u_texsize_icon:p,u_texture:0,u_texture_icon:1,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:ox,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:ox,u_up_vector:[0,-1,0],u_color_adj_mat:E,u_icon_transition:S||0,u_gamma_scale:o?s.transform.getCameraToCenterDistance(b)*Math.cos(s.terrain?0:s.transform._pitch):1,u_device_pixel_ratio:i.co.devicePixelRatio,u_is_halo:1,u_scale_factor:A||1,u_ground_shadow_factor:w,u_inv_matrix:i.dr(i.bT(),u),u_normal_scale:T,u_lutTexture:10,u_spp_fill_np_color:[0,0,0,1],u_spp_halo_np_color:[0,0,0,0],u_spp_opacity:1,u_spp_halo_width:0,u_spp_halo_blur:0,u_spp_emissive_strength:0,u_spp_occlusion_opacity:1,u_spp_z_offset:0,u_spp_translate_rotation:[1,0],u_spp_fill_color_zoom_factor:0,u_spp_halo_color_zoom_factor:0,u_spp_opacity_zoom_factor:0,u_spp_halo_width_zoom_factor:0,u_spp_halo_blur_zoom_factor:0,u_spp_emissive_strength_zoom_factor:0,u_spp_occlusion_opacity_zoom_factor:0,u_spp_z_offset_zoom_factor:0,u_spp_translate_zoom_factor:0,u_opacity_multiplier:1};return"globe"===b.name&&(I.u_tile_id=[g.canonical.x,g.canonical.y,1<<g.canonical.z],I.u_zoom_transition=_,I.u_inv_rot_matrix=v,I.u_merc_center=y,I.u_camera_forward=C._camera.forward(),I.u_ecef_origin=i.df(C.globeMatrix,g.toUnwrapped()),I.u_tile_matrix=C.globeMatrix,I.u_up_vector=x),I},ow=(i,r,n,a)=>({u_matrix:i,u_emissive_strength:r,u_opacity:n,u_color:a}),oT=(r,n,a,o,s,l,u,c,d)=>Object.assign(function(r,n,a,o,s){let{width:l,height:u}=a.imageManager.getPixelSize(r),c=Math.pow(2,s.tileID.overscaledZ),d=s.tileSize*Math.pow(2,a.transform.tileZoom)/c,h=d*(s.tileID.canonical.x+s.tileID.wrap*c),f=d*s.tileID.canonical.y;return{u_image:0,u_pattern_tl:n.tl,u_pattern_br:n.br,u_texsize:[l,u],u_pattern_size:n.displaySize,u_pattern_units_to_pixels:o?[a.transform.width,-1*a.transform.height]:[1/i.eG(s,1,a.transform.tileZoom),1/i.eG(s,1,a.transform.tileZoom)],u_pixel_coord_upper:[h>>16,f>>16],u_pixel_coord_lower:[65535&h,65535&f]}}(l,u,o,c,d),{u_matrix:r,u_emissive_strength:n,u_opacity:a}),oE={fillExtrusion:r=>({u_matrix:new i.bb(r),u_lightpos:new i.b7(r),u_lightintensity:new i.b4(r),u_lightcolor:new i.b7(r),u_vertical_gradient:new i.b4(r),u_opacity:new i.b4(r),u_edge_radius:new i.b4(r),u_width_scale:new i.b4(r),u_ao:new i.b6(r),u_height_type:new i.b5(r),u_base_type:new i.b5(r),u_tile_id:new i.b7(r),u_zoom_transition:new i.b4(r),u_inv_rot_matrix:new i.bb(r),u_merc_center:new i.b6(r),u_up_dir:new i.b7(r),u_height_lift:new i.b4(r),u_flood_light_color:new i.b7(r),u_vertical_scale:new i.b4(r),u_flood_light_intensity:new i.b4(r),u_ground_shadow_factor:new i.b7(r),u_front_cutoff_params:new i.b7(r)}),fillExtrusionDepth:r=>({u_matrix:new i.bb(r),u_edge_radius:new i.b4(r),u_width_scale:new i.b4(r),u_vertical_scale:new i.b4(r),u_height_type:new i.b5(r),u_base_type:new i.b5(r)}),fillExtrusionPattern:r=>({u_matrix:new i.bb(r),u_lightpos:new i.b7(r),u_lightintensity:new i.b4(r),u_lightcolor:new i.b7(r),u_vertical_gradient:new i.b4(r),u_height_factor:new i.b4(r),u_edge_radius:new i.b4(r),u_width_scale:new i.b4(r),u_ao:new i.b6(r),u_height_type:new i.b5(r),u_base_type:new i.b5(r),u_tile_id:new i.b7(r),u_zoom_transition:new i.b4(r),u_inv_rot_matrix:new i.bb(r),u_merc_center:new i.b6(r),u_up_dir:new i.b7(r),u_height_lift:new i.b4(r),u_image:new i.b5(r),u_texsize:new i.b6(r),u_pixel_coord_upper:new i.b6(r),u_pixel_coord_lower:new i.b6(r),u_tile_units_to_pixels:new i.b4(r),u_opacity:new i.b4(r),u_pattern_transition:new i.b4(r)}),fillExtrusionGroundEffect:r=>({u_matrix:new i.bb(r),u_opacity:new i.b4(r),u_ao_pass:new i.b4(r),u_meter_to_tile:new i.b4(r),u_ao:new i.b6(r),u_flood_light_intensity:new i.b4(r),u_flood_light_color:new i.b7(r),u_attenuation:new i.b4(r),u_edge_radius:new i.b4(r),u_fb:new i.b5(r),u_fb_size:new i.b4(r),u_dynamic_offset:new i.b4(r)}),fill:r=>({u_matrix:new i.bb(r),u_emissive_strength:new i.b4(r),u_ground_shadow_factor:new i.b7(r),u_opacity_multiplier:new i.b4(r)}),fillPattern:r=>({u_matrix:new i.bb(r),u_emissive_strength:new i.b4(r),u_image:new i.b5(r),u_texsize:new i.b6(r),u_pixel_coord_upper:new i.b6(r),u_pixel_coord_lower:new i.b6(r),u_tile_units_to_pixels:new i.b4(r),u_ground_shadow_factor:new i.b7(r),u_pattern_transition:new i.b4(r),u_opacity_multiplier:new i.b4(r)}),fillOutline:r=>({u_matrix:new i.bb(r),u_emissive_strength:new i.b4(r),u_world:new i.b6(r),u_ground_shadow_factor:new i.b7(r),u_opacity_multiplier:new i.b4(r)}),fillOutlinePattern:r=>({u_matrix:new i.bb(r),u_emissive_strength:new i.b4(r),u_world:new i.b6(r),u_image:new i.b5(r),u_texsize:new i.b6(r),u_pixel_coord_upper:new i.b6(r),u_pixel_coord_lower:new i.b6(r),u_tile_units_to_pixels:new i.b4(r),u_ground_shadow_factor:new i.b7(r),u_pattern_transition:new i.b4(r),u_opacity_multiplier:new i.b4(r)}),lineBlendComposite:r=>({u_image:new i.b5(r),u_opacity:new i.b4(r),u_blend_mode:new i.b5(r),u_max_density:new i.b4(r)}),lineBlendReduce:r=>({u_image:new i.b5(r),u_texel_size:new i.b6(r),u_first_pass:new i.b5(r)}),circle:i.bE,collisionBox:r=>({u_matrix:new i.bb(r),u_inv_rot_matrix:new i.bb(r),u_camera_to_center_distance:new i.b4(r),u_extrude_scale:new i.b6(r),u_zoom_transition:new i.b4(r),u_merc_center:new i.b6(r),u_tile_id:new i.b7(r)}),collisionCircle:r=>({u_matrix:new i.bb(r),u_inv_matrix:new i.bb(r),u_camera_to_center_distance:new i.b4(r),u_viewport_size:new i.b6(r)}),debug:r=>
112({u_color:new i.b9(r),u_matrix:new i.bb(r),u_overlay:new i.b5(r),u_overlay_scale:new i.b4(r)}),clippingMask:r=>({u_matrix:new i.bb(r)}),heatmap:r=>({u_extrude_scale:new i.b4(r),u_intensity:new i.b4(r),u_matrix:new i.bb(r),u_inv_rot_matrix:new i.bb(r),u_merc_center:new i.b6(r),u_tile_id:new i.b7(r),u_zoom_transition:new i.b4(r),u_up_dir:new i.b7(r)}),heatmapTexture:r=>({u_image:new i.b5(r),u_color_ramp:new i.b5(r),u_opacity:new i.b4(r)}),hillshade:r=>({u_matrix:new i.bb(r),u_image:new i.b5(r),u_latrange:new i.b6(r),u_light:new i.b6(r),u_shadow:new i.b9(r),u_highlight:new i.b9(r),u_emissive_strength:new i.b4(r),u_accent:new i.b9(r)}),hillshadePrepare:r=>({u_matrix:new i.bb(r),u_image:new i.b5(r),u_dimension:new i.b6(r),u_zoom:new i.b4(r)}),line:i.e3,linePattern:i.e1,raster:r=>({u_matrix:new i.bb(r),u_normalize_matrix:new i.bb(r),u_globe_matrix:new i.bb(r),u_merc_matrix:new i.bb(r),u_grid_matrix:new i.ba(r),u_tl_parent:new i.b6(r),u_scale_parent:new i.b4(r),u_fade_t:new i.b4(r),u_opacity:new i.b4(r),u_image0:new i.b5(r),u_image1:new i.b5(r),u_brightness_low:new i.b4(r),u_brightness_high:new i.b4(r),u_saturation_factor:new i.b4(r),u_contrast_factor:new i.b4(r),u_spin_weights:new i.b7(r),u_perspective_transform:new i.b6(r),u_raster_elevation:new i.b4(r),u_zoom_transition:new i.b4(r),u_merc_center:new i.b6(r),u_cutoff_params:new i.b8(r),u_colorization_mix:new i.b8(r),u_colorization_offset:new i.b4(r),u_color_ramp:new i.b5(r),u_texture_offset:new i.b6(r),u_texture_res:new i.b6(r),u_emissive_strength:new i.b4(r),u_zbias_factor:new i.b4(r)}),symbol:r=>({u_is_size_zoom_constant:new i.b5(r),u_is_size_feature_constant:new i.b5(r),u_size_t:new i.b4(r),u_size:new i.b4(r),u_camera_to_center_distance:new i.b4(r),u_rotate_symbol:new i.b5(r),u_aspect_ratio:new i.b4(r),u_fade_change:new i.b4(r),u_matrix:new i.bb(r),u_label_plane_matrix:new i.bb(r),u_coord_matrix:new i.bb(r),u_is_text:new i.b5(r),u_elevation_from_sea:new i.b5(r),u_pitch_with_map:new i.b5(r),u_texsize:new i.b6(r),u_texsize_icon:new i.b6(r),u_texture:new i.b5(r),u_texture_icon:new i.b5(r),u_gamma_scale:new i.b4(r),u_device_pixel_ratio:new i.b4(r),u_tile_id:new i.b7(r),u_zoom_transition:new i.b4(r),u_inv_rot_matrix:new i.bb(r),u_merc_center:new i.b6(r),u_camera_forward:new i.b7(r),u_tile_matrix:new i.bb(r),u_up_vector:new i.b7(r),u_ecef_origin:new i.b7(r),u_is_halo:new i.b5(r),u_icon_transition:new i.b4(r),u_color_adj_mat:new i.bb(r),u_scale_factor:new i.b4(r),u_ground_shadow_factor:new i.b7(r),u_inv_matrix:new i.bb(r),u_normal_scale:new i.b4(r),u_lutTexture:new i.b5(r),u_spp_fill_np_color:new i.b8(r),u_spp_halo_np_color:new i.b8(r),u_spp_opacity:new i.b4(r),u_spp_halo_width:new i.b4(r),u_spp_halo_blur:new i.b4(r),u_spp_emissive_strength:new i.b4(r),u_spp_occlusion_opacity:new i.b4(r),u_spp_z_offset:new i.b4(r),u_spp_translate_rotation:new i.b6(r),u_spp_fill_color_zoom_factor:new i.b4(r),u_spp_halo_color_zoom_factor:new i.b4(r),u_spp_opacity_zoom_factor:new i.b4(r),u_spp_halo_width_zoom_factor:new i.b4(r),u_spp_halo_blur_zoom_factor:new i.b4(r),u_spp_emissive_strength_zoom_factor:new i.b4(r),u_spp_occlusion_opacity_zoom_factor:new i.b4(r),u_spp_z_offset_zoom_factor:new i.b4(r),u_spp_translate_zoom_factor:new i.b4(r),u_opacity_multiplier:new i.b4(r)}),background:r=>({u_matrix:new i.bb(r),u_emissive_strength:new i.b4(r),u_opacity:new i.b4(r),u_color:new i.b9(r)}),backgroundPattern:r=>({u_matrix:new i.bb(r),u_emissive_strength:new i.b4(r),u_opacity:new i.b4(r),u_image:new i.b5(r),u_pattern_tl:new i.b6(r),u_pattern_br:new i.b6(r),u_texsize:new i.b6(r),u_pattern_size:new i.b6(r),u_pixel_coord_upper:new i.b6(r),u_pixel_coord_lower:new i.b6(r),u_pattern_units_to_pixels:new i.b6(r)}),terrainRaster:r=>({u_matrix:new i.bb(r),u_image0:new i.b5(r),u_image1:new i.b5(r),u_skirt_height:new i.b4(r),u_ground_shadow_factor:new i.b7(r),u_emissive_texture_available:new i.b4(r)}),skybox:r=>({u_matrix:new i.bb(r),u_sun_direction:new i.b7(r),u_cubemap:new i.b5(r),u_opacity:new i.b4(r),u_temporal_offset:new i.b4(r)}),skyboxGradient:r=>({u_matrix:new i.bb(r),u_color_ramp:new i.b5(r),u_center_direction:new i.b7(r),u_radius:new i.b4(r),u_opacity:new i.b4(r),u_temporal_offset:new i.b4(r)}),skyboxCapture:r=>({u_matrix_3f:new i.ba(r),u_sun_direction:new i.b7(r),u_sun_intensity:new i.b4(r),u_color_tint_r:new i.b8(r),u_color_tint_m:new i.b8(r),u_luminance:new i.b4(r)}),globeRaster:r=>({u_proj_matrix:new i.bb(r),u_globe_matrix:new i.bb(r),u_normalize_matrix:new i.bb(r),u_merc_matrix:new i.bb(r),u_zoom_transition:new i.b4(r),u_merc_center:new i.b6(r),u_image0:new i.b5(r),u_image1:new i.b5(r),u_grid_matrix:new i.ba(r),u_skirt_height:new i.b4(r),u_far_z_cutoff:new i.b4(r),u_frustum_tl:new i.b7(r),u_frustum_tr:new i.b7(r),u_frustum_br:new i.b7(r),u_frustum_bl:new i.b7(r),u_globe_pos:new i.b7(r),u_globe_radius:new i.b4(r),u_viewport:new i.b6(r),u_emissive_texture_available:new i.b4(r)}),globeAtmosphere:r=>({u_frustum_tl:new i.b7(r),u_frustum_tr:new i.b7(r),u_frustum_br:new i.b7(r),u_frustum_bl:new i.b7(r),u_horizon:new i.b4(r),u_transition:new i.b4(r),u_fadeout_range:new i.b4(r),u_atmosphere_fog_color:new i.b8(r),u_high_color:new i.b8(r),u_space_color:new i.b8(r),u_temporal_offset:new i.b4(r),u_horizon_angle:new i.b4(r)}),groundShadow:r=>({u_matrix:new i.bb(r),u_ground_shadow_factor:new i.b7(r)}),stars:r=>({u_matrix:new i.bb(r),u_up:new i.b7(r),u_right:new i.b7(r),u_intensity_multiplier:new i.b4(r)}),occlusion:r=>({u_matrix:new i.bb(r),u_anchorPos:new i.b7(r),u_screenSizePx:new i.b6(r),u_occluderSizePx:new i.b6(r),u_color:new i.b8(r)})};class oS{constructor(i,r,n,a){this.id=oS.uniqueIdxCounter,oS.uniqueIdxCounter++,this.context=i;const o=i.gl;this.buffer=o.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||a||r.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(i){this.id=oS.uniqueIdxCounter,oS.uniqueIdxCounter++;let r=this.context.gl;this.context.unbindVAO(),this.bind(),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}oS.uniqueIdxCounter=0;let oA={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class oC{constructor(i,r,n,a,o,s){this.length=r.length,this.attributes=n,this.itemSize=r.bytesPerElement,this.dynamicDraw=a,this.instanceCount=s,this.context=i;const l=i.gl;this.buffer=l.createBuffer(),i.bindVertexBuffer.set(this.buffer),l.bufferData(l.ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?l.DYNAMIC_DRAW:l.STATIC_DRAW),this.dynamicDraw||o||r.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(i){let r=this.context.gl;this.bind(),r.bufferSubData(r.ARRAY_BUFFER,0,i.arrayBuffer)}
112enableAttributes(i,r){for(let n of this.attributes){let a=r.getAttributeLocation(i,n.name);-1!==a&&i.enableVertexAttribArray(a)}}setVertexAttribPointers(i,r,n){for(let a of this.attributes){let o=r.getAttributeLocation(i,a.name);if(-1!==o){let r=a.offset+this.itemSize*(n||0);"Float32"===a.type?i.vertexAttribPointer(o,a.components,i.FLOAT,!1,this.itemSize,r):i.vertexAttribIPointer(o,a.components,i[oA[a.type]],this.itemSize,r)}}}setVertexAttribDivisor(i,r,n){for(let a=0;a<this.attributes.length;a++){let o=r.getAttributeLocation(i,this.attributes[a].name);-1!==o&&this.instanceCount&&this.instanceCount>0&&i.vertexAttribDivisor(o,n)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class oI{constructor(i,r,n,a,o){this.context=i,this.width=r,this.height=n;const s=this.framebuffer=i.gl.createFramebuffer();a>0&&(this.colorAttachment0=new a5(i,s,0)),a>1&&(this.colorAttachment1=new a5(i,s,1)),o&&(this.depthAttachmentType=o,this.depthAttachment="renderbuffer"===o?new a4(i,s):new a9(i,s))}static createWithTexture(r,n,a,o,s){let l=r.gl;if(r.activeTexture.set(l.TEXTURE1),r.viewport.set([0,0,a,o]),n&&n.width===a&&n.height===o)return l.bindTexture(l.TEXTURE_2D,n.colorAttachment0.get()),r.bindFramebuffer.set(n.framebuffer),n;n&&n.destroy();let u=r.extRenderToTextureHalfFloat||r.extColorBufferFloat?r.gl.RGBA16F:r.gl.RGBA8,c=new i.a_(r,{width:a,height:o,data:null},u);c.bind(l.LINEAR,l.CLAMP_TO_EDGE);let d=r.createFramebuffer(a,o,1,null);if(d.format=u,d.colorAttachment0.set(c.texture),s){let i=r.createRenderbuffer(l.DEPTH24_STENCIL8,a,o);r.bindFramebuffer.set(d.framebuffer),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,i),d._stencilRbo=i}return d}createColorAttachment(i,r){0===r?this.colorAttachment0=new a5(i,this.framebuffer,0):1===r&&(this.colorAttachment1=new a5(i,this.framebuffer,1))}removeColorAttachment(i,r){let n,a=this.context.gl;0===r?(n=this.colorAttachment0.get(),this.colorAttachment0=void 0):1===r&&(n=this.colorAttachment1.get(),this.colorAttachment1=void 0),n&&a.deleteTexture(n)}destroy(){let i=this.context.gl;if(this.colorAttachment0){let r=this.colorAttachment0.get();r&&i.deleteTexture(r)}if(this.colorAttachment1){let r=this.colorAttachment1.get();r&&i.deleteTexture(r)}if(this.depthAttachment&&this.depthAttachmentType)if("renderbuffer"===this.depthAttachmentType){let r=this.depthAttachment.get();r&&i.deleteRenderbuffer(r)}else{let r=this.depthAttachment.get();r&&i.deleteTexture(r)}this._stencilRbo&&(i.deleteRenderbuffer(this._stencilRbo),this._stencilRbo=null),i.deleteFramebuffer(this.framebuffer)}}class ok{constructor(i,r){this.gl=i,this._pendingPrograms=new Set,this._compileStats={precompiled:0,onDemand:0,totalStallMs:0,maxStallMs:0,framesMissed:0,stalls:[]},this.clearColor=new aS(this),this.clearDepth=new aA(this),this.clearStencil=new aC(this),this.colorMask=new aI(this),this.depthMask=new ak(this),this.stencilMask=new aR(this),this.stencilFunc=new aM(this),this.stencilOp=new aL(this),this.stencilTest=new aP(this),this.depthRange=new aO(this),this.depthTest=new aD(this),this.depthFunc=new aF(this),this.blend=new aN(this),this.blendFunc=new aj(this),this.blendColor=new az(this),this.blendEquation=new aB(this),this.cullFace=new aU(this),this.cullFaceSide=new aV(this),this.frontFace=new aH(this),this.program=new aG(this),this.activeTexture=new aq(this),this.viewport=new a$(this),this.bindFramebuffer=new aW(this),this.bindRenderbuffer=new aY(this),this.bindTexture=new aZ(this),this.bindVertexBuffer=new aK(this),this.bindElementBuffer=new aX(this),this.bindVertexArrayOES=new aQ(this),this.pixelStoreUnpack=new aJ(this),this.pixelStoreUnpackPremultiplyAlpha=new a1(this),this.pixelStoreUnpackFlipY=new a0(this),this.options=r?Object.assign({},r):{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=i.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=i.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=i.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=i.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.forceManualRenderingForInstanceIDShaders=r&&!!r.forceManualRenderingForInstanceIDShaders||this.renderer&&this.renderer.includes("PowerVR"),this.disableSymbolUBO=r&&!!r.forceDisableSymbolUBO,this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=i.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=i.getExtension("EXT_color_buffer_half_float"),this.extColorBufferFloat=i.getExtension("EXT_color_buffer_float"),this.extTimerQuery=i.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),this.maxUniformBlockSize=Math.min(i.getParameter(i.MAX_UNIFORM_BLOCK_SIZE),32768),this.maxUniformBufferBindings=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS),this.extBlendFuncExtended=i.getExtension("WEBGL_blend_func_extended"),this.extParallelShaderCompile=i.getExtension("KHR_parallel_shader_compile")}
112sweepPendingPrograms(){if(0!==this._pendingPrograms.size)for(let i of this._pendingPrograms)i.maybeFinalize()}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(i,r,n){return new oS(this,i,r,n)}createVertexBuffer(i,r,n,a,o){return new oC(this,i,r,n,a,o)}createRenderbuffer(i,r,n){let a=this.gl,o=a.createRenderbuffer();return this.bindRenderbuffer.set(o),a.renderbufferStorage(a.RENDERBUFFER,i,r,n),this.bindRenderbuffer.set(null),o}createFramebuffer(i,r,n,a){return new oI(this,i,r,n,a)}clear({color:i,depth:r,stencil:n,colorMask:a}){let o=this.gl,s=0;i&&(s|=o.COLOR_BUFFER_BIT,this.clearColor.set(i.toNonPremultipliedRenderColor(null)),this.colorMask.set(a||[!0,!0,!0,!0])),void 0!==r&&(s|=o.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),void 0!==n&&(s|=o.STENCIL_BUFFER_BIT,this.clearStencil.set(n),this.stencilMask.set(255)),o.clear(s)}setCullFace(i){!1===i.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(i.mode),this.frontFace.set(i.frontFace))}setDepthMode(i){i.func!==this.gl.ALWAYS||i.mask?(this.depthTest.set(!0),this.depthFunc.set(i.func),this.depthMask.set(i.mask),this.depthRange.set(i.range)):this.depthTest.set(!1)}setStencilMode(i){i.test.func!==this.gl.ALWAYS||i.mask?(this.stencilTest.set(!0),this.stencilMask.set(i.mask),this.stencilOp.set([i.fail,i.depthFail,i.pass]),this.stencilFunc.set({func:i.test.func,ref:i.ref,mask:i.test.mask})):this.stencilTest.set(!1)}setColorMode(r){i.c2(r.blendFunction,ie.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(r.blendFunction),this.blendColor.set(r.blendColor),r.blendEquation?this.blendEquation.set(r.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(r.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}function oR(r,n,a,o,s,l,u){let c=r.context,h=c.gl,f=r.transform,p=[i.ek(f.center.lng),i.el(f.center.lat)],m=a.layout.get("symbol-placement"),g=a.layout.get("text-variable-anchor"),_="map"===a.layout.get("icon-rotation-alignment"),y="map"===a.layout.get("text-rotation-alignment"),v="point"!==m,x=[],b=0,w=0;for(let c=0;c<o.length;c++){let d=o[c],m=n.getTile(d),T=m.getBucket(a);if(!T)continue;let E=T.getProjection().createInversionMatrix(f,d.canonical),S=[],A=function(i,r,n){if(r.projection.name===n.projection.name)return i.projMatrix;let a=n.clone();return a.setProjection(r.projection),nG(a,r.getProjection(),i)}(d,T,f),C=!u&&_&&v,I=u&&y&&v,k=g&&T.hasTextData(),R=T.hasIconTextFit()&&k&&T.hasIconData(),M=C||I||u&&k||R,L="globe"===T.projection.name,P=L?i.dm(f.zoom):0;L&&(S.push("PROJECTION_GLOBE_VIEW"),M&&S.push("PROJECTED_POS_ON_VIEWPORT"));let O=r.getOrCreateProgram("collisionBox",{defines:S}),D=A;0===s[0]&&0===s[1]||(D=r.translatePosMatrix(A,m,s,l));let F=u?T.textCollisionBox:T.iconCollisionBox,N=T.collisionCircleArray;
112if(N.length>0){let r=i.bT(),n=D;i.eo(r,T.placementInvProjMatrix,f.glCoordMatrix),i.eo(r,r,T.placementViewportMatrix),x.push({circleArray:N,circleOffset:w,transform:n,invTransform:r,projection:T.getProjection()}),b+=N.length/4,w=b}if(!F)continue;r.terrain&&r.terrain.setupElevationDraw(m,O);let j=L?[d.canonical.x,d.canonical.y,1<<d.canonical.z]:[0,0,0];O.draw(r,h.LINES,tz.disabled,t7.disabled,r.colorModeForRenderPass(),tj.disabled,om(D,E,f,P,p,m,j,T.getProjection()),a.id,F.layoutVertexBuffer,F.indexBuffer,F.segments,null,f.zoom,null,[F.collisionVertexBuffer,F.collisionVertexBufferExt])}if(!u||!x.length)return;let T=r.getOrCreateProgram("collisionCircle"),E=new i.aN;E.resize(4*b),E._trim();let S=0;for(let i of x)for(let r=0;r<i.circleArray.length/4;r++){let n=4*r,a=i.circleArray[n+0],o=i.circleArray[n+1],s=i.circleArray[n+2],l=i.circleArray[n+3];E.emplace(S++,a,o,s,l,0),E.emplace(S++,a,o,s,l,1),E.emplace(S++,a,o,s,l,2),E.emplace(S++,a,o,s,l,3)}(!d||d.length<2*b)&&(d=function(r){let n=2*r,a=new i.aT;a.resize(n),a._trim();for(let i=0;i<n;i++){let r=6*i;a.uint16[r+0]=4*i+0,a.uint16[r+1]=4*i+1,a.uint16[r+2]=4*i+2,a.uint16[r+3]=4*i+2,a.uint16[r+4]=4*i+3,a.uint16[r+5]=4*i+0}return a}(b));let A=c.createIndexBuffer(d,!0),C=c.createVertexBuffer(E,i.bM.members,!0);for(let n of x){let o=og(n.transform,n.invTransform,f,n.projection);T.draw(r,h.TRIANGLES,tz.disabled,t7.disabled,r.colorModeForRenderPass(),tj.disabled,o,a.id,C,A,i.aJ.simpleSegment(0,2*n.circleOffset,n.circleArray.length,n.circleArray.length/2),null,f.zoom)}C.destroy(),A.destroy()}let oM=i.bT();function oL(r){let n=r._camera.getWorldToCamera(r.worldSize,1),a=i.er([],n,r.globeMatrix);i.dr(a,a);let o=[0,0,0],s=[0,1,0,0];return i.fM(s,s,a),o[0]=s[0],o[1]=s[1],o[2]=s[2],i.ex(o,o),o}function oP(r,n,a,o,s,l,u={}){let c=a.paint.get("icon-translate"),d=a.paint.get("text-translate"),h=a.paint.get("icon-translate-anchor"),f=a.paint.get("text-translate-anchor"),p=a.layout.get("icon-rotation-alignment"),m=a.layout.get("text-rotation-alignment"),g=a.layout.get("icon-pitch-alignment"),_=a.layout.get("text-pitch-alignment"),y=a.layout.get("icon-keep-upright"),v=a.layout.get("text-keep-upright"),x=a.paint.get("icon-color-saturation"),b=a.paint.get("icon-color-contrast"),w=a.paint.get("icon-color-brightness-min"),T=a.paint.get("icon-color-brightness-max"),E="sea"===a.layout.get("symbol-elevation-reference"),S="none"===a.layout.get("icon-image-use-theme"),A=r.context,C=A.gl,I=r.transform,k="map"===p,R="map"===m,M="map"===g,L="map"===_,P=void 0!==a.layout.get("symbol-sort-key").constantOr(1),O=!1,D=r.depthModeForSublayer(0,tz.ReadOnly),F=new tz(r.context.gl.LEQUAL,tz.ReadOnly,r.depthRangeFor3D),N=[i.ek(I.center.lng),i.el(I.center.lat)],j=a.layout.get("text-variable-anchor"),z="globe"===I.projection.name,B=[],U=[0,-1,0];for(let s of o){let o=n.getTile(s),l=o.getBucket(a);if(!l||"mercator"===l.projection.name&&z||l.fullyClipped)continue;let p="globe"===l.projection.name,m=p?i.dm(I.zoom):0,g=nq(s,l.getProjection(),I),_=I.calculatePixelsToTileUnitsMatrix(o),V=j&&l.hasTextData(),H=l.hasIconTextFit()&&V&&l.hasIconData(),G=l.getProjection().createInversionMatrix(I,s.canonical),q=(1<<o.tileID.canonical.z)*i.r/r.transform.worldSize,$=i=>{let n=[0,0,0];if(i){let i=r.style.directionalLight,a=r.style.ambientLight;i&&a&&(n=iv(r.style,i,a))}return n},W=i=>{if(r.context.disableSymbolUBO)return;i.push("USE_PAINT_PROPERTIES_UBO");let n=Math.floor(Math.floor(r.context.maxUniformBlockSize/4)/4);i.push(`MAX_UBO_SIZE_VEC4 ${n}u`)},Y=i=>{I.depthOcclusionForSymbolsAndCircles&&(a.hasOcclusionOpacityProperties||r.terrain)&&(i.push("DEPTH_D24"),i.push("DEPTH_OCCLUSION"))},Z=n=>{a.lut&&!S&&(a.lut.texture||(a.lut.texture=new i.a$(r.context,a.lut.image,[a.lut.image.height,a.lut.image.height,a.lut.image.height],A.gl.RGBA8)),A.activeTexture.set(A.gl.TEXTURE0+10),a.lut.texture&&a.lut.texture.bind(A.gl.LINEAR,A.gl.CLAMP_TO_EDGE),n.push("APPLY_LUT_ON_GPU"))},K=()=>{let n=k&&"point"!==a.layout.get("symbol-placement"),u=[];Y(u),Z(u);let d=n||H,f="road"===l.elevationType,v=r.shadowRenderer,S=f&&M&&!!v&&v.enabled,R=$(S),L=f&&M&&!r.terrain?F:D,P=
112a.paint.get("icon-image-cross-fade");r.terrainRenderModeElevated()&&M&&u.push("PITCH_WITH_MAP_TERRAIN"),p&&(u.push("PROJECTION_GLOBE_VIEW"),d&&u.push("PROJECTED_POS_ON_VIEWPORT")),P>0&&l.hasAnySecondaryIcon&&u.push("ICON_TRANSITION"),!l.icon.zOffsetVertexBuffer||f&&r.terrain||u.push("Z_OFFSET"),0===x&&0===b&&0===w&&1===T||u.push("COLOR_ADJUSTMENT"),l.sdfIcons&&u.push("RENDER_SDF"),S&&u.push("RENDER_SHADOWS","NORMAL_OFFSET"),f&&M&&!r.terrain&&l.icon.orientationVertexBuffer&&u.push("ELEVATED_ROADS"),W(u);let O=A.disableSymbolUBO?l.icon.programConfigurations.get(a.id):null,j=r.getOrCreateProgram("symbol",{config:O,defines:u}),B=o.imageAtlasTexture?o.imageAtlasTexture.size:[0,0],V=l.iconSizeData,K=i.ci(V,I.zoom),X=M||!I.isOrthographic,Q=tW(g,o.tileID.canonical,M,k,I,l.getProjection(),_),J=tZ(g,o.tileID.canonical,M,k,I,l.getProjection(),_),ee=l.icon.uboBinder&&l.icon.uboBinder.hasPerFeatureTranslate()?[0,0]:c,et=r.translatePosMatrix(J,o,ee,h,!0),ei=r.translatePosMatrix(g,o,ee,h),er=d?oM:Q,en=k&&!M&&!n,ea=U;(z||I.mercatorFromTransition)&&!k&&(ea=oL(I));let eo=p?ea:U,es=a.getColorAdjustmentMatrix(x,b,w,T),el=ob(V.kind,K,en,M,r,ei,er,et,E,!1,B,[0,0],0,s,m,N,G,eo,l.getProjection(),R,q,es,P,null),eu=o.imageAtlasTexture?o.imageAtlasTexture:null,ec=1!==a.layout.get("icon-size").constantOr(0)||l.iconsNeedLinear,ed=l.sdfIcons||r.options.rotating||r.options.zooming||ec||X?C.LINEAR:C.NEAREST,eh=l.sdfIcons&&0!==a.paint.get("icon-halo-width").constantOr(1),ef=r.terrain&&M&&n?i.dr(i.bT(),Q):oM;if(n&&l.icon){let n=i.s.getAtTileOffsetFunc(s,I.center.lat,I.worldSize,l.getProjection()),u=tY(g,o.tileID.canonical,M,k,I,l.getProjection(),_),c=a.layout.get("icon-size-scale-range"),d=i.bG(r.scaleFactor,c[0],c[1]);tQ(l,g,r,!1,u,J,M,y,n,s,d)}return{program:j,buffers:l.icon,uniformValues:el,atlasTexture:eu,atlasTextureIcon:null,atlasInterpolation:ed,atlasInterpolationIcon:null,isSDF:l.sdfIcons,hasHalo:eh,depthMode:L,tile:o,renderWithShadows:S,labelPlaneMatrixInv:ef}},X=()=>{let n=R&&"point"!==a.layout.get("symbol-placement"),u=[],c=n||j||H,h="road"===l.elevationType,y=r.shadowRenderer,x=h&&L&&!!y&&y.enabled,b=$(x),w=h&&L&&!r.terrain?F:D;r.terrainRenderModeElevated()&&L&&u.push("PITCH_WITH_MAP_TERRAIN"),p&&(u.push("PROJECTION_GLOBE_VIEW"),c&&u.push("PROJECTED_POS_ON_VIEWPORT")),!l.text.zOffsetVertexBuffer||h&&r.terrain||u.push("Z_OFFSET"),l.iconsInText&&u.push("RENDER_TEXT_AND_SYMBOL"),u.push("RENDER_SDF"),x&&u.push("RENDER_SHADOWS","NORMAL_OFFSET"),h&&L&&!r.terrain&&l.text.orientationVertexBuffer&&u.push("ELEVATED_ROADS"),Y(u),W(u);let T=A.disableSymbolUBO?l.text.programConfigurations.get(a.id):null,S=r.getOrCreateProgram("symbol",{config:T,defines:u}),k,M=[0,0],P=null,O=l.textSizeData;l.iconsInText&&(M=o.imageAtlasTexture?o.imageAtlasTexture.size:[0,0],P=o.imageAtlasTexture?o.imageAtlasTexture:null,k=L||!I.isOrthographic||r.options.rotating||r.options.zooming||"composite"===O.kind||"camera"===O.kind?C.LINEAR:C.NEAREST);let B=o.glyphAtlasTexture?o.glyphAtlasTexture.size:[0,0],V=a.layout.get("text-size-scale-range"),Z=i.bG(r.scaleFactor,V[0],V[1]),K=i.ci(O,I.zoom,Z),X=tW(g,o.tileID.canonical,L,R,I,l.getProjection(),_),Q=tZ(g,o.tileID.canonical,L,R,I,l.getProjection(),_),J=l.text.uboBinder&&l.text.uboBinder.hasPerFeatureTranslate()?[0,0]:d,ee=r.translatePosMatrix(Q,o,J,f,!0),et=r.translatePosMatrix(g,o,J,f),ei=c?oM:X,er=R&&!L&&!n,en=U;(z||I.mercatorFromTransition)&&!R&&(en=oL(I));let ea=ob(O.kind,K,er,L,r,et,ei,ee,E,!0,B,M,0,s,m,N,G,p?en:U,l.getProjection(),b,q,null,null,Z),eo=o.glyphAtlasTexture?o.glyphAtlasTexture:null,es=C.LINEAR,el=0!==a.paint.get("text-halo-width").constantOr(1),eu=r.terrain&&L&&n?i.dr(i.bT(),X):oM;if(n&&l.text){let n=i.s.getAtTileOffsetFunc(s,I.center.lat,I.worldSize,l.getProjection()),a=tY(g,o.tileID.canonical,L,R,I,l.getProjection(),_);tQ(l,g,r,!0,a,Q,L,v,n,s,Z)}return{program:S,buffers:l.text,uniformValues:ea,atlasTexture:eo,atlasTextureIcon:P,atlasInterpolation:es,atlasInterpolationIcon:k,isSDF:!0,hasHalo:el,depthMode:w,tile:o,renderWithShadows:x,labelPlaneMatrixInv:eu}},Q=l.icon.segments.get().length,J=l.text.segments.get().length,ee=Q&&!u.onlyText?K():null,et=J&&!u.onlyIcons?X():null,ei=a.paint.get("icon-opacity").constantOr(1),er=a.paint.get("text-opacity").constantOr(1);if(P&&l.canOverlap){O=!0;let r=ei&&!u.onlyText?l.icon.segments.get():[],n=er&&!u.onlyIcons?l.text.segments.get():[];for(let n of r)B.push({segments:new i.aJ([n]),sortKey:n.sortKey,state:ee});for(let r of n)B.push({segments:new i.aJ([r]),sortKey:r.sortKey,state:et})}else u.onlyText||B.push({segments:ei?l.icon.segments:new i.aJ([]),sortKey:0,state:ee}),u.onlyIcons||B.push({segments:er?l.text.segments:new i.aJ([]),sortKey:0,state:et})}for(let i of(O&&B.sort((i,r)=>i.sortKey-r.sortKey),B)){let n=i.state;if(n)if(r.terrain?r.terrain.setupElevationDraw(n.tile,n.program,{useDepthForOcclusion:I.depthOcclusionForSymbolsAndCircles,labelPlaneMatr
112ixInv:n.labelPlaneMatrixInv}):r.setupDepthForOcclusion(I.depthOcclusionForSymbolsAndCircles,n.program),A.activeTexture.set(C.TEXTURE0),n.atlasTexture&&n.atlasTexture.bind(n.atlasInterpolation,C.CLAMP_TO_EDGE,!0),n.atlasTextureIcon&&(A.activeTexture.set(C.TEXTURE1),n.atlasTextureIcon&&n.atlasTextureIcon.bind(n.atlasInterpolationIcon,C.CLAMP_TO_EDGE,!0)),n.renderWithShadows&&r.shadowRenderer.setupShadows(n.tile.tileID.toUnwrapped(),n.program,"vector-tile"),r.uploadCommonLightUniforms(r.context,n.program),n.hasHalo){let o=n.uniformValues;o.u_is_halo=1,oO(n.buffers,i.segments,a,r,n.program,n.depthMode,s,l,o,2),o.u_is_halo=0}else{if(n.isSDF){let o=n.uniformValues;n.hasHalo&&(o.u_is_halo=1,oO(n.buffers,i.segments,a,r,n.program,n.depthMode,s,l,o,1)),o.u_is_halo=0}oO(n.buffers,i.segments,a,r,n.program,n.depthMode,s,l,n.uniformValues,1)}}}function oO(i,r,n,a,o,s,l,u,c,d){let h=a.context,f=h.gl,p=[i.dynamicLayoutVertexBuffer,i.opacityVertexBuffer,i.iconTransitioningVertexBuffer,i.globeExtVertexBuffer,i.zOffsetVertexBuffer,i.orientationVertexBuffer];i.featureIdBuffer&&p.push(i.featureIdBuffer);let m=i.uboBinder?null:i.programConfigurations.get(n.id);if(i.uboBinder){i.uboBinder.layer=n;let r=a.transform.zoom,o=a.style.getBrightness?a.style.getBrightness():null,s=i.uboBinder.getConstantUniformValues(r,o);c.u_spp_fill_np_color=s.fill_np_color,c.u_spp_halo_np_color=s.halo_np_color,c.u_spp_opacity=s.opacity,c.u_spp_halo_width=s.halo_width,c.u_spp_halo_blur=s.halo_blur,c.u_spp_emissive_strength=s.emissive_strength,c.u_spp_occlusion_opacity=s.occlusion_opacity,c.u_spp_z_offset=s.z_offset;let l=s.zoomFactors;c.u_spp_fill_color_zoom_factor=l[0],c.u_spp_halo_color_zoom_factor=l[1],c.u_spp_opacity_zoom_factor=l[2],c.u_spp_halo_width_zoom_factor=l[3],c.u_spp_halo_blur_zoom_factor=l[4],c.u_spp_emissive_strength_zoom_factor=l[5],c.u_spp_occlusion_opacity_zoom_factor=l[6],c.u_spp_z_offset_zoom_factor=l[7],c.u_spp_translate_zoom_factor=l[8];let u=n.paint.get(i.uboBinder.isText?"text-translate-anchor":"icon-translate-anchor"),d=i.uboBinder.hasPerFeatureTranslate()&&"map"===u?a.transform.angle:0;c.u_spp_translate_rotation=[Math.cos(d),Math.sin(d)]}let{batchIndices:g,batchSegments:_}=i.getBatchGrouping(r);for(let r of g){let g=_.get(r);i.uboBinder&&i.uboBinder.bind(h,o.program,r),o.draw(a,f.TRIANGLES,s,l,u,tj.disabled,c,n.id,i.layoutVertexBuffer,i.indexBuffer,g,n.paint,a.transform.zoom,m,p,d)}}function oD(r,n,a,o,s,l){let u,c=a.paint.get("line-width"),d=a.paint.get("line-emissive-strength").isConstant(),h=a.paint.get("line-emissive-strength").constantOr(0),f=a.paint.get("line-occlusion-opacity"),p=a.layout.get("line-elevation-reference"),m="meters"===a.layout.get("line-width-unit"),g=!(!r.terrain||!r.terrain.enabled),_=r.context,y=_.gl;if(a.hasElevatedBuckets&&"globe"===r.transform.projection.name)return;let v=a.layout.get("line-cross-slope"),x=s||r.colorModeForDrapableLayerRenderPass(d?h:null),b=r.terrain&&r.terrain.renderingToTexture||l,w=b?1:i.co.devicePixelRatio,T=a.paint.get("line-dasharray"),E=T.constantOr(1),S=a.layout.get("line-cap"),A=T.constantOr(null),C=S.constantOr(null),I=a.paint.get("line-pattern"),k=I.constantOr(1),R=a.paint.get("line-pattern-cross-fade"),M=I.constantOr(null),L=a.paint.get("line-opacity").constantOr(1),P=!k&&1!==L||r.depthOcclusion&&f>0&&f<1,O=a.paint.get("line-gradient"),D=k?"linePattern":"line",F=i.d$(a);if(b&&r.terrain&&r.terrain.clipOrMaskOverlapStencilType()&&(P=!1),0!==f&&r.depthOcclusion){let r=a.paint._values["line-opacity"];r&&r.value&&"constant"===r.value.kind?u=r.value:i.f_(`Occlusion opacity for layer ${a.id} is supported only when line-opacity isn't data-driven.`)}"constant"!==c.value.kind&&!1===c.value.isLineProgressConstant&&F.push("VARIABLE_LINE_WIDTH");let N=a.paint.get("line-emissive-strength");k||"constant"===N.value.kind||!1!==N.value.isLineProgressConstant||F.push("VARIABLE_LINE_EMISSIVE_STRENGTH"),r._debugParams.showElevationIdDebug&&F.push("DEBUG_ELEVATION_ID"),b&&("dual-source-blending"!==r.emissiveMode||d?"mrt-fallback"===r.emissiveMode&&F.push("USE_MRT1"):F.push("DUAL_SOURCE_BLENDING"));let j={},z=[],B=(o,s,l,c,d,h)=>{for(let p of o){let o,g=n.getTile(p);if(k&&!g.patternsLoaded())continue;let v=g.getBucket(a);if(!v||"none"!==v.elevationType&&!d||"none"===v.elevationType&&d)continue;r.prepareDrawTile();let T=[...s],S=r.shadowRenderer,I="road"===v.elevationType&&!!S&&S.enabled,F=[0,0,0];
112if(I){let i=r.style.directionalLight,n=r.style.ambientLight;i&&n&&(F=iv(r.style,i,n)),T.push("RENDER_SHADOWS","NORMAL_OFFSET")}let N=v.programConfigurations.get(a.id),B=!1;if(M&&g.imageAtlas){let r=i.aG.from(M),n=r.getPrimary().scaleSelf(w).toString(),a=g.imageAtlas.patternPositions.get(n),o=r.getSecondary(),s=o?g.imageAtlas.patternPositions.get(o.scaleSelf(w).toString()):null;B=!!a&&!!s,a&&N.setConstantPatternPositions(a,s)}R>0&&(B||N.getPatternTransitionVertexBuffer("line-pattern"))&&T.push("LINE_PATTERN_TRANSITION"),v.elevationGroundScaleVertexBuffer&&T.push("ELEVATION_GROUND_SCALE");let U=r.isTileAffectedByFog(p),V=r.getOrCreateProgram(D,{config:N,defines:T,overrideFog:U});if(!k&&A&&C&&g.lineAtlas){let i=g.lineAtlas.getDash(A,C);i&&N.setConstantPatternPositions(i)}I&&S.setupShadows(g.tileID.toUnwrapped(),V,"vector-tile");let[H,G]=a.paint.get("line-trim-offset");("round"===C||"square"===C)&&H!==G&&(0===H&&(H-=1),1===G&&(G+=1));let q=b?p.projMatrix:null,$=m?1/v.tileToMeter/i.eG(g,1,r.transform.zoom):1,W=m?1/v.tileToMeter/i.eG(g,1,Math.floor(r.transform.zoom)):1,Y=E?a.paint._values["line-floorwidth"]:null;if(Y&&"constant"===Y.value.kind){let i=v.zoom;i in j||(j[i]=Math.max(.01,a.widthExpression().evaluate({zoom:i}))),o=Y.value.value;let n=Math.floor(r.transform.zoom);Y.value.value=j[i]*Math.pow(2,n-g.tileID.overscaledZ)}let Z=k?i.e0(r,g,a,q,w,$,W,[H,G],F,R):i.e2(r,g,a,q,v.lineClipsArray.length,w,$,W,[H,G],F);if(O){let o=v.gradients[a.id],s=o.texture;if(a.gradientVersion!==o.version){let l=256;if(a.stepInterpolant){let a=n.getSource().maxzoom,o=p.canonical.z===a?Math.ceil(1<<r.transform.maxZoom-p.canonical.z):1;l=i.bG(i.ew(v.maxLineLength/i.r*1024*o),256,_.maxTextureSize)}let u="none"===a.paint.get("line-gradient-use-theme").constantOr("default");o.gradient=i.e$({expression:a.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:o.gradient||void 0,clips:v.lineClipsArray,lut:u?null:a.lut}),o.texture?o.texture.update(o.gradient):o.texture=new i.a_(_,o.gradient,y.RGBA8),o.version=a.gradientVersion,s=o.texture}_.activeTexture.set(y.TEXTURE1),s.bind(a.stepInterpolant?y.NEAREST:y.LINEAR,y.CLAMP_TO_EDGE)}E&&(_.activeTexture.set(y.TEXTURE0),g.lineAtlasTexture&&g.lineAtlasTexture.bind(y.LINEAR,y.REPEAT),N.updatePaintBuffers()),k&&(_.activeTexture.set(y.TEXTURE0),g.imageAtlasTexture&&g.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),N.updatePaintBuffers()),d&&r.terrain.setupElevationDraw(g,V),r.uploadCommonUniforms(_,V,p.toUnwrapped());let K=r5?r5(r,v,p,d,Z,N,V,l,x,z):null,X=(i,n,o)=>{n&&0!==n.get().length&&(null!=u&&(u.value=L*f),void 0!==o&&(Z.u_opacity_multiplier=o),V.draw(r,y.TRIANGLES,l,i,x,tj.disabled,Z,a.id,v.layoutVertexBuffer,v.indexBuffer,n,a.paint,r.transform.zoom,N,[v.layoutVertexBuffer2,v.patternVertexBuffer,v.zOffsetVertexBuffer,v.elevationIdColVertexBuffer,v.elevationGroundScaleVertexBuffer]),void 0!==o&&(Z.u_opacity_multiplier=1),null!=u&&(u.value=L))},Q=i=>{K&&K.active&&r4?r4(v,K,i,X):X(i,v.segments)};if(P&&!d){let i=r.stencilModeForClipping(p).ref;0===i&&b&&_.clear({stencil:0});let n={func:y.EQUAL,mask:255};Z.u_alpha_discard_threshold=.8,Q(new t7(n,i,255,y.KEEP,y.KEEP,y.INVERT)),Z.u_alpha_discard_threshold=0,Q(new t7(n,i,255,y.KEEP,y.KEEP,y.KEEP))}else Z.u_alpha_discard_threshold=P&&d&&h?.8:0,Q(d?c:r.stencilModeForClipping(p));K&&r9&&r9(r,v,p,K,d,c,X),void 0!==o&&(Y.value.value=o)}},U=r.depthModeForSublayer(0,tz.ReadOnly),V=new tz(r.depthOcclusion?y.GREATER:y.LEQUAL,tz.ReadOnly,r.depthRangeFor3D);if(a.hasNonElevatedBuckets){let n=!b&&r.terrain;0!==f&&n?i.f_(`Occlusion opacity for layer ${a.id} is supported on terrain only if the layer has line-z-offset enabled.`):n?i.f_(`Cannot render non-elevated lines in immediate mode when terrain is enabled. Layer: ${a.id}.`):B(o,F,U,t7.disabled,!1,!0)}if(a.hasElevatedBuckets){"hd-road-markup"===p?g||(U=V,F.push("ELEVATED_ROADS")):(F.push("ELEVATED"),U=V,void 0!==v&&F.push(v<1?"CROSS_SLOPE_HORIZONTAL":"CROSS_SLOPE_VERTICAL"),"sea"===p&&F.push("ELEVATION_REFERENCE_SEA"));let i=P?r.stencilModeFor3D():t7.disabled;r.forceTerrainMode=!0,B(o,F,U,i,!0,!0),P&&B(o,F,U,i,!0,!1),r.forceTerrainMode=!1}r3&&r3(r,a,z),P&&(r.resetStencilClippingMasks(),b&&_.clear({stencil:0})),0===f||r.depthOcclusion||b||r.layersWithOcclusionOpacity.push(r.currentLayer)}class oF{destroy(){this.fbo&&(this.fbo.destroy(),this.fbo=null),this.drapeFbo&&(this.drapeFbo.destroy(),this.drapeFbo=null)}}class oN{constructor(i){this.pbo=i.createBuffer(),this.sync=null,this.fboA=null,this.fboB=null,this.maxDensity=0}destroy(i){this.sync&&(i.deleteSync(this.sync),this.sync=null),i.deleteBuffer(this.pbo),this.fboA&&(this.fboA.destroy(),this.fboA=null),this.fboB&&(this.fboB.destroy(),this.fboB=null)}}let oj={additive:{clearColor:new i.i(0,0,0,0),colorMode:ie.additiveAlphaWeighted,compositeUniformValue:1},multiply:{clearColor:new i.i(1,1,1,1),colorMode:ie.multiply,compositeUniformValue:0}};function oz(i){return!(!i.extRenderToTextureHalfFloat&&!i.extColorBufferFloat)}
112function oB(i,r){return"additive"===i&&oz(r)?ie.additiveAlphaWeightedUnboundedAlpha:oj[i].colorMode}function oU(i,r,n){let a=i.context,o=a.gl,s=n.width,l=n.height,u=n.colorAttachment0.get();r.lineBlendDensityReadback||(r.lineBlendDensityReadback=new oN(o));let c=r.lineBlendDensityReadback,d=0,h=!0;for(;s>1||l>1;){let n=Math.max(1,Math.floor(s/2)),f=Math.max(1,Math.floor(l/2)),p=0===d?"fboA":"fboB";c[p]=oI.createWithTexture(a,c[p],n,f,!1);let m=c[p];a.bindFramebuffer.set(m.framebuffer),a.viewport.set([0,0,n,f]),a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,u),i.getOrCreateProgram("lineBlendReduce").draw(i,o.TRIANGLES,tz.disabled,t7.disabled,ie.unblended,tj.disabled,op(0,[1/s,1/l],h),r.id,i.viewportBuffer,i.quadTriangleIndexBuffer,i.viewportSegments,r.paint,i.transform.zoom),s=n,l=f,u=m.colorAttachment0.get(),d=1-d,h=!1}let f=oz(a);c.sync&&(o.deleteSync(c.sync),c.sync=null),o.bindBuffer(o.PIXEL_PACK_BUFFER,c.pbo),o.bufferData(o.PIXEL_PACK_BUFFER,f?16:4,o.STREAM_READ),o.readPixels(0,0,1,1,o.RGBA,f?o.FLOAT:o.UNSIGNED_BYTE,0),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),c.sync=o.fenceSync(o.SYNC_GPU_COMMANDS_COMPLETE,0),a.viewport.set([0,0,i.width,i.height])}function oV(i,r,n){if(!oz(i.context))return;let a=r.lineBlendDensityReadback;a&&a.sync?(function(i,r,n){if(i.sync&&r.getSyncParameter(i.sync,r.SYNC_STATUS)===r.SIGNALED){if(r.deleteSync(i.sync),i.sync=null,r.bindBuffer(r.PIXEL_PACK_BUFFER,i.pbo),oz(n)){let n=new Float32Array(4);r.getBufferSubData(r.PIXEL_PACK_BUFFER,0,n);let a=n[1];i.maxDensity=Math.max(2*(a>0?n[0]/a:0),1)}else i.maxDensity=1;r.bindBuffer(r.PIXEL_PACK_BUFFER,null)}}(a,i.context.gl,i.context),a.sync||(oU(i,r,n),i.style.map.triggerRepaint())):(oU(i,r,n),i.style.map.triggerRepaint())}function oH(i,r,n,a,o,s){let l=i.context,u=l.gl,c="additive"===n?1:r.paint.get("line-opacity").constantOr(1),d="additive"===n?function(i){let r=i.paint.get("line-blend-additive-clamp");if(r>0)return r;let n=i.lineBlendDensityReadback;return n&&0!==n.maxDensity?n.maxDensity:null}(r):1;if(null===d)return;l.bindFramebuffer.set(o),s&&l.viewport.set([0,0,s[0],s[1]]),l.activeTexture.set(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,a.colorAttachment0.get());let h=oB(n,i.context);i.getOrCreateProgram("lineBlendComposite").draw(i,u.TRIANGLES,tz.disabled,t7.disabled,h,tj.disabled,{u_image:0,u_opacity:c,u_blend_mode:oj[n].compositeUniformValue,u_max_density:d},r.id,i.viewportBuffer,i.quadTriangleIndexBuffer,i.viewportSegments,r.paint,i.transform.zoom)}function oG(r,n,a,o){let{painter:s,sourceCache:l,layer:u,coords:c,colorMode:d,elevationType:h,terrainEnabled:f,pass:p}=r,m=s.context.gl,g=u.paint.get("fill-pattern"),_=u.paint.get("fill-pattern-cross-fade"),y=g.constantOr(null),v=h;"road"!==h||n&&!f||(v="none");let x="road"===v,b=r.painter.shadowRenderer,w=x&&!!b&&b.enabled,T=new tz(s.context.gl.LEQUAL,tz.ReadOnly,s.depthRangeFor3D),E=[0,0,0];if(w){let i=s.style.directionalLight,r=s.style.ambientLight;i&&r&&(E=iv(s.style,i,r))}let S=g&&g.constantOr(1),A=s.terrain&&s.terrain.renderingToTexture,C=(r,p)=>{let g,v,C,I,k;p?(g=S&&!u.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",C=m.LINES):(g=S?"fillPattern":"fill",C=m.TRIANGLES);let R=[];for(let M of c){let c=l.getTile(M);if(S&&!c.patternsLoaded())continue;let L=c.getBucket(u);if(!L)continue;let P=n?L.hdExt&&L.hdExt.elevationBufferData:L.bufferData;if(!P||P.isEmpty())continue;s.prepareDrawTile();let O=P.programConfigurations.get(u.id),D=s.isTileAffectedByFog(M),F=[],N=[];x&&(F.push("ELEVATED_ROADS"),N.push(P.elevatedLayoutVertexBuffer)),w&&F.push("RENDER_SHADOWS","NORMAL_OFFSET"),A&&a&&F.push("USE_MRT1"),S&&(s.context.activeTexture.set(m.TEXTURE0),c.imageAtlasTexture&&c.imageAtlasTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE),O.updatePaintBuffers());let j=!1;if(y&&c.imageAtlas){let r=c.imageAtlas,n=i.aG.from(y),a=n.getPrimary().scaleSelf(i.co.devicePixelRatio).toString(),o=n.getSecondary(),s=r.patternPositions.get(a),l=o?r.patternPositions.get(o.scaleSelf(i.co.devicePixelRatio).toString()):null;j=!!s&&!!l,s&&O.setConstantPatternPositions(s,l)}_>0&&(j||O.getPatternTransitionVertexBuffer("fill-pattern"))&&F.push("FILL_PATTERN_TRANSITION");let z=s.getOrCreateProgram(g,{config:O,overrideFog:D,defines:F}),B=s.translatePosMatrix(M.projMatrix,c,u.paint.get("fill-translate"),u.paint.get("fill-translate-anchor"));w&&b.setupShadows(c.tileID.toUnwrapped(),z,"vector-tile");let U=u.paint.get("fill-emissive-strength");if(p){I=P.lineIndexBuffer,k=P.lineSegments;let i=s.terrain&&s.terrain.renderingToTexture?s.terrain.drapeBufferSize:[m.drawingBufferWidth,m.drawingBufferHeight];v="fillOutlinePattern"===g&&S?of(B,U,s,c,i,E,_):oh(B,U,i,E)}else I=P.indexBuffer,k=P.triangleSegments,v=S?od(B,U,s,c,E,_):oc(B,U,E);s.uploadCommonUniforms(s.context,z,M.toUnwrapped());let V=r;if(("road"!==h||f)&&"offset"!==h||(V=T),!k||k.get&&0===k.get().length)continue;let H=o||s.stencilModeForClipping(M),G="fallthrough";!p&&r0&&(G=r0({painter:s,layer:u,bucket:L,coord:M,elevatedGeometry:n,program:z,programConfiguration:O,uniformValues:v,drawMode:C,depthMode:V,stencilMode:H,colorMode:d,bufferData:P,indexBuffer:I,segments:k,dynamicBuffers:N,polygonCoverageTiles:R})),"fallthrough"===G&&z.draw(s,C,V,H,d,tj.disabled,v,u.id,P.layoutVertexBuffer,I,k,u.paint,s.transform.zoom,O,N)}!p&&r2&&r2(s,u,R,C,d)};s.renderPass===p&&C(s.depthModeForSublayer(1,"opaque"===s.renderPass?tz.ReadWrite:tz.ReadOnly),!1),"none"===v&&"translucent"===s.renderPass&&u.paint.get("fill-antialias")&&C(s.depthModeForSublayer(2*!!u.getPaintProperty("fill-outline-color"),tz.ReadOnly),!0)}function oq(r){return[r[0]*i.C,r[1]*i.C,r[2]*i.C,0]}function o$(r,n,a,o,s,l,u,c,d){let h,f,p,m,g,_,y,v,x=o.getSource(),b=a.globeSharedBuffers;if(!b||(n&&(h=o.getTile(n)),x instanceof i.a3?(f=x.texture,p=i.dj(0,0,a.transform)):h&&n&&(f=h.texture,p=i.dj(n.canonical.z,n.canonical.x,a.transform)),!f||!p))return;r||(p=i.fc(i.bT(),p,[1,-1,1]));let w=a.context,T=w.gl,E="nearest"===s.paint.get("raster-resampling")?T.NEAREST:T.LINEAR,S=a.colorModeForDrapableLayerRenderPass(l),A=u.defines;A.push("GLOBE_POLES");let C=new tz(T.LEQUAL,tz.ReadWrite,a.depthRangeFor3D),I=a.transform.expandedFarZProjMatrix,k=Float32Array.from(i.dh(i.dk(new i.f(0,0,0))));a.terrain&&a.terrain.prepareDrawTile(),w.activeTexture.set(T.TEXTURE0),f.bind(E,T.CLAMP_TO_EDGE),w.activeTexture.set(T.TEXTURE1),f.bind(E,T.CLAMP_TO_EDGE),"useMipmap"in f&&w.extTextureFilterAnisotropic&&a.transform.pitch>20&&T.texParameterf(T.TEXTURE_2D,w.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,w.extTextureFilterAnisotropicMax);let[R,M,L,P]=n?b.getPoleBuffers(n.canonical.z,!1):b.getPoleBuffers(0,!0),O=s.paint.get("raster-elevation");r?(m=R,a.renderDefaultNorthPole=0!==O):(m=M,a.renderDefaultSouthPole=0!==O);let D=oq(u.mix),F=(g=p,_=i.dm(a.transform.zoom),y=u.offset,v=u.range,ov(a,I,k,g,new Float32Array(16),new Float32Array(9),[0,0],_,[0,0],[0,0,0,0],1,{opacity:1,mix:0},s,[0,0],O,2,D,y,v,1,0,l)),N=a.getOrCreateProgram("raster",{defines:A});a.uploadCommonUniforms(w,N,null),N.draw(a,T.TRIANGLES,C,d,S,c,F,s.id,m,L,P)}let oW=i.dq(new Float32Array(16)),oY=new i.i(1,0,0,1),oZ=new i.i(0,1,0,1),oK=new i.i(0,0,1,1),oX=new i.i(1,0,1,1),oQ=new i.i(0,1,1,1);function oJ(i,r,n,a){o0(i,0,r+n/2,i.transform.width,n,a)}function o1(i,r,n,a){o0(i,r-n/2,0,n,i.transform.height,a)}function o0(r,n,a,o,s,l){let u=r.context,c=u.gl;c.enable(c.SCISSOR_TEST),c.scissor(n*i.co.devicePixelRatio,a*i.co.devicePixelRatio,o*i.co.devicePixelRatio,s*i.co.devicePixelRatio),u.clear({color:l}),c.disable(c.SCISSOR_TEST)}let{members:o2}=i.b_([{name:"a_pos_3f",components:3,type:"Float32"}]);function o5(i,r,n,a){i.emplaceBack(r,n,a)}class o4{constructor(r){this.vertexArray=new i.aS,this.indices=new i.aT,o5(this.vertexArray,-1,-1,1),o5(this.vertexArray,1,-1,1),o5(this.vertexArray,-1,1,1),o
1125(this.vertexArray,1,1,1),o5(this.vertexArray,-1,-1,-1),o5(this.vertexArray,1,-1,-1),o5(this.vertexArray,-1,1,-1),o5(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=r.createVertexBuffer(this.vertexArray,o2),this.indexBuffer=r.createIndexBuffer(this.indices),this.segment=i.aJ.simpleSegment(0,0,36,12)}}function o9(r,n,a,o,s,l){let u,c,d,h=r.context.gl,f=n.paint.get("sky-atmosphere-color"),p=n.paint.get("sky-atmosphere-halo-color"),m=n.paint.get("sky-atmosphere-sun-intensity"),g=(u=i.cs(i.bV(),o),c=f.toPremultipliedRenderColor(null),d=p.toPremultipliedRenderColor(null),{u_matrix_3f:u,u_sun_direction:s,u_sun_intensity:m,u_color_tint_r:[c.r,c.g,c.b,c.a],u_color_tint_m:[d.r,d.g,d.b,d.a],u_luminance:5e-5});h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_CUBE_MAP_POSITIVE_X+l,n.skyboxTexture,0),a.draw(r,h.TRIANGLES,tz.disabled,t7.disabled,ie.unblended,tj.frontCW,g,"skyboxCapture",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}let o3=i.b_([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class o8{constructor(r){const n=new i.aU;n.emplaceBack(-1,1,1,0,0),n.emplaceBack(1,1,1,1,0),n.emplaceBack(1,-1,1,1,1),n.emplaceBack(-1,-1,1,0,1);const a=new i.aT;a.emplaceBack(0,1,2),a.emplaceBack(2,3,0),this.vertexBuffer=r.createVertexBuffer(n,o3.members),this.indexBuffer=r.createIndexBuffer(a),this.segments=i.aJ.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}let o6=i.b_([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_opacity",components:1}]);class o7{constructor(){this.colorModeAlphaBlendedWriteRGB=new ie([1,771,1,771],i.i.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new ie([1,0,1,0],i.i.transparent,[!1,!1,!1,!0]),this.params={starsCount:16e3,sizeMultiplier:.15,sizeRange:100,intensityRange:200},this.updateNeeded=!0,this._painter=null,this._devtoolsFolder=null}update(r){this._painter=r;let n=r.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new o8(n);let r=this.params,a=r.sizeRange,o=r.intensityRange,s=function(r){let n=i.eq(30),a=[];for(let o=0;o<r;++o){let r=2*Math.PI*n(),o=Math.acos(1-2*n())-.5*Math.PI;a.push(i.cx(Math.cos(o)*Math.cos(r),Math.cos(o)*Math.sin(r),Math.sin(o)))}return a}(r.starsCount),l=i.eq(300),u=new i.aV,c=new i.aT,d=0;for(let r=0;r<s.length;++r){let n=i.fa([],s[r],200),h=Math.max(0,1+.01*a*(l()-.5)),f=Math.max(0,1+.01*o*(l()-.5));u.emplaceBack(n[0],n[1],n[2],-1,-1,h,f),u.emplaceBack(n[0],n[1],n[2],1,-1,h,f),u.emplaceBack(n[0],n[1],n[2],1,1,h,f),u.emplaceBack(n[0],n[1],n[2],-1,1,h,f),c.emplaceBack(d+0,d+1,d+2),c.emplaceBack(d+0,d+2,d+3),d+=4}this.starsVx=n.createVertexBuffer(u,o6.members),this.starsIdx=n.createIndexBuffer(c),this.starsSegments=i.aJ.simpleSegment(0,0,u.length,c.length)}}destroy(){this.atmosphereBuffer&&this.atmosphereBuffer.destroy(),this.starsVx&&this.starsVx.destroy(),this.starsIdx&&this.starsIdx.destroy(),this._painter=null}drawAtmosphereGlow(r,n){let a=r.context,o=a.gl,s=r.transform,l=new tz(o.LEQUAL,tz.ReadOnly,[0,1]),u=i.dm(s.zoom),c=r.style.getLut(n.scope),d="none"===n.properties.get("color-use-theme"),h=n.properties.get("color").toNonPremultipliedRenderColor(d?null:c),f="none"===n.properties.get("high-color-use-theme"),p=n.properties.get("high-color").toNonPremultipliedRenderColor(f?null:c),m="none"===n.properties.get("space-color-use-theme"),g=n.properties.get("space-color").toNonPremultipliedRenderColor(m?null:c),_=i.ec(n.properties.get("horizon-blend"),0,1,5e-4,.25),y=i.dn(r,a,s)&&5e-4===_?s.worldSize/(2*Math.PI*1.025)-1:s.globeRadius,v=r.frameCounter/1e3%1,x=i.dW(s.globeCenterInViewSpace),b=Math.acos(Math.sqrt(Math.pow(x,2)-Math.pow(y,2))/x),w=i=>{let n,c,d,f,m,y="globe"===s.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];i&&y.push("ALPHA_PASS");let x=r.getOrCreateProgram("globeAtmosphere",{defines:y}),w=(n=s.frustumCorners.TL,c=s.frustumCorners.TR,d=s.frustumCorners.BR,f=s.frustumCorners.BL,m=s.frustumCorners.horizon,{u_frustum_tl:n,u_frustum_tr:c,u_frustum_br:d,u_frustum_bl:f,u_horizon:m,u_transition:u,u_fadeout_range:_,u_atmosphere_fog_color:h.toArray01(),u_high_color:p.toArray01(),u_space_color:g.toArray01(),u_temporal_offset:v,u_horizon_angle:b});r.uploadCommonUniforms(a,x);let T=this.atmosphereBuffer;T&&x.draw(r,o.TRIANGLES,l,t7.disabled,i?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,tj.backCW,w,i?"atmosphere_glow_alpha":"atmosphere_glow",T.vertexBuffer,T.indexBuffer,T.segments)};w(!1),w(!0)}drawStars(r,n){let a=i.bG(n.properties.get("star-intensity"),0,1);if(0===a)return;let o=r.context,s=o.gl,l=r.transform,u=r.getOrCreateProgram("stars"),c=i.dp([]);i.f2(c,c,-l._pitch),i.f5(c,c,-l.angle),i.f2(c,c,i.c4(l._center.lat)),i.f4(c,c,-i.c4(l._center.lng));let d=i.ct(new Float32Array(16),c),h=i.er([],l.starsProjMatrix,d),f=i.cs([],d),p=i.dt([],f),m=this.params.sizeMultiplier,g=[0,1,0];i.fK(g,g,p),i.fa(g,g,m);let _=[1,0,0];i.fK(_,_,p),i.fa(_,_,m);let y={u_matrix:Float32Array.from(h),u_up:g,u_right:_,u_intensity_multiplier:a};r.uploadCommonUniforms(o,u),this.starsVx&&this.starsIdx&&u.draw(r,s.TRIANGLES,tz.disabled,t7.disabled,this.colorModeAlphaBlendedWriteRGB,tj.disabled,y,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}class se{constructor(){this.visibleTiles=[]}updateBorders(r,n){let a=[],o=[];for(let i of r._getRenderableCoordinates(!1,!0)){let s=r.getTile(i);if(!s.hasData())continue;let l=s.getBucket(n);l&&(l.isEmpty()||(a.push(i.key),o.push({bucket:l,tileID:i.canonical})))}let s=a.length!==this.visibleTiles.length;if(!s){a.sort();for(let i=0;i<a.length;
112i++)if(a[i]!==this.visibleTiles[i]){s=!0;break}}if(!s)return;let l=new Set;for(let r of(this.visibleTiles=a,o.sort((i,r)=>i.tileID.z-r.tileID.z||i.tileID.x-r.tileID.x||i.tileID.y-r.tileID.y),o)){let n=[],a=[],o=r.bucket;for(let i of o.featuresOnBorder)l.has(i.featureId)?a.push(i.footprintIndex):(l.add(i.featureId),n.push(i.footprintIndex));o.updateFootprintHiddenFlags(n,i.B,!1),o.updateFootprintHiddenFlags(a,i.B,!0)}}}class st{}class si{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(r,n,a){{let i=this._storage.get(n.id);if(i)return i.lastUsedFrameIdx=r,i.buf}let o=a.gl,s=o.getBufferParameter(o.ELEMENT_ARRAY_BUFFER,o.BUFFER_SIZE),l=new ArrayBuffer(s),u=new Int16Array(l);o.getBufferSubData(o.ELEMENT_ARRAY_BUFFER,0,new Int16Array(l));let c=new i.aR;for(let i=0;i<s/2;i+=3){let r=u[i],n=u[i+1],a=u[i+2];c.emplaceBack(r,n),c.emplaceBack(n,a),c.emplaceBack(a,r)}let d=a.bindVertexArrayOES.current,h=new st;return h.buf=new oS(a,c),h.lastUsedFrameIdx=r,this._storage.set(n.id,h),a.bindVertexArrayOES.set(d),h.buf}update(i){for(let[r,n]of this._storage)i-n.lastUsedFrameIdx>30&&(n.buf.destroy(),this._storage.delete(r))}destroy(){for(let[i,r]of this._storage)r.buf.destroy(),this._storage.delete(i)}}class sr{constructor(){this.occluderSize=30,this.depthOffset=-1e-4}}let sn={symbol:function(r,n,a,o,s){if("translucent"!==r.renderPass)return;let l=t7.disabled,u=r.colorModeForRenderPass(),c=a.layout.get("text-variable-anchor"),d=a.layout.get("text-size-scale-range"),h=i.bG(r.scaleFactor,d[0],d[1]);c&&function(r,n,a,o,s,l,u,c){let d=n.transform,h="map"===s,f="map"===l;for(let n of r){let r=o.getTile(n),s=r.getBucket(a);if(!s||!s.text||!s.text.segments.get().length)continue;let l=i.ci(s.textSizeData,d.zoom,c),p=nq(n,s.getProjection(),d),m=d.calculatePixelsToTileUnitsMatrix(r),g=tW(p,r.tileID.canonical,f,h,d,s.getProjection(),m),_=s.hasIconTextFit()&&s.hasIconData();l&&function(r,n,a,o,s,l,u,c,d,h){let f=r.text.placedSymbolArray,p=r.text.dynamicLayoutVertexArray,m=r.icon.dynamicLayoutVertexArray,g={},_=r.getProjection(),y=nq(u,_,s),v=s.elevation,x=_.upVectorScale(u.canonical,s.center.lat,s.worldSize).metersToTile;p.clear();for(let m=0;m<f.length;m++){let b=f.get(m),{tileAnchorX:w,tileAnchorY:T,numGlyphs:E}=b,S=b.hidden||!b.crossTileID||r.allowVerticalPlacement&&!b.placedOrientation?null:o[b.crossTileID];if(S){let o=0,f=0,A=0,C="road"===r.elevationType;if(v||C){let n=C&&r.hdExt?r.hdExt.getElevationFeatureForPlacedSymbol(r,r.text,m):null,a=i.s.getAtTileOffset(u,new i.au(w,T),v,n),[s,l,c]=_.upVector(u.canonical,w,T);o=a*s*x,f=a*l*x,A=a*c*x}let[I,k,R,M]=tK(b.projectedAnchorX+o,b.projectedAnchorY+f,b.projectedAnchorZ+A,a?y:l),L=tX(s.getCameraToCenterDistance(_),M),P=i.ch(r.textSizeData,d,b)*L/i.ao;a&&(P*=r.tilePixelRatio/c);let O=function({width:r,height:n,anchor:a,textOffset:o,textScale:s},l){let{horizontalAlign:u,verticalAlign:c}=i.cE(a),d=i.cj(a,o);return new i.au((-(u-.5)*r/s+d[0])*l,(-(c-.5)*n/s+d[1])*l)}(S,P);a?({x:I,y:k,z:R}=_.projectTilePoint(w+O.x,T+O.y,u.canonical),[I,k,R]=tK(I+o,k+f,R+A,l)):(n&&O._rotate(-s.angle),I+=O.x,k+=O.y,R=0);let D=r.allowVerticalPlacement&&b.placedOrientation===i.bg.vertical?Math.PI/2:0;for(let r=0;r<E;r++)i.bl(p,I,k,R,D);h&&b.associatedIconIndex>=0&&(g[b.associatedIconIndex]={x:I,y:k,z:R,angle:D})}else t9(E,p)}if(h){m.clear();let n=r.icon.placedSymbolArray;for(let r=0;r<n.length;r++){let a=n.get(r),{numGlyphs:o}=a,s=g[r];if(a.hidden||!s)t9(o,m);else{let{x:r,y:n,z:a,angle:l}=s;for(let s=0;s<o;s++)i.bl(m,r,n,a,l)}}r.icon.dynamicLayoutVertexBuffer.updateData(m)}r.text.dynamicLayoutVertexBuffer.updateData(p)}(s,h,f,u,d,g,n,Math.pow(2,d.zoom-r.tileID.overscaledZ),l,_)}}(o,r,a,n,a.layout.get("text-rotation-alignment"),a.layout.get("text-pitch-alignment"),s,h);let f=0!==a.paint.get("icon-opacity").constantOr(1),p=0!==a.paint.get("text-opacity").constantOr(1);void 0!==a.layout.get("symbol-sort-key").constantOr(1)&&(f||p)?oP(r,n,a,o,l,u):(f&&oP(r,n,a,o,l,u,{onlyIcons:!0}),p&&oP(r,n,a,o,l,u,{onlyText:!0})),n.map.showCollisionBoxes&&(oR(r,n,a,o,a.paint.get("text-translate"),a.paint.get("text-translate-anchor"),!0),oR(r,n,a,o,a.paint.get("icon-translate"),a.paint.get("icon-translate-anchor"),!1))},circle:function(r,n,a,o){if("translucent"!==r.renderPass)return;let s=a.paint.get("circle-opacity"),l=a.paint.get("circle-stroke-width"),u=a.paint.get("circle-stroke-opacity"),c=void 0!==a.layout.get("
112circle-sort-key").constantOr(1),d=a.paint.get("circle-emissive-strength");if(0===s.constantOr(1)&&(0===l.constantOr(1)||0===u.constantOr(1)))return;let h=r.context,f=h.gl,p=r.transform,m=!(!r.terrain||!r.terrain.enabled),g=a.layout.get("circle-elevation-reference"),_=r.depthModeForSublayer(0,tz.ReadOnly),y=new tz(r.context.gl.LEQUAL,tz.ReadOnly,r.depthRangeFor3D),v="none"===g||m?_:y,x=t7.disabled,b=r.colorModeForDrapableLayerRenderPass(d),w="globe"===p.projection.name,T=[i.ek(p.center.lng),i.el(p.center.lat)],E=[];for(let s=0;s<o.length;s++){let l=o[s],u=n.getTile(l),d=u.getBucket(a);if(!d||d.projection.name!==p.projection.name)continue;let h=d.programConfigurations.get(a.id),f=d.layoutVertexBuffer,m=d.globeExtVertexBuffer,g=d.indexBuffer,_=i.bC(a),y=[m],v=r.isTileAffectedByFog(l);w&&_.push("PROJECTION_GLOBE_VIEW"),_.push("DEPTH_D24"),r.terrain&&p.depthOcclusionForSymbolsAndCircles&&_.push("DEPTH_OCCLUSION"),d.hdExt&&d.hdExt.hasElevation&&!r.terrain&&(_.push("ELEVATED_ROADS"),y.push(d.hdExt.elevatedLayoutVertexBuffer));let x=r.getOrCreateProgram("circle",{config:h,defines:_,overrideFog:v}),b=p.projection.createInversionMatrix(p,l.canonical),S={programConfiguration:h,program:x,layoutVertexBuffer:f,dynamicBuffers:y,indexBuffer:g,uniformValues:i.bD(r,l,u,b,T,a),tile:u};if(c)for(let r of d.segments.get())E.push({segments:new i.aJ([r]),sortKey:r.sortKey,state:S});else E.push({segments:d.segments,sortKey:0,state:S})}c&&E.sort((i,r)=>i.sortKey-r.sortKey);let S={useDepthForOcclusion:p.depthOcclusionForSymbolsAndCircles};for(let i of E){let{programConfiguration:n,program:o,layoutVertexBuffer:s,dynamicBuffers:l,indexBuffer:u,uniformValues:c,tile:d}=i.state,m=i.segments;r.terrain&&r.terrain.setupElevationDraw(d,o,S),r.uploadCommonUniforms(h,o,d.tileID.toUnwrapped()),o.draw(r,f.TRIANGLES,v,x,b,tj.disabled,c,a.id,s,u,m,a.paint,p.zoom,n,l)}},heatmap:function(r,n,a,o){if(0!==a.paint.get("heatmap-opacity"))if("offscreen"===r.renderPass){let s=r.context,l=s.gl,u=t7.disabled,c=new ie([l.ONE,l.ONE,l.ONE,l.ONE],i.i.transparent,[!0,!0,!0,!0]),d="globe"===r.transform.projection.name?.5:.25;a.heatmapFbo=oI.createWithTexture(s,a.heatmapFbo,r.width*d,r.height*d),s.clear({color:i.i.transparent});let h=r.transform,f="globe"===h.projection.name,p=f?["PROJECTION_GLOBE_VIEW"]:[],m=f?tj.frontCCW:tj.disabled,g=[i.ek(h.center.lng),i.el(h.center.lat)];for(let i=0;i<o.length;i++){let d=o[i];if(n.hasRenderableParent(d))continue;let _=n.getTile(d),y=_.getBucket(a);if(!y||y.projection.name!==h.projection.name)continue;let v=r.isTileAffectedByFog(d),x=y.programConfigurations.get(a.id),b=r.getOrCreateProgram("heatmap",{config:x,defines:p,overrideFog:v}),{zoom:w}=r.transform;r.terrain&&r.terrain.setupElevationDraw(_,b),r.uploadCommonUniforms(s,b,d.toUnwrapped());let T=h.projection.createInversionMatrix(h,d.canonical);b.draw(r,l.TRIANGLES,tz.disabled,u,c,m,oy(r,d,_,T,g,w,a.paint.get("heatmap-intensity")),a.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,a.paint,r.transform.zoom,x,f?[y.globeExtVertexBuffer]:null)}s.viewport.set([0,0,r.width,r.height])}else"translucent"===r.renderPass&&(r.context.setColorMode(r.colorModeForRenderPass()),function(r,n){let a=r.context,o=a.gl,s=n.heatmapFbo;if(!s)return;a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,s.colorAttachment0.get()),a.activeTexture.set(o.TEXTURE1);let l=n.colorRampTexture;l||(l=n.colorRampTexture=new i.a_(a,n.colorRamp,o.RGBA8)),l.bind(o.LINEAR,o.CLAMP_TO_EDGE),r.getOrCreateProgram("heatmapTexture").draw(r,o.TRIANGLES,tz.disabled,t7.disabled,r.colorModeForRenderPass(),tj.disabled,{u_image:0,u_color_ramp:1,u_opacity:n.paint.get("heatmap-opacity")},n.id,r.viewportBuffer,r.quadTriangleIndexBuffer,r.viewportSegments,n.paint,r.transform.zoom)}(r,a))},line:function(i,r,n,a){let o=n.paint.get("line-opacity"),s=n.paint.get("line-width");if(0===o.constantOr(1)||0===s.constantOr(1))return;let l=n.paint.get("line-blend-mode"),u=i.terrain&&i.terrain.renderingToTexture;if("default"===l||"globe"===i.transform.projection.name)"translucent"===i.renderPass&&oD(i,r,n,a);else{if(u)return void function(i,r,n,a,o){if("translucent"!==i.renderPass)return;let s=i.context,l=s.gl,u=i.terrain;if(!u)return;let c=s.bindFramebuffer.current,d="mrt-fallback"===i.emissiveMode,h=u.drapeBufferSize[0],f=u.drapeBufferSize[1];n.lineBlendFbos||(n.lineBlendFbos=new oF),n.lineBlendFbos.drapeFbo=oI.createWithTexture(s,n.lineBlendFbos.drapeFbo,h,f,!0),d&&l.drawBuffers([l.COLOR_ATTACHMENT0]),s.clear({color:oj[o].clearColor,depth:1,stencil:0});let p=i.currentStencilSource,m=i._tileClippingMaskIDs,g=i.nextStencilID;i.currentStencilSource=void 0,i._tileClippingMaskIDs={},i.nextStencilID=1;let _=i._terrain;i._terrain=null,i._renderTileClippingMasks(n,r,a),oD(i,r,n,a,oB(o,i.context),!0),i._terrain=_,i.currentStencilSource=p,i._tileClippingMaskIDs=m,i.nextStencilID=g,d&&l.drawBuffers([l.COLOR_ATTACHMENT0,l.COLOR_ATTACHMENT1]);let y=u.drapeBufferSize,v=n.lineBlendFbos&&n.lineBlendFbos.drapeFbo;v&&("additive"===o&&oV(i,n,v),oH(i,n,o,v,c,y))}(i,r,n,a,l);if("offscreen"===i.renderPass){let o,s,u,c,d,h,f;return void(o=i.context,s=Math.ceil(i.width),u=Math.ceil(i.height),n.lineBlendFbos||(n.lineBlendFbos=new oF),n.lineBlendFbos.fbo=oI.createWithTexture(o,n.lineBlendFbos.fbo,s,u,!0),o.clear({color:oj[l].clearColor,depth:1,stencil:0}),c=i.currentStencilSource,d=i._tileClippingMaskIDs,h=i.nextStencilID,i.currentStencilSource=void 0,i._tileClippingMaskIDs={},i.nextStencilID=1,i._renderTileClippingMasks(n,r,a),f=i.renderPass,i.renderPass="translucent",oD(i,r,n,a,oB(l,i.context)),i.renderPass=f,i.currentStencilSource=c,i._tileClippingMaskIDs=d,i.nextStencilID=h,o.viewport.set([0,0,i.width,i.height]),"additive"===l&&oV(i,n,n.lineBlendFbos.fbo))}if("translucent"===i.renderPass){let r=n.lineBlendFbos&&n.lineBlendFbos.fbo;return void(r&&oH(i,n,l,r,null))}}},fill:function(r,n,a,o){let s=a.paint.get("fill-color"),l=a.paint.get("fill-opacity");if(0===l.constantOr(1))return;let u=a.paint.get("fill-emissive-strength"),c=r.colorModeForDrapableLayerRenderPass(u),d=a.paint.get("fill-pattern"),h=r.opaquePassEnabledForLayer()&&!d.constantOr(1)&&1===s.constantOr(i.i.transparent).a&&1===l.constantOr(0)?"opaque":"translucent",f="none";"none"!==a.layout.get("fill-elevation-reference")?f="road":0!==a.paint.get("fill-z-offset").constantOr(1)&&(f="offset");let p=!(!r.terrain||!r.terrain.enabled),m={painter:r,sourceCache:n,layer:a,coords:o,colorMode:c,elevationType:f,terrainEnabled:p,pass:h};if("shadow"===r.renderPass)return void(r.shadowRenderer&&"road"===f&&!p&&r$&&r$(m));let g="mrt-fallback"===r.emissiveMode;if("offset"!==f){if(oG(m,!1,g),"road"===f){let i=!p&&"translucent"===r.renderPass;i&&rW&&rW(r,n,a,o,"geometry"),oG(m,!0,g,t7.disabled),i&&rq&&rq(m)}}else oG(m,!1,g,r.stencilModeFor3D())},"fill-extrusion":function(r,n,a,o){let s=a.paint.get("fill-extrusion-opacity"),l=r.context,u=l.gl,c=r.terrain,d=c&&c.renderingToTexture;if(0===s)return;let h="mrt-fallback"===r.emissiveMode,f=r.conflationActive&&r.style.isLayerClipped(a,n.getSource()),p=r.style.order.indexOf(a.fqid);if(f&&function(i,r,n,a,o){for(let s of a){let a=r.getTile(s).getBucket(n);a&&(a.updateReplacement(s,i.replacementSource,o),a.uploadCentroid(i.context))}}(r,n,a,o,p),c||f)for(let s of o){let o=n.getTile(s).getBucket(a);o&&function(r,n,a,o,s,l,u){0===o.centroidVertexArray.length&&o.createCentroidsBuffer();let c=l?l.findDEMTileFor(a):null;if(!(c&&c.dem||u))return;l&&c&&c.dem&&o.selfDEMTileTimestamp!==c.dem._timestamp&&(o.borderDoneWithNeighborZ=[-1,-1,-1,-1],o.selfDEMTileTimestamp=c.dem._timestamp);let d=(r,n)=>{(r.flags|n.flags)&i.Y?(r.flags|=i.Y,n.flags|=i.Y):(r.flags&=~i.Y,n.flags&=~i.Y)},h=r=>
112new i.au(Math.ceil((r+i.E)*i.q),0),f=(r,n,a)=>{let o=Math.ceil((r+i.E)*i.q),s=Math.floor(Math.max(0,Math.min(i.r-1,a))/4);return new i.au(o,s<<5|(3&n)<<3|7)},p=i=>{let r=n.getSource().minzoom,a=i=>{let r=n.getTileByID(i);if(r&&r.hasData())return r.getBucket(s)};for(let n of[0,-1,1]){if(i.overscaledZ+n<r)continue;let o=a(i.calculateScaledKey(i.overscaledZ+n));if(o)return o}},m=[0,0,0],g=(r,n)=>(m[0]=Math.min(r.min.y,n.min.y),m[1]=Math.max(r.max.y,n.max.y),m[2]=i.r-n.min.x>r.max.x?n.min.x-i.r:r.max.x,m),_=(r,n)=>(m[0]=Math.min(r.min.x,n.min.x),m[1]=Math.max(r.max.x,n.max.x),m[2]=i.r-n.min.y>r.max.y?n.min.y-i.r:r.max.y,m),y=[(i,r)=>g(i,r),(i,r)=>g(r,i),(i,r)=>_(i,r),(i,r)=>_(r,i)],v=(r,n,o,s,u,d,h)=>{if(!l)return 0;let f=[[d?o:r,d?r:o,0],[d?o:n,d?n:o,0]],p=h<0?i.r+h:h,m=[d?p:(r+n)/2,d?(r+n)/2:p,0];return 0===o&&h<0||0!==o&&h>0?l.getForTilePoints(u,[m],!0,s):f.push(m),l.getForTilePoints(a,f,!0,c),Math.max(f[0][2],f[1][2],m[2])/l.exaggeration()};for(let r=0;r<4;r++){let n=o.borderFeatureIndices[r];if(0===n.length)continue;let s=i.ev[r](a),c=p(s);if(!(c&&c instanceof i.K))continue;let m=l?l.findDEMTileFor(s):null;if(!(m&&m.dem||u)||(l&&m&&m.dem&&o.borderDEMTileTimestamp[r]!==m.dem._timestamp&&(o.borderDoneWithNeighborZ[r]=-1,o.borderDEMTileTimestamp[r]=m.dem._timestamp),o.borderDoneWithNeighborZ[r]===c.canonical.z))continue;0===c.centroidVertexArray.length&&c.createCentroidsBuffer();let g=(r<2?1:5)-r,_=c.borderDoneWithNeighborZ[g]!==o.canonical.z,x=c.borderFeatureIndices[g],b=0;if(o.canonical.z!==c.canonical.z){for(let i of n)o.showCentroid(o.featuresOnBorder[i]);if(_)for(let i of x)c.showCentroid(c.featuresOnBorder[i]);o.borderDoneWithNeighborZ[r]=c.canonical.z,c.borderDoneWithNeighborZ[g]=o.canonical.z;continue}let w=new Map,T=new Set,E=new Set;for(let i=0;i<x.length;i++){let r=c.featuresOnBorder[x[i]];void 0!==r.buildingId&&w.set(r.buildingId,i)}for(let a of n){let n=o.featuresOnBorder[a],l=o.centroidData.get(n.centroidDataIndex);if(void 0===n.buildingId)continue;let h=w.get(n.buildingId);if(void 0===h)continue;let p=c.featuresOnBorder[x[h]],_=c.centroidData.get(p.centroidDataIndex);T.add(a),E.add(h),u&&d(l,_);let b=0!==l.groupCentroidPos.x||0!==l.groupCentroidPos.y?l.groupCentroidPos:n.centroid(),S=0!==_.groupCentroidPos.x||0!==_.groupCentroidPos.y?_.groupCentroidPos:p.centroid(),A=r<2?Math.round((b.y+S.y)/2):Math.round((b.x+S.x)/2),C=n.intersectsCount()>1||p.intersectsCount()>1;{let n=0;if(m&&m.dem&&!C){let a=y[r](l,_),o=r%2?i.r-1:0;n=v(a[0],Math.min(i.r-1,a[1]),o,m,s,r<2,a[2])}l.centroidXY=f(n,r,A),_.centroidXY=f(n,g,A)}if(o.writeCentroidToBuffer(l),c.writeCentroidToBuffer(_),void 0!==n.buildingId){for(let i of o.centroidData)i.buildingId===n.buildingId&&i!==l&&(i.centroidXY=l.centroidXY,o.writeCentroidToBuffer(i));for(let i of c.centroidData)i.buildingId===n.buildingId&&i!==_&&(i.centroidXY=_.centroidXY,c.writeCentroidToBuffer(i))}}for(let a of n){let n;if(T.has(a))continue;let l=o.featuresOnBorder[a],f=o.centroidData.get(l.centroidDataIndex),p=l.borders[r];for(;b<x.length;){if(E.has(b)){b++;continue}let i=(n=c.featuresOnBorder[x[b]]).borders[g];if(i[1]>p[0]+3||i[0]>p[0]-3)break;c.showCentroid(n),b++}if(n&&b<x.length){let a=b,_=0;for(;;)if(E.has(b)){if(++b===x.length)break;n=c.featuresOnBorder[x[b]]}else{if(n.borders[g][0]>p[1]-3||(_++,++b===x.length))break;n=c.featuresOnBorder[x[b]]}for(;a<x.length&&E.has(a);)a++;if(a>=x.length){o.showCentroid(l);continue}n=c.featuresOnBorder[x[a]];let w=!1;if(_>=1){let i=n.borders[g];3>Math.abs(p[0]-i[0])&&3>Math.abs(p[1]-i[1])&&(_=1,w=!0,b=a+1)}else if(0===_){o.showCentroid(l);continue}let T=c.centroidData.get(n.centroidDataIndex);u&&w&&d(f,T);let S=l.intersectsCount()>1||n.intersectsCount()>1;if(_>1)b=a,f.centroidXY=T.centroidXY=new i.au(0,0);else if(m&&m.dem&&!S){let n=y[r](f,T),a=r%2?i.r-1:0;f.centroidXY=T.centroidXY=h(v(n[0],Math.min(i.r-1,n[1]),a,m,s,r<2,n[2]))}else S?f.centroidXY=T.centroidXY=new i.au(0,0):(f.centroidXY=o.encodeBorderCentroid(l),T.centroidXY=c.encodeBorderCentroid(n));o.writeCentroidToBuffer(f),c.writeCentroidToBuffer(T)}else o.showCentroid(l)}o.borderDoneWithNeighborZ[r]=c.canonical.z,c.borderDoneWithNeighborZ[g]=o.canonical.z}(o.needsCentroidUpdate||!o.centroidVertexBuffer&&0!==o.centroidVertexArray.length)&&o.uploadCentroid(r)}(r.context,n,s,o,a,c,f)}if("shadow"===r.renderPass&&r.shadowRenderer){if(c&&s<.65&&a._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof i.bh)return;let l=r.shadowRenderer.getShadowPassDepthMode();ib(r,n,a,o,l,t7.disabled,ie.disabled,f)}else if("translucent"===r.renderPass){let p=!a.paint.get("fill-extrusion-pattern").constantOr(1),m=a.paint.get("fill-extrusion-color").constantOr(i.i.white);if(!d&&0!==m.a){let i=new tz(r.context.gl.LEQUAL,tz.ReadWrite,r.depthRangeFor3D);
1121===s&&p?ib(r,n,a,o,i,t7.disabled,ie.unblended,f):(ib(r,n,a,o,i,t7.disabled,ie.disabled,f),ib(r,n,a,o,i,r.stencilModeFor3D(),r.colorModeForRenderPass(),f),r.resetStencilClippingMasks())}if(r.style.enable3dLights()&&p&&(!c&&"globe"!==r.transform.projection.name||d)){let s=a.paint.get("fill-extrusion-opacity"),p=a.paint.get("fill-extrusion-ambient-occlusion-intensity"),m=a.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),g=a.paint.get("fill-extrusion-flood-light-intensity"),_="none"===a.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),y=a.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(_?null:a.lut).toArray01().slice(0,3),v=p>0&&m>0,x=g>0,b=new iw;b.translate=a.paint.get("fill-extrusion-translate"),b.translateAnchor=a.paint.get("fill-extrusion-translate-anchor"),b.edgeRadius=a.layout.get("fill-extrusion-edge-radius"),b.cutoffFadeRange=a.paint.get("fill-extrusion-cutoff-fade-range");let w=l=>{let c=r.depthModeForSublayer(1,tz.ReadOnly,u.LEQUAL,!0),d=a.paint.get(l?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),h=i.dY(.1,3,d),_=r._showOverdrawInspector;_||iE(b,r,n,a,o,c,new t7({func:u.ALWAYS,mask:255},255,255,u.KEEP,u.KEEP,u.REPLACE),new ie([u.ONE,u.ONE,u.ONE,u.ONE],i.i.transparent,[!1,!1,!1,!0],u.MIN),tj.disabled,l,"sdf",s,p,m,g,y,h,f,!1);{let d=_?t7.disabled:new t7({func:u.EQUAL,mask:255},255,255,u.KEEP,u.DECR,u.DECR),v=_?r.colorModeForRenderPass():new ie([u.ONE_MINUS_DST_ALPHA,u.DST_ALPHA,u.ONE,u.ONE],i.i.transparent,[!0,!0,!0,!0]);iE(b,r,n,a,o,c,d,v,tj.disabled,l,"color",s,p,m,g,y,h,f,!1)}};if(d){let d=()=>{let r=c.drapeBufferSize[0],n=c.drapeBufferSize[1],a=c.framebufferCopyTexture;return a&&(!a||a.size[0]===r&&a.size[1]===n)||(a&&a.destroy(),a=c.framebufferCopyTexture=new i.a_(l,new i.ay({width:r,height:n}),u.RGBA8)),a.bind(u.LINEAR,u.CLAMP_TO_EDGE),u.copyTexSubImage2D(u.TEXTURE_2D,0,0,0,0,0,r,n),a},_=(l,c,_)=>{let v=r.depthModeForSublayer(1,tz.ReadOnly,u.LEQUAL,!1),x=a.paint.get(l?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),w=i.dY(.1,3,x);{let d=new ie([u.ONE,u.ONE,u.ONE,u.ONE],i.i.transparent,[!1,!1,!1,!0]);iE(b,r,n,a,o,v,t7.disabled,d,tj.disabled,l,"clear",s,p,m,g,y,w,f,c)}iE(b,r,n,a,o,v,new t7({func:u.ALWAYS,mask:255},255,255,u.KEEP,u.KEEP,u.REPLACE),new ie([u.ONE,u.ONE,u.ONE,u.ONE],i.i.transparent,[!1,!1,!1,!0],u.MIN),tj.disabled,l,"sdf",s,p,m,g,y,w,f,c),h&&!l&&(_=d());{let d=l?u.ZERO:u.ONE_MINUS_DST_ALPHA;iE(b,r,n,a,o,v,new t7({func:u.EQUAL,mask:255},255,255,u.KEEP,u.DECR,u.DECR),new ie([d,u.DST_ALPHA,u.ONE_MINUS_DST_ALPHA,u.ZERO],i.i.transparent,[!0,!0,!0,!0]),tj.disabled,l,"color",s,p,m,g,y,w,f,c)}if(!h||l){let d=new ie([u.ONE,u.ONE,u.ONE,l?u.ZERO:u.ONE],i.i.transparent,[!1,!1,!1,!0],l?u.FUNC_ADD:u.MAX);iE(b,r,n,a,o,v,t7.disabled,d,tj.disabled,l,"clear",s,p,m,g,y,w,f,c,_)}else u.drawBuffers([u.NONE,u.COLOR_ATTACHMENT1]),iE(b,r,n,a,o,v,new t7({func:u.EQUAL,mask:255},254,255,u.KEEP,u.DECR,u.DECR),new ie([u.ONE,u.ONE,u.ONE,u.ONE],i.i.transparent,[!0,!1,!1,!1],u.MAX),tj.disabled,l,"emissive",s,p,m,g,y,w,f,c,_),u.drawBuffers([u.COLOR_ATTACHMENT0])};if(v||x){let i;r.prepareDrawTile(),h&&!v||(i=d()),v&&_(!0,!1,i),x&&_(!1,!0,i)}}else v&&w(!0),x&&w(!1),(v||x)&&r.resetStencilClippingMasks()}}},hillshade:function(r,n,a,o){if("offscreen"!==r.renderPass&&"translucent"!==r.renderPass||r.style.disableElevatedTerrain)return;let s=r.context,l=r.terrain&&r.terrain.renderingToTexture,[u,c]="translucent"!==r.renderPass||l?[{},o]:r.stencilConfigForOverlap(o);for(let o of c){let s=n.getTile(o);if(s.needsHillshadePrepare&&"offscreen"===r.renderPass)!function(r,n,a){var o;let s,l,u=r.context,c=u.gl;if(!n.dem)return;let d=n.dem;if(u.activeTexture.set(c.TEXTURE1),aT(r,n,d),!n.demTexture)return;n.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);let h=d.dim;u.activeTexture.set(c.TEXTURE0);let f=n.hillshadeFBO;if(!f){let r=new i.a_(u,{width:h,height:h,data:null},c.RGBA8);r.bind(c.LINEAR,c.CLAMP_TO_EDGE),(f=n.hillshadeFBO=u.createFramebuffer(h,h,1,"renderbuffer")).colorAttachment0.set(r.texture)}u.bindFramebuffer.set(f.framebuffer),u.viewport.set([0,0,h,h]);let{tileBoundsBuffer:p,tileBoundsIndexBuffer:m,tileBoundsSegments:g}=r.getMercatorTileBoundsBuffers(),_=[];r.linearFloatFilteringSupported()&&_.push("TERRAIN_DEM_FLOAT_FORMAT"),r.terrain&&r.terrain.renderingToTexture&&"mrt-fallback"===r.emissiveMode&&_.push("USE_MRT1"),r.getOrCreateProgram("hillshadePrepare",{defines:_}).draw(r,c.TRIANGLES,tz.disabled,t7.disabled,ie.unblended,tj.disabled,(o=n.tileID,s=d.stride,l=i.bT(),i.eB(l,0,i.r,-i.r,0,0,1),i.fQ(l,l,[0,-i.r,0]),{u_matrix:l,u_image:1,u_dimension:[s,s],u_zoom:o.overscaledZ}),a.id,p,m,g),n.needsHillshadePrepare=!1}(r,s,a);else if("translucent"===r.renderPass){let n=r.depthModeForSublayer(0,tz.ReadOnly),c=a.paint.get("hillshade-emissive-strength"),d=r.colorModeForDrapableLayerRenderPass(c),h=l&&r.terrain?r.terrain.stencilModeForRTTOverlap(o):u[o.overscaledZ];!function(r,n,a,o,s,l,u){let c=r.context,d=c.gl,h=a.hillshadeFBO;if(!h)return;r.prepareDrawTile();let f=r.isTileAffectedByFog(n),p=[];r.terrain&&r.terrain.renderingToTexture&&"mrt-fallback"===r.emissiveMode&&p.push("USE_MRT1");let m=r.getOrCreateProgram("hillshade",{overrideFog:f,defines:p});c.activeTexture.set(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,h.colorAttachment0.get());let g=((r,n,a,o)=>{var s;let l,u,c=a.paint.get("hillshade-shadow-color"),d="none"===a.paint.get("hillshade-shadow-color-use-theme").
112constantOr("default"),h=a.paint.get("hillshade-highlight-color"),f="none"===a.paint.get("hillshade-highlight-color-use-theme").constantOr("default"),p=a.paint.get("hillshade-accent-color"),m="none"===a.paint.get("hillshade-accent-color-use-theme").constantOr("default"),g=a.paint.get("hillshade-emissive-strength"),_=i.c4(a.paint.get("hillshade-illumination-direction"));if("viewport"===a.paint.get("hillshade-illumination-anchor"))_-=r.transform.angle;else if(r.style&&r.style.enable3dLights()&&r.style.directionalLight){let n=r.style.directionalLight.properties.get("direction"),a=i.bB(n.x,n.y,n.z);_=i.c4(a[1])}let y=!r.options.moving;return{u_matrix:o||r.transform.calculateProjMatrix(n.tileID.toUnwrapped(),y),u_image:0,u_latrange:(l=Math.pow(2,(s=n.tileID).canonical.z),u=s.canonical.y,[new i.ag(0,u/l).toLngLat().lat,new i.ag(0,(u+1)/l).toLngLat().lat]),u_light:[a.paint.get("hillshade-exaggeration"),_],u_shadow:c.toPremultipliedRenderColor(d?null:a.lut),u_highlight:h.toPremultipliedRenderColor(f?null:a.lut),u_emissive_strength:g,u_accent:p.toPremultipliedRenderColor(m?null:a.lut)}})(r,a,o,r.terrain?n.projMatrix:null);r.uploadCommonUniforms(c,m,n.toUnwrapped());let{tileBoundsBuffer:_,tileBoundsIndexBuffer:y,tileBoundsSegments:v}=r.getTileBoundsBuffers(a);m.draw(r,d.TRIANGLES,s,l,u,tj.disabled,g,o.id,_,y,v)}(r,o,s,a,n,h,d)}}s.viewport.set([0,0,r.width,r.height]),r.resetStencilClippingMasks()},raster:function(r,n,a,o,s,l){if("translucent"!==r.renderPass)return;let u=a.paint.get("raster-opacity");if(0===u)return;let c="globe"===r.transform.projection.name,d=0!==a.paint.get("raster-elevation"),h=d&&c,f=r.terrain&&r.terrain.exaggeration()>0&&d&&"ground"===a.paint.get("raster-elevation-reference"),p=!c&&f;if(r.renderElevatedRasterBackface&&!h)return;let m=r.context,g=m.gl,_=n.getSource(),y=function(r,n,a,o,s){let l=n.paint.get("raster-color"),u="raster-array"===r.type,c=[],d=n.paint.get("raster-resampling"),h=n.paint.get("raster-color-mix"),f=n.paint.get("raster-color-range"),p=[h[0],h[1],h[2],0],m=h[3],g="nearest"===d?o.NEAREST:o.LINEAR;if(u&&(c.push("RASTER_ARRAY"),l||c.push("RASTER_COLOR"),"linear"===d&&c.push("RASTER_ARRAY_LINEAR"),g=o.NEAREST,!f&&r.rasterLayers)){let i=r.rasterLayers.find(({id:i})=>i===n.sourceLayer);i&&i.fields&&i.fields.range&&(f=i.fields.range)}if(f=f||[0,1],l){c.push("RASTER_COLOR"),a.activeTexture.set(o.TEXTURE2),n.updateColorRamp(f);let r=n.colorRampTexture;r||(r=n.colorRampTexture=new i.a_(a,n.colorRamp,o.RGBA8)),r.bind(g,o.CLAMP_TO_EDGE)}return s&&c.push("USE_MRT1"),{mix:p,range:f,offset:m,defines:c,resampling:g}}(_,a,m,g,r.terrain&&r.terrain.renderingToTexture&&"mrt-fallback"===r.emissiveMode);if(_ instanceof i.a3&&!o.length&&!c)return;let v=a.paint.get("raster-emissive-strength"),x=r.colorModeForDrapableLayerRenderPass(v),b=r.terrain&&r.terrain.renderingToTexture,w=!r.options.moving,T="nearest"===a.paint.get("raster-resampling")?g.NEAREST:g.LINEAR;if(_ instanceof i.a3&&!o.length&&(_.onNorthPole||_.onSouthPole)){let i=d?r.stencilModeFor3D():t7.disabled;return void o$(!!_.onNorthPole,null,r,n,a,v,y,tj.disabled,i)}if(!o.length)return;let[E,S]=_ instanceof i.a3||b?[{},o]:r.stencilConfigForOverlap(o),A=S.at(-1).overscaledZ;h&&y.defines.push("PROJECTION_GLOBE_VIEW"),d&&y.defines.push("RENDER_CUTOFF","ELEVATED"),f&&y.defines.push("ELEVATION_REFERENCE_GROUND");let C=(o,s,S)=>{for(let C of o){let o,I,k,R,M,L=C.toUnwrapped(),P=n.getTile(C);if(b&&(!P||!P.hasData()))continue;m.activeTexture.set(g.TEXTURE0);let O=function(i,r,n,a){if(i)return r instanceof iH&&i instanceof iz?r.getTextureDescriptor(i,n,!0):{texture:i.texture,mix:oq(a.mix),offset:a.offset,buffer:0,tileSize:1}}(P,_,a,y);if(!O||!O.texture)continue;let{texture:D,mix:F,offset:N,tileSize:j,buffer:z}=O;b?(o=tz.disabled,I=C.projMatrix):d?(o=new tz(g.LEQUAL,tz.ReadWrite,r.depthRangeFor3D),I=c?r.transform.expandedFarZProjMatrix:r.transform.calculateProjMatrix(L,w)):(o=r.depthModeForSublayer(C.overscaledZ-A,1===u?tz.ReadWrite:tz.ReadOnly,g.LESS),I=r.transform.calculateProjMatrix(L,w));let B=r.terrain&&b?r.terrain.stencilModeForRTTOverlap(C):E[C.overscaledZ],U=l?0:a.paint.get("raster-fade-duration");P.registerFadeDuration(U);let V=n.findLoadedParent(C,0),H=i$(P,V,n,r.transform,U);!H.isFading&&P.refreshedUponExpiration&&(P.refreshedUponExpiration=!1),r.terrain&&r.terrain.prepareDrawTile(),m.activeTexture.set(g.TEXTURE0),D.bind(T,g.CLAMP_TO_EDGE),m.activeTexture.set(g.TEXTURE1),V?(V.texture&&V.texture.bind(T,g.CLAMP_TO_EDGE),k=Math.pow(2,V.tileID.overscaledZ-P.tileID.overscaledZ
112),R=[P.tileID.canonical.x*k%1,P.tileID.canonical.y*k%1]):D.bind(T,g.CLAMP_TO_EDGE),"useMipmap"in D&&m.extTextureFilterAnisotropic&&r.transform.pitch>20&&g.texParameterf(g.TEXTURE_2D,m.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,m.extTextureFilterAnisotropicMax);let G=r.transform,q=d?function(i){if(i.isOrthographic)return[0,0,0,0];let r=i._nearZ,n=i.projection.farthestPixelDistance(i),a=n-r,o=.2*i.height,s=r+o;return[r,n,(s-o-r)/a,(s-r)/a]}(G):[0,0,0,0],$,W,Y,Z,K,X=0;if(h&&_ instanceof i.a3&&_.coordinates.length>3)$=Float32Array.from(i.dh(i.dk(new i.f(0,0,0)))),W=Float32Array.from(G.globeMatrix),Y=Float32Array.from(i.by(G)),Z=[i.ek(G.center.lng),i.el(G.center.lat)],M=_.elevatedGlobePerspectiveTransform,K=_.elevatedGlobeGridMatrix||new Float32Array(9);else if(h){let r=i.fF(C.canonical);X=i.cU(r.getCenter().lat),$=Float32Array.from(i.dh(i.dk(C.canonical))),W=Float32Array.from(G.globeMatrix),Y=Float32Array.from(i.by(G)),Z=[i.ek(G.center.lng),i.el(G.center.lat)],M=[0,0],K=Float32Array.from(i.cP(C.canonical,r,X,G.worldSize/G._pixelsPerMercatorPixel))}else M=_ instanceof i.a3?_.perspectiveTransform:[0,0],$=new Float32Array(16),W=new Float32Array(9),Y=new Float32Array(16),Z=[0,0],K=new Float32Array(9);let Q=ov(r,I,$,W,Y,K,R||[0,0],i.dm(r.transform.zoom),Z,q,k||1,H,a,M,d?a.paint.get("raster-elevation"):0,2,F,N,y.range,j,z,v),J=r.isTileAffectedByFog(C),ee=r.getOrCreateProgram("raster",{defines:y.defines,overrideFog:J});if(r.uploadCommonUniforms(m,ee,L),_ instanceof i.a3){let n=_.elevatedGlobeVertexBuffer,l=_.elevatedGlobeIndexBuffer;if(b||!c)_.boundsBuffer&&_.boundsSegments&&ee.draw(r,g.TRIANGLES,o,t7.disabled,x,tj.disabled,Q,a.id,_.boundsBuffer,r.quadTriangleIndexBuffer,_.boundsSegments);else if(n&&l){let u=G.zoom<=i.S?_.elevatedGlobeSegments:_.getSegmentsForLongitude(G.center.lng);u&&ee.draw(r,g.TRIANGLES,o,t7.disabled,x,s,Q,a.id,n,l,u)}}else if(h){o=new tz(g.LEQUAL,tz.ReadOnly,r.depthRangeFor3D);let i=r.globeSharedBuffers;if(i){f&&(r.terrain.setupElevationDraw(P,ee),r.uploadCommonUniforms(m,ee,P.tileID.toUnwrapped()));let[n,l,u]=i.getGridBuffers(X,!1),c=ee.getAttributeLocation(g,"a_texture_pos");-1!==c&&g.vertexAttribI4ui(c,0,0,0,0),ee.draw(r,g.TRIANGLES,o,S||B,r.colorModeForRenderPass(),s,Q,a.id,n,l,u)}}else if(p)o=new tz(g.LEQUAL,tz.ReadWrite,r.depthRangeFor3D),r.terrain.setupElevationDraw(P,ee),r.uploadCommonUniforms(m,ee,P.tileID.toUnwrapped()),G.pitch>20&&ee.draw(r,g.TRIANGLES,o,t7.disabled,ie.disabled,tj.frontCCW,Q,a.id,r.terrain.gridBuffer,r.terrain.gridIndexBuffer,r.terrain.gridSegments),ee.draw(r,g.TRIANGLES,o,B,x,tj.backCCW,Q,a.id,r.terrain.gridBuffer,r.terrain.gridIndexBuffer,r.terrain.gridSegments);else{let{tileBoundsBuffer:i,tileBoundsIndexBuffer:n,tileBoundsSegments:s}=r.getTileBoundsBuffers(P);ee.draw(r,g.TRIANGLES,o,B,x,tj.disabled,Q,a.id,i,n,s)}}if(!(_ instanceof i.a3)&&h)for(let i of o){let o=i.canonical.y===(1<<i.canonical.z)-1;0===i.canonical.y&&o$(!0,i,r,n,a,v,y,s,S||t7.disabled),o&&o$(!1,i,r,n,a,v,y,s===tj.frontCW?tj.backCW:tj.frontCW,S||t7.disabled)}};h?C(S,r.renderElevatedRasterBackface?tj.backCW:tj.frontCW,r.stencilModeFor3D()):C(S,tj.disabled,void 0),r.resetStencilClippingMasks()},background:function(r,n,a,o){let s,l=a.paint.get("background-color"),u="none"===a.paint.get("background-color-use-theme").constantOr("default"),c=a.paint.get("background-opacity"),d=a.paint.get("background-emissive-strength"),h="viewport"===a.paint.get("background-pitch-alignment");if(0===c)return;let f=r.context,p=f.gl,m=r.transform,g=m.tileSize,_=a.paint.get("background-pattern");if(void 0!==_&&(null===_||!(s=r.imageManager.getPattern(i.a1.from(_.toString()),a.scope,r.style.getLut(a.scope)))))return;let y=!_&&1===l.a&&1===c&&r.opaquePassEnabledForLayer()?"opaque":"translucent";if(r.renderPass!==y)return;let v=t7.disabled,x=r.depthModeForSublayer(0,"opaque"===y?tz.ReadWrite:tz.ReadOnly),b=r.colorModeForDrapableLayerRenderPass(d),w=_?"backgroundPattern":"background",T,E=o;E||(E=Object.values(T=r.getBackgroundTiles()).map(i=>i.tileID)),_&&(f.activeTexture.set(p.TEXTURE0),r.imageManager.bind(r.context,a.scope));let S=[];if(r.terrain&&r.terrain.renderingToTexture&&"mrt-fallback"===r.emissiveMode&&S.push("USE_MRT1"),h){let n=r.getOrCreateProgram(w,{overrideFog:!1,overrideRtt:!0,defines:S}),o=new i.ap(0,0,0,0,0),f=_?oT(oW,d,c,r,0,a.scope,s,h,{tileID:o,tileSize:g}):ow(oW,d,c,l.toPremultipliedRenderColor(u?null:a.lut));return void n.draw(r,p.TRIANGLES,x,v,b,tj.disabled,f,a.id,r.viewportBuffer,r.quadTriangleIndexBuffer,r.viewportSegments)}for(let y of E){let E=r.isTileAffectedByFog(y),A=r.getOrCreateProgram(w,{overrideFog:E,defines:S}),C=y.toUnwrapped(),I=o?y.projMatrix:r.transform.calculateProjMatrix(C);r.prepareDrawTile();let k=n?n.getTile(y):T?T[y.key]:new i.b0(y,g,m.zoom,r),R=_?oT(I,d,c,r,0,a.scope,s,h,{tileID:y,tileSize:g}):ow(I,d,c,l.toPremultipliedRenderColor(u?null:a.lut));r.uploadCommonUniforms(f,A,C);let{tileBoundsBuffer:M,tileBoundsIndexBuffer:L,tileBoundsSegments:P}=r.getTileBoundsBuffers(k);A.draw(r,p.TRIANGLES,x,v,b,tj.disabled,R,a.id,M,L,P)}},sky:function(r,n,a){let o,s,l,u,c,d,h,f,p,m,g,_,y,v,x=r._atmosphere?i.dm(r.transform.zoom):1,b=a.paint.get("sky-opacity")*x;if(0===b)return;let w=r.context,T=a.paint.get("sky-type"),E=new tz(w.gl.LEQUAL,tz.ReadOnly,[0,1]),S=r.frameCounter/1e3%1;"atmosphere"===T?"offscreen"===r.renderPass?a.needsSkyboxCapture(r)&&(function(r,n){let a=r.context,o=a.gl,s=n.skyboxFbo;if(!s){s=n.skyboxFbo=a.createFramebuffer(32,32,1,null),n.skyboxGeometry=new o4(a),n.skyboxTexture=a.gl.createTexture(),o.bindTexture(o.TEXTURE_CUBE_MAP,n.skyboxTexture),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MAG_FILTER,o.LINEAR);for(let i=0;i<6;++i)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,o.RGBA,32,32,0,o.RGBA,o.UNSIGNED_BYTE,null)}a.bindFramebuffer.set(s.framebuffer),a.viewport.set([0,0,32,32]);let l=n.getCenter(r,!0),u=r.getOrCreateProgram("skyboxCapture"),c=new Float64Array(16);i.cB(c,-(.5*Math.PI)),o9(r,n,u,c,l,0),i.cB(c,.5*Math.PI),o9(r,n,u,c,l,1),i.cA(c,-(.5*Math.PI)),o9(r,n,u,c,l,2),i.cA(c,.5*Math.PI),o9(r,n,u,c,l,3),i.dq(c),o9(r,n,u,c,l,4),i.cB(c,Math.PI),o9(r,n,u,c,l,5),a.viewport.set([0,0,r.width,r.height])}(r,a),a.markSkyboxValid(r)):"sky"===r.renderPass&&(s=(o=r.context).gl,l=r.transform,u=r.getOrCreateProgram("skybox"),o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_CUBE_MAP,a.skyboxTexture),c={u_matrix:l.skyboxMatrix,u_sun_direction:a.getCenter(r,!1),u_cubemap:0,u_opacity:b,u_temporal_offset:S},r.uploadCommonUniforms(o,u),u.draw(r,s.TRIANGLES,E,t7.disabled,r.colorModeForRenderPass(),tj.backCW,c,"skybox",a.skyboxGeometry.vertexBuffer,a.skyboxGeometry.indexBuffer,a.skyboxGeometry.segment)):"gradient"===T&&"sky"===r.renderPass&&(h=(d=r.context).gl,f=r.transform,p=r.getOrCreateProgram("skyboxGradient"),a.skyboxGeometry||(a.skyboxGeometry=new o4(d)),d.activeTexture.set(h.TEXTURE0),(m=a.colorRampTexture)||(m=a.colorRampTexture=new i.a_(d,a.colorRamp,h.RGBA8)),m.bind(h.LINEAR,h.CLAMP_TO_EDGE),g=f.skyboxMatrix,_=a.getCenter(r,!1),y=a.paint.get("sky-gradient-radius"),v={u_matrix:g,u_color_ramp:0,u_center_direction:_,u_radius:i.c4(y),u_opacity:b,u_temporal_offset:S},r.uploadCommonUniforms(d,p),p.draw(r,h.TRIANGLES,E,t7.disabled,r.colorModeForRenderPass(),tj.backCW,v,"skyboxGradient",a.skyboxGeometry.vertexBuffer,a.skyboxGeometry.indexBuffer,a.skyboxGeometry.segment))},custom:function(r,n,a,o){let s=r.context,l=a.implementation;if(!r.transform.projection.unsupportedLayers||!r.transform.projection.unsupportedLayers.includes("custom")||r.terrain&&(r.terrain.renderingToTexture||"offscreen"===r.renderPass)&&a.isDraped(n)){if("offscreen"===r.renderPass){let n=l.prerender;if(n){if(r.setCustomLayerDefaults(),s.setColorMode(r.colorModeForRenderPass()),"globe"===r.transform.projection.name){let a=r.transform.pointMerc;n.call(l,s.gl,r.transform.customLayerMatrix(),r.transform.getProjection(),r.transform.globeToMercatorMatrix(),i.dm(r.transform.zoom),[a.x,a.y],r.transform.pixelsPerMeterRatio)}else n.call(l,s.gl,r.transform.customLayerMatrix());s.setDirty(),r.setBaseState()}}else if("translucent"===r.renderPass){if(r.terrain&&r.terrain.renderingToTexture){let i=l.renderToTile;if(i){let n=o[0].canonical,a={x:n.x+o[0].wrap*(l.wrapTileId?0:1<<n.z),y:n.y,z:n.z};s.setDepthMode(tz.disabled),s.setStencilMode(t7.disabled),s.setColorMode(r.colorModeForRenderPass()),r.setCustomLayerDefaults();let u=s.gl;"mrt-fallback"===r.emissiveMode&&u.drawBuffers([u.COLOR_ATTACHMENT0]),i.call(l,s.gl,a),"mrt-fallback"===r.emissiveMode&&u.drawBuffers([u.COLOR_ATTACHMENT0,u.COLOR_ATTACHMENT1]),s.setDirty(),r.setBaseState()}return}r.setCustomLayerDefaults(),s.setColorMode(r.colorModeForRenderPass()),s.setStencilMode(t7.disabled);let n="3d"===l.renderingMode?new tz(r.context.gl.LEQUAL,tz.ReadWrite,r.depthRangeFor3D):r.depthModeForSublayer(0,tz.ReadOnly);if(s.setDepthMode(n),"globe"===r.transform.projection.name){let n=r.transform.pointMerc;l.render(s.gl,r.transform.customLayerMatrix(),r.transform.getProjection(),r.transform.globeToMercatorMatrix(),i.dm(r.transform.zoom),[n.x,n.y],r.transform.pixelsPerMeterRatio)}else l.render(s.gl,r.transform.customLayerMatrix());s.setDirty(),r.setBaseState(),s.bindFramebuffer.set(null)}}else i.f_("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")}},sa={line:function(i,r,n){if(i.hasElevatedBuckets=!1,i.hasNonElevatedBuckets=!1,void 0!==i._unevaluatedLayout.getValue("line-elevation-reference")||void 0!==i._unevaluatedLayout.getValue("line-z-offset")){if(r)for(let n of r.getVisibleCoordinates()){let a=r.getTile(n).getBucket(i);if(a&&("none"!==a.elevationType?i.hasElevatedBuckets=!0:i.hasNonElevatedBuckets=!0,i.hasElevatedBuckets&&i.hasNonElevatedBuckets))break}}else i.hasNonElevatedBuckets=!0},raster:function(i,r,n){let a=r.getSource();if(!(a instanceof iH&&a.loaded()))return;let o=i.sourceLayer||a.rasterLayerIds&&a.rasterLayerIds[0];if(!o)return;let s=i.paint.get("raster-array-band")||a.getInitialBand(o);if(null!=s)for(let n of r.getIds().map(i=>r.getTileByID(i)))n.updateNeeded(i.id,s)&&a.prepareTile(n,o,i.id,s)}};class so{constructor(r,n,a,o,s){this.context=new ok(r,n),this.transform=a,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.frcCoverageSnapshot=null,this.frcCoverageFadeRange=null,this.frcCoverageSourceLayers=[],this.frcCoverageRenderer=r1?new r1:null,this._debugParams={averageFPS:0,fpsHistory:[],fpsWindow:30,dt:0,timeStamp:i.co.now(),continousRedraw:!1,enabledLayers:{},buildingsShowNormals:!1,buildingsDrawGroundAO:!0,buildingsDrawShadowPass:!0,buildingsDrawTranslucentPass:!0,showTerrainProxyTiles:!1,terrainSortTilesHiZFirst:!0,terrainDisableRenderCache:!1,forceEnablePrecipitation:!1,overrideSnowParams:!1,snowParamsOverride:null,snowRevealParamsOverride:null,snowVignetteParam
112sOverride:null,overrideRainParams:!1,rainParamsOverride:null,rainRevealParamsOverride:null,rainVignetteParamsOverride:null,overrideStarsParams:!1,starsParamsOverride:null,show3DModelFootprints:!1,showElevationIdDebug:!1,lodSwitchDistance:5e3,lodSwitchFadeDuration:.5},this.occlusionParams=new sr,this.setup(),this.numSublayers=rR.maxUnderzooming+rR.maxOverzooming+1,this.depthEpsilon=1/65536,this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._shadowCullCache=null,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new i.aF,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new ig(this),this._wireframeDebugCache=new si,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0,this.layersWithOcclusionOpacity=[];const l=new i.ay({width:1,height:1},Uint8Array.of(0,0,0,0));this.emptyDepthTexture=new i.a_(this.context,l,r.RGBA8),this._clippingActiveLastFrame=!1,this.scaleFactor=o,this.maxFrontCutoffRawStart=0,this.worldview=s,this._forceEmissiveMode=!1,this.emissiveMode="constant"}updateTerrain(i,r){let n=!!i&&!!i.terrain&&this.transform.projection.supportsTerrain;if(!(n||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new oo(this,i));let a=this._terrain;this.transform.elevation=n?a:null,a.update(i,this.transform,r),this.transform.elevation&&!a.enabled&&(this.transform.elevation=null)}_updateFog(i){let r=i.fog;if(!r||"globe"===this.transform.projection.name||1>r.getOpacity(this.transform.pitch)||.03>r.properties.get("horizon-blend"))return void(this.transform.fogCullDistSq=null);let[n,a]=r.getRangeForProjection();if(n>a)return void(this.transform.fogCullDistSq=null);let o=n+.78*(a-n);this.transform.fogCullDistSq=o*o}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(i){i&&!this._terrain&&(this._terrain=new oo(this,this.style)),this._forceTerrainMode=i}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(r,n){if(this.width=r*i.co.devicePixelRatio,this.height=n*i.co.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let i of this.style.order)this.style._mergedLayers[i].resize()}setup(){let r=this.context,n=new i.aQ;n.emplaceBack(0,0),n.emplaceBack(i.r,0),n.emplaceBack(0,i.r),n.emplaceBack(i.r,i.r),this.tileExtentBuffer=r.createVertexBuffer(n,i.eQ.members),this.tileExtentSegments=i.aJ.simpleSegment(0,0,4,2);let a=new i.aQ;a.emplaceBack(0,0),a.emplaceBack(i.r,0),a.emplaceBack(0,i.r),a.emplaceBack(i.r,i.r),this.debugBuffer=r.createVertexBuffer(a,i.eQ.members),this.debugSegments=i.aJ.simpleSegment(0,0,4,5);let o=new i.aQ;o.emplaceBack(-1,-1),o.emplaceBack(1,-1),o.emplaceBack(-1,1),o.emplaceBack(1,1),this.viewportBuffer=r.createVertexBuffer(o,i.eQ.members),this.viewportSegments=i.aJ.simpleSegment(0,0,4,2);let s=new i.aP;s.emplaceBack(0,0,0,0),s.emplaceBack(i.r,0,i.r,0),s.emplaceBack(0,i.r,0,i.r),s.emplaceBack(i.r,i.r,i.r,i.r),this.mercatorBoundsBuffer=r.createVertexBuffer(s,i.bt.members),this.mercatorBoundsSegments=i.aJ.simpleSegment(0,0,4,2);let l=new i.aT;l.emplaceBack(0,1,2),l.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=r.createIndexBuffer(l);let u=new i.aM;for(let i of[0,1,3,2,0])u.emplaceBack(i);this.debugIndexBuffer=r.createIndexBuffer(u),this.emptyTexture=new i.a_(r,new i.ay({width:1,height:1},Uint8Array.of(0,0,0,0)),r.gl.RGBA8),this.identityMat=i.bT();let c=this.context.gl;this.stencilClearMode=new t7({func:c.ALWAYS,mask:0},0,255,c.ZERO,c.ZERO,c.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(i){return i._makeTileBoundsBuffers(this.context,this.transform.projection),i._tileBoundsBuffer?{tileBoundsBuffer:i._tileBoundsBuffer,tileBoundsIndexBuffer:i._tileBoundsIndexBuffer,tileBoundsSegments:i._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){let i=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,i.TRIANGLES,tz.disabled,this.stencilClearMode,ie.disabled,tj.disabled,rP(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(i,r,n){if(!r||this.currentStencilSource===r.id||!i.isTileClipped()||!n||0===n.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let i=!1;for(let r of n)if(void 0===this._tileClippingMaskIDs[r.key]){i=!0;break}if(!i)return}this.currentStencilSource=r.id;let a=this.context,o=a.gl;this.nextStencilID+n.length>256&&this.clearStencil(),a.setColorMode(ie.disabled),a.setDepthMode(tz.disabled);let s=this.getOrCreateProgram("clippingMask");for(let i of(this._tileClippingMaskIDs={},n)){let n=r.getTile(i),a=this._tileClippingMaskIDs[i.key]=this.nextStencilID++,{tileBoundsBuffer:l,tileBoundsIndexBuffer:u,tileBoundsSegments:c}=this.getTileBoundsBuffers(n);s.draw(this,o.TRIANGLES,tz.disabled,new t7({func:o.ALWAYS,mask:0},a,255,o.KEEP,o.KEEP,o.REPLACE),ie.disabled,tj.disabled,rP(i.projMatrix),"$clipping",l,u,c)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let i=this.nextStencilID++,r=this.context.gl;return new t7({func:r.NOTEQUAL,mask:255},i,255,r.KEEP,r.KEEP,r.REPLACE)}stencilModeForClipping(i){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(i);let r=this.context.gl;return new t7({func:r.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,r.KEEP,r.KEEP,r.REPLACE)}stencilConfigForOverlap(i){let r=this.context.gl,n=i.sort((i,r)=>
112r.overscaledZ-i.overscaledZ),a=n.at(-1).overscaledZ,o=n[0].overscaledZ-a+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();let i={};for(let n=0;n<o;n++)i[n+a]=new t7({func:r.GEQUAL,mask:255},n+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=o,[i,n]}return[{[a]:t7.disabled},n]}colorModeForRenderPass(){let r=this.context.gl;if(this._showOverdrawInspector){let n=1/8;return new ie([r.CONSTANT_COLOR,r.ONE,r.CONSTANT_COLOR,r.ONE],new i.i(n,n,n,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?ie.unblended:ie.alphaBlended}colorModeForDrapableLayerRenderPass(r){let n=this.context.gl;return this.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture&&"translucent"===this.renderPass?null!=r&&"mrt-fallback"!==this.emissiveMode||"constant"===this.emissiveMode?new ie([n.ONE,n.ONE_MINUS_SRC_ALPHA,n.CONSTANT_ALPHA,n.ONE_MINUS_SRC_ALPHA],new i.i(0,0,0,null!=r?r:0),[!0,!0,!0,!0]):"dual-source-blending"===this.emissiveMode?new ie([n.ONE,n.ONE_MINUS_SRC_ALPHA,this.context.extBlendFuncExtended.SRC1_ALPHA_WEBGL,n.ONE_MINUS_SRC_ALPHA],i.i.transparent,[!0,!0,!0,!0]):this.colorModeForRenderPass():this.colorModeForRenderPass()}depthModeForSublayer(i,r,n,a=!1){if(this.depthOcclusion)return new tz(this.context.gl.GREATER,tz.ReadOnly,this.depthRangeFor3D);if(!this.opaquePassEnabledForLayer()&&!a)return tz.disabled;let o=1-((1+this.currentLayer)*this.numSublayers+i)*this.depthEpsilon;return new tz(n||this.context.gl.LEQUAL,r,[o,o])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}blitDepth(){let r=this.context.gl,n=Math.ceil(this.width),a=Math.ceil(this.height),o=this.context.bindFramebuffer.get(),s=r.getParameter(r.TEXTURE_BINDING_2D);this.depthFBO&&this.depthFBO.width===n&&this.depthFBO.height===a||(this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),0!==n&&0!==a&&(this.depthFBO=new oI(this.context,n,a,0,"texture"),this.depthTexture=new i.a_(this.context,{width:n,height:a,data:null},r.DEPTH24_STENCIL8),this.depthFBO.depthAttachment.set(this.depthTexture.texture))),this.context.bindFramebuffer.set(o),r.bindTexture(r.TEXTURE_2D,s),this.depthFBO&&(r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,this.depthFBO.framebuffer),r.blitFramebuffer(0,0,n,a,0,0,n,a,r.DEPTH_BUFFER_BIT,r.NEAREST),r.bindFramebuffer(r.FRAMEBUFFER,this.context.bindFramebuffer.current))}render(r,n){var a,o;let s,l;this.context.sweepPendingPrograms(),this._wireframeDebugCache.update(this.frameCounter),this.style=r,this.options=n,this.frcCoverageSnapshot&&!this.frcCoverageSnapshot.empty()&&(!this.frcCoverageRenderer&&r1&&(this.frcCoverageRenderer=new r1),this.frcCoverageRenderer&&this.frcCoverageRenderer.update(this.context,this.frcCoverageSnapshot.tiles));let u=this.style._mergedLayers,c=!(!this.terrain||!this.terrain.enabled),d=()=>this.style._getOrder(c),h=d(),f=!1,p=!1,m=null,g=0,_=!1;for(let i of h){let r=u[i];"none"!==r.visibility&&("circle"===r.type?f=!0:"building"===r.type?(m=r,++g):"symbol"===r.type&&(r.hasOcclusionOpacityProperties?p=!0:f=!0))}this.updateEmissiveMode();let y=h.map(i=>u[i]),v=this.style._mergedSourceCaches;for(let n in this.imageManager=r.imageManager,this.modelManager=r.modelManager,this.symbolFadeChange=r.placement.symbolFadeChange(i.co.now()),this.imageManager.beginFrame(),v){let i=v[n];i.used&&(i.prepare(this.context),i.getSource().usedInConflation&&++g)}let x=!1;for(let i of y)i.isHidden(this.transform.zoom)||("clip"===i.type&&(x=!0),this.prepareLayer(i));let b={},w={},T={},E={},S={};for(let i in v){let r=v[i];b[i]=r.getVisibleCoordinates(),w[i]=b[i].slice().reverse(),T[i]=r.getVisibleCoordinates(!0).reverse(),E[i]=r.getShadowCasterCoordinates(),S[i]=r.sortCoordinatesByDistance(b[i])}let A=i=>{let r=this.style.getLayerSourceCache(i);return r&&r.used?r.getSource():null};if(g||x||this._clippingActiveLastFrame){let r=[],n=[],a=0;for(let i of y)this.isSourceForClippingOrConflation(i,A(i))&&(r.push(i),n.push(a)),a++;if(r&&(x||r.length>1)||this._clippingActiveLastFrame){x=!1;let a=[];for(let o=0;o<r.length;o++){let s=r[o],l=n[o],u=this.style.getLayerSourceCache(s);if(!u||!u.used||!u.getSource().usedInConflation&&"clip"!==s.type&&"building"!==s.type)continue;let c=i.aE,d=i.a8.None,h=[],f=!0;if("building"===s.type)c=i.aD;else if("clip"===s.type)if(c=l,s.isHidden(this.transform.zoom))f=!1;else{if(!s.layout){f=!1;continue}
112for(let r of s.layout.get("clip-layer-types"))d|="model"===r?i.a8.Model:"symbol"===r?i.a8.Symbol:i.a8.FillExtrusion;for(let r of s.layout.get("clip-layer-scope"))h.push(i.ea(r,s.scope));x=!0}f&&a.push({layer:s.fqid,cache:u,order:c,clipMask:d,clipScope:h})}this.replacementSource.setSources(a),_=!0}}this._clippingActiveLastFrame=x,_||this.replacementSource.clear(),this.conflationActive=_,this.minCutoffZoom=0,this.longestCutoffRange=0,this.maxFrontCutoffRawStart=0,this.opaquePassCutoff=1/0,this._lastOcclusionLayer=-1,this.layersWithOcclusionOpacity=[];for(let i=0;i<y.length;i++){let r=y[i];if("none"===r.visibility)continue;let n=r.cutoffRange();if(this.longestCutoffRange=Math.max(n,this.longestCutoffRange),n>0){let i=A(r);i&&(this.minCutoffZoom=Math.max(i.minzoom,this.minCutoffZoom)),r.minzoom&&(this.minCutoffZoom=Math.max(r.minzoom,this.minCutoffZoom))}r.is3D(c)&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=i),this._lastOcclusionLayer=i)}let C=this.style&&this.style.fog;C?(this._fogVisible=0!==C.getOpacity(this.transform.pitch),this._fogVisible&&"globe"!==this.transform.projection.name&&(this._fogVisible=C.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(T),this.opaquePassCutoff=0,y=(h=d()).map(i=>u[i]));let I=this._shadowRenderer;if(I)for(let i in I.updateShadowParameters(this.transform,this.style.directionalLight),v)for(let r of b[i]){let i={min:0,max:0};this.terrain&&(i=this.terrain.getMinMaxForTile(r)||i),I.addShadowReceiver(r.toUnwrapped(),i.min,i.max)}"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new i.T(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new o7),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0);let k=!(!this.style||!this.style.snow),R=!(!this.style||!this.style.rain);if(k&&!this._snow&&rV&&(this._snow=new rV),!k&&this._snow&&(this._snow.destroy(),delete this._snow),R&&!this._rain&&rU&&(this._rain=new rU),!R&&this._rain&&(this._rain.destroy(),delete this._rain),this._snow&&this._snow.update(this),this._rain&&this._rain.update(this),m){this.buildingTileBorderManager||(this.buildingTileBorderManager=new se);let i=this.style.getLayerSourceCache(m);this.buildingTileBorderManager.updateBorders(i,m)}if(!eu.has(this.context.gl))return;for(let i of(this.renderPass="offscreen",y)){let n=r.getLayerSourceCache(i);if(!i.hasOffscreenPass()||i.isHidden(this.transform.zoom))continue;let a=n?w[n.id]:void 0;("custom"===i.type||"raster"===i.type||"raster-particle"===i.type||i.isSky()||a&&a.length)&&this.renderLayer(this,n,i,a)}this.depthRangeFor3D=[0,1-(y.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,E)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);let M="globe"===this.transform.projection.name||this.transform.isHorizonVisible(),L=(()=>{if(n.showOverdrawInspector)return i.i.black;let r=this.style.fog;if(r&&this.transform.projection.supportsFog){let n=this.style.getLut(r.scope);if(!M){let a="none"===r.properties.get("color-use-theme"),o=r.properties.get("color").toNonPremultipliedRenderColor(a?null:n).toArray01();return new i.i(...o)}if(M){let a="none"===r.properties.get("space-color-use-theme"),o=r.properties.get("space-color").toNonPremultipliedRenderColor(a?null:n).toArray01();return new i.i(...o)}}return i.i.transparent})();if(this.context.clear({color:L,depth:1}),this.clearStencil(),this._showOverdrawInspector=n.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&M&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=h.length-1;this.currentLayer>=0;this.currentLayer--){let i=y[this.currentLayer],n=r.getLayerSourceCache(i);if(i.isSky())continue;let a=n?(i.is3D(c)?S:w)[n.id]:void 0;this._renderTileClippingMasks(i,n,a),this.renderLayer(this,n,i,a)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&M&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||i.dm(this.transform.zoom)>0)&&("globe"===this.transform.projection.name||this.transform.isH
112orizonVisible()))for(this.currentLayer=0;this.currentLayer<h.length;this.currentLayer++){let i=y[this.currentLayer],n=r.getLayerSourceCache(i);i.isSky()&&this.renderLayer(this,n,i,n?w[n.id]:void 0)}function P(i,r){let n;return r&&(n=("symbol"===i.type?T:i.is3D(c)?S:w)[r.id]),n}if(this.renderPass="translucent","globe"===this.transform.projection.name){for(this.renderElevatedRasterBackface=!0,this.currentLayer=0;this.currentLayer<h.length;){let i=y[this.currentLayer];if("raster"===i.type||"raster-particle"===i.type){let n=r.getLayerSourceCache(i);this.renderLayer(this,n,i,P(i,n))}++this.currentLayer}this.renderElevatedRasterBackface=!1}this.currentLayer=0,this.firstLightBeamLayer=Number.MAX_SAFE_INTEGER;let O=I?I.getGroundShadowLayerIndex():-1,D=!1,F=-1;for(let i=0;i<h.length;++i){let r=y[i];r.isHidden(this.transform.zoom)||r.is3D(c)&&(F=i)}p&&-1===F&&(f=!0);let N=!1;for(;this.currentLayer<h.length;){let i=y[this.currentLayer],n=r.getLayerSourceCache(i);if(i.isSky())++this.currentLayer;else if(this.terrain&&this.style.isLayerDraped(i)){if(i.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer),this._lastOcclusionLayer=Math.max(this.currentLayer,this._lastOcclusionLayer)}else{if(!N&&i.is3D(c)&&!c){let i=this.currentLayer,r=i=>{for(this.currentLayer=0;this.currentLayer<y.length;this.currentLayer++){let r=y[this.currentLayer];if("fill"===r.type&&rW){let n=this.style.getLayerSourceCache(r);rW(this,n,r,P(r,n),i)}}};r("initialize"),r("reset"),this.currentLayer=i,N=!0}if(f&&!D&&this.terrain&&!this.transform.isOrthographic&&(D=!0,this.blitDepth()),p&&-1!==F&&this.currentLayer===F+1&&!this.transform.isOrthographic&&this.blitDepth(),this.terrain||this._renderTileClippingMasks(i,n,n?b[n.id]:void 0),this.renderLayer(this,n,i,P(i,n)),!this.terrain&&I&&this.currentLayer===O){{this.clearStencil(),this.resetStencilClippingMasks();let i=this.currentLayer;for(this.currentLayer=0;this.currentLayer<y.length;this.currentLayer++){let i=y[this.currentLayer];if("fill"===i.type&&rY){let r=this.style.getLayerSourceCache(i);rY(this,r,i,P(i,r))}}this.currentLayer=i}if(I.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer){let i=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=i;this.currentLayer++){let i=y[this.currentLayer];if(!i.hasLightBeamPass())continue;let n=r.getLayerSourceCache(i);this.renderLayer(this,n,i,n?w[n.id]:void 0)}this.currentLayer=i,this.renderPass="translucent"}}if(this.currentLayer>=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){let i=this.currentLayer;for(let i of(this.depthOcclusion=!0,this.layersWithOcclusionOpacity)){this.currentLayer=i;let n=y[this.currentLayer],a=r.getLayerSourceCache(n),o=a?w[a.id]:void 0;this.terrain||this._renderTileClippingMasks(n,a,a?b[a.id]:void 0),this.renderLayer(this,a,n,o)}this.depthOcclusion=!1,this.currentLayer=i,this.renderPass="translucent",this.layersWithOcclusionOpacity=[]}++this.currentLayer}}if(this.terrain&&this.terrain.postRender(),this._snow&&this._snow.draw(this),this._rain&&this._rain.draw(this),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let n=null;y.forEach(i=>{let a=r.getLayerSourceCache(i);a&&!i.isHidden(this.transform.zoom)&&a.getVisibleCoordinates().length&&(!n||n.getSource().maxzoom<a.getSource().maxzoom)&&(n=a)}),n&&this.options.showTileBoundaries&&function(r,n,a,o,s){for(let l=0;l<a.length;l++)!function(r,n,a,o,s){let l=r.context,u=r.transform,c=l.gl,d="globe"===u.projection.name,h=i.bJ(a.projMatrix);if(d&&i.dm(u.zoom)>0){let r=i.fP(a.canonical,u),n=i.de(r);h=i.er(new Float32Array(16),u.globeMatrix,n),i.er(h,u.projMatrix,h)}let f=i.bT();f[12]+=0/(i.co.devicePixelRatio*u.width),f[13]+=0/(i.co.devicePixelRatio*u.height),i.er(h,f,h);let p=r.getOrCreateProgram("debug",{defines:d?["PROJECTION_GLOBE_VIEW"]:[]}),m=n.getTileByID(a.key);r.terrain&&r.terrain.setupElevationDraw(m,p);let g=tz.disabled,_=t7.disabled,y=r.colorModeForRenderPass(),v="$debug";l.activeTexture.set(c.TEXTURE0),r.emptyTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),d?m._makeGlobeTileDebugBuffers(r.context,u):m._makeDebugTileBoundsBuffers(r.context,u.projection);let x=m._tileDebugBuffer||r.debugBuffer,b=m._tileDebugIndexBuffer||r.debugIndexBuffer,w=m._tileDebugSegments||r.debugSegments;if(p.draw(r,c.LINE_STRIP,g,_,y,tj.disabled,nt(h,o.toPremultipliedRenderColor(null)),v,x,b,w,null,null,null,[m._globeTileDebugBorderBuffer]),s){var T;let i,n,o,s=m.latestRawTileData,l=Math.floor((s&&s.byteLength||0)/1024),u=a.canonical.toString();a.overscaledZ!==a.canonical.z&&(u+=` => ${a.overscaledZ}`),u+=` ${m.state}`,u+=` ${l}kb`,T=u,r.initDebugOverlayCanvas(),i=r.debugOverlayCanvas,n=r.context.gl,(o=r.debugOverlayCanvas.getContext("2d")).clearRect(0,0,i.width,i.height),o.shadowColor="white",o.shadowBlur=2,o.lineWidth=1.5,o.strokeStyle="white",o.textBaseline="top",o.font="bold 36px Open Sans, sans-serif",o.fillText(T,5,5),o.strokeText(T,5,5),r.debugOverlayTexture.update(i),r.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}let E=512/Math.min(n.getTile(a).tileSize,512)*(a.overscaledZ/u.zoom)*.5,S=m._tileDebugTextBuffer||r.debugBuffer,A=m._tileDebugTextIndexBuffer||r.quadTriangleIndexBuffer,C=m._tileDebugTextSegments||r.debugSegments;p.draw(r,c.TRIANGLES,g,_,ie.alphaBlended,tj.disabled,nt(h,i.i.transparent.toPremultipliedRenderColor(null),E),v,S,A,C,null,null,null,[m._globeTileDebugTextBuffer])}(r,n,a[l],o,s)}(this,n,n.getVisibleCoordinates(),i.i.red,this.options.showParseStatus)}this.options.showPadding&&(s=this.transform.padding,oJ(this,this.transform.height-(s.top||0),3,oY),oJ(this,s.bottom||0,3,oZ),o1(this,s.left||0,3,oK),o1(this,this.transform.width-(s.right||0),3,oX),l=this.transform.centerPoint,a=l.x,o0(this,a-1,(o=this.transform.height-l.y)-10,2,20,oQ),o0(this,a-10,o-1,20,2,oQ)),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(performance.now()),this.saveC
112anvasCopy()),_||(this.conflationActive=!1)}prepareLayer(i){this.gpuTimingStart(i);let{unsupportedLayers:r}=this.transform.projection,n=!r||!r.includes(i.type);if(sa[i.type]&&(n||this.terrain&&"custom"===i.type)){let r=this.style.getLayerSourceCache(i);sa[i.type](i,r,this)}this.gpuTimingEnd()}renderLayer(i,r,n,a){n.isHidden(this.transform.zoom)||("background"===n.type||"sky"===n.type||"custom"===n.type||"model"===n.type||"raster"===n.type||"raster-particle"===n.type||a&&a.length)&&(this.id=n.id,this.gpuTimingStart(n),(!i.transform.projection.unsupportedLayers||!i.transform.projection.unsupportedLayers.includes(n.type)||i.terrain&&"custom"===n.type)&&"clip"!==n.type&&"slot"!==n.type&&sn[n.type]&&sn[n.type](i,r,n,a,this.style.placement.variableOffsets,this.options.isInitialLoad),sn[n.type]||(n.mayUse("HD")&&async function(){await r8(),Object.assign(sn,{building:rj,"raster-particle":rz}),Object.assign(sa,{"raster-particle":rB})}(),n.mayUse("Standard")&&async function(){await nS(),Object.assign(sn,{model:nE.drawModels}),Object.assign(sa,{model:nE.prepare})}()),this.gpuTimingEnd())}gpuTimingStart(i){if(!this.options.gpuTiming)return;let r=this.context.extTimerQuery,n=this.context.gl,a=this.gpuTimers[i.id];a||(a=this.gpuTimers[i.id]={calls:0,cpuTime:0,query:n.createQuery()}),a.calls++,n.beginQuery(r.TIME_ELAPSED_EXT,a.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){let i=this.context.extTimerQuery,r=this.context.gl,n=r.createQuery();this.deferredRenderGpuTimeQueries.push(n),r.beginQuery(i.TIME_ELAPSED_EXT,n)}}gpuTimingDeferredRenderEnd(){this.options.gpuTimingDeferredRender&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}gpuTimingEnd(){this.options.gpuTiming&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}collectGpuTimers(){let i=this.gpuTimers;return this.gpuTimers={},i}collectDeferredRenderGpuQueries(){let i=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],i}queryGpuTimers(i){let r={};for(let n in i){let a=i[n],o=this.context.extTimerQuery,s=o.getQueryParameter(a.query,this.context.gl.QUERY_RESULT)/1e6;o.deleteQueryEXT(a.query),r[n]=s}return r}queryGpuTimeDeferredRender(i){if(!this.options.gpuTimingDeferredRender)return 0;let r=this.context.gl,n=0;for(let a of i)n+=r.getQueryParameter(a,r.QUERY_RESULT)/1e6,r.deleteQuery(a);return n}translatePosMatrix(r,n,a,o,s){if(!a[0]&&!a[1])return r;let l=s?"map"===o?this.transform.angle:0:"viewport"===o?-this.transform.angle:0;if(l){let i=Math.sin(l),r=Math.cos(l);a=[a[0]*r-a[1]*i,a[0]*i+a[1]*r]}let u=[s?a[0]:i.eG(n,a[0],this.transform.zoom),s?a[1]:i.eG(n,a[1],this.transform.zoom),0],c=new Float32Array(16);return i.fQ(c,r,u),c}saveTileTexture(i){if(i.context!==this.context)return;let r=i.size[0],n=this._tileTextures[r];n?n.push(i):this._tileTextures[r]=[i]}getTileTexture(i){let r=this._tileTextures[i];return r&&r.length>0?r.pop():null}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return null!=this.context.extTextureFloatLinear}currentGlobalDefines(i,r,n,a,o){let s=void 0===n?this.terrain&&this.terrain.renderingToTexture:n,l=void 0===a?this.terrainRenderModeElevated():a,u=void 0===o?"globe"===this.transform.projection.name:o,c=[];return this.style&&this.style.enable3dLights()&&("globeRaster"===i||"terrainRaster"===i?(c.push("LIGHTING_3D_MODE"),c.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):s||c.push("LIGHTING_3D_MODE")),l&&(c.push("TERRAIN"),this.linearFloatFilteringSupported()&&c.push("TERRAIN_DEM_FLOAT_FORMAT")),u&&c.push("GLOBE"),this._fogVisible&&!s&&(void 0===r||r)&&c.push("FOG"),s&&c.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&c.push("OVERDRAW_INSPECTOR"),c}getOrCreateProgram(i,r){this.cache=this.cache||{};let{defines:n,config:a,overrideFog:o,overrideRtt:s,overrideTerrain:l,overrideGlobe:u,precompiled:c}=r||{},d=this.currentGlobalDefines(i,o,s,l,u).concat(n||[]),h=this.getShaderSource(i),f=rG,p=nE.programUniforms,m=oE[i]||f&&f[i]||p&&p[i],g=ou.cacheKey(h,i,d,a);return this.cache[g]||(this.cache[g]=new ou(this.context,i,h,a,m,d,c)),this.cache[g]}getShaderSource(i){let r=rH,n=nE.shaders;return rl[i]||r&&r[i]||n&&n[i]}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(){let i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new i.a_(this.context,this.debugOverlayCanvas,this.context.gl.RGBA8))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.de
112stroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy(),this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),this.emptyDepthTexture&&this.emptyDepthTexture.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(r,n){if(this.style.enable3dLights()){let s=this.style.directionalLight,l=this.style.ambientLight;if(s&&l){var a,o;let u,c,d,h,f,p,m,g,_,y,v,x,b,w,T,E,S,A=(a=this.style,u=s.properties.get("direction"),c="none"===s.properties.get("color-use-theme"),d=s.properties.get("color").toNonPremultipliedRenderColor(c?null:a.getLut(s.scope)).toArray01(),h=s.properties.get("intensity"),f="none"===l.properties.get("color-use-theme"),p=l.properties.get("color").toNonPremultipliedRenderColor(f?null:a.getLut(l.scope)).toArray01(),m=l.properties.get("intensity"),g=[u.x,u.y,u.z],_=i.f8(p,m),{u_lighting_ambient_color:_,u_lighting_directional_dir:g,u_lighting_directional_color:y=i.f8(d,h),u_ground_radiance:(o=[0,0,1],v=i.c7(o,g),x=1-.3*Math.min(i.c7(y,[.2126,.7152,.0722]),1),b=i.dY(x,1,Math.min(v+1,1)),w=i.dY(.92,1,Math.asin(i.bG(o[2],-1,1))/Math.PI+.5)*b,T=[0,0,0],i.fa(T,_.slice(0,3),w),E=[0,0,0],i.fa(E,y.slice(0,3),g[2]),S=[0,0,0],i.bj(S,T,E),i.e4(S))});n.setLightsUniformValues(r,A)}}}uploadCommonUniforms(r,n,a,o,s){if(this.uploadCommonLightUniforms(r,n),this.terrain&&this.terrain.renderingToTexture)return;let l=this.style.fog;if(l){let s=l.getOpacity(this.transform.pitch),u=((r,n,a,o,s,l,u,c,d,h,f,p)=>{let m=r.transform,g="none"===n.properties.get("color-use-theme"),_=n.properties.get("color").toNonPremultipliedRenderColor(g?null:r.style.getLut(n.scope)).toArray01();_[3]=o;let y=r.frameCounter/1e3%1,[v,x]=n.properties.get("vertical-range");return{u_fog_matrix:a?m.calculateFogTileMatrix(a):p||r.identityMat,u_fog_range:n.getRangeForProjection(),u_fog_color:_,u_fog_horizon_blend:n.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(v,x),x],u_fog_temporal_offset:y,u_frustum_tl:s,u_frustum_tr:l,u_frustum_br:u,u_frustum_bl:c,u_globe_pos:d,u_globe_radius:h,u_viewport:f,u_globe_transition:i.dm(m.zoom),u_is_globe:+("globe"===m.projection.name)}})(this,l,a,s,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*i.co.devicePixelRatio,this.transform.height*i.co.devicePixelRatio],o);n.setFogUniformValues(r,u)}s&&n.setCutoffUniformValues(r,s.uniformValues)}setTileLoadedFlag(i){this.tileLoaded=i}saveCanvasCopy(){let i=this.canvasCopy();i&&(this.frameCopies.push(i),this.tileLoaded=!1)}canvasCopy(){let i=this.context.gl,r=i.createTexture();return i.bindTexture(i.TEXTURE_2D,r),i.copyTexImage2D(i.TEXTURE_2D,0,i.RGBA,0,0,i.drawingBufferWidth,i.drawingBufferHeight,0),r}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;let i=this.style&&this.style.fog;return!!i&&0!==i.getOpacity(this.transform.pitch)}getBackgroundTiles(){let r=this._backgroundTiles,n=this._backgroundTiles={};for(let a of this.transform.coveringTiles({tileSize:512}))n[a.key]=r[a.key]||new i.b0(a,512,this.transform.tileZoom,this,void 0,this.worldview);return n}clearBackgroundTiles(){this._backgroundTiles={}}isSourceForClippingOrConflation(i,r){return!(!i.is3D(!(!this.terrain||!this.terrain.enabled))||"clip"!==i.type&&"building"!==i.type&&(i.minzoom&&i.minzoom>this.transform.zoom||(this.style._clipLayerPresent||"building"!==i.sourceLayer&&"procedural_buildings"!==i.sourceLayer)&&(!r||"batched-model"!==r.type)))}isTileAffectedByFog(i){if(!this.style||!this.style.fog)return!1;if("globe"===this.transform.projection.name)return!0;let r=this._cachedTileFogOpacities[i.key];return r||(this._cachedTileFogOpacities[i.key]=r=this.style.fog.getOpacityForTile(i)),r[0]>=.05||r[1]>=.05}setupDepthForOcclusion(i,r,n){var a;let o=this.context,s=o.gl,l=!!n;n||(n={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0}),o.activeTexture.set(s.TEXTURE3),i&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(s.NEAREST,s.CLAMP_TO_EDGE),n.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],n.u_depth_range_unpack=[2/((a=this.depthRangeFor3D)[1]-a[0]),-1-2*a[0]/(a[1]-a[0])],n.u_occluder_half_size=.5*this.occlusionParams.occluderSize,n.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.empty
112DepthTexture.bind(s.NEAREST,s.CLAMP_TO_EDGE),o.activeTexture.set(s.TEXTURE0),l||r.setTerrainUniformValues(o,n)}updateEmissiveMode(){if(this._forceEmissiveMode)return;let i=this.style.hasDataDrivenEmissiveStrength();this.emissiveMode=i?this.context.extBlendFuncExtended?"dual-source-blending":"mrt-fallback":"constant"}}function ss(i,r){let n=!1,a=null,o=()=>{a=null,n&&(i(),a=setTimeout(o,r),n=!1)};return()=>(n=!0,a||o(),a)}let sl=/(#.+)?$/;class su{constructor(r){this._hashName=r&&encodeURIComponent(r),i.bs(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=ss(this._updateHashUnthrottled.bind(this),300)}addTo(i){return this._map=i,window.addEventListener("hashchange",this._onHashChange,!1),i.on("moveend",this._updateHash),this}remove(){return this._map&&(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0),this}getHashString(){let i=this._map;if(!i)return"";let r=sc(i);if(this._hashName){let i=this._hashName,n=!1,a=location.hash.slice(1).split("&").map(a=>{let o=a.split("=")[0];return o===i?(n=!0,`${o}=${r}`):a}).filter(i=>i);return n||a.push(`${i}=${r}`),`#${a.join("&")}`}return`#${r}`}_getCurrentHash(){let i=location.hash.replace("#","");if(this._hashName){let r;return i.split("&").map(i=>i.split("=")).forEach(i=>{i[0]===this._hashName&&(r=i)}),(r&&r[1]||"").split("/")}return i.split("/")}_onHashChange(){let i=this._map;if(!i)return!1;let r=this._getCurrentHash();if(r.length>=3&&!r.some(i=>isNaN(Number(i)))){let n=i.dragRotate.isEnabled()&&i.touchZoomRotate.isEnabled()?+(r[3]||0):i.getBearing();return i.jumpTo({center:[+r[2],+r[1]],zoom:+r[0],bearing:n,pitch:+(r[4]||0)}),!0}return!1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(sl,this.getHashString()))}}function sc(i,r){let n=i.getCenter(),a=Math.round(100*i.getZoom())/100,o=Math.pow(10,Math.ceil((a*Math.LN2+Math.log(512/360/.5))/Math.LN10)),s=Math.round(n.lng*o)/o,l=Math.round(n.lat*o)/o,u=i.getBearing(),c=i.getPitch(),d=r?`/${s}/${l}/${a}`:`${a}/${l}/${s}`;return(u||c)&&(d+="/"+Math.round(10*u)/10),c&&(d+=`/${Math.round(c)}`),d}let sd={linearity:.3,easing:i.fV(0,0,.3,1)},sh=Object.assign({deceleration:2500,maxSpeed:1400},sd),sf=Object.assign({deceleration:20,maxSpeed:1400},sd),sp=Object.assign({deceleration:1e3,maxSpeed:360},sd),sm=Object.assign({deceleration:1e3,maxSpeed:90},sd);class sg{constructor(i){this._map=i,this.clear()}clear(){this._inertiaBuffer=[]}record(r){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:i.co.now(),settings:r})}_drainInertiaBuffer(){let r=this._inertiaBuffer,n=i.co.now();for(;r.length>0&&n-r[0].time>160;)r.shift()}_onMoveEnd(r){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;let n={zoom:0,bearing:0,pitch:0,pan:new i.au(0,0),pinchAround:void 0,around:void 0};for(let{settings:i}of this._inertiaBuffer)n.zoom+=i.zoomDelta||0,n.bearing+=i.bearingDelta||0,n.pitch+=i.pitchDelta||0,i.panDelta&&n.pan._add(i.panDelta),i.around&&(n.around=i.around),i.pinchAround&&(n.pinchAround=i.pinchAround);let a=this._inertiaBuffer.at(-1).time-this._inertiaBuffer[0].time,o={};if(n.pan.mag()){let i=sy(n.pan.mag(),a,Object.assign({},sh,r||{}));o.offset=n.pan.mult(i.amount/n.pan.mag()),o.center=this._map.transform.center,s_(o,i)}if(n.zoom){let i=sy(n.zoom,a,sf);o.zoom=this._map.transform.zoom+i.amount,s_(o,i)}if(n.bearing){let r=sy(n.bearing,a,sp);o.bearing=this._map.transform.bearing+i.bG(r.amount,-179,179),s_(o,r)}if(n.pitch){let i=sy(n.pitch,a,sm);o.pitch=this._map.transform.pitch+i.amount,s_(o,i)}if(o.zoom||o.bearing){let i=void 0===n.pinchAround?n.around:n.pinchAround;o.around=i?this._map.unproject(i):this._map.getCenter()}return this.clear(),o.noMoveStart=!0,o}}function s_(i,r){(!i.duration||i.duration<r.duration)&&(i.duration=r.duration,i.easing=r.easing)}function sy(r,n,a){let{maxSpeed:o,linearity:s,deceleration:l}=a,u=i.bG(r*s/(n/1e3),-o,o),c=Math.abs(u)/(l*s);return{easing:a.easing,duration:1e3*c,amount:c/2*u}}class sv extends i.x{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(i,r,n,a={}){const o=I(r.getCanvasContainer(),n),s=r.unproject(o);super(i,Object.assign({point:o,lngLat:s,originalEvent:n},a)),this._defaultPrevented=!1,this.target=r}}class sx extends i.x{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,n,a){const o="touchend"===r?a.changedTouches:a.touches,s=k(n.getCanvasContainer(),o),l=s.map(i=>n.unproject(i)),u=s.reduce((i,r,n,a)=>i.add(r.div(a.length)),new i.au(0,0));super(r,{points:s,point:u,lngLats:l,lngLat:n.unproject(u),originalEvent:a}),this._defaultPrevented=!1}}class sb extends i.x{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(i,r){super("wheel",{originalEvent:r}),this._defaultPrevented=!1}}class sw{constructor(i,r){this._map=i,this._clickTolerance=r.clickTolerance}reset(){this._mousedownPos=void 0}wheel(i){return this._firePreventable(new sb(this._map,i))}mousedown(i,r){return this._mousedownPos=r,this._firePreventable(new sv(i.type,this._map,i))}mouseup(i){this._map.fire(new sv(i.type,this._map,i))}preclick(i){let r=new MouseEvent("preclick",i);this._map.fire(new sv(r.type,this._map,r))}click(i,r){this._mousedownPos&&this._mousedownPos.dist(r)>=this._clickTolerance||(this.preclick(i),this._map.fire(new sv(i.type,this._map,i)))}dblclick(i){return this._firePreventable(new sv(i.type,this._map,i))}mouseover(i){this._map.fire(new sv(i.type,this._map,i))}mouseout(i){this._map.fire(new sv(i.type,this._map,i))}touchstart(i){return this._firePreventable(new sx(i.type,this._map,i))}touchmove(i){this._map.fire(new sx(i.type,this._map,i))}touchend(i){this._map.fire(new sx(i.type,this._map,i))}touchcancel(i){this._map.fire(new sx(i.type,this._map,i))}_firePreventable(i){if(this._map.fire(i),i.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class sT{constructor(i){this._map=i}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(i){this._map.fire(new sv(i.type,this._map,i))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new sv("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(i){this._delayContextMenu?this._contextMenuEvent=i:this._map.fire(new sv(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class sE{constructor(i,r){this._map=i,this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=r.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(i,r){this.isEnabled()&&i.shiftKey&&0===i.button&&(E(),this._startPos=this._lastPos=r,this._active=!0)}mousemoveWindow(i,r){if(!this._active)return;let n=this._startPos,a=this._lastPos;if(!n||!a||a.equals(r)||!this._box&&r.dist(n)<this._clickTolerance)return;this._lastPos=r,this._box||(this._box=x("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",i));let o=Math.min(n.x,r.x),s=Math.max(n.x,r.x),l=Math.min(n.y,r.y),u=Math.max(n.y,r.y);this._map._requestDomTask(()=>{this._box&&(this._box.style.transform=`translate(${o}px,${l}px)`,this._box.style.width=s-o+"px",this._box.style.height=u-l+"px")})}mouseupWindow(r,n){if(!this._active)return;let a=this._startPos;if(a&&0===r.button){if(this.reset(),C(),a.x!==n.x||a.y!==n.y)return this._map.fire(new i.x("boxzoomend",{originalEvent:r})),{cameraAnimation:i=>i.fitScreenCoordinates(a,n,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",r)}}keydown(i){this._active&&27===i.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",i))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),S(),delete this._startPos,delete this._lastPos}_fireEvent(r,n){return this._map.fire(new i.x(r,{originalEvent:n}))}}function sS(i,r){let n={};for(let a=0;a<i.length;a++)n[i[a].identifier]=r[a];return n}class sA{constructor(i){this.reset(),this.numTouches=i.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(r,n,a){(this.centroid||a.length>this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=r.timeStamp),a.length===this.numTouches&&(this.centroid=function(r){let n=new i.au(0,0);for(let i of r)n._add(i);return n.div(r.length)}(n),this.touches=sS(a,n)))}touchmove(i,r,n){if(this.aborted||!this.centroid)return;let a=sS(n,r);for(let i in this.touches){let r=a[i];(!r||r.dist(this.touches[i])>30)&&(this.aborted=!0)}}touchend(i,r,n){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){let i=!this.aborted&&this.centroid;if(this.reset(),i)return i}}}class sC{constructor(i){this.singleTap=new sA(i),this.numTaps=i.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(i,r,n){this.singleTap.touchstart(i,r,n)}touchmove(i,r,n){this.singleTap.touchmove(i,r,n)}touchend(i,r,n){let a=this.singleTap.touchend(i,r,n);if(a){let r=i.timeStamp-this.lastTime<500,n=!this.lastTap||30>this.lastTap.dist(a);if(r&&n||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=a,this.count===this.numTaps)return this.reset(),a}}}class sI{constructor(){this._zoomIn=new sC({numTouches:1,numTaps:2}),this._zoomOut=new sC({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(i,r,n){this._zoomIn.touchstart(i,r,n),this._zoomOut.touchstart(i,r,n)}touchmove(i,r,n){this._zoomIn.touchmove(i,r,n),this._zoomOut.touchmove(i,r,n)}touchend(i,r,n){let a=this._zoomIn.touchend(i,r,n),o=this._zoomOut.touchend(i,r,n);return a?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:r=>r.easeTo({duration:300,zoom:r.getZoom()+1,around:r.unproject(a)},{originalEvent:i})}):o?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:r=>r.easeTo({duration:300,zoom:r.getZoom()-1,around:r.unproject(o)},{originalEvent:i})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}let sk={0:1,2:2},sR={Control:"ctrlKey",Alt:"altKey",Shift:"shiftKey",Meta:"metaKey"};class sM{constructor(i){this.reset(),this._clickTolerance=i.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(i,r){return!1}_move(i,r){return{}}mousedown(i,r){if(this._lastPoint)return;let n=R(i);this._correctButton(i,n)&&(this._lastPoint=r,this._eventButton=n)}mousemoveWindow(i,r){let n=this._lastPoint;if(n){let a;if(i.preventDefault(),null!=this._eventButton&&(a=sk[this._eventButton],void 0===i.buttons||(i.buttons&a)!==a))this.reset();else if(this._moved||!(r.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=r,this._move(n,r)}}mouseupWindow(i){this._lastPoint&&R(i)===this._eventButton&&(this._moved&&C(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class sL extends sM{mousedown(i,r){super.mousedown(i,r),this._lastPoint&&(this._active=!0)}_correctButton(i,r){return 0===r&&!i.ctrlKey}_move(i,r){return{around:r,panDelta:r.sub(i)}}}class sP extends sM{constructor(i){super(i),this._pitchRotateKey=i.pitchRotateKey?sR[i.pitchRotateKey]:void 0}_correctButton(i,r){return this._pitchRotateKey?0===r&&i[this._pitchRotateKey]:0===r&&i.ctrlKey||2===r}_move(i,r){let n=.8*(r.x-i.x);if(n)return this._active=!0,{bearingDelta:n}}contextmenu(i){this._pitchRotateKey||i.preventDefault()}}class sO extends sM{constructor(i){super(i),this._pitchRotateKey=i.pitchRotateKey?sR[i.pitchRotateKey]:void 0}_correctButton(i,r){return this._pitchRotateKey?0===r&&i[this._pitchRotateKey]:0===r&&i.ctrlKey||2===r}_move(i,r){let n=-.5*(r.y-i.y);if(n)return this._active=!0,{pitchDelta:n}}contextmenu(i){this._pitchRotateKey||i.preventDefault()}}class sD{constructor(r,n){this._map=r,this._el=r.getCanvasContainer(),this._minTouches=1,this._clickTolerance=n.clickTolerance||1,this.reset(),i.bs(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new i.au(0,0)}touchstart(i,r,n){return this._calculateTransform(i,r,n)}touchmove(r,n,a){if(this._active&&!(a.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(1===a.length&&!i.dA())return void this._showTouchPanBlockerAlert();
112"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return r.cancelable&&r.preventDefault(),this._calculateTransform(r,n,a)}}touchend(i,r,n){this._calculateTransform(i,r,n),this._active&&n.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(r,n,a){a.length>0&&(this._active=!0);let o=sS(a,n),s=new i.au(0,0),l=new i.au(0,0),u=0;for(let i in o){let r=o[i],n=this._touches[i];n&&(s._add(r),l._add(r.sub(n)),u++,o[i]=r)}if(this._touches=o,u<this._minTouches||!l.mag())return;let c=l.div(u);return this._sum._add(c),this._sum.mag()<this._clickTolerance?void 0:{around:s.div(u),panDelta:c}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=x("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role")},500)}}class sF{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(i){}_move(i,r,n){return{}}touchstart(i,r,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([r[0],r[1]]))}touchmove(i,r,n){let a=this._firstTwoTouches;if(!a)return;i.preventDefault();let[o,s]=a,l=sN(n,r,o),u=sN(n,r,s);if(!l||!u)return;let c=this._aroundCenter?null:l.add(u).div(2);return this._move([l,u],c,i)}touchend(i,r,n){if(!this._firstTwoTouches)return;let[a,o]=this._firstTwoTouches,s=sN(n,r,a),l=sN(n,r,o);s&&l||(this._active&&C(),this.reset())}touchcancel(){this.reset()}enable(i){this._enabled=!0,this._aroundCenter=!!i&&"center"===i.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function sN(i,r,n){for(let a=0;a<i.length;a++)if(i[a].identifier===n)return r[a]}function sj(i,r){return Math.log2(i/r)}class sz extends sF{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(i){this._startDistance=this._distance=i[0].dist(i[1])}_move(i,r){let n=this._distance;if(this._distance=i[0].dist(i[1]),this._active||!(.1>Math.abs(sj(this._distance,this._startDistance))))return this._active=!0,{zoomDelta:sj(this._distance,n),pinchAround:r}}}function sB(i,r){return 180*i.angleWith(r)/Math.PI}class sU extends sF{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(i){this._startVector=this._vector=i[0].sub(i[1]),this._minDiameter=i[0].dist(i[1])}_move(i,r){let n=this._vector;if(this._vector=i[0].sub(i[1]),n&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:sB(this._vector,n),pinchAround:r}}_isBelowThreshold(i){this._minDiameter=Math.min(this._minDiameter,i.mag());let r=25/(Math.PI*this._minDiameter)*360,n=this._startVector;return!!n&&Math.abs(sB(i,n))<r}}function sV(i){return Math.abs(i.y)>Math.abs(i.x)}class sH extends sF{constructor(i){super(),this._map=i}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(i){this._lastPoints=i,sV(i[0].sub(i[1]))&&(this._valid=!1)}_move(r,n,a){let o=this._lastPoints;if(!o)return;let s=r[0].sub(o[0]),l=r[1].sub(o[1]);return this._map._cooperativeGestures&&!i.dA()&&a.touches.length<3||(this._val
112id=this.gestureBeginsVertically(s,l,a.timeStamp),!this._valid)?void 0:(this._lastPoints=r,this._active=!0,{pitchDelta:-((s.y+l.y)/2*.5)})}gestureBeginsVertically(i,r,n){if(void 0!==this._valid)return this._valid;let a=i.mag()>=2,o=r.mag()>=2;if(!a&&!o)return;if(!a||!o)return null==this._firstMove&&(this._firstMove=n),n-this._firstMove<100&&void 0;let s=i.y>0==r.y>0;return sV(i)&&sV(r)&&s}}let sG=100,sq=15,s$=10;class sW{constructor(){this._panStep=sG,this._bearingStep=sq,this._pitchStep=s$,this._rotationDisabled=!1,this._panDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(i){if(i.altKey||i.ctrlKey||i.metaKey)return;let r=0,n=0,a=0,o=0,s=0;switch(i.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:i.shiftKey?n=-1:(i.preventDefault(),o=-1);break;case 39:i.shiftKey?n=1:(i.preventDefault(),o=1);break;case 38:i.shiftKey?a=1:(i.preventDefault(),s=-1);break;case 40:i.shiftKey?a=-1:(i.preventDefault(),s=1);break;default:return}return this._rotationDisabled&&(n=0,a=0),this._panDisabled&&(o=0,s=0),{cameraAnimation:l=>{let u=l.getZoom();l.easeTo({duration:300,easeId:"keyboardHandler",easing:sY,zoom:r?Math.round(u)+r*(i.shiftKey?2:1):u,bearing:l.getBearing()+n*this._bearingStep,pitch:l.getPitch()+a*this._pitchStep,offset:[-o*this._panStep,-s*this._panStep],center:l.getCenter()},{originalEvent:i})}}}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}disablePan(){this._panDisabled=!0}enablePan(){this._panDisabled=!1}}function sY(i){return i*(2-i)}let sZ=1/450,sK=/(Mac|iPad)/i;class sX{constructor(r,n){this._map=r,this._el=r.getCanvasContainer(),this._handler=n,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=sZ,i.bs(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(i){this._defaultZoomRate=i}setWheelZoomRate(i){this._wheelZoomRate=i}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!i&&"center"===i.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(r){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(r.ctrlKey||r.metaKey||this.isZooming()||i.dA()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let n=r.deltaMode===WheelEvent.DOM_DELTA_LINE?40*r.deltaY:r.deltaY,a=i.co.now(),o=a-(this._lastWheelEventTime||0);this._lastWheelEventTime=a,0!==n&&n%4.000244140625==0?this._type="wheel":0!==n&&4>Math.abs(n)?this._type="trackpad":o>400?(this._type=null,this._lastValue=n,this._timeout=window.setTimeout(this._onTimeout,40,r)):this._type||(this._type=200>Math.abs(o*n)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),r.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=r,this._delta-=n,this._active||this._start(r)),r.preventDefault()}_onTimeout(i){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)}_start(i){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let r=I(this._el,i);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:r,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;let r=this._map.transform;"wheel"===this._type&&r.projection.wrap&&(r._center.lng>=180||r._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);let n=()=>r._terrainEnabled()&&this._aroundCoord?r.computeZoomRelativeTo(this._aroundCoord):r.zoom;if(0!==this._delta){let i="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,a=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==a&&(a=1/a);let o=n(),s=Math.pow(2,o),l="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):s;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(l*a))),"wheel"===this._type&&(this._startZoom=o,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}let a="number"==typeof this._targetZoom?this._targetZoom:n(),o=this._startZoom,s=this._easing,l,u=!1;if("wheel"===this._type&&o&&s){let r=Math.min((i.co.now()-this._lastWheelEventTime)/200,1),n=s(r);l=i.dY(o,a,n),r<1?this._frameId||(this._frameId=!0):u=!0}else l=a,u=!0;this._active=!0,u&&(this._active=!1,this._finishTimeout=window.setTimeout(()=>
112{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200));let c=l-n();return c*this._lastDelta<0&&(c=0),{noInertia:!0,needsRenderFrame:!u,zoomDelta:c,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(r){let n=i.ca;if(this._prevEase){let r=this._prevEase,a=(i.co.now()-r.start)/r.duration,o=r.easing(a+.01)-r.easing(a),s=.27/Math.sqrt(o*o+1e-4)*.01,l=Math.sqrt(.0729-s*s);n=i.fV(s,l,.25,1)}return this._prevEase={start:i.co.now(),duration:r,easing:n},n}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=x("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=sK.test(navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role")},200)}}class sQ{constructor(i,r){this._clickZoom=i,this._tapZoom=r}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class sJ{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(i,r){return i.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:n.getZoom()+(i.shiftKey?-1:1),around:n.unproject(r)},{originalEvent:i})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class s1{constructor(){this._tap=new sC({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(i,r,n){this._swipePoint||(this._tapTime&&i.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=r[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(i,r,n))}touchmove(i,r,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;let a=r[0],o=a.y-this._swipePoint.y;return this._swipePoint=a,i.preventDefault(),this._active=!0,{zoomDelta:o/128}}}else this._tap.touchmove(i,r,n)}touchend(i,r,n){this._tapTime?this._swipePoint&&0===n.length&&this.reset():this._tap.touchend(i,r,n)&&(this._tapTime=i.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class s0{constructor(i,r,n){this._el=i,this._mousePan=r,this._touchPan=n}enable(i){this._inertiaOptions=i||{},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 s2{constructor(i,r,n){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=r,this._mousePitch=n,this._pitchDisabled=!1}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&!this._pitchDisabled&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._pitchDisabled||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}disablePitch(){this._pitchDisabled=!0,this._mousePitch.disable()}enablePitch(){this._pitchDisabled=!1,this._pitchWithRotate&&this._mouseRotate.isEnabled()&&this._mousePitch.enable()}}class s5{constructor(i,r,n,a){this._el=i,this._touchZoom=r,this._touchRotate=n,this._tapDragZoom=a,this._rotationDisabled=!1,this._tapDragZoomDisabled=!1,this._enabled=!0}enable(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoomDisabled||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._tapDragZoomDisabled||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()}disableTapDragZoom(){this._tapDragZoomDisabled=!0,this._tapDragZoom.disable()}enableTapDragZoom(){this._tapDragZoomDisabled=!1,this._touchZoom.isEnabled()&&this._tapDragZoom.enable()}}let s4=i=>i.zoom||i.drag||i.pitch||i.rotate;class s9 extends i.x{}class s3{constructor(){this.constants=[1,1,.01],this.radius=0}setup(r,n){let a=i.fx([],n,r);this.radius=i.dW(a[2]<0?i.c6([],a,this.constants):[a[0],a[1],0])}projectRay(r){i.c6(r,r,this.constants),i.ex(r,r),i.ep(r,r,this.constants);let n=i.fa([],r,this.radius);if(n[2]>0){let r=i.fa([],[0,0,1],i.c7(n,[0,0,1])),a=i.fa([],i.ex([],[n[0],n[1],0]),this.radius),o=i.bj([],n,i.fa([],i.fx([],i.bj([],a,r),n),2));n[0]=o[0],n[1]=o[1]}return n}}function s8(i){return i.panDelta&&i.panDelta.mag()||i.zoomDelta||i.bearingDelta||i.pitchDelta}class s6{constructor(r,n){this._map=r,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new sg(r),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new s3,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(n),i.bs(["handleEvent","handleWindowEvent"],this);const a=this._el;for(const[i,r,n]of(this._listeners=[[a,"touchstart",{passive:!0}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[window,"blur",void 0]],this._listeners)){const a=i===document?this.handleWindowEvent:this.handleEvent;i.addEventListener(r,a,n)}}destroy(){for(let[i,r,n]of this._listeners){let a=i===document?this.handleWindowEvent:this.handleEvent;i.removeEventListener(r,a,n)}}_addDefaultHandlers(i){let r=this._map,n=r.getCanvasContainer();this._add("mapEvent",new sw(r,i));let a=r.boxZoom=new sE(r,i);this._add("boxZoom",a);let o=new sI,s=new sJ;r.doubleClickZoom=new sQ(s,o),this._add("tapZoom",o),this._add("clickZoom",s);let l=new s1;this._add("tapDragZoom",l);let u=r.touchPitch=new sH(r);this._add("touchPitch",u);let c=new sP(i),d=new sO(i);r.dragRotate=new s2(i,c,d),this._add("mouseRotate",c,["mousePitch"]),this._add("mousePitch",d,["mouseRotate"]);let h=new sL(i),f=new sD(r,i);r.dragPan=new s0(n,h,f),this._add("mousePan",h),this._add("touchPan",f,["touchZoom","touchRotate"]);let p=new sU,m=new sz;r.touchZoomRotate=new s5(n,m,p,l),this._add("touchRotate",p,["touchPan","touchZoom"]),this._add("touchZoom",m,["touchPan","touchRotate"]),this._add("blockableMapEvent",new sT(r));let g=r.scrollZoom=new sX(r,this);this._add("scrollZoom",g,["mousePan"]);let _=r.keyboard=new sW;for(let n of(this._add("keyboard",_),["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"]))i.interactive&&i[n]&&r[n].enable(i[n])}_add(i,r,n){this._handlers.push({handlerName:i,handler:r,allowed:n}),this._handlersById[i]=r}stop(i){if(!this._updatingCamera){for(let{handler:i}of this._handlers)i.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[],this._originalZoom=void 0}}isActive(){for(let{handler:i}of this._handlers)if(i.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!s4(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(i,r,n){for(let a in i)if(!(a===n||r&&r.includes(a)))return!0;return!1}handleWindowEvent(i){this.handleEvent(i,`${i.type}Window`)}_getMapTouches(i){let r=[];for(let n of i)this._el.contains(n.target)&&r.push(n);return r}handleEvent(i,r){this._updatingCamera=!0;let n="renderFrame"===i.type,a=n?void 0:i,o={needsRenderFrame:!1},s={},l={},u=i.touches?this._getMapTouches(i.touches):void 0,c=u?k(this._el,u):n?void 0:I(this._el,i);for(let{handlerName:n,handler:d,allowed:h}of this._handlers){let f;d.isEnabled()&&(this._blockedByActive(l,h,n)?d.reset():d[r||i.type]&&(f=d[r||i.type](i,c,u),this.mergeHandlerResult(o,s,f,n,a),f&&f.needsRenderFrame&&this._triggerRe
112nderFrame()),(f||d.isActive())&&(l[n]=d))}let d={};for(let i in this._previousActiveHandlers)l[i]||(d[i]=a);this._previousActiveHandlers=l,(Object.keys(d).length||s8(o))&&(this._changes.push([o,s,d]),this._triggerRenderFrame()),(Object.keys(l).length||s8(o))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:h}=o;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))}mergeHandlerResult(i,r,n,a,o){if(!n)return;Object.assign(i,n);let s={handlerName:a,originalEvent:n.originalEvent||o};void 0!==n.zoomDelta&&(r.zoom=s),void 0!==n.panDelta&&(r.drag=s),void 0!==n.pitchDelta&&(r.pitch=s),void 0!==n.bearingDelta&&(r.rotate=s)}_applyChanges(){let r={},n={},a={};for(let[o,s,l]of this._changes)o.panDelta&&(r.panDelta=(r.panDelta||new i.au(0,0))._add(o.panDelta)),o.zoomDelta&&(r.zoomDelta=(r.zoomDelta||0)+o.zoomDelta),o.bearingDelta&&(r.bearingDelta=(r.bearingDelta||0)+o.bearingDelta),o.pitchDelta&&(r.pitchDelta=(r.pitchDelta||0)+o.pitchDelta),void 0!==o.around&&(r.around=o.around),void 0!==o.aroundCoord&&(r.aroundCoord=o.aroundCoord),void 0!==o.pinchAround&&(r.pinchAround=o.pinchAround),o.noInertia&&(r.noInertia=o.noInertia),Object.assign(n,s),Object.assign(a,l);this._updateMapTransform(r,n,a),this._changes=[]}_updateMapTransform(r,n,a){let o,s=this._map,l=s.transform,u=i=>[i.x,i.y,i.z];if((o=this._eventsInProgress.drag)&&!this._handlersById[o.handlerName].isActive()&&!s8(r)){let i=l.zoom;l.cameraElevationReference="sea",null!=this._originalZoom&&l._orthographicProjectionAtLowPitch&&"globe"!==l.projection.name&&0===l.pitch?(l.cameraElevationReference="ground",l.zoom=this._originalZoom):(l.recenterOnTerrain(),l.cameraElevationReference="ground"),i!==l.zoom&&this._map._update(!0)}if(l._isCameraConstrained&&s._stop(!0),!s8(r))return void this._fireEvents(n,a,!0);let{panDelta:c,zoomDelta:d,bearingDelta:h,pitchDelta:f,around:p,aroundCoord:m,pinchAround:g}=r;l._isCameraConstrained&&(d>0&&(d=0),l._isCameraConstrained=!1),void 0!==g&&(p=g),(d||n.drag&&!this._eventsInProgress.drag)&&p&&(this._dragOrigin=u(l.pointCoordinate3D(p)),this._originalZoom=l.zoom,this._trackingEllipsoid.setup(l._camera.position,this._dragOrigin)),l.cameraElevationReference="sea",s._stop(!0),p=p||s.transform.centerPoint,h&&(l.bearing+=h),f&&(l.pitch+=f),l._updateCameraState();let _=[0,0,0];if(c)if("mercator"===l.projection.name){let i=this._trackingEllipsoid.projectRay(l.screenPointToMercatorRay(p).dir),r=this._trackingEllipsoid.projectRay(l.screenPointToMercatorRay(p.sub(c)).dir);_[0]=r[0]-i[0],_[1]=r[1]-i[1]}else{let r=l.pointCoordinate(p);if("globe"===l.projection.name){c=c.rotate(-l.angle);let n=l._pixelsPerMercatorPixel/l.worldSize;_[0]=-c.x*i.ej(i.dT(r.y))*n,_[1]=-c.y*i.ej(l.center.lat)*n}else{let i=l.pointCoordinate(p.sub(c));r&&i&&(_[0]=i.x-r.x,_[1]=i.y-r.y)}}let y=l.zoom,v=[0,0,0];if(d){let r=u(m||l.pointCoordinate3D(p)),n={dir:i.ex([],i.fx([],r,l._camera.position))};if(n.dir[2]<0){let a=l.zoomDeltaToMovement(r,d);i.fa(v,n.dir,a)}}let x=i.bj(_,_,v);l._translateCameraConstrained(x),d&&Math.abs(l.zoom-y)>1e-4&&l.recenterOnTerrain(),l.cameraElevationReference="ground",this._map._update(),r.noInertia||this._inertia.record(r),this._fireEvents(n,a,!0)}_fireEvents(r,n,a){let o,s=s4(this._eventsInProgress),l=s4(r),u={};for(let i in r){let{originalEvent:n}=r[i];this._eventsInProgress[i]||(u[`${i}start`]=n),this._eventsInProgress[i]=r[i]}for(let i in!s&&l&&this._fireEvent("movestart",l.originalEvent),u)this._fireEvent(i,u[i]);for(let i in l&&this._fireEvent("move",l.originalEvent),r){let{originalEvent:n}=r[i];this._fireEvent(i,n)}let c={};for(let i in this._eventsInProgress){let{handlerName:r,originalEvent:a}=this._eventsInProgress[i];this._handlersById[r].isActive()||(delete this._eventsInProgress[i],o=n[r]||a,c[`${i}end`]=o)}for(let i in c)this._fireEvent(i,c[i]);let d=s4(this._eventsInProgress);if(a&&(s||l)&&!d){this._updatingCamera=!0;let r=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),n=i=>0!==i&&-this._bearingSnap<i&&i<this._bearingSnap;r?(n(r.bearing||this._map.getBearing())&&(r.bearing=0),this._map.easeTo(r,{originalEvent:o})):(this._map.fire(new i.x("moveend",{originalEvent:o})),n(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(r,n){this._map.fire(new i.x(r,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(i=>{this._frameId=void 0,this.handleEvent(new s9("renderFrame",{timeStamp:i})),this._applyChanges()})}
112_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}let s7="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class le extends i.y{constructor(r,n){super(),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,this._respectPrefersReducedMotion=!1!==n.respectPrefersReducedMotion,i.bs(["_renderFrameCallback"],this)}getCenter(){return new i.ab(this.transform.center.lng,this.transform.center.lat)}setCenter(i,r){return this.jumpTo({center:i},r)}panBy(r,n,a){return r=i.au.convert(r).mult(-1),this.panTo(this.transform.center,Object.assign({offset:r},n),a)}panTo(i,r,n){return this.easeTo(Object.assign({center:i},r),n)}getZoom(){return this.transform.zoom}setZoom(i,r){return this.jumpTo({zoom:i},r),this}zoomTo(i,r,n){return this.easeTo(Object.assign({zoom:i},r),n)}zoomIn(i,r){return this.zoomTo(this.getZoom()+1,i,r),this}zoomOut(i,r){return this.zoomTo(this.getZoom()-1,i,r),this}getBearing(){return this.transform.bearing}setBearing(i,r){return this.jumpTo({bearing:i},r),this}getPadding(){return this.transform.padding}setPadding(i,r){return this.jumpTo({padding:i},r),this}rotateTo(i,r,n){return this.easeTo(Object.assign({bearing:i},r),n)}resetNorth(i,r){return this.rotateTo(0,Object.assign({duration:1e3},i),r),this}resetNorthPitch(i,r){return this.easeTo(Object.assign({bearing:0,pitch:0,duration:1e3},i),r),this}snapToNorth(i,r){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(i,r):this}getPitch(){return this.transform.pitch}setPitch(i,r){return this.jumpTo({pitch:i},r),this}cameraForBounds(r,n){r=i.ac.convert(r);let a=n&&n.bearing||0,o=n&&n.pitch||0,s=r.getNorthWest(),l=r.getSouthEast();return this._cameraForBounds(this.transform,s,l,a,o,n)}_extendPadding(i){let r={top:0,right:0,bottom:0,left:0};return null==i?Object.assign({},r,this.transform.padding):"number"==typeof i?{top:i,bottom:i,right:i,left:i}:Object.assign({},r,i)}_extendCameraOptions(i){return(i=Object.assign({offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding=this._extendPadding(i.padding),i}_minimumAABBFrustumDistance(i,r){let n=r.max[0]-r.min[0],a=r.max[1]-r.min[1];return n/a>i.aspect?n/(2*Math.tan(.5*i.fovX)*i.aspect):a/(2*Math.tan(.5*i.fovY)*i.aspect)}_cameraForBoundsOnGlobe(r,n,a,o,s,l){let u=r.clone(),c=this._extendCameraOptions(l);u.bearing=o,u.pitch=s;let d=i.ab.convert(n),h=i.ab.convert(a),f=.5*(d.lat+h.lat),p=.5*(d.lng+h.lng),m=i.dU(f,p),g=i.ex([],m),_=i.ex([],i.c1([],g,[0,1,0])),y=i.c1([],_,g),v=[_[0],_[1],_[2],0,y[0],y[1],y[2],0,g[0],g[1],g[2],0,0,0,0,1],x=[m,i.dU(d.lat,d.lng),i.dU(h.lat,d.lng),i.dU(h.lat,h.lng),i.dU(d.lat,h.lng),i.dU(f,d.lng),i.dU(f,h.lng),i.dU(d.lat,p),i.dU(h.lat,p)],b=i.A.fromPoints(x.map(r=>[i.c7(_,r),i.c7(y,r),i.c7(g,r)])),w=i.fL([],b.center,v);0===i.fu(w)&&i.ff(w,0,0,1),i.ex(w,w),i.fa(w,w,i.P),u.center=i.cd(w);let T=u.getWorldToCameraMatrix(),E=i.dr(new Float64Array(16),T);b=i.A.applyTransform(b,i.er([],T,v));let S=this._extendAABB(b,u,c,o);if(!S)return void i.f_("Map cannot fit within canvas with the given bounds, padding, and/or offset.");b=S,i.fL(w,w,T);let A=.5*(b.max[2]-b.min[2]),C=this._minimumAABBFrustumDistance(u,b),I=i.fa([],[0,0,1],A),k=i.bj(I,w,I),R=C+(0===u.pitch?0:i.c5(w,k)),M=u.globeCenterInViewSpace,L=i.fx([],w,[M[0],M[1],M[2]]);i.ex(L,L),i.fa(L,L,R);let P=i.bj([],w,L);i.fL(P,P,E);let O=i.c9/i.P,D=i.dW(P),F=i.em(Math.max(D*O-i.c9,Number.EPSILON),0),N=Math.min(u.zoomFromMercatorZAdjusted(F),c.maxZoom);return N>.5*(i.S+i.R)?(u.setProjection({name:"mercator"}),u.zoom=N,this._cameraForBounds(u,n,a,o,s,l)):{center:u.center,zoom:N,bearing:o,pitch:s}}_extendAABB(r,n,a,o){let s=.5*((a.padding.left||0)+(a.padding.right||0)),l=.5*((a.padding.top||0)+(a.padding.bottom||0)),u=n.width-(s+s),c=n.height-(l+l),d=i.fx([],r.max,r.min),h=Math.min(u/d[0],c/d[1]),f=Math.min(n.scaleZoom(n.scale*h),a.maxZoom);if(isNaN(f))return null;let p=n.scale/n.zoomScale(f),m=new i.A([r.min[0]-s*p,r.min[1]-l*p,r.min[2]],[r.max[0]+s*p,r.max[1]+l*p,r.max[2]]),g=("number"==typeof a.offset.x&&"number"==typeof a.offset.y?new i.au(a.offset.x,a.offset.y):i.au.convert(a.offset)).rotate(-i.c4(o));return m.center[0]-=g.x*p,m.center[1]+=g.y*p,m}queryTerrainElevation(r,n){let a=this.transform.elevation;return a?(n=Object.assign({},{exaggerated:!0}
112,n),a.getAtPoint(i.ag.fromLngLat(r),null,n.exaggerated)):null}_cameraForBounds(r,n,a,o,s,l){if("globe"===r.projection.name)return this._cameraForBoundsOnGlobe(r,n,a,o,s,l);let u=r.clone(),c=this._extendCameraOptions(l);u.bearing=o,u.pitch=s;let d=i.ab.convert(n),h=i.ab.convert(a),f=new i.ab(d.lng,h.lat),p=new i.ab(h.lng,d.lat),m=u.project(d),g=u.project(h),_=this.queryTerrainElevation(d),y=this.queryTerrainElevation(h),v=this.queryTerrainElevation(f),x=this.queryTerrainElevation(p),b=[[m.x,m.y,Math.min(_||0,y||0,v||0,x||0)],[g.x,g.y,Math.max(_||0,y||0,v||0,x||0)]],w=i.A.fromPoints(b),T=u.getWorldToCameraMatrix(),E=i.dr(new Float64Array(16),T);w=i.A.applyTransform(w,T);let S=this._extendAABB(w,u,c,o);if(!S)return void i.f_("Map cannot fit within canvas with the given bounds, padding, and/or offset.");w=S;let A=.5*i.fx([],w.max,w.min)[2],C=this._minimumAABBFrustumDistance(u,w),I=[0,0,1,0];i.fM(I,I,T),i.ez(I,I);let k=i.fa([],I,C+A),R=i.bj([],w.center,k);i.fL(w.center,w.center,E),i.fL(R,R,E);let M=u.unproject(new i.au(w.center[0],w.center[1])),L=Math.pow(2,i.dc(u.projection,M)),P=Math.min(u._zoomFromMercatorZ(R[2]*u.pixelsPerMeter*L/u.worldSize),c.maxZoom);return u.mercatorFromTransition&&P<.5*(i.S+i.R)?(u.setProjection({name:"globe"}),u.zoom=P,this._cameraForBounds(u,n,a,o,s,l)):{center:M,zoom:P,bearing:o,pitch:s}}fitBounds(i,r,n){let a=this.cameraForBounds(i,r);return this._fitInternal(a,r,n)}fitScreenCoordinates(r,n,a,o,s){let l=i.au.convert(r),u=i.au.convert(n),c=new i.au(Math.min(l.x,u.x),Math.min(l.y,u.y)),d=new i.au(Math.max(l.x,u.x),Math.max(l.y,u.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(l,u))return this;let h=this.transform.pointLocation3D(c),f=this.transform.pointLocation3D(d),p=this.transform.pointLocation3D(new i.au(c.x,d.y)),m=this.transform.pointLocation3D(new i.au(d.x,c.y)),g=[Math.min(h.lng,f.lng,p.lng,m.lng),Math.min(h.lat,f.lat,p.lat,m.lat)],_=[Math.max(h.lng,f.lng,p.lng,m.lng),Math.max(h.lat,f.lat,p.lat,m.lat)],y=o&&o.pitch?o.pitch:this.getPitch(),v=this._cameraForBounds(this.transform,g,_,a,y,o);return this._fitInternal(v,o,s)}_fitInternal(i,r,n){return i?(r=Object.assign(i,r)).linear?this.easeTo(r,n):this.flyTo(r,n):this}jumpTo(r,n){this.stop();let a=r.preloadOnly?this.transform.clone():this.transform,o=!1,s=!1,l=!1;"zoom"in r&&a.zoom!==+r.zoom&&(o=!0,a.zoom=+r.zoom),void 0!==r.center&&(a.center=i.ab.convert(r.center)),"bearing"in r&&a.bearing!==+r.bearing&&(s=!0,a.bearing=+r.bearing),"pitch"in r&&a.pitch!==+r.pitch&&(l=!0,a.pitch=+r.pitch);let u="number"==typeof r.padding?this._extendPadding(r.padding):r.padding;if(null!=r.padding&&!a.isPaddingEqual(u))if(!1===r.retainPadding){let i=a.clone();i.padding=u,a.setLocationAtPoint(a.center,i.centerPoint)}else a.padding=u;return r.preloadOnly?(this._preloadTiles(a),this):(this.fire(new i.x("movestart",n)).fire(new i.x("move",n)),o&&this.fire(new i.x("zoomstart",n)).fire(new i.x("zoom",n)).fire(new i.x("zoomend",n)),s&&this.fire(new i.x("rotatestart",n)).fire(new i.x("rotate",n)).fire(new i.x("rotateend",n)),l&&this.fire(new i.x("pitchstart",n)).fire(new i.x("pitch",n)).fire(new i.x("pitchend",n)),this.fire(new i.x("moveend",n)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||i.f_(s7),this.transform.getFreeCameraOptions()}setFreeCameraOptions(r,n){let a=this.transform;if(!a.projection.supportsFreeCamera)return i.f_(s7),this;this.stop();let o=a.zoom,s=a.pitch,l=a.bearing;a.setFreeCameraOptions(r);let u=o!==a.zoom,c=s!==a.pitch,d=l!==a.bearing;return this.fire(new i.x("movestart",n)).fire(new i.x("move",n)),u&&this.fire(new i.x("zoomstart",n)).fire(new i.x("zoom",n)).fire(new i.x("zoomend",n)),d&&this.fire(new i.x("rotatestart",n)).fire(new i.x("rotate",n)).fire(new i.x("rotateend",n)),c&&this.fire(new i.x("pitchstart",n)).fire(new i.x("pitch",n)).fire(new i.x("pitchend",n)),this.fire(new i.x("moveend",n)),this}easeTo(r,n){let a,o,s,l,u;this._stop(!1,r.easeId),(!1===(r=Object.assign({offset:[0,0],duration:500,easing:i.ca},r)).animate||this._prefersReducedMotion(r))&&(r.duration=0);let c=this.transform,d=this.getZoom(),h=this.getBearing(),f=this.getPitch(),p=this.getPadding(),m="zoom"in r?+r.zoom:d,g="bearing"in r?this._normalizeBearing(r.bearing,h):h,_="pitch"in r?+r.pitch:f,y=this._extendPadding(r.padding),v=i.au.convert(r.offset);if("globe"===c.projection.name){let n=i.ag.fromLngLat(c.center),l=v.rotate(-c.angle);n.x+=l.x/c.worldSize,n.y+=l.y/c.worldSize;let u=n.toLngLat(),d=i.ab.convert(r.center||u);this._normalizeCenter(d),a=c.centerPoint.add(l),o=new i.au(n.x,n.y).mult(c.worldSize),s=new i.au(i.ek(d.lng),i.el(d.lat)).mult(c.worldSize).sub(o)}else{a=c.centerPoint.add(v);let n=c.pointLocation(a),l=i.ab.convert(r.center||n);this._normalizeCenter(l),o=c.project(n),s=c.project(l).sub(o)}
112let x=c.zoomScale(m-d);r.around&&(l=i.ab.convert(r.around),u=c.locationPoint(l));let b=this._zooming||m!==d,w=this._rotating||h!==g,T=this._pitching||_!==f,E=!c.isPaddingEqual(y),S=!1===r.retainPadding?c.clone():c,A=c=>A=>{if(b&&(c.zoom=i.dY(d,m,A)),w&&(c.bearing=i.dY(h,g,A)),T&&(c.pitch=i.dY(f,_,A)),E&&(S.interpolatePadding(p,y,A),a=S.centerPoint.add(v)),l)c.setLocationAtPoint(l,u);else{let i=c.zoomScale(c.zoom-d),r=Math.pow(m>d?Math.min(2,x):Math.max(.5,x),1-A),n=c.unproject(o.add(s.mult(A*r)).mult(i));c.setLocationAtPoint(c.renderWorldCopies?n.wrap():n,a)}return r.preloadOnly||this._fireMoveEvents(n),c};if(r.preloadOnly){let i=this._emulate(A,r.duration,c);return this._preloadTiles(i),this}let C={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=b,this._rotating=w,this._pitching=T,this._padding=E,this._easeId=r.easeId,this._prepareEase(n,r.noMoveStart,C),this._ease(A(c),i=>{"sea"===c.cameraElevationReference&&c.recenterOnTerrain(),this._afterEase(n,i)},r),this}_prepareEase(r,n,a={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&0===this.transform.pitch&&"globe"!==this.transform.projection.name&&(this.transform.cameraElevationReference="ground"),n||a.moving||this.fire(new i.x("movestart",r)),this._zooming&&!a.zooming&&this.fire(new i.x("zoomstart",r)),this._rotating&&!a.rotating&&this.fire(new i.x("rotatestart",r)),this._pitching&&!a.pitching&&this.fire(new i.x("pitchstart",r))}_fireMoveEvents(r){this.fire(new i.x("move",r)),this._zooming&&this.fire(new i.x("zoom",r)),this._rotating&&this.fire(new i.x("rotate",r)),this._pitching&&this.fire(new i.x("pitch",r))}_afterEase(r,n){if(this._easeId&&n&&this._easeId===n)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";let a=this._zooming,o=this._rotating,s=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,a&&this.fire(new i.x("zoomend",r)),o&&this.fire(new i.x("rotateend",r)),s&&this.fire(new i.x("pitchend",r)),this.fire(new i.x("moveend",r))}flyTo(r,n){if(this._prefersReducedMotion(r)){let a=i.eF(r,["center","zoom","bearing","pitch","around","padding","retainPadding"]);return this.jumpTo(a,n)}this.stop(),r=Object.assign({offset:[0,0],speed:1.2,curve:1.42,easing:i.ca},r);let a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),u=this.getPadding(),c="zoom"in r?i.bG(+r.zoom,a.minZoom,a.maxZoom):o,d="bearing"in r?this._normalizeBearing(r.bearing,s):s,h="pitch"in r?+r.pitch:l,f=this._extendPadding(r.padding),p=a.zoomScale(c-o),m=i.au.convert(r.offset),g=a.centerPoint.add(m),_=a.pointLocation(g),y=i.ab.convert(r.center||_);this._normalizeCenter(y);let v=a.project(_),x=a.project(y).sub(v),b=r.curve,w=Math.max(a.width,a.height),T=w/p,E=x.mag();if("minZoom"in r){let n=i.bG(Math.min(r.minZoom,o,c),a.minZoom,a.maxZoom);b=Math.sqrt(w/a.zoomScale(n-o)/E*2)}let S=b*b;function A(i){let r=(T*T-w*w+(i?-1:1)*S*S*E*E)/(2*(i?T:w)*S*E);return Math.log(Math.sqrt(r*r+1)-r)}function C(i){return(Math.exp(i)-Math.exp(-i))/2}function I(i){return(Math.exp(i)+Math.exp(-i))/2}let k=A(0),R=function(i){return I(k)/I(k+b*i)},M=function(i){var r;return w*((I(k)*(C(r=k+b*i)/I(r))-C(k))/S)/E},L=(A(1)-k)/b;if(1e-6>Math.abs(E)||!isFinite(L)){if(1e-6>Math.abs(w-T))return this.easeTo(r,n);let i=T<w?-1:1;L=Math.abs(Math.log(T/w))/b,M=function(){return 0},R=function(r){return Math.exp(i*b*r)}}r.duration="duration"in r?+r.duration:1e3*L/("screenSpeed"in r?r.screenSpeed/b:+r.speed),r.maxDuration&&r.duration>r.maxDuration&&(r.duration=0);let P=s!==d,O=h!==l,D=!a.isPaddingEqual(f),F=!1===r.retainPadding?a.clone():a,N=a=>p=>{let _=p*L,b=1/R(_);a.zoom=1===p?c:o+a.scaleZoom(b),P&&(a.bearing=i.dY(s,d,p)),O&&(a.pitch=i.dY(l,h,p)),D&&(F.interpolatePadding(u,f,p),g=F.centerPoint.add(m));let w=1===p?y:a.unproject(v.add(x.mult(M(_))).mult(b));return a.setLocationAtPoint(a.renderWorldCopies?w.wrap():w,g),a._updateCameraOnTerrain(),r.preloadOnly||this._fireMoveEvents(n),a};if(r.preloadOnly){let i=this._emulate(N,r.duration,a);return this._preloadTiles(i),this}return this._zooming=!0,this._rotating=P,this._pitching=O,this._padding=D,this._prepareEase(n,!1),this._ease(N(a),()=>this._afterEase(n),r),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(i){}_cancelRenderFrame(i){}_stop(i,r){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){let i=this._onEaseEnd;this._onEaseEnd=void 0,i.call(this,r)}if(!i){let i=this.handlers;i&&i.stop(!1)}return this}_ease(r,n,a){!1===a.animate||0===a.duration?(r(1),n()):(this._easeStart=i.co.now(),this._easeOptions=a,this._onEaseFrame=r,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){let r=Math.min((i.co.now()-this._easeStart)/this._easeOptions.duration,1),n=this._onEaseFrame;n&&n(this._easeOptions.easing(r)),r<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(r,n){let a=Math.abs((r=i.f$(r,-180,180))-n);return Math.abs(r-360-n)<a&&(r-=360),Math.abs(r+360-n)<a&&(r+=360),r}_normalizeCenter(i){let r=this.transform;if(r.maxBounds||"globe"!==r.projection.name&&!r.renderWorldCopies)return;let n=i.lng-r.center.lng;i.lng+=n>180?-360:360*(n<-180)}_prefersReducedMotion(r){return this._respectPrefersReducedMotion&&i.co.prefersReducedMotion&&!(r&&r.essential)}_emulate(i,r,n){let a=Math.ceil(15*r/1e3),o=[],s=i(n.clone());for(let i=0;i<=a;i++){let r=s(i/a);o.push(r.clone())}return o}_preloadTiles(i,r){}}let lt=/^(https?:|mailto:)/i;class li{constructor(r={}){this.options=r,i.bs(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(i){let r=this.options&&this.options.compact,n=i._getUIString("AttributionControl.ToggleAttribution");this._map=i,this._container=x("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=x("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",n);let a=x("span","mapboxgl-ctrl-icon",this._compactButton);return a.setAttribute("aria-hidden","true"),a.setAttribute("title",n),this._innerContainer=x("div","mapboxgl-ctrl-attrib-inner",this._container),r&&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===r&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","fal
112se")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let r=this._editLink;r||(r=this._editLink=this._container.querySelector(".mapbox-improve-map"));let n=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||i.bN.ACCESS_TOKEN}];if(r){let a=n.reduce((i,r,a)=>(r.value&&(i+=`${r.key}=${r.value}${a<n.length-1?"&":""}`),i),"?");r.href=`${i.bN.FEEDBACK_URL}/${a}#${sc(this._map,!0)}`,r.rel="noopener nofollow"}}_updateData(i){i&&("source"===i.dataType&&("metadata"===i.sourceDataType||"visibility"===i.sourceDataType)||"style"===i.dataType)&&(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let i=[];if(this._map.style.stylesheet){let i=this._map.style.stylesheet;this.styleOwner=i.owner,this.styleId=i.id}let r=this._map.style._mergedSourceCaches;for(let n in r){let a=r[n];if(a.used){let r=a.getSource();r.attribution&&!i.includes(r.attribution)&&i.push(r.attribution)}}i.sort((i,r)=>i.length-r.length),i=i.filter((r,n)=>{for(let a=n+1;a<i.length;a++)if(i[a].includes(r))return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=[...this.options.customAttribution,...i]:i.unshift(this.options.customAttribution));let n=i.map(i=>{let r;return Array.from((r=(new DOMParser).parseFromString(i,"text/html")).body.querySelectorAll("*")).reverse().forEach(i=>{let n=i.textContent||"";if("A"!==i.tagName)return void i.replaceWith(...i.childNodes);let a=i.getAttribute("href");if(!a||!lt.test(a))return void i.replaceWith(r.createTextNode(n));let o=r.createElement("a");o.href=a,o.textContent=n,o.rel="noopener nofollow";let s=i.getAttribute("class");s&&(o.className=s),i.replaceWith(o)}),r.body.innerHTML}).join(" | ");n!==this._attribHTML&&(this._attribHTML=n,i.length?(this._innerContainer.innerHTML=n,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 lr{constructor(){i.bs(["_updateLogo","_updateCompact"],this)}onAdd(i){this._map=i,this._container=x("div","mapboxgl-ctrl");let r=x("a","mapboxgl-ctrl-logo");return r.target="_blank",r.rel="noopener nofollow",r.href="https://www.mapbox.com/",r.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),r.setAttribute("rel","noopener nofollow"),this._container.appendChild(r),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(i){i&&"metadata"!==i.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;let i=this._map.style._sourceCaches;if(0===Object.entries(i).length)return!0;for(let r in i){let n=i[r].getSource();if(Object.hasOwn(n,"mapbox_logo")&&!n.mapbox_logo)return!1}return!0}_updateCompact(){let i=this._container.children;if(i.length){let r=i[0];this._map.getCanvasContainer().offsetWidth<250?r.classList.add("mapboxgl-compact"):r.classList.remove("mapboxgl-compact")}}}class ln{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(i){let r=++this._id;return this._queue.push({callback:i,id:r,cancelled:!1}),r}remove(i){let r=this._currentlyRunning;for(let n of r?this._queue.concat(r):this._queue)if(n.id===i)return void(n.cancelled=!0)}run(i=0){let r=this._currentlyRunning=this._queue;for(let n of(this._queue=[],r))if(!n.cancelled&&(n.callback(i),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}class la{constructor(i){this.jumpTo(i)}getValue(r){if(r<=this._startTime)return this._start;if(r>=this._endTime)return this._end;let n=i.cb((r-this._startTime)/(this._endTime-this._startTime));return this._start*(1-n)+this._end*n}isEasing(i){return i>=this._startTime&&i<=this._endTime}jumpTo(i){this._startTime=-1/0,this._endTime=-1/0,this._start=i,this._end=i}easeTo(i,r,n){this._start=this.getValue(r),this._end=i,this._startTime=r,this._endTime=r+n}}let lo={"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"};class ls extends i.x{constructor(i,r,n,a){const{point:o,lngLat:s,originalEvent:l,target:u}=i;super(i.type,{point:o,lngLat:s,originalEvent:l,target:u}),this.preventDefault=()=>{i.preventDefault()},this.id=r,this.interaction=n,this.feature=a}}class ll{constructor(i){this.map=i,this.interactionsByType=new Map,this.delegatedInteractions=new Map,this.typeById=new Map,this.filters=new Map,this.handleType=this.handleType.bind(this),this.handleMove=this.handleMove.bind(this),this.handleOut=this.handleOut.bind(this),this.hoveredFeatures=new Map,this.prevHoveredFeatures=new Map}
112add(r,n){if(this.typeById.has(r))throw Error(`Interaction id "${r}" already exists.`);let a=n.filter,o=n.type;a&&this.filters.set(r,i.bZ(a)),"mouseover"===o&&(o="mouseenter"),"mouseout"===o&&(o="mouseleave");let s=this.interactionsByType.get(o)||new Map;"mouseenter"===o||"mouseleave"===o?(0===this.delegatedInteractions.size&&(this.map.on("mousemove",this.handleMove),this.map.on("mouseout",this.handleOut)),this.delegatedInteractions.set(r,n)):0===s.size&&this.map.on(o,this.handleType),0===s.size&&this.interactionsByType.set(o,s),s.set(r,n),this.typeById.set(r,o)}get(i){let r=this.typeById.get(i);if(!r)return;let n=this.interactionsByType.get(r);return n?n.get(i):void 0}remove(i){let r=this.typeById.get(i);if(!r)return;this.typeById.delete(i),this.filters.delete(i);let n=this.interactionsByType.get(r);n&&(n.delete(i),"mouseenter"===r||"mouseleave"===r?(this.delegatedInteractions.delete(i),0===this.delegatedInteractions.size&&(this.map.off("mousemove",this.handleMove),this.map.off("mouseout",this.handleOut))):0===n.size&&this.map.off(r,this.handleType))}queryTargets(i,r){let n=[];for(let[i,a]of r)a.target&&n.push({targetId:i,target:a.target,filter:this.filters.get(i)});return this.map.style.queryRenderedTargets(i,n,this.map.transform)}handleMove(i){this.prevHoveredFeatures=this.hoveredFeatures,this.hoveredFeatures=new Map;let r=this.queryTargets(i.point,Array.from(this.delegatedInteractions).reverse());r.length&&(i.type="mouseenter",this.handleType(i,r));let n=new Map;for(let[i,{feature:r}]of this.prevHoveredFeatures)this.hoveredFeatures.has(i)||n.set(r.id,r);n.size&&(i.type="mouseleave",this.handleType(i,Array.from(n.values())))}handleOut(i){let r=Array.from(this.hoveredFeatures.values()).map(({feature:i})=>i);r.length&&(i.type="mouseleave",this.handleType(i,r)),this.hoveredFeatures.clear()}handleType(r,n){let a="mouseenter"===r.type;if(a&&!this.interactionsByType.has(r.type))return void i.f_("mouseenter interaction required for mouseleave to work.");let o=Array.from(this.interactionsByType.get(r.type)).reverse(),s=!!n;n=n||this.queryTargets(r.point,o);let l=!1,u=new Set;for(let c of n){for(let[n,d]of o){if(!d.target)continue;let o=c.variants?c.variants[n]:null;
112if(o){for(let h of o){if(nP(h,c,u,n))continue;let o=new i.aZ(c,h),f=nL(h,c,n);s&&void 0!==o.id&&(o.state=this.map.getFeatureState(o));let p=a?this.prevHoveredFeatures.get(f):null,m=new ls(r,n,d,o),g=p?p.stop:d.handler(m);if(a&&this.hoveredFeatures.set(f,{feature:c,stop:g}),!1!==g){l=!0;break}}if(l)break}}if(l)break}if(!l)for(let[i,n]of o){let{handler:a,target:o}=n;if(!o&&!1!==a(new ls(r,i,n,null)))break}}}let lu=/matrix.*\((.+)\)/,lc={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,fontstackCompositing:"client",transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1,precompilePrograms:!0,scaleFactor:1},ld={showCompass:!0,showZoom:!0,visualizePitch:!1};class lh{constructor(r,n,a=!1){this._clickTolerance=10,this.element=n,this.mouseRotate=new sP({clickTolerance:r.dragRotate._mouseRotate._clickTolerance}),this.map=r,a&&(this.mousePitch=new sO({clickTolerance:r.dragRotate._mousePitch._clickTolerance})),i.bs(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),n.addEventListener("mousedown",this.mousedown),n.addEventListener("touchstart",this.touchstart,{passive:!1}),n.addEventListener("touchmove",this.touchmove),n.addEventListener("touchend",this.touchend),n.addEventListener("touchcancel",this.reset)}down(i,r){this.mouseRotate.mousedown(i,r),this.mousePitch&&this.mousePitch.mousedown(i,r),E()}move(i,r){let n=this.map,a=this.mouseRotate.mousemoveWindow(i,r),o=a&&a.bearingDelta;if(o&&n.setBearing(n.getBearing()+o),this.mousePitch){let a=this.mousePitch.mousemoveWindow(i,r),o=a&&a.pitchDelta;o&&n.setPitch(n.getPitch()+o)}}off(){let i=this.element;i.removeEventListener("mousedown",this.mousedown),i.removeEventListener("touchstart",this.touchstart),i.removeEventListener("touchmove",this.touchmove),i.removeEventListener("touchend",this.touchend),i.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){S(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(i){this.down(Object.assign({},i,{button:i.button,type:i.type,ctrlKey:!0,preventDefault:()=>i.preventDefault()}),I(this.element,i)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(i){this.move(i,I(this.element,i))}mouseup(i){this.mouseRotate.mouseupWindow(i),this.mousePitch&&this.mousePitch.mouseupWindow(i),this.offTemp()}touchstart(i){1!==i.targetTouches.length?this.reset():(this._startPos=this._lastPos=k(this.element,i.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>i.preventDefault()},this._startPos))}touchmove(i){1!==i.targetTouches.length?this.reset():(this._lastPos=k(this.element,i.targetTouches)[0],this.move({buttons:1,preventDefault:()=>i.preventDefault()},this._lastPos))}touchend(i){0===i.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}function lf(r,n,a){if(r=new i.ab(r.lng,r.lat),n){let o=new i.ab(r.lng-360,r.lat),s=new i.ab(r.lng+360,r.lat),l=360*Math.ceil(Math.abs(r.lng-a.center.lng)/360),u=a.locationPoint3D(r).distSqr(n),c=n.x<0||n.y<0||n.x>a.width||n.y>a.height;a.locationPoint3D(o).distSqr(n)<u&&(c||Math.abs(o.lng-a.center.lng)<l)?r=o:a.locationPoint3D(s).distSqr(n)<u&&(c||Math.abs(s.lng-a.center.lng)<l)&&(r=s)}for(;Math.abs(r.lng-a.center.lng)>180;){let i=a.locationPoint3D(r);if(i.x>=0&&i.y>=0&&i.x<=a.width&&i.y<=a.height)break;r.lng>a.center.lng?r.lng-=360:r.lng+=360}return r}
112let lp={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%)"},lm=/\s+/,lg="auto",l_="auto";class ly extends i.y{constructor(r,n){super(),(r instanceof HTMLElement||n)&&(r=Object.assign({element:r},n)),i.bs(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this);const{anchor:a="center",color:o="#3FB1CE",scale:s=1,draggable:l=!1,clickTolerance:u=0,rotation:c=0,rotationAlignment:d=lg,pitchAlignment:h=l_,occludedOpacity:f=.2,altitude:p=0}=r||{};this._anchor=a,this._color=o,this._scale=s,this._draggable=l,this._clickTolerance=u,this._rotation=c,this._rotationAlignment=d,this._pitchAlignment=h,this._occludedOpacity=f,this._altitude=p,this._state="inactive",this._isDragging=!1,this._updateMoving=()=>this._update(!0),r&&r.element?(this._element=r.element,this._offset=i.au.convert(r&&r.offset||[0,0])):(this._defaultMarker=!0,this._element=this._createDefaultMarker(),this._offset=i.au.convert(r&&r.offset||[0,-14])),this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",i=>{i.preventDefault()}),this._element.addEventListener("mousedown",i=>{i.preventDefault()});const m=this._element.classList;for(const i in lp)m.remove(`mapboxgl-marker-anchor-${i}`);m.add(`mapboxgl-marker-anchor-${this._anchor}`),r&&r.className&&m.add(...r.className.trim().split(lm)),this._popup=null}_createDefaultMarker(){let i=x("div"),r=b("svg",{display:"block",height:41*this._scale+"px",width:27*this._scale+"px",viewBox:"0 0 27 41"},i);this._svgElement=r;let n=b("radialGradient",{id:"shadowGradient"},b("defs",{},r));b("stop",{offset:"10%","stop-opacity":.4},n),b("stop",{offset:"100%","stop-opacity":.05},n);let a=b("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"});return this._shadowElement=a,0===this._altitude&&r.insertBefore(a,r.firstChild),b("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"},r),b("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"},r),b("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},r),i}addTo(i){return i===this._map||(this.remove(),this._map=i,i.getCanvasContainer().appendChild(this._element),i.on("move",this._updateMoving),i.on("moveend",this._update),i.on("remove",this._clearFadeTimer),i._addMarker(this),this.setDraggable(this._draggable),this._update(),i.on("click",this._onMapClick)),this}remove(){let i=this._map;return i&&(i.off("click",this._onMapClick),i.off("move",this._updateMoving),i.off("moveend",this._update),i.off("mousedown",this._addDragHandler),i.off("touchstart",this._addDragHandler),i.off("mouseup",this._onUp),i.off("touchend",this._onUp),i.off("mousemove",this._onMove),i.off("touchmove",this._onMove),i.off("remove",this._clearFadeTimer),i._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(r){return this._lngLat=i.ab.convert(r),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}setAltitude(i){if(i===this._altitude)return this;let r=this._altitude;return this._altitude=i||0,this._defaultMarker&&0===r!=(0===this._altitude)&&(0===this._altitude?this._svgElement.insertBefore(this._shadowElement,this._svgElement.firstChild):this._shadowElement.remove()),this._update(),this}getAltitude(){return this._altitude}getElement(){return this._element}setPopup(i){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")),i){if(!("offset"in i.options)){let r=Math.sqrt(91.125);i.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
1120,-38.1],"bottom-left":[r,-1*(24.6+r)],"bottom-right":[-r,-1*(24.6+r)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=i,i._marker=this,i._altitude=this._altitude,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(i){let r=i.code,n=i.charCode||i.keyCode;"Space"!==r&&"Enter"!==r&&32!==n&&13!==n||this.togglePopup()}_onMapClick(i){let r=i.originalEvent.target,n=this._element;this._popup&&(r===n||n.contains(r))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){let i=this._popup;return i&&(i.isOpen()?(i.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(i.addTo(this._map),this._element.setAttribute("aria-expanded","true"))),this}_behindTerrain(){let i=this._map,r=this._pos;if(!i||!r)return!1;let n=i.unproject(r,this._altitude),a=i.getFreeCameraOptions();if(!a.position)return!1;let o=a.position.toLngLat();return o.distanceTo(n)<.9*o.distanceTo(this._lngLat)}_evaluateOpacity(){let r,n=this._map;if(!n)return;let a=this._pos;if(!a||a.x<0||a.x>n.transform.width||a.y<0||a.y>n.transform.height)return void this._clearFadeTimer();let o=n.unproject(a,this._altitude);n._showingGlobe()&&i.dE(n.transform,this._lngLat)?r=0:(r=1-n._queryFogOpacity(o),n.transform._terrainEnabled()&&n.getTerrain()&&this._behindTerrain()&&(r*=this._occludedOpacity)),this._element.style.opacity=`${r}`,this._element.style.pointerEvents=r>0?"auto":"none",this._popup&&this._popup._setOpacity(r),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){let i=this._pos;if(!i||!this._map)return;let r=this._offset.mult(this._scale);this._element.style.transform=`
113            translate(${i.x}px,${i.y}px)
114            ${lp[this._anchor]}
115            ${this._calculateXYTransform()} ${this._calculateZTransform()}
116            translate(${r.x}px,${r.y}px)
117        `}_calculateXYTransform(){let r=this._pos,n=this._map,a=this.getPitchAlignment();if(!n||!r||"map"!==a)return"";if(!n._showingGlobe()){let i=n.getPitch();return i?`rotateX(${i}deg)`:""}let o=i.eX(i.dl(n.transform,this._lngLat)),s=r.sub(i.dd(n.transform)),l=Math.abs(s.x)+Math.abs(s.y);if(0===l)return"";let u=o/l;return`rotateX(${-s.y*u}deg) rotateY(${s.x*u}deg)`}_calculateZTransform(){let r=this._pos,n=this._map;if(!n||!r)return"";let a=0,o=this.getRotationAlignment();if("map"===o)if(n._showingGlobe()){let r=n.project(new i.ab(this._lngLat.lng,this._lngLat.lat+.001),this._altitude),o=n.project(new i.ab(this._lngLat.lng,this._lngLat.lat-.001),this._altitude).sub(r);a=i.eX(Math.atan2(o.y,o.x))-90}else a=-n.getBearing();else if("horizon"===o){let o=i.fq(4,6,n.getZoom()),s=i.dd(n.transform);s.y+=o*n.transform.height;let l=r.sub(s),u=i.eX(Math.atan2(l.y,l.x));a=(u>90?u-270:u+90)*(1-o)}return(a+=this._rotation)?`rotateZ(${a}deg)`:""}_update(i){cancelAnimationFrame(this._updateFrameId);let r=this._map;
117r&&(r.transform.renderWorldCopies&&(this._lngLat=lf(this._lngLat,this._pos,r.transform)),this._pos=r.project(this._lngLat,this._altitude),!0===i?this._updateFrameId=requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),r._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(r._showingGlobe()||r.getTerrain()||r.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(r){return this._offset=i.au.convert(r),this._update(),this}addClassName(i){return this._element.classList.add(i),this}removeClassName(i){return this._element.classList.remove(i),this}toggleClassName(i){return this._element.classList.toggle(i)}_onMove(r){let n=this._map;if(!n)return;let a=this._pointerdownPos,o=this._positionDelta;if(a&&o){if(!this._isDragging){let i=this._clickTolerance||n._clickTolerance;if(r.point.dist(a)<i)return;this._isDragging=!0}this._pos=r.point.sub(o),this._lngLat=n.unproject(this._pos,this._altitude),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new i.x("dragstart"))),this.fire(new i.x("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;let r=this._map;r&&(r.off("mousemove",this._onMove),r.off("touchmove",this._onMove)),"active"===this._state&&this.fire(new i.x("dragend")),this._state="inactive"}_addDragHandler(i){let r=this._map,n=this._pos;r&&n&&this._element.contains(i.originalEvent.target)&&(i.preventDefault(),this._positionDelta=i.point.sub(n),this._pointerdownPos=i.point,this._state="pending",r.on("mousemove",this._onMove),r.on("touchmove",this._onMove),r.once("mouseup",this._onUp),r.once("touchend",this._onUp))}setDraggable(i){this._draggable=!!i;let r=this._map;return r&&(i?(r.on("mousedown",this._addDragHandler),r.on("touchstart",this._addDragHandler)):(r.off("mousedown",this._addDragHandler),r.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(i){return this._rotation=i||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(i){return this._rotationAlignment=i||lg,this._update(),this}getRotationAlignment(){return"auto"===this._rotationAlignment||"horizon"===this._rotationAlignment&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(i){return this._pitchAlignment=i||l_,this._update(),this}getPitchAlignment(){return"auto"===this._pitchAlignment?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(i){return this._occludedOpacity=i||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}let lv={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1,showButton:!0,followUserLocation:!0},lx={maxWidth:100,unit:"metric"},lb={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},lw=/\s+/,lT={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",altitude:0};function lE(r=new i.au(0,0),n="bottom"){if("number"==typeof r){let a=Math.round(Math.sqrt(.5*Math.pow(r,2)));switch(n){case"top":return new i.au(0,r);case"top-left":return new i.au(a,a);case"top-right":return new i.au(-a,a);case"bottom":return new i.au(0,-r);case"bottom-left":return new i.au(a,-a);case"bottom-right":return new i.au(-a,-a);case"left":return new i.au(r,0);case"right":return new i.au(-r,0)}return new i.au(0,0)}return r instanceof i.au||Array.isArray(r)?i.au.convert(r):i.au.convert(r[n]||[0,0])}let lS="u">typeof document?document.currentScript:null;return $=lS&&lS.src&&i.dF(lS.src)?"cdn":"other",{version:h,supported:function(i){let a,o;return!!("u">typeof window)&&!!("u">typeof document)&&!!Object.hasOwn&&((a=document.createElement("canvas")).width=a.height=1,!!(o=a.getContext("2d"))&&o.getImageData(0,0,1,1).width===a.width&&((i?(void 0===n&&(n=_(!0)),!!n):(void 0===r&&(r=_(!1)),!!r))||!1))},setRTLTextPlugin:i.fo,getRTLTextPluginStatus:i.d3,setSdkInfo:function(r){"string"!=typeof r||r.length>64||!q.test(r)?i.f_(`Invalid SDK info "${r}"; expected a "Name/version" string. Ignoring.`):o=r},addTileProvider:i.bm,Map:class extends le{constructor(r){p.mark(f.create);const n=r;if(null!=(r=Object.assign({},lc,r)).minZoom&&null!=r.maxZoom&&r.minZoom>r.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=r.minPitch&&null!=r.maxPitch&&r.minPitch>r.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=r.minPitch&&r.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=r.maxPitch&&r.maxPitch>85)throw Error("maxPitch must be less than or equal to 85");r.antialias&&i.dO(window)&&(r.antialias=!1,i.f_("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new t8(r.minZoom,r.maxZoom,r.minPitch,r.maxPitch,r.renderWorldCopies,null,null),r),this._repaint=!!r.repaint,this._interactive=r.interactive,this._minTileCacheSize=r.minTileCacheSize,this._maxTileC
117acheSize=r.maxTileCacheSize,this._failIfMajorPerformanceCaveat=r.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=r.preserveDrawingBuffer,this._antialias=r.antialias,this._trackResize=r.trackResize,this._bearingSnap=r.bearingSnap,this._refreshExpiredTiles=r.refreshExpiredTiles,this._fadeDuration=r.fadeDuration,this._placementAlgorithm=r.placementAlgorithm||"default",this._isInitialLoad=!0,this._crossSourceCollisions=r.crossSourceCollisions,this._collectResourceTiming=r.collectResourceTiming,this._language=this._parseLanguage(r.language),this._worldview=r.worldview,this._renderTaskQueue=new ln,this._domRenderTaskQueue=new ln,this._controls=[],this._markers=[],this._popups=[],this._mapId=i.fU(),this._locale=Object.assign({},lo,r.locale),this._clickTolerance=r.clickTolerance,this._cooperativeGestures=r.cooperativeGestures,this._performanceMetricsCollection=r.performanceMetricsCollection,this._tessellationStep=r.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=r.precompilePrograms,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new la(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._scaleFactor=r.scaleFactor,this._requestManager=new j(r.transformRequest,r.accessToken,r.testMode);const a=H(r.accessToken||i.bN.ACCESS_TOKEN);if(a&&"atlas"in a&&"number"==typeof a.atlas&&(this._tokenExpiration=a.atlas),this._silenceAuthErrors=!!r.testMode,this._contextCreateOptions=r.contextCreateOptions?Object.assign({},r.contextCreateOptions):{},"string"==typeof r.container){const i=document.getElementById(r.container);if(!i)throw Error(`Container '${r.container.toString()}' not found.`);this._container=i}else{if(!(r.container instanceof HTMLElement))throw Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=r.container}if(this._container.childNodes.length>0&&i.f_("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."),r.maxBounds&&this.setMaxBounds(r.maxBounds),this._spriteFormat="auto",i.bs(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw Error("Failed to initialize WebGL.");if(this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new s6(this,r),this._localFontFamily=r.localFontFamily,this._localIdeographFontFamily=r.localIdeographFontFamily,this._fontstackCompositing=r.fontstackCompositing,(r.style||!r.testMode)&&this.setStyle(r.style||i.bN.DEFAULT_STYLE,{config:r.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily,fontstackCompositing:this._fontstackCompositing}),r.projection&&this.setProjection(r.projection),r.hash&&(this._hash=new su("string"==typeof r.hash&&r.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){null==n.center&&null==n.zoom||(this.transform._unmodified=!1),this.jumpTo({center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch});const i=r.bounds;i&&(this.resize(),this.fitBounds(i,Object.assign({},r.fitBoundsOptions,{duration:0})))}this.resize(),r.attributionControl&&this.addControl(new li({customAttribution:r.customAttribution})),this._logoControl=new lr,this.addControl(this._logoControl,r.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent(),this._postStyleWithAppearanceEvent()}),this.on("data",r=>{this._update("style"===r.dataType),this.fire(new i.x(`${r.dataType}data`,r))}),this.on("dataloading",r=>{this.fire(new i.x(`${r.dataType}dataloading`,r))}),this._interactions=new ll(this)}_getMapId(){return this._mapId}addControl(r,n){if(void 0===n&&(n=r.getDefaultPosition?r.getDefaultPosition():"top-right"),!r||!r.onAdd)return this.fire(new i.v(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let a=r.onAdd(this);this._controls.push(r);let o=this._controlPositions[n];return n.includes("bottom")?o.insertBefore(a,o.firstChild):o.appendChild(a),this}
117removeControl(r){if(!r||!r.onRemove)return this.fire(new i.v(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let n=this._controls.indexOf(r);return n>-1&&this._controls.splice(n,1),r.onRemove(this),this}hasControl(i){return this._controls.includes(i)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(r){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));let n=!this._moving;return n&&this.fire(new i.x("movestart",r)).fire(new i.x("move",r)),this.fire(new i.x("resize",r)),n&&this.fire(new i.x("moveend",r)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(r){return this.transform.setMaxBounds(i.ac.convert(r)),this._update()}setMinZoom(r){if((r=r??-2)>=-2&&r<=this.transform.maxZoom)return this.transform.minZoom=r,this._update(),this.getZoom()<r?this.setZoom(r):this.fire(new i.x("zoomstart")).fire(new i.x("zoom")).fire(new i.x("zoomend")),this;throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(r){if((r=r??22)>=this.transform.minZoom)return this.transform.maxZoom=r,this._update(),this.getZoom()>r?this.setZoom(r):this.fire(new i.x("zoomstart")).fire(new i.x("zoom")).fire(new i.x("zoomend")),this;throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(r){if((r=r??0)<0)throw Error("minPitch must be greater than or equal to 0");if(r>=0&&r<=this.transform.maxPitch)return this.transform.minPitch=r,this._update(),this.getPitch()<r?this.setPitch(r):this.fire(new i.x("pitchstart")).fire(new i.x("pitch")).fire(new i.x("pitchend")),this;throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(r){if((r=r??85)>85)throw Error("maxPitch must be less than or equal to 85");if(r>=this.transform.minPitch)return this.transform.maxPitch=r,this._update(),this.getPitch()>r?this.setPitch(r):this.fire(new i.x("pitchstart")).fire(new i.x("pitch")).fire(new i.x("pitchend")),this;throw Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getScaleFactor(){return this._scaleFactor}setScaleFactor(i){return this._scaleFactor=i,this.painter.scaleFactor=i,this.style&&this.style._setLabelPlacementStale(),this.style._updateFilteredLayers(i=>"symbol"===i.type),this._update(!0),this}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(i){return this.transform.renderWorldCopies=i,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(i){return"auto"===i?navigator.language:Array.isArray(i)?0===i.length?void 0:i.map(i=>"auto"===i?navigator.language:i):i}setLanguage(i){let r=this._parseLanguage(i);if(!this.style||r===this._language)return this;for(let i of(this._language=r,this.style.reloadSources(),this._controls))i._setLanguage&&i._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(i){return this.style&&i!==this._worldview&&(this._worldview=i,this._styleDirty=!0,this.style.setWorldview(i)),this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(i){return this._lazyInitEmptyStyle(),i?"string"==typeof i&&(i={name:i}):i=null,this._useExplicitProjection=!!i,this._prioritizeAndUpdateProjection(i,this.style.projection)}_updateProjectionTransition(){let r;if("globe"!==this.getProjection().name)return;let n=this.transform,a=n.projection.name;"globe"===a&&n.zoom>=i.R?(n.setMercatorFromTransition(),r=!0):"mercator"===a&&n.zoom<i.R&&(n.setProjection({name:"globe"}),r=!0),r&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayer
117Update(),this._update(!0))}_prioritizeAndUpdateProjection(i,r){return this._updateProjection(i||r||{name:"mercator"})}_updateProjection(r){let n,a=this.transform.mercatorFromTransition;n="globe"===r.name&&this.transform.zoom>=i.R?this.transform.setMercatorFromTransition():this.transform.setProjection(r),this.style.applyProjectionUpdate();let o="mercator"===this.transform.getProjection().name&&a!==this.transform.mercatorFromTransition;return(n||o)&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(r,n){return this.transform.locationPoint3D(i.ab.convert(r),n)}unproject(r,n){return this.transform.pointLocation3D(i.au.convert(r),n)}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(i,r,n){let a=i=>{let n=[];if(Array.isArray(r)){let a=r.filter(i=>this.getLayer(i));n=a.length?this.queryRenderedFeatures(i,{layers:a}):[]}else n=this.queryRenderedFeatures(i,{target:r});return n};if("mouseenter"===i||"mouseover"===i){let o=!1,s=r=>{let s=a(r.point);s.length?o||(o=!0,n.call(this,new sv(i,this,r.originalEvent,{features:s}))):o=!1};return{listener:n,targets:r,delegates:{mousemove:s,mouseout:()=>{o=!1}}}}if("mouseleave"===i||"mouseout"===i){let o=!1,s=r=>{a(r.point).length?o=!0:o&&(o=!1,n.call(this,new sv(i,this,r.originalEvent)))},l=r=>{o&&(o=!1,n.call(this,new sv(i,this,r.originalEvent)))};return{listener:n,targets:r,delegates:{mousemove:s,mouseout:l}}}{let o=i=>{let r=a(i.point);r.length&&(i.features=r,n.call(this,i),delete i.features)};return{listener:n,targets:r,delegates:{[i]:o}}}}on(i,r,n){if("function"==typeof r||void 0===n)return super.on(i,r);if("string"==typeof r&&(r=[r]),!this._areTargetsValid(r))return this;let a=this._createDelegatedListener(i,r,n);for(let r in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[i]=this._delegatedListeners[i]||[],this._delegatedListeners[i].push(a),a.delegates)this.on(r,a.delegates[r]);return this}once(i,r,n){if("function"==typeof r||void 0===n)return super.once(i,r);if("string"==typeof r&&(r=[r]),!this._areTargetsValid(r))return this;let a=this._createDelegatedListener(i,r,n);for(let i in a.delegates)this.once(i,a.delegates[i]);return this}off(r,n,a){if("function"==typeof n||void 0===a)return super.off(r,n);if("string"==typeof n&&(n=[n]),!this._areTargetsValid(n))return this;let o=this._delegatedListeners?this._delegatedListeners[r]:void 0;return o&&(r=>{for(let o=0;o<r.length;o++){let s=r[o];if(s.listener===a&&function(r,n){if(Array.isArray(r)&&Array.isArray(n)){let i=new Set(r),a=new Set(n);return i.size===a.size&&r.every(i=>a.has(i))}return i.c2(r,n)}(s.targets,n)){for(let i in s.delegates)this.off(i,s.delegates[i]);return r.splice(o,1),this}}})(o),this}queryRenderedFeatures(r,n){if(!this.style)return[];if(void 0===r||r instanceof i.au||Array.isArray(r)||void 0!==n||(n=r,r=void 0),r=r||[[0,0],[this.transform.width,this.transform.height]],!n){let i=this.style.queryRenderedFeatures(r,void 0,this.transform),n=this.style.queryRenderedFeatureset(r,void 0,this.transform);return i.concat(n)}let a=!0;if(n.target&&(a=this._isTargetValid(n.target))&&!n.layers)return this.style.queryRenderedFeatureset(r,n,this.transform);let o=!0;if(n.layers&&Array.isArray(n.layers)){for(let i of n.layers)if(!this._isValidId(i)){o=!1;break}if(o&&!n.target)return this.style.queryRenderedFeatures(r,n,this.transform)}let s=[];return o&&(s=s.concat(this.style.queryRenderedFeatures(r,n,this.transform))),a&&(s=s.concat(this.style.queryRenderedFeatureset(r,n,this.transform))),s}querySourceFeatures(i,r){return i&&("string"!=typeof i||this._isValidId(i))?this.style.querySourceFeatures(i,r):[]}queryRasterValue(i,r,n){return this._isValidId(i)?this.style.queryRasterValue(i,r,n):Promise.resolve(null)}isPointOnSurface(r){let{name:n}=this.transform.projection;return"globe"!==n&&"mercator"!==n&&i.f_(`${n} projection does not support isPointOnSurface, this API may behave unex
117pectedly.`),this.transform.isPointOnSurface(i.au.convert(r))}addInteraction(i,r){return this._interactions.add(i,r),this}removeInteraction(i){return this._interactions.remove(i),this}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(i){return this._cooperativeGestures=i,this}setStyle(r,n){return n=Object.assign({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily,fontstackCompositing:this._fontstackCompositing},n),this.style&&r&&!1!==n.diff&&n.localFontFamily===this._localFontFamily&&n.localIdeographFontFamily===this._localIdeographFontFamily&&n.fontstackCompositing===this._fontstackCompositing&&!n.config?(this.style._diffStyle(r,(a,o)=>{if(a){let o="string"==typeof a?a:a instanceof Error?a.message:a.error;i.f_(`Unable to perform style diff: ${o}. Rebuilding the style from scratch.`),this._updateStyle(r,n)}else o&&this._update(!0)},()=>this._postStyleLoadEvent()),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._localFontFamily=n.localFontFamily,this._fontstackCompositing=n.fontstackCompositing,this._updateStyle(r,n))}_getUIString(i){let r=this._locale[i];if(null==r)throw Error(`Missing UI string '${i}'`);return r}_updateStyle(i,r){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),i){let n=Object.assign({},r);r&&r.config&&(n.initialConfig=r.config,delete n.config),this.style=new ab(this,n).load(i),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new ab(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(i.f_("There is no style added to the map."),!1)}_isValidId(r){return null==r?(this.fire(new i.v(Error("IDs can't be empty."))),!1):!i.dx(r)||(this.fire(new i.v(Error(`IDs can't contain special symbols: "${r}".`))),!1)}_isTargetValid(i){return"featuresetId"in i?this._isValidId("importId"in i?i.importId:i.featuresetId):"layerId"in i&&this._isValidId(i.layerId)}_areTargetsValid(i){if(Array.isArray(i)){for(let r of i)if(!this._isValidId(r))return!1;return!0}return this._isTargetValid(i)}addSource(i,r){return this._isValidId(i)?(this._lazyInitEmptyStyle(),this.style.addSource(i,r),this._update(!0)):this}isSourceLoaded(i){return!!this._isValidId(i)&&!!this.style&&this.style._isSourceCacheLoaded(i)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(i,r,n){this._lazyInitEmptyStyle(),this.style.addSourceType(i,r,n)}removeSource(i){return this._isValidId(i)?(this.style.removeSource(i),this._updateTerrain(),this._update(!0)):this}getSource(i){return this._isValidId(i)?this.style.getOwnSource(i):null}addImage(r,n,{pixelRatio:a=1,sdf:o=!1,stretchX:s,stretchY:l,content:u}={}){this._lazyInitEmptyStyle();let c=i.a1.from(r);if(n instanceof HTMLImageElement||ImageBitmap&&n instanceof ImageBitmap){let{width:r,height:d,data:h}=i.co.getImageData(n);this.style.addImage(c,{data:new i.ay({width:r,height:d},h),pixelRatio:a,stretchX:s,stretchY:l,content:u,sdf:o,version:0,usvg:!1})}else if(void 0===n.width||void 0===n.height)this.fire(new i.v(Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{let{width:d,height:h}=n;this.style.addImage(c,{data:new i.ay({width:d,height:h},new Uint8Array(n.data)),pixelRatio:a,stretchX:s,stretchY:l,content:u,sdf:o,usvg:!1,version:0,userImage:n}),n.onAdd&&n.onAdd(this,r)}}updateImage(r,n){this._lazyInitEmptyStyle();let a=i.a1.from(r),o=this.style.getImage(a);if(!o)return void this.fire(new i.v(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:s,height:l,data:u}=n instanceof HTMLImageElement||ImageBitmap&&n instanceof ImageBitmap?i.co.getImageData(n):n;if(void 0===s||void 0===l)return void this.fire(new i.v(Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(s!==(o.usvg?o.icon.usvg_tree.width:o.data.width)||l!==(o.usvg?o.icon.usvg_tree.height:o.data.height))return void this.fire(new i.v(Error(`The width and height of the updated image (${s}, ${l})
118                must be that same as the previous version of the image
119                (${o.data.width}, ${o.data.height})`)));let c=!(n instanceof HTMLImageElement||ImageBitmap&&n instanceof ImageBitmap),d=!1;o.usvg?(o.data=new i.ay({width:s,height:l},new Uint8Array(u)),o.usvg=!1,o.icon=void 0,d=!0):o.data.replace(u,c),this.style.updateImage(a,o,d)}hasImage(r){return r?!!this.style&&!!this.style.getImage(i.a1.from(r)):(this.fire(new i.v(Error("Missing required image id"))),!1)}removeImage(r){this.style.removeImage(i.a1.from(r))}loadImage(r,n){i.cQ(this._requestManager.transformRequest(r,i.aH.Image),(i,r)=>
119{n(i,r)})}listImages(){return this.style.listImages().map(i=>i.name)}addModel(i,r){this._lazyInitEmptyStyle(),this.style.addModel(i,r)}hasModel(r){return r?this.style.hasModel(r):(this.fire(new i.v(Error("Missing required model id"))),!1)}removeModel(i){this.style.removeModel(i)}listModels(){return this.style.listModels()}addLayer(i,r){return this._isValidId(i.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(i,r),this._update(!0)):this}getSlot(i){let r=this.getLayer(i);return r&&r.slot||null}setSlot(i,r){return this.style.setSlot(i,r),this.style.mergeLayers(),this._update(!0)}addImport(r,n){return this.style.addImport(r,n).catch(r=>this.fire(new i.v(Error("Failed to add import",r)))),this}updateImport(i,r){return"string"!=typeof r&&r.id!==i?(this.removeImport(i),this.addImport(r)):(this.style.updateImport(i,r),this._update(!0))}removeImport(i){return this.style.removeImport(i),this}moveImport(i,r){return this.style.moveImport(i,r),this._update(!0)}moveLayer(i,r){return this._isValidId(i)?(this.style.moveLayer(i,r),this._update(!0)):this}removeLayer(i){return this._isValidId(i)?(this.style.removeLayer(i),this._update(!0)):this}getLayer(i){if(!this._isValidId(i))return null;let r=this.style.getOwnLayer(i);return r?"custom"===r.type?r.implementation:r.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(i,r,n){return this._isValidId(i)?(this.style.setLayerZoomRange(i,r,n),this._update(!0)):this}setFilter(i,r,n={}){return this._isValidId(i)?(this.style.setFilter(i,r,n),this._update(!0)):this}getFilter(i){return this._isValidId(i)?this.style.getFilter(i):null}setPaintProperty(i,r,n,a={}){return this._isValidId(i)?(this.style.setPaintProperty(i,r,n,a),this._update(!0)):this}getPaintProperty(i,r){return this._isValidId(i)?this.style.getPaintProperty(i,r):null}setLayoutProperty(i,r,n,a={}){return this._isValidId(i)?(this.style.setLayoutProperty(i,r,n,a),this._update(!0)):this}getLayoutProperty(i,r){return this._isValidId(i)?this.style.getLayoutProperty(i,r):null}getLayerProperty(i,r){return this._isValidId(i)?this.style.getLayerProperty(i,r):null}setLayerProperty(i,r,n,a={}){return this._isValidId(i)?("appearances"===r&&this._postAddingAppearancesToStyleEvent(),this.style.setLayerProperty(i,r,n,a),this._update(!0)):this}getGlyphsUrl(){return this.style.getGlyphsUrl()}setGlyphsUrl(i){return this.style.setGlyphsUrl(i),this._update(!0)}getSchema(i){return this.style.getSchema(i)}setSchema(i,r){return this.style.setSchema(i,r),this._update(!0)}getConfig(i){return this.style.getConfig(i)}setConfig(i,r){return this.style.setConfig(i,r),this._update(!0)}getConfigProperty(i,r){return this.style.getConfigProperty(i,r)}setConfigProperty(i,r,n){return this.style.setConfigProperty(i,r,n),this._update(!0)}getFeaturesetDescriptors(i){return this.style.getFeaturesetDescriptors(i)}setLights(i){if(this._lazyInitEmptyStyle(),i&&1===i.length&&"flat"===i[0].type){let r=i[0];r.properties?this.style.setFlatLight(r.properties,r.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(i),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){let i=this.style.getLights()||[];return 0===i.length&&i.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),i}setLight(i,r={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:i}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(i){return this._lazyInitEmptyStyle(),!i&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(i),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(i){return this._lazyInitEmptyStyle(),this.style.setFog(i),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setSnow(i){return this._lazyInitEmptyStyle(),this.style.setSnow(i),this._update(!0)}getSnow(){return this.style?this.style.getSnow():null}setRain(i){return this._lazyInitEmptyStyle(),this.style.setRain(i),this._update(!0)}getRain(){return this.style?this.style.getRain():null}setColorTheme(i){return this._lazyInitEmptyStyle(),this.style.setColorTheme(i),this._update(!0)}setImportColorTheme(i,r){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(i,r),this._update(!0)}setCamera(i){return this.style.setCamera(i),this._triggerCameraUpdate(i)}getNearClipOffset(){return this.transform.nearClipOffset}setNearClipOffset(i){let r=this.transform.nearClipOffset!==i;return this.transform.nearClipOffset=i,this._update(r)}_triggerCameraUpdate(i){return this._update(this.transform.setOrthogra
119phicProjectionAtLowPitch("orthographic"===i["camera-projection"]))}getCamera(){return this.style.camera}_queryFogOpacity(r){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(i.ab.convert(r),this.transform):0}setFeatureState(i,r){return i.source&&!this._isValidId(i.source)?this:(this.style.setFeatureState(i,r),this._update())}removeFeatureState(i,r){return i.source&&!this._isValidId(i.source)?this:(this.style.removeFeatureState(i,r),this._update())}getFeatureState(i){return i.source&&!this._isValidId(i.source)?null:this.style.getFeatureState(i)}_selectIndoorFloor(i){this.style.indoorManager&&this.style.indoorManager.selectFloor(i)}_setIndoorActiveFloorsVisibility(i){this.style.indoorManager&&this.style.indoorManager.setActiveFloorsVisibility(i)}getIndoorTileOptions(i,r){return this.style&&this.style.isIndoorEnabled()&&this.style.indoorManager?this.style.indoorManager.getIndoorTileOptions(i,r):null}_updateContainerDimensions(){if(!this._container)return;let i=this._container.getBoundingClientRect().width||400,r=this._container.getBoundingClientRect().height||300,n,a,o,s=this._container;for(;s&&(!a||!o);){let i=window.getComputedStyle(s).transform;i&&"none"!==i&&((n=i.match(lu)[1].split(", "))[0]&&"0"!==n[0]&&"1"!==n[0]&&(a=n[0]),n[3]&&"0"!==n[3]&&"1"!==n[3]&&(o=n[3])),s=s.parentElement}this._containerWidth=a?Math.abs(i/a):i,this._containerHeight=o?Math.abs(r/o):r}_detectMissingCSS(){"rgb(250, 128, 114)"!==window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&i.f_("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(){let i=this._container;i.classList.add("mapboxgl-map"),(this._missingCSSCanary=x("div","mapboxgl-canary",i)).style.visibility="hidden",this._detectMissingCSS();let r=this._canvasContainer=x("div","mapboxgl-canvas-container",i);this._canvas=x("canvas","mapboxgl-canvas",r),this._interactive&&(r.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);let n=this._controlContainer=x("div","mapboxgl-control-container",i),a=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach(i=>{a[i]=x("div",`mapboxgl-ctrl-${i}`,n)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(r,n){let a=i.co.devicePixelRatio||1;this._canvas.width=a*Math.ceil(r),this._canvas.height=a*Math.ceil(n),this._canvas.style.width=`${r}px`,this._canvas.style.height=`${n}px`}_addMarker(i){this._markers.push(i)}_removeMarker(i){let r=this._markers.indexOf(i);-1!==r&&this._markers.splice(r,1)}_addPopup(i){this._popups.push(i)}_removePopup(i){let r=this._popups.indexOf(i);-1!==r&&this._popups.splice(r,1)}_setupPainter(){let r=Object.assign({},g,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl2",r);n?(ec(n,!0),this.painter=new so(n,this._contextCreateOptions,this.transform,this._scaleFactor,this._worldview),this.on("data",i=>{if("source"===i.dataType){let r=this.transform.elevation?this.transform.elevation._source():null;r&&i.sourceCacheId===r.id&&this.style&&this.style._setLabelPlacementStale(),this.painter.setTileLoadedFlag(!0)}}),i.cn.testSupport(n)):this.fire(new i.v(Error("Failed to initialize WebGL")))}_contextLost(r){r.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.style&&this.style.handleContextLost(),this.fire(new i.x("webglcontextlost",{originalEvent:r}))}_contextRestored(r){this._setupPainter(),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight)),this._updateTerrain(),this.style&&(this.style.clearLayers(),this.style.imageManager.destroyAtlasTextures(),this.style.imageManager.imageAtlasCache.destroyTextures(),this.style.reloadModels(),this.style.clearSources()),this._update(),this.fire(new i.x("webglcontextrestored",{originalEvent:r}))}_onMapScroll(i){if(i.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(i){return this.style&&(this._styleDirty=this._styleDirty||i,this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(i){return this._update(),this._renderTaskQueue.add(i)}_cancelRenderFrame(i){this._renderTaskQueue.remove(i)}_requestDomTask(i){!this.loaded()||this.loaded()&&!this.isMoving()?i():this._domRenderTaskQueue.add(i)}_render(r){let n;this.fire(new i.x("renderstart")),++this._frameId;let a=this.painter.context.extTimerQuery,o=i.co.now(),s=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(n=s.createQuery(),s.beginQuery(a.TIME_ELAPSED_EXT,n)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&
119(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(r),this._domRenderTaskQueue.run(r),this._removed)return;this._updateProjectionTransition();let l=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;let r=this.transform.zoom,n=this.transform.pitch,a=i.co.now(),o=new i.w(r,{now:a,fadeDuration:l,pitch:n,transition:this.style.transition,worldview:this._worldview});this.style.update(o)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let u=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),u=this._updateAverageElevation(o),this.style.updateSources(this.transform),this.style.updateImageProviders(),this.isMoving()||this._forceMarkerAndPopupUpdate()):u=this._updateAverageElevation(o),this.style&&(this._placementDirty=this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,l,this._crossSourceCollisions,this.painter.replacementSource,this._placementAlgorithm)),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:l,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new i.x("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,p.mark(f.load),this.fire(new i.x("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=!0),this.style&&this.style.imageManager.hasPatternsInFlight()&&(this._styleDirty=!0),this.style&&!this.style.modelManager.isLoaded()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),n){let r=i.co.now()-o;s.endQuery(a.TIME_ELAPSED_EXT),setTimeout(()=>{let a=s.getQueryParameter(n,s.QUERY_RESULT)/1e6;s.deleteQuery(n),this.fire(new i.x("gpu-timing-frame",{cpuTime:r,gpuTime:a}))},50)}if(this.listens("gpu-timing-layer")){let r=this.painter.collectGpuTimers();setTimeout(()=>{let n=this.painter.queryGpuTimers(r);this.fire(new i.x("gpu-timing-layer",{layerTimes:n}))},50)}if(this.listens("gpu-timing-deferred-render")){let r=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{let n=this.painter.queryGpuTimeDeferredRender(r);this.fire(new i.x("gpu-timing-deferred-render",{gpuTime:n}))},50)}let c=this._sourcesDirty||this._styleDirty||this._placementDirty||u;if(c||this._repaint)this.triggerRepaint();else{let r=this.idle();if(r&&(u=this._updateAverageElevation(o,!0)),u)this.triggerRepaint();else{if(this._triggerFrame(!1),r&&(this.fire(new i.x("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){let r=this._calculateSpeedIndex();this.fire(new i.x("speedindexcompleted",{speedIndex:r})),this.speedIndexTiming=!1}r&&this.style&&this.style.handleIdle()}}!this._loaded||this._fullyLoaded||c||(this._fullyLoaded=!0,p.mark(f.fullLoad),this._performanceMetricsCollection&&eo(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(i){for(let r of this._markers)i&&!this.getRenderWorldCopies()&&(r._lngLat=r._lngLat.wrap()),r._update();for(let r of this._popups)!i||this.getRenderWorldCopies()||r._trackPointer||(r._lngLat=r._lngLat.wrap()),r._update()}_updateAverageElevation(i,r=!1){let n=i=>(this.transform.averageElevation=i,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&n(0);let a=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(a||(r||i-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(i)){let r=this.transform.averageElevation,o=this.transform.sampleAverageElevation();null!=this.transform.elevation&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(o)?o=0:this._averageElevationLastSampledAt=i;let s=Math.abs(r-o);if(s>
1191){if(this._isInitialLoad||a)return this._averageElevation.jumpTo(o),n(o);this._averageElevation.easeTo(o,i,300)}else if(s>1e-4)return this._averageElevation.jumpTo(o),n(o)}return!!this._averageElevation.isEasing(i)&&n(this._averageElevation.getValue(i))}_isTokenExpired(){return null!=this._tokenExpiration&&Date.now()>this._tokenExpiration}_revokeAuth(){let r=this.painter.context.gl;ec(r,!1),this._logoControl instanceof lr&&this._logoControl._updateLogo(),r&&r.clear(r.DEPTH_BUFFER_BIT|r.COLOR_BUFFER_BIT|r.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new i.v(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/")))}_authenticate(){el(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,i=>{i&&(i.message!==N&&401!==i.status||this._revokeAuth())}),this._isTokenExpired()&&this._revokeAuth(),Q(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_postStyleLoadEvent(){this.style.globalId&&ee(this._requestManager._customAccessToken,{map:this,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_postStyleWithAppearanceEvent(){this.style.globalId&&this.style.hasAppearances()&&ei(this._requestManager._customAccessToken)}_postAddingAppearancesToStyleEvent(){en(this._requestManager._customAccessToken)}_updateTerrain(){let i=this._isDragging();this.painter.updateTerrain(this.style,i)}_calculateSpeedIndex(){let i=this.painter.canvasCopy(),r=this.painter.getCanvasCopiesAndTimestamps();r.timeStamps.push(performance.now());let n=this.painter.context.gl,a=n.createFramebuffer();function o(i){n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,i,0);let r=new Uint8Array(n.drawingBufferWidth*n.drawingBufferHeight*4);return n.readPixels(0,0,n.drawingBufferWidth,n.drawingBufferHeight,n.RGBA,n.UNSIGNED_BYTE,r),r}return n.bindFramebuffer(n.FRAMEBUFFER,a),this._canvasPixelComparison(o(i),r.canvasCopies.map(o),r.timeStamps)}_canvasPixelComparison(i,r,n){let a=n[1]-n[0],o=i.length/4;for(let s=0;s<r.length;s++){let l=r[s],u=0;for(let r=0;r<l.length;r+=4)l[r]===i[r]&&l[r+1]===i[r+1]&&l[r+2]===i[r+2]&&l[r+3]===i[r+3]&&(u+=1);a+=(n[s+2]-n[s+1])*(1-u/o)}return a}remove(){if(this._removed)return;for(let i of(this._hash&&this._hash.remove(),this._controls))i.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),window.removeEventListener("resize",this._onWindowResize,!1),window.removeEventListener("orientationchange",this._onWindowResize,!1),window.removeEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.removeEventListener("online",this._onWindowOnline,!1),window.removeEventListener("visibilitychange",this._onVisibilityChange,!1);let r=this.painter.context.gl.getExtension("WEBGL_lose_context");r&&r.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),eu.delete(this.painter.context.gl),es.remove(),X.remove(),this._removed=!0,this.fire(new i.x("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(r){this._renderNextFrame=this._renderNextFrame||r,this.style&&!this._frame&&(this._frame=i.co.frame(i=>{let r=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,r&&this._render(i)}))}_preloadTiles(r){let n=this.style?this.style.getSourceCaches():[];return i.bp(n,(i,n)=>i._preloadTiles(r,n),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(i){this._trackResize&&this.resize({originalEvent:i})._update()}_onVisibilityChange(){"hidden"===document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(i){this._showTileBoundaries!==i&&(this._showTileBoundaries=i,this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(i){this._showParseStatus!==i&&(this._showParseStatus=i,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(i){this._showTerrainWireframe!==i&&(this._showTerrainWireframe=i,this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(i){this._showLayers2DWireframe!==i&&(this._showLayers2DWireframe=i,this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(i){this._showLayers3DWireframe!==i&&(this._showLayers3DWireframe=i,this._update())}get showElevationIdDebug(){return!!this.painter&&this.painter._debugParams.showElevationIdDebug}set showElevationIdDebug(i){this.painter&&this.painter._debugParams.showElevationIdDebug!==i&&(this.painter._debugParams.showElevationIdDebug=i,this.style&&i?this.style._reloadSources():this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(i){this._speedIndexTiming!==i&&(this._speedIndexTiming=i,this._update())}get showPadding(){return!!this._showPadding}set showPadding(i){this._showPadding!==i&&(this._showPadding=i,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(i){this._showCollisionBoxes!==i&&(this._showCollisionBoxes=i,this.style&&i?this.style._reloadSources():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(i){this._showOverdrawInspector!==i&&(this._showOverdrawInspector=i,this._update())}get repaint(){return!!this._repaint}set repaint(i){this._repaint!==i&&(this._repaint=i,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(i){this._vertices=i,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(i){this._showTileAABBs!==i&&(this._showTileAABBs=i,i&&this._update())}_setCacheLimits(r,n){i.fj(r,n)}get version(){return h}},NavigationControl:class{constructor(r={}){this.options=Object.assign({},ld,r),this._container=x("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",i=>i.preventDefault()),this.options.showZoom&&(i.bs(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",i=>{this._map&&this._map.zoomIn({},{originalEvent:i})}),x("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",i=>{this._map&&this._map.zoomOut({},{originalEvent:i})}),x("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(i.bs(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",i=>{let r=this._map;r&&(this.options.visualizePitch?r.resetNorthPitch({},{originalEvent:i}):r.resetNorth({},{originalEvent:i}))}),this._compassIcon=x("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){let i=this._map;if(!i)return;let r=i.getZoom(),n=r===i.getMaxZoom(),a=r===i.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=a,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",a.toString())}_rotateCompassArrow(){let i=this._map;if(!i)return;let r=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(i.transform.pitch*(Math.PI/180)
119),.5)}) rotateX(${i.transform.pitch}deg) rotateZ(${i.transform.angle*(180/Math.PI)}deg)`:`rotate(${i.transform.angle*(180/Math.PI)}deg)`;i._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=r)})}onAdd(i){return this._map=i,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),i.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&i.on("pitch",this._rotateCompassArrow),i.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new lh(i,this._compass,this.options.visualizePitch)),this._container}onRemove(){let i=this._map;i&&(this._container.remove(),this.options.showZoom&&i.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&i.off("pitch",this._rotateCompassArrow),i.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(i,r){let n=x("button",i,this._container);return n.type="button",n.addEventListener("click",r),n}_setButtonTitle(i,r){if(!this._map)return;let n=this._map._getUIString(`NavigationControl.${r}`);i.setAttribute("aria-label",n),i.firstElementChild&&i.firstElementChild.setAttribute("title",n)}},GeolocateControl:class extends i.y{constructor(r={}){super();const n=navigator.geolocation;this.options=Object.assign({geolocation:n},lv,r),i.bs(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=ss(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(i){return this._map=i,this._container=x("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._clearRequestTimeout(),void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(i){let r=(r=!!this.options.geolocation)=>{this._supportsGeolocation=r,i(r)};void 0!==this._supportsGeolocation?i(this._supportsGeolocation):void 0!==navigator.permissions?navigator.permissions.query({name:"geolocation"}).then(i=>r("denied"!==i.state)).catch(()=>r()):r()}_isOutOfMapMaxBounds(i){let r=this._map.getMaxBounds(),n=i.coords;return!!r&&(n.longitude<r.getWest()||n.longitude>r.getEast()||n.latitude<r.getSouth()||n.latitude>r.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(r){if(this._map){if(this._clearRequestTimeout(),this._isOutOfMapMaxBounds(r))return this._setErrorState(),this.fire(new i.x("outofmaxbounds",r)),this._updateMarker(),void this._finish();if(this._lastKnownPosition=r,this.options.trackUserLocation)switch(this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this.options.followUserLocation?(this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active")):(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"));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(r),this.options.followUserLocation&&(!this.options.trackUserLocation||"ACTIVE_LOCK"===this._watchState)&&this._updateCamera(r),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new i.x("geolocate",Object.assign({coords:r.coords,timestamp:r.timestamp},r.toJSON?{toJSON:r.toJSON.bind(r)}:{}))),this._finish()}}
119_updateCamera(r){let n=new i.ab(r.coords.longitude,r.coords.latitude),a=r.coords.accuracy,o=Object.assign({bearing:this._map.getBearing()},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(a),o,{geolocateSource:!0})}_updateMarker(r){if(r){let n=new i.ab(r.coords.longitude,r.coords.latitude);this.options.showAccuracyCircle?this._accuracyCircleMarker.setLngLat(n).addTo(this._map):this._accuracyCircleMarker.remove(),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=r.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){let r=this._map.transform,n=i.em(1,r._center.lat)*r.worldSize,a=Math.ceil(2*this._accuracy*n);this._circleElement.style.width=`${a}px`,this._circleElement.style.height=`${a}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(r){if(this._map){if(this._clearRequestTimeout(),this.options.trackUserLocation)if(1===r.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;let i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",i),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",i),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===r.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new i.x("error",{code:r.code,message:r.message,PERMISSION_DENIED:r.PERMISSION_DENIED,POSITION_UNAVAILABLE:r.POSITION_UNAVAILABLE,TIMEOUT:r.TIMEOUT})),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_startRequestTimeout(){this._clearRequestTimeout();let i=this.options.positionOptions.timeout;i&&(this._requestTimeoutId=window.setTimeout(()=>{this._onError({code:3,message:"Geolocation request timed out"})},i))}_clearRequestTimeout(){void 0!==this._requestTimeoutId&&(clearTimeout(this._requestTimeoutId),this._requestTimeoutId=void 0)}_setupUI(r){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",i=>i.preventDefault()),this._geolocateButton=x("button","mapboxgl-ctrl-geolocate",this._container),x("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===r){i.f_("Geolocation support is not available so the GeolocateControl will be disabled.");let r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}else{let i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",i),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._createUserLocationMarkers(),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.showButton||(this._container.style.display="none"),this.options.trackUserLocation&&this._map.on("movestart",r=>{r.geolocateSource||"ACTIVE_LOCK"!==this._watchState||r.originalEvent&&"resize"===r.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new i.x("trackuserlocationend")))}),this.fire(new i.x("ready"))}}_onDeviceOrientation(i){this._userLocationDotMarker&&(i.webkitCompassHeading?this._heading=i.webkitCompassHeading:!0===i.absolute&&(this._heading=-1*i.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return i.f_("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 i.x("trackuserlocationstart"));break;
119case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new i.x("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 i.x("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 i;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(i={maximumAge:6e5,timeout:0},this._noTimeout=!0):(i=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,i),this._startRequestTimeout(),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._startRequestTimeout(),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}setFollowUserLocation(r){return this.options.followUserLocation=null!=r?r:lv.followUserLocation,this.options.trackUserLocation&&"OFF"!==this._watchState&&(this.options.followUserLocation?"BACKGROUND"!==this._watchState&&"BACKGROUND_ERROR"!==this._watchState||(this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new i.x("trackuserlocationstart"))):"ACTIVE_LOCK"!==this._watchState&&"ACTIVE_ERROR"!==this._watchState||(this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this.fire(new i.x("trackuserlocationend")))),this}setShowAccuracyCircle(r){if(this.options.showAccuracyCircle=null!=r?r:lv.showAccuracyCircle,!this._accuracyCircleMarker)return this;if(this.options.showAccuracyCircle){if(this.options.showUserLocation&&this._lastKnownPosition){let{longitude:r,latitude:n,accuracy:a}=this._lastKnownPosition.coords;this._accuracy=a,this._accuracyCircleMarker.setLngLat(new i.ab(r,n)).addTo(this._map),this._updateCircleRadius()}}else this._accuracyCircleMarker.remove();return this}setShowUserHeading(i){return this.options.showUserHeading=null!=i?i:lv.showUserHeading,this._setup&&(this.options.showUserHeading?void 0!==this._geolocationWatchID&&this._addDeviceOrientationListener():(this._removeDeviceOrientationListener(),this._heading=void 0,this._userLocationDotMarker&&this._updateMarkerRotation())),this}setFitBoundsOptions(i){return this.options.fitBoundsOptions=null!=i?i:lv.fitBoundsOptions,this}setShowUserLocation(i){return this.options.showUserLocation=null!=i?i:lv.showUserLocation,this._setup&&(this.options.showUserLocation?(this._userLocationDotMarker||(this._createUserLocationMarkers(),this._map.on("zoom",this._onZoom)),this._lastKnownPosition&&(void 0===this._watchState||"OFF"!==this._watchState)&&this._updateMarker(this._lastKnownPosition)):(this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this._accuracyCircleMarker&&this._accuracyCircleMarker.remove())),this}_addDeviceOrientationListener(){let i=()=>{let i="ondeviceorientationabsolute"in window?"deviceorientationabsolute":"deviceorientation";window.addEventListener(i,this._onDeviceOrientation)};"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(r=>{"granted"===r&&i()}).catch(console.error):i()}_removeDeviceOrientationListener(){window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation)}_createUserLocationMarkers(){this._dotElement=x("div","mapboxgl-user-location"),this._dotElement.appendChild(x("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(x("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new ly({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=x("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ly({element:this._circleElement,pitchAlignment:"map"})}_clearWatch(){this._clearRequestTimeout(),this.options.geolocation.clearWatch(this._geolocationWatchID),this._removeDeviceOrientationListener(),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
119se"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:li,ScaleControl:class{constructor(r={}){this.options=Object.assign({},lx,r),i.bs(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){let i=this.options.maxWidth||100,r=this._map,n=r._containerHeight/2,a=r._containerWidth/2-i/2,o=r.unproject([a,n]),s=r.unproject([a+i,n]),l=o.distanceTo(s);if("imperial"===this.options.unit){let r=3.2808*l;r>5280?this._setScale(i,r/5280,"mile"):this._setScale(i,r,"foot")}else"nautical"===this.options.unit?this._setScale(i,l/1852,"nautical-mile"):l>=1e3?this._setScale(i,l/1e3,"kilometer"):this._setScale(i,l,"meter")}_setScale(i,r,n){this._map._requestDomTask(()=>{var a;let o,s,l,u=(o=Math.pow(10,`${Math.floor(r)}`.length-1),s=r/o,o*(s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:s>=1?1:(l=Math.pow(10,Math.ceil(-Math.log(a=s)/Math.LN10)),Math.round(a*l)/l))),c=u/r;this._container.innerHTML="nautical-mile"!==n?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:n}).format(u):`${u}&nbsp;${lb[n]}`,this._container.style.width=i*c+"px"})}onAdd(i){return this._map=i,this._language=i.getLanguage(),this._container=x("div","mapboxgl-ctrl mapboxgl-ctrl-scale",i.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(i){this._language=i,this._update()}setUnit(i){this.options.unit=i,this._update()}},FullscreenControl:class{constructor(r={}){this._fullscreen=!1,r&&r.container&&(r.container instanceof HTMLElement?this._container=r.container:i.f_("Full screen control 'container' must be a DOM element.")),i.bs(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(r){return this._map=r,this._container||(this._container=this._map.getContainer()),this._controlContainer=x("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",i.f_("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){let i=this._fullscreenButton=x("button","mapboxgl-ctrl-fullscreen",this._controlContainer);x("span","mapboxgl-ctrl-icon",i).setAttribute("aria-hidden","true"),i.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){let i=this._getTitle();this._fullscreenButton.setAttribute("aria-label",i),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",i)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},IndoorControl:class{constructor(){i.bs(["_onIndoorUpdate","_onStyleData","_scrollUp","_scrollDown","_toggleIndoor"],this),this._visibleFloorStart=0,this._lastSelectedFloorId=null}onAdd(i){return this._map=i,this._container=x("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.style.display="none",this._map.on("styledata",this._onStyleData),this._map.on("idle",this._onStyleData),this._updateConnection(),this._container}_onStyleData(){this._updateConnection()}_updateConnection(){if(this._map&&this._map.style&&this._map.style.indoorManager){let i=this._map.style.indoorManager;i.off("selector-update",this._onIndoorUpdate),i.on("selector-update",this._onIndoorUpdate),this._onIndoorUpdate(i.getControlState()),this._map.off("idle",this._onStyleData)}}_createButton(i,r){let n=x("button",i,this._container);return n.type="button",n.addEventListener("click",r),n}_setButtonTitle(i,r){i.setAttribute("aria-label",r),i.textContent=r}onRemove(){this._container&&this._container.remove(),this._map&&(this._map.off("styledata",this._onStyleData),this._map.off("idle",this._onStyleData),this._map.style&&this._map.style.indoorManager&&this._map.style.indoorManager.off("selector-update",this._onIndoorUpdate),this._map=null)}getDefaultPosition(){return"top-right"}_onIndoorUpdate(i){if(!i||!i.floors||0===i.floors.length)return this._model=i,void(this._container.style.display="none");let r=this._model;this._model=i,this._container.style.display="inline-block";let n=!r||r.floors.length!==i.floors.length||r.floors.some((r,n)=>r.id!==i.floors[n].id);if(n&&(this._visibleFloorStart=0,this._lastSelectedFloorId=null),i.selectedFloorId){if(i.selectedFloorId!==this._lastSelectedFloorId||n){let r=i.floors.findIndex(r=>
119r.id===i.selectedFloorId);if(-1!==r){let n,a,o=i.floors.length;o<=5?(n=0,a=o-1):0===this._visibleFloorStart?(n=0,a=3):this._visibleFloorStart>=o-3?(n=o-3-1,a=o-1):(n=this._visibleFloorStart,a=this._visibleFloorStart+3-1),r<n?this._visibleFloorStart=r:r>a&&(this._visibleFloorStart=r-2)}}this._lastSelectedFloorId=i.selectedFloorId}this._render()}_render(){if(!this._container||!this._model||!this._model.floors)return;this._container.innerHTML="";let i=this._createButton("mapboxgl-ctrl-indoor-toggle",this._toggleIndoor);x("span","mapboxgl-ctrl-icon",i).setAttribute("aria-hidden","true"),this._model.activeFloorsVisible||i.classList.add("mapboxgl-ctrl-level-button-selected"),this._container.appendChild(i);let r=this._model.floors,n=r.length;if(n<=5)return void r.forEach(i=>this._createFloorButton(i));let a=0===this._visibleFloorStart,o=this._visibleFloorStart>=n-3;if(a)this._createFloorButton(r[0]);else{let i=this._createButton("mapboxgl-ctrl-arrow-up",this._scrollUp);x("span","mapboxgl-ctrl-icon",i).setAttribute("aria-hidden","true"),this._container.appendChild(i)}if((a?r.slice(1,4):o?r.slice(this._visibleFloorStart-1,this._visibleFloorStart+3-1):r.slice(this._visibleFloorStart,this._visibleFloorStart+3)).forEach(i=>this._createFloorButton(i)),o)this._createFloorButton(r[n-1]);else{let i=this._createButton("mapboxgl-ctrl-arrow-down",this._scrollDown);x("span","mapboxgl-ctrl-icon",i).setAttribute("aria-hidden","true"),this._container.appendChild(i)}}_createFloorButton(i){let r=this._createButton("mapboxgl-ctrl-level-button",()=>{let r=i.id;this._model&&this._model.selectedFloorId===r&&this._model.activeFloorsVisible||this._map&&(this._model&&!this._model.activeFloorsVisible&&this._map.style&&this._map.style.indoorManager&&this._map.style.indoorManager.setActiveFloorsVisibility(!0),this._map._selectIndoorFloor(r))}),n=(i.name||"").trim(),a=i.zIndex.toString(),o=n?Array.from(n).slice(0,3).join(""):a;this._setButtonTitle(r,o),this._model&&this._model.activeFloorsVisible&&i.id===this._model.selectedFloorId&&r.classList.add("mapboxgl-ctrl-level-button-selected"),this._container&&this._container.appendChild(r)}_toggleIndoor(){this._map&&this._map.style&&this._map.style.indoorManager&&this._model&&this._model.activeFloorsVisible&&this._map.style.indoorManager.setActiveFloorsVisibility(!1)}_scrollUp(){if(this._visibleFloorStart>0){this._visibleFloorStart--,1===this._visibleFloorStart&&(this._visibleFloorStart=0);let i=this._model&&this._model.floors||[];if(i.length>3){let r=i.length-3;this._visibleFloorStart===r-1&&(this._visibleFloorStart=r-2)}this._render()}}_scrollDown(){if(this._model&&this._model.floors){let i=this._model.floors.length-3;this._visibleFloorStart<i&&(this._visibleFloorStart++,1===this._visibleFloorStart&&(this._visibleFloorStart=2),this._visibleFloorStart===i-1&&(this._visibleFloorStart=i),this._visibleFloorStart>i&&(this._visibleFloorStart=i),this._render())}}},Popup:class extends i.y{constructor(r){super(),this.options=Object.assign(Object.create(lT),r),this._altitude=this.options.altitude,i.bs(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(r&&r.className?r.className.trim().split(lw):[])}addTo(r){return this._map&&this.remove(),this._map=r,this.options.closeOnClick&&r.on("preclick",this._onClose),this.options.closeOnMove&&r.on("move",this._onClose),r.on("remove",this.remove),this._update(),r._addPopup(this),this._focusFirstElement(),this._trackPointer?(r.on("mousemove",this._onMouseEvent),r.on("mouseup",this._onMouseEvent),r._canvasContainer.classList.add("mapboxgl-track-pointer")):r.on("move",this._update),this.fire(new i.x("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);let r=this._map;return r&&(r.off("move",this._update),r.off("move",this._onClose),r.off("preclick",this._onClose),r.off("click",this._onClose),r.off("remove",this.remove),r.off("mousemove",this._onMouseEvent),r.off("mouseup",this._onMouseEvent),r.off("drag",this._onMouseEvent),r._canvasContainer&&r._canvasContainer.classList.remove("mapboxgl-track-pointer"),r._removePopup(this),this._map=void 0),this.fire(new i.x("close")),this}getLngLat(){return this._lngLat}setLngLat(r){this._lngLat=i.ab.convert(r),this._pos=null,this._trackPointer=!1,this._update();let n=this._map;return n&&(n.on("move",this._update),n.off("mousemove",this._onMouseEvent),n._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}getAltitude(){return this._altitude}setAltitude(i){return this._altitude=i,this._update(),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();let i=this._map;return i&&(i.off("move",this._update),i.on("mousemove",this._onMouseEvent),i.on("drag",this._onMouseEvent),i._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(i){return this.setDOMContent(document.createTextNode(i))}setHTML(i){let r,n=document.createDocumentFragment(),a=document.createElement("body");for(a.innerHTML=i;r=a.firstChild;)n.appendChild(r);return this.setDOMContent(n)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(i){return this.options.maxWidth=i,this._update(),this}setDOMContent(i){let r=this._content;if(r)for(;r.hasChildNodes();)r.firstChild&&r.removeChild(r.firstChild);else r=this._content=x("div","mapboxgl-popup-content",this._container||void 0);
119if(r.appendChild(i),this.options.closeButton){let i=this._closeButton=x("button","mapboxgl-popup-close-button",r);i.type="button",i.setAttribute("aria-label","Close popup"),i.innerHTML='<span aria-hidden="true">&#215;</span>',i.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(i){return this._classList.add(i),this._updateClassList(),this}removeClassName(i){return this._classList.delete(i),this._updateClassList(),this}setOffset(i){return this.options.offset=i,this._update(),this}toggleClassName(i){let r;return this._classList.delete(i)?r=!1:(this._classList.add(i),r=!0),this._updateClassList(),r}_onMouseEvent(i){this._update(i.point)}_getAnchor(i){if(this.options.anchor)return this.options.anchor;let r=this._map,n=this._container,a=this._pos;if(!r||!n||!a)return"bottom";let o=n.offsetWidth,s=n.offsetHeight,l=a.x<o/2,u=a.x>r.transform.width-o/2;if(a.y+i<s)return l?"top-left":u?"top-right":"top";if(a.y>r.transform.height-s){if(l)return"bottom-left";if(u)return"bottom-right"}return l?"left":u?"right":"bottom"}_updateClassList(){let i=this._container;if(!i)return;let r=[...this._classList];r.push("mapboxgl-popup"),this._anchor&&r.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&r.push("mapboxgl-popup-track-pointer"),i.className=r.join(" ")}_update(r){let n=this._map,a=this._content;if(!n||!this._lngLat&&!this._trackPointer||!a)return;let o=this._container;if(o||(o=this._container=x("div","mapboxgl-popup",n.getContainer()),this._tip=x("div","mapboxgl-popup-tip",o),o.appendChild(a)),this.options.maxWidth&&o.style.maxWidth!==this.options.maxWidth&&(o.style.maxWidth=this.options.maxWidth),n.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=lf(this._lngLat,this._pos,n.transform)),!this._trackPointer||r){let a=this._pos=this._trackPointer&&r instanceof i.au?r:n.project(this._lngLat,this._altitude),o=lE(this.options.offset),s=this._anchor=this._getAnchor(o.y),l=lE(this.options.offset,s),u=a.add(l).round();n._requestDomTask(()=>{this._container&&s&&(this._container.style.transform=`${lp[s]} translate(${u.x}px,${u.y}px)`)})}if(!this._marker&&n._showingGlobe()){let r=+!i.dE(n.transform,this._lngLat);this._setOpacity(r)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let i=this._container.querySelector("a[href], [tabindex]:not([tabindex='-1']), [contenteditable]:not([contenteditable='false']), button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])");i&&i.focus()}_onClose(){this.remove()}_setOpacity(i){this._container&&(this._container.style.opacity=`${i}`),this._content&&(this._content.style.pointerEvents=i?"auto":"none")}},Marker:ly,Style:ab,LngLat:i.ab,LngLatBounds:i.ac,Point:i.au,MercatorCoordinate:i.ag,FreeCameraOptions:tG,Evented:i.y,config:i.bN,prewarm:function(){nF().acquire(tk)},clearPrewarmedResources:function(){let i=c;i&&(i.isPreloaded()&&1===i.numActive()?(i.release(tk),c=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 i.bN.ACCESS_TOKEN},set accessToken(t){i.fg(t)},get baseApiUrl(){return i.bN.API_URL},set baseApiUrl(t){i.fh(t)},get workerCount(){return tR.workerCount},set workerCount(e){tR.workerCount=e},get maxParallelImageRequests(){return i.bN.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){i.fm(t)},clearStorage(r){i.bH(r)},get workerUrl(){return tI.workerUrl},set workerUrl(e){tI.workerUrl=e},get workerClass(){return tI.workerClass},set workerClass(e){tI.workerClass=e},get dracoUrl(){return i.cN()},set dracoUrl(t){i.fl(t)},get meshoptUrl(){return i.cW()},set meshoptUrl(t){i.fn(t)},get buildingGenUrl(){return i.cK()},set buildingGenUrl(t){i.fi(t)},setNow:i.co.setNow,restoreNow:i.co.restoreNow}}),n}()},156399,(i,r,n)=>{(function(){var a,o="Expected a function",s="__lodash_hash_undefined__",l="__lodash_placeholder__",u=1/0,c=0/0,d=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],h="[object Arguments]",f="[object Array]",p="[object Boolean]",m="[object Date]",g="[object Error]",_="[object Function]",y="[object GeneratorFunction]",v="[object Map]",x="[object Number]",b="[object Object]",w="[object Promise]",T="[object RegExp]",E="[object Set]",S="[object String]",A="[object Symbol]",C="[object WeakMap]",I="[object ArrayBuffer]",k="[object DataView]",R="[object Float32Array]",M="[object Float64Array
vendor: 7,598 bytes, line 119
119]",L="[object Int8Array]",P="[object Int16Array]",O="[object Int32Array]",D="[object Uint8Array]",F="[object Uint8ClampedArray]",N="[object Uint16Array]",j="[object Uint32Array]",z=/\b__p \+= '';/g,B=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,G=RegExp(V.source),q=RegExp(H.source),$=/<%-([\s\S]+?)%>/g,W=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K=/^\w*$/,X=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,J=RegExp(Q.source),ee=/^\s+/,et=/\s/,ei=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,er=/\{\n\/\* \[wrapped with (.+)\] \*/,en=/,? & /,ea=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,eo=/[()=,{}\[\]\/\s]/,es=/\\(\\)?/g,el=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,eu=/\w*$/,ec=/^[-+]0x[0-9a-f]+$/i,ed=/^0b[01]+$/i,eh=/^\[object .+?Constructor\]$/,ef=/^0o[0-7]+$/i,ep=/^(?:0|[1-9]\d*)$/,em=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,eg=/($^)/,e_=/['\n\r\u2028\u2029\\]/g,ey="\\ud800-\\udfff",ev="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ex="\\u2700-\\u27bf",eb="a-z\\xdf-\\xf6\\xf8-\\xff",ew="A-Z\\xc0-\\xd6\\xd8-\\xde",eT="\\ufe0e\\ufe0f",eE="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",eS="['’]",eA="["+eE+"]",eC="["+ev+"]",eI="["+eb+"]",ek="[^"+ey+eE+"\\d+"+ex+eb+ew+"]",eR="\\ud83c[\\udffb-\\udfff]",eM="[^"+ey+"]",eL="(?:\\ud83c[\\udde6-\\uddff]){2}",eP="[\\ud800-\\udbff][\\udc00-\\udfff]",eO="["+ew+"]",eD="\\u200d",eF="(?:"+eI+"|"+ek+")",eN="(?:"+eO+"|"+ek+")",ej="(?:"+eS+"(?:d|ll|m|re|s|t|ve))?",ez="(?:"+eS+"(?:D|LL|M|RE|S|T|VE))?",eB="(?:"+eC+"|"+eR+")?",eU="["+eT+"]?",eV="(?:"+eD+"(?:"+[eM,eL,eP].join("|")+")"+eU+eB+")*",eH=eU+eB+eV,eG="(?:"+["["+ex+"]",eL,eP].join("|")+")"+eH,eq="(?:"+[eM+eC+"?",eC,eL,eP,"["+ey+"]"].join("|")+")",e$=RegExp(eS,"g"),eW=RegExp(eC,"g"),eY=RegExp(eR+"(?="+eR+")|"+eq+eH,"g"),eZ=RegExp([eO+"?"+eI+"+"+ej+"(?="+[eA,eO,"$"].join("|")+")",eN+"+"+ez+"(?="+[eA,eO+eF,"$"].join("|")+")",eO+"?"+eF+"+"+ej,eO+"+"+ez,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",eG].join("|"),"g"),eK=RegExp("["+eD+ey+ev+eT+"]"),eX=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,eQ=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eJ=-1,e1={};e1[R]=e1[M]=e1[L]=e1[P]=e1[O]=e1[D]=e1[F]=e1[N]=e1[j]=!0,e1[h]=e1[f]=e1[I]=e1[p]=e1[k]=e1[m]=e1[g]=e1[_]=e1[v]=e1[x]=e1[b]=e1[T]=e1[E]=e1[S]=e1[C]=!1;var e0={};e0[h]=e0[f]=e0[I]=e0[k]=e0[p]=e0[m]=e0[R]=e0[M]=e0[L]=e0[P]=e0[O]=e0[v]=e0[x]=e0[b]=e0[T]=e0[E]=e0[S]=e0[A]=e0[D]=e0[F]=e0[N]=e0[j]=!0,e0[g]=e0[_]=e0[C]=!1;var e2={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},e5=parseFloat,e4=parseInt,e9=i.g&&i.g.Object===Object&&i.g,e3="object"==typeof self&&self&&self.Object===Object&&self,e8=e9||e3||Function("return this")(),e6=n&&!n.nodeType&&n,e7=e6&&r&&!r.nodeType&&r,te=e7&&e7.exports===e6,tt=te&&e9.process,ti=function(){try{var i=e7&&e7.require&&e7.require("util").types;if(i)return i;return tt&&tt.binding&&tt.binding("util")}catch(i){}}(),tr=ti&&ti.isArrayBuffer,tn=ti&&ti.isDate,ta=ti&&ti.isMap,to=ti&&ti.isRegExp,ts=ti&&ti.isSet,tl=ti&&ti.isTypedArray;function tu(i,r,n){switch(n.length){case 0:return i.call(r);case 1:return i.call(r,n[0]);case 2:return i.call(r,n[0],n[1]);case 3:return i.call(r,n[0],n[1],n[2])}return i.apply(r,n)}function tc(i,r,n,a){for(var o=-1,s=null==i?0:i.length;++o<s;){var l=i[o];r(a,l,n(l),i)}return a}function td(i,r){for(var n=-1,a=null==i?0:i.length;++n<a&&!1!==r(i[n],n,i););return i}function th(i,r){for(var n=-1,a=null==i?0:i.length;++n<a;)if(!r(i[n],n,i))return!1;return!0}function tf(i,r){for(var n=-1,a=null==i?0:i.length,o=0,s=[];++n<a;){var l=i[n];r(l,n,i)&&(s[o++]=l)}return s}function tp(i,r){return!!(null==i?0:i.length)&&tE(i,r,0)>-1}function tm(i,r,n){for(var a=-1,o=null==i?0:i.length;++a<o;)if(n(r,i[a]))return!0;return!1}function tg(i,r){for(var n=-1,a=null==i?0:i.length,o=Array(a);++n<a;)o[n]=r(i[n],n,i);return o}function t_(i,r){for(var n=-1,a=r.length,o=i.length;++n<a;)i[o+n]=r[n];return i}function ty(i,r,n,a){var o=-1,s=null==i?0:i.length;for(a&&s&&(n=i[++o]);++o<s;)n=r(n,i[o],o,i);return n}function tv(i,r,n,a){var o=null==i?0:i.length;for(a&&o&&(n=i[--o]);o--;)n=r(n,i[o],o,i);return n}function tx(i,r){for(var n=-1,a=null==i?0:i.length;++n<a;)if(r(i[n],n,i))return!0;return!1}var tb=tI("length");function tw(i,r,n){var a;return n(i,function(i,n,o){if(r(i,n,o))return a=n,!1}),a}function tT(i,r,n,a){for(var o=i.length,s=n+(a?1:-1);a?s--:++s<o;)if(r(i[s],s,i))return s;return -1}function tE(i,r,n){return r==r?function(i,r,n){for(var a=n-1,o=i.length;++a<o;)if(i[a]===r)return a;return -1}(i,r,n):tT(i,tA,n)}function tS(i,r,n,a){for(var o=n-1,s=i.length;++o<s;)if(a(i[o],r))return o;return -1}function tA(i){return i!=i}function tC(i,r){var n=null==i?0:i.length;return n?tM(i,r)/n:c}function tI(i){return function(r){return null==r?a:r[i]}}function tk(i){return function(r){return null==i?a:i[r]}}function tR(i,r,n,a,o){return o(i,function(i,o,s){n=a?(a=!1,i):r(n,i,o,s)}),n}function tM(i,r){for(var n,o=-1,s=i.length;++o<s;){var l=r(i[o]);a!==l&&(n=a===n?l:n+l)}return n}function tL(i,r){for(var n=-1,a=Array(i);++n<i;)a[n]=r(n);return a}function tP(i){return i?i.slice(0,tZ(i)+1).replace(ee,""):i}function tO(i){return function(r){return i(r)}}function tD(i,r){return tg(r,function(r){return i[r]})}function tF(i,r){return i.has(r)}function tN(i,r){for(var n=-1,a=i.length;++n<a&&tE(r,i[n],0)>-1;);return n}function tj(i,r){for(var n=i.length;n--&&tE(r,i[n],0)>-1;);return n}var tz=tk({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tB=tk({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function tU(i){return"\\"+e2[i]}function tV(i){return eK.test(i)}function tH(i){var r=-1,n=Array(i.size);
119return i.forEach(function(i,a){n[++r]=[a,i]}),n}function tG(i,r){return function(n){return i(r(n))}}function tq(i,r){for(var n=-1,a=i.length,o=0,s=[];++n<a;){var u=i[n];(u===r||u===l)&&(i[n]=l,s[o++]=n)}return s}function t$(i){var r=-1,n=Array(i.size);return i.forEach(function(i){n[++r]=i}),n}function tW(i){return tV(i)?function(i){for(var r=eY.lastIndex=0;eY.test(i);)++r;return r}(i):tb(i)}function tY(i){return tV(i)?i.match(eY)||[]:i.split("")}function tZ(i){for(var r=i.length;r--&&et.test(i.charAt(r)););return r}var tK=tk({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),tX=function i(r){var n,et,ey,ev,ex=(r=null==r?e8:tX.defaults(e8.Object(),r,tX.pick(e8,eQ))).Array,eb=r.Date,ew=r.Error,eT=r.Function,eE=r.Math,eS=r.Object,eA=r.RegExp,eC=r.String,eI=r.TypeError,ek=ex.prototype,eR=eT.prototype,eM=eS.prototype,eL=r["__core-js_shared__"],eP=eR.toString,eO=eM.hasOwnProperty,eD=0,eF=(n=/[^.]+$/.exec(eL&&eL.keys&&eL.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",eN=eM.toString,ej=eP.call(eS),ez=e8._,eB=eA("^"+eP.call(eO).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),eU=te?r.Buffer:a,eV=r.Symbol,eH=r.Uint8Array,eG=eU?eU.allocUnsafe:a,eq=tG(eS.getPrototypeOf,eS),eY=eS.create,eK=eM.propertyIsEnumerable,e2=ek.splice,e9=eV?eV.isConcatSpreadable:a,e3=eV?eV.iterator:a,e6=eV?eV.toStringTag:a,e7=function(){try{var i=ng(eS,"defineProperty");return i({},"",{}),i}catch(i){}}(),tt=r.clearTimeout!==e8.clearTimeout&&r.clearTimeout,ti=eb&&eb.now!==e8.Date.now&&eb.now,tb=r.setTimeout!==e8.setTimeout&&r.setTimeout,tk=eE.ceil,tQ=eE.floor,tJ=eS.getOwnPropertySymbols,t1=eU?eU.isBuffer:a,t0=r.isFinite,t2=ek.join,t5=tG(eS.keys,eS),t4=eE.max,t9=eE.min,t3=eb.now,t8=r.parseInt,t6=eE.random,t7=ek.reverse,ie=ng(r,"DataView"),it=ng(r,"Map"),ii=ng(r,"Promise"),ir=ng(r,"Set"),ia=ng(r,"WeakMap"),io=ng(eS,"create"),is=ia&&new ia,il={},iu=nU(ie),ic=nU(it),id=nU(ii),ih=nU(ir),ip=nU(ia),im=eV?eV.prototype:a,ig=im?im.valueOf:a,i_=im?im.toString:a;function iy(i){if(aK(i)&&!az(i)&&!(i instanceof iw)){if(i instanceof ib)return i;if(eO.call(i,"__wrapped__"))return nV(i)}return new ib(i)}var iv=function(){function i(){}return function(r){if(!aZ(r))return{};if(eY)return eY(r);i.prototype=r;var n=new i;return i.prototype=a,n}}();function ix(){}function ib(i,r){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=a}function iw(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=0xffffffff,this.__views__=[]}function iT(i){var r=-1,n=null==i?0:i.length;for(this.clear();++r<n;){var a=i[r];this.set(a[0],a[1])}}function iE(i){var r=-1,n=null==i?0:i.length;for(this.clear();++r<n;){var a=i[r];this.set(a[0],a[1])}}function iS(i){var r=-1,n=null==i?0:i.length;for(this.clear();++r<n;){var a=i[r];this.set(a[0],a[1])}}function iA(i){var r=-1,n=null==i?0:i.length;for(this.__data__=new iS;++r<n;)this.add(i[r])}function iC(i){var r=this.__data__=new iE(i);this.size=r.size}function iI(i,r){var n=az(i),a=!n&&aj(i),o=!n&&!a&&aH(i),s=!n&&!a&&!o&&a4(i),l=n||a||o||s,u=l?tL(i.length,eC):[],c=u.length;for(var d in i)(r||eO.call(i,d))&&!(l&&("length"==d||o&&("offset"==d||"parent"==d)||s&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||nT(d,c)))&&u.push(d);return u}function ik(i){var r=i.length;return r?i[rf(0,r-1)]:a}iy.templateSettings={escape:$,evaluate:W,interpolate:Y,variable:"",imports:{_:iy}},iy.prototype=ix.prototype,iy.prototype.constructor=iy,ib.prototype=iv(ix.prototype),ib.prototype.constructor=ib,iw.prototype=iv(ix.prototype),iw.prototype.constructor=iw,iT.prototype.clear=function(){this.__data__=io?io(null):{},this.size=0},iT.prototype.delete=function(i){var r=this.has(i)&&delete this.__data__[i];return this.size-=!!r,r},iT.prototype.get=function(i){var r=this.__data__;if(io){var n=r[i];return n===s?a:n}return eO.call(r,i)?r[i]:a},iT.prototype.has=function(i){var r=this.__data__;return io?r[i]!==a:eO.call(r,i)},iT.prototype.set=function(i,r){var n=this.__data__;return this.size+=+!this.has(i),n[i]=io&&a===r?s:r,this},iE.prototype.clear=function(){this.__data__=[],this.size=0},iE.prototype.delete=function(i){var r=this.__data__,n=iL(r,i);return!(n<0)&&(n==r.length-1?r.pop():e2.call(r,n,1),--this.size,!0)},iE.prototype.get=function(i){var r=this.__data__,n=iL(r,i);return n<0?a:r[n][1]},iE.prototype.has=function(i){return iL(this.__data__,i)>-1},iE.prototype.set=function(i,r){var n=this.__data__,a=iL(n,i);return a<0?(++this.size,n.push([i,r])):n[a][1]=r,this},iS.prototype.clear=function(){this.size=0,this.__data__={hash:new iT,map:new(it||iE),string:new iT}},iS.prototype.delete=function(i){var r=np(this,i).delete(i);return this.size-=!!r,r},iS.prototype.get=function(i){return np(this,i).get(i)},iS.prototype.has=function(i){return np(this,i).has(i)},iS.prototype.set=function(i,r){var n=np(this,i),a=n.size;return n.set(i,r),this.size+=+(n.size!=a),this},iA.prototype.add=iA.prototype.push=function(i){return this.__data__.set(i,s),this},iA.prototype.has=function(i){return this.__data__.has(i)};
119function iR(i,r,n){(a===n||aD(i[r],n))&&(a!==n||r in i)||iD(i,r,n)}function iM(i,r,n){var o=i[r];eO.call(i,r)&&aD(o,n)&&(a!==n||r in i)||iD(i,r,n)}function iL(i,r){for(var n=i.length;n--;)if(aD(i[n][0],r))return n;return -1}function iP(i,r,n,a){return iV(i,function(i,o,s){r(a,i,n(i),s)}),a}function iO(i,r){return i&&rq(r,og(r),i)}function iD(i,r,n){"__proto__"==r&&e7?e7(i,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):i[r]=n}function iF(i,r){for(var n=-1,o=r.length,s=ex(o),l=null==i;++n<o;)s[n]=l?a:od(i,r[n]);return s}function iN(i,r,n){return i==i&&(a!==n&&(i=i<=n?i:n),a!==r&&(i=i>=r?i:r)),i}function ij(i,r,n,o,s,l){var u,c=1&r,d=2&r,f=4&r;if(n&&(u=s?n(i,o,s,l):n(i)),a!==u)return u;if(!aZ(i))return i;var g=az(i);if(g){if(C=(w=i).length,z=new w.constructor(C),C&&"string"==typeof w[0]&&eO.call(w,"index")&&(z.index=w.index,z.input=w.input),u=z,!c)return rG(i,u)}else{var w,C,z,B,U,V,H,G,q=nv(i),$=q==_||q==y;if(aH(i))return rj(i,c);if(q==b||q==h||$&&!s){if(u=d||$?{}:nb(i),!c){return d?(B=i,U=(G=u)&&rq(i,o_(i),G),rq(B,ny(B),U)):(V=i,H=iO(u,i),rq(V,n_(V),H))}}else{if(!e0[q])return s?i:{};u=function(i,r,n){var a,o,s=i.constructor;switch(r){case I:return rz(i);case p:case m:return new s(+i);case k:return a=n?rz(i.buffer):i.buffer,new i.constructor(a,i.byteOffset,i.byteLength);case R:case M:case L:case P:case O:case D:case F:case N:case j:return rB(i,n);case v:return new s;case x:case S:return new s(i);case T:return(o=new i.constructor(i.source,eu.exec(i))).lastIndex=i.lastIndex,o;case E:return new s;case A:return ig?eS(ig.call(i)):{}}}(i,q,c)}}l||(l=new iC);var W=l.get(i);if(W)return W;l.set(i,u),a0(i)?i.forEach(function(a){u.add(ij(a,r,n,a,i,l))}):aX(i)&&i.forEach(function(a,o){u.set(o,ij(a,r,n,o,i,l))});var Y=f?d?nu:nl:d?o_:og,Z=g?a:Y(i);return td(Z||i,function(a,o){Z&&(a=i[o=a]),iM(u,o,ij(a,r,n,o,i,l))}),u}function iz(i,r,n){var o=n.length;if(null==i)return!o;for(i=eS(i);o--;){var s=n[o],l=r[s],u=i[s];if(a===u&&!(s in i)||!l(u))return!1}return!0}function iB(i,r,n){if("function"!=typeof i)throw new eI(o);return nO(function(){i.apply(a,n)},r)}function iU(i,r,n,a){var o=-1,s=tp,l=!0,u=i.length,c=[],d=r.length;if(!u)return c;n&&(r=tg(r,tO(n))),a?(s=tm,l=!1):r.length>=200&&(s=tF,l=!1,r=new iA(r));e:for(;++o<u;){var h=i[o],f=null==n?h:n(h);if(h=a||0!==h?h:0,l&&f==f){for(var p=d;p--;)if(r[p]===f)continue e;c.push(h)}else s(r,f,a)||c.push(h)}return c}iC.prototype.clear=function(){this.__data__=new iE,this.size=0},iC.prototype.delete=function(i){var r=this.__data__,n=r.delete(i);return this.size=r.size,n},iC.prototype.get=function(i){return this.__data__.get(i)},iC.prototype.has=function(i){return this.__data__.has(i)},iC.prototype.set=function(i,r){var n=this.__data__;if(n instanceof iE){var a=n.__data__;if(!it||a.length<199)return a.push([i,r]),this.size=++n.size,this;n=this.__data__=new iS(a)}return n.set(i,r),this.size=n.size,this};var iV=rY(iK),iH=rY(iX,!0);function iG(i,r){var n=!0;return iV(i,function(i,a,o){return n=!!r(i,a,o)}),n}function iq(i,r,n){for(var o=-1,s=i.length;++o<s;){var l=i[o],u=r(l);if(null!=u&&(a===c?u==u&&!a5(u):n(u,c)))var c=u,d=l}return d}function i$(i,r){var n=[];return iV(i,function(i,a,o){r(i,a,o)&&n.push(i)}),n}function iW(i,r,n,a,o){var s=-1,l=i.length;for(n||(n=nw),o||(o=[]);++s<l;){var u=i[s];r>0&&n(u)?r>1?iW(u,r-1,n,a,o):t_(o,u):a||(o[o.length]=u)}return o}var iY=rZ(),iZ=rZ(!0);function iK(i,r){return i&&iY(i,r,og)}function iX(i,r){return i&&iZ(i,r,og)}function iQ(i,r){return tf(r,function(r){return a$(i[r])})}function iJ(i,r){r=rD(r,i);for(var n=0,o=r.length;null!=i&&n<o;)i=i[nB(r[n++])];return n&&n==o?i:a}function i1(i,r,n){var a=r(i);return az(i)?a:t_(a,n(i))}function i0(i){var r;return null==i?a===i?"[object Undefined]":"[object Null]":e6&&e6 in eS(i)?function(i){var r=eO.call(i,e6),n=i[e6];try{i[e6]=a;var o=!0}catch(i){}var s=eN.call(i);return o&&(r?i[e6]=n:delete i[e6]),s}(i):(r=i,eN.call(r))}function i2(i,r){return i>r}function i5(i,r){return null!=i&&eO.call(i,r)}function i4(i,r){return null!=i&&r in eS(i)}function i9(i,r,n){for(var o=n?tm:tp,s=i[0].length,l=i.length,u=l,c=ex(l),d=1/0,h=[];u--;){var f=i[u];u&&r&&(f=tg(f,tO(r))),d=t9(f.length,d),c[u]=!n&&(r||s>=120&&f.length>=120)?new iA(u&&f):a}f=i[0];var p=-1,m=c[0];e:for(;++p<s&&h.length<d;){var g=f[p],_=r?r(g):g;if(g=n||0!==g?g:0,!(m?tF(m,_):o(h,_,n))){for(u=l;--u;){var y=c[u];if(!(y?tF(y,_):o(i[u],_,n)))continue e}m&&m.push(_),h.push(g)}}return h}function i3(i,r,n){r=rD(r,i);var o=null==(i=nM(i,r))?i:i[nB(nJ(r))];return null==o?a:tu(o,i,n)}function i8(i){return aK(i)&&i0(i)==h}function i6(i,r,n,o,s){return i===r||(null!=i&&null!=r&&(aK(i)||aK(r))?function(i,r,n,o,s,l){var u=az(i),c=az(r),d=u?f:nv(i),_=c?f:nv(r);d=d==h?b:d,_=_==h?b:_;var y=d==b,w=_==b,C=d==_;if(C&&aH(i)){if(!aH(r))return!1;u=!0,y=!1}if(C&&!y)return l||(l=new iC),u||a4(i)?no(i,r,n,o,s,l):function(i,r,n,a,o,s,l){switch(n){case k:if(i.byteLength!=r.byteLength||i.byteOffset!=r.byteOffset)break;i=i.buffer,r=r.buffer;case I:if(i.byteLength!=r.byteLength||!s(new eH(i),new eH(r)))break;return!0;case p:case m:case x:return aD(+i,+r);case g:return i.name==r.name&&i.message==r.message;case T:case S:return i==r+"";case v:var u=tH;case E:var c=1&a;if(u||(u=t$),i.size!=r.size&&!c)break;var d=l.get(i);if(d)return d==r;a|=2,l.set(i,r);var h=no(u(i),u(r),a,o,s,l);return l.delete(i),h;case A:if(ig)return ig.call(i)==ig.call(r)}return!1}(i,r,d,n,o,s,l);if(!(1&n)){var R=y&&eO.call(i,"__wrapped__"),M=w&&eO.call(r,"__wrapped__");
vendor: 11,892 bytes, line 119
119if(R||M){var L=R?i.value():i,P=M?r.value():r;return l||(l=new iC),s(L,P,n,o,l)}}return!!C&&(l||(l=new iC),function(i,r,n,o,s,l){var u=1&n,c=nl(i),d=c.length;if(d!=nl(r).length&&!u)return!1;for(var h=d;h--;){var f=c[h];if(!(u?f in r:eO.call(r,f)))return!1}var p=l.get(i),m=l.get(r);if(p&&m)return p==r&&m==i;var g=!0;l.set(i,r),l.set(r,i);for(var _=u;++h<d;){var y=i[f=c[h]],v=r[f];if(o)var x=u?o(v,y,f,r,i,l):o(y,v,f,i,r,l);if(!(a===x?y===v||s(y,v,n,o,l):x)){g=!1;break}_||(_="constructor"==f)}if(g&&!_){var b=i.constructor,w=r.constructor;b!=w&&"constructor"in i&&"constructor"in r&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(g=!1)}return l.delete(i),l.delete(r),g}(i,r,n,o,s,l))}(i,r,n,o,i6,s):i!=i&&r!=r)}function i7(i,r,n,o){var s=n.length,l=s,u=!o;if(null==i)return!l;for(i=eS(i);s--;){var c=n[s];if(u&&c[2]?c[1]!==i[c[0]]:!(c[0]in i))return!1}for(;++s<l;){var d=(c=n[s])[0],h=i[d],f=c[1];if(u&&c[2]){if(a===h&&!(d in i))return!1}else{var p=new iC;if(o)var m=o(h,f,d,i,r,p);if(!(a===m?i6(f,h,3,o,p):m))return!1}}return!0}function re(i){var r;return!(!aZ(i)||(r=i,eF&&eF in r))&&(a$(i)?eB:eh).test(nU(i))}function rt(i){return"function"==typeof i?i:null==i?oV:"object"==typeof i?az(i)?ro(i[0],i[1]):ra(i):oX(i)}function ri(i){if(!nI(i))return t5(i);var r=[];for(var n in eS(i))eO.call(i,n)&&"constructor"!=n&&r.push(n);return r}function rr(i,r){return i<r}function rn(i,r){var n=-1,a=aU(i)?ex(i.length):[];return iV(i,function(i,o,s){a[++n]=r(i,o,s)}),a}function ra(i){var r=nm(i);return 1==r.length&&r[0][2]?nk(r[0][0],r[0][1]):function(n){return n===i||i7(n,i,r)}}function ro(i,r){var n;return nS(i)&&(n=r)==n&&!aZ(n)?nk(nB(i),r):function(n){var o=od(n,i);return a===o&&o===r?oh(n,i):i6(r,o,3)}}function rs(i,r,n,o,s){i!==r&&iY(r,function(l,u){if(s||(s=new iC),aZ(l))!function(i,r,n,o,s,l,u){var c=nL(i,n),d=nL(r,n),h=u.get(d);if(h)return iR(i,n,h);var f=l?l(c,d,n+"",i,r,u):a,p=a===f;if(p){var m=az(d),g=!m&&aH(d),_=!m&&!g&&a4(d);f=d,m||g||_?az(c)?f=c:aV(c)?f=rG(c):g?(p=!1,f=rj(d,!0)):_?(p=!1,f=rB(d,!0)):f=[]:aJ(d)||aj(d)?(f=c,aj(c)?f=oi(c):(!aZ(c)||a$(c))&&(f=nb(d))):p=!1}p&&(u.set(d,f),s(f,d,o,l,u),u.delete(d)),iR(i,n,f)}(i,r,u,n,rs,o,s);else{var c=o?o(nL(i,u),l,u+"",i,r,s):a;a===c&&(c=l),iR(i,u,c)}},o_)}function rl(i,r){var n=i.length;if(n)return nT(r+=r<0?n:0,n)?i[r]:a}function ru(i,r,n){r=r.length?tg(r,function(i){return az(i)?function(r){return iJ(r,1===i.length?i[0]:i)}:i}):[oV];var a=-1;r=tg(r,tO(nf()));var o=rn(i,function(i,n,o){return{criteria:tg(r,function(r){return r(i)}),index:++a,value:i}}),s=o.length;for(o.sort(function(i,r){return function(i,r,n){for(var a=-1,o=i.criteria,s=r.criteria,l=o.length,u=n.length;++a<l;){var c=rU(o[a],s[a]);if(c){if(a>=u)return c;return c*("desc"==n[a]?-1:1)}}return i.index-r.index}(i,r,n)});s--;)o[s]=o[s].value;return o}function rc(i,r,n){for(var a=-1,o=r.length,s={};++a<o;){var l=r[a],u=iJ(i,l);n(u,l)&&rg(s,rD(l,i),u)}return s}function rd(i,r,n,a){var o=a?tS:tE,s=-1,l=r.length,u=i;for(i===r&&(r=rG(r)),n&&(u=tg(i,tO(n)));++s<l;)for(var c=0,d=r[s],h=n?n(d):d;(c=o(u,h,c,a))>-1;)u!==i&&e2.call(u,c,1),e2.call(i,c,1);return i}function rh(i,r){for(var n=i?r.length:0,a=n-1;n--;){var o=r[n];if(n==a||o!==s){var s=o;nT(o)?e2.call(i,o,1):rC(i,o)}}return i}function rf(i,r){return i+tQ(t6()*(r-i+1))}function rp(i,r){var n="";if(!i||r<1||r>0x1fffffffffffff)return n;do r%2&&(n+=i),(r=tQ(r/2))&&(i+=i);while(r)return n}function rm(i,r){return nD(nR(i,r,oV),i+"")}function rg(i,r,n,o){if(!aZ(i))return i;r=rD(r,i);for(var s=-1,l=r.length,u=l-1,c=i;null!=c&&++s<l;){var d=nB(r[s]),h=n;if("__proto__"===d||"constructor"===d||"prototype"===d)break;if(s!=u){var f=c[d];h=o?o(f,d,c):a,a===h&&(h=aZ(f)?f:nT(r[s+1])?[]:{})}iM(c,d,h),c=c[d]}return i}var r_=is?function(i,r){return is.set(i,r),i}:oV,ry=e7?function(i,r){return e7(i,"toString",{configurable:!0,enumerable:!1,value:oz(r),writable:!0})}:oV;function rv(i,r,n){var a=-1,o=i.length;r<0&&(r=-r>o?0:o+r),(n=n>o?o:n)<0&&(n+=o),o=r>n?0:n-r>>>0,r>>>=0;for(var s=ex(o);++a<o;)s[a]=i[a+r];return s}function rx(i,r){var n;return iV(i,function(i,a,o){return!(n=r(i,a,o))}),!!n}function rb(i,r,n){var a=0,o=null==i?a:i.length;if("number"==typeof r&&r==r&&o<=0x7fffffff){for(;a<o;){var s=a+o>>>1,l=i[s];null!==l&&!a5(l)&&(n?l<=r:l<r)?a=s+1:o=s}return o}return rw(i,r,oV,n)}function rw(i,r,n,o){var s=0,l=null==i?0:i.length;if(0===l)return 0;for(var u=(r=n(r))!=r,c=null===r,d=a5(r),h=a===r;s<l;){var f=tQ((s+l)/2),p=n(i[f]),m=a!==p,g=null===p,_=p==p,y=a5(p);if(u)var v=o||_;else v=h?_&&(o||m):c?_&&m&&(o||!g):d?_&&m&&!g&&(o||!y):!g&&!y&&(o?p<=r:p<r);v?s=f+1:l=f}return t9(l,0xfffffffe)}function rT(i,r){for(var n=-1,a=i.length,o=0,s=[];++n<a;){var l=i[n],u=r?r(l):l;if(!n||!aD(u,c)){var c=u;s[o++]=0===l?0:l}}return s}function rE(i){return"number"==typeof i?i:a5(i)?c:+i}function rS(i){if("string"==typeof i)return i;if(az(i))return tg(i,rS)+"";if(a5(i))return i_?i_.call(i):"";var r=i+"";return"0"==r&&1/i==-u?"-0":r}function rA(i,r,n){var a=-1,o=tp,s=i.length,l=!0,u=[],c=u;if(n)l=!1,o=tm;else if(s>=200){var d=r?null:ne(i);if(d)return t$(d);l=!1,o=tF,c=new iA}else c=r?[]:u;e:for(;++a<s;){var h=i[a],f=r?r(h):h;if(h=n||0!==h?h:0,l&&f==f){for(var p=c.length;p--;)if(c[p]===f)continue e;r&&c.push(f),u.push(h)}else o(c,f,n)||(c!==u&&c.push(f),u.push(h))}return u}function rC(i,r){r=rD(r,i);var n=-1,a=r.length;if(!a)return!0;for(;++n<a;){var o=nB(r[n]);if("__proto__"===o&&!eO.call(i,"__proto__")||("constructor"===o||"prototype"===o)&&n<a-1)return!1}var s=nM(i,r);return null==s||delete s[nB(nJ(r))]}function rI(i,r,n,a){return rg(i,r,n(iJ(i,r)),a)}function rk(i,r,n,a){for(var o=i.length,s=a?o:-1;(a?s--:++s<o)&&r(i[s],s,i););return n?rv(i,a?0:s,a?s+1:o):rv(i,a?s+1:0,a?o:s)}function rR(i,r){var n=i;return n instanceof iw&&(n=n.value()),ty(r,function(i,r){return r.func.apply(r.thisArg,t_([i],r.args))},n)}function rM(i,r,n){var a=i.length;if(a<2)return a?rA(i[0]):[];for(var o=-1,s=ex(a);++o<a;)for(var l=i[o],u=-1;++u<a;)u!=o&&(s[o]=iU(s[o]||l,i[u],r,n));return rA(iW(s,1),r,n)}function rL(i,r,n){for(var o=-1,s=i.length,l=r.length,u={};++o<s;){var c=o<l?r[o]:a;n(u,i[o],c)}return u}function rP(i){return aV(i)?i:[]}function rO(i){return"function"==typeof i?i:oV}function rD(i,r){return az(i)?i:nS(i,r)?[i]:nz(or(i))}function rF(i,r,n){var o=i.length;return n=a===n?o:n,!r&&n>=o?i:rv(i,r,n)}var rN=tt||function(i){return e8.clearTimeout(i)};function rj(i,r){if(r)return i.slice();var n=i.length,a=eG?eG(n):new i.constructor(n);return i.copy(a),a}function rz(i){var r=new i.constructor(i.byteLength);return new eH(r).set(new eH(i)),r}function rB(i,r){var n=r?rz(i.buffer):i.buffer;return new i.constructor(n,i.byteOffset,i.length)}function rU(i,r){if(i!==r){var n=a!==i,o=null===i,s=i==i,l=a5(i),u=a!==r,c=null===r,d=r==r,h=a5(r);if(!c&&!h&&!l&&i>r||l&&u&&d&&!c&&!h||o&&u&&d||!n&&d||!s)return 1;if(!o&&!l&&!h&&i<r||h&&n&&s&&!o&&!l||c&&n&&s||!u&&s||!d)return -1}return 0}function rV(i,r,n,a){for(var o=-1,s=i.length,l=n.length,u=-1,c=r.length,d=t4(s-l,0),h=ex(c+d),f=!a;++u<c;)h[u]=r[u];for(;++o<l;)(f||o<s)&&(h[n[o]]=i[o]);for(;d--;)h[u++]=i[o++];return h}function rH(i,r,n,a){for(var o=-1,s=i.length,l=-1,u=n.length,c=-1,d=r.length,h=t4(s-u,0),f=ex(h+d),p=!a;++o<h;)f[o]=i[o];for(var m=o;++c<d;)f[m+c]=r[c];for(;++l<u;)(p||o<s)&&(f[m+n[l]]=i[o++]);return f}function rG(i,r){var n=-1,a=i.length;for(r||(r=ex(a));++n<a;)r[n]=i[n];return r}function rq(i,r,n,o){var s=!n;n||(n={});for(var l=-1,u=r.length;++l<u;){var c=r[l],d=o?o(n[c],i[c],c,n,i):a;a===d&&(d=i[c]),s?iD(n,c,d):iM(n,c,d)}return n}function r$(i,r){return function(n,a){var o=az(n)?tc:iP,s=r?r():{};return o(n,i,nf(a,2),s)}}function rW(i){return rm(function(r,n){var o=-1,s=n.length,l=s>1?n[s-1]:a,u=s>2?n[2]:a;for(l=i.length>3&&"function"==typeof l?(s--,l):a,u&&nE(n[0],n[1],u)&&(l=s<3?a:l,s=1),r=eS(r);++o<s;){var c=n[o];c&&i(r,c,o,l)}return r})}function rY(i,r){return function(n,a){if(null==n)return n;if(!aU(n))return i(n,a);for(var o=n.length,s=r?o:-1,l=eS(n);(r?s--:++s<o)&&!1!==a(l[s],s,l););return n}}function rZ(i){return function(r,n,a){for(var o=-1,s=eS(r),l=a(r),u=l.length;u--;){var c=l[i?u:++o];if(!1===n(s[c],c,s))break}return r}}function rK(i){return function(r){var n=tV(r=or(r))?tY(r):a,o=n?n[0]:r.charAt(0),s=n?rF(n,1).join(""):r.slice(1);return o[i]()+s}}function rX(i){return function(r){return ty(oF(oI(r).replace(e$,"")),i,"")}}function rQ(i){return function(){var r=arguments;switch(r.length){case 0:return new i;case 1:return new i(r[0]);case 2:return new i(r[0],r[1]);case 3:return new i(r[0],r[1],r[2]);case 4:return new i(r[0],r[1],r[2],r[3]);case 5:return new i(r[0],r[1],r[2],r[3],r[4]);case 6:return new i(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new i(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var n=iv(i.prototype),a=i.apply(n,r);return aZ(a)?a:n}}function rJ(i){return function(r,n,o){var s=eS(r);if(!aU(r)){var l=nf(n,3);r=og(r),n=function(i){return l(s[i],i,s)}}var u=i(r,n,o);return u>-1?s[l?r[u]:u]:a}}function r1(i){return ns(function(r){var n=r.length,s=n,l=ib.prototype.thru;for(i&&r.reverse();s--;){var u=r[s];if("function"!=typeof u)throw new eI(o);if(l&&!c&&"wrapper"==nd(u))var c=new ib([],!0)}for(s=c?s:n;++s<n;){var d=nd(u=r[s]),h="wrapper"==d?nc(u):a;c=h&&nA(h[0])&&424==h[1]&&!h[4].length&&1==h[9]?c[nd(h[0])].apply(c,h[3]):1==u.length&&nA(u)?c[d]():c.thru(u)}return function(){var i=arguments,a=i[0];if(c&&1==i.length&&az(a))return c.plant(a).value();for(var o=0,s=n?r[o].apply(this,i):a;++o<n;)s=r[o].call(this,s);return s}})}function r0(i,r,n,o,s,l,u,c,d,h){var f=128&r,p=1&r,m=2&r,g=24&r,_=512&r,y=m?a:rQ(i);function v(){for(var x=arguments.length,b=ex(x),w=x;w--;)b[w]=arguments[w];if(g)var T=nh(v),E=function(i,r){for(var n=i.length,a=0;n--;)i[n]===r&&++a;return a}(b,T);if(o&&(b=rV(b,o,s,g)),l&&(b=rH(b,l,u,g)),x-=E,g&&x<h){var S=tq(b,T);return r6(i,r,r0,v.placeholder,n,b,S,c,d,h-x)}var A=p?n:this,C=m?A[i]:i;return x=b.length,c?b=function(i,r){for(var n=i.length,o=t9(r.length,n),s=rG(i);o--;){var l=r[o];i[o]=nT(l,n)?s[l]:a}return i}(b,c):_&&x>1&&b.reverse(),f&&d<x&&(b.length=d),this&&this!==e8&&this instanceof v&&(C=y||rQ(C)),C.apply(A,b)}return v}function r2(i,r){return function(n,a){var o,s;return o=r(a),s={},iK(n,function(r,n,a){i(s,o(r),n,a)}),s}}function r5(i,r){return function(n,o){var s;if(a===n&&a===o)return r;if(a!==n&&(s=n),a!==o){if(a===s)return o;"string"==typeof n||"string"==typeof o?(n=rS(n),o=rS(o)):(n=rE(n),o=rE(o)),s=i(n,o)}return s}}function r4(i){return ns(function(r){return r=tg(r,tO(nf())),rm(function(n){var a=this;return i(r,function(i){return tu(i,a,n)})})})}function r9(i,r){var n=(r=a===r?" ":rS(r)).length;if(n<2)return n?rp(r,i):r;var o=rp(r,tk(i/tW(r)));return tV(r)?rF(tY(o),0,i).join(""):o.slice(0,i)}function r3(i){return function(r,n,o){o&&"number"!=typeof o&&nE(r,n,o)&&(n=o=a),r=a6(r),a===n?(n=r,r=0):n=a6(n),o=a===o?r<n?1:-1:a6(o);for(var s=r,l=n,u=o,c=-1,d=t4(tk((l-s)/(u||1)),0),h=ex(d);d--;)h[i?d:++c]=s,s+=u;return h}}function r8(i){return function(r,n){return("string"!=typeof r||"string"!=typeof n)&&(r=ot(r),n=ot(n)),i(r,n)}}function r6(i,r,n,o,s,l,u,c,d,h){var f=8&r,p=f?u:a,m=f?a:u,g=f?l:a,_=f?a:l;r|=f?32:64,4&(r&=~(f?64:32))||(r&=-4);var y=[i,r,s,g,p,_,m,c,d,h],v=n.apply(a,y);return nA(i)&&nP(v,y),v.placeholder=o,nF(v,i,r)}function r7(i){var r=eE[i];return function(i,n){if(i=ot(i),(n=null==n?0:t9(a7(n),292))&&t0(i)){var a=(or(i)+"e").split("e");return+((a=(or(r(a[0]+"e"+(+a[1]+n)))+"e").split("e"))[0]+"e"+(a[1]-n))}return r(i)}}var ne=ir&&1/t$(new ir([,-0]))[1]==u?function(i){return new ir(i)}:oW;function nt(i){return function(r){var n,a,o=nv(r);return o==v?tH(r):o==E?(n=-1,a=Array(r.size),r.forEach(function(i){a[++n]=[i,i]}),a):tg(i(r),function(i){return[i,r[i]]})}}function ni(i,r,n,s,u,c,d,h){var f=2&r;if(!f&&"function"!=typeof i)throw new eI(o);var p=s?s.length:0;if(p||(r&=-97,s=u=a),d=a===d?d:t4(a7(d),0),h=a===h?h:a7(h),p-=u?u.length:0,64&r){var m=s,g=u;
119s=u=a}var _=f?a:nc(i),y=[i,r,n,s,u,m,g,c,d,h];if(_&&function(i,r){var n=i[1],a=r[1],o=n|a,s=o<131,u=128==a&&8==n||128==a&&256==n&&i[7].length<=r[8]||384==a&&r[7].length<=r[8]&&8==n;if(s||u){1&a&&(i[2]=r[2],o|=1&n?0:4);var c=r[3];if(c){var d=i[3];i[3]=d?rV(d,c,r[4]):c,i[4]=d?tq(i[3],l):r[4]}(c=r[5])&&(d=i[5],i[5]=d?rH(d,c,r[6]):c,i[6]=d?tq(i[5],l):r[6]),(c=r[7])&&(i[7]=c),128&a&&(i[8]=null==i[8]?r[8]:t9(i[8],r[8])),null==i[9]&&(i[9]=r[9]),i[0]=r[0],i[1]=o}}(y,_),i=y[0],r=y[1],n=y[2],s=y[3],u=y[4],(h=y[9]=y[9]===a?f?0:i.length:t4(y[9]-p,0))||!(24&r)||(r&=-25),r&&1!=r)8==r||16==r?R=function(i,r,n){var o=rQ(i);function s(){for(var l=arguments.length,u=ex(l),c=l,d=nh(s);c--;)u[c]=arguments[c];var h=l<3&&u[0]!==d&&u[l-1]!==d?[]:tq(u,d);return(l-=h.length)<n?r6(i,r,r0,s.placeholder,a,u,h,a,a,n-l):tu(this&&this!==e8&&this instanceof s?o:i,this,u)}return s}(i,r,h):32!=r&&33!=r||u.length?R=r0.apply(a,y):(v=i,x=r,b=n,w=s,T=1&x,E=rQ(v),R=function i(){for(var r=-1,n=arguments.length,a=-1,o=w.length,s=ex(o+n),l=this&&this!==e8&&this instanceof i?E:v;++a<o;)s[a]=w[a];for(;n--;)s[a++]=arguments[++r];return tu(l,T?b:this,s)});else var v,x,b,w,T,E,S,A,C,I,k,R=(S=i,A=r,C=n,I=1&A,k=rQ(S),function i(){return(this&&this!==e8&&this instanceof i?k:S).apply(I?C:this,arguments)});return nF((_?r_:nP)(R,y),i,r)}function nr(i,r,n,o){return a===i||aD(i,eM[n])&&!eO.call(o,n)?r:i}function nn(i,r,n,o,s,l){return aZ(i)&&aZ(r)&&(l.set(r,i),rs(i,r,a,nn,l),l.delete(r)),i}function na(i){return aJ(i)?a:i}function no(i,r,n,o,s,l){var u=1&n,c=i.length,d=r.length;if(c!=d&&!(u&&d>c))return!1;var h=l.get(i),f=l.get(r);if(h&&f)return h==r&&f==i;var p=-1,m=!0,g=2&n?new iA:a;for(l.set(i,r),l.set(r,i);++p<c;){var _=i[p],y=r[p];if(o)var v=u?o(y,_,p,r,i,l):o(_,y,p,i,r,l);if(a!==v){if(v)continue;m=!1;break}if(g){if(!tx(r,function(i,r){if(!tF(g,r)&&(_===i||s(_,i,n,o,l)))return g.push(r)})){m=!1;break}}else if(!(_===y||s(_,y,n,o,l))){m=!1;break}}return l.delete(i),l.delete(r),m}function ns(i){return nD(nR(i,a,nY),i+"")}function nl(i){return i1(i,og,n_)}function nu(i){return i1(i,o_,ny)}var nc=is?function(i){return is.get(i)}:oW;
119function nd(i){for(var r=i.name+"",n=il[r],a=eO.call(il,r)?n.length:0;a--;){var o=n[a],s=o.func;if(null==s||s==i)return o.name}return r}function nh(i){return(eO.call(iy,"placeholder")?iy:i).placeholder}function nf(){var i=iy.iteratee||oH;return i=i===oH?rt:i,arguments.length?i(arguments[0],arguments[1]):i}function np(i,r){var n,a,o=i.__data__;return("string"==(a=typeof(n=r))||"number"==a||"symbol"==a||"boolean"==a?"__proto__"!==n:null===n)?o["string"==typeof r?"string":"hash"]:o.map}function nm(i){for(var r=og(i),n=r.length;n--;){var a,o=r[n],s=i[o];r[n]=[o,s,(a=s)==a&&!aZ(a)]}return r}function ng(i,r){var n=null==i?a:i[r];return re(n)?n:a}var n_=tJ?function(i){return null==i?[]:tf(tJ(i=eS(i)),function(r){return eK.call(i,r)})}:o1,ny=tJ?function(i){for(var r=[];i;)t_(r,n_(i)),i=eq(i);return r}:o1,nv=i0;function nx(i,r,n){r=rD(r,i);for(var a=-1,o=r.length,s=!1;++a<o;){var l=nB(r[a]);if(!(s=null!=i&&n(i,l)))break;i=i[l]}return s||++a!=o?s:!!(o=null==i?0:i.length)&&aY(o)&&nT(l,o)&&(az(i)||aj(i))}function nb(i){return"function"!=typeof i.constructor||nI(i)?{}:iv(eq(i))}function nw(i){return az(i)||aj(i)||!!(e9&&i&&i[e9])}function nT(i,r){var n=typeof i;return!!(r=null==r?0x1fffffffffffff:r)&&("number"==n||"symbol"!=n&&ep.test(i))&&i>-1&&i%1==0&&i<r}function nE(i,r,n){if(!aZ(n))return!1;var a=typeof r;return("number"==a?!!(aU(n)&&nT(r,n.length)):"string"==a&&r in n)&&aD(n[r],i)}function nS(i,r){if(az(i))return!1;var n=typeof i;return!!("number"==n||"symbol"==n||"boolean"==n||null==i||a5(i))||K.test(i)||!Z.test(i)||null!=r&&i in eS(r)}function nA(i){var r=nd(i),n=iy[r];if("function"!=typeof n||!(r in iw.prototype))return!1;if(i===n)return!0;var a=nc(n);return!!a&&i===a[0]}(ie&&nv(new ie(new ArrayBuffer(1)))!=k||it&&nv(new it)!=v||ii&&nv(ii.resolve())!=w||ir&&nv(new ir)!=E||ia&&nv(new ia)!=C)&&(nv=function(i){var r=i0(i),n=r==b?i.constructor:a,o=n?nU(n):"";if(o)switch(o){case iu:return k;case ic:return v;case id:return w;case ih:return E;case ip:return C}return r});var nC=eL?a$:o0;function nI(i){var r=i&&i.constructor;return i===("function"==typeof r&&r.prototype||eM)}function nk(i,r){return function(n){return null!=n&&n[i]===r&&(a!==r||i in eS(n))}}function nR(i,r,n){return r=t4(a===r?i.length-1:r,0),function(){for(var a=arguments,o=-1,s=t4(a.length-r,0),l=ex(s);++o<s;)l[o]=a[r+o];o=-1;for(var u=ex(r+1);++o<r;)u[o]=a[o];return u[r]=n(l),tu(i,this,u)}}function nM(i,r){return r.length<2?i:iJ(i,rv(r,0,-1))}function nL(i,r){if(("constructor"!==r||"function"!=typeof i[r])&&"__proto__"!=r)return i[r]}var nP=nN(r_),nO=tb||function(i,r){return e8.setTimeout(i,r)},nD=nN(ry);function nF(i,r,n){var a,o,s,l=r+"";return nD(i,function(i,r){var n=r.length;if(!n)return i;var a=n-1;return r[a]=(n>1?"& ":"")+r[a],r=r.join(n>2?", ":" "),i.replace(ei,"{\n/* [wrapped with "+r+"] */\n")}(l,(a=(s=l.match(er))?s[1].split(en):[],o=n,td(d,function(i){var r="_."+i[0];o&i[1]&&!tp(a,r)&&a.push(r)}),a.sort())))}function nN(i){var r=0,n=0;return function(){var o=t3(),s=16-(o-n);if(n=o,s>0){if(++r>=800)return arguments[0]}else r=0;return i.apply(a,arguments)}}function nj(i,r){var n=-1,o=i.length,s=o-1;for(r=a===r?o:r;++n<r;){var l=rf(n,s),u=i[l];i[l]=i[n],i[n]=u}return i.length=r,i}var nz=(ey=(et=ak(function(i){var r=[];return 46===i.charCodeAt(0)&&r.push(""),i.replace(X,function(i,n,a,o){r.push(a?o.replace(es,"$1"):n||i)}),r},function(i){return 500===ey.size&&ey.clear(),i})).cache,et);function nB(i){if("string"==typeof i||a5(i))return i;var r=i+"";return"0"==r&&1/i==-u?"-0":r}function nU(i){if(null!=i){try{return eP.call(i)}catch(i){}try{return i+""}catch(i){}}return""}function nV(i){if(i instanceof iw)return i.clone();
119var r=new ib(i.__wrapped__,i.__chain__);return r.__actions__=rG(i.__actions__),r.__index__=i.__index__,r.__values__=i.__values__,r}var nH=rm(function(i,r){return aV(i)?iU(i,iW(r,1,aV,!0)):[]}),nG=rm(function(i,r){var n=nJ(r);return aV(n)&&(n=a),aV(i)?iU(i,iW(r,1,aV,!0),nf(n,2)):[]}),nq=rm(function(i,r){var n=nJ(r);return aV(n)&&(n=a),aV(i)?iU(i,iW(r,1,aV,!0),a,n):[]});function n$(i,r,n){var a=null==i?0:i.length;if(!a)return -1;var o=null==n?0:a7(n);return o<0&&(o=t4(a+o,0)),tT(i,nf(r,3),o)}function nW(i,r,n){var o=null==i?0:i.length;if(!o)return -1;var s=o-1;return a!==n&&(s=a7(n),s=n<0?t4(o+s,0):t9(s,o-1)),tT(i,nf(r,3),s,!0)}function nY(i){return(null==i?0:i.length)?iW(i,1):[]}function nZ(i){return i&&i.length?i[0]:a}var nK=rm(function(i){var r=tg(i,rP);return r.length&&r[0]===i[0]?i9(r):[]}),nX=rm(function(i){var r=nJ(i),n=tg(i,rP);return r===nJ(n)?r=a:n.pop(),n.length&&n[0]===i[0]?i9(n,nf(r,2)):[]}),nQ=rm(function(i){var r=nJ(i),n=tg(i,rP);return(r="function"==typeof r?r:a)&&n.pop(),n.length&&n[0]===i[0]?i9(n,a,r):[]});function nJ(i){var r=null==i?0:i.length;return r?i[r-1]:a}var n1=rm(n0);function n0(i,r){return i&&i.length&&r&&r.length?rd(i,r):i}var n2=ns(function(i,r){var n=null==i?0:i.length,a=iF(i,r);return rh(i,tg(r,function(i){return nT(i,n)?+i:i}).sort(rU)),a});function n5(i){return null==i?i:t7.call(i)}var n4=rm(function(i){return rA(iW(i,1,aV,!0))}),n9=rm(function(i){var r=nJ(i);return aV(r)&&(r=a),rA(iW(i,1,aV,!0),nf(r,2))}),n3=rm(function(i){var r=nJ(i);return r="function"==typeof r?r:a,rA(iW(i,1,aV,!0),a,r)});function n8(i){if(!(i&&i.length))return[];var r=0;return i=tf(i,function(i){if(aV(i))return r=t4(i.length,r),!0}),tL(r,function(r){return tg(i,tI(r))})}function n6(i,r){if(!(i&&i.length))return[];var n=n8(i);return null==r?n:tg(n,function(i){return tu(r,a,i)})}var n7=rm(function(i,r){return aV(i)?iU(i,r):[]}),ae=rm(function(i){return rM(tf(i,aV))}),at=rm(function(i){var r=nJ(i);return aV(r)&&(r=a),rM(tf(i,aV),nf(r,2))}),ai=rm(function(i){var r=nJ(i);return r="function"==typeof r?r:a,rM(tf(i,aV),a,r)}),ar=rm(n8),an=rm(function(i){var r=i.length,n=r>1?i[r-1]:a;return n="function"==typeof n?(i.pop(),n):a,n6(i,n)});function aa(i){var r=iy(i);return r.__chain__=!0,r}function ao(i,r){return r(i)}var as=ns(function(i){var r=i.length,n=r?i[0]:0,o=this.__wrapped__,s=function(r){return iF(r,i)};return!(r>1)&&!this.__actions__.length&&o instanceof iw&&nT(n)?((o=o.slice(n,+n+ +!!r)).__actions__.push({func:ao,args:[s],thisArg:a}),new ib(o,this.__chain__).thru(function(i){return r&&!i.length&&i.push(a),i})):this.thru(s)}),al=r$(function(i,r,n){eO.call(i,n)?++i[n]:iD(i,n,1)}),au=rJ(n$),ac=rJ(nW);function ad(i,r){return(az(i)?td:iV)(i,nf(r,3))}function ah(i,r){return(az(i)?function(i,r){for(var n=null==i?0:i.length;n--&&!1!==r(i[n],n,i););return i}:iH)(i,nf(r,3))}var af=r$(function(i,r,n){eO.call(i,n)?i[n].push(r):iD(i,n,[r])}),ap=rm(function(i,r,n){var a=-1,o="function"==typeof r,s=aU(i)?ex(i.length):[];return iV(i,function(i){s[++a]=o?tu(r,i,n):i3(i,r,n)}),s}),am=r$(function(i,r,n){iD(i,n,r)});function ag(i,r){return(az(i)?tg:rn)(i,nf(r,3))}var a_=r$(function(i,r,n){i[+!n].push(r)},function(){return[[],[]]}),ay=rm(function(i,r){if(null==i)return[];var n=r.length;return n>1&&nE(i,r[0],r[1])?r=[]:n>2&&nE(r[0],r[1],r[2])&&(r=[r[0]]),ru(i,iW(r,1),[])}),av=ti||function(){return e8.Date.now()};function ax(i,r,n){return r=n?a:r,r=i&&null==r?i.length:r,ni(i,128,a,a,a,a,r)}function ab(i,r){var n;if("function"!=typeof r)throw new eI(o);return i=a7(i),function(){return--i>0&&(n=r.apply(this,arguments)),i<=1&&(r=a),n}}var aw=rm(function(i,r,n){var a=1;if(n.length){var o=tq(n,nh(aw));a|=32}return ni(i,a,r,n,o)}),aT=rm(function(i,r,n){var a=3;if(n.length){var o=tq(n,nh(aT));a|=32}return ni(r,a,i,n,o)});function aE(i,r,n){r=n?a:r;var o=ni(i,8,a,a,a,a,a,r);return o.placeholder=aE.placeholder,o}function aS(i,r,n){r=n?a:r;var o=ni(i,16,a,a,a,a,a,r);return o.placeholder=aS.placeholder,o}function aA(i,r,n){var s,l,u,c,d,h,f=0,p=!1,m=!1,g=!0;if("function"!=typeof i)throw new eI(o);function _(r){var n=s,o=l;return s=l=a,f=r,c=i.apply(o,n)}function y(i){var n=i-h,o=i-f;return a===h||n>=r||n<0||m&&o>=u}function v(){var i,n,a,o=av();if(y(o))return x(o);d=nO(v,(i=o-h,n=o-f,a=r-i,m?t9(a,u-n):a))}function x(i){return(d=a,g&&s)?_(i):(s=l=a,c)}function b(){var i,n=av(),o=y(n);if(s=arguments,l=this,h=n,o){if(a===d)return f=i=h,d=nO(v,r),p?_(i):c;if(m)return rN(d),d=nO(v,r),_(h)}return a===d&&(d=nO(v,r)),c}return r=ot(r)||0,aZ(n)&&(p=!!n.leading,u=(m="maxWait"in n)?t4(ot(n.maxWait)||0,r):u,g="trailing"in n?!!n.trailing:g),b.cancel=function(){a!==d&&rN(d),f=0,s=h=l=d=a},b.flush=function(){return a===d?c:x(av())},b}var aC=rm(function(i,r){return iB(i,1,r)}),aI=rm(function(i,r,n){return iB(i,ot(r)||0,n)});function ak(i,r){if("function"!=typeof i||null!=r&&"function"!=typeof r)throw new eI(o);var n=function(){var a=arguments,o=r?r.apply(this,a):a[0],s=n.cache;if(s.has(o))return s.get(o);var l=i.apply(this,a);return n.cache=s.set(o,l)||s,l};return n.cache=new(ak.Cache||iS),n}
vendor: 1,982 bytes, line 119
119function aR(i){if("function"!=typeof i)throw new eI(o);return function(){var r=arguments;switch(r.length){case 0:return!i.call(this);case 1:return!i.call(this,r[0]);case 2:return!i.call(this,r[0],r[1]);case 3:return!i.call(this,r[0],r[1],r[2])}return!i.apply(this,r)}}ak.Cache=iS;var aM=rm(function(i,r){var n=(r=1==r.length&&az(r[0])?tg(r[0],tO(nf())):tg(iW(r,1),tO(nf()))).length;return rm(function(a){for(var o=-1,s=t9(a.length,n);++o<s;)a[o]=r[o].call(this,a[o]);return tu(i,this,a)})}),aL=rm(function(i,r){var n=tq(r,nh(aL));return ni(i,32,a,r,n)}),aP=rm(function(i,r){var n=tq(r,nh(aP));return ni(i,64,a,r,n)}),aO=ns(function(i,r){return ni(i,256,a,a,a,r)});function aD(i,r){return i===r||i!=i&&r!=r}var aF=r8(i2),aN=r8(function(i,r){return i>=r}),aj=i8(function(){return arguments}())?i8:function(i){return aK(i)&&eO.call(i,"callee")&&!eK.call(i,"callee")},az=ex.isArray,aB=tr?tO(tr):function(i){return aK(i)&&i0(i)==I};function aU(i){return null!=i&&aY(i.length)&&!a$(i)}function aV(i){return aK(i)&&aU(i)}var aH=t1||o0,aG=tn?tO(tn):function(i){return aK(i)&&i0(i)==m};function aq(i){if(!aK(i))return!1;var r=i0(i);return r==g||"[object DOMException]"==r||"string"==typeof i.message&&"string"==typeof i.name&&!aJ(i)}function a$(i){if(!aZ(i))return!1;var r=i0(i);return r==_||r==y||"[object AsyncFunction]"==r||"[object Proxy]"==r}function aW(i){return"number"==typeof i&&i==a7(i)}function aY(i){return"number"==typeof i&&i>-1&&i%1==0&&i<=0x1fffffffffffff}function aZ(i){var r=typeof i;return null!=i&&("object"==r||"function"==r)}function aK(i){return null!=i&&"object"==typeof i}var aX=ta?tO(ta):function(i){return aK(i)&&nv(i)==v};function aQ(i){return"number"==typeof i||aK(i)&&i0(i)==x}function aJ(i){if(!aK(i)||i0(i)!=b)return!1;var r=eq(i);if(null===r)return!0;var n=eO.call(r,"constructor")&&r.constructor;return"function"==typeof n&&n instanceof n&&eP.call(n)==ej}var a1=to?tO(to):function(i){return aK(i)&&i0(i)==T},a0=ts?tO(ts):function(i){return aK(i)&&nv(i)==E};
119function a2(i){return"string"==typeof i||!az(i)&&aK(i)&&i0(i)==S}function a5(i){return"symbol"==typeof i||aK(i)&&i0(i)==A}var a4=tl?tO(tl):function(i){return aK(i)&&aY(i.length)&&!!e1[i0(i)]},a9=r8(rr),a3=r8(function(i,r){return i<=r});function a8(i){if(!i)return[];if(aU(i))return a2(i)?tY(i):rG(i);if(e3&&i[e3]){for(var r,n=i[e3](),a=[];!(r=n.next()).done;)a.push(r.value);return a}var o=nv(i);return(o==v?tH:o==E?t$:oS)(i)}function a6(i){return i?(i=ot(i))===u||i===-u?(i<0?-1:1)*17976931348623157e292:i==i?i:0:0===i?i:0}function a7(i){var r=a6(i),n=r%1;return r==r?n?r-n:r:0}function oe(i){return i?iN(a7(i),0,0xffffffff):0}function ot(i){if("number"==typeof i)return i;if(a5(i))return c;if(aZ(i)){var r="function"==typeof i.valueOf?i.valueOf():i;i=aZ(r)?r+"":r}if("string"!=typeof i)return 0===i?i:+i;i=tP(i);var n=ed.test(i);return n||ef.test(i)?e4(i.slice(2),n?2:8):ec.test(i)?c:+i}function oi(i){return rq(i,o_(i))}function or(i){return null==i?"":rS(i)}var on=rW(function(i,r){if(nI(r)||aU(r))return void rq(r,og(r),i);for(var n in r)eO.call(r,n)&&iM(i,n,r[n])}),oa=rW(function(i,r){rq(r,o_(r),i)}),oo=rW(function(i,r,n,a){rq(r,o_(r),i,a)}),os=rW(function(i,r,n,a){rq(r,og(r),i,a)}),ol=ns(iF),ou=rm(function(i,r){i=eS(i);var n=-1,o=r.length,s=o>2?r[2]:a;for(s&&nE(r[0],r[1],s)&&(o=1);++n<o;)for(var l=r[n],u=o_(l),c=-1,d=u.length;++c<d;){var h=u[c],f=i[h];(a===f||aD(f,eM[h])&&!eO.call(i,h))&&(i[h]=l[h])}return i}),oc=rm(function(i){return i.push(a,nn),tu(ov,a,i)});function od(i,r,n){var o=null==i?a:iJ(i,r);return a===o?n:o}function oh(i,r){return null!=i&&nx(i,r,i4)}var of=r2(function(i,r,n){null!=r&&"function"!=typeof r.toString&&(r=eN.call(r)),i[r]=n},oz(oV)),op=r2(function(i,r,n){null!=r&&"function"!=typeof r.toString&&(r=eN.call(r)),eO.call(i,r)?i[r].push(n):i[r]=[n]},nf),om=rm(i3);function og(i){return aU(i)?iI(i):ri(i)}function o_(i){return aU(i)?iI(i,!0):function(i){if(!aZ(i)){var r=i,n=[];if(null!=r)for(var a in eS(r))n.push(a);return n}var o=nI(i),s=[];for(var l in i)"constructor"==l&&(o||!eO.call(i,l))||s.push(l);return s}(i)}var oy=rW(function(i,r,n){rs(i,r,n)}),ov=rW(function(i,r,n,a){rs(i,r,n,a)}),ox=ns(function(i,r){var n={};if(null==i)return n;var a=!1;r=tg(r,function(r){return r=rD(r,i),a||(a=r.length>1),r}),rq(i,nu(i),n),a&&(n=ij(n,7,na));for(var o=r.length;o--;)rC(n,r[o]);return n}),ob=ns(function(i,r){return null==i?{}:rc(i,r,function(r,n){return oh(i,n)})});function ow(i,r){if(null==i)return{};var n=tg(nu(i),function(i){return[i]});return r=nf(r),rc(i,n,function(i,n){return r(i,n[0])})}var oT=nt(og),oE=nt(o_);function oS(i){return null==i?[]:tD(i,og(i))}var oA=rX(function(i,r,n){return r=r.toLowerCase(),i+(n?oC(r):r)});function oC(i){return oD(or(i).toLowerCase())}function oI(i){return(i=or(i))&&i.replace(em,tz).replace(eW,"")}var ok=rX(function(i,r,n){return i+(n?"-":"")+r.toLowerCase()}),oR=rX(function(i,r,n){return i+(n?" ":"")+r.toLowerCase()}),oM=rK("toLowerCase"),oL=rX(function(i,r,n){return i+(n?"_":"")+r.toLowerCase()}),oP=rX(function(i,r,n){return i+(n?" ":"")+oD(r)}),oO=rX(function(i,r,n){return i+(n?" ":"")+r.toUpperCase()}),oD=rK("toUpperCase");function oF(i,r,n){if(i=or(i),r=n?a:r,a===r){var o;return(o=i,eX.test(o))?i.match(eZ)||[]:i.match(ea)||[]}return i.match(r)||[]}var oN=rm(function(i,r){try{return tu(i,a,r)}catch(i){return aq(i)?i:new ew(i)}}),oj=ns(function(i,r){return td(r,function(r){iD(i,r=nB(r),aw(i[r],i))}),i});function oz(i){return function(){return i}}var oB=r1(),oU=r1(!0);function oV(i){return i}function oH(i){return rt("function"==typeof i?i:ij(i,1))}var oG=rm(function(i,r){return function(n){return i3(n,i,r)}}),oq=rm(function(i,r){return function(n){return i3(i,n,r)}});function o$(i,r,n){var a=og(r),o=iQ(r,a);null!=n||aZ(r)&&(o.length||!a.length)||(n=r,r=i,i=this,o=iQ(r,og(r)));var s=!(aZ(n)&&"chain"in n)||!!n.chain,l=a$(i);return td(o,function(n){var a=r[n];i[n]=a,l&&(i.prototype[n]=function(){var r=this.__chain__;if(s||r){var n=i(this.__wrapped__);return(n.__actions__=rG(this.__actions__)).push({func:a,args:arguments,thisArg:i}),n.__chain__=r,n}return a.apply(i,t_([this.value()],arguments))})}),i}function oW(){}var oY=r4(tg),oZ=r4(th),oK=r4(tx);function oX(i){return nS(i)?tI(nB(i)):function(r){return iJ(r,i)}}var oQ=r3(),oJ=r3(!0);function o1(){return[]}function o0(){return!1}var o2=r5(function(i,r){return i+r},0),o5=r7("ceil"),o4=r5(function(i,r){return i/r},1),o9=r7("floor"),o3=r5(function(i,r){return i*r},1),o8=r7("round"),o6=r5(function(i,r){return i-r},0);return iy.after=function(i,r){if("function"!=typeof r)throw new eI(o);return i=a7(i),function(){if(--i<1)return r.apply(this,arguments)}},iy.ary=ax,iy.assign=on,iy.assignIn=oa,iy.assignInWith=oo,iy.assignWith=os,iy.at=ol,iy.before=ab,iy.bind=aw,iy.bindAll=oj,iy.bindKey=aT,iy.castArray=function(){if(!arguments.length)return[];var i=arguments[0];return az(i)?i:[i]},iy.chain=aa,iy.chunk=function(i,r,n){r=(n?nE(i,r,n):a===r)?1:t4(a7(r),0);var o=null==i?0:i.length;if(!o||r<1)return[];for(var s=0,l=0,u=ex(tk(o/r));s<o;)u[l++]=rv(i,s,s+=r);return u},iy.compact=function(i){for(var r=-1,n=null==i?0:i.length,a=0,o=[];++r<n;){var s=i[r];s&&(o[a++]=s)}return o},iy.concat=function(){var i=arguments.length;if(!i)return[];for(var r=ex(i-1),n=arguments[0],a=i;a--;)r[a-1]=arguments[a];return t_(az(n)?rG(n):[n],iW(r,1))},iy.cond=function(i){var r=null==i?0:i.length,n=nf();return i=r?tg(i,function(i){if("function"!=typeof i[1])throw new eI(o);return[n(i[0]),i[1]]}):[],rm(function(n){for(var a=-1;++a<r;){var o=i[a];if(tu(o[0],this,n))return tu(o[1],this,n)}})},iy.conforms=function(i){var r,n;return n=og(r=ij(i,1)),function(i){return iz(i,r,n)}},iy.constant=oz,iy.countBy=al,iy.create=function(i,r){var n=iv(i);return null==r?n:iO(n,r)},iy.curry=aE,iy.curryRight=aS,iy.debounce=aA,iy.defaults=ou,iy.defaultsDeep=oc,iy.defer=aC,iy.delay=aI,iy.difference=nH,iy.differenceBy=nG,iy.differenceWith=nq,iy.drop=function(i,r,n){var o=null==i?0:i.length;return o?rv(i,(r=n||a===r?1:a7(r))<0?0:r,o):[]},iy.dropRight=function(i,r,n){var o=null==i?0:i.length;
vendor: 13,545 bytes, line 119
119return o?rv(i,0,(r=o-(r=n||a===r?1:a7(r)))<0?0:r):[]},iy.dropRightWhile=function(i,r){return i&&i.length?rk(i,nf(r,3),!0,!0):[]},iy.dropWhile=function(i,r){return i&&i.length?rk(i,nf(r,3),!0):[]},iy.fill=function(i,r,n,o){var s=null==i?0:i.length;if(!s)return[];n&&"number"!=typeof n&&nE(i,r,n)&&(n=0,o=s);var l=n,u=o,c=i.length;for((l=a7(l))<0&&(l=-l>c?0:c+l),(u=a===u||u>c?c:a7(u))<0&&(u+=c),u=l>u?0:oe(u);l<u;)i[l++]=r;return i},iy.filter=function(i,r){return(az(i)?tf:i$)(i,nf(r,3))},iy.flatMap=function(i,r){return iW(ag(i,r),1)},iy.flatMapDeep=function(i,r){return iW(ag(i,r),u)},iy.flatMapDepth=function(i,r,n){return n=a===n?1:a7(n),iW(ag(i,r),n)},iy.flatten=nY,iy.flattenDeep=function(i){return(null==i?0:i.length)?iW(i,u):[]},iy.flattenDepth=function(i,r){return(null==i?0:i.length)?iW(i,r=a===r?1:a7(r)):[]},iy.flip=function(i){return ni(i,512)},iy.flow=oB,iy.flowRight=oU,iy.fromPairs=function(i){for(var r=-1,n=null==i?0:i.length,a={};++r<n;){var o=i[r];iD(a,o[0],o[1])}return a},iy.functions=function(i){return null==i?[]:iQ(i,og(i))},iy.functionsIn=function(i){return null==i?[]:iQ(i,o_(i))},iy.groupBy=af,iy.initial=function(i){return(null==i?0:i.length)?rv(i,0,-1):[]},iy.intersection=nK,iy.intersectionBy=nX,iy.intersectionWith=nQ,iy.invert=of,iy.invertBy=op,iy.invokeMap=ap,iy.iteratee=oH,iy.keyBy=am,iy.keys=og,iy.keysIn=o_,iy.map=ag,iy.mapKeys=function(i,r){var n={};return r=nf(r,3),iK(i,function(i,a,o){iD(n,r(i,a,o),i)}),n},iy.mapValues=function(i,r){var n={};return r=nf(r,3),iK(i,function(i,a,o){iD(n,a,r(i,a,o))}),n},iy.matches=function(i){return ra(ij(i,1))},iy.matchesProperty=function(i,r){return ro(i,ij(r,1))},iy.memoize=ak,iy.merge=oy,iy.mergeWith=ov,iy.method=oG,iy.methodOf=oq,iy.mixin=o$,iy.negate=aR,iy.nthArg=function(i){return i=a7(i),rm(function(r){return rl(r,i)})},iy.omit=ox,iy.omitBy=function(i,r){return ow(i,aR(nf(r)))},iy.once=function(i){return ab(2,i)},iy.orderBy=function(i,r,n,o){return null==i?[]:(az(r)||(r=null==r?[]:[r]),az(n=o?a:n)||(n=null==n?[]:[n]),ru(i,r,n))},iy.over=oY,iy.overArgs=aM,iy.overEvery=oZ,iy.overSome=oK,iy.partial=aL,iy.partialRight=aP,iy.partition=a_,iy.pick=ob,iy.pickBy=ow,iy.property=oX,iy.propertyOf=function(i){return function(r){return null==i?a:iJ(i,r)}},iy.pull=n1,iy.pullAll=n0,iy.pullAllBy=function(i,r,n){return i&&i.length&&r&&r.length?rd(i,r,nf(n,2)):i},iy.pullAllWith=function(i,r,n){return i&&i.length&&r&&r.length?rd(i,r,a,n):i},iy.pullAt=n2,iy.range=oQ,iy.rangeRight=oJ,iy.rearg=aO,iy.reject=function(i,r){return(az(i)?tf:i$)(i,aR(nf(r,3)))},iy.remove=function(i,r){var n=[];if(!(i&&i.length))return n;var a=-1,o=[],s=i.length;for(r=nf(r,3);++a<s;){var l=i[a];r(l,a,i)&&(n.push(l),o.push(a))}return rh(i,o),n},iy.rest=function(i,r){if("function"!=typeof i)throw new eI(o);return rm(i,r=a===r?r:a7(r))},iy.reverse=n5,iy.sampleSize=function(i,r,n){return r=(n?nE(i,r,n):a===r)?1:a7(r),(az(i)?function(i,r){return nj(rG(i),iN(r,0,i.length))}:function(i,r){var n=oS(i);return nj(n,iN(r,0,n.length))})(i,r)},iy.set=function(i,r,n){return null==i?i:rg(i,r,n)},iy.setWith=function(i,r,n,o){return o="function"==typeof o?o:a,null==i?i:rg(i,r,n,o)},iy.shuffle=function(i){return(az(i)?function(i){return nj(rG(i))}:function(i){return nj(oS(i))})(i)},iy.slice=function(i,r,n){var o=null==i?0:i.length;return o?(n&&"number"!=typeof n&&nE(i,r,n)?(r=0,n=o):(r=null==r?0:a7(r),n=a===n?o:a7(n)),rv(i,r,n)):[]},iy.sortBy=ay,iy.sortedUniq=function(i){return i&&i.length?rT(i):[]},iy.sortedUniqBy=function(i,r){return i&&i.length?rT(i,nf(r,2)):[]},iy.split=function(i,r,n){return(n&&"number"!=typeof n&&nE(i,r,n)&&(r=n=a),n=a===n?0xffffffff:n>>>0)?(i=or(i))&&("string"==typeof r||null!=r&&!a1(r))&&!(r=rS(r))&&tV(i)?rF(tY(i),0,n):i.split(r,n):[]},iy.spread=function(i,r){if("function"!=typeof i)throw new eI(o);return r=null==r?0:t4(a7(r),0),rm(function(n){var a=n[r],o=rF(n,0,r);return a&&t_(o,a),tu(i,this,o)})},iy.tail=function(i){var r=null==i?0:i.length;return r?rv(i,1,r):[]},iy.take=function(i,r,n){return i&&i.length?rv(i,0,(r=n||a===r?1:a7(r))<0?0:r):[]},iy.takeRight=function(i,r,n){var o=null==i?0:i.length;return o?rv(i,(r=o-(r=n||a===r?1:a7(r)))<0?0:r,o):[]},iy.takeRightWhile=function(i,r){return i&&i.length?rk(i,nf(r,3),!1,!0):[]},iy.takeWhile=function(i,r){return i&&i.length?rk(i,nf(r,3)):[]},iy.tap=function(i,r){return r(i),i},iy.throttle=function(i,r,n){var a=!0,s=!0;if("function"!=typeof i)throw new eI(o);return aZ(n)&&(a="leading"in n?!!n.leading:a,s="trailing"in n?!!n.trailing:s),aA(i,r,{leading:a,maxWait:r,trailing:s})},iy.thru=ao,iy.toArray=a8,iy.toPairs=oT,iy.toPairsIn=oE,iy.toPath=function(i){return az(i)?tg(i,nB):a5(i)?[i]:rG(nz(or(i)))},iy.toPlainObject=oi,iy.transform=function(i,r,n){var a=az(i),o=a||aH(i)||a4(i);if(r=nf(r,4),null==n){var s=i&&i.constructor;n=o?a?new s:[]:aZ(i)&&a$(s)?iv(eq(i)):{}}return(o?td:iK)(i,function(i,a,o){return r(n,i,a,o)}),n},iy.unary=function(i){return ax(i,1)},iy.union=n4,iy.unionBy=n9,iy.unionWith=n3,iy.uniq=function(i){return i&&i.length?rA(i):[]},iy.uniqBy=function(i,r){return i&&i.length?rA(i,nf(r,2)):[]},iy.uniqWith=function(i,r){return r="function"==typeof r?r:a,i&&i.length?rA(i,a,r):[]},iy.unset=function(i,r){return null==i||rC(i,r)},iy.unzip=n8,iy.unzipWith=n6,iy.update=function(i,r,n){return null==i?i:rI(i,r,rO(n))},iy.updateWith=function(i,r,n,o){return o="function"==typeof o?o:a,null==i?i:rI(i,r,rO(n),o)},iy.values=oS,iy.valuesIn=function(i){return null==i?[]:tD(i,o_(i))},iy.without=n7,iy.words=oF,iy.wrap=function(i,r){return aL(rO(r),i)},iy.xor=ae,iy.xorBy=at,iy.xorWith=ai,iy.zip=ar,iy.zipObject=function(i,r){return rL(i||[],r||[],iM)},iy.zipObjectDeep=function(i,r){return rL(i||[],r||[],rg)},iy.zipWith=an,iy.entries=oT,iy.entriesIn=oE,iy.extend=oa,iy.extendWith=oo,o$(iy,iy),iy.add=o2,iy.attempt=oN,iy.camelCase=oA,iy.capitalize=oC,iy.ceil=o5,iy.clamp=function(i,r,n){return a===n&&(n=r,r=a),a!==n&&(n=(n=ot(n))==n?n:0),a!==r&&(r=(r=ot(r))==r?r:0),iN(ot(i),r,n)},iy.clone=function(i){return ij(i,4)},iy.cloneDeep=function(i){return ij(i,5)},iy.cloneDeepWith=function(i,r){return ij(i,5,r="function"==typeof r?r:a)},iy.cloneWith=function(i,r){return ij(i,4,r="function"==typeof r?r:a)},iy.conformsTo=function(i,r){return null==r||iz(i,r,og(r))},iy.deburr=oI,iy.defaultTo=function(i,r){return null==i||i!=i?r:i},iy.divide=o4,iy.endsWith=function(i,r,n){i=or(i),r=rS(r);var o=i.length,s=n=a===n?o:iN(a7(n),0,o);return(n-=r.length)>=0&&i.slice(n,s)==r},iy.eq=aD,iy.escape=function(i){return(i=or(i))&&q.test(i)?i.replace(H,tB):i},iy.escapeRegExp=function(i){return(i=or(i))&&J.test(i)?i.replace(Q,"\\$&"):i},iy.every=function(i,r,n){var o=az(i)?th:iG;return n&&nE(i,r,n)&&(r=a),o(i,nf(r,3))},iy.find=au,iy.findIndex=n$,iy.findKey=function(i,r){return tw(i,nf(r,3),iK)},iy.findLast=ac,iy.findLastIndex=nW,iy.findLastKey=function(i,r){return tw(i,nf(r,3),iX)},iy.floor=o9,iy.forEach=ad,iy.forEachRight=ah,iy.forIn=function(i,r){return null==i?i:iY(i,nf(r,3),o_)},iy.forInRight=function(i,r){return null==i?i:iZ(i,nf(r,3),o_)},iy.forOwn=function(i,r){return i&&iK(i,nf(r,3))},iy.forOwnRight=function(i,r){return i&&iX(i,nf(r,3))},iy.get=od,iy.gt=aF,iy.gte=aN,iy.has=function(i,r){return null!=i&&nx(i,r,i5)},iy.hasIn=oh,iy.head=nZ,iy.identity=oV,iy.includes=function(i,r,n,a){i=aU(i)?i:oS(i),n=n&&!a?a7(n):0;var o=i.length;return n<0&&(n=t4(o+n,0)),a2(i)?n<=o&&i.indexOf(r,n)>-1:!!o&&tE(i,r,n)>-1},iy.indexOf=function(i,r,n){var a=null==i?0:i.length;if(!a)return -1;var o=null==n?0:a7(n);return o<0&&(o=t4(a+o,0)),tE(i,r,o)},iy.inRange=function(i,r,n){var o,s,l;return r=a6(r),a===n?(n=r,r=0):n=a6(n),(o=i=ot(i))>=t9(s=r,l=n)&&o<t4(s,l)},iy.invoke=om,iy.isArguments=aj,iy.isArray=az,iy.isArrayBuffer=aB,iy.isArrayLike=aU,iy.isArrayLikeObject=aV,iy.isBoolean=function(i){return!0===i||!1===i||aK(i)&&i0(i)==p},iy.isBuffer=aH,iy.isDate=aG,iy.isElement=function(i){return aK(i)&&1===i.nodeType&&!aJ(i)},iy.isEmpty=function(i){if(null==i)return!0;if(aU(i)&&(az(i)||"string"==typeof i||"function"==typeof i.splice||aH(i)||a4(i)||aj(i)))return!i.length;var r=nv(i);if(r==v||r==E)return!i.size;if(nI(i))return!ri(i).length;for(var n in i)if(eO.call(i,n))return!1;return!0},iy.isEqual=function(i,r){return i6(i,r)},iy.isEqualWith=function(i,r,n){var o=(n="function"==typeof n?n:a)?n(i,r):a;return a===o?i6(i,r,a,n):!!o},iy.isError=aq,iy.isFinite=function(i){return"number"==typeof i&&t0(i)},iy.isFunction=a$,iy.isInteger=aW,iy.isLength=aY,iy.isMap=aX,iy.isMatch=function(i,r){return i===r||i7(i,r,nm(r))},iy.isMatchWith=function(i,r,n){return n="function"==typeof n?n:a,i7(i,r,nm(r),n)},iy.isNaN=function(i){return aQ(i)&&i!=+i},iy.isNative=function(i){if(nC(i))throw new ew("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return re(i)},iy.isNil=function(i){return null==i},iy.isNull=function(i){return null===i},iy.isNumber=aQ,iy.isObject=aZ,iy.isObjectLike=aK,iy.isPlainObject=aJ,iy.isRegExp=a1,iy.isSafeInteger=function(i){return aW(i)&&i>=-0x1fffffffffffff&&i<=0x1fffffffffffff},iy.isSet=a0,iy.isString=a2,iy.isSymbol=a5,iy.isTypedArray=a4,iy.isUndefined=function(i){return a===i},iy.isWeakMap=function(i){return aK(i)&&nv(i)==C},iy.isWeakSet=function(i){return aK(i)&&"[object WeakSet]"==i0(i)},iy.join=function(i,r){return null==i?"":t2.call(i,r)},iy.kebabCase=ok,iy.last=nJ,iy.lastIndexOf=function(i,r,n){var o=null==i?0:i.length;if(!o)return -1;var s=o;return a!==n&&(s=(s=a7(n))<0?t4(o+s,0):t9(s,o-1)),r==r?function(i,r,n){for(var a=n+1;a--&&i[a]!==r;);return a}(i,r,s):tT(i,tA,s,!0)},iy.lowerCase=oR,iy.lowerFirst=oM,iy.lt=a9,iy.lte=a3,iy.max=function(i){return i&&i.length?iq(i,oV,i2):a},iy.maxBy=function(i,r){return i&&i.length?iq(i,nf(r,2),i2):a},iy.mean=function(i){return tC(i,oV)},iy.meanBy=function(i,r){return tC(i,nf(r,2))},iy.min=function(i){return i&&i.length?iq(i,oV,rr):a},iy.minBy=function(i,r){return i&&i.length?iq(i,nf(r,2),rr):a},iy.stubArray=o1,iy.stubFalse=o0,iy.stubObject=function(){return{}},iy.stubString=function(){return""},iy.stubTrue=function(){return!0},iy.multiply=o3,iy.nth=function(i,r){return i&&i.length?rl(i,a7(r)):a},iy.noConflict=function(){return e8._===this&&(e8._=ez),this},iy.noop=oW,iy.now=av,iy.pad=function(i,r,n){i=or(i);var a=(r=a7(r))?tW(i):0;if(!r||a>=r)return i;var o=(r-a)/2;return r9(tQ(o),n)+i+r9(tk(o),n)},iy.padEnd=function(i,r,n){i=or(i);var a=(r=a7(r))?tW(i):0;return r&&a<r?i+r9(r-a,n):i},iy.padStart=function(i,r,n){i=or(i);var a=(r=a7(r))?tW(i):0;return r&&a<r?r9(r-a,n)+i:i},iy.parseInt=function(i,r,n){return n||null==r?r=0:r&&(r*=1),t8(or(i).replace(ee,""),r||0)},iy.random=function(i,r,n){if(n&&"boolean"!=typeof n&&nE(i,r,n)&&(r=n=a),a===n&&("boolean"==typeof r?(n=r,r=a):"boolean"==typeof i&&(n=i,i=a)),a===i&&a===r?(i=0,r=1):(i=a6(i),a===r?(r=i,i=0):r=a6(r)),i>r){var o=i;i=r,r=o}if(n||i%1||r%1){var s=t6();return t9(i+s*(r-i+e5("1e-"+((s+"").length-1))),r)}return rf(i,r)},iy.reduce=function(i,r,n){var a=az(i)?ty:tR,o=arguments.length<3;return a(i,nf(r,4),n,o,iV)},iy.reduceRight=function(i,r,n){var a=az(i)?tv:tR,o=arguments.length<3;return a(i,nf(r,4),n,o,iH)},iy.repeat=function(i,r,n){return r=(n?nE(i,r,n):a===r)?1:a7(r),rp(or(i),r)},iy.replace=function(){var i=arguments,r=or(i[0]);return i.length<3?r:r.replace(i[1],i[2])},iy.result=function(i,r,n){r=rD(r,i);var o=-1,s=r.length;for(s||(s=1,i=a);++o<s;){var l=null==i?a:i[nB(r[o])];a===l&&(o=s,l=n),i=a$(l)?l.call(i):l}return i},iy.round=o8,iy.runInContext=i,iy.sample=function(i){return(az(i)?ik:function(i){return ik(oS(i))})(i)},iy.size=function(i){if(null==i)return 0;if(aU(i))return a2(i)?tW(i):i.length;var r=nv(i);return r==v||r==E?i.size:ri(i).length},iy.snakeCase=oL,iy.some=function(i,r,n){var o=az(i)?tx:rx;return n&&nE(i,r,n)&&(r=a),o(i,nf(r,3))},iy.sortedIndex=function(i,r){return rb(i,r)},iy.sortedIndexBy=function(i,r,n){return rw(i,r,nf(n,2))},iy.sortedIndexOf=function(i,r){var n=null==i?0:i.length;if(n){var a=rb(i,r);if(a<n&&aD(i[a],r))return a}return -1},iy.sortedLastIndex=function(i,r){return rb(i,r,!0)},iy.sortedLastIndexBy=function(i,r,n){return rw(i,r,nf(n,2),!0)},iy.sortedLastIndexOf=function(i,r){if(null==i?0:i.length){var n=rb(i,r,!0)-1;if(aD(i[n],r))return n}return -1},iy.startCase=oP,iy.startsWith=function(i,r,n){return i=or(i),n=null==n?0:iN(a7(n),0,i.length),r=rS(r),i.slice(n,n+r.length)==r},iy.subtract=o6,iy.sum=function(i){return i&&i.length?tM(i,oV):0},iy.sumBy=function(i,r){return i&&i.length?tM(i,nf(r,2)):0},iy.template=function(i,r,n){var o=iy.templateSettings;n&&nE(i,r,n)&&(r=a),i=or(i),r=os({},r,o,nr);var s=os({},r.imports,o.imports,nr),l=og(s),u=tD(s,l);td(l,function(i){if(eo.test(i))throw new ew("Invalid `imports` option passed into `_.template`")});var c,d,h=0,f=r.interpolate||eg,p="__p += '",m=eA((r.escape||eg).source+"|"+f.source+"|"+(f===Y?el:eg).source+"|"+(r.evaluate||eg).source+"|$","g"),g="//# sourceURL="+(eO.call(r,"sourceURL")?(r.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++eJ+"]")+"\n";i.replace(m,function(r,n,a,o,s,l){return a||(a=o),p+=i.slice(h,l).replace(e_,tU),n&&(c=!0,p+="' +\n__e("+n+") +\n'"),s&&(d=!0,p+="';\n"+s+";\n__p += '"),a&&(p+="' +\n((__t = ("+a+")) == null ? '' : __t) +\n'"),h=l+r.length,r}),p+="';\n";var _=eO.call(r,"variable")&&r.variable;if(_){if(eo.test(_))throw new ew("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(d?p.replace(z,""):p).replace(B,"$1").replace(U,"$1;"),p="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(c?", __e = _.escape":"")+(d?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";
119\n")+p+"return __p\n}";var y=oN(function(){return eT(l,g+"return "+p).apply(a,u)});if(y.source=p,aq(y))throw y;return y},iy.times=function(i,r){if((i=a7(i))<1||i>0x1fffffffffffff)return[];var n=0xffffffff,a=t9(i,0xffffffff);r=nf(r),i-=0xffffffff;for(var o=tL(a,r);++n<i;)r(n);return o},iy.toFinite=a6,iy.toInteger=a7,iy.toLength=oe,iy.toLower=function(i){return or(i).toLowerCase()},iy.toNumber=ot,iy.toSafeInteger=function(i){return i?iN(a7(i),-0x1fffffffffffff,0x1fffffffffffff):0===i?i:0},iy.toString=or,iy.toUpper=function(i){return or(i).toUpperCase()},iy.trim=function(i,r,n){if((i=or(i))&&(n||a===r))return tP(i);if(!i||!(r=rS(r)))return i;var o=tY(i),s=tY(r),l=tN(o,s),u=tj(o,s)+1;return rF(o,l,u).join("")},iy.trimEnd=function(i,r,n){if((i=or(i))&&(n||a===r))return i.slice(0,tZ(i)+1);if(!i||!(r=rS(r)))return i;var o=tY(i),s=tj(o,tY(r))+1;return rF(o,0,s).join("")},iy.trimStart=function(i,r,n){if((i=or(i))&&(n||a===r))return i.replace(ee,"");if(!i||!(r=rS(r)))return i;var o=tY(i),s=tN(o,tY(r));return rF(o,s).join("")},iy.truncate=function(i,r){var n=30,o="...";if(aZ(r)){var s="separator"in r?r.separator:s;n="length"in r?a7(r.length):n,o="omission"in r?rS(r.omission):o}var l=(i=or(i)).length;if(tV(i)){var u=tY(i);l=u.length}if(n>=l)return i;var c=n-tW(o);if(c<1)return o;var d=u?rF(u,0,c).join(""):i.slice(0,c);if(a===s)return d+o;if(u&&(c+=d.length-c),a1(s)){if(i.slice(c).search(s)){var h,f=d;for(s.global||(s=eA(s.source,or(eu.exec(s))+"g")),s.lastIndex=0;h=s.exec(f);)var p=h.index;d=d.slice(0,a===p?c:p)}}else if(i.indexOf(rS(s),c)!=c){var m=d.lastIndexOf(s);m>-1&&(d=d.slice(0,m))}return d+o},iy.unescape=function(i){return(i=or(i))&&G.test(i)?i.replace(V,tK):i},iy.uniqueId=function(i){var r=++eD;return or(i)+r},iy.upperCase=oO,iy.upperFirst=oD,iy.each=ad,iy.eachRight=ah,iy.first=nZ,o$(iy,(ev={},iK(iy,function(i,r){eO.call(iy.prototype,r)||(ev[r]=i)}),ev),{chain:!1}),iy.VERSION="4.18.1",td(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){iy[i].placeholder=iy}),td(["drop","take"],function(i,r){iw.prototype[i]=function(n){n=a===n?1:t4(a7(n),0);var o=this.__filtered__&&!r?new iw(this):this.clone();return o.__filtered__?o.__takeCount__=t9(n,o.__takeCount__):o.__views__.push({size:t9(n,0xffffffff),type:i+(o.__dir__<0?"Right":"")}),o},iw.prototype[i+"Right"]=function(r){return this.reverse()[i](r).reverse()}}),td(["filter","map","takeWhile"],function(i,r){var n=r+1,a=1==n||3==n;iw.prototype[i]=function(i){var r=this.clone();return r.__iteratees__.push({iteratee:nf(i,3),type:n}),r.__filtered__=r.__filtered__||a,r}}),td(["head","last"],function(i,r){var n="take"+(r?"Right":"");iw.prototype[i]=function(){return this[n](1).value()[0]}}),td(["initial","tail"],function(i,r){var n="drop"+(r?"":"Right");iw.prototype[i]=function(){return this.__filtered__?new iw(this):this[n](1)}}),iw.prototype.compact=function(){return this.filter(oV)},iw.prototype.find=function(i){return this.filter(i).head()},iw.prototype.findLast=function(i){return this.reverse().find(i)},iw.prototype.invokeMap=rm(function(i,r){return"function"==typeof i?new iw(this):this.map(function(n){return i3(n,i,r)})}),iw.prototype.reject=function(i){return this.filter(aR(nf(i)))},iw.prototype.slice=function(i,r){i=a7(i);var n=this;return n.__filtered__&&(i>0||r<0)?new iw(n):(i<0?n=n.takeRight(-i):i&&(n=n.drop(i)),a!==r&&(n=(r=a7(r))<0?n.dropRight(-r):n.take(r-i)),n)},iw.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},iw.prototype.toArray=function(){return this.take(0xffffffff)},iK(iw.prototype,function(i,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),o=/^(?:head|last)$/.test(r),s=iy[o?"take"+("last"==r?"Right":""):r],l=o||/^find/.test(r);s&&(iy.prototype[r]=function(){var r=this.__wrapped__,u=o?[1]:arguments,c=r instanceof iw,d=u[0],h=c||az(r),f=function(i){var r=s.apply(iy,t_([i],u));return o&&p?r[0]:r};h&&n&&"function"==typeof d&&1!=d.length&&(c=h=!1);var p=this.__chain__,m=!!this.__actions__.length,g=l&&!p,_=c&&!m;if(!l&&h){r=_?r:new iw(this);var y=i.apply(r,u);return y.__actions__.push({func:ao,args:[f],thisArg:a}),new ib(y,p)}
119return g&&_?i.apply(this,u):(y=this.thru(f),g?o?y.value()[0]:y.value():y)})}),td(["pop","push","shift","sort","splice","unshift"],function(i){var r=ek[i],n=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",a=/^(?:pop|shift)$/.test(i);iy.prototype[i]=function(){var i=arguments;if(a&&!this.__chain__){var o=this.value();return r.apply(az(o)?o:[],i)}return this[n](function(n){return r.apply(az(n)?n:[],i)})}}),iK(iw.prototype,function(i,r){var n=iy[r];if(n){var a=n.name+"";eO.call(il,a)||(il[a]=[]),il[a].push({name:r,func:n})}}),il[r0(a,2).name]=[{name:"wrapper",func:a}],iw.prototype.clone=function(){var i=new iw(this.__wrapped__);return i.__actions__=rG(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=rG(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=rG(this.__views__),i},iw.prototype.reverse=function(){if(this.__filtered__){var i=new iw(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i},iw.prototype.value=function(){var i=this.__wrapped__.value(),r=this.__dir__,n=az(i),a=r<0,o=n?i.length:0,s=function(i,r,n){for(var a=-1,o=n.length;++a<o;){var s=n[a],l=s.size;switch(s.type){case"drop":i+=l;break;case"dropRight":r-=l;break;case"take":r=t9(r,i+l);break;case"takeRight":i=t4(i,r-l)}}return{start:i,end:r}}(0,o,this.__views__),l=s.start,u=s.end,c=u-l,d=a?u:l-1,h=this.__iteratees__,f=h.length,p=0,m=t9(c,this.__takeCount__);if(!n||!a&&o==c&&m==c)return rR(i,this.__actions__);var g=[];e:for(;c--&&p<m;){for(var _=-1,y=i[d+=r];++_<f;){var v=h[_],x=v.iteratee,b=v.type,w=x(y);if(2==b)y=w;else if(!w)if(1==b)continue e;else break e}g[p++]=y}return g},iy.prototype.at=as,iy.prototype.chain=function(){return aa(this)},iy.prototype.commit=function(){return new ib(this.value(),this.__chain__)},iy.prototype.next=function(){this.__values__===a&&(this.__values__=a8(this.value()));var i=this.__index__>=this.__values__.length,r=i?a:this.__values__[this.__index__++];return{done:i,value:r}},iy.prototype.plant=function(i){for(var r,n=this;n instanceof ix;){var o=nV(n);o.__index__=0,o.__values__=a,r?s.__wrapped__=o:r=o;var s=o;n=n.__wrapped__}return s.__wrapped__=i,r},iy.prototype.reverse=function(){var i=this.__wrapped__;if(i instanceof iw){var r=i;return this.__actions__.length&&(r=new iw(this)),(r=r.reverse()).__actions__.push({func:ao,args:[n5],thisArg:a}),new ib(r,this.__chain__)}return this.thru(n5)},iy.prototype.toJSON=iy.prototype.valueOf=iy.prototype.value=function(){return rR(this.__wrapped__,this.__actions__)},iy.prototype.first=iy.prototype.head,e3&&(iy.prototype[e3]=function(){return this}),iy}();if("function"==typeof define&&"object"==typeof define.amd&&define.amd)e8._=tX,i.r,a!==tX&&i.v(tX);else e7?((e7.exports=tX)._=tX,e6._=tX):e8._=tX}).call(i.e)},501668,(i,r,n)=>{r.exports={name:"@yext/analytics",version:"1.1.0",description:"An analytics library for Yext",author:"[email protected]",license:"BSD-3-Clause",main:"./lib/commonjs/src/index.js",module:"./lib/esm/src/index.js",types:"./lib/analytics.d.ts",keywords:["analytics","report","events","yext"],files:["src","lib","THIRD-PARTY-NOTICES"],scripts:{build:"rm -rf lib/** && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && npm run format-check && npm run api-extractor && npm run generate-docs && npm run generate-notices && vite build",prepare:"husky install","format-check":"prettier --check . && eslint .","format-fix":"prettier --write . && eslint . --fix","api-extractor":"api-extractor run --local --verbose","generate-docs":"api-documenter markdown --input-folder temp --output-folder docs && rm -rf temp",prepublishOnly:"npm run build",test:"jest && playwright test",dev:"tsc -p tsconfig.esm.json --watch","generate-notices":"generate-license-file --input package.json --output THIRD-PARTY-NOTICES --overwrite"},devDependencies:{"@babel/preset-env":"^7.23.2","@babel/preset-typescript":"^7.14.5","@microsoft/api-documenter":"^7.15.3","@microsoft/api-extractor":"^7.19.4","@playwright/test":"^1.38.0","@types/jest":"^29.5.12","@types/node":"^20.6.0","@typescript-eslint/eslint-plugin":"^6.19.1","@typescript-eslint/parser":"^6.19.1",eslint:"^7.32.0","fetch-mock-jest":"^1.5.1","generate-license-file":"^1.3.0",husky:"^8.0.3",jest:"^27.0.6","jest-fetch-mock":"^3.0.3",prettier:"^3.0.3",typescript:"^4.1.5",vite:"^4.4.9"},overrides:{"@babel/helper-define-polyfill-provider":"0.4.3","babel-plugin-
119polyfill-corejs2":"0.4.6","babel-plugin-polyfill-corejs3":"0.8.5","babel-plugin-polyfill-regenerator":"0.5.3"},jest:{bail:!1,verbose:!0,collectCoverage:!0,testEnvironment:"jsdom",collectCoverageFrom:["src/**","!src/utils/**"],moduleFileExtensions:["js","ts"],moduleDirectories:["node_modules","<rootDir>"],testMatch:["<rootDir>/tests/**/*.ts"],resetMocks:!0,restoreMocks:!0,clearMocks:!0,passWithNoTests:!0},dependencies:{ulidx:"^2.0.0"}}},257272,(i,r,n)=>{"use strict";var a={}.hasOwnProperty;function o(i){return i&&"object"==typeof i||(i={}),l(i.line)+":"+l(i.column)}function s(i){return i&&"object"==typeof i||(i={}),o(i.start)+"-"+o(i.end)}function l(i){return i&&"number"==typeof i?i:1}r.exports=function(i){return i&&"object"==typeof i?a.call(i,"position")||a.call(i,"type")?s(i.position):a.call(i,"start")||a.call(i,"end")?s(i):a.call(i,"line")||a.call(i,"column")?o(i):"":""}},430216,(i,r,n)=>{"use strict";var a=i.r(257272);function o(){}r.exports=l,o.prototype=Error.prototype,l.prototype=new o;var s=l.prototype;function l(i,r,n){var o,s,l,u,c;"string"==typeof r&&(n=r,r=null),c=[null,null],"string"==typeof(l=n)&&(-1===(u=l.indexOf(":"))?c[1]=l:(c[0]=l.slice(0,u),c[1]=l.slice(u+1))),o=a(r)||"1:1",s={start:{line:null,column:null},end:{line:null,column:null}},r&&r.position&&(r=r.position),r&&(r.start?(s=r,r=r.start):s.start=r),i.stack&&(this.stack=i.stack,i=i.message),this.message=i,this.name=o,this.reason=i,this.line=r?r.line:null,this.column=r?r.column:null,this.location=s,this.source=parts[0],this.ruleId=parts[1]}s.file="",s.name="",s.reason="",s.message="",s.stack="",s.fatal=null,s.column=null,s.line=null},622227,(i,r,n)=>{"use strict";function a(i){if("string"!=typeof i)throw TypeError("Path must be a string. Received "+JSON.stringify(i))}n.basename=function(i,r){var n,o,s,l,u=0,c=-1;if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');if(a(i),n=i.length,void 0===r||!r.length||r.length>i.length){for(;n--;)if(47===i.charCodeAt(n)){if(s){u=n+1;break}}else c<0&&(s=!0,c=n+1);return c<0?"":i.slice(u,c)}if(r===i)return"";for(o=-1,l=r.length-1;n--;)if(47===i.charCodeAt(n)){if(s){u=n+1;break}}else o<0&&(s=!0,o=n+1),l>-1&&(i.charCodeAt(n)===r.charCodeAt(l--)?l<0&&(c=n):(l=-1,c=o));return u===c?c=o:c<0&&(c=i.length),i.slice(u,c)},n.dirname=function(i){var r,n,o;if(a(i),!i.length)return".";for(r=-1,o=i.length;--o;)if(47===i.charCodeAt(o)){if(n){r=o;break}}else n||(n=!0);return r<0?47===i.charCodeAt(0)?"/":".":1===r&&47===i.charCodeAt(0)?"//":i.slice(0,r)},n.extname=function(i){var r,n,o,s=-1,l=0,u=-1,c=0;for(a(i),o=i.length;o--;){if(47===(n=i.charCodeAt(o))){if(r){l=o+1;break}continue}u<0&&(r=!0,u=o+1),46===n?s<0?s=o:1!==c&&(c=1):s>-1&&(c=-1)}return s<0||u<0||0===c||1===c&&s===u-1&&s===l+1?"":i.slice(s,u)},n.join=function(){for(var i,r,n,o,s=-1;++s<arguments.length;)a(arguments[s]),arguments[s]&&(o=void 0===o?arguments[s]:o+"/"+arguments[s]);return void 0===o?".":(a(i=o),r=47===i.charCodeAt(0),(n=function(i,r){for(var n,a,o="",s=0,l=-1,u=0,c=-1;++c<=i.length;){if(c<i.length)n=i.charCodeAt(c);else if(47===n)break;else n=47;if(47===n){if(l===c-1||1===u);else if(l!==c-1&&2===u){if(o.length<2||2!==s||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2)){if(o.length>2){if((a=o.lastIndexOf("/"))!==o.length-1){a<0?(o="",s=0):s=(o=o.slice(0,a)).length-1-o.lastIndexOf("/"),l=c,u=0;continue}}else if(o.length){o="",s=0,l=c,u=0;continue}}r&&(o=o.length?o+"/..":"..",s=2)}else o.length?o+="/"+i.slice(l+1,c):o=i.slice(l+1,c),s=c-l-1;l=c,u=0}else 46===n&&u>-1?u++:u=-1}return o}(i,!r)).length||r||(n="."),n.length&&47===i.charCodeAt(i.length-1)&&(n+="/"),r?"/"+n:n)},n.sep="/"},373801,(i,r,n)=>{"use strict";n.cwd=function(){return"/"}},336643,(i,r,n)=>{r.exports=function(i){return null!=i&&null!=i.constructor&&"function"==typeof i.constructor.isBuffer&&i.constructor.isBuffer(i)}},614339,(i,r,n)=>{"use strict";var a=i.r(622227),o=i.r(373801),s=i.r(336643);r.exports=c;var l={}.hasOwnProperty,u=["history","path","basename","stem","extname","dirname"];function c(i){var r,n;if(i){if("string"==typeof i||s(i))i={contents:i};else if("message"in i&&"messages"in i)return i}else i={};if(!(this instanceof c))return new c(i);for(this.data={},this.messages=[],this.history=[],this.cwd=o.cwd(),n=-1;++n<u.length;)r=u[n],l.call(i,r)&&(this[r]=i[r]);for(r in i)0>u.indexOf(r)&&(this[r]=i[r])}function d(i,r){if(i&&i.indexOf(a.sep)>-1)throw Error("`"+r+"` cannot be a path: did not expect `"+a.sep+"`")}function h(i,r){if(!i)throw Error("`"+r+"` cannot be empty")}function f(i,r){if(!i)throw Error("Setting `"+r+"` requires `path` to be set too")}c.prototype.toString=function(i){return(this.contents||"").toString(i)},Object.defineProperty(c.prototype,"path",{get:function(){return this.history[this.history.length-1]},set:function(i){h(i,"path"),this.path!==i&&this.history.push(i)}}),Object.defineProperty(c.prototype,"dirname",{get:function(){return"string"==typeof this.path?a.dirname(this.path):void 0},set:function(i){f(this.path,"dirname"),this.path=a.join(i||"",this.basename)}}),Object.defineProperty(c.prototype,"basename",{get:function(){return"string"==typeof this.path?a.basename(this.path):void 0},set:function(i){h(i,"basename"),d(i,"basename"),this.path=a.join(this.dirname||"",i)}}),Object.defineProperty(c.prototype,"extname",{get:function(){return"string"==typeof this.path?a.extname(this.path):void 0}
119,set:function(i){if(d(i,"extname"),f(this.path,"extname"),i){if(46!==i.charCodeAt(0))throw Error("`extname` must start with `.`");if(i.indexOf(".",1)>-1)throw Error("`extname` cannot contain multiple dots")}this.path=a.join(this.dirname,this.stem+(i||""))}}),Object.defineProperty(c.prototype,"stem",{get:function(){return"string"==typeof this.path?a.basename(this.path,this.extname):void 0},set:function(i){h(i,"stem"),d(i,"stem"),this.path=a.join(this.dirname||"",i+(this.extname||""))}})},16426,(i,r,n)=>{"use strict";var a=i.r(430216),o=i.r(614339);r.exports=o,o.prototype.message=function(i,r,n){var o=new a(i,r,n);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o},o.prototype.info=function(){var i=this.message.apply(this,arguments);return i.fatal=null,i},o.prototype.fail=function(){var i=this.message.apply(this,arguments);throw i.fatal=!0,i}},761175,(i,r,n)=>{"use strict";r.exports=i.r(16426)},593432,(i,r,n)=>{"use strict";r.exports=function(i){if(i)throw i}},362506,(i,r,n)=>{"use strict";var a=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(i){return"function"==typeof Array.isArray?Array.isArray(i):"[object Array]"===o.call(i)},c=function(i){if(!i||"[object Object]"!==o.call(i))return!1;var r,n=a.call(i,"constructor"),s=i.constructor&&i.constructor.prototype&&a.call(i.constructor.prototype,"isPrototypeOf");if(i.constructor&&!n&&!s)return!1;for(r in i);return void 0===r||a.call(i,r)},d=function(i,r){s&&"__proto__"===r.name?s(i,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):i[r.name]=r.newValue},h=function(i,r){if("__proto__"===r){if(!a.call(i,r))return;else if(l)return l(i,r).value}return i[r]};r.exports=function i(){var r,n,a,o,s,l,f=arguments[0],p=1,m=arguments.length,g=!1;for("boolean"==typeof f&&(g=f,f=arguments[1]||{},p=2),(null==f||"object"!=typeof f&&"function"!=typeof f)&&(f={});p<m;++p)if(r=arguments[p],null!=r)for(n in r)a=h(f,n),f!==(o=h(r,n))&&(g&&o&&(c(o)||(s=u(o)))?(s?(s=!1,l=a&&u(a)?a:[]):l=a&&c(a)?a:{},d(f,{name:n,newValue:i(g,l,o)})):void 0!==o&&d(f,{name:n,newValue:o}));return f}},249605,(i,r,n)=>{"use strict";r.exports=i=>{if("[object Object]"!==Object.prototype.toString.call(i))return!1;let r=Object.getPrototypeOf(i);return null===r||r===Object.prototype}},815050,(i,r,n)=>{"use strict";var a=[].slice;r.exports=function(i,r){var n;return function(){var r,l=a.call(arguments,0),u=i.length>l.length;u&&l.push(o);try{r=i.apply(null,l)}catch(i){if(u&&n)throw i;return o(i)}u||(r&&"function"==typeof r.then?r.then(s,o):r instanceof Error?o(r):s(r))};function o(){n||(n=!0,r.apply(null,arguments))}function s(i){o(null,i)}}},822209,(i,r,n)=>{"use strict";var a=i.r(815050);r.exports=s,s.wrap=a;var o=[].slice;function s(){var i=[],r={};return r.run=function(){var r=-1,n=o.call(arguments,0,-1),s=arguments[arguments.length-1];if("function"!=typeof s)throw Error("Expected function as last argument, not "+s);function l(u){var c=i[++r],d=o.call(arguments,0),h=d.slice(1),f=n.length,p=-1;if(u)return void s(u);for(;++p<f;)(null===h[p]||void 0===h[p])&&(h[p]=n[p]);n=h,c?a(c,l).apply(null,n):s.apply(null,[null].concat(n))}l.apply(null,[null].concat(n))},r.use=function(n){if("function"!=typeof n)throw Error("Expected `fn` to be a function, not "+n);return i.push(n),r},r}},822357,(i,r,n)=>{"use strict";var a=i.r(593432),o=i.r(336643),s=i.r(362506),l=i.r(249605),u=i.r(822209),c=i.r(761175);r.exports=(function i(){var r,n=[],o=u(),x={},b=-1;return w.data=function(i,n){return"string"==typeof i?2==arguments.length?(_("data",r),x[i]=n,w):h.call(x,i)&&x[i]||null:i?(_("data",r),x=i,w):x},w.freeze=T,w.attachers=n,w.use=function(i){var a;if(_("use",r),null==i);else if("function"==typeof i)c.apply(null,arguments);else if("object"==typeof i)"length"in i?u(i):o(i);else throw Error("Expected usable value, not `"+i+"`");return a&&(x.settings=s(x.settings||{},a)),w;function o(i){u(i.plugins),i.settings&&(a=s(a||{},i.settings))}function u(i){var r=-1;if(null==i);else if("object"==typeof i&&"length"in i)for(;++r<i.length;){var n=i[r];if("function"==typeof n)c(n);else if("object"==typeof n)"length"in n?c.apply(null,n):o(n);else throw Error("Expected usable value, not `"+n+"`")}else throw Error("Expected a list of plugins, not `"+i+"`")}function c(i,r){var a=function(i){for(var r=-1;++r<n.length;)if(n[r][0]===i)return n[r]}(i);a?(l(a[1])&&l(r)&&(r=s(!0,a[1],r)),a[1]=r):n.push(d.call(arguments))}},w.parse=function(i){var r,n=c(i);return(T(),m("parse",r=w.Parser),p(r,"parse"))?new r(String(n),n).parse():r(String(n),n)},w.stringify=function(i,r){var n,a=c(r);return(T(),g("stringify",n=w.Compiler),y(i),p(n,"compile"))?new n(i,a).c
119ompile():n(i,a)},w.run=E,w.runSync=function(i,r){var n,o;return E(i,r,function(i,r){o=!0,n=r,a(i)}),v("runSync","run",o),n},w.process=S,w.processSync=function(i){var r,n;return T(),m("processSync",w.Parser),g("processSync",w.Compiler),S(r=c(i),function(i){n=!0,a(i)}),v("processSync","process",n),r},w;function w(){for(var r=i(),a=-1;++a<n.length;)r.use.apply(null,n[a]);return r.data(s(!0,{},x)),r}function T(){var i,a;if(r)return w;for(;++b<n.length;)!1!==(i=n[b])[1]&&(!0===i[1]&&(i[1]=void 0),"function"==typeof(a=i[0].apply(w,i.slice(1)))&&o.use(a));return r=!0,b=1/0,w}function E(i,r,n){if(y(i),T(),n||"function"!=typeof r||(n=r,r=null),!n)return new Promise(a);function a(a,s){o.run(i,c(r),function(r,o,l){o=o||i,r?s(r):a?a(o):n(null,o,l)})}a(null,n)}function S(i,r){if(T(),m("process",w.Parser),g("process",w.Compiler),!r)return new Promise(n);function n(n,a){var o=c(i);f.run(w,{file:o},function(i){i?a(i):n?n(o):r(null,o)})}n(null,r)}})().freeze();var d=[].slice,h={}.hasOwnProperty,f=u().use(function(i,r){r.tree=i.parse(r.file)}).use(function(i,r,n){i.run(r.tree,r.file,function(i,a,o){i?n(i):(r.tree=a,r.file=o,n())})}).use(function(i,r){var n=i.stringify(r.tree,r.file);null==n||("string"==typeof n||o(n)?("value"in r.file&&(r.file.value=n),r.file.contents=n):r.file.result=n)});function p(i,r){return"function"==typeof i&&i.prototype&&(function(i){var r;for(r in i)return!0;return!1}(i.prototype)||r in i.prototype)}function m(i,r){if("function"!=typeof r)throw Error("Cannot `"+i+"` without `Parser`")}function g(i,r){if("function"!=typeof r)throw Error("Cannot `"+i+"` without `Compiler`")}function _(i,r){if(r)throw Error("Cannot invoke `"+i+"` on a frozen processor.\nCreate a new processor first, by invoking it: use `processor()` instead of `processor`.")}function y(i){if(!i||"string"!=typeof i.type)throw Error("Expected node, got `"+i+"`")}function v(i,r,n){if(!n)throw Error("`"+i+"` finished async. Use `"+r+"` instead")}},419140,(i,r,n)=>{"use strict";function a(i){return i&&(i.value||i.alt||i.title||"children"in i&&o(i.children)||"length"in i&&o(i))||""}function o(i){for(var r=[],n=-1;++n<i.length;)r[n]=a(i[n]);return r.join("")}r.exports=a},545490,(i,r,n)=>{"use strict";r.exports=Object.assign},910601,(i,r,n)=>{"use strict";r.exports=({}).hasOwnProperty},718150,(i,r,n)=>{"use strict";r.exports=function(i){return i.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}},953358,(i,r,n)=>{"use strict";r.exports=String.fromCharCode},472568,(i,r,n)=>{"use strict";var a=i.r(953358);r.exports=function(i,r){var n=parseInt(i,r);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":a(n)}},669275,(i,r,n)=>{"use strict";r.exports=function(i){return i<-2}},419953,(i,r,n)=>{"use strict";r.exports=function(i){return -2===i||-1===i||32===i}},70881,(i,r,n)=>{"use strict";var a=i.r(419953);r.exports=function(i,r,n,o){var s=o?o-1:1/0,l=0;return function(o){return a(o)?(i.enter(n),function o(u){return a(u)&&l++<s?(i.consume(u),o):(i.exit(n),r(u))}(o)):r(o)}}},397981,(i,r,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=i.r(669275),o=i.r(70881);n.tokenize=function(i){var r,n=i.attempt(this.parser.constructs.contentInitial,function(r){return null===r?void i.consume(r):(i.enter("lineEnding"),i.consume(r),i.exit("lineEnding"),o(i,n,"linePrefix"))},function(n){return i.enter("paragraph"),function n(o){var s=i.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=s),r=s,function r(o){if(null===o){i.exit("chunkText"),i.exit("paragraph"),i.consume(o);return}return a(o)?(i.consume(o),i.exit("chunkText"),n):(i.consume(o),r)}(o)}(n)});return n}},90225,(i,r,n)=>{"use strict";var a=i.r(669275),o=i.r(70881);r.exports={tokenize:function(i,r,n){return o(i,function(i){return null===i||a(i)?r(i):n(i)},"linePrefix")},partial:!0}},406502,(i,r,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=i.r(669275),o=i.r(70881),s=i.r(90225),l={tokenize:function(i,r,n){return o(i,i.attempt(this.parser.constructs.document,r,n),"linePrefix",this.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}},u={tokenize:function(i,r,n){return o(i,i.lazy(this.parser.constructs.flow,r,n),"linePrefix",this.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}};n.tokenize=function(i){var r,n,o,c=this,d=[],h=0,f={tokenize:function(i,a){var o=0;return r={},h;function h(a){return o<d.length?(c.containerState=d[o][1],i.attempt(d[o][0].c
119ontinuation,f,p)(a)):n.currentConstruct&&n.currentConstruct.concrete?(r.flowContinue=!0,_(a)):(c.interrupt=n.currentConstruct&&n.currentConstruct.interruptible,c.containerState={},i.attempt(l,g,_)(a))}function f(i){return o++,c.containerState._closeFlow?g(i):h(i)}function p(r){return n.currentConstruct&&n.currentConstruct.lazy?(c.containerState={},i.attempt(l,g,i.attempt(u,g,i.check(s,g,m)))(r)):g(r)}function m(i){return o=d.length,r.lazy=!0,r.flowContinue=!0,_(i)}function g(i){return r.flowEnd=!0,_(i)}function _(i){return r.continued=o,c.interrupt=c.containerState=void 0,a(i)}},partial:!0};return p;function p(r){return h<d.length?(c.containerState=d[h][1],i.attempt(d[h][0].continuation,m,g)(r)):g(r)}function m(i){return h++,p(i)}function g(a){return r&&r.flowContinue?y(a):(c.interrupt=n&&n.currentConstruct&&n.currentConstruct.interruptible,c.containerState={},i.attempt(l,_,y)(a))}function _(i){return d.push([c.currentConstruct,c.containerState]),c.containerState=void 0,g(i)}function y(r){if(null===r){b(0,!0),i.consume(r);return}return n=n||c.parser.flow(c.now()),i.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:n}),function r(n){return null===n?(x(i.exit("chunkFlow")),y(n)):a(n)?(i.consume(n),x(i.exit("chunkFlow")),i.check(f,v)):(i.consume(n),r)}(r)}function v(i){return b(r.continued,r&&r.flowEnd),h=0,p(i)}function x(i){o&&(o.next=i),o=i,n.lazy=r&&r.lazy,n.defineSkip(i.start),n.write(c.sliceStream(i))}function b(r,a){var s=d.length;for(n&&a&&(n.write([null]),o=n=void 0);s-- >r;)c.containerState=d[s][1],d[s][0].exit.call(c,i);d.length=r}}},254275,(i,r,n)=>{"use strict";r.exports=function(i){for(var r=-1,n=0;++r<i.length;)n+="string"==typeof i[r]?i[r].length:1;return n}},999570,(i,r,n)=>{"use strict";var a=i.r(254275);r.exports=function(i,r){var n=i[i.length-1];return n&&n[1].type===r?a(n[2].sliceStream(n[1])):0}},924561,(i,r,n)=>{"use strict";r.exports=[].splice},793315,(i,r,n)=>{"use strict";var a=i.r(924561);r.exports=function(i,r,n,o){var s,l=i.length,u=0;if(r=r<0?-r>l?0:l+r:r>l?l:r,n=n>0?n:0,o.length<1e4)(s=Array.from(o)).unshift(r,n),a.apply(i,s);else for(n&&a.apply(i,[r,n]);u<o.length;)(s=o.slice(u,u+1e4)).unshift(r,0),a.apply(i,s),u+=1e4,r+=1e4}},733902,(i,r,n)=>{"use strict";var a=i.r(545490);r.exports=function(i){return a({},i)}},77762,(i,r,n)=>{"use strict";var a=i.r(545490),o=i.r(793315),s=i.r(733902);r.exports=function(i){for(var r,n,l,u,c,d,h,f={},p=-1;++p<i.length;){for(;p in f;)p=f[p];if(r=i[p],p&&"chunkFlow"===r[1].type&&"listItemPrefix"===i[p-1][1].type&&((l=0)<(d=r[1]._tokenizer.events).length&&"lineEndingBlank"===d[l][1].type&&(l+=2),l<d.length&&"content"===d[l][1].type))for(;++l<d.length&&"content"!==d[l][1].type;)"chunkText"===d[l][1].type&&(d[l][1].isInFirstContentOfListItem=!0,l++);if("enter"===r[0])r[1].contentType&&(a(f,function(i,r){for(var n,a,s,l,u,c,d=i[r][1],h=i[r][2],f=r-1,p=[],m=d._tokenizer||h.parser[d.contentType](d.start),g=m.events,_=[],y={};d;){for(;i[++f][1]!==d;);p.push(f),!d._tokenizer&&(n=h.sliceStream(d),d.next||n.push(null),a&&m.defineSkip(d.start),d.isInFirstContentOfListItem&&(m._gfmTasklistFirstContentOfListItem=!0),m.write(n),d.isInFirstContentOfListItem&&(m._gfmTasklistFirstContentOfListItem=void 0)),a=d,d=d.next}for(d=a,s=g.length;s--;)"enter"===g[s][0]?l=!0:l&&g[s][1].type===g[s-1][1].type&&g[s][1].start.line!==g[s][1].end.line&&(v(g.slice(s+1,u)),d._tokenizer=d.next=void 0,d=d.previous,u=s+1);for(m.events=d._tokenizer=d.next=void 0,v(g.slice(0,u)),s=-1,c=0;++s<_.length;)y[c+_[s][0]]=c+_[s][1],c+=_[s][1]-_[s][0]-1;return y;function v(r){var n=p.pop();_.unshift([n,n+r.length-1]),o(i,n,2,r)}}(i,p)),p=f[p],h=!0);else if(r[1]._container||r[1]._movePreviousLineEndings){for(l=p,n=void 0;l--;)if("lineEnding"===(u=i[l])[1].type||"lineEndingBlank"===u[1].type)"enter"===u[0]&&(n&&(i[n][1].type="lineEndingBlank"),u[1].type="lineEnding",n=l);else break;n&&(r[1].end=s(i[n][1].start),(c=i.slice(n,p)).unshift(r),o(i,n,p-n+1,c))}}return!h}},403632,(i,r,n)=>{"use strict";var a=i.r(669275),o=i.r(999570),s=i.r(77762),l=i.r(70881),u={tokenize:function(i,r,n){var s=this;return function(r){return i.enter("lineEnding"),i.consume(r),i.exit("lineEnding"),l(i,u,"linePrefix")};function u(l){return null===l||a(l)?n(l):s.parser.constructs.disable.null.indexOf("codeIndented")>-1||4>o(s.events,"linePrefix")?i.interrupt(s.parser.constructs.flow,n,r)(l):r(l)}},partial:!0};
119r.exports={tokenize:function(i,r){var n;return function(r){return i.enter("content"),n=i.enter("chunkContent",{contentType:"content"}),o(r)};function o(r){return null===r?s(r):a(r)?i.check(u,l,s)(r):(i.consume(r),o)}function s(n){return i.exit("chunkContent"),i.exit("content"),r(n)}function l(r){return i.consume(r),i.exit("chunkContent"),n=n.next=i.enter("chunkContent",{contentType:"content",previous:n}),o}},resolve:function(i){return s(i),i},interruptible:!0,lazy:!0}},286591,(i,r,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=i.r(403632),o=i.r(70881),s=i.r(90225);n.tokenize=function(i){var r=this,n=i.attempt(s,function(a){return null===a?void i.consume(a):(i.enter("lineEndingBlank"),i.consume(a),i.exit("lineEndingBlank"),r.currentConstruct=void 0,n)},i.attempt(this.parser.constructs.flowInitial,l,o(i,i.attempt(this.parser.constructs.flow,l,i.attempt(a,l)),"linePrefix")));return n;function l(a){return null===a?void i.consume(a):(i.enter("lineEnding"),i.consume(a),i.exit("lineEnding"),r.currentConstruct=void 0,n)}}},125445,(i,r,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=i.r(545490),o=i.r(733902),s=u("text"),l=u("string");function u(i){return{tokenize:function(r){var n=this,a=this.parser.constructs[i],o=r.attempt(a,s,l);return s;function s(i){return c(i)?o(i):l(i)}function l(i){return null===i?void r.consume(i):(r.enter("data"),r.consume(i),u)}function u(i){return c(i)?(r.exit("data"),o(i)):(r.consume(i),u)}function c(i){var r=a[i],o=-1;if(null===i)return!0;if(r){for(;++o<r.length;)if(!r[o].previous||r[o].previous.call(n,n.previous))return!0}}},resolveAll:c("text"===i?d:void 0)}}function c(i){return function(r,n){for(var a,o=-1;++o<=r.length;)void 0===a?r[o]&&"data"===r[o][1].type&&(a=o,o++):r[o]&&"data"===r[o][1].type||(o!==a+2&&(r[a][1].end=r[o-1][1].end,r.splice(a+2,o-a-2),o=a+2),a=void 0);return i?i(r,n):r}}function d(i,r){for(var n,s,l,u,c,d,h,f,p=-1;++p<=i.length;)if((p===i.length||"lineEnding"===i[p][1].type)&&"data"===i[p-1][1].type){for(s=i[p-1][1],u=(n=r.sliceStream(s)).length,c=-1,d=0,h=void 0;u--;)if("string"==typeof(l=n[u])){for(c=l.length;32===l.charCodeAt(c-1);)d++,c--;if(c)break;c=-1}else if(-2===l)h=!0,d++;else if(-1===l);else{u++;break}d&&(f={type:p===i.length||h||d<2?"lineSuffix":"hardBreakTrailing",start:{line:s.end.line,column:s.end.column-d,offset:s.end.offset-d,_index:s.start._index+u,_bufferIndex:u?c:s.start._bufferIndex+c},end:o(s.end)},s.end=o(f.start),s.start.offset===s.end.offset?a(s,f):(i.splice(p,0,["enter",f,r],["exit",f,r]),p+=2)),p++}return i}n.resolver={resolveAll:c()},n.string=l,n.text=s},386789,(i,r,n)=>{"use strict";r.exports=function(i){return null==i?[]:"length"in i?i:[i]}},90187,(i,r,n)=>{"use strict";var a=i.r(910601),o=i.r(793315),s=i.r(386789);r.exports=function(i){for(var r={},n=-1;++n<i.length;)!function(i,r){var n,l,u,c;for(n in r)for(c in l=a.call(i,n)?i[n]:i[n]={},u=r[n])l[c]=function(i,r){for(var n=-1,a=[];++n<i.length;)("after"===i[n].add?r:a).push(i[n]);return o(r,0,0,a),r}(s(u[c]),a.call(l,c)?l[c]:[])}(r,i[n]);return r}},52813,(i,r,n)=>{"use strict";var a=i.r(793315);r.exports=function(i,r){return i.length?(a(i,i.length,0,r),i):r}},299388,(i,r,n)=>{"use strict";r.exports=function(i,r,n){for(var a,o=[],s=-1;++s<i.length;)(a=i[s].resolveAll)&&0>o.indexOf(a)&&(r=a(r,n),o.push(a));return r}},799189,(i,r,n)=>{"use strict";var a=i.r(953358);r.exports=function(i){for(var r,n,o,s=-1,l=[];++s<i.length;){if("string"==typeof(r=i[s]))n=r;else if(-5===r)n="\r";else if(-4===r)n="\n";else if(-3===r)n="\r\n";else if(-2===r)n="	";else if(-1===r){if(o)continue;n=" "}else n=a(r);o=-2===r,l.push(n)}return l.join("")}},32709,(i,r,n)=>{"use strict";r.exports=function(i,r){var n,a=r.start._index,o=r.start._bufferIndex,s=r.end._index,l=r.end._bufferIndex;return a===s?n=[i[a].slice(o,l)]:(n=i.slice(a,s),o>-1&&(n[0]=n[0].slice(o)),l>0&&n.push(i[s].slice(0,l))),n}},658060,(i,r,n)=>{"use strict";var a=i.r(545490),o=i.r(669275),s=i.r(52813),l=i.r(793315),u=i.r(386789),c=i.r(299388),d=i.r(799189),h=i.r(733902),f=i.r(32709);r.exports=function(i,r,n){var p=n?h(n):{line:1,column:1,offset:0},m={},g=[],_=[],y=[],v={consume:function(i){o(i)?(p.line++,p.column=1,p.offset+=-3===i?2:1,C()):-1!==i&&(p.column++,p.offset++),p._bufferIndex<0?p._index++:(p._bufferIndex++,p._bufferIndex===_[p._index].length&&(p._bufferIndex=-1,p._index++)),x.previous=i},enter:function(i,r){var n=r||{};return n.type=i,n.start=T(),x.events.push(["enter",n,x]),y.push(n),n},exit:function(i){var r=y.pop();return r.end=T(),x.events.push(["exit",r,x]),r},attempt:S(function(i,r){A(i,r.from)}),check:S(E),interrupt:S(E,{interrupt:!0}),lazy:S(E,{lazy:!0})},x={previous:null,events:[],parser:i,sliceStream:w,sliceSerialize:function(i){return d(w(i))}
119,now:T,defineSkip:function(i){m[i.line]=i.column,C()},write:function(i){return(_=s(_,i),function(){for(var i,r,n;p._index<_.length;)if("string"==typeof(r=_[p._index]))for(i=p._index,p._bufferIndex<0&&(p._bufferIndex=0);p._index===i&&p._bufferIndex<r.length;){n=r.charCodeAt(p._bufferIndex),b=b(n)}else b=b(r)}(),null!==_[_.length-1])?[]:(A(r,0),x.events=c(g,x.events,x),x.events)}},b=r.tokenize.call(x,v);return r.resolveAll&&g.push(r),p._index=0,p._bufferIndex=-1,x;function w(i){return f(_,i)}function T(){return h(p)}function E(i,r){r.restore()}function S(i,r){return function(n,o,s){var l,c,d,h;return n.tokenize||"length"in n?f(u(n)):function(i){return i in n||null in n?f(n.null?u(n[i]).concat(u(n.null)):n[i])(i):s(i)};function f(i){return l=i,m(i[c=0])}function m(i){return function(n){var o,s,l,u,c;return(o=T(),s=x.previous,l=x.currentConstruct,u=x.events.length,c=Array.from(y),h={restore:function(){p=o,x.previous=s,x.currentConstruct=l,x.events.length=u,y=c,C()},from:u},d=i,i.partial||(x.currentConstruct=i),i.name&&x.parser.constructs.disable.null.indexOf(i.name)>-1)?_():i.tokenize.call(r?a({},x,r):x,v,g,_)(n)}}function g(r){return i(d,h),o}function _(i){return(h.restore(),++c<l.length)?m(l[c]):s}}}function A(i,r){i.resolveAll&&0>g.indexOf(i)&&g.push(i),i.resolve&&l(x.events,r,x.events.length-r,i.resolve(x.events.slice(r),x)),i.resolveTo&&(x.events=i.resolveTo(x.events,x))}function C(){p.line in m&&p.column<2&&(p.column=m[p.line],p.offset+=m[p.line]-1)}}},172605,(i,r,n)=>{"use strict";r.exports=function(i){return i<0||32===i}},816958,(i,r,n)=>{"use strict";r.exports=/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/},580340,(i,r,n)=>{"use strict";var a=i.r(953358);r.exports=function(i){return function(r){return i.test(a(r))}}},240196,(i,r,n)=>{"use strict";var a=i.r(816958);r.exports=i.r(580340)(a)},214856,(i,r,n)=>{"use strict";r.exports=i.r(580340)(/\s/)},886854,(i,r,n)=>{"use strict";var a=i.r(172605),o=i.r(240196),s=i.r(214856);r.exports=function(i){return null===i||a(i)||s(i)?1:o(i)?2:void 0}},616796,(i,r,n)=>{"use strict";r.exports=function(i,r){return i.column+=r,i.offset+=r,i._bufferIndex+=r,i}},784173,(i,r,n)=>{"use strict";var a=i.r(52813),o=i.r(793315),s=i.r(886854),l=i.r(616796),u=i.r(299388),c=i.r(733902);r.exports={name:"attention",tokenize:function(i,r){var n,a=s(this.previous);return function(o){return i.enter("attentionSequence"),n=o,function o(l){var u,c,d,h;return l===n?(i.consume(l),o):(u=i.exit("attentionSequence"),d=!(c=s(l))||2===c&&a,h=!a||2===a&&c,u._open=42===n?d:d&&(a||!h),u._close=42===n?h:h&&(c||!d),r(l))}(o)}},resolveAll:function(i,r){for(var n,s,d,h,f,p,m,g,_=-1;++_<i.length;)if("enter"===i[_][0]&&"attentionSequence"===i[_][1].type&&i[_][1]._close){for(n=_;n--;)if("exit"===i[n][0]&&"attentionSequence"===i[n][1].type&&i[n][1]._open&&r.sliceSerialize(i[n][1]).charCodeAt(0)===r.sliceSerialize(i[_][1]).charCo
119deAt(0)){if((i[n][1]._close||i[_][1]._open)&&(i[_][1].end.offset-i[_][1].start.offset)%3&&!((i[n][1].end.offset-i[n][1].start.offset+i[_][1].end.offset-i[_][1].start.offset)%3))continue;h={type:(p=i[n][1].end.offset-i[n][1].start.offset>1&&i[_][1].end.offset-i[_][1].start.offset>1?2:1)>1?"strongSequence":"emphasisSequence",start:l(c(i[n][1].end),-p),end:c(i[n][1].end)},f={type:p>1?"strongSequence":"emphasisSequence",start:c(i[_][1].start),end:l(c(i[_][1].start),p)},d={type:p>1?"strongText":"emphasisText",start:c(i[n][1].end),end:c(i[_][1].start)},s={type:p>1?"strong":"emphasis",start:c(h.start),end:c(f.end)},i[n][1].end=c(h.start),i[_][1].start=c(f.end),m=[],i[n][1].end.offset-i[n][1].start.offset&&(m=a(m,[["enter",i[n][1],r],["exit",i[n][1],r]])),m=a(m,[["enter",s,r],["enter",h,r],["exit",h,r],["enter",d,r]]),m=a(m,u(r.parser.constructs.insideSpan.null,i.slice(n+1,_),r)),m=a(m,[["exit",d,r],["enter",f,r],["exit",f,r],["exit",s,r]]),i[_][1].end.offset-i[_][1].start.offset?(g=2,m=a(m,[["enter",i[_][1],r],["exit",i[_][1],r]])):g=0,o(i,n-1,_-n+3,m),_=n+m.length-g-2;break}}for(_=-1;++_<i.length;)"attentionSequence"===i[_][1].type&&(i[_][1].type="data");return i}}},327944,(i,r,n)=>{"use strict";r.exports=i.r(580340)(/[A-Za-z]/)},956009,(i,r,n)=>{"use strict";r.exports=i.r(580340)(/[\dA-Za-z]/)},217642,(i,r,n)=>{"use strict";r.exports=i.r(580340)(/[#-'*+\--9=?A-Z^-~]/)},436218,(i,r,n)=>{"use strict";r.exports=function(i){return i<32||127===i}},516075,(i,r,n)=>{"use strict";var a=i.r(327944),o=i.r(956009),s=i.r(217642),l=i.r(436218);r.exports={name:"autolink",tokenize:function(i,r,n){var u=1;return function(r){return i.enter("autolink"),i.enter("autolinkMarker"),i.consume(r),i.exit("autolinkMarker"),i.enter("autolinkProtocol"),c};function c(r){return a(r)?(i.consume(r),d):s(r)?f(r):n(r)}function d(r){return 43===r||45===r||46===r||o(r)?function r(n){return 58===n?(i.consume(n),h):(43===n||45===n||46===n||o(n))&&u++<32?(i.consume(n),r):f(n)}(r):f(r)}function h(r){return 62===r?(i.exit("autolinkProtocol"),m(r)):32===r||60===r||l(r)?n(r):(i.consume(r),h)}function f(r){return 64===r?(i.consume(r),u=0,p):s(r)?(i.consume(r),f):n(r)}function p(r){return o(r)?function r(a){return 46===a?(i.consume(a),u=0,p):62===a?(i.exit("autolinkProtocol").type="autolinkEmail",m(a)):function a(s){return(45===s||o(s))&&u++<63?(i.consume(s),45===s?a:r):n(s)}(a)}(r):n(r)}function m(n){return i.enter("autolinkMarker"),i.consume(n),i.exit("autolinkMarker"),i.exit("autolink"),r}}}},811326,(i,r,n)=>{"use strict";var a=i.r(419953),o=i.r(70881),s={name:"blockQuote",tokenize:function(i,r,n){var o=this;return function(r){return 62===r?(o.containerState.open||(i.enter("blockQuote",{_container:!0}),o.containerState.open=!0),i.enter("blockQuotePrefix"),i.enter("blockQuoteMarker"),i.consume(r),i.exit("blockQuoteMarker"),s):n(r)};function s(n){return a(n)?(i.enter("blockQuotePrefixWhitespace"),i.consume(n),i.exit("blockQuotePrefixWhitespace"),i.exit("blockQuotePrefix"),r):(i.exit("blockQuotePrefix"),r(n))}},continuation:{tokenize:function(i,r,n){return o(i,i.attempt(s,r,n),"linePrefix",this.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}},exit:function(i){i.exit("blockQuote")}};r.exports=s},797794,(i,r,n)=>{"use strict";r.exports=i.r(580340)(/[!-/:-@[-`{-~]/)},749953,(i,r,n)=>{"use strict";var a=i.r(797794);r.exports={name:"characterEscape",tokenize:function(i,r,n){return function(r){return i.enter("characterEscape"),i.enter("escapeMarker"),i.consume(r),i.exit("escapeMarker"),o};function o(o){return a(o)?(i.enter("characterEscapeValue"),i.consume(o),i.exit("characterEscapeValue"),i.exit("characterEscape"),r):n(o)}}}},50364,(i,r,n)=>{"use strict";var a;r.exports=function(i){var r,n="&"+i+";";return(a=a||document.createElement("i")).innerHTML=n,(59!==(r=a.textContent).charCodeAt(r.length-1)||"semi"===i)&&r!==n&&r}},319253,(i,r,n)=>{"use strict";r.exports=i.r(580340)(/\d/)},414257,(i,r,n)=>{"use strict";r.exports=i.r(580340)(/[\dA-Fa-f]/)},95036,(i,r,n)=>{"use strict";var a=i.r(50364),o=i.r(956009),s=i.r(319253),l=i.r(414257),u=a&&"object"==typeof a&&"default"in a?a:{default:a};r.exports={name:"characterReference",tokenize:function(i,r,n){var a,c,d=this,h=0;return function(r){return i.enter("characterReference"),i.enter("characterReferenceMarker"),i.consume(r),i.exit("characterReferenceMarker"),f};function f(r){return 35===r?(i.enter("characterReferenceMarkerNumeric"),i.consume(r),i.exit("characterReferenceMarkerNumeric"),p):(i.enter("characterReferenceValue"),a=31,c=o,m(r))}function p(r){return 88===r||120===r?(i.enter("characterReferenceMarkerHexadecimal"),i.consume(r),i.exit("characterReferenceMarkerHexadecimal"),i.enter("characterReferenceValue"),a=6,c=l,m):(i.enter("characterReferenceValue"),a=7,c=s,m(r))}function m(s){var l;return 59===s&&h?(l=i.exit("characterReferenceValue"),c!==o||u.default(d.sliceSerialize(l)))?(i.enter("characterReferenceMarker"),i.consume(s),i.exit("characterReferenceMarker"),i.exit("characterReference"),r):n(s):c(s)&&h++<a?(i.consume(s),m):n(s)}}}},163642,(i,r,n)=>{"use strict";
119var a=i.r(669275),o=i.r(172605),s=i.r(999570),l=i.r(70881);r.exports={name:"codeFenced",tokenize:function(i,r,n){var u,c=this,d={tokenize:function(i,r,n){var o=0;return l(i,function(r){return i.enter("codeFencedFence"),i.enter("codeFencedFenceSequence"),function r(a){return a===u?(i.consume(a),o++,r):o<f?n(a):(i.exit("codeFencedFenceSequence"),l(i,s,"whitespace")(a))}(r)},"linePrefix",this.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4);function s(o){return null===o||a(o)?(i.exit("codeFencedFence"),r(o)):n(o)}},partial:!0},h=s(this.events,"linePrefix"),f=0;return function(r){return i.enter("codeFenced"),i.enter("codeFencedFence"),i.enter("codeFencedFenceSequence"),u=r,function r(a){return a===u?(i.consume(a),f++,r):(i.exit("codeFencedFenceSequence"),f<3?n(a):l(i,p,"whitespace")(a))}(r)};function p(r){return null===r||a(r)?g(r):(i.enter("codeFencedFenceInfo"),i.enter("chunkString",{contentType:"string"}),function r(a){return null===a||o(a)?(i.exit("chunkString"),i.exit("codeFencedFenceInfo"),l(i,m,"whitespace")(a)):96===a&&a===u?n(a):(i.consume(a),r)}(r))}function m(r){return null===r||a(r)?g(r):(i.enter("codeFencedFenceMeta"),i.enter("chunkString",{contentType:"string"}),function r(o){return null===o||a(o)?(i.exit("chunkString"),i.exit("codeFencedFenceMeta"),g(o)):96===o&&o===u?n(o):(i.consume(o),r)}(r))}function g(n){return i.exit("codeFencedFence"),c.interrupt?r(n):function r(n){return null===n?_(n):a(n)?(i.enter("lineEnding"),i.consume(n),i.exit("lineEnding"),i.attempt(d,_,h?l(i,r,"linePrefix",h+1):r)):(i.enter("codeFlowValue"),function n(o){return null===o||a(o)?(i.exit("codeFlowValue"),r(o)):(i.consume(o),n)}(n))}(n)}function _(n){return i.exit("codeFenced"),r(n)}},concrete:!0}},181051,(i,r,n)=>{"use strict";var a=i.r(669275),o=i.r(793315),s=i.r(999570),l=i.r(70881),u={tokenize:function(i,r,n){var o=this;return l(i,function u(c){return a(c)?(i.enter("lineEnding"),i.consume(c),i.exit("lineEnding"),l(i,u,"linePrefix",5)):4>s(o.events,"linePrefix")?n(c):r(c)},"linePrefix",5)},partial:!0};r.exports={name:"codeIndented",tokenize:function(i,r,n){return i.attempt(u,function n(o){return null===o?r(o):a(o)?i.attempt(u,n,r)(o):(i.enter("codeFlowValue"),function r(o){return null===o||a(o)?(i.exit("codeFlowValue"),n(o)):(i.consume(o),r)}(o))},n)},resolve:function(i,r){var n={type:"codeIndented",start:i[0][1].start,end:i[i.length-1][1].end};return o(i,0,0,[["enter",n,r]]),o(i,i.length,0,[["exit",n,r]]),i}}},281771,(i,r,n)=>{"use strict";var a=i.r(669275);
119r.exports={name:"codeText",tokenize:function(i,r,n){var o,s,l=0;return function(r){return i.enter("codeText"),i.enter("codeTextSequence"),function r(n){return 96===n?(i.consume(n),l++,r):(i.exit("codeTextSequence"),u(n))}(r)};function u(d){return null===d?n(d):96===d?(s=i.enter("codeTextSequence"),o=0,function n(a){return 96===a?(i.consume(a),o++,n):o===l?(i.exit("codeTextSequence"),i.exit("codeText"),r(a)):(s.type="codeTextData",c(a))}(d)):32===d?(i.enter("space"),i.consume(d),i.exit("space"),u):a(d)?(i.enter("lineEnding"),i.consume(d),i.exit("lineEnding"),u):(i.enter("codeTextData"),c(d))}function c(r){return null===r||32===r||96===r||a(r)?(i.exit("codeTextData"),u(r)):(i.consume(r),c)}},resolve:function(i){var r,n,a=i.length-4,o=3;if(("lineEnding"===i[3][1].type||"space"===i[o][1].type)&&("lineEnding"===i[a][1].type||"space"===i[a][1].type)){for(r=o;++r<a;)if("codeTextData"===i[r][1].type){i[a][1].type=i[o][1].type="codeTextPadding",o+=2,a-=2;break}}for(r=o-1,a++;++r<=a;)void 0===n?r!==a&&"lineEnding"!==i[r][1].type&&(n=r):(r===a||"lineEnding"===i[r][1].type)&&(i[n][1].type="codeTextData",r!==n+2&&(i[n][1].end=i[r-1][1].end,i.splice(n+2,r-n-2),a-=r-n-2,r=n+2),n=void 0);return i},previous:function(i){return 96!==i||"characterEscape"===this.events[this.events.length-1][1].type}}},649722,(i,r,n)=>{"use strict";var a=i.r(436218),o=i.r(172605),s=i.r(669275);
119r.exports=function(i,r,n,l,u,c,d,h,f){var p=f||1/0,m=0;return function(r){return 60===r?(i.enter(l),i.enter(u),i.enter(c),i.consume(r),i.exit(c),g):a(r)||41===r?n(r):(i.enter(l),i.enter(d),i.enter(h),i.enter("chunkString",{contentType:"string"}),v(r))};function g(n){return 62===n?(i.enter(c),i.consume(n),i.exit(c),i.exit(u),i.exit(l),r):(i.enter(h),i.enter("chunkString",{contentType:"string"}),_(n))}function _(r){return 62===r?(i.exit("chunkString"),i.exit(h),g(r)):null===r||60===r||s(r)?n(r):(i.consume(r),92===r?y:_)}function y(r){return 60===r||62===r||92===r?(i.consume(r),_):_(r)}function v(s){return 40===s?++m>p?n(s):(i.consume(s),v):41===s?m--?(i.consume(s),v):(i.exit("chunkString"),i.exit(h),i.exit(d),i.exit(l),r(s)):null===s||o(s)?m?n(s):(i.exit("chunkString"),i.exit(h),i.exit(d),i.exit(l),r(s)):a(s)?n(s):(i.consume(s),92===s?x:v)}function x(r){return 40===r||41===r||92===r?(i.consume(r),v):v(r)}}},133716,(i,r,n)=>{"use strict";var a=i.r(669275),o=i.r(419953);r.exports=function(i,r,n,s,l,u){var c,d=this,h=0;return function(r){return i.enter(s),i.enter(l),i.consume(r),i.exit(l),i.enter(u),f};function f(o){return null===o||91===o||93===o&&!c||94===o&&!h&&"_hiddenFootnoteSupport"in d.parser.constructs||h>999?n(o):93===o?(i.exit(u),i.enter(l),i.consume(o),i.exit(l),i.exit(s),r):a(o)?(i.enter("lineEnding"),i.consume(o),i.exit("lineEnding"),f):(i.enter("chunkString",{contentType:"string"}),p(o))}function p(r){return null===r||91===r||93===r||a(r)||h++>999?(i.exit("chunkString"),f(r)):(i.consume(r),c=c||!o(r),92===r?m:p)}function m(r){return 91===r||92===r||93===r?(i.consume(r),h++,p):p(r)}}},948893,(i,r,n)=>{"use strict";var a=i.r(669275),o=i.r(419953),s=i.r(70881);r.exports=function(i,r){var n;return function l(u){return a(u)?(i.enter("lineEnding"),i.consume(u),i.exit("lineEnding"),n=!0,l):o(u)?s(i,l,n?"linePrefix":"lineSuffix")(u):r(u)}}},185648,(i,r,n)=>{"use strict";var a=i.r(669275),o=i.r(70881);r.exports=function(i,r,n,s,l,u){var c;return function(r){return i.enter(s),i.enter(l),i.consume(r),i.exit(l),c=40===r?41:r,d};function d(n){return n===c?(i.enter(l),i.consume(n),i.exit(l),i.exit(s),r):(i.enter(u),h(n))}function h(r){return r===c?(i.exit(u),d(c)):null===r?n(r):a(r)?(i.enter("lineEnding"),i.consume(r),i.exit("lineEnding"),o(i,h,"linePrefix")):(i.enter("chunkString",{contentType:"string"}),f(r))}function f(r){return r===c||null===r||a(r)?(i.exit("chunkString"),h(r)):(i.consume(r),92===r?p:f)}function p(r){return r===c||92===r?(i.consume(r),f):f(r)}}},530779,(i,r,n)=>{"use strict";var a=i.r(669275),o=i.r(172605),s=i.r(718150),l=i.r(649722),u=i.r(133716),c=i.r(70881),d=i.r(948893),h=i.r(185648),f={tokenize:function(i,r,n){return function(r){return o(r)?d(i,s)(r):n(r)};function s(r){return 34===r||39===r||40===r?h(i,c(i,l,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(r):n(r)}function l(i){return null===i||a(i)?r(i):n(i)}},partial:!0};r.exports={name:"definition",tokenize:function(i,r,n){var o,h=this;return function(r){return i.enter("definition"),u.call(h,i,p,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function p(r){return(o=s(h.sliceSerialize(h.events[h.events.length-1][1]).slice(1,-1)),58===r)?(i.enter("definitionMarker"),i.consume(r),i.exit("definitionMarker"),d(i,l(i,i.attempt(f,c(i,m,"whitespace"),c(i,m,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(r)}function m(s){return null===s||a(s)?(i.exit("definition"),0>h.parser.defined.indexOf(o)&&h.parser.defined.push(o),r(s)):n(s)}}}},970616,(i,r,n)=>{"use strict";var a=i.r(669275);
119r.exports={name:"hardBreakEscape",tokenize:function(i,r,n){return function(r){return i.enter("hardBreakEscape"),i.enter("escapeMarker"),i.consume(r),o};function o(o){return a(o)?(i.exit("escapeMarker"),i.exit("hardBreakEscape"),r(o)):n(o)}}}},454179,(i,r,n)=>{"use strict";var a=i.r(669275),o=i.r(172605),s=i.r(419953),l=i.r(793315),u=i.r(70881);r.exports={name:"headingAtx",tokenize:function(i,r,n){var l=this,c=0;return function(d){return i.enter("atxHeading"),i.enter("atxHeadingSequence"),function d(h){return 35===h&&c++<6?(i.consume(h),d):null===h||o(h)?(i.exit("atxHeadingSequence"),l.interrupt?r(h):function n(l){return 35===l?(i.enter("atxHeadingSequence"),function r(a){return 35===a?(i.consume(a),r):(i.exit("atxHeadingSequence"),n(a))}(l)):null===l||a(l)?(i.exit("atxHeading"),r(l)):s(l)?u(i,n,"whitespace")(l):(i.enter("atxHeadingText"),function r(a){return null===a||35===a||o(a)?(i.exit("atxHeadingText"),n(a)):(i.consume(a),r)}(l))}(h)):n(h)}(d)}},resolve:function(i,r){var n,a,o=i.length-2,s=3;return"whitespace"===i[3][1].type&&(s+=2),o-2>s&&"whitespace"===i[o][1].type&&(o-=2),"atxHeadingSequence"===i[o][1].type&&(s===o-1||o-4>s&&"whitespace"===i[o-2][1].type)&&(o-=s+1===o?2:4),o>s&&(n={type:"atxHeadingText",start:i[s][1].start,end:i[o][1].end},a={type:"chunkText",start:i[s][1].start,end:i[o][1].end,contentType:"text"},l(i,s,o-s+1,[["enter",n,r],["enter",a,r],["exit",a,r],["exit",n,r]])),i}}},918248,(i,r,n)=>{"use strict";r.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},626477,(i,r,n)=>{"use strict";r.exports=["pre","script","style","textarea"]},875556,(i,r,n)=>{"use strict";var a=i.r(327944),o=i.r(956009),s=i.r(669275),l=i.r(172605),u=i.r(419953),c=i.r(953358),d=i.r(918248),h=i.r(626477),f=i.r(90225),p={tokenize:function(i,r,n){return function(a){return i.exit("htmlFlowData"),i.enter("lineEndingBlank"),i.consume(a),i.exit("lineEndingBlank"),i.attempt(f,r,n)}},partial:!0};r.exports={name:"htmlFlow",tokenize:function(i,r,n){var f,m,g,_,y,v=this;return function(r){return i.enter("htmlFlow"),i.enter("htmlFlowData"),i.consume(r),x};function x(o){return 33===o?(i.consume(o),b):47===o?(i.consume(o),E):63===o?(i.consume(o),f=3,v.interrupt?r:U):a(o)?(i.consume(o),g=c(o),m=!0,S):n(o)}function b(o){return 45===o?(i.consume(o),f=2,w):91===o?(i.consume(o),f=5,g="CDATA[",_=0,T):a(o)?(i.consume(o),f=4,v.interrupt?r:U):n(o)}function w(a){return 45===a?(i.consume(a),v.interrupt?r:U):n(a)}function T(a){return a===g.charCodeAt(_++)?(i.consume(a),_===g.length?v.interrupt?r:D:T):n(a)}function E(r){return a(r)?(i.consume(r),g=c(r),S):n(r)}function S(a){if(null===a||47===a||62===a||l(a))return 47!==a&&m&&h.indexOf(g.toLowerCase())>-1?(f=1,v.interrupt?r(a):D(a)):d.indexOf(g.toLowerCase())>-1?(f=6,47===a)?(i.consume(a),A):v.interrupt?r(a):D(a):(f=7,v.interrupt?n(a):m?C(a):function r(n){return u(n)?(i.consume(n),r):P(n)}(a));return 45===a||o(a)?(i.consume(a),g+=c(a),S):n(a)}function A(a){return 62===a?(i.consume(a),v.interrupt?r:D):n(a)}function C(r){return 47===r?(i.consume(r),P):58===r||95===r||a(r)?(i.consume(r),I):u(r)?(i.consume(r),C):P(r)}function I(r){return 45===r||46===r||58===r||95===r||o(r)?(i.consume(r),I):k(r)}function k(r){return 61===r?(i.consume(r),R):u(r)?(i.consume(r),k):C(r)}function R(r){return null===r||60===r||61===r||62===r||96===r?n(r):34===r||39===r?(i.consume(r),y=r,M):u(r)?(i.consume(r),R):(y=void 0,function r(n){return null===n||34===n||39===n||60===n||61===n||62===n||96===n||l(n)?k(n):(i.consume(n),r)}(r))}function M(r){return r===y?(i.consume(r),L):null===r||s(r)?n(r):(i.consume(r),M)}function L(i){return 47===i||62===i||u(i)?C(i):n(i)}function P(r){return 62===r?(i.consume(r),O):n(r)}function O(r){return u(r)?(i.consume(r),O):null===r||s(r)?D(r):n(r)}function D(r){return 45===r&&2===f?(i.consume(r),N):60===r&&1===f?(i.consume(r),j):62===r&&4===f?(i.consume(r),V):63===r&&3===f?(i.consume(r),U):93===r&&5===f?(i.consume(r),B):s(r)&&(6===f||7===f)?i.check(p,V,F)(r):null===r||s(r)?F(r):(i.consume(r),D)}function F(r){return i.exit("htmlFlowData"),function r(n){return null===n?H(n):s(n)?(i.enter("lineEnding"),i.consume(n),i.exit("lineEnding"),r):(i.enter("htmlFlowData"),D(n))}(r)}function N(r){return 45===r?(i.consume(r),U):D(r)}function j(r){return 47===r?(i.consume(r),g="",z):D(r)}function z(r){return 62===r&&h.indexOf(g.toLowerCase())>-1?(i.consume(r),V):a(r)&&g.length<8?(i.consume(r),g+=c(r),z):D(r)}function B(r){return 93===r?(i.consume(r),U):D(r)}function U(r){return 62===r?(i.consume(r),V):D(r)}function V(r){return null===r||s(r)?(i.exit("htmlFlowData"),H(r)):(i.consume(r),V)}function H(n){return i.exit("htmlFlow"),r(n)}},resolveTo:function(i){for(var r=i.length;r--&&("enter"!==i[r][0]||"htmlFlow"!==i[r][1].type););return r>1&&"linePrefix"===i[r-2][1].type&&(i[r][1].start=i[r-2][1].start,i[r+1][1].start=i[r-2][1].start,i.splice(r-2,2)),i},concrete:!0}},69467,(i,r,n)=>{"use strict";
119var a=i.r(327944),o=i.r(956009),s=i.r(669275),l=i.r(172605),u=i.r(419953),c=i.r(70881);r.exports={name:"htmlText",tokenize:function(i,r,n){var d,h,f,p,m=this;return function(r){return i.enter("htmlText"),i.enter("htmlTextData"),i.consume(r),g};function g(r){return 33===r?(i.consume(r),_):47===r?(i.consume(r),R):63===r?(i.consume(r),I):a(r)?(i.consume(r),L):n(r)}function _(r){return 45===r?(i.consume(r),y):91===r?(i.consume(r),h="CDATA[",f=0,T):a(r)?(i.consume(r),C):n(r)}function y(r){return 45===r?(i.consume(r),v):n(r)}function v(r){return null===r||62===r?n(r):45===r?(i.consume(r),x):b(r)}function x(i){return null===i||62===i?n(i):b(i)}function b(r){return null===r?n(r):45===r?(i.consume(r),w):s(r)?(p=b,z(r)):(i.consume(r),b)}function w(r){return 45===r?(i.consume(r),U):b(r)}function T(r){return r===h.charCodeAt(f++)?(i.consume(r),f===h.length?E:T):n(r)}function E(r){return null===r?n(r):93===r?(i.consume(r),S):s(r)?(p=E,z(r)):(i.consume(r),E)}function S(r){return 93===r?(i.consume(r),A):E(r)}function A(r){return 62===r?U(r):93===r?(i.consume(r),A):E(r)}function C(r){return null===r||62===r?U(r):s(r)?(p=C,z(r)):(i.consume(r),C)}function I(r){return null===r?n(r):63===r?(i.consume(r),k):s(r)?(p=I,z(r)):(i.consume(r),I)}function k(i){return 62===i?U(i):I(i)}function R(r){return a(r)?(i.consume(r),M):n(r)}function M(r){return 45===r||o(r)?(i.consume(r),M):function r(n){return s(n)?(p=r,z(n)):u(n)?(i.consume(n),r):U(n)}(r)}function L(r){return 45===r||o(r)?(i.consume(r),L):47===r||62===r||l(r)?P(r):n(r)}function P(r){return 47===r?(i.consume(r),U):58===r||95===r||a(r)?(i.consume(r),O):s(r)?(p=P,z(r)):u(r)?(i.consume(r),P):U(r)}function O(r){return 45===r||46===r||58===r||95===r||o(r)?(i.consume(r),O):function r(n){return 61===n?(i.consume(n),D):s(n)?(p=r,z(n)):u(n)?(i.consume(n),r):P(n)}(r)}function D(r){return null===r||60===r||61===r||62===r||96===r?n(r):34===r||39===r?(i.consume(r),d=r,F):s(r)?(p=D,z(r)):u(r)?(i.consume(r),D):(i.consume(r),d=void 0,j)}function F(r){return r===d?(i.consume(r),N):null===r?n(r):s(r)?(p=F,z(r)):(i.consume(r),F)}function N(i){return 62===i||47===i||l(i)?P(i):n(i)}function j(r){return null===r||34===r||39===r||60===r||61===r||96===r?n(r):62===r||l(r)?P(r):(i.consume(r),j)}function z(r){return i.exit("htmlTextData"),i.enter("lineEnding"),i.consume(r),i.exit("lineEnding"),c(i,B,"linePrefix",m.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}function B(r){return i.enter("htmlTextData"),p(r)}function U(a){return 62===a?(i.consume(a),i.exit("htmlTextData"),i.exit("htmlText"),r):n(a)}}}},427778,(i,r,n)=>{"use strict";var a=i.r(172605),o=i.r(52813),s=i.r(793315),l=i.r(718150),u=i.r(299388),c=i.r(733902),d=i.r(649722),h=i.r(133716),f=i.r(185648),p=i.r(948893),m={tokenize:function(i,r,n){return function(r){return i.enter("resource"),i.enter("resourceMarker"),i.consume(r),i.exit("resourceMarker"),p(i,o)};function o(r){return 41===r?u(r):d(i,s,n,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",3)(r)}function s(r){return a(r)?p(i,l)(r):u(r)}function l(r){return 34===r||39===r||40===r?f(i,p(i,u),n,"resourceTitle","resourceTitleMarker","resourceTitleString")(r):u(r)}function u(a){return 41===a?(i.enter("resourceMarker"),i.consume(a),i.exit("resourceMarker"),i.exit("resource"),r):n(a)}}},g={tokenize:function(i,r,n){var a=this;return function(r){return h.call(a,i,o,n,"reference","referenceMarker","referenceString")(r)};function o(i){return 0>a.parser.defined.indexOf(l(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?n(i):r(i)}}},_={tokenize:function(i,r,n){return function(r){return i.enter("reference"),i.enter("referenceMarker"),i.consume(r),i.exit("referenceMarker"),a};function a(a){return 93===a?(i.enter("referenceMarker"),i.consume(a),i.exit("referenceMarker"),i.exit("reference"),r):n(a)}}};r.exports={name:"labelEnd",tokenize:function(i,r,n){for(var a,o,s=this,u=s.events.length;u--;)if(("labelImage"===s.events[u][1].type||"labelLink"===s.events[u][1].type)&&!s.events[u][1]._balanced){a=s.events[u][1];break}return function(r){return a?a._inactive?d(r):(o=s.parser.defined.indexOf(l(s.sliceSerialize({start:a.end,end:s.now()})))>-1,i.enter("labelEnd"),i.enter("labelMarker"),i.consume(r),i.exit("labelMarker"),i.exit("labelEnd"),c):n(r)};function c(n){return 40===n?i.attempt(m,r,o?r:d)(n):91===n?i.attempt(g,r,o?i.attempt(_,r,d):d)(n):o?r(n):d(n)}function d(i){return a._balanced=!0,n(i)}},resolveTo:function(i,r){for(var n,a,l,d,h,f,p,m=i.length,g=0;m--;)if(d=i[m][1],h){if("link"===d.type||"labelLink"===d.type&&d._inactive)break;"enter"===i[m][0]&&"labelLink"===d.type&&(d._inactive=!0)}else if(f){if("enter"===i[m][0]&&("labelImage"===d.type||"labelLink"===d.type)&&!d._balanced&&(h=m,"labelLink"!==d.type)){g=2;break}}else"labelEnd"===d.type&&(f=m);return n={type:"labelLink"===i[h][1].type?"link":"image",start:c(i[h][1].start),end:c(i[i.length-1][1].end)},a={type:"label",start:c(i[h][1].start),end:c(i[f][1].end)},l={type:"labelText",start:c(i[h+g+2][1].end),end:c(i[f-2][1].start)},p=o(p=[["enter",n,r],["enter",a,r]],i.slice(h+1,h+g+3)),p=o(p,[["enter",l,r]]),p=o(p,u(r.parser.constructs.insideSpan.null,i.slice(h+g+4,f-3),r)),p=o(p,[["exit",l,r],i[f-2],i[f-1],["exit",a,r]]),p=o(p,i.slice(f+1)),p=o(p,[["exit",n,r]]),s(i,h,i.length,p),i},resolveAll:function(i){for(var r,n=-1;++n<i.length;)!(r=i[n][1])._used&&("labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type)&&(i.splice(n+1,"labelImage"===r.type?4:2),r.type="data",n++);return i}}},119242,(i,r,n)=>{"use strict";r.exports={name:"labelStartImage",tokenize:function(i,r,n){var a=this;return function(r){return i.enter("labelImage"),i.enter("labelImageMarker"),i.consume(r),i.exit("labelImageMarker"),o};function o(r){return 91===r?(i.enter("labelMarker"),i.consume(r),i.exit("labelMarker"),i.exit("labelImage"),s):n(r)}function s(i){return 94===i&&"_hiddenFootnoteSupport"in a.parser.constructs?n(i):r(i)}},resolveAll:i.r(427778).resolveAll}},927303,(i,r,n)=>{"use strict";r.exports={name:"labelStartLink",tokenize:function(i,r,n){var a=this;return function(r){return i.enter("labelLink"),i.enter("labelMarker"),i.consume(r),i.exit("labelMarker"),i.exit("labelLink"),o};function o(i){return 94===i&&"_hiddenFootnoteSupport"in a.parser.constructs?n(i):r(i)}},resolveAll:i.r(427778).resolveAll}},249123,(i,r,n)=>{"use strict";var a=i.r(70881);
119r.exports={name:"lineEnding",tokenize:function(i,r){return function(n){return i.enter("lineEnding"),i.consume(n),i.exit("lineEnding"),a(i,r,"linePrefix")}}}},604772,(i,r,n)=>{"use strict";var a=i.r(669275),o=i.r(419953),s=i.r(70881);r.exports={name:"thematicBreak",tokenize:function(i,r,n){var l,u=0;return function(c){return i.enter("thematicBreak"),l=c,function c(d){return d===l?(i.enter("thematicBreakSequence"),function r(n){return n===l?(i.consume(n),u++,r):(i.exit("thematicBreakSequence"),c(n))}(d)):o(d)?s(i,c,"whitespace")(d):u<3||null!==d&&!a(d)?n(d):(i.exit("thematicBreak"),r(d))}(c)}}}},536178,(i,r,n)=>{"use strict";var a=i.r(319253),o=i.r(419953),s=i.r(999570),l=i.r(254275),u=i.r(70881),c=i.r(90225),d=i.r(604772),h={name:"list",tokenize:function(i,r,n){var u=this,h=s(u.events,"linePrefix"),p=0;return function(r){var o=u.containerState.type||(42===r||43===r||45===r?"listUnordered":"listOrdered");if("listUnordered"===o?!u.containerState.marker||r===u.containerState.marker:a(r)){if(u.containerState.type||(u.containerState.type=o,i.enter(o,{_container:!0})),"listUnordered"===o)return i.enter("listItemPrefix"),42===r||45===r?i.check(d,n,m)(r):m(r);if(!u.interrupt||49===r)return i.enter("listItemPrefix"),i.enter("listItemValue"),function r(o){return a(o)&&++p<10?(i.consume(o),r):(!u.interrupt||p<2)&&(u.containerState.marker?o===u.containerState.marker:41===o||46===o)?(i.exit("listItemValue"),m(o)):n(o)}(r)}return n(r)};function m(r){return i.enter("listItemMarker"),i.consume(r),i.exit("listItemMarker"),u.containerState.marker=u.containerState.marker||r,i.check(c,u.interrupt?n:g,i.attempt(f,y,_))}
119function g(i){return u.containerState.initialBlankLine=!0,h++,y(i)}function _(r){return o(r)?(i.enter("listItemPrefixWhitespace"),i.consume(r),i.exit("listItemPrefixWhitespace"),y):n(r)}function y(n){return u.containerState.size=h+l(u.sliceStream(i.exit("listItemPrefix"))),r(n)}},continuation:{tokenize:function(i,r,n){var a=this;return a.containerState._closeFlow=void 0,i.check(c,function(n){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,u(i,r,"listItemIndent",a.containerState.size+1)(n)},function(n){return a.containerState.furtherBlankLines||!o(n)?(a.containerState.furtherBlankLines=a.containerState.initialBlankLine=void 0,s(n)):(a.containerState.furtherBlankLines=a.containerState.initialBlankLine=void 0,i.attempt(p,r,s)(n))});function s(o){return a.containerState._closeFlow=!0,a.interrupt=void 0,u(i,i.attempt(h,r,n),"linePrefix",a.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)(o)}}},exit:function(i){i.exit(this.containerState.type)}},f={tokenize:function(i,r,n){var a=this;return u(i,function(i){return o(i)||!s(a.events,"listItemPrefixWhitespace")?n(i):r(i)},"listItemPrefixWhitespace",a.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:5)},partial:!0},p={tokenize:function(i,r,n){var a=this;return u(i,function(i){return s(a.events,"listItemIndent")===a.containerState.size?r(i):n(i)},"listItemIndent",a.containerState.size+1)},partial:!0};r.exports=h},289612,(i,r,n)=>{"use strict";var a=i.r(669275),o=i.r(733902),s=i.r(70881);r.exports={name:"setextUnderline",tokenize:function(i,r,n){for(var o,l,u=this,c=u.events.length;c--;)if("lineEnding"!==u.events[c][1].type&&"linePrefix"!==u.events[c][1].type&&"content"!==u.events[c][1].type){l="paragraph"===u.events[c][1].type;break}return function(r){return!u.lazy&&(u.interrupt||l)?(i.enter("setextHeadingLine"),i.enter("setextHeadingLineSequence"),o=r,function r(n){return n===o?(i.consume(n),r):(i.exit("setextHeadingLineSequence"),s(i,d,"lineSuffix")(n))}(r)):n(r)};function d(o){return null===o||a(o)?(i.exit("setextHeadingLine"),r(o)):n(o)}},resolveTo:function(i,r){for(var n,a,s,l,u=i.length;u--;)if("enter"===i[u][0]){if("content"===i[u][1].type){n=u;break}"paragraph"===i[u][1].type&&(a=u)}else"content"===i[u][1].type&&i.splice(u,1),s||"definition"!==i[u][1].type||(s=u);return l={type:"setextHeading",start:o(i[a][1].start),end:o(i[i.length-1][1].end)},i[a][1].type="setextHeadingText",s?(i.splice(a,0,["enter",l,r]),i.splice(s+1,0,["exit",i[n][1],r]),i[n][1].end=o(i[s][1].end)):i[n][1]=l,i.push(["exit",l,r]),i}}},858064,(i,r,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=i.r(125445),o=i.r(784173),s=i.r(516075),l=i.r(811326),u=i.r(749953),c=i.r(95036),d=i.r(163642),h=i.r(181051),f=i.r(281771),p=i.r(530779),m=i.r(970616),g=i.r(454179),_=i.r(875556),y=i.r(69467),v=i.r(427778),x=i.r(119242),b=i.r(927303),w=i.r(249123),T=i.r(536178),E=i.r(289612),S=i.r(604772),A={null:[o,a.resolver]};n.contentInitial={91:p},n.disable={null:[]},n.document={42:T,43:T,45:T,48:T,49:T,50:T,51:T,52:T,53:T,54:T,55:T,56:T,57:T,62:l},n.flow={35:g,42:S,45:[E,S],60:_,61:E,95:S,96:d,126:d},n.flowInitial={"-2":h,"-1":h,32:h},n.insideSpan=A,n.string={38:c,92:u},n.text={"-5":w,"-4":w,"-3":w,33:x,38:c,42:o,60:[s,y],91:b,92:[m,u],93:v,95:o,96:f}},884811,(i,r,n)=>{"use strict";var a=i.r(397981),o=i.r(406502),s=i.r(286591),l=i.r(125445),u=i.r(90187),c=i.r(658060),d=i.r(386789),h=i.r(858064);r.exports=function(i){var r={defined:[],constructs:u([h].concat(d((i||{}).extensions))),content:n(a),document:n(o),flow:n(s),string:n(l.string),text:n(l.text)};return r;function n(i){return function(n){return c(r,i,n)}}}},447520,(i,r,n)=>{"use strict";var a=/[\0\t\n\r]/g;r.exports=function(){var i,r=!0,n=1,o="";return function(s,l,u){var c,d,h,f,p,m=[];for(s=o+s.toString(l),h=0,o="",r&&(65279===s.charCodeAt(0)&&h++,r=void 0);h<s.length;){if(a.lastIndex=h,f=(c=a.exec(s))?c.index:s.length,p=s.charCodeAt(f),!c){o=s.slice(h);break}if(10===p&&h===f&&i)m.push(-3),i=void 0;else if(i&&(m.push(-5),i=void 0),h<f&&(m.push(s.slice(h,f)),n+=f-h),0===p)m.push(65533),n++;else if(9===p)for(d=4*Math.ceil(n/4),m.push(-2);n++<d;)m.push(-1);else 10===p?m.push(-4):i=!0,n=1;h=f+1}return u&&(i&&m.push(-5),o&&m.push(o),m.push(null)),m}}},370334,(i,r,n)=>{"use strict";var a=i.r(77762);r.exports=function(i){for(;!a(i););return i}},392721,(i,r,n)=>{"use strict";r.exports=function(i,r,n){return"string"!=typeof r&&(n=r,r=void 0),(function(i){var r=function(i,r){for(var n=-1;++n<r.length;)!function(i,r){var n,a;for(n in r)a=s.call(i,n)?i[n]:i[n]={},"canContainEols"===n||"transforms"===n?i[n]=[].concat(a,r[n]):Object.assign(a,r[n])}(i,r[n]);return i}({transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter
119:{autolink:m(k),autolinkProtocol:b,autolinkEmail:b,atxHeading:m(A),blockQuote:m(function(){return{type:"blockquote",children:[]}}),characterEscape:b,characterReference:b,codeFenced:m(S),codeFencedFenceInfo:g,codeFencedFenceMeta:g,codeIndented:m(S,g),codeText:m(function(){return{type:"inlineCode",value:""}},g),codeTextData:b,data:b,codeFlowValue:b,definition:m(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:g,definitionLabelString:g,definitionTitleString:g,emphasis:m(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:m(C),hardBreakTrailing:m(C),htmlFlow:m(I,g),htmlFlowData:b,htmlText:m(I,g),htmlTextData:b,image:m(function(){return{type:"image",title:null,url:"",alt:null}}),label:g,link:m(k),listItem:m(function(i){return{type:"listItem",spread:i._spread,checked:null,children:[]}}),listItemValue:function(i){n.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=parseInt(this.sliceSerialize(i),10),n.expectingFirstListItemValue=void 0)},listOrdered:m(R,function(){n.expectingFirstListItemValue=!0}),listUnordered:m(R),paragraph:m(function(){return{type:"paragraph",children:[]}}),reference:function(){n.referenceType="collapsed"},referenceString:g,resourceDestinationString:g,resourceTitleString:g,setextHeading:m(A),strong:m(function(){return{type:"strong",children:[]}}),thematicBreak:m(function(){return{type:"thematicBreak"}})},exit:{atxHeading:y(),atxHeadingSequence:function(i){this.stack[this.stack.length-1].depth||(this.stack[this.stack.length-1].depth=this.sliceSerialize(i).length)},autolink:y(),autolinkEmail:function(i){w.call(this,i),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(i)},autolinkProtocol:function(i){w.call(this,i),this.stack[this.stack.length-1].url=this.sliceSerialize(i)},blockQuote:y(),characterEscapeValue:w,characterReferenceMarkerHexadecimal:E,characterReferenceMarkerNumeric:E,characterReferenceValue:function(i){var r,a,o=this.sliceSerialize(i),s=n.characterReferenceType;s?(r=u(o,"characterReferenceMarkerNumeric"===s?10:16),n.characterReferenceType=void 0):r=f(o),a=this.stack.pop(),a.value+=r,a.position.end=h(i.end)},codeFenced:y(function(){var i=this.resume();this.stack[this.stack.length-1].value=i.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),n.flowCodeInside=void 0}),codeFencedFence:function(){!n.flowCodeInside&&(this.buffer(),n.flowCodeInside=!0)},codeFencedFenceInfo:function(){var i=this.resume();this.stack[this.stack.length-1].lang=i},codeFencedFenceMeta:function(){var i=this.resume();this.stack[this.stack.length-1].meta=i},codeFlowValue:w,codeIndented:y(function(){var i=this.resume();this.stack[this.stack.length-1].value=i}),codeText:y(function(){var i=this.resume();this.stack[this.stack.length-1].value=i}),codeTextData:w,data:w,definition:y(),definitionDestinationString:function(){var i=this.resume();this.stack[this.stack.length-1].url=i},definitionLabelString:function(i){var r=this.resume();this.stack[this.stack.length-1].label=r,this.stack[this.stack.length-1].identifier=l(this.sliceSerialize(i)).toLowerCase()},definitionTitleString:function(){var i=this.resume();this.stack[this.stack.length-1].title=i},emphasis:y(),hardBreakEscape:y(T),hardBreakTrailing:y(T),htmlFlow:y(function(){var i=this.resume();this.stack[this.stack.length-1].value=i}),htmlFlowData:w,htmlText:y(function(){var i=this.resume();this.stack[this.stack.length-1].value=i}),htmlTextData:w,image:y(function(){var i=this.stack[this.stack.length-1];n.inReference?(i.type+="Reference",i.referenceType=n.referenceType||"shortcut",delete i.url,delete i.title):(delete i.identifier,delete i.label,delete i.referenceType),n.referenceType=void 0}),label:function(){var i=this.stack[this.stack.length-1],r=this.resume();this.stack[this.stack.length-1].label=r,n.inReference=!0,"link"===this.stack[this.stack.length-1].type?this.stack[this.stack.length-1].children=i.children:this.stack[this.stack.length-1].alt=r},labelText:function(i){this.stack[this.stack.length-2].identifier=l(this.sliceSerialize(i)).toLowerCase()},lineEnding:function(i){var a=this.stack[this.stack.length-1];if(n.atHardBreak){a.children[a.children.length-1].position.end=h(i.end),n.atHardBreak=void 0;return}!n.setextHeadingSlurpLineEnding&&r.canContainEols.indexOf(a.type)>-1&&(b.call(this,i),w.call(this,i))},link:y(function(){var i=this.stack[this.stack.length-1];n.inReference?(i.type+="Reference",i.referenceType=n.referenceType||"shortcut",delete i.url,delete i.title):(delete i.identifier,delete i.label,delete i.referenceType),n.referenceType=void 0}),listItem:y(),listOrdered:y(),listUnordered:y(),paragraph:y(),referenceString:function(i){var r=this.resume();this.stack[this.stack.length-1].label=r,this.stack[this.stack.length-1].identifier=l(this.sliceSerialize(i)).toLowerCase(),n.referenceType="full"},resourceDestinationString:function(){var i=this.resume();this.stack[this.stack.length-1].url=i},resourceTitleString:function(){var i=this.resume();this.stack[this.stack.length-1].title=i},resource:function(){n.inReference=void 0},setextHeading:y(function(){n.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(i){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(i).charCo
119deAt(0)?1:2},setextHeadingText:function(){n.setextHeadingSlurpLineEnding=!0},strong:y(),thematicBreak:y()}},(i||{}).mdastExtensions||[]),n={};return function(i){for(var n,a,l={type:"root",children:[]},u=[],f=[],m=-1,y={stack:[l],tokenStack:u,config:r,enter:_,exit:v,buffer:g,resume:x,setData:c,getData:d};++m<i.length;)("listOrdered"===i[m][1].type||"listUnordered"===i[m][1].type)&&("enter"===i[m][0]?f.push(m):m=function(i,r,n){for(var a,o,s,l,u,c,d,f=r-1,p=-1,m=!1;++f<=n;)if("listUnordered"===(u=i[f])[1].type||"listOrdered"===u[1].type||"blockQuote"===u[1].type?("enter"===u[0]?p++:p--,d=void 0):"lineEndingBlank"===u[1].type?"enter"===u[0]&&(!a||d||p||c||(c=f),d=void 0):"linePrefix"===u[1].type||"listItemValue"===u[1].type||"listItemMarker"===u[1].type||"listItemPrefix"===u[1].type||"listItemPrefixWhitespace"===u[1].type||(d=void 0),!p&&"enter"===u[0]&&"listItemPrefix"===u[1].type||-1===p&&"exit"===u[0]&&("listUnordered"===u[1].type||"listOrdered"===u[1].type)){if(a){for(o=f,s=void 0;o--;)if("lineEnding"===(l=i[o])[1].type||"lineEndingBlank"===l[1].type){if("exit"===l[0])continue;s&&(i[s][1].type="lineEndingBlank",m=!0),l[1].type="lineEnding",s=o}else if("linePrefix"===l[1].type||"blockQuotePrefix"===l[1].type||"blockQuotePrefixWhitespace"===l[1].type||"blockQuoteMarker"===l[1].type||"listItemIndent"===l[1].type);else break;c&&(!s||c<s)&&(a._spread=!0),a.end=h(s?i[s][1].start:u[1].end),i.splice(s||f,0,["exit",a,u[2]]),f++,n++}"listItemPrefix"===u[1].type&&(a={type:"listItem",_spread:!1,start:h(u[1].start)},i.splice(f,0,["enter",a,u[2]]),f++,n++,c=void 0,d=!0)}return i[r][1]._spread=m,n}(i,a=f.pop(m),m));for(m=-1;++m<i.length;)n=r[i[m][0]],s.call(n,i[m][1].type)&&n[i[m][1].type].call(o({sliceSerialize:i[m][2].sliceSerialize},y),i[m][1]);if(u.length)throw Error("Cannot close document, a token (`"+u[u.length-1].type+"`, "+p({start:u[u.length-1].start,end:u[u.length-1].end})+") is still open");for(l.position={start:h(i.length?i[0][1].start:{line:1,column:1,offset:0}),end:h(i.length?i[i.length-2][1].end:{line:1,column:1,offset:0})},m=-1;++m<r.transforms.length;)l=r.transforms[m](l)||l;return l};function c(i,r){n[i]=r}function d(i){return n[i]}function h(i){return{line:i.line,column:i.column,offset:i.offset}}function m(i,r){return function(n){_.call(this,i(n),n),r&&r.call(this,n)}}function g(){this.stack.push({type:"fragment",children:[]})}function _(i,r){return this.stack[this.stack.length-1].children.push(i),this.stack.push(i),this.tokenStack.push(r),i.position={start:h(r.start)},i}function y(i){return function(r){i&&i.call(this,r),v.call(this,r)}}function v(i){var r=this.stack.pop(),n=this.tokenStack.pop();if(n){if(n.type!==i.type)throw Error("Cannot close `"+i.type+"` ("+p({start:i.start,end:i.end})+"): a different token (`"+n.type+"`, "+p({start:n.start,end:n.end})+") is open")}else throw Error("Cannot close `"+i.type+"` ("+p({start:i.start,end:i.end})+"): it’s not open");return r.position.end=h(i.end),r}function x(){return a(this.stack.pop())}function b(i){var r=this.stack[this.stack.length-1].children,n=r[r.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:h(i.start)},this.stack[this.stack.length-1].children.push(n)),this.stack.push(n)}function w(i){var r=this.stack.pop();r.value+=this.sliceSerialize(i),r.position.end=h(i.end)}function T(){n.atHardBreak=!0}function E(i){n.characterReferenceType=i.type}function S(){return{type:"code",lang:null,meta:null,value:""}}function A(){return{type:"heading",depth:void 0,children:[]}}function C(){return{type:"break"}}function I(){return{type:"html",value:""}}function k(){return{type:"link",title:null,url:"",children:[]}}function R(i){return{type:"list",ordered:"listOrdered"===i.type,start:null,spread:i._spread,children:[]}}})(n)(h(c(n).document().write(d()(i,r,!0))))};var a=i.r(419140),o=i.r(545490),s=i.r(910601),l=i.r(718150),u=i.r(472568),c=i.r(884811),d=i.r(447520),h=i.r(370334),f=i.r(50364),p=i.r(257272)},921443,(i,r,n)=>{"use strict";r.exports=i.r(392721)},402028,(i,r,n)=>{"use strict";r.exports=function(i){var r=this;this.Parser=function(n){return a(n,Object.assign({},r.data("settings"),i,{extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]}))}};var a=i.r(921443)},663448,(i,r,n)=>{"use strict";r.exports=function(i,r,n){var a;return null==n&&("object"!=typeof r||Array.isArray(r))&&(n=r,r={}),a=Object.assign({type:String(i)},r),Array.isArray(n)?a.children=n:null!=n&&(a.value=String(n)),a}},635691,(i,r,n)=>{"use strict";function a(){return!0}r.exports=function i(r){var n,o;if(null==r)return a;
119if("string"==typeof r){return n=r,function(i){return!!(i&&i.type===n)}}if("object"==typeof r){return"length"in r?function(r){for(var n=[],a=-1;++a<r.length;)n[a]=i(r[a]);return function(){for(var i=-1;++i<n.length;)if(n[i].apply(this,arguments))return!0;return!1}}(r):(o=r,function(i){var r;for(r in o)if(i[r]!==o[r])return!1;return!0})}if("function"==typeof r)return r;throw Error("Expected function, string, or object as test")}},983838,(i,r,n)=>{r.exports=function(i){return i}},825592,(i,r,n)=>{"use strict";r.exports=l;var a=i.r(635691),o=i.r(983838),s="skip";function l(i,r,n,l){var u,c;"function"==typeof r&&"function"!=typeof n&&(l=n,n=r,r=null),c=a(r),u=l?-1:1,(function i(a,d,h){var f,p="object"==typeof a&&null!==a?a:{};return"string"==typeof p.type&&(f="string"==typeof p.tagName?p.tagName:"string"==typeof p.name?p.name:void 0,m.displayName="node ("+o(p.type+(f?"<"+f+">":""))+")"),m;function m(){var o,f,p,m=h.concat(a),g=[];if((!r||c(a,d,h[h.length-1]||null))&&!1===(g=null!==(o=n(a,h))&&"object"==typeof o&&"length"in o?o:"number"==typeof o?[!0,o]:[o])[0])return g;if(a.children&&g[0]!==s)for(p=(l?a.children.length:-1)+u;p>-1&&p<a.children.length;){if(!1===(f=i(a.children[p],p,m)())[0])return f;p="number"==typeof f[1]?f[1]:p+u}return g}})(i,null,[])()}l.CONTINUE=!0,l.SKIP=s,l.EXIT=!1},163420,(i,r,n)=>{"use strict";r.exports=u;var a=i.r(825592),o=a.CONTINUE,s=a.SKIP,l=a.EXIT;function u(i,r,n,o){"function"==typeof r&&"function"!=typeof n&&(o=n,n=r,r=null),a(i,r,function(i,r){var a=r[r.length-1],o=a?a.children.indexOf(i):null;return n(i,o,a)},o)}u.CONTINUE=o,u.SKIP=s,u.EXIT=l},579241,(i,r,n)=>{"use strict";var a=l("start"),o=l("end");function s(i){return{start:a(i),end:o(i)}}function l(i){return r.displayName=i,r;function r(r){var n=r&&r.position&&r.position[i]||{};return{line:n.line||null,column:n.column||null,offset:isNaN(n.offset)?null:n.offset}}}r.exports=s,s.start=a,s.end=o},813361,(i,r,n)=>{"use strict";r.exports=function(i){return!i||!i.position||!i.position.start||!i.position.start.line||!i.position.start.column||!i.position.end||!i.position.end.line||!i.position.end.column}},720556,(i,r,n)=>{"use strict";var a=i.r(163420);r.exports=function(i,r){var n;return n=function(i){var r={};if(!i||!i.type)throw Error("mdast-util-definitions expected node");return a(i,"definition",function(i){var n=s(i.identifier);o.call(r,n)||(r[n]=i)}),r}(i),function(i){var r=i&&s(i);return r&&o.call(n,r)?n[r]:null}};var o={}.hasOwnProperty;function s(i){return i.toUpperCase()}},887657,(i,r,n)=>{"use strict";r.exports=function(i,r){for(var n,o,s=r.children||[],l=s.length,u=[],c=-1;++c<l;)(n=a(i,s[c],r))&&(c&&"break"===s[c-1].type&&(n.value&&(n.value=n.value.replace(/^\s+/,"")),(o=n.children&&n.children[0])&&o.value&&(o.value=o.value.replace(/^\s+/,""))),u=u.concat(n));return u};var a=i.r(574944)},574944,(i,r,n)=>{"use strict";r.exports=function(i,r,n){var u,c=r&&r.type;if(!c)throw Error("Expected node, got `"+r+"`");return("function"==typeof(u=s.call(i.handlers,c)?i.handlers[c]:i.passThrough&&i.passThrough.indexOf(c)>-1?l:i.unknownHandler)?u:function(i,r){var n,l;return(l=(n=r).data||{},!(s.call(l,"hName")||s.call(l,"hProperties")||s.call(l,"hChildren"))&&"value"in n)?i.augment(r,a("text",r.value)):i(r,"div",o(i,r))})(i,r,n)};var a=i.r(663448),o=i.r(887657),s={}.hasOwnProperty;function l(i,r){var n;return r.children?((n=Object.assign({},r)).children=o(i,r),n):r}},423022,(i,r,n)=>{"use strict";r.exports=function(i,r){return i(r,"hr")}},18684,(i,r,n)=>{"use strict";r.exports=function(i,r){var n=[],o=-1,s=i.length;for(r&&n.push(a("text","\n"));++o<s;)o&&n.push(a("text","\n")),n.push(i[o]);return r&&i.length>0&&n.push(a("text","\n")),n};var a=i.r(663448)},941653,(i,r,n)=>{"use strict";r.exports=function(i,r){var n,s,l={},u=r.ordered?"ol":"ul",c=-1;for("number"==typeof r.start&&1!==r.start&&(l.start=r.start),s=(n=o(i,r)).length;++c<s;)if(n[c].properties.className&&-1!==n[c].properties.className.indexOf("task-list-item")){l.className=["contains-task-list"];break}return i(r,u,l,a(n,!0))};var a=i.r(18684),o=i.r(887657)},335207,(i,r,n)=>{"use strict";r.exports=function(i){for(var r,n,l,u,c=i.footnoteById,d=i.footnoteOrder,h=d.length,f=-1,p=[];++f<h;)(r=c[d[f].toUpperCase()])&&(u=(l=r.children.concat())[l.length-1],n={type:"link",url:"#fnref-"+r.identifier,data:{hProperties:{className:["footnote-backref"]}},children:[{type:"text",value:"↩"}]},u&&"paragraph"===u.type||(u={type:"paragraph",children:[]},l.push(u)),u.children.push(n),p.push({type:"listItem",data:{hProperties:{id:"fn-"+r.identifier}},children:l,position:r.position}));return 0===p.length?null:i(null,"div",{className:["footnotes"]},s([a(i),o(i,{type:"list",ordered:!0,children:p})],!0))};var a=i.r(423022),o=i.r(941653),s=i.r(18684)},529355,(i,r,n)=>{"use strict";r.exports=function(i,r){return i(r,"blockquote",a(o(i,r),!0))};var a=i.r(18684),o=i.r(887657)},825074,(i,r,n)=>{"use strict";r.exports=function(i,r){return[i(r,"br"),a("text","\n")]};var a=i.r(663448)},202193,(i,r,n)=>{"use strict";r.exports=function(i,r){var n,o=r.value?r.value+"\n":"",s=r.lang&&r.lang.match(/^[^ \t]+(?=[ \t]|$)/),l={};return s&&(l.className=["language-"+s]),n=i(r,"code",l,[a("text",o)]),r.meta&&(n.data={meta:r.meta}
119),i(r.position,"pre",[n])};var a=i.r(663448)},882813,(i,r,n)=>{"use strict";r.exports=function(i,r){return i(r,"del",a(i,r))};var a=i.r(887657)},941423,(i,r,n)=>{"use strict";r.exports=function(i,r){return i(r,"em",a(i,r))};var a=i.r(887657)},824254,(i,r,n)=>{"use strict";r.exports=function(i,r){var n=i.footnoteOrder,o=String(r.identifier);return -1===n.indexOf(o)&&n.push(o),i(r.position,"sup",{id:"fnref-"+o},[i(r,"a",{href:"#fn-"+o,className:["footnote-ref"]},[a("text",r.label||o)])])};var a=i.r(663448)},466210,(i,r,n)=>{"use strict";r.exports=function(i,r){for(var n=i.footnoteById,o=i.footnoteOrder,s=1;s in n;)s++;return s=String(s),o.push(s),n[s]={type:"footnoteDefinition",identifier:s,children:[{type:"paragraph",children:r.children}],position:r.position},a(i,{type:"footnoteReference",identifier:s,position:r.position})};var a=i.r(824254)},449536,(i,r,n)=>{"use strict";r.exports=function(i,r){return i(r,"h"+r.depth,a(i,r))};var a=i.r(887657)},644820,(i,r,n)=>{"use strict";r.exports=function(i,r){return i.dangerous?i.augment(r,a("raw",r.value)):null};var a=i.r(663448)},272192,(i,r,n)=>{"use strict";var a={};function o(i,r,n){var s,l,u,c,d,h="";for("string"!=typeof r&&(n=r,r=o.defaultChars),void 0===n&&(n=!0),d=function(i){var r,n,o=a[i];if(o)return o;for(r=0,o=a[i]=[];r<128;r++)n=String.fromCharCode(r),/^[0-9a-z]$/i.test(n)?o.push(n):o.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2));for(r=0;r<i.length;r++)o[i.charCodeAt(r)]=i[r];return o}(r),s=0,l=i.length;s<l;s++){if(u=i.charCodeAt(s),n&&37===u&&s+2<l&&/^[0-9a-f]{2}$/i.test(i.slice(s+1,s+3))){h+=i.slice(s,s+3),s+=2;continue}if(u<128){h+=d[u];continue}if(u>=55296&&u<=57343){if(u>=55296&&u<=56319&&s+1<l&&(c=i.charCodeAt(s+1))>=56320&&c<=57343){h+=encodeURIComponent(i[s]+i[s+1]),s++;continue}h+="%EF%BF%BD";continue}h+=encodeURIComponent(i[s])}return h}o.defaultChars=";/?:@&=+$,-_.!~*'()#",o.componentChars="-_.!~*'()",r.exports=o},133058,(i,r,n)=>{"use strict";r.exports=function(i,r){var n,s,l,u=r.referenceType,c="]";return("collapsed"===u?c+="[]":"full"===u&&(c+="["+(r.label||r.identifier)+"]"),"imageReference"===r.type)?a("text","!["+r.alt+c):((s=(n=o(i,r))[0])&&"text"===s.type?s.value="["+s.value:n.unshift(a("text","[")),(l=n[n.length-1])&&"text"===l.type?l.value+=c:n.push(a("text",c)),n)};var a=i.r(663448),o=i.r(887657)},736492,(i,r,n)=>{"use strict";r.exports=function(i,r){var n,s=i.definition(r.identifier);return s?(n={src:a(s.url||""),alt:r.alt},null!==s.title&&void 0!==s.title&&(n.title=s.title),i(r,"img",n)):o(i,r)};var a=i.r(272192),o=i.r(133058)},950033,(i,r,n)=>{"use strict";var a=i.r(272192);r.exports=function(i,r){var n={src:a(r.url),alt:r.alt};return null!==r.title&&void 0!==r.title&&(n.title=r.title),i(r,"img",n)}},691444,(i,r,n)=>{"use strict";r.exports=function(i,r){var n=r.value.replace(/\r?\n|\r/g," ");return i(r,"code",[a("text",n)])};var a=i.r(663448)},657752,(i,r,n)=>{"use strict";r.exports=function(i,r){var n,l=i.definition(r.identifier);return l?(n={href:a(l.url||"")},null!==l.title&&void 0!==l.title&&(n.title=l.title),i(r,"a",n,s(i,r))):o(i,r)};var a=i.r(272192),o=i.r(133058),s=i.r(887657)},519202,(i,r,n)=>{"use strict";var a=i.r(272192),o=i.r(887657);r.exports=function(i,r){var n={href:a(r.url)};return null!==r.title&&void 0!==r.title&&(n.title=r.title),i(r,"a",n,o(i,r))}},352779,(i,r,n)=>{"use strict";r.exports=function(i,r,n){var l,u,c,d=o(i,r),h=d[0],f=n?function(i){for(var r=i.spread,n=i.children,a=n.length,o=-1;!r&&++o<a;)r=s(n[o]);return r}(n):s(r),p={},m=[];for("boolean"==typeof r.checked&&(h&&"p"===h.tagName||(h=i(null,"p",[]),d.unshift(h)),h.children.length>0&&h.children.unshift(a("text"," ")),h.children.unshift(i(null,"input",{type:"checkbox",checked:r.checked,disabled:!0})),p.className=["task-list-item"]),l=d.length,u=-1;++u<l;)c=d[u],(f||0!==u||"p"!==c.tagName)&&m.push(a("text","\n")),"p"!==c.tagName||f?m.push(c):m=m.concat(c.children);return l&&(f||"p"!==c.tagName)&&m.push(a("text","\n")),i(r,"li",p,m)};var a=i.r(663448),o=i.r(887657);function s(i){var r=i.spread;return null==r?i.children.length>1:r}},469317,(i,r,n)=>{"use strict";r.exports=function(i,r){return i(r,"p",a(i,r))};var a=i.r(887657)},976495,(i,r,n)=>{"use strict";r.exports=function(i,r){return i.augment(r,a("root",o(s(i,r))))};var a=i.r(663448),o=i.r(18684),s=i.r(887657)},191689,(i,r,n)=>{"use strict";r.exports=function(i,r){return i(r,"strong",a(i,r))};var a=i.r(887657)},262430,(i,r,n)=>{"use strict";r.exports=function(i,r){for(var n,l,u,c,d,h=r.children,f=h.length,p=r.align||[],m=p.length,g=[];f--;){for(l=h[f].children,c=0===f?"th":"td",n=m||l.length,u=[];n--;)d=l[n],u[n]=i(d,c,{align:p[n]},d?s(i,d):[]);g[f]=i(h[f],"tr",o(u,!0))}return i(r,"table",o([i(g[0].position,"thead",o([g[0]],!0))].concat(g[1]?i({start:a.start(g[1]),end:a.end(g[g.length-1])},"tbody",o(g.slice(1),!0)):[]),!0))};var a=i.r(579241),o=i.r(18684),s=i.r(887657)},809815,(i,r,n)=>{"use strict";r.exports=function(i,r){return i.augment(r,a("text",String(r.value).replace(/[ \t]*(\r?\n|\r)[ \t]*/g,"$1")))};var a=i.r(663448)},6081,(i,r,n)=>{"use strict";function a(){return null}r.exports={blockquote:i.r(529355),break:i.r(825074),code:i.r(202193),delete:i.r(882813),emphasis:i.r(941423),footnoteReference:i.r(824254),footnote:i.r(466210),heading:i.r(449536),html:i.r(644820),imageReference:i.r(736492),image:i.r(950033),inl
119ineCode:i.r(691444),linkReference:i.r(657752),link:i.r(519202),listItem:i.r(352779),list:i.r(941653),paragraph:i.r(469317),root:i.r(976495),strong:i.r(191689),table:i.r(262430),text:i.r(809815),thematicBreak:i.r(423022),toml:a,yaml:a,definition:a,footnoteDefinition:a}},892693,(i,r,n)=>{"use strict";r.exports=function(i,r){var n=function(i,r){var n=r||{};void 0===n.allowDangerousHTML||p||(p=!0,console.warn("mdast-util-to-hast: deprecation: `allowDangerousHTML` is nonstandard, use `allowDangerousHtml` instead"));var a=n.allowDangerousHtml||n.allowDangerousHTML,c={};return m.dangerous=a,m.definition=u(i),m.footnoteById=c,m.footnoteOrder=[],m.augment=d,m.handlers=Object.assign({},h,n.handlers),m.unknownHandler=n.unknownHandler,m.passThrough=n.passThrough,o(i,"footnoteDefinition",function(i){var r=String(i.identifier).toUpperCase();f.call(c,r)||(c[r]=i)}),m;function d(i,r){var n,a;return i&&i.data&&((n=i.data).hName&&("element"!==r.type&&(r={type:"element",tagName:"",properties:{},children:[]}),r.tagName=n.hName),"element"===r.type&&n.hProperties&&(r.properties=Object.assign({},r.properties,n.hProperties)),r.children&&n.hChildren&&(r.children=n.hChildren)),l(a=i&&i.position?i:{position:i})||(r.position={start:s.start(a),end:s.end(a)}),r}function m(i,r,n,a){return null==a&&"object"==typeof n&&"length"in n&&(a=n,n={}),d(i,{type:"element",tagName:r,properties:n||{},children:a||[]})}}(i,r),m=c(n,i),g=d(n);return g&&(m.children=m.children.concat(a("text","\n"),g)),m};var a=i.r(663448),o=i.r(163420),s=i.r(579241),l=i.r(813361),u=i.r(720556),c=i.r(574944),d=i.r(335207),h=i.r(6081),f={}.hasOwnProperty,p=!1},395787,(i,r,n)=>{"use strict";r.exports=i.r(892693)},389741,(i,r,n)=>{"use strict";var a=i.r(395787);r.exports=function(i,r){var n,o,s;return i&&!i.process&&(r=i,i=null),i?(n=i,o=r,function(i,r,s){n.run(a(i,o),r,function(i){s(i)})}):(s=r,function(i){return a(i,s)})}},843088,(i,r,n)=>{r.exports=function(){for(var i={},r=0;r<arguments.length;r++){var n=arguments[r];for(var o in n)a.call(n,o)&&(i[o]=n[o])}return i};var a=Object.prototype.hasOwnProperty},299637,(i,r,n)=>{"use strict";r.exports=o;var a=o.prototype;function o(i,r,n){this.property=i,this.normal=r,n&&(this.space=n)}a.space=null,a.normal={},a.property={}},478726,(i,r,n)=>{"use strict";var a=i.r(843088),o=i.r(299637);r.exports=function(i){for(var r,n,s=i.length,l=[],u=[],c=-1;++c<s;)r=i[c],l.push(r.property),u.push(r.normal),n=r.space;return new o(a.apply(null,l),a.apply(null,u),n)}},123585,(i,r,n)=>{"use strict";r.exports=function(i){return i.toLowerCase()}},424285,(i,r,n)=>{"use strict";r.exports=o;var a=o.prototype;function o(i,r){this.property=i,this.attribute=r}a.space=null,a.attribute=null,a.property=null,a.boolean=!1,a.booleanish=!1,a.overloadedBoolean=!1,a.number=!1,a.commaSeparated=!1,a.spaceSeparated=!1,a.commaOrSpaceSeparated=!1,a.mustUseProperty=!1,a.defined=!1},908285,(i,r,n)=>{"use strict";var a=0;function o(){return Math.pow(2,++a)}n.boolean=o(),n.booleanish=o(),n.overloadedBoolean=o(),n.number=o(),n.spaceSeparated=o(),n.commaSeparated=o(),n.commaOrSpaceSeparated=o()},825096,(i,r,n)=>{"use strict";var a=i.r(424285),o=i.r(908285);r.exports=u,u.prototype=new a,u.prototype.defined=!0;var s=["boolean","booleanish","overloadedBoolean","number","commaSeparated","spaceSeparated","commaOrSpaceSeparated"],l=s.length;function u(i,r,n,u){var c,d,h,f,p,m,g=-1;for(c=this,(d=u)&&(c.space=d),a.call(this,i,r);++g<l;){h=this,f=m=s[g],(p=(n&o[m])===o[m])&&(h[f]=p)}}},846988,(i,r,n)=>{"use strict";var a=i.r(123585),o=i.r(299637),s=i.r(825096);r.exports=function(i){var r,n,l=i.space,u=i.mustUseProperty||[],c=i.attributes||{},d=i.properties,h=i.transform,f={},p={};for(r in d)n=new s(r,h(c,r),d[r],l),-1!==u.indexOf(r)&&(n.mustUseProperty=!0),f[r]=n,p[a(r)]=r,p[a(n.attribute)]=r;return new o(f,p,l)}},888471,(i,r,n)=>{"use strict";r.exports=i.r(846988)({space:"xlink",transform:function(i,r){return"xlink:"+r.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}})},655352,(i,r,n)=>{"use strict";r.exports=i.r(846988)({space:"xml",transform:function(i,r){return"xml:"+r.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}})},491064,(i,r,n)=>{"use strict";r.exports=function(i,r){return r in i?i[r]:r}},664861,(i,r,n)=>{"use strict";var a=i.r(491064);r.exports=function(i,r){return a(i,r.toLowerCase())}},952585,(i,r,n)=>{"use strict";r.exports=i.r(846988)({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:i.r(664861),properties:{xmlns:null,xmlnsXLink:null}})},65435,(i,r,n)=>{"use strict";var a=i.r(908285),o=i.r(846988),s=a.booleanish,l=a.number,u=a.spaceSeparated;r.exports=o({transform:function(i,r){return"role"===r?r:"aria-"+r.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:s,ariaAutoComplete:null,ariaBusy:s,ariaChecked:s,ariaColCount:l,ariaColIndex:l,ariaColSpan:l,ariaControl
119s:u,ariaCurrent:null,ariaDescribedBy:u,ariaDetails:null,ariaDisabled:s,ariaDropEffect:u,ariaErrorMessage:null,ariaExpanded:s,ariaFlowTo:u,ariaGrabbed:s,ariaHasPopup:null,ariaHidden:s,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:u,ariaLevel:l,ariaLive:null,ariaModal:s,ariaMultiLine:s,ariaMultiSelectable:s,ariaOrientation:null,ariaOwns:u,ariaPlaceholder:null,ariaPosInSet:l,ariaPressed:s,ariaReadOnly:s,ariaRelevant:null,ariaRequired:s,ariaRoleDescription:u,ariaRowCount:l,ariaRowIndex:l,ariaRowSpan:l,ariaSelected:s,ariaSetSize:l,ariaSort:null,ariaValueMax:l,ariaValueMin:l,ariaValueNow:l,ariaValueText:null,role:null}})},961315,(i,r,n)=>{"use strict";var a=i.r(908285),o=i.r(846988),s=i.r(664861),l=a.boolean,u=a.overloadedBoolean,c=a.booleanish,d=a.number,h=a.spaceSeparated,f=a.commaSeparated;r.exports=o({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:s,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:f,acceptCharset:h,accessKey:h,action:null,allow:null,allowFullScreen:l,allowPaymentRequest:l,allowUserMedia:l,alt:null,as:null,async:l,autoCapitalize:null,autoComplete:h,autoFocus:l,autoPlay:l,capture:l,charSet:null,checked:l,cite:null,className:h,cols:d,colSpan:null,content:null,contentEditable:c,controls:l,controlsList:h,coords:d|f,crossOrigin:null,data:null,dateTime:null,decoding:null,default:l,defer:l,dir:null,dirName:null,disabled:l,download:u,draggable:c,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:l,formTarget:null,headers:h,height:d,hidden:l,high:d,href:null,hrefLang:null,htmlFor:h,httpEquiv:h,id:null,imageSizes:null,imageSrcSet:f,inputMode:null,integrity:null,is:null,isMap:l,itemId:null,itemProp:h,itemRef:h,itemScope:l,itemType:h,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:l,low:d,manifest:null,max:null,maxLength:d,media:null,method:null,min:null,minLength:d,multiple:l,muted:l,name:null,nonce:null,noModule:l,noValidate:l,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextMenu:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:l,optimum:d,pattern:null,ping:h,placeholder:null,playsInline:l,poster:null,preload:null,readOnly:l,referrerPolicy:null,rel:h,required:l,reversed:l,rows:d,rowSpan:d,sandbox:h,scope:null,scoped:l,seamless:l,selected:l,shape:null,size:d,sizes:null,slot:null,span:d,spellCheck:c,src:null,srcDoc:null,srcLang:null,srcSet:f,start:d,step:null,style:null,tabIndex:d,target:null,title:null,translate:null,type:null,typeMustMatch:l,useMap:null,value:c,width:d,wrap:null,align:null,aLink:null,archive:h,axis:null,background:null,bgColor:null,border:d,borderColor:null,bottomMargin:d,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:l,declare:l,event:null,face:null,frame:null,frameBorder:null,hSpace:d,leftMargin:d,link:null,longDesc:null,lowSrc:null,marginHeight:d,marginWidth:d,noResize:l,noHref:l,noShade:l,noWrap:l,object:null,profile:null,prompt:null,rev:null,rightMargin:d,rules:null,scheme:null,scrolling:c,standby:null,summary:null,text:null,topMargin:d,valueType:null,version:null,vAlign:null,vLink:null,vSpace:d,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:l,disableRemotePlayback:l,prefix:null,property:null,results:d,security:null,unselectable:null}})},367214,(i,r,n)=>{"use strict";var a=i.r(478726),o=i.r(888471);r.exports=a([i.r(655352),o,i.r(952585),i.r(65435),i.r(961315)])},182447,(i,r,n)=>{let a=i.r(163420);
119r.exports=function(i){if(i.allowedElements&&i.disallowedElements)throw TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(i.allowedElements||i.disallowedElements||i.allowElement)return i=>{a(i,"element",r)};function r(r,n,a){let o;if(i.allowedElements?o=!i.allowedElements.includes(r.tagName):i.disallowedElements&&(o=i.disallowedElements.includes(r.tagName)),!o&&i.allowElement&&"number"==typeof n&&(o=!i.allowElement(r,n,a)),o&&"number"==typeof n)return i.unwrapDisallowed&&r.children?a.children.splice(n,1,...r.children):a.children.splice(n,1),n}}},461480,(i,r,n)=>{let a=["http","https","mailto","tel"];r.exports=function(i){let r=(i||"").trim(),n=r.charAt(0);if("#"===n||"/"===n)return r;let o=r.indexOf(":");if(-1===o)return r;let s=-1;for(;++s<a.length;){let i=a[s];if(o===i.length&&r.slice(0,i.length).toLowerCase()===i)return r}return -1!==(s=r.indexOf("?"))&&o>s||-1!==(s=r.indexOf("#"))&&o>s?r:"javascript:void(0)"}},895888,(i,r,n)=>{"use strict";var a=60103,o=60106,s=60107,l=60108,u=60114,c=60109,d=60110,h=60112,f=60113,p=60120,m=60115,g=60116,_=60121,y=60122,v=60117,x=60129,b=60131;if("function"==typeof Symbol&&Symbol.for){var w=Symbol.for;a=w("react.element"),o=w("react.portal"),s=w("react.fragment"),l=w("react.strict_mode"),u=w("react.profiler"),c=w("react.provider"),d=w("react.context"),h=w("react.forward_ref"),f=w("react.suspense"),p=w("react.suspense_list"),m=w("react.memo"),g=w("react.lazy"),_=w("react.block"),y=w("react.server.block"),v=w("react.fundamental"),x=w("react.debug_trace_mode"),b=w("react.legacy_hidden")}function T(i){if("object"==typeof i&&null!==i){var r=i.$$typeof;switch(r){case a:switch(i=i.type){case s:case u:case l:case f:case p:return i;default:switch(i=i&&i.$$typeof){case d:case h:case g:case m:case c:return i;default:return r}}case o:return r}}}var E=c,S=a,A=h,C=s,I=g,k=m,R=o,M=u,L=l,P=f;n.ContextConsumer=d,n.ContextProvider=E,n.Element=S,n.ForwardRef=A,n.Fragment=C,n.Lazy=I,n.Memo=k,n.Portal=R,n.Profiler=M,n.StrictMode=L,n.Suspense=P,n.isAsyncMode=function(){return!1},n.isConcurrentMode=function(){return!1},n.isContextConsumer=function(i){return T(i)===d},n.isContextProvider=function(i){return T(i)===c},n.isElement=function(i){return"object"==typeof i&&null!==i&&i.$$typeof===a},n.isForwardRef=function(i){return T(i)===h},n.isFragment=function(i){return T(i)===s},n.isLazy=function(i){return T(i)===g},n.isMemo=function(i){return T(i)===m},n.isPortal=function(i){return T(i)===o},n.isProfiler=function(i){return T(i)===u},n.isStrictMode=function(i){return T(i)===l},n.isSuspense=function(i){return T(i)===f},n.isValidElementType=function(i){return"string"==typeof i||"function"==typeof i||i===s||i===u||i===x||i===l||i===f||i===p||i===b||"object"==typeof i&&null!==i&&(i.$$typeof===g||i.$$typeof===m||i.$$typeof===c||i.$$typeof===d||i.$$typeof===h||i.$$typeof===v||i.$$typeof===_||i[0]===y)||!1},n.typeOf=T},935768,(i,r,n)=>{"use strict";r.exports=i.r(895888)},339522,(i,r,n)=>{"use strict";var a=i.r(908285),o=i.r(846988),s=i.r(491064),l=a.boolean,u=a.number,c=a.spaceSeparated,d=a.commaSeparated,h=a.commaOrSpaceSeparated;r.exports=o({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav
119-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:s,properties:{about:h,accentHeight:u,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:u,amplitude:u,arabicForm:null,ascent:u,attributeName:null,attributeType:null,azimuth:u,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:u,by:null,calcMode:null,capHeight:u,className:c,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:u,diffuseConstant:u,direction:null,display:null,dur:null,divisor:u,dominantBaseline:null,download:l,dx:null,dy:null,edgeMode:null,editable:null,elevation:u,enableBackground:null,end:null,event:null,exponent:u,externalResourcesRequired:null,fill:null,fillOpacity:u,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:d,g2:d,glyphName:d,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:u,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:u,horizOriginX:u,horizOriginY:u,id:null,ideographic:u,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:u,k:u,k1:u,k2:u,k3:u,k4:u,kernelMatrix:h,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:u,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:u,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,on
119Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:u,overlineThickness:u,paintOrder:null,panose1:null,path:null,pathLength:u,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:c,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:u,pointsAtY:u,pointsAtZ:u,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:h,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:h,rev:h,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:h,requiredFeatures:h,requiredFonts:h,requiredFormats:h,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:u,specularExponent:u,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:u,strikethroughThickness:u,string:null,stroke:null,strokeDashArray:h,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:u,strokeOpacity:u,strokeWidth:null,style:null,surfaceScale:u,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:h,tabIndex:u,tableValues:null,target:null,targetX:u,targetY:u,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:h,to:null,transform:null,u1:null,u2:null,underlinePosition:u,underlineThickness:u,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:u,values:null,vAlphabetic:u,vMathematical:u,vectorEffect:null,vHanging:u,vIdeographic:u,version:null,vertAdvY:u,vertOriginX:u,vertOriginY:u,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:u,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}})},89287,(i,r,n)=>{"use strict";var a=i.r(478726),o=i.r(888471);r.exports=a([i.r(655352),o,i.r(952585),i.r(65435),i.r(339522)])},907972,(i,r,n)=>{"use strict";var a=i.r(123585),o=i.r(825096),s=i.r(424285),l="data";r.exports=function(i,r){var n,p,m,g=a(r),_=r,y=s;return g in i.normal?i.property[i.normal[g]]:(g.length>4&&g.slice(0,4)===l&&u.test(r)&&("-"===r.charAt(4)?_=l+(n=r.slice(5).replace(c,f)).charAt(0).toUpperCase()+n.slice(1):(m=(p=r).slice(4),r=c.test(m)?p:("-"!==(m=m.replace(d,h)).charAt(0)&&(m="-"+m),l+m)),y=o),new y(_,r))};var u=/^data[-\w.:]+$/i,c=/-[a-z]/g,d=/[A-Z]/g;function h(i){return"-"+i.toLowerCase()}function f(i){return i.charAt(1).toUpperCase()}},515702,(i,r,n)=>{r.exports={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"}},956681,(i,r,n)=>{"use strict";n.parse=function(i){var r=String(i||"").trim();return""===r?[]:r.split(a)},n.stringify=function(i){return i.join(" ").trim()};var a=/[ \t\n\r\f]+/g},148325,(i,r,n)=>{"use strict";n.parse=function(i){for(var r,n=[],a=String(i||""),o=a.indexOf(","),s=0,l=!1;!l;)-1===o&&(o=a.length,l=!0),((r=a.slice(s,o).trim())||!l)&&n.push(r),s=o+1,o=a.indexOf(",",s);return n},n.stringify=function(i,r){var n=r||{},a=!1===n.padLeft?"":" ",o=n.padRight?" ":"";return""===i[i.length-1]&&(i=i.concat("")),i.join(o+","+a).trim()}},162510,(i,r,n)=>{var a=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,o=/\n/g,s=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,h=/^\s+|\s+$/g;function f(i){return i?i.replace(h,""):""}r.exports=function(i,r){if("string"!=typeof i)throw TypeError("First argument must be a string");if(!i)return[];r=r||{};var n=1,h=1;function p(i){var r=i.match(o);r&&(n+=r.length);var a=i.lastIndexOf("\n");h=~a?i.length-a:h+i.length}function m(){var i={line:n,column:h};return function(r){return r.position=new g(i),v(s),r}}function g(i){this.start=i,this.end={line:n,column:h},this.source=r.source}g.prototype.content=i;var _=[];function y(a){var o=Error(r.source+":"+n+":"+h+": "+a);if(o.reason=a,o.filename=r.source,o.line=n,o.column=h,o.source=i,r.silent)_.push(o);else throw o}function v(r){var n=r.exec(i);if(n){var a=n[0];return p(a),i=i.slice(a.length),n}}function x(i){var r;for(i=i||[];r=b();)!1!==r&&i.push(r);return i}function b(){var r=m();if("/"==i.charAt(0)&&"*"==i.charAt(1)){for(var n=2;""!=i.charAt(n)&&("*"!=i.charAt(n)||"/"!=i.charAt(n+1));)++n;if(n+=2,""===i.charAt(n-1))return y("End of comment missing");var a=i.slice(2,n-2);return h+=2,p(a),i=i.slice(n),h+=2,r({type:"comment",comment:a})}}v(s);var w,T=[];for(x(T);w=function(){var i=m(),r=v(l);if(r){if(b(),!v(u))return y("property missing ':'");var n=v(c),o=i({type:"declaration",property:f(r[0].replace(a,"")),value:n?f(n[0].replace(a,"")):""});
119return v(d),o}}();)!1!==w&&(T.push(w),x(T));return T}},936345,(i,r,n)=>{var a=i.r(162510);r.exports=function(i,r){var n,o,s,l=null;if(!i||"string"!=typeof i)return l;for(var u=a(i),c="function"==typeof r,d=0,h=u.length;d<h;d++)o=(n=u[d]).property,s=n.value,c?r(o,s,n):s&&(l||(l={}),l[o]=s);return l}},594089,(i,r,n)=>{"use strict";let a=i.r(2317),o=i.r(935768),s=i.r(89287),l=i.r(907972),u=i.r(515702),c=i.r(956681),d=i.r(148325),h=i.r(936345);n.hastToReact=g,n.hastChildrenToReact=m;let f={}.hasOwnProperty,p=new Set(["table","thead","tbody","tfoot","tr"]);function m(i,r){let n,a=[],o=-1;for(;++o<r.children.length;)"element"===(n=r.children[o]).type?a.push(g(i,n,o,r)):"text"===n.type?"element"===r.type&&p.has(r.tagName)&&"\n"===n.value||a.push(n.value):"raw"!==n.type||i.options.skipHtml||a.push(n.value);return a}function g(i,r,n,p){var g;let v,x=i.options,b=i.schema,w=r.tagName,T={};if("html"===b.space&&"svg"===w&&(i.schema=s),r.properties)for(v in r.properties)f.call(r.properties,v)&&function(i,r,n,a){let o=l(a.schema,r),s=n;null!=s&&s==s&&(s&&"object"==typeof s&&"length"in s&&(s=(o.commaSeparated?d:c).stringify(s)),"style"===o.property&&"string"==typeof s&&(s=function(i){let r={};try{h(i,function(i,n){r[("-ms-"===i.slice(0,4)?`ms-${i.slice(4)}`:i).replace(/-([a-z])/g,y)]=n})}catch(i){}return r}(s)),o.space&&o.property?i[f.call(u,o.property)?u[o.property]:o.property]=s:o.attribute&&(i[o.attribute]=s))}(T,v,r.properties[v],i);("ol"===w||"ul"===w)&&i.listDepth++;let E=m(i,r);("ol"===w||"ul"===w)&&i.listDepth--,i.schema=b;let S=r.position||{start:{line:null,column:null,offset:null},end:{line:null,column:null,offset:null}},A=x.components&&f.call(x.components,w)?x.components[w]:w,C="string"==typeof A||A===a.Fragment;if(!o.isValidElementType(A))throw TypeError(`Component for name \`${w}\` not defined or is not renderable`);if(T.key=[w,S.start.line,S.start.column,n].join("-"),"a"===w&&x.linkTarget&&(T.target="function"==typeof x.linkTarget?x.linkTarget(T.href,r.children,T.title):x.linkTarget),"a"===w&&x.transformLinkUri&&(T.href=x.transformLinkUri(T.href,r.children,T.title)),C||"code"!==w||"element"!==p.type||"pre"===p.tagName||(T.inline=!0),C||"h1"!==w&&"h2"!==w&&"h3"!==w&&"h4"!==w&&"h5"!==w&&"h6"!==w||(T.level=parseInt(w.charAt(1),10)),"img"===w&&x.transformImageUri&&(T.src=x.transformImageUri(T.src,T.alt,T.title)),!C&&"li"===w&&"element"===p.type){let i=function(i){let r=-1;for(;++r<i.children.length;){let n=i.children[r];if("element"===n.type&&"input"===n.tagName)return n}return null}(r);T.checked=i&&i.properties?!!i.properties.checked:null,T.index=_(p,r),T.ordered="ol"===p.tagName}return C||"ol"!==w&&"ul"!==w||(T.ordered="ol"===w,T.depth=i.listDepth),("td"===w||"th"===w)&&(T.align&&(T.style||(T.style={}),T.style.textAlign=T.align,delete T.align),C||(T.isHeader="th"===w)),C||"tr"!==w||"element"!==p.type||(T.isHeader="thead"===p.tagName),x.sourcePos&&(T["data-sourcepos"]=[(g=S).start.line,":",g.start.column,"-",g.end.line,":",g.end.column].map(i=>String(i)).join("")),!C&&x.rawSourcePos&&(T.sourcePosition=r.position),!C&&x.includeElementIndex&&(T.index=_(p,r),T.siblingCount=_(p)),C||(T.node=r),E.length>0?a.createElement(A,T,E):a.createElement(A,T)}function _(i,r){let n=-1,a=0;for(;++n<i.children.length&&i.children[n]!==r;)"element"===i.children[n].type&&a++;return a}function y(i,r){return r.toUpperCase()}},847548,(i,r,n)=>{"use strict";let a=i.r(2317),o=i.r(761175),s=i.r(822357),l=i.r(402028),u=i.r(389741),c=i.r(537904),d=i.r(367214),h=i.r(182447),f=i.r(461480),p=i.r(594089).hastChildrenToReact;r.exports=_;let m={}.hasOwnProperty,g={renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function _(i){let r;for(let r in g)if(m.call(g,r)&&m.call(i,r)){let i=g[r];console.warn(`[react-markdown] Warning: please ${i.to?`use \`${i.to}\` instead of`:"remove"} \`${r}\` (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#${i.id}> for more info)`),delete g[r]}let n=s().use(l).use(i.remarkPlugins||i.plugins||[]).use(u,{allowDangerousHtml:!0}).use(i.rehypePlugins||[]).use(h,i);"string"==typeof i.children?r=o(i.children):(void 0!==i.children&&null!==i.children&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${i.children}\`)`),r=o());let c=n.runSync(n.parse(r),r);if("root"!==c.type)throw TypeError("Expected a `root` node");let f=a.createElement(a.Fragment,{},p({options:i,schema:d,listDepth:0},c));return i.className&&(f=a.createElement("div",{className:i.className},f)),f}_.defaultProps={transformLinkUri:f},_.propTypes={children:c.string,className:c.string,allowElement:c.func,allowedElements:c.arrayOf(c.string),disallowedElements:c.arrayOf(c.string),unwrapDisallowed:c.bool,remarkPlugins:c.arrayOf(c.oneOfType([c.object,c.func,c.arrayOf(c.oneOfType([c.object,c.func]))])),rehypePlugins:c.arrayOf(c.oneOfType([c.object,c.func,c.arrayOf(c.oneOfType([c.object,c.func]))])),sourcePos:c.bool,rawSourcePos:c.bool,ski
119pHtml:c.bool,includeElementIndex:c.bool,transformLinkUri:c.oneOfType([c.func,c.bool]),linkTarget:c.oneOfType([c.func,c.string]),transformImageUri:c.func,components:c.object},_.uriTransformer=f},289381,(i,r,n)=>{var a=i.r(327944),o=i.r(956009),s=i.r(436218),l=i.r(669275),u=i.r(240196),c=i.r(214856),d={tokenize:function(i,r,n){return function(r){return i.consume(r),a};function a(r){return 87===r||r-32==87?(i.consume(r),o):n(r)}function o(r){return 87===r||r-32==87?(i.consume(r),s):n(r)}function s(r){return 46===r?(i.consume(r),u):n(r)}function u(i){return null===i||l(i)?n(i):r(i)}},partial:!0},h={tokenize:function(i,r,n){var a,o;return l;function l(r){return 38===r?i.check(m,h,d)(r):46===r||95===r?i.check(p,h,d)(r):s(r)||c(r)||45!==r&&u(r)?h(r):(i.consume(r),l)}function d(r){return 46===r?(o=a,a=void 0):95===r&&(a=!0),i.consume(r),l}function h(i){return o||a?n(i):r(i)}},partial:!0},f={tokenize:function(i,r){var n=0;return a;function a(l){return 38===l?i.check(m,r,o)(l):(40===l&&n++,41===l)?i.check(p,s,o)(l):w(l)?r(l):b(l)?i.check(p,r,o)(l):(i.consume(l),a)}function o(r){return i.consume(r),a}function s(i){return--n<0?r(i):o(i)}},partial:!0},p={tokenize:function(i,r,n){return function(r){return i.consume(r),a};function a(o){return b(o)?(i.consume(o),a):w(o)?r(o):n(o)}},partial:!0},m={tokenize:function(i,r,n){return function(r){return i.consume(r),o};function o(r){return a(r)?(i.consume(r),o):59===r?(i.consume(r),s):n(r)}function s(i){return w(i)?r(i):n(i)}},partial:!0},g={tokenize:function(i,r,n){var a=this;return function(r){return 87!==r&&r-32!=87||!E(a.previous)||C(a.events)?n(r):(i.enter("literalAutolink"),i.enter("literalAutolinkWww"),i.check(d,i.attempt(h,i.attempt(f,o),n),n)(r))};function o(n){return i.exit("literalAutolinkWww"),i.exit("literalAutolink"),r(n)}},previous:E},_={tokenize:function(i,r,n){var a=this;return function(r){return 72!==r&&r-32!=72||!S(a.previous)||C(a.events)?n(r):(i.enter("literalAutolink"),i.enter("literalAutolinkHttp"),i.consume(r),o)};function o(r){return 84===r||r-32==84?(i.consume(r),l):n(r)}function l(r){return 84===r||r-32==84?(i.consume(r),d):n(r)}function d(r){return 80===r||r-32==80?(i.consume(r),p):n(r)}function p(r){return 83===r||r-32==83?(i.consume(r),m):m(r)}function m(r){return 58===r?(i.consume(r),g):n(r)}function g(r){return 47===r?(i.consume(r),_):n(r)}function _(r){return 47===r?(i.consume(r),y):n(r)}function y(r){return s(r)||c(r)||u(r)?n(r):i.attempt(h,i.attempt(f,v),n)(r)}function v(n){return i.exit("literalAutolinkHttp"),i.exit("literalAutolink"),r(n)}},previous:S},y={tokenize:function(i,r,n){var a,s=this;return function(r){return!T(r)||!A(s.previous)||C(s.events)?n(r):(i.enter("literalAutolink"),i.enter("literalAutolinkEmail"),function r(a){return T(a)?(i.consume(a),r):64===a?(i.consume(a),l):n(a)}(r))};function l(r){return 46===r?i.check(p,h,u)(r):45===r||95===r?i.check(p,n,c)(r):o(r)?(i.consume(r),l):h(r)}function u(r){return i.consume(r),a=!0,l}function c(r){return i.consume(r),d}function d(r){return 46===r?i.check(p,n,u)(r):l(r)}function h(o){return a?(i.exit("literalAutolinkEmail"),i.exit("literalAutolink"),r(o)):n(o)}},previous:A},v={};n.text=v;for(var x=48;x<123;)v[x]=y,58==++x?x=65:91===x&&(x=97);function b(i){return 33===i||34===i||39===i||41===i||42===i||44===i||46===i||58===i||59===i||60===i||63===i||95===i||126===i}function w(i){return null===i||i<0||32===i||60===i}function T(i){return 43===i||45===i||46===i||95===i||o(i)}function E(i){return null===i||i<0||32===i||40===i||42===i||95===i||126===i}function S(i){return null===i||!a(i)}function A(i){return 47!==i&&S(i)}function C(i){for(var r=i.length;r--;)if(("labelLink"===i[r][1].type||"labelImage"===i[r][1].type)&&!i[r][1]._balanced)return!0}v[43]=y,v[45]=y,v[46]=y,v[95]=y,v[72]=[y,_],v[104]=[y,_],v[87]=[y,g],v[119]=[y,g]},447784,(i,r,n)=>{r.exports=i.r(289381)},3301,(i,r,n)=>{r.exports=function(i){var r=(i||{}).singleTilde,n={tokenize:function(i,n,o){var s=this.previous,l=this.events,u=0;return function(c){return 126!==c||126===s&&"characterEscape"!==l[l.length-1][1].type?o(c):(i.enter("strikethroughSequenceTemporary"),function l(c){var d,h,f=a(s);return 126===c?u>1?o(c):(i.consume(c),u++,l):u<2&&!r?o(c):((d=i.exit("strikethroughSequenceTemporary"))._open=!(h=a(c))||2===h&&f,d._close=!f||2===f&&h,n(c))}(c))}},resolveAll:function(i,r){for(var n,a,u,c,d=-1;++d<i.length;)if("enter"===i[d][0]&&"strikethroughSequenceTemporary"===i[d][1].type&&i[d][1]._close){for(u=d;u--;)if("exit"===i[u][0]&&"strikethroughSequenceTemporary"===i[u][1].type&&i[u][1]._open&&i[d][1].end.offset-i[d][1].start.offset==i[u][1].end.offset-i[u][1].start.offset){i[d][1].type="strikethroughSequence",i[u][1].type="strikethroughSequence",n={type:"strikethrough",start:l(i[u][1].start),end:l(i[d][1].end)},a={type:"strikethroughText",start:l(i[u][1].end),end:l(i[d][1].start)},o(c=[["enter",n,r],["enter",i[u][1],r],["exit",i[u][1],r],["enter",a,r]],c.length,0,s(r.parser.constructs.insideSpan.null,i.slice(u+1,d),r)),o(c,c.length,0,[["exit",a,r],["enter",i[d][1],r],["exit",i[d][1],r],["exit",n,r]]),o(i,u-1,d-u+3,c),d=u+c.length-2;break}}for(var h=i,f=-1,p=h.length;++f<p;)"strikethroughSequenceTemporary"===h[f][1].type&&(h[f][1].type="data");return h}};return null==r&&(r=!0),{text:{126:n},insideSpan:{null:n}}};var a=i.r(886854),o=i.r(793315),s=i.r(299388),l=i.r(733902)},325960,(i,r,n)=>{n.flow={null:{tokenize:function(i,r,n){var l,u,c=[],d=0;return function(r){return null===r||-5===r||-4===r||-3===r?n(r):(i.enter("table")._align=c,i.enter("tableHead"),i.enter("tableRow"),124===r)?h(r):(d++,i.enter("temporaryTableCellContent"),m(r))};function h(r){return i.enter("tableCellDivider"),i.consume(r),i.exit("tableCellDivider"),l=!0,f}function f(r){var s;return null===r||-5===r||-4===r||-3===r?null===(s=r)?n(s):(i.exit("tableRow"),i.exit("tableHead"),i.enter("lineEnding"),i.consume(s),i.exit("lineEnding"),i.check(o,n,a(i,_,"linePrefix",4))):-2===r||-1===r||32===r?(i.enter("whitespace"),i.consume(r),p):(l&&(l=void 0,d++),124===r)?h(r):(i.enter("temporaryTableCellContent"),m(r))}function p(r){return -2===r||-1===r||32===r?(i.consume(r),p):(i.exit("whitespace"),f(r))}function m(r){return null===r||r<0||32===r||124===r?(i.exit("temporaryTableCellContent"),f(r)):(i.consume(r),92===r?g:m)}function g(r){return 92===r||124===r?(i.consume(r),m):m(r)}function _(r){return null===r||r<0||32===r?n(r):(i.enter("tableDelimiterRow"),y(r))}function y(r){return null===r||-5===r||-4===r||-3===r?T(r):-2===r||-1===r||32===r?(i.enter("whitespace"),i.consume(r),v):45===r?(i.enter("tableDelimiterFiller"),i.consume(r),u=!0,c.push(null),x):58===r?(i.enter("tableDelimiterAlignment"),i.c
119onsume(r),i.exit("tableDelimiterAlignment"),c.push("left"),b):124===r?(i.enter("tableCellDivider"),i.consume(r),i.exit("tableCellDivider"),y):n(r)}function v(r){return -2===r||-1===r||32===r?(i.consume(r),v):(i.exit("whitespace"),y(r))}function x(r){return 45===r?(i.consume(r),x):(i.exit("tableDelimiterFiller"),58===r)?(i.enter("tableDelimiterAlignment"),i.consume(r),i.exit("tableDelimiterAlignment"),c[c.length-1]="left"===c[c.length-1]?"center":"right",w):y(r)}function b(r){return 45===r?(i.enter("tableDelimiterFiller"),i.consume(r),u=!0,x):n(r)}function w(r){return null===r||-5===r||-4===r||-3===r?T(r):-2===r||-1===r||32===r?(i.enter("whitespace"),i.consume(r),v):124===r?(i.enter("tableCellDivider"),i.consume(r),i.exit("tableCellDivider"),y):n(r)}function T(r){return(i.exit("tableDelimiterRow"),u&&d===c.length)?null===r?E(r):i.check(s,E,S)(r):n(r)}function E(n){return i.exit("table"),r(n)}function S(r){return i.enter("lineEnding"),i.consume(r),i.exit("lineEnding"),a(i,A,"linePrefix",4)}function A(r){return i.enter("tableBody"),C(r)}function C(r){return(i.enter("tableRow"),124===r)?I(r):(i.enter("temporaryTableCellContent"),M(r))}function I(r){return i.enter("tableCellDivider"),i.consume(r),i.exit("tableCellDivider"),k}function k(r){var n;return null===r||-5===r||-4===r||-3===r?(n=r,(i.exit("tableRow"),null===n)?P(n):i.check(s,P,O)(n)):-2===r||-1===r||32===r?(i.enter("whitespace"),i.consume(r),R):124===r?I(r):(i.enter("temporaryTableCellContent"),M(r))}function R(r){return -2===r||-1===r||32===r?(i.consume(r),R):(i.exit("whitespace"),k(r))}function M(r){return null===r||r<0||32===r||124===r?(i.exit("temporaryTableCellContent"),k(r)):(i.consume(r),92===r?L:M)}function L(r){return 92===r||124===r?(i.consume(r),M):M(r)}function P(r){return i.exit("tableBody"),E(r)}function O(r){return i.enter("lineEnding"),i.consume(r),i.exit("lineEnding"),a(i,C,"linePrefix",4)}},resolve:function(i,r){for(var n,a,o,s,l,u,c,d,h,f,p=i.length,m=-1;++m<p;)n=i[m][1],s&&("temporaryTableCellContent"===n.type&&(d=d||m,h=m),("tableCellDivider"===n.type||"tableRow"===n.type)&&h&&(c={type:"chunkText",start:(u={type:"tableContent",start:i[d][1].start,end:i[h][1].end}).start,end:u.end,contentType:"text"},i.splice(d,h-d+1,["enter",u,r],["enter",c,r],["exit",c,r],["exit",u,r]),m-=h-d-3,p=i.length,d=void 0,h=void 0)),"exit"===i[m][0]&&f&&f+1<m&&("tableCellDivider"===n.type||"tableRow"===n.type&&(f+3<m||"whitespace"!==i[f][1].type))&&(l={type:o?"tableDelimiter":a?"tableHeader":"tableData",start:i[f][1].start,end:i[m][1].end},i.splice(m+ +("tableCellDivider"===n.type),0,["exit",l,r]),i.splice(f,0,["enter",l,r]),m+=2,p=i.length,f=m+1),"tableRow"===n.type&&(s="enter"===i[m][0])&&(f=m+1),"tableDelimiterRow"===n.type&&(o="enter"===i[m][0])&&(f=m+1),"tableHead"===n.type&&(a="enter"===i[m][0]);return i},interruptible:!0}};var a=i.r(70881),o={tokenize:function(i,r,n){return function(a){return 45!==a?n(a):(i.enter("setextUnderline"),function a(o){return 45===o?(i.consume(o),a):function a(o){return -2===o||-1===o||32===o?(i.consume(o),a):null===o||-5===o||-4===o||-3===o?r(o):n(o)}(o)}(a))}},partial:!0},s={tokenize:function(i,r,n){var a=0;return function(r){return i.enter("check"),i.consume(r),o};function o(s){return -1===s||32===s?(i.consume(s),4==++a?r:o):null===s||s<0?r(s):n(s)}},partial:!0}},341508,(i,r,n)=>{r.exports=i.r(325960)},755847,(i,r,n)=>{var a=i.r(172605),o=i.r(70881),s=i.r(999570);function l(i,r,n){var l=this;return o(i,function(i){return s(l.events,"whitespace")&&null!==i&&!a(i)?r(i):n(i)},"whitespace")}n.text={91:{tokenize:function(i,r,n){var a=this;return function(r){return 91===r&&null===a.previous&&a._gfmTasklistFirstContentOfListItem?(i.enter("taskListCheck"),i.enter("taskListCheckMarker"),i.consume(r),i.exit("taskListCheckMarker"),o):n(r)};function o(r){return -2===r||32===r?(i.enter("taskListCheckValueUnchecked"),i.consume(r),i.exit("taskListCheckValueUnchecked"),s):88===r||120===r?(i.enter("taskListCheckValueChecked"),i.consume(r),i.exit("taskListCheckValueChecked"),s):n(r)}function s(a){return 93===a?(i.enter("taskListCheckMarker"),i.consume(a),i.exit("taskListCheckMarker"),i.exit("taskListCheck"),i.check({tokenize:l},r,n)):n(a)}}}}},256611,(i,r,n)=>{r.exports=i.r(755847)},939750,(i,r,n)=>{var a=i.r(90187),o=i.r(447784),s=i.r(3301),l=i.r(341508),u=i.r(256611);r.exports=function(i){return a([o,s(i),l,u])}},918705,(i,r,n)=>{r.exports=i.r(939750)},900929,(i,r,n)=>{"use strict";r.exports=function(i,r){var n,a=String(i),o=0;if("string"!=typeof r)throw Error("Expected character");for(n=a.indexOf(r);-1!==n;)o++,n=a.indexOf(r,n+r.length);return o}},926212,(i,r,n)=>{"use strict";r.exports=i=>{if("string"!=typeof i)throw TypeError("Expected a string");return i.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}},857461,(i,r,n)=>{"use strict";r.exports=function(i,r,n,a){var o,s;return"string"==typeof r||r&&"function"==typeof r.exec?s=[[r,n]]:(s=r,a=n),u(i,o=a||{},function i(r){var n=r[0];return function(a,s){var c,d,h,f,p=n[0],m=n[1],g=[],_=0,y=s.children.indexOf(a);for(p.lastIndex=0,d=p.exec(a.value);d&&(c=d.index,!1!==(f=m.apply(null,[].concat(d,{index:d.index,input:d.input})))&&(_!==c&&g.push({type:"text",value:a.value.slice(_,c)}),"string"==typeof f&&f.length>0&&(f={type:"text",value:f}),f&&(g=[].concat(g,f)),_=c+d[0].length),p.global);)d=p.exec(a.value);if(void 0===c?(g=[a],y--):(_<a.value.length&&g.push({type:"text",value:a.value.slice(_)}),g.unshift(y,1),l.apply(s.children,g)),r.length>1)for(h=i(r.slice(1)),c=-1;++c<g.length;)"text"===(a=g[c]).type?h(a,s):u(a,o,h);return y+g.length+1}}(function(i){var r,n,a=[];if("object"!=typeof i)throw Error("Expected array or object as schema");if("length"in i)for(n=-1;++n<i.length;)a.push([c(i[n][0]),d(i[n][1])]);else for(r in i)a.push([c(r),d(i[r])]);return a}(s))),i};var a=i.r(825592),o=i.r(635691),s=i.r(926212),l=[].splice;function u(i,r,n){var s=o(r.ignore||[]);return a(i,"text",function(i,r){for(var a,o,l=-1;++l<r.length;){if(s(a=r[l],o?o.children.indexOf(a):void 0,o))return;o=a}return n(i,o)}),[]}function c(i){return"string"==typeof i?RegExp(s(i),"g"):i}function d(i){return"function"==typeof i?i:function(){return i}}},112690,(i,r,n)=>{var a=i.r(900929),o=i.r(857461),s=i.r(240196),l=i.r(214856);function u(i){this.config.enter.autolinkProtocol.call(this,i)}function c(i,r,n,o,s){var l,u,c,d="";return!!h(s)&&(/^w/i.test(r)&&(n=r+n,r="",d="http://"),!((l=n.split(".")).length<2||l[l.length-1]&&(/_/.test(l[l.length-1])||!/[a-zA-Z\d]/.test(l[l.length-1]))||l[l.length-2]&&(/_/.test(l[l.length-2])||!/[a-zA-Z\d]/.test(l[l.length-2])))&&!!(u=function(i){var r,n,o,s=/[!"&'),.:;<>?\]}]+$/.exec(i);if(s)for(i=i.slice(0,s.index),r=(s=s[0]).indexOf(")"),n=a(i,"("),o=a(i,")");-1!==r&&n>o;)i+=s.slice(0,r+1),r=(s=s.slice(r+1)).indexOf(")"),o++;return[i,s]}(n+o))[0]&&(c={type:"link",title:null,url:d+r+u[0],children:[{type:"text",value:r+u[0]}]},u[1]&&(c=[c,{type:"text",value:u[1]}]),c))}function d(i,r,n,a){return!(!h(a,!0)||/[_-]$/.test(n))&&{type:"link",title:null,url:"mailto:"+r+"@"+n,children:[{type:"text",value:r+"@"+n}]}}function h(i,r){var n=i.input.charCodeAt(i.index-1);return(n!=n||l(n)||s(n))&&(!r||47!==n)}n.transforms=[function(i){o(i,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/i,c],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/,d]],{ignore:["link","linkReference"]})}],n.enter={literalAutolink:function(i){this.enter({type:"link",title:null,url:"",children:[]},i)},literalAutolinkEmail:u,literalAutolinkHttp:u,literalAutolinkWww:u},n.exit={literalAutolink:function(i){this.exit(i)},literalAutolinkEmail:function(i){this.config.exit.autolinkEmail.call(this,i)},literalAutolinkHttp:function(i){this.config.exit.autolinkProtocol.call(this,i)},literalAutolinkWww:function(i){this.config.exit.data.call(this,i),this.stack[this.stack.length-1].url="http://"+this.sliceSerialize(i)}}},968895,(i,r,n)=>{n.canContainEols=["delete"],n.enter={strikethrough:function(i){this.enter({type:"delete",children:[]},i)}},n.exit={strikethrough:function(i){this.exit(i)}}},351555,(i,r,n)=>{function a(i){this.exit(i)}function o(i){this.enter({type:"tableCell",children:[]},i)}function s(i,r){return"|"===r?r:i}n.enter={table:function(i){this.enter({type:"table",align:i._align,children:[]},i),this.setData("inTable",!0)},tableData:o,tableHeader:o,tableRow:function(i){this.enter({type:"tableRow",children:[]},i)}},n.exit={codeText:function(i){var r=this.resume();this.getData("inTable")&&(r=r.replace(/\\([\\|])/g,s)),this.stack[this.stack.length-1].value=r,this.exit(i)},table:function(i){this.exit(i),this.setData("inTable")},tableData:a,tableHeader:a,tableRow:a}},632472,(i,r,n)=>{function a(i){this.stack[this.stack.length-2].checked="taskListCheckValueChecked"===i.t
119ype}n.exit={taskListCheckValueChecked:a,taskListCheckValueUnchecked:a,paragraph:function(i){var r,n=this.stack[this.stack.length-2],a=this.stack[this.stack.length-1],o=n.children,s=a.children[0],l=-1;if(n&&"listItem"===n.type&&"boolean"==typeof n.checked&&s&&"text"===s.type){for(;++l<o.length;)if("paragraph"===o[l].type){r=o[l];break}r===a&&(s.value=s.value.slice(1),0===s.value.length?a.children.shift():(s.position.start.column++,s.position.start.offset++,a.position.start=Object.assign({},s.position.start)))}this.exit(i)}}},919890,(i,r,n)=>{var a=i.r(112690),o=i.r(968895),s=i.r(351555),l=i.r(632472),u={}.hasOwnProperty;r.exports=function(i){for(var r={transforms:[],canContainEols:[]},n=i.length,a=-1;++a<n;)!function(i,r){var n,a,o;for(n in r)a=u.call(i,n)?i[n]:i[n]={},o=r[n],"canContainEols"===n||"transforms"===n?i[n]=[].concat(a,o):Object.assign(a,o)}(r,i[a]);return r}([a,o,s,l])},487528,(i,r,n)=>{var a="phrasing",o=["autolink","link","image","label"];n.unsafe=[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:a,notInConstruct:o},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:a,notInConstruct:o},{character:":",before:"[ps]",after:"\\/",inConstruct:a,notInConstruct:o}]},156576,(i,r,n)=>{r.exports=function(i,r,n){for(var a,o,s,l=i.children||[],u=[],c=-1,d=n.before;++c<l.length;)s=l[c],c+1<l.length?((o=r.handle.handlers[l[c+1].type])&&o.peek&&(o=o.peek),a=o?o(l[c+1],i,r,{before:"",after:""}).charAt(0):""):a=n.after,u.length>0&&("\r"===d||"\n"===d)&&"html"===s.type&&(u[u.length-1]=u[u.length-1].replace(/(\r?\n|\r)$/," "),d=" "),u.push(r.handle(s,i,r,{before:d,after:a})),d=u[u.length-1].slice(-1);return u.join("")}},493889,(i,r,n)=>{var a=i.r(156576);function o(i,r,n){var o=n.enter("emphasis"),s=a(i,n,{before:"~",after:"~"});return o(),"~~"+s+"~~"}n.unsafe=[{character:"~",inConstruct:"phrasing"}],n.handlers={delete:o},o.peek=function(){return"~"}},930091,(i,r,n)=>{r.exports=function(i){var r,n;return i._compiled||(r=i.before?"(?:"+i.before+")":"",n=i.after?"(?:"+i.after+")":"",i.atBreak&&(r="[\\r\\n][\\t ]*"+r),i._compiled=RegExp((r?"("+r+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(i.character)?"\\":"")+i.character+(n||""),"g")),i._compiled}},437524,(i,r,n)=>{r.exports=o,o.peek=function(){return"`"};var a=i.r(930091);function o(i,r,n){for(var o,s,l,u,c=i.value||"",d="`",h=-1;RegExp("(^|[^`])"+d+"([^`]|$)").test(c);)d+="`";for(/[^ \r\n]/.test(c)&&(/[ \r\n`]/.test(c.charAt(0))||/[ \r\n`]/.test(c.charAt(c.length-1)))&&(c=" "+c+" ");++h<n.unsafe.length;)if((o=n.unsafe[h]).atBreak)for(s=a(o);l=s.exec(c);)u=l.index,10===c.charCodeAt(u)&&13===c.charCodeAt(u-1)&&u--,c=c.slice(0,u)+" "+c.slice(l.index+1);return d+c+d}},989277,(i,r,n)=>{"use strict";var a,o="";r.exports=function(i,r){if("string"!=typeof i)throw TypeError("expected a string");if(1===r)return i;if(2===r)return i+i;var n=i.length*r;if(a!==i||void 0===a)a=i,o="";else if(o.length>=n)return o.substr(0,n);for(;n>o.length&&r>1;)1&r&&(o+=i),r>>=1,i+=i;return o+=i,o=o.substr(0,n)}},853461,(i,r,n)=>{"use strict";var a=i.r(989277);r.exports=function(i,r){for(var n,u,c,d,h,f,p,m,g,_,y,v,x=r||{},b=!1!==x.padding,w=!1!==x.delimiterStart,T=!1!==x.delimiterEnd,E=(x.align||[]).concat(),S=!1!==x.alignDelimiters,A=[],C=x.stringLength||s,I=-1,k=i.length,R=[],M=[],L=[],P=[],O=[],D=0;++I<k;){for(u=i[I],c=-1,d=u.length,L=[],P=[],d>D&&(D=d);++c<d;){p=null==(n=u[c])?"":String(n),!0===S&&(f=C(p),P[c]=f,(void 0===(h=O[c])||f>h)&&(O[c]=f)),L.push(p)}R[I]=L,M[I]=P}if(c=-1,d=D,"object"==typeof E&&"length"in E)for(;++c<d;)A[c]=l(E[c]);else for(v=l(E);++c<d;)A[c]=v;for(c=-1,d=D,L=[],P=[];++c<d;)v=A[c],_="",y="",108===v?_=":":114===v?y=":":99===v&&(_=":",y=":"),f=S?Math.max(1,O[c]-_.length-y.length):1,p=_+a("-",f)+y,!0===S&&((f=_.length+f+y.length)>O[c]&&(O[c]=f),P[c]=f),L[c]=p;for(R.splice(1,0,L),M.splice(1,0,P),I=-1,k=R.length,m=[];++I<k;){for(L=R[I],P=M[I],c=-1,d=D,g=[];++c<d;)p=L[c]||"",_="",y="",!0===S&&(f=O[c]-(P[c]||0),114===(v=A[c])?_=a(" ",f):99===v?f%2==0?y=_=a(" ",f/2):(_=a(" ",f/2+.5),y=a(" ",f/2-.5)):y=a(" ",f)),!0===w&&0===c&&g.push("|"),!0===b&&(!1!==S||""!==p)&&(!0===w||0!==c)&&g.push(" "),!0===S&&g.push(_),g.push(p),!0===S&&g.push(y),!0===b&&g.push(" "),(!0===T||c!==d-1)&&g.push("|");g=g.join(""),!1===T&&(g=g.replace(o,"")),m.push(g)}return m.join("\n")};var o=/ +$/;function s(i){return i.length}
119function l(i){var r="string"==typeof i?i.charCodeAt(0):0;return 76===r||108===r?108:82===r||114===r?114:99*(67===r||99===r)}},938884,(i,r,n)=>{var a=i.r(156576),o=i.r(437524),s=i.r(853461);r.exports=function(i){var r=i||{},n=r.tableCellPadding,l=r.tablePipeAlign,u=r.stringLength,c=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:function(i,r,n){return h(function(i,r){for(var n=i.children,a=-1,o=n.length,s=[],l=r.enter("table");++a<o;)s[a]=f(n[a],r);return l(),s}(i,n),i.align)},tableRow:function(i,r,n){var a=h([f(i,n)]);return a.slice(0,a.indexOf("\n"))},tableCell:d,inlineCode:function(i,r,n){var a=o(i,r,n);return -1!==n.stack.indexOf("tableCell")&&(a=a.replace(/\|/g,"\\$&")),a}}};function d(i,r,n){var o=n.enter("tableCell"),s=a(i,n,{before:c,after:c});return o(),s}function h(i,r){return s(i,{align:r,alignDelimiters:l,padding:n,stringLength:u})}function f(i,r){for(var n=i.children,a=-1,o=n.length,s=[],l=r.enter("tableRow");++a<o;)s[a]=d(n[a],i,r);return l(),s}}},259346,(i,r,n)=>{r.exports=function(i){var r=i.options.bullet||"*";if("*"!==r&&"+"!==r&&"-"!==r)throw Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}},333228,(i,r,n)=>{r.exports=function(i){var r=i.options.listItemIndent||"tab";if(1===r||"1"===r)return"one";if("tab"!==r&&"one"!==r&&"mixed"!==r)throw Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}},82844,(i,r,n)=>{r.exports=function(i,r){for(var n,o=i.children||[],s=[],l=-1;++l<o.length;)n=o[l],s.push(r.handle(n,i,r,{before:"\n",after:"\n"})),l+1<o.length&&s.push(function(n,o){for(var s,l=-1;++l<r.join.length&&!0!==(s=r.join[l](n,o,i,r))&&1!==s;){if("number"==typeof s)return a("\n",1+Number(s));if(!1===s)return"\n\n<!---->\n\n"}return"\n\n"}(n,o[l+1]));return s.join("")};var a=i.r(989277)},675857,(i,r,n)=>{r.exports=function(i,r){for(var n,o=[],s=0,l=0;n=a.exec(i);)u(i.slice(s,n.index)),o.push(n[0]),s=n.index+n[0].length,l++;return u(i.slice(s)),o.join("");function u(i){o.push(r(i,l,!i))}};var a=/\r?\n|\r/g},977964,(i,r,n)=>{r.exports=function(i,r,n){var c,d,h,f=o(n),p=s(n);return r&&r.ordered&&(f=(r.start>-1?r.start:1)+(!1===n.options.incrementListMarker?0:r.children.indexOf(i))+"."),c=f.length+1,("tab"===p||"mixed"===p&&(r&&r.spread||i.spread))&&(c=4*Math.ceil(c/4)),h=n.enter("listItem"),d=u(l(i,n),function(i,r,n){return r?(n?"":a(" ",c))+i:(n?f:f+a(" ",c-f.length))+i}),h(),d};var a=i.r(989277),o=i.r(259346),s=i.r(333228),l=i.r(82844),u=i.r(675857)},428641,(i,r,n)=>{var a=i.r(977964);n.unsafe=[{atBreak:!0,character:"-",after:"[:|-]"}],n.handlers={listItem:function(i,r,n){var o=a(i,r,n),s=i.children[0];return"boolean"==typeof i.checked&&s&&"paragraph"===s.type&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(r){return r+"["+(i.checked?"x":" ")+"] "})),o}}},189846,(i,r,n)=>{r.exports=function i(r,n){var a,o=-1;if(n.extensions)for(;++o<n.extensions.length;)i(r,n.extensions[o]);for(a in n)"extensions"===a||("unsafe"===a||"join"===a?r[a]=r[a].concat(n[a]||[]):"handlers"===a?r[a]=Object.assign(r[a],n[a]||{}):r.options[a]=n[a]);return r}},740084,(i,r,n)=>{var a=i.r(487528),o=i.r(493889),s=i.r(938884),l=i.r(428641),u=i.r(189846);r.exports=function(i){var r=u({handlers:{},join:[],unsafe:[],options:{}},{extensions:[a,o,s(i),l]});return Object.assign(r.options,{handlers:r.handlers,join:r.join,unsafe:r.unsafe})}},630495,(i,r,n)=>{"use strict";var a,o=i.r(918705),s=i.r(919890),l=i.r(740084);r.exports=function(i){var r=this.data();function n(i,n){r[i]?r[i].push(n):r[i]=[n]}!a&&(this.Parser&&this.Parser.prototype&&this.Parser.prototype.blockTokenizers||this.Compiler&&this.Compiler.prototype&&this.Compiler.prototype.visitors)&&(a=!0,console.warn("[remark-gfm] Warning: please upgrade to remark 13 to use this plugin")),n("micromarkExtensions",o(i)),n("fromMarkdownExtensions",s),n("toMarkdownExtensions",l(i))}},567303,(i,r,n)=>{"use strict";let a=[65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];n.REPLACEMENT_CHARACTER="�",n.CODE_POINTS={EOF:-1,NULL:0,TABULATION:9,CARRIAGE_RETURN:13,LINE_FEED:10,FORM_FEED:12,SPACE:32,EXCLAMATION_MARK:33,QUOTATION_MARK:34,NUMBER_SIGN:35,AMPERSAND:38,APO
119STROPHE:39,HYPHEN_MINUS:45,SOLIDUS:47,DIGIT_0:48,DIGIT_9:57,SEMICOLON:59,LESS_THAN_SIGN:60,EQUALS_SIGN:61,GREATER_THAN_SIGN:62,QUESTION_MARK:63,LATIN_CAPITAL_A:65,LATIN_CAPITAL_F:70,LATIN_CAPITAL_X:88,LATIN_CAPITAL_Z:90,RIGHT_SQUARE_BRACKET:93,GRAVE_ACCENT:96,LATIN_SMALL_A:97,LATIN_SMALL_F:102,LATIN_SMALL_X:120,LATIN_SMALL_Z:122,REPLACEMENT_CHARACTER:65533},n.CODE_POINT_SEQUENCES={DASH_DASH_STRING:[45,45],DOCTYPE_STRING:[68,79,67,84,89,80,69],CDATA_START_STRING:[91,67,68,65,84,65,91],SCRIPT_STRING:[115,99,114,105,112,116],PUBLIC_STRING:[80,85,66,76,73,67],SYSTEM_STRING:[83,89,83,84,69,77]},n.isSurrogate=function(i){return i>=55296&&i<=57343},n.isSurrogatePair=function(i){return i>=56320&&i<=57343},n.getSurrogatePairCodePoint=function(i,r){return(i-55296)*1024+9216+r},n.isControlCodePoint=function(i){return 32!==i&&10!==i&&13!==i&&9!==i&&12!==i&&i>=1&&i<=31||i>=127&&i<=159},n.isUndefinedCodePoint=function(i){return i>=64976&&i<=65007||a.indexOf(i)>-1}},369264,(i,r,n)=>{"use strict";r.exports={controlCharacterInInputStream:"control-character-in-input-stream",noncharacterInInputStream:"noncharacter-in-input-stream",surrogateInInputStream:"surrogate-in-input-stream",nonVoidHtmlElementStartTagWithTrailingSolidus:"non-void-html-element-start-tag-with-trailing-solidus",endTagWithAttributes:"end-tag-with-attributes",endTagWithTrailingSolidus:"end-tag-with-trailing-solidus",unexpectedSolidusInTag:"unexpected-solidus-in-tag",unexpectedNullCharacter:"unexpected-null-character",unexpectedQuestionMarkInsteadOfTagName:"unexpected-question-mark-instead-of-tag-name",invalidFirstCharacterOfTagName:"invalid-first-character-of-tag-name",unexpectedEqualsSignBeforeAttributeName:"unexpected-equals-sign-before-attribute-name",missingEndTagName:"missing-end-tag-name",unexpectedCharacterInAttributeName:"unexpected-character-in-attribute-name",unknownNamedCharacterReference:"unknown-named-character-reference",missingSemicolonAfterCharacterReference:"missing-semicolon-after-character-reference",unexpectedCharacterAfterDoctypeSystemIdentifier:"unexpected-character-after-doctype-system-identifier",unexpectedCharacterInUnquotedAttributeValue:"unexpected-character-in-unquoted-attribute-value",eofBeforeTagName:"eof-before-tag-name",eofInTag:"eof-in-tag",missingAttributeValue:"missing-attribute-value",missingWhitespaceBetweenAttributes:"missing-whitespace-between-attributes",missingWhitespaceAfterDoctypePublicKeyword:"missing-whitespace-after-doctype-public-keyword",missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:"missing-whitespace-between-doctype-public-and-system-identifiers",missingWhitespaceAfterDoctypeSystemKeyword:"missing-whitespace-after-doctype-system-keyword",missingQuoteBeforeDoctypePublicIdentifier:"missing-quote-before-doctype-public-identifier",missingQuoteBeforeDoctypeSystemIdentifier:"missing-quote-before-doctype-system-identifier",missingDoctypePublicIdentifier:"missing-doctype-public-identifier",missingDoctypeSystemIdentifier:"missing-doctype-system-identifier",abruptDoctypePublicIdentifier:"abrupt-doctype-public-identifier",abruptDoctypeSystemIdentifier:"abrupt-doctype-system-identifier",cdataInHtmlContent:"cdata-in-html-content",incorrectlyOpenedComment:"incorrectly-opened-comment",eofInScriptHtmlCommentLikeText:"eof-in-script-html-comment-like-text",eofInDoctype:"eof-in-doctype",nestedComment:"nested-comment",abruptClosingOfEmptyComment:"abrupt-closing-of-empty-comment",eofInComment:"eof-in-comment",incorrectlyClosedComment:"incorrectly-closed-comment",eofInCdata:"eof-in-cdata",absenceOfDigitsInNumericCharacterReference:"absence-of-digits-in-numeric-character-reference",nullCharacterReference:"null-character-reference",surrogateCharacterReference:"surrogate-character-reference",characterReferenceOutsideUnicodeRange:"character-reference-outside-unicode-range",controlCharacterReference:"control-character-reference",noncharacterCharacterReference:"noncharacter-character-reference",missingWhitespaceBeforeDoctypeName:"missing-whitespace-before-doctype-name",missingDoctypeName:"missing-doctype-name",invalidCharacterSequenceAfterDoctypeName:"invalid-character-sequence-after-doctype-name",duplicateAttribute:"duplicate-attribute",nonConformingDoctype:"non-conforming-doctype",missingDoctype:"missing-doctype",misplacedDoctype:"misplaced-doctype",endTagWithoutMatchingOpenElement:"end-tag-without-matching-open-element",closingOfElementWithOpenChildElements:"closing-of-element-with-open-child-elements",disallowedContentInNoscriptInHead:"disallowed-content-in-noscript-in-head",openElementsLeftAfterEof:"open-elements-left-after-eof",abandonedHeadElementChild:"abandoned-head-element-child",misplacedStartTagForHeadElement:"misplaced-start-tag-for-head-element",nestedNoscriptInHead:"nested-noscript-in-head",eofInElementThatCanContainOnlyText:"eof-in-element-that-can-contain-only-text"}},591539,(i,r,n)=>{"use strict";let a=i.r(567303),o=i.r(369264),s=a.CODE_POINTS;
119r.exports=class{constructor(){this.html=null,this.pos=-1,this.lastGapPos=-1,this.lastCharPos=-1,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536}_err(){}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(i){if(this.pos!==this.lastCharPos){let r=this.html.charCodeAt(this.pos+1);if(a.isSurrogatePair(r))return this.pos++,this._addGap(),a.getSurrogatePairCodePoint(i,r)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,s.EOF;return this._err(o.surrogateInInputStream),i}dropParsedChunk(){this.pos>this.bufferWaterline&&(this.lastCharPos-=this.pos,this.html=this.html.substring(this.pos),this.pos=0,this.lastGapPos=-1,this.gapStack=[])}write(i,r){this.html?this.html+=i:this.html=i,this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1,this.lastChunkWritten=r}insertHtmlAtCurrentPos(i){this.html=this.html.substring(0,this.pos+1)+i+this.html.substring(this.pos+1,this.html.length),this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1}advance(){if(this.pos++,this.pos>this.lastCharPos)return this.endOfChunkHit=!this.lastChunkWritten,s.EOF;let i=this.html.charCodeAt(this.pos);return this.skipNextNewLine&&i===s.LINE_FEED?(this.skipNextNewLine=!1,this._addGap(),this.advance()):i===s.CARRIAGE_RETURN?(this.skipNextNewLine=!0,s.LINE_FEED):(this.skipNextNewLine=!1,a.isSurrogate(i)&&(i=this._processSurrogate(i)),i>31&&i<127||i===s.LINE_FEED||i===s.CARRIAGE_RETURN||i>159&&i<64976||this._checkForProblematicCharacters(i),i)}_checkForProblematicCharacters(i){a.isControlCodePoint(i)?this._err(o.controlCharacterInInputStream):a.isUndefinedCodePoint(i)&&this._err(o.noncharacterInInputStream)}retreat(){this.pos===this.lastGapPos&&(this.lastGapPos=this.gapStack.pop(),this.pos--),this.pos--}}},485293,(i,r,n)=>{"use strict";r.exports
vendor: 73,453 bytes, line 119
119=new Uint16Array([4,52,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,106,303,412,810,1432,1701,1796,1987,2114,2360,2420,2484,3170,3251,4140,4393,4575,4610,5106,5512,5728,6117,6274,6315,6345,6427,6516,7002,7910,8733,9323,9870,10170,10631,10893,11318,11386,11467,12773,13092,14474,14922,15448,15542,16419,17666,18166,18611,19004,19095,19298,19397,4,16,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,140,150,158,169,176,194,199,210,216,222,226,242,256,266,283,294,108,105,103,5,198,1,59,148,1,198,80,5,38,1,59,156,1,38,99,117,116,101,5,193,1,59,167,1,193,114,101,118,101,59,1,258,4,2,105,121,182,191,114,99,5,194,1,59,189,1,194,59,1,1040,114,59,3,55349,56580,114,97,118,101,5,192,1,59,208,1,192,112,104,97,59,1,913,97,99,114,59,1,256,100,59,1,10835,4,2,103,112,232,237,111,110,59,1,260,102,59,3,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,1,8289,105,110,103,5,197,1,59,264,1,197,4,2,99,115,272,277,114,59,3,55349,56476,105,103,110,59,1,8788,105,108,100,101,5,195,1,59,292,1,195,109,108,5,196,1,59,301,1,196,4,8,97,99,101,102,111,114,115,117,321,350,354,383,388,394,400,405,4,2,99,114,327,336,107,115,108,97,115,104,59,1,8726,4,2,118,119,342,345,59,1,10983,101,100,59,1,8966,121,59,1,1041,4,3,99,114,116,362,369,379,97,117,115,101,59,1,8757,110,111,117,108,108,105,115,59,1,8492,97,59,1,914,114,59,3,55349,56581,112,102,59,3,55349,56633,101,118,101,59,1,728,99,114,59,1,8492,109,112,101,113,59,1,8782,4,14,72,79,97,99,100,101,102,104,105,108,111,114,115,117,442,447,456,504,542,547,569,573,577,616,678,784,790,796,99,121,59,1,1063,80,89,5,169,1,59,454,1,169,4,3,99,112,121,464,470,497,117,116,101,59,1,262,4,2,59,105,476,478,1,8914,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,1,8517,108,101,121,115,59,1,8493,4,4,97,101,105,111,514,520,530,535,114,111,110,59,1,268,100,105,108,5,199,1,59,528,1,199,114,99,59,1,264,110,105,110,116,59,1,8752,111,116,59,1,266,4,2,100,110,553,560,105,108,108,97,59,1,184,116,101,114,68,111,116,59,1,183,114,59,1,8493,105,59,1,935,114,99,108,101,4,4,68,77,80,84,591,596,603,609,111,116,59,1,8857,105,110,117,115,59,1,8854,108,117,115,59,1,8853,105,109,101,115,59,1,8855,111,4,2,99,115,623,646,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8754,101,67,117,114,108,121,4,2,68,81,658,671,111,117,98,108,101,81,117,111,116,101,59,1,8221,117,111,116,101,59,1,8217,4,4,108,110,112,117,688,701,736,753,111,110,4,2,59,101,696,698,1,8759,59,1,10868,4,3,103,105,116,709,717,722,114,117,101,110,116,59,1,8801,110,116,59,1,8751,111,117,114,73,110,116,101,103,114,97,108,59,1,8750,4,2,102,114,742,745,59,1,8450,111,100,117,99,116,59,1,8720,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8755,111,115,115,59,1,10799,99,114,59,3,55349,56478,112,4,2,59,67,803,805,1,8915,97,112,59,1,8781,4,11,68,74,83,90,97,99,101,102,105,111,115,834,850,855,860,865,888,903,916,921,1011,1415,4,2,59,111,840,842,1,8517,116,114,97,104,100,59,1,10513,99,121,59,1,1026,99,121,59,1,1029,99,121,59,1,1039,4,3,103,114,115,873,879,883,103,101,114,59,1,8225,114,59,1,8609,104,118,59,1,10980,4,2,97,121,894,900,114,111,110,59,1,270,59,1,1044,108,4,2,59,116,910,912,1,8711,97,59,1,916,114,59,3,55349,56583,4,2,97,102,927,998,4,2,99,109,933,992,114,105,116,105,99,97,108,4,4,65,68,71,84,950,957,978,985,99,117,116,101,59,1,180,111,4,2,116,117,964,967,59,1,729,98,108,101,65,99,117,116,101,59,1,733,114,97,118,101,59,1,96,105,108,100,101,59,1,732,111,110,100,59,1,8900,102,101,114,101,110,116,105,97,108,68,59,1,8518,4,4,112,116,117,119,1021,1026,1048,1249,102,59,3,55349,56635,4,3,59,68,69,1034,1036,1041,1,168,111,116,59,1,8412,113,117,97,108,59,1,8784,98,108,101,4,6,67,68,76,82,85,86,1065,1082,1101,1189,1211,1236,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8751,111,4,2,116,119,1089,1092,59,1,168,110,65,114,114,111,119,59,1,8659,4,2,101,111,1107,1141,102,116,4,3,65,82,84,1117,1124,1136,114,114,111,119,59,1,8656,105,103,104,116,65,114,114,111,119,59,1,8660,101,101,59,1,10980,110,103,4,2,76,82,1149,1177,101,102,116,4,2,65,82,1158,1165,114,114,111,119,59,1,10232,105,103,104,116,65,114,114,111,119,59,1,10234,105,103,104,116,65,114,114,111,119,59,1,10233,105,103,104,116,4,2,65,84,1199,1206,114,114,111,119,59,1,8658,101,101,59,1,8872,112,4,2,65,68,1218,1225,114,114,111,119,59,1,8657,111,119,110,65,114,114,111,119,59,1,8661,101,114,116,105,99,97,108,66,97,114,59,1,8741,110,4,6,65,66,76,82,84,97,1264,1292,1299,1352,1391,1408,114,114,111,119,4,3,59,66,85,1276,1278,1283,1,8595,97,114,59,1,10515,112,65,114,114,111,119,59,1,8693,114,101,118,101,59,1,785,101,102,116,4,3,82,84,86,1310,1323,1334,105,103,104,116,86,101,99,116,111,114,59,1,10576,101,101,86,101,99,116,111,114,59,1,10590,101,99,116,111,114,4,2,59,66,1345,1347,1,8637,97,114,59,1,10582,105,103,104,116,4,2,84,86,1362,1373,101,101,86,101,99,116,111,114,59,1,10591,101,99,116,111,114,4,2,59,66,1384,1386,1,8641,97,114,59,1,10583,101,101,4,2,59,65,1399,1401,1,8868,114,114,111,119,59,1,8615,114,114,111,119,59,1,8659,4,2,99,116,1421,1426,114,59,3,55349,56479,114,111,107,59,1,272,4,16,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1466,1470,1478,1489,1515,1520,1525,1536,1544,1593,1609,1617,1650,1664,1668,1677,71,59,1,330,72,5,208,1,59,1476,1,208,99,117,116,101,5,201,1,59,1487,1,201,4,3,97,105,121,1497,1503,1512,114,111,110,59,1,282,114,99,5,202,1,59,1510,1,202,59,1,1069,111,116,59,1,278,114,59,3,55349,56584,114,97,118,101,5,200,1,59,1534,1,200,101,109,101,110,116,59,1,8712,4,2,97,112,1550,1555,99,114,59,1,274,116,121,4,2,83,86,1563,1576,109,97,108,108,83,113,117,97,114,101,59,1,9723,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9643,4,2,103,112,1599,1604,111,110,59,1,280,102,59,3,55349,56636,115,105,108,111,110,59,1,917,117,4,2,97,105,1624,1640,108,4,2,59,84,1631,1633,1,10869,105,108,100,101,59,1,8770,108,105,98,114,105,117,109,59,1,8652,4,2,99,105,1656,1660,114,59,1,8496,109,59,1,10867,97,59,1,919,109,108,5,203,1,59,1675,1,203,4,2,105,112,1683,1689,115,116,115,59,1,8707,111,110,101,110,116,105,97,108,69,59,1,8519,4,5,99,102,105,111,115,1713,1717,1722,1762,1791,121,59,1,1060,114,59,3,55349,56585,108,108,101,100,4,2,83,86,1732,1745,109,97,108,108,83,113,117,97,114,101,59,1,9724,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9642,4,3,112,114,117,1770,1775,1781,102,59,3,55349,56637,65,108,108,59,1,8704,114,105,101,114,116,114,102,59,1,8497,99,114,59,1,8497,4,12,74,84,97,98,99,100,102,103,111,114,115,116,1822,1827,1834,1848,1855,1877,1882,1887,1890,1896,1978,1984,99,121,59,1,1027,5,62,1,59,1832,1,62,109,109,97,4,2,59,100,1843,1845,1,915,59,1,988,114,101,118,101,59,1,286,4,3,101,105,121,1863,1869,1874,100,105,108,59,1,290,114,99,59,1,284,59,1,1043,111,116,59,1,288,114,59,3,55349,56586,59,1,8921,112,102,59,3,55349,56638,101,97,116,101,114,4,6,69,70,71,76,83,84,1915,1933,1944,1953,1959,1971,113,117,97,108,4,2,59,76,1925,1927,1,8805,101,115,115,59,1,8923,117,108,108,69,113,117,97,108,59,1,8807,114,101,97,116,101,114,59,1,10914,101,115,115,59,1,8823,108,97,110,116,69,113,117,97,108,59,1,10878,105,108,100,101,59,1,8819,99,114,59,3,55349,56482,59,1,8811,4,8,65,97,99,102,105,111,115,117,2005,2012,2026,2032,2036,2049,2073,2089,82,68,99,121,59,1,1066,4,2,99,116,2018,2023,101,107,59,1,711,59,1,94,105,114,99,59,1,292,114,59,1,8460,108,98,101,114,116,83,112,97,99,101,59,1,8459,4,2,112,114,2055,2059,102,59,1,8461,105,122,111,110,116,97,108,76,105,110,101,59,1,9472,4,2,99,116,2079,2083,114,59,1,8459,114,111,107,59,1,294,109,112,4,2,68,69,2097,2107,111,119,110,72,117,109,112,59,1,8782,113,117,97,108,59,1,8783,4,14,69,74,79,97,99,100,102,103,109,110,111,115,116,117,2144,2149,2155,2160,2171,2189,2194,2198,2209,2245,2307,2329,2334,2341,99,121,59,1,1045,108,105,103,59,1,306,99,121,59,1,1025,99,117,116,101,5,205,1,59,2169,1,205,4,2,105,121,2177,2186,114,99,5,206,1,59,2184,1,206,59,1,1048,111,116,59,1,304,114,59,1,8465,114,97,118,101,5,204,1,59,2207,1,204,4,3,59,97,112,2217,2219,2238,1,8465,4,2,99,103,2225,2229,114,59,1,298,105,110,97,114,121,73,59,1,8520,108,105,101,115,59,1,8658,4,2,116,118,2251,2281,4,2,59,101,2257,2259,1,8748,4,2,103,114,2265,2271,114,97,108,59,1,8747,115,101,99,116,105,111,110,59,1,8898,105,115,105,98,108,101,4,2,67,84,2293,2300,111,109,109,97,59,1,8291,105,109,101,115,59,1,8290,4,3,103,112,116,2315,2320,2325,111,110,59,1,302,102,59,3,55349,56640,97,59,1,921,99,114,59,1,8464,105,108,100,101,59,1,296,4,2,107,109,2347,2352,99,121,59,1,1030,108,5,207,1,59,2358,1,207,4,5,99,102,111,115,117,2372,2386,2391,2397,2414,4,2,105,121,2378,2383,114,99,59,1,308,59,1,1049,114,59,3,55349,56589,112,102,59,3,55349,56641,4,2,99,101,2403,2408,114,59,3,55349,56485,114,99,121,59,1,1032,107,99,121,59,1,1028,4,7,72,74,97,99,102,111,115,2436,2441,2446,2452,2467,2472,2478,99,121,59,1,1061,99,121,59,1,1036,112,112,97,59,1,922,4,2,101,121,2458,2464,100,105,108,59,1,310,59,1,1050,114,59,3,55349,56590,112,102,59,3,55349,56642,99,114,59,3,55349,56486,4,11,74,84,97,99,101,102,108,109,111,115,116,2508,2513,2520,2562,2585,2981,2986,3004,3011,3146,3167,99,121,59,1,1033,5,60,1,59,2518,1,60,4,5,99,109,110,112,114,2532,2538,2544,2548,2558,117,116,101,59,1,313,98,100,97,59,1,923,103,59,1,10218,108,97,99,101,116,114,102,59,1,8466,114,59,1,8606,4,3,97,101,121,2570,2576,2582,114,111,110,59,1,317,100,105,108,59,1,315,59,1,1051,4,2,102,115,2591,2907,116,4,10,65,67,68,70,82,84,85,86,97,114,2614,2663,2672,2728,2735,2760,2820,2870,2888,2895,4,2,110,114,2620,2633,103,108,101,66,114,97,99,107,101,116,59,1,10216,114,111,119,4,3,59,66,82,2644,2646,2651,1,8592,97,114,59,1,8676,105,103,104,116,65,114,114,111,119,59,1,8646,101,105,108,105,110,103,59,1,8968,111,4,2,117,119,2679,2692,98,108,101,66,114,97,99,107,101,116,59,1,10214,110,4,2,84,86,2699,2710,101,101,86,101,99,116,111,114,59,1,10593,101,99,116,111,114,4,2,59,66,2721,2723,1,8643,97,114,59,1,10585,108,111,111,114,59,1,8970,105,103,104,116,4,2,65,86,2745,2752,114,114,111,119,59,1,8596,101,99,116,111,114,59,1,10574,4,2,101,114,2766,2792,101,4,3,59,65,86,2775,2777,2784,1,8867,114,114,111,119,59,1,8612,101,99,116,111,114,59,1,10586,105,97,110,103,108,101,4,3,59,66,69,2806,2808,2813,1,8882,97,114,59,1,10703,113,117,97,108,59,1,8884,112,4,3,68,84,86,2829,2841,2852,111,119,110,86,101,99,116,111,114,59,1,10577,101,101,86,101,99,116,111,114,59,1,10592,101,99,116,111,114,4,2,59,66,2863,2865,1,8639,97,114,59,1,10584,101,99,116,111,114,4,2,59,66,2881,2883,1,8636,97,114,59,1,10578,114,114,111,119,59,1,8656,105,103,104,116,97,114,114,111,119,59,1,8660,115,4,6,69,70,71,76,83,84,2922,2936,2947,2956,2962,2974,113,117,97,108,71,114,101,97,116,101,114,59,1,8922,117,108,108,69,113,117,97,108,59,1,8806,114,101,97,116,101,114,59,1,8822,101,115,115,59,1,10913,108,97,110,116,69,113,117,97,108,59,1,10877,105,108,100,101,59,1,8818,114,59,3,55349,56591,4,2,59,101,2992,2994,1,8920,102,116,97,114,114,111,119,59,1,8666,105,100,111,116,59,1,319,4,3,110,112,119,3019,3110,3115,103,4,4,76,82,108,114,3030,3058,3070,3098,101,102,116,4,2,65,82,3039,3046,114,114,111,119,59,1,10229,105,103,104,116,65,114,114,111,119,59,1,10231,105,103,104,116,65,114,114,111,119,59,1,10230,101,102,116,4,2,97,114,3079,3086,114,114,111,119,59,1,10232,105,103,104,116,97,114,114,111,119,59,1,10234,105,103,104,116,97,114,114,111,119,59,1,10233,102,59,3,55349,56643,101,114,4,2,76,82,3123,3134,101,102,116,65,114,114,111,119,59,1,8601,105,103,104,116,65,114,114,111,119,59,1,8600,4,3,99,104,116,3154,3158,3161,114,59,1,8466,59,1,8624,114,111,107,59,1,321,59,1,8810,4,8,97,99,101,102,105,111,115,117,3188,3192,3196,3222,3227,3237,3243,3248,112,59,1,10501,121,59,1,1052,4,2,100,108,3202,3213,105,117,109,83,112,97,99,101,59,1,8287,108,105,110,116,114,102,59,1,8499,114,59,3,55349,56592,110,117,115,80,108,117,115,59,1,8723,112,102,59,3,55349,56644,99,114,59,1,8499,59,1,924,4,9,74,97,99,101,102,111,115,116,117,3271,3276,3283,3306,3422,3427,4120,4126,4137,99,121,59,1,1034,99,117,116,101,59,1,323,4,3,97,101,121,3291,3297,3303,114,111,110,59,1,327,100,105,108,59,1,325,59,1,1053,4,3,103,115,119,3314,3380,3415,97,116,105,118,101,4,3,77,84,86,3327,3340,3365,101,100,105,117,109,83,112,97,99,101,59,1,8203,104,105,4,2,99,110,3348,3357,107,83,112,97,99,101,59,1,8203,83,112,97,99,101,59,1,8203,101,114,121,84,104,105,110,83,112,97,99,101,59,1,8203,116,101,100,4,2,71,76,3389,3405,114,101,97,116,101,114,71,114,101,97,116,101,114,59,1,8811,101,115,115,76,101,115,115,59,1,8810,76,105,110,101,59,1,10,114,59,3,55349,56593,4,4,66,110,112,116,3437,3444,3460,3464,114,101,97,107,59,1,8288,66,114,101,97,107,105,110,103,83,112,97,99,101,59,1,160,102,59,1,8469,4,13,59,67,68,69,71,72,76,78,80,82,83,84,86,3492,3494,3517,3536,3578,3657,3685,3784,3823,3860,3915,4066,4107,1,10988,4,2,111,117,3500,3510,110,103,114,117,101,110,116,59,1,8802,112,67,97,112,59,1,8813,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,1,8742,4,3,108,113,120,3544,3552,3571,101,109,101,110,116,59,1,8713,117,97,108,4,2,59,84,3561,3563,1,8800,105,108,100,101,59,3,8770,824,105,115,116,115,59,1,8708,114,101,97,116,101,114,4,7,59,69,70,71,76,83,84,3600,3602,3609,3621,3631,3637,3650,1,8815,113,117,97,108,59,1,8817,117,108,108,69,113,117,97,108,59,3,8807,824,114,101,97,116,101,114,59,3,8811,824,101,115,115,59,1,8825,108,97,110,116,69,113,117,97,108,59,3,10878,824,105,108,100,101,59,1,8821,117,109,112,4,2,68,69,3666,3677,111,119,110,72,117,109,112,59,3,8782,824,113,117,97,108,59,3,8783,824,101,4,2,102,115,3692,3724,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3709,3711,3717,1,8938,97,114,59,3,10703,824,113,117,97,108,59,1,8940,115,4,6,59,69,71,76,83,84,3739,3741,3748,3757,3764,3777,1,8814,113,117,97,108,59,1,8816,114,101,97,116,101,114,59,1,8824,101,115,115,59,3,8810,824,108,97,110,116,69,113,117,97,108,59,3,10877,824,105,108,100,101,59,1,8820,101,115,116,101,100,4,2,71,76,3795,3812,114,101,97,116,101,114,71,114,101,97,116,101,114,59,3,10914,824,101,115,115,76,101,115,115,59,3,10913,824,114,101,99,101,100,101,115,4,3,59,69,83,3838,3840,3848,1,8832,113,117,97,108,59,3,10927,824,108,97,110,116,69,113,117,97,108,59,1,8928,4,2,101,105,3866,3881,118,101,114,115,101,69,108,101,109,101,110,116,59,1,8716,103,104,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3900,3902,3908,1,8939,97,114,59,3,10704,824,113,117,97,108,59,1,8941,4,2,113,117,3921,3973,117,97,114,101,83,117,4,2,98,112,3933,3952,115,101,116,4,2,59,69,3942,3945,3,8847,824,113,117,97,108,59,1,8930,101,114,115,101,116,4,2,59,69,3963,3966,3,8848,824,113,117,97,108,59,1,8931,4,3,98,99,112,3981,4e3,4045,115,101,116,4,2,59,69,3990,3993,3,8834,8402,113,117,97,108,59,1,8840,99,101,101,100,115,4,4,59,69,83,84,4015,4017,4025,4037,1,8833,113,117,97,108,59,3,10928,824,108,97,110,116,69,113,117,97,108,59,1,8929,105,108,100,101,59,3,8831,824,101,114,115,101,116,4,2,59,69,4056,4059,3,8835,8402,113,117,97,108,59,1,8841,105,108,100,101,4,4,59,69,70,84,4080,4082,4089,4100,1,8769,113,117,97,108,59,1,8772,117,108,108,69,113,117,97,108,59,1,8775,105,108,100,101,59,1,8777,101,114,116,105,99,97,108,66,97,114,59,1,8740,99,114,59,3,55349,56489,105,108,100,101,5,209,1,59,4135,1,209,59,1,925,4,14,69,97,99,100,102,103,109,111,112,114,115,116,117,118,4170,4176,4187,4205,4212,4217,4228,4253,4259,4292,4295,4316,4337,4346,108,105,103,59,1,338,99,117,116,101,5,211,1,59,4185,1,211,4,2,105,121,4193,4202,114,99,5,212,1,59,4200,1,212,59,1,1054,98,108,97,99,59,1,336,114,59,3,55349,56594,114,97,118,101,5,210,1,59,4226,1,210,4,3,97,101,105,4236,4241,4246,99,114,59,1,332,103,97,59,1,937,99,114,111,110,59,1,927,112,102,59,3,55349,56646,101,110,67,117,114,108,121,4,2,68,81,4272,4285,111,117,98,108,101,81,117,111,116,101,59,1,8220,117,111,116,101,59,1,8216,59,1,10836,4,2,99,108,4301,4306,114,59,3,55349,56490,97,115,104,5,216,1,59,4314,1,216,105,4,2,108,109,4323,4332,100,101,5,213,1,59,4330,1,213,101,115,59,1,10807,109,108,5,214,1,59,4344,1,214,101,114,4,2,66,80,4354,4380,4,2,97,114,4360,4364,114,59,1,8254,97,99,4,2,101,107,4372,4375,59,1,9182,101,116,59,1,9140,97,114,101,110,116,104,101,115,105,115,59,1,9180,4,9,97,99,102,104,105,108,111,114,115,4413,4422,4426,4431,4435,4438,4448,4471,4561,114,116,105,97,108,68,59,1,8706,121,59,1,1055,114,59,3,55349,56595,105,59,1,934,59,1,928,117,115,77,105,110,117,115,59,1,177,4,2,105,112,4454,4467,110,99,97,114,101,112,108,97,110,101,59,1,8460,102,59,1,8473,4,4,59,101,105,111,4481,4483,4526,4531,1,10939,99,101,100,101,115,4,4,59,69,83,84,4498,4500,4507,4519,1,8826,113,117,97,108,59,1,10927,108,97,110,116,69,113,117,97,108,59,1,8828,105,108,100,101,59,1,8830,109,101,59,1,8243,4,2,100,112,4537,4543,117,99,116,59,1,8719,111,114,116,105,111,110,4,2,59,97,4555,4557,1,8759,108,59,1,8733,4,2,99,105,4567,4572,114,59,3,55349,56491,59,1,936,4,4,85,102,111,115,4585,4594,4599,4604,79,84,5,34,1,59,4592,1,34,114,59,3,55349,56596,112,102,59,1,8474,99,114,59,3,55349,56492,4,12,66,69,97,99,101,102,104,105,111,114,115,117,4636,4642,4650,4681,4704,4763,4767,4771,5047,5069,5081,5094,97,114,114,59,1,10512,71,5,174,1,59,4648,1,174,4,3,99,110,114,4658,4664,4668,117,116,101,59,1,340,103,59,1,10219,114,4,2,59,116,4675,4677,1,8608,108,59,1,10518,4,3,97,101,121,4689,4695,4701,114,111,110,59,1,344,100,105,108,59,1,342,59,1,1056,4,2,59,118,4710,4712,1,8476,101,114,115,101,4,2,69,85,4722,4748,4,2,108,113,4728,4736,101,109,101,110,116,59,1,8715,117,105,108,105,98,114,105,117,109,59,1,8651,112,69,113,117,105,108,105,98,114,105,117,109,59,1,10607,114,59,1,8476,111,59,1,929,103,104,116,4,8,65,67,68,70,84,85,86,97,4792,4840,4849,4905,4912,4972,5022,5040,4,2,110,114,4798,4811,103,108,101,66,114,97,99,107,101,116,59,1,10217,114,111,119,4,3,59,66,76,4822,4824,4829,1,8594,97,114,59,1,8677,101,102,116,65,114,114,111,119,59,1,8644,101,105,108,105,110,103,59,1,8969,111,4,2,117,119,4856,4869,98,108,101,66,114,97,99,107,101,116,59,1,10215,110,4,2,84,86,4876,4887,101,101,86,101,99,116,111,114,59,1,10589,101,99,116,111,114,4,2,59,66,4898,4900,1,8642,97,114,59,1,10581,108,111,111,114,59,1,8971,4,2,101,114,4918,4944,101,4,3,59,65,86,4927,4929,4936,1,8866,114,114,111,119,59,1,8614,101,99,116,111,114,59,1,10587,105,97,110,103,108,101,4,3,59,66,69,4958,4960,4965,1,8883,97,114,59,1,10704,113,117,97,108,59,1,8885,112,4,3,68,84,86,4981,4993,5004,111,119,110,86,101,99,116,111,114,59,1,10575,101,101,86,101,99,116,111,114,59,1,10588,101,99,116,111,114,4,2,59,66,5015,5017,1,8638,97,114,59,1,10580,101,99,116,111,114,4,2,59,66,5033,5035,1,8640,97,114,59,1,10579,114,114,111,119,59,1,8658,4,2,112,117,5053,5057,102,59,1,8477,110,100,73,109,112,108,105,101,115,59,1,10608,105,103,104,116,97,114,114,111,119,59,1,8667,4,2,99,104,5087,5091,114,59,1,8475,59,1,8625,108,101,68,101,108,97,121,101,100,59,1,10740,4,13,72,79,97,99,102,104,105,109,111,113,115,116,117,5134,5150,5157,5164,5198,5203,5259,5265,5277,5283,5374,5380,5385,4,2,67,99,5140,5146,72,99,121,59,1,1065,121,59,1,1064,70,84,99,121,59,1,1068,99,117,116,101,59,1,346,4,5,59,97,101,105,121,5176,5178,5184,5190,5195,1,10940,114,111,110,59,1,352,100,105,108,59,1,350,114,99,59,1,348,59,1,1057,114,59,3,55349,56598,111,114,116,4,4,68,76,82,85,5216,5227,5238,5250,111,119,110,65,114,114,111,119,59,1,8595,101,102,116,65,114,114,111,119,59,1,8592,105,103,104,116,65,114,114,111,119,59,1,8594,112,65,114,114,111,119,59,1,8593,103,109,97,59,1,931,97,108,108,67,105,114,99,108,101,59,1,8728,112,102,59,3,55349,56650,4,2,114,117,5289,5293,116,59,1,8730,97,114,101,4,4,59,73,83,85,5306,5308,5322,5367,1,9633,110,116,101,114,115,101,99,116,105,111,110,59,1,8851,117,4,2,98,112,5329,5347,115,101,116,4,2,59,69,5338,5340,1,8847,113,117,97,108,59,1,8849,101,114,115,101,116,4,2,59,69,5358,5360,1,8848,113,117,97,108,59,1,8850,110,105,111,110,59,1,8852,99,114,59,3,55349,56494,97,114,59,1,8902,4,4,98,99,109,112,5395,5420,5475,5478,4,2,59,115,5401,5403,1,8912,101,116,4,2,59,69,5411,5413,1,8912,113,117,97,108,59,1,8838,4,2,99,104,5426,5468,101,101,100,115,4,4,59,69,83,84,5440,5442,5449,5461,1,8827,113,117,97,108,59,1,10928,108,97,110,116,69,113,117,97,108,59,1,8829,105,108,100,101,59,1,8831,84,104,97,116,59,1,8715,59,1,8721,4,3,59,101,115,5486,5488,5507,1,8913,114,115,101,116,4,2,59,69,5498,5500,1,8835,113,117,97,108,59,1,8839,101,116,59,1,8913,4,11,72,82,83,97,99,102,104,105,111,114,115,5536,5546,5552,5567,5579,5602,5607,5655,5695,5701,5711,79,82,78,5,222,1,59,5544,1,222,65,68,69,59,1,8482,4,2,72,99,5558,5563,99,121,59,1,1035,121,59,1,1062,4,2,98,117,5573,5576,59,1,9,59,1,932,4,3,97,101,121,5587,5593,5599,114,111,110,59,1,356,100,105,108,59,1,354,59,1,1058,114,59,3,55349,56599,4,2,101,105,5613,5631,4,2,114,116,5619,5627,101,102,111,114,101,59,1,8756,97,59,1,920,4,2,99,110,5637,5647,107,83,112,97,99,101,59,3,8287,8202,83,112,97,99,101,59,1,8201,108,100,101,4,4,59,69,70,84,5668,5670,5677,5688,1,8764,113,117,97,108,59,1,8771,117,108,108,69,113,117,97,108,59,1,8773,105,108,100,101,59,1,8776,112,102,59,3,55349,56651,105,112,108,101,68,111,116,59,1,8411,4,2,99,116,5717,5722,114,59,3,55349,56495,114,111,107,59,1,358,4,14,97,98,99,100,102,103,109,110,111,112,114,115,116,117,5758,5789,5805,5823,5830,5835,5846,5852,5921,5937,6089,6095,6101,6108,4,2,99,114,5764,5774,117,116,101,5,218,1,59,5772,1,218,114,4,2,59,111,5781,5783,1,8607,99,105,114,59,1,10569,114,4,2,99,101,5796,5800,121,59,1,1038,118,101,59,1,364,4,2,105,121,5811,5820,114,99,5,219,1,59,5818,1,219,59,1,1059,98,108,97,99,59,1,368,114,59,3,55349,56600,114,97,118,101,5,217,1,59,5844,1,217,97,99,114,59,1,362,4,2,100,105,5858,5905,101,114,4,2,66,80,5866,5892,4,2,97,114,5872,5876,114,59,1,95,97,99,4,2,101,107,5884,5887,59,1,9183,101,116,59,1,9141,97,114,101,110,116,104,101,115,105,115,59,1,9181,111,110,4,2,59,80,5913,5915,1,8899,108,117,115,59,1,8846,4,2,103,112,5927,5932,111,110,59,1,370,102,59,3,55349,56652,4,8,65,68,69,84,97,100,112,115,5955,5985,5996,6009,6026,6033,6044,6075,114,114,111,119,4,3,59,66,68,5967,5969,5974,1,8593,97,114,59,1,10514,111,119,110,65,114,114,111,119,59,1,8645,111,119,110,65,114,114,111,119,59,1,8597,113,117,105,108,105,98,114,105,117,109,59,1,10606,101,101,4,2,59,65,6017,6019,1,8869,114,114,111,119,59,1,8613,114,114,111,119,59,1,8657,111,119,110,97,114,114,111,119,59,1,8661,101,114,4,2,76,82,6052,6063,101,102,116,65,114,114,111,119,59,1,8598,105,103,104,116,65,114,114,111,119,59,1,8599,105,4,2,59,108,6082,6084,1,978,111,110,59,1,933,105,110,103,59,1,366,99,114,59,3,55349,56496,105,108,100,101,59,1,360,109,108,5,220,1,59,6115,1,220,4,9,68,98,99,100,101,102,111,115,118,6137,6143,6148,6152,6166,6250,6255,6261,6267,97,115,104,59,1,8875,97,114,59,1,10987,121,59,1,1042,97,115,104,4,2,59,108,6161,6163,1,8873,59,1,10982,4,2,101,114,6172,6175,59,1,8897,4,3,98,116,121,6183,6188,6238,97,114,59,1,8214,4,2,59,105,6194,6196,1,8214,99,97,108,4,4,66,76,83,84,6209,6214,6220,6231,97,114,59,1,8739,105,110,101,59,1,124,101,112,97,114,97,116,111,114,59,1,10072,105,108,100,101,59,1,8768,84,104,105,110,83,112,97,99,101,59,1,8202,114,59,3,55349,56601,112,102,59,3,55349,56653,99,114,59,3,55349,56497,100,97,115,104,59,1,8874,4,5,99,101,102,111,115,6286,6292,6298,6303,6309,105,114,99,59,1,372,100,103,101,59,1,8896,114,59,3,55349,56602,112,102,59,3,55349,56654,99,114,59,3,55349,56498,4,4,102,105,111,115,6325,6330,6333,6339,114,59,3,55349,56603,59,1,926,112,102,59,3,55349,56655,99,114,59,3,55349,56499,4,9,65,73,85,97,99,102,111,115,117,6365,6370,6375,6380,6391,6405,6410,6416,6422,99,121,59,1,1071,99,121,59,1,1031,99,121,59,1,1070,99,117,116,101,5,221,1,59,6389,1,221,4,2,105,121,6397,6402,114,99,59,1,374,59,1,1067,114,59,3,55349,56604,112,102,59,3,55349,56656,99,114,59,3,55349,56500,109,108,59,1,376,4,8,72,97,99,100,101,102,111,115,6445,6450,6457,6472,6477,6501,6505,6510,99,121,59,1,1046,99,117,116,101,59,1,377,4,2,97,121,6463,6469,114,111,110,59,1,381,59,1,1047,111,116,59,1,379,4,2,114,116,6483,6497,111,87,105,100,116,104,83,112,97,99,101,59,1,8203,97,59,1,918,114,59,1,8488,112,102,59,1,8484,99,114,59,3,55349,56501,4,16,97,98,99,101,102,103,108,109,110,111,112,114,115,116,117,119,6550,6561,6568,6612,6622,6634,6645,6672,6699,6854,6870,6923,6933,6963,6974,6983,99,117,116,101,5,225,1,59,6559,1,225,114,101,118,101,59,1,259,4,6,59,69,100,105,117,121,6582,6584,6588,6591,6600,6609,1,8766,59,3,8766,819,59,1,8767,114,99,5,226,1,59,6598,1,226,116,101,5,180,1,59,6607,1,180,59,1,1072,108,105,103,5,230,1,59,6620,1,230,4,2,59,114,6628,6630,1,8289,59,3,55349,56606,114,97,118,101,5,224,1,59,6643,1,224,4,2,101,112,6651,6667,4,2,102,112,6657,6663,115,121,109,59,1,8501,104,59,1,8501,104,97,59,1,945,4,2,97,112,6678,6692,4,2,99,108,6684,6688,114,59,1,257,103,59,1,10815,5,38,1,59,6697,1,38,4,2,100,103,6705,6737,4,5,59,97,100,115,118,6717,6719,6724,6727,6734,1,8743,110,100,59,1,10837,59,1,10844,108,111,112,101,59,1,10840,59,1,10842,4,7,59,101,108,109,114,115,122,6753,6755,6758,6762,6814,6835,6848,1,8736,59,1,10660,101,59,1,8736,115,100,4,2,59,97,6770,6772,1,8737,4,8,97,98,99,100,101,102,103,104,6790,6793,6796,6799,6802,6805,6808,6811,59,1,10664,59,1,10665,59,1,10666,59,1,10667,59,1,10668,59,1,10669,59,1,10670,59,1,10671,116,4,2,59,118,6821,6823,1,8735,98,4,2,59,100,6830,6832,1,8894,59,1,10653,4,2,112,116,6841,6845,104,59,1,8738,59,1,197,97,114,114,59,1,9084,4,2,103,112,6860,6865,111,110,59,1,261,102,59,3,55349,56658,4,7,59,69,97,101,105,111,112,6886,6888,6891,6897,6900,6904,6908,1,8776,59,1,10864,99,105,114,59,1,10863,59,1,8778,100,59,1,8779,115,59,1,39,114,111,120,4,2,59,101,6917,6919,1,8776,113,59,1,8778,105,110,103,5,229,1,59,6931,1,229,4,3,99,116,121,6941,6946,6949,114,59,3,55349,56502,59,1,42,109,112,4,2,59,101,6957,6959,1,8776,113,59,1,8781,105,108,100,101,5,227,1,59,6972,1,227,109,108,5,228,1,59,6981,1,228,4,2,99,105,6989,6997,111,110,105,110,116,59,1,8755,110,116,59,1,10769,4,16,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,7036,7041,7119,7135,7149,7155,7219,7224,7347,7354,7463,7489,7786,7793,7814,7866,111,116,59,1,10989,4,2,99,114,7047,7094,107,4,4,99,101,112,115,7058,7064,7073,7080,111,110,103,59,1,8780,112,115,105,108,111,110,59,1,1014,114,105,109,101,59,1,8245,105,109,4,2,59,101,7088,7090,1,8765,113,59,1,8909,4,2,118,119,7100,7105,101,101,59,1,8893,101,100,4,2,59,103,7113,7115,1,8965,101,59,1,8965,114,107,4,2,59,116,7127,7129,1,9141,98,114,107,59,1,9142,4,2,111,121,7141,7146,110,103,59,1,8780,59,1,1073,113,117,111,59,1,8222,4,5,99,109,112,114,116,7167,7181,7188,7193,7199,97,117,115,4,2,59,101,7176,7178,1,8757,59,1,8757,112,116,121,118,59,1,10672,115,105,59,1,1014,110,111,117,59,1,8492,4,3,97,104,119,7207,7210,7213,59,1,946,59,1,8502,101,101,110,59,1,8812,114,59,3,55349,56607,103,4,7,99,111,115,116,117,118,119,7241,7262,7288,7305,7328,7335,7340,4,3,97,105,117,7249,7253,7258,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,4,3,100,112,116,7270,7275,7281,111,116,59,1,10752,108,117,115,59,1,10753,105,109,101,115,59,1,10754,4,2,113,116,7294,7300,99,117,112,59,1,10758,97,114,59,1,9733,114,105,97,110,103,108,101,4,2,100,117,7318,7324,111,119,110,59,1,9661,112,59,1,9651,112,108,117,115,59,1,10756,101,101,59,1,8897,101,100,103,101,59,1,8896,97,114,111,119,59,1,10509,4,3,97,107,111,7362,7436,7458,4,2,99,110,7368,7432,107,4,3,108,115,116,7377,7386,7394,111,122,101,110,103,101,59,1,10731,113,117,97,114,101,59,1,9642,114,105,97,110,103,108,101,4,4,59,100,108,114,7411,7413,7419,7425,1,9652,111,119,110,59,1,9662,101,102,116,59,1,9666,105,103,104,116,59,1,9656,107,59,1,9251,4,2,49,51,7442,7454,4,2,50,52,7448,7451,59,1,9618,59,1,9617,52,59,1,9619,99,107,59,1,9608,4,2,101,111,7469,7485,4,2,59,113,7475,7478,3,61,8421,117,105,118,59,3,8801,8421,116,59,1,8976,4,4,112,116,119,120,7499,7504,7517,7523,102,59,3,55349,56659,4,2,59,116,7510,7512,1,8869,111,109,59,1,8869,116,105,101,59,1,8904,4,12,68,72,85,86,98,100,104,109,112,116,117,118,7549,7571,7597,7619,7655,7660,7682,7708,7715,7721,7728,7750,4,4,76,82,108,114,7559,7562,7565,7568,59,1,9559,59,1,9556,59,1,9558,59,1,9555,4,5,59,68,85,100,117,7583,7585,7588,7591,7594,1,9552,59,1,9574,59,1,9577,59,1,9572,59,1,9575,4,4,76,82,108,114,7607,7610,7613,7616,59,1,9565,59,1,9562,59,1,9564,59,1,9561,4,7,59,72,76,82,104,108,114,7635,7637,7640,7643,7646,7649,7652,1,9553,59,1,9580,59,1,9571,59,1,9568,59,1,9579,59,1,9570,59,1,9567,111,120,59,1,10697,4,4,76,82,108,114,7670,7673,7676,7679,59,1,9557,59,1,9554,59,1,9488,59,1,9484,4,5,59,68,85,100,117,7694,7696,7699,7702,7705,1,9472,59,1,9573,59,1,9576,59,1,9516,59,1,9524,105,110,117,115,59,1,8863,108,117,115,59,1,8862,105,109,101,115,59,1,8864,4,4,76,82,108,114,7738,7741,7744,7747,59,1,9563,59,1,9560,59,1,9496,59,1,9492,4,7,59,72,76,82,104,108,114,7766,7768,7771,7774,7777,7780,7783,1,9474,59,1,9578,59,1,9569,59,1,9566,59,1,9532,59,1,9508,59,1,9500,114,105,109,101,59,1,8245,4,2,101,118,7799,7804,118,101,59,1,728,98,97,114,5,166,1,59,7812,1,166,4,4,99,101,105,111,7824,7829,7834,7846,114,59,3,55349,56503,109,105,59,1,8271,109,4,2,59,101,7841,7843,1,8765,59,1,8909,108,4,3,59,98,104,7855,7857,7860,1,92,59,1,10693,115,117,98,59,1,10184,4,2,108,109,7872,7885,108,4,2,59,101,7879,7881,1,8226,116,59,1,8226,112,4,3,59,69,101,7894,7896,7899,1,8782,59,1,10926,4,2,59,113,7905,7907,1,8783,59,1,8783,4,15,97,99,100,101,102,104,105,108,111,114,115,116,117,119,121,7942,8021,8075,8080,8121,8126,8157,8279,8295,8430,8446,8485,8491,8707,8726,4,3,99,112,114,7950,7956,8007,117,116,101,59,1,263,4,6,59,97,98,99,100,115,7970,7972,7977,7984,7998,8003,1,8745,110,100,59,1,10820,114,99,117,112,59,1,10825,4,2,97,117,7990,7994,112,59,1,10827,112,59,1,10823,111,116,59,1,10816,59,3,8745,65024,4,2,101,111,8013,8017,116,59,1,8257,110,59,1,711,4,4,97,101,105,117,8031,8046,8056,8061,4,2,112,114,8037,8041,115,59,1,10829,111,110,59,1,269,100,105,108,5,231,1,59,8054,1,231,114,99,59,1,265,112,115,4,2,59,115,8069,8071,1,10828,109,59,1,10832,111,116,59,1,267,4,3,100,109,110,8088,8097,8104,105,108,5,184,1,59,8095,1,184,112,116,121,118,59,1,10674,116,5,162,2,59,101,8112,8114,1,162,114,100,111,116,59,1,183,114,59,3,55349,56608,4,3,99,101,105,8134,8138,8154,121,59,1,1095,99,107,4,2,59,109,8146,8148,1,10003,97,114,107,59,1,10003,59,1,967,114,4,7,59,69,99,101,102,109,115,8174,8176,8179,8258,8261,8268,8273,1,9675,59,1,10691,4,3,59,101,108,8187,8189,8193,1,710,113,59,1,8791,101,4,2,97,100,8200,8223,114,114,111,119,4,2,108,114,8210,8216,101,102,116,59,1,8634,105,103,104,116,59,1,8635,4,5,82,83,97,99,100,8235,8238,8241,8246,8252,59,1,174,59,1,9416,115,116,59,1,8859,105,114,99,59,1,8858,97,115,104,59,1,8861,59,1,8791,110,105,110,116,59,1,10768,105,100,59,1,10991,99,105,114,59,1,10690,117,98,115,4,2,59,117,8288,8290,1,9827,105,116,59,1,9827,4,4,108,109,110,112,8305,8326,8376,8400,111,110,4,2,59,101,8313,8315,1,58,4,2,59,113,8321,8323,1,8788,59,1,8788,4,2,109,112,8332,8344,97,4,2,59,116,8339,8341,1,44,59,1,64,4,3,59,102,108,8352,8354,8358,1,8705,110,59,1,8728,101,4,2,109,120,8365,8371,101,110,116,59,1,8705,101,115,59,1,8450,4,2,103,105,8382,8395,4,2,59,100,8388,8390,1,8773,111,116,59,1,10861,110,116,59,1,8750,4,3,102,114,121,8408,8412,8417,59,3,55349,56660,111,100,59,1,8720,5,169,2,59,115,8424,8426,1,169,114,59,1,8471,4,2,97,111,8436,8441,114,114,59,1,8629,115,115,59,1,10007,4,2,99,117,8452,8457,114,59,3,55349,56504,4,2,98,112,8463,8474,4,2,59,101,8469,8471,1,10959,59,1,10961,4,2,59,101,8480,8482,1,10960,59,1,10962,100,111,116,59,1,8943,4,7,100,101,108,112,114,118,119,8507,8522,8536,8550,8600,8697,8702,97,114,114,4,2,108,114,8516,8519,59,1,10552,59,1,10549,4,2,112,115,8528,8532,114,59,1,8926,99,59,1,8927,97,114,114,4,2,59,112,8545,8547,1,8630,59,1,10557,4,6,59,98,99,100,111,115,8564,8566,8573,8587,8592,8596,1,8746,114,99,97,112,59,1,10824,4,2,97,117,8579,8583,112,59,1,10822,112,59,1,10826,111,116,59,1,8845,114,59,1,10821,59,3,8746,65024,4,4,97,108,114,118,8610,8623,8663,8672,114,114,4,2,59,109,8618,8620,1,8631,59,1,10556,121,4,3,101,118,119,8632,8651,8656,113,4,2,112,115,8639,8645,114,101,99,59,1,8926,117,99,99,59,1,8927,101,101,59,1,8910,101,100,103,101,59,1,8911,101,110,5,164,1,59,8670,1,164,101,97,114,114,111,119,4,2,108,114,8684,8690,101,102,116,59,1,8630,105,103,104,116,59,1,8631,101,101,59,1,8910,101,100,59,1,8911,4,2,99,105,8713,8721,111,110,105,110,116,59,1,8754,110,116,59,1,8753,108,99,116,121,59,1,9005,4,19,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,8773,8778,8783,8821,8839,8854,8887,8914,8930,8944,9036,9041,9058,9197,9227,9258,9281,9297,9305,114,114,59,1,8659,97,114,59,1,10597,4,4,103,108,114,115,8793,8799,8805,8809,103,101,114,59,1,8224,101,116,104,59,1,8504,114,59,1,8595,104,4,2,59,118,8816,8818,1,8208,59,1,8867,4,2,107,108,8827,8834,97,114,111,119,59,1,10511,97,99,59,1,733,4,2,97,121,8845,8851,114,111,110,59,1,271,59,1,1076,4,3,59,97,111,8862,8864,8880,1,8518,4,2,103,114,8870,8876,103,101,114,59,1,8225,114,59,1,8650,116,115,101,113,59,1,10871,4,3,103,108,109,8895,8902,8907,5,176,1,59,8900,1,176,116,97,59,1,948,112,116,121,118,59,1,10673,4,2,105,114,8920,8926,115,104,116,59,1,10623,59,3,55349,56609,97,114,4,2,108,114,8938,8941,59,1,8643,59,1,8642,4,5,97,101,103,115,118,8956,8986,8989,8996,9001,109,4,3,59,111,115,8965,8967,8983,1,8900,110,100,4,2,59,115,8975,8977,1,8900,117,105,116,59,1,9830,59,1,9830,59,1,168,97,109,109,97,59,1,989,105,110,59,1,8946,4,3,59,105,111,9009,9011,9031,1,247,100,101,5,247,2,59,111,9020,9022,1,247,110,116,105,109,101,115,59,1,8903,110,120,59,1,8903,99,121,59,1,1106,99,4,2,111,114,9048,9053,114,110,59,1,8990,111,112,59,1,8973,4,5,108,112,116,117,119,9070,9076,9081,9130,9144,108,97,114,59,1,36,102,59,3,55349,56661,4,5,59,101,109,112,115,9093,9095,9109,9116,9122,1,729,113,4,2,59,100,9102,9104,1,8784,111,116,59,1,8785,105,110,117,115,59,1,8760,108,117,115,59,1,8724,113,117,97,114,101,59,1,8865,98,108,101,98,97,114,119,101,100,103,101,59,1,8966,110,4,3,97,100,104,9153,9160,9172,114,114,111,119,59,1,8595,111,119,110,97,114,114,111,119,115,59,1,8650,97,114,112,111,111,110,4,2,108,114,9184,9190,101,102,116,59,1,8643,105,103,104,116,59,1,8642,4,2,98,99,9203,9211,107,97,114,111,119,59,1,10512,4,2,111,114,9217,9222,114,110,59,1,8991,111,112,59,1,8972,4,3,99,111,116,9235,9248,9252,4,2,114,121,9241,9245,59,3,55349,56505,59,1,1109,108,59,1,10742,114,111,107,59,1,273,4,2,100,114,9264,9269,111,116,59,1,8945,105,4,2,59,102,9276,9278,1,9663,59,1,9662,4,2,97,104,9287,9292,114,114,59,1,8693,97,114,59,1,10607,97,110,103,108,101,59,1,10662,4,2,99,105,9311,9315,121,59,1,1119,103,114,97,114,114,59,1,10239,4,18,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,9361,9376,9398,9439,9444,9447,9462,9495,9531,9585,9598,9614,9659,9755,9771,9792,9808,9826,4,2,68,111,9367,9372,111,116,59,1,10871,116,59,1,8785,4,2,99,115,9382,9392,117,116,101,5,233,1,59,9390,1,233,116,101,114,59,1,10862,4,4,97,105,111,121,9408,9414,9430,9436,114,111,110,59,1,283,114,4,2,59,99,9421,9423,1,8790,5,234,1,59,9428,1,234,108,111,110,59,1,8789,59,1,1101,111,116,59,1,279,59,1,8519,4,2,68,114,9453,9458,111,116,59,1,8786,59,3,55349,56610,4,3,59,114,115,9470,9472,9482,1,10906,97,118,101,5,232,1,59,9480,1,232,4,2,59,100,9488,9490,1,10902,111,116,59,1,10904,4,4,59,105,108,115,9505,9507,9515,9518,1,10905,110,116,101,114,115,59,1,9191,59,1,8467,4,2,59,100,9524,9526,1,10901,111,116,59,1,10903,4,3,97,112,115,9539,9544,9564,99,114,59,1,275,116,121,4,3,59,115,118,9554,9556,9561,1,8709,101,116,59,1,8709,59,1,8709,112,4,2,49,59,9571,9583,4,2,51,52,9577,9580,59,1,8196,59,1,8197,1,8195,4,2,103,115,9591,9594,59,1,331,112,59,1,8194,4,2,103,112,9604,9609,111,110,59,1,281,102,59,3,55349,56662,4,3,97,108,115,9622,9635,9640,114,4,2,59,115,9629,9631,1,8917,108,59,1,10723,117,115,59,1,10865,105,4,3,59,108,118,9649,9651,9656,1,949,111,110,59,1,949,59,1,1013,4,4,99,115,117,118,9669,9686,9716,9747,4,2,105,111,9675,9680,114,99,59,1,8790,108,111,110,59,1,8789,4,2,105,108,9692,9696,109,59,1,8770,97,110,116,4,2,103,108,9705,9710,116,114,59,1,10902,101,115,115,59,1,10901,4,3,97,101,105,9724,9729,9734,108,115,59,1,61,115,116,59,1,8799,118,4,2,59,68,9741,9743,1,8801,68,59,1,10872,112,97,114,115,108,59,1,10725,4,2,68,97,9761,9766,111,116,59,1,8787,114,114,59,1,10609,4,3,99,100,105,9779,9783,9788,114,59,1,8495,111,116,59,1,8784,109,59,1,8770,4,2,97,104,9798,9801,59,1,951,5,240,1,59,9806,1,240,4,2,109,114,9814,9822,108,5,235,1,59,9820,1,235,111,59,1,8364,4,3,99,105,112,9834,9838,9843,108,59,1,33,115,116,59,1,8707,4,2,101,111,9849,9859,99,116,97,116,105,111,110,59,1,8496,110,101,110,116,105,97,108,101,59,1,8519,4,12,97,99,101,102,105,106,108,110,111,112,114,115,9896,9910,9914,9921,9954,9960,9967,9989,9994,10027,10036,10164,108,108,105,110,103,100,111,116,115,101,113,59,1,8786,121,59,1,1092,109,97,108,101,59,1,9792,4,3,105,108,114,9929,9935,9950,108,105,103,59,1,64259,4,2,105,108,9941,9945,103,59,1,64256,105,103,59,1,64260,59,3,55349,56611,108,105,103,59,1,64257,108,105,103,59,3,102,106,4,3,97,108,116,9975,9979,9984,116,59,1,9837,105,103,59,1,64258,110,115,59,1,9649,111,102,59,1,402,4,2,112,114,1e4,10005,102,59,3,55349,56663,4,2,97,107,10011,10016,108,108,59,1,8704,4,2,59,118,10022,10024,1,8916,59,1,10969,97,114,116,105,110,116,59,1,10765,4,2,97,111,10042,10159,4,2,99,115,10048,10155,4,6,49,50,51,52,53,55,10062,10102,10114,10135,10139,10151,4,6,50,51,52,53,54,56,10076,10083,10086,10093,10096,10099,5,189,1,59,10081,1,189,59,1,8531,5,188,1,59,10091,1,188,59,1,8533,59,1,8537,59,1,8539,4,2,51,53,10108,10111,59,1,8532,59,1,8534,4,3,52,53,56,10122,10129,10132,5,190,1,59,10127,1,190,59,1,8535,59,1,8540,53,59,1,8536,4,2,54,56,10145,10148,59,1,8538,59,1,8541,56,59,1,8542,108,59,1,8260,119,110,59,1,8994,99,114,59,3,55349,56507,4,17,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,10206,10217,10247,10254,10268,10273,10358,10363,10374,10380,10385,10406,10458,10464,10470,10497,10610,4,2,59,108,10212,10214,1,8807,59,1,10892,4,3,99,109,112,10225,10231,10244,117,116,101,59,1,501,109,97,4,2,59,100,10239,10241,1,947,59,1,989,59,1,10886,114,101,118,101,59,1,287,4,2,105,121,10260,10265,114,99,59,1,285,59,1,1075,111,116,59,1,289,4,4,59,108,113,115,10283,10285,10288,10308,1,8805,59,1,8923,4,3,59,113,115,10296,10298,10301,1,8805,59,1,8807,108,97,110,116,59,1,10878,4,4,59,99,100,108,10318,10320,10324,10345,1,10878,99,59,1,10921,111,116,4,2,59,111,10332,10334,1,10880,4,2,59,108,10340,10342,1,10882,59,1,10884,4,2,59,101,10351,10354,3,8923,65024,115,59,1,10900,114,59,3,55349,56612,4,2,59,103,10369,10371,1,8811,59,1,8921,109,101,108,59,1,8503,99,121,59,1,1107,4,4,59,69,97,106,10395,10397,10400,10403,1,8823,59,1,10898,59,1,10917,59,1,10916,4,4,69,97,101,115,10416,10419,10434,10453,59,1,8809,112,4,2,59,112,10426,10428,1,10890,114,111,120,59,1,10890,4,2,59,113,10440,10442,1,10888,4,2,59,113,10448,10450,1,10888,59,1,8809,105,109,59,1,8935,112,102,59,3,55349,56664,97,118,101,59,1,96,4,2,99,105,10476,10480,114,59,1,8458,109,4,3,59,101,108,10489,10491,10494,1,8819,59,1,10894,59,1,10896,5,62,6,59,99,100,108,113,114,10512,10514,10527,10532,10538,10545,1,62,4,2,99,105,10520,10523,59,1,10919,114,59,1,10874,111,116,59,1,8919,80,97,114,59,1,10645,117,101,115,116,59,1,10876,4,5,97,100,101,108,115,10557,10574,10579,10599,10605,4,2,112,114,10563,10570,112,114,111,120,59,1,10886,114,59,1,10616,111,116,59,1,8919,113,4,2,108,113,10586,10592,101,115,115,59,1,8923,108,101,115,115,59,1,10892,101,115,115,59,1,8823,105,109,59,1,8819,4,2,101,110,10616,10626,114,116,110,101,113,113,59,3,8809,65024,69,59,3,8809,65024,4,10,65,97,98,99,101,102,107,111,115,121,10653,10658,10713,10718,10724,10760,10765,10786,10850,10875,114,114,59,1,8660,4,4,105,108,109,114,10668,10674,10678,10684,114,115,112,59,1,8202,102,59,1,189,105,108,116,59,1,8459,4,2,100,114,10690,10695,99,121,59,1,1098,4,3,59,99,119,10703,10705,10710,1,8596,105,114,59,1,10568,59,1,8621,97,114,59,1,8463,105,114,99,59,1,293,4,3,97,108,114,10732,10748,10754,114,116,115,4,2,59,117,10741,10743,1,9829,105,116,59,1,9829,108,105,112,59,1,8230,99,111,110,59,1,8889,114,59,3,55349,56613,115,4,2,101,119,10772,10779,97,114,111,119,59,1,10533,97,114,111,119,59,1,10534,4,5,97,109,111,112,114,10798,10803,10809,10839,10844,114,114,59,1,8703,116,104,116,59,1,8763,107,4,2,108,114,10816,10827,101,102,116,97,114,114,111,119,59,1,8617,105,103,104,116,97,114,114,111,119,59,1,8618,102,59,3,55349,56665,98,97,114,59,1,8213,4,3,99,108,116,10858,10863,10869,114,59,3,55349,56509,97,115,104,59,1,8463,114,111,107,59,1,295,4,2,98,112,10881,10887,117,108,108,59,1,8259,104,101,110,59,1,8208,4,15,97,99,101,102,103,105,106,109,110,111,112,113,115,116,117,10925,10936,10958,10977,10990,11001,11039,11045,11101,11192,11220,11226,11237,11285,11299,99,117,116,101,5,237,1,59,10934,1,237,4,3,59,105,121,10944,10946,10955,1,8291,114,99,5,238,1,59,10953,1,238,59,1,1080,4,2,99,120,10964,10968,121,59,1,1077,99,108,5,161,1,59,10975,1,161,4,2,102,114,10983,10986,59,1,8660,59,3,55349,56614,114,97,118,101,5,236,1,59,10999,1,236,4,4,59,105,110,111,11011,11013,11028,11034,1,8520,4,2,105,110,11019,11024,110,116,59,1,10764,116,59,1,8749,102,105,110,59,1,10716,116,97,59,1,8489,108,105,103,59,1,307,4,3,97,111,112,11053,11092,11096,4,3,99,103,116,11061,11065,11088,114,59,1,299,4,3,101,108,112,11073,11076,11082,59,1,8465,105,110,101,59,1,8464,97,114,116,59,1,8465,104,59,1,305,102,59,1,8887,101,100,59,1,437,4,5,59,99,102,111,116,11113,11115,11121,11136,11142,1,8712,97,114,101,59,1,8453,105,110,4,2,59,116,11129,11131,1,8734,105,101,59,1,10717,100,111,116,59,1,305,4,5,59,99,101,108,112,11154,11156,11161,11179,11186,1,8747,97,108,59,1,8890,4,2,103,114,11167,11173,101,114,115,59,1,8484,99,97,108,59,1,8890,97,114,104,107,59,1,10775,114,111,100,59,1,10812,4,4,99,103,112,116,11202,11206,11211,11216,121,59,1,1105,111,110,59,1,303,102,59,3,55349,56666,97,59,1,953,114,111,100,59,1,10812,117,101,115,116,5,191,1,59,11235,1,191,4,2,99,105,11243,11248,114,59,3,55349,56510,110,4,5,59,69,100,115,118,11261,11263,11266,11271,11282,1,8712,59,1,8953,111,116,59,1,8949,4,2,59,118,11277,11279,1,8948,59,1,8947,59,1,8712,4,2,59,105,11291,11293,1,8290,108,100,101,59,1,297,4,2,107,109,11305,11310,99,121,59,1,1110,108,5,239,1,59,11316,1,239,4,6,99,102,109,111,115,117,11332,11346,11351,11357,11363,11380,4,2,105,121,11338,11343,114,99,59,1,309,59,1,1081,114,59,3,55349,56615,97,116,104,59,1,567,112,102,59,3,55349,56667,4,2,99,101,11369,11374,114,59,3,55349,56511,114,99,121,59,1,1112,107,99,121,59,1,1108,4,8,97,99,102,103,104,106,111,115,11404,11418,11433,11438,11445,11450,11455,11461,112,112,97,4,2,59,118,11413,11415,1,954,59,1,1008,4,2,101,121,11424,11430,100,105,108,59,1,311,59,1,1082,114,59,3,55349,56616,114,101,101,110,59,1,312,99,121,59,1,1093,99,121,59,1,1116,112,102,59,3,55349,56668,99,114,59,3,55349,56512,4,23,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,11515,11538,11544,11555,11560,11721,11780,11818,11868,12136,12160,12171,12203,12208,12246,12275,12327,12509,12523,12569,12641,12732,12752,4,3,97,114,116,11523,11528,11532,114,114,59,1,8666,114,59,1,8656,97,105,108,59,1,10523,97,114,114,59,1,10510,4,2,59,103,11550,11552,1,8806,59,1,10891,97,114,59,1,10594,4,9,99,101,103,109,110,112,113,114,116,11580,11586,11594,11600,11606,11624,11627,11636,11694,117,116,101,59,1,314,109,112,116,121,118,59,1,10676,114,97,110,59,1,8466,98,100,97,59,1,955,103,4,3,59,100,108,11615,11617,11620,1,10216,59,1,10641,101,59,1,10216,59,1,10885,117,111,5,171,1,59,11634,1,171,114,4,8,59,98,102,104,108,112,115,116,11655,11657,11669,11673,11677,11681,11685,11690,1,8592,4,2,59,102,11663,11665,1,8676,115,59,1,10527,115,59,1,10525,107,59,1,8617,112,59,1,8619,108,59,1,10553,105,109,59,1,10611,108,59,1,8610,4,3,59,97,101,11702,11704,11709,1,10923,105,108,59,1,10521,4,2,59,115,11715,11717,1,10925,59,3,10925,65024,4,3,97,98,114,11729,11734,11739,114,114,59,1,10508,114,107,59,1,10098,4,2,97,107,11745,11758,99,4,2,101,107,11752,11755,59,1,123,59,1,91,4,2,101,115,11764,11767,59,1,10635,108,4,2,100,117,11774,11777,59,1,10639,59,1,10637,4,4,97,101,117,121,11790,11796,11811,11815,114,111,110,59,1,318,4,2,100,105,11802,11807,105,108,59,1,316,108,59,1,8968,98,59,1,123,59,1,1083,4,4,99,113,114,115,11828,11832,11845,11864,97,59,1,10550,117,111,4,2,59,114,11840,11842,1,8220,59,1,8222,4,2,100,117,11851,11857,104,97,114,59,1,10599,115,104,97,114,59,1,10571,104,59,1,8626,4,5,59,102,103,113,115,11880,11882,12008,12011,12031,1,8804,116,4,5,97,104,108,114,116,11895,11913,11935,11947,11996,114,114,111,119,4,2,59,116,11905,11907,1,8592,97,105,108,59,1,8610,97,114,112,111,111,110,4,2,100,117,11925,11931,111,119,110,59,1,8637,112,59,1,8636,101,102,116,97,114,114,111,119,115,59,1,8647,105,103,104,116,4,3,97,104,115,11959,11974,11984,114,114,111,119,4,2,59,115,11969,11971,1,8596,59,1,8646,97,114,112,111,111,110,115,59,1,8651,113,117,105,103,97,114,114,111,119,59,1,8621,104,114,101,101,116,105,109,101,115,59,1,8907,59,1,8922,4,3,59,113,115,12019,12021,12024,1,8804,59,1,8806,108,97,110,116,59,1,10877,4,5,59,99,100,103,115,12043,12045,12049,12070,12083,1,10877,99,59,1,10920,111,116,4,2,59,111,12057,12059,1,10879,4,2,59,114,12065,12067,1,10881,59,1,10883,4,2,59,101,12076,12079,3,8922,65024,115,59,1,10899,4,5,97,100,101,103,115,12095,12103,12108,12126,12131,112,112,114,111,120,59,1,10885,111,116,59,1,8918,113,4,2,103,113,12115,12120,116,114,59,1,8922,103,116,114,59,1,10891,116,114,59,1,8822,105,109,59,1,8818,4,3,105,108,114,12144,12150,12156,115,104,116,59,1,10620,111,111,114,59,1,8970,59,3,55349,56617,4,2,59,69,12166,12168,1,8822,59,1,10897,4,2,97,98,12177,12198,114,4,2,100,117,12184,12187,59,1,8637,4,2,59,108,12193,12195,1,8636,59,1,10602,108,107,59,1,9604,99,121,59,1,1113,4,5,59,97,99,104,116,12220,12222,12227,12235,12241,1,8810,114,114,59,1,8647,111,114,110,101,114,59,1,8990,97,114,100,59,1,10603,114,105,59,1,9722,4,2,105,111,12252,12258,100,111,116,59,1,320,117,115,116,4,2,59,97,12267,12269,1,9136,99,104,101,59,1,9136,4,4,69,97,101,115,12285,12288,12303,12322,59,1,8808,112,4,2,59,112,12295,12297,1,10889,114,111,120,59,1,10889,4,2,59,113,12309,12311,1,10887,4,2,59,113,12317,12319,1,10887,59,1,8808,105,109,59,1,8934,4,8,97,98,110,111,112,116,119,122,12345,12359,12364,12421,12446,12467,12474,12490,4,2,110,114,12351,12355,103,59,1,10220,114,59,1,8701,114,107,59,1,10214,103,4,3,108,109,114,12373,12401,12409,101,102,116,4,2,97,114,12382,12389,114,114,111,119,59,1,10229,105,103,104,116,97,114,114,111,119,59,1,10231,97,112,115,116,111,59,1,10236,105,103,104,116,97,114,114,111,119,59,1,10230,112,97,114,114,111,119,4,2,108,114,12433,12439,101,102,116,59,1,8619,105,103,104,116,59,1,8620,4,3,97,102,108,12454,12458,12462,114,59,1,10629,59,3,55349,56669,117,115,59,1,10797,105,109,101,115,59,1,10804,4,2,97,98,12480,12485,115,116,59,1,8727,97,114,59,1,95,4,3,59,101,102,12498,12500,12506,1,9674,110,103,101,59,1,9674,59,1,10731,97,114,4,2,59,108,12517,12519,1,40,116,59,1,10643,4,5,97,99,104,109,116,12535,12540,12548,12561,12564,114,114,59,1,8646,111,114,110,101,114,59,1,8991,97,114,4,2,59,100,12556,12558,1,8651,59,1,10605,59,1,8206,114,105,59,1,8895,4,6,97,99,104,105,113,116,12583,12589,12594,12597,12614,12635,113,117,111,59,1,8249,114,59,3,55349,56513,59,1,8624,109,4,3,59,101,103,12606,12608,12611,1,8818,59,1,10893,59,1,10895,4,2,98,117,12620,12623,59,1,91,111,4,2,59,114,12630,12632,1,8216,59,1,8218,114,111,107,59,1,322,5,60,8,59,99,100,104,105,108,113,114,12660,12662,12675,12680,12686,12692,12698,12705,1,60,4,2,99,105,12668,12671,59,1,10918,114,59,1,10873,111,116,59,1,8918,114,101,101,59,1,8907,109,101,115,59,1,8905,97,114,114,59,1,10614,117,101,115,116,59,1,10875,4,2,80,105,12711,12716,97,114,59,1,10646,4,3,59,101,102,12724,12726,12729,1,9667,59,1,8884,59,1,9666,114,4,2,100,117,12739,12746,115,104,97,114,59,1,10570,104,97,114,59,1,10598,4,2,101,110,12758,12768,114,116,110,101,113,113,59,3,8808,65024,69,59,3,8808,65024,4,14,68,97,99,100,101,102,104,105,108,110,111,112,115,117,12803,12809,12893,12908,12914,12928,12933,12937,13011,13025,13032,13049,13052,13069,68,111,116,59,1,8762,4,4,99,108,112,114,12819,12827,12849,12887,114,5,175,1,59,12825,1,175,4,2,101,116,12833,12836,59,1,9794,4,2,59,101,12842,12844,1,10016,115,101,59,1,10016,4,2,59,115,12855,12857,1,8614,116,111,4,4,59,100,108,117,12869,12871,12877,12883,1,8614,111,119,110,59,1,8615,101,102,116,59,1,8612,112,59,1,8613,107,101,114,59,1,9646,4,2,111,121,12899,12905,109,109,97,59,1,10793,59,1,1084,97,115,104,59,1,8212,97,115,117,114,101,100,97,110,103,108,101,59,1,8737,114,59,3,55349,56618,111,59,1,8487,4,3,99,100,110,12945,12954,12985,114,111,5,181,1,59,12952,1,181,4,4,59,97,99,100,12964,12966,12971,12976,1,8739,115,116,59,1,42,105,114,59,1,10992,111,116,5,183,1,59,12983,1,183,117,115,4,3,59,98,100,12995,12997,13e3,1,8722,59,1,8863,4,2,59,117,13006,13008,1,8760,59,1,10794,4,2,99,100,13017,13021,112,59,1,10971,114,59,1,8230,112,108,117,115,59,1,8723,4,2,100,112,13038,13044,101,108,115,59,1,8871,102,59,3,55349,56670,59,1,8723,4,2,99,116,13058,13063,114,59,3,55349,56514,112,111,115,59,1,8766,4,3,59,108,109,13077,13079,13087,1,956,116,105,109,97,112,59,1,8888,97,112,59,1,8888,4,24,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,13142,13165,13217,13229,13247,13330,13359,13414,13420,13508,13513,13579,13602,13626,13631,13762,13767,13855,13936,13995,14214,14285,14312,14432,4,2,103,116,13148,13152,59,3,8921,824,4,2,59,118,13158,13161,3,8811,8402,59,3,8811,824,4,3,101,108,116,13173,13200,13204,102,116,4,2,97,114,13181,13188,114,114,111,119,59,1,8653,105,103,104,116,97,114,114,111,119,59,1,8654,59,3,8920,824,4,2,59,118,13210,13213,3,8810,8402,59,3,8810,824,105,103,104,116,97,114,114,111,119,59,1,8655,4,2,68,100,13235,13241,97,115,104,59,1,8879,97,115,104,59,1,8878,4,5,98,99,110,112,116,13259,13264,13270,13275,13308,108,97,59,1,8711,117,116,101,59,1,324,103,59,3,8736,8402,4,5,59,69,105,111,112,13287,13289,13293,13298,13302,1,8777,59,3,10864,824,100,59,3,8779,824,115,59,1,329,114,111,120,59,1,8777,117,114,4,2,59,97,13316,13318,1,9838,108,4,2,59,115,13325,13327,1,9838,59,1,8469,4,2,115,117,13336,13344,112,5,160,1,59,13342,1,160,109,112,4,2,59,101,13352,13355,3,8782,824,59,3,8783,824,4,5,97,101,111,117,121,13371,13385,13391,13407,13411,4,2,112,114,13377,13380,59,1,10819,111,110,59,1,328,100,105,108,59,1,326,110,103,4,2,59,100,13399,13401,1,8775,111,116,59,3,10861,824,112,59,1,10818,59,1,1085,97,115,104,59,1,8211,4,7,59,65,97,100,113,115,120,13436,13438,13443,13466,13472,13478,13494,1,8800,114,114,59,1,8663,114,4,2,104,114,13450,13454,107,59,1,10532,4,2,59,111,13460,13462,1,8599,119,59,1,8599,111,116,59,3,8784,824,117,105,118,59,1,8802,4,2,101,105,13484,13489,97,114,59,1,10536,109,59,3,8770,824,105,115,116,4,2,59,115,13503,13505,1,8708,59,1,8708,114,59,3,55349,56619,4,4,69,101,115,116,13523,13527,13563,13568,59,3,8807,824,4,3,59,113,115,13535,13537,13559,1,8817,4,3,59,113,115,13545,13547,13551,1,8817,59,3,8807,824,108,97,110,116,59,3,10878,824,59,3,10878,824,105,109,59,1,8821,4,2,59,114,13574,13576,1,8815,59,1,8815,4,3,65,97,112,13587,13592,13597,114,114,59,1,8654,114,114,59,1,8622,97,114,59,1,10994,4,3,59,115,118,13610,13612,13623,1,8715,4,2,59,100,13618,13620,1,8956,59,1,8954,59,1,8715,99,121,59,1,1114,4,7,65,69,97,100,101,115,116,13647,13652,13656,13661,13665,13737,13742,114,114,59,1,8653,59,3,8806,824,114,114,59,1,8602,114,59,1,8229,4,4,59,102,113,115,13675,13677,13703,13725,1,8816,116,4,2,97,114,13684,13691,114,114,111,119,59,1,8602,105,103,104,116,97,114,114,111,119,59,1,8622,4,3,59,113,115,13711,13713,13717,1,8816,59,3,8806,824,108,97,110,116,59,3,10877,824,4,2,59,115,13731,13734,3,10877,824,59,1,8814,105,109,59,1,8820,4,2,59,114,13748,13750,1,8814,105,4,2,59,101,13757,13759,1,8938,59,1,8940,105,100,59,1,8740,4,2,112,116,13773,13778,102,59,3,55349,56671,5,172,3,59,105,110,13787,13789,13829,1,172,110,4,4,59,69,100,118,13800,13802,13806,13812,1,8713,59,3,8953,824,111,116,59,3,8949,824,4,3,97,98,99,13820,13823,13826,59,1,8713,59,1,8951,59,1,8950,105,4,2,59,118,13836,13838,1,8716,4,3,97,98,99,13846,13849,13852,59,1,8716,59,1,8958,59,1,8957,4,3,97,111,114,13863,13892,13899,114,4,4,59,97,115,116,13874,13876,13883,13888,1,8742,108,108,101,108,59,1,8742,108,59,3,11005,8421,59,3,8706,824,108,105,110,116,59,1,10772,4,3,59,99,101,13907,13909,13914,1,8832,117,101,59,1,8928,4,2,59,99,13920,13923,3,10927,824,4,2,59,101,13929,13931,1,8832,113,59,3,10927,824,4,4,65,97,105,116,13946,13951,13971,13982,114,114,59,1,8655,114,114,4,3,59,99,119,13961,13963,13967,1,8603,59,3,10547,824,59,3,8605,824,103,104,116,97,114,114,111,119,59,1,8603,114,105,4,2,59,101,13990,13992,1,8939,59,1,8941,4,7,99,104,105,109,112,113,117,14011,14036,14060,14080,14085,14090,14106,4,4,59,99,101,114,14021,14023,14028,14032,1,8833,117,101,59,1,8929,59,3,10928,824,59,3,55349,56515,111,114,116,4,2,109,112,14045,14050,105,100,59,1,8740,97,114,97,108,108,101,108,59,1,8742,109,4,2,59,101,14067,14069,1,8769,4,2,59,113,14075,14077,1,8772,59,1,8772,105,100,59,1,8740,97,114,59,1,8742,115,117,4,2,98,112,14098,14102,101,59,1,8930,101,59,1,8931,4,3,98,99,112,14114,14157,14171,4,4,59,69,101,115,14124,14126,14130,14133,1,8836,59,3,10949,824,59,1,8840,101,116,4,2,59,101,14141,14144,3,8834,8402,113,4,2,59,113,14151,14153,1,8840,59,3,10949,824,99,4,2,59,101,14164,14166,1,8833,113,59,3,10928,824,4,4,59,69,101,115,14181,14183,14187,14190,1,8837,59,3,10950,824,59,1,8841,101,116,4,2,59,101,14198,14201,3,8835,8402,113,4,2,59,113,14208,14210,1,8841,59,3,10950,824,4,4,103,105,108,114,14224,14228,14238,14242,108,59,1,8825,108,100,101,5,241,1,59,14236,1,241,103,59,1,8824,105,97,110,103,108,101,4,2,108,114,14254,14269,101,102,116,4,2,59,101,14263,14265,1,8938,113,59,1,8940,105,103,104,116,4,2,59,101,14279,14281,1,8939,113,59,1,8941,4,2,59,109,14291,14293,1,957,4,3,59,101,115,14301,14303,14308,1,35,114,111,59,1,8470,112,59,1,8199,4,9,68,72,97,100,103,105,108,114,115,14332,14338,14344,14349,14355,14369,14376,14408,14426,97,115,104,59,1,8877,97,114,114,59,1,10500,112,59,3,8781,8402,97,115,104,59,1,8876,4,2,101,116,14361,14365,59,3,8805,8402,59,3,62,8402,110,102,105,110,59,1,10718,4,3,65,101,116,14384,14389,14393,114,114,59,1,10498,59,3,8804,8402,4,2,59,114,14399,14402,3,60,8402,105,101,59,3,8884,8402,4,2,65,116,14414,14419,114,114,59,1,10499,114,105,101,59,3,8885,8402,105,109,59,3,8764,8402,4,3,65,97,110,14440,14445,14468,114,114,59,1,8662,114,4,2,104,114,14452,14456,107,59,1,10531,4,2,59,111,14462,14464,1,8598,119,59,1,8598,101,97,114,59,1,10535,4,18,83,97,99,100,101,102,103,104,105,108,109,111,112,114,115,116,117,118,14512,14515,14535,14560,14597,14603,14618,14643,14657,14662,14701,14741,14747,14769,14851,14877,14907,14916,59,1,9416,4,2,99,115,14521,14531,117,116,101,5,243,1,59,14529,1,243,116,59,1,8859,4,2,105,121,14541,14557,114,4,2,59,99,14548,14550,1,8858,5,244,1,59,14555,1,244,59,1,1086,4,5,97,98,105,111,115,14572,14577,14583,14587,14591,115,104,59,1,8861,108,97,99,59,1,337,118,59,1,10808,116,59,1,8857,111,108,100,59,1,10684,108,105,103,59,1,339,4,2,99,114,14609,14614,105,114,59,1,10687,59,3,55349,56620,4,3,111,114,116,14626,14630,14640,110,59,1,731,97,118,101,5,242,1,59,14638,1,242,59,1,10689,4,2,98,109,14649,14654,97,114,59,1,10677,59,1,937,110,116,59,1,8750,4,4,97,99,105,116,14672,14677,14693,14698,114,114,59,1,8634,4,2,105,114,14683,14687,114,59,1,10686,111,115,115,59,1,10683,110,101,59,1,8254,59,1,10688,4,3,97,101,105,14709,14714,14719,99,114,59,1,333,103,97,59,1,969,4,3,99,100,110,14727,14733,14736,114,111,110,59,1,959,59,1,10678,117,115,59,1,8854,112,102,59,3,55349,56672,4,3,97,101,108,14755,14759,14764,114,59,1,10679,114,112,59,1,10681,117,115,59,1,8853,4,7,59,97,100,105,111,115,118,14785,14787,14792,14831,14837,14841,14848,1,8744,114,114,59,1,8635,4,4,59,101,102,109,14802,14804,14817,14824,1,10845,114,4,2,59,111,14811,14813,1,8500,102,59,1,8500,5,170,1,59,14822,1,170,5,186,1,59,14829,1,186,103,111,102,59,1,8886,114,59,1,10838,108,111,112,101,59,1,10839,59,1,10843,4,3,99,108,111,14859,14863,14873,114,59,1,8500,97,115,104,5,248,1,59,14871,1,248,108,59,1,8856,105,4,2,108,109,14884,14893,100,101,5,245,1,59,14891,1,245,101,115,4,2,59,97,14901,14903,1,8855,115,59,1,10806,109,108,5,246,1,59,14914,1,246,98,97,114,59,1,9021,4,12,97,99,101,102,104,105,108,109,111,114,115,117,14948,14992,14996,15033,15038,15068,15090,15189,15192,15222,15427,15441,114,4,4,59,97,115,116,14959,14961,14976,14989,1,8741,5,182,2,59,108,14968,14970,1,182,108,101,108,59,1,8741,4,2,105,108,14982,14986,109,59,1,10995,59,1,11005,59,1,8706,121,59,1,1087,114,4,5,99,105,109,112,116,15009,15014,15019,15024,15027,110,116,59,1,37,111,100,59,1,46,105,108,59,1,8240,59,1,8869,101,110,107,59,1,8241,114,59,3,55349,56621,4,3,105,109,111,15046,15057,15063,4,2,59,118,15052,15054,1,966,59,1,981,109,97,116,59,1,8499,110,101,59,1,9742,4,3,59,116,118,15076,15078,15087,1,960,99,104,102,111,114,107,59,1,8916,59,1,982,4,2,97,117,15096,15119,110,4,2,99,107,15103,15115,107,4,2,59,104,15110,15112,1,8463,59,1,8462,118,59,1,8463,115,4,9,59,97,98,99,100,101,109,115,116,15140,15142,15148,15151,15156,15168,15171,15179,15184,1,43,99,105,114,59,1,10787,59,1,8862,105,114,59,1,10786,4,2,111,117,15162,15165,59,1,8724,59,1,10789,59,1,10866,110,5,177,1,59,15177,1,177,105,109,59,1,10790,119,111,59,1,10791,59,1,177,4,3,105,112,117,15200,15208,15213,110,116,105,110,116,59,1,10773,102,59,3,55349,56673,110,100,5,163,1,59,15220,1,163,4,10,59,69,97,99,101,105,110,111,115,117,15244,15246,15249,15253,15258,15334,15347,15367,15416,15421,1,8826,59,1,10931,112,59,1,10935,117,101,59,1,8828,4,2,59,99,15264,15266,1,10927,4,6,59,97,99,101,110,115,15280,15282,15290,15299,15303,15329,1,8826,112,112,114,111,120,59,1,10935,117,114,108,121,101,113,59,1,8828,113,59,1,10927,4,3,97,101,115,15311,15319,15324,112,112,114,111,120,59,1,10937,113,113,59,1,10933,105,109,59,1,8936,105,109,59,1,8830,109,101,4,2,59,115,15342,15344,1,8242,59,1,8473,4,3,69,97,115,15355,15358,15362,59,1,10933,112,59,1,10937,105,109,59,1,8936,4,3,100,102,112,15375,15378,15404,59,1,8719,4,3,97,108,115,15386,15392,15398,108,97,114,59,1,9006,105,110,101,59,1,8978,117,114,102,59,1,8979,4,2,59,116,15410,15412,1,8733,111,59,1,8733,105,109,59,1,8830,114,101,108,59,1,8880,4,2,99,105,15433,15438,114,59,3,55349,56517,59,1,968,110,99,115,112,59,1,8200,4,6,102,105,111,112,115,117,15462,15467,15472,15478,15485,15491,114,59,3,55349,56622,110,116,59,1,10764,112,102,59,3,55349,56674,114,105,109,101,59,1,8279,99,114,59,3,55349,56518,4,3,97,101,111,15499,15520,15534,116,4,2,101,105,15506,15515,114,110,105,111,110,115,59,1,8461,110,116,59,1,10774,115,116,4,2,59,101,15528,15530,1,63,113,59,1,8799,116,5,34,1,59,15540,1,34,4,21,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,15586,15609,15615,15620,15796,15855,15893,15931,15977,16001,16039,16183,16204,16222,16228,16285,16312,16318,16363,16408,16416,4,3,97,114,116,15594,15599,15603,114,114,59,1,8667,114,59,1,8658,97,105,108,59,1,10524,97,114,114,59,1,10511,97,114,59,1,10596,4,7,99,100,101,110,113,114,116,15636,15651,15656,15664,15687,15696,15770,4,2,101,117,15642,15646,59,3,8765,817,116,101,59,1,341,105,99,59,1,8730,109,112,116,121,118,59,1,10675,103,4,4,59,100,101,108,15675,15677,15680,15683,1,10217,59,1,10642,59,1,10661,101,59,1,10217,117,111,5,187,1,59,15694,1,187,114,4,11,59,97,98,99,102,104,108,112,115,116,119,15721,15723,15727,15739,15742,15746,15750,15754,15758,15763,15767,1,8594,112,59,1,10613,4,2,59,102,15733,15735,1,8677,115,59,1,10528,59,1,10547,115,59,1,10526,107,59,1,8618,112,59,1,8620,108,59,1,10565,105,109,59,1,10612,108,59,1,8611,59,1,8605,4,2,97,105,15776,15781,105,108,59,1,10522,111,4,2,59,110,15788,15790,1,8758,97,108,115,59,1,8474,4,3,97,98,114,15804,15809,15814,114,114,59,1,10509,114,107,59,1,10099,4,2,97,107,15820,15833,99,4,2,101,107,15827,15830,59,1,125,59,1,93,4,2,101,115,15839,15842,59,1,10636,108,4,2,100,117,15849,15852,59,1,10638,59,1,10640,4,4,97,101,117,121,15865,15871,15886,15890,114,111,110,59,1,345,4,2,100,105,15877,15882,105,108,59,1,343,108,59,1,8969,98,59,1,125,59,1,1088,4,4,99,108,113,115,15903,15907,15914,15927,97,59,1,10551,100,104,97,114,59,1,10601,117,111,4,2,59,114,15922,15924,1,8221,59,1,8221,104,59,1,8627,4,3,97,99,103,15939,15966,15970,108,4,4,59,105,112,115,15950,15952,15957,15963,1,8476,110,101,59,1,8475,97,114,116,59,1,8476,59,1,8477,116,59,1,9645,5,174,1,59,15975,1,174,4,3,105,108,114,15985,15991,15997,115,104,116,59,1,10621,111,111,114,59,1,8971,59,3,55349,56623,4,2,97,111,16007,16028,114,4,2,100,117,16014,16017,59,1,8641,4,2,59,108,16023,16025,1,8640,59,1,10604,4,2,59,118,16034,16036,1,961,59,1,1009,4,3,103,110,115,16047,16167,16171,104,116,4,6,97,104,108,114,115,116,16063,16081,16103,16130,16143,16155,114,114,111,119,4,2,59,116,16073,16075,1,8594,97,105,108,59,1,8611,97,114,112,111,111,110,4,2,100,117,16093,16099,111,119,110,59,1,8641,112,59,1,8640,101,102,116,4,2,97,104,16112,16120,114,114,111,119,115,59,1,8644,97,114,112,111,111,110,115,59,1,8652,105,103,104,116,97,114,114,111,119,115,59,1,8649,113,117,105,103,97,114,114,111,119,59,1,8605,104,114,101,101,116,105,109,101,115,59,1,8908,103,59,1,730,105,110,103,100,111,116,115,101,113,59,1,8787,4,3,97,104,109,16191,16196,16201,114,114,59,1,8644,97,114,59,1,8652,59,1,8207,111,117,115,116,4,2,59,97,16214,16216,1,9137,99,104,101,59,1,9137,109,105,100,59,1,10990,4,4,97,98,112,116,16238,16252,16257,16278,4,2,110,114,16244,16248,103,59,1,10221,114,59,1,8702,114,107,59,1,10215,4,3,97,102,108,16265,16269,16273,114,59,1,10630,59,3,55349,56675,117,115,59,1,10798,105,109,101,115,59,1,10805,4,2,97,112,16291,16304,114,4,2,59,103,16298,16300,1,41,116,59,1,10644,111,108,105,110,116,59,1,10770,97,114,114,59,1,8649,4,4,97,99,104,113,16328,16334,16339,16342,113,117,111,59,1,8250,114,59,3,55349,56519,59,1,8625,4,2,98,117,16348,16351,59,1,93,111,4,2,59,114,16358,16360,1,8217,59,1,8217,4,3,104,105,114,16371,16377,16383,114,101,101,59,1,8908,109,101,115,59,1,8906,105,4,4,59,101,102,108,16394,16396,16399,16402,1,9657,59,1,8885,59,1,9656,116,114,105,59,1,10702,108,117,104,97,114,59,1,10600,59,1,8478,4,19,97,98,99,100,101,102,104,105,108,109,111,112,113,114,115,116,117,119,122,16459,16466,16472,16572,16590,16672,16687,16746,16844,16850,16924,16963,16988,17115,17121,17154,17206,17614,17656,99,117,116,101,59,1,347,113,117,111,59,1,8218,4,10,59,69,97,99,101,105,110,112,115,121,16494,16496,16499,16513,16518,16531,16536,16556,16564,16569,1,8827,59,1,10932,4,2,112,114,16505,16508,59,1,10936,111,110,59,1,353,117,101,59,1,8829,4,2,59,100,16524,16526,1,10928,105,108,59,1,351,114,99,59,1,349,4,3,69,97,115,16544,16547,16551,59,1,10934,112,59,1,10938,105,109,59,1,8937,111,108,105,110,116,59,1,10771,105,109,59,1,8831,59,1,1089,111,116,4,3,59,98,101,16582,16584,16587,1,8901,59,1,8865,59,1,10854,4,7,65,97,99,109,115,116,120,16606,16611,16634,16642,16646,16652,16668,114,114,59,1,8664,114,4,2,104,114,16618,16622,107,59,1,10533,4,2,59,111,16628,16630,1,8600,119,59,1,8600,116,5,167,1,59,16640,1,167,105,59,1,59,119,97,114,59,1,10537,109,4,2,105,110,16659,16665,110,117,115,59,1,8726,59,1,8726,116,59,1,10038,114,4,2,59,111,16679,16682,3,55349,56624,119,110,59,1,8994,4,4,97,99,111,121,16697,16702,16716,16739,114,112,59,1,9839,4,2,104,121,16708,16713,99,121,59,1,1097,59,1,1096,114,116,4,2,109,112,16724,16729,105,100,59,1,8739,97,114,97,108,108,101,108,59,1,8741,5,173,1,59,16744,1,173,4,2,103,109,16752,16770,109,97,4,3,59,102,118,16762,16764,16767,1,963,59,1,962,59,1,962,4,8,59,100,101,103,108,110,112,114,16788,16790,16795,16806,16817,16828,16832,16838,1,8764,111,116,59,1,10858,4,2,59,113,16801,16803,1,8771,59,1,8771,4,2,59,69,16812,16814,1,10910,59,1,10912,4,2,59,69,16823,16825,1,10909,59,1,10911,101,59,1,8774,108,117,115,59,1,10788,97,114,114,59,1,10610,97,114,114,59,1,8592,4,4,97,101,105,116,16860,16883,16891,16904,4,2,108,115,16866,16878,108,115,101,116,109,105,110,117,115,59,1,8726,104,112,59,1,10803,112,97,114,115,108,59,1,10724,4,2,100,108,16897,16900,59,1,8739,101,59,1,8995,4,2,59,101,16910,16912,1,10922,4,2,59,115,16918,16920,1,10924,59,3,10924,65024,4,3,102,108,112,16932,16938,16958,116,99,121,59,1,1100,4,2,59,98,16944,16946,1,47,4,2,59,97,16952,16954,1,10692,114,59,1,9023,102,59,3,55349,56676,97,4,2,100,114,16970,16985,101,115,4,2,59,117,16978,16980,1,9824,105,116,59,1,9824,59,1,8741,4,3,99,115,117,16996,17028,17089,4,2,97,117,17002,17015,112,4,2,59,115,17009,17011,1,8851,59,3,8851,65024,112,4,2,59,115,17022,17024,1,8852,59,3,8852,65024,117,4,2,98,112,17035,17062,4,3,59,101,115,17043,17045,17048,1,8847,59,1,8849,101,116,4,2,59,101,17056,17058,1,8847,113,59,1,8849,4,3,59,101,115,17070,17072,17075,1,8848,59,1,8850,101,116,4,2,59,101,17083,17085,1,8848,113,59,1,8850,4,3,59,97,102,17097,17099,17112,1,9633,114,4,2,101,102,17106,17109,59,1,9633,59,1,9642,59,1,9642,97,114,114,59,1,8594,4,4,99,101,109,116,17131,17136,17142,17148,114,59,3,55349,56520,116,109,110,59,1,8726,105,108,101,59,1,8995,97,114,102,59,1,8902,4,2,97,114,17160,17172,114,4,2,59,102,17167,17169,1,9734,59,1,9733,4,2,97,110,17178,17202,105,103,104,116,4,2,101,112,17188,17197,112,115,105,108,111,110,59,1,1013,104,105,59,1,981,115,59,1,175,4,5,98,99,109,110,112,17218,17351,17420,17423,17427,4,9,59,69,100,101,109,110,112,114,115,17238,17240,17243,17248,17261,17267,17279,17285,17291,1,8834,59,1,10949,111,116,59,1,10941,4,2,59,100,17254,17256,1,8838,111,116,59,1,10947,117,108,116,59,1,10945,4,2,69,101,17273,17276,59,1,10955,59,1,8842,108,117,115,59,1,10943,97,114,114,59,1,10617,4,3,101,105,117,17299,17335,17339,116,4,3,59,101,110,17308,17310,17322,1,8834,113,4,2,59,113,17317,17319,1,8838,59,1,10949,101,113,4,2,59,113,17330,17332,1,8842,59,1,10955,109,59,1,10951,4,2,98,112,17345,17348,59,1,10965,59,1,10963,99,4,6,59,97,99,101,110,115,17366,17368,17376,17385,17389,17415,1,8827,112,112,114,111,120,59,1,10936,117,114,108,121,101,113,59,1,8829,113,59,1,10928,4,3,97,101,115,17397,17405,17410,112,112,114,111,120,59,1,10938,113,113,59,1,10934,105,109,59,1,8937,105,109,59,1,8831,59,1,8721,103,59,1,9834,4,13,49,50,51,59,69,100,101,104,108,109,110,112,115,17455,17462,17469,17476,17478,17481,17496,17509,17524,17530,17536,17548,17554,5,185,1,59,17460,1,185,5,178,1,59,17467,1,178,5,179,1,59,17474,1,179,1,8835,59,1,10950,4,2,111,115,17487,17491,116,59,1,10942,117,98,59,1,10968,4,2,59,100,17502,17504,1,8839,111,116,59,1,10948,115,4,2,111,117,17516,17520,108,59,1,10185,98,59,1,10967,97,114,114,59,1,10619,117,108,116,59,1,10946,4,2,69,101,17542,17545,59,1,10956,59,1,8843,108,117,115,59,1,10944,4,3,101,105,117,17562,17598,17602,116,4,3,59,101,110,17571,17573,17585,1,8835,113,4,2,59,113,17580,17582,1,8839,59,1,10950,101,113,4,2,59,113,17593,17595,1,8843,59,1,10956,109,59,1,10952,4,2,98,112,17608,17611,59,1,10964,59,1,10966,4,3,65,97,110,17622,17627,17650,114,114,59,1,8665,114,4,2,104,114,17634,17638,107,59,1,10534,4,2,59,111,17644,17646,1,8601,119,59,1,8601,119,97,114,59,1,10538,108,105,103,5,223,1,59,17664,1,223,4,13,97,98,99,100,101,102,104,105,111,112,114,115,119,17694,17709,17714,17737,17742,17749,17754,17860,17905,17957,17964,18090,18122,4,2,114,117,17700,17706,103,101,116,59,1,8982,59,1,964,114,107,59,1,9140,4,3,97,101,121,17722,17728,17734,114,111,110,59,1,357,100,105,108,59,1,355,59,1,1090,111,116,59,1,8411,108,114,101,99,59,1,8981,114,59,3,55349,56625,4,4,101,105,107,111,17764,17805,17836,17851,4,2,114,116,17770,17786,101,4,2,52,102,17777,17780,59,1,8756,111,114,101,59,1,8756,97,4,3,59,115,118,17795,17797,17802,1,952,121,109,59,1,977,59,1,977,4,2,99,110,17811,17831,107,4,2,97,115,17818,17826,112,112,114,111,120,59,1,8776,105,109,59,1,8764,115,112,59,1,8201,4,2,97,115,17842,17846,112,59,1,8776,105,109,59,1,8764,114,110,5,254,1,59,17858,1,254,4,3,108,109,110,17868,17873,17901,100,101,59,1,732,101,115,5,215,3,59,98,100,17884,17886,17898,1,215,4,2,59,97,17892,17894,1,8864,114,59,1,10801,59,1,10800,116,59,1,8749,4,3,101,112,115,17913,17917,17953,97,59,1,10536,4,4,59,98,99,102,17927,17929,17934,17939,1,8868,111,116,59,1,9014,105,114,59,1,10993,4,2,59,111,17945,17948,3,55349,56677,114,107,59,1,10970,97,59,1,10537,114,105,109,101,59,1,8244,4,3,97,105,112,17972,17977,18082,100,101,59,1,8482,4,7,97,100,101,109,112,115,116,17993,18051,18056,18059,18066,18072,18076,110,103,108,101,4,5,59,100,108,113,114,18009,18011,18017,18032,18035,1,9653,111,119,110,59,1,9663,101,102,116,4,2,59,101,18026,18028,1,9667,113,59,1,8884,59,1,8796,105,103,104,116,4,2,59,101,18045,18047,1,9657,113,59,1,8885,111,116,59,1,9708,59,1,8796,105,110,117,115,59,1,10810,108,117,115,59,1,10809,98,59,1,10701,105,109,101,59,1,10811,101,122,105,117,109,59,1,9186,4,3,99,104,116,18098,18111,18116,4,2,114,121,18104,18108,59,3,55349,56521,59,1,1094,99,121,59,1,1115,114,111,107,59,1,359,4,2,105,111,18128,18133,120,116,59,1,8812,104,101,97,100,4,2,108,114,18143,18154,101,102,116,97,114,114,111,119,59,1,8606,105,103,104,116,97,114,114,111,119,59,1,8608,4,18,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,18204,18209,18214,18234,18250,18268,18292,18308,18319,18343,18379,18397,18413,18504,18547,18553,18584,18603,114,114,59,1,8657,97,114,59,1,10595,4,2,99,114,18220,18230,117,116,101,5,250,1,59,18228,1,250,114,59,1,8593,114,4,2,99,101,18241,18245,121,59,1,1118,118,101,59,1,365,4,2,105,121,18256,18265,114,99,5,251,1,59,18263,1,251,59,1,1091,4,3,97,98,104,18276,18281,18287,114,114,59,1,8645,108,97,99,59,1,369,97,114,59,1,10606,4,2,105,114,18298,18304,115,104,116,59,1,10622,59,3,55349,56626,114,97,118,101,5,249,1,59,18317,1,249,4,2,97,98,18325,18338,114,4,2,108,114,18332,18335,59,1,8639,59,1,8638,108,107,59,1,9600,4,2,99,116,18349,18374,4,2,111,114,18355,18369,114,110,4,2,59,101,18363,18365,1,8988,114,59,1,8988,111,112,59,1,8975,114,105,59,1,9720,4,2,97,108,18385,18390,99,114,59,1,363,5,168,1,59,18395,1,168,4,2,103,112,18403,18408,111,110,59,1,371,102,59,3,55349,56678,4,6,97,100,104,108,115,117,18427,18434,18445,18470,18475,18494,114,114,111,119,59,1,8593,111,119,110,97,114,114,111,119,59,1,8597,97,114,112,111,111,110,4,2,108,114,18457,18463,101,102,116,59,1,8639,105,103,104,116,59,1,8638,117,115,59,1,8846,105,4,3,59,104,108,18484,18486,18489,1,965,59,1,978,111,110,59,1,965,112,97,114,114,111,119,115,59,1,8648,4,3,99,105,116,18512,18537,18542,4,2,111,114,18518,18532,114,110,4,2,59,101,18526,18528,1,8989,114,59,1,8989,111,112,59,1,8974,110,103,59,1,367,114,105,59,1,9721,99,114,59,3,55349,56522,4,3,100,105,114,18561,18566,18572,111,116,59,1,8944,108,100,101,59,1,361,105,4,2,59,102,18579,18581,1,9653,59,1,9652,4,2,97,109,18590,18595,114,114,59,1,8648,108,5,252,1,59,18601,1,252,97,110,103,108,101,59,1,10663,4,15,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,18643,18648,18661,18667,18847,18851,18857,18904,18909,18915,18931,18937,18943,18949,18996,114,114,59,1,8661,97,114,4,2,59,118,18656,18658,1,10984,59,1,10985,97,115,104,59,1,8872,4,2,110,114,18673,18679,103,114,116,59,1,10652,4,7,101,107,110,112,114,115,116,18695,18704,18711,18720,18742,18754,18810,112,115,105,108,111,110,59,1,1013,97,112,112,97,59,1,1008,111,116,104,105,110,103,59,1,8709,4,3,104,105,114,18728,18732,18735,105,59,1,981,59,1,982,111,112,116,111,59,1,8733,4,2,59,104,18748,18750,1,8597,111,59,1,1009,4,2,105,117,18760,18766,103,109,97,59,1,962,4,2,98,112,18772,18791,115,101,116,110,101,113,4,2,59,113,18784,18787,3,8842,65024,59,3,10955,65024,115,101,116,110,101,113,4,2,59,113,18803,18806,3,8843,65024,59,3,10956,65024,4,2,104,114,18816,18822,101,116,97,59,1,977,105,97,110,103,108,101,4,2,108,114,18834,18840,101,102,116,59,1,8882,105,103,104,116,59,1,8883,121,59,1,1074,97,115,104,59,1,8866,4,3,101,108,114,18865,18884,18890,4,3,59,98,101,18873,18875,18880,1,8744,97,114,59,1,8891,113,59,1,8794,108,105,112,59,1,8942,4,2,98,116,18896,18901,97,114,59,1,124,59,1,124,114,59,3,55349,56627,116,114,105,59,1,8882,115,117,4,2,98,112,18923,18927,59,3,8834,8402,59,3,8835,8402,112,102,59,3,55349,56679,114,111,112,59,1,8733,116,114,105,59,1,8883,4,2,99,117,18955,18960,114,59,3,55349,56523,4,2,98,112,18966,18981,110,4,2,69,101,18973,18977,59,3,10955,65024,59,3,8842,65024,110,4,2,69,101,18988,18992,59,3,10956,65024,59,3,8843,65024,105,103,122,97,103,59,1,10650,4,7,99,101,102,111,112,114,115,19020,19026,19061,19066,19072,19075,19089,105,114,99,59,1,373,4,2,100,105,19032,19055,4,2,98,103,19038,19043,97,114,59,1,10847,101,4,2,59,113,19050,19052,1,8743,59,1,8793,101,114,112,59,1,8472,114,59,3,55349,56628,112,102,59,3,55349,56680,59,1,8472,4,2,59,101,19081,19083,1,8768,97,116,104,59,1,8768,99,114,59,3,55349,56524,4,14,99,100,102,104,105,108,109,110,111,114,115,117,118,119,19125,19146,19152,19157,19173,19176,19192,19197,19202,19236,19252,19269,19286,19291,4,3,97,105,117,19133,19137,19142,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,116,114,105,59,1,9661,114,59,3,55349,56629,4,2,65,97,19163,19168,114,114,59,1,10234,114,114,59,1,10231,59,1,958,4,2,65,97,19182,19187,114,114,59,1,10232,114,114,59,1,10229,97,112,59,1,10236,105,115,59,1,8955,4,3,100,112,116,19210,19215,19230,111,116,59,1,10752,4,2,102,108,19221,19225,59,3,55349,56681,117,115,59,1,10753,105,109,101,59,1,10754,4,2,65,97,19242,19247,114,114,59,1,10233,114,114,59,1,10230,4,2,99,113,19258,19263,114,59,3,55349,56525,99,117,112,59,1,10758,4,2,112,116,19275,19281,108,117,115,59,1,10756,114,105,59,1,9651,101,101,59,1,8897,101,100,103,101,59,1,8896,4,8,97,99,101,102,105,111,115,117,19316,19335,19349,19357,19362,19367,19373,19379,99,4,2,117,121,19323,19332,116,101,5,253,1,59,19330,1,253,59,1,1103,4,2,105,121,19341,19346,114,99,59,1,375,59,1,1099,110,5,165,1,59,19355,1,165,114,59,3,55349,56630,99,121,59,1,1111,112,102,59,3,55349,56682,99,114,59,3,55349,56526,4,2,99,109,19385,19389,121,59,1,1102,108,5,255,1,59,19395,1,255,4,10,97,99,100,101,102,104,105,111,115,119,19419,19426,19441,19446,19462,19467,19472,19480,19486,19492,99,117,116,101,59,1,378,4,2,97,121,19432,19438,114,111,110,59,1,382,59,1,1079,111,116,59,1,380,4,2,101,116,19452,19458,116,114,102,59,1,8488,97,59,1,950,114,59,3,55349,56631,99,121,59,1,1078,103,114,97,114,114,59,1,8669,112,102,59,3,55349,56683,99,114,59,3,55349,56527,4,2,106,110,19498,19501,59,1,8205,106,59,1,8204])
119},869768,(i,r,n)=>{"use strict";let a=i.r(591539),o=i.r(567303),s=i.r(485293),l=i.r(369264),u=o.CODE_POINTS,c=o.CODE_POINT_SEQUENCES,d={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},h="DATA_STATE",f="RCDATA_STATE",p="RAWTEXT_STATE",m="SCRIPT_DATA_STATE",g="PLAINTEXT_STATE",_="TAG_OPEN_STATE",y="END_TAG_OPEN_STATE",v="TAG_NAME_STATE",x="RCDATA_LESS_THAN_SIGN_STATE",b="RCDATA_END_TAG_OPEN_STATE",w="RCDATA_END_TAG_NAME_STATE",T="RAWTEXT_LESS_THAN_SIGN_STATE",E="RAWTEXT_END_TAG_OPEN_STATE",S="RAWTEXT_END_TAG_NAME_STATE",A="SCRIPT_DATA_LESS_THAN_SIGN_STATE",C="SCRIPT_DATA_END_TAG_OPEN_STATE",I="SCRIPT_DATA_END_TAG_NAME_STATE",k="SCRIPT_DATA_ESCAPE_START_STATE",R="SCRIPT_DATA_ESCAPE_START_DASH_STATE",M="SCRIPT_DATA_ESCAPED_STATE",L="SCRIPT_DATA_ESCAPED_DASH_STATE",P="SCRIPT_DATA_ESCAPED_DASH_DASH_STATE",O="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE",D="SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE",F="SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE",N="SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE",j="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",z="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE",B="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE",U="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE",V="SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",H="BEFORE_ATTRIBUTE_NAME_STATE",G="ATTRIBUTE_NAME_STATE",q="AFTER_ATTRIBUTE_NAME_STATE",$="BEFORE_ATTRIBUTE_VALUE_STATE",W="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",Y="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",Z="ATTRIBUTE_VALUE_UNQUOTED_STATE",K="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE",X="SELF_CLOSING_START_TAG_STATE",Q="BOGUS_COMMENT_STATE",J="MARKUP_DECLARATION_OPEN_STATE",ee="COMMENT_START_STATE",et="COMMENT_START_DASH_STATE",ei="COMMENT_STATE",er="COMMENT_LESS_THAN_SIGN_STATE",en="COMMENT_LESS_THAN_SIGN_BANG_STATE",ea="COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE",eo="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE",es="COMMENT_END_DASH_STATE",el="COMMENT_END_STATE",eu="COMMENT_END_BANG_STATE",ec="DOCTYPE_STATE",ed="BEFORE_DOCTYPE_NAME_STATE",eh="DOCTYPE_NAME_STATE",ef="AFTER_DOCTYPE_NAME_STATE",ep="AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE",em="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE",eg="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE",e_="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE",ey="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE",ev="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE",ex="AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE",eb="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE",ew="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE",eT="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE",eE="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE",eS="BOGUS_DOCTYPE_STATE",eA="CDATA_SECTION_STATE",eC="CDATA_SECTION_BRACKET_STATE",eI="CDATA_SECTION_END_STATE",ek="CHARACTER_REFERENCE_STATE",eR="NAMED_CHARACTER_REFERENCE_STATE",eM="AMBIGUOS_AMPERSAND_STATE",eL="NUMERIC_CHARACTER_REFERENCE_STATE",eP="HEXADEMICAL_CHARACTER_REFERENCE_START_STATE",eO="DECIMAL_CHARACTER_REFERENCE_START_STATE",eD="HEXADEMICAL_CHARACTER_REFERENCE_STATE",eF="DECIMAL_CHARACTER_REFERENCE_STATE",eN="NUMERIC_CHARACTER_REFERENCE_END_STATE";function ej(i){return i===u.SPACE||i===u.LINE_FEED||i===u.TABULATION||i===u.FORM_FEED}function ez(i){return i>=u.DIGIT_0&&i<=u.DIGIT_9}function eB(i){return i>=u.LATIN_CAPITAL_A&&i<=u.LATIN_CAPITAL_Z}function eU(i){return i>=u.LATIN_SMALL_A&&i<=u.LATIN_SMALL_Z}function eV(i){return eU(i)||eB(i)}function eH(i){return eV(i)||ez(i)}function eG(i){return i>=u.LATIN_CAPITAL_A&&i<=u.LATIN_CAPITAL_F}function eq(i){return i>=u.LATIN_SMALL_A&&i<=u.LATIN_SMALL_F}function e$(i){return i<=65535?String.fromCharCode(i):String.fromCharCode((i-=65536)>>>10&1023|55296)+String.fromCharCode(56320|1023&i)}function eW(i){return String.fromCharCode(i+32)}function eY(i,r){let n=s[++i],a=++i,o=a+n-1;for(;a<=o;){let i=a+o>>>1,l=s[i];if(l<r)a=i+1;else{if(!(l>r))return s[i+n];o=i-1}}return -1}class eZ{constructor(){this.preprocessor=new a,this.tokenQueue=[],this.allowCDATA=!1,this.state=h,this.returnState="",this.charRefCode=-1,this.tempBuff=[],this.lastStartTagName="",this.consumedAfterSnapshot=-1,this.active=!1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr=null}_err(){}_errOnNextCodePoint(i){this._consume(),this._err(i),this._unconsume()}getNextToken(){for(;!this.tokenQueue.length&&this.active;){this.consumedAfterSnapshot=0;let i=this._consume();this._ensureHibernation()||this[this.state](i)}return this.tokenQueue.shift()}write(i,r){this.active=!0,this.preprocessor.write(i,r)}insertHtmlAtCurrentPos(i){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(i)}_ensureHibernation(){if(this.preprocessor.endOfChunkHit){for(;this.consumedAfterSnapshot>0;this.consumedAfterSnapshot--)this.preprocessor.retreat();return this.active=!1,this.tokenQueue.push({type:eZ.HIBERNATION_TOKEN}),!0}return!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(){this.consumedAfterSnapshot--,this.preprocessor.retreat()}_reconsumeInState(i){this.state=i,this._unconsume()}_consumeSequenceIfMatch(i,r,n){let a,o=0,s=!0,l=i.length,c=0,d=r;for(;c<l;c++)if(c>0&&(d=this._consume(),o++),d===u.EOF||d!==(a=i[c])&&(n||d!==a+32)){s=!1;break}if(!s)for(;o--;)this._unconsume();return s}_isTempBufferEqualToScriptString(){if(this.tempBuff.length!==c.SCRIPT_STRING.length)return!1;for(let i=0;i<this.tempBuff.length;i++)if(this.tempBuff[i]!==c.SCRIPT_STRING[i])return!1;return!0}_createStartTagToken(){this.currentToken={type:eZ.START_TAG_TOKEN,tagName:"",selfClosing:!1,ackSelfClosing:!1,attrs:[]}}_createEndTagToken(){this.currentToken={type:eZ.END_TAG_TOKEN,tagName:"",selfClosing:!1,attrs:[]}}_createCommentToken(){this.currentToken={type:eZ.COMMENT_TOKEN,data:""}}_createDoctypeToken(i){this.currentToken={type:eZ.DOCTYPE_TOKEN,name:i,forceQuirks:!1,publicId:null,
119systemId:null}}_createCharacterToken(i,r){this.currentCharacterToken={type:i,chars:r}}_createEOFToken(){this.currentToken={type:eZ.EOF_TOKEN}}_createAttr(i){this.currentAttr={name:i,value:""}}_leaveAttrName(i){null===eZ.getTokenAttr(this.currentToken,this.currentAttr.name)?this.currentToken.attrs.push(this.currentAttr):this._err(l.duplicateAttribute),this.state=i}_leaveAttrValue(i){this.state=i}_emitCurrentToken(){this._emitCurrentCharacterToken();let i=this.currentToken;this.currentToken=null,i.type===eZ.START_TAG_TOKEN?this.lastStartTagName=i.tagName:i.type===eZ.END_TAG_TOKEN&&(i.attrs.length>0&&this._err(l.endTagWithAttributes),i.selfClosing&&this._err(l.endTagWithTrailingSolidus)),this.tokenQueue.push(i)}_emitCurrentCharacterToken(){this.currentCharacterToken&&(this.tokenQueue.push(this.currentCharacterToken),this.currentCharacterToken=null)}_emitEOFToken(){this._createEOFToken(),this._emitCurrentToken()}_appendCharToCurrentCharacterToken(i,r){this.currentCharacterToken&&this.currentCharacterToken.type!==i&&this._emitCurrentCharacterToken(),this.currentCharacterToken?this.currentCharacterToken.chars+=r:this._createCharacterToken(i,r)}_emitCodePoint(i){let r=eZ.CHARACTER_TOKEN;ej(i)?r=eZ.WHITESPACE_CHARACTER_TOKEN:i===u.NULL&&(r=eZ.NULL_CHARACTER_TOKEN),this._appendCharToCurrentCharacterToken(r,e$(i))}_emitSeveralCodePoints(i){for(let r=0;r<i.length;r++)this._emitCodePoint(i[r])}_emitChars(i){this._appendCharToCurrentCharacterToken(eZ.CHARACTER_TOKEN,i)}_matchNamedCharacterReference(i){let r=null,n=1,a=eY(0,i);for(this.tempBuff.push(i);a>-1;){let i=s[a],o=i<7;o&&1&i&&(r=2&i?[s[++a],s[++a]]:[s[++a]],n=0);let l=this._consume();if(this.tempBuff.push(l),n++,l===u.EOF)break;a=o?4&i?eY(a,l):-1:l===i?++a:-1}for(;n--;)this.tempBuff.pop(),this._unconsume();return r}_isCharacterReferenceInAttribute(){return this.returnState===W||this.returnState===Y||this.returnState===Z}_isCharacterReferenceAttributeQuirk(i){if(!i&&this._isCharacterReferenceInAttribute()){let i=this._consume();return this._unconsume(),i===u.EQUALS_SIGN||eH(i)}return!1}_flushCodePointsConsumedAsCharacterReference(){if(this._isCharacterReferenceInAttribute())for(let i=0;i<this.tempBuff.length;i++)this.currentAttr.value+=e$(this.tempBuff[i]);else this._emitSeveralCodePoints(this.tempBuff);this.tempBuff=[]}[h](i){this.preprocessor.dropParsedChunk(),i===u.LESS_THAN_SIGN?this.state=_:i===u.AMPERSAND?(this.returnState=h,this.state=ek):i===u.NULL?(this._err(l.unexpectedNullCharacter),this._emitCodePoint(i)):i===u.EOF?this._emitEOFToken():this._emitCodePoint(i)}[f](i){this.preprocessor.dropParsedChunk(),i===u.AMPERSAND?(this.returnState=f,this.state=ek):i===u.LESS_THAN_SIGN?this.state=x:i===u.NULL?(this._err(l.unexpectedNullCharacter),this._emitChars(o.REPLACEMENT_CHARACTER)):i===u.EOF?this._emitEOFToken():this._emitCodePoint(i)}[p](i){this.preprocessor.dropParsedChunk(),i===u.LESS_THAN_SIGN?this.state=T:i===u.NULL?(this._err(l.unexpectedNullCharacter),this._emitChars(o.REPLACEMENT_CHARACTER)):i===u.EOF?this._emitEOFToken():this._emitCodePoint(i)}[m](i){this.preprocessor.dropParsedChunk(),i===u.LESS_THAN_SIGN?this.state=A:i===u.NULL?(this._err(l.unexpectedNullCharacter),this._emitChars(o.REPLACEMENT_CHARACTER)):i===u.EOF?this._emitEOFToken():this._emitCodePoint(i)}[g](i){this.preprocessor.dropParsedChunk(),i===u.NULL?(this._err(l.unexpectedNullCharacter),this._emitChars(o.REPLACEMENT_CHARACTER)):i===u.EOF?this._emitEOFToken():this._emitCodePoint(i)}[_](i){i===u.EXCLAMATION_MARK?this.state=J:i===u.SOLIDUS?this.state=y:eV(i)?(this._createStartTagToken(),this._reconsumeInState(v)):i===u.QUESTION_MARK?(this._err(l.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(),this._reconsumeInState(Q)):i===u.EOF?(this._err(l.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken()):(this._err(l.invalidFirstCharacterOfTagName),this._emitChars("<"),this._reconsumeInState(h))}[y](i){eV(i)?(this._createEndTagToken(),this._reconsumeInState(v)):i===u.GREATER_THAN_SIGN?(this._err(l.missingEndTagName),this.state=h):i===u.EOF?(this._err(l.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken()):(this._err(l.invalidFirstCharacterOfTagName),this._createCommentToken(),this._reconsumeInState(Q))}[v](i){ej(i)?this.state=H:i===u.SOLIDUS?this.state=X:i===u.GREATER_THAN_SIGN?(this.state=h,this._emitCurrentToken()):eB(i)?this.currentToken.tagName+=eW(i):i===u.NULL?(this._err(l.unexpectedNullCharacter),this.currentToken.tagName+=o.REPLACEMENT_CHARACTER):i===u.EOF?(this._err(l.eofInTag),this._emitEOFToken()):this.currentToken.tagName+=e$(i)}[x](i){i===u.SOLIDUS?(this.tempBuff=[],this.state=b):(this._emitChars("<"),this._reconsumeInState(f))}[b](i){eV(i)?(this._createEndTagToken(),this._reconsumeInState(w)):(this._emitChars("</"),this._reconsumeInState(f))}
vendor: 15,011 bytes, line 119
119[w](i){if(eB(i))this.currentToken.tagName+=eW(i),this.tempBuff.push(i);else if(eU(i))this.currentToken.tagName+=e$(i),this.tempBuff.push(i);else{if(this.lastStartTagName===this.currentToken.tagName){if(ej(i)){this.state=H;return}if(i===u.SOLIDUS){this.state=X;return}if(i===u.GREATER_THAN_SIGN){this.state=h,this._emitCurrentToken();return}}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(f)}}[T](i){i===u.SOLIDUS?(this.tempBuff=[],this.state=E):(this._emitChars("<"),this._reconsumeInState(p))}[E](i){eV(i)?(this._createEndTagToken(),this._reconsumeInState(S)):(this._emitChars("</"),this._reconsumeInState(p))}[S](i){if(eB(i))this.currentToken.tagName+=eW(i),this.tempBuff.push(i);else if(eU(i))this.currentToken.tagName+=e$(i),this.tempBuff.push(i);else{if(this.lastStartTagName===this.currentToken.tagName){if(ej(i)){this.state=H;return}if(i===u.SOLIDUS){this.state=X;return}if(i===u.GREATER_THAN_SIGN){this._emitCurrentToken(),this.state=h;return}}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(p)}}[A](i){i===u.SOLIDUS?(this.tempBuff=[],this.state=C):i===u.EXCLAMATION_MARK?(this.state=k,this._emitChars("<!")):(this._emitChars("<"),this._reconsumeInState(m))}[C](i){eV(i)?(this._createEndTagToken(),this._reconsumeInState(I)):(this._emitChars("</"),this._reconsumeInState(m))}[I](i){if(eB(i))this.currentToken.tagName+=eW(i),this.tempBuff.push(i);else if(eU(i))this.currentToken.tagName+=e$(i),this.tempBuff.push(i);else{if(this.lastStartTagName===this.currentToken.tagName){if(ej(i)){this.state=H;return}else if(i===u.SOLIDUS){this.state=X;return}else if(i===u.GREATER_THAN_SIGN){this._emitCurrentToken(),this.state=h;return}}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(m)}}[k](i){i===u.HYPHEN_MINUS?(this.state=R,this._emitChars("-")):this._reconsumeInState(m)}[R](i){i===u.HYPHEN_MINUS?(this.state=P,this._emitChars("-")):this._reconsumeInState(m)}[M](i){i===u.HYPHEN_MINUS?(this.state=L,this._emitChars("-")):i===u.LESS_THAN_SIGN?this.state=O:i===u.NULL?(this._err(l.unexpectedNullCharacter),this._emitChars(o.REPLACEMENT_CHARACTER)):i===u.EOF?(this._err(l.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):this._emitCodePoint(i)}[L](i){i===u.HYPHEN_MINUS?(this.state=P,this._emitChars("-")):i===u.LESS_THAN_SIGN?this.state=O:i===u.NULL?(this._err(l.unexpectedNullCharacter),this.state=M,this._emitChars(o.REPLACEMENT_CHARACTER)):i===u.EOF?(this._err(l.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=M,this._emitCodePoint(i))}[P](i){i===u.HYPHEN_MINUS?this._emitChars("-"):i===u.LESS_THAN_SIGN?this.state=O:i===u.GREATER_THAN_SIGN?(this.state=m,this._emitChars(">")):i===u.NULL?(this._err(l.unexpectedNullCharacter),this.state=M,this._emitChars(o.REPLACEMENT_CHARACTER)):i===u.EOF?(this._err(l.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=M,this._emitCodePoint(i))}[O](i){i===u.SOLIDUS?(this.tempBuff=[],this.state=D):eV(i)?(this.tempBuff=[],this._emitChars("<"),this._reconsumeInState(N)):(this._emitChars("<"),this._reconsumeInState(M))}[D](i){eV(i)?(this._createEndTagToken(),this._reconsumeInState(F)):(this._emitChars("</"),this._reconsumeInState(M))}[F](i){if(eB(i))this.currentToken.tagName+=eW(i),this.tempBuff.push(i);else if(eU(i))this.currentToken.tagName+=e$(i),this.tempBuff.push(i);else{if(this.lastStartTagName===this.currentToken.tagName){if(ej(i)){this.state=H;return}if(i===u.SOLIDUS){this.state=X;return}if(i===u.GREATER_THAN_SIGN){this._emitCurrentToken(),this.state=h;return}}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(M)}}[N](i){ej(i)||i===u.SOLIDUS||i===u.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?j:M,this._emitCodePoint(i)):eB(i)?(this.tempBuff.push(i+32),this._emitCodePoint(i)):eU(i)?(this.tempBuff.push(i),this._emitCodePoint(i)):this._reconsumeInState(M)}[j](i){i===u.HYPHEN_MINUS?(this.state=z,this._emitChars("-")):i===u.LESS_THAN_SIGN?(this.state=U,this._emitChars("<")):i===u.NULL?(this._err(l.unexpectedNullCharacter),this._emitChars(o.REPLACEMENT_CHARACTER)):i===u.EOF?(this._err(l.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):this._emitCodePoint(i)}[z](i){i===u.HYPHEN_MINUS?(this.state=B,this._emitChars("-")):i===u.LESS_THAN_SIGN?(this.state=U,this._emitChars("<")):i===u.NULL?(this._err(l.unexpectedNullCharacter),this.state=j,this._emitChars(o.REPLACEMENT_CHARACTER)):i===u.EOF?(this._err(l.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=j,this._emitCodePoint(i))}[B](i){i===u.HYPHEN_MINUS?this._emitChars("-"):i===u.LESS_THAN_SIGN?(this.state=U,this._emitChars("<")):i===u.GREATER_THAN_SIGN?(this.state=m,this._emitChars(">")):i===u.NULL?(this._err(l.unexpectedNullCharacter),this.state=j,this._emitChars(o.REPLACEMENT_CHARACTER)):i===u.EOF?(this._err(l.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=j,this._emitCodePoint(i))}[U](i){i===u.SOLIDUS?(this.tempBuff=[],this.state=V,this._emitChars("/")):this._reconsumeInState(j)}[V](i){ej(i)||i===u.SOLIDUS||i===u.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?M:j,this._emitCodePoint(i)):eB(i)?(this.tempBuff.push(i+32),this._emitCodePoint(i)):eU(i)?(this.tempBuff.push(i),this._emitCodePoint(i)):this._reconsumeInState(j)}[H](i){ej(i)||(i===u.SOLIDUS||i===u.GREATER_THAN_SIGN||i===u.EOF?this._reconsumeInState(q):i===u.EQUALS_SIGN?(this._err(l.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=G):(this._createAttr(""),this._reconsumeInState(G)))}[G](i){ej(i)||i===u.SOLIDUS||i===u.GREATER_THAN_SIGN||i===u.EOF?(this._leaveAttrName(q),this._unconsume()):i===u.EQUALS_SIGN?this._leaveAttrName($):eB(i)?this.currentAttr.name+=eW(i):i===u.QUOTATION_MARK||i===u.APOSTROPHE||i===u.LESS_THAN_SIGN?(this._err(l.unexpectedCharacterInAttributeName),this.currentAttr.name+=e$(i)):i===u.NULL?(this._err(l.unexpectedNullCharacter),this.currentAttr.name+=o.REPLACEMENT_CHARACTER):this.currentAttr.name+=e$(i)}[q](i){ej(i)||(i===u.SOLIDUS?this.state=X:i===u.EQUALS_SIGN?this.state=$:i===u.GREATER_THAN_SIGN?(this.state=h,this._emitCurrentToken()):i===u.EOF?(this._err(l.eofInTag),this._emitEOFToken()):(this._createAttr(""),this._reconsumeInState(G)))}[$](i){ej(i)||(i===u.QUOTATION_MARK?this.state=W:i===u.APOSTROPHE?this.state=Y:i===u.GREATER_THAN_SIGN?(this._err(l.missingAttributeValue),this.state=h,this._emitCurrentToken()):this._reconsumeInState(Z))}[W](i){i===u.QUOTATION_MARK?this.state=K:i===u.AMPERSAND?(this.returnState=W,this.state=ek):i===u.NULL?(this._err(l.unexpectedNullCharacter),this.currentAttr.value+=o.REPLACEMENT_CHARACTER):i===u.EOF?(this._err(l.eofInTag),this._emitEOFToken()):this.currentAttr.value+=e$(i)}[Y](i){i===u.APOSTROPHE?this.state=K:i===u.AMPERSAND?(this.returnState=Y,this.state=ek):i===u.NULL?(this._err(l.unexpectedNullCharacter),this.currentAttr.value+=o.REPLACEMENT_CHARACTER):i===u.EOF?(this._err(l.eofInTag),this._emitEOFToken()):this.currentAttr.value+=e$(i)}[Z](i){ej(i)?this._leaveAttrValue(H):i===u.AMPERSAND?(this.returnState=Z,this.state=ek):i===u.GREATER_THAN_SIGN?(this._leaveAttrValue(h),this._emitCurrentToken()):i===u.NULL?(this._err(l.unexpectedNullCharacter),this.currentAttr.value+=o.REPLACEMENT_CHARACTER):i===u.QUOTATION_MARK||i===u.APOSTROPHE||i===u.LESS_THAN_SIGN||i===u.EQUALS_SIGN||i===u.GRAVE_ACCENT?(this._err(l.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=e$(i)):i===u.EOF?(this._err(l.eofInTag),this._emitEOFToken()):this.currentAttr.value+=e$(i)}[K](i){ej(i)?this._leaveAttrValue(H):i===u.SOLIDUS?this._leaveAttrValue(X):i===u.GREATER_THAN_SIGN?(this._leaveAttrValue(h),this._emitCurrentToken()):i===u.EOF?(this._err(l.eofInTag),this._emitEOFToken()):(this._err(l.missingWhitespaceBetweenAttributes),this._reconsumeInState(H))}[X](i){i===u.GREATER_THAN_SIGN?(this.currentToken.selfClosing=!0,this.state=h,this._emitCurrentToken()):i===u.EOF?(this._err(l.eofInTag),this._emitEOFToken()):(this._err(l.unexpectedSolidusInTag),this._reconsumeInState(H))}[Q](i){i===u.GREATER_THAN_SIGN?(this.state=h,this._emitCurrentToken()):i===u.EOF?(this._emitCurrentToken(),this._emitEOFToken()):i===u.NULL?(this._err(l.unexpectedNullCharacter),this.currentToken.data+=o.REPLACEMENT_CHARACTER):this.currentToken.data+=e$(i)}[J](i){this._consumeSequenceIfMatch(c.DASH_DASH_STRING,i,!0)?(this._createCommentToken(),this.state=ee):this._consumeSequenceIfMatch(c.DOCTYPE_STRING,i,!1)?this.state=ec:this._consumeSequenceIfMatch(c.CDATA_START_STRING,i,!0)?this.allowCDATA?this.state=eA:(this._err(l.cdataInHtmlContent),this._createCommentToken(),this.currentToken.data="[CDATA[",this.state=Q):this._ensureHibernation()||(this._err(l.incorrectlyOpenedComment),this._createCommentToken(),this._reconsumeInState(Q))}[ee](i){i===u.HYPHEN_MINUS?this.state=et:i===u.GREATER_THAN_SIGN?(this._err(l.abruptClosingOfEmptyComment),this.state=h,this._emitCurrentToken()):this._reconsumeInState(ei)}[et](i){i===u.HYPHEN_MINUS?this.state=el:i===u.GREATER_THAN_SIGN?(this._err(l.abruptClosingOfEmptyComment),this.state=h,this._emitCurrentToken()):i===u.EOF?(this._err(l.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(ei))}[ei](i){i===u.HYPHEN_MINUS?this.state=es:i===u.LESS_THAN_SIGN?(this.currentToken.data+="<",this.state=er):i===u.NULL?(this._err(l.unexpectedNullCharacter),this.currentToken.data+=o.REPLACEMENT_CHARACTER):i===u.EOF?(this._err(l.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.data+=e$(i)}[er](i){i===u.EXCLAMATION_MARK?(this.currentToken.data+="!",this.state=en):i===u.LESS_THAN_SIGN?this.currentToken.data+="!":this._reconsumeInState(ei)}[en](i){i===u.HYPHEN_MINUS?this.state=ea:this._reconsumeInState(ei)}[ea](i){i===u.HYPHEN_MINUS?this.state=eo:this._reconsumeInState(es)}[eo](i){i!==u.GREATER_THAN_SIGN&&i!==u.EOF&&this._err(l.nestedComment),this._reconsumeInState(el)}[es](i){i===u.HYPHEN_MINUS?this.state=el:i===u.EOF?(this._err(l.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(ei))}[el](i){i===u.GREATER_THAN_SIGN?(this.state=h,this._emitCurrentToken()):i===u.EXCLAMATION_MARK?this.state=eu:i===u.HYPHEN_MINUS?this.currentToken.data+="-":i===u.EOF?(this._err(l.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--",this._reconsumeInState(ei))}[eu](i){i===u.HYPHEN_MINUS?(this.currentToken.data+="--!",this.state=es):i===u.GREATER_THAN_SIGN?(this._err(l.incorrectlyClosedComment),this.state=h,this._emitCurrentToken()):i===u.EOF?(this._err(l.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--!",this._reconsumeInState(ei))}[ec](i){ej(i)?this.state=ed:i===u.GREATER_THAN_SIGN?this._reconsumeInState(ed):i===u.EOF?(this._err(l.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(l.missingWhitespaceBeforeDoctypeName),this._reconsumeInState(ed))}[ed](i){ej(i)||(eB(i)?(this._createDoctypeToken(eW(i)),this.state=eh):i===u.NULL?(this._err(l.unexpectedNullCharacter),this._createDoctypeToken(o.REPLACEMENT_CHARACTER),this.state=eh):i===u.GREATER_THAN_SIGN?(this._err(l.missingDoctypeName),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=h):i===u.EOF?(this._err(l.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._createDoctypeToken(e$(i)),this.state=eh))}[eh](i){ej(i)?this.state=ef:i===u.GREATER_THAN_SIGN?(this.state=h,this._emitCurrentToken()):eB(i)?this.currentToken.name+=eW(i):i===u.NULL?(this._err(l.unexpectedNullCharacter),this.currentToken.name+=o.REPLACEMENT_CHARACTER):i===u.EOF?(this._err(l.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.name+=e$(i)}[ef](i){!ej(i)&&(i===u.GREATER_THAN_SIGN?(this.state=h,this._emitCurrentToken()):i===u.EOF?(this._err(l.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this._consumeSequenceIfMatch(c.PUBLIC_STRING,i,!1)?this.state=ep:this._consumeSequenceIfMatch(c.SYSTEM_STRING,i,!1)?this.state=ex:this._ensureHibernation()||(this._err(l.invalidCharacterSequenceAfterDoctypeName),this.currentToken.forceQuirks=!0,this._reconsumeInState(eS)))}[ep](i){ej(i)?this.state=em:i===u.QUOTATION_MARK?(this._err(l.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state=eg):i===u.APOSTROPHE?(this._err(l.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state=e_):i===u.GREATER_THAN_SIGN?(this._err(l.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=h,this._emitCurrentToken()):i===u.EOF?(this._err(l.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(l.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(eS))}[em](i){ej(i)||(i===u.QUOTATION_MARK?(this.currentToken.publicId="",this.state=eg):i===u.APOSTROPHE?(this.currentToken.publicId="",this.state=e_):i===u.GREATER_THAN_SIGN?(this._err(l.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=h,this._emitCurrentToken()):i===u.EOF?(this._err(l.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(l.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(eS)))}[eg](i){i===u.QUOTATION_MARK?this.state=ey:i===u.NULL?(this._err(l.unexpectedNullCharacter),this.currentToken.publicId+=o.REPLACEMENT_CHARACTER):i===u.GREATER_THAN_SIGN?(this._err(l.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=h):i===u.EOF?(this._err(l.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=e$(i)}[e_](i){i===u.APOSTROPHE?this.state=ey:i===u.NULL?(this._err(l.unexpectedNullCharacter),this.currentToken.publicId+=o.REPLACEMENT_CHARACTER):i===u.GREATER_THAN_SIGN?(this._err(l.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=h):i===u.EOF?(this._err(l.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=e$(i)}[ey](i){ej(i)?this.state=ev:i===u.GREATER_THAN_SIGN?(this.state=h,this._emitCurrentToken()):i===u.QUOTATION_MARK?(this._err(l.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state=ew):i===u.APOSTROPHE?(this._err(l.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state=eT):i===u.EOF?(this._err(l.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(l.missingQuoteBeforeDoctype
119SystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(eS))}[ev](i){ej(i)||(i===u.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=h):i===u.QUOTATION_MARK?(this.currentToken.systemId="",this.state=ew):i===u.APOSTROPHE?(this.currentToken.systemId="",this.state=eT):i===u.EOF?(this._err(l.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(l.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(eS)))}[ex](i){ej(i)?this.state=eb:i===u.QUOTATION_MARK?(this._err(l.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state=ew):i===u.APOSTROPHE?(this._err(l.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state=eT):i===u.GREATER_THAN_SIGN?(this._err(l.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=h,this._emitCurrentToken()):i===u.EOF?(this._err(l.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(l.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(eS))}[eb](i){ej(i)||(i===u.QUOTATION_MARK?(this.currentToken.systemId="",this.state=ew):i===u.APOSTROPHE?(this.currentToken.systemId="",this.state=eT):i===u.GREATER_THAN_SIGN?(this._err(l.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=h,this._emitCurrentToken()):i===u.EOF?(this._err(l.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(l.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(eS)))}[ew](i){i===u.QUOTATION_MARK?this.state=eE:i===u.NULL?(this._err(l.unexpectedNullCharacter),this.currentToken.systemId+=o.REPLACEMENT_CHARACTER):i===u.GREATER_THAN_SIGN?(this._err(l.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=h):i===u.EOF?(this._err(l.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=e$(i)}[eT](i){i===u.APOSTROPHE?this.state=eE:i===u.NULL?(this._err(l.unexpectedNullCharacter),this.currentToken.systemId+=o.REPLACEMENT_CHARACTER):i===u.GREATER_THAN_SIGN?(this._err(l.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=h):i===u.EOF?(this._err(l.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=e$(i)}[eE](i){ej(i)||(i===u.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=h):i===u.EOF?(this._err(l.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(l.unexpectedCharacterAfterDoctypeSystemIdentifier),this._reconsumeInState(eS)))}[eS](i){i===u.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=h):i===u.NULL?this._err(l.unexpectedNullCharacter):i===u.EOF&&(this._emitCurrentToken(),this._emitEOFToken())}[eA](i){i===u.RIGHT_SQUARE_BRACKET?this.state=eC:i===u.EOF?(this._err(l.eofInCdata),this._emitEOFToken()):this._emitCodePoint(i)}[eC](i){i===u.RIGHT_SQUARE_BRACKET?this.state=eI:(this._emitChars("]"),this._reconsumeInState(eA))}[eI](i){i===u.GREATER_THAN_SIGN?this.state=h:i===u.RIGHT_SQUARE_BRACKET?this._emitChars("]"):(this._emitChars("]]"),this._reconsumeInState(eA))}[ek](i){this.tempBuff=[u.AMPERSAND],i===u.NUMBER_SIGN?(this.tempBuff.push(i),this.state=eL):eH(i)?this._reconsumeInState(eR):(this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}[eR](i){let r=this._matchNamedCharacterReference(i);if(this._ensureHibernation())this.tempBuff=[u.AMPERSAND];else if(r){let i=this.tempBuff[this.tempBuff.length-1]===u.SEMICOLON;this._isCharacterReferenceAttributeQuirk(i)||(i||this._errOnNextCodePoint(l.missingSemicolonAfterCharacterReference),this.tempBuff=r),this._flushCodePointsConsumedAsCharacterReference(),this.state=this.returnState}else this._flushCodePointsConsumedAsCharacterReference(),this.state=eM}[eM](i){eH(i)?this._isCharacterReferenceInAttribute()?this.currentAttr.value+=e$(i):this._emitCodePoint(i):(i===u.SEMICOLON&&this._err(l.unknownNamedCharacterReference),this._reconsumeInState(this.returnState))}[eL](i){this.charRefCode=0,i===u.LATIN_SMALL_X||i===u.LATIN_CAPITAL_X?(this.tempBuff.push(i),this.state=eP):this._reconsumeInState(eO)}[eP](i){ez(i)||eG(i)||eq(i)?this._reconsumeInState(eD):(this._err(l.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}[eO](i){ez(i)?this._reconsumeInState(eF):(this._err(l.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}[eD](i){eG(i)?this.charRefCode=16*this.charRefCode+i-55:eq(i)?this.charRefCode=16*this.charRefCode+i-87:ez(i)?this.charRefCode=16*this.charRefCode+i-48:i===u.SEMICOLON?this.state=eN:(this._err(l.missingSemicolonAfterCharacterReference),this._reconsumeInState(eN))}[eF](i){ez(i)?this.charRefCode=10*this.charRefCode+i-48:i===u.SEMICOLON?this.state=eN:(this._err(l.missingSemicolonAfterCharacterReference),this._reconsumeInState(eN))}[eN](){if(this.charRefCode===u.NULL)this._err(l.nullCharacterReference),this.charRefCode=u.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err(l.characterReferenceOutsideUnicodeRange),this.charRefCode=u.REPLACEMENT_CHARACTER;else if(o.isSurrogate(this.charRefCode))this._err(l.surrogateCharacterReference),this.charRefCode=u.REPLACEMENT_CHARACTER;else if(o.isUndefinedCodePoint(this.charRefCode))this._err(l.noncharacterCharacterReference);else if(o.isControlCodePoint(this.charRefCode)||this.charRefCode===u.CARRIAGE_RETURN){this._err(l.controlCharacterReference);let i=d[this.charRefCode];i&&(this.charRefCode=i)}this.tempBuff=[this.charRefCode],this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)}}eZ.CHARACTER_TOKEN="CHARACTER_TOKEN",eZ.NULL_CHARACTER_TOKEN="NULL_CHARACTER_TOKEN",eZ.WHITESPACE_CHARACTER_TOKEN="WHITESPACE_CHARACTER_TOKEN",eZ.START_TAG_TOKEN="START_TAG_TOKEN",eZ.END_TAG_TOKEN="END_TAG_TOKEN",eZ.COMMENT_TOKEN="COMMENT_TOKEN",eZ.DOCTYPE_TOKEN="DOCTYPE_TOKEN",eZ.EOF_TOKEN="EOF_TOKEN",eZ.HIBERNATION_TOKEN="HIBERNATION_TOKEN",eZ.MODE={DATA:h,RCDATA:f,RAWTEXT:p,SCRIPT_DATA:m,PLAINTEXT:g},eZ.getTokenAttr=function(i,r){for(let n=i.attrs.length-1;n>=0;n--)if(i.attrs[n].name===r)return i.attrs[n].value;return null},r.exports=eZ},938759,(i,r,n)=>{"use strict";let a=n.NAMESPACES={HTML:"http://www.w3.org/1999/xhtml",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"};n.ATTRS={TYPE:"type",ACTION:"action",ENCODING:"encoding",PROMPT:"prompt",NAME:"name",COLOR:"color",FACE:"face",SIZE:"size"},n.DOCUMENT_MODE={NO_QUIRKS:"no-quirks",QUIRKS:"quirks",LIMITED_QUIRKS:"limited-quirks"};let o=n.TAG_NAMES={A:"a",ADDRESS:"address",ANNOTATION_XML:"annotation-xml",APPLET:"applet",AREA:"area",ARTICLE:"article",ASIDE:"aside",B:"b",BASE:"base",BASE
vendor: 7,587 bytes, line 119
119FONT:"basefont",BGSOUND:"bgsound",BIG:"big",BLOCKQUOTE:"blockquote",BODY:"body",BR:"br",BUTTON:"button",CAPTION:"caption",CENTER:"center",CODE:"code",COL:"col",COLGROUP:"colgroup",DD:"dd",DESC:"desc",DETAILS:"details",DIALOG:"dialog",DIR:"dir",DIV:"div",DL:"dl",DT:"dt",EM:"em",EMBED:"embed",FIELDSET:"fieldset",FIGCAPTION:"figcaption",FIGURE:"figure",FONT:"font",FOOTER:"footer",FOREIGN_OBJECT:"foreignObject",FORM:"form",FRAME:"frame",FRAMESET:"frameset",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",HEAD:"head",HEADER:"header",HGROUP:"hgroup",HR:"hr",HTML:"html",I:"i",IMG:"img",IMAGE:"image",INPUT:"input",IFRAME:"iframe",KEYGEN:"keygen",LABEL:"label",LI:"li",LINK:"link",LISTING:"listing",MAIN:"main",MALIGNMARK:"malignmark",MARQUEE:"marquee",MATH:"math",MENU:"menu",META:"meta",MGLYPH:"mglyph",MI:"mi",MO:"mo",MN:"mn",MS:"ms",MTEXT:"mtext",NAV:"nav",NOBR:"nobr",NOFRAMES:"noframes",NOEMBED:"noembed",NOSCRIPT:"noscript",OBJECT:"object",OL:"ol",OPTGROUP:"optgroup",OPTION:"option",P:"p",PARAM:"param",PLAINTEXT:"plaintext",PRE:"pre",RB:"rb",RP:"rp",RT:"rt",RTC:"rtc",RUBY:"ruby",S:"s",SCRIPT:"script",SECTION:"section",SELECT:"select",SOURCE:"source",SMALL:"small",SPAN:"span",STRIKE:"strike",STRONG:"strong",STYLE:"style",SUB:"sub",SUMMARY:"summary",SUP:"sup",TABLE:"table",TBODY:"tbody",TEMPLATE:"template",TEXTAREA:"textarea",TFOOT:"tfoot",TD:"td",TH:"th",THEAD:"thead",TITLE:"title",TR:"tr",TRACK:"track",TT:"tt",U:"u",UL:"ul",SVG:"svg",VAR:"var",WBR:"wbr",XMP:"xmp"};n.SPECIAL_ELEMENTS={[a.HTML]:{[o.ADDRESS]:!0,[o.APPLET]:!0,[o.AREA]:!0,[o.ARTICLE]:!0,[o.ASIDE]:!0,[o.BASE]:!0,[o.BASEFONT]:!0,[o.BGSOUND]:!0,[o.BLOCKQUOTE]:!0,[o.BODY]:!0,[o.BR]:!0,[o.BUTTON]:!0,[o.CAPTION]:!0,[o.CENTER]:!0,[o.COL]:!0,[o.COLGROUP]:!0,[o.DD]:!0,[o.DETAILS]:!0,[o.DIR]:!0,[o.DIV]:!0,[o.DL]:!0,[o.DT]:!0,[o.EMBED]:!0,[o.FIELDSET]:!0,[o.FIGCAPTION]:!0,[o.FIGURE]:!0,[o.FOOTER]:!0,[o.FORM]:!0,[o.FRAME]:!0,[o.FRAMESET]:!0,[o.H1]:!0,[o.H2]:!0,[o.H3]:!0,[o.H4]:!0,[o.H5]:!0,[o.H6]:!0,[o.HEAD]:!0,[o.HEADER]:!0,[o.HGROUP]:!0,[o.HR]:!0,[o.HTML]:!0,[o.IFRAME]:!0,[o.IMG]:!0,[o.INPUT]:!0,[o.LI]:!0,[o.LINK]:!0,[o.LISTING]:!0,[o.MAIN]:!0,[o.MARQUEE]:!0,[o.MENU]:!0,[o.META]:!0,[o.NAV]:!0,[o.NOEMBED]:!0,[o.NOFRAMES]:!0,[o.NOSCRIPT]:!0,[o.OBJECT]:!0,[o.OL]:!0,[o.P]:!0,[o.PARAM]:!0,[o.PLAINTEXT]:!0,[o.PRE]:!0,[o.SCRIPT]:!0,[o.SECTION]:!0,[o.SELECT]:!0,[o.SOURCE]:!0,[o.STYLE]:!0,[o.SUMMARY]:!0,[o.TABLE]:!0,[o.TBODY]:!0,[o.TD]:!0,[o.TEMPLATE]:!0,[o.TEXTAREA]:!0,[o.TFOOT]:!0,[o.TH]:!0,[o.THEAD]:!0,[o.TITLE]:!0,[o.TR]:!0,[o.TRACK]:!0,[o.UL]:!0,[o.WBR]:!0,[o.XMP]:!0},[a.MATHML]:{[o.MI]:!0,[o.MO]:!0,[o.MN]:!0,[o.MS]:!0,[o.MTEXT]:!0,[o.ANNOTATION_XML]:!0},[a.SVG]:{[o.TITLE]:!0,[o.FOREIGN_OBJECT]:!0,[o.DESC]:!0}}},951983,(i,r,n)=>{"use strict";let a=i.r(938759),o=a.TAG_NAMES,s=a.NAMESPACES;function l(i){switch(i.length){case 1:return i===o.P;case 2:return i===o.RB||i===o.RP||i===o.RT||i===o.DD||i===o.DT||i===o.LI;case 3:return i===o.RTC;case 6:return i===o.OPTION;case 8:return i===o.OPTGROUP}return!1}function u(i,r){switch(i.length){case 2:if(i===o.TD||i===o.TH)return r===s.HTML;if(i===o.MI||i===o.MO||i===o.MN||i===o.MS)return r===s.MATHML;break;case 4:if(i===o.HTML)return r===s.HTML;if(i===o.DESC)return r===s.SVG;break;case 5:if(i===o.TABLE)return r===s.HTML;if(i===o.MTEXT)return r===s.MATHML;if(i===o.TITLE)return r===s.SVG;break;case 6:return(i===o.APPLET||i===o.OBJECT)&&r===s.HTML;case 7:return(i===o.CAPTION||i===o.MARQUEE)&&r===s.HTML;case 8:return i===o.TEMPLATE&&r===s.HTML;case 13:return i===o.FOREIGN_OBJECT&&r===s.SVG;case 14:return i===o.ANNOTATION_XML&&r===s.MATHML}return!1}r.exports=class{constructor(i,r){this.stackTop=-1,this.items=[],this.current=i,this.currentTagName=null,this.currentTmplContent=null,this.tmplCount=0,this.treeAdapter=r}_indexOf(i){let r=-1;for(let n=this.stackTop;n>=0;n--)if(this.items[n]===i){r=n;break}return r}_isInTemplate(){return this.currentTagName===o.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===s.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagName=this.current&&this.treeAdapter.getTagName(this.current),this.currentTmplContent=this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):null}push(i){this.items[++this.stackTop]=i,this._updateCurrentElement(),this._isInTemplate()&&this.tmplCount++}pop(){this.stackTop--,this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this._updateCurrentElement()}replace(i,r){let n=this._indexOf(i);this.items[n]=r,n===this.stackTop&&this._updateCurrentElement()}insertAfter(i,r){let n=this._indexOf(i)+1;this.items.splice(n,0,r),n===++this.stackTop&&this._updateCurrentElement()}popUntilTagNamePopped(i){for(;this.stackTop>-1;){let r=this.currentTagName,n=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),r===i&&n===s.HTML)break}}popUntilElementPopped(i){for(;this.stackTop>-1;){let r=this.current;if(this.pop(),r===i)break}}popUntilNumberedHeaderPopped(){for(;this.stackTop>-1;){let i=this.currentTagName,r=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),i===o.H1||i===o.H2||i===o.H3||i===o.H4||i===o.H5||i===o.H6&&r===s.HTML)break}}popUntilTableCellPopped(){for(;this.stackTop>-1;){let i=this.currentTagName,r=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),i===o.TD||i===o.TH&&r===s.HTML)break}}popAllUpToHtmlElement(){this.stackTop=0,this._updateCurrentElement()}clearBackToTableContext(){for(;this.currentTagName!==o.TABLE&&this.currentTagName!==o.TEMPLATE&&this.currentTagName!==o.HTML||this.treeAdapter.getNamespaceURI(this.current)!==s.HTML;)this.pop()}clearBackToTableBodyContext(){for(;this.currentTagName!==o.TBODY&&this.currentTagName!==o.TFOOT&&this.currentTagName!==o.THEAD&&this.currentTagName!==o.TEMPLATE&&this.currentTagName!==o.HTML||this.treeAdapter.getNamespaceURI(this.current)!==s.HTML;)this.pop()}clearBackToTableRowContext(){for(;this.currentTagName!==o.TR&&this.currentTagName!==o.TEMPLATE&&this.currentTagName!==o.HTML||this.treeAdapter.getNamespaceURI(this.current)!==s.HTML;)this.pop()}remove(i){for(let r=this.stackTop;r>=0;r--)if(this.items[r]===i){this.items.splice(r,1),this.stackTop--,this._updateCurrentElement();break}}tryPeekProperlyNestedBodyElement(){let i=this.items[1];return i&&this.treeAdapter.getTagName(i)===o.BODY?i:null}contains(i){return this._indexOf(i)>-1}getCommonAncestor(i){let r=this._indexOf(i);return--r>=0?this.items[r]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.currentTagName===o.HTML}hasInScope(i){for(let r=this.stackTop;r>=0;r--){let n=this.treeAdapter.getTagName(this.items[r]),a=this.treeAdapter.getNamespaceURI(this.items[r]);if(n===i&&a===s.HTML)break;if(u(n,a))return!1}return!0}hasNumberedHeaderInScope(){for(let i=this.stackTop;i>=0;i--){let r=this.treeAdapter.getTagName(this.items[i]),n=this.treeAdapter.getNamespaceURI(this.items[i]);if((r===o.H1||r===o.H2||r===o.H3||r===o.H4||r===o.H5||r===o.H6)&&n===s.HTML)break;if(u(r,n))return!1}return!0}hasInListItemScope(i){for(let r=this.stackTop;r>=0;r--){let n=this.treeAdapter.getTagName(this.items[r]),a=this.treeAdapter.getNamespaceURI(this.items[r]);if(n===i&&a===s.HTML)break;if((n===o.UL||n===o.OL)&&a===s.HTML||u(n,a))return!1}return!0}hasInButtonScope(i){for(let r=this.stackTop;r>=0;r--){let n=this.treeAdapter.getTagName(this.items[r]),a=this.treeAdapter.getNamespaceURI(this.items[r]);if(n===i&&a===s.HTML)break;if(n===o.BUTTON&&a===s.HTML||u(n,a))return!1}return!0}hasInTableScope(i){for(let r=this.stackTop;r>=0;r--){let n=this.treeAdapter.getTagName(this.items[r]);if(this.treeAdapter.getNamespaceURI(this.items[r])===s.HTML){if(n===i)return!0;
119if(n===o.TABLE||n===o.TEMPLATE||n===o.HTML)return!1}}return!0}hasTableBodyContextInTableScope(){for(let i=this.stackTop;i>=0;i--){let r=this.treeAdapter.getTagName(this.items[i]);if(this.treeAdapter.getNamespaceURI(this.items[i])===s.HTML){if(r===o.TBODY||r===o.THEAD||r===o.TFOOT)return!0;if(r===o.TABLE||r===o.HTML)return!1}}return!0}hasInSelectScope(i){for(let r=this.stackTop;r>=0;r--){let n=this.treeAdapter.getTagName(this.items[r]);if(this.treeAdapter.getNamespaceURI(this.items[r])===s.HTML){if(n===i)return!0;if(n!==o.OPTION&&n!==o.OPTGROUP)return!1}}return!0}generateImpliedEndTags(){for(;l(this.currentTagName);)this.pop()}generateImpliedEndTagsThoroughly(){for(;function(i){switch(i.length){case 1:return i===o.P;case 2:return i===o.RB||i===o.RP||i===o.RT||i===o.DD||i===o.DT||i===o.LI||i===o.TD||i===o.TH||i===o.TR;case 3:return i===o.RTC;case 5:return i===o.TBODY||i===o.TFOOT||i===o.THEAD;case 6:return i===o.OPTION;case 7:return i===o.CAPTION;case 8:return i===o.OPTGROUP||i===o.COLGROUP}return!1}(this.currentTagName);)this.pop()}generateImpliedEndTagsWithExclusion(i){for(;l(this.currentTagName)&&this.currentTagName!==i;)this.pop()}}},173434,(i,r,n)=>{"use strict";class a{constructor(i){this.length=0,this.entries=[],this.treeAdapter=i,this.bookmark=null}_getNoahArkConditionCandidates(i){let r=[];if(this.length>=3){let n=this.treeAdapter.getAttrList(i).length,o=this.treeAdapter.getTagName(i),s=this.treeAdapter.getNamespaceURI(i);for(let i=this.length-1;i>=0;i--){let l=this.entries[i];if(l.type===a.MARKER_ENTRY)break;let u=l.element,c=this.treeAdapter.getAttrList(u);this.treeAdapter.getTagName(u)===o&&this.treeAdapter.getNamespaceURI(u)===s&&c.length===n&&r.push({idx:i,attrs:c})}}return r.length<3?[]:r}_ensureNoahArkCondition(i){let r=this._getNoahArkConditionCandidates(i),n=r.length;if(n){let a=this.treeAdapter.getAttrList(i),o=a.length,s=Object.create(null);for(let i=0;i<o;i++){let r=a[i];s[r.name]=r.value}for(let i=0;i<o;i++)for(let a=0;a<n;a++){let o=r[a].attrs[i];if(s[o.name]!==o.value&&(r.splice(a,1),n--),r.length<3)return}for(let i=n-1;i>=2;i--)this.entries.splice(r[i].idx,1),this.length--}}insertMarker(){this.entries.push({type:a.MARKER_ENTRY}),this.length++}pushElement(i,r){this._ensureNoahArkCondition(i),this.entries.push({type:a.ELEMENT_ENTRY,element:i,token:r}),this.length++}insertElementAfterBookmark(i,r){let n=this.length-1;for(;n>=0&&this.entries[n]!==this.bookmark;n--);this.entries.splice(n+1,0,{type:a.ELEMENT_ENTRY,element:i,token:r}),this.length++}removeEntry(i){for(let r=this.length-1;r>=0;r--)if(this.entries[r]===i){this.entries.splice(r,1),this.length--;break}}clearToLastMarker(){for(;this.length;){let i=this.entries.pop();if(this.length--,i.type===a.MARKER_ENTRY)break}}getElementEntryInScopeWithTagName(i){for(let r=this.length-1;r>=0;r--){let n=this.entries[r];if(n.type===a.MARKER_ENTRY)break;if(this.treeAdapter.getTagName(n.element)===i)return n}return null}getElementEntry(i){for(let r=this.length-1;r>=0;r--){let n=this.entries[r];if(n.type===a.ELEMENT_ENTRY&&n.element===i)return n}return null}}a.MARKER_ENTRY="MARKER_ENTRY",a.ELEMENT_ENTRY="ELEMENT_ENTRY",r.exports=a},549113,(i,r,n)=>{"use strict";class a{constructor(i){const r={},n=this._getOverriddenMethods(this,r);for(const a of Object.keys(n))"function"==typeof n[a]&&(r[a]=i[a],i[a]=n[a])}_getOverriddenMethods(){throw Error("Not implemented")}}a.install=function(i,r,n){i.__mixins||(i.__mixins=[]);for(let n=0;n<i.__mixins.length;n++)if(i.__mixins[n].constructor===r)return i.__mixins[n];let a=new r(i,n);return i.__mixins.push(a),a},r.exports=a},102452,(i,r,n)=>{"use strict";let a=i.r(549113);r.exports=class extends a{constructor(i){super(i),this.preprocessor=i,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.offset=0,this.col=0,this.line=1}_getOverriddenMethods(i,r){return{advance(){let n=this.pos+1,a=this.html[n];return i.isEol&&(i.isEol=!1,i.line++,i.lineStartPos=n),("\n"===a||"\r"===a&&"\n"!==this.html[n+1])&&(i.isEol=!0),i.col=n-i.lineStartPos+1,i.offset=i.droppedBufferSize+n,r.advance.call(this)},retreat(){r.retreat.call(this),i.isEol=!1,i.col=this.pos-i.lineStartPos+1},dropParsedChunk(){let n=this.pos;r.dropParsedChunk.call(this);let a=n-this.pos;i.lineStartPos-=a,i.droppedBufferSize+=a,i.offset=i.droppedBufferSize+this.pos}}}}},683556,(i,r,n)=>{"use strict";let a=i.r(549113),o=i.r(869768),s=i.r(102452);r.exports=class extends a{constructor(i){super(i),this.tokenizer=i,this.posTracker=a.install(i.preprocessor,s),this.currentAttrLocation=null,this.ctLoc=null}_getCurrentLocation(){return{startLine:this.posTracker.line,startCol:this.posTracker.col,startOffset:this.posTracker.offset,endLine:-1,endCol:-1,endOffset:-1}}_attachCurrentAttrLocationInfo(){this.currentAttrLocation.endLine=this.posTracker.line,this.currentAttrLocation.endCol=this.posTracker.col,this.currentAttrLocation.endOffset=this.posTracker.offset;let i=this.tokenizer.currentToken,r=this.tokenizer.currentAttr;i.location.attrs||(i.location.attrs=Object.create(null)),i.location.attrs[r.name]=this.currentAttrLocation}_getOverriddenMethods(i,r){let n={_createStartTagToken(){r._createStartTagToken.call(this),this.currentToken.location=i.ctLoc},_createEndTagToken(){r._createEndTagToken.call(this),this.currentToken.location=i.ctLoc},_createCommentToken(){r._createCommentToken.call(this),this.currentToken.location=i.ctLoc},_createDoctypeToken(n){r._createDoctypeToken.call(this,n),this.currentToken.location=i.ctLoc},_createCharacterToken(n,a){r._createCharacterToken.call(this,n,a),this.currentCharacterToken.location=i.ctLoc},_createEOFToken(){r._createEOFToken.call(this),this.currentToken.location=i._getCurrentLocation()},_createAttr(n){r._createAttr.call(this,n),i.currentAttrLocation=i._getCurrentLocation()},_leaveAttrName(n){r._leaveAttrName.call(this,n),i._attachCurrentAttrLocationInfo()},_leaveAttrValue(n){r._leaveAttrValue.call(this,n),i._attachCurrentAttrLocationInfo()},_emitCurrentToken(){let n=this.currentToken.location;this.currentCharacterToken&&(this.currentCharacterToken.location.endLine=n.startLine,this.currentCharacterToken.location.endCol=n.startCol,this.currentCharacterToken.location.endOffset=n.startOffset),this.currentToken.type===o.EOF_TOKEN?(n.endLine=n.startLine,n.endCol=n.startCol,n.endOffset=n.startOffset):(n.endLine=i.posTracker.line,n.endCol=i.posTracker.col+1,n.endOffset=i.posTracker.offset+1),r._emitCurrentToken.call(this)},_emitCurrentCharacterToken(){let n=this.currentCharacterToken&&this.currentCharacterToken.location;n&&-1===n.endOffset&&(n.endLine=i.posTracker.line,n.endCol=i.posTracker.col,n.endOffset=i.posTracker.offset),r._emitCurrentCharacterToken.call(this)}};
119return Object.keys(o.MODE).forEach(a=>{let s=o.MODE[a];n[s]=function(n){i.ctLoc=i._getCurrentLocation(),r[s].call(this,n)}}),n}}},636928,(i,r,n)=>{"use strict";let a=i.r(549113);r.exports=class extends a{constructor(i,r){super(i),this.onItemPop=r.onItemPop}_getOverriddenMethods(i,r){return{pop(){i.onItemPop(this.current),r.pop.call(this)},popAllUpToHtmlElement(){for(let r=this.stackTop;r>0;r--)i.onItemPop(this.items[r]);r.popAllUpToHtmlElement.call(this)},remove(n){i.onItemPop(this.current),r.remove.call(this,n)}}}}},991260,(i,r,n)=>{"use strict";let a=i.r(549113),o=i.r(869768),s=i.r(683556),l=i.r(636928),u=i.r(938759).TAG_NAMES;r.exports=class extends a{constructor(i){super(i),this.parser=i,this.treeAdapter=this.parser.treeAdapter,this.posTracker=null,this.lastStartTagToken=null,this.lastFosterParentingLocation=null,this.currentToken=null}_setStartLocation(i){let r=null;this.lastStartTagToken&&((r=Object.assign({},this.lastStartTagToken.location)).startTag=this.lastStartTagToken.location),this.treeAdapter.setNodeSourceCodeLocation(i,r)}_setEndLocation(i,r){if(this.treeAdapter.getNodeSourceCodeLocation(i)&&r.location){let n=r.location,a=this.treeAdapter.getTagName(i),s=r.type===o.END_TAG_TOKEN&&a===r.tagName,l={};s?(l.endTag=Object.assign({},n),l.endLine=n.endLine,l.endCol=n.endCol,l.endOffset=n.endOffset):(l.endLine=n.startLine,l.endCol=n.startCol,l.endOffset=n.startOffset),this.treeAdapter.updateNodeSourceCodeLocation(i,l)}}_getOverriddenMethods(i,r){return{_bootstrap(n,o){r._bootstrap.call(this,n,o),i.lastStartTagToken=null,i.lastFosterParentingLocation=null,i.currentToken=null,i.posTracker=a.install(this.tokenizer,s).posTracker,a.install(this.openElements,l,{onItemPop:function(r){i._setEndLocation(r,i.currentToken)}})},_runParsingLoop(n){r._runParsingLoop.call(this,n);for(let r=this.openElements.stackTop;r>=0;r--)i._setEndLocation(this.openElements.items[r],i.currentToken)},_processTokenInForeignContent(n){i.currentToken=n,r._processTokenInForeignContent.call(this,n)},_processToken(n){if(i.currentToken=n,r._processToken.call(this,n),n.type===o.END_TAG_TOKEN&&(n.tagName===u.HTML||n.tagName===u.BODY&&this.openElements.hasInScope(u.BODY)))for(let r=this.openElements.stackTop;r>=0;r--){let a=this.openElements.items[r];if(this.treeAdapter.getTagName(a)===n.tagName){i._setEndLocation(a,n);break}}},_setDocumentType(i){r._setDocumentType.call(this,i);let n=this.treeAdapter.getChildNodes(this.document),a=n.length;for(let r=0;r<a;r++){let a=n[r];if(this.treeAdapter.isDocumentTypeNode(a)){this.treeAdapter.setNodeSourceCodeLocation(a,i.location);break}}},_attachElementToTree(n){i._setStartLocation(n),i.lastStartTagToken=null,r._attachElementToTree.call(this,n)},_appendElement(n,a){i.lastStartTagToken=n,r._appendElement.call(this,n,a)},_insertElement(n,a){i.lastStartTagToken=n,r._insertElement.call(this,n,a)},_insertTemplate(n){i.lastStartTagToken=n,r._insertTemplate.call(this,n);let a=this.treeAdapter.getTemplateContent(this.openElements.current);this.treeAdapter.setNodeSourceCodeLocation(a,null)},_insertFakeRootElement(){r._insertFakeRootElement.call(this),this.treeAdapter.setNodeSourceCodeLocation(this.openElements.current,null)},_appendCommentNode(i,n){r._appendCommentNode.call(this,i,n);let a=this.treeAdapter.getChildNodes(n),o=a[a.length-1];this.treeAdapter.setNodeSourceCodeLocation(o,i.location)},_findFosterParentingLocation(){return i.lastFosterParentingLocation=r._findFosterParentingLocation.call(this),i.lastFosterParentingLocation},_insertCharacters(n){r._insertCharacters.call(this,n);let a=this._shouldFosterParentOnInsertion(),o=a&&i.lastFosterParentingLocation.parent||this.openElements.currentTmplContent||this.openElements.current,s=this.treeAdapter.getChildNodes(o),l=a&&i.lastFosterParentingLocation.beforeElement?s.indexOf(i.lastFosterParentingLocation.beforeElement)-1:s.length-1,u=s[l];if(this.treeAdapter.getNodeSourceCodeLocation(u)){let{endLine:i,endCol:r,endOffset:a}=n.location;this.treeAdapter.updateNodeSourceCodeLocation(u,{endLine:i,endCol:r,endOffset:a})}else this.treeAdapter.setNodeSourceCodeLocation(u,n.location)}}}}},123613,(i,r,n)=>{"use strict";let a=i.r(549113);r.exports=class extends a{constructor(i,r){super(i),this.posTracker=null,this.onParseError=r.onParseError}_setErrorLocation(i){i.startLine=i.endLine=this.posTracker.line,i.startCol=i.endCol=this.posTracker.col,i.startOffset=i.endOffset=this.posTracker.offset}_reportError(i){let r={code:i,startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1};this._setErrorLocation(r),this.onParseError(r)}_getOverriddenMethods(i){return{_err(r){i._reportError(r)}}}}},867952,(i,r,n)=>{"use strict";let a=i.r(123613),o=i.r(102452),s=i.r(549113);r.exports=class extends a{constructor(i,r){super(i,r),this.posTracker=s.install(i,o),this.lastErrOffset=-1}_reportError(i){this.lastErrOffset!==this.posTracker.offset&&(this.lastErrOffset=this.posTracker.offset,super._reportError(i))}}},990066,(i,r,n)=>{"use strict";let a=i.r(123613),o=i.r(867952),s=i.r(549113);r.exports=class extends a{constructor(i,r){super(i,r);const n=s.install(i.preprocessor,o,r);this.posTracker=n.posTracker}}},720042,(i,r,n)=>{"use strict";let a=i.r(123613),o=i.r(990066),s=i.r(683556),l=i.r(549113);r.exports=class extends a{constructor(i,r){super(i,r),this.opts=r,this.ctLoc=null,this.locBeforeToken=!1}_setErrorLocation(i){this.ctLoc&&(i.startLine=this.ctLoc.startLine,i.startCol=this.ctLoc.startCol,i.startOffset=this.ctLoc.startOffset,i.endLine=this.locBeforeToken?this.ctLoc.startLine:this.ctLoc.endLine,i.endCol=this.locBeforeToken?this.ctLoc.startCol:this.ctLoc.endCol,i.endOffset=this.locBeforeToken?this.ctLoc.startOffset:this.ctLoc.endOffset)}_getOverriddenMethods(i,r){return{_bootstrap(n,a){r._bootstrap.call(this,n,a),l.install(this.tokenizer,o,i.opts),l.install(this.tokenizer,s)}
119,_processInputToken(n){i.ctLoc=n.location,r._processInputToken.call(this,n)},_err(r,n){i.locBeforeToken=n&&n.beforeToken,i._reportError(r)}}}}},462720,(i,r,n)=>{"use strict";let{DOCUMENT_MODE:a}=i.r(938759);n.createDocument=function(){return{nodeName:"#document",mode:a.NO_QUIRKS,childNodes:[]}},n.createDocumentFragment=function(){return{nodeName:"#document-fragment",childNodes:[]}},n.createElement=function(i,r,n){return{nodeName:i,tagName:i,attrs:n,namespaceURI:r,childNodes:[],parentNode:null}},n.createCommentNode=function(i){return{nodeName:"#comment",data:i,parentNode:null}};let o=function(i){return{nodeName:"#text",value:i,parentNode:null}},s=n.appendChild=function(i,r){i.childNodes.push(r),r.parentNode=i},l=n.insertBefore=function(i,r,n){let a=i.childNodes.indexOf(n);i.childNodes.splice(a,0,r),r.parentNode=i};n.setTemplateContent=function(i,r){i.content=r},n.getTemplateContent=function(i){return i.content},n.setDocumentType=function(i,r,n,a){let o=null;for(let r=0;r<i.childNodes.length;r++)if("#documentType"===i.childNodes[r].nodeName){o=i.childNodes[r];break}o?(o.name=r,o.publicId=n,o.systemId=a):s(i,{nodeName:"#documentType",name:r,publicId:n,systemId:a})},n.setDocumentMode=function(i,r){i.mode=r},n.getDocumentMode=function(i){return i.mode},n.detachNode=function(i){if(i.parentNode){let r=i.parentNode.childNodes.indexOf(i);i.parentNode.childNodes.splice(r,1),i.parentNode=null}},n.insertText=function(i,r){if(i.childNodes.length){let n=i.childNodes[i.childNodes.length-1];if("#text"===n.nodeName){n.value+=r;return}}s(i,o(r))},n.insertTextBefore=function(i,r,n){let a=i.childNodes[i.childNodes.indexOf(n)-1];a&&"#text"===a.nodeName?a.value+=r:l(i,o(r),n)},n.adoptAttributes=function(i,r){let n=[];for(let r=0;r<i.attrs.length;r++)n.push(i.attrs[r].name);for(let a=0;a<r.length;a++)-1===n.indexOf(r[a].name)&&i.attrs.push(r[a])},n.getFirstChild=function(i){return i.childNodes[0]},n.getChildNodes=function(i){return i.childNodes},n.getParentNode=function(i){return i.parentNode},n.getAttrList=function(i){return i.attrs},n.getTagName=function(i){return i.tagName},n.getNamespaceURI=function(i){return i.namespaceURI},n.getTextNodeContent=function(i){return i.value},n.getCommentNodeContent=function(i){return i.data},n.getDocumentTypeNodeName=function(i){return i.name},n.getDocumentTypeNodePublicId=function(i){return i.publicId},n.getDocumentTypeNodeSystemId=function(i){return i.systemId},n.isTextNode=function(i){return"#text"===i.nodeName},n.isCommentNode=function(i){return"#comment"===i.nodeName},n.isDocumentTypeNode=function(i){return"#documentType"===i.nodeName},n.isElementNode=function(i){return!!i.tagName},n.setNodeSourceCodeLocation=function(i,r){i.sourceCodeLocation=r},n.getNodeSourceCodeLocation=function(i){return i.sourceCodeLocation},n.updateNodeSourceCodeLocation=function(i,r){i.sourceCodeLocation=Object.assign(i.sourceCodeLocation,r)}},706853,(i,r,n)=>{"use strict";r.exports=function(i,r){return[i,r=r||Object.create(null)].reduce((i,r)=>(Object.keys(r).forEach(n=>{i[n]=r[n]}),i),Object.create(null))}},643431,(i,r,n)=>{"use strict";let{DOCUMENT_MODE:a}=i.r(938759),o="html",s=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],l=s.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]),u=["-/
119/w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"],c=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],d=c.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]);function h(i){let r=-1!==i.indexOf('"')?"'":'"';return r+i+r}function f(i,r){for(let n=0;n<r.length;n++)if(0===i.indexOf(r[n]))return!0;return!1}n.isConforming=function(i){return i.name===o&&null===i.publicId&&(null===i.systemId||"about:legacy-compat"===i.systemId)},n.getDocumentMode=function(i){if(i.name!==o)return a.QUIRKS;let r=i.systemId;if(r&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===r.toLowerCase())return a.QUIRKS;let n=i.publicId;if(null!==n){if(n=n.toLowerCase(),u.indexOf(n)>-1)return a.QUIRKS;let i=null===r?l:s;if(f(n,i))return a.QUIRKS;if(f(n,i=null===r?c:d))return a.LIMITED_QUIRKS}return a.NO_QUIRKS},n.serializeContent=function(i,r,n){let a="!DOCTYPE ";return i&&(a+=i),r?a+=" PUBLIC "+h(r):n&&(a+=" SYSTEM"),null!==n&&(a+=" "+h(n)),a}},70715,(i,r,n)=>{"use strict";let a=i.r(869768),o=i.r(938759),s=o.TAG_NAMES,l=o.NAMESPACES,u=o.ATTRS,c={attributename:"attributeName",attributetype:"attributeType",basefrequency:"baseFrequency",baseprofile:"baseProfile",calcmode:"calcMode",clippathunits:"clipPathUnits",diffuseconstant:"diffuseConstant",edgemode:"edgeMode",filterunits:"filterUnits",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",limitingconeangle:"limitingConeAngle",markerheight:"markerHeight",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textlength:"textLength",viewbox:"viewBox",viewtarget:"viewTarget",xchannelselector:"xChannelSelector",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan"},d={"xlink:actuate":{prefix:"xlink",name:"actuate",namespace:l.XLINK},"xlink:arcrole":{prefix:"xlink",name:"arcrole",namespace:l.XLINK},"xlink:href":{prefix:"xlink",name:"href",namespace:l.XLINK},"xlink:role":{prefix:"xlink",name:"role",namespace:l.XLINK},"xlink:show":{prefix:"xlink",name:"show",namespace:l.XLINK},"xlink:title":{prefix:"xlink",name:"title",namespace:l.XLINK},"xlink:type":{prefix:"xlink",name:"type",namespace:l.XLINK}
119,"xml:base":{prefix:"xml",name:"base",namespace:l.XML},"xml:lang":{prefix:"xml",name:"lang",namespace:l.XML},"xml:space":{prefix:"xml",name:"space",namespace:l.XML},xmlns:{prefix:"",name:"xmlns",namespace:l.XMLNS},"xmlns:xlink":{prefix:"xmlns",name:"xlink",namespace:l.XMLNS}},h=n.SVG_TAG_NAMES_ADJUSTMENT_MAP={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient",textpath:"textPath"},f={[s.B]:!0,[s.BIG]:!0,[s.BLOCKQUOTE]:!0,[s.BODY]:!0,[s.BR]:!0,[s.CENTER]:!0,[s.CODE]:!0,[s.DD]:!0,[s.DIV]:!0,[s.DL]:!0,[s.DT]:!0,[s.EM]:!0,[s.EMBED]:!0,[s.H1]:!0,[s.H2]:!0,[s.H3]:!0,[s.H4]:!0,[s.H5]:!0,[s.H6]:!0,[s.HEAD]:!0,[s.HR]:!0,[s.I]:!0,[s.IMG]:!0,[s.LI]:!0,[s.LISTING]:!0,[s.MENU]:!0,[s.META]:!0,[s.NOBR]:!0,[s.OL]:!0,[s.P]:!0,[s.PRE]:!0,[s.RUBY]:!0,[s.S]:!0,[s.SMALL]:!0,[s.SPAN]:!0,[s.STRONG]:!0,[s.STRIKE]:!0,[s.SUB]:!0,[s.SUP]:!0,[s.TABLE]:!0,[s.TT]:!0,[s.U]:!0,[s.UL]:!0,[s.VAR]:!0};n.causesExit=function(i){let r=i.tagName;return r===s.FONT&&(null!==a.getTokenAttr(i,u.COLOR)||null!==a.getTokenAttr(i,u.SIZE)||null!==a.getTokenAttr(i,u.FACE))||f[r]},n.adjustTokenMathMLAttrs=function(i){for(let r=0;r<i.attrs.length;r++)if("definitionurl"===i.attrs[r].name){i.attrs[r].name="definitionURL";break}},n.adjustTokenSVGAttrs=function(i){for(let r=0;r<i.attrs.length;r++){let n=c[i.attrs[r].name];n&&(i.attrs[r].name=n)}},n.adjustTokenXMLAttrs=function(i){for(let r=0;r<i.attrs.length;r++){let n=d[i.attrs[r].name];n&&(i.attrs[r].prefix=n.prefix,i.attrs[r].name=n.name,i.attrs[r].namespace=n.namespace)}},n.adjustTokenSVGTagName=function(i){let r=h[i.tagName];r&&(i.tagName=r)},n.isIntegrationPoint=function(i,r,n,a){return!!((!a||a===l.HTML)&&function(i,r,n){if(r===l.MATHML&&i===s.ANNOTATION_XML){for(let i=0;i<n.length;i++)if(n[i].name===u.ENCODING){let r=n[i].value.toLowerCase();return"text/html"===r||"application/xhtml+xml"===r}}return r===l.SVG&&(i===s.FOREIGN_OBJECT||i===s.DESC||i===s.TITLE)}(i,r,n))||(!a||a===l.MATHML)&&r===l.MATHML&&(i===s.MI||i===s.MO||i===s.MN||i===s.MS||i===s.MTEXT)||!1}},681684,(i,r,n)=>{"use strict";let a=i.r(869768),o=i.r(951983),s=i.r(173434),l=i.r(991260),u=i.r(720042),c=i.r(549113),d=i.r(462720),h=i.r(706853),f=i.r(643431),p=i.r(70715),m=i.r(369264),g=i.r(567303),_=i.r(938759),y=_.TAG_NAMES,v=_.NAMESPACES,x=_.ATTRS,b={scriptingEnabled:!0,sourceCodeLocationInfo:!1,onParseError:null,treeAdapter:d},w="hidden",T="INITIAL_MODE",E="BEFORE_HTML_MODE",S="BEFORE_HEAD_MODE",A="IN_HEAD_MODE",C="IN_HEAD_NO_SCRIPT_MODE",I="AFTER_HEAD_MODE",k="IN_BODY_MODE",R="TEXT_MODE",M="IN_TABLE_MODE",L="IN_TABLE_TEXT_MODE",P="IN_CAPTION_MODE",O="IN_COLUMN_GROUP_MODE",D="IN_TABLE_BODY_MODE",F="IN_ROW_MODE",N="IN_CELL_MODE",j="IN_SELECT_MODE",z="IN_SELECT_IN_TABLE_MODE",B="IN_TEMPLATE_MODE",U="AFTER_BODY_MODE",V="IN_FRAMESET_MODE",H="AFTER_FRAMESET_MODE",G="AFTER_AFTER_BODY_MODE",q="AFTER_AFTER_FRAMESET_MODE",$={[y.TR]:F,[y.TBODY]:D,[y.THEAD]:D,[y.TFOOT]:D,[y.CAPTION]:P,[y.COLGROUP]:O,[y.TABLE]:M,[y.BODY]:k,[y.FRAMESET]:V},W={[y.CAPTION]:M,[y.COLGROUP]:M,[y.TBODY]:M,[y.TFOOT]:M,[y.THEAD]:M,[y.COL]:O,[y.TR]:D,[y.TD]:F,[y.TH]:F},Y={[T]:{[a.CHARACTER_TOKEN]:ei,[a.NULL_CHARACTER_TOKEN]:ei,[a.WHITESPACE_CHARACTER_TOKEN]:K,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:function(i,r){i._setDocumentType(r);let n=r.forceQuirks?_.DOCUMENT_MODE.QUIRKS:f.getDocumentMode(r);f.isConforming(r)||i._err(m.nonConformingDoctype),i.treeAdapter.setDocumentMode(i.document,n),i.insertionMode=E},[a.START_TAG_TOKEN]:ei,[a.END_TAG_TOKEN]:ei,[a.EOF_TOKEN]:ei},[E]:{[a.CHARACTER_TOKEN]:er,[a.NULL_CHARACTER_TOKEN]:er,[a.WHITESPACE_CHARACTER_TOKEN]:K,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:function(i,r){r.tagName===y.HTML?(i._insertElement(r,v.HTML),i.insertionMode=S):er(i,r)},[a.END_TAG_TOKEN]:function(i,r){let n=r.tagName;(n===y.HTML||n===y.HEAD||n===y.BODY||n===y.BR)&&er(i,r)},[a.EOF_TOKEN]:er},[S]:{[a.CHARACTER_TOKEN]:en,[a.NULL_CHARACTER_TOKEN]:en,[a.WHITESPACE_CHARACTER_TOKEN]:K,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:X,[a.START_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.HTML?ew(i,r):n===y.HEAD?(i._insertElement(r,v.HTML),i.headElement=i.openElements.current,i.insertionMode=A):en(i,r)},[a.END_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.HEAD||n===y.BODY||n===y.HTML||n===y.BR?en(i,r):i._err(m.endTagWithoutMatchingOpenElement)},[a.EOF_TOKEN]:en},[A]:{[a.CHARACTER_TOKEN]:es,[a.NULL_CHARACTER_TOKEN]:es,[a.WHITESPACE_CHARACTER_TOKEN]:ee,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:X,[a.START_TAG_TOKEN]:ea,[a.END_TAG_TOKEN]:eo,[a.EOF_TOKEN]:es},[C]:{[a.CHARACTER_TOKEN]:el,[a.NULL_CHARACTER_TOKEN]:el,[a.WHITESPACE_CHARACTER_TOKEN]:ee,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:X,[a.START_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.HTML?ew(i,r):n===y.BASEFONT||n===y.BGSOUND||n===y.HEAD||n===y.LINK||n===y.META||n===y.NOFRAMES||n===y.STYLE?ea(i,r):n===y.NOSCRIPT?i._err(m.nestedNoscriptInHead):el(i,r)},[a.END_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.NOSCRIPT?(i.openElements.pop(),i.insertionMode=A):n===y.BR?el(i,r):i._err(m.endTagWithoutMatchingOpenElement)},[a.EOF_TOKEN]:el},[I]:{[a.CHARACTER_TOKEN]:eu,[a.NULL_CHARACTER_TOKEN]:eu,[a.WHITESPACE_CHARACTER_TOKEN]:ee,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:X,[a.START_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.HTML?ew(i,r):n===y.BODY?(i._insertElement(r,v.HTML),i.framesetOk=!1,i.insertionMode=k):n===y.FRAMESET?(i._insertElement(r,v.HTML),i.insertionMode=V):n===y.BASE||n===y.BASEFONT||n===y.BGSOUND||n===y.LINK||n===y.META||n===y.NOFRAMES||n===y.SCRIPT||n===y.STYLE||n===y.TEMPLATE||n===y.TITLE?(i._err(m.abandonedHeadElementChild),i.openElements.push(i.headElement),ea(i,r),i.openElements.remove(i.headElement)):n===y.HEAD?i._err(m.misplacedStartTagForHeadElement):eu(i,r)},[a.END_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.BODY||n===y.HTML||n===y.BR?eu(i,r):n===y.TEMPLATE?eo(i,r):i._err(m.endTagWithoutMatchingOpenElement)},[a.EOF_TOKEN]:eu},[k]:{[a.CHARACTER_TOKEN]:ed,[a.NULL_CHARACTER_TOKEN]:K,[a.WHITESPACE_CHARACTER_TOKEN]:ec,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:ew,[a.END_TAG_TOKEN]:eA,[a.EOF_TOKEN]:eC},[R]:{[a.CHARACTER_TOKEN]:ee,[a.NULL_CHARACTER_TOKEN]:ee,[a.WHITESPACE_CHARACTER_TOKEN]:ee,[a.COMMENT_TOKEN]:K,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:K,[a.END_TAG_TOKEN]:function(i,r){r.tagName===y.SCRIPT&&(i.pendingScript=i.openElements.current),i.openElements.pop(),i.insertionMode=i.originalInsertionMode},[a.EOF_TOKEN]:function(i,r){i._err(m.eofInElementThatCanContainOnlyText),i.openElements.pop(),i.insertionMode=i.originalInsertionMode,i._processToken(r)}},[M]:{[a.CHARACTER_TOKEN]:eI,[a.NULL_CHARACTER_TOKEN]:eI,[a.WHITESPACE_CHARACTER_TOKEN]:eI,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:ek,[a.END_TAG_TOKEN]:eR,[a.EOF_TOKEN]:eC},[L]:{[a.CHARACTER_TOKEN]:function(i,r){i.pendingCharacterTokens.push(r),i.hasNonWhitespacePendingCharacterToken=!0},[a.NULL_CHARACTER_TOKEN]:K,[a.WHITESPACE_CHARACTER_TOKEN]:function(i,r){i.pendingCharacterTokens.push(r)},[a.COMMENT_TOKEN]:eL,[a.DOCTYPE_TOKEN]:eL,[a.START_TAG_TOKEN]:eL,[a.END_TAG_TOKEN]:eL,[a.EOF_TOKEN]:eL},[P]:{[a.CHARACTER_TOKEN]:ed,[a.NULL_CHARACTER_TOKEN]:K,[a.WHITESPACE_CHARACTER_TOKEN]:ec,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.CAPTION||n===y.COL||n===y.COLGROUP||n===y.TBODY||n===y.TD||n===y.TFOOT||n===y.TH||n===y.THEAD||n===y.TR?i.openElements.hasInTableScope(y.CAPTION)&&(i.openElements.generateImpliedEndTags(),i.openElements.popUntilTagNamePopped(y.CAPTION),i.activeFormattingElements.clearToLastMarker(),i.insertionMode=M,i._processToken(r)):ew(i,r)},[a.END_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.CAPTION||n===y.TABLE?i.openElements.hasInTableScope(y.CAPTION)&&(i.openElements.generateImpliedEndTags(),i.openElements.popUntilTagNamePopped(y.CAPTION),i.activeFormattingElements.clearToLastMarker(),i.insertionMode=M,n===y.TABLE&&i._processToken(r)):n!==y.BODY&&n!==y.COL&&n!==y.COLGROUP&&n!==y.HTML&&n!==y.TBODY&&n!==y.TD&&n!==y.TFOOT&&n!==y.TH&&n!==y.THEAD&&n!==y.TR&&eA(i,r)},[a.EOF_TOKEN]:eC},[O]:{[a.CHARACTER_TOKEN]:eP,[a.NULL_CHARACTER_TOKEN]:eP,[a.WHITESPACE_CHARACTER_TOKEN]:ee,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.HTML?ew(i,r):n===y.COL?(i._appendElement(r,v.HTML),r.ackSelfClosing=!0):n===y.TEMPLATE?ea(i,r):eP(i,r)},[a.END_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.COLGROUP?i.openElements.currentTagName===y.COLGROUP&&(i.openElements.pop(),i.insertionMode=M):n===y.TEMPLATE?eo(i,r):n!==y.COL&&eP(i,r)},[a.EOF_TOKEN]:eC},[D]:{[a.CHARACTER_TOKEN]:eI,[a.NULL_CHARACTER_TOKEN]:eI,[a.WHITESPACE_CHARACTER_TOKEN]:eI,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.TR?(i.openElements.clearBackToTableBodyContext(),i._insertElement(r,v.HTML),i.insertionMode=F):n===y.TH||n===y.TD?(i.openElements.clearBackToTableBodyContext(),i._insertFakeElement(y.TR),i.insertionMode=F,i._processToken(r)):n===y.CAPTION||n===y.COL||n===y.COLGROUP||n===y.TBODY||n===y.TFOOT||n===y.THEAD?i.openElements.hasTableBodyContextInTableScope()&&(i.openElements.clearBackToTableBodyContext(),i.openElements.pop(),i.insertionMode=M,i._processToken(r)):ek(i,r)},[a.END_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.TBODY||n===y.TFOOT||n===y.THEAD?i.openElements.hasInTableScope(n)&&(i.openElements.clearBackToTableBodyContext(),i.openElements.pop(),i.insertionMode=M):n===y.TABLE?i.openElements.hasTableBodyContextInTableScope()&&(i.openElements.clearBackToTableBodyContext(),i.openElements.pop(),i.insertionMode=M,i._processToken(r)):(n!==y.BODY&&n!==y.CAPTION&&n!==y.COL&&n!==y.COLGROUP||n!==y.HTML&&n!==y.TD&&n!==y.TH&&n!==y.TR)&&eR(i,r)},[a.EOF_TOKEN]:eC},[F]:{[a.CHARACTER_TOKEN]:eI,[a.NULL_CHARACTER_TOKEN]:eI,[a.WHITESPACE_CHARACTER_TOKEN]:eI,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.TH||n===y.TD?(i.openElements.clearBackToTableRowContext(),i._insertElement(r,v.HTML),i.insertionMode=N,i.activeFormattingElements.insertMarker()):n===y.CAPTION||n===y.COL||n===y.COLGROUP||n===y.TBODY||n===y.TFOOT||n===y.THEAD||n===y.TR?i.openElements.hasInTableScope(y.TR)&&(i.openElements.clearBackToTableRowContext(),i.openElements.pop(),i.insertionMode=D,i._processToken(r)):ek(i,r)},[a.END_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.TR?i.openElements.hasInTableScope(y.TR)&&(i.openElements.clearBackToTableRowContext(),i.openElements.pop(),i.insertionMode=D
119):n===y.TABLE?i.openElements.hasInTableScope(y.TR)&&(i.openElements.clearBackToTableRowContext(),i.openElements.pop(),i.insertionMode=D,i._processToken(r)):n===y.TBODY||n===y.TFOOT||n===y.THEAD?(i.openElements.hasInTableScope(n)||i.openElements.hasInTableScope(y.TR))&&(i.openElements.clearBackToTableRowContext(),i.openElements.pop(),i.insertionMode=D,i._processToken(r)):(n!==y.BODY&&n!==y.CAPTION&&n!==y.COL&&n!==y.COLGROUP||n!==y.HTML&&n!==y.TD&&n!==y.TH)&&eR(i,r)},[a.EOF_TOKEN]:eC},[N]:{[a.CHARACTER_TOKEN]:ed,[a.NULL_CHARACTER_TOKEN]:K,[a.WHITESPACE_CHARACTER_TOKEN]:ec,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.CAPTION||n===y.COL||n===y.COLGROUP||n===y.TBODY||n===y.TD||n===y.TFOOT||n===y.TH||n===y.THEAD||n===y.TR?(i.openElements.hasInTableScope(y.TD)||i.openElements.hasInTableScope(y.TH))&&(i._closeTableCell(),i._processToken(r)):ew(i,r)},[a.END_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.TD||n===y.TH?i.openElements.hasInTableScope(n)&&(i.openElements.generateImpliedEndTags(),i.openElements.popUntilTagNamePopped(n),i.activeFormattingElements.clearToLastMarker(),i.insertionMode=F):n===y.TABLE||n===y.TBODY||n===y.TFOOT||n===y.THEAD||n===y.TR?i.openElements.hasInTableScope(n)&&(i._closeTableCell(),i._processToken(r)):n!==y.BODY&&n!==y.CAPTION&&n!==y.COL&&n!==y.COLGROUP&&n!==y.HTML&&eA(i,r)},[a.EOF_TOKEN]:eC},[j]:{[a.CHARACTER_TOKEN]:ee,[a.NULL_CHARACTER_TOKEN]:K,[a.WHITESPACE_CHARACTER_TOKEN]:ee,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:eO,[a.END_TAG_TOKEN]:eD,[a.EOF_TOKEN]:eC},[z]:{[a.CHARACTER_TOKEN]:ee,[a.NULL_CHARACTER_TOKEN]:K,[a.WHITESPACE_CHARACTER_TOKEN]:ee,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.CAPTION||n===y.TABLE||n===y.TBODY||n===y.TFOOT||n===y.THEAD||n===y.TR||n===y.TD||n===y.TH?(i.openElements.popUntilTagNamePopped(y.SELECT),i._resetInsertionMode(),i._processToken(r)):eO(i,r)},[a.END_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.CAPTION||n===y.TABLE||n===y.TBODY||n===y.TFOOT||n===y.THEAD||n===y.TR||n===y.TD||n===y.TH?i.openElements.hasInTableScope(n)&&(i.openElements.popUntilTagNamePopped(y.SELECT),i._resetInsertionMode(),i._processToken(r)):eD(i,r)},[a.EOF_TOKEN]:eC},[B]:{[a.CHARACTER_TOKEN]:ed,[a.NULL_CHARACTER_TOKEN]:K,[a.WHITESPACE_CHARACTER_TOKEN]:ec,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:function(i,r){let n=r.tagName;if(n===y.BASE||n===y.BASEFONT||n===y.BGSOUND||n===y.LINK||n===y.META||n===y.NOFRAMES||n===y.SCRIPT||n===y.STYLE||n===y.TEMPLATE||n===y.TITLE)ea(i,r);else{let a=W[n]||k;i._popTmplInsertionMode(),i._pushTmplInsertionMode(a),i.insertionMode=a,i._processToken(r)}},[a.END_TAG_TOKEN]:function(i,r){r.tagName===y.TEMPLATE&&eo(i,r)},[a.EOF_TOKEN]:eF},[U]:{[a.CHARACTER_TOKEN]:eN,[a.NULL_CHARACTER_TOKEN]:eN,[a.WHITESPACE_CHARACTER_TOKEN]:ec,[a.COMMENT_TOKEN]:function(i,r){i._appendCommentNode(r,i.openElements.items[0])},[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:function(i,r){r.tagName===y.HTML?ew(i,r):eN(i,r)},[a.END_TAG_TOKEN]:function(i,r){r.tagName===y.HTML?i.fragmentContext||(i.insertionMode=G):eN(i,r)},[a.EOF_TOKEN]:et},[V]:{[a.CHARACTER_TOKEN]:K,[a.NULL_CHARACTER_TOKEN]:K,[a.WHITESPACE_CHARACTER_TOKEN]:ee,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.HTML?ew(i,r):n===y.FRAMESET?i._insertElement(r,v.HTML):n===y.FRAME?(i._appendElement(r,v.HTML),r.ackSelfClosing=!0):n===y.NOFRAMES&&ea(i,r)},[a.END_TAG_TOKEN]:function(i,r){r.tagName===y.FRAMESET&&!i.openElements.isRootHtmlElementCurrent()&&(i.openElements.pop(),i.fragmentContext||i.openElements.currentTagName===y.FRAMESET||(i.insertionMode=H))},[a.EOF_TOKEN]:et},[H]:{[a.CHARACTER_TOKEN]:K,[a.NULL_CHARACTER_TOKEN]:K,[a.WHITESPACE_CHARACTER_TOKEN]:ee,[a.COMMENT_TOKEN]:Q,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.HTML?ew(i,r):n===y.NOFRAMES&&ea(i,r)},[a.END_TAG_TOKEN]:function(i,r){r.tagName===y.HTML&&(i.insertionMode=q)},[a.EOF_TOKEN]:et},[G]:{[a.CHARACTER_TOKEN]:ej,[a.NULL_CHARACTER_TOKEN]:ej,[a.WHITESPACE_CHARACTER_TOKEN]:ec,[a.COMMENT_TOKEN]:J,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:function(i,r){r.tagName===y.HTML?ew(i,r):ej(i,r)},[a.END_TAG_TOKEN]:ej,[a.EOF_TOKEN]:et},[q]:{[a.CHARACTER_TOKEN]:K,[a.NULL_CHARACTER_TOKEN]:K,[a.WHITESPACE_CHARACTER_TOKEN]:ec,[a.COMMENT_TOKEN]:J,[a.DOCTYPE_TOKEN]:K,[a.START_TAG_TOKEN]:function(i,r){let n=r.tagName;n===y.HTML?ew(i,r):n===y.NOFRAMES&&ea(i,r)},[a.END_TAG_TOKEN]:K,[a.EOF_TOKEN]:et}};function Z(i,r){var n,a;let o,s;for(let l=0;l<8&&(n=i,a=r,(s=n.activeFormattingElements.getElementEntryInScopeWithTagName(a.tagName))?n.openElements.contains(s.element)?n.openElements.hasInScope(a.tagName)||(s=null):(n.activeFormattingElements.removeEntry(s),s=null):eS(n,a),o=s);l++){let r=function(i,r){let n=null;for(let a=i.openElements.stackTop;a>=0;a--){let o=i.openElements.items[a];if(o===r.element)break;
119i._isSpecialElement(o)&&(n=o)}return n||(i.openElements.popUntilElementPopped(r.element),i.activeFormattingElements.removeEntry(r)),n}(i,o);if(!r)break;i.activeFormattingElements.bookmark=o;let n=function(i,r,n){let a=r,o=i.openElements.getCommonAncestor(r);for(let s=0,l=o;l!==n;s++,l=o){o=i.openElements.getCommonAncestor(l);let n=i.activeFormattingElements.getElementEntry(l),u=n&&s>=3;!n||u?(u&&i.activeFormattingElements.removeEntry(n),i.openElements.remove(l)):(l=function(i,r){let n=i.treeAdapter.getNamespaceURI(r.element),a=i.treeAdapter.createElement(r.token.tagName,n,r.token.attrs);return i.openElements.replace(r.element,a),r.element=a,a}(i,n),a===r&&(i.activeFormattingElements.bookmark=n),i.treeAdapter.detachNode(a),i.treeAdapter.appendChild(l,a),a=l)}return a}(i,r,o.element),a=i.openElements.getCommonAncestor(o.element);i.treeAdapter.detachNode(n),function(i,r,n){if(i._isElementCausesFosterParenting(r))i._fosterParentElement(n);else{let a=i.treeAdapter.getTagName(r),o=i.treeAdapter.getNamespaceURI(r);a===y.TEMPLATE&&o===v.HTML&&(r=i.treeAdapter.getTemplateContent(r)),i.treeAdapter.appendChild(r,n)}}(i,a,n),function(i,r,n){let a=i.treeAdapter.getNamespaceURI(n.element),o=n.token,s=i.treeAdapter.createElement(o.tagName,a,o.attrs);i._adoptNodes(r,s),i.treeAdapter.appendChild(r,s),i.activeFormattingElements.insertElementAfterBookmark(s,n.token),i.activeFormattingElements.removeEntry(n),i.openElements.remove(n.element),i.openElements.insertAfter(r,s)}(i,r,o)}}function K(){}function X(i){i._err(m.misplacedDoctype)}function Q(i,r){i._appendCommentNode(r,i.openElements.currentTmplContent||i.openElements.current)}function J(i,r){i._appendCommentNode(r,i.document)}function ee(i,r){i._insertCharacters(r)}function et(i){i.stopped=!0}function ei(i,r){i._err(m.missingDoctype,{beforeToken:!0}),i.treeAdapter.setDocumentMode(i.document,_.DOCUMENT_MODE.QUIRKS),i.insertionMode=E,i._processToken(r)}function er(i,r){i._insertFakeRootElement(),i.insertionMode=S,i._processToken(r)}function en(i,r){i._insertFakeElement(y.HEAD),i.headElement=i.openElements.current,i.insertionMode=A,i._processToken(r)}function ea(i,r){let n=r.tagName;n===y.HTML?ew(i,r):n===y.BASE||n===y.BASEFONT||n===y.BGSOUND||n===y.LINK||n===y.META?(i._appendElement(r,v.HTML),r.ackSelfClosing=!0):n===y.TITLE?i._switchToTextParsing(r,a.MODE.RCDATA):n===y.NOSCRIPT?i.options.scriptingEnabled?i._switchToTextParsing(r,a.MODE.RAWTEXT):(i._insertElement(r,v.HTML),i.insertionMode=C):n===y.NOFRAMES||n===y.STYLE?i._switchToTextParsing(r,a.MODE.RAWTEXT):n===y.SCRIPT?i._switchToTextParsing(r,a.MODE.SCRIPT_DATA):n===y.TEMPLATE?(i._insertTemplate(r,v.HTML),i.activeFormattingElements.insertMarker(),i.framesetOk=!1,i.insertionMode=B,i._pushTmplInsertionMode(B)):n===y.HEAD?i._err(m.misplacedStartTagForHeadElement):es(i,r)}function eo(i,r){let n=r.tagName;n===y.HEAD?(i.openElements.pop(),i.insertionMode=I):n===y.BODY||n===y.BR||n===y.HTML?es(i,r):n===y.TEMPLATE&&i.openElements.tmplCount>0?(i.openElements.generateImpliedEndTagsThoroughly(),i.openElements.currentTagName!==y.TEMPLATE&&i._err(m.closingOfElementWithOpenChildElements),i.openElements.popUntilTagNamePopped(y.TEMPLATE),i.activeFormattingElements.clearToLastMarker(),i._popTmplInsertionMode(),i._resetInsertionMode()):i._err(m.endTagWithoutMatchingOpenElement)}function es(i,r){i.openElements.pop(),i.insertionMode=I,i._processToken(r)}function el(i,r){let n=r.type===a.EOF_TOKEN?m.openElementsLeftAfterEof:m.disallowedContentInNoscriptInHead;i._err(n),i.openElements.pop(),i.insertionMode=A,i._processToken(r)}function eu(i,r){i._insertFakeElement(y.BODY),i.insertionMode=k,i._processToken(r)}function ec(i,r){i._reconstructActiveFormattingElements(),i._insertCharacters(r)}function ed(i,r){i._reconstructActiveFormattingElements(),i._insertCharacters(r),i.framesetOk=!1}function eh(i,r){i.openElements.hasInButtonScope(y.P)&&i._closePElement(),i._insertElement(r,v.HTML)}function ef(i,r){i.openElements.hasInButtonScope(y.P)&&i._closePElement(),i._insertElement(r,v.HTML),i.skipNextNewLine=!0,i.framesetOk=!1}function ep(i,r){i._reconstructActiveFormattingElements(),i._insertElement(r,v.HTML),i.activeFormattingElements.pushElement(i.openElements.current,r)}function em(i,r){i._reconstructActiveFormattingElements(),i._insertElement(r,v.HTML),i.activeFormattingElements.insertMarker(),i.framesetOk=!1}function eg(i,r){i._reconstructActiveFormattingElements(),i._appendElement(r,v.HTML),i.framesetOk=!1,r.ackSelfClosing=!0}function e_(i,r){i._appendElement(r,v.HTML),r.ackSelfClosing=!0}function ey(i,r){i._switchToTextParsing(r,a.MODE.RAWTEXT)}function ev(i,r){i.openElements.currentTagName===y.OPTION&&i.openElements.pop(),i._reconstructActiveFormattingElements(),i._insertElement(r,v.HTML)}function ex(i,r){i.openElements.hasInScope(y.RUBY)&&i.openElements.generateImpliedEndTags(),i._insertElement(r,v.HTML)}function eb(i,r){i._reconstructActiveFormattingElements(),i._insertElement(r,v.HTML)}function ew(i,r){let n=r.tagName;switch(n.length){case 1:if(n===y.I||n===y.S||n===y.B||n===y.U)ep(i,r);else if(n===y.P)eh(i,r);else if(n===y.A){let n;(n=i.activeFormattingElements.getElementEntryInScopeWithTagName(y.A))&&(Z(i,r),i.openElements.remove(n.element),i.activeFormattingElements.removeEntry(n)),i._reconstructActiveFormattingElements(),i._insertElement(r,v.HTML),i.activeFormattingElements.pushElement(i.openElements.current,r)}else eb(i,r);break;case 2:if(n===y.DL||n===y.OL||n===y.UL)eh(i,r);else if(n===y.H1||n===y.H2||n===y.H3||n===y.H4||n===y.H5||n===y.H6){let n;i.openElements.hasInButtonScope(y.P)&&i._closePElement(),((n=i.openElements.currentTagName)===y.H1||n===y.H2||n===y.H3||n===y.H4||n===y.H5||n===y.H6)&&i.openElements.pop(),i._insertElement(r,v.HTML)}else n===y.LI||n===y.DD||n===y.DT?!function(i,r){i.framesetOk=!1;let n=r.tagName;for(let r=i.openElements.stackTop;r>=0;r--){let a=i.openElements.items[r],o=i.treeAdapter.getTagName(a),s=null;if(n===y.LI&&o===y.LI?s=y.LI:(n===y.DD||n===y.DT)&&(o===y.DD||o===y.DT)&&(s=o),s){i.openElements.generateImpliedEndTagsWithExclusion(s),i.openElements.popUntilTagNamePopped(s);break}if(o!==y.ADDRESS&&o!==y.DIV&&o!==y.P&&i._isSpecialElement(a))break}i.openElements.hasInButtonScope(y.P)&&i._closePElement(),i._insertElement(r,v.HTML)}(i,r):n===y.EM||n===y.TT?ep(i,r):n===y.BR?eg(i,r):n===y.HR?(i.openElements.hasInButtonScope(y.P)&&i._closePElement(),i._appendElement(r,v.HTML),i.framesetOk=!1,r.ackSelfClosing=!0):n===y.RB?ex(i,r):n===y.RT||n===y.RP?(i.openElements.hasInScope(y.RUBY)&&i.openElements.generateImpliedEndTagsWithExclusion(y.RTC),i._insertElement(r,v.HTML)):n!==y.TH&&n!==y.TD&&n!==y.TR&&eb(i,r);break;case 3:n===y.DIV||n===y.DIR||n===y.NAV?eh(i,r):n===y.PRE?ef(i,r):n===y.BIG?ep(i,r):n===y.IMG||n===y.WBR?eg(i,r):n===y.XMP?(i.openElements.hasInButtonScope(y.P)&&i._closePElement(),i._reconstructActiveFormattingElements(),i.framesetOk=!1,i._switchToTextParsing(r,a.MODE.RAWTEXT)):n===y.SVG?(i._reconstructActiveFormattingElements(),p.adjustTokenSVGAttrs(r),p.adjustTokenXMLAttrs(r),r.selfClosing?i._appendElement(r,v.SVG):i._insertElement(r,v.SVG),r.ackSelfClosing=!0):n===y.RTC?ex(i,r):n!==y.COL&&eb(i,r);break;case 4:if(n===y.HTML)0===i.openElements.tmplCount&&i.treeAdapter.adoptAttributes(i.openElements.items[0],r.attrs);else if(n===y.BASE||n===y.LINK||n===y.META)ea(i,r);else if(n===y.BODY){let n;(n=i.openElements.tryPeekProperlyNestedBodyElement())&&0===i.openElements.tmplCount&&(i.framesetOk=!1,i.treeAdapter.adoptAttributes(n,r.attrs))}else if(n===y.MAIN||n===y.MENU)eh(i,r);else if(n===y.FORM){let n;n=i.openElements.tmplCount>0,(!i.formElement||n)&&(i.openElements.hasInButtonScope(y.P)&&i._closePElement(),i._insertElement(r,v.HTML),n||(i.formElement=i.openElements.current))}else n===y.CODE||n===y.FONT?ep(i,r):n===y.NOBR?(i._reconstructActiveFormattingElements(),i.openElements.hasInScope(y.NOBR)&&(Z(i,r),i._reconstructActiveFormattingElements()),i._insertElement(r,v.HTML),i.activeFormattingElements.pushElement(i.openElements.current,r)):n===y.AREA?eg(i,r):n===y.MATH?(i._reconstructActiveFormattingElements(),p.adjustTokenMathMLAttrs(r),p.adjustTokenXMLAttrs(r),r.selfClosing?i._appendElement(r,v.MATHML):i._insertElement(r,v.MATHML),r.ackSelfClosing=!0):n===y.MENU?(i.openElements.hasInButtonScope(y.P)&&i._closePElement(),i._insertElement(r,v.HTML)):n!==y.HEAD&&eb(i,r);break;case 5:if(n===y.STYLE||n===y.TITLE)ea(i,r);else if(n===y.ASIDE)eh(i,r);else if(n===y.SMALL)ep(i,r);else if(n===y.TABLE)i.treeAdapter.getDocumentMode(i.document)!==_.DOCUMENT_MODE.QUIRKS&&i.openElements.hasInButtonScope(y.P)&&i._closePElement(),i._insertElement(r,v.HTML),i.framesetOk=!1,i.insertionMode=M;else if(n===y.EMBED)eg(i,r);else if(n===y.INPUT){let n;i._reconstructActiveFormattingElements(),i._appendElement(r,v.HTML),(n=a.getTokenAttr(r,x.TYPE))&&n.toLowerCase()===w||(i.framesetOk=!1),r.ackSelfClosing=!0}else n===y.PARAM||n===y.TRACK?e_(i,r):n===y.IMAGE?(r.tagName=y.IMG,eg(i,r)):n!==y.FRAME&&n!==y.TBODY&&n!==y.TFOOT&&n!==y.THEAD&&eb(i,r);break;case 6:n===y.SCRIPT?ea(i,r):n===y.CENTER||n===y.FIGURE||n===y.FOOTER||n===y.HEADER||n===y.HGROUP||n===y.DIALOG?eh(i,r):n===y.BUTTON?(i.openElements.hasInScope(y.BUTTON)&&(i.openElements.generateImpliedEndTags(),i.openElements.popUntilTagNamePopped(y.BUTTON)),i._reconstructActiveFormattingElements(),i._insertElement(r,v.HTML),i.framesetOk=!1):n===y.STRIKE||n===y.STRONG?ep(i,r):n===y.APPLET||n===y.OBJECT?em(i,r):n===y.KEYGEN?eg(i,r):n===y.SOURCE?e_(i,r):n===y.IFRAME?(i.framesetOk=!1,i._switchToTextParsing(r,a.MODE.RAWTEXT)):n===y.SELECT?(i._reconstructActiveFormattingElements(),i._insertElement(r,v.HTML),i.framesetOk=!1,i.insertionMode===M||i.insertionMode===P||i.insertionMode===D||i.insertionMode===F||i.insertionMode===N?i.insertionMode=z:i.insertionMode=j):n===y.OPTION?ev(i,r):eb(i,r);break;case 7:n===y.BGSOUND?ea(i,r):n===y.DETAILS||n===y.ADDRESS||n===y.ARTICLE||n===y.SECTION||n===y.SUMMARY?eh(i,r):n===y.LISTING?ef(i,r):n===y.MARQUEE?em(i,r):n===y.NOEMBED?ey(i,r):n!==y.CAPTION&&eb(i,r);break;case 8:if(n===y.BASEFONT)ea(i,r);else if(n===y.FRAMESET){let n;n=i.openElements.tryPeekProperlyNestedBodyElement(),i.framesetOk&&n&&(i.treeAdapter.detachNode(n),i.openElements.popAllUpToHtmlElement(),i._insertElement(r,v.HTML),i.insertionMode=V)}else n===y.FIELDSET?eh(i,r):n===y.TEXTAREA?(i._insertElement(r,v.HTML),i.skipNextNewLine=!0,i.tokenizer.state=a.MODE.RCDATA,i.originalInsertionMode=i.insertionMode,i.framesetOk=!1,i.insertionMode=R):n===y.TEMPLATE?ea(i,r):n===y.NOSCRIPT?i.options.scriptingEnabled?ey(i,r):eb(i,r):n===y.OPTGROUP?ev(i,r):n!==y.COLGROUP&&eb(i,r);break;case 9:n===y.PLAINTEXT?(i.openElements.hasInButtonScope(y.P)&&i._closePElement(),i._insertElement(r,v.HTML),i.tokenizer.state=a.MODE.PLAINTEXT):eb(i,r);break;case 10:n===y.BLOCKQUOTE||n===y.FIGCAPTION?eh(i,r):eb(i,r);break;default:eb(i,r)}}function eT(i,r){let n=r.tagName;i.openElements.hasInScope(n)&&(i.openElements.generateImpliedEndTags(),i.openElements.popUntilTagNamePopped(n))}function eE(i,r){let n=r.tagName;i.openElements.hasInScope(n)&&(i.openElements.generateImpliedEndTags(),i.openElements.popUntilTagNamePopped(n),i.activeFormattingElements.clearToLastMarker())}function eS(i,r){let n=r.tagName;for(let r=i.openElements.stackTop;r>0;r--){let a=i.openElements.items[r];if(i.treeAdapter.getTagName(a)===n){i.openElements.generateImpliedEndTagsWithExclusion(n),i.openElements.popUntilElementPopped(a);break}
119if(i._isSpecialElement(a))break}}function eA(i,r){let n=r.tagName;switch(n.length){case 1:n===y.A||n===y.B||n===y.I||n===y.S||n===y.U?Z(i,r):n===y.P?(i.openElements.hasInButtonScope(y.P)||i._insertFakeElement(y.P),i._closePElement()):eS(i,r);break;case 2:if(n===y.DL||n===y.UL||n===y.OL)eT(i,r);else if(n===y.LI)i.openElements.hasInListItemScope(y.LI)&&(i.openElements.generateImpliedEndTagsWithExclusion(y.LI),i.openElements.popUntilTagNamePopped(y.LI));else if(n===y.DD||n===y.DT){let n;n=r.tagName,i.openElements.hasInScope(n)&&(i.openElements.generateImpliedEndTagsWithExclusion(n),i.openElements.popUntilTagNamePopped(n))}else n===y.H1||n===y.H2||n===y.H3||n===y.H4||n===y.H5||n===y.H6?i.openElements.hasNumberedHeaderInScope()&&(i.openElements.generateImpliedEndTags(),i.openElements.popUntilNumberedHeaderPopped()):n===y.BR?(i._reconstructActiveFormattingElements(),i._insertFakeElement(y.BR),i.openElements.pop(),i.framesetOk=!1):n===y.EM||n===y.TT?Z(i,r):eS(i,r);break;case 3:n===y.BIG?Z(i,r):n===y.DIR||n===y.DIV||n===y.NAV||n===y.PRE?eT(i,r):eS(i,r);break;case 4:if(n===y.BODY)i.openElements.hasInScope(y.BODY)&&(i.insertionMode=U);else if(n===y.HTML)i.openElements.hasInScope(y.BODY)&&(i.insertionMode=U,i._processToken(r));else if(n===y.FORM){let r,n;r=i.openElements.tmplCount>0,n=i.formElement,r||(i.formElement=null),(n||r)&&i.openElements.hasInScope(y.FORM)&&(i.openElements.generateImpliedEndTags(),r?i.openElements.popUntilTagNamePopped(y.FORM):i.openElements.remove(n))}else n===y.CODE||n===y.FONT||n===y.NOBR?Z(i,r):n===y.MAIN||n===y.MENU?eT(i,r):eS(i,r);break;case 5:n===y.ASIDE?eT(i,r):n===y.SMALL?Z(i,r):eS(i,r);break;case 6:n===y.CENTER||n===y.FIGURE||n===y.FOOTER||n===y.HEADER||n===y.HGROUP||n===y.DIALOG?eT(i,r):n===y.APPLET||n===y.OBJECT?eE(i,r):n===y.STRIKE||n===y.STRONG?Z(i,r):eS(i,r);break;case 7:n===y.ADDRESS||n===y.ARTICLE||n===y.DETAILS||n===y.SECTION||n===y.SUMMARY||n===y.LISTING?eT(i,r):n===y.MARQUEE?eE(i,r):eS(i,r);break;case 8:n===y.FIELDSET?eT(i,r):n===y.TEMPLATE?eo(i,r):eS(i,r);break;case 10:n===y.BLOCKQUOTE||n===y.FIGCAPTION?eT(i,r):eS(i,r);break;default:eS(i,r)}}function eC(i,r){i.tmplInsertionModeStackTop>-1?eF(i,r):i.stopped=!0}function eI(i,r){let n=i.openElements.currentTagName;n===y.TABLE||n===y.TBODY||n===y.TFOOT||n===y.THEAD||n===y.TR?(i.pendingCharacterTokens=[],i.hasNonWhitespacePendingCharacterToken=!1,i.originalInsertionMode=i.insertionMode,i.insertionMode=L,i._processToken(r)):eM(i,r)}function ek(i,r){let n=r.tagName;switch(n.length){case 2:n===y.TD||n===y.TH||n===y.TR?(i.openElements.clearBackToTableContext(),i._insertFakeElement(y.TBODY),i.insertionMode=D,i._processToken(r)):eM(i,r);break;case 3:n===y.COL?(i.openElements.clearBackToTableContext(),i._insertFakeElement(y.COLGROUP),i.insertionMode=O,i._processToken(r)):eM(i,r);break;case 4:n===y.FORM?i.formElement||0!==i.openElements.tmplCount||(i._insertElement(r,v.HTML),i.formElement=i.openElements.current,i.openElements.pop()):eM(i,r);break;case 5:if(n===y.TABLE)i.openElements.hasInTableScope(y.TABLE)&&(i.openElements.popUntilTagNamePopped(y.TABLE),i._resetInsertionMode(),i._processToken(r));else if(n===y.STYLE)ea(i,r);else if(n===y.TBODY||n===y.TFOOT||n===y.THEAD)i.openElements.clearBackToTableContext(),i._insertElement(r,v.HTML),i.insertionMode=D;else if(n===y.INPUT){let n;(n=a.getTokenAttr(r,x.TYPE))&&n.toLowerCase()===w?i._appendElement(r,v.HTML):eM(i,r),r.ackSelfClosing=!0}else eM(i,r);break;case 6:n===y.SCRIPT?ea(i,r):eM(i,r);break;case 7:n===y.CAPTION?(i.openElements.clearBackToTableContext(),i.activeFormattingElements.insertMarker(),i._insertElement(r,v.HTML),i.insertionMode=P):eM(i,r);break;case 8:n===y.COLGROUP?(i.openElements.clearBackToTableContext(),i._insertElement(r,v.HTML),i.insertionMode=O):n===y.TEMPLATE?ea(i,r):eM(i,r);break;default:eM(i,r)}}function eR(i,r){let n=r.tagName;n===y.TABLE?i.openElements.hasInTableScope(y.TABLE)&&(i.openElements.popUntilTagNamePopped(y.TABLE),i._resetInsertionMode()):n===y.TEMPLATE?eo(i,r):n!==y.BODY&&n!==y.CAPTION&&n!==y.COL&&n!==y.COLGROUP&&n!==y.HTML&&n!==y.TBODY&&n!==y.TD&&n!==y.TFOOT&&n!==y.TH&&n!==y.THEAD&&n!==y.TR&&eM(i,r)}function eM(i,r){let n=i.fosterParentingEnabled;i.fosterParentingEnabled=!0,i._processTokenInBodyMode(r),i.fosterParentingEnabled=n}function eL(i,r){let n=0;if(i.hasNonWhitespacePendingCharacterToken)for(;n<i.pendingCharacterTokens.length;n++)eM(i,i.pendingCharacterTokens[n]);else for(;n<i.pendingCharacterTokens.length;n++)i._insertCharacters(i.pendingCharacterTokens[n]);i.insertionMode=i.originalInsertionMode,i._processToken(r)}function eP(i,r){i.openElements.currentTagName===y.COLGROUP&&(i.openElements.pop(),i.insertionMode=M,i._processToken(r))}function eO(i,r){let n=r.tagName;n===y.HTML?ew(i,r):n===y.OPTION?(i.openElements.currentTagName===y.OPTION&&i.openElements.pop(),i._insertElement(r,v.HTML)):n===y.OPTGROUP?(i.openElements.currentTagName===y.OPTION&&i.openElements.pop(),i.openElements.currentTagName===y.OPTGROUP&&i.openElements.pop(),i._insertElement(r,v.HTML)):n===y.INPUT||n===y.KEYGEN||n===y.TEXTAREA||n===y.SELECT?i.openElements.hasInSelectScope(y.SELECT)&&(i.openElements.popUntilTagNamePopped(y.SELECT),i._resetInsertionMode(),n!==y.SELECT&&i._processToken(r)):(n===y.SCRIPT||n===y.TEMPLATE)&&ea(i,r)}function eD(i,r){let n=r.tagName;if(n===y.OPTGROUP){let r=i.openElements.items[i.openElements.stackTop-1],n=r&&i.treeAdapter.getTagName(r);i.openElements.currentTagName===y.OPTION&&n===y.OPTGROUP&&i.openElements.pop(),i.openElements.currentTagName===y.OPTGROUP&&i.openElements.pop()}else n===y.OPTION?i.openElements.currentTagName===y.OPTION&&i.openElements.pop():n===y.SELECT&&i.openElements.hasInSelectScope(y.SELECT)?(i.openElements.popUntilTagNamePopped(y.SELECT),i._resetInsertionMode()):n===y.TEMPLATE&&eo(i,r)}function eF(i,r){i.openElements.tmplCount>0?(i.openElements.popUntilTagNamePopped(y.TEMPLATE),i.activeFormattingElements.clearToLastMarker(),i._popTmplInsertionMode(),i._resetInsertionMode(),i._processToken(r)):i.stopped=!0}function eN(i,r){i.insertionMode=k,i._processToken(r)}function ej(i,r){i.insertionMode=k,i._processToken(r)}r.exports=class{constructor(i){this.options=h(b,i),this.treeAdapter=this.options.treeAdapter,this.pendingScript=null,this.options.sourceCodeLocationInfo&&c.install(this,l),this.options.onParseError&&c.install(this,u,{onParseError:this.options.onParseError})}parse(i){let r=this.treeAdapter.createDocument();return this._bootstrap(r,null),this.tokenizer.write(i,!0),this._runParsingLoop(null),r}parseFragment(i,r){r||(r=this.treeAdapter.createElement(y.TEMPLATE,v.HTML,[]));let n=this.treeAdapter.createElement("documentmock",v.HTML,[]);this._bootstrap(n,r),this.treeAdapter.getTagName(r)===y.TEMPLATE&&this._pushTmplInsertionMode(B),this._initTokenizerForFragmentParsing(),this._insertFakeRootElement(),this._resetInsertionMode(),this._findFormInFragmentContext(),this.tokenizer.write(i,!0),this._runParsingLoop(null);let a=this.treeAdapter.getFirstChild(n),o=this.treeAdapter.createDocumentFragment();return this._adoptNodes(a,o),o}_bootstrap(i,r){this.tokenizer=new a(this.options),this.stopped=!1,this.insertionMode=T,this.originalInsertionMode="",this.document=i,this.fragmentContext=r,this.headElement=null,this.formElement=null,this.openElements=new o(this.document,this.treeAdapter),this.activeFormattingElements=new s(this.treeAdapter),this.tmplInsertionModeStack=[],this.tmplInsertionModeStackTop=-1,this.currentTmplInsertionMode=null,this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1}_err(){}_runParsingLoop(i){for(;!this.stopped;){this._setupTokenizerCDATAMode();let r=this.tokenizer.getNextToken();if(r.type===a.HIBERNATION_TOKEN)break;if(this.skipNextNewLine&&(this.skipNextNewLine=!1,r.type===a.WHITESPACE_CHARACTER_TOKEN&&"\n"===r.chars[0])){if(1===r.chars.length)continue;r.chars=r.chars.substr(1)}if(this._processInputToken(r),i&&this.pendingScript)break}}runParsingLoopForCurrentChunk(i,r){if(this._runParsingLoop(r),r&&this.pendingScript){let i=this.pendingScript;this.pendingScript=null,r(i);return}i&&i()}_setupTokenizerCDATAMode(){let i=this._getAdjustedCurrentElement();this.tokenizer.allowCDATA=i&&i!==this.document&&this.treeAdapter.getNamespaceURI(i)!==v.HTML&&!this._isIntegrationPoint(i)}_switchToTextParsing(i,r){this._insertElement(i,v.HTML),this.tokenizer.state=r,this.originalInsertionMode=this.insertionMode,this.insertionMode=R}switchToPlaintextParsing(){this.insertionMode=R,this.originalInsertionMode=k,this.tokenizer.state=a.MODE.PLAINTEXT}_getAdjustedCurrentElement(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let i=this.fragmentContext;do{if(this.treeAdapter.getTagName(i)===y.FORM){this.formElement=i;break}i=this.treeAdapter.getParentNode(i)}while(i)}_initTokenizerForFragmentParsing(){if(this.treeAdapter.getNamespaceURI(this.fragmentContext)===v.HTML){let i=this.treeAdapter.getTagName(this.fragmentContext);i===y.TITLE||i===y.TEXTAREA?this.tokenizer.state=a.MODE.RCDATA:i===y.STYLE||i===y.XMP||i===y.IFRAME||i===y.NOEMBED||i===y.NOFRAMES||i===y.NOSCRIPT?this.tokenizer.state=a.MODE.RAWTEXT:i===y.SCRIPT?this.tokenizer.state=a.MODE.SCRIPT_DATA:i===y.PLAINTEXT&&(this.tokenizer.state=a.MODE.PLAINTEXT)}}_setDocumentType(i){let r=i.name||"",n=i.publicId||"",a=i.systemId||"";this.treeAdapter.setDocumentType(this.document,r,n,a)}_attachElementToTree(i){if(this._shouldFosterParentOnInsertion())this._fosterParentElement(i);else{let r=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.appendChild(r,i)}}_appendElement(i,r){let n=this.treeAdapter.createElement(i.tagName,r,i.attrs);this._attachElementToTree(n)}_insertElement(i,r){let n=this.treeAdapter.createElement(i.tagName,r,i.attrs);this._attachElementToTree(n),this.openElements.push(n)}_insertFakeElement(i){let r=this.treeAdapter.createElement(i,v.HTML,[]);this._attachElementToTree(r),this.openElements.push(r)}_insertTemplate(i){let r=this.treeAdapter.createElement(i.tagName,v.HTML,i.attrs),n=this.treeAdapter.createDocumentFragment();
119this.treeAdapter.setTemplateContent(r,n),this._attachElementToTree(r),this.openElements.push(r)}_insertFakeRootElement(){let i=this.treeAdapter.createElement(y.HTML,v.HTML,[]);this.treeAdapter.appendChild(this.openElements.current,i),this.openElements.push(i)}_appendCommentNode(i,r){let n=this.treeAdapter.createCommentNode(i.data);this.treeAdapter.appendChild(r,n)}_insertCharacters(i){if(this._shouldFosterParentOnInsertion())this._fosterParentText(i.chars);else{let r=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.insertText(r,i.chars)}}_adoptNodes(i,r){for(let n=this.treeAdapter.getFirstChild(i);n;n=this.treeAdapter.getFirstChild(i))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(r,n)}_shouldProcessTokenInForeignContent(i){let r=this._getAdjustedCurrentElement();if(!r||r===this.document)return!1;let n=this.treeAdapter.getNamespaceURI(r);if(n===v.HTML||this.treeAdapter.getTagName(r)===y.ANNOTATION_XML&&n===v.MATHML&&i.type===a.START_TAG_TOKEN&&i.tagName===y.SVG)return!1;let o=i.type===a.CHARACTER_TOKEN||i.type===a.NULL_CHARACTER_TOKEN||i.type===a.WHITESPACE_CHARACTER_TOKEN;return!((i.type===a.START_TAG_TOKEN&&i.tagName!==y.MGLYPH&&i.tagName!==y.MALIGNMARK||o)&&this._isIntegrationPoint(r,v.MATHML)||(i.type===a.START_TAG_TOKEN||o)&&this._isIntegrationPoint(r,v.HTML))&&i.type!==a.EOF_TOKEN}_processToken(i){Y[this.insertionMode][i.type](this,i)}_processTokenInBodyMode(i){Y[k][i.type](this,i)}_processTokenInForeignContent(i){var r,n,o,s;i.type===a.CHARACTER_TOKEN?(r=this,n=i,r._insertCharacters(n),r.framesetOk=!1):i.type===a.NULL_CHARACTER_TOKEN?(o=this,(s=i).chars=g.REPLACEMENT_CHARACTER,o._insertCharacters(s)):i.type===a.WHITESPACE_CHARACTER_TOKEN?ee(this,i):i.type===a.COMMENT_TOKEN?Q(this,i):i.type===a.START_TAG_TOKEN?function(i,r){if(p.causesExit(r)&&!i.fragmentContext){for(;i.treeAdapter.getNamespaceURI(i.openElements.current)!==v.HTML&&!i._isIntegrationPoint(i.openElements.current);)i.openElements.pop();i._processToken(r)}else{let n=i._getAdjustedCurrentElement(),a=i.treeAdapter.getNamespaceURI(n);a===v.MATHML?p.adjustTokenMathMLAttrs(r):a===v.SVG&&(p.adjustTokenSVGTagName(r),p.adjustTokenSVGAttrs(r)),p.adjustTokenXMLAttrs(r),r.selfClosing?i._appendElement(r,a):i._insertElement(r,a),r.ackSelfClosing=!0}}(this,i):i.type===a.END_TAG_TOKEN&&function(i,r){for(let n=i.openElements.stackTop;n>0;n--){let a=i.openElements.items[n];if(i.treeAdapter.getNamespaceURI(a)===v.HTML){i._processToken(r);break}if(i.treeAdapter.getTagName(a).toLowerCase()===r.tagName){i.openElements.popUntilElementPopped(a);break}}}(this,i)}_processInputToken(i){this._shouldProcessTokenInForeignContent(i)?this._processTokenInForeignContent(i):this._processToken(i),i.type===a.START_TAG_TOKEN&&i.selfClosing&&!i.ackSelfClosing&&this._err(m.nonVoidHtmlElementStartTagWithTrailingSolidus)}_isIntegrationPoint(i,r){let n=this.treeAdapter.getTagName(i),a=this.treeAdapter.getNamespaceURI(i),o=this.treeAdapter.getAttrList(i);return p.isIntegrationPoint(n,a,o,r)}_reconstructActiveFormattingElements(){let i=this.activeFormattingElements.length;if(i){let r=i,n=null;do if(r--,(n=this.activeFormattingElements.entries[r]).type===s.MARKER_ENTRY||this.openElements.contains(n.element)){r++;break}while(r>0)for(let a=r;a<i;a++)n=this.activeFormattingElements.entries[a],this._insertElement(n.token,this.treeAdapter.getNamespaceURI(n.element)),n.element=this.openElements.current}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=F}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(y.P),this.openElements.popUntilTagNamePopped(y.P)}_resetInsertionMode(){for(let i=this.openElements.stackTop,r=!1;i>=0;i--){let n=this.openElements.items[i];0===i&&(r=!0,this.fragmentContext&&(n=this.fragmentContext));let a=this.treeAdapter.getTagName(n),o=$[a];if(o){this.insertionMode=o;break}if(r||a!==y.TD&&a!==y.TH)if(r||a!==y.HEAD){if(a===y.SELECT){this._resetInsertionModeForSelect(i);break}else if(a===y.TEMPLATE){this.insertionMode=this.currentTmplInsertionMode;break}else if(a===y.HTML){this.insertionMode=this.headElement?I:S;break}else if(r){this.insertionMode=k;break}}else{this.insertionMode=A;break}else{this.insertionMode=N;break}}}_resetInsertionModeForSelect(i){if(i>0)for(let r=i-1;r>0;r--){let i=this.openElements.items[r],n=this.treeAdapter.getTagName(i);if(n===y.TEMPLATE)break;if(n===y.TABLE){this.insertionMode=z;return}}this.insertionMode=j}_pushTmplInsertionMode(i){this.tmplInsertionModeStack.push(i),this.tmplInsertionModeStackTop++,this.currentTmplInsertionMode=i}_popTmplInsertionMode(){this.tmplInsertionModeStack.pop(),this.tmplInsertionModeStackTop--,this.currentTmplInsertionMode=this.tmplInsertionModeStack[this.tmplInsertionModeStackTop]}_isElementCausesFosterParenting(i){let r=this.treeAdapter.getTagName(i);return r===y.TABLE||r===y.TBODY||r===y.TFOOT||r===y.THEAD||r===y.TR}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.current)}_findFosterParentingLocation(){let i={parent:null,beforeElement:null};for(let r=this.openElements.stackTop;r>=0;r--){let n=this.openElements.items[r],a=this.treeAdapter.getTagName(n),o=this.treeAdapter.getNamespaceURI(n);if(a===y.TEMPLATE&&o===v.HTML){i.parent=this.treeAdapter.getTemplateContent(n);break}if(a===y.TABLE){i.parent=this.treeAdapter.getParentNode(n),i.parent?i.beforeElement=n:i.parent=this.openElements.items[r-1];break}}return i.parent||(i.parent=this.openElements.items[0]),i}_fosterParentElement(i){let r=this._findFosterParentingLocation();r.beforeElement?this.treeAdapter.insertBefore(r.parent,i,r.beforeElement):this.treeAdapter.appendChild(r.parent,i)}_fosterParentText(i){let r=this._findFosterParentingLocation();r.beforeElement?this.treeAdapter.insertTextBefore(r.parent,i,r.beforeElement):this.treeAdapter.insertText(r.parent,i)}_isSpecialElement(i){let r=this.treeAdapter.getTagName(i),n=this.treeAdapter.getNamespaceURI(i);return _.SPECIAL_ELEMENTS[n][r]}}},452837,(i,r,n)=>{r.exports=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"]},24124,(i,r,n)=>{"use strict";r.exports=function(i,r){for(var n,o,s,l=i||"",u=r||"div",c={},d=0;d<l.length;)a.lastIndex=d,s=a.exec(l),(n=l.slice(d,s?s.index:l.length))&&(o?"#"===o?c.id=n:c.className?c.className.push(n):c.className=[n]:u=n,d+=n.length),s&&(o=s[0],d++);return{type:"element",tagName:u,properties:c,children:[]}};var a=/[#.]/g},892046,(i,r,n)=>{"use strict";var a=i.r(907972),o=i.r(123585),s=i.r(24124),l=i.r(956681).parse,u=i.r(148325).parse;r.exports=function(i,r,n){var o=n?function(i){for(var r,n=i.length,a=-1,o={};++a<n;)o[(r=i[a]).toLowerCase()]=r;return o}(n):null;return function(n,h){var f,p,m,g,_,y,v=s(n,r),x=Array.prototype.slice.call(arguments,2),b=v.tagName.toLowerCase();if(v.tagName=o&&c.call(o,b)?o[b]:b,h&&(f=h,p=v,"string"==typeof f||"length"in f||(m=p.tagName,_=(g=f).type,"input"!==m&&_&&"string"==typeof _&&("object"==typeof g.children&&"length"in g.children||((_=_.toLowerCase(),"button"===m)?"menu"!==_&&"submit"!==_&&"reset"!==_&&"button"!==_:"value"in g))))&&(x.unshift(h),h=null),h)for(y in h)!function(r,n,o){var s,c,h;null!=o&&o==o&&(c=(s=a(i,n)).property,"string"==typeof(h=o)&&(s.spaceSeparated?h=l(h):s.commaSeparated?h=u(h):s.commaOrSpaceSeparated&&(h=l(u(h).join(" ")))),"style"===c&&"string"!=typeof o&&(h=function(i){var r,n=[];for(r in i)n.push([r,i[r]].join(": "));return n.join("; ")}(h)),"className"===c&&r.className&&(h=r.className.concat(h)),r[c]=function(i,r,n){var a,o,s;if("object"!=typeof n||!("length"in n))return d(i,r,n);for(o=n.length,a=-1,s=[];++a<o;)s[a]=d(i,r,n[a]);return s}(s,c,h))}(v.properties,y,h[y]);return function i(r,n){var a,o;if("string"==typeof n||"number"==typeof n)return void r.push({type:"text",value:String(n)});if("object"==typeof n&&"length"in n){for(a=-1,o=n.length;++a<o;)i(r,n[a]);return}if("object"!=typeof n||!("type"in n))throw Error("Expected node, nodes, or string, got `"+n+"`");r.push(n)}(v.children,x),"template"===v.tagName&&(v.content={type:"root",children:v.children},v.children=[]),v}};var c={}.hasOwnProperty;function d(i,r,n){var a=n;return i.number||i.positiveNumber?isNaN(a)||""===a||(a=Number(a)):(i.boolean||i.overloadedBoolean)&&"string"==typeof a&&(""===a||o(n)===o(r))&&(a=!0),a}},520029,(i,r,n)=>{"use strict";var a=i.r(89287),o=i.r(452837),s=i.r(892046)(a,"g",o);
119s.displayName="svg",r.exports=s},665598,(i,r,n)=>{"use strict";var a=i.r(367214),o=i.r(892046)(a,"div");o.displayName="html",r.exports=o},795308,(i,r,n)=>{"use strict";r.exports=i.r(665598)},585725,(i,r,n)=>{"use strict";r.exports=function(i){for(var r=String(i),n=[],a=/\r?\n|\r/g;a.exec(r);)n.push(a.lastIndex);return n.push(r.length+1),{toPoint:o,toPosition:o,toOffset:function(i){var r,a=i&&i.line,o=i&&i.column;return!isNaN(a)&&!isNaN(o)&&a-1 in n&&(r=(n[a-2]||0)+o-1||0),r>-1&&r<n[n.length-1]?r:-1}};function o(i){var r=-1;if(i>-1&&i<n[n.length-1]){for(;++r<n.length;)if(n[r]>i)return{line:r+1,column:i-(n[r-1]||0)+1,offset:i}}return{}}}},303102,(i,r,n)=>{r.exports={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},870171,(i,r,n)=>{"use strict";var a=i.r(520029),o=i.r(795308),s=i.r(907972),l=i.r(367214),u=i.r(89287),c=i.r(585725),d=i.r(303102);r.exports=function(i,r){var n,a=r||{};return a.messages?(n=a,a={}):n=a.file,p(i,{schema:"svg"===a.space?u:l,file:n,verbose:a.verbose})};var h={}.hasOwnProperty,f={"#document":m,"#document-fragment":m,"#text":function(i){return{type:"text",value:i.value}},"#comment":function(i){return{type:"comment",value:i.data}},"#documentType":function(i){return{type:"doctype",name:i.name||"",public:i.publicId||null,system:i.systemId||null}}};function p(i,r){var n,a,o,c=r.schema,m=h.call(f,i.nodeName)?f[i.nodeName]:g;return m===g&&(r.schema=i.namespaceURI===d.svg?u:l),i.childNodes&&(n=function(i,r){for(var n=-1,a=[];++n<i.length;)a[n]=p(i[n],r);return a}(i.childNodes,r)),a=m(i,n,r),i.sourceCodeLocation&&r.file&&(o=function(i,r,n){var a,o,l,u=_(r);if("element"===i.type&&(a=i.children[i.children.length-1],!r.endTag&&a&&a.position&&a.position.end&&(u.end=Object.assign({},a.position.end)),n.verbose)){for(o in l={},r.attrs)l[s(n.schema,o).property]=_(r.attrs[o]);i.data={position:{opening:_(r.startTag),closing:r.endTag?_(r.endTag):null,properties:l}}}return u}(a,i.sourceCodeLocation,r))&&(r.location=!0,a.position=o),r.schema=c,a}function m(i,r,n){var a,o,s={type:"root",children:r,data:{quirksMode:"quirks"===i.mode||"limited-quirks"===i.mode}};return n.file&&n.location&&(s.position={start:(o=c(a=String(n.file))).toPoint(0),end:o.toPoint(a.length)}),s}function g(i,r,n){for(var s,l,u,c,d,h="svg"===n.schema.space?a:o,f={},m=-1;++m<i.attrs.length;)f[((l=i.attrs[m]).prefix?l.prefix+":":"")+l.name]=l.value;return"template"===(s=h(i.tagName,f,r)).tagName&&"content"in i&&(c=(u=i.sourceCodeLocation)&&u.startTag&&_(u.startTag).end,d=u&&u.endTag&&_(u.endTag).start,s.content=p(i.content,n),(c||d)&&n.file&&(s.content.position={start:c,end:d})),s}function _(i){var r=y({line:i.startLine,column:i.startCol,offset:i.startOffset}),n=y({line:i.endLine,column:i.endCol,offset:i.endOffset});return r||n?{start:r,end:n}:null}function y(i){return i.line&&i.column?i:null}},8642,(i,r,n)=>{"use strict";var a=i.r(367214),o=i.r(89287),s=i.r(907972),l=i.r(515702),u=i.r(956681),c=i.r(148325),d=i.r(936345),h=i.r(303102),f=i.r(635691),p=f("root"),m=f("element"),g=f("text");function _(i,r){return r.toUpperCase()}r.exports=function(i,r,n){var f,y,v,x,b,w,T,E=n||{},S=!!((v=(y=i)&&y("div"))&&("_owner"in v||"_store"in v)&&null==v.key),A=!!((b=(x=i)&&x("div"))&&b.context&&b.context._isVue),C=(w=i)&&"VirtualNode"===w("div").type;if("function"!=typeof i)throw Error("h is not a function");if("string"==typeof E||"boolean"==typeof E?(T=E,E={}):T=E.prefix,p(r))r=1===r.children.length&&m(r.children[0])?r.children[0]:{type:"element",tagName:"div",properties:{},children:r.children};else if(!m(r))throw Error("Expected root or element, not `"+(r&&r.type||r)+"`");return function i(r,n,a){var f,p,y=a.schema,v=y,x=n.tagName,b={},w=[],T=-1;for(f in"html"===y.space&&"svg"===x.toLowerCase()&&(a.schema=v=o),n.properties)!function(i,r,n,a,o){var h,f=s(a.schema,r);null==n||n!=n||!1===n&&(a.vue||a.vdom||a.hyperscript)||!n&&f.boolean&&(a.vue||a.vdom||a.hyperscript)||(n&&"object"==typeof n&&"length"in n&&(n=(f.commaSeparated?c:u).stringify(n)),f.boolean&&a.hyperscript&&(n=""),"style"===f.property&&"string"==typeof n&&(a.react||a.vue||a.vdom)&&(n=function(i,r){var n={};try{d(i,function(i,r){"-ms-"===i.slice(0,4)&&(i="ms-"+i.slice(4)),n[i.replace(/-([a-z])/g,_)]=r})}catch(i){throw i.message=r+"[style]"+i.message.slice(9),i}return n}(n,o)),a.vue?"style"!==f.property&&(h="attrs"):!f.mustUseProperty&&(a.vdom?"style"!==f.property&&(h="attributes"):a.hyperscript&&(h="attrs")),h?(i[h]||(i[h]={}),i[h][f.attribute]=n):f.space&&a.react?i[l[f.property]||f.property]=n:i[f.attribute]=n)}(b,f,n.properties[f],a,x);if(a.vdom&&("html"===v.space?x=x.toUpperCase():b.namespace=h[v.space]),a.prefix&&(a.key++,b.key=a.prefix+a.key),n.children)for(;++T<n.children.length;)m(p=n.children[T])?w.push(i(r,p,a)):g(p)&&w.push(p.value);return a.schema=y,w.length?r.call(n,x,b,w):r.call(n,x,b)}(i,r,{schema:"svg"===E.space?o:a,prefix:null==T?S||A||C?"h-":null:T,key:0,react:S,vue:A,vdom:C,hyperscript:!!((f=i)&&f.context&&f.cleanup)})}},594562,(i,r,n)=>{"use strict";r.exports=function(i,r){var n=r||{};function s(r){var n=s.invalid,l=s.handlers;return r&&o.call(r,i)&&(n=o.call(l,r[i])?l[r[i]]:s.unknown),(n||a).apply(this,arguments)}return s.handlers=n.handlers||{},s.invalid=n.invalid,s.unknown=n.unknown,s};var a=Function.prototype,o={}.hasOwnProperty},171520,(i,r,n)=>{"use strict";var a=i.r(843088),o=i.r(367214),s=i.r(89287),l=i.r(907972),u=i.r(8642),c=i.r(303102),d=i.r(594562);r.exports=function(i,r){return f(i,"svg"===r?s:o)};var h=["svg","html"],f=d("type");function p(i,r,n){var a,o=n,l=i.position,u=i.children,d=[],h=u?u.length:0,p=-1;for("element"===i.type&&("html"===o.space&&"svg"===i.tagName&&(o=s),r.namespaceURI=c[o.space]);++p<h;)(a=f(u[p],o)).parentNode=r,d[p]=a;return("element"===i.type||"root"===i.type)&&(r.childNodes=d),l&&l.start&&l.end&&(r.sourceCodeLocation={startLine:l.start.line,startCol:l.start.column,startOffset:l.start.offset,endLine:l.end.line,endCol:l.end.column,endOffset:l.end.offset}),r}f.handlers.root=function(i,r){var n=(i.data||{}).quirksMode?"quirks":"no-quirks";return p(i,{nodeName:"#document",mode:n},r)},f.handlers.element=function(i,r){var n=r.space,o=a(i,{children:[]});return u(function(n,a){var s,u,d,f,m,g,_=[];for(f in a)m=l(r,f),!1!==(u=a[f])&&(!m.boolean||u)&&(d={name:f,value:!0===u?"":String(u)},m.space&&-1===h.indexOf(m.space)&&(-1===(g=f.indexOf(":"))?d.prefix="":(d.name=f.slice(g+1),d.prefix=f.slice(0,g)),d.namespace=c[m.space]),_.push(d));return s=p(i,{nodeName:n,tagName:n,attrs:_},r),"template"===n&&(s.content=p(o.content,{nodeName:"#document-fragment"},r)),s},o,{space:n})},f.handlers.text=function(i,r){return p(i,{nodeName:"#text",value:i.value},r)},f.handlers.comment=function(i,r){return p(i,{nodeName:"#comment",data:i.value},r)},f.handlers.doctype=function(i,r){return p(i,{nodeName:"#documentType",name:i.name,publicId:i.public||"",systemId:i.system||""},r)}},37073,(i,r,n)=>{r.exports=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","
119image","img","input","isindex","keygen","link","menuitem","meta","nextid","param","source","track","wbr"]},97915,(i,r,n)=>{"use strict";var a=i.r(681684),o=i.r(579241),s=i.r(163420),l=i.r(870171),u=i.r(171520),c=i.r(37073),d=i.r(303102),h=i.r(594562),f=i.r(843088);r.exports=function i(r,n,_){var y,v,x,b,w,T,E,S,A,C,I,k,R,M=new a(p),L=h("type",{handlers:{root:function(i){P(i.children)},element:function(i){var r,n,a,o,s;F(),M._processToken(((n=g(r=i)).startTag=f(n),{type:"START_TAG_TOKEN",tagName:r.tagName,selfClosing:!1,attrs:u({tagName:(a=r).tagName,type:"element",properties:a.properties}).attrs,location:n}),d.html),P(i.children),0>c.indexOf(i.tagName)&&(F(),M._processToken(((s=g(o=i)).endTag=f(s),{type:"END_TAG_TOKEN",tagName:o.tagName,attrs:[],location:s})))},text:function(i){F(),M._processToken({type:"CHARACTER_TOKEN",chars:i.value,location:g(i)})},comment:O,doctype:function(i){var r=u(i);F(),M._processToken({type:"DOCTYPE_TOKEN",name:r.name,forceQuirks:!1,publicId:r.publicId,systemId:r.systemId,location:g(i)})},raw:function(i){var r,n=o.start(i),a=n.line||1,s=n.column||1,l=n.offset||0;A.html=null,A.pos=-1,A.lastGapPos=-1,A.lastCharPos=-1,A.gapStack=[],A.skipNextNewLine=!1,A.lastChunkWritten=!1,A.endOfChunkHit=!1,C.isEol=!1,C.lineStartPos=-s+1,C.droppedBufferSize=l,C.offset=0,C.col=1,C.line=a,I.currentAttrLocation=null,I.ctLoc=g(i),S.write(i.value),M._runParsingLoop(null),(r=S.currentCharacterToken)&&(r.location.endLine=C.line,r.location.endCol=C.col+1,r.location.endOffset=C.offset+1,M._processToken(r))}},unknown:m});if(!n||"contents"in n||(_=n,n=void 0),_&&_.passThrough)for(R=-1;++R<_.passThrough.length;)L.handlers[_.passThrough[R]]=D;if(k=l((v="root"===(y=r).type?y.children[0]:y)&&("doctype"===v.type||"html"===v.tagName)?(x=M.treeAdapter.createDocument(),M._bootstrap(x,null),A=(S=M.tokenizer).preprocessor,C=(I=S.__mixins[0]).posTracker,L(r),x):(b={nodeName:"template",tagName:"template",attrs:[],namespaceURI:d.html,childNodes:[]},w={nodeName:"documentmock",tagName:"documentmock",attrs:[],namespaceURI:d.html,childNodes:[]},T={nodeName:"#document-fragment",childNodes:[]},M._bootstrap(w,b),M._pushTmplInsertionMode("IN_TEMPLATE_MODE"),M._initTokenizerForFragmentParsing(),M._insertFakeRootElement(),M._resetInsertionMode(),M._findFormInFragmentContext(),A=(S=M.tokenizer).preprocessor,C=(I=S.__mixins[0]).posTracker,L(r),M._adoptNodes(w.childNodes[0],T),T),n),E&&s(k,"comment",function(i,r,n){if(i.value.stitch)return n.children[r]=i.value.stitch,r}),"root"!==r.type&&1===k.children.length)return k.children[0];return k;function P(i){var r=-1;if(i)for(;++r<i.length;)L(i[r])}function O(i){F(),M._processToken({type:"COMMENT_TOKEN",data:i.value,location:g(i)})}function D(r){var a=Object.assign({},r);E=!0,r.children&&(a.children=i({type:"root",children:r.children},n,_).children),O({value:{stitch:a}})}function F(){S.tokenQueue=[],S.state="DATA_STATE",S.returnState="",S.charRefCode=-1,S.tempBuff=[],S.lastStartTagName="",S.consumedAfterSnapshot=-1,S.active=!1,S.currentCharacterToken=null,S.currentToken=null,S.currentAttr=null}};var p={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function m(i){throw Error("Cannot compile `"+i.type+"` node")}function g(i){var r=o.start(i),n=o.end(i);return{startLine:r.line,startCol:r.column,startOffset:r.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}},93729,(i,r,n)=>{"use strict";var a=i.r(97915);r.exports=function(i){return function(r,n){return a(r,n,i)}}},508743,(i,r,n)=>{r.exports={strip:["script"],clobberPrefix:"user-content-",clobber:["name","id"],ancestors:{tbody:["table"],tfoot:["table"],thead:["table"],td:["table"],th:["table"],tr:["table"]},protocols:{href:["http","https","mailto","xmpp","irc","ircs"],cite:["http","https"],src:["http","https"],longDesc:["http","https"]},tagNames:["h1","h2","h3","h4","h5","h6","br","b","i","strong","em","a","pre","code","img","tt","div","ins","del","sup","sub","p","ol","ul","table","thead","tbody","tfoot","blockquote","dl","dt","dd","kbd","q","samp","var","hr","ruby","rt","rp","li","tr","td","th","s","strike","summary","details","caption","figure","figcaption","abbr","bdo","cite","dfn","mark","small","span","time","wbr","input"],attributes:{a:["href"],img:["src","longDesc"],input:[["type","checkbox"],["disabled",!0]],li:[["className","task-list-item"]],div:["itemScope","itemType"],blockquote:["cite"],del:["cite"],ins:["cite"],q:["cite"],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","ariaDescribedBy","ariaHidden","ariaLabel","ariaLabelledBy","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","cols","colSpan","color","compact","coords","dateTime","dir","disabled","encType","htmlFor","frame","headers","height","hrefLang","hSpace","isMap","id","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rel","rev","rows","rowSpan","rules","scope","selected","shape","size","span","start","summary","tabIndex","target","title","type","useMap","vAlign","value","vSpace","width","itemProp"]},required:{input:{type:"checkbox",disabled:!0}}}},774147,(i,r,n)=>{"use strict";var a=i.r(843088),o=i.r(508743);r.exports=function(i,r){var n,s={type:"root",children:[]};return i&&"object"==typeof i&&i.type&&(n=c(a(o,r||{}),i,[]))&&("length"in n?1===n.length?s=n[0]:s.children=n:s=n),s};var s={}.hasOwnProperty,l=[].push,u={root:{children:d},doctype:function(i){return i.allowDoctypes?{name:f}:null},comment:function(i){return i.allowComments?{value:m}:null},element:{tagName:p,properties:function(i,r,n,o){var l,u,c,d,f=p(i,n.tagName,n,o),m=i.required||{},_=r||{},y=a(g(i.attributes["*"]),g(s.call(i.attributes,f)?i.attributes[f]:[])),v={};for(c in _){if(s.call(y,c))u=y[c];else{if(!((l=c).length>4&&"data"===l.slice(0,4).toLowerCase()&&s.call(y,"data*")))continue;u=y["data*"]}null!=(d=(d=_[c])&&"object"==typeof d&&"length"in d?function(i,r,n,a){for(var o,s=[],l=-1;++l<r.length;)null!=(o=h(i,r[l],n,a))&&s.push(o);return s}(i,d,c,u):h(i,d,c,u))&&(v[c]=d)}if(s.call(m,f))for(c in m[f])s.call(v,c)||(v[c]=m[f][c]);return v},children:d},text:{value:function(i,r){return"string"==typeof r?r:""}},"*":{data:_,position:_}};function c(i,r,n){var o,l,c,d,h,f=r&&r.type,p={type:r.type};if(s.call(u,f)&&("function"==typeof(l=u[f])&&(l=l(i,r)),l))for(h in o=!0,c=a(l,u["*"]))!1===(d=c[h](i,r[h],r,n))?(o=null,p[h]=r[h]):null!=d&&(p[h]=d);return o?p:p.children&&p.children.length&&0>i.strip.indexOf(p.tagName)?p.children:null}function d(i,r,n,a){var o,s=[],u=-1;if(r){for(a.push(n.tagName);++u<r.length;)(o=c(i,r[u],a))&&("length"in o?l.apply(s,o):s.push(o));a.pop()}return s}function h(i,r,n,a){if(("boolean"==typeof r||"number"==typeof r||"string"==typeof r)&&function(i,r,n){var a=String(r),o=a.indexOf(":"),l=a.indexOf("?"),u=a.indexOf("#"),c=a.indexOf("/"),d=s.call(i.protocols,n)?i.protocols[n].concat():[],h=-1;if(!d.length||o<0||c>-1&&o>c||l>-1&&o>l||u>-1&&o>u)return!0;for(;++h<d.length;)if(o===d[h].length&&a.slice(0,d[h].length)===d[h])return!0;return!1}(i,r,n)&&(!a.length||a.indexOf(r)>-1))return 0>i.clobber.indexOf(n)?r:i.clobberPrefix+r}function f(){return"html"}function p(i,r,n,a){var o="string"==typeof r&&r,l=-1;if(!o||"*"===o||0>i.tagNames.indexOf(o))return!1;if(s.call(i.ancestors,o)){for(;++l<i.ancestors[o].length;)if(a.indexOf(i.ancestors[o][l])>-1)return o;return!1}return o}function m(i,r){var n="string"==typeof r?r:"",a=n.indexOf("-->");return a<0?n:n.slice(0,a)}function g(i){for(var r,n={},a=-1;++a<i.length;)(r=i[a])&&"object"==typeof r&&"length"in r?n[r[0]]=r.slice(1):n[r]=[];return n}function _(i,r){return r}},792326,(i,r,n)=>{"use strict";r.exports=i.r(774147)},148021,(i,r,n)=>{"use strict";var a=i.r(792326);
119r.exports=function(i){return function(r){return a(r,i)}}},598842,i=>{i.v({filters:"YextSearch-module-scss-module__ThkQcG__filters",header:"YextSearch-module-scss-module__ThkQcG__header",heading:"YextSearch-module-scss-module__ThkQcG__heading",highlight:"YextSearch-module-scss-module__ThkQcG__highlight",inner:"YextSearch-module-scss-module__ThkQcG__inner",results:"YextSearch-module-scss-module__ThkQcG__results","results-count":"YextSearch-module-scss-module__ThkQcG__results-count","sr-only":"YextSearch-module-scss-module__ThkQcG__sr-only",tabs:"YextSearch-module-scss-module__ThkQcG__tabs",text:"YextSearch-module-scss-module__ThkQcG__text",vertical:"YextSearch-module-scss-module__ThkQcG__vertical",wrapper:"YextSearch-module-scss-module__ThkQcG__wrapper"})},327329,i=>{i.v({"clear-button":"StyledYextSearchBar-module-scss-module__NLFGQa__clear-button","error-suggestion":"StyledYextSearchBar-module-scss-module__NLFGQa__error-suggestion",highlight:"StyledYextSearchBar-module-scss-module__NLFGQa__highlight",icon:"StyledYextSearchBar-module-scss-module__NLFGQa__icon","input-divider":"StyledYextSearchBar-module-scss-module__NLFGQa__input-divider","input-element":"StyledYextSearchBar-module-scss-module__NLFGQa__input-element","search-bar-container":"StyledYextSearchBar-module-scss-module__NLFGQa__search-bar-container","search-button":"StyledYextSearchBar-module-scss-module__NLFGQa__search-button","search-button-container":"StyledYextSearchBar-module-scss-module__NLFGQa__search-button-container","sr-only":"StyledYextSearchBar-module-scss-module__NLFGQa__sr-only",suggestion:"StyledYextSearchBar-module-scss-module__NLFGQa__suggestion",suggestions:"StyledYextSearchBar-module-scss-module__NLFGQa__suggestions","vertical-divider":"StyledYextSearchBar-module-scss-module__NLFGQa__vertical-divider",wrapper:"StyledYextSearchBar-module-scss-module__NLFGQa__wrapper"})},832665,560071,i=>{"use strict";let r,n;var a,o,s,l,u,c,d,h=i.i(677076),f=i.i(327329),p=i.i(2317);i.i(469321),Object.create(null);let m={},g=(i,r,n,a)=>{x(n)&&m[n]||(x(n)&&(m[n]=new Date),((i,r,n,a)=>{let o=[n,{code:r,...a||{}}];if(i?.services?.logger?.forward)return i.services.logger.forward(o,"warn","react-i18next::",!0);x(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),i?.services?.logger?.warn?i.services.logger.warn(...o):console?.warn&&console.warn(...o)})(i,r,n,a))},_=(i,r)=>()=>{if(i.isInitialized)r();else{let n=()=>{setTimeout(()=>{i.off("initialized",n)},0),r()};i.on("initialized",n)}},y=(i,r,n)=>{i.loadNamespaces(r,_(i,n))},v=(i,r,n,a)=>{if(x(n)&&(n=[n]),i.options.preload&&i.options.preload.indexOf(r)>-1)return y(i,n,a);n.forEach(r=>{0>i.options.ns.indexOf(r)&&i.options.ns.push(r)}),i.loadLanguages(r,_(i,a))},x=i=>"string"==typeof i,b=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,w={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},T=i=>w[i],E={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:i=>i.replace(b,T)},S=(0,p.createContext)();class A{constructor(){this.usedNamespaces={}}addUsedNamespaces(i){i.forEach(i=>{this.usedNamespaces[i]||(this.usedNamespaces[i]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}let C=(i,n={})=>{var a,o,s,l;let u,{i18n:c}=n,{i18n:d,defaultNS:h}=(0,p.useContext)(S)||{},f=c||d||r;if(f&&!f.reportNamespaces&&(f.reportNamespaces=new A),!f){g(f,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");let i=(i,r)=>{let n;return x(r)?r:"object"==typeof(n=r)&&null!==n&&x(r.defaultValue)?r.defaultValue:Array.isArray(i)?i[i.length-1]:i},r=[i,{},!1];return r.t=i,r.i18n={},r.ready=!1,r}f.options.react?.wait&&g(f,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");let m={...E,...f.options.react,...n},{useSuspense:_,keyPrefix:b}=m,w=i||h||f.options?.defaultNS;w=x(w)?[w]:w||["translation"],f.reportNamespaces.addUsedNamespaces?.(w);let T=(f.isInitialized||f.initializedStoreOnce)&&w.every(i=>((i,r,n={})=>r.languages&&r.languages.length?r.hasLoadedNamespace(i,{lng:n.lng,precheck:(r,a)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,i))return!1}}):(g(r,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:r.languages}),!0))(i,f,m)),C=(a=n.lng||null,o="fallback"===m.nsMode?w:w[0],(0,p.useCallback)(f.getFixedT(a,o,b),[f,a,o,b])),I=()=>C,k=()=>{let i,r;return i=n.lng||null,r="fallback"===m.nsMode?w:w[0],f.getFixedT(i,r,b)},[R,M]=(0,p.useState)(I),L=w.join();n.lng&&(L=`${n.lng}${L}`);let P=(s=L,u=(0,p.useRef)(),(0,p.useEffect)(()=>{u.current=l?u.current:s},[s,l]),u.current),O=(0,p.useRef)(!0);(0,p.useEffect)(()=>{let{bindI18n:i,bindI18nStore:r}=m;O.current=!0,T||_||(n.lng?v(f,n.lng,w,()=>{O.current&&M(k)}):y(f,w,()=>{O.current&&M(k)})),T&&P&&P!==L&&O.current&&M(k);let a=()=>{O.current&&M(k)};return i&&f?.on(i,a),r&&f?.store.on(r,a),()=>{O.current=!1,f&&i&&i?.split(" ").forEach(i=>
119f.off(i,a)),r&&f&&r.split(" ").forEach(i=>f.store.off(i,a))}},[f,L]),(0,p.useEffect)(()=>{O.current&&T&&M(I)},[f,b,T]);let D=[R,f,T];if(D.t=R,D.i18n=f,D.ready=T,T||!T&&!_)return D;throw new Promise(i=>{n.lng?v(f,n.lng,w,()=>i()):y(f,w,()=>i())})};var I=i.i(275243),k=i.i(565072),R=i.i(956028),M=i.i(227015),L=i.i(885025);(l||(l={})).NearMe="NEAR_ME";let P=!!("u">typeof window&&window.document&&window.document.createElement);var O=!1,D=!1;try{var F={get passive(){return O=!0},get once(){return D=O=!0}};P&&(window.addEventListener("test",F,F),window.removeEventListener("test",F,!0))}catch(i){}let N=function(i,r,n,a){if(a&&"boolean"!=typeof a&&!D){var o=a.once,s=a.capture,l=n;!D&&o&&(l=n.__once||function i(a){this.removeEventListener(r,i,s),n.call(this,a)},n.__once=l),i.addEventListener(r,l,O?a:s)}i.addEventListener(r,n,a)},j=function(i,r,n,a){var o=a&&"boolean"!=typeof a?a.capture:a;i.removeEventListener(r,n,o),n.__once&&i.removeEventListener(r,n.__once,o)},z=function(i,r,n,a){return N(i,r,n,a),function(){j(i,r,n,a)}};function B(i){return i&&i.ownerDocument||document}let U=function(i){let r=(0,p.useRef)(i);return(0,p.useEffect)(()=>{r.current=i},[i]),r};function V(i){let r=U(i);return(0,p.useCallback)(function(...i){return r.current&&r.current(...i)},[r])}function H(i,r){return i.contains?i.contains(r):i.compareDocumentPosition?i===r||!!(16&i.compareDocumentPosition(r)):void 0}var G=i.i(376935);let q=()=>{},$=i=>i&&("current"in i?i.current:i),W={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"},Y=function(i,r=q,{disabled:n,clickTrigger:a="click"}={}){let o=(0,p.useRef)(!1),s=(0,p.useRef)(!1),l=(0,p.useCallback)(r=>{let n=$(i);(0,G.default)(!!n,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),o.current=!n||!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)||0!==r.button||!!H(n,r.target)||s.current,s.current=!1},[i]),u=V(r=>{let n=$(i);n&&H(n,r.target)?s.current=!0:s.current=!1}),c=V(i=>{o.current||r(i)});(0,p.useEffect)(()=>{var r,o;if(n||null==i)return;let s=B($(i)),d=s.defaultView||window,h=null!=(r=d.event)?r:null==(o=d.parent)?void 0:o.event,f=null;W[a]&&(f=z(s,W[a],u,!0));let p=z(s,a,l,!0),m=z(s,a,i=>{if(i===h){h=void 0;return}c(i)}),g=[];return"ontouchstart"in s.documentElement&&(g=[].slice.call(s.body.children).map(i=>z(i,"mousemove",q))),()=>{null==f||f(),p(),m(),g.forEach(i=>i())}},[i,n,a,l,u,c])},Z=()=>{};var K=/^\[(.+)\]$/;function X(i,r){var n=i;return r.split("-").forEach(function(i){n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n}var Q=/\s+/;function J(){for(var i,r,n=0,a="";n<arguments.length;)(i=arguments[n++])&&(r=function i(r){if("string"==typeof r)return r;for(var n,a="",o=0;o<r.length;o++)r[o]&&(n=i(r[o]))&&(a&&(a+=" "),a+=n);return a}(i))&&(a&&(a+=" "),a+=r);return a}function ee(){for(var i,r,n,a=arguments.length,o=Array(a),s=0;s<a;s++)o[s]=arguments[s];var l=function(a){var s=o[0];return r=(i=function(i){var r,n,a,o,s,l,u,c,d,h,f,p,m,g;return{cache:function(i){if(i<1)return{get:function(){},set:function(){}};var r=0,n=new Map,a=new Map;function o(o,s){n.set(o,s),++r>i&&(r=0,a=n,n=new Map)}return{get:function(i){var r=n.get(i);return void 0!==r?r:void 0!==(r=a.get(i))?(o(i,r),r):void 0},set:function(i,r){n.has(i)?n.set(i,r):o(i,r)}}}(i.cacheSize),splitModifiers:(n=1===(r=i.separator||":").length,a=r[0],o=r.length,function(i){for(var s,l=[],u=0,c=0,d=0;d<i.length;d++){var h=i[d];if(0===u){if(h===a&&(n||i.slice(d,d+o)===r)){l.push(i.slice(c,d)),c=d+o;continue}if("/"===h){s=d;continue}}"["===h?u++:"]"===h&&u--}var f=0===l.length?i:i.substring(c),p=f.startsWith("!"),m=p?f.substring(1):f;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:s&&s>c?s-c:void 0}}),...(h=(d=i).theme,f=d.prefix,p={nextPart:new Map,validators:[]},(m=Object.entries(d.classGroups),(g=f)?m.map(function(i){return[i[0],i[1].map(function(i){return"string"==typeof i?g+i:"object"==typeof i?Object.fromEntries(Object.entries(i).map(function(i){return[g+i[0],i[1]]})):i})]}):m).forEach(function(i){var r=i[0];!function i(r,n,a,o){r.forEach(function(r){if("string"==typeof r){(""===r?n:X(n,r)).classGroupId=a;return}if("function"==typeof r)return r.isThemeGetter?void i(r(o),n,a,o):void n.validators.push({validator:r,classGroupId:a});Object.entries(r).forEach(function(r){var s=r[0];i(r[1],X(n,s),a,o)})})}(i[1],p,r,h)}),s=p,l=i.conflictingClassGroups,c=void 0===(u=i.conflictingClassGroupModifiers)?{}:u,{getClassGroupId:function(i){var r=i.split("-");return""===r[0]&&1!==r.length&&r.shift(),function i(r,n){if(0===r.length)return n.classGroupId;var a=r[0],o=n.nextPart.get(a),s=o?i(r.slice(1),o):void 0;if(s)return s;if(0!==n.validators.length){var l=r.join("-");return n.validators.find(function(i){return(0,i.validator)(l)})?.classGroupId}}(r,s)||function(i){if(K.test(i)){var r=K.exec(i)[1],n=r?.substring(0,r.indexOf(":"));if(n)return"arbitrary.."+n}}(i)},getConflictingClassGroupIds:function(i,r){var n=l[i]||[];return r&&c[i]?[].concat(n,c[i]):n}})}}(o.slice(1).reduce(function(i,r){return r(i)},s()))).cache.get,n=i.cache.set,l=u,u(a)};function u(a){var o,s,l,u,c,d=r(a);if(d)return d;var h=(s=(o=i).splitModifiers,l=o.getClassGroupId,u=o.getConflictingClassGroupIds,c=new Set,a.trim().split(Q).map(function(i){var r=s(i),n=r.modifiers,a=r.hasImportantModifier,o=r.baseClassName,u=r.maybePostfixModifierPosition,c=l(u?o.substring(0,u):o),d=!!u;if(!c){if(!u||!(c=l(o)))return{isTailwindClass:!1,originalClassName:i};d=!1}var h=(function(i){if(i.length<=1)return i;var r=[],n=[];
119return i.forEach(function(i){"["===i[0]?(r.push.apply(r,n.sort().concat([i])),n=[]):n.push(i)}),r.push.apply(r,n.sort()),r})(n).join(":");return{isTailwindClass:!0,modifierId:a?h+"!":h,classGroupId:c,originalClassName:i,hasPostfixModifier:d}}).reverse().filter(function(i){if(!i.isTailwindClass)return!0;var r=i.modifierId,n=i.classGroupId,a=i.hasPostfixModifier,o=r+n;return!c.has(o)&&(c.add(o),u(n,a).forEach(function(i){return c.add(r+i)}),!0)}).reverse().map(function(i){return i.originalClassName}).join(" "));return n(a,h),h}return function(){return l(J.apply(null,arguments))}}function et(i){var r=function(r){return r[i]||[]};return r.isThemeGetter=!0,r}var ei=/^\[(?:([a-z-]+):)?(.+)\]$/i,er=/^\d+\/\d+$/,en=new Set(["px","full","screen"]),ea=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,es=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function el(i){return ep(i)||en.has(i)||er.test(i)||eu(i)}function eu(i){return eb(i,"length",ew)}function ec(i){return eb(i,"size",eT)}function ed(i){return eb(i,"position",eT)}function eh(i){return eb(i,"url",eE)}function ef(i){return eb(i,"number",ep)}function ep(i){return!Number.isNaN(Number(i))}function em(i){return i.endsWith("%")&&ep(i.slice(0,-1))}function eg(i){return eS(i)||eb(i,"number",eS)}function e_(i){return ei.test(i)}function ey(){return!0}function ev(i){return ea.test(i)}function ex(i){return eb(i,"",eA)}function eb(i,r,n){var a=ei.exec(i);return!!a&&(a[1]?a[1]===r:n(a[2]))}function ew(i){return eo.test(i)}function eT(){return!1}function eE(i){return i.startsWith("url(")}function eS(i){return Number.isInteger(Number(i))}function eA(i){return es.test(i)}function eC(){var i=et("colors"),r=et("spacing"),n=et("blur"),a=et("brightness"),o=et("borderColor"),s=et("borderRadius"),l=et("borderSpacing"),u=et("borderWidth"),c=et("contrast"),d=et("grayscale"),h=et("hueRotate"),f=et("invert"),p=et("gap"),m=et("gradientColorStops"),g=et("gradientColorStopPositions"),_=et("inset"),y=et("margin"),v=et("opacity"),x=et("padding"),b=et("saturate"),w=et("scale"),T=et("sepia"),E=et("skew"),S=et("space"),A=et("translate"),C=function(){return["auto","contain","none"]},I=function(){return["auto","hidden","clip","visible","scroll"]},k=function(){return["auto",e_,r]},R=function(){return[e_,r]},M=function(){return["",el]},L=function(){return["auto",ep,e_]},P=function(){return["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"]},O=function(){return["solid","dashed","dotted","double","none"]},D=function(){return["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},F=function(){return["start","end","center","between","around","evenly","stretch"]},N=function(){return["","0",e_]},j=function(){return["auto","avoid","all","avoid-page","page","left","right","column"]},z=function(){return[ep,ef]},B=function(){return[ep,e_]};return{cacheSize:500,theme:{colors:[ey],spacing:[el],blur:["none","",ev,e_],brightness:z(),borderColor:[i],borderRadius:["none","","full",ev,e_],borderSpacing:R(),borderWidth:M(),contrast:z(),grayscale:N(),hueRotate:B(),invert:N(),gap:R(),gradientColorStops:[i],gradientColorStopPositions:[em,eu],inset:k(),margin:k(),opacity:z(),padding:R(),saturate:z(),scale:z(),sepia:N(),skew:B(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",e_]}],container:["container"],columns:[{columns:[ev]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(P(),[e_])}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}
vendor: 5,720 bytes, line 119
119],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",eg]}],basis:[{basis:k()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",e_]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",eg]}],"grid-cols":[{"grid-cols":[ey]}],"col-start-end":[{col:["auto",{span:["full",eg]},e_]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[ey]}],"row-start-end":[{row:["auto",{span:[eg]},e_]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",e_]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",e_]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal"].concat(F())}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal"].concat(F(),["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(F(),["baseline"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",e_,r]}],"min-w":[{"min-w":["min","max","fit",e_,el]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[ev]},ev,e_]}],h:[{h:[e_,r,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",e_,el]}],"max-h":[{"max-h":[e_,r,"min","max","fit"]}],"font-size":[{text:["base",ev,eu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ef]}],"font-family":[{font:[ey]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",e_]}],"line-clamp":[{"line-clamp":["none",ep,ef]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",e_,el]}],"list-image":[{"list-image":["none",e_]}],"list-style-type":[{list:["none","disc","decimal",e_]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[i]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[i]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(O(),["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",el]}],"underline-offset":[{"underline-offset":["auto",e_,el]}],"text-decoration-color":[{decoration:[i]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",e_]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",e_]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(P(),[ed])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ec]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},eh]}],"bg-color":[{bg:[i]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[].concat(O(),["hidden"])}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}
119],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:O()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:[""].concat(O())}],"outline-offset":[{"outline-offset":[e_,el]}],"outline-w":[{outline:[el]}],"outline-color":[{outline:[i]}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[i]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[el]}],"ring-offset-color":[{"ring-offset":[i]}],shadow:[{shadow:["","inner","none",ev,ex]}],"shadow-color":[{shadow:[ey]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":D()}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[a]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ev,e_]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",e_]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",e_]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",e_]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[eg,e_]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",e_]}],accent:[{accent:["auto",i]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",e_]}],"caret-color":[{caret:[i]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",e_]}],fill:[{fill:[i,"none"]}],"stroke-w":[{stroke:[el,ef]}],stroke:[{stroke:[i,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}var eI=Object.prototype.hasOwnProperty,ek=new Set(["string","number","boolean"]),eR=p.useLayoutEffect,eM=i.i(360227),eL=i.i(529594),eP=i.i(699813),eO=i.i(589295);let eD=i=>"string"==typeof i,eF=()=>{let i,r,n=new Promise((n,a)=>{i=n,r=a});return n.resolve=i,n.reject=r,n},eN=i=>null==i?"":""+i,ej=/###/g,ez=i=>i&&i.indexOf("###")>-1?i.replace(ej,"."):i,eB=i=>!i||eD(i),eU=(i,r,n)=>{let a=eD(r)?r.split("."):r,o=0;for(;o<a.length-1;){if(eB(i))return{};let r=ez(a[o]);!i[r]&&n&&(i[r]=new n),i=Object.prototype.hasOwnProperty.call(i,r)?i[r]:{},++o}return eB(i)?{}:{obj:i,k:ez(a[o])}},eV=(i,r,n)=>{let{obj:a,k:o}=eU(i,r,Object);if(void 0!==a||1===r.length){a[o]=n;return}let s=r[r.length-1],l=r.slice(0,r.length-1),u=eU(i,l,Object);for(;void 0===u.obj&&l.length;)s=`${l[l.length-1]}.${s}`,u=eU(i,l=l.slice(0,l.length-1),Object),u?.obj&&void 0!==u.obj[`${u.k}.${s}`]&&(u.obj=void 0);u.obj[`${u.k}.${s}`]=n},eH=(i,r)=>{let{obj:n,k:a}=eU(i,r);if(n&&Object.prototype.hasOwnProperty.call(n,a))return n[a]},eG=(i,r,n)=>{for(let a in r)"__proto__"!==a&&"constructor"!==a&&(a in i?eD(i[a])||i[a]instanceof String||eD(r[a])||r[a]instanceof String?n&&(i[a]=r[a]):eG(i[a],r[a],n):i[a]=r[a]);return i};var eq={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};let e$=i=>eD(i)?i.replace(/[&<>
119"'\/]/g,i=>eq[i]):i,eW=[" ",",","?","!",";"],eY=new class{constructor(i){this.capacity=i,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(i){let r=this.regExpMap.get(i);if(void 0!==r)return r;let n=new RegExp(i);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(i,n),this.regExpQueue.push(i),n}}(20),eZ=(i,r,n=".")=>{if(!i)return;if(i[r]){if(!Object.prototype.hasOwnProperty.call(i,r))return;return i[r]}let a=r.split(n),o=i;for(let i=0;i<a.length;){let r;if(!o||"object"!=typeof o)return;let s="";for(let l=i;l<a.length;++l)if(l!==i&&(s+=n),s+=a[l],void 0!==(r=o[s])){if(["string","number","boolean"].indexOf(typeof r)>-1&&l<a.length-1)continue;i+=l-i+1;break}o=r}return o},eK=i=>i?.replace(/_/g,"-"),eX={type:"logger",log(i){this.output("log",i)},warn(i){this.output("warn",i)},error(i){this.output("error",i)},output(i,r){console?.[i]?.apply?.(console,r)}};class eQ{constructor(i,r={}){this.init(i,r)}init(i,r={}){this.prefix=r.prefix||"i18next:",this.logger=i||eX,this.options=r,this.debug=r.debug}log(...i){return this.forward(i,"log","",!0)}warn(...i){return this.forward(i,"warn","",!0)}error(...i){return this.forward(i,"error","")}deprecate(...i){return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}forward(i,r,n,a){return a&&!this.debug?null:(eD(i[0])&&(i[0]=`${n}${this.prefix} ${i[0]}`),this.logger[r](i))}create(i){return new eQ(this.logger,{...{prefix:`${this.prefix}:${i}:`},...this.options})}clone(i){return(i=i||this.options).prefix=i.prefix||this.prefix,new eQ(this.logger,i)}}var eJ=new eQ;class e1{constructor(){this.observers={}}on(i,r){return i.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);let n=this.observers[i].get(r)||0;this.observers[i].set(r,n+1)}),this}off(i,r){if(this.observers[i]){if(!r)return void delete this.observers[i];this.observers[i].delete(r)}}emit(i,...r){this.observers[i]&&Array.from(this.observers[i].entries()).forEach(([i,n])=>{for(let a=0;a<n;a++)i(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,a])=>{for(let o=0;o<a;o++)n.apply(n,[i,...r])})}}class e0 extends e1{constructor(i,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=i||{},this.options=r,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(i){0>this.options.ns.indexOf(i)&&this.options.ns.push(i)}removeNamespaces(i){let r=this.options.ns.indexOf(i);r>-1&&this.options.ns.splice(r,1)}getResource(i,r,n,a={}){let o,s=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,l=void 0!==a.ignoreJSONStructure?a.ignoreJSONStructure:this.options.ignoreJSONStructure;i.indexOf(".")>-1?o=i.split("."):(o=[i,r],n&&(Array.isArray(n)?o.push(...n):eD(n)&&s?o.push(...n.split(s)):o.push(n)));let u=eH(this.data,o);return(!u&&!r&&!n&&i.indexOf(".")>-1&&(i=o[0],r=o[1],n=o.slice(2).join(".")),!u&&l&&eD(n))?eZ(this.data?.[i]?.[r],n,s):u}addResource(i,r,n,a,o={silent:!1}){let s=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,l=[i,r];n&&(l=l.concat(s?n.split(s):n)),i.indexOf(".")>-1&&(l=i.split("."),a=r,r=l[1]),this.addNamespaces(r),eV(this.data,l,a),o.silent||this.emit("added",i,r,n,a)}addResources(i,r,n,a={silent:!1}){for(let a in n)(eD(n[a])||Array.isArray(n[a]))&&this.addResource(i,r,a,n[a],{silent:!0});a.silent||this.emit("added",i,r,n)}addResourceBundle(i,r,n,a,o,s={silent:!1,skipCopy:!1}){let l=[i,r];i.indexOf(".")>-1&&(l=i.split("."),a=n,n=r,r=l[1]),this.addNamespaces(r);let u=eH(this.data,l)||{};s.skipCopy||(n=JSON.parse(JSON.stringify(n))),a?eG(u,n,o):u={...u,...n},eV(this.data,l,u),s.silent||this.emit("added",i,r,n)}removeResourceBundle(i,r){this.hasResourceBundle(i,r)&&delete this.data[i][r],this.removeNamespaces(r),this.emit("removed",i,r)}hasResourceBundle(i,r){return void 0!==this.getResource(i,r)}getResourceBundle(i,r){return r||(r=this.options.defaultNS),this.getResource(i,r)}getDataByLanguage(i){return this.data[i]}hasLanguageSomeTranslations(i){let r=this.getDataByLanguage(i);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var e2={processors:{},addPostProcessor(i){this.processors[i.name]=i}
119,handle(i,r,n,a,o){return i.forEach(i=>{r=this.processors[i]?.process(r,n,a,o)??r}),r}};let e5=Symbol("i18next/PATH_KEY");function e4(i,r){let n,a,o,{[e5]:s}=i((a=[],(o=Object.create(null)).get=(i,r)=>(n?.revoke?.(),r===e5)?a:(a.push(r),(n=Proxy.revocable(i,o)).proxy),Proxy.revocable(Object.create(null),o).proxy)),l=r?.keySeparator??".",u=r?.nsSeparator??":";if(s.length>1&&u){let i=r?.ns,n=Array.isArray(i)?i:null;if(n&&n.length>1&&n.slice(1).includes(s[0]))return`${s[0]}${u}${s.slice(1).join(l)}`}return s.join(l)}let e9={},e3=i=>!eD(i)&&"boolean"!=typeof i&&"number"!=typeof i;class e8 extends e1{constructor(i,r={}){super(),((i,r,n)=>{i.forEach(i=>{r[i]&&(n[i]=r[i])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,this),this.options=r,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=eJ.create("translator")}changeLanguage(i){i&&(this.language=i)}exists(i,r={interpolation:{}}){let n={...r};if(null==i)return!1;let a=this.resolve(i,n);if(a?.res===void 0)return!1;let o=e3(a.res);return!1!==n.returnObjects||!o}extractFromKey(i,r){let n=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let a=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=r.ns||this.options.defaultNS||[],s=n&&i.indexOf(n)>-1,l=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!((i,r,n)=>{r=r||"",n=n||"";let a=eW.filter(i=>0>r.indexOf(i)&&0>n.indexOf(i));if(0===a.length)return!0;let o=eY.getRegExp(`(${a.map(i=>"?"===i?"\\?":i).join("|")})`),s=!o.test(i);if(!s){let r=i.indexOf(n);r>0&&!o.test(i.substring(0,r))&&(s=!0)}return s})(i,n,a);if(s&&!l){let r=i.match(this.interpolator.nestingRegexp);if(r&&r.length>0)return{key:i,namespaces:eD(o)?[o]:o};let s=i.split(n);(n!==a||n===a&&this.options.ns.indexOf(s[0])>-1)&&(o=s.shift()),i=s.join(a)}return{key:i,namespaces:eD(o)?[o]:o}}translate(i,r,n){let a="object"==typeof r?{...r}:r;if("object"!=typeof a&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof a&&(a={...a}),a||(a={}),null==i)return"";"function"==typeof i&&(i=e4(i,{...this.options,...a})),Array.isArray(i)||(i=[String(i)]),i=i.map(i=>"function"==typeof i?e4(i,{...this.options,...a}):String(i));let o=void 0!==a.returnDetails?a.returnDetails:this.options.returnDetails,s=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,{key:l,namespaces:u}=this.extractFromKey(i[i.length-1],a),c=u[u.length-1],d=void 0!==a.nsSeparator?a.nsSeparator:this.options.nsSeparator;void 0===d&&(d=":");let h=a.lng||this.language,f=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h?.toLowerCase()==="cimode")return f?o?{res:`${c}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:h,usedNS:c,usedParams:this.getUsedParamsDetails(a)}:`${c}${d}${l}`:o?{res:l,usedKey:l,exactUsedKey:l,usedLng:h,usedNS:c,usedParams:this.getUsedParamsDetails(a)}:l;let p=this.resolve(i,a),m=p?.res,g=p?.usedKey||l,_=p?.exactUsedKey||l,y=void 0!==a.joinArrays?a.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,x=void 0!==a.count&&!eD(a.count),b=e8.hasDefaultValue(a),w=x?this.pluralResolver.getSuffix(h,a.count,a):"",T=a.ordinal&&x?this.pluralResolver.getSuffix(h,a.count,{ordinal:!1}):"",E=x&&!a.ordinal&&0===a.count,S=E&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${w}`]||a[`defaultValue${T}`]||a.defaultValue,A=m;v&&!m&&b&&(A=S);let C=e3(A),I=Object.prototype.toString.apply(A);if(v&&A&&C&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(I)&&!(eD(y)&&Array.isArray(A))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let i=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,A,{...a,ns:u}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(p.res=i,p.usedParams=this.getUsedParamsDetails(a),p):i}if(s){let i=Array.isArray(A),r=i?[]:{},n=i?_:g;for(let i in A)if(Object.prototype.hasOwnProperty.call(A,i)){let o=`${n}${s}${i}`;b&&!m?r[i]=this.translate(o,{...a,defaultValue:e3(S)?S[i]:void 0,...{joinArrays:!1,ns:u}}):r[i]=this.translate(o,{...a,joinArrays:!1,ns:u}),r[i]===o&&(r[i]=A[i])}m=r}}else if(v&&eD(y)&&Array.isArray(m))(m=m.join(y))&&(m=this.extendTranslation(m,i,a,n));else{let r=!1,o=!1;!this.isValidLookup(m)&&b&&(r=!0,m=S),this.isValidLookup(m)||(o=!0,m=l);let u=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:m,f=b&&S!==m&&this.options.updateMissing;if(o||r||f){if(this.logger.log(f?"updateKey":"missingKey",h,c,l,f?S:m),s){let i=this.resolve(l,{...a,keySeparator:!1});i&&i.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let i=[],r=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if("fallback"===this.options.saveMissingTo&&r&&r[0])for(let n=0;n<r.length;n++)i.push(r[n]);else"all"===this.options.saveMissingTo?i=this.languageUtils.toResolveHierarchy(a.lng||this.language):i.push(a.lng||this.language);let n=(i,r,n)=>{let o=b&&n!==m?n:u;this.options.missingKeyHandler?this.options.missingKeyHandler(i,c,r,o,f,a):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(i,c,r,o,f,a),this.emit
119("missingKey",i,c,r,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?i.forEach(i=>{let r=this.pluralResolver.getSuffixes(i,a);E&&a[`defaultValue${this.options.pluralSeparator}zero`]&&0>r.indexOf(`${this.options.pluralSeparator}zero`)&&r.push(`${this.options.pluralSeparator}zero`),r.forEach(r=>{n([i],l+r,a[`defaultValue${r}`]||S)})}):n(i,l,S))}m=this.extendTranslation(m,i,a,p,n),o&&m===l&&this.options.appendNamespaceToMissingKey&&(m=`${c}${d}${l}`),(o||r)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${d}${l}`:l,r?m:void 0,a))}return o?(p.res=m,p.usedParams=this.getUsedParamsDetails(a),p):m}extendTranslation(i,r,n,a,o){if(this.i18nFormat?.parse)i=this.i18nFormat.parse(i,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!n.skipInterpolation){let s;n.interpolation&&this.interpolator.init({...n,...{interpolation:{...this.options.interpolation,...n.interpolation}}});let l=eD(i)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(l){let r=i.match(this.interpolator.nestingRegexp);s=r&&r.length}let u=n.replace&&!eD(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),i=this.interpolator.interpolate(i,u,n.lng||this.language||a.usedLng,n),l){let r=i.match(this.interpolator.nestingRegexp);s<(r&&r.length)&&(n.nest=!1)}!n.lng&&a&&a.res&&(n.lng=this.language||a.usedLng),!1!==n.nest&&(i=this.interpolator.nest(i,(...i)=>o?.[0]!==i[0]||n.context?this.translate(...i,r):(this.logger.warn(`It seems you are nesting recursively key: ${i[0]} in key: ${r[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}let s=n.postProcess||this.options.postProcess,l=eD(s)?[s]:s;return null!=i&&l?.length&&!1!==n.applyPostProcessor&&(i=e2.handle(l,i,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),i}resolve(i,r={}){let n,a,o,s,l;return eD(i)&&(i=[i]),Array.isArray(i)&&(i=i.map(i=>"function"==typeof i?e4(i,{...this.options,...r}
119):i)),i.forEach(i=>{if(this.isValidLookup(n))return;let u=this.extractFromKey(i,r),c=u.key;a=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));let h=void 0!==r.count&&!eD(r.count),f=h&&!r.ordinal&&0===r.count,p=void 0!==r.context&&(eD(r.context)||"number"==typeof r.context)&&""!==r.context,m=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);d.forEach(i=>{this.isValidLookup(n)||(l=i,!e9[`${m[0]}-${i}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(l)&&(e9[`${m[0]}-${i}`]=!0,this.logger.warn(`key "${a}" for languages "${m.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(a=>{let l;if(this.isValidLookup(n))return;s=a;let u=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(u,c,a,i,r);else{let i;h&&(i=this.pluralResolver.getSuffix(a,r.count,r));let n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(r.ordinal&&0===i.indexOf(o)&&u.push(c+i.replace(o,this.options.pluralSeparator)),u.push(c+i),f&&u.push(c+n)),p){let a=`${c}${this.options.contextSeparator||"_"}${r.context}`;u.push(a),h&&(r.ordinal&&0===i.indexOf(o)&&u.push(a+i.replace(o,this.options.pluralSeparator)),u.push(a+i),f&&u.push(a+n))}}for(;l=u.pop();)this.isValidLookup(n)||(o=l,n=this.getResource(a,i,l,r))}))})}),{res:n,usedKey:a,exactUsedKey:o,usedLng:s,usedNS:l}}isValidLookup(i){return void 0!==i&&!(!this.options.returnNull&&null===i)&&!(!this.options.returnEmptyString&&""===i)}getResource(i,r,n,a={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(i,r,n,a):this.resourceStore.getResource(i,r,n,a)}getUsedParamsDetails(i={}){let r=i.replace&&!eD(i.replace),n=r?i.replace:i;if(r&&void 0!==i.count&&(n.count=i.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!r)for(let i of(n={...n},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete n[i];return n}static hasDefaultValue(i){let r="defaultValue";for(let n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&r===n.substring(0,r.length)&&void 0!==i[n])return!0;return!1}}class e6{constructor(i){this.options=i,this.supportedLngs=this.options.supportedLngs||!1,this.logger=eJ.create("languageUtils")}getScriptPartFromCode(i){if(!(i=eK(i))||0>i.indexOf("-"))return null;let r=i.split("-");return 2===r.length||(r.pop(),"x"===r[r.length-1].toLowerCase())?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(i){if(!(i=eK(i))||0>i.indexOf("-"))return i;let r=i.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(i){if(eD(i)&&i.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(i)[0]}catch(i){}return(r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r)?r:this.options.lowerCaseLng?i.toLowerCase():i}return this.options.cleanCode||this.options.lowerCaseLng?i.toLowerCase():i}isSupportedCode(i){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(i=this.getLanguagePartFromCode(i)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(i)>-1}getBestMatchFromCodes(i){let r;return i?(i.forEach(i=>{if(r)return;let n=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(n))&&(r=n)}),!r&&this.options.supportedLngs&&i.forEach(i=>{if(r)return;let n=this.getScriptPartFromCode(i);if(this.isSupportedCode(n))return r=n;let a=this.getLanguagePartFromCode(i);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(i=>{if(i===a||!(0>i.indexOf("-")&&0>a.indexOf("-"))&&(i.indexOf("-")>0&&0>a.indexOf("-")&&i.substring(0,i.indexOf("-"))===a||0===i.indexOf(a)&&a.length>1))return i})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r):null}getFallbackCodes(i,r){if(!i)return[];if("function"==typeof i&&(i=i(r)),eD(i)&&(i=[i]),Array.isArray(i))return i;if(!r)return i.default||[];let n=i[r];
119return n||(n=i[this.getScriptPartFromCode(r)]),n||(n=i[this.formatLanguageCode(r)]),n||(n=i[this.getLanguagePartFromCode(r)]),n||(n=i.default),n||[]}toResolveHierarchy(i,r){let n=this.getFallbackCodes((!1===r?[]:r)||this.options.fallbackLng||[],i),a=[],o=i=>{i&&(this.isSupportedCode(i)?a.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return eD(i)&&(i.indexOf("-")>-1||i.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(i)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(i)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(i))):eD(i)&&o(this.formatLanguageCode(i)),n.forEach(i=>{0>a.indexOf(i)&&o(this.formatLanguageCode(i))}),a}}let e7={zero:0,one:1,two:2,few:3,many:4,other:5},te={select:i=>1===i?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class tt{constructor(i,r={}){this.languageUtils=i,this.options=r,this.logger=eJ.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(i,r={}){let n,a=eK("dev"===i?"en":i),o=r.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:a,type:o});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];try{n=new Intl.PluralRules(a,{type:o})}catch(o){if("u"<typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),te;if(!i.match(/-|_/))return te;let a=this.languageUtils.getLanguagePartFromCode(i);n=this.getRule(a,r)}return this.pluralRulesCache[s]=n,n}needsPlural(i,r={}){let n=this.getRule(i,r);return n||(n=this.getRule("dev",r)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(i,r,n={}){return this.getSuffixes(i,n).map(i=>`${r}${i}`)}getSuffixes(i,r={}){let n=this.getRule(i,r);return(n||(n=this.getRule("dev",r)),n)?n.resolvedOptions().pluralCategories.sort((i,r)=>e7[i]-e7[r]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(i,r,n={}){let a=this.getRule(i,n);return a?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a.select(r)}`:(this.logger.warn(`no plural rule found for: ${i}`),this.getSuffix("dev",r,n))}}let ti=(i,r,n,a=".",o=!0)=>{let s,l=void 0!==(s=eH(i,n))?s:eH(r,n);return!l&&o&&eD(n)&&void 0===(l=eZ(i,n,a))&&(l=eZ(r,n,a)),l};class tr{constructor(i={}){this.logger=eJ.create("interpolator"),this.options=i,this.format=i?.interpolation?.format||(i=>i),this.init(i)}init(i={}){i.interpolation||(i.interpolation={escapeValue:!0});let{escape:r,escapeValue:n,useRawValueToEscape:a,prefix:o,prefixEscaped:s,suffix:l,suffixEscaped:u,formatSeparator:c,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:m,nestingSuffixEscaped:g,nestingOptionsSeparator:_,maxReplaces:y,alwaysFormat:v}=i.interpolation;this.escape=void 0!==r?r:e$,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==a&&a,this.prefix=o?o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):s||"{{",this.suffix=l?l.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):u||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=f?f.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):p||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=m?m.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):g||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=_||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let i=(i,r)=>i?.source===r?(i.lastIndex=0,i):RegExp(r,"g");this.regexp=i(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=i(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=i(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(i,r,n,a){let o,s,l,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=i=>{if(0>i.indexOf(this.formatSeparator)){let o=ti(r,u,i,this.options.keySeparator,this.options.ignoreJSONStructure);
119return this.alwaysFormat?this.format(o,void 0,n,{...a,...r,interpolationkey:i}):o}let o=i.split(this.formatSeparator),s=o.shift().trim(),l=o.join(this.formatSeparator).trim();return this.format(ti(r,u,s,this.options.keySeparator,this.options.ignoreJSONStructure),l,n,{...a,...r,interpolationkey:s})};this.resetRegExp();let d=a?.missingInterpolationHandler||this.options.missingInterpolationHandler,h=a?.interpolation?.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:i=>i.replace(/\$/g,"$$$$")},{regex:this.regexp,safeValue:i=>this.escapeValue?this.escape(i).replace(/\$/g,"$$$$"):i.replace(/\$/g,"$$$$")}].forEach(r=>{for(l=0;o=r.regex.exec(i);){let n=o[1].trim();if(void 0===(s=c(n)))if("function"==typeof d){let r=d(i,o,a);s=eD(r)?r:""}else if(a&&Object.prototype.hasOwnProperty.call(a,n))s="";else if(h){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${i}`),s="";else eD(s)||this.useRawValueToEscape||(s=eN(s));let u=r.safeValue(s);if(i=i.replace(o[0],u),h?(r.regex.lastIndex+=s.length,r.regex.lastIndex-=o[0].length):r.regex.lastIndex=0,++l>=this.maxReplaces)break}}),i}nest(i,r,n={}){let a,o,s,l=(i,r)=>{let n=this.nestingOptionsSeparator;if(0>i.indexOf(n))return i;let a=i.split(RegExp(`${n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}[ ]*{`)),o=`{${a[1]}`;i=a[0];let l=(o=this.interpolate(o,s)).match(/'/g),u=o.match(/"/g);((l?.length??0)%2!=0||u)&&(u?.length??0)%2==0||(o=o.replace(/'/g,'"'));try{s=JSON.parse(o),r&&(s={...r,...s})}catch(r){return this.logger.warn(`failed parsing options string in nesting for key ${i}`,r),`${i}${n}${o}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,i};for(;a=this.nestingRegexp.exec(i);){let u=[];(s=(s={...n}).replace&&!eD(s.replace)?s.replace:s).applyPostProcessor=!1,delete s.defaultValue;let c=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(-1!==c&&(u=a[1].slice(c).split(this.formatSeparator).map(i=>i.trim()).filter(Boolean),a[1]=a[1].slice(0,c)),(o=r(l.call(this,a[1].trim(),s),s))&&a[0]===i&&!eD(o))return o;eD(o)||(o=eN(o)),o||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${i}`),o=""),u.length&&(o=u.reduce((i,r)=>this.format(i,r,n.lng,{...n,interpolationkey:a[1].trim()}),o.trim())),i=i.replace(a[0],o),this.regexp.lastIndex=0}return i}}let tn=i=>{let r={};return(n,a,o)=>{let s=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(s={...s,[o.interpolationkey]:void 0});let l=a+JSON.stringify(s),u=r[l];return u||(u=i(eK(a),o),r[l]=u),u(n)}},ta=i=>(r,n,a)=>i(eK(n),a)(r);class to{constructor(i={}){this.logger=eJ.create("formatter"),this.options=i,this.init(i)}init(i,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";let n=r.cacheInBuiltFormats?tn:ta;this.formats={number:n((i,r)=>{let n=new Intl.NumberFormat(i,{...r});return i=>n.format(i)}),currency:n((i,r)=>{let n=new Intl.NumberFormat(i,{...r,style:"currency"});return i=>n.format(i)}),datetime:n((i,r)=>{let n=new Intl.DateTimeFormat(i,{...r});return i=>n.format(i)}),relativetime:n((i,r)=>{let n=new Intl.RelativeTimeFormat(i,{...r});return i=>n.format(i,r.range||"day")}),list:n((i,r)=>{let n=new Intl.ListFormat(i,{...r});return i=>n.format(i)})}}add(i,r){this.formats[i.toLowerCase().trim()]=r}addCached(i,r){this.formats[i.toLowerCase().trim()]=tn(r)}format(i,r,n,a={}){let o=r.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&0>o[0].indexOf(")")&&o.find(i=>i.indexOf(")")>-1)){let i=o.findIndex(i=>i.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,i)].join(this.formatSeparator)}return o.reduce((i,r)=>{let{formatName:o,formatOptions:s}=(i=>{let r=i.toLowerCase().trim(),n={};if(i.indexOf("(")>-1){let a=i.split("(");r=a[0].toLowerCase().trim();let o=a[1].substring(0,a[1].length-1);"currency"===r&&0>o.indexOf(":")?n.currency||(n.currency=o.trim()):"relativetime"===r&&0>o.indexOf(":")?n.range||(n.range=o.trim()):o.split(";").forEach(i=>{if(i){let[r,...a]=i.split(":"),o=a.join(":").trim().replace(/^'+|'+$/g,""),s=r.trim();n[s]||(n[s]=o),"false"===o&&(n[s]=!1),"true"===o&&(n[s]=!0),isNaN(o)||(n[s]=parseInt(o,10))}})}return{formatName:r,formatOptions:n}})(r);if(this.formats[o]){let r=i;try{let l=a?.formatParams?.[a.interpolationkey]||{},u=l.locale||l.lng||a.locale||a.lng||n;r=this.formats[o](i,u,{...s,...a,...l})}catch(i){this.logger.warn(i)}return r}return this.logger.warn(`there was no format function for ${o}`),i},i)}}class ts extends e1{constructor(i,r,n,a={}){super(),this.backend=i,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=a,this.logger=eJ.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,a.backend,a)}queueLoad(i,r,n,a){let o={},s={},l={},u={};
119return i.forEach(i=>{let a=!0;r.forEach(r=>{let l=`${i}|${r}`;!n.reload&&this.store.hasResourceBundle(i,r)?this.state[l]=2:this.state[l]<0||(1===this.state[l]?void 0===s[l]&&(s[l]=!0):(this.state[l]=1,a=!1,void 0===s[l]&&(s[l]=!0),void 0===o[l]&&(o[l]=!0),void 0===u[r]&&(u[r]=!0)))}),a||(l[i]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(u)}}loaded(i,r,n){let a=i.split("|"),o=a[0],s=a[1];r&&this.emit("failedLoading",o,s,r),!r&&n&&this.store.addResourceBundle(o,s,n,void 0,void 0,{skipCopy:!0}),this.state[i]=r?-1:2,r&&n&&(this.state[i]=0);let l={};this.queue.forEach(n=>{((i,r,n,a)=>{let{obj:o,k:s}=eU(i,r,Object);o[s]=o[s]||[],o[s].push(n)})(n.loaded,[o],s),void 0!==n.pending[i]&&(delete n.pending[i],n.pendingCount--),r&&n.errors.push(r),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(i=>{l[i]||(l[i]={});let r=n.loaded[i];r.length&&r.forEach(r=>{void 0===l[i][r]&&(l[i][r]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(i=>!i.done)}read(i,r,n,a=0,o=this.retryTimeout,s){if(!i.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:i,ns:r,fcName:n,tried:a,wait:o,callback:s});this.readingCalls++;let l=(l,u)=>{if(this.readingCalls--,this.waitingReads.length>0){let i=this.waitingReads.shift();this.read(i.lng,i.ns,i.fcName,i.tried,i.wait,i.callback)}l&&u&&a<this.maxRetries?setTimeout(()=>{this.read.call(this,i,r,n,a+1,2*o,s)},o):s(l,u)},u=this.backend[n].bind(this.backend);if(2===u.length){try{let n=u(i,r);n&&"function"==typeof n.then?n.then(i=>l(null,i)).catch(l):l(null,n)}catch(i){l(i)}return}return u(i,r,l)}prepareLoading(i,r,n={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();eD(i)&&(i=this.languageUtils.toResolveHierarchy(i)),eD(r)&&(r=[r]);let o=this.queueLoad(i,r,n,a);if(!o.toLoad.length)return o.pending.length||a(),null;o.toLoad.forEach(i=>{this.loadOne(i)})}load(i,r,n){this.prepareLoading(i,r,{},n)}reload(i,r,n){this.prepareLoading(i,r,{reload:!0},n)}loadOne(i,r=""){let n=i.split("|"),a=n[0],o=n[1];this.read(a,o,"read",void 0,void 0,(n,s)=>{n&&this.logger.warn(`${r}loading namespace ${o} for language ${a} failed`,n),!n&&s&&this.logger.log(`${r}loaded namespace ${o} for language ${a}`,s),this.loaded(i,n,s)})}saveMissing(i,r,n,a,o,s={},l=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(r))return void this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=n&&""!==n){if(this.backend?.create){let u={...s,isUpdate:o},c=this.backend.create.bind(this.backend);if(c.length<6)try{let o;(o=5===c.length?c(i,r,n,a,u):c(i,r,n,a))&&"function"==typeof o.then?o.then(i=>l(null,i)).catch(l):l(null,o)}catch(i){l(i)}else c(i,r,n,a,l,u)}i&&i[0]&&this.store.addResource(i[0],r,n,a)}}}let tl=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:i=>{let r={};if("object"==typeof i[1]&&(r=i[1]),eD(i[1])&&(r.defaultValue=i[1]),eD(i[2])&&(r.tDescription=i[2]),"object"==typeof i[2]||"object"==typeof i[3]){let n=i[3]||i[2];
119Object.keys(n).forEach(i=>{r[i]=n[i]})}return r},interpolation:{escapeValue:!0,format:i=>i,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),tu=i=>(eD(i.ns)&&(i.ns=[i.ns]),eD(i.fallbackLng)&&(i.fallbackLng=[i.fallbackLng]),eD(i.fallbackNS)&&(i.fallbackNS=[i.fallbackNS]),i.supportedLngs?.indexOf?.("cimode")<0&&(i.supportedLngs=i.supportedLngs.concat(["cimode"])),"boolean"==typeof i.initImmediate&&(i.initAsync=i.initImmediate),i),tc=()=>{},td="__i18next_supportNoticeShown";class th extends e1{constructor(i={},r){if(super(),this.options=tu(i),this.services={},this.logger=eJ,this.modules={external:[]},(i=>{Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach(r=>{"function"==typeof i[r]&&(i[r]=i[r].bind(i))})})(this),r&&!this.isInitialized&&!i.isClone){if(!this.options.initAsync)return this.init(i,r),this;setTimeout(()=>{this.init(i,r)},0)}}init(i={},r){this.isInitializing=!0,"function"==typeof i&&(r=i,i={}),null==i.defaultNS&&i.ns&&(eD(i.ns)?i.defaultNS=i.ns:0>i.ns.indexOf("translation")&&(i.defaultNS=i.ns[0]));let n=tl();this.options={...n,...this.options,...tu(i)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==i.keySeparator&&(this.options.userDefinedKeySeparator=i.keySeparator),void 0!==i.nsSeparator&&(this.options.userDefinedNsSeparator=i.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),!1!==this.options.showSupportNotice&&!(this?.modules?.backend?.name?.indexOf("Locize")>0||this?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||this?.options?.backend?.backends&&this.options.backend.backends.some(i=>i?.name?.indexOf("Locize")>0||i?.constructor?.name?.indexOf("Locize")>0)||this?.options?.backend?.projectId||this?.options?.backend?.backendOptions&&this.options.backend.backendOptions.some(i=>i?.projectId))&&1&&!("u">typeof globalThis&&globalThis[td]||void 0!==eO.default&&eO.default.env&&eO.default.env.I18NEXT_NO_SUPPORT_NOTICE||void 0!==eO.default&&eO.default.env&&1)&&("u">typeof console&&void 0!==console.info&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),"u">typeof globalThis&&(globalThis[td]=!0));let a=i=>i?"function"==typeof i?new i:i:null;if(!this.options.isClone){let i;this.modules.logger?eJ.init(a(this.modules.logger),this.options):eJ.init(null,this.options),i=this.modules.formatter?this.modules.formatter:to;let r=new e6(this.options);this.store=new e0(this.options.resources,this.options);let o=this.services;o.logger=eJ,o.resourceStore=this.store,o.languageUtils=r,o.pluralResolver=new tt(r,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),i&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(o.formatter=a(i),o.formatter.init&&o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new tr(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new ts(a(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(i,...r)=>{this.emit(i,...r)}),this.modules.languageDetector&&(o.languageDetector=a(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=a(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new e8(this.services,this.options),this.translator.on("*",(i,...r)=>
119{this.emit(i,...r)}),this.modules.external.forEach(i=>{i.init&&i.init(this)})}if(this.format=this.options.interpolation.format,r||(r=tc),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let i=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);i.length>0&&"dev"!==i[0]&&(this.options.lng=i[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(i=>{this[i]=(...r)=>this.store[i](...r)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(i=>{this[i]=(...r)=>(this.store[i](...r),this)});let o=eF(),s=()=>{let i=(i,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(n),r(i,n)};if(this.languages&&!this.isInitialized)return i(null,this.t.bind(this));this.changeLanguage(this.options.lng,i)};return this.options.resources||!this.options.initAsync?s():setTimeout(s,0),o}loadResources(i,r=tc){let n=r,a=eD(i)?i:this.language;if("function"==typeof i&&(n=i),!this.options.resources||this.options.partialBundledLanguages){if(a?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return n();let i=[],r=r=>{r&&"cimode"!==r&&this.services.languageUtils.toResolveHierarchy(r).forEach(r=>{"cimode"!==r&&0>i.indexOf(r)&&i.push(r)})};a?r(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(i=>r(i)),this.options.preload?.forEach?.(i=>r(i)),this.services.backendConnector.load(i,this.options.ns,i=>{i||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(i)})}else n(null)}reloadResources(i,r,n){let a=eF();return"function"==typeof i&&(n=i,i=void 0),"function"==typeof r&&(n=r,r=void 0),i||(i=this.languages),r||(r=this.options.ns),n||(n=tc),this.services.backendConnector.reload(i,r,i=>{a.resolve(),n(i)}),a}use(i){if(!i)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===i.type&&(this.modules.backend=i),("logger"===i.type||i.log&&i.warn&&i.error)&&(this.modules.logger=i),"languageDetector"===i.type&&(this.modules.languageDetector=i),"i18nFormat"===i.type&&(this.modules.i18nFormat=i),"postProcessor"===i.type&&e2.addPostProcessor(i),"formatter"===i.type&&(this.modules.formatter=i),"3rdParty"===i.type&&this.modules.external.push(i),this}setResolvedLanguage(i){if(i&&this.languages&&!(["cimode","dev"].indexOf(i)>-1)){for(let i=0;i<this.languages.length;i++){let r=this.languages[i];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&0>this.languages.indexOf(i)&&this.store.hasLanguageSomeTranslations(i)&&(this.resolvedLanguage=i,this.languages.unshift(i))}}changeLanguage(i,r){this.isLanguageChangingTo=i;let n=eF();this.emit("languageChanging",i);let a=i=>{this.language=i,this.languages=this.services.languageUtils.toResolveHierarchy(i),this.resolvedLanguage=void 0,this.setResolvedLanguage(i)},o=(o,s)=>{s?this.isLanguageChangingTo===i&&(a(s),this.translator.changeLanguage(s),this.isLanguageChangingTo=void 0,this.emit("languageChanged",s),this.logger.log("languageChanged",s)):this.isLanguageChangingTo=void 0,n.resolve((...i)=>this.t(...i)),r&&r(o,(...i)=>this.t(...i))},s=r=>{i||r||!this.services.languageDetector||(r=[]);let n=eD(r)?r:r&&r[0],s=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(eD(r)?[r]:r);s&&(this.language||a(s),this.translator.language||this.translator.changeLanguage(s),this.services.languageDetector?.cacheUserLanguage?.(s)),this.loadResources(s,i=>{o(i,s)})};return i||!this.services.languageDetector||this.services.languageDetector.async?!i&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(i):s(this.services.languageDetector.detect()),n}getFixedT(i,r,n){let a=(i,r,...o)=>{let s,l;(s="object"!=typeof r?this.options.overloadTranslationOptionHandler([i,r].concat(o)):{...r}).lng=s.lng||a.lng,s.lngs=s.lngs||a.lngs,s.ns=s.ns||a.ns,""!==s.keyPrefix&&(s.keyPrefix=s.keyPrefix||n||a.keyPrefix);let u={...this.options,...s};"function"==typeof s.keyPrefix&&(s.keyPrefix=e4(s.keyPrefix,u));let c=this.options.keySeparator||".";return s.keyPrefix&&Array.isArray(i)?l=i.map(i=>("function"==typeof i&&(i=e4(i,u)),`${s.keyPrefix}${c}${i}`)):("function"==typeof i&&(i=e4(i,u)),l=s.keyPrefix?`${s.keyPrefix}${c}${i}`:i),this.t(l,s)};return eD(i)?a.lng=i:a.lngs=i,a.ns=r,a.keyPrefix=n,a}t(...i){return this.translator?.translate(...i)}exists(...i){return this.translator?.exists(...i)}setDefaultNamespace(i){this.options.defaultNS=i}hasLoadedNamespace(i,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
119if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=r.lng||this.resolvedLanguage||this.languages[0],a=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let s=(i,r)=>{let n=this.services.backendConnector.state[`${i}|${r}`];return -1===n||0===n||2===n};if(r.precheck){let i=r.precheck(this,s);if(void 0!==i)return i}return!!(this.hasResourceBundle(n,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(n,i)&&(!a||s(o,i)))}loadNamespaces(i,r){let n=eF();return this.options.ns?(eD(i)&&(i=[i]),i.forEach(i=>{0>this.options.ns.indexOf(i)&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(i,r){let n=eF();eD(i)&&(i=[i]);let a=this.options.preload||[],o=i.filter(i=>0>a.indexOf(i)&&this.services.languageUtils.isSupportedCode(i));return o.length?(this.options.preload=a.concat(o),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}dir(i){if(i||(i=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!i)return"rtl";try{let r=new Intl.Locale(i);if(r&&r.getTextInfo){let i=r.getTextInfo();if(i&&i.direction)return i.direction}}catch(i){}let r=this.services?.languageUtils||new e6(tl());return i.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(r.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(i={},r){let n=new th(i,r);return n.createInstance=th.createInstance,n}cloneInstance(i={},r=tc){let n=i.forkResourceStore;n&&delete i.forkResourceStore;let a={...this.options,...i,isClone:!0},o=new th(a);if((void 0!==i.debug||void 0!==i.prefix)&&(o.logger=o.logger.clone(i)),["store","services","language"].forEach(i=>{o[i]=this[i]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new e0(Object.keys(this.store.data).reduce((i,r)=>(i[r]={...this.store.data[r]},i[r]=Object.keys(i[r]).reduce((n,a)=>(n[a]={...i[r][a]},n),i[r]),i),{}),a),o.services.resourceStore=o.store),i.interpolation){let r={...tl().interpolation,...this.options.interpolation,...i.interpolation},n={...a,interpolation:r};o.services.interpolator=new tr(n)}return o.translator=new e8(o.services,a),o.translator.on("*",(i,...r)=>{o.emit(i,...r)}),o.init(a,r),o.translator.options=a,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let tf=th.createInstance(),tp=tf.createInstance;tf.dir,tf.init,tf.loadResources,tf.reloadResources,tf.use,tf.changeLanguage,tf.getFixedT,tf.t,tf.exists,tf.setDefaultNamespace,tf.hasLoadedNamespace,tf.loadNamespaces,tf.loadLanguages,i.i(524238),(a=u||(u={})).Ip="IP",a.Device="DEVICE",a.Unknown="UNKNOWN";var tm=i.i(537904);p["useId".toString()],"u">typeof window?p.useLayoutEffect:p.useEffect,"u"<typeof window?p.useEffect:p.useLayoutEffect,i.i(279120),i.i(156399);var tg=i.i(309859);function t_(i){if(!ty(i))throw Error("Parameter was not an error")}function ty(i){var r;return!!i&&"object"==typeof i&&"[object Error]"===(r=i,Object.prototype.toString.call(r))||i instanceof Error}i.i(733150);class tv extends Error{constructor(i,r){const n=[...arguments],{options:a,shortMessage:o}=function(i){let r,n="";if(0===i.length)r={};else if(ty(i[0]))r={cause:i[0]},n=i.slice(1).join(" ")||"";else if(i[0]&&"object"==typeof i[0])r=Object.assign({},i[0]),n=i.slice(1).join(" ")||"";else if("string"==typeof i[0])r={},n=n=i.join(" ")||"";else throw Error("Invalid arguments passed to Layerr");return{options:r,shortMessage:n}}(n);let s=o;a.cause&&(s=`${s}: ${a.cause.message}`),super(s),this.message=s,a.name&&"string"==typeof a.name?this.name=a.name:this.name="Layerr",a.cause&&Ob
119ject.defineProperty(this,"_cause",{value:a.cause}),Object.defineProperty(this,"_info",{value:{}}),a.info&&"object"==typeof a.info&&Object.assign(this._info,a.info),Error.captureStackTrace&&Error.captureStackTrace(this,a.constructorOpt||this.constructor)}static cause(i){return(t_(i),i._cause&&ty(i._cause))?i._cause:null}static fullStack(i){t_(i);let r=tv.cause(i);return r?`${i.stack}
120caused by: ${tv.fullStack(r)}`:i.stack??""}static info(i){t_(i);let r={},n=tv.cause(i);return n&&Object.assign(r,tv.info(n)),i._info&&Object.assign(r,i._info),r}toString(){let i=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(i=`${i}: ${this.message}`),i}}let tx="0123456789ABCDEFGHJKMNPQRSTVWXYZ",tb=Object.freeze({source:"ulid"});var tw="yext_analytics_session_id",tT=i.i(501668);function tE(i,r,n){console.log("[DEBUG] AnalyticsConfig object at time of call to report():",n),console.log("[DEBUG] The following EventPayload would be sent to the Yext Events API using ".concat(i?"Beacon":"fetch()",":"),r)}var tS=function(){return(tS=Object.assign||function(i){for(var r,n=1,a=arguments.length;n<a;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o]);return i}).apply(this,arguments)},tA=function(i,r){if(!r||0===Object.keys(r).length)return i;if(!i||0===Object.keys(i).length)return r;var n=JSON.parse(JSON.stringify(i));for(var a in r)if(r.hasOwnProperty(a)){var o=r[a];null==o?delete n[a]:"object"!=typeof o?n[a]=o:n[a]=tA(n[a],o)}return tS({},n)},tC=function(i,r){var n,a,o,s,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(u){return function(c){var d=[u,c];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,d[0]&&(l=0)),l;)try{if(n=1,a&&(o=2&d[0]?a.return:d[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,d[1])).done)return o;switch(a=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return l.label++,{value:d[1],done:!1};case 5:l.label++,a=d[1],d=[0];continue;case 7:d=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===d[0]||2===d[0])){l=0;continue}if(3===d[0]&&(!o||d[1]>o[0]&&d[1]<o[3])){l.label=d[1];break}if(6===d[0]&&l.label<o[1]){l.label=o[1],o=d;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(d);break}o[2]&&l.ops.pop(),l.trys.pop();continue}d=r.call(i,l)}catch(i){d=[6,i],a=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}};function tI(i,r){if("apiKey"!==i.authorizationType&&"bearer"!==i.authorizationType)throw Error("Authorization type must be either apiKey or bearer.");if(!i.authorization)throw Error("Authorization must be provided.");this.config=i,this.payload=r}tI.prototype.with=function(i){var r=void 0===this.payload?i:tA(this.payload,i);return new tI(this.config,r)},tI.prototype.report=function(r){var n,a,o,s,l;return a=this,o=void 0,s=void 0,l=function(){var a,o,s,l,u=this;return tC(this,function(c){var d;return(a=tA(null!=(n=this.payload)?n:{},null!=r?r:{}),this.config.sessionTrackingEnabled?a.sessionId||(a.sessionId=function(){if("u"<typeof window)return null;try{var r=window.sessionStorage.getItem(tw);if(!r){let n;n=function(){let r="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:"u">typeof window?window:i.g,n=r&&(r.crypto||r.msCrypto)||null;if("function"==typeof n?.getRandomValues)return()=>{let i=new Uint8Array(1);return n.getRandomValues(i),i[0]/255};if("function"==typeof n?.randomBytes)return()=>n.randomBytes(1).readUInt8()/255;throw new tv({info:{code:"PRNG_DETECT",...tb}},"Failed to find a reliable PRNG")}(),r=function(i){if(isNaN(i))throw new tv({info:{code:"ENC_TIME_NAN",...tb}},`Time must be a number: ${i}`);if(i>0xffffffffffff)throw new tv({info:{code:"ENC_TIME_SIZE_EXCEED",...tb}}
120,`Cannot encode a time larger than 281474976710655: ${i}`);if(i<0)throw new tv({info:{code:"ENC_TIME_NEG",...tb}},`Time must be positive: ${i}`);if(!1===Number.isInteger(i))throw new tv({info:{code:"ENC_TIME_TYPE",...tb}},`Time must be an integer: ${i}`);let r,n="";for(let a=10;a>0;a--)r=i%32,n=tx.charAt(r)+n,i=(i-r)/32;return n}(isNaN(void 0)?Date.now():void 0)+function(i,r){let n="";for(;i>0;i--)n=function(i){let r=Math.floor(32*i());return 32===r&&(r=31),tx.charAt(r)}(r)+n;return n}(16,n),window.sessionStorage.setItem(tw,r)}return r}catch(i){return console.warn("Unable to use browser sessionStorage for sessionId.\n",i),null}}()):a.sessionId=void 0,a.clientSdk?a.clientSdk.ANALYTICS=tT.default.version:((l={}).ANALYTICS=tT.default.version,a.clientSdk=l),a.authorization="apiKey"===this.config.authorizationType?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,o=!this.config.forceFetch&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox"),s=function(i,r){var n="SANDBOX"===i,a=null==r?void 0:r.toLowerCase();if(n&&"eu"===a)throw Error("Sandbox environment is not available in the EU region.");return"https://"+(n?"sbx.":"")+(null!=a?a:"us")+".yextevents.com/accounts/me/events"}(this.config.env,this.config.region),o)?[2,new Promise(function(i,r){var n;((n=u.config).debug?(tE(!0,a,n),!0):navigator.sendBeacon(s,JSON.stringify(a)))?i(""):r("Failed Beacon Call")})]:(void 0===a.pageUrl&&""!==document.URL&&(a.pageUrl=document.URL),void 0===a.referrerUrl&&""!==document.referrer&&(a.referrerUrl=document.referrer),[2,((d=this.config).debug?(tE(!1,a,d),Promise.resolve(new Response)):fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a),keepalive:!0})).then(function(i){return i}).catch(function(i){return i})])})},new(s||(s=Promise))(function(i,r){function n(i){try{c(l.next(i))}catch(i){r(i)}}function u(i){try{c(l.throw(i))}catch(i){r(i)}}function c(r){var a;r.done?i(r.value):((a=r.value)instanceof s?a:new s(function(i){i(a)})).then(n,u)}c((l=l.apply(a,o||[])).next())})},i.i(847548);var tk=i.i(630495),tR=i.i(93729),tM=i.i(148021),tL=Object.getOwnPropertyNames,tP=(i,r)=>function(){try{return r||(0,i[tL(i)[0]])((r={exports:{}}).exports,r),r.exports}catch(i){throw r=0,i}},tO=tP({"locales/ar/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"إجابة تم إنشاؤها بواسطة الذكاء الاصطناعي",allCategories:"جميع الفئات ",appliedFiltersToCurrentSearch:"تم تطبيق الفلاتر على البحث الحالي",apply:"تطبيق",applyFilters:"تطبيق الفلاتر",autocompleteOptionsFound_few:"تم العثور على {{count}} خيارات للإكمال التلقائي {{label}}.",autocompleteOptionsFound_many:"تم العثور على {{count}} خيارًا للإكمال التلقائي {{label}}.",autocompleteOptionsFound_one:"تم العثور على خيار واحد للإكمال التلقائي {{label}}.",autocompleteOptionsFound_other:"تم العثور على {{count}} خيار للإكمال التلقائي {{label}}.",autocompleteOptionsFound_two:"تم العثور على خيارين للإكمال التلقائي {{label}}.",autocompleteOptionsFound_zero:"لم يتم العثور على أي خيارات للإكمال التلقائي.",autocompleteSuggestion:"اقتراح الإكمال التلقائي: {{suggestion}}",autocompleteSuggestionsFound_few:"تم العثور على {{count}} اقتراحات.",autocompleteSuggestionsFound_many:"تم العثور على {{count}} اقتراحًا.",autocompleteSuggestionsFound_one:"تم العثور على اقتراح واحد.",autocompleteSuggestionsFound_other:"تم العثور على {{count}} اقتراح.",autocompleteSuggestionsFound_two:"تم العثور على اقتراحين.",autocompleteSuggestionsFound_zero:"لم يتم العثور على أي اقتراحات.",basedOnYourDevice:" (استنادًا إلى جهازك)",basedOnYourInternetAddress:" (استنادًا إلى عنوان الإنترنت الخاص بك)",categoriesText_one:"الفئة التالية تحتوي على نتائج لـ - <strong>{{query}}</strong>",categoriesText_other:"الفئات التالية تحتوي على نتائج لـ - <strong>{{query}}</strong>
120",clearAll:"مسح الكل",clearMinAndMax:"مسح الحد الأدنى والأقصى",clearTheRangeToSelectOptions:"امسح النطاق لاختيار الخيارات.",clearTheSearchBar:"امسح شريط البحث",conductASearch:"إجراء بحث",currentLocation:"الموقع الحالي",didYouMean:"هل كنت تقصد <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"عند توفر نتائج الإكمال التلقائي، استخدم الأسهم للأعلى والأسفل للتنقل واضغط Enter للاختيار.",feedback:"ملاحظات",filterGroupSearchInputLabel:"ابحث في خيارات {{title}}",invalidRange:"نطاق غير صالح",max:"الحد الأقصى",min:"الحد الأدنى",navigateToTheNextResultsPage:"انتقل إلى صفحة النتائج التالية",navigateToThePreviousResultsPage:"انتقل إلى صفحة النتائج السابقة",noAutocompleteOptionsFound:"لم يتم العثور على خيارات للإكمال التلقائي.",noAutocompleteSuggestionsFound:"لم يتم العثور على اقتراحات.",n
120oResultsFoundIn:"لم يتم العثور على نتائج في {{currentVerticalLabel}}.",paginationPage:"الصفحة {{pageNumber}}",pagination:"ترقيم الصفحات",readMoreAbout:"اقرأ المزيد عن <a>{{name}}</a>",recentSearch:"بحث حديث: {{query}}",recentSearchesFound_few:"تم العثور على {{count}} عمليات بحث.",recentSearchesFound_many:"تم العثور على {{count}} عملية بحث.",recentSearchesFound_one:"تم العثور على عملية بحث واحدة.",recentSearchesFound_other:"تم العثور على {{count}} عملية بحث.",recentSearchesFound_two:"تم العثور على عمليتي بحث.",recentSearchesFound_zero:"لم يتم العثور على عمليات بحث حديثة.",removeFilter:"إزالة الفلتر «{{displayName}}»",resultPreview:"معاينة النتيجة: {{value}}",resultPreviewsFound_few:"تم العثور على {{count}} معاينات.",resultPreviewsFound_many:"تم العثور على {{count}} معاينة.",resultPreviewsFound_one:"تم العثور على معاينة واحدة.",resultPreviewsFound_other:"تم العثور على {{count}} معاينة.",resultPreviewsFound_two:"تم العثور على معاينتين.",resultPreviewsFound_zero:"لم يتم العثور على أي معاينات.",resultsCountText_few:"{{count}} نتائج",resultsCountText_many:"{{count}} نتيجة",resultsCountText_one:"نتيجة واحدة",resultsCountText_other:"{{count}} نتيجة",resultsCountText_two:"نتيجتان",resultsCountText_zero:"لا توجد نتائج",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} من أصل {{resultsCount}} نتيجة",searchHere:"ابحث هنا…",showingAllInstead:"يتم عرض جميع نتائج {{currentVerticalLabel}} بدلاً من ذلك.",showLess:"عرض أقل",showMore:"عرض المزيد",sources_few:"مصادر ({{count}})",sources_many:"مصدر ({{count}})",sources_one:"مصدر",sources_other:"مصدر ({{count}})",sources_two:"مصدران",sources_zero:"لا توجد مصادر",submitSearch:"تنفيذ البحث",suggestionResultsCount_few:"{{label}} - {{count}} نتائج",suggestionResultsCount_many:"{{label}} - {{count}} نتيجة",suggestionResultsCount_one:"{{label}} - نتيجة واحدة",suggestionResultsCount_other:"{{label}} - {{count}} نتيجة",suggestionResultsCount_two:"{{label}} - نتيجتان",suggestionResultsCount_zero:"{{label}} - لا توجد نتائج",thankYouForYourFeedback:"شكرًا لملاحظاتك!",thisAnsweredMyQuestion:"نعم، هذا أجاب على سؤالي",thisDidNotAnswerMyQuestion:"لا، هذا لم يجب على سؤالي",unselectAnOptionToEnterInARange:"قم بإلغاء تحديد خيار لإدخال نطاق.",updateYourLocation:"تحديث موقعك",useCurrentLocation:"استخدام الموقع الحالي",useMyLocation:"استخدم موقعي",viewAll:"عرض الكل",viewDetails:"عرض التفاصيل"}}}),tD=tP({"locales/cs/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI generovaná odpověď",allCategories:"Všechny kategorie",appliedFiltersToCurrentSearch:"Použité filtry pro aktuální hledání",apply:"Použít",applyFilters:"Použít filtry",autocompleteOptionsFound_few:"Nalezeny {{count}}{{label}} možnosti automatického dokončování.",autocompleteOptionsFound_many:"Nalezeno {{count}}{{label}} možností automatického dokončování.",autocompleteOptionsFound_one:"Nalezena {{count}}{{label}} možnost automatického dokončování.",autocompleteOptionsFound_other:"Nalezeno {{count}}{{label}} možností automatického dokončování.",autocompleteSuggestion:"návrh automatického doplňování: {{suggestion}}",autocompleteSuggestionsFound_few:"Nalezeny {{count}} návrhy automatického dokončování.",autocompleteSuggestionsFound_many:"Nalezeno {{count}} návrhů automatického dokončování.",autocompleteSuggestionsFound_one:"Nalezen {{count}} návrh automatického dokončování.",autocompleteSuggestionsFound_other:"Nalezeno {{count}} návrhů automatického dokončování.",basedOnYourDevice:" (na základě vašeho zařízení)",basedOnYourInternetAddress:" (na základě vaší IP adresy)",categoriesText_few:"Následující kategorie přinesla výsledky pro – <strong>{{query}}</strong>",categoriesText_one:"Následující kategorie přinesly výsledky pro – <strong>{{query}}</strong>",categoriesText_other:"Následujících kategorií přineslo výsledky pro – <strong>{{query}}</strong>
120",clearAll:"Vyčistit vše",clearMinAndMax:"Vymazat min a max",clearTheRangeToSelectOptions:"Vymažte rozsah pro výběr možností.",clearTheSearchBar:"Vymažte vyhledávací lištu",conductASearch:"Provést vyhledávání",currentLocation:"Aktuální poloha",didYouMean:"Mysleli jste <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Pokud jsou dostupné výsledky automatického doplnění, použijte šipky nahoru/dolů pro výběr a Enter pro potvrzení.",feedback:"Zpětná vazba",filterGroupSearchInputLabel:"Hledat možnosti {{title}}",invalidRange:"Neplatný rozsah",max:"Max",min:"Min",navigateToTheNextResultsPage:"Přejděte na další stránku výsledků",navigateToThePreviousResultsPage:"Přejděte na stránku předchozích výsledků",noAutocompleteOptionsFound:"Nenalezeny žádné možností automatického doplňování.",noAutocompleteSuggestionsFound:"Nenalezeny žádné návrhy automatického doplňování.",noResultsFoundIn:"V {{currentVerticalLabel}} nebyly nalezeny žádné výsledky.",paginationPage:"stránka {{pageNumber}}",pagination:"Stránkování",readMoreAbout:"Přečíst si více o <a>{{name}}</a>",recentSearch:"nedávné vyhledávání: {{query}}",recentSearchesFound_few:"Nalezena {{count}} nedávná hledání.",recentSearchesFound_many:"Nalezeno {{count}} nedávných hledání.",recentSearchesFound_one:"Nalezeno {{count}} nedávné hledání.",recentSearchesFound_other:"Nalezeno {{count}} nedávných hledání.",removeFilter:"Odebrat filtr „{{displayName}}“",resultPreview:"náhled výsledků: {{value}}",resultPreviewsFound_few:"Nalezeny {{count}} náhledy výsledků.",resultPreviewsFound_many:"Nalezeno {{count}} náhledů výsledků.",resultPreviewsFound_one:"Nalezen {{count}} náhled výsledku.",resultPreviewsFound_other:"Nalezeno {{count}} náhledů výsledků.",resultsCountText_few:"{{count}} výsledky",resultsCountText_many:"{{count}} výsledků",resultsCountText_one:"{{count}} výsledek",resultsCountText_other:"{{count}} výsledků",resultsCountWithPaginationText:"{{paginateStart}} – {{paginateEnd}} z {{resultsCount}} výsledků",searchHere:"Hledejte zde…",showingAllInstead:"Místo toho zobrazujeme všechny {{currentVerticalLabel}}.",showLess:"Zobrazit méně",showMore:"Zobrazit více",sources_few:"Zdroje ({{count}})",sources_many:"Zdroje ({{count}})",sources_one:"Zdroj",sources_other:"Zdroje ({{count}})",submitSearch:"Odeslat vyhledávání",suggestionResultsCount_few:"{{label}} – {{count}} výsledky",suggestionResultsCount_many:"{{label}} – {{count}} výsledků",suggestionResultsCount_one:"{{label}} – {{count}} výsledek",suggestionResultsCount_other:"{{label}} – {{count}} výsledků",thankYouForYourFeedback:"Děkujeme za vaši zpětnou vazbu!",thisAnsweredMyQuestion:"Toto odpovědělo na mou otázku",thisDidNotAnswerMyQuestion:"Toto neodpovědělo na mou otázku",unselectAnOptionToEnterInARange:"Zrušte výběr možnosti, abyste mohli zadat rozsah.",updateYourLocation:"Aktualizujte svou polohu",useCurrentLocation:"Použít aktuální polohu",useMyLocation:"Použít mou polohu",viewAll:"Zobrazit vše",viewDetails:"Zobrazit podrobnosti"}}}),tF=tP({"locales/da/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI-genereret svar",allCategories:"Alle kategorier",appliedFiltersToCurrentSearch:"Anvendte filtre til den aktuelle søgning",apply:"Anvende",applyFilters:"Anvend filtre",autocompleteOptionsFound_one:"{{count}}{{label}} autofuldførelsesmulighed fundet.",autocompleteOptionsFound_other:"{{count}}{{label}} autofuldførelsesmuligheder fundet.",autocompleteSuggestion:"autofuldførelsesforslag: {{suggestion}}",autocompleteSuggestionsFound_one:"{{count}} autofuldførelsesforslag fundet.",autocompleteSuggestionsFound_other:"{{count}} autofuldførelsesforslag fundet.",basedOnYourDevice:" (baseret på din enhed)",basedOnYourInternetAddress:" (baseret på din internetadresse)",categoriesText_one:"Følgende kategori gav resultater for - <strong>{{query}}</strong>",categoriesText_other:"Følgende kategorier gav resultater for - <strong>{{query}}</strong>
120",clearAll:"Ryd alle",clearMinAndMax:"Ryd maks og min",clearTheRangeToSelectOptions:"Ryd rækkevidden for at vælge indstillinger.",clearTheSearchBar:"Ryd søgefeltet",conductASearch:"Foretage en søgning",currentLocation:"Nuværende placering",didYouMean:"Mente du <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Når autoudfyldningsresultater er tilgængelige, brug pil op/ned for at gennemgå og Enter for at vælge.",feedback:"Feedback",filterGroupSearchInputLabel:"Søg i valgmuligheder for {{title}}",invalidRange:"Ugyldigt rækkevidde",max:"Maks",min:"Min",navigateToTheNextResultsPage:"Naviger til den næste resultatside",navigateToThePreviousResultsPage:"Naviger til den tidligere resultatside",noAutocompleteOptionsFound:"0 autofuldførelsesmuligheder fundet.",noAutocompleteSuggestionsFound:"0 forslag til autofuldførelse fundet.",noResultsFoundIn:"Ingen resultater fundet i {{currentVerticalLabel}}.",paginationPage:"side {{pageNumber}}",pagination:"Pagination",readMoreAbout:"Læs mere om <a>{{name}}</a>",recentSearch:"nylig søgning: {{query}}",recentSearchesFound_one:"{{count}} seneste søgning fundet.",recentSearchesFound_other:"{{count}} seneste søgninger fundet.",removeFilter:"Fjern filteret »{{displayName}}«",resultPreview:"resultatvisninger: {{value}}",resultPreviewsFound_one:"{{count}} resultatvisning fundet.",resultPreviewsFound_other:"{{count}} resultatvisninger fundet.",resultsCountText_one:"{{count}} resultat",resultsCountText_other:"{{count}} resultater",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} af {{resultsCount}} resultater",searchHere:"Søg her…",showingAllInstead:"Viser i stedet alle {{currentVerticalLabel}}.",showLess:"Vis mindre",showMore:"Vis mere",sources_one:"Kilde",sources_other:"Kilder ({{count}})",submitSearch:"Indsend søgning",suggestionResultsCount_one:"{{label}} - {{count}} resultat",suggestionResultsCount_other:"{{label}} - {{count}} resultater",thankYouForYourFeedback:"Tak for din feedback!",thisAnsweredMyQuestion:"Dette besvarede mit spørgsmål",thisDidNotAnswerMyQuestion:"Dette besvarede ikke mit spørgsmål",unselectAnOptionToEnterInARange:"Fravælg en mulighed for at indtaste et interval.",updateYourLocation:"Opdater din placering",useCurrentLocation:"Brug nuværende placering",useMyLocation:"Brug min placering",viewAll:"Se alle",viewDetails:"Se detaljer"}}}),tN=tP({"locales/de/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"KI-generierte Antwort",allCategories:"Alle Kategorien",appliedFiltersToCurrentSearch:"Angewandte Filter auf die aktuelle Suche",apply:"Anwenden",applyFilters:"Filter anwenden",autocompleteOptionsFound_one:"{{count}}{{label}} Autovervollständigungsoption gefunden.",autocompleteOptionsFound_other:"{{count}}{{label}} Autovervollständigungsoptionen gefunden.",autocompleteSuggestion:"autovervollständigung Vorschlag: {{suggestion}}",autocompleteSuggestionsFound_one:"{{count}} Autovervollständigungsvorschlag gefunden.",autocompleteSuggestionsFound_other:"{{count}} Autovervollständigungsvorschläge gefunden.",basedOnYourDevice:" (basierend auf Ihrem Gerät)",basedOnYourInternetAddress:" (basierend auf Ihrer IP-Adresse)",categoriesText_one:"Die folgende Kategorie lieferte Ergebnisse für - <strong>{{query}}</strong>",categoriesText_other:"Die folgenden Kategorien lieferten Ergebnisse für - <strong>{{query}}</strong>",clearAll:"Alle klar",clearMinAndMax:"Min und Max löschen",clearTheRangeToSelectOptions:"Löschen Sie den Bereich, um Optionen auszuwählen.",clearTheSearchBar:"Löschen Sie die Suchleiste",conductASearch:"Eine Suche durchführen",currentLocation:"Aktueller Standort",didYouMean:"Meinten Sie <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Wenn Autovervollständigungsergebnisse verfügbar sind, mit Pfeiltasten navigieren und mit Enter auswählen.",feedback:"Rückmeldung",filterGroupSearchInputLabel:"Optionen für {{title}} durchsuchen",invalidRange:"Ungültiger Bereich",max:"Max",min:"Min",navigateToTheNextResultsPage:"Navigieren Sie zur nächsten Ergebnisseite",navigateToThePreviousResultsPage:"Navigieren Sie zur vorherigen Ergebnisseite",noAutocompleteOptionsFound:"0 autovervollständigung Optionen gefunden.",noAutocompleteSuggestionsFound:"0 autovervollständigung Vorschläge gefunden.",noResultsFoundIn:"Keine Ergebnisse in {{currentVerticalLabel}} gefunden.",paginationPage:"Seite {{pageNumber}}",pagination:"Seitennavigation",readMoreAbout:"Mehr erfahren über <a>{{name}}</a>",recentSearch:"neuere Suche: {{query}}",recentSearchesFound_one:"{{count}} letzter Suchbegriff gefunden.",recentSearchesFound_other:"{{count}} letzte Suchbegriffe gefunden.",removeFilter:"Filter „{{displayName}}“ entfernen",resultPreview:"Ergebnisvorschau: {{value}}",resultPreviewsFound_one:"{{count}} Ergebnisvorschau gefunden.",resultPreviewsFound_other:"{{count}} Ergebnisvorschauen gefunden.",resultsCountText_one:"{{count}} Ergebnis",resultsCountText_other:"{{count}} Ergebnisse",resultsCountWithPaginationText:"{{paginateStart}}–{{paginateEnd}} von {{resultsCount}} Ergebnissen",searchHere:"Suche hier…",showingAllInstead:"Zeige stattdessen alle {{currentVerticalLabel}} an.",showLess:"Weniger anzeigen",showMore:"Mehr anzeigen",sources_one:"Quelle",sources_other:"Quellen ({{count}})",submitSearch:"Suche einreichen",suggestionResultsCount_one:"{{label}}
120 - {{count}} Ergebnis",suggestionResultsCount_other:"{{label}} - {{count}} Ergebnisse",thankYouForYourFeedback:"Vielen Dank für Ihr Feedback!",thisAnsweredMyQuestion:"Das hat meine Frage beantwortet",thisDidNotAnswerMyQuestion:"Das hat meine Frage nicht beantwortet",unselectAnOptionToEnterInARange:"Wählen Sie eine Option ab, um einen Bereich einzugeben.",updateYourLocation:"Aktualisieren Sie Ihren Standort",useCurrentLocation:"Aktuellen Standort verwenden",useMyLocation:"Meinen Standort verwenden",viewAll:"Alle anzeigen",viewDetails:"Details anzeigen"}}}),tj=tP({"locales/el/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"Απάντηση που δημιουργήθηκε από ΤΝ",allCategories:"Όλες οι κατηγορίες",appliedFiltersToCurrentSearch:"Εφαρμοσμένα φίλτρα στην τρέχουσα αναζήτηση",apply:"Εφαρμογή",applyFilters:"Εφαρμογή φίλτρων",autocompleteOptionsFound_one:"Βρέθηκε {{count}}{{label}} επιλογή αυτόματης συμπλήρωσης.",autocompleteOptionsFound_other:"Βρέθηκαν {{count}}{{label}} επιλογές αυτόματης συμπλήρωσης.",autocompleteSuggestion:"Πρόταση αυτόματης συμπλήρωσης: {{suggestion}}",autocompleteSuggestionsFound_one:"Βρέθηκε {{count}} πρόταση αυτόματης συμπλήρωσης.",autocompleteSuggestionsFound_other:"Βρέθηκαν {{count}} προτάσεις αυτόματης συμπλήρωσης.",basedOnYourDevice:" (με βάση τη συσκευή σας)",basedOnYourInternetAddress:" (με βάση τη διεύθυνση IP σας)",categoriesText_one:"Η παρακάτω κατηγορία έδωσε αποτελέσματα για - <strong>{{query}}</strong>",categoriesText_other:"Οι παρακάτω κατηγορίες έδωσαν αποτελέσματα για - <strong>{{query}}</strong>",clearAll:"Καθάρισμα όλων",clearMinAndMax:"Καθάρισμα ελάχιστου και μέγιστου",clearTheRangeToSelectOptions:"Καθάρισε το εύρος για επιλογή επιλογών.",clearTheSearchBar:"Καθάρισε τη γραμμή αναζήτησης",conductASearch:"Διεξαγωγή αναζήτησης",currentLocation:"Τρέχουσα τοποθεσία",didYouMean:"Μήπως εννοούσατε <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Όταν είναι διαθέσιμα αποτελέσματα αυτόματης συμπλήρωσης, χρησιμοποιήστε τα βελάκια πάνω/κάτω για προεπισκόπηση και Enter για επιλογή.",feedback:"Σχόλια",filterGroupSearchInputLabel:"Αναζήτηση στις επιλογές {{title}}",invalidRange:"Άκυρο εύρος",max:"Μέγ.",min:"Ελάχ.",navigateToTheNextResultsPage:"Μετάβαση στην επόμενη σελίδα αποτελεσμάτων",navigateToThePreviousResultsPage:"Επιστροφή στην προηγούμενη σελίδα αποτελεσμάτων",noAutocompleteOptionsFound:"Δεν βρέθηκε καμία επιλογή αυτόματης συμπλήρωσης.",noAutocompleteSuggestionsFound:"Δεν βρέθηκε καμία πρόταση αυτόματης συμπλήρωσης.",noResultsFoundIn:"Δεν βρέθηκαν αποτελέσματα στο/στη {{currentVerticalLabel}}.",paginationPage:"σελίδα {{pageNumber}}",pagination:"Σελιδοποίηση",readMoreAbout:"Διαβάστε περισσότερα για <a>{{name}}</a>",recentSearch:"πρόσφατη αναζήτηση: {{query}}",recentSearchesFound_one:"Βρέθηκε {{count}} πρόσφατη αναζήτηση.",recentSearchesFound_other:"Βρέθηκαν {{count}} πρόσφατες αναζητήσεις.",removeFilter:"Αφαίρεση φίλτρου «{{displayName}}»",resultPreview:"προεπισκόπηση αποτελέσματος: {{value}}",resultPreviewsFound_one:"Βρέθηκε {{count}} προεπισκόπηση αποτελέσματος.",resultPreviewsFound_other:"Βρέθηκαν {{count}} προεπισκοπήσεις αποτελεσμάτων.",resultsCountText_one:"{{count}} Αποτέλεσμα",resultsCountText_other:"{{count}} Αποτελέσματα",resultsCountWithPaginationText:"{{paginateStart}} – {{paginateEnd}} από {{resultsCount}} Αποτελέσματα",searchHere:"Αναζήτησε εδώ…",showingAllInstead:"Δείχνωνται όλα τα/{{currentVerticalLabel}} αντ’ αυτού.",showLess:"Εμφάνιση λιγότερων",showMore:"Εμφάνιση περισσότερων",sources_one:"Πηγή",sources_other:"Πηγές ({{count}})",submitSearch:"Αναζήτηση",suggestionResultsCount_one:"{{label}} – {{count}} αποτέλεσμα",suggestionResultsCount_other:"{{label}} – {{count}} αποτελέσματα",thankYouForYourFeedback:"Ευχαριστούμε για τα σχόλιά σας!",thisAnsweredMyQuestion:"Αυτό απάντησε στην ερώτησή μου",thisDidNotAnswerMyQuestion:"Αυτό δεν απάντησε στην ερώτησή μου",unselectAnOptionToEnterInARange:"Αποεπιλογή μιας επιλογής για εισαγωγή σε εύρος.",updateYourLocation:"Ενημέρωσε την τοποθεσία σου",useCurrentLocation:"Χρήση τρέχουσας τοποθεσίας",useMyLocation:"Χρήση της τοποθεσίας μου",viewAll:"Δες όλα",viewDetails:"Δες λεπτομέρειες"}}}),tz=tP({"locales/en-GB/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI Generated Answer",allCategories:"All Categories",appliedFiltersToCurrentSearch:"Applied filters to current search",apply:"Apply",applyFilters:"Apply Filters",autocompleteOptionsFound_one:"{{count}}{{label}} autocomplete option found.",autocompleteOptionsFound_other:"{{count}}{{label}}
120 autocomplete options found.",autocompleteSuggestion:"autocomplete suggestion: {{suggestion}}",autocompleteSuggestionsFound_one:"{{count}} autocomplete suggestion found.",autocompleteSuggestionsFound_other:"{{count}} autocomplete suggestions found.",basedOnYourDevice:" (based on your device)",basedOnYourInternetAddress:" (based on your internet address)",categoriesText_one:"The following category yielded results for - <strong>{{query}}</strong>",categoriesText_other:"The following categories yielded results for - <strong>{{query}}</strong>",clearAll:"Clear All",clearMinAndMax:"Clear min and max",clearTheRangeToSelectOptions:"Clear the range to select options.",clearTheSearchBar:"Clear the search bar",conductASearch:"Conduct a search",currentLocation:"Current Location",didYouMean:"Did you mean <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"When autocomplete results are available, use up and down arrows to review and enter to select.",feedback:"Feedback",filterGroupSearchInputLabel:"Search {{title}} Options",invalidRange:"Invalid range",max:"Max",min:"Min",navigateToTheNextResultsPage:"Navigate to the next results page",navigateToThePreviousResultsPage:"Navigate to the previous results page",noAutocompleteOptionsFound:"0 autocomplete options found.",noAutocompleteSuggestionsFound:"0 autocomplete suggestions found.",noResultsFoundIn:"No results found in {{currentVerticalLabel}}.",paginationPage:"page {{pageNumber}}",pagination:"Pagination",readMoreAbout:"Read more about <a>{{name}}</a>",recentSearch:"recent search: {{query}}",recentSearchesFound_one:"{{count}} recent search found.",recentSearchesFound_other:"{{count}} recent searches found.",removeFilter:'Remove "{{displayName}}" filter',resultPreview:"result preview: {{value}}",resultPreviewsFound_one:"{{count}} result preview found.",resultPreviewsFound_other:"{{count}} recent previews found.",resultsCountText_one:"{{count}} Result",resultsCountText_other:"{{count}} Results",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} of {{resultsCount}} Results",searchHere:"Search here…",showingAllInstead:"Showing all {{currentVerticalLabel}} instead.",showLess:"Show Less",showMore:"Show More",sources_one:"Source",sources_other:"Sources ({{count}})",submitSearch:"Submit Search",suggestionResultsCount_one:"{{label}} - {{count}} result",suggestionResultsCount_other:"{{label}} - {{count}} results",thankYouForYourFeedback:"Thank you for your feedback!",thisAnsweredMyQuestion:"This answered my question",thisDidNotAnswerMyQuestion:"This did not answer my question",unselectAnOptionToEnterInARange:"Unselect an option to enter in a range.",updateYourLocation:"Update your location",useCurrentLocation:"Use Current Location",useMyLocation:"Use my location",viewAll:"View all",viewDetails:"View Details"}}}),tB=tP({"locales/en/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI Generated Answer",aiGeneratedAnswerSignpostLabel:"AI-Generated",aiGeneratedAnswerSignpostPopoverHeader:"AI-Generated Content",aiGeneratedAnswerSignpostPopoverBody:"This answer was generated by AI from matching search results and may be incomplete or inaccurate. Review the matching results for full context.",allCategories:"All Categories",appliedFiltersToCurrentSearch:"Applied filters to current search",apply:"Apply",applyFilters:"Apply Filters",autocompleteOptionsFound_one:"{{count}}{{label}} autocomplete option found.",autocompleteOptionsFound_other:"{{count}}{{label}} autocomplete options found.",autocompleteSuggestion:"autocomplete suggestion: {{suggestion}}",autocompleteSuggestionsFound_one:"{{count}} autocomplete suggestion found.",autocompleteSuggestionsFound_other:"{{count}} autocomplete suggestions found.",basedOnYourDevice:" (based on your device)",basedOnYourInternetAddress:" (based on your internet address)",categoriesText_one:"The following category yielded results for - <strong>{{query}}</strong>",categoriesText_other:"The following categories yielded results for - <strong>{{query}}</strong>",clearAll:"Clear All",clearMinAndMax:"Clear min and max",clearTheRangeToSelectOptions:"Clear the range to select options.",clearTheSearchBar:"Clear the search bar",conductASearch:"
120Conduct a search",currentLocation:"Current Location",didYouMean:"Did you mean <button>{{correctedQuery}}</button>",dismiss:"Dismiss",dropDownScreenReaderInstructions:"When autocomplete results are available, use up and down arrows to review and enter to select.",feedback:"Feedback",filterGroupSearchInputLabel:"Search {{title}} Options",invalidRange:"Invalid range",max:"Max",min:"Min",navigateToTheNextResultsPage:"Navigate to the next results page",navigateToThePreviousResultsPage:"Navigate to the previous results page",noAutocompleteOptionsFound:"0 autocomplete options found.",noAutocompleteSuggestionsFound:"0 autocomplete suggestions found.",noResultsFoundIn:"No results found in {{currentVerticalLabel}}.",paginationPage:"page {{pageNumber}}",pagination:"Pagination",readMoreAbout:"Read more about <a>{{name}}</a>",recentSearch:"recent search: {{query}}",recentSearchesFound_one:"{{count}} recent search found.",recentSearchesFound_other:"{{count}} recent searches found.",removeFilter:'Remove "{{displayName}}" filter',resultPreview:"result preview: {{value}}",resultPreviewsFound_one:"{{count}} result preview found.",resultPreviewsFound_other:"{{count}} recent previews found.",resultsCountText_one:"{{count}} Result",resultsCountText_other:"{{count}} Results",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} of {{resultsCount}} Results",searchHere:"Search here...",showingAllInstead:"Showing all {{currentVerticalLabel}} instead.",showLess:"Show Less",showMore:"Show More",sources_one:"Source",sources_other:"Sources ({{count}})",submitSearch:"Submit Search",suggestionResultsCount_one:"{{label}} - {{count}} result",suggestionResultsCount_other:"{{label}} - {{count}} results",thankYouForYourFeedback:"Thank you for your feedback!",thisAnsweredMyQuestion:"This answered my question",thisDidNotAnswerMyQuestion:"This did not answer my question",unselectAnOptionToEnterInARange:"Unselect an option to enter in a range.",updateYourLocation:"Update your location",useCurrentLocation:"Use Current Location",useMyLocation:"Use my location",viewAll:"View all",viewDetails:"View Details"}}}),tU=tP({"locales/es/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"Respuesta generada por IA",allCategories:"Todas las categorías",appliedFiltersToCurrentSearch:"Filtros aplicados a la búsqueda actual",apply:"Aplicar",applyFilters:"Aplicar filtros",autocompleteOptionsFound_many:"{{count}}{{label}} opciones de autocompletado encontradas.",autocompleteOptionsFound_one:"{{count}}{{label}} opción de autocompletado encontrada.",autocompleteOptionsFound_other:"{{count}}{{label}} opciones de autocompletado encontradas.",autocompleteSuggestion:"sugerencia de autocompleto: {{suggestion}}",autocompleteSuggestionsFound_many:"{{count}} sugerencias de autocompletado encontradas.",autocompleteSuggestionsFound_one:"{{count}} sugerencia de autocompletado encontrada.",autocompleteSuggestionsFound_other:"{{count}} sugerencias de autocompletado encontradas.",basedOnYourDevice:" (basado en tu dispositivo)",basedOnYourInternetAddress:" (basado en tu dirección de internet)",categoriesText_one:"La siguiente categoría produjo resultados para - <strong>{{query}}</strong>",categoriesText_other:"Las siguientes categorías produjeron resultados para - <strong>{{query}}</strong>",clearAll:"Borrar todo",clearMinAndMax:"Borrar mínimo y máximo",clearTheRangeToSelectOptions:"Borrar el rango para seleccionar opciones.",clearTheSearchBar:"Borrar la barra de búsqueda",conductASearch:"Realizar una búsqueda",currentLocation:"Ubicación Actual",didYouMean:"Quisiste decir <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Cuando haya resultados de autocompletar, usa las flechas arriba y abajo para revisar y entra para seleccionar.",feedback:"Comentarios",filterGroupSearchInputLabel:"Buscar opciones de {{title}}",invalidRange:"Rango no válido",max:"Máx.",min:"Mín.",navigateToTheNextResultsPage:"Navegue a la página de resultados del siguiente",navigateToThePreviousResultsPage:"Navegue a la página de resultados anterior",noAutocompleteOptionsFound:"0 Opciones de autocompletar encontradas.",n
120oAutocompleteSuggestionsFound:"0 Sugerencias de autocompletar encontradas.",noResultsFoundIn:"No se encontraron resultados en {{currentVerticalLabel}}.",paginationPage:"página {{pageNumber}}",pagination:"Paginación",readMoreAbout:"Leer más sobre <a>{{name}}</a>",recentSearch:"búsqueda reciente: {{query}}",recentSearchesFound_many:"{{count}} búsquedas recientes encontradas.",recentSearchesFound_one:"{{count}} búsqueda reciente encontrada.",recentSearchesFound_other:"{{count}} búsquedas recientes encontradas.",removeFilter:"Quitar el filtro «{{displayName}}»",resultPreview:"vista previa de resultados: {{value}}",resultPreviewsFound_many:"{{count}} vistas previas de resultados encontradas.",resultPreviewsFound_one:"{{count}} vista previa de resultado encontrada.",resultPreviewsFound_other:"{{count}} vistas previas de resultados encontradas.",resultsCountText_many:"{{count}} resultados",resultsCountText_one:"{{count}} resultado",resultsCountText_other:"{{count}} resultados",resultsCountWithPaginationText:"{{paginateStart}}–{{paginateEnd}} de {{resultsCount}} resultados",searchHere:"Buscar aquí…",showingAllInstead:"Mostrando todos los {{currentVerticalLabel}} en su lugar.",showLess:"Mostrar Menos",showMore:"Mostrar Más",sources_many:"Fuentes ({{count}})",sources_one:"Fuente",sources_other:"Fuentes ({{count}})",submitSearch:"Enviar búsqueda",suggestionResultsCount_many:"{{label}} - {{count}} resultados",suggestionResultsCount_one:"{{label}} - {{count}} resultado",suggestionResultsCount_other:"{{label}} - {{count}} resultados",thankYouForYourFeedback:"¡Gracias por tus comentarios!",thisAnsweredMyQuestion:"Esto respondió mi pregunta",thisDidNotAnswerMyQuestion:"Esto no respondió mi pregunta",unselectAnOptionToEnterInARange:"Deselecciona una opción para ingresar un rango.",updateYourLocation:"Actualiza tu ubicación",useCurrentLocation:"Usar Ubicación Actual",useMyLocation:"Usar mi ubicación",viewAll:"Ver todo",viewDetails:"Ver detalles"}}}),tV=tP({"locales/et/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"Tehisintellekti loodud vastus",allCategories:"Kõik kategooriad",appliedFiltersToCurrentSearch:"Rakendatud filtrid praegusele otsingule",apply:"Rakendama",applyFilters:"Rakenda filtrid",autocompleteOptionsFound_one:"Leiti {{count}}{{label}} automaatse täitmise valik.",autocompleteOptionsFound_other:"Leiti {{count}}{{label}} automaatse täitmise valikut.",autocompleteSuggestion:"automaatse täitmise soovitus: {{suggestion}}",autocompleteSuggestionsFound_one:"Leiti {{count}} automaatse täitmise soovitus.",autocompleteSuggestionsFound_other:"Leiti {{count}} automaatse täitmise soovitust.",basedOnYourDevice:" (põhineb sinu seadmel)",basedOnYourInternetAddress:" (põhineb sinu internetiaadressil)",categoriesText_one:"Järgmine kategooria andis tulemusi päringu jaoks – <strong>{{query}}</strong>",categoriesText_other:"Järgmised kategooriad andsid tulemusi päringu jaoks – <strong>{{query}}</strong>",clearAll:"Puhastama kõik",clearMinAndMax:"Tühjenda miinimum ja maksimum",clearTheRangeToSelectOptions:"Valikute valimiseks tühjendage vahemik.",clearTheSearchBar:"Tühjendage otsinguriba",conductASearch:"Otsingut tegema",currentLocation:"Praegune asukoht",didYouMean:"Kas mõtlesite <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Kui automaattäite tulemused on saadaval, kasuta üles-/allanooleid eelvaateks ja Enterit valimiseks.",feedback:"Tagasiside",filterGroupSearchInputLabel:"Otsi {{title}} valikute seast",invalidRange:"Kehtetu vahemik",max:"Maks",min:"Min",navigateToTheNextResultsPage:"Liikuge järgmisele tulemuste lehele",navigateToThePreviousResultsPage:"Liikuge eelmise tulemuste lehele",noAutocompleteOptionsFound:"0 leitud automaatse täitmise valikud.",noAutocompleteSuggestionsFound:"0 leitud automaatse täitmise ettepanekuid.",noResultsFoundIn:"Tulemusi ei leitud kategoorias {{currentVerticalLabel}}.",paginationPage:"leht {{pageNumber}}",pagination:"Lehekülgede navigeerimine",readMoreAbout:"Loe rohkem: <a>{{name}}</a>",recentSearch:"hiljutine otsing: {{query}}",recentSearchesFound_one:"Leiti {{count}} hiljutine otsing.",recentSearchesFound_other:"Leiti {{count}} hiljutist otsingut.",removeFilter:"Eemalda filter „{{displayName}}”",resultPreview:"tulemuse eelvaade: {{value}}",resultPreviewsFound_one:"Leiti {{count}} tulemuse eelvaade.",resultPreviewsFound_other:"Leiti {{count}} tulemuse eelvaateid.",resultsCountText_one:"{{count}} tulemust",resultsCountText_other:"{{count}} tulemust",resultsCountWithPaginationText:"{{paginateStart}} – {{paginateEnd}} / {{resultsCount}} tulemust",searchHere:"Otsige siit…",showingAllInstead:"Näidatakse hoopis kõiki kategooriaid {{currentVerticalLabel}}.",showLess:"Näita vähem",showMore:"Näita rohkem",sources_one:"Allikas",sources_other:"Allikad ({{krahv}})",submitSearch:"Otsingut esitama",suggestionResultsCount_one:"{{label}} – {{count}} tulemus",suggestionResultsCount_other:"{{label}} – {{count}} tulemust",thankYouForYourFeedback:"Täname teie tagasiside eest!",thisAnsweredMyQuestion:"See vastas minu küsimusele",thisDidNotAnswerMyQuestion:"See ei vastanud minu küsimusele",unselectAnOptionToEnterInARange:"Valiku tühistamiseks sisestage vahemik.",updateYourLocation:"Värskendage oma asukohta",useCurrentLocation:"Kasuta praegust asukohta",useMyLocation:"Kasuta minu asukohta",viewAll:"Vaata kõiki",viewDetails:"Vaadake üksikasju"}}}),tH=tP({"locales/fi/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"Tekoälyn luoma vastaus",allCategories:"Kaikki kategoriat",appliedFiltersToCurrentSearch:"Käytetyt suodattimet nykyiseen hakuun",apply:"Käytä",applyFilters:"Käytä suodattimia",autocompleteOptionsFound_one:"{{count}}{{label}} automaattista ehdotusta löytyi.",autocompleteOptionsFound_other:"{{count}}{{label}} automaattista ehdotusta löytyi.",autocompleteSuggestion:"automaattinen ehdotus: {{suggestion}}",autocompleteSuggestionsFound_one:"{{count}} automaattinen ehdotus löytyi.",autocompleteSuggestionsFound_other:"{{count}} automaattista ehdotusta löytyi.",basedOnYourDevice:" (perustuu laitteeseesi)",basedOnYourInternetAddress:" (perustuu internet-osoitteeseesi)",categoriesText_one:"Seuraava kategoria antoi tuloksia hakusanalle - <strong>{{query}}</strong>",categoriesText_other:"Seuraavat kategoriat antoivat tuloksia hakusanalle - <strong>{{query}}</strong>
120",clearAll:"Tyhjennä kaikki",clearMinAndMax:"Tyhjennä minimi ja maksimi",clearTheRangeToSelectOptions:"Tyhjennä valintaväli.",clearTheSearchBar:"Tyhjennä hakupalkki",conductASearch:"Tee haku",currentLocation:"Nykyinen sijainti",didYouMean:"Tarkoititko <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Kun automaattiset tulokset ovat saatavilla, käytä nuolinäppäimiä selaamiseen ja Enteriä valitsemiseen.",feedback:"Palaute",filterGroupSearchInputLabel:"Hae {{title}}-vaihtoehdoista",invalidRange:"Virheellinen väli",max:"Maks",min:"Min",navigateToTheNextResultsPage:"Siirry seuraavalle tulossivulle",navigateToThePreviousResultsPage:"Siirry edelliselle tulossivulle",noAutocompleteOptionsFound:"0 automaattista ehdotusta löytyi.",noAutocompleteSuggestionsFound:"0 automaattista ehdotusta löytyi.",noResultsFoundIn:"Tuloksia ei löytynyt kohdasta {{currentVerticalLabel}}.",paginationPage:"sivu {{pageNumber}}",pagination:"Sivutus",readMoreAbout:"Lue lisää aiheesta <a>{{name}}</a>",recentSearch:"viimeisin haku: {{query}}",recentSearchesFound_one:"{{count}} viimeisin haku löytyi.",recentSearchesFound_other:"{{count}} viimeisintä hakua löytyi.",removeFilter:'Poista suodatin "{{displayName}}"',resultPreview:"tuloksen esikatselu: {{value}}",resultPreviewsFound_one:"{{count}} tuloksen esikatselu löytyi.",resultPreviewsFound_other:"{{count}} tuloksen esikatselua löytyi.",resultsCountText_one:"{{count}} tulos",resultsCountText_other:"{{count}} tulosta",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} / {{resultsCount}} tulosta",searchHere:"Hae tästä…",showingAllInstead:"Näytetään kaikki kohteessa {{currentVerticalLabel}} sen sijaan.",showLess:"Näytä vähemmän",showMore:"Näytä lisää",sources_one:"Lähde",sources_other:"Lähteet ({{count}})",submitSearch:"Lähetä haku",suggestionResultsCount_one:"{{label}} - {{count}} tulos",suggestionResultsCount_other:"{{label}} - {{count}} tulosta",thankYouForYourFeedback:"Kiitos palautteestasi!",thisAnsweredMyQuestion:"Tämä vastasi kysymykseeni",thisDidNotAnswerMyQuestion:"Tämä ei vastannut kysymykseeni",unselectAnOptionToEnterInARange:"Poista valinta päästäksesi syöttämään välin.",updateYourLocation:"Päivitä sijaintisi",useCurrentLocation:"Käytä nykyistä sijaintia",useMyLocation:"Käytä sijaintiani",viewAll:"Näytä kaikki",viewDetails:"Näytä tiedot"}}}),tG=tP({"locales/fr/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"Réponse générée par l'IA",allCategories:"Toutes les catégories",appliedFiltersToCurrentSearch:"Filtres appliqués à la recherche actuelle",apply:"Appliquer",applyFilters:"Appliquer les filtres",autocompleteOptionsFound_many:"{{count}} options d'autocomplétion{{label}} trouvées.",autocompleteOptionsFound_one:"{{count}} option d'autocomplétion{{label}} trouvée.",autocompleteOptionsFound_other:"{{count}} options d'autocomplétion{{label}} trouvées.",autocompleteSuggestion:"suggestion de saisie semi-automatique: {{suggestion}}",autocompleteSuggestionsFound_many:"{{count}} suggestions d'autocomplétion trouvées.",autocompleteSuggestionsFound_one:"{{count}} suggestion d'autocomplétion trouvée.",autocompleteSuggestionsFound_other:"{{count}} suggestions d'autocomplétion trouvées.",basedOnYourDevice:" (basé sur votre appareil)",basedOnYourInternetAddress:" (basé sur votre adresse Internet)",categoriesText_one:"La catégorie suivante a donné des résultats pour - <strong>{{query}}</strong>",categoriesText_other:"Les catégories suivantes ont donné des résultats pour - <strong>{{query}}</strong>",clearAll:"Effacer tout",clearMinAndMax:"Effacer min et max",clearTheRangeToSelectOptions:"Effacer la plage pour sélectionner les options.",clearTheSearchBar:"Effacer la barre de recherche",conductASearch:"Effectuer une recherche",currentLocation:"Localisation actuelle",didYouMean:"Vouliez-vous dire <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Lorsque des résultats de saisie semi-automatique sont disponibles, utilisez les flèches haut et bas pour naviguer et appuyez sur Entrée pour sélectionner.",feedback:"Retour",filterGroupSearchInputLabel:"Rechercher parmi les options de {{title}}
120",invalidRange:"Gamme non valide",max:"Max",min:"Min",navigateToTheNextResultsPage:"Accédez à la page de résultats suivante",navigateToThePreviousResultsPage:"Accédez à la page de résultats précédents",noAutocompleteOptionsFound:"0 option de saisie semi-automatique trouvée.",noAutocompleteSuggestionsFound:"0 suggestion de saisie semi-automatique trouvées.",noResultsFoundIn:"Aucun résultat trouvé dans {{currentVerticalLabel}}.",paginationPage:"page {{pageNumber}}",pagination:"Pagination",readMoreAbout:"En savoir plus sur <a>{{name}}</a>",recentSearch:"recherche récente : {{query}}",recentSearchesFound_many:"{{count}} recherches récentes trouvées.",recentSearchesFound_one:"{{count}} recherche récente trouvée.",recentSearchesFound_other:"{{count}} recherches récentes trouvées.",removeFilter:"Supprimer le filtre «{{displayName}}»",resultPreview:"aperçu du résultat: {{value}}",resultPreviewsFound_many:"{{count}} aperçus de résultats trouvés.",resultPreviewsFound_one:"{{count}} aperçu de résultat trouvé.",resultPreviewsFound_other:"{{count}} aperçus de résultats trouvés.",resultsCountText_many:"{{count}} résultats",resultsCountText_one:"{{count}} résultat",resultsCountText_other:"{{count}} résultats",resultsCountWithPaginationText:"{{paginateStart}}–{{paginateEnd}} sur {{resultsCount}} résultats",searchHere:"Recherche ici…",showingAllInstead:"Affichage de tous les {{currentVerticalLabel}} à la place.",showLess:"Afficher moins",showMore:"Afficher plus",sources_many:"Sources ({{count}})",sources_one:"Source",sources_other:"Sources ({{count}})",submitSearch:"Soumettre la recherche",suggestionResultsCount_many:"{{label}} - {{count}} résultats",suggestionResultsCount_one:"{{label}} - {{count}} résultat",suggestionResultsCount_other:"{{label}} - {{count}} résultats",thankYouForYourFeedback:"Merci pour votre retour !",thisAnsweredMyQuestion:"Cela a répondu à ma question",thisDidNotAnswerMyQuestion:"Cela n'a pas répondu à ma question",unselectAnOptionToEnterInARange:"Désélectionnez une option pour saisir une plage.",updateYourLocation:"Mettez à jour votre emplacement",useCurrentLocation:"Utiliser la localisation actuelle",useMyLocation:"Utiliser ma localisation",viewAll:"Afficher tous",viewDetails:"Afficher les détails"}}}),tq=tP({"locales/hi/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"एआई द्वारा जनरेट किया गया उत्तर",allCategories:"सभी श्रेणियाँ",appliedFiltersToCurrentSearch:"वर्तमान खोज पर लागू फ़िल्टर",apply:"लागू करें",applyFilters:"फ़िल्टर लागू करें",autocompleteOptionsFound_one:"{{count}}{{label}} स्वतः पूर्ति विकल्प मिला।",autocompleteOptionsFound_other:"{{count}}{{label}} स्वतः पूर्ति विकल्प मिले।",autocompleteSuggestion:"स्वतः पूर्ति सुझाव: {{suggestion}}",autocompleteSuggestionsFound_one:"{{count}} स्वतः पूर्ति सुझाव मिला।",autocompleteSuggestionsFound_other:"{{count}} स्वतः पूर्ति सुझाव मिले।",basedOnYourDevice:" (आपके डिवाइस के आधार पर)",basedOnYourInternetAddress:" (आपके इंटरनेट पते के आधार पर)",categoriesText_one:"निम्नलिखित श्रेणी में परिणाम मिले - <strong>{{query}}</strong>",categoriesText_other:"निम्नलिखित श्रेणियों में परिणाम मिले - <strong>{{query}}</strong>",clearAll:"सभी साफ़ करें",clearMinAndMax:"न्यूनतम और अधिकतम साफ़ करें",clearTheRangeToSelectOptions:"विकल्प चुनने के लिए सीमा साफ़ करें।",clearTheSearchBar:"खोज बार साफ़ करें",conductASearch:"खोज करें",currentLocation:"वर्तमान स्थान",didYouMean:"क्या आपका मतलब <button>{{correctedQuery}}</button> था",dropDownScreenReaderInstructions:"जब स्वतः पूर्ण परिणाà
120¤® उपलब्ध हों, तो समीक्षा के लिए ऊपर और नीचे के तीर कुंजी का उपयोग करें और चयन के लिए एंटर दबाएं।",feedback:"प्रतिक्रिया",filterGroupSearchInputLabel:"{{title}} विकल्प खोजें",invalidRange:"अमान्य सीमा",max:"अधिकतम",min:"न्यूनतम",navigateToTheNextResultsPage:"अगले परिणाम पृष्ठ पर जाएं",navigateToThePreviousResultsPage:"पिछले परिणाम पृष्ठ पर जाएं",noAutocompleteOptionsFound:"कोई स्वतः पूर्ति विकल्प नहीं मिला।",noAutocompleteSuggestionsFound:"कोई स्वतः पूर्ति सुझाव नहीं मिला।",noResultsFoundIn:"{{currentVerticalLabel}} में कोई परिणाम नहीं मिला।",paginationPage:"पृष्ठ {{pageNumber}}",pagination:"पृष्ठांकन",readMoreAbout:"<a>{{name}}</a> के बारे में और पढ़ें",recentSearch:"हाल की खोज: {{query}}",recentSearchesFound_one:"{{count}} हाल की खोज मिली।",recentSearchesFound_other:"{{count}} हाल की खोज मिलीं।",removeFilter:"“{{displayName}}“ फ़िल्टर हटाएं",resultPreview:"परिणाम पूर्वावलोकन: {{value}}",resultPreviewsFound_one:"{{count}} परिणाम पूर्वावलोकन मिला।",resultPreviewsFound_other:"{{count}} परिणाम पूर्वावलोकन मिले।",resultsCountText_one:"{{count}} परिणाम",resultsCountText_other:"{{count}} परिणाम",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} में से कुल {{resultsCount}} परिणाम",searchHere:"यहाँ खोजें…",showingAllInstead:"इसके बजाय सभी {{currentVerticalLabel}} दिखा रहे हैं।",showLess:"कम दिखाएँ",showMore:"और दिखाएँ",sources_one:"स्रोत",sources_other:"स्रोत ({{count}})",submitSearch:"खोज जमा करें",suggestionResultsCount_one:"{{label}} - {{count}} परिणाम",suggestionResultsCount_other:"{{label}} - {{count}} परिणाम",thankYouForYourFeedback:"आपकी प्रतिक्रिया के लिए धन्यवाद!",thisAnsweredMyQuestion:"इससे मेरे प्रश्न का उत्तर मिला",thisDidNotAnswerMyQuestion:"इससे मेरे प्रश्न का उत्तर नहीं मिला",unselectAnOptionToEnterInARange:"सीमा दर्ज करने के लिए विकल्प अनचेक करें।",updateYourLocation:"अपना स्थान अपडेट करें",useCurrentLocation:"वर्तमान स्थान का उपयोग करें",useMyLocation:"मेरा स्थान उपयोग करें",viewAll:"सभी देखें",viewDetails:"विवरण देखें"}}}),t$=tP({"locales/hr/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI generirani odgovor",allCategories:"Sve kategorije",appliedFiltersToCurrentSearch:"Primijenjeni filtri na trenutnu pretragu",apply:"Primijeni",applyFilters:"Primijeni filtere",autocompleteOptionsFound_few:"Pronađene su {{count}}{{label}} opcije za automatsko dovrÅ¡avanje.",autocompleteOptionsFound_one:"Pronađena je {{count}}{{label}} opcija za automatsko dovrÅ¡avanje.",autocompleteOptionsFound_other:"Pronađeno je {{count}}{{label}} opcija za automatsko dovrÅ¡avanje.",autocompleteSuggestion:"prijedlog za automatsko dovrÅ¡avanje: {{suggestion}}",autocompleteSuggestionsFound_few:"Pronađena su {{count}} prijedloga za automatsko dovrÅ¡avanje.",autocompleteSuggestionsFound_one:"Pronađen je {{count}} prijedlog za automatsko dovrÅ¡avanje.",autocompleteSuggestionsFound_other:"Pronađeno je {{count}} prijedloga za automatsko dovrÅ¡avanje.",basedOnYourDevice:" (na temelju vaÅ¡eg uređaja)",basedOnYourInternetAddress:" (na temelju vaÅ¡e internet adrese)",categoriesText_few:"Sljedeće kategorije dale su rezultate za - <strong>{{query}}</strong>",categoriesText_one:"Sljedeća kategorija dala je rezultate za - <strong>{{query}}</strong>",categoriesText_other:"Sljedeće kategorije dale su rezultate za - <strong>{{query}}</strong>
120",clearAll:"Očisti sve",clearMinAndMax:"Očisti min i max",clearTheRangeToSelectOptions:"Očistite raspon za odabir opcija.",clearTheSearchBar:"Očistite traku za pretraživanje",conductASearch:"Provesti pretragu",currentLocation:"Trenutna lokacija",didYouMean:"Jeste li mislili na <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Kad su dostupni rezultati automatskog dovršavanja, koristite strelice gore i dolje za pregled i Enter za odabir.",feedback:"Povratne informacije",filterGroupSearchInputLabel:"Pretraži opcije za {{title}}",invalidRange:"Nevažeći raspon",max:"Maks",min:"Min",navigateToTheNextResultsPage:"Dođite do sljedeće stranice rezultata",navigateToThePreviousResultsPage:"Dođite do stranice s prethodnim rezultatima",noAutocompleteOptionsFound:"Nije pronađena 0 opcija automatskog dovršavanja.",noAutocompleteSuggestionsFound:"Nije pronađen 0 prijedloga za automatsko dovršavanje.",noResultsFoundIn:"Nema rezultata u {{currentVerticalLabel}}.",paginationPage:"stranica {{pageNumber}}",pagination:"Paginacija",readMoreAbout:"Pročitaj više o <a>{{name}}</a>",recentSearch:"nedavno pretraživanje: {{query}}",recentSearchesFound_few:"Pronađene su {{count}} nedavne pretrage.",recentSearchesFound_one:"Pronađena je {{count}} nedavna pretraga.",recentSearchesFound_other:"Pronađeno je {{count}} nedavnih pretraga.",removeFilter:"Ukloni filtar „{{displayName}}“",resultPreview:"pregled rezultata: {{value}}",resultPreviewsFound_few:"Pronađena su {{count}} pregleda rezultata.",resultPreviewsFound_one:"Pronađen je {{count}} pregled rezultata.",resultPreviewsFound_other:"Pronađeno je {{count}} pregleda rezultata.",resultsCountText_few:"{{count}} rezultata",resultsCountText_one:"{{count}} rezultat",resultsCountText_other:"{{count}} rezultata",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} od {{resultsCount}} rezultata",searchHere:"Pretražite ovdje…",showingAllInstead:"Prikazuju se svi {{currentVerticalLabel}} umjesto toga.",showLess:"Prikaži manje",showMore:"Prikaži više",sources_few:"Izvora ({{count}})",sources_one:"Izvor",sources_other:"Izvori ({{count}})",submitSearch:"Pošaljite pretragu",suggestionResultsCount_few:"{{label}} - {{count}} rezultata",suggestionResultsCount_one:"{{label}} - {{count}} rezultat",suggestionResultsCount_other:"{{label}} - {{count}} rezultata",thankYouForYourFeedback:"Hvala na vašoj povratnoj informaciji!",thisAnsweredMyQuestion:"Ovo je odgovorilo na moje pitanje",thisDidNotAnswerMyQuestion:"Ovo nije odgovorilo na moje pitanje",unselectAnOptionToEnterInARange:"Poništite odabir opcije da biste unijeli raspon.",updateYourLocation:"Ažurirajte svoje mjesto",useCurrentLocation:"Koristi trenutnu lokaciju",useMyLocation:"Koristi moju lokaciju",viewAll:"Pogledajte sve",viewDetails:"Pogledajte detalje"}}}),tW=tP({"locales/hu/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI generált válasz",allCategories:"Összes kategória",appliedFiltersToCurrentSearch:"Alkalmazott szűrők az aktuális keresésre",apply:"Alkalmaz",applyFilters:"Szűrők alkalmazása",autocompleteOptionsFound_one:"{{count}}{{label}} automatikus kiegészítési opció található.",autocompleteOptionsFound_other:"{{count}}{{label}} automatikus kiegészítési opció található.",autocompleteSuggestion:"automatikus kiegészítési javaslat: {{suggestion}}",autocompleteSuggestionsFound_one:"{{count}} automatikus javaslat található.",autocompleteSuggestionsFound_other:"{{count}} automatikus javaslat található.",basedOnYourDevice:" (a készülék alapján)",basedOnYourInternetAddress:" (az internetes cím alapján)",categoriesText_one:"Az alábbi kategória adott találatot erre: - <strong>{{query}}</strong>",categoriesText_other:"Az alábbi kategóriák adtak találatot erre: - <strong>{{query}}</strong>",clearAll:"Tisztítsa meg az összeset",clearMinAndMax:"Töröld a minimumot és maximumot",clearTheRangeToSelectOptions:"Törölje az Opciók kiválasztásához a tartományt.",clearTheSearchBar:"Törölje a keresősávot",conductASearch:"Kutatást végez",currentLocation:"Jelenlegi helyzet",didYouMean:"Ezt szerette volna: <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Ha automatikus kiegészítési eredmények érhetők el, használd a fel/le nyilakat a böngészéshez, és az Entert a kiválasztáshoz.",feedback:"Visszacsatolás",filterGroupSearchInputLabel:"Keresés a(z) {{title}} lehetőségei között",invalidRange:"Érvénytelen hatótávolság",max:"Max",min:"Min",navigateToTheNextResultsPage:"Keresse meg a következő eredményoldalt",navigateToThePreviousResultsPage:"Keresse meg az előző eredményoldalt",noAutocompleteOptionsFound:"0 automatikus kiegészítési lehetőség található.",noAutocompleteSuggestionsFound:"0 automatikus kiegészítési javaslat található.",noResultsFoundIn:"Nem találhatók találatok a(z) {{currentVerticalLabel}}-ben.",paginationPage:"{{pageNumber}}. oldal",pagination:"Lapozás",readMoreAbout:"Olvass többet erről: <a>{{name}}</a>",recentSearch:"legutóbbi keresés: {{query}}",recentSearchesFound_one:"{{count}} legutóbbi keresés található.",recentSearchesFound_other:"{{count}} legutóbbi keresés található.",removeFilter:"„{{displayName}}“ szűrő eltávolítása",resultPreview:"találati előnézete: {{value}}",resultPreviewsFound_one:"{{count}} találati előnézet található.",resultPreviewsFound_other:"{{count}} találati előnézet található.",resultsCountText_one:"{{count}} találat",resultsCountText_other:"{{count}} találat",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} / összesen {{resultsCount}} találat",searchHere:"Keressen itt…",showingAllInstead:"Helyette az összes {{currentVerticalLabel}} megjelenítése.",showLess:"Kevesebb mutatása",showMore:"Több mutat
120ása",sources_one:"Forrás ({{count}})",sources_other:"Források ({{count}})",submitSearch:"Küldje el a keresést",suggestionResultsCount_one:"{{label}} - {{count}} találat",suggestionResultsCount_other:"{{label}} - {{count}} találat",thankYouForYourFeedback:"Köszönjük a visszajelzését!",thisAnsweredMyQuestion:"Ez megválaszolta a kérdésemet",thisDidNotAnswerMyQuestion:"Ez nem válaszolta meg a kérdésemet",unselectAnOptionToEnterInARange:"Töröljön egy jelölést a tartomány megadásához.",updateYourLocation:"Frissítse a tartózkodási helyét",useCurrentLocation:"Használd a jelenlegi helyzetet",useMyLocation:"Használd a helyzetemet",viewAll:"Tekintse meg az összeset",viewDetails:"A részletek megtekintése"}}}),tY=tP({"locales/it/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"Risposta generata dall'IA",allCategories:"Tutte le categorie",appliedFiltersToCurrentSearch:"Filtri applicati alla ricerca corrente",apply:"Applica",applyFilters:"Applica filtri",autocompleteOptionsFound_many:"{{count}}{{label}} opzioni di completamento automatico trovate.",autocompleteOptionsFound_one:"{{count}}{{label}} opzione di completamento automatico trovata.",autocompleteOptionsFound_other:"{{count}}{{label}} opzioni di completamento automatico trovate.",autocompleteSuggestion:"suggerimento di completamento automatico: {{suggestion}}",autocompleteSuggestionsFound_many:"{{count}} suggerimenti di completamento automatico trovati.",autocompleteSuggestionsFound_one:"{{count}} suggerimento di completamento automatico trovato.",autocompleteSuggestionsFound_other:"{{count}} suggerimenti di completamento automatico trovati.",basedOnYourDevice:" (basato sul tuo dispositivo)",basedOnYourInternetAddress:" (basato sul tuo indirizzo internet)",categoriesText_one:"La seguente categoria ha prodotto risultati per – <strong>{{query}}</strong>",categoriesText_other:"Le seguenti categorie hanno prodotto risultati per – <strong>{{query}}</strong>",clearAll:"Cancella tutto",clearMinAndMax:"Cancella min e max",clearTheRangeToSelectOptions:"Cancella l'intervallo per selezionare le opzioni.",clearTheSearchBar:"Cancella la barra di ricerca",conductASearch:"Condurre una ricerca",currentLocation:"Posizione attuale",didYouMean:"Volevi dire <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Quando sono disponibili i risultati di completamento automatico, usa le frecce su e giù per rivedere e invio per selezionare.",feedback:"Feedback",filterGroupSearchInputLabel:"Cerca tra le opzioni di {{title}}",invalidRange:"Gamma non valida",max:"Max",min:"Min",navigateToTheNextResultsPage:"Passare alla pagina dei risultati successivi",navigateToThePreviousResultsPage:"Passare alla pagina dei risultati precedenti",noAutocompleteOptionsFound:"0 opzioni di completamento automatico trovate.",noAutocompleteSuggestionsFound:"0 suggerimenti di completamento automatico trovati.",noResultsFoundIn:"Nessun risultato trovato in {{currentVerticalLabel}}.",paginationPage:"pagina {{pageNumber}}",pagination:"Paginazione",readMoreAbout:"Leggi di più su <a>{{name}}</a>",recentSearch:"ricerca recente: {{query}}",recentSearchesFound_many:"{{count}} ricerche recenti trovate.",recentSearchesFound_one:"{{count}} ricerca recente trovata.",recentSearchesFound_other:"{{count}} ricerche recenti trovate.",removeFilter:"Rimuovi il filtro «{{displayName}}»",resultPreview:"anteprima dei risultati: {{value}}",resultPreviewsFound_many:"{{count}} anteprime dei risultati trovate.",resultPreviewsFound_one:"{{count}} anteprima del risultato trovata.",resultPreviewsFound_other:"{{count}} anteprime dei risultati trovate.",resultsCountText_many:"{{count}} risultati",resultsCountText_one:"{{count}} risultato",resultsCountText_other:"{{count}} risultati",resultsCountWithPaginationText:"{{paginateStart}}–{{paginateEnd}} di {{resultsCount}} risultati",searchHere:"Cerca qui…",showingAllInstead:"Mostrando invece tutti i {{currentVerticalLabel}}.",showLess:"Mostra meno",showMore:"Mostra di più",sources_many:"Fonti ({{count}})",sources_one:"Fonte",sources_other:"Fonti ({{count}})",submitSearch:"Invia la ricerca",suggestionResultsCount_many:"{{label}} – {{count}} risultati",suggestionResultsCount_one:"{{label}} – {{count}} risultato",suggestionResultsCount_other:"{{label}} – {{count}} risultati",thankYouForYourFeedback:"Grazie per il tuo feedback!",thisAnsweredMyQuestion:"Questa risposta ha risolto il mio dubbio",thisDidNotAnswerMyQuestion:"Questa risposta non ha risolto il mio dubbio",unselectAnOptionToEnterInARange:"Deseleziona un’opzione per inserire un intervallo.",updateYourLocation:"Aggiorna la tua posizione",useCurrentLocation:"Usa la posizione attuale",useMyLocation:"Usa la mia posizione",viewAll:"Visualizza tutto",viewDetails:"Visualizza i dettagli"}}}),tZ=tP({"locales/ja/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI生成された回答",allCategories:"すべてのカテゴリー",appliedFiltersToCurrentSearch:"現在の検索に適用されたフィルター",apply:"適用",applyFilters:"フィルターを適用",autocompleteOptionsFound_other:"{{label}}
120のオートコンプリート候補が{{count}}件見つかりました。",autocompleteSuggestion:"オートコンプリートの提案:{{suggestion}}",autocompleteSuggestionsFound_other:"{{count}} 件のオートコンプリート候補が見つかりました。",basedOnYourDevice:"(デバイスに基づく)",basedOnYourInternetAddress:"(インターネットアドレスに基づく)",categoriesText_other:"次のカテゴリでは、 -  <strong> {{query}} </strong>の結果が得られました",clearAll:"すべてをクリアします",clearMinAndMax:"最小値と最大値をクリア",clearTheRangeToSelectOptions:"範囲をクリアしてオプションを選択します。",clearTheSearchBar:"検索バーをクリアします",conductASearch:"検索を実施します",currentLocation:"現在地",didYouMean:"<button>{{correctedQuery}}</button> と言いたかったですか",dropDownScreenReaderInstructions:"オートコンプリート結果が利用可能な場合、↑↓キーで選択し、Enter キーで選択。",feedback:"フィードバック",filterGroupSearchInputLabel:"{{title}} のオプションを検索",invalidRange:"無効な範囲",max:"最大",min:"最小",navigateToTheNextResultsPage:"次の結果ページに移動します",navigateToThePreviousResultsPage:"前の結果ページに移動します",noAutocompleteOptionsFound:"オートコンプリート オプションが 0 件見つかりました。",noAutocompleteSuggestionsFound:"オートコンプリート候補が 0 件見つかりました。",noResultsFoundIn:"{{currentVerticalLabel}}で結果が見つかりませんでした。",paginationPage:"{{pageNumber}}ページ",pagination:"ページネーション",readMoreAbout:"<a>{{name}}</a> について詳しく読む",recentSearch:"最近の検索:{{query}}",recentSearchesFound_other:"{{count}} 件の最近の検索が見つかりました。",removeFilter:"「{{displayName}}」 フィルターを削除",resultPreview:"結果プレビュー:{{value}}",resultPreviewsFound_other:"{{count}} 件の結果プレビューが見つかりました。",resultsCountText_other:"{{count}}件",resultsCountWithPaginationText:"{{paginateStart}}〜{{paginateEnd}}/全{{resultsCount}}件",searchHere:"ここで検索…",showingAllInstead:"代わりにすべての{{currentVerticalLabel}}を表示しています。",showLess:"折りたたむ",showMore:"もっと見る",sources_other:"出典({{count}})",submitSearch:"検索を送信します",suggestionResultsCount_other:"{{label}} – {{count}} 件の結果",thankYouForYourFeedback:"ご意見ありがとうございます!",thisAnsweredMyQuestion:"この回答で疑問が解決しました",thisDidNotAnswerMyQuestion:"この回答では疑問が解決しませんでした",unselectAnOptionToEnterInARange:"範囲を入力するには、選択を解除してください。",updateYourLocation:"あなたの場所を更新します",useCurrentLocation:"現在地を使用",useMyLocation:"現在地を使用",viewAll:"すべてを表示します",viewDetails:"詳細を表示します"}}}),tK=tP({"locales/ko/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI 생성 답변",allCategories:"전체 카테고리",appliedFiltersToCurrentSearch:"현재 검색에 적용된 필터",apply:"적용",applyFilters:"필터 적용",autocompleteOptionsFound_other:"{{count}}{{label}}개의 자동완성 옵션을 찾았습니다.",autocompleteSuggestion:"자동완성 제안: {{suggestion}}",autocompleteSuggestionsFound_other:"{{count}}개의 자동완성 제안을 찾았습니다.",basedOnYourDevice:" (기기 기준)",basedOnYourInternetAddress:" (인터넷 주소 기준)",categoriesText_other:"다음 카테고리에서 결과가 나타났습니다: <strong>{{query}}</strong>",clearAll:"모두 지우기",clearMinAndMax:"최소값 및 최대값 지우기",clearTheRangeToSelectOptions:"범위를 지워 옵션을 선택하세요.",clearTheSearchBar:"검색창 지우기",conductASearch:"검색 실행",currentLocation:"현재 위치",didYouMean:"다음을 찾으셨나요 <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"자동완성 결과가 있을 때 위/아래 화살표로 탐색하고 Enter 키로 선택하세요.",feedback:"피드백",filterGroupSearchInputLabel:"{{title}} 옵션 검색",invalidRange:"잘못된 범위입니다",max:"최대",min:"최소",navigateToTheNextResultsPage:"다음 결과 페이지로 이동",navigateToThePreviousResultsPage:"이전 결과 페이지로 이동",noAutocompleteOptionsFound:"자동완성 옵션이 없습니다.",noAutocompleteSuggestionsFound:"자동완성 제안이 없습니다.",noResultsFoundIn:"{{currentVerticalLabel}}에서 결과를 찾을 수 없습니다.",paginationPage:"{{pageNumber}}페이지",pagination:"페이지네이션",readMoreAbout:"<a>{{name}}</a>에 대해 더 읽기",recentSearch:"최근 검색: {{query}}",recentSearchesFound_other:"{{count}}개의 최근 검색어가 있습니다.",removeFilter:"「{{displayName}}」필터 제거",resultPreview:"결과 미리보기: {{value}}",resultPreviewsFound_other:"{{count}}개의 미리보기를 찾았습니다.",resultsCountText_other:"{{count}}개 결과",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} / 총 {{resultsCount}}개 결과",searchHere:"여기에 검색…",showingAllInstead:"{{currentVerticalLabel}} 전체를 표시하고 있습니다.",showLess:"간략히 보기",showMore:"더 보기",sources_other:"출처 ({{count}})",submitSearch:"검색",suggestionResultsCount_other:"{{label}}
120 - {{count}}개 결과",thankYouForYourFeedback:"피드백 감사합니다!",thisAnsweredMyQuestion:"질문에 대한 답변이 되었습니다",thisDidNotAnswerMyQuestion:"질문에 대한 답변이 아닙니다",unselectAnOptionToEnterInARange:"범위를 입력하려면 선택을 취소하세요.",updateYourLocation:"위치 업데이트",useCurrentLocation:"현재 위치 사용",useMyLocation:"내 위치 사용",viewAll:"전체 보기",viewDetails:"자세히 보기"}}}),tX=tP({"locales/lt/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"Dirbtinio intelekto sugeneruotas atsakymas",allCategories:"Visos kategorijos",appliedFiltersToCurrentSearch:"Taikyti filtrai dabartiniam paieškai",apply:"Taikyti",applyFilters:"Taikyti filtrus",autocompleteOptionsFound_few:"Rastos {{count}}{{label}} automatinio užbaigimo parinktys.",autocompleteOptionsFound_many:"Rasta {{count}}{{label}} automatinio užbaigimo parinkčių.",autocompleteOptionsFound_one:"Rasta {{count}}{{label}} automatinio užbaigimo parinktis.",autocompleteOptionsFound_other:"Rasta {{count}}{{label}} automatinio užbaigimo parinkčių.",autocompleteSuggestion:"automatinis užbaigimas pasiūlymas: {{suggestion}}",autocompleteSuggestionsFound_few:"Rasti {{count}} automatinio užbaigimo pasiūlymai.",autocompleteSuggestionsFound_many:"Rasta {{count}} automatinio užbaigimo pasiūlymų.",autocompleteSuggestionsFound_one:"Rastas {{count}} automatinio užbaigimo pasiūlymas.",autocompleteSuggestionsFound_other:"Rasta {{count}} automatinio užbaigimo pasiūlymų.",basedOnYourDevice:" (remiantis jūsų įrenginiu)",basedOnYourInternetAddress:" (remiantis jūsų interneto adresu)",categoriesText_few:"Šios kategorijos pateikė rezultatus – <strong>{{query}}</strong>",categoriesText_one:"Ši kategorija pateikė rezultatus – <strong>{{query}}</strong>",categoriesText_other:"Šių kategorijų pateikta rezultatų – <strong>{{query}}</strong>",clearAll:"Išvalyti viską",clearMinAndMax:"Išvalyti min ir max",clearTheRangeToSelectOptions:"Išvalykite diapazoną, kurį galite pasirinkti parinktys.",clearTheSearchBar:"Išvalykite paieškos juostą",conductASearch:"Atlikite paiešką",currentLocation:"Dabartinė vieta",didYouMean:"Ar turėjote omenyje <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Kai yra automatinio užbaigimo rezultatai, naudokite rodykles aukštyn ir žemyn naršymui ir Enter pasirinkimui.",feedback:"Atsiliepimai",filterGroupSearchInputLabel:"Ieškoti {{title}} parinkčių",invalidRange:"Neteisingas diapazonas",max:"Maks.",min:"Min.",navigateToTheNextResultsPage:"Eikite į kitą rezultatų puslapį",navigateToThePreviousResultsPage:"Eikite į ankstesnį rezultatų puslapį",noAutocompleteOptionsFound:"0 automaatse täitmise valikut ei leitud.",noAutocompleteSuggestionsFound:"0 automaatse täitmise soovitust ei leitud.",noResultsFoundIn:"Rezultatų nerasta {{currentVerticalLabel}}.",paginationPage:"{{pageNumber}} puslapis",pagination:"Puslapiavimas",readMoreAbout:"Skaityti daugiau apie <a>{{name}}</a>",recentSearch:"Naujausia paieška: {{query}}",recentSearchesFound_few:"Rastos {{count}} neseniai atliktos paieškos.",recentSearchesFound_many:"Rasta {{count}} neseniai atliktų paieškų.",recentSearchesFound_one:"Rasta {{count}} neseniai atlikta paieška.",recentSearchesFound_other:"Rasta {{count}} neseniai atliktų paieškų.",removeFilter:"Pašalinti filtrą: „{{displayName}}“",resultPreview:"rezultato peržiūra: {{value}}",resultPreviewsFound_few:"Rastos {{count}} rezultatų peržiūros.",resultPreviewsFound_many:"Rasta {{count}} rezultatų peržiūrų.",resultPreviewsFound_one:"Rasta {{count}} rezultatų peržiūra.",resultPreviewsFound_other:"Rasta {{count}} rezultatų peržiūrų.",resultsCountText_few:"{{count}} rezultatai",resultsCountText_many:"{{count}} rezultatų",resultsCountText_one:"{{count}} rezultatas",resultsCountText_other:"{{count}} rezultatų",resultsCountWithPaginationText:"{{paginateStart}}–{{paginateEnd}} iš {{resultsCount}} rezultatų",searchHere:"Ieškokite čia…",showingAllInstead:"Vietoje to rodomi visi {{currentVerticalLabel}}.",showLess:"Rodyti mažiau",showMore:"Rodyti daugiau",sources_few:"Šaltiniai ({{count}})",sources_many:"Šaltinių ({{count}})",sources_one:"Šaltinis",sources_other:"Šaltinių ({{count}})",submitSearch:"Pateikti paiešką",suggestionResultsCount_few:"{{label}} – {{count}} rezultatai",suggestionResultsCount_many:"{{label}} – {{count}} rezultatų",suggestionResultsCount_one:"{{label}} – {{count}} rezultatas",suggestionResultsCount_other:"{{label}} – {{count}} rezultatų",thankYouForYourFeedback:"Ačiū už jūsų atsiliepimus!",thisAnsweredMyQuestion:"Tai atsakė į mano klausimą",thisDidNotAnswerMyQuestion:"Tai neatsakė į mano klausimą",unselectAnOptionToEnterInARange:"Atžymėkite parinktį, kad galėtumėte įvesti intervalą.",updateYourLocation:"Atnaujinkite savo vietą",useCurrentLocation:"Naudoti dabartinę vietą",useMyLocation:"Naudoti mano vietą",viewAll:"Peržiūrėti visus",viewDetails:"Peržiūrėti išsamią informaciją"}}}),tQ=tP({"locales/lv/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI ģenerēta atbilde",allCategories:"Visas kategorijas",appliedFiltersToCurrentSearch:"Pielietotie filtri pašreizējai meklēšanai",apply:"Pielietot",applyFilters:"Pielietot filtrus",autocompleteOptionsFound_one:"Atrasta {{count}}{{label}} automātiskās aizpildes iespēja.",autocompleteOptionsFound_other:"Atrastas {{count}}{{label}} automātiskās aizpildes iespējas.",autocompleteOptionsFound_zero:"Nav atrasta neviena{{label}} automātiskās aizpildes iespējas.",autocompleteSuggestion:"automātiskās pabeigšanas ieteikums: {{suggestion}}",autocompleteSuggestionsFound_one:"Atrasts {{count}} automātās aizpildes ieteikums.",autocompleteSuggestionsFound_other:"Atrasti {{count}} automātiskās aizpildes ieteikumi.",autocompleteSuggestionsFound_zero:"Atrasti {{count}} automātiskās aizpildes ieteikumi.",basedOnYourDevice:" (balstoties uz jūsu ierīci)",basedOnYourInternetAddress:" (balstoties uz jūsu interneta adresi)",categoriesText_one:"Nākamā kategorija deva rezultātus priekš – <strong>{{query}}</strong>",categoriesText_other:"Nākamo kategoriju skaits deva rezultātus priekš – <strong>{{query}}</strong>",categoriesText_zero:"Nav neviena rezultāta kategorijai – <strong>{{query}}</strong>
120",clearAll:"Notīrīt visu",clearMinAndMax:"Notīrīt min un max",clearTheRangeToSelectOptions:"Notīriet diapazonu, lai izvēlētos opcijas.",clearTheSearchBar:"Notīriet meklēšanas joslu",conductASearch:"Veikt meklēšanu",currentLocation:"Pašreizējā atrašanās vieta",didYouMean:"Vai jūs domājāt <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Kad ir pieejami automātiskās pabeigšanas rezultāti, izmantojiet bultiņas uz augšu un leju, lai pārlūkotu, un Enter, lai izvēlētos.",feedback:"Atsauksmes",filterGroupSearchInputLabel:"Meklēt {{title}} opcijās",invalidRange:"Nederīgs diapazons",max:"Maks",min:"Min",navigateToTheNextResultsPage:"Dodieties uz nākamo rezultātu lapu",navigateToThePreviousResultsPage:"Dodieties uz iepriekšējo rezultātu lapu",noAutocompleteOptionsFound:"Atrasta 0 automātiskās pabeigšanas opcija.",noAutocompleteSuggestionsFound:"Atrasti 0 automātiskās pabeigšanas ieteikumi.",noResultsFoundIn:"Rezultāti nav atrasti {{currentVerticalLabel}}.",paginationPage:"{{pageNumber}}. lapa",pagination:"Lappuļošana",readMoreAbout:"Lasīt vairāk par <a>{{name}}</a>",recentSearch:"nesenā meklēšana: {{query}}",recentSearchesFound_one:"Atrasta {{count}} nesenā meklēšana.",recentSearchesFound_other:"Atrastas {{count}} nesenās meklēšanas.",recentSearchesFound_zero:"Atrastas {{count}} nesenās meklēšanas.",removeFilter:"Noņemt filtru: „{{displayName}}“",resultPreview:"rezultāta priekšskatījums: {{value}}",resultPreviewsFound_one:"Atrasts {{count}} rezultātu priekšskatījums.",resultPreviewsFound_other:"Atrastas {{count}} rezultātu priekšskatījumi.",resultPreviewsFound_zero:"Atrastas {{count}} rezultātu priekšskatījumi.",resultsCountText_one:"{{count}} rezultāts",resultsCountText_other:"{{count}} rezultāti",resultsCountText_zero:"{{count}} rezultātu",resultsCountWithPaginationText:"{{paginateStart}}–{{paginateEnd}} no {{resultsCount}} rezultātiem",searchHere:"Meklēt šeit…",showingAllInstead:"Tiek rādīti visi {{currentVerticalLabel}}.",showLess:"Rādīt mazāk",showMore:"Rādīt vairāk",sources_one:"Avots",sources_other:"Avoti ({{count}})",sources_zero:"Avoti nav pieejami",submitSearch:"Iesniegt meklēšanu",suggestionResultsCount_one:"{{label}} – {{count}} rezultāts",suggestionResultsCount_other:"{{label}} – {{count}} rezultātu",suggestionResultsCount_zero:"{{label}} – nav rezultātu",thankYouForYourFeedback:"Paldies par jūsu atsauksmēm!",thisAnsweredMyQuestion:"Šis atbildēja uz manu jautājumu",thisDidNotAnswerMyQuestion:"Šis neatbildēja uz manu jautājumu",unselectAnOptionToEnterInARange:"Atceļiet izvēli, lai ievadītu diapazonu.",updateYourLocation:"Atjauniniet savu atrašanās vietu",useCurrentLocation:"Izmantot pašreizējo atrašanās vietu",useMyLocation:"Izmantot manu atrašanās vietu",viewAll:"Skatīt visu",viewDetails:"Skatīt informāciju"}}}),tJ=tP({"locales/nb/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI-generert svar",allCategories:"Alle kategorier",appliedFiltersToCurrentSearch:"Brukte filtre for gjeldende søk",apply:"Bruk",applyFilters:"Bruk filtre",autocompleteOptionsFound_one:"{{count}}{{label}} autofullføringsvalg funnet.",autocompleteOptionsFound_other:"{{count}}{{label}} autofullføringsvalg funnet.",autocompleteSuggestion:"autofullføringsforslag: {{suggestion}}",autocompleteSuggestionsFound_one:"{{count}} autofullføringsforslag funnet.",autocompleteSuggestionsFound_other:"{{count}} autofullføringsforslag funnet.",basedOnYourDevice:" (basert på enheten din)",basedOnYourInternetAddress:" (basert på din internettadresse)",categoriesText_one:"Følgende kategori ga resultater for – <strong>{{query}}</strong>",categoriesText_other:"Følgende kategorier ga resultater for – <strong>{{query}}</strong>",clearAll:"Fjern alt",clearMinAndMax:"Fjern min og maks",clearTheRangeToSelectOptions:"Fjern området for å velge alternativer.",clearTheSearchBar:"Tøm søkefeltet",conductASearch:"Utfør et søk",currentLocation:"Nåværende posisjon",didYouMean:"Mente du <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Når autofullføringsresultater er tilgjengelige, bruk opp- og nedpiler for å bla gjennom og enter for å velge.",feedback:"Tilbakemelding",f
120ilterGroupSearchInputLabel:"Søk i alternativer for {{title}}",invalidRange:"Ugyldig område",max:"Maks",min:"Min",navigateToTheNextResultsPage:"Gå til neste resultatside",navigateToThePreviousResultsPage:"Gå til forrige resultatside",noAutocompleteOptionsFound:"0 autofullføringsvalg funnet.",noAutocompleteSuggestionsFound:"0 autofullføringsforslag funnet.",noResultsFoundIn:"Ingen resultater funnet i {{currentVerticalLabel}}.",paginationPage:"side {{pageNumber}}",pagination:"Sideinndeling",readMoreAbout:"Les mer om <a>{{name}}</a>",recentSearch:"siste søk: {{query}}",recentSearchesFound_one:"{{count}} siste søk funnet.",recentSearchesFound_other:"{{count}} siste søk funnet.",removeFilter:"Fjern filteret “{{displayName}}”",resultPreview:"resultatforhåndsvisning: {{value}}",resultPreviewsFound_one:"{{count}} resultatforhåndsvisning funnet.",resultPreviewsFound_other:"{{count}} resultatforhåndsvisninger funnet.",resultsCountText_one:"{{count}} resultat",resultsCountText_other:"{{count}} resultater",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} av {{resultsCount}} resultater",searchHere:"Søk her…",showingAllInstead:"Viser alle {{currentVerticalLabel}} i stedet.",showLess:"Vis mindre",showMore:"Vis mer",sources_one:"Kilde",sources_other:"Kilder ({{count}})",submitSearch:"Send søk",suggestionResultsCount_one:"{{label}} - {{count}} resultat",suggestionResultsCount_other:"{{label}} - {{count}} resultater",thankYouForYourFeedback:"Takk for tilbakemeldingen!",thisAnsweredMyQuestion:"Dette besvarte spørsmålet mitt",thisDidNotAnswerMyQuestion:"Dette besvarte ikke spørsmålet mitt",unselectAnOptionToEnterInARange:"Fjern valg for å angi et område.",updateYourLocation:"Oppdater plasseringen din",useCurrentLocation:"Bruk nåværende posisjon",useMyLocation:"Bruk min posisjon",viewAll:"Se alle",viewDetails:"Se detaljer"}}}),t1=tP({"locales/nl/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI gegenereerd antwoord",allCategories:"Alle categorieën",appliedFiltersToCurrentSearch:"Toegepaste filters op de huidige zoekopdracht",apply:"Toepassen",applyFilters:"Filters toepassen",autocompleteOptionsFound_one:"{{count}}{{label}} automatisch aanvulsuggestie gevonden.",autocompleteOptionsFound_other:"{{count}}{{label}} automatisch aanvulsuggesties gevonden.",autocompleteSuggestion:"automatisch aanvultip: {{suggestion}}",autocompleteSuggestionsFound_one:"{{count}} automatisch aanvultip gevonden.",autocompleteSuggestionsFound_other:"{{count}} automatisch aanvultips gevonden.",basedOnYourDevice:" (gebaseerd op je apparaat)",basedOnYourInternetAddress:" (gebaseerd op je internetadres)",categoriesText_one:"De volgende categorie leverde resultaten op voor - <strong>{{query}}</strong>",categoriesText_other:"De volgende categorieën leverden resultaten op voor - <strong>{{query}}</strong>",clearAll:"Alles wissen",clearMinAndMax:"Min en max wissen",clearTheRangeToSelectOptions:"Wis het bereik om opties te selecteren.",clearTheSearchBar:"Zoekbalk wissen",conductASearch:"Een zoekopdracht uitvoeren",currentLocation:"Huidige locatie",didYouMean:"Bedoelde je <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Wanneer automatische aanvulresultaten beschikbaar zijn, gebruik de pijltjestoetsen omhoog en omlaag om te navigeren en Enter om te selecteren.",feedback:"Feedback",filterGroupSearchInputLabel:"Zoek in opties voor {{title}}",invalidRange:"Ongeldig bereik",max:"Max",min:"Min",navigateToTheNextResultsPage:"Navigeer naar de volgende resultatenpagina",navigateToThePreviousResultsPage:"Navigeer naar de vorige resultatenpagina",noAutocompleteOptionsFound:"0 automatisch aanvulopties gevonden.",noAutocompleteSuggestionsFound:"0 automatisch aanvultips gevonden.",noResultsFoundIn:"Geen resultaten gevonden in {{currentVerticalLabel}}.",paginationPage:"pagina {{pageNumber}}",pagination:"Paginering",readMoreAbout:"Lees meer over <a>{{name}}</a>",recentSearch:"recente zoekopdracht: {{query}}",recentSearchesFound_one:"{{count}} recente zoekopdracht gevonden.",recentSearchesFound_other:"{{count}} recente zoekopdrachten gevonden.",removeFilter:"Filter „{{displayName}}“ verwijderen",resultPreview:"resultaatvoorbeeld: {{value}}",resultPreviewsFound_one:"{{count}} resultaatvoorbeeld gevonden.",resultPreviewsFound_other:"{{count}} resultaatvoorbeelden gevonden.",resultsCountText_one:"{{count}} resultaat",resultsCountText_other:"{{count}} resultaten",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} van {{resultsCount}} resultaten",searchHere:"Hier zoeken…",showingAllInstead:"Toont in plaats daarvan alle {{currentVerticalLabel}}.",showLess:"Minder weergeven",showMore:"Meer weergeven",sources_one:"Bron",sources_other:"Bronnen ({{count}})",submitSearch:"Zoekopdracht versturen",suggestionResultsCount_one:"{{label}}
120 - {{count}} resultaat",suggestionResultsCount_other:"{{label}} - {{count}} resultaten",thankYouForYourFeedback:"Bedankt voor je feedback!",thisAnsweredMyQuestion:"Dit beantwoordde mijn vraag",thisDidNotAnswerMyQuestion:"Dit beantwoordde mijn vraag niet",unselectAnOptionToEnterInARange:"Deselecteer een optie om een bereik in te voeren.",updateYourLocation:"Werk je locatie bij",useCurrentLocation:"Gebruik huidige locatie",useMyLocation:"Gebruik mijn locatie",viewAll:"Bekijk alles",viewDetails:"Bekijk details"}}}),t0=tP({"locales/pl/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI wygenerowało odpowiedź",allCategories:"Wszystkie kategorie",appliedFiltersToCurrentSearch:"Zastosowane filtry do bieżącego wyszukiwania",apply:"Zastosuj",applyFilters:"Zastosuj filtry",autocompleteOptionsFound_few:"Znaleziono {{count}}{{label}} opcje autouzupełniania.",autocompleteOptionsFound_many:"Znaleziono {{count}}{{label}} opcji autouzupełniania.",autocompleteOptionsFound_one:"Znaleziono {{count}}{{label}} opcję autouzupełniania.",autocompleteOptionsFound_other:"Znaleziono {{count}}{{label}} opcji autouzupełniania.",autocompleteSuggestion:"sugestia autouzupełniania: {{suggestion}}",autocompleteSuggestionsFound_few:"Znaleziono {{count}} sugestie autouzupełniania.",autocompleteSuggestionsFound_many:"Znaleziono {{count}} sugestii autouzupełniania.",autocompleteSuggestionsFound_one:"Znaleziono {{count}} sugestię autouzupełniania.",autocompleteSuggestionsFound_other:"Znaleziono {{count}} sugestii autouzupełniania.",basedOnYourDevice:" (na podstawie Twojego urządzenia)",basedOnYourInternetAddress:" (na podstawie Twojego adresu internetowego)",categoriesText_few:"Następujące kategorie zwróciły wyniki dla – <strong>{{query}}</strong>",categoriesText_one:"Następująca kategoria zwróciła wyniki dla – <strong>{{query}}</strong>",categoriesText_other:"Następujących kategorii zwróciło wyniki dla – <strong>{{query}}</strong>",clearAll:"Wyczyść wszystko",clearMinAndMax:"Wyczyść min i max",clearTheRangeToSelectOptions:"Wyczyść zakres, aby wybrać opcje.",clearTheSearchBar:"Wyczyść pasek wyszukiwania",conductASearch:"Przeprowadzić wyszukiwanie",currentLocation:"Aktualna lokalizacja",didYouMean:"Czy chodziło Ci o <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Gdy dostępne są wyniki autouzupełniania, użyj strzałek w górę i w dół, aby przejrzeć, a enter, aby wybrać.",feedback:"Informacja zwrotna",filterGroupSearchInputLabel:"Szukaj w opcjach {{title}}",invalidRange:"Nieprawidłowy zasięg",max:"Max",min:"Min",navigateToTheNextResultsPage:"Przejdź do strony następnych wyników",navigateToThePreviousResultsPage:"Przejdź do strony poprzednich wyników",noAutocompleteOptionsFound:"Znaleziono 0 opcji autouzupełniania.",noAutocompleteSuggestionsFound:"Znaleziono 0 sugestii autouzupełniania.",noResultsFoundIn:"Nie znaleziono wyników w {{currentVerticalLabel}}.",paginationPage:"strona {{pageNumber}}",pagination:"Paginacja",readMoreAbout:"Czytaj więcej o <a>{{name}}</a>",recentSearch:"najnowsze wyszukiwanie: {{query}}",recentSearchesFound_few:"Znaleziono {{count}} ostatnie wyszukiwania.",recentSearchesFound_many:"Znaleziono {{count}} ostatnich wyszukiwań.",recentSearchesFound_one:"Znaleziono {{count}} ostatnie wyszukiwanie.",recentSearchesFound_other:"Znaleziono {{count}} ostatnich wyszukiwań.",removeFilter:"Usuń filtr „{{displayName}}“",resultPreview:"podgląd wyników: {{value}}",resultPreviewsFound_few:"Znaleziono {{count}} podglądy wyników.",resultPreviewsFound_many:"Znaleziono {{count}} podglądów wyników.",resultPreviewsFound_one:"Znaleziono {{count}} podgląd wyniku.",resultPreviewsFound_other:"Znaleziono {{count}} podglądów wyników.",resultsCountText_few:"{{count}} wyniki",resultsCountText_many:"{{count}} wyników",resultsCountText_one:"{{count}} wynik",resultsCountText_other:"{{count}} wyników",resultsCountWithPaginationText:"{{paginateStart}}–{{paginateEnd}} z {{resultsCount}} wyników",searchHere:"Wyszukaj tutaj…",showingAllInstead:"Wyświetlam wszystkie {{currentVerticalLabel}} zamiast tego.",showLess:"Pokaż mniej",showMore:"Pokaż więcej",sources_few:"Źródła ({{count}})",sources_many:"Źródeł ({{count}})",sources_one:"Źródło",sources_other:"Źródeł ({{count}})",submitSearch:"Prześlij wyszukiwanie",suggestionResultsCount_few:"{{label}} – {{count}} wyniki",suggestionResultsCount_many:"{{label}} – {{count}} wyników",suggestionResultsCount_one:"{{label}} – {{count}} wynik",suggestionResultsCount_other:"{{label}} – {{count}} wyników",thankYouForYourFeedback:"Dziękujemy za Twoją opinię!",thisAnsweredMyQuestion:"To odpowiedziało na moje pytanie",thisDidNotAnswerMyQuestion:"To nie odpowiedziało na moje pytanie",unselectAnOptionToEnterInARange:"Odznacz opcję, aby wpisać zakres.",updateYourLocation:"Zaktualizuj swoją lokalizację",useCurrentLocation:"Użyj aktualnej lokalizacji",useMyLocation:"Użyj mojej lokalizacji",viewAll:"Zobacz wszystkie",viewDetails:"Zobacz szczegóły"}}}
120),t2=tP({"locales/pt/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"Resposta Gerada por IA",allCategories:"Todas as Categorias",appliedFiltersToCurrentSearch:"Filtros aplicados à pesquisa atual",apply:"Aplicar",applyFilters:"Aplicar Filtros",autocompleteOptionsFound_many:"{{count}}{{label}} opções de preenchimento automático encontradas.",autocompleteOptionsFound_one:"{{count}}{{label}} opção de preenchimento automático encontrada.",autocompleteOptionsFound_other:"{{count}}{{label}} opções de preenchimento automático encontradas.",autocompleteSuggestion:"sugestão de preenchimento automático: {{suggestion}}",autocompleteSuggestionsFound_many:"{{count}} sugestões de preenchimento automático encontradas.",autocompleteSuggestionsFound_one:"{{count}} sugestão de preenchimento automático encontrada.",autocompleteSuggestionsFound_other:"{{count}} sugestões de preenchimento automático encontradas.",basedOnYourDevice:" (baseado no seu dispositivo)",basedOnYourInternetAddress:" (baseado no seu endereço de internet)",categoriesText_one:"A seguinte categoria apresentou resultados para - <strong>{{query}}</strong>",categoriesText_other:"As seguintes categorias apresentaram resultados para - <strong>{{query}}</strong>",clearAll:"Limpar Tudo",clearMinAndMax:"Limpar mín e máx",clearTheRangeToSelectOptions:"Limpar o intervalo para selecionar opções.",clearTheSearchBar:"Limpar a barra de pesquisa",conductASearch:"Realizar uma busca",currentLocation:"Localização Atual",didYouMean:"Você quis dizer <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Quando os resultados de preenchimento automático estiverem disponíveis, use as setas para cima e para baixo para revisar e Enter para selecionar.",feedback:"Feedback",filterGroupSearchInputLabel:"Pesquisar opções de {{title}}",invalidRange:"Intervalo inválido",max:"Máx",min:"Mín",navigateToTheNextResultsPage:"Navegar para a próxima página de resultados",navigateToThePreviousResultsPage:"Navegar para a página de resultados anterior",noAutocompleteOptionsFound:"0 opções de preenchimento automático encontradas.",noAutocompleteSuggestionsFound:"0 sugestões de preenchimento automático encontradas.",noResultsFoundIn:"Nenhum resultado encontrado em {{currentVerticalLabel}}.",paginationPage:"página {{pageNumber}}",pagination:"Paginação",readMoreAbout:"Leia mais sobre <a>{{name}}</a>",recentSearch:"busca recente: {{query}}",recentSearchesFound_many:"{{count}} buscas recentes encontradas.",recentSearchesFound_one:"{{count}} busca recente encontrada.",recentSearchesFound_other:"{{count}} buscas recentes encontradas.",removeFilter:"Remover filtro «{{displayName}}»",resultPreview:"pré-visualização do resultado: {{value}}",resultPreviewsFound_many:"{{count}} pré-visualizações recentes encontradas.",resultPreviewsFound_one:"{{count}} pré-visualização do resultado encontrada.",resultPreviewsFound_other:"{{count}} pré-visualizações recentes encontradas.",resultsCountText_many:"{{count}} Resultados",resultsCountText_one:"{{count}} Resultado",resultsCountText_other:"{{count}} Resultados",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} de {{resultsCount}} Resultados",searchHere:"Pesquise aqui…",showingAllInstead:"Mostrando todos os {{currentVerticalLabel}} em vez disso.",showLess:"Mostrar Menos",showMore:"Mostrar Mais",sources_many:"Fontes ({{count}})",sources_one:"Fonte",sources_other:"Fontes ({{count}})",submitSearch:"Enviar pesquisa",suggestionResultsCount_many:"{{label}} - {{count}} resultados",suggestionResultsCount_one:"{{label}} - {{count}} resultado",suggestionResultsCount_other:"{{label}} - {{count}} resultados",thankYouForYourFeedback:"Obrigado pelo seu feedback!",thisAnsweredMyQuestion:"Isso respondeu à minha pergunta",thisDidNotAnswerMyQuestion:"Isso não respondeu à minha pergunta",unselectAnOptionToEnterInARange:"Desmarque uma opção para inserir um intervalo.",updateYourLocation:"Atualize sua localização",useCurrentLocation:"Usar Localização Atual",useMyLocation:"Usar minha localização",viewAll:"Ver tudo",viewDetails:"Ver Detalhes"}}}),t5=tP({"locales/ro/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"Răspuns generat de AI",allCategories:"Toate categoriile",appliedFiltersToCurrentSearch:"Filtre aplicate la căutarea curentă",apply:"Aplică",applyFilters:"Aplică filtre",autocompleteOptionsFound_few:"{{count}}{{label}} opțiuni de completare automată găsite.",autocompleteOptionsFound_one:"{{count}}{{label}} opțiune de completare automată găsită.",autocompleteOptionsFound_other:"{{count}}{{label}} opțiuni de completare automată găsite.",autocompleteSuggestion:"sugestie completă automată: {{suggestion}}",autocompleteSuggestionsFound_few:"{{count}} sugestii de completare automată găsite.",autocompleteSuggestionsFound_one:"{{count}} sugestie de completare automată găsită.",autocompleteSuggestionsFound_other:"{{count}} sugestii de completare automată găsite.",basedOnYourDevice:" (bazat pe dispozitivul tău)",basedOnYourInternetAddress:" (bazat pe adresa ta de internet)",categoriesText_few:"Următoarele categorii au generat rezultate pentru – <strong>{{query}}</strong>",categoriesText_one:"Următoarea categorie a generat rezultate pentru – <strong>{{query}}</strong>",categoriesText_other:"Următoarele categorii au generat rezultate pentru – <strong>{{query}}</strong>
120",clearAll:"Ștergeți toate",clearMinAndMax:"Șterge min și max",clearTheRangeToSelectOptions:"Ștergeți intervalul pentru a selecta opțiuni.",clearTheSearchBar:"Ștergeți bara de căutare",conductASearch:"Efectuați o căutare",currentLocation:"Locația curentă",didYouMean:"Ai vrut să spui <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Când sunt disponibile rezultate de completare automată, folosește săgețile sus și jos pentru a naviga și Enter pentru a selecta.",feedback:"Feedback",filterGroupSearchInputLabel:"Căutați în opțiunile pentru {{title}}",invalidRange:"Interval nevalid",max:"Max",min:"Min",navigateToTheNextResultsPage:"Navigați la pagina de rezultate următoare",navigateToThePreviousResultsPage:"Navigați la pagina de rezultate anterioare",noAutocompleteOptionsFound:"Nu a fost găsită nicio opțiune de completare automată.",noAutocompleteSuggestionsFound:"Nu a fost găsită nicio sugestie de completare automată.",noResultsFoundIn:"Niciun rezultat găsit în {{currentVerticalLabel}}.",paginationPage:"pagina {{pageNumber}}",pagination:"Paginare",readMoreAbout:"Citește mai mult despre <a>{{name}}</a>",recentSearch:"căutare recentă: {{query}}",recentSearchesFound_few:"{{count}} căutări recente găsite.",recentSearchesFound_one:"{{count}} căutare recentă găsită.",recentSearchesFound_other:"{{count}} căutări recente găsite.",removeFilter:"Elimină filtrul „{{displayName}}“",resultPreview:"rezultat previzualizare: {{value}}",resultPreviewsFound_few:"{{count}} previzualizări ale rezultatelor găsite.",resultPreviewsFound_one:"{{count}} previzualizare a rezultatului găsită.",resultPreviewsFound_other:"{{count}} previzualizări ale rezultatelor găsite.",resultsCountText_few:"{{count}} rezultate",resultsCountText_one:"{{count}} rezultat",resultsCountText_other:"{{count}} de rezultate",resultsCountWithPaginationText:"{{paginateStart}}–{{paginateEnd}} din {{resultsCount}} rezultate",searchHere:"Căutați aici…",showingAllInstead:"Se afișează toate {{currentVerticalLabel}} în schimb.",showLess:"Arată mai puțin",showMore:"Arată mai mult",sources_few:"Surse ({{count}})",sources_one:"Sursă",sources_other:"Surse ({{count}})",submitSearch:"Trimiteți căutarea",suggestionResultsCount_few:"{{label}} – {{count}} rezultate",suggestionResultsCount_one:"{{label}} – {{count}} rezultat",suggestionResultsCount_other:"{{label}} – {{count}} rezultate",thankYouForYourFeedback:"Mulțumim pentru feedback!",thisAnsweredMyQuestion:"Aceasta a răspuns la întrebarea mea",thisDidNotAnswerMyQuestion:"Aceasta nu a răspuns la întrebarea mea",unselectAnOptionToEnterInARange:"Deselectează o opțiune pentru a introduce un interval.",updateYourLocation:"Actualizați -vă locația",useCurrentLocation:"Folosește locația curentă",useMyLocation:"Folosește locația mea",viewAll:"Vizualizați toate",viewDetails:"Vizualizați detalii"}}}),t4=tP({"locales/ru/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"Ответ, сгенерированный ИИ",allCategories:"Все категории",appliedFiltersToCurrentSearch:"Применённые фильтры к текущему поиску",apply:"Применить",applyFilters:"Применить фильтры",autocompleteOptionsFound_few:"Найдены {{count}} автозаполняющие опции {{label}}.",autocompleteOptionsFound_many:"Найдено {{count}} автозаполняющих опций {{label}}.",autocompleteOptionsFound_one:"Найдена {{count}} автозаполняющая опция {{label}}.",autocompleteOptionsFound_other:"Найдено {{count}} автозаполняющих опций {{label}}.",autocompleteSuggestion:"Подсказка автозаполнения: {{suggestion}}",autocompleteSuggestionsFound_few:"Найдены {{count}} подсказки автозаполнения.",autocompleteSuggestionsFound_many:"Найдено {{count}} подсказок автозаполнения.",autocompleteSuggestionsFound_one:"Найдена {{count}} подсказка автозаполнения.",autocompleteSuggestionsFound_other:"Найдено {{count}} подсказок автозаполнения.",basedOnYourDevice:" (на основе вашего устройства)",basedOnYourInternetAddress:" (на основе вашего интернет-адреса)",categoriesText_few:"В категориях — <strong>{{query}}</strong> найдены результаты",categoriesText_many:"В категориях — <strong>{{query}}</strong> найдено результатов",categoriesText_one:"В категории — <strong>{{query}}</strong> найден результат",categoriesText_other:"В категориях — <strong>{{query}}</strong> найдено результатов",clearAll:"Очистить всё",clearMinAn
120dMax:"Очистить минимальное и максимальное значения",clearTheRangeToSelectOptions:"Очистите диапазон для выбора опций.",clearTheSearchBar:"Очистить строку поиска",conductASearch:"Выполнить поиск",currentLocation:"Текущее местоположение",didYouMean:"Вы имели в виду <button>{{correctedQuery}}</button>?",dropDownScreenReaderInstructions:"Когда доступны результаты автозаполнения, используйте стрелки вверх и вниз для просмотра и Enter для выбора.",feedback:"Обратная связь",filterGroupSearchInputLabel:"Искать среди вариантов {{title}}",invalidRange:"Недопустимый диапазон",max:"Макс",min:"Мин",navigateToTheNextResultsPage:"Перейти к следующей странице результатов",navigateToThePreviousResultsPage:"Перейти к предыдущей странице результатов",noAutocompleteOptionsFound:"Автозаполняющих опций не найдено.",noAutocompleteSuggestionsFound:"Подсказок автозаполнения не найдено.",noResultsFoundIn:"Результатов не найдено в {{currentVerticalLabel}}.",paginationPage:"страница {{pageNumber}}",pagination:"Пагинация",readMoreAbout:"Подробнее о <a>{{name}}</a>",recentSearch:"недавний поиск: {{query}}",recentSearchesFound_few:"Найдены {{count}} недавних поиска.",recentSearchesFound_many:"Найдено {{count}} недавних поисков.",recentSearchesFound_one:"Найдён {{count}} недавний поиск.",recentSearchesFound_other:"Найдено {{count}} недавних поисков.",removeFilter:"Удалить фильтр «{{displayName}}»",resultPreview:"Превью результата: {{value}}",resultPreviewsFound_few:"Найдены {{count}} предварительных просмотра.",resultPreviewsFound_many:"Найдено {{count}} предварительных просмотров.",resultPreviewsFound_one:"Найдён {{count}} предварительный просмотр.",resultPreviewsFound_other:"Найдено {{count}} предварительных просмотров.",resultsCountText_few:"{{count}} результата",resultsCountText_many:"{{count}} результатов",resultsCountText_one:"{{count}} результат",resultsCountText_other:"{{count}} результата",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} из {{resultsCount}} результатов",searchHere:"Искать здесь…",showingAllInstead:"Показаны все {{currentVerticalLabel}} вместо этого.",showLess:"Показать меньше",showMore:"Показать больше",sources_few:"Источника ({{count}})",sources_many:"Источников ({{count}})",sources_one:"Источник",sources_other:"Источника ({{count}})",submitSearch:"Отправить поиск",suggestionResultsCount_few:"{{label}} - {{count}} результата",suggestionResultsCount_many:"{{label}} - {{count}} результатов",suggestionResultsCount_one:"{{label}} - {{count}} результат",suggestionResultsCount_other:"{{label}} - {{count}} результата",thankYouForYourFeedback:"Спасибо за ваш отзыв!",thisAnsweredMyQuestion:"Это ответило на мой вопрос",thisDidNotAnswerMyQuestion:"Это не ответило на мой вопрос",unselectAnOptionToEnterInARange:"Снимите выбор опции, чтобы ввести диапазон.",updateYourLocation:"Обновить ваше местоположение",useCurrentLocation:"Использовать текущее местоположение",useMyLocation:"Использовать моё местоположение",viewAll:"Показать все",viewDetails:"Просмотреть детали"}}}),t9=tP({"locales/sk/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"Odpoveď generovaná AI",allCategories:"Všetky kategórie",appliedFiltersToCurrentSearch:"Použité filtre na aktuálne vyhľadávanie",apply:"Použiť",applyFilters:"Použiť filtre",autocompleteOptionsFound_few:"Nájdené {{count}}{{label}} možnosti automatického dopĺňania.",autocompleteOptionsFound_many:"Nájdených {{count}}{{label}} možností automatického dopĺňania.",autocompleteOptionsFound_one:"Nájdená {{count}}{{label}} možnosť automatického dopĺňania.",autocompleteOptionsFound_other:"Nájdených {{count}}{{label}} možností automatického dopĺňania.",autocompleteSuggestion:"návrh automatického dopĺňania: {{suggestion}}",autocompleteSuggestionsFound_few:"Nájdené {{count}} návrhy automatického dopĺňania.",autocompleteSuggestionsFound_many:"Nájdených {{count}} návrhov automatického dopĺňania.",autocompleteSuggestionsFound_one:"Nájdený {{count}} návrh automatického dopĺňania.",autocompleteSuggestionsFound_other:"Nájdených {{count}} návrhov automatického dopĺňania.",basedOnYourDevice:" (na základe vášho zariadenia)",basedOnYourInternetAddress:" (na základe vašej internetovej adresy)",categoriesText_few:"Nasledujúce kategórie priniesli výsledky pre – <strong>{{query}}</strong>",categoriesText_one:"Nasledujúca kategória priniesla výsledky pre – <strong>{{query}}</strong>",categoriesText_other:"Nasledujúcych kategórií prinieslo výsledky pre – <strong>{{query}}</strong>
120",clearAll:"Vymazať všetko",clearMinAndMax:"Vymazať min a max",clearTheRangeToSelectOptions:"Vymazať rozsah na výber možností.",clearTheSearchBar:"Vymazať vyhľadávací panel",conductASearch:"Vykonať vyhľadávanie",currentLocation:"Aktuálna poloha",didYouMean:"Mali ste na mysli <button>{{correctedQuery}}</button>?",dropDownScreenReaderInstructions:"Keď sú k dispozícii výsledky automatického dokončenia, použite šípky nahor a nadol na preskúmanie a enter na výber.",feedback:"Spätná väzba",filterGroupSearchInputLabel:"Hľadať možnosti {{title}}",invalidRange:"Neplatný rozsah",max:"Max",min:"Min",navigateToTheNextResultsPage:"Prejsť na ďalšiu stránku výsledkov",navigateToThePreviousResultsPage:"Prejsť na predchádzajúcu stránku výsledkov",noAutocompleteOptionsFound:"0 nájdených možností automatického dokončenia.",noAutocompleteSuggestionsFound:"0 nájdených návrhov automatického dokončenia.",noResultsFoundIn:"Nenašli sa žiadne výsledky v {{currentVerticalLabel}}.",paginationPage:"strana {{pageNumber}}",pagination:"Stránkovanie",readMoreAbout:"Čítať viac o <a>{{name}}</a>",recentSearch:"nedávne vyhľadávanie: {{query}}",recentSearchesFound_few:"Nájdené {{count}} nedávne vyhľadávania.",recentSearchesFound_many:"Nájdených {{count}} nedávnych vyhľadávaní.",recentSearchesFound_one:"Nájdené {{count}} nedávne vyhľadávanie.",recentSearchesFound_other:"Nájdených {{count}} nedávnych vyhľadávaní.",removeFilter:"Odstrániť filter „{{displayName}}“",resultPreview:"výsledkový náhľad: {{value}}",resultPreviewsFound_few:"Nájdené {{count}} náhľady výsledkov.",resultPreviewsFound_many:"Nájdených {{count}} náhľadov výsledkov.",resultPreviewsFound_one:"Nájdený {{count}} náhľad výsledku.",resultPreviewsFound_other:"Nájdených {{count}} náhľadov výsledkov.",resultsCountText_few:"{{count}} výsledky",resultsCountText_many:"{{count}} výsledkov",resultsCountText_one:"{{count}} výsledok",resultsCountText_other:"{{count}} výsledkov",resultsCountWithPaginationText:"{{paginateStart}}–{{paginateEnd}} z {{resultsCount}} výsledkov",searchHere:"Vyhľadajte tu…",showingAllInstead:"Zobrazujú sa všetky položky v {{currentVerticalLabel}}.",showLess:"Zobraziť menej",showMore:"Zobraziť viac",sources_few:"Zdroje ({{count}})",sources_many:"Zdroje ({{count}})",sources_one:"Zdroj",sources_other:"Zdroje ({{count}})",submitSearch:"Odovzdať",suggestionResultsCount_few:"{{label}} – {{count}} výsledky",suggestionResultsCount_many:"{{label}} – {{count}} výsledkov",suggestionResultsCount_one:"{{label}} – {{count}} výsledok",suggestionResultsCount_other:"{{label}} – {{count}} výsledkov",thankYouForYourFeedback:"Ďakujeme za vašu spätnú väzbu!",thisAnsweredMyQuestion:"Toto odpovedalo na moju otázku",thisDidNotAnswerMyQuestion:"Toto neodpovedalo na moju otázku",unselectAnOptionToEnterInARange:"Zrušte výber možnosti, aby ste mohli zadať rozsah.",updateYourLocation:"Aktualizujte svoju polohu",useCurrentLocation:"Použiť aktuálnu polohu",useMyLocation:"Použiť moju polohu",viewAll:"Zobraziť všetko",viewDetails:"Zobraziť podrobnosti"}}}),t3=tP({"locales/sv/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI-genererat svar",allCategories:"Alla kategorier",appliedFiltersToCurrentSearch:"Tillämpade filter för aktuell sökning",apply:"Tillämpa",applyFilters:"Tillämpa filter",autocompleteOptionsFound_one:"{{count}}{{label}} autofyllningsval hittades.",autocompleteOptionsFound_other:"{{count}}{{label}} autofyllningsval hittades.",autocompleteSuggestion:"autofyllningsförslag: {{suggestion}}",autocompleteSuggestionsFound_one:"{{count}} autofyllningsförslag hittades.",autocompleteSuggestionsFound_other:"{{count}} autofyllningsförslag hittades.",basedOnYourDevice:" (baserat på din enhet)",basedOnYourInternetAddress:" (baserat på din internetadress)",categoriesText_one:"Följande kategori gav resultat för – <strong>{{query}}</strong>",categoriesText_other:"Följande kategorier gav resultat för – <strong>{{query}}</strong>
120",clearAll:"Rensa allt",clearMinAndMax:"Rensa min och max",clearTheRangeToSelectOptions:"Rensa intervallet för att välja alternativ.",clearTheSearchBar:"Rensa sökfältet",conductASearch:"Utför en sökning",currentLocation:"Aktuell plats",didYouMean:"Menade du <button>{{correctedQuery}}</button>?",dropDownScreenReaderInstructions:"När autofyllningsresultat är tillgängliga, använd upp- och nedpilar för att bläddra och enter för att välja.",feedback:"Feedback",filterGroupSearchInputLabel:"Sök bland alternativ för {{title}}",invalidRange:"Ogiltigt intervall",max:"Max",min:"Min",navigateToTheNextResultsPage:"Gå till nästa resultatsida",navigateToThePreviousResultsPage:"Gå till föregående resultatsida",noAutocompleteOptionsFound:"0 autofyllningsval hittades.",noAutocompleteSuggestionsFound:"0 autofyllningsförslag hittades.",noResultsFoundIn:"Inga resultat hittades i {{currentVerticalLabel}}.",paginationPage:"sida {{pageNumber}}",pagination:"Pagination",readMoreAbout:"Läs mer om <a>{{name}}</a>",recentSearch:"senaste sökningen: {{query}}",recentSearchesFound_one:"{{count}} senaste sökning hittades.",recentSearchesFound_other:"{{count}} senaste sökningar hittades.",removeFilter:'Ta bort filtret "{{displayName}}"',resultPreview:"resultatförhandsgranskning: {{value}}",resultPreviewsFound_one:"{{count}} förhandsgranskning hittades.",resultPreviewsFound_other:"{{count}} förhandsgranskningar hittades.",resultsCountText_one:"{{count}} resultat",resultsCountText_other:"{{count}} resultat",resultsCountWithPaginationText:"{{paginateStart}}–{{paginateEnd}} av {{resultsCount}} resultat",searchHere:"Sök här…",showingAllInstead:"Visar alla {{currentVerticalLabel}} i stället.",showLess:"Visa mindre",showMore:"Visa mer",sources_one:"Källa",sources_other:"Källor ({{count}})",submitSearch:"Skicka sökning",suggestionResultsCount_one:"{{label}} – {{count}} resultat",suggestionResultsCount_other:"{{label}} – {{count}} resultat",thankYouForYourFeedback:"Tack för din feedback!",thisAnsweredMyQuestion:"Detta besvarade min fråga",thisDidNotAnswerMyQuestion:"Detta besvarade inte min fråga",unselectAnOptionToEnterInARange:"Avmarkera ett alternativ för att ange ett intervall.",updateYourLocation:"Uppdatera din plats",useCurrentLocation:"Använd aktuell plats",useMyLocation:"Använd min plats",viewAll:"Visa alla",viewDetails:"Visa detaljer"}}}),t8=tP({"locales/tr/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"Yapay Zekâ Tarafından Oluşturulan Yanıt",allCategories:"Tüm Kategoriler",appliedFiltersToCurrentSearch:"Mevcut aramaya uygulanan filtreler",apply:"Uygula",applyFilters:"Filtreleri Uygula",autocompleteOptionsFound_one:"{{count}}{{label}} tamamlayıcı seçenek bulundu.",autocompleteOptionsFound_other:"{{count}}{{label}} tamamlayıcı seçenekler bulundu.",autocompleteSuggestion:"tamamlayıcı öneri: {{suggestion}}",autocompleteSuggestionsFound_one:"{{count}} tamamlayıcı öneri bulundu.",autocompleteSuggestionsFound_other:"{{count}} tamamlayıcı öneri bulundu.",basedOnYourDevice:" (cihazınıza göre)",basedOnYourInternetAddress:" (internet adresinize göre)",categoriesText_other:"Aşağıdaki kategoriler için sonuçlar bulundu – <strong>{{query}}</strong>",clearAll:"Tümünü Temizle",clearMinAndMax:"Min ve maks değerleri temizle",clearTheRangeToSelectOptions:"Seçenekleri seçmek için aralığı temizle.",clearTheSearchBar:"Arama çubuğunu temizle",conductASearch:"Arama yap",currentLocation:"Mevcut Konum",didYouMean:"Demek istediniz mi <button>{{correctedQuery}}</button>",dropDownScreenReaderInstructions:"Tamamlayıcı sonuçlar mevcut olduğunda, yukarı/aşağı okları kullanarak gezinip enter ile seçin.",feedback:"Geri bildirim",filterGroupSearchInputLabel:"{{title}} seçeneklerinde ara",invalidRange:"Geçersiz aralık",max:"Maks",min:"Min",navigateToTheNextResultsPage:"Sonraki sonuç sayfasına git",navigateToThePreviousResultsPage:"Önceki sonuç sayfasına git",noAutocompleteOptionsFound:"0 tamamlayıcı seçenek bulundu.",noAutocompleteSuggestionsFound:"0 tamamlayıcı öneri bulundu.",noResultsFoundIn:"{{currentVerticalLabel}} içinde sonuç bulunamadı.",paginationPage:"sayfa {{pageNumber}}",pagination:"Sayfalandırma",readMoreAbout:"<a>{{name}}</a> hakkında daha fazla oku",recentSearch:"son arama: {{query}}",recentSearchesFound_one:"{{count}} son arama bulundu.",recentSearchesFound_other:"{{count}} son arama bulundu.",removeFilter:"“{{displayName}}” filtresini kaldır",resultPreview:"sonuç önizlemesi: {{value}}",resultPreviewsFound_one:"{{count}} sonuç önizlemesi bulundu.",resultPreviewsFound_other:"{{count}} yakın zamanda önizleme bulundu.",resultsCountText_one:"{{count}} Sonuç",resultsCountText_other:"{{count}} Sonuç",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} toplam {{resultsCount}} sonuç",searchHere:"Burada ara…",showingAllInstead:"Bunun yerine tüm {{currentVerticalLabel}} gösteriliyor.",showLess:"Daha az göster",showMore:"Daha fazla göster",sources_one:"Kaynak",sources_other:"Kaynaklar ({{count}})",submitSearch:"Aramayı Gönder",suggestionResultsCount_one:"{{label}}
120 - {{count}} sonuç",suggestionResultsCount_other:"{{label}} - {{count}} sonuç",thankYouForYourFeedback:"Geri bildiriminiz için teşekkürler!",thisAnsweredMyQuestion:"Bu sorumu yanıtladı",thisDidNotAnswerMyQuestion:"Bu sorumu yanıtlamadı",unselectAnOptionToEnterInARange:"Aralık girmek için bir seçeneğin seçimini kaldırın.",updateYourLocation:"Konumunuzu güncelleyin",useCurrentLocation:"Mevcut Konumu Kullan",useMyLocation:"Konumumu kullan",viewAll:"Tümünü Gör",viewDetails:"Detayları Görüntüle"}}}),t6=tP({"locales/vi/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"Trả lời do AI tạo",allCategories:"Tất cả danh mục",appliedFiltersToCurrentSearch:"Bộ lọc được áp dụng cho tìm kiếm hiện tại",apply:"Áp dụng",applyFilters:"Áp dụng bộ lọc",autocompleteOptionsFound_other:"Đã tìm thấy {{count}} tùy chọn tự động hoàn thành{{label}}.",autocompleteSuggestion:"đề xuất tự động hoàn thành: {{suggestion}}",autocompleteSuggestionsFound_other:"Đã tìm thấy {{count}} đề xuất tự động hoàn thành.",basedOnYourDevice:" (dựa trên thiết bị của bạn)",basedOnYourInternetAddress:" (dựa trên địa chỉ internet của bạn)",categoriesText_other:"Các danh mục sau có kết quả cho – <strong>{{query}}</strong>",clearAll:"Xóa tất cả",clearMinAndMax:"Xóa giá trị tối thiểu và tối đa",clearTheRangeToSelectOptions:"Xóa phạm vi để chọn các tùy chọn.",clearTheSearchBar:"Xóa thanh tìm kiếm",conductASearch:"Tiến hành tìm kiếm",currentLocation:"Vị trí hiện tại",didYouMean:"Ý bạn là <button>{{correctedQuery}}</button> phải không",dropDownScreenReaderInstructions:"Khi có kết quả tự động hoàn thành, dùng phím mũi lên/xuống để duyệt và Enter để chọn.",feedback:"Phản hồi",filterGroupSearchInputLabel:"Tìm kiếm trong các tùy chọn {{title}}",invalidRange:"Phạm vi không hợp lệ",max:"Tối đa",min:"Tối thiểu",navigateToTheNextResultsPage:"Điều hướng đến trang kết quả tiếp theo",navigateToThePreviousResultsPage:"Điều hướng đến trang kết quả trước đó",noAutocompleteOptionsFound:"0 tùy chọn tự động hoàn thành được tìm thấy.",noAutocompleteSuggestionsFound:"0 đề xuất tự động hoàn thành được tìm thấy.",noResultsFoundIn:"Không tìm thấy kết quả trong {{currentVerticalLabel}}.",paginationPage:"trang {{pageNumber}}",pagination:"Phân trang",readMoreAbout:"Tìm hiểu thêm về <a>{{name}}</a>",recentSearch:"Tìm kiếm gần đây: {{query}}",recentSearchesFound_other:"Đã tìm thấy {{count}} lượt tìm kiếm gần đây.",removeFilter:"Xóa bộ lọc “{{displayName}}”",resultPreview:"Xem trước kết quả: {{value}}",resultPreviewsFound_other:"Đã tìm thấy {{count}} bản xem trước kết quả.",resultsCountText_other:"{{count}} kết quả",resultsCountWithPaginationText:"{{paginateStart}}–{{paginateEnd}} trên tổng {{resultsCount}} kết quả",searchHere:"Tìm kiếm ở đây…",showingAllInstead:"Hiển thị tất cả {{currentVerticalLabel}} thay vào đó.",showLess:"Ẩn bớt",showMore:"Xem thêm",sources_other:"Nguồn ({{count}})",submitSearch:"Gửi tìm kiếm",suggestionResultsCount_other:"{{label}} – {{count}} kết quả",thankYouForYourFeedback:"Cảm ơn bạn đã phản hồi!",thisAnsweredMyQuestion:"Điều này đã trả lời câu hỏi của tôi",thisDidNotAnswerMyQuestion:"Điều này không trả lời câu hỏi của tôi",unselectAnOptionToEnterInARange:"Bỏ chọn một tùy chọn để nhập khoảng giá trị.",updateYourLocation:"Cập nhật vị trí của bạn",useCurrentLocation:"Dùng vị trí hiện tại",useMyLocation:"Dùng vị trí của tôi",viewAll:"Xem tất cả",viewDetails:"Xem chi tiết"}}}),t7=tP({"locales/zh-CN/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI 生成的答案",allCategories:"所有类别",appliedFiltersToCurrentSearch:"已应用于当前搜索的筛选条件",apply:"应用",applyFilters:"应用筛选条件",autocompleteOptionsFound_other:"找到 {{count}} 个{{label}}自动完成选项。",autocompleteSuggestion:"自动完成建议:{{suggestion}}",autocompleteSuggestionsFound_other:"找到 {{count}} 个自动完成建议。",basedOnYourDevice:"(基于您的设备)",basedOnYourInternetAddress:"(基于您的 IP 地址)",categoriesText_other:"以下分类包含与<strong>{{query}}</strong>
120相关的结果",clearAll:"清除全部",clearMinAndMax:"清除最小值和最大值",clearTheRangeToSelectOptions:"清除以选择选项的范围。",clearTheSearchBar:"清除搜索栏",conductASearch:"进行搜索",currentLocation:"当前位置",didYouMean:"您的意思是 <button>{{correctedQuery}}</button> 吗",dropDownScreenReaderInstructions:"当有自动完成结果时,使用上下箭头浏览,按回车键选择。",feedback:"反馈",filterGroupSearchInputLabel:"搜索{{title}}选项",invalidRange:"无效范围",max:"最大",min:"最小",navigateToTheNextResultsPage:"导航到下一个结果页面",navigateToThePreviousResultsPage:"导航到上一个结果页面",noAutocompleteOptionsFound:"0已找到自动完成选项。",noAutocompleteSuggestionsFound:"0发现自动完成建议。",noResultsFoundIn:"在{{currentVerticalLabel}}中未找到结果。",paginationPage:"第 {{pageNumber}} 页",pagination:"分页",readMoreAbout:"阅读关于<a>{{name}}</a>的更多内容",recentSearch:"最近的搜索:{{query}}",recentSearchesFound_other:"找到 {{count}} 个最近的搜索记录。",removeFilter:"移除“{{displayName}}”筛选器",resultPreview:"结果预览:{{value}}",resultPreviewsFound_other:"找到 {{count}} 个结果预览。",resultsCountText_other:"{{count}} 条结果",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} / 共 {{resultsCount}} 个结果",searchHere:"在此搜索…",showingAllInstead:"正在显示所有{{currentVerticalLabel}}。",showLess:"收起",showMore:"查看更多",sources_other:"来源({{count}})",submitSearch:"提交搜索",suggestionResultsCount_other:"{{label}} – {{count}} 个结果",thankYouForYourFeedback:"感谢您的反馈!",thisAnsweredMyQuestion:"这个回答了我的问题",thisDidNotAnswerMyQuestion:"这个没有回答我的问题",unselectAnOptionToEnterInARange:"取消选择某个选项以输入范围。",updateYourLocation:"更新您的位置",useCurrentLocation:"使用当前位置",useMyLocation:"使用我的位置",viewAll:"查看全部",viewDetails:"查看详细信息"}}}),ie=tP({"locales/zh-TW/search-ui-react.json"(i,r){r.exports={aiGeneratedAnswer:"AI 產生的答案",allCategories:"所有分類",appliedFiltersToCurrentSearch:"已套用至目前搜尋的篩選器",apply:"套用",applyFilters:"套用篩選器",autocompleteOptionsFound_other:"找到 {{count}} 個{{label}}自動完成選項。",autocompleteSuggestion:"自動完成建議:{{suggestion}}",autocompleteSuggestionsFound_other:"找到 {{count}} 個自動完成建議。",basedOnYourDevice:"(依據您的裝置)",basedOnYourInternetAddress:"(依據您的網際網路位址)",categoriesText_other:"以下分類包含與<strong>{{query}}</strong>相關的結果",clearAll:"清除全部",clearMinAndMax:"清除最小值與最大值",clearTheRangeToSelectOptions:"清除範圍以選擇選項。",clearTheSearchBar:"清除搜尋欄",conductASearch:"進行搜尋",currentLocation:"目前位置",didYouMean:"您的意思是 <button>{{correctedQuery}}</button> 嗎",dropDownScreenReaderInstructions:"有自動完成結果時,請使用上下鍵瀏覽並按 Enter 鍵選取。",feedback:"回饋",filterGroupSearchInputLabel:"搜尋{{title}}選項",invalidRange:"無效範圍",max:"最大",min:"最小",navigateToTheNextResultsPage:"前往下一頁結果",navigateToThePreviousResultsPage:"前往上一頁結果",noAutocompleteOptionsFound:"未找到自動完成選項。",noAutocompleteSuggestionsFound:"未找到自動完成建議。",noResultsFoundIn:"在{{currentVerticalLabel}}中找不到結果。",paginationPage:"第 {{pageNumber}} 頁",pagination:"分頁",readMoreAbout:"閱讀更多關於<a>{{name}}</a>的資訊",recentSearch:"最近搜尋:{{query}}",recentSearchesFound_other:"找到 {{count}} 筆最近搜尋。",removeFilter:"移除「{{displayName}}」篩選器",resultPreview:"結果預覽:{{value}}",resultPreviewsFound_other:"找到 {{count}} 筆結果預覽。",resultsCountText_other:"{{count}} 筆結果",resultsCountWithPaginationText:"{{paginateStart}} - {{paginateEnd}} / 共 {{resultsCount}} 筆結果",searchHere:"請在此搜尋…",showingAllInstead:"顯示所有 {{currentVerticalLabel}}。",showLess:"顯示較少",showMore:"顯示更多",sources_other:"來源({{count}})",submitSearch:"提交搜尋",suggestionResultsCount_other:"{{label}} – {{count}} 筆結果",thankYouForYourFeedback:"感謝您的意見回饋!",thisAnsweredMyQuestion:"這有回答到我的問題",thisDidNotAnswerMyQuestion:"這沒有回答到我的問題",unselectAnOptionToEnterInARange:"取消選擇一個選項以輸入範圍。",updateYourLocation:"更新您的位置",useCurrentLocation:"使用目前位置",useMyLocation:"使用我的位置",viewAll:"查看全部",viewDetails:"查看詳細資料"}}}),it=tP({"src/utils/supportedLocales.ts"(i,r){r.exports={supportedLocales:["ar","cs","da","de","el","en-GB","en","es","et","fi","fr","hi","hr","hu","it","ja","ko","lt","lv","nb","nl","pl","pt","ro","ru","sk","sv","tr","vi","zh-CN","zh-TW"]}}});function ii(){let i=(0,p.useRef)(!1);return(0,p.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]),i}function ir(i,r){let n=(0,p.useRef)(void 0),a=(0,p.useRef)(i);(0,p.useEffect)(()=>{a.current=i},[i]);let o=(0,p.useCallback)((...i)=>new Promise(o=>{void 0!==n.current&&clearTimeout(n.current),n.current=window.setTimeout(()=>
120{o(a.current?.(...i)),n.current=void 0},r)}),[r]);return i?o:void 0}async function ia(i){let r=i.state.meta.searchType===k.SearchTypeEnum.Vertical;try{r?i.executeVerticalQuery():i.executeUniversalQuery()}catch(i){console.error(`Error occured executing a ${r?"vertical":"universal"} search.
121`,i)}}async function io(i){let r=i.state.meta.searchType===k.SearchTypeEnum.Vertical;try{return r?i.executeVerticalAutocomplete():i.executeUniversalAutocomplete()}catch(i){console.error(`Error occured executing a ${r?"vertical":"universal"} autocomplete search.
122`,i)}}var is={enableHighAccuracy:!1,timeout:6e3,maximumAge:3e5};async function il(i,r,n){if(r.includes(l.NearMe)&&!i.state.location.userLocation)try{let r=await iu(n);i.setUserLocation({latitude:r.coords.latitude,longitude:r.coords.longitude})}catch(i){console.error(i)}}async function iu(i){return new Promise((r,n)=>{"geolocation"in navigator?navigator.geolocation.getCurrentPosition(i=>r(i),i=>{console.error("Error occured using geolocation API. Unable to determine user's location."),n(i)},{...is,...i}):n("No access to geolocation API. Unable to determine user's location.")})}function ic({className:i}){return p.default.createElement("svg",{className:i,width:"1",height:"24",viewBox:"0 0 1 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},p.default.createElement("rect",{width:"1",height:"24",rx:"0.5",fill:"#E1E5E8"}))}function id(){return p.default.createElement("svg",{viewBox:"0 0 14 15",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},p.default.createElement("path",{d:"M13.7813 7.75C13.7539 4.00391 10.7188 0.96875 7 0.96875C5.11328 0.96875 3.39063 1.76172 2.16016 2.99219L0.929688 1.76172C0.738281 1.57031 0.382813 1.70703 0.382813 2.00781L0.382813 5.45312C0.382813 5.64453 0.519531 5.78125 0.710938 5.78125L4.21094 5.78125C4.51172 5.78125 4.64844 5.42578 4.45703 5.23437L3.11719 3.92188C4.10156 2.91016 5.46875 2.28125 7 2.28125C10.0078 2.28125 12.4688 4.74219 12.4688 7.75C12.4688 10.7852 10.0078 13.2187 7 13.2188C5.57813 13.2188 4.32031 12.6992 3.33594 11.8516C3.22656 11.7422 3.00781 11.7422 2.89844 11.8516L2.43359 12.3164C2.29688 12.4531 2.29688 12.6719 2.43359 12.8086C3.63672 13.875 5.25 14.5586 7 14.5312C10.7188 14.5312 13.7813 11.4961 13.7813 7.75ZM9.1875 10.2109L9.59766 9.69141C9.67969 9.52734 9.65234 9.33594 9.51563 9.22656L7.65625 7.85937V3.92187C7.65625 3.75781 7.49219 3.59375 7.32813 3.59375H6.67188C6.48047 3.59375 6.34375 3.75781 6.34375 3.92187V8.54297L8.75 10.293C8.88672 10.4023 9.10547 10.375 9.1875 10.2109Z"}))}function ih({className:i}){return p.default.createElement("svg",{className:i,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true"},p.default.createElement("path",{d:"M10.9095 9.00028L16.6786 3.2311L17.8684 2.04138C18.0439 1.86587 18.0439 1.58067 17.8684 1.40517L16.5954 0.132192C16.4199 -0.0433137 16.1347 -0.0433137 15.9592 0.132192L9.00028 7.0911L2.04138 0.131629C1.86587 -0.0438764 1.58067 -0.0438764 1.40517 0.131629L0.131629 1.40461C-0.0438764 1.58011 -0.0438764 1.86531 0.131629 2.04081L7.0911 9.00028L0.131629 15.9592C-0.0438764 16.1347 -0.0438764 16.4199 0.131629 16.5954L1.40461 17.8684C1.58011 18.0439 1.86531 18.0439 2.04081 17.8684L9.00028 10.9095L14.7695 16.6786L15.9592 17.8684C16.1347 18.0439 16.4199 18.0439 16.5954 17.8684L17.8684 16.5954C18.0439 16.4199 18.0439 16.1347 17.8684 15.9592L10.9095 9.00028Z",fill:"#6b7280"}))}function ip(){return p.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p.default.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),p.default.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))}var im=(0,p.createContext)(null);function ig(){let i=(0,p.useContext)(im);if(null===i)throw Error("Tried to use DropdownContext when none exists.");return i}var i_=(0,p.createContext)(null);function iy(){let i=(0,p.useContext)(i_);if(null===i)throw Error("Tried to use InputContext when none exists.");return i}var iv=(0,p.createContext)(null);function ix(){let i=(0,p.useContext)(iv);if(null===i)throw Error("Tried to use FocusContext when none exists.");return i}function ib({instructionsId:i,instructions:r,announcementKey:n,announcementText:a}){return p.default.createElement(p.default.Fragment,null,p.default.createElement("div",{id:i,className:"sr-only"},r),p.default.createElement("div",{className:"sr-only",key:n,"aria-live":"polite","aria-atomic":"true"},a))}function iw(i,r){return p.Children.map(i,(i,n)=>{if(!(0,p.isValidElement)(i))return i;let a=r(i,n);if(!a||!(0,p.isValidElement)(a)||!("props"in a))return a;let o=a.props.children;if(!o)return a;let s=iw(o,r);return(0,p.cloneElement)(a,{},[s])})}function iT(i,r){return i?i+"_"+r:""}var iE=function(i){for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];
122return"function"==typeof i?ee.apply(void 0,[eC,i].concat(n)):ee.apply(void 0,[function(){var r=eC();for(var n in i)!function i(r,n,a){if(!eI.call(r,n)||ek.has(typeof a)||null===a){r[n]=a;return}if(Array.isArray(a)&&Array.isArray(r[n])){r[n]=r[n].concat(a);return}if("object"==typeof a&&"object"==typeof r[n]){if(null===r[n]){r[n]=a;return}for(var o in a)i(r[n],o,a[o])}}(r,n,i[n]);return r}].concat(n))}({classGroups:{form:["input","checkbox","textarea","select","multiselect","radio"].map(i=>"form-"+i)}});function iS(i,r,n=!1){return(0,p.useMemo)(()=>{if(n&&r)return r;let a={...i};return r&&Object.keys(r).forEach(n=>{let o=i[n],s=r[n];o&&s?a[n]=iE(o,s):a[n]=s||o}),a},[i,r,n])}function iA(i){return null}function iC(i){let{children:r,value:n,index:a,className:o,focusedClassName:s,itemData:l,onClick:u,ariaLabel:c}=i,{toggleDropdown:d,onSelect:h,screenReaderUUID:f}=ig(),{focusedIndex:m,updateFocusedItem:g}=ix(),{setValue:_,setLastTypedOrSubmittedValue:y}=iy(),v=m===a,x=(0,p.useCallback)(()=>{d(!1),g(-1),y(n),_(n),h?.(n,a,l),u?.(n,a,l)},[a,l,u,h,y,_,d,g,n]),b=iE("bg-transparent border-0 p-0 m-0 font-inherit text-inherit text-left cursor-pointer w-full self-stretch box-border",v?s??"":o??"");return p.default.createElement("button",{id:iT(f,a),type:"button",tabIndex:-1,className:b,onClick:x,"aria-label":"function"==typeof c?c(n):c,role:"option","aria-selected":v},r)}var iI="function"==typeof eR?eR:eR.default,ik=!1,iR=0;function iM(i){return++iR,i+"-"+iR.toString()}var iL=p.default["useId".toString()];function iP(i){let r=iL?.(),n=ik?iM(i):"",[a,o]=(0,p.useState)(n);return iI(()=>{""===a&&o(iM(i))},[i,a]),(0,p.useEffect)(()=>{!1===ik&&(ik=!0)},[]),r??a}var iO=function(i,r,{disabled:n,clickTrigger:a}={}){let o=r||Z;Y(i,o,{disabled:n,clickTrigger:a});let s=V(i=>{("Escape"===i.code||27===i.keyCode)&&o(i)});(0,p.useEffect)(()=>{if(n||null==i)return;let r=B($(i)),a=(r.defaultView||window).event,o=z(r,"keyup",i=>{if(i===a){a=void 0;return}s(i)});return()=>{o()}},[i,n,s])};function iD(i){let{t:r}=C(),{children:n,screenReaderText:a,screenReaderInstructions:o,onSelect:s,onToggle:l,className:u,activeClassName:c,parentQuery:d,alwaysSelectOption:h=!1}=i,f=(0,p.useRef)(null),m=iP("dropdown"),g=iP("dropdown-list"),[_,y]=(0,p.useState)(0),[v,x]=(0,p.useState)(!1),[b,w]=(0,p.useMemo)(()=>{let i;return i=[],[iw(n,r=>{if(!((0,p.isValidElement)(r)&&r.type===iA))return r;let n=r.props;return i.push({value:n.value,itemData:n.itemData}),(0,p.createElement)(iC,{...n,index:i.length-1})}),i]},[n]),T=function(){let[i,r]=(0,p.useState)(""),[n,a]=(0,p.useState)("");return{value:i,setValue:r,lastTypedOrSubmittedValue:n,setLastTypedOrSubmittedValue:a}}(),{value:E,setValue:S,lastTypedOrSubmittedValue:A,setLastTypedOrSubmittedValue:I}=T,k=function(i,r,n,a,o){let[s,l]=(0,p.useState)(-1),[u,c]=(0,p.useState)(null),[d,h]=(0,p.useState)(void 0);return(0,p.useEffect)(()=>{if(o)if(i.length>0){let r=-1===s||s>=i.length?0:s;l(r),c(i[r].value),h(i[r].itemData)}else l(-1),c(null),h(void 0)},[o,s,i]),{focusedIndex:s,focusedValue:u,focusedItemData:d,updateFocusedItem:function(s,u){let d,f=i.length;if(-1===s||s>=f||0===f)d=u??r,o&&0!==f?(l(0),h(i[0].itemData),a(i=>i+1)):(l(-1),h(void 0),a(i=>i+1));else if(s<-1){let r=(f+s+1)%f;d=u??i[r].value,l(r),h(i[r].itemData)}else d=u??i[s].value,l(s),h(i[s].itemData);c(d),n(o?u??r:d)}}}(w,A,S,y,h),{focusedIndex:R,focusedItemData:M,updateFocusedItem:L}=k,P=function(i,r,n,a,o,s,l,u,c){let[d,h]=(0,p.useState)(!1);return{isActive:d,toggleDropdown:o=>{o||l(!1),h(o),u?.(o,i,r,n,a)},onSelect:c,screenReaderUUID:o,dropdownListUUID:s}}(A,E,R,M,m,g,x,l,s),{toggleDropdown:O,isActive:D}=P;return iI(()=>{void 0!==d&&d!==A&&(I(d),L(-1,d))},[d,A,L,I]),iO(f,()=>{O(!1)},{disabled:!D}),p.default.createElement("div",{ref:f,className:D?c:u,onKeyDown:function(i){D&&(("ArrowDown"===i.key||"ArrowUp"===i.key)&&i.preventDefault(),"ArrowDown"===i.key?h&&R===w.length-1?L(0):L(R+1):"ArrowUp"===i.key?h&&0===R?L(w.length-1):L(R-1):"Tab"!==i.key||i.shiftKey?v||x(!0):(L(-1),O(!1)))}},p.default.createElement(im.Provider,{value:P},p.default.createElement(i_.Provider,{value:T},p.default.createElement(iv.Provider,{value:k},b))),p.default.createElement(ib,{announcementKey:_,announcementText:D&&(v||w.length||E)?a:"",instructionsId:m,instructions:o??r("dropDownScreenReaderInstructions")}))}function iF(i){let{className:r,placeholder:n,inputId:a,ariaLabel:o,ariaLabelledBy:s,ariaDescribedBy:l,onSubmit:u,onFocus:c,onChange:d,submitCriteria:h}=i,f=(0,p.useRef)(null),{toggleDropdown:m,onSelect:g,screenReaderUUID:_,dropdownListUUID:y,isActive:v}=ig(),{value:x="",setLastTypedOrSubmittedValue:b}=iy(),{focusedIndex:w=-1,focusedItemData:T,focusedValue:E,updateFocusedItem:S}
122=ix(),[A,C]=(0,p.useState)(!0),I=[_,l].filter(Boolean).join(" ")||void 0,k=(0,p.useCallback)(i=>{C(!0),m(!0),d?.(i.target.value),S(-1,i.target.value),b(i.target.value)},[d,b,m,S]),R=(0,p.useCallback)(i=>{("ArrowDown"===i.key||"ArrowUp"===i.key||"Tab"===i.key)&&C(!1),"Enter"===i.key&&(!h||h(w))&&(S(w),m(!1),f.current?.blur(),u?.(x,w,T),w>=0&&g?.(x,w,T),S(-1,E??void 0))},[w,E,T,g,u,h,m,S,x]),M=(0,p.useCallback)(()=>{m(!0),S(-1),c?.(x)},[c,m,S,x]);return p.default.createElement("input",{ref:f,className:r,placeholder:n,value:x,onChange:k,onKeyDown:R,onFocus:M,id:a??iT(_,-1),autoComplete:"off","aria-describedby":I,"aria-activedescendant":A?void 0:iT(_,w),"aria-label":s?void 0:o,"aria-labelledby":s,"aria-autocomplete":"list",role:"combobox","aria-controls":y,"aria-expanded":v?"true":"false","aria-haspopup":"listbox"})}function iN({children:i,className:r}){let{isActive:n,dropdownListUUID:a}=ig();return n?p.default.createElement("div",{id:a,className:r,role:"listbox"},i):null}function ij({handleClick:i,className:r}){let{t:n}=C();return p.default.createElement("button",{className:r,onClick:i,"aria-label":n("submitSearch")},p.default.createElement(ip,null))}var iz={highlighted:"font-normal",nonHighlighted:"font-semibold"};function iB(i,r){let{value:n="",matchedSubstrings:a}="string"==typeof i?{value:i,matchedSubstrings:[]}:i,o={...iz,...r};if(!a||0===a.length)return p.default.createElement("span",null,n);let s=[...a];s.sort((i,r)=>i.offset-r.offset);let l=[],u=0;for(let{offset:i,length:r}of s)i>u&&l.push(p.default.createElement("span",{key:u,className:o.nonHighlighted},n.substring(u,i))),l.push(p.default.createElement("span",{key:i,className:o.highlighted},n.substring(i,i+r))),u=i+r;return u<n.length&&l.push(p.default.createElement("span",{key:u,className:o.nonHighlighted},n.substring(u))),p.default.createElement(p.default.Fragment,null,l)}function iU(i,r={},n){return p.default.createElement(p.default.Fragment,null,n&&p.default.createElement("div",{className:r.icon},p.default.createElement(n,null)),p.default.createElement("div",{className:r.option},iB(i,r)))}var iV=(0,p.createContext)(null);function iH(){return(0,p.useContext)(iV)}var iG={searchBarContainer:"h-12 mb-6",inputDivider:"border-t border-gray-200 mx-2.5",inputElement:"outline-none flex-grow border-none h-11 pl-5 pr-2 text-neutral-dark text-base placeholder:text-neutral-light",searchButtonContainer:" w-8 h-full mx-2 flex flex-col justify-center items-center",searchButton:"h-7 w-7",focusedOption:"bg-gray-100",clearButton:"h-3 w-3 mr-3.5",verticalDivider:"mr-0.5",recentSearchesIcon:"w-5 mr-1 flex-shrink-0 h-full text-gray-400",recentSearchesOption:"whitespace-no-wrap max-w-full px-3 text-neutral-dark truncate",recentSearchesNonHighlighted:"font-normal",verticalLink:"ml-12 pl-1 text-neutral italic",entityPreviewsDivider:"h-px bg-gray-200 mt-1 mb-4 mx-3.5",option:"whitespace-no-wrap max-w-full px-3 text-neutral-dark truncate",icon:"w-6 h-full flex-shrink-0 text-gray-400"};function iq({placeholder:i,geolocationOptions:r,hideRecentSearches:n,visualAutocompleteConfig:a,showVerticalLinks:o=!1,onSelectVerticalLink:s,verticalKeyToLabel:l,recentSearchesLimit:u=5,universalAutocompleteLimit:c,verticalAutocompleteLimits:d,customCssClasses:h,onSearch:f,autocompleteDisabled:m=!1}){let g,_,y,v,x,b,w,T,E,S,A,{t:P}=C(),{entityPreviewSearcher:O,renderEntityPreviews:D,includedVerticals:F,universalLimit:N,entityPreviewsDebouncingTime:j=500}=a??{},z=(0,R.useSearchActions)(),B=(0,R.useSearchUtilities)(),U=(_=iH(),y=(0,R.useSearchState)(i=>i.vertical.verticalKey),v=(0,R.useSearchState)(i=>i.query.queryId),x=(0,R.useSearchState)(i=>i.meta.uuid),b=(0,R.useSearchState)(i=>i.meta.locale),w=(0,R.useSearchState)(i=>i.meta.experienceKey),T=(0,R.useSearchState)(i=>i.query.mostRecentSearch),i=>{_&&("AUTO_COMPLETE_SELECTION"===i?w?_?.report({action:"AUTO_COMPLETE_SELECTION",locale:b,searchId:x,queryId:v,verticalKey:y,experienceKey:w,searchTerm:T}):console.error("Unable to report an autocomplete event. Missing field: experienceKey."):w?_?.report({action:"SEARCH_CLEAR_BUTTON",locale:b,searchId:x,queryId:v,verticalKey:y,experienceKey:w,searchTerm:T}):console.error("Unable to report a search clear event. Missing field: experienceKey."))}),V=(0,R.useSearchState)(i=>i.query.input)??"",H=iS(iG,h),G=(0,R.useSearchState)(i=>i.meta.searchType)===k.SearchTypeEnum.Vertical,q=(0,R.useSearchState)(i=>i.vertical.verticalKey),$=ir(()=>io(z),200),[W,Y,Z]=function(i){let r=(0,p.useRef)(i),n=(0,p.useRef)(void 0),a=ii(),o=(0,p.useRef)({latestRequest:0,responseInState:0}),[s,l]=(0,p.useState)(),u=(0,p.useCallback)(async i=>{let s=++o.current.latestRequest;return new Promise(async u=>{let c;try{c=await r.current(i)}catch(i){n.current?n.current(i):console.error(i)}if(s>=o.current.responseInState){if(!a.current)return;l(c),o.current.responseInState=s}u(c)})},[a]),c=(0,p.useCallback)(()=>{l(void 0)},[l]);return(0,p.useEffect)(()=>{r.current=i,n.current=void 0}),[s,u,c]}(async()=>!m&&$?$():void 0),[K,X]=(E=(0,p.useRef)(void 0),S=(0,R.useSearchActions)(),[async function(){try{let i=[];if(!S.state.location.userLocation){E.current||(E.current=io(S));let n=await E.current;i=n?.inputIntents||[],await il(S,i,r)}}catch(i){console.error("Error executing autocomplete before search:",i),await il(S,[],r)}let i=S.state.vertical.verticalKey??"",n=S.state.query.input??"";f?f({verticalKey:i,query:n}):ia(S)},E]),[Q,J,ee]=function(i,r){var n;let a=(n=r)?`__yxt_recent_searches_${n}__`:"__yxt_recent_searches_universal__",[o,s]=(0,p.useState)(new L.RecentSearches({limit:i,namespace:a})),l=(0,p.useCallback)(()=>{localStorage.removeItem(a),s(new L.RecentSearches({limit:i,namespace:a})),localStorage.removeItem(a)},[a,i]),u=(0,p.useCallback)(i=>{o.setRecentSearch(i)},[o]);return(0,p.useEffect)(()=>{s(new L.RecentSearches({limit:i,namespace:a}))},[a,i]),[o?.getRecentSearches(),u,l]}(u,q),et=Q?.filter(i=>B.isCloseMatch(i.query,V));(0,p.useEffect)(()=>{n&&ee()},[ee,n]),(0,p.useEffect)(()=>{c?z.setUniversalAutocompleteLimit(c):z.setUniversalAutocompleteLimit(void 0),q&&d?.[q]?z.setVerticalAutocompleteLimit(d[q]):z.setVerticalAutocompleteLimit(void 0)},[z,c,d,q]);let ei=(0,p.useCallback)(()=>{Z(),X.current=void 0},[X,Z]),er=(0,p.useCallback)(()=>
122{if(!n){let i=z.state.query.input;i&&J(i)}K()},[z.state.query.input,K,n,J]),en=(0,p.useCallback)((i,r,n)=>{let a,o;void 0!==i&&z.setQuery(i),z.setOffset(0),z.setFacets([]),a=z.state?.filters?.static?.filter(i=>(function(i={}){var r;return i.matcher===eM.Matcher.Between&&"object"==typeof(r=i.value)&&!!r&&("start"in r||"end"in r)})(i)&&!0===i.selected&&!0),a?.forEach(i=>{z.setFilterOption({...i,selected:!1})}),n&&"object"==typeof(o=n.verticalLink)&&o&&"verticalKey"in o&&s?s({verticalLink:n.verticalLink,querySource:I.QuerySource.Autocomplete}):er(),"number"==typeof r&&r>=0&&!n?.isEntityPreview&&U("AUTO_COMPLETE_SELECTION")},[z,er,s,U]),[ea,eo]=function(i,r){let n=ii(),[a,o]=(0,p.useState)({}),s=ir(async()=>{!i||(await i.executeUniversalQuery(),n.current&&(o((i.state.universal.verticals||[]).reduce((i,r)=>(i[r.verticalKey]=r,i),{})),u(!1)))},r),[l,u]=(0,p.useState)(!1);return[{verticalKeyToResults:a,isLoading:l},function(r,n,a){i&&r!==i.state.query.input&&(u(!0),i.setQuery(r),i.setRestrictVerticals(a),i.setUniversalLimit(n),s?.())}]}(O,j),{verticalKeyToResults:es,isLoading:el}=ea,eu=(0,p.useCallback)(i=>P("resultPreview",{value:i}),[P]),ec=D?.(el,es,{onClick:en,ariaLabel:eu}),ed=(0,p.useCallback)(i=>{D&&F&&eo(i,N??{},F)},[eo,D,F,N]),eh=(0,p.useCallback)((i="")=>{z.setQuery(i),ed(i),X.current=Y()},[z,X,Y,ed]),ef=(0,p.useCallback)((i="")=>{z.setQuery(i),ed(i),X.current=Y()},[z,X,Y,ed]),ep=(0,p.useCallback)(()=>{ed(""),z.setQuery(""),U("SEARCH_CLEAR_BUTTON")},[U,z,ed]),em=(0,p.useMemo)(()=>W?.results.map(i=>i.verticalKeys?.map(r=>({verticalLink:{verticalKey:r,query:i.value}}))??[])??[],[W?.results]),eg=(g=0,iw(ec,i=>((0,p.isValidElement)(i)&&i.type===iA&&g++,i)),g),e_=ec&&!!(W?.results.length||et?.length),ey=!!(W?.results.length||et?.length||ec),ev=function(i=0,r=0,n=0,a){let o=[];r>0&&o.push(a("recentSearchesFound",{count:r})),n>0&&o.push(a("resultPreviewsFound",{count:n})),i>0&&o.push(a("autocompleteSuggestionsFound",{count:i}));let s=o.join(" ");return""===s?a("noAutocompleteSuggestionsFound"):s.trim()}(W?.results.length,et?.length,eg,P),ex=(0,M.default)("relative z-10 bg-white border rounded-3xl border-gray-200 w-full overflow-hidden",{"shadow-lg":ey}),eb=(0,p.useCallback)(i=>{i||ei()},[ei]);return p.default.createElement("div",{className:H.searchBarContainer},p.default.createElement(iD,{className:"relative bg-white border rounded-3xl border-gray-200 w-full overflow-hidden",activeClassName:ex,screenReaderText:ev,parentQuery:V,onToggle:eb},p.default.createElement("div",{className:"inline-flex items-center justify-between w-full"},p.default.createElement(iF,{className:H.inputElement,placeholder:i,onSubmit:en,onFocus:eh,onChange:ef,ariaLabel:P("conductASearch")}),V&&p.default.createElement(p.default.Fragment,null,p.default.createElement("button",{"aria-label":P("clearTheSearchBar"),className:H.clearButton,onClick:ep}
122,p.default.createElement(ih,null)),p.default.createElement(ic,{className:H.verticalDivider})),p.default.createElement(iW,{handleSubmit:en,cssClasses:H})),ey&&p.default.createElement(i$,{cssClasses:H},(A={icon:H.recentSearchesIcon,option:H.recentSearchesOption,nonHighlighted:H.recentSearchesNonHighlighted},et?.map((i,r)=>p.default.createElement(iA,{className:"flex items-center h-6.5 px-3.5 py-1.5 cursor-pointer hover:bg-gray-100",focusedClassName:iE("flex items-center h-6.5 px-3.5 py-1.5 cursor-pointer hover:bg-gray-100",H.focusedOption),key:r,value:i.query,onClick:en,ariaLabel:P("recentSearch",{query:i.query})},iU({value:i.query,inputIntents:[]},A,id)))),W?.results.map((i,r)=>p.default.createElement(p.Fragment,{key:r},p.default.createElement(iA,{className:"flex items-stretch py-1.5 px-3.5 cursor-pointer hover:bg-gray-100",focusedClassName:iE("flex items-stretch py-1.5 px-3.5 cursor-pointer hover:bg-gray-100",H.focusedOption),value:i.value,onClick:en,ariaLabel:P("autocompleteSuggestion",{suggestion:i.value})},iU(i,H,ip)),o&&!G&&i.verticalKeys?.map((n,a)=>p.default.createElement(iA,{key:a,className:"flex items-stretch py-1.5 px-3.5 cursor-pointer hover:bg-gray-100",focusedClassName:iE("flex items-stretch py-1.5 px-3.5 cursor-pointer hover:bg-gray-100",H.focusedOption),value:i.value,itemData:em[r][a],onClick:en},iU({value:`in ${l?l(n):n}`,inputIntents:[]},{...H,option:H.verticalLink}))))),ec&&p.default.createElement("div",{role:"group"},e_&&p.default.createElement("div",{className:H.entityPreviewsDivider,"aria-hidden":"true"}),ec))))}function i$({cssClasses:i,children:r}){return p.default.createElement("div",null,p.default.createElement("div",{className:i.inputDivider,"aria-hidden":"true"}),p.default.createElement(iN,{className:"bg-white py-4"},r))}function iW({handleSubmit:i,cssClasses:r}){let{toggleDropdown:n}=ig(),a=(0,p.useCallback)(()=>{i(),n(!1)},[i,n]);return p.default.createElement("div",{className:r.searchButtonContainer},p.default.createElement(ij,{className:r.searchButton,handleClick:a}))}function iY(i){return i?.type===eP.DirectAnswerType.FeaturedSnippet||i?.type===eP.DirectAnswerType.FieldValue}function iZ(i){return!!i?.destinationUrl}function iK(){let i=iH(),r=(0,R.useSearchState)(i=>i.vertical?.verticalKey),n=(0,R.useSearchState)(i=>i.query.queryId),a=(0,R.useSearchState)(i=>i.meta.uuid),o=(0,R.useSearchState)(i=>i.meta.locale),s=(0,R.useSearchState)(i=>i.meta.experienceKey),l=(0,R.useSearchState)(i=>i.query.mostRecentSearch),u=(0,p.useCallback)((u,c)=>{let d,h,f=!1,p=!1;(iY(u)?(d=u.relatedResult.link,h=u.relatedResult.id,f=!0):iZ(u)?(d=u.destinationUrl,h=u.searchResult?.id,f=!0,p=!0):(d=u.link,h=u.id),n)?a?s?i?.report({action:"TITLE_CLICK"===c?"TITLE":"VIEW_WEBSITE"===c?"WEBSITE":c,destinationUrl:d,entity:h,locale:o,searchId:a,queryId:n,verticalKey:r||"",isDirectAnswer:f,isGenerativeDirectAnswer:p,experienceKey:s,searchTerm:l}):console.error("Unable to report a CTA event. Missing field: experienceKey."):console.error("Unable to report a CTA event. Missing field: searchId."):console.error("Unable to report a CTA event. Missing field: queryId.")},[i,s,o,n,a,l,r]),c=(0,p.useCallback)((u,c)=>{let d;if(!n)return void console.error("Unable to report a result feedback event. Missing field: queryId.");if(!a)return void console.error("Unable to report a result feedback event. Missing field: searchId.");if(!s)return void console.error("Unable to report a result feedback event. Missing field: experienceKey.");let h=!1,f=!1;iY(u)?(h=!0,d=u.relatedResult.id):iZ(u)?(h=!0,f=!0,d=u.searchResult?.id):d=u.id,i?.report({action:c,entity:d,locale:o,searchId:a,queryId:n,verticalKey:r||"",isDirectAnswer:h,isGenerativeDirectAnswer:f,experienceKey:s,searchTerm:l})},[i,s,o,n,a,l,r]);return(0,p.useCallback)((r,n)=>{i&&(("TITLE_CLICK"===n||"CTA_CLICK"===n||"CITATION_CLICK"===n||"DRIVING_DIRECTIONS"===n||"VIEW_WEBSITE"===n||"TAP_TO_CALL"===n)&&u(r,n),("THUMBS_DOWN"===n||"THUMBS_UP"===n)&&c(r,n))},[i,u,c])}function iX(i,r){let n=iK();return(0,p.useCallback)(()=>{n(i,r)},[r,n,i])}var iQ=(n={
122"../../locales/ar/search-ui-react.json":()=>tO(),
122"../../locales/cs/search-ui-react.json":()=>tD(),
122"../../locales/da/search-ui-react.json":()=>tF(),
122"../../locales/de/search-ui-react.json":()=>tN(),
122"../../locales/el/search-ui-react.json":()=>tj(),
122"../../locales/en-GB/search-ui-react.json":()=>tz(),
122"../../locales/en/search-ui-react.json":()=>tB(),
122"../../locales/es/search-ui-react.json":()=>tU(),
122"../../locales/et/search-ui-react.json":()=>tV(),
122"../../locales/fi/search-ui-react.json":()=>tH(),
122"../../locales/fr/search-ui-react.json":()=>tG(),
122"../../locales/hi/search-ui-react.json":()=>tq(),
122"../../locales/hr/search-ui-react.json":()=>t$(),
122"../../locales/hu/search-ui-react.json":()=>tW(),
122"../../locales/it/search-ui-react.json":()=>tY(),
122"../../locales/ja/search-ui-react.json":()=>tZ(),
122"../../locales/ko/search-ui-react.json":()=>tK(),
122"../../locales/lt/search-ui-react.json":()=>tX(),
122"../../locales/lv/search-ui-react.json":()=>tQ(),
122"../../locales/nb/search-ui-react.json":()=>tJ(),
122"../../locales/nl/search-ui-react.json":()=>t1(),
122"../../locales/pl/search-ui-react.json":()=>t0(),
122"../../locales/pt/search-ui-react.json":()=>t2(),
122"../../locales/ro/search-ui-react.json":()=>t5(),
122"../../locales/ru/search-ui-react.json":()=>t4(),
122"../../locales/sk/search-ui-react.json":()=>t9(),
122"../../locales/sv/search-ui-react.json":()=>t3(),
122"../../locales/tr/search-ui-react.json":()=>t8(),
122"../../locales/vi/search-ui-react.json":()=>t6(),
122"../../locales/zh-CN/search-ui-react.json":()=>t7(),
122"../../locales/zh-TW/search-ui-react.json":()=>ie()
122},i=>{var r=n[i];if(r)return r();throw Error("Module not found in bundle: "+i)}),{supportedLocales:iJ}=it(),i1="search-ui-react",i0={};function i2({className:i}){return p.default.createElement("svg",{className:i,viewBox:"0 0 18 18",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},p.default.createElement("path",{d:"M10.6667 7.33333H14.6366C15.8756 7.33333 16.6814 8.63719 16.1273 9.74536L13.2107 15.5787C12.9283 16.1433 12.3512 16.5 11.7199 16.5H8.37184C8.23557 16.5 8.09982 16.4833 7.96762 16.4502L4.83333 15.6667M10.6667 7.33333V3.16667C10.6667 2.24619 9.92047 1.5 9 1.5H8.92044C8.50414 1.5 8.16667 1.83748 8.16667 2.25377C8.16667 2.84903 7.99047 3.43096 7.66028 3.92624L4.83333 8.16667V15.6667M10.6667 7.33333H9M4.83333 15.6667H3.16667C2.24619 15.6667 1.5 14.9205 1.5 14V9C1.5 8.07953 2.24619 7.33333 3.16667 7.33333H5.25",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))}iJ.forEach(i=>{i0[i]={[i1]:iQ(`../../locales/${i}/search-ui-react.json`)}}),tp().use({type:"3rdParty",init(i){((i={})=>{E={...E,...i}})(i.options.react),r=i}}).init({fallbackLng:"en",ns:[i1],defaultNS:i1,interpolation:{escapeValue:!1},resources:i0});var i5={thumbsFeedbackContainer:"flex justify-end mt-2 text-sm text-gray-500 font-medium",thumbsUpIcon:"ml-3 w-5",thumbsDownIcon:"w-5 ml-1 transform rotate-180"};function i4(i){let{t:r}=C(),{onClick:n,feedbackText:a,feedbackTextOnSubmission:o}=i,s=iS(i5,i.customCssClasses),l=(0,R.useSearchState)(i=>i.query.mostRecentSearch),[u,c]=(0,p.useState)(!1),d=(0,p.useCallback)(()=>{n("THUMBS_UP"),c(!0)},[n]),h=(0,p.useCallback)(()=>{n("THUMBS_DOWN"),c(!0)},[n]);return iI(()=>{c(!1)},[l]),p.default.createElement("div",{className:s.thumbsFeedbackContainer},u?o??r("thankYouForYourFeedback"):p.default.createElement(p.default.Fragment,null,a??r("feedback","Feedback"),p.default.createElement("button",{className:s.thumbsUpIcon,onClick:d,"aria-label":r("thisAnsweredMyQuestion")},p.default.createElement(i2,null)),p.default.createElement("button",{className:s.thumbsDownIcon,onClick:h,"aria-label":r("thisDidNotAnswerMyQuestion")},p.default.createElement(i2,null))))}function i9(i){let r,n,{t:a}=C(),{nlpFilterDisplayNames:o=[],removableFilters:s=[],cssClasses:l={}}=i,u=(r=(0,R.useSearchActions)(),n=(0,R.useSearchState)(i=>i.filters.static),(0,p.useCallback)(()=>{r.setOffset(0),r.resetFacets(),n&&r.setStaticFilters(n.map(i=>({...i,selected:!1}))),ia(r)},[r,n])),c=(0,R.useSearchActions)(),d=o.filter(i=>!s.some(r=>r.displayName===i)),h=function(i){let r=[];for(let n of i){let i=r.find(i=>{var r,a;return r=i.filter,a=n.filter,r.fieldId===a.fieldId&&r.matcher===a.matcher&&(0,eL.default)(r.value,a.value)});i?i.duplicates?i.duplicates.push(n):i.duplicates=[n]:r.push(n)}return r}(s),f=(0,p.useCallback)(i=>{for(let r of(i.handleRemove(),i.duplicates??[]))r.handleRemove();c.setOffset(0),ia(c)},[c]),m=(0,p.useMemo)(()=>h.map(i=>({filter:i,handleRemove:()=>f(i)})),[h,f]);return s.length+o.length===0?null:p.default.createElement("div",{className:l.appliedFiltersContainer,"aria-label":a("appliedFiltersToCurrentSearch")},d.map((i,r)=>{var n,a,o;return n=i,a=r,o=l,p.default.createElement("div",{className:o.nlpFilter,key:`${n}-${a}`},p.default.createElement("span",{className:o.filterLabel},n))}),m.map(({filter:i,handleRemove:r},n)=>p.default.createElement(i3,{key:`${i.displayName??"filter"}-${n}`,displayName:i.displayName,handleRemove:r,cssClasses:l})),s.length>0&&p.default.createElement("button",{onClick:u,className:l.clearAllButton},a("clearAll")))}function i3({displayName:i,handleRemove:r,cssClasses:n}){let{t:a}=C();return p.default.createElement("div",{className:n.removableFilter},p.default.createElement("div",{className:n.filterLabel},i),p.default.createElement("button",{className:"ml-1 inline-flex h-5 w-5 shrink-0 items-center justify-center text-neutral",onClick:r,"aria-label":a("removeFilter",{displayName:i})},p.default.createElement(ih,{className:"h-2 w-2"})))}i5.thumbsFeedbackContainer,i5.thumbsUpIcon,i5.thumbsDownIcon,(0,p.createContext)(null);var i8={verticalResultsLoading:"opacity-50"};function i6(i){let{CardComponent:r,results:n,isLoading:a=!1,customCssClasse
122s:o,setResultsRef:s}=i,l=iS(i8,o);if(0===n.length)return null;let u=(0,M.default)(l.verticalResultsContainer,{[l.verticalResultsLoading??""]:a});return p.default.createElement("div",{className:u},n?.map(i=>{var n,a,o;let l;return n=r,a=i,o=s,l=a.id&&a.index?`${a.id}-${a.index}`:a.id||a.index,p.default.createElement("div",{key:a.id,ref:a.index?o?.(a.index):null},p.default.createElement(n,{result:a,key:l}))}))}var i7={container:"flex flex-col justify-between border border-gray-200 rounded-lg mb-4 p-4 shadow-sm",header:"flex text-neutral-dark",body:"flex justify-end pt-2.5 text-base",cta1:"whitespace-nowrap bg-primary text-white font-medium rounded-lg py-2 px-5 shadow",cta2:"whitespace-nowrap bg-white text-primary font-medium rounded-lg py-2 px-5 mt-2 shadow",title:"text-lg font-medium",thumbsFeedbackContainer:"flex justify-end mt-4 text-sm text-gray-500 font-medium",thumbsUpIcon:i5.thumbsUpIcon,thumbsDownIcon:i5.thumbsDownIcon};function re(i){let r,{title:n,link:a,description:o,customCssClasses:s,clickHandlers:l,showFeedbackButtons:u,cta1:c,cta2:d}=i,h=iS(i7,s);return p.default.createElement("div",{className:h.container},p.default.createElement("div",{className:h.header},(r=iB(n,{highlighted:"font-bold",nonHighlighted:"font-medium"}),a?p.default.createElement("a",{href:a,className:"text-lg font-medium text-primary hover:underline focus:underline",onClick:l.handleTitleClick},r):p.default.createElement("div",{className:h.title},r))),(o??c??d)&&p.default.createElement("div",{className:h.body},o?p.default.createElement("div",{className:"w-full"},iB(o,{highlighted:"font-semibold",nonHighlighted:"font-normal"})):null,c||d?p.default.createElement("div",{className:"flex flex-col justify-end ml-4"},c&&p.default.createElement("button",{className:h.cta1,onClick:l.handleCtaClick},c.label),d&&p.default.createElement("button",{className:h.cta2,onClick:l.handleCtaClick},d.label)):null),u?p.default.createElement(i4,{feedbackText:"",onClick:l.handleFeedbackClick,customCssClasses:h}):null)}function rt(i){let r,{result:n,customCssClasses:a,showFeedbackButtons:o}=i,s={title:n.highlightedFields?.name??n.name??n.rawData.name,description:n.highlightedFields?.description??n.rawData.description,cta1:n.rawData.c_primaryCTA,cta2:n.rawData.c_secondaryCTA},l={handleCtaClick:iX(n,"CTA_CLICK"),handleTitleClick:iX(n,"TITLE_CLICK"),handleFeedbackClick:(r=iK(),(0,p.useCallback)(i=>{r(n,i)},[r,n]))};return p.default.createElement(re,{customCssClasses:a,showFeedbackButtons:o,clickHandlers:l,title:s.title,link:n.link,description:s.description,cta1:s.cta1,cta2:s.cta2})}re.propTypes={title:tm.default.oneOfType([tm.default.string,tm.default.shape({value:tm.default.string.isRequired,matchedSubstrings:tm.default.arrayOf(tm.default.shape({length:tm.default.number.isRequired,offset:tm.default.number.isRequired})).isRequired})]).isRequired,link:tm.default.string,description:tm.default.string,cta1:tm.default.shape({label:tm.default.string.isRequired,link:tm.default.string.isRequired,linkType:tm.default.string.isRequired}),cta2:tm.default.shape({label:tm.default.string.isRequired,link:tm.default.string.isRequired,linkType:tm.default.string.isRequired})};var ri={section:""};function rr(i){let r=iS(ri,i.customCssClasses),{results:n,CardComponent:a=rt,header:o}=i;return 0===n.length?null:p.default.createElement("section",{className:r.section},o,p.default.createElement(i6,{results:n,CardComponent:a,customCssClasses:r}))}function rn(){return p.default.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},p.default.createElement("path",{d:"M19 11H5M19 11C20.1046 11 21 11.8954 21 13V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V13C3 11.8954 3.89543 11 5 11M19 11V9C19 7.89543 18.1046 7 17 7M5 11V9C5 7.89543 5.89543 7 7 7M7 7V5C7 3.89543 7.89543 3 9 3H15C16.1046 3 17 3.89543 17 5V7M7 7H17",stroke:"#1f2937",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))}var ra={};function ro(i){let{t:r}=C(),{label:n,verticalKey:a,viewAllButton:o=!1,appliedQueryFilters:s,cssClasses:l=ra,getViewAllUrl:u}=i,c=(0,R.useSearchState)(i=>i.query.mostRecentSearch),d=s?.map(i=>i.displayValue),h=iH(),f=(0,R.useSearchState)(i=>i.query.queryId),m=(0,R.useSearchState)(i=>i.meta.uuid),g=(0,R.useSearchState)(i=>i.meta.locale),_=(0,R.useSearchState)(i=>i.meta.experienceKey),y=(0,R.useSearchState)(i=>i.query.mostRecentSearch),v=(0,R.useSearchState)(i=>i.searchStatus.isLoading);l.appliedFiltersContainer=(0,M.default)(l.appliedFiltersContainer,{[l.appliedFiltersLoading??""]:v});let x=u?u({verticalKey:a,query:c}):`/${a}?query=${c}`,b=(0,p.useCallback)(()=>
122{if(h){if(!f)return void console.error("Unable to report a vertical view all event. Missing field: queryId.");if(!m)return void console.error("Unable to report a vertical view all event. Missing field: searchId.");if(!_)return void console.error("Unable to report a vertical view all event. Missing field: experienceKey.");h?.report({action:"VERTICAL_VIEW_ALL",locale:g,searchId:m,queryId:f,verticalKey:a,experienceKey:_,searchTerm:y})}},[h,_,g,f,m,y,a]);return p.default.createElement("div",{className:l.sectionHeaderContainer},p.default.createElement("div",{className:l.sectionHeaderIconContainer},p.default.createElement(rn,null)),p.default.createElement("h2",{className:l.sectionHeaderLabel},n),s&&p.default.createElement(i9,{nlpFilterDisplayNames:d,cssClasses:l}),o&&p.default.createElement("div",{className:l.viewMoreContainer},p.default.createElement("a",{className:l.viewMoreLink,href:x,onClick:b},r("viewAll"))))}var rs={universalResultsContainer:"space-y-8",universalResultsLoading:"opacity-50",sectionHeaderContainer:"flex items-center w-full pl-1 mb-4",sectionHeaderIconContainer:"w-5 h-5",sectionHeaderLabel:"font-bold text-neutral-dark text-base pl-3",viewMoreContainer:"flex justify-end flex-grow ml-auto font-medium text-neutral-dark",viewMoreLink:"text-primary pr-1 pl-3",appliedFiltersContainer:"ml-3 flex flex-wrap",nlpFilter:"border border-gray-200 rounded-3xl px-3 py-1.5 text-sm font-medium text-neutral-dark mr-2",removableFilter:"flex items-center border border-gray-200 rounded-3xl px-3 py-1.5 text-sm font-medium text-neutral-dark mr-2"};(0,p.createContext)(null),p.default.Fragment,p.default.Fragment,tg.default,Number.isNaN(Number(p.default.version.split(".")[0])),(o=c||(c={})).PROD="prod",o.SANDBOX="sbx",o.QA="qa",o.DEV="dev",(s=d||(d={})).US="us",s.EU="eu",tk.default,tR.default,tM.default,i.s(["SearchBar",0,iq,"UniversalResults",0,function({verticalConfigMap:i,showAppliedFilters:r,customCssClasses:n}){let a=iS(rs,n),o=(0,R.useSearchState)(i=>i?.universal?.verticals)||[],s=(0,R.useSearchState)(i=>i.searchStatus.isLoading);if(0===o.length)return null;let l=(0,M.default)(a.universalResultsContainer,{[a.universalResultsLoading??""]:s});return p.default.createElement("div",{className:l},function(i){let{resultsFromAllVerticals:r,verticalConfigMap:n,cssClasses:a}=i;return p.default.createElement(p.default.Fragment,null,r.filter(i=>i.results).map(r=>{let o=r.verticalKey,s=n[o]||{},l=s.label??o,u=r.results,c=s.SectionComponent||rr,d=i.showAppliedFilters?r.appliedQueryFilters:void 0;return p.default.createElement(c,{results:u,verticalKey:o,header:p.default.createElement(ro,{...{label:l,appliedQueryFilters:d,verticalKey:o,viewAllButton:s.viewAllButton,getViewAllUrl:s.getViewAllUrl,cssClasses:a}}),CardComponent:s.CardComponent,key:o})}))}({resultsFromAllVerticals:o,showAppliedFilters:r,verticalConfigMap:i,cssClasses:a}))},"VerticalResults",0,function(i){let{displayAllOnNoResults:r=!0,...n}=i,a=(0,R.useSearchState)(i=>i.vertical.results)||[],o=(0,R.useSearchState)(i=>i.vertical?.noResults?.allResultsForVertical.results)||[],s=(0,R.useSearchState)(i=>i.searchStatus.isLoading),l=a;return 0===a.length&&r&&(l=o),p.default.createElement(i6,{results:l,isLoading:s,...n})},"executeSearch",0,ia,"useComposedCssClasses",0,iS],560071),i.s(["default",0,i=>(0,h.jsx)("div",{className:f.default.wrapper,children:(0,h.jsx)(iq,{hideRecentSearches:!0,customCssClasses:{option:f.default.option,icon:f.default.icon,highlighted:f.default.highlighted,nonHighlighted:f.default["non-highlighted"],searchBarContainer:f.default["search-bar-container"],inputElement:f.default["input-element"],inputDivider:f.default["input-divider"],clearButton:f.default["clear-button"],searchButton:f.default["search-button"],searchButtonContainer:f.default["search-button-container"],focusedOption:f.default["focused-option"],recentSearchesIcon:f.default["recent-searches-icon"],recentSearchesOption:f.default["recent-searches-option"],recentSearchesNonHighlighted:f.default["recent-searches-non-highlighted"],verticalLink:f.default["vertical-link"],verticalDivider:f.default["vertical-divider"],entityPreviewsDiv
122ider:f.default["entity-previews-divider"]},...i})})],832665)},394075,i=>{i.v({highlight:"YextCustomPagination-module-scss-module__8hOPkG__highlight","sr-only":"YextCustomPagination-module-scss-module__8hOPkG__sr-only",wrapper:"YextCustomPagination-module-scss-module__8hOPkG__wrapper"})},323890,i=>{i.v({ctas:"YextCustomAlternativeVerticals-module-scss-module__6gC0wa__ctas",highlight:"YextCustomAlternativeVerticals-module-scss-module__6gC0wa__highlight","sr-only":"YextCustomAlternativeVerticals-module-scss-module__6gC0wa__sr-only",subtitle:"YextCustomAlternativeVerticals-module-scss-module__6gC0wa__subtitle",title:"YextCustomAlternativeVerticals-module-scss-module__6gC0wa__title",wrapper:"YextCustomAlternativeVerticals-module-scss-module__6gC0wa__wrapper"})},329954,i=>{i.v({desktop:"YextFilters-module-scss-module__U7fzeW__desktop",filters:"YextFilters-module-scss-module__U7fzeW__filters","filters-title":"YextFilters-module-scss-module__U7fzeW__filters-title",highlight:"YextFilters-module-scss-module__U7fzeW__highlight",label:"YextFilters-module-scss-module__U7fzeW__label",mobile:"YextFilters-module-scss-module__U7fzeW__mobile","sr-only":"YextFilters-module-scss-module__U7fzeW__sr-only"})},280498,i=>{i.v({footer:"FiltersFooter-module-scss-module__40aaqW__footer",highlight:"FiltersFooter-module-scss-module__40aaqW__highlight","sr-only":"FiltersFooter-module-scss-module__40aaqW__sr-only"})},846083,i=>{i.v({highlight:"YextNoResults-module-scss-module__fHxRxa__highlight","sr-only":"YextNoResults-module-scss-module__fHxRxa__sr-only",title:"YextNoResults-module-scss-module__fHxRxa__title",wrapper:"YextNoResults-module-scss-module__fHxRxa__wrapper"})},675603,i=>{i.v({copy:"YextResultCardArticles-module-scss-module__-VIq6W__copy",ctas:"YextResultCardArticles-module-scss-module__-VIq6W__ctas","has-image":"YextResultCardArticles-module-scss-module__-VIq6W__has-image",highlight:"YextResultCardArticles-module-scss-module__-VIq6W__highlight",image:"YextResultCardArticles-module-scss-module__-VIq6W__image","no-image":"YextResultCardArticles-module-scss-module__-VIq6W__no-image","sr-only":"YextResultCardArticles-module-scss-module__-VIq6W__sr-only",text:"YextResultCardArticles-module-scss-module__-VIq6W__text",wrapper:"YextResultCardArticles-module-scss-module__-VIq6W__wrapper"})},907626,i=>{i.v({copy:"YextResultCardConsultants-module-scss-module__Sc5g5G__copy",cta:"YextResultCardConsultants-module-scss-module__Sc5g5G__cta",highlight:"YextResultCardConsultants-module-scss-module__Sc5g5G__highlight",image:"YextResultCardConsultants-module-scss-module__Sc5g5G__image",inline:"YextResultCardConsultants-module-scss-module__Sc5g5G__inline","sr-only":"YextResultCardConsultants-module-scss-module__Sc5g5G__sr-only",text:"YextResultCardConsultants-module-scss-module__Sc5g5G__text",wrapper:"YextResultCardConsultants-module-scss-module__Sc5g5G__wrapper"})},783769,861486,153320,925150,341754,44629,5254,714730,611571,554283,128904,i=>{"use strict";var r=i.i(677076),n=i.i(34639),a=i.i(249736);i.i(589295);var o=i.i(956028);let s="all,healthcare_facilities,tests_and_treatments,healthcare_professionals,specialties,articles,faqs".split(",")||[],l=new Map([["all","All"],["healthcare_facilities","Locations"],["tests_and_treatments","Tests & Treatments"],["healthcare_professionals","Consultants"],["specialties","Departments"],["articles","Articles"],["faqs","FAQs"],["jobs","Vacancies"]].filter(([i])=>s.includes(i))),u=()=>{let i=(0,o.useSearchActions)();return r=>{"all"===r?(i.setUniversal(),i.setUniversalLimit({healthcare_facilities:3,tests_and_treatments:5,healthcare_professionals:5,specialties:5,articles:5,faqs:5}),i.executeUniversalQuery()):(i.setVertical(r),i.setVerticalLimit(5),i.executeVerticalQuery())}};i.s(["default",0,u,"verticalMap",0,l],861486),i.s(["default",0,()=>{let i=u(),s=(0,o.useSearchState)(i=>i).vertical.verticalKey,c=[...l.keys()].indexOf(s||"all");return(0,r.jsx)(a.default,{theme:"A-HCA-White",children:(0,r.jsx)(n.default,{overrideTabIndex:c,callback:r=>{(({value:r})=>{i(r)})(r)},tabs:[...l.entries()].map(([i,r])=>({label:r,value:i})),contentVariation:"scroll-max-large"})})}],783769);var c=i.i(2317),d=i.i(394075),h=i.i(514315),f=i.i(560071);i.s(["default",0,i=>{let{paginateAllOnNoResults:n,callback:a}=i,s=(0,o.useSearchActions)(),l=(0,o.useSearchState)(i=>i.vertical.resultsCount)||0,u=(0,o.useSearchState)(i=>i.vertical?.noResults?.allResultsForVertical.resultsCount)||0,p=(0,o.useSearchState)(i=>i.searchStatus.isLoading),m=l;0===l&&n&&(m=u);let g=(0,o.useSearchState)(i=>i.vertical.offset)||0,_=(0,o.useSearchState)(i=>i.vertical.limit)||20,y=g/_+1,v=Math.ceil(m/_),x=(0,c.useCallback)(i=>{if(p)return;let r=_*(i-1);s.setOffset(r),(0,f.executeSearch)(s),a?.()},[s,_,p,a]);return v<=1?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)("div",{className:d.default.wrapper,children:(0,r.jsx)(h.default,{pageCount:v,currentPage:y,callback:x})})}],153320);var p=i.i(257818),m=i.i(323890),g=i.i(443107),_=i.i(630077),y=i.i(902841);function v(i){return i?.resultsCount!==void 0&&i?.verticalKey!==void 0}i.s(["AlternativeVerticals",0,function({currentVerticalLabel:i,verticalConfigMap:n,displayAllOnNoResults:a=!0}){var s;let l=u(),c=(0,o.useSearchState)(i=>i.vertical.noResults?.alternativeVerticals)||[],d=(0,o.useSearchState)(i=>i.vertical.noResults?.allResultsForVertical.results)||[],h=(0,o.useSearchState)(i=>i.query.mostRecentSearch),f=(s=n,c.filter(i=>!!s[i.verticalKey]).map(i=>({label:s[i.verticalKey].label,verticalKey:i.verticalKey,resultsCount:i.resultsCount})).filter(v).filter(i=>i.resultsCount>0)),x=a&&d.length>0;function b(i){return null!=i.count&&i.pluralForm&&1!==i.count?i.pluralForm:i.phrase}let w=i=>{let{suggestion:n}=i,a=u(),o=b({phrase:`${n.resultsCount} result`,pluralForm:`${n.resultsCount} results`,count:n.resultsCount});return(0,r.jsx)(g.default,{size:"small",variation:"filter",children:(0,r.jsxs)("button",{onClick:()=>a(n.verticalKey),children:[(0,r.jsx)(_.default,{iconName:"iconSearch"}),(0,r.jsxs)("span",{children:[n.label||"Links"," - ",o]})]})},n.verticalKey)};return(0,r.jsx)("div",{className:m.default.wrapper,children:f&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:m.default.title,children:(0,r.jsxs)(p.default,{tag:"h2",variation:"display-5",children:["No results found in ",i,"."]})}),x&&f.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:m.default.subtitle,children:(0,r.jsx)(p.default,{tag:"p",variation:"body-extra-large",children:(0,r.jsxs)("span",{children:[" ","Showing ",(0,r.jsxs)("strong",{children:["all ",i]})," instead."]})})}),(0,r.jsx)("div",{className:m.default.copy,children:(0,r.jsxs)(p.default,{tag:"p",variation:"body-extra-large",children:[b({phrase:"The following category yielded results for ",pluralForm:"The following categories yielded results for ",count:f.length})," ",(0,r.jsxs)("strong",{children:["‘",h,"’:"]})]})}),(0,r.jsx)("div",{className:m.default.ctas,children:f.map((i,n)=>(0,r.jsx)(w,{suggestion:i},n))}),(0,r.jsx)(p.default,{variation:"body-extra-large",children:(0,r.jsx)(y.default,{variation:"body-extra-large",children:(0,r.jsx)("button",{onClick:()=>l("all"),children:(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{children:"Alternatively, you can "}),(0,r.jsx)("strong",{children:"view results across all search categories."})]})})})})]}):(0,r.jsx)(p.default,{tag:"p",variation:"body-extra-large",children:"Please try another search."})]})})}],925150);var x=i.i(329954),b=i.i(859040),w=i.i(938954),T=i.i(280498),E=i.i(211452);let S=i=>{let{resultsCount:n,dialogRef:a}=i;return(0,r.jsxs)("div",{className:T.default.footer,children:[(0,r.jsx)(E.default,{theme:"dark",children:(0,r.jsx)("button",{type:"button",onClick:()=>
122{if(!a?.current)return;let i=a.current.querySelectorAll("input:checked");i?.forEach((r,n)=>{n===i.length-1?r.click():r.checked=!1})},children:"Clear All"})}),(0,r.jsx)(g.default,{variation:"full-dark",size:"small",children:(0,r.jsxs)("button",{onClick:()=>a?.current?.close(),type:"button",children:["See ",n," Results"]})})]})},A=i=>{let{children:n,label:a="Filter by:",mobileLabel:o="Filter by",buttonIcon:s=(0,r.jsx)(_.default,{iconName:"iconFilterCircle"}),filtersTitle:l,resultsCount:u}=i,d=(0,c.useRef)(null),h=(i=>{let[r,n]=(0,c.useState)(window.innerWidth),a=(0,w.useDebouncedCallback)(()=>{n(window.innerWidth),window.addEventListener("resize",a)},100);return(0,c.useEffect)(()=>(a(),()=>{window.removeEventListener("resize",a)}),[a]),r>=i})(1135);return(0,r.jsx)("div",{className:x.default.wrapper,children:h?(0,r.jsxs)("div",{className:x.default.desktop,children:[(0,r.jsx)("div",{className:x.default.label,children:a}),(0,r.jsx)("div",{className:x.default.filters,children:n})]}):(0,r.jsxs)("div",{className:x.default.mobile,children:[(0,r.jsx)("div",{className:x.default.toggle,children:(0,r.jsx)(g.default,{variation:"full",size:"large",children:(0,r.jsxs)("button",{onClick:()=>d.current?.showModal(),type:"button",children:[s,o]})})}),(0,r.jsxs)(b.default,{ref:d,defaultOpen:!1,contentVariation:"filters",children:[(0,r.jsx)("div",{className:x.default.label,children:o}),(0,r.jsxs)("div",{className:x.default.filters,children:[(0,r.jsx)("div",{className:x.default["filters-title"],children:l}),n]}),(0,r.jsx)(S,{resultsCount:u,dialogRef:d})]})]})})};var C=i.i(360227),I=i.i(623420),k=i.i(208024);i.s(["default",0,()=>{let i=(0,o.useSearchState)(i=>i.filters.facets),n=(0,o.useSearchState)(i=>i.vertical.resultsCount),a=(0,o.useSearchActions)(),s=(i??[]).map(i=>i.options[0]?.matcher==="$eq"&&["c_locationCity","address.city"].includes(i.fieldId)?(0,r.jsx)(A,{filtersTitle:i?.displayName,resultsCount:n,children:(0,r.jsx)(k.default,{children:i.options.map((n,o)=>(0,r.jsx)(I.default,{id:String(n.value),label:n.displayName,name:i.fieldId,value:String(n.value),onChange:()=>((i,r,n,o=C.Matcher.Equals)=>{a.setFacetOption(n,{matcher:o,value:i},r),a.executeVerticalQuery()})(n.value,!n.selected,i.fieldId)},o))})},i.fieldId):null).filter(i=>null!==i);return s.length>0?s:[]}],341754);var R=i.i(565072),M=i.i(227015);let L={resultsCountContainer:"font-semibold text-neutral mb-4 py-2 mr-2.5 whitespace-nowrap",resultsCountLoading:"opacity-50"};i.s(["ResultsCount",0,function({customCssClasses:i}
122){let n=(0,f.useComposedCssClasses)(L,i),a=(0,o.useSearchState)(i=>i.searchStatus.isLoading),s=function(){var i;let r=(0,o.useSearchState)(i=>i.meta.searchType)===R.SearchTypeEnum.Vertical,n=(0,o.useSearchState)(i=>r?i.vertical:i.universal.verticals),a=(0,o.useSearchState)(i=>i.vertical.offset)||0,s=(0,o.useSearchState)(i=>i.vertical.limit)||20,l=0;if(n&&(Array.isArray(n)?n.forEach(i=>l+=i.resultsCount):l=n.resultsCount??0),0===l)return null;let u=null!=(i={phrase:`${l} result`,pluralForm:`${l} results`,count:l}).count&&i.pluralForm&&1!==i.count?i.pluralForm:i.phrase;if(!(l>s)||!r)return u;{let i=Math.min(a+s,l),r=`${a+1}-${i}`;return`${r} of ${l}`}}(),l=(0,M.default)(n.resultsCountContainer,{[n.resultsCountLoading??""]:a});return(0,r.jsx)("div",{className:l,children:s})}],44629);var P=i.i(846083);i.s(["default",0,i=>{let{currentVerticalLabel:n,displayAllOnNoResults:a=!0}=i,s=(0,o.useSearchState)(i=>i.vertical.noResults?.allResultsForVertical.results)||[],l=(0,o.useSearchState)(i=>i.query.mostRecentSearch),u=a&&s.length>0,c=""===n?`No results found for ${l}.`:`No results found in ${n} for ${l}.`;return(0,r.jsx)("div",{className:P.default.wrapper,children:(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:P.default.title,children:(0,r.jsx)(p.default,{tag:"h2",variation:"display-5",children:c})}),(0,r.jsx)("div",{className:P.default.subtitle,children:(0,r.jsx)(p.default,{tag:"p",variation:"body-extra-large",children:u?(0,r.jsxs)("span",{children:["Showing ",(0,r.jsxs)("strong",{children:["all ",n]})," instead."]}):(0,r.jsx)("span",{children:"Please try another search."})})})]})})}],5254);var O=i.i(215904),D=i.i(675603);let F=i=>{let{image:n,title:a,copy:o,ctas:s}=i;return(0,r.jsxs)("div",{className:[D.default.wrapper,D.default[n?"has-image":"no-image"]].join(" "),children:[n&&(0,r.jsx)("div",{className:D.default.image,children:n}),(0,r.jsxs)("div",{className:D.default.text,children:[a&&a,o&&(0,r.jsx)("div",{className:D.default.copy,children:o})]}),s&&(0,r.jsxs)("div",{className:D.default.ctas,children:[s.button&&(0,r.jsx)(g.default,{variation:"full",size:"small",contentVariation:"card",children:s.button}),s.textButton&&(0,r.jsx)(g.default,{variation:"outline",size:"small",children:s.textButton})]})]})};function N(i){return i?i.replace(/\\r\\n|\\n|\\r|\\t/g," ").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/__(.*?)__/g,"$1").replace(/_(.*?)_/g,"$1").replace(/\\([&\-*_#[\](){}.!+\\])/g,"$1").replace(/\s*[•·]\s*/g,", ").replace(/\s{2,}/g," ").trim():""}i.s(["default",0,F],714730),i.s(["tidySearchDescription",0,N],611571),i.s(["default",0,i=>{let{result:n}=i,{rawData:a}=n,{c_answersPrimaryCallToAction:o,c_nameRichText:s,c_primaryImage:l,c_servicesImage:u,c_uRL:c,name:d,c_abstractTitle:h,c_abstractText:f,c_pageTitle:m,c_abstractImage:g,c_pageImage:y}=a,v=s||h||m||d||"",x=N(f),b=u||l,w=g||y,T=d&&b?.url?{alt:d,src:b?.url,width:b?.width,height:b?.height}:d&&w?{alt:d,src:w,width:480,height:384}:void 0;return(0,r.jsx)(F,{image:T?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(O.default,{...T})}):void 0,title:(0,r.jsx)(p.default,{tag:"h3",variation:"heading-1",children:v}),copy:x?(0,r.jsx)(p.default,{tag:"div",variation:"body-large",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:x}})}):void 0,ctas:{button:c?(0,r.jsxs)("a",{href:c,children:["Learn ",(0,r.jsx)("b",{children:"more"})]}):void 0,textButton:o?.link?(0,r.jsxs)("a",{href:o?.link,children:[(0,r.jsx)(_.default,{iconName:"iconStethoscope"}),(0,r.jsxs)("span",{children:["Find a ",(0,r.jsx)("b",{children:"consultant"})]})]}):void 0}})}],554283);var j=i.i(907626);i.s(["default",0,i=>{let{title:n,doctify:a,copy:o,phone:s,specialties:l,cta:u,image:c}=i;return(0,r.jsxs)("div",{className:j.default.wrapper,children:[(0,r.jsx)("div",{className:j.default.image,children:c}),(0,r.jsxs)("div",{className:j.default.text,children:[n&&n,a&&a,o&&(0,r.jsx)("div",{className:j.default.copy,children:o}),s&&(0,r.jsx)("div",{className:j.default.inline,children:s}),l&&(0,r.jsxs)("div",{className:j.default.inline,children:[(0,r.jsx)("span",{children:l.icon}),(0,r.jsx)("span",{children:l.text})]})]}),u&&(0,r.jsx)("div",{className:j.default.cta,children:(0,r.jsx)(g.default,{variation:"full",size:"large",contentVariation:"card",children:u})})]})}],128904)},334569,i=>{i.v({centre:"Doctify-module-scss-module__JqeGDq__centre","dark-logo":"Doctify-module-scss-module__JqeGDq__dark-logo",highlight:"Doctify-module-scss-module__JqeGDq__highlight",inactive:"Doctify-module-scss-module__JqeGDq__inactive","light-logo":"Doctify-module-scss-module__JqeGDq__light-logo",link:"Doctify-module-scss-module__JqeGDq__link",logo:"Doctify-module-scss-module__JqeGDq__logo",rating:"Doctify-module-scss-module__JqeGDq__rating","review-container":"Doctify-module-scss-module__JqeGDq__review-container",reviews:"Doctify-module-scss-module__JqeGDq__reviews",right:"Doctify-module-scss-module__JqeGDq__right","sr-only":"Doctify-module-scss-module__JqeGDq__sr-only",wrapper:"Doctify-module-scss-module__JqeGDq__wrapper"})},969209,i=>{"use strict";var r=i.i(677076),n=i.i(630077),a=i.i(334569);i.s(["default",0,i=>{let{rating:o,reviews:s,logo:l,link:u,alignment:c}=i,d=[],h=[],f=Math.round(Number(o)),p=5-f;for(let i=0;i<f;i++)d.push((0,r.jsx)(n.default,{iconName:"iconStar"}));if(p>0)for(let i=0;i<p;i++)h.push((0,r.jsx)(n.default,{iconName:"iconStar"}));return(0,r.jsxs)("div",{className:[a.default.wrapper,a.default[f]].join(" "),children:[(0,r.jsx)("div",{className:a.default.link,children:u}),(0,r.jsxs)("div",{className:a.default["review-container"],children:[(0,r.jsxs)("span",{className:a.default.rating,children:[(0,r.jsx)("ul",{children:d.map((i,n)=>(0,r.jsx)("li",{children:i},n))}),(0,r.jsx)("ul",{className:a.default.inactive,children:h.map((i,n)=>(0,r.jsx)("li",{children:i},n))})]}),(0,r.jsxs)("span",{className:a.default.reviews,children:[s," reviews"]})]}
122),(0,r.jsxs)("div",{className:[a.default.logo,c&&a.default[c]].join(" "),children:[(0,r.jsx)("span",{children:"Verified by:"}),(0,r.jsx)("span",{className:a.default["light-logo"],children:l.light}),(0,r.jsx)("span",{className:a.default["dark-logo"],children:l.dark})]})]})}])},77688,i=>{"use strict";let r={src:i.i(150919).default,width:1024,height:264,blurWidth:8,blurHeight:2,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAACCAYAAABllJ3tAAAATUlEQVR42gFCAL3/AB17n7oaiZe0F0BASUxMTEg4ODg1QEBAPV5eXllDQ0NAAB2FqMkflLvhHj1BSFZXV1JRUVFNSUlJRU1NTklXV1hT2xUVyPvxnY4AAAAASUVORK5CYII="};i.s(["default",0,r])},49640,i=>{i.v({highlight:"Numbers-module-scss-module__fE8AAG__highlight",large:"Numbers-module-scss-module__fE8AAG__large",small:"Numbers-module-scss-module__fE8AAG__small","sr-only":"Numbers-module-scss-module__fE8AAG__sr-only",wrapper:"Numbers-module-scss-module__fE8AAG__wrapper"})},951864,i=>{i.v({card:"YextResultSectionLocations-module-scss-module__1eguLW__card",cards:"YextResultSectionLocations-module-scss-module__1eguLW__cards",grid:"YextResultSectionLocations-module-scss-module__1eguLW__grid",highlight:"YextResultSectionLocations-module-scss-module__1eguLW__highlight",map:"YextResultSectionLocations-module-scss-module__1eguLW__map","map-column":"YextResultSectionLocations-module-scss-module__1eguLW__map-column",selected:"YextResultSectionLocations-module-scss-module__1eguLW__selected","side-by-side":"YextResultSectionLocations-module-scss-module__1eguLW__side-by-side","sr-only":"YextResultSectionLocations-module-scss-module__1eguLW__sr-only",stacked:"YextResultSectionLocations-module-scss-module__1eguLW__stacked",wrapper:"YextResultSectionLocations-module-scss-module__1eguLW__wrapper"})},222235,i=>{i.v({address:"YextResultCardLocations-module-scss-module__5Sgi3G__address",column:"YextResultCardLocations-module-scss-module__5Sgi3G__c
122olumn",contacts:"YextResultCardLocations-module-scss-module__5Sgi3G__contacts",content:"YextResultCardLocations-module-scss-module__5Sgi3G__content",copy:"YextResultCardLocations-module-scss-module__5Sgi3G__copy",ctas:"YextResultCardLocations-module-scss-module__5Sgi3G__ctas",distance:"YextResultCardLocations-module-scss-module__5Sgi3G__distance",heading:"YextResultCardLocations-module-scss-module__5Sgi3G__heading",highlight:"YextResultCardLocations-module-scss-module__5Sgi3G__highlight",image:"YextResultCardLocations-module-scss-module__5Sgi3G__image",inline:"YextResultCardLocations-module-scss-module__5Sgi3G__inline",inner:"YextResultCardLocations-module-scss-module__5Sgi3G__inner",opening:"YextResultCardLocations-module-scss-module__5Sgi3G__opening",phone:"YextResultCardLocations-module-scss-module__5Sgi3G__phone","sr-only":"YextResultCardLocations-module-scss-module__5Sgi3G__sr-only",stacked:"YextResultCardLocations-module-scss-module__5Sgi3G__stacked",wrapper:"YextResultCardLocations-module-scss-module__5Sgi3G__wrapper"})},219435,i=>{i.v({children:"YextResultCardAskAQuestion-module-scss-module__rPxahq__children",error:"YextResultCardAskAQuestion-module-scss-module__rPxahq__error",highlight:"YextResultCardAskAQuestion-module-scss-module__rPxahq__highlight","sr-only":"YextResultCardAskAQuestion-module-scss-module__rPxahq__sr-only",title:"YextResultCardAskAQuestion-module-scss-module__rPxahq__title","title-description":"YextResultCardAskAQuestion-module-scss-module__rPxahq__title-description","title-wrapper":"YextResultCardAskAQuestion-module-scss-module__rPxahq__title-wrapper"})},129706,i=>{"use strict";var r=i.i(677076),n=i.i(956028),a=i.i(117243);let o={apiKey:"4a8383e85bab30d0436cf4d1d859520d",experienceKey:"new-hca-search",locale:"en_GB",environment:i.i(142377).Environment.PRODUCTION},s=(0,a.provideHeadless)(o);i.s(["default",0,i=>{let{children:a}=i;return(0,r.jsx)(n.SearchHeadlessProvider,{searcher:s,children:a})},"headlessConfig",0,o])},319346,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(560071),o=i.i(598842),s=i.i(783769),l=i.i(832665),u=i.i(153320),c=i.i(956028),d=i.i(925150),h=i.i(341754),f=i.i(44629),p=i.i(249736),m=i.i(123768),g=i.i(5254),_=i.i(554283),y=i.i(257818),v=i.i(215904),x=i.i(128904),b=i.i(969209),w=i.i(630077),T=i.i(966749),E=i.i(77688),S=i.i(902841),A=i.i(611571);let C=i=>{let{result:n}=i,{rawData:a}=n,{c_overallExperience:o,c_totalReviews:s,c_body:l,c_specialty:u,mainPhone:c,headshot:d,name:h,websiteUrl:f}=a,p={url:f?.url,label:"View profile"},m=u?.map(i=>i.keywordName)?.join(", "),g=(0,A.tidySearchDescription)(l);return(0,r.jsx)(x.default,{image:d?.url?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(v.default,{alt:"headshot of "+h,src:d?.url,width:d?.width,height:d?.height})}):void 0,title:(0,r.jsx)(y.default,{tag:"h3",variation:"heading-1",children:h}),copy:g?(0,r.jsx)(y.default,{tag:"div",variation:"body-large",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:g}})}):void 0,cta:(0,r.jsx)("a",{href:p.url,children:p.label}),doctify:(0,r.jsx)(b.default,{alignment:"left",link:(0,r.jsx)("a",{href:"#"}),rating:o,reviews:s,logo:{dark:(0,r.jsx)(v.default,{src:T.default,alt:"doctify logo",width:"83",height:"21"}),light:(0,r.jsx)(v.default,{src:E.default,alt:"doctify logo",width:"83",height:"21"})}}),phone:c?(0,r.jsx)(S.default,{variation:"body-large",children:(0,r.jsxs)("a",{href:`tel:${c}`,children:[(0,r.jsx)(w.default,{iconName:"iconPhone"}),(0,r.jsx)("span",{children:c})]})}):void 0,specialties:m?{icon:(0,r.jsx)(w.default,{iconName:"iconStethoscope"}),text:(0,r.jsx)(y.default,{variation:"body-large",tag:"span",children:m})}:void 0})};var I=i.i(714730);let k=i=>{let{result:n}=i,{name:a,rawData:o}=n,{c_uRL:s,c_answersPrimaryCallToAction:l,c_abstractText:u,c_pageText:c,c_nameRichText:d,c_abstractTitle:h,c_pageTitle:f}=o,p=(0,A.tidySearchDescription)(u||c);return(0,r.jsx)(I.default,{image:void 0,title:(0,r.jsx)(y.default,{tag:"h3",variation:"heading-1",children:d||h||f||a||""}),copy:p?(0,r.jsx)(y.default,{tag:"div",variation:"body-large",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:p}})}):void 0,ctas:{button:s?(0,r.jsxs)("a",{href:s,children:["Learn ",(0,r.jsx)("b",{children:"more"})]}):void 0,textButton:l?.link?(0,r.jsxs)("a",{href:l?.link,children:[(0,r.jsx)(w.default,{iconName:"iconStethoscope"}),(0,r.jsxs)("span",{children:["Find a ",(0,r.jsx)("b",{children:"consultant"})]})]}):void 0}})};var R=i.i(252971);let M=i=>
122{let[a,o]=(0,n.useState)(!1),{title:s,children:l}=i;return(0,r.jsx)(R.default,{title:s,children:l,onShow:()=>{o(!a)},isActive:a})};var L=i.i(443107);let P=i=>{let{result:n}=i,{rawData:a}=n,{answer:o,question:s,c_answersPrimaryCallToAction:l,c_uRL:u}=a;return(0,r.jsx)(M,{title:s,children:(0,r.jsxs)(r.Fragment,{children:[o||"",u?(0,r.jsx)(L.default,{size:"large",variation:"full",children:(0,r.jsx)("a",{href:u,children:(0,r.jsx)("span",{children:l?.label})})}):(0,r.jsx)(r.Fragment,{})]})})},O=i=>{let{result:n}=i,{name:a,link:o,description:s}=n;return(0,r.jsx)(I.default,{title:(0,r.jsx)(y.default,{tag:"h3",variation:"heading-1",children:a}),copy:s?(0,r.jsx)(y.default,{tag:"div",variation:"body-large",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s}})}):void 0,ctas:{button:(0,r.jsx)("a",{href:o,children:a})}})},D=i=>{let{result:n}=i,{name:a,rawData:o}=n,{c_body:s,c_uRL:l,c_primaryImage:u}=o,c=a&&u?.url?{alt:a,src:u?.url,width:u?.width,height:u?.height}:void 0;return(0,r.jsx)(I.default,{image:c?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(v.default,{...c})}):void 0,title:(0,r.jsx)(y.default,{tag:"h3",variation:"heading-1",children:a}),copy:s?(0,r.jsx)(y.default,{tag:"div",variation:"body-large",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s}})}):void 0,ctas:{button:(0,r.jsxs)("a",{href:l,children:["Learn ",(0,r.jsx)("b",{children:"more"})]})}})},F=i=>{let{result:n}=i,{rawData:a}=n,{c_answersPrimaryCallToAction:o,c_nameRichText:s,c_primaryImage:l,c_servicesImage:u,c_uRL:c,name:d,c_abstractTitle:h,c_abstractText:f,c_pageTitle:p,c_abstractImage:m,c_pageImage:g}=a,_=s||h||p||d||"",x=(0,A.tidySearchDescription)(f),b=u||l,T=m||g,E=d&&b?.url?{alt:d,src:b?.url,width:b?.width,height:b?.height}:d&&T?{alt:d,src:T,width:480,height:384}:void 0;return(0,r.jsx)(I.default,{image:E?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(v.default,{...E})}):void 0,title:(0,r.jsx)(y.default,{tag:"h3",variation:"heading-1",children:_}),copy:x?(0,r.jsx)(y.default,{tag:"div",variation:"body-large",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:x}})}):void 0,ctas:{button:c?(0,r.jsxs)("a",{href:c,children:["Learn ",(0,r.jsx)("b",{children:"more"})]}):void 0,textButton:o?.link?(0,r.jsxs)("a",{href:o?.link,children:[(0,r.jsx)(w.default,{iconName:"iconStethoscope"}),(0,r.jsxs)("span",{children:["Find a ",(0,r.jsx)("b",{children:"consultant"})]})]}):void 0}})};i.i(589295);var N=i.i(49640);let j=i=>{let{number:n,size:a="large"}=i;return(0,r.jsx)("span",{className:`${N.default.wrapper} ${N.default[a]}`,children:n})};var z=i.i(951864),B=i.i(878044),U=i.i(978972);let V=(0,n.forwardRef)((i,a)=>{let{center:o,apiKey:s,callback:l}=i;return(0,n.useMemo)(()=>(0,r.jsx)(B.default,{ref:a,fullscreenControl:!1,mapTypeControl:!1,apiKey:s,callback:l,zoom:10,styles:U.default,center:o}),[s,l,o,a])});var H=i.i(211452),G=i.i(861486),q=i.i(360227),$=i.i(511730);let W=i=>{let{center:a,locations:o=[],apiKey:s,variation:l="stacked",title:u}=i,h=(0,G.default)(),f=(0,c.useSearchActions)(),p=(0,n.useRef)(null),[m,g]=(0,n.useState)(),_=(0,c.useSearchState)(i=>i),[v,x]=(0,n.useState)(!0),[b,T]=(0,n.useState)(!1),[E]=(0,n.useState)(a),[S,A]=(0,n.use
122State)([]),C=(0,n.useRef)(null),I=(0,n.useRef)([]);(0,n.useEffect)(()=>{let i=o?.map((i,r)=>(({id:i,center:r,callback:n})=>{let a=`data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 28.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg width='37' height='44' version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 37 44' style='enable-background:new 0 0 37 44;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill-rule:evenodd;clip-rule:evenodd;fill:%230C2141;%7D .st1%7Bfill:%23FFFFFF;%7D .st2%7Bfont-family:Mark, arial, helvetica, sans-serif;%7D .st3%7Bfont-size:18px;%7D .st4%7Bfont-weight: 700;%7D%0A%3C/style%3E%3Cpath class='st0' d='M18.5,44c0,0,18.5-12.3,18.5-26.4c0-4.7-2.6-9.1-6-12.4C27.7,1.9,23.2,0,18.5,0S9.3,1.9,6,5.2 c-3.3,3.3-6,7.8-6,12.4C0,30.2,18.5,44,18.5,44z'/%3E%3Ctext transform='matrix(1 0 0 1 13.562 24.9067)' class='st1 st2 st3 st4'%3E${i}%3C/text%3E%3C/svg%3E%0A`,o=new window.google.maps.Marker({position:r,map:C.current,icon:a});return o.addListener("click",()=>{n?.()}),{marker:o,activeIcon:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='37' height='44' viewBox='0 0 37 44' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M18.4956 44C18.4956 44 36.9911 31.7345 36.9911 17.6C36.9911 12.9322 34.3458 8.45556 31.0233 5.15492C27.7007 1.85428 23.1944 0 18.4956 0C13.7968 0 9.29044 1.85428 5.9679 5.15492C2.64535 8.45556 0 12.9322 0 17.6C0 30.177 18.4956 44 18.4956 44ZM25.7071 13.7071C26.0976 13.3166 26.0976 12.6834 25.7071 12.2929C25.3166 11.9024 24.6834 11.9024 24.2929 12.2929L15 21.5858L11.7071 18.2929C11.3166 17.9024 10.6834 17.9024 10.2929 18.2929C9.90237 18.6834 9.90237 19.3166 10.2929 19.7071L14.2929 23.7071C14.6834 24.0976 15.3166 24.0976 15.7071 23.7071L25.7071 13.7071Z' fill='%230C2141'/%3E%3C/svg%3E",inactiveIcon:a}})({...i,callback:()=>{let n=p?.current?.children,a=n?.[r];a?.scrollIntoView({behavior:"smooth"}),g(i.id);let o=I.current;o?.forEach(({marker:i,activeIcon:n,inactiveIcon:a},o)=>{o==r?i.setIcon(n):i.setIcon(a)})}}));return A(i),()=>{i.forEach(i=>{i.marker.setMap(null)})}},[o]),(0,n.useEffect)(()=>{let i=C.current;if(!i||!S.length)return;let r=new google.maps.LatLngBounds;[...S.values()].map(i=>i.marker.getPosition()).forEach(i=>{i?.lat()&&i.lng()&&r?.extend({lat:i?.lat(),lng:i?.lng()})}),b||i.fitBounds(r)},[S,b]);let k=(0,n.useCallback)(()=>{let i=C.current;if(!v||!i)return;let r=i.getCenter(),n=r?.lat(),a=r?.lng(),o=(i=>{let r=i.getBounds();if(!r)return;
122let n=r.getSouthWest(),a=r.getNorthEast();return google.maps.geometry.spherical.computeDistanceBetween(n,a)})(i);if(!n||!a||!o)return;let s={filter:{fieldId:"builtin.location",value:{lat:n,lng:a,radius:.4*o},kind:"fieldValue",matcher:q.Matcher.Near},selected:!0,displayName:"builtin.location"};T(!0),_?.vertical?.verticalKey&&(f.setStaticFilters([]),f.setFilterOption(s),f.setOffset(0),f.executeVerticalQuery())},[f,v,_?.vertical?.verticalKey]);(0,n.useEffect)(()=>{T(!1),f.setStaticFilters([])},[f,_.query.input,_.vertical.offset,_.vertical.verticalKey]);let R=(0,n.useCallback)(i=>{i.addListener("dragend",k),v||i.addListener("zoom_changed",k)},[k,v]);return(0,r.jsxs)("div",{className:[z.default.wrapper,z.default[l]].join(" "),children:[u&&"stacked"===l&&(0,r.jsx)(y.default,{tag:"h2",variation:"heading-1",children:u}),(0,r.jsxs)("div",{className:z.default.grid,children:[(0,r.jsxs)("div",{ref:p,className:z.default.cards,children:[o.map(({card:i,id:n})=>(0,r.jsx)("div",{className:[z.default.card,n===m?z.default.selected:""].join(" "),children:i},n)),0===o.length&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(d.AlternativeVerticals,{currentVerticalLabel:"Locations",verticalConfigMap:ei,displayAllOnNoResults:!1})}),!!o?.length&&"side-by-side"===l&&(0,r.jsx)($.default,{label:"Search when map moves",name:"search-on-move",value:"search-on-move",checked:v,onChange:()=>{v&&(f.setStaticFilters([]),_?.vertical?.verticalKey?f.executeVerticalQuery():f.executeUniversalQuery()),x(!v)},id:"search-on-move"})]}),(0,r.jsx)("div",{className:z.default["map-column"],children:(0,r.jsx)("div",{className:z.default.map,children:(0,r.jsx)(V,{ref:C,apiKey:s,center:E,callback:R})})})]}),"stacked"===l&&(0,r.jsx)(H.default,{children:(0,r.jsxs)("button",{onClick:()=>{window.scrollTo({top:0,behavior:"smooth"}),setTimeout(()=>{h("healthcare_facilities")},1e3)},children:[(0,r.jsx)("span",{children:"View all"}),(0,r.jsx)(w.default,{iconName:"iconArrowRight"})]})})]})},Y=i=>{let{center:a,locations:o=[],apiKey:s,variation:l="stacked",title:u}=i,c=(0,G.default)(),h=(0,n.useRef)(null),[f,p]=(0,n.useState)(),[m]=(0,n.useState)(a),g=(0,n.useRef)(null),_=(0,n.useRef)([]),v=(0,n.useCallback)(i=>{let r=o?.map((r,n)=>(({id:r,center:n,callback:a})=>{let o=`data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 28.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg width='37' height='44' version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 37 44' style='enable-background:new 0 0 37 44;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill-rule:evenodd;clip-rule:evenodd;fill:%230C2141;%7D .st1%7Bfill:%23FFFFFF;%7D .st2%7Bfont-family:Mark, arial, helvetica, sans-serif;%7D .st3%7Bfont-size:18px;%7D .st4%7Bfont-weight: 700;%7D%0A%3C/style%3E%3Cpath class='st0' d='M18.5,44c0,0,18.5-12.3,18.5-26.4c0-4.7-2.6-9.1-6-12.4C27.7,1.9,23.2,0,18.5,0S9.3,1.9,6,5.2 c-3.3,3.3-6,7.8-6,12.4C0,30.2,18.5,44,18.5,44z'/%3E%3Ctext transform='matrix(1 0 0 1 13.562 24.9067)' class='st1 st2 st3 st4'%3E${r}%3C/text%3E%3C/svg%3E%0A`,s=new window.google.maps.Marker({position:n,map:i,icon:o});return s.addListener("click",()=>{a?.()}),{marker:s,activeIcon:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='37' height='44' viewBox='0 0 37 44' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M18.4956 44C18.4956 44 36.9911 31.7345 36.9911 17.6C36.9911 12.9322 34.3458 8.45556 31.0233 5.15492C27.7007 1.85428 23.1944 0 18.4956 0C13.7968 0 9.29044 1.85428 5.9679 5.15492C2.64535 8.45556 0 12.9322 0 17.6C0 30.177 18.4956 44 18.4956 44ZM25.7071 13.7071C26.0976 13.3166 26.0976 12.6834 25.7071 12.2929C25.3166 11.9024 24.6834 11.9024 24.2929 12.2929L15 21.5858L11.7071 18.2929C11.3166 17.9024 10.6834 17.9024 10.2929 18.2929C9.90237 18.6834 9.90237 19.3166 10.2929 19.7071L14.2929 23.7071C14.6834 24.0976 15.3166 24.0976 15.7071 23.7071L25.7071 13.7071Z' fill='%230C2141'/%3E%3C/svg%3E",inactiveIcon:o}})({...r,callback:()=>{let i=h?.current?.children,a=i?.[n];a?.scrollIntoView({behavior:"smooth"}),p(r.id);let o=_.current;o?.forEach(({marker:i,activeIcon:r,inactiveIcon:a},o)=>{o==n?i.setIcon(r):i.setIcon(a)})}})),n=new google.maps.LatLngBounds;return[...r.values()].map(i=>
122i.marker.getPosition()).forEach(i=>{i?.lat()&&i.lng()&&n?.extend({lat:i?.lat(),lng:i?.lng()})}),i.fitBounds(n),()=>{r.forEach(i=>{i.marker.setMap(null)})}},[o]);return(0,r.jsxs)("div",{className:[z.default.wrapper,z.default[l]].join(" "),children:[u&&"stacked"===l&&(0,r.jsx)(y.default,{tag:"h2",variation:"heading-1",children:u}),(0,r.jsxs)("div",{className:z.default.grid,children:[(0,r.jsxs)("div",{ref:h,className:z.default.cards,children:[o.map(({card:i,id:n})=>(0,r.jsx)("div",{className:[z.default.card,n===f?z.default.selected:""].join(" "),children:i},n)),0===o.length&&(0,r.jsx)(d.AlternativeVerticals,{currentVerticalLabel:"Locations",verticalConfigMap:ei})]}),(0,r.jsx)("div",{className:z.default["map-column"],children:(0,r.jsx)("div",{className:z.default.map,children:(0,r.jsx)(V,{ref:g,apiKey:s,center:m,callback:v})})})]}),"stacked"===l&&(0,r.jsx)(H.default,{children:(0,r.jsxs)("button",{onClick:()=>{window.scrollTo({top:0,behavior:"smooth"}),setTimeout(()=>{c("healthcare_facilities")},1e3)},children:[(0,r.jsx)("span",{children:"View all"}),(0,r.jsx)(w.default,{iconName:"iconArrowRight"})]})})]})};var Z=i.i(222235);let K=i=>{let{number:n,image:a,title:o,address:s,phone:l,distance:u,ctas:c,openingHours:d,variation:h="stacked"}=i;return(0,r.jsxs)("div",{className:[Z.default.wrapper,Z.default[h]].join(" "),children:[(0,r.jsx)("div",{className:Z.default.image,children:a&&a}),(0,r.jsxs)("div",{className:Z.default.content,children:[(0,r.jsxs)("div",{className:Z.default.heading,children:[n&&(0,r.jsx)("div",{className:Z.default.number,children:n}),o&&(0,r.jsx)("div",{className:Z.default.title,children:o}),u&&(0,r.jsx)("div",{className:Z.default.distance,children:u})]}),(0,r.jsxs)("div",{className:Z.default.inner,children:[(0,r.jsxs)("div",{className:Z.default.address,children:[(0,r.jsx)("span",{children:s.icon}),(0,r.jsx)("span",{children:s.text})]}),(0,r.jsxs)("div",{className:Z.default.column,children:[l&&(0,r.jsxs)("div",{className:Z.default.phone,children:[(0,r.jsx)("span",{children:l.icon}),(0,r.jsx)("span",{children:l.text})]}),d&&(0,r.jsxs)("div",{className:Z.default.opening,children:[(0,r.jsx)("span",{children:d.icon}),(0,r.jsx)("span",{children:d.text})]})]}),c&&(0,r.jsxs)("div",{className:Z.default.ctas,children:[c.button&&(0,r.jsx)(L.default,{variation:"full",size:"small",contentVariation:"card",children:c.button}),c.textButton&&(0,r.jsx)(H.default,{children:c.textButton})]})]})]})]})},X=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Q=i=>{let{variation:n="stacked",results:a}=i,o={apiKey:"AIzaSyCJu0aTsRYKOQVPsETLeTvI84jxDZjRGAg",center:{lat:51.5072,lng:.1276},locations:a?.map((i,a)=>{let{address:o,name:s,mainPhone:l,yextDisplayCoordinate:u,closed:c,hours:d,c_heroImage:h,c_abstractImage:f,c_pageImage:p,googlePlaceId:m,c_uRL:g,c_abstractTitle:_,c_pageTitle:x}=i.rawData,b=f||p,T=_||x||s||"",E=s&&h?.url?{alt:h.alternateText||"",src:h?.url,width:h?.width,height:h?.height}:s&&b?{alt:s,src:b,width:480,height:384}:void 0,S=(a+1).toString(),A=new Date().getDay(),C="";if(d)try{let i=d[X[A]];C=c?"Opens at "+i.openIntervals[0].start:i.openIntervals[0].end?"Closes at "+i.openIntervals[0].end:"Open 24h"}catch{}let I=i.rawData.geocodedCoordinate||i.rawData.displayCoordinate,k={number:(0,r.jsx)(j,{number:(0,r.jsx)("span",{children:S})}),image:E?(0,r.jsx)(v.default,{...E}):void 0,title:(0,r.jsx)(y.default,{variation:"heading-1",children:g?(0,r.jsx)("a",{href:g,children:T}):T}),distance:(0,r.jsxs)(y.default,{variation:"body-large",children:[Math.round(Number(i.distance)/100)/10,"km"]}),ctas:{button:(0,r.jsxs)("a",{href:"tel:"+l,children:[(0,r.jsx)(w.default,{iconName:"iconPhone"}),"Call"]}),textButton:I||m?m?(0,r.jsxs)("a",{target:"_blank",rel:"noopener noreferrer",href:`https://maps.google.com/?q=place_id:${m}`,children:[(0,r.jsx)(w.default,{iconName:"iconRedo"}),"Get directions"]}):(0,r.jsxs)("a",{target:"_blank",rel:"noopener noreferrer",href:`https://maps.google.com/?q=${I?.latitude},${I?.longitude}`,children:[(0,r.jsx)(w.default,{iconName:"iconRedo"}),"Get directions"]}):void 0},address:{icon:(0,r.jsx)(w.default,{iconName:"iconPin"}),text:o&&(0,r.jsxs)(y.default,{variation:"body-large",tag:"span",children:[o.line1,", ",o.line2," ",o.
122city," ",o.postalCode]})},phone:l?{icon:(0,r.jsx)(w.default,{iconName:"iconPhone"}),text:(0,r.jsx)(y.default,{variation:"body-large",tag:"span",children:l})}:void 0,openingHours:C?.length?{icon:(0,r.jsx)(w.default,{iconName:"iconClock"}),text:(0,r.jsxs)(y.default,{variation:"body-large",tag:"span",children:[(0,r.jsx)("strong",{children:c?"Closed.":"Open Now."})," ",C]})}:void 0};return{id:S,card:(0,r.jsx)(K,{...k,number:(0,r.jsx)(j,{number:(0,r.jsx)("span",{children:S})}),variation:n}),center:{lat:u?.latitude||51.5072,lng:u?.longitude||.1276}}}),title:"Locations"};return"side-by-side"===n?(0,r.jsx)(W,{...o,variation:n}):(0,r.jsx)(Y,{...o,variation:n})},J=({results:i,CardComponent:n,title:a,verticalKey:s})=>{let l=(0,G.default)();return n?(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:o.default.heading,children:a}),(0,r.jsx)("div",{className:o.default.vertical,children:i.map((i,a)=>(0,r.jsx)(n,{result:i},a))}),s&&(0,r.jsx)(H.default,{children:(0,r.jsxs)("button",{onClick:()=>{window.scrollTo({top:0,behavior:"smooth"}),setTimeout(()=>{l(s)},1e3)},children:[(0,r.jsx)("span",{children:"View all"}),(0,r.jsx)(w.default,{iconName:"iconArrowRight"})]})})]}):(0,r.jsx)("div",{children:"Missing Card Component"})};var ee=i.i(635875);let et=i=>{let{result:n}=i,{rawData:a}=n,{landingPageUrl:o,c_jobLocation:s,c_employmentType:l,name:u,c_jobFunction:c}=a,d=(0,r.jsx)(y.default,{variation:"heading-1",children:u}),h=(0,r.jsx)(L.default,{contentVariation:"full-width",variation:"full",size:"small",children:(0,r.jsx)("a",{href:o,children:(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{children:"Read More & "}),(0,r.jsx)("strong",{children:"Apply"})]})})});return(0,r.jsx)(ee.default,{location:s,clinical:c,timing:l,title:d,cta:h})},ei={healthcare_facilities:{label:"Locations",SectionComponent:i=>(0,r.jsx)(Q,{results:i.results,variation:"stacked"})},articles:{label:"Articles",SectionComponent:i=>(0,r.jsx)(J,{results:i.results,CardComponent:_.default,title:"Articles",verticalKey:"articles"})},tests_and_treatments:{label:"Tests & Treatments",SectionComponent:i=>(0,r.jsx)(J,{results:i.results,CardComponent:F,title:"Tests & Treatments",verticalKey:"tests_and_treatments"})},treatments:{label:"",SectionComponent:()=>null},conditions:{label:"Conditions",SectionComponent:i=>(0,r.jsx)(J,{results:i.results,CardComponent:F,title:"Conditions",verticalKey:"conditions"})},specialties:{label:"Departments",SectionComponent:i=>(0,r.jsx)(J,{results:i.results,CardComponent:k,title:"Departments",verticalKey:"specialties"})},healthcare_professionals:{label:"Consultants",SectionComponent:i=>(0,r.jsx)(J,{results:i.results,CardComponent:C,title:"Consultants",verticalKey:"healthcare_professionals"})},faqs:{label:"FAQs",SectionComponent:i=>(0,r.jsx)(J,{results:i.results,CardComponent:P,title:"FAQs",verticalKey:"faqs"})},links:{label:"Links",SectionComponent:i=>(0,r.jsx)(J,{results:i.results,CardComponent:O,title:"Links"})},jobs:{label:"Vacancies",SectionComponent:i=>(0,r.jsx)(J,{results:i.results,CardComponent:et,title:"Vacancies"})},scans:{label:"Scans",SectionComponent:i=>(0,r.jsx)(J,{results:i.results,CardComponent:D,title:"Scans"})},patientstories:{label:"Patient Stories",SectionComponent:i=>(0,r.jsx)(J,{results:i.results,CardComponent:D,title:"Patient Stories"})},promotion:{label:"Promotion",SectionComponent:i=>(0,r.jsx)(J,{results:i.results,CardComponent:D,title:"Promotion"})}};var er=i.i(219435);let en=i=>{let[a,o]=(0,n.useState)(!1),{title:s,titleDescription:l,children:u}=i;return(0,r.jsx)(R.default,{title:(0,r.jsxs)("div",{className:er.default["title-wrapper"],children:[(0,r.jsx)("div",{className:er.default.title,children:s}),l&&(0,r.jsx)("div",{className:er.default["title-description"],children:l})]}),onShow:()=>{o(!a)},isActive:a,children:(0,r.jsx)("div",{className:er.default.children,children:u})})};var ea=i.i(953102),eo=i.i(623420),es=i.i(144077),el=i.i(129706);let eu=()=>{let i=(0,n.useRef)(null),a=(0,n.useRef)(null),[o,s]=(0,n.useState)(!1),[l,u]=(0,n.useState)(!1),[d,h]=(0,n.useState)(0),[f,p]=(0,n.useState)([]),m=(0,c.useSearchState)(i=>i.query.mostRecentSearch);return(0,n.useEffect)(()=>
122{if(i){let i=a?.current?.getBoundingClientRect();i&&h(i.top)}},[a]),(0,r.jsx)(en,{title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{ref:a}),(0,r.jsx)(w.default,{iconName:"iconQuestion"}),(0,r.jsx)(y.default,{variation:"heading-2",children:"Ask a question"})]}),titleDescription:(0,r.jsx)(y.default,{children:"Can't find what you're looking for? Ask a question below."}),children:l?(0,r.jsx)(y.default,{variation:"body-bold-extra-large",children:"Thank you for your question!"}):(0,r.jsxs)("form",{method:"POST",ref:i,onSubmit:async r=>{r.preventDefault();let n=i.current;if(!n||o)return;s(!0);let{method:a,action:l}=n,c=new FormData(n),h=await fetch(l,{method:a,body:JSON.stringify({email:c.get("email"),entityId:c.get("entityId"),name:c.get("name"),questionLanguage:c.get("questionLanguage"),questionText:c.get("questionText"),site:c.get("site")}),headers:new Headers({"Content-Type":"application/json"})}),f=await h.json(),m=f.meta.errors?.map(i=>({...i,message:22===i.code?"Invalid email address. Please review your entry and try submitting your question again.":i.message}))||[];m.length?(p(m),s(!1)):(s(!1),u(!0)),window.scroll({top:d,left:0,behavior:"smooth"})},action:`https://liveapi.yext.com/v2/accounts/me/createQuestion?v=20220511&api_key=${el.headlessConfig.apiKey}&sessionTrackingEnabled=false&jsLibVersion=v1.14.3`,children:[(0,r.jsx)(y.default,{variation:"body-extra-large",children:"Enter your question and contact information, and we'll get back to you with a response shortly."}),(0,r.jsx)("input",{type:"hidden",name:"entityId",value:"org-1"}),(0,r.jsx)("input",{type:"hidden",name:"questionLanguage",value:"en_GB"}),(0,r.jsx)("input",{type:"hidden",name:"site",value:"FIRSTPARTY"}),(0,r.jsx)(es.default,{id:"questionText",label:"Question",name:"questionText",required:!0,errorMessage:"This field is required",defaultValue:m}),(0,r.jsx)(ea.default,{id:"name",name:"name",label:"Name",required:!0,errorMessage:"This field is required"}),(0,r.jsx)(ea.default,{id:"email",name:"email",label:"Email",required:!0,errorMessage:"Please enter a valid email address."}),(0,r.jsx)(eo.default,{id:"privacyPolicy",label:(0,r.jsxs)("span",{children:["By submitting my email address, I consent to being contacted via email at the address provided."," ",(0,r.jsx)("a",{href:"https://www.hcahealthcare.co.uk/legal/privacy-policy",children:"Learn more here."})]}),name:"privacyPolicy",required:!0,errorMessage:"You must agree to the privacy policy to submit a question."}),(0,r.jsx)("div",{className:er.default.error,children:f?.map((i,n)=>(0,r.jsx)(y.default,{children:i.message},n))}),(0,r.jsx)(L.default,{variation:"full",size:"large",contentVariation:"card",children:(0,r.jsx)("button",{disabled:o,type:"submit",children:"Submit"})})]})})},ec=()=>{let i=(0,c.useSearchState)(i=>i),n=i.vertical.verticalKey,s=i.vertical.results;switch(n){case"healthcare_facilities":return(0,r.jsx)(Q,{results:s||[],variation:"side-by-side"});case"healthcare_professionals":return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(a.VerticalResults,{CardComponent:C,customCssClasses:{verticalResultsContainer:o.default.vertical}})});case"faqs":return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.VerticalResults,{CardComponent:P,customCssClasses:{verticalResultsContainer:o.default.vertical}}),(0,r.jsx)(eu,{})]});case"tests_and_treatments":return(0,r.jsx)(a.VerticalResults,{CardComponent:F,customCssClasses:{verticalResultsContainer:o.default.vertical}});case"articles":return(0,r.jsx)(a.VerticalResults,{CardComponent:_.default,customCssClasses:{verticalResultsContainer:o.default.vertical}});case"specialties":return(0,r.jsx)(a.VerticalResults,{CardComponent:k,customCssClasses:{verticalResultsContainer:o.default.vertical}});case"links":return(0,r.jsx)(a.VerticalResults,{CardComponent:O,customCssClasses:{verticalResultsContainer:o.default.vertical}});case"jobs":return(0,r.jsx)(a.VerticalResults,{CardComponent:et,customCssClasses:{verticalResultsContainer:o.default.vertical}});default:return(0,r.jsx)(r.Fragment,{})}};i.s(["default",0,()=>{let i=(0,c.useSearchState)(i=>i.query.input),_=(0,c.useSearchState)(i=>i.vertical.verticalKey),y=(0,c.useSearchActions)(),[v,x]=(0,n.use
122State)(!1),b=(0,m.useRouter)(),w=(0,m.usePathname)();(0,n.useEffect)(()=>{let r=new URLSearchParams(location.search);if(i)r.set("query",i),b.push(`${w}?${r.toString()}`,{scroll:!1});else if(!v){let i=r.get("query");y.setQuery(i||""),_?y.executeVerticalQuery():y.executeUniversalQuery()}x(!0)},[v,w,b,y,i,_]);let T=(0,n.useRef)(null),E=(0,c.useSearchState)(i=>i.searchStatus.isLoading),S=(0,c.useSearchState)(i=>i.universal.verticals),A=S?.length||0,C=(0,c.useSearchState)(i=>i.vertical?.resultsCount)||0;return(0,r.jsx)("div",{className:o.default.wrapper,children:(0,r.jsxs)("div",{className:o.default.inner,children:[(0,r.jsx)(l.default,{}),(0,r.jsx)("div",{ref:T,className:o.default.tabs,children:(0,r.jsx)(s.default,{})}),(0,r.jsxs)("div",{className:o.default.header,children:[(0,r.jsx)(f.ResultsCount,{customCssClasses:{resultsCountContainer:o.default.results}}),(0,r.jsx)("div",{className:o.default.filters,children:(0,r.jsx)(h.default,{})})]}),A>0&&!E?(0,r.jsx)(a.UniversalResults,{verticalConfigMap:ei}):""!==i&&!E&&!_&&(0,r.jsx)(g.default,{currentVerticalLabel:"",displayAllOnNoResults:!1}),!E&&_&&"healthcare_facilities"!==_&&C<=0&&(0,r.jsx)(p.default,{theme:"O-HCA-Teal-20",children:(0,r.jsx)(d.AlternativeVerticals,{currentVerticalLabel:ei[_]?.label||"",verticalConfigMap:ei})}),(0,r.jsx)(ec,{}),(0,r.jsx)(u.default,{callback:()=>{T?.current?.scrollIntoView({behavior:"smooth"})}})]})})}],319346)},308943,i=>{"use strict";var r=i.i(677076),n=i.i(770705),a=i.i(2317);let o=async i=>{n.default.post("/api/formAPI/PostLogEmail",{profileType:"404Report",freeText:i}).catch(i=>{console.error(i)})};i.s(["default",0,()=>((0,a.useEffect)(()=>{o(`user landed on 404 page from ${window.location.pathname}`)},[]),(0,r.jsx)(r.Fragment,{}))])},423053,i=>{i.v({carousel:"CarouselReviews-module-scss-module__qGHUgq__carousel",container:"CarouselReviews-module-scss-module__qGHUgq__container",doctify:"CarouselReviews-module-scss-module__qGHUgq__doctify",highlight:"CarouselReviews-module-scss-module__qGHUgq__highlight",image:"CarouselReviews-module-scss-module__qGHUgq__image","slick-wrapper":"CarouselReviews-module-scss-module__qGHUgq__slick-wrapper","sr-only":"CarouselReviews-module-scss-module__qGHUgq__sr-only",stars:"CarouselReviews-module-scss-module__qGHUgq__stars",wrapper:"CarouselReviews-module-scss-module__qGHUgq__wrapper"})},869500,i=>{"use strict";var r,n,a,o=i.i(677076),s=i.i(423053),l=i.i(257818),u=i.i(630077),c=i.i(215904),d=i.i(249736),h=i.i(714443),f=i.i(519064),p=i.i(966749),m=i.i(77688),g=i.i(2317);function _(){return(_=Object.assign.bind()).apply(null,arguments)}let y=function(i){return g.createElement("svg",_({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 26 26"},i),r||(r=g.createElement("path",{fill:"#96A2A4",fillRule:"evenodd",d:"M16.904 8.604a1.09 1.09 0 0 1-.821-.614l-3.154-6.72a.316.316 0 0 0-.572 0L9.203 7.99a1.09 1.09 0 0 1-.82.614l-7.026 1.08a.316.316 0 0 0-.178.532l5.124 5.248c.241.247.351.595.295.936l-1.212 7.43c-.02.12.031.24.13.31l-.627.89a1.4 1.4 0 0 1-.578-1.375l1.212-7.43L.4 10.977a1.405 1.405 0 0 1 .791-2.37l7.026-1.08L11.37.808a1.405 1.405 0 0 1 2.544 0l3.154 6.72 7.026 1.08a1.405 1.405 0 0 1 .791 2.37l-5.123 5.248 1.211 7.43a1.404 1.404 0 0 1-2.066 1.455l-6.265-3.464-6.265 3.464c-.471.26-1.05.23-1.49-.08l.628-.89c.099.069.229.076.334.017l6.266-3.464a1.09 1.09 0 0 1 1.054 0l6.265 3.464a.316.316 0 0 0 .465-.327l-1.212-7.43a1.09 1.09 0 0 1 .295-.936l5.124-5.248a.315.315 0 0 0-.178-.532z",clipRule:"evenodd"})))};function v(){return(v=Object.assign.bind()).apply(null,arguments)}let x=function(i){return g.createElement("svg",v({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 26 26"},i),n||(n=g.createElement("path",{fill:"#96A2A4",fillRule:"evenodd",d:"M16.904 8.604a1.09 1.09 0 0 1-.821-.614l-3.154-6.72a.316.316 0 0 0-.572 0L9.203 7.99a1.09 1.09 0 0 1-.82.614l-7.026 1.08a.316.316 0 0 0-.178.532l5.124 5.248c.241.247.351.595.295.936l-1.212 7.43c-.02.12.031.24.13.31l-.627.89a1.4 1.4 0 0 1-.578-1.375l1.212-7.43L.4 10.977a1.405 1.405 0 0 1 .791-2.37l7.026-1.08L11.37.808a1.405 1.405 0 0 1 2.544 0l3.154 6.72 7.
122026 1.08a1.405 1.405 0 0 1 .791 2.37l-5.123 5.248 1.211 7.43a1.404 1.404 0 0 1-2.066 1.455l-6.265-3.464-6.265 3.464c-.471.26-1.05.23-1.49-.08l.628-.89c.099.069.229.076.334.017l6.266-3.464a1.09 1.09 0 0 1 1.054 0l6.265 3.464a.316.316 0 0 0 .465-.327l-1.212-7.43a1.09 1.09 0 0 1 .295-.936l5.124-5.248a.315.315 0 0 0-.178-.532z",clipRule:"evenodd"})),a||(a=g.createElement("path",{fill:"currentColor",d:"M12.643 0c.545 0 1.04.315 1.272.808l3.154 6.72L6.378 25.11a1.404 1.404 0 0 1-2.067-1.455l1.212-7.43L.4 10.977a1.405 1.405 0 0 1 .791-2.37l7.026-1.08L11.37.808A1.4 1.4 0 0 1 12.643 0"})))};i.s(["default",0,i=>{let{theme:r,rating:n,reviewCount:a,children:g,id:_,tableOfContentTitle:v,image:b}=i,w={speed:1200,slidesToShow:1,slidesToScroll:1,infinite:!0,className:s.default["slick-wrapper"],nextArrow:(0,o.jsx)(h.NextArrow,{}),prevArrow:(0,o.jsx)(h.PrevArrow,{})},T=[];for(let i=0;i<Math.floor(n);i++)T.push((0,o.jsx)(u.default,{iconName:"iconStar"}));Number.isInteger(n)||T.push((0,o.jsx)(x,{}));for(let i=0;i<5-Math.ceil(n);i++)T.push((0,o.jsx)(y,{}));return(0,o.jsx)(d.default,{theme:r,id:_,tableOfContentTitle:v,children:(0,o.jsxs)("div",{className:s.default.wrapper,children:[b&&(0,o.jsx)("div",{className:s.default.image,children:b}),(0,o.jsxs)("div",{className:s.default.container,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(l.default,{tag:"h2",variation:"display-1",children:n.toString()}),(0,o.jsx)("div",{className:s.default.stars,children:T.map((i,r)=>(0,o.jsx)("span",{children:i},r))}),(0,o.jsx)(l.default,{tag:"p",variation:"body-medium-extra-large",children:a})]}),(0,o.jsx)("div",{className:s.default.carousel,children:(0,o.jsx)(f.default,{...w,children:g})}),(0,o.jsxs)("div",{className:s.default.doctify,children:[(0,o.jsx)(l.default,{tag:"p",variation:"body-bold-large",children:(0,o.jsx)("span",{children:"Verified by"})}),(0,o.jsx)(c.default,{src:b?m.default:p.default,alt:"doctify logo",width:"83",height:"21"})]})]})]})})}],869500)},397175,i=>{"use strict";var r=i.i(677076),n=i.i(898205),a=i.i(314816),o=i.i(257818),s=i.i(450782),l=i.i(85008),u=i.i(203828),c=i.i(777912);let d=i=>i.page.mode.isEditing?(0,r.jsx)("div",{className:`component promo ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Content Carousel Extended. Please click to select datasource"})})}):(0,r.jsx)(r.Fragment,{});i.s(["Default",0,i=>{let h=i.page.mode.isEditing;if(!i.fields)return(0,r.jsx)(d,{...i});if(!i.fields?.Cards?.length&&!h)return(0,r.jsx)(r.Fragment,{});let f=s.inPageNavGlobalStore.addItem(i?.params,""),p=i?.params?.TableOfContentsLinkTitle,m=i.fields?.Cards?.map(i=>{let n=i?.fields?.Icon?.fields?.SvgMarkup48?.value||"",s=i?.fields?.Title?.value||h,l=i?.fields?.Text||h;return{image:(0,r.jsx)(u.default,{field:i?.fields?.Image,editable:!1,next:{width:456,height:253,sizes:"(max-width: 768px) 100vw, 30vw"}}),icon:i?.fields?.Icon?(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:n}}):void 0,title:s?i?.fields?.Title?.value:void 0,bodyText:l?(0,r.jsx)(o.default,{variation:"body-medium",tag:"div",children:(0,r.jsx)(a.RichText,{tag:"div",field:i.fields?.Text})}):void 0}})||[],{headingTag:g,subheadingTag:_}=(0,c.default)(i?.params,i.fields?.Heading?.value);return(0,r.jsx)(l.default,{title:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(o.default,{variation:i.params?.HeadingSize||"display-2",tag:g,children:(0,r.jsx)(n.Text,{field:i.fields?.Title})})}),subtitle:h?(0,r.jsx)(o.default,{tag:"span",variation:"subheading-1",children:(0,r.jsx)(n.Text,{field:i.fields?.Heading})}):i.fields?.Heading?.value?(0,r.jsx)(o.default,{tag:_,variation:"subheading-1",children:(0,r.jsx)(n.Text,{field:i.fields?.Heading})}):(0,r.jsx)(r.Fragment,{}),bodyText:(i.fields?.Text?.value||h)&&(0,r.jsx)(o.default,{tag:"div",variation:"body-medium",children:(0,r.jsx)(a.RichText,{tag:"div",field:i.fields?.Text})}),theme:i.params?.Theme||"B-HCA-Navy-Blue",id:f,...p&&i?.params?.ExcludeFromTableOfContents!=="1"?{tableOfContentTitle:p}:{},cards:m})}])},203846,i=>{i.v({container:"CarouselContent-module-scss-module__I0Qobq__container",highlight:"CarouselContent-module-scss-module__I0Qobq__highlight",image:"CarouselContent-module-scss-module__I0Qobq__image",noImagePadding:"CarouselContent-module-scss-module__I0Qobq__noImagePadding","slick-wrapper":"CarouselContent-module-scss-module__I0Qobq__slick-wrapper",slide:"CarouselContent-module-scss-module__I0Qobq__slide","sr-only":"CarouselContent-module-scss-module__I0Qobq__sr-only",text:"CarouselContent-module-scss-module__I0Qobq__text",wrapper:"CarouselContent-module-scss-module__I0Qobq__wrapper"})},45460,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(203846),o=i.i(249736),s=i.i(714443),l=i.i(519064);i.s(["default",0,i=>{let{slides:u,theme:c,id:d,tableOfContentTitle:h}=i,f=u.map((i,o)=>(0,r.jsx)(n.default.Fragment,{children:(0,r.jsxs)("div",{className:a.default.slide,children:[(0,r.jsx)("div",{className:a.default.image,children:i.image}),(0,r.jsxs)("div",{className:`${a.default.text} ${!i.image?a.default.noImagePadding:""}`,children:[i.title,i.body]})]})},o)),p={speed:1800,slidesToShow:1,slidesToScroll:1,infinite:!0,className:a.default["slick-wrapper"],nextArrow:(0,r.jsx)(s.NextArrow,{}),prevArrow:(0,r.jsx)(s.PrevArrow,{})};return(0,r.jsx)(o.default,{theme:c,id:d,tableOfContentTitle:h,children:(0,r.jsx)("div",{className:a.default.wrapper,children:(0,r.jsx)("div",{className:a.default.container,children:(0,r.jsx)("div",{children:(0,r.jsx)(l.default,{...p,children:f})})})})})}])},97527,i=>{i.v({content:"ModalImageShortText-module-scss-module__k8_C0a__content",grid:"ModalImageShortText-module-scss-module__k8_C0a__grid",header:"ModalImageShortText-module-scss-module__k8_C0a__header",highlight:"ModalImageShortText-module-scss-module__k8_C0a__highlight",image:"ModalImageShortText-module-scss-module__k8_C0a__image","sr-only":"ModalImageShortText-module-scss-module__k8_C0a__sr-only",subheader:"ModalImageShortText-module-scss-module__k8_C0a__subheader",text:"ModalImageShortText-module-scss-module__k8_C0a__text"})},641204,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(898205),o=i.i(314816),s=i.i(86164),l=i.i(66441),u=i.i(203828),c=i.i(249736),d=i.i(859040),h=i.i(97527);let f=(0,n.forwardRef)((i,n)=>{let{defaultOpen:a=!1,header:o,image:s,subheader:l,copy:u}=i;return(0,r.jsx)(c.default,{theme:"A-HCA-White",children:(0,r.jsx)(d.default,{ref:n,defaultOpen:a,children:(0,r.jsx)("div",{className:h.default.grid,children:(0,r.jsxs)("div",{className:h.default.content,children:[(0,r.jsx)("div",{className:h.default.image,children:s}),(0,r.jsxs)("div",{className:h.default.text,children:[(0,r.jsx)("div",{className:h.default.subheader,children:l}),(0,r.jsx)("div",{className:h.default.header,children:o}),(0,r.jsx)("div",{className:h.default.copy,children:u})]})]})})})})});var p=i.i(811846),m=i.i(257818);i.s(["default",0,i=>{let{showImage:c=!0,cards:d}=i,h=(0,n.useRef)(null);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.default,{image:c?(0,r.jsx)(u.default,{field:d.image?.jsonValue,editable:!1,next:{width:500,height:400,sizes:"(max-width: 768px) 100vw, 30vw"}}):void 0,title:(0,r.jsx)(m.default,{tag:(0,l.default)(i.params?.HeadingTag,"h3"),variation:"heading-1",children:(0,r.jsx)(a.Text,{field:d.title})}),bodyCopy:d?.text?(0,r.jsx)(m.default,{tag:"p",variation:"body-large",children:(0,r.jsx)(o.RichText,{tag:"span",field:d.text})}):void 0,link:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("button",{onClick:()=>{h?.current?.showModal?.()},children:(0,r.jsx)(o.RichText,{tag:"div",field:i.fields?.data?.item?.cTACardText?.jsonValue})})})}),(0,r.jsx)(f,{ref:h,subheader:(0,r.jsx)(m.default,{variation:"subheading-1",children:(0,r.jsx)(a.Text,{tag:"p",field:d?.overlayHeading})}),header:(0,r.jsx)(m.default,{variation:"display-2",children:(0,r.jsx)(a.Text,{tag:"p",field:d?.overlayTitle})}),image:d?.overlayImage?.jsonValue?.value?(0,r.jsx)(u.default,{field:d?.overlayImage?.jsonValue,next:{width:1e3,height:1e3,sizes:"(max-width: 768px) 100vw, 30vw"}}):void 0,copy:(0,r.jsx)(p.default,{children:(0,r.jsx)(o.RichText,{tag:"div",field:d?.overlayText})})})]})}],641204)},11931,i=>{"use strict";var r=i.i(677076),n=i.i(898205),a=i.i(102553),o=i.i(641657),s=i.i(249736);let l=i=>i.page.mode.isEditing?(0,r.jsx)("div",{className:`component ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Contact Details Box Component. Please click to select datasource."})})}):(0,r.jsx)(r.Fragment,{});i.s(["Default",0,i=>{if(!i.fields)return(0,r.jsx)(l,{...i});let u=[];
122if(i.fields?.data?.item?.contactUnit?.contactUnitList?.map(i=>{let o=i?.contactUnitName,s=i?.telephoneNumber?.telephoneNumberList.map(i=>({text:i?.phoneNumber?.value,number:i?.internationPhoneNumber?.value})),l=(0,a.OpeningHours)(i,"linebreaks")||[];u.push({title:(0,r.jsx)(n.Text,{field:o}),phone:s?.[0],availability:l.length?(0,r.jsx)(r.Fragment,{children:l}):void 0})}),u.length<1)return(0,r.jsx)(l,{...i});let c=u[0];return(0,r.jsx)(s.default,{theme:i.params?.Theme||"A-HCA-White",children:(0,r.jsx)(o.default,{headline:i.fields?.data?.item?.title?.jsonValue?.value||"Need help?",subheadline:c?.title||"",workingHoursHeadline:c?.availability?"Opening hours":"",workingHours:c?.availability||"",phoneNumber:c.phone?.text||"",workingHoursTime:""})})}])},746116,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(898205),o=i.i(314816),s=i.i(541904),l=i.i(443107),u=i.i(102553);let c=i=>{let{page:n}=i;return n.mode.isEditing?(0,r.jsx)("div",{className:`component ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Call Us Component. Please click to select datasource."})})}):(0,r.jsx)(r.Fragment,{})},d=i=>{let{contentVariation:d}=i,h=(0,n.useRef)(null);if(!i.fields)return(0,r.jsx)(c,{...i});let f=[];i.fields?.data?.item?.contactUnit?.contactUnitList?.map(i=>{let n=i?.contactUnitName,o=i?.telephoneNumber?.telephoneNumberList?.map(i=>({text:i?.phoneNumber?.value,number:i?.internationPhoneNumber?.value})),s=(0,u.OpeningHours)(i,"linebreaks")||[];f.push({title:(0,r.jsx)(a.Text,{field:n}),phone:o?.[0],availability:s.length?(0,r.jsx)(r.Fragment,{children:s}):void 0})});let p=i.params?.BtnVariant||"outline";return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.default,{size:"large",variation:p.toLocaleLowerCase(),children:(0,r.jsx)("button",{onClick:()=>h?.current?.showModal(),children:i.fields?.data?.item?.cTAText?.jsonValue&&(0,r.jsxs)(r.Fragment,{children:[i.fields?.data?.item?.cTAIcon?.Icon?.svgMarkup&&(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i.fields?.data?.item?.cTAIcon?.Icon?.svgMarkup?.value||""}}),(0,r.jsx)(o.RichText,{field:i.fields?.data?.item?.cTAText?.jsonValue})]})})}),(0,r.jsx)(s.default,{ref:h,contacts:f,contentVariation:d})]})};i.s(["Default",0,d,"EqualSizeNumbers",0,i=>i.fields?(0,r.jsx)(d,{...i,contentVariation:"EqualSizeNumbers"}):(0,r.jsx)(c,{...i})])},257343,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(898205),o=i.i(314816),s=i.i(443107),l=i.i(370777),u=i.i(257818),c=i.i(405133),d=i.i(210822),h=i.i(829057),f=i.i(79022),p=i.i(595504);let m=i=>i.page.mode.isEditing?(0,r.jsx)("div",{className:`component promo ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Book an appointment CTA. Please click to select datasource."})})}):(0,r.jsx)(r.Fragment,{});i.s(["Default",0,i=>{let g,_=(0,n.useRef)(null),y=(0,p.firstSelfOrAncestorByTemplate)(h.SITECORE_TEMPLATE_IDS.LocationPage,i?.fields?.data?.contextItem);if(y)g=y.doctifyPractice?.value;else{let r=(0,f.firstDoctifyMappedSelfOrAncestor)(i?.fields?.data?.contextItem);r?.type=="doctifyKeywordId"&&(g=r.value)}if(!i.fields)return(0,r.jsx)(m,{...i});if(!i.fields?.data?.item?.modalContent)return(0,r.jsx)(r.Fragment,{});let v=i.fields?.data?.item?.modalContent?.targetItems[0],x=i.fields?.data?.item?.modalContent?.targetItems[1],b=[{link:v?.primaryCTA,icon:v?.primaryCTAIcon,buttonVariation:v?.primaryCTAVariant?.targetItem?.name??"full"},{link:v?.secondaryCTA,icon:v?.secondaryCTAIcon,buttonVariation:v?.secondaryCTAVariant?.targetItem?.name??"outline"},{link:v?.tertiaryCTA,icon:v?.tertiaryCTAIcon,buttonVariation:v?.tertiaryCTAVariant?.targetItem?.name??"outline"},{link:v?.quaternaryCTA,icon:v?.quaternaryCTAIcon,buttonVariation:v?.quaternaryCTAVariant?.targetItem?.name??"outline"}],w=[{link:x?.primaryCTA,icon:x?.primaryCTAIcon,buttonVariation:x?.primaryCTAVariant?.targetItem?.name??"full"},{link:x?.secondaryCTA,icon:x?.secondaryCTAIcon,buttonVariation:x?.secondaryCTAVariant?.targetItem?.name??"outline"},{link:x?.tertiaryCTA,icon:x?.tertiaryCTAIcon,buttonVariation:x?.tertiaryCTAVariant?.targetItem?.name??"outline"},{link:x?.quaternaryCTA,icon:x?.quaternaryCTAIcon,buttonVariation:x?.quaternaryCTAVariant?.targetItem?.name??"outline"}];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.default,{size:"large",variation:"full",children:(0,r.jsx)("button",{onClick:()=>_?.current?.showModal(),children:i?.fields?.data?.item?.cTAText?.jsonValue&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i?.fields?.data?.item?.cTAIcon?.targetItem?.svgMarkup?.value||""}}),(0,r.jsx)(o.RichText,{tag:"span",field:i?.fields?.data?.item?.cTAText.jsonValue})]})})}),(0,r.jsx)(l.default,{ref:_,title1:v&&(0,r.jsx)(u.default,{variation:"display-4",tag:"h2",children:(0,r.jsx)(a.Text,{field:v.title})}),copy1:v&&(0,r.jsx)(u.default,{variation:"body-large",tag:"div",children:(0,r.jsx)(o.RichText,{field:v?.text})}),cta1:v&&(0,r.jsx)(r.Fragment,{children:b.map(({link:i,icon:n,buttonVariation:a},l)=>{if(!i?.jsonValue.value.text)return null;if(-1!=(i?.jsonValue.value?.class||"").indexOf("optionalfinder")&&!g)return;let{href:u,text:h}=y?(0,d.withKeywordIdIfNeeded)(i.jsonValue,g,"practice"):(0,d.withKeywordIdIfNeeded)(i.jsonValue,g,"keywordId");return(0,r.jsx)(s.default,{size:"large",contentVariation:"full-width",variation:a.toLowerCase(),children:(0,r.jsxs)(c.default,{href:u,target:i?.jsonValue?.value?.target,children:[(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:n?.targetItem?.svgMarkup?.value||""}}),(0,r.jsx)(o.RichText,{tag:"span",field:{value:h}})]})},l)})}),title2:x&&(0,r.jsx)(u.default,{variation:"display-4",tag:"h2",children:(0,r.jsx)(a.Text,{field:x?.title})}),copy2:x&&(0,r.jsx)(u.default,{variation:"body-large",tag:"div",children:(0,r.jsx)(a.Text,{field:x?.text})}),cta2:x&&(0,r.jsx)(r.Fragment,{children:w.map(({link:i,icon:n,buttonVariation:a},l)=>{if(!i?.jsonValue?.value?.text)return null;if(-1!=(i?.jsonValue?.value?.class||"").indexOf("optionalfinder")&&!g)return;let{href:u,text:h}=y?(0,d.withKeywordIdIfNeeded)(i?.jsonValue,g,"practice"):(0,d.withKeywordIdIfNeeded)(i?.jsonValue,g,"keywordId");return(0,r.jsx)(s.default,{size:"large",contentVariation:"full-width",variation:a.toLowerCase(),children:(0,r.jsxs)(c.default,{href:u,target:i.jsonValue?.value?.target,children:[(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:n?.targetItem?.svgMarkup?.value||""}}),(0,r.jsx)(o.RichText,{tag:"span",field:{value:h}})]})},l)})})})]})}])},340466,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(898205),o=i.i(314816),s=i.i(273723),l=i.i(257818),u=i.i(208024),c=i.i(623420),d=i.i(922861),h=i.i(215904),f=i.i(855963),p=i.i(234285),m=i.i(321767),g=i.i(580707),_=i.i(594967),y=i.i(385013),v=i.i(249736),x=i.i(267770),b=i.i(82037
1225),w=i.i(586936),T=i.i(581246),E=i.i(483123),S=i.i(773293),A=i.i(924274),C=i.i(752071),I=i.i(825477),k=i.i(398762),R=i.i(777912),M=i.i(254740),L=i.i(751344);let P=i=>(0,r.jsx)("div",{className:`component ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"BlogSearch no datasource"})})}),O=i=>{let{fallbackData:O,fields:D,params:F}=i,N=(0,C.useTranslations)(i?.page?.siteName),{defaultLimit:j,defaultOffset:z,baselineParams:B,baselineAutocompleteParams:U}=(0,_.default)(i),V=(0,n.useRef)(null),{data:H,error:G,formHandlers:q,searchParams:$,isResultsLoading:W,autocompleteData:Y,autocompleteError:Z}=(0,m.default)({baseUrl:"/api/api-layer/articles",searchPath:"/search",baselineParams:B,fallbackData:O,baselineAutocompleteParams:U});if(!D)return(0,r.jsx)(P,{...i});let K=Number($.get("limit"))||j,X=Number($.get("offset"))||z,Q=H?.response.resultsCount||0,J=Math.min(X+K,Q),ee=`${X+1}-${J}`,et=i.fields?.FilterOptions?.map(i=>({title:i?.fields.Header?.value||i?.displayName||"",fields:i.fields?.Filters?.map(i=>{let{id:r,key:n,value:a,displayName:o}=(0,S.default)(i);return{id:r,value:a,name:n,label:o,defaultChecked:$.getAll(n).includes(a)}})})),ei=et?.reduce((i,{fields:r})=>[...i,...r.filter(({defaultChecked:i})=>i)],[]),{headingTag:er,subheadingTag:en}=(0,R.default)(i?.params,D?.Heading?.value,"h1"),ea=et?.some(i=>i.fields&&i.fields.length>0);return(0,r.jsxs)("form",{...q,children:[(0,r.jsx)(v.default,{theme:F?.Theme||"A-HCA-White",children:(0,r.jsxs)(w.default,{heading:(0,r.jsx)(l.default,{tag:er,variation:i.params?.HeadingSize||(0,w.getDynamicTitleStyle)(i?.fields?.Title?.value.length),children:(0,r.jsx)(a.Text,{field:i?.fields?.Title})}),metatitle:!!D?.Heading?.value&&(0,r.jsx)(l.default,{tag:en,variation:"subheading-1",children:(0,r.jsx)(a.Text,{field:D?.Heading})}),description:(0,r.jsx)(l.default,{tag:"div",variation:"body-large",children:(0,r.jsx)(o.RichText,{tag:"span",field:i?.fields?.Text})}),children:[(0,r.jsx)(s.default,{defaultValue:$.get("input")||void 0,name:"input",placeholder:D?.SearchPlaceholder?.value,suggestions:Z?[]:Y?.response.results?.map(i=>`${i.value}`),children:ea&&(0,r.jsx)(d.default,{buttonText:(0,r.jsx)(a.Text,{field:D?.FilterOptionsText}),buttonIcon:(0,r.jsx)(x.default,{children:i?.fields?.FilterOptionsIcon?.fields?.SvgMarkup?.value}),resultsCount:Q,filters:et?.map(i=>({title:i.title,contentVariation:"filters",children:(0,r.jsx)(u.default,{children:i.fields?.map(i=>(0,n.createElement)(c.default,{...i,key:i.id}))})}))})}),(0,r.jsx)(b.default,{filters:ei||[],clearFilters:()=>{ei?.forEach(({id:i},r)=>{let n=document.getElementById(i);n&&(r===ei.length-1?n.click():n.checked=!1)})}})]})}),(0,r.jsx)(v.default,{theme:F?.CardTheme||"A-HCA-White",children:(0,r.jsxs)(y.default,{ref:V,children:[!W&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.default,{tag:"h3",variation:"heading-1",children:(0,r.jsx)(I.default,{searchResultsTextWithInput:D?.SearchResultsTextWithInput?.value,searchResultsText:D?.SearchResultsText?.value,resultsCount:Q,input:$.get("input")||$.get("autocomplete")||void 0})}),!!J&&(0,r.jsx)(l.default,{variation:"body-medium",children:(0,r.jsxs)("span",{children:[N("showing")||"Showing"," ",ee]})})]}),W?(0,r.jsx)(L.default,{loadingMsg:N("loading-articles")}):G?(0,r.jsx)(A.default,{variant:"search-error",contentVariation:"no-container"}):Q?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f.default,{children:H?.response.results?.map((i,n)=>{let{data:a}=i,{abstractTitle:o,abstractImageUrl:s,title:u,imageUrl:c,primaryImageUrl:d,url:f,date:m,typeName:g}=a,_=(0,k.default)(s,d,c);return(0,r.jsxs)(p.default,{children:[void 0!==_?(0,r.jsx)("a",{href:f,children:(0,r.jsx)(h.default,{src:(0,M.upsertQuerystringParam)(_,"t","w750"),alt:"",width:"560",height:"420",quality:90})}):void 0,(0,r.jsx)("time",{children:(0,E.default)(new Date(m))}),(0,r.jsx)(l.default,{tag:"h3",variation:"heading-2",children:(0,r.jsx)("a",{href:f,children:o||u})}),(0,r.jsx)("div",{children:!!g&&(0,r.jsx)(T.default,{children:(0,r.jsx)("span",{children:g})})})]},n)})}),(0,r.jsx)(g.default,{offset:X,limit:K,resultsCount:Q,scrollToRef:V})]}):(0,r.jsx)(A.default,{contentVariation:"no-container"})]})})]})};i.s(["Default",0,i=>{let a=(0,C.useTranslations)(i?.page?.siteName);return(0,r.jsx)(n.Suspense,{fallback:(0,r.jsx)(L.default,{loadingMsg:a("loading")}),children:(0,r.jsx)(O,{...i})})}])},206605,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(314816),o=i.i(898205),s=i.i(257818),l=i.i(586936),u=i.i(82037
1225),c=i.i(623420),d=i.i(208024),h=i.i(249736),f=i.i(321767),p=i.i(594967),m=i.i(267770),g=i.i(273723),_=i.i(922861),y=i.i(773293),v=i.i(777912);let x=()=>(0,r.jsx)(r.Fragment,{}),b=i=>{let{fields:b,params:w}=i,{baselineParams:T,baselineAutocompleteParams:E}=(0,p.default)(i),{data:S,formHandlers:A,searchParams:C,autocompleteData:I,autocompleteError:k}=(0,f.default)({baseUrl:"/api/api-layer/articles",searchPath:"/search",baselineParams:[...T],redirectUrl:b?.BlogUrl?.value.href||"",baselineAutocompleteParams:E});if(!b)return(0,r.jsx)(x,{});let R=S?.response?.resultsCount||0,M=i.fields?.FilterOptions?.map(i=>({title:i?.fields.Header?.value||i?.displayName||"",fields:i.fields?.Filters?.map(i=>{let{id:r,key:n,value:a,displayName:o}=(0,y.default)(i);return{id:r,value:a,name:n,label:o,defaultChecked:C.getAll(n).includes(a)}})})),L=M?.reduce((i,{fields:r})=>[...i,...r.filter(({defaultChecked:i})=>i)],[]),{headingTag:P,subheadingTag:O}=(0,v.default)(i?.params,b?.Heading?.value,"h1");return(0,r.jsx)("form",{...A,children:(0,r.jsx)(h.default,{theme:w?.Theme||"A-HCA-White",children:(0,r.jsxs)(l.default,{heading:(0,r.jsx)(s.default,{tag:P,variation:i.params?.HeadingSize||(0,l.getDynamicTitleStyle)(b?.Title?.value?.length),children:(0,r.jsx)(o.Text,{field:i?.fields?.Title})}),metatitle:!!b?.Heading?.value&&(0,r.jsx)(s.default,{tag:O,variation:"subheading-1",children:(0,r.jsx)(o.Text,{field:b?.Heading})}),description:(0,r.jsx)(s.default,{tag:"div",variation:"body-large",children:(0,r.jsx)(a.RichText,{tag:"span",field:i?.fields?.Text})}),children:[(0,r.jsx)(g.default,{searchOnEnter:!0,defaultValue:C.get("input")||void 0,name:"input",placeholder:b?.SearchPlaceholder?.value,suggestions:k?[]:I?.response?.results?.map(i=>`${i.value}`),children:(0,r.jsx)(_.default,{submitOnClose:!0,buttonText:(0,r.jsx)(o.Text,{field:b?.FilterOptionsText}),buttonIcon:(0,r.jsx)(m.default,{children:i?.fields?.FilterOptionsIcon?.fields?.SvgMarkup?.value}),resultsCount:R,filters:M?.map(i=>({title:i.title,contentVariation:"filters",children:(0,r.jsx)(d.default,{children:i.fields?.map(i=>(0,n.createElement)(c.default,{...i,key:i.id}))})}))})}),(0,r.jsx)(u.default,{filters:L||[],clearFilters:()=>{L?.forEach(({id:i},r)=>{let n=document.getElementById(i);n&&(r===L.length-1?n.click():n.checked=!1)})}})]})})})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(b,{...i})})])},607107,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(257818),o=i.i(898205),s=i.i(449752),l=i.i(249736),u=i.i(630077),c=i.i(123768),d=i.i(389241);let h=i=>{let[h,f]=(0,n.useState)([]),p=(0,n.useCallback)(()=>{f(Array.from(document.querySelectorAll("[data-subnav-link-title]")).map(i=>({TableOfContentsLinkTitle:i.dataset.subnavLinkTitle||"",Id:i.dataset.subnavLinkId||i.id||""})))},[]),m=(0,c.usePathname)(),g=(0,c.useSearchParams)();(0,n.useEffect)(()=>{let i=requestAnimationFrame(()=>{p()});return()=>cancelAnimationFrame(i)},[p,m,g]);let _=!i.fields;return"stacked"===i.variant?(0,r.jsx)(s.default,{variation:i.variant,isSticky:!0,isInsideContainer:(0,d.isInsideContainerComponent)(i.params),heading:_?(0,r.jsx)(a.default,{variation:"body-bold-large",children:"Jump to"}):(0,r.jsx)(a.default,{variation:"body-bold-large",children:(0,r.jsx)(o.Text,{field:i.fields?.Title})}),children:h.length>0&&h.map((i,n)=>(0,r.jsx)(s.JumpToTextLink,{children:(0,r.jsx)("a",{href:"#"+i.Id,children:(0,r.jsx)("span",{children:i.TableOfContentsLinkTitle})})},n))}):(0,r.jsx)(l.default,{theme:"A-HCA-White",collapse:!1,children:(0,r.jsx)(s.default,{isInsideContainer:(0,d.isInsideContainerComponent)(i.params),heading:_?(0,r.jsx)(a.default,{variation:"body-medium-medium",children:"Jump to"}):(0,r.jsx)(a.default,{variation:"body-medium-medium",children:(0,r.jsx)(o.Text,{field:i.fields?.Title})}),children:h.length>0&&h.map((i,n)=>(0,r.jsx)(s.JumpToAnchor,{children:(0,r.jsxs)("a",{href:"#"+i.Id,children:[(0,r.jsx)(u.default,{iconName:"iconArrowSmallDown"}),(0,r.jsx)("span",{children:i.TableOfContentsLinkTitle})]})},n))})})},f=i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(h,{...i})});i.s(["Default",0,f,"Stacked",0,i=>(0,r.jsx)(f,{...i,variant:"stacked"})])},679584,i=>{i.v({active:"NavigationDesktop-module-scss-module___F9ohG__active",closed:"NavigationDesktop-module-scss-module___F9ohG__closed",content:"NavigationDesktop-module-scss-module___F9ohG__content",control:"NavigationDesktop-module-scss-module___F9ohG__control",double:"NavigationDesktop-module-scss-module___F9ohG__double",drawer:"NavigationDesktop-module-scss-module___F9ohG__drawer",eyebrow:"NavigationDesktop-module-scss-module___F9ohG__eyebrow","eyebrow-inner":"NavigationDesktop-module-scss-module___F9ohG__eyebrow-inner","eyebrow-left":"NavigationDesktop-module-scss-module___F9ohG__eyebrow-left","eyebrow-right":"NavigationDesktop-module-scss-module___F9ohG__eyebrow-right",full:"NavigationDesktop-module-scss-module___F9ohG__full",highlight:"NavigationDesktop-module-scss-module___F9ohG__highlight",logo:"NavigationDesktop-module-scss-module___F9ohG__logo","logo-closed":"NavigationDesktop-module-scss-module___F9ohG__logo-closed","logo-open":"NavigationDesktop-module-scss-module___F9ohG__logo-open",main:"NavigationDesktop-module-scss-module___F9ohG__main",navigation:"NavigationDesktop-module-scss-module___F9ohG__navigation",open:"NavigationDesktop-module-scss-module___F9ohG__open","span-1":"NavigationDesktop-module-scss-module___F9ohG__span-1","span-12":"NavigationDesktop-module-scss-module___F9ohG__span-12","span-2":"NavigationDesktop-module-scss-module___F9ohG__span-2","span-3":"NavigationDesktop-module-scss-module___F9ohG__span-3","span-4":"NavigationDesktop-module-scss-module___F9ohG__span-4","span-5":"NavigationDesktop-module-scss-module___F9ohG__span-5","span-6":"NavigationDesktop-module-scss-module___F9ohG__span-6","sr-only":"NavigationDesktop-module-scss-module___F9ohG__sr-only",tabs:"NavigationDesktop-module-scss-module___F9ohG__tabs",wrapper:"NavigationDesktop-module-scss-module___F9ohG__wrapper"})},800441,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(976481),s=i.i(250090),l=i.i(679584);i.s(["default",0,({initialActiveIndex:i=null,themeClosed:u,themeOpen:c})=>{let d=(0,n.useRef)(null),h=(0,a.usePathname)(),f=(0,a.useSearchParams)();return(0,n.useEffect)(()=>{let r,n=d.current,a=n?.closest("[data-navigation-desktop-root]");if(!a)return;let h=a.parentElement,f=Array.from(a.querySelectorAll("[data-navigation-desktop-control]")),p=Array.from(a.querySelectorAll("[data-navigation-desktop-drawer]")),m=i,g=i=>{let r=null!==(m=i);a.classList.toggle(l.default.open,r),a.classList.toggle(l.default.closed,!r),(i=>{if(!h)return;let r=i?c:u,n=s.default[c],a=s.default[u],l=s.default[r];n&&h.classList.remove(n),a&&h.classList.remove(a),l&&h.classList.add(l),h.setAttribute("data-theme",r),h.setAttribute("data-theme-mode",(0,o.getThemeMode)(r))})(r),f.forEach(i=>
122{let r=Number(i.dataset.navigationDesktopTabIndex)===m,n=i.querySelector("button");i.classList.toggle(l.default.active,r),n?.setAttribute("aria-expanded",String(r))}),p.forEach(i=>{let r=Number(i.dataset.navigationDesktopTabIndex);i.classList.toggle(l.default.active,r===m)})},_=[],y=()=>{void 0!==r&&(window.clearTimeout(r),r=void 0)};f.forEach(i=>{let n=Number(i.dataset.navigationDesktopTabIndex),a=()=>g(n),o=()=>{y(),r=window.setTimeout(a,160)},s=()=>{y(),g(m===n?null:n)};i.addEventListener("mouseenter",o),i.addEventListener("mouseleave",y),i.addEventListener("click",s),_.push(()=>{i.removeEventListener("mouseenter",o),i.removeEventListener("mouseleave",y),i.removeEventListener("click",s)})});let v=()=>{y(),g(null)};return a.addEventListener("mouseleave",v),_.push(()=>a.removeEventListener("mouseleave",v)),g(i),()=>{y(),_.forEach(i=>i())}},[i,u,c,h,f]),(0,r.jsx)("span",{ref:d,hidden:!0,"aria-hidden":"true","data-navigation-desktop-controller":!0})}])},798207,i=>{i.v({back:"NavigationMobile-module-scss-module__5xUcaG__back",bottom:"NavigationMobile-module-scss-module__5xUcaG__bottom",closed:"NavigationMobile-module-scss-module__5xUcaG__closed",ctas:"NavigationMobile-module-scss-module__5xUcaG__ctas",drawer:"NavigationMobile-module-scss-module__5xUcaG__drawer",eyebrow:"NavigationMobile-module-scss-module__5xUcaG__eyebrow","eyebrow-inner":"NavigationMobile-module-scss-module__5xUcaG__eyebrow-inner",grow:"NavigationMobile-module-scss-module__5xUcaG__grow",hidden:"NavigationMobile-module-scss-module__5xUcaG__hidden",highlight:"NavigationMobile-module-scss-module__5xUcaG__highlight",links:"NavigationMobile-module-scss-module__5xUcaG__links",logo:"NavigationMobile-module-scss-module__5xUcaG__logo","logo-closed":"NavigationMobile-module-scss-module__5xUcaG__logo-closed","logo-open":"NavigationMobile-module-scss-module__5xUcaG__logo-open",main:"NavigationMobile-module-scss-module__5xUcaG__main",navigation:"NavigationMobile-module-scss-module__5xUcaG__navigation",open:"NavigationMobile-module-scss-module__5xUcaG__open",primary:"NavigationMobile-module-scss-module__5xUcaG__primary","search-wrapper":"NavigationMobile-module-scss-module__5xUcaG__search-wrapper","sr-only":"NavigationMobile-module-scss-module__5xUcaG__sr-only","toggle-closed":"NavigationMobile-module-scss-module__5xUcaG__toggle-closed","toggle-open":"NavigationMobile-module-scss-module__5xUcaG__toggle-open",wrapper:"NavigationMobile-module-scss-module__5xUcaG__wrapper"})},591787,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(976481),s=i.i(250090),l=i.i(798207);i.s(["default",0,({themeClosed:i,themeOpen:u})=>{let c=(0,n.useRef)(null),d=(0,a.usePathname)(),h=(0,a.useSearchParams)();return(0,n.useEffect)(()=>{let r=c.current,n=r?.closest("[data-navigation-mobile-root]");if(!n)return;let a=n.parentElement,d=n.querySelector("[data-navigation-mobile-drawer]"),h=n.querySelector("[data-navigation-mobile-toggle]"),f=n.querySelector("[data-navigation-mobile-toggle-label]"),p=n.querySelector("[data-navigation-mobile-links]"),m=n.querySelector("[data-navigation-mobile-eyebrow]"),g=n.querySelector("[data-navigation-mobile-active-primary-label]"),_=Array.from(n.querySelectorAll("[data-navigation-mobile-primary-item]")),y=Array.from(n.querySelectorAll("[data-navigation-mobile-primary-button]")),v=Array.from(n.querySelectorAll("[data-navigation-mobile-secondary-group]")),x=Array.from(n.querySelectorAll("[data-navigation-mobile-secondary-item]")),b=Array.from(n.querySelectorAll("[data-navigation-mobile-secondary-button]")),w=Array.from(n.querySelectorAll("[data-navigation-mobile-tertiary-group]")),T=Array.from(n.querySelectorAll("[data-navigation-mobile-secondary-bottom]")),E=Array.from(n.querySelectorAll("[data-navigation-mobile-primary-bottom]")),S=n.querySelector('[data-navigation-mobile-back="menu"]'),A=n.querySelector('[data-navigation-mobile-back="secondary"]'),C=n.querySelector('[data-navigation-mobile-back-button="menu"]'),I=n.querySelector('[data-navigation-mobile-back-button="secondary"]'),k=!1,R=null,M=null,L=i=>null===i?void 0:y.find(r=>Number(r.dataset.navigationMobilePrimaryIndex)===i),P=i=>Number(L(i)?.dataset.navigationMobilePrimaryContentCount||0),O=()=>{n.classList.toggle(l.default.open,k),n.classList.toggle(l.default.closed,!k),d?.classList.toggle(l.default.open,k),h?.setAttribute("aria-expanded",String(k)),k?h?.setAttribute("data-navigation-type","mobileNavigationOpen"):h?.removeAttribute("data-navigation-type"),f&&(f.textContent=k?"Close navigation":"Open navigation"),(r=>{if(!a)return;let n=r?u:i,l=s.default[u],c=s.default[i],d=s.default[n];l&&a.classList.remove(l),c&&a.classList.remove(c),d&&a.classList.add(d),a.setAttribute("data-theme",n),a.setAttribute("data-theme-mode",(0,o.getThemeMode)(n))})(k),document.body.style.overflow=k?"hidden":"";let r=L(R),c=P(R);g&&(g.textContent=r?.dataset.navigationMobilePrimaryLabel||""),_.forEach(i=>
122{i.classList.toggle(l.default.hidden,null!==R)}),v.forEach(i=>{let r=Number(i.dataset.navigationMobilePrimaryIndex);i.classList.toggle(l.default.hidden,R!==r)}),x.forEach(i=>{let r=Number(i.dataset.navigationMobilePrimaryIndex);i.classList.toggle(l.default.hidden,R!==r||null!==M)}),w.forEach(i=>{let r=Number(i.dataset.navigationMobilePrimaryIndex),n=Number(i.dataset.navigationMobileSecondaryIndex);i.classList.toggle(l.default.hidden,R!==r||M!==n)}),T.forEach(i=>{let r=Number(i.dataset.navigationMobilePrimaryIndex),n=Number(i.dataset.navigationMobileSecondaryIndex);i.classList.toggle(l.default.hidden,R!==r||M!==n)}),E.forEach(i=>{let r=Number(i.dataset.navigationMobilePrimaryIndex),n="true"===i.dataset.navigationMobileSingleLevel;i.classList.toggle(l.default.hidden,R!==r||null!==M&&!n)}),p?.classList.toggle(l.default.primary,null===R&&null===M),S?.classList.toggle(l.default.hidden,null===R||!(null===M||c<=1)),A?.classList.toggle(l.default.hidden,null===R||null===M||c<=1),m?.classList.toggle(l.default.hidden,null!==R)},D=()=>{k=!1,R=null,M=null,O()},F=[],N=()=>{k?D():(k=!0,O())};h?.addEventListener("click",N),F.push(()=>h?.removeEventListener("click",N)),y.forEach(i=>{let r=()=>{k=!0,M=1>=P(R=Number(i.dataset.navigationMobilePrimaryIndex))?0:null,O()};i.addEventListener("click",r),F.push(()=>i.removeEventListener("click",r))}),b.forEach(i=>{let r=()=>{R=Number(i.dataset.navigationMobilePrimaryIndex),M=Number(i.dataset.navigationMobileSecondaryIndex),O()};i.addEventListener("click",r),F.push(()=>i.removeEventListener("click",r))});let j=()=>{R=null,M=null,O()},z=()=>{M=null,O()};return C?.addEventListener("click",j),I?.addEventListener("click",z),F.push(()=>C?.removeEventListener("click",j)),F.push(()=>I?.removeEventListener("click",z)),D(),()=>{F.forEach(i=>i()),document.body.style.overflow=""}},[i,u,d,h]),(0,r.jsx)("span",{ref:c,hidden:!0,"aria-hidden":"true","data-navigation-mobile-controller":!0})}])},16120,i=>{i.v({down:"Navigation-module-scss-module__rdzW6q__down",highlight:"Navigation-module-scss-module__rdzW6q__highlight","sr-only":"Navigation-module-scss-module__rdzW6q__sr-only",sticky:"Navigation-module-scss-module__rdzW6q__sticky",up:"Navigation-module-scss-module__rdzW6q__up"})},504485,i=>{"use strict";var r=i.i(677076),n=i.i(16120),a=i.i(2317);i.s(["default",0,({children:i})=>{let o=(()=>{let[i,r]=a.useState("up"),n=a.useRef(!1),o=a.useRef(0);return a.useEffect(()=>{o.current=window.pageYOffset;let i=()=>{let i=window.pageYOffset;Math.abs(i-o.current)>=0&&(r(i>o.current?"down":"up"),o.current=i>0?i:0),n.current=!1},a=()=>{n.current||(n.current=!0,window.requestAnimationFrame(i))};return window.addEventListener("scroll",a),()=>window.removeEventListener("scroll",a)},[i]),i})();return(0,r.jsx)("div",{className:[n.default.sticky,n.default[o]].join(" "),children:i})}],504485)},561345,i=>{i.v({highlight:"ModalSearch-module-scss-module__QLwJ-q__highlight",search:"ModalSearch-module-scss-module__QLwJ-q__search","sr-only":"ModalSearch-module-scss-module__QLwJ-q__sr-only",subheading:"ModalSearch-module-scss-module__QLwJ-q__subheading",suggestions:"ModalSearch-module-scss-module__QLwJ-q__suggestions",wrapper:"ModalSearch-module-scss-module__QLwJ-q__wrapper"})},98627,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(249736),o=i.i(257818),s=i.i(561345),l=i.i(859040),u=i.i(832665),c=i.i(956028),d=i.i(123768),h=i.i(443107);let f=(0,n.forwardRef)((i,n)=>{let{defaultOpen:a=!1,suggestions:o,id:f,placeholder:p,subheading:m,redirectUrl:g="/"}=i,_=(0,c.useSearchActions)(),y=(0,d.useRouter)(),v=i=>{if(_.setQuery(i),!i.length){let i=n?.current?.querySelector('[class*="StyledYextSearchBar_input-element"]');i?.focus?.();return}_.executeUniversalQuery();try{y.replace(g),n?.current?.close()}catch(i){console.error("Failed to change route:",i)}};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(l.default,{id:f,ref:n,defaultOpen:a,children:(0,r.jsxs)("div",{className:s.default.wrapper,children:[(0,r.jsx)("div",{className:s.default.search,children:(0,r.jsx)(u.default,{onSearch:({query:i=""})=>{v(i)},placeholder:p})}),m&&(0,r.jsx)("div",{className:s.default.subheading,children:m}),o&&(0,r.jsx)("div",{className:s.default.suggestions,children:o.map(({icon:i,text:n,query:a=""},o)=>(0,r.jsx)(h.default,{size:"small",variation:"filter",children:(0,r.jsxs)("button",{onClick:()=>{v(a)},children:[i,n]})},o))})]})})})});var p=i.i(229462),m=i.i(267770);i.s(["default",0,({placeholder:i="",popularSearchesLabel:s="",redirectUrl:l,suggestions:u=[]})=>{let c=(0,n.useRef)(null);return(0,r.jsx)(a.default,{theme:"A-HCA-White",children:(0,r.jsx)(f,{id:p.SEARCH_SUGGESTIONS_MODAL_ID,ref:c,placeholder:i,subheading:s?(0,r.jsx)(o.default,{variation:"subheading-1",children:s}):void 0,redirectUrl:l,suggestions:u.map(i=>({icon:(0,r.jsx)(m.default,{children:i.iconSvg}),text:i.text,query:i.query}))})})}],98627)},521635,i=>{"use strict";var r=i.i(677076),n=i.i(902841),a=i.i(630077),o=i.i(229462);i.s(["default",0,()=>(0,r.jsx)(n.default,{children:(0,r.jsxs)("button",{type:"button",onClick:()=>{let i=document.getElementById(o.SEARCH_SUGGESTIONS_MODAL_ID);i?.showModal()},children:[(0,r.jsx)(a.default,{iconName:"iconSearch"}),(0,r.jsx)("span",{className:"sr-only",children:"Search"})]})})])},803768,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(405133),s=i.i(293715),l=i.i(314816),u=i.i(443107),c=i.i(257818),d=i.i(660817),h=i.i(242838),f=i.i(907771),p=i.i(211452),m=i.i(630077),g=i.i(857690),_=i.i(190408),y=i.i(225659),v=i.i(267770),x=i.i(304684),b=i.i(597330);let w=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})}),T=i=>{let T=i.params.RenderingIdentifier,E=(0,a.useSearchParams)(),[S,A]=(0,n.use
122State)(""),[C,I]=(0,n.useState)(""),[k,R]=(0,n.useState)(""),[M,L]=(0,n.useState)(""),[P,O]=(0,n.useState)(""),[D,F]=(0,n.useState)(null);return((0,n.useEffect)(()=>{window.scrollTo({top:0,behavior:"smooth"}),R((0,b.getQueryValue)(E,"search")),L((0,b.getQueryValue)(E,"keywordId")),A((0,b.getQueryValue)(E,"slug")),I((0,b.getQueryValue)(E,"name")),O((0,b.getQueryValue)(E,"gmcNumber")),F(Number(E.get("reviewsTotal")))},[E]),i.fields)?(0,r.jsx)("div",{id:T||void 0,children:(0,r.jsxs)("div",{className:"component-content",children:[(0,r.jsx)(g.default,{logo:(0,r.jsx)(s.Image,{field:i?.fields?.HCALogo}),progress:(0,r.jsx)(y.default,{currentPage:i?.fields?.CurrentStep?.value,steps:i?.fields?.Steps,reviewsTotal:D,name:C})}),(0,r.jsx)(x.default,{children:(0,r.jsx)(c.default,{tag:"h1",variation:"heading-1",children:"A few important things to know before you book"})}),(0,r.jsxs)(d.default,{acceptBtn:null,children:[(0,r.jsx)(h.default,{backgroundColour:"turquoise",icon:(0,r.jsx)(v.default,{children:i?.fields?.Card1Icon?.fields?.SvgMarkup?.value}),isShortInfo:!1,longText:(0,r.jsx)(l.RichText,{field:i?.fields?.Card1BodyText}),longTextTitle:i.fields.Card1HeadingText.value,paddingLarge:!0}),(0,r.jsx)(h.default,{backgroundColour:"turquoise",icon:(0,r.jsx)(v.default,{children:i?.fields?.Card2Icon?.fields?.SvgMarkup?.value}),isShortInfo:!1,longText:(0,r.jsx)(l.RichText,{field:i?.fields?.Card2BodyText}),longTextTitle:i.fields.Card2HeadingText.value,paddingLarge:!0}),(0,r.jsx)(h.default,{backgroundColour:"turquoise",icon:(0,r.jsx)(v.default,{children:i?.fields?.Card3Icon?.fields?.SvgMarkup?.value}),isShortInfo:!1,longText:(0,r.jsx)(l.RichText,{field:i?.fields?.Card3BodyText}),longTextTitle:i.fields.Card3HeadingText.value,paddingLarge:!0}),(0,r.jsx)(h.default,{backgroundColour:"turquoise",icon:(0,r.jsx)(v.default,{children:i?.fields?.Card4Icon?.fields?.SvgMarkup?.value}),isShortInfo:!1,longText:(0,r.jsx)(l.RichText,{field:i?.fields?.Card4BodyText}),longTextTitle:i.fields.Card4HeadingText.value,paddingLarge:!0})]}),(0,r.jsxs)(f.default,{hideTextMobile:!0,children:[(0,r.jsx)("div",{children:(0,r.jsx)(p.default,{children:(0,r.jsxs)(o.default,{href:`${i?.fields?.BackLink?.value?.href&&i?.fields?.BackLink?.value?.href.replace(/,-w-,/g,"")}${S}`,children:[(0,r.jsx)(m.default,{iconName:"iconArrowSmallLeft"}),(0,r.jsx)("span",{children:i.fields.BackLink.value.text||"Back"})]})})}),(0,r.jsx)(c.default,{tag:"p",variation:"body-medium-extra-large",children:i?.fields?.AcceptInstructionsText?.value||"Please accept to continue."}),(0,r.jsx)(_.default,{customBtn:!0,children:(0,r.jsx)(u.default,{variation:"full-dark",size:"large",children:(0,r.jsx)(o.default,{href:`${i?.fields?.NextLink?.value?.href||"/finder/step-appointment-type"}?slug=${S}&name=${encodeURIComponent(C)}&gmcNumber=${P}&reviewsTotal=${D}&search=${k}&keywordId=${M}`,children:(0,r.jsx)("span",{children:i?.fields?.AcceptButtonText?.value||"Accept"})})})})]})]})}):(0,r.jsx)(w,{...i})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(T,{...i})})])},465427,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(405133),s=i.i(56676),l=i.i(293715),u=i.i(443107),c=i.i(257818),d=i.i(857690),h=i.i(225659),f=i.i(417964),p=i.i(308637),m=i.i(907771),g=i.i(211452),_=i.i(630077),y=i.i(190408),v=i.i(267770),x=i.i(859040),b=i.i(597330);let w=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})}),T=i=>{let T=(0,s.useComponentProps)(i.rendering.uid),E=T?.Holidays,{selectedLocation:S,selectedTypeOfAppointment:A,selectedDate:C,selectedTime:I,isBookableContent:k}=(0,n.useContext)(p.ConsultantFinderContext),R=i.params.RenderingIdentifier,M=(0,a.useRouter)(),L=(0,a.useSearchParams)(),[P,O]=(0,n.useState)(""),[D,F]=(0,n.useState)(""),[N,j]=(0,n.useState)(""),[z,B]=(0,n.useState)(""),[U,V]=(0,n.useState)(""),[H,G]=(0,n.useState)(null),q=(0,n.useRef)(null);return((0,n.useEffect)(()=>{window.scrollTo({top:0,behavior:"smooth"}),j((0,b.getQueryValue)(L,"search")),B((0,b.getQueryValue)(L,"keywordId"));let i=(0,b.getQueryValue)(L,"slug");O(i);let r=(0,b.getQueryValue)(L,"name");F(r);let n=(0,b.getQueryValue)(L,"gmcNumber");V(n);let a=L.get("reviewsTotal");G(Number(a)),""===S&&""===A&&M.push(`/finder/step-terms-and-conditions?slug=${i}&name=${encodeURIComponent(r)}&gmcNumber=${n}&reviewsTotal=${a}&search=${(0,b.getQueryValue)(L,"search")}&keywordId=${(0,b.getQueryValue)(L,"keywordId")}`)},[L]),i.fields)?(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,id:R||void 0,children:""!==S&&""!==A&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.default,{logo:(0,r.jsx)(l.Image,{field:i?.fields?.HCALogo}),progress:(0,r.jsx)(h.default,{currentPage:i?.fields?.CurrentStep?.value,steps:i?.fields?.Steps,slug:P,gmcNumber:U,reviewsTotal:H,name:D})}),(0,r.jsx)(f.default,{slug:P,gmcNumber:U,reviewsTotal:H,name:D,backLinkHref:i?.fields?.BackLink?.value?.href,backLinkText:i.fields.BackLink.value.text||"Back",holidays:E,titleText:i?.fields?.TitleText?.value||"Please select a slot",keyShortNoticeText:i?.fields?.KeyShortNoticeText?.value||"",keyBookOnlineText:i?.fields?.KeyBookOnlineText?.value||"",API_C2_GetConsultantSlots_L
122oadingMsg:i?.fields?.API_C2_GetConsultantSlots_LoadingMsg?.value||"",API_C2_GetConsultantSlots_BaseURL:i?.fields?.API_C2_GetConsultantSlots_BaseURL?.value||"/api/C2/GetLDBConsultantSlots?",API_C2_GetConsultantSlots_NoResultsMsg:i?.fields?.API_C2_GetConsultantSlots_NoResultsMsg?.value||"No slots found",viewMapText:i?.fields?.ViewMapText?.value||"View location on Google Maps",chooseTimeHeading:i?.fields?.ChooseTimeHeading?.value||"Choose time",shortNoticeIcon:(0,r.jsx)(v.default,{children:i?.fields?.BookByPhoneIcon?.fields?.SvgMarkup?.value}),modalRef:q,resultsLink:i?.fields?.ResultsLink?.value||"/finder/step-consultant-cards",search:N,keywordId:z}),(0,r.jsx)(x.default,{ref:q,alignContent:"center",children:(0,r.jsxs)(y.default,{alignItems:"center-align",children:[""!==C&&""!==I&&(0,r.jsxs)(c.default,{tag:"p",variation:"body-medium-extra-large",children:[k&&`${i?.fields?.AppointmentSelectedText?.value||"Appointment selected on"} ${C} at ${I}`,!k&&i?.fields?.KeyShortNoticeText?.value]}),k&&(0,r.jsx)(y.default,{marginBottom:"spacing-4",marginTop:"spacing-4",children:(0,r.jsx)(u.default,{size:"small",variation:"full-dark",children:(0,r.jsx)("button",{disabled:""===C&&""===I,onClick:()=>M.push(`${i?.fields?.NextLink?.value?.href}?slug=${P}&name=${encodeURIComponent(D)}&gmcNumber=${U}&reviewsTotal=${H}&search=${N}&keywordId=${z}`),children:(0,r.jsx)("span",{children:i?.fields?.NextLink?.value?.text||"Book Slot"})})})}),!k&&(0,r.jsx)(y.default,{marginBottom:"spacing-4",marginTop:"spacing-4",children:(0,r.jsx)(u.default,{size:"small",variation:"full-dark",children:(0,r.jsxs)("a",{href:`tel:${i?.fields?.PhoneNumberToBook?.value.replace(/\s/g,"")}`,children:[(0,r.jsx)(v.default,{children:i?.fields?.PhoneNumberIcon?.fields?.SvgMarkup?.value}),(0,r.jsx)("span",{children:i?.fields?.PhoneNumberToBook?.value})]})})}),(0,r.jsx)(g.default,{children:(0,r.jsx)("button",{type:"button",onClick:()=>q?.current?.close(),children:(0,r.jsx)("span",{children:"Cancel"})})})]})}),(0,r.jsxs)(m.default,{hideTextMobile:!0,showOnMobile:!0,children:[(0,r.jsx)("div",{children:(0,r.jsx)(g.default,{children:(0,r.jsxs)(o.default,{href:`${i?.fields?.BackLink?.value?.href}?slug=${P}&name=${encodeURIComponent(D)}&gmcNumber=${U}&reviewsTotal=${H}&search=${N}&keywordId=${z}`,children:[(0,r.jsx)(_.default,{iconName:"iconArrowSmallLeft"}),(0,r.jsx)("span",{children:i.fields.BackLink.value.text||"Back"})]})})}),""!==C&&""!==I&&(0,r.jsxs)(c.default,{tag:"p",variation:"body-medium-extra-large",children:[k&&`${i?.fields?.AppointmentSelectedText?.value||"Appointment selected on"} ${C} at ${I}`,!k&&i?.fields?.KeyShortNoticeText?.value]}),k&&(0,r.jsx)(y.default,{children:(0,r.jsx)(u.default,{size:"small",variation:"full-dark",children:(0,r.jsx)("button",{disabled:""===C&&""===I,onClick:()=>M.push(`${i?.fields?.NextLink?.value?.href}?slug=${P}&name=${encodeURIComponent(D)}&gmcNumber=${U}&reviewsTotal=${H}`),children:(0,r.jsx)("span",{children:i?.fields?.NextLink?.value?.text||"Book Slot"})})})}),!k&&(0,r.jsx)(y.default,{customBtn:!0,children:(0,r.jsx)(u.default,{size:"small",variation:"full-dark",children:(0,r.jsxs)("a",{href:`tel:${i?.fields?.PhoneNumberToBook?.value.replace(/\s/g,"")}`,children:[(0,r.jsx)(v.default,{children:i?.fields?.PhoneNumberIcon?.fields?.SvgMarkup?.value}),(0,r.jsx)("span",{children:i?.fields?.PhoneNumberToBook?.value})]})})})]})]})}):(0,r.jsx)(w,{...i})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(T,{...i})})])},663941,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(293715),s=i.i(159273),l=i.i(314816),u=i.i(443107),c=i.i(257818),d=i.i(308637),h=i.i(569030),f=i.i(67558),p=i.i(907771),m=i.i(630077),g=i.i(211452);let _=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})});i.s(["Default",0,i=>{let y=(0,a.useRouter)(),{searchStringConsultantName:v,setSearchStringConsultantName:x,consultantSlug:b}=(0,n.useContext)(d.ConsultantFinderContext),w=i.params.RenderingIdentifier;return(console.log("props?.fields?.PopularConsultantsList ",i?.fields?.PopularConsultantsList),console.log(i.fields.NextLink),i.fields)?(0,r.jsxs)("div",{id:w||void 0,children:[(0,r.jsxs)(h.default,{contentVariation:"hero-cf",noOverflownHidden:!0,theme:"A-HCA-White",imageAlignment:"left",length:"short",cfVariation:!0,subheader:(0,r.jsx)(c.default,{tag:"h3",variation:"subheading-1",children:(0,r.jsx)(l.RichText,{field:i.fields.HeadingText})}),header:(0,r.jsx)(c.default,{tag:"h2",variation:"display-2",children:(0,r.jsx)(l.RichText,{field:i.fields.TitleText})}),image:(0,r.jsx)(o.Image,{field:i.fields.CardImage}),children:[(0,r.jsx)(c.default,{tag:"div",variation:"body-large",children:(0,r.jsx)(l.RichText,{field:i.fields.BodyText})}),(0,r.jsx)("form",{autoComplete:"off",children:(0,r.jsx)(f.default,{placeholder:i?.fields?.SearchPlaceholderText?.value||"Type in a consultant name",doctifyBaseURL:i?.fields?.API_Autocomplete_BaseURL?.value||"https://api.doctify.com/api/hca/search/autocomplete?search",doctifySearchBaseURL:i?.fields?.API_DoctifySearch_BaseURL?.value||"https://api.doctify.com/api/hca/search",limit:Number(i?.fields?.API_Autocomplete_Limit?.value)||20,noResultsMsg:i?.fields?.API_Autocomplete_NoResultsMsg?.value||"No matches found, please try typing something else.",searchIcon:i?.fields?.SearchIconSearchBar?.fields?.SvgMarkup?.value||null,searchIconResults:i?.fields?.SearchIconResults?.fields?.SvgMarkup?.value||null,searchStringConsultantName:v,setSearchStringConsultantName:x,popularConsultantsList:i?.fields?.PopularConsultantsList||[],searchConsultantsResultsHeaderText:i?.fields?.SearchConsultantsResultsHeaderText?.value||"SPECIALISTS",loadingText:i?.fields?.API_Autocomplete_LoadingMsg?.value||"Loading..."})})]}),(0,r.jsxs)(p.default,{children:[(0,r.jsx)(g.default,{children:(0,r.jsxs)(s.Link,{field:i.fields.BackLink,children:[(0,r.jsx)(m.default,{iconName:"iconArrowSmallLeft"}),i.fields.BackLink.value.text]})}),(0,r.jsx)(u.default,{size:"small",variation:"full-dark",children:(0,r.jsx)("button",{disabled:""===b,onClick:()=>y.push(`${i?.fields?.NextLink?.value?.href&&i?.fields?.NextLink?.value?.href.replace(/,-w-,/g,"")}${b}`||""),children:(0,r.jsx)("span",{children:i.fields.NextLink.value.text||"Next"})})})]})]}):(0,r.jsx)(_,{...i})}])},504240,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(308637),s=i.i(159273),l=i.i(314816),u=i.i(443107),c=i.i(257818),d=i.i(569030),h=i.i(77015),f=i.i(907771),p=i.i(623420),m=i.i(630077),g=i.i(211452),_=i.i(190408),y=i.i(304684),v=i.i(906396),x=i.i(597330);let b=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})}),w=i=>{let w=(0,a.useRouter)(),T=(0,a.useSearchParams)(),{searchStringPayment:E,setSearchStringPayment:S,setIsSelfPayment:A,isSelfPayment:C,selectedInsurerPaymentStep:I,searchStringLocations:k,lat:R,lon:M,distance:L}
122=(0,n.useContext)(o.ConsultantFinderContext),[P,O]=(0,n.useState)(""),[D,F]=(0,n.useState)("");return((0,n.useEffect)(()=>{window.scrollTo({top:0,behavior:"smooth"}),F((0,x.getQueryValue)(T,"keywordId")),O((0,x.getQueryValue)(T,"searchString")),A(!1),S("")},[T]),i.fields)?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y.default,{withConsultantName:!0,backLinkProfile:i?.fields?.BackLink?.value?.href,backLinkText:i?.fields?.BackLink?.value?.text||"Back",hasTitleName:!1}),(0,r.jsxs)(d.default,{noOverflownHidden:!0,contentVariation:"hero-cf",cfVariation:!0,showRegion:!1,theme:"A-HCA-White",imageAlignment:"left",length:"short",hideImageOnMobile:!0,subheader:(0,r.jsx)(c.default,{tag:"h3",variation:"subheading-1",children:(0,r.jsx)(l.RichText,{field:i.fields.HeadingText})}),header:(0,r.jsx)(c.default,{tag:"h2",variation:"display-2",children:(0,r.jsx)(l.RichText,{field:i.fields.TitleText})}),image:null,children:[(0,r.jsx)(c.default,{tag:"div",variation:"body-large",children:(0,r.jsx)(l.RichText,{field:i.fields.BodyText})}),(0,r.jsxs)("form",{autoComplete:"off",children:[(0,r.jsx)(_.default,{marginTop:"spacing-4",marginBottom:"spacing-4",children:(0,r.jsx)(c.default,{tag:"h2",variation:"heading-2",children:i.fields.TitleText.value})}),(0,r.jsx)(p.default,{id:"1",label:i.fields.SelfPayCheckBoxText.value,name:"selfpayment",value:"selfpayment",checked:C,onChange:r=>{r.target.checked&&(A(r.target.checked),S(""),(0,v.isMobile)()||("London"!==k&&"Anywhere"!==k?w.push(`/finder/step-consultant-cards?search=${P}&keywordId=${D}&sortType=relevance&lat=${R||"51.507217"}&lon=${M||"-0.1275862"}&distance=${L||0}&limit=12&offset=0`):w.push(`${i.fields.NextLink.value.href||"/finder/step-locations"}?keywordId=${D}&searchString=${P}`)))}}),(0,r.jsx)(h.default,{placeholder:i?.fields?.SearchPlaceholderText?.value||"Type in your insurance provider",doctifyBaseURL:i?.fields?.API_Insurance_BaseURL?.value||"https://api.doctify.com/api/hca/listing/insurers",limit:Number(i?.fields?.API_Insurance_Limit?.value)||20,noResultsMsg:i?.fields?.API_Insurance_NoResultsMsg?.value||"No matches found, please try typing something else.",searchIcon:i?.fields?.SearchIcon?.fields?.SvgMarkup?.value||null,searchStringPayment:E,setSearchStringPayment:S,insuranceProvidersFilterHeaderText:i?.fields?.InsuranceProvidersFilterHeaderText?.value||"INSURERS",insurersList:i?.fields?.InsurersList||[],loadingText:i?.fields?.API_Insurance_LoadingMsg?.value||"Loading...",nextLink:`${i.fields.NextLink.value.href||"/finder/step-locations"}?keywordId=${D}&searchString=${P}`,search:P})]})]}),(0,r.jsxs)(f.default,{showOnMobile:!0,children:[(0,r.jsx)(g.default,{children:(0,r.jsxs)(s.Link,{field:i.fields.BackLink,children:[(0,r.jsx)(m.default,{iconName:"iconArrowSmallLeft"}),i.fields.BackLink.value.text]})}),(0,r.jsx)(u.default,{size:"small",variation:"full-dark",children:(0,r.jsx)("button",{disabled:""===E&&!C,onClick:()=>{"London"!==k&&"Anywhere"!==k?w.push(`/finder/step-consultant-cards?search=${P}&keywordId=${D}&sortType=relevance&lat=${R||"51.507217"}&lon=${M||"-0.1275862"}&distance=${L||0}&limit=12&offset=0${C?"":`&insurer=${I}`}`):w.push(`${i.fields.NextLink.value.href||"/finder/step-locations"}?keywordId=${D}&searchString=${P}${C?"":`&insurer=${I}`}`)},children:(0,r.jsx)("span",{children:i.fields.NextLink.value.text})})})]})]})}):(0,r.jsx)(b,{...i})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(w,{...i})})])},534829,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(443107),s=i.i(573295),l=i.i(70498),u=i.i(907771),c=i.i(211452),d=i.i(630077),h=i.i(308637),f=i.i(23582),p=i.i(751344),m=i.i(405133),g=i.i(597330);let _=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})}),y=i=>{let{selectedLocations:y}=(0,n.useContext)(h.ConsultantFinderContext),[v,x]=(0,n.useState)([]),[b,w]=(0,n.useState)(i?.fields?.Hospitals||[]),[T,E]=(0,n.useState)(""),[S,A]=(0,n.use
122State)(""),[C,I]=(0,n.useState)(""),[k,R]=(0,n.useState)(!1),M=(0,a.useRouter)(),L=(0,a.useSearchParams)(),P=i?.fields?.Hospitals.map(i=>i.fields.slug.value),O=i?.fields?.Hospitals.map(i=>i.fields.postCode.value).join(",");return((0,n.useEffect)(()=>{window.scrollTo({top:0,behavior:"smooth"}),A((0,g.getQueryValue)(L,"keywordId")),E((0,g.getQueryValue)(L,"searchString")),I((0,g.getQueryValue)(L,"insurer"))},[L]),i.fields)?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f.default,{hospitals:b,setHospitals:w,postcodesFacilities:O,locationAPI:i?.fields?.API_HCA_Locations_BaseURL?.value,array:v,setArray:x,slugs:P,subheadline:i?.fields?.HeadingText?.value||"facilities & hospitals",title:i?.fields?.TitleText?.value||"Preferred locations",text:i?.fields?.BodyText?.value||"Enter your postcode to see the locations closest to you. Please select any facilities you wish to visit, or continue to see consultants across all of our facilities.",searchPlaceholderText:i?.fields?.SearchPlaceholderText?.value||"Enter postcode or place name",removeAllLocationsButtonText:i?.fields?.RemoveAllLocationsButtonText?.value||"Remove all locations",selectAllLocationsButtonText:i?.fields?.SelectAllLocationsButtonText?.value||"Add all locations",setCalculate:R}),k&&(0,r.jsx)(p.default,{loadingMsg:"Calculating distances..."}),(0,r.jsx)(s.default,{children:b.length>0&&b.map(n=>(0,r.jsx)(l.default,{name:n?.fields?.HCAName?.value||"",addressLine1:n?.fields?.addressLine1?.value||"",city:n?.fields?.cityOrCounty?.value||"",postcode:n?.fields?.postCode?.value||"",slug:n?.fields?.slug?.value||"",array:v,setArray:x,distance:n?.distance||null,selectCardText:i?.fields?.SelectCardText?.value||"Select",removeCardText:i?.fields?.RemoveCardText?.value||"Remove",search:T,keywordId:S,insurance:C},n.id))}),(0,r.jsxs)(u.default,{children:[(0,r.jsx)(c.default,{children:(0,r.jsxs)(m.default,{href:`${i.fields.BackLink.value.href}?keywordId=${S}&searchString=${T}`,children:[(0,r.jsx)(d.default,{iconName:"iconArrowSmallLeft"}),i.fields.BackLink.value.text]})}),(0,r.jsx)(o.default,{size:"small",variation:"full-dark",children:(0,r.jsx)("button",{disabled:!1,onClick:()=>M.push(`${i?.fields?.NextLink?.value?.href}?search=${T}&keywordId=${S}&sortType=relevance${y.length>0?`&practice=${y.join(",")}&`:"&"}lat=51.507217&lon=-0.1275862&distance=0&limit=12&${C?`insurer=${C}&`:""}offset=0`),children:(0,r.jsx)("span",{children:i.fields.NextLink.value.text})})})]})]})}):(0,r.jsx)(_,{...i})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(y,{...i})})])},454874,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(405133),s=i.i(293715),l=i.i(443107),u=i.i(257818),c=i.i(308637),d=i.i(857690),h=i.i(225659),f=i.i(190408),p=i.i(211452),m=i.i(907771),g=i.i(630077),_=i.i(709003),y=i.i(751344),v=i.i(267770),x=i.i(770705),b=i.i(304684),w=i.i(597330);let T=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})}),E=i=>{let{setSelectedTypeOfAppointment:E,setConsultantGUID:S,setHcaConsultantID:A,setConsultantName:C,setConsultantMainSpecialty:I}=(0,n.useContext)(c.ConsultantFinderContext),k=i.params.RenderingIdentifier,R=(0,a.useRouter)(),M=(0,a.useSearchParams)(),[L,P]=(0,n.useState)(""),[O,D]=(0,n.useState)(""),[F,N]=(0,n.useState)(""),[j,z]=(0,n.useState)(""),[B,U]=(0,n.useState)(""),[V,H]=(0,n.useState)(null),[G,q]=(0,n.use
122State)(""),$=i?.fields?.API_C2_GetConsultantDetails_BaseURL?.value||"/api/C2/GetLDBConsultantDetails?",[W,Y]=(0,n.useState)([]),[Z,K]=(0,n.useState)(!0),[X,Q]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{window.scrollTo({top:0,behavior:"smooth"}),N((0,w.getQueryValue)(M,"search")),z((0,w.getQueryValue)(M,"keywordId")),P((0,w.getQueryValue)(M,"slug")),D((0,w.getQueryValue)(M,"name"));let i=(0,w.getQueryValue)(M,"gmcNumber");U(i),H(Number(M.get("reviewsTotal")));let r=M.get("isFollowOnAppointment");r&&E(r?.toString());let n=`${$}&gmcNumber=${i}&isFollowOnAppointment=${r}`;x.default.get(n).then(i=>{K(!1),Q(!1),Y(i?.data?.availability||[]),S(i?.data?.CRMID||""),A(i?.data?.professionalRegistrationNumber||""),C(`${i?.data?.firstName} ${i?.data?.lastName}`),I(i?.data?.providerMainSpecialty||"")}).catch(i=>{Q(!0),console.log(i)})},[M]),i.fields)?(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,id:k||void 0,children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.default,{logo:(0,r.jsx)(s.Image,{field:i?.fields?.HCALogo}),progress:(0,r.jsx)(h.default,{currentPage:i?.fields?.CurrentStep?.value,steps:i?.fields?.Steps,slug:L,gmcNumber:B,reviewsTotal:V,name:O})}),(0,r.jsx)(b.default,{withConsultantName:!0,name:O,slug:L,gmcNumber:B,reviewsTotal:V||0,backLink:i?.fields?.BackLink?.value?.href,headingText:i?.fields?.HeadingText?.value||"Please select a location",backLinkText:i.fields.BackLink.value.text||"Back",resultsLink:i?.fields?.ResultsLink?.value||"/finder/step-consultant-cards",search:F,keywordId:j}),!Z&&!X&&(0,r.jsx)(_.default,{cantFindIcon:(0,r.jsx)(v.default,{children:i?.fields?.CantFindIcon?.fields?.SvgMarkup?.value}),cantFindTitle:(0,r.jsx)(u.default,{tag:"p",variation:"body-medium-large",children:i?.fields?.CantFindBannerText?.value}),cantFindNumber:i?.fields?.CantFindPhoneNumber?.value,nextLink:`${i?.fields?.NextLink?.value?.href||"/finder/step-slot-select"}?slug=${L}&name=${encodeURIComponent(O)}&gmcNumber=${B}&reviewsTotal=${V}&search=${F}&keywordId=${j}`,locations:W,viewOnMapText:i?.fields?.ViewMapText?.value||"View location on Google Maps",noLocationsMsg:"",icon:(0,r.jsx)(v.default,{children:i?.fields?.CardTimeIcon?.fields?.SvgMarkup?.value}),iconPhone:(0,r.jsx)(g.default,{iconName:"iconPhone"}),isSelected:G,setIsSelected:q}),Z&&(0,r.jsx)(y.default,{loadingMsg:"Loading..."}),!Z&&X&&(0,r.jsx)("div",{children:"There was an error, please try again"}),(0,r.jsxs)(m.default,{showOnMobile:!0,children:[(0,r.jsx)("div",{children:(0,r.jsx)(p.default,{children:(0,r.jsxs)(o.default,{href:`${i?.fields?.BackLink?.value?.href}?slug=${L}&name=${encodeURIComponent(O)}&gmcNumber=${B}&reviewsTotal=${V}&search=${F}&keywordId=${j}`,children:[(0,r.jsx)(g.default,{iconName:"iconArrowSmallLeft"}),(0,r.jsx)("span",{children:i.fields.BackLink.value.text||"Back"})]})})}),(0,r.jsx)(f.default,{children:(0,r.jsx)(l.default,{size:"small",variation:"full-dark",children:(0,r.jsx)("button",{disabled:""===G,onClick:()=>R.push(`${i?.fields?.NextLink?.value?.href||"/finder/step-slot-select"}?slug=${L}&name=${encodeURIComponent(O)}&gmcNumber=${B}&reviewsTotal=${V}&search=${F}&keywordId=${j}`),children:(0,r.jsx)("span",{children:i?.fields?.NextLink?.value?.text||"Next"})})})})]})]})}):(0,r.jsx)(T,{...i})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(E,{...i})})])},296334,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(918445),s=i.i(661279),l=i.i(687052),u=i.i(951690),c=i.i(649555),d=i.i(770705),h=i.i(293715),f=i.i(314816),p=i.i(443107),m=i.i(257818),g=i.i(857690),_=i.i(225659),y=i.i(376227),v=i.i(862185),x=i.i(308637),b=i.i(462907),w=i.i(47742),T=i.i(708517),E=i.i(473792),S=i.i(680346),A=i.i(160919),C=i.i(190408),I=i.i(887322),k=i.i(641657),R=i.i(780798),M=i.i(859040),L=i.i(906396),P=i.i(710820),O=i.i(597330);let D=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})}),F=i=>{let F=i.params.RenderingIdentifier,N=(0,a.useRouter)(),j=(0,a.useSearchParams)(),[z,B]=(0,n.use
122State)(""),[U,V]=(0,n.useState)(""),[H,G]=(0,n.useState)(null),[q,$]=(0,n.useState)([]),[W,Y]=(0,n.useState)(!1),[Z,K]=(0,n.useState)(!0),[X,Q]=(0,n.useState)(!1),J=(0,n.useRef)(null),[ee,et]=(0,n.useState)(""),[ei,er]=(0,n.useState)(""),[en,ea]=(0,n.useState)(""),eo={id:"999999",name:"HCA Healthcare UK",website:"https://www.hcahealthcare.co.uk/"},{selectedLocationName:es,selectedDate:el,selectedTime:eu,hcaConsultantID:ec,locationID:ed,selectedTypeOfAppointment:eh,startTime:ef,consultantMainSpecialty:ep,consultantName:em,setPatientName:eg,setFinderFormPayor:e_,setFinderFormPrevious:ey,setCompletedFormId:ev}=(0,n.useContext)(x.ConsultantFinderContext),ex=s.z.object({user:s.z.string().trim().min(1,{message:"Required"}),payment:s.z.string(),insuranceProvider:s.z.string(),insurancePolicyNumber:s.z.string(),insuranceAuthorisationCode:s.z.string().optional(),reasonForAppointment:s.z.string().trim().min(1,{message:"Required"}),gpreferral:s.z.string().min(1,{message:"Required"}),previouslyBeenWithHCA:s.z.string().min(1,{message:"Required"}),patientCode:s.z.string().optional(),title:s.z.string().trim().min(1,{message:"Required"}),firstName:s.z.string().trim().min(1,{message:"Required"}),lastName:s.z.string().trim().min(1,{message:"Required"}),email:s.z.string().min(1,{message:"Required"}).email("This is not a valid email."),phone:s.z.string().trim().min(1,{message:"Required"}).refine(i=>/^\d+$/.test(i),{message:"Invalid phone number"}),gender:s.z.string().trim().min(1,{message:"Required"}),dateOfBirth:s.z.string().min(1,{message:"Required"}).refine(i=>{if(es.toLowerCase().includes("portland"))return!0;let r=new Date(i),n=new Date((0,L.formatDateYYYYMMDD)(ef)),a=new Date(n);return a.setFullYear(n.getFullYear()-18),r<=a},{message:`${i?.fields?.LiveBookingFormDateOfBirthErrors[0]?.fields?.Msg?.value||"Our online live diary booking service is not available for bookings for patients under the age of 18 years old or if you require an oncology specialist. For this please call us on 020 3993 4232"}`}),address1:s.z.string().trim().min(1,{message:"Required"}),address2:s.z.string().optional(),postcode:s.z.string().trim().min(1,{message:"Required"}),towncity:s.z.string().trim().min(1,{message:"Required"}),country:s.z.string().trim().min(1,{message:"Required"}),contactDetails:s.z.boolean().optional(),marketingPreferenceEmail:s.z.boolean().optional(),marketingPreferencePhone:s.z.boolean().optional(),marketingPreferenceSMS:s.z.boolean().optional(),marketingPreferencePost:s.z.boolean().optional(),representativeRelationToPatient:s.z.string(),representativeTitle:s.z.string(),representativeFirstName:s.z.string(),representativeLastName:s.z.string(),representativeEmail:s.z.string().max(0).or(s.z.string().email()),representativePhone:s.z.string(),recaptcha:s.z.string().min(1,{message:"Required"})}).refine(i=>{if(("patient"===i.user||"medicalsecretary"===i.user)&&""===i.payment)return!1;return!0},{message:"Required",path:["payment"]}).refine(i=>{if(("insurer"===i.user||"insurance"===i.payment)&&""===i.insuranceProvider&&0!==q.length)return!1;return!0},{message:"Required",path:["insuranceProvider"]}).refine(i=>{if(("insurer"===i.user||"insurance"===i.payment)&&""===i.insurancePolicyNumber)return!1;return!0},{message:"Required",path:["insurancePolicyNumber"]}).refine(i=>{if(!0===i.contactDetails&&""===i.representativeRelationToPatient)return!1;return!0},{message:"Required",path:["representativeRelationToPatient"]}).refine(i=>{if(!0===i.contactDetails&&""===i.representativeTitle)return!1;return!0},{message:"Required",path:["representativeTitle"]}).refine(i=>{if(!0===i.contactDetails&&""===i.representativeFirstName)return!1;return!0},{message:"Required",path:["representativeFirstName"]}).refine(i=>{if(!0===i.contactDetails&&""===i.representativeLastName)return!1;return!0},{message:"Required",path:["representativeLastName"]}).refine(i=>{if(!0===i.contactDetails&&""===i.representativeEmail)return!1;return!0},{message:"Required",path:["representativeEmail"]}).refine(i=>{if(!0===i.contactDetails&&""===i.representativePhone)return!1;return!0},{message:"Required",path:["representativePhone"]}),{register:eb,control:ew,handleSubmit:eT,formState:{errors:eE,isDirty:eS},watch:eA,setValue:eC,clearErrors:eI}=(0,o.useForm)({defaultValues:{user:"",payment:"",insuranceProvider:"",insurancePolicyNumber:"",insuranceAuthorisationCode:"",reasonForAppointment:"",gpreferral:"",previouslyBeenWithHCA:"",patientCode:"",title:"",firstName:"",lastName:"",email:"",ph
122one:"",gender:"",dateOfBirth:"",address1:"",address2:"",postcode:"",towncity:"",country:"",contactDetails:!1,marketingPreferenceEmail:!1,marketingPreferencePhone:!1,marketingPreferenceSMS:!1,marketingPreferencePost:!1,representativeRelationToPatient:"",representativeTitle:"",representativeFirstName:"",representativeLastName:"",representativeEmail:"",representativePhone:"",recaptcha:""},resolver:(0,l.zodResolver)(ex),mode:"onChange"}),ek=eA();return((0,n.useEffect)(()=>{window.scrollTo({top:0,behavior:"smooth"}),er((0,O.getQueryValue)(j,"search")),ea((0,O.getQueryValue)(j,"keywordId"));let i=j.get("slug");if(i){var r;B(i.toString()),r=i.toString(),d.default.get(`${P.DOCTIFY_API_BASE_URL}/specialists/${r}`).then(i=>{Y(!1),K(!1),$(i?.data?.insurers||[])}).catch(i=>{Y(!0),K(!1),console.log(i)})}et((0,O.getQueryValue)(j,"name")),V((0,O.getQueryValue)(j,"gmcNumber")),G(Number(j.get("reviewsTotal")))},[j]),(0,n.useEffect)(()=>{("patient"===ek.user||"medicalsecretary"===ek.user)&&q&&$(q.filter(i=>"HCA Healthcare UK"!==i.name)),"insurer"===ek.user&&(eC("payment",""),eC("contactDetails",!1),eC("marketingPreferenceEmail",!1),eC("marketingPreferencePhone",!1),eC("marketingPreferenceSMS",!1),eC("marketingPreferencePost",!1),eE?.representativeRelationToPatient&&eI("representativeRelationToPatient"),eE?.representativeTitle&&eI("representativeTitle"),eE?.representativeFirstName&&eI("representativeFirstName"),eE?.representativeLastName&&eI("representativeLastName"),eE?.representativeEmail&&eI("representativeEmail"),eE?.representativePhone&&eI("representativePhone"),q&&(q.some(i=>"HCA Healthcare UK"===i.name)||(q.unshift(eo),$(q)))),"self-pay"===ek.payment&&(eC("insuranceProvider",""),eC("insurancePolicyNumber",""),eC("insuranceAuthorisationCode","")),"No"===ek.previouslyBeenWithHCA&&eC("patientCode",""),!1===ek.contactDetails&&eC("representativeRelationToPatient","")},[ek.user,ek.payment,ek.previouslyBeenWithHCA,ek.contactDetails]),i.fields)?(0,r.jsxs)("div",{className:`component promo ${i.params.styles}`,id:F||void 0,children:[""===eu&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C.default,{marginBottom:"spacing-8",marginTop:"spacing-8",marginLeft:"spacing-6",marginRight:"spacing-6",children:(0,r.jsx)(m.default,{tag:"p",variation:"body-medium-large",children:i?.fields?.LiveBookingFormErrorNoSlotSelected?.value||"There is no slot selected."})}),(0,r.jsx)(C.default,{marginBottom:"spacing-8",marginTop:"spacing-8",marginLeft:"spacing-6",marginRight:"spacing-6",children:(0,r.jsx)(p.default,{size:"small",variation:"full-dark",children:(0,r.jsx)("button",{onClick:()=>N.push(`${i?.fields?.LiveBookingFormStepAppointment?.value?.href||"/finder/step-appointment-type"}?slug=${z}&gmcNumber=${U}&reviewsTotal=${H}&search=${ei}&keywordId=${en}`),children:i?.fields?.LiveBookingFormErrorSubmitBtnLabel?.value||"Back to booking"})})})]}),""!==eu&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.default,{logo:(0,r.jsx)(h.Image,{field:i?.fields?.HCALogo}),progress:(0,r.jsx)(_.default,{currentPage:i?.fields?.CurrentStep?.value,steps:i?.fields?.Steps,slug:z,gmcNumber:U,reviewsTotal:H,name:ee})}),(0,r.jsxs)(y.default,{children:[(0,r.jsx)(M.default,{ref:J,children:(0,r.jsxs)(C.default,{marginBottom:"spacing-8",marginTop:"spacing-8",marginLeft:"spacing-4",marginRight:"spacing-4",children:[(0,r.jsx)(m.default,{tag:"p",variation:"heading-1",children:i?.fields?.LiveBookingFormErrorSubmitMsg?.value||"There was an error, please choose a different appointment"}),(0,r.jsx)(C.default,{marginBottom:"spacing-8",marginTop:"spacing-8",children:(0,r.jsx)(p.default,{size:"small",variation:"full-dark",children:(0,r.jsx)("button",{onClick:()=>N.push(`${i?.fields?.LiveBookingFormStepSlotSelect?.value?.href||"/finder/step-slot-select"}?slug=${z}&gmcNumber=${U}&isFollowOnAppointment=${eh}&reviewsTotal=${H}&search=${ei}&keywordId=${en}`),children:i?.fields?.LiveBookingFormErrorSubmitBtnLabel?.value||"Back to booking"})})})]})}),(0,r.jsx)(u.DevTool,{control:ew,placement:"top-right"}),(0,r.jsxs)("form",{onSubmit:eT(r=>{let n,a,o;return Q(!0),n={dateFrom:ef,isFollowOnAppointment:eh,HCAConsultantId:ec,FacilityId:ed,selectedSpeciality:ep,reasonForAppointment:r.reasonForAppointment,recaptcha:r.re
122captcha,demographics:{previouslyBeenWithHCA:"Yes"===r.previouslyBeenWithHCA,patientCode:r.patientCode,title:r.title,firstName:r.firstName,lastName:r.lastName,gender:r.gender,dateOfBirth:r.dateOfBirth,email:r.email,phone:r.phone,address1:r.address1,address2:r.address2,towncity:r.towncity,postcode:r.postcode,country:r.country,marketingPreferenceEmail:r.marketingPreferenceEmail,marketingPreferencePhone:r.marketingPreferencePhone,marketingPreferenceSMS:r.marketingPreferenceSMS,marketingPreferencePost:r.marketingPreferencePost,datesCannotDo:r.datesCannotDo,representativeTitle:r.representativeTitle,representativeFirstName:r.representativeFirstName,representativeLastName:r.representativeLastName,representativeRelation:r.representativeRelationToPatient,representativeEmail:r.representativeEmail,representativePhone:r.representativePhone,bookingBy:r.user,paidBy:r.payment,insuranceProvider:r.insuranceProvider,insurancePolicyNumber:r.insurancePolicyNumber,insuranceAuthorisationCode:r.insuranceAuthorisationCode,gpreferral:"yes"===r.gpreferral}},a=i?.fields?.API_C2_ReserveConsultantSlot_BaseURL?.value,o=JSON.stringify(n),(0,d.default)({method:"post",url:a,headers:{"Content-Type":"application/json"},data:o}).then(function(n){n.data.errorCode?(console.log("error booking"),J?.current?.showModal()):(e_(r.payment),ev(n?.data?.hcaReservationId),ey(r.previouslyBeenWithHCA),G(H),N.push(`${i?.fields?.NextLink?.value?.href||"/finder/step-live-booking-confirmation"}?slug=${z}&gmcNumber=${U}&reviewsTotal=${H}`)),Q(!1)}).catch(function(i){Q(!1),J?.current?.showModal(),console.log(i),i.response?(console.log("error.response.status",i.response.status),console.log("error.response.data",i.response.data)):console.log("error.message",i.message)}),eg(`${r.firstName} ${r.lastName}`),new Promise(i=>{setTimeout(()=>i(),1e3)})},i=>{console.log("errors on submit",i)}),noValidate:!0,children:[(0,r.jsxs)(C.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:[(0,r.jsx)(m.default,{tag:"h1",variation:"display-4",children:i?.fields?.LiveBookingFormHeadline?.value||"Your details"}),(0,r.jsx)(m.default,{tag:"p",variation:"body-medium-large",children:i?.fields?.LiveBookingFormSubHeadline?.value||"All fields are required unless specified as optional."})]}),(0,r.jsx)(C.default,{marginBottom:"spacing-6",children:(0,r.jsx)(v.default,{title:i?.fields?.LiveBookingFormSummaryTitle?.value||"Appointment summary",consultantTitle:i?.fields?.LiveBookingFormSummaryConsultant?.value||"Consultant",consultantText:em,locationTitle:i?.fields?.LiveBookingFormSummaryLocation?.value||"Location",locationText:es,dateTitle:i?.fields?.LiveBookingFormSummaryDate?.value||"Date & time",dateText:`${el} at ${eu}`,slug:z,gmcNumber:U,reviewsTotal:H,isFollowUpAppointment:eh,isMobile:!0,liveBookingFormStepLocationSelect:i?.fields?.LiveBookingFormStepLocationSelect?.value?.href||"/finder/step-location-select",liveBookingFormStepSlotSelect:i?.fields?.LiveBookingFormStepSlotSelect?.value?.href||"/finder/step-slot-select",name:ee,search:ei,keywordId:en})}),(0,r.jsx)(m.default,{tag:"h2",variation:"heading-1",children:i?.fields?.LiveBookingFormUserLabel?.value||"About you"}),(0,r.jsxs)(C.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:[i?.fields?.LiveBookingFormUserOptions&&i?.fields?.LiveBookingFormUserOptions.map(i=>(0,r.jsx)(T.default,{label:i?.fields?.Label?.value||"",name:"user",value:i?.fields?.Value?.value,register:eb},i.id)),eE?.user&&(0,r.jsx)(b.default,{errorMessage:eE?.user?.message})]}),""!==ek.user&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.default,{tag:"h2",variation:"heading-1",children:i?.fields?.LiveBookingFormAboutAppointmentHeadline?.value||"About appointment"}),("patient"===ek.user||"medicalsecretary"===ek.user)&&(0,r.jsxs)(C.default,{marginBottom:"spacing-6",marginTop:"spacing-2",children:[i?.fields?.LiveBookingFormAboutAppointmentOptions&&i?.fields?.LiveBookingFormAboutAppointmentOptions.map(i=>(0,r.jsx)(T.default,{label:i?.fields?.Label?.value||"",name:"payment",value:i?.fields?.Value?.value,register:eb},i.id)),eE?.payment&&(0,r.jsx)(b.default,{errorMessage:eE?.payment?.message})]}),("insurer"===ek.user||"insurance"===ek.payment)&&(0,r.jsxs)(r.Fragment,{children:[!Z&&!W&&q.length>0&&(0,r.jsx)(S.default,{id:"insuranceProvider",name:"insuranceProvider",label:i?.fields?.LiveBookingFormInsuranceLabel?.value||"Insurance company",addDefaultValue:!0,defaultValueLabel:"Please select",required:!0,isError:!!eE?.insuranceProvider,errorMessage:eE?.insuranceProvider?.message,options:q.map(i=>(0,r.jsx)("option",{value:i.name,children:i.name},i.id)),register:eb}),(0,r.jsx)(E.default,{id:"insurancePolicyNumber",label:i?.fields?.LiveBookingFormInsuranceNumberLabel?.value||"",name:"insurancePolicyNumber",required:!0,register:eb,setValue:eC,isError:!!eE?.insurancePolicyNumber,errorMessage:eE?.insurancePolicyNumber?.message}),(0,r.jsx)(E.default,{id:"insuranceAuthorisationCode",label:i?.fields?.LiveBookingFormPatientAuthorisationCodeLabel?.value||"",name:"insuranceAuthorisationCode",required:!1,register:eb,setValue:eC,isError:!!eE?.insuranceAuthorisationCode,errorMessage:eE?.insuranceAuthorisationCode?.message})]}),(0,r.jsx)(w.default,{id:"reasonForAppointment",name:"reasonForAppointment",label:"What is the reason for this appointment?",required:!0,register:eb,isError:!!eE?.reasonForAppointment,errorMessage:eE?.reasonForAppointment?.message}),(0,r.jsxs)(C.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:[(0,r.jsx)(m.default,{tag:"h2",variation:"body-medium-extra-large",children:i?.fields?.LiveBookingFormGpreferralSubHeadline?.value||"Has the patient received a referral from their GP ?"}),i?.fields?.LiveBookingFormGpreferralOptions&&i?.fields?.LiveBookingFormGpreferralOptions.map(i=>(0,r.jsx)(T.default,{label:i?.fields?.Label?.value||"",name:"gpreferral",value:i?.fields?.Value?.value,register:eb},i.id)),eE?.gpreferral&&(0,r.jsx)(b.default,{errorMessage:eE?.gpreferral?.message})]}),(0,r.jsxs)(C.default,{marginBottom:"spacing-6",children:[(0,r.jsx)(m.default,{tag:"h2",variation:"heading-1",children:i?.fields?.LiveBookingFormAboutYouHeadline?.value||"About the patient"}),i?.fields?.LiveBookingFormPreviouslyBeenWithHCAOptions&&(0,r.jsx)(S.default,{id:"previouslyBeenWithHCA",name:"previouslyBeenWithHCA",label:i?.fields?.LiveBookingFormPreviouslyBeenWithHCALabel?.value||"Has the Patient previously been with HCA?",required:!0,isError:!!eE?.previouslyBeenWithHCA,errorMessage:eE?.previouslyBeenWithHCA?.message,options:i?.fields?.LiveBookingFormPreviouslyBeenWithHCAOptions.map(i=>(0,r.jsx)("option",{value:i?.fields?.Value?.value,children:i?.fields?.Label?.value},i.id)),register:eb}),"Yes"===ek.previouslyBeenWithHCA&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.default,{tag:"h2",variation:"body-medium-large",children:i?.fields?.LiveBookingFormXNumberHeadline?.value||"Do you have the Patients X-number?"}),(0,r.jsx)(E.default,{id:"patientCode",label:i?.fields?.LiveBookingFormXNumberLabel?.value||"What is the reason for this appointment?",name:"patientCode",required:!1,register:eb,setValue:eC,isError:!!eE?.patientCode,errorMessage:eE?.patientCode?.message})]})]}),(0,r.jsxs)(C.default,{marginBottom:"spacing-6",children:[(0,r.jsx)(m.default,{tag:"h2",variation:"heading-1",children:i?.fields?.LiveBookingFormDetailsHeadline?.value||"Patients details"}),(0,r.jsx)(S.default,{id:"title",name:"title",label:i?.fields?.LiveBookingFormTitleLabel?.value||"Title",required:!0,isError:!!eE?.title,errorMessage:eE?.title?.message,options:i?.fields?.LiveBookingFormTitleOptions.map(i=>(0,r.jsx)("option",{value:i?.fields?.Value?.value,children:i?.fields?.Label?.value},i.id)),register:eb}),(0,r.jsx)(E.default,{id:"firstName",label:i?.fields?.LiveBookingFormFirstNameLabel?.value||"First Name",name:"firstName",required:!0,register:eb,setValue:eC,isError:!!eE?.firstName,errorMessage:eE?.firstName?.message}),(0,r.jsx)(E.default,{id:"lastName",label:i?.fields?.LiveBookingFormLastNameLabel?.value||"Last Name",name:"lastName",required:!0,register:eb,setValue:eC,isError:!!eE?.lastName,errorMessage:eE?.lastName?.message}),(0,r.jsx)(E.default,{id:"email",label:i?.fields?.LiveBookingFormEmailLabel?.value||"email",name:"email",type:"email",required:!0,register:eb,setValue:eC,isError:!!eE?.email,errorMessage:eE?.email?.message}),(0,r.jsx)(E.default,{id:"phone",label:i?.fields?.LiveBookingFormPhoneLabel?.value||"phone",name:"phone",required:!0,register:eb,setValue:eC,isError:!!eE?.phone,errorMessage:eE?.phone?.message}),(0,r.jsx)(S.default,{id:"gender",name:"gender",label:i?.fields?.LiveBookingFormGenderLabel?.value||"Gender",required:!0,isError:!!eE?.gender,errorMessage:eE?.gender?.message,options:i?.fields?.LiveBookingFormGenderOptions.map(i=>(0,r.jsx)("option",{value:i?.fields?.Value?.value,children:i?.fields?.Label?.value},i.id)),register:eb}),(0,r.jsx)(E.default,{id:"dateOfBirth",label:i?.fields?.LiveBookingFormDateOfBirthLabel?.value||"date of birth",name:"dateOfBirth",type:"date",required:!0,register:eb,setValue:eC,isError:!!eE?.dateOfBirth,errorMessage:eE?.dateOfBirth?.message})]}),(0,r.jsxs)(C.default,{marginBottom:"spacing-6",children:[(0,r.jsx)(m.default,{tag:"h2",variation:"heading-1",children:i?.fields?.LiveBookingFormAddressHeadline?.value||"Patients address"}),(0,r.jsx)(E.default,{id:"address1",label:i?.fields?.LiveBookingFormAddress1Label?.value||"Address Line 1",name:"address1",required:!0,register:eb,setValue:eC,isError:!!eE?.address1,errorMessage:eE?.address1?.message}),(0,r.jsx)(E.default,{id:"address2",label:i?.fields?.LiveBookingFormAddress2Label?.value||"Address Line 2",name:"address2",required:!1,register:eb,setValue:eC,isError:!!eE?.address2,errorMessage:eE?.address2?.message}),(0,r.jsx)(E.default,{id:"postcode",label:i?.fields?.LiveBookingFormPostcodeLabel?.value||"Postcode",name:"postcode",required:!0,register:eb,setValue:eC,isError:!!eE?.postcode,errorMessage:eE?.postcode?.message}),(0,r.jsx)(E.default,{id:"towncity",label:i?.fields?.LiveBookingFormTowncityLabel?.value||"Town / City",name:"towncity",required:!0,register:eb,setValue:eC,isError:!!eE?.towncity,errorMessage:eE?.towncity?.message}),(0,r.jsx)(E.default,{id:"country",label:i?.fields?.LiveBookingFormCountryLabel?.value||"Country",name:"country",required:!0,register:eb,setValue:eC,isError:!!eE?.country,errorMessage:eE?.country?.message})]}),(0,r.jsxs)(C.default,{marginBottom:"spacing-6",children:[(0,r.jsx)(m.default,{tag:"h2",variation:"heading-1",children:i?.fields?.LiveBookingFormRepresentativeHeadline?.value||"Additional details"}),"insurer"!==ek.user&&(0,r.jsx)(A.default,{label:i?.fields?.LiveBookingFormRepresentativeContactDetailsLabel?.value||"",name:"contactDetails",id:"contactDetails",register:eb}),(ek.contactDetails||"insurer"===ek.user)&&(0,r.jsxs)(r.Fragment,{children:["insurer"!==ek.user&&(0,r.jsx)(E.default,{id:"representativeRelationToPatient",label:i?.fields?.LiveBookingFormRepresentativeRelationToPatientLabel?.value||"Relation to the patient",name:"representativeRelationToPatient",required:"insurer"!==ek.user,register:eb,setValue:eC,isError:!!eE?.representativeRelationToPatient,errorMessage:eE?.representativeRelationToPatient?.message}),(0,r.jsx)(S.default,{id:"representativeTitle",name:"representativeTitle",label:i?.fields?.LiveBookingFormRepresentativeTitleLabel?.value||"Title",required:"insurer"!==ek.user,isError:!!eE?.representativeTitle,errorMessage:eE?.representativeTitle?.message,options:i?.fields?.LiveBookingFormRepresentativeTitleOptions.map(i=>(0,r.jsx)("option",{value:i?.fields?.Value?.value,children:i?.fields?.Label?.value},i.id)),register:eb}),(0,r.jsx)(E.default,{id:"representativeFirstName",label:i?.fields?.LiveBookingFormRepresentativeFirstNameLabel?.value||"First Name",name:"representativeFirstName",required:"insurer"!==ek.user,register:eb,setValue:eC,isError:!!eE?.representativeFirstName,errorMessage:eE?.representativeFirstName?.message}),(0,r.jsx)(E.default,{id:"representativeLastName",label:i?.fields?.LiveBookingFormRepresentativeLastNameLabel?.value||"Last Name",name:"representativeLastName",required:"insurer"!==ek.user,register:eb,setValue:eC,isError:!!eE?.representativeLastName,errorMessage:eE?.representativeLastName?.message}),(0,r.jsx)(E.default,{id:"representativeEmail",label:i?.fields?.LiveBookingFormRepresentativeEmailLabel?.value||"Email",n
122ame:"representativeEmail",type:"email",required:"insurer"!==ek.user,register:eb,setValue:eC,isError:!!eE?.representativeEmail,errorMessage:eE?.representativeEmail?.message}),(0,r.jsx)(E.default,{id:"representativePhone",label:i?.fields?.LiveBookingFormRepresentativePhoneLabel?.value||"Phone",name:"representativePhone",required:"insurer"!==ek.user,register:eb,setValue:eC,isError:!!eE?.representativePhone,errorMessage:eE?.representativePhone?.message})]})]}),("patient"===ek.user||"medicalsecretary"===ek.user)&&(0,r.jsxs)(I.default,{headline:i?.fields?.LiveBookingFormMarketingPreferencesHeadline?.value,text:(0,r.jsx)(f.RichText,{field:i.fields.LiveBookingFormMarketingPreferencesText}),children:[(0,r.jsx)(A.default,{label:i?.fields?.LiveBookingFormMarketingPreferencesFieldsEmailLabel?.value||"",name:"marketingPreferenceEmail",id:"marketingPreferenceEmail",register:eb}),(0,r.jsx)(A.default,{label:i?.fields?.LiveBookingFormMarketingPreferencesFieldsPhoneLabel?.value||"",name:"marketingPreferencePhone",id:"marketingPreferencePhone",register:eb}),(0,r.jsx)(A.default,{label:i?.fields?.LiveBookingFormMarketingPreferencesFieldsSmsLabel?.value||"",name:"marketingPreferenceSMS",id:"marketingPreferenceSMS",register:eb}),(0,r.jsx)(A.default,{label:i?.fields?.LiveBookingFormMarketingPreferencesFieldsPostLabel?.value||"",name:"marketingPreferencePost",id:"marketingPreferencePost",register:eb})]}),(0,r.jsxs)(C.default,{marginBottom:"spacing-6",children:[(0,r.jsx)(c.default,{sitekey:i?.fields?.API_C2_ReserveConsultantSlot_RecapchaKey?.value||"",onChange:i=>{eC("recaptcha",i||""),eE?.recaptcha&&eI("recaptcha")}}),(0,r.jsx)("input",{...eb("recaptcha"),type:"hidden"}),eE?.recaptcha&&(0,r.jsx)(b.default,{errorMessage:eE?.recaptcha?.message})]}),(0,r.jsx)(p.default,{size:"small",variation:"full-dark",children:(0,r.jsx)("button",{disabled:!eS||X,type:"submit",children:X?"Submitting":"Submit"})})]})]}),(0,r.jsxs)(R.default,{children:[(0,r.jsx)(v.default,{title:i?.fields?.LiveBookingFormSummaryTitle?.value||"Appointment summary",consultantTitle:i?.fields?.LiveBookingFormSummaryConsultant?.value||"Consultant",consultantText:em,locationTitle:i?.fields?.LiveBookingFormSummaryLocation?.value||"Location",locationText:es,dateTitle:i?.fields?.LiveBookingFormSummaryDate?.value||"Date & time",dateText:`${el} at ${eu}`,slug:z,gmcNumber:U,reviewsTotal:H,isFollowUpAppointment:eh,liveBookingFormStepLocationSelect:i?.fields?.LiveBookingFormStepLocationSelect?.value?.href||"/finder/step-location-select",liveBookingFormStepSlotSelect:i?.fields?.LiveBookingFormStepSlotSelect?.value?.href||"/finder/step-slot-select",name:ee,search:ei,keywordId:en}),(0,r.jsx)(k.default,{headline:i?.fields?.LiveBookingFormContactBoxHeadline?.value||"",subheadline:i?.fields?.LiveBookingFormContactBoxPhone0Label?.value||"",workingHoursHeadline:i?.fields?.LiveBookingFormContactBoxOpeningHoursLabel?.value||"",workingHours:i?.fields?.LiveBookingFormContactBoxOpeningHoursDays?.value||"",workingHoursTime:i?.fields?.LiveBookingFormContactBoxOpeningHoursTime?.value||"",phoneNumber:i?.fields?.LiveBookingFormContactBoxPhone0Phone?.value||""})]})]})]})]}):(0,r.jsx)(D,{...i})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(F,{...i})})])},222018,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(293715),s=i.i(443107),l=i.i(257818),u=i.i(857690),c=i.i(225659),d=i.i(446348),h=i.i(352472),f=i.i(93379),p=i.i(308637),m=i.i(780798),g=i.i(641657),_=i.i(760227),y=i.i(597330);let v=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})}),x=i=>{let{selectedLocationName:x,selectedDate:b,selectedTime:w,consultantName:T,consultantMainSpecialty:E,finderFormPayor:S,finderFormPrevious:A,completedFormId:C,patientName:I}=(0,n.useContext)(p.ConsultantFinderContext),k=(0,a.useRouter)(),R=(0,a.useSearchParams)(),[M,L]=(0,n.useState)(""),[P,O]=(0,n.useState)(""),[D,F]=(0,n.useState)(null);return((0,n.useEffect)(()=>{window.scrollTo({top:0,behavior:"smooth"});let i=R.get("slug");i&&L(i.toString()),O((0,y.getQueryValue)(R,"gmcNumber")),F(Number(R.get("reviewsTotal")))},[R]),i.fields)?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(r.Fragment,{children:[C&&C.length>0&&(0,r.jsx)(_.default,{id:"cf-gtm-liveBooking",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:`window.dataLayer = window.dataLayer || [];
123                   window.dataLayer.push({
124                   'event': 'consultantFinder',
125                   'formType': 'live',
126                   'goalType': 'finderBookingSubmit',
127                   'consultantName': '${T}',
128                   'consultantSpecialty': '${E}',
129                   'consultantReviews': '${D}',
130                   'finderFormPayor': '${S}',
131                   'finderFormPrevious': '${A}',
132                   'finderFormPractice': '${x}',
133                   'completedFormId': '${C}'
134                   });`}}),(0,r.jsx)(u.default,{logo:(0,r.jsx)(o.Image,{field:i?.fields?.HCALogo}),progress:(0,r.jsx)(c.default,{currentPage:i?.fields?.CurrentStep?.value,steps:i?.fields?.Steps,slug:M,gmcNumber:P,reviewsTotal:D})}),(0,r.jsxs)(d.default,{children:[(0,r.jsx)(h.default,{headline:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.default,{tag:"h1",variation:"display-4",children:i?.fields?.TitleText?.value||""}),(0,r.jsx)(l.default,{tag:"p",variation:"body-extra-large",children:i?.fields?.IntroText?.value||"You have booked an appointment, once confirmed you will receive an email confirmation"})]}),summary:(0,r.jsx)(f.default,{title:i?.fields?.SummaryTitle?.value||"Appointment summary",patientTitle:i?.fields?.SummaryPatientTitle?.value||"Patient",patientName:I,dateTitle:i?.fields?.SummaryDateTitle?.value||"Date",date:b,consultantTitle:i?.fields?.SummaryConsultantTitle?.value||"Consultant",timeTitle:i?.fields?.SummaryTimeTitle?.value||"Time",time:w,consultantName:T,facilityTitle:i?.fields?.SummaryFacilityTitle?.value||"Hospital",facilityName:x}),nextStepsTitle:i?.fields?.nextStepsTitle?.value||"Next steps",nextStepsContent:i?.fields?.nextStepsContent?.value||"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse.",amendBookingTitle:i?.fields?.amendBookingTitle?.value||"How to amend your booking",amendBookingContent:i?.fields?.amendBookingContent?.value||"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse.",children:(0,r.jsx)(s.default,{size:"large",variation:"full-dark",children:(0,r.jsx)("button",{onClick:()=>k.push("/finder/step-intro"),children:(0,r.jsx)("span",{children:i?.fields?.NextLink?.value?.text||"Go to Homepage"})})})}),(0,r.jsx)(m.default,{children:(0,r.jsx)(g.default,{headline:i?.f
134ields?.LiveBookingFormContactBoxHeadline?.value||"Need help?",subheadline:i?.fields?.LiveBookingFormContactBoxPhone0Label?.value||"General enquiries",workingHoursHeadline:i?.fields?.LiveBookingFormContactBoxOpeningHoursLabel?.value||"Opening hours",workingHours:i?.fields?.LiveBookingFormContactBoxOpeningHoursDays?.value||"Mon – Fri",workingHoursTime:i?.fields?.LiveBookingFormContactBoxOpeningHoursTime?.value||"8am – 6pm",phoneNumber:i?.fields?.LiveBookingFormContactBoxPhone0Phone?.value||"020 3797 7236"})})]})]})}):(0,r.jsx)(v,{...i})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(x,{...i})})])},593636,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(308637),s=i.i(382570),l=i.i(443107),u=i.i(257818),c=i.i(630077),d=i.i(377314),h=i.i(545398),f=i.i(139891),p=i.i(157503),m=i.i(249736),g=i.i(597330);let _=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})});i.s(["Default",0,i=>{let y=(0,a.useRouter)(),v=i.params.RenderingIdentifier,{searchString:x,setSearchString:b,setKeywordId:w,keywordId:T,searchStringLocations:E,setSearchStringLocations:S,selectedLocationConsultants:A,setSelectedLocationConsultants:C,showSearchError:I,setShowSearchError:k}=(0,n.useContext)(o.ConsultantFinderContext),[R,M]=(0,n.useState)(!1),[L,P]=(0,n.useState)(!1),O=(i?.fields?.PopularConsultantsList).map(i=>({id:i.fields.id.value,firstName:i.fields.firstName.value,lastName:i.fields.lastName.value,slug:i.fields.slug.value,specialty:i.fields.specialty.value})),D=(i?.fields?.LocationsList||[]).map(i=>({name:i.fields.name.value,distance:i.fields.distance.value,latitude:i.fields.lat.value,longitude:i.fields.lon.value})),F=A??"Anywhere",{latitude:N,longitude:j,distance:z}=(D.find(i=>i.name===F)||D.find(i=>"Anywhere"===i.name))??{},B=()=>(window.OnetrustActiveGroups||"").includes("C0003"),U=i=>{document.cookie=`location=${encodeURIComponent(i)}; path=/; max-age=31536000; SameSite=Lax`};(0,n.useEffect)(()=>{!R||B()&&U(A)},[R,A]),(0,n.useEffect)(()=>{let i=()=>{let i;if(!B())return;P(!0);let r=(i=document.cookie.match(RegExp("(?:^|; )location=([^;]*)")))?decodeURIComponent(i[1]):null;r?(C(r),S(r)):U(A||"Anywhere"),M(!0)};return i(),window.addEventListener("OneTrustGroupsUpdated",i),()=>window.removeEventListener("OneTrustGroupsUpdated",i)},[A]);let V=(i?.fields?.PopularSearchesList||[]).map(i=>({label:i.fields.name.value,href:i.fields.HRef.value}));return i.fields?(0,r.jsx)("div",{id:v||void 0,children:(0,r.jsx)(d.default,{headline:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.default,{tag:"h2",variation:"subheading-1",children:i.fields.Heading2Text?.value||"Over 1,250 consultants across the UK"}),(0,r.jsx)(u.default,{tag:"h1",variation:"display-1",children:i.fields.HeadingText?.value||"Find a consultant"}),(0,r.jsx)(u.default,{tag:"p",variation:"body-large",children:i.fields.Heading3Text?.value||"Search by consultant name, specialty, or condition — we’ll help you find the right specialist quickly."})]}),search:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.default,{placeholder:i?.fields?.SearchPlaceholderText?.value||"Type in a service, condition, treatment...",doctifyBaseURL:i?.fields?.API_Autocomplete_BaseURL?.value||"https://api.doctify.com/api/hca/search/autocomplete?search",limit:Number(i?.fields?.API_Autocomplete_Limit?.value)||20,noResultsMsg:i?.fields?.API_Autocomplete_NoResultsMsg?.value||"No matches found, please try typing something else.",specialistsLabel:i?.fields?.SpecialistsFilterHeaderText?.value||"Consultants",specialtyLabel:i?.fields?.SpecialitiesFilterHeaderText?.value||"Specialties",conditionsProceduresLabel:i?.fields?.ConditionsTreatmentsFilterHeaderText?.value||"Conditions/ Procedures",setKeywordId:w,searchString:x,setSearchString:b,searchIcon:i?.fields?.SearchIcon?.fields?.SvgMarkup?.value||null,conditionsTreatmentsList:i?.fields?.ConditionsTreatmentsList||[],specialistsList:O,specialitiesList:i?.fields?.SpecialitiesList||[],popularConsultantsList:i?.fields?.PopularConsultantsList||[],loadingText:i?.fields?.API_Autocomplete_LoadingMsg?.value||"Loading..."}),(0,r.jsx)(h.default,{isStepIntro:!0,placeholder:i?.fields?.SearchPlaceholderText?.value||"Type in a service, condition, treatment...",doctifyBaseURL:i?.fields?.API_Autocomplete_BaseURL?.value||"https://api.doctify.com/api/hca/search/autocomplete?search",limit:Number(i?.fields?.API_Autocomplete_Limit?.value)||20,noResultsMsg:i?.fields?.API_Autocomplete_NoResultsMsg?.value||"No matches found, please try typing something else.",setKeywordId:w,searchString:E,setSearchString:S,searchIcon:i?.fields?.SearchIcon?.fields?.SvgMarkup?.value||null,locationList:D||[],loadingText:i?.fields?.API_Autocomplete_LoadingMsg?.value||"Loading...",labelLocationsResults:i?.fields?.LocationsResultsLabelText?.value||"LOCATIONS"})]}),showError:I,errorLabel:i?.fields?.SearchErrorText?.value||"Please enter a consultant name, specialty, or condition to continue",buttons:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.default,{theme:"B-HCA-Navy-Blue",children:(0,r.jsx)(l.default,{size:"small",variation:"full-light",contentVariation:"full-width",children:(0,r.jsxs)("button",{onClick:r=>{if(r.preventDefault(),r.stopPropagation(),!x.trim())return void k(!0);let n=i?.fields?.QuickSearchLink?.value?.href;y.push(`${n}?search=${x}&keywordId=${T}&sortType=relevance&lat=${N}&lon=${j}&distance=${z}&limit=12&offset=0`)},children:[(0,r.jsx)(c.default,{iconName:"iconSearch"}),(0,r.jsx)("span",{children:i.fields.QuickSearchLink.value.text})]})})}),(0,r.jsx)(l.default,{size:"small",variation:"outline-light",contentVariation:"full-width",children:(0,r.jsxs)("button",{onClick:r=>{(r.preventDefault(),r.stopPropagation(),x.trim())?y.push((0,g.buildUrl)(i.fields.AdvancedSearchLink.value.href||"",{keywordId:T,searchString:x})):k(!0)},children:[(0,r.jsx)(c.default,{iconName:"iconAdvanced"}),(0,r.jsx)("span",{children:i.fields.AdvancedSearchLink.value.text})]})})]}),popularSearch:(0,r.jsx)(p.default,{popularSearches:V,popularSearchesTtitle:i.fields.PopularSearchesTitle?.value||"Popular searches"}),children:!L&&void 0!==window.OneTrust&&(0,r.jsx)(f.default,{title:i.fields?.FunctionalCookieSaveNextTimeTitle?.value||"Save this location for next time?",label:i.fields?.FunctionalCookieSaveNextTimeLabel?.value||"Activate functional cookies"})})}):(0,r.jsx)(_,{...i})}])},464851,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(314816),o=i.i(123768),s=i.i(443107),l=i.i(257818),u=i.i(6931),c=i.i(780798),d=i.i(352472),h=i.i(641657),f=i.i(446348),p=i.i(190408),m=i.i(902841),g=i.i(630077),_=i.i(405133),y=i.i(760227),v=i.i(308637);let x=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})});i.s(["Default",0,i=>{let{consultantReviews:b,selectedLocationName:w,consultantName:T,consultantMainSpecialty:E,finderFormPayor:S,finderFormPrevious:A,completedFormId:C}=(0,n.useContext)(v.ConsultantFinderContext),I=(0,o.useRouter)();return i.fields?(0,r.jsxs)(r.Fragment,{children:[C&&C.length>0&&(0,r.jsx)(y.default,{id:"cf-gtm-enquiryBooking",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:`window.dataLayer = window.dataLayer || [];
135                window.dataLayer.push({
136                'event': 'consultantFinder',
137                'goalType': 'formComplete',
138                'formType': 'enquiry',
139                'consultantName': '${T}',
140                'consultantSpecialty': '${E}',
141                'consultantReviews': '${b}',
142                'finderFormPayor': '${S}',
143                'finderFormPrevious': '${A}',
144                'finderFormPractice': '${w}',
145                'completedFormId': '${C}'
146                });`}}),(0,r.jsxs)(u.default,{backCta:{text:"Consultant Finder",link:`${i?.fields?.BreadcrumbHomePage?.value?.href||"/finder/step-intro"}`},children:[(0,r.jsx)(m.default,{children:(0,r.jsxs)("a",{href:"/",children:[(0,r.jsx)(g.default,{iconName:"iconHome"}),(0,r.jsx)("span",{className:"sr-only",children:"Home"})]})}),(0,r.jsx)(m.default,{children:(0,r.jsx)(_.default,{href:`${i?.fields?.BreadcrumbHomePage?.value?.href||"/finder/step-intro"}`,children:i?.fields?.EnquireFormConfirmationBreadcrumbsHomePage?.value||"Consultant Finder"})}),(0,r.jsx)("span",{children:i?.fields?.EnquireFormConfirmationBreadcrumbsCurrentPage?.value||"Thank you"})]}),(0,r.jsxs)(f.default,{children:[(0,r.jsxs)(d.default,{headline:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.default,{tag:"h1",variation:"display-4",children:i?.fields?.TitleText?.value||"Enquire form confirmation"}),(0,r.jsx)(l.default,{tag:"h2",variation:"body-medium-extra-large",children:i?.fields?.SubHeadline?.value||"Thank you for taking the time to complete the form."})]}),isEnquireForm:!0,children:[(0,r.jsx)(l.default,{tag:"div",variation:"body-extra-large",children:(0,r.jsx)(a.RichText,{field:i?.fields?.Text})}),(0,r.jsx)(p.default,{marginBottom:"spacing-6",marginTop:"spacing-6",children:(0,r.jsx)(s.default,{size:"large",variation:"full-dark",children:(0,r.jsx)("button",{onClick:()=>I.push(i?.fields?.NextLink?.value.href||"/finder/step-intro"),children:(0,r.jsx)("span",{children:i?.fields?.NextLink?.value?.text||"Go to Homepage"})})})})]}),(0,r.jsx)(c.default,{children:(0,r.jsx)(h.default,{headline:i?.f
146ields?.EnquireFormConfirmationContactBoxHeadline?.value||"Need help?",subheadline:i?.fields?.EnquireFormConfirmationContactBoxPhone0Label?.value||"General enquiries",workingHoursHeadline:i?.fields?.EnquireFormConfirmationContactBoxOpeningHoursLabel?.value||"Opening hours",workingHours:i?.fields?.EnquireFormConfirmationContactBoxOpeningHoursDays?.value||"Mon – Fri",workingHoursTime:i?.fields?.EnquireFormConfirmationContactBoxOpeningHoursTime?.value||"8am – 6pm",phoneNumber:i?.fields?.EnquireFormConfirmationContactBoxPhone0Phone?.value||"020 3797 7236"})})]})]}):(0,r.jsx)(x,{...i})}])},805577,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(405133),s=i.i(918445),l=i.i(661279),u=i.i(687052),c=i.i(951690),d=i.i(906396),h=i.i(649555),f=i.i(770705),p=i.i(314816),m=i.i(443107),g=i.i(257818),_=i.i(376227),y=i.i(462907),v=i.i(47742),x=i.i(473792),b=i.i(680346),w=i.i(160919),T=i.i(190408),E=i.i(887322),S=i.i(641657),A=i.i(780798),C=i.i(6931),I=i.i(859040),k=i.i(902841),R=i.i(630077),M=i.i(211452),L=i.i(327271),P=i.i(308637),O=i.i(710820);let D=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})}),F=i=>{let F=(0,a.useRouter)(),N=(0,a.useSearchParams)(),[j,z]=(0,n.useState)(""),[B,U]=(0,n.useState)(null),[V,H]=(0,n.useState)([]),[G,q]=(0,n.use
146State)(!1),[$,W]=(0,n.useState)(!0),[Y,Z]=(0,n.useState)(""),[K,X]=(0,n.useState)([]),[Q,J]=(0,n.useState)(!1),[ee,et]=(0,n.useState)(""),[ei,er]=(0,n.useState)(""),en="u">typeof self&&self.crypto?.randomUUID?self.crypto.randomUUID():Date.now().toString(),ea=(0,n.useRef)(null),{setSelectedLocationName:eo,setConsultantMainSpecialty:es,setConsultantName:el,setConsultantReviews:eu,setFinderFormPayor:ec,setFinderFormPrevious:ed,setCompletedFormId:eh}=(0,n.useContext)(P.ConsultantFinderContext),ef=l.z.object({practice:l.z.string(),dateAppointment:l.z.string().trim().min(1,{message:"Required"}),timeAppointment:l.z.string().trim().min(1,{message:"Required"}),previousPatient:l.z.string().trim().min(1,{message:"Required"}),title:l.z.string().trim().min(1,{message:"Required"}),firstName:l.z.string().trim().min(1,{message:"Required"}),lastName:l.z.string().trim().min(1,{message:"Required"}),gender:l.z.string().trim().min(1,{message:"Required"}),date:l.z.string().trim().min(1,{message:"Required"}),userEmail:l.z.string().min(1,{message:"Required"}).email("This is not a valid email."),userPhone:l.z.string().trim().min(1,{message:"Required"}).refine(i=>/^\d+$/.test(i),{message:"Invalid phone number"}),insurance:l.z.string().trim().min(1,{message:"Required"}),insuranceNumber:l.z.string().optional(),reasonVisit:l.z.string().trim().min(1,{message:"Required"}),email:l.z.boolean().optional(),sms:l.z.boolean().optional(),phone:l.z.boolean().optional(),post:l.z.boolean().optional(),recaptcha:l.z.string().min(1,{message:"Required"}),allowAlternateConsultant:l.z.boolean()}).refine(i=>0===K.length||""!==i.practice,{message:"Required",path:["practice"]}),{reset:ep,register:em,control:eg,handleSubmit:e_,formState:{errors:ey,isDirty:ev},setValue:ex,clearErrors:eb}=(0,s.useForm)({defaultValues:{practice:"",dateAppointment:"",timeAppointment:"",previousPatient:"",title:"",firstName:"",lastName:"",gender:"",date:"",userEmail:"",userPhone:"",insurance:"I pay for myself",insuranceNumber:"",reasonVisit:"",email:!1,sms:!1,phone:!1,post:!1,recaptcha:"",allowAlternateConsultant:!0},resolver:(0,u.zodResolver)(ef),mode:"onChange"});return((0,n.useEffect)(()=>{window.scrollTo({top:0,behavior:"smooth"});let i=N.get("slug");if(i){var r;z(i.toString()),r=i.toString(),f.default.get(`${O.DOCTIFY_API_BASE_URL}/specialists/${r}`).then(i=>{q(!1),W(!1),H(i?.data?.insurers||[]),X(i?.data?.practices||[]),Z(`${i?.data?.title} ${i?.data?.firstName} ${i?.data?.lastName}`);let r=i?.data?.keywords?.filter(i=>"ABSTRACT_TOP_LEVEL_KEYWORD"===i.parentName);et(r[0]?.name||"")}).catch(i=>{q(!0),W(!1),console.log(i)})}U(Number(N.get("reviewsTotal")))},[N]),i.fields)?(0,r.jsxs)(r.Fragment,{children:[G&&(0,r.jsx)(g.default,{tag:"p",variation:"display-4",children:"There was an error, please try again later."}),!$&&!G&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(C.default,{backCta:{text:"Consultant Finder",link:`${i?.fields?.BreadcrumbHomePage?.value?.href||"/finder/step-intro"}`},children:[(0,r.jsx)(k.default,{children:(0,r.jsxs)("a",{href:"/",children:[(0,r.jsx)(R.default,{iconName:"iconHome"}),(0,r.jsx)("span",{className:"sr-only",children:i?.fields?.EnquireFormBreadcrumbsHome?.value||"Home"})]})}),(0,r.jsx)(k.default,{children:(0,r.jsx)(o.default,{href:`${i?.fields?.BreadcrumbHomePage?.value?.href||"/finder/step-intro"}`,children:"Consultant Finder"})}),(0,r.jsx)(k.default,{children:(0,r.jsx)(o.default,{href:`${i?.fields?.EnquireFormBreadcrumbsProfilePageLink?.value?.href&&i?.fields?.EnquireFormBreadcrumbsProfilePageLink?.value?.href.replace(/,-w-,/g,"")}${j}`,children:Y})}),(0,r.jsx)("span",{children:i?.fields?.EnquireFormBreadcrumbsCurrentPage?.value||"Enquire Now"})]}),(0,r.jsxs)(_.default,{children:[(0,r.jsx)(I.default,{ref:ea,children:(0,r.jsxs)(T.default,{marginBottom:"spacing-8",marginTop:"spacing-8",marginLeft:"spacing-4",marginRight:"spacing-4",children:[(0,r.jsx)(g.default,{tag:"p",variation:"heading-1",children:i?.fields?.API_HCA_EnquireBookingForm_ErrorSubmittingText?.value||"Error submitting the form, please retry later"}),(0,r.jsx)(g.default,{tag:"p",variation:"body-medium-extra-large",children:ei})]})}),(0,r.jsx)(c.DevTool,{control:eg,placement:"top-right"}),(0,r.jsxs)("form",{onSubmit:e_(r=>{let n,a,o,s;i?.fields?.API_HCA_EnquireBookingForm_UtilizeCRM?.value&&(J(!0),(n={...r}).dateOfBirthFormatted=(0,d.formatDateDMY)(r.date),n.consultantName=Y,n.consultantTopSpecialty=ee,n.hiddenFormInstance=en,a=i?.fields?.API_C2_BookingEnquiry_BaseURL?.value,f.default.post(a,n).then(a=>{a?.data?.errorCode>0?(er(`error code: ${a?.data?.errorCode} ${a?.data?.errorText}`),ea?.current?.showModal()):a?.data?.success==!1?(er(`${a?.data?.html}`),ea?.current?.showModal()):(eu(B?B.toString():"0"),eo(r.practice),es(ee),el(Y),ec(n.insurance),eh(n.hiddenFormInstance),ed(r.previousPatient),F.push(`${i?.fields?.NextLink?.value?.href||"/finder/step-enquire-form-confirmation"}`)),J(!1)}).catch(i=>{console.log(i),J(!1),ea?.current?.showModal()})),i?.fields?.API_HCA_EnquireBookingForm_UtilizeDatabase?.value&&(J(!0),(o={...r}).dateOfBirthFormatted=(0,d.formatDateDMY)(r.date),o.consultantName=Y,o.consultantTopSpecialty=ee,o.hiddenFormInstance=en,s=i?.fields?.API_HCA_EnquireBookingForm_BaseURL?.value||"/api/formAPI/PostMakeBookingEnquiry",f.default.post(s,o).then(n=>
146{n?.data?.errorCode>0?(er(`error code: ${n?.data?.errorCode} ${n?.data?.errorText}`),ea?.current?.showModal()):n?.data?.success==!1?(er(`${n?.data?.html}`),ea?.current?.showModal()):(eu(B?B.toString():"0"),eo(r.practice),es(ee),el(Y),ec(o.insurance),eh(o.hiddenFormInstance),ed(r.previousPatient),F.push(`${i?.fields?.NextLink?.value?.href||"/finder/step-enquire-form-confirmation"}`)),J(!1)}).catch(i=>{console.log(i),J(!1),ea?.current?.showModal()}))},i=>{console.log("errors on submit",i)}),noValidate:!0,children:[(0,r.jsxs)(T.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:[(0,r.jsx)(g.default,{tag:"h1",variation:"display-4",children:i?.fields?.TitleText?.value||"Enquire Form"}),(0,r.jsx)(g.default,{tag:"h2",variation:"body-medium-extra-large",children:`${i?.fields?.EnquireFormHeadline?.value} ${Y}`})]}),(0,r.jsx)(T.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:(0,r.jsx)(w.default,{label:i?.fields?.AllowAlternateConsultantLabel?.value||"I am happy booking with an alternate consultant if my selected consultant is not available",name:"allowAlternateConsultant",id:"allowAlternateConsultant",register:em})}),K.length>0&&(0,r.jsx)(T.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:(0,r.jsx)(b.default,{id:"practice",name:"practice",label:i?.fields?.EnquireFormPracticeLabel?.value||"Select a practice",addDefaultValue:!0,defaultValueLabel:"Select a practice",required:!0,isError:!!ey?.practice,errorMessage:ey?.practice?.message,options:K.map(i=>(0,r.jsx)("option",{value:i.name,children:i.name},i.id)),register:em})}),(0,r.jsxs)(T.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:[(0,r.jsx)(b.default,{id:"dateAppointment",name:"dateAppointment",label:i?.fields?.EnquireFormSectionsHeadlinesAppointment?.value||"When would you like your appointment to be?",addDefaultValue:!1,required:!0,isError:!!ey?.dateAppointment,errorMessage:ey?.dateAppointment?.message,options:i?.fields?.EnquireFormDateOptions.map(i=>(0,r.jsx)("option",{value:i?.fields?.Value?.value,children:i?.fields?.Label?.value},i.id)),register:em}),(0,r.jsx)(b.default,{id:"timeAppointment",name:"timeAppointment",label:"",addDefaultValue:!1,required:!0,isError:!!ey?.timeAppointment,errorMessage:ey?.timeAppointment?.message,options:i?.fields?.EnquireFormTimeOptions.map(i=>(0,r.jsx)("option",{value:i?.fields?.Value?.value,children:i?.fields?.Label?.value},i.id)),register:em})]}),(0,r.jsx)(T.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:(0,r.jsx)(b.default,{id:"previousPatient",name:"previousPatient",label:i?.fields?.EnquireFormSectionsHeadlinesPrevPatient?.value||"Have you previously been to HCA UK?",addDefaultValue:!1,required:!0,isError:!!ey?.previousPatient,errorMessage:ey?.previousPatient?.message,options:i?.fields?.EnquireFormPrevClientOptions.map(i=>(0,r.jsx)("option",{value:i?.fields?.Value?.value,children:i?.fields?.Label?.value},i.id)),register:em})}),(0,r.jsxs)(T.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:[(0,r.jsx)(g.default,{tag:"h2",variation:"heading-1",children:i?.fields?.EnquireFormSectionsHeadlinesPatientDetails?.value||"Your details"}),(0,r.jsx)(b.default,{id:"title",name:"title",label:i?.fields?.EnquireFormTitleLabel?.value||"Title",required:!0,isError:!!ey?.title,errorMessage:ey?.title?.message,options:i?.fields?.EnquireFormTitleOptions.map(i=>(0,r.jsx)("option",{value:i?.fields?.Value?.value,children:i?.fields?.Label?.value},i.id)),register:em}),(0,r.jsx)(x.default,{id:"firstName",label:i?.fields?.EnquireFormFirstNameLabel?.value||"First Name",name:"firstName",required:!0,register:em,setValue:ex,isError:!!ey?.firstName,errorMessage:ey?.firstName?.message}),(0,r.jsx)(x.default,{id:"lastName",label:i?.fields?.EnquireFormLastNameLabel?.value||"Last Name",name:"lastName",required:!0,register:em,setValue:ex,isError:!!ey?.lastName,errorMessage:ey?.lastName?.message})]}),(0,r.jsxs)(T.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:[(0,r.jsx)(g.default,{tag:"h2",variation:"heading-1",children:i?.fields?.EnquireFormSectionsHeadlinesFurtherInfo?.value||"Further information"}),(0,r.jsx)(b.default,{id:"gender",name:"gender",label:i?.fields?.EnquireFormGenderLabel?.value||"Gender",required:!0,isError:!!ey?.gender,errorMessage:ey?.gender?.message,options:i?.fields?.EnquireFormGenderOptions.map(i=>(0,r.jsx)("option",{value:i?.fields?.Value?.value,children:i?.fields?.Label?.value},i.id)),register:em}),(0,r.jsx)(x.default,{id:"date",label:i?.fields?.EnquireFormDateOfBirthLabel?.value||"date of birth",name:"date",type:"date",required:!0,register:em,setValue:ex,isError:!!ey?.date,errorMessage:ey?.date?.message})]}),(0,r.jsxs)(T.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:[(0,r.jsx)(g.default,{tag:"h2",variation:"heading-1",children:i?.fields?.EnquireFormSectionsHeadlinesContactDetails?.value||"Contact details"}),(0,r.jsx)(x.default,{id:"userEmail",label:i?.fields?.EnquireFormEmailLabel?.value||"email",name:"userEmail",type:"email",required:!0,register:em,setValue:ex,isError:!!ey?.userEmail,errorMessage:ey?.userEmail?.message}),(0,r.jsx)(x.default,{id:"userPhone",label:i?.fields?.EnquireFormPhoneLabel?.value||"phone",name:"userPhone",required:!0,register:em,setValue:ex,isError:!!ey?.userPhone,errorMessage:ey?.userPhone?.message})]}),(0,r.jsxs)(T.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:[(0,r.jsx)(g.default,{tag:"h2",variation:"heading-1",children:i?.fields?.EnquireFormSectionsHeadlinesPayment?.value||"Payment"}),(0,r.jsx)(g.default,{tag:"p",variation:"body-extra-large",children:i?.fields?.EnquireFormInfoTextPayment?.value||"We only need these details in order to get you to the right person"}),V.length>0&&(0,r.jsxs)(T.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:[(0,r.jsx)(b.default,{id:"insurance",name:"insurance",label:i?.fields?.EnquireFormInsuranceLabel?.value||"InsuranceS",addDefaultValue:!0,defaultValueLabel:i.fields.EnquireFormInsuranceSelfPayOption.value||"I pay for myself",defaultValue:i.fields.EnquireFormInsuranceSelfPayOption.value||"I pay for myself",required:!0,isError:!!ey?.insurance,errorMessage:ey?.insurance?.message,options:V.map(i=>(0,r.jsx)("option",{value:i.name,children:i.name},i.id)),register:em}),(0,r.jsx)(x.default,{id:"insuranceNumber",label:i?.fields?.EnquireFormInsuranceNumberLabel?.value||"Insurance number",name:"insuranceNumber",required:!1,register:em,setValue:ex,isError:!!ey?.insuranceNumber,errorMessage:ey?.insuranceNumber?.message})]})]}),(0,r.jsxs)(T.default,{marginBottom:"spacing-6",marginTop:"spacing-4",children:[(0,r.jsx)(g.default,{tag:"h2",variation:"heading-1",children:i?.fields?.EnquireFormSectionsHeadlinesReasonVisit?.value||"Reason for visit"}),(0,r.jsx)(v.default,{id:"reasonVisit",name:"reasonVisit",label:i?.fields?.EnquireFormReasonVisitPlaceholder?.value||"Let us know what you would like to discu
146ss in your consultation",required:!0,register:em,isError:!!ey?.reasonVisit,errorMessage:ey?.reasonVisit?.message})]}),(0,r.jsxs)(E.default,{headline:i?.fields?.EnquireFormMarketingPreferencesHeadline?.value,text:(0,r.jsx)(p.RichText,{field:i?.fields?.EnquireFormMarketingPreferencesText}),children:[(0,r.jsx)(w.default,{label:i?.fields?.EnquireFormMarketingPreferencesFieldsEmailLabel?.value||"Email",name:"email",id:"email",register:em}),(0,r.jsx)(w.default,{label:i?.fields?.EnquireFormMarketingPreferencesFieldsPhoneLabel?.value||"Phone",name:"phone",id:"phone",register:em}),(0,r.jsx)(w.default,{label:i?.fields?.EnquireFormMarketingPreferencesFieldsSmsLabel?.value||"SMS",name:"sms",id:"sms",register:em}),(0,r.jsx)(w.default,{label:i?.fields?.EnquireFormMarketingPreferencesFieldsPostLabel?.value||"Post",name:"post",id:"post",register:em})]}),(0,r.jsxs)(T.default,{marginBottom:"spacing-6",children:[(0,r.jsx)(h.default,{sitekey:i?.fields?.API_HCA_EnquireBookingForm_RecapchaKey?.value||"6Lcbh1IiAAAAAPIprpy5uCDJj3gtCGmOU5AVNhzM",onChange:i=>{ex("recaptcha",i||""),ey?.recaptcha&&eb("recaptcha")}}),(0,r.jsx)("input",{...em("recaptcha"),type:"hidden"}),ey?.recaptcha&&(0,r.jsx)(y.default,{errorMessage:ey?.recaptcha?.message})]}),(0,r.jsxs)(L.default,{children:[(0,r.jsx)(T.default,{marginRight:"spacing-6",children:(0,r.jsx)(m.default,{size:"small",variation:"full-dark",children:(0,r.jsx)("button",{disabled:!ev||Q,type:"submit",children:Q?`${i?.fields?.API_HCA_EnquireBookingForm_LoadingMsg?.value||"Submitting"}`:`${i?.fields?.EnquireFormBtnsSubmit?.value||"Submit"}`})})}),(0,r.jsx)(M.default,{theme:"dark",children:(0,r.jsx)("button",{onClick:i=>{i.preventDefault(),ep(),eb()},children:i?.fields?.EnquireFormBtnsClear?.value||"Clear"})})]}),(0,r.jsx)(T.default,{marginBottom:"spacing-8",marginTop:"spacing-8",children:(0,r.jsx)(g.default,{tag:"p",variation:"body-medium-extra-large",children:`${i?.fields?.EnquireFormInfoTextSubmit?.value||"Once you have submitted your enquiry, you will receive a reply within 1 working day."}`})})]}),(0,r.jsx)(A.default,{children:(0,r.jsx)(S.default,{headline:i?.fields?.EnquireFormContactBoxHeadline?.value||"Need help?",subheadline:i?.fields?.EnquireFormContactBoxPhone0Label?.value||"General enquiries",workingHoursHeadline:i?.fields?.EnquireFormContactBoxOpeningHoursLabel?.value||"Opening hours",workingHours:i?.fields?.EnquireFormContactBoxOpeningHoursDays?.value||"Mon – Fri",workingHoursTime:i?.fields?.EnquireFormContactBoxOpeningHoursTime?.value||"8am – 6pm",phoneNumber:i?.fields?.EnquireFormContactBoxPhone0Phone?.value||"020 3797 7236"})})]})]})]}):(0,r.jsx)(D,{...i})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(F,{...i})})])},704880,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(405133),o=i.i(293715),s=i.i(56676),l=i.i(257818),u=i.i(321104),c=i.i(985905),d=i.i(242838),h=i.i(443107),f=i.i(630077),p=i.i(6931),m=i.i(778394),g=i.i(850538),_=i.i(428645),y=i.i(34639),v=i.i(275780),x=i.i(446816),b=i.i(838950),w=i.i(65211),T=i.i(4722),E=i.i(971552),S=i.i(834901),A=i.i(39773),C=i.i(907771),I=i.i(249736),k=i.i(10019),R=i.i(906396),M=i.i(770705),L=i.i(902841),P=i.i(859040),O=i.i(430825);let D=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})});i.s(["Default",0,i=>{let[F,N]=(0,n.useState)(!1),[j,z]=(0,n.useState)(),[B,U]=(0,n.useState)(null),V=(0,s.useComponentProps)(i.rendering.uid),H=(V?.ProfileJson?.keywords?.filter(i=>"ABSTRACT_TOP_LEVEL_KEYWORD"===i.parentName)||[])[0],G=i.params.RenderingIdentifier,q=`${V?.ProfileJson?.firstName||""} ${V?.ProfileJson?.lastName||""}`;V?.ProfileJson?.title,V?.ProfileJson?.firstName,V?.ProfileJson?.lastName,V?.ProfileJson?.suffix;let $=(0,n.useRef)(null),W=(0,n.useRef)(null),Y=(0,n.useRef)(null),Z=(0,n.useRef)(null),K=(0,n.useRef)(null),X=!V||V.ErrorWithProfileData||!V.ProfileJson;if((0,n.useEffect)(()=>{if(!X&&!F){N(!0),B&&(B.cancel(),U(null));let r=`${i?.fields?.API_C2_FirstAppointment_BaseURL?.value}${V?.ProfileJson?.gmcNumber}`,n=M.default.CancelToken.source();
146U(n),M.default.get(r,{cancelToken:n.token}).then(i=>{z(i?.data)}).catch(i=>{console.warn(i)}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"consultantFinder",consultantName:q,consultantSpecialty:H?.name||"",consultantReviews:V?.ProfileJson?.review?.reviewsTotal||0})}},[V]),X)return(0,r.jsx)(r.Fragment,{});let Q=i=>{let r;switch(i.label){case"About":r=$;break;case"Locations":r=W;break;case"Fees":r=Y;break;case"Reviews":r=Z}r&&r.current?r.current.scrollIntoView({behavior:"smooth"}):console.log("Ref not found or not initialized")},J=[];V?.ProfileJson?.languages?.forEach(i=>{J.push((0,R.capitalizeFirstLetter)(i.name))});let ee=J.toString().split(",").join(", "),et=V?.ProfileJson?.gmcNumber,ei=V?.ProfileJson?.keywords.filter(i=>"specialty"===i.keywordType&&"ABSTRACT_TOP_LEVEL_KEYWORD"!==i.parentName).map(i=>i.name).toString().split(",").join(", "),er=V?.ProfileJson?.keywords.filter(i=>"procedure"===i.keywordType),en=V?.ProfileJson?.keywords.filter(i=>"condition"===i.keywordType),ea=V?.ProfileJson?.images?.logo||i?.fields?.ProfileImagePlaceholderImage?.value.src||null;function eo(){K?.current?.showModal(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"consultantFinder",goalType:"callReveal",consultantName:q,consultantSpecialty:H?.name||"",consultantReviews:V?.ProfileJson?.review?.reviewsTotal||0})}return i.fields?(0,r.jsx)("div",{id:G||void 0,children:V&&(0,r.jsxs)("div",{children:[(0,r.jsx)(P.default,{ref:K,children:(0,r.jsx)(O.default,{practices:V?.ProfileJson?.practices||[],title:i?.fields?.CallToBookModalTitle?.value||"Appointments at",defaultNumber:i?.fields?.PhoneNumberHref?.value,isDoctifyPhoneNumberConsultant:V?.DoctifyPhoneNumberConsultant||!1,slug:V?.ProfileJson?.slug})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)(p.default,{backCta:{text:"Consultant Finder",link:`${i?.fields?.BreadcrumbHomePage?.value?.href||"/finder/step-intro"}`},children:[(0,r.jsx)(L.default,{children:(0,r.jsxs)("a",{href:"/",children:[(0,r.jsx)(f.default,{iconName:"iconHome"}),(0,r.jsx)("span",{className:"sr-only",children:"Home"})]})}),(0,r.jsx)(L.default,{children:(0,r.jsx)(a.default,{href:`${i?.fields?.BreadcrumbHomePage?.value?.href||"/finder/step-intro"}`,children:i?.fields?.Breadcrumb?.value||"Consultant Finder"})}),H?.name&&(0,r.jsx)(L.default,{children:(0,r.jsx)(a.default,{href:`${i?.fields?.ResultsLink?.value?.href}?search=${H?.name||""}&keywordId=${H?.id||""}&sortType=relevance&lat=51.507217&lon=-0.1275862&distance=0&limit=12&offset=0`,children:H?.name})}),(0,r.jsx)("span",{children:`${V?.ProfileJson?.firstName} ${V?.ProfileJson?.lastName}`})]}),(0,r.jsx)(k.default,{children:(0,r.jsx)(I.default,{theme:"A-HCA-White",children:(0,r.jsx)(y.default,{callback:i=>{Q(i)},tabs:[{icon:"iconBook",label:`${i?.fields?.AboutTabText?.value}`||"About"},{icon:"iconPin",label:`${i?.fields?.LocationsTabText?.value}`||"Locations"},{icon:"iconCreditCard",label:`${i?.fields?.FeesTabText?.value}`||"Fees"},{icon:"iconComment",label:`${i?.fields?.ReviewsTabText?.value}`||"Reviews"}]})})})]}),(0,r.jsxs)(m.default,{children:[(0,r.jsxs)(_.default,{children:[(0,r.jsx)(x.default,{image:ea,name:`${V?.ProfileJson?.firstName} ${V?.ProfileJson?.lastName}`,topSpecialty:H?.name||"",infoBoxText:"some text",overallExperienceYears:(0,R.yearsExperience)(V?.ProfileJson?.yearsOfExperience)||0,overallExperienceYearsText:i?.fields?.ExperienceText?.value||"years of experience",children:(0,r.jsx)(I.default,{theme:"A-HCA-White",children:(0,r.jsx)(y.default,{callback:i=>{Q(i)},tabs:[{icon:"iconBook",label:`${i?.fields?.AboutTabText?.value}`||"About"},{icon:"iconPin",label:`${i?.fields?.LocationsTabText?.value}`||"Locations"},{icon:"iconCreditCard",label:`${i?.fields?.FeesTabText?.value}`||"Fees"},{icon:"iconComment",label:`${i?.fields?.ReviewsTabText?.value}`||"Reviews"}]})})}),(0,r.jsxs)(u.default,{isMobile:!0,children:[(0,r.jsx)(c.default,{doctifyLogo:(0,r.jsx)(o.Image,{field:i.fields.DoctifyLogoImage}),doctifyText:i?.fields?.DoctifyText?.value||"Reviewed By",hasDoctifyBranding:!0,isConsultantProfileReviews:!0,reviewsCount:V?.IgnoreReviewsConsultant?0:V?.ProfileJson?.review?.averageRating||0,reviewsText:"Patients",reviewsTotal:V?.IgnoreReviewsConsultant?0:V?.ProfileJson?.review?.reviewsTotal||0,noReviewsMsg:"This consultant does not have any reviews at the moment.",titleText:i?.fields?.PanelTitle?.value||"PATIENTS REVIEWS",reviewsRef:Z,ignoreReviewsConsultant:V?.IgnoreReviewsConsultant||!1}),V?.ProfileJson?.isLiveDiaryConsultant&&j?.initial_appointment&&j?.follow_appointment&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.default,{backgroundColour:"green",icon:null,isShortInfo:!0,shortText:`${i?.fields?.NextInitialAppointmentText?.value||"Next initial appointment"} ${(0,R.formatDateShort)(j?.initial_appointment)}`}),(0,r.jsx)(d.default,{backgroundColour:"orange",icon:null,isShortInfo:!0,shortText:`${i?.fields?.NextFollowOnAppointmentText?.value||"Next follow up appointment"} ${(0,R.formatDateShort)(j?.follow_appointment)}`}),(0,r.jsx)(l.default,{tag:"p",variation:"body-small",children:`${i?.fields?.LastCheckedText?.value||"Last checked:"} ${j?.refreshedText}
147                          `})]})]}),(0,r.jsx)(v.default,{ref:$,children:(0,r.jsx)(b.default,{title:i?.fields?.AboutHeadingText?.value||"About",description:V?.ProfileJson?.about||""})}),ei.length>0&&(0,r.jsx)(v.default,{children:(0,r.jsx)(w.default,{title:i.fields.SubSpecialtiesSubHeadingText.value||"Subspecialities",data:ei})}),(0,r.jsx)(v.default,{children:(0,r.jsx)(T.default,{treatmentsLabel:i?.fields?.AllProceduresSubHeadingText?.value||"ALL PROCEDURES",conditionsLabel:i.fields.AllConditionsSubHeadingText.value||"ALL CONDITIONS",treatmentsList:er,conditionsList:en,noTreatmentsMsg:i?.fields?.NoTreatmentsMsg?.value||"This consultant doesn't have any procedures information at the moment.",noConditionsMsg:i?.fields?.NoConditionsMsg?.value||"This consultant doesn't have any conditions information at the moment."})}),(0,r.jsx)(v.default,{children:(0,r.jsx)(w.default,{title:i?.fields?.LanguagesSubHeadingText?.value||"Languages",data:ee})}),(0,r.jsx)(v.default,{children:(0,r.jsx)(w.default,{title:i?.fields?.QualificationsSubHeadingText?.value||"qualifications",data:V?.ProfileJson?.suffix||i?.fields?.NoQualificationsMsg?.value||"This consultant doesn't have any qualification information at the moment."})}),V?.ProfileJson?.registrationBodies&&V?.ProfileJson?.registrationBodies.length>0&&(0,r.jsx)(v.default,{children:(0,r.jsx)(w.default,{title:i?.fields?.RegisteredWithSubHeadingText?.value||"Registered with",data:`${V?.ProfileJson?.registrationBodies[0]?.name||"General Medical Council"}: ${et}`})}),(0,r.jsx)(v.default,{ref:W,children:(0,r.jsx)(A.default,{title:i?.fields?.Locations
147HeadingText?.value||"Locations",locations:V?.ProfileJson?.practices,noLocationsText:"This consultant doesn't have any locations information at the moment.",viewOnGoogleMapText:i?.fields?.ViewOnGoogleMapsText?.value||"View on Google Maps",videoConsultationText:i?.fields?.VideoConsultationText?.value||"Call to book a video consultation.",videoConsultationTitle:i?.fields?.VideoConsultationTitle?.value||"Video Consultation",phoneNumberHref:i?.fields?.PhoneNumberHref?.value||"+442070794344",displayNumber:i?.fields?.DisplayNumber?.value||"020 7079 4344"})}),(0,r.jsx)(v.default,{ref:Y,children:(0,r.jsx)(E.default,{title:i?.fields?.ConsultationFeesHeadingText?.value||"Consultation Fees",newAppointmentFees:V?.ProfileJson?.consultationFees?.new||null,newAppointmentFeesLabel:i?.fields?.NewAppointmentText?.value||"New appointment",followUpAppointmentFees:V?.ProfileJson?.consultationFees?.followUp||null,followUpAppointmentFeesLabel:i?.fields?.FollowUpAppointmentText?.value||"Follow-up appointment",noFeesInfo:i.fields.NoFeesInfo.value||"This consultant doesn't have any consultation fees information at the moment."})}),(0,r.jsx)(v.default,{ref:Z,noBottomBorder:!0,children:(0,r.jsx)(S.default,{title:i?.fields?.ReviewsHeadingText?.value||"Reviews",subtitle:i?.fields?.OverallRatingSubHeadingText?.value||"Overall Rating",overallExperienceLabel:i?.fields?.OverallExperienceCategoryText?.value||"Overall experience",personalCareLabel:i?.fields?.PersonalCareReceivedCategoryText?.value||"Personal care received",explanationLabel:i?.fields?.ExplainationOfCareCategoryText?.value||"Explanation of care provided",overallExperience:V?.ProfileJson?.review?.overallExperience||0,overalCare:V?.ProfileJson?.review?.bedsideManner||0,explanation:V?.ProfileJson?.review?.explanation||0,ignoreReviewsConsultant:V?.IgnoreReviewsConsultant||!1,noReviewsMsg:"This consultant does not have any reviews at the moment."})}),!V?.IgnoreReviewsConsultant&&(0,r.jsx)("iframe",{src:`/finder/frame-reviews?slug=${V?.Slug}`,width:"100%",height:"700px",id:"specialistReviews",name:"specialistReviews",scrolling:"no"})]}),(0,r.jsx)(g.default,{children:(0,r.jsxs)(u.default,{isSticky:!0,buttons:(0,r.jsxs)(r.Fragment,{children:[V?.IsLiveDiaryConsultant&&(0,r.jsx)(h.default,{variation:"full-dark",size:"small",children:(0,r.jsx)(a.default,{href:`/finder/step-terms-and-conditions?slug=${V?.ProfileJson?.slug}&name=${encodeURIComponent(q)}&gmcNumber=${et}&reviewsTotal=${V?.ProfileJson?.review?.reviewsTotal||0}&search=${H?.name||""}&keywordId=${H?.id||""}`,children:(0,r.jsx)("span",{children:i.fields.BookOnlineButtonLink.value.text||"Book online"})})}),!V?.IsLiveDiaryConsultant&&!V?.ProfileJson?.hideAppointmentRequest&&(0,r.jsx)(h.default,{variation:"full-dark",size:"small",children:(0,r.jsx)(a.default,{href:`${i?.fields?.EnquireNowButtonLink?.value?.href}?slug=${V?.ProfileJson?.slug}&reviewsTotal=${V?.ProfileJson?.review?.reviewsTotal||0}`,children:(0,r.jsx)("span",{children:i?.fields?.EnquireNowButtonLink?.value?.title||"Enquire now"})})}),(0,r.jsx)(h.default,{variation:"outline",size:"small",children:(0,r.jsxs)("button",{onClick:eo,children:[(0,r.jsx)("span",{children:(0,r.jsx)(f.default,{iconName:"iconPhone"})}),(0,r.jsx)("span",{children:i?.fields?.CallToBookButtonText?.value||"Call to book"})]})})]}),children:[(0,r.jsx)(c.default,{doctifyLogo:(0,r.jsx)(o.Image,{field:i.fields.DoctifyLogoImage}),doctifyText:i?.fields?.DoctifyText?.value||"Reviewed By",hasDoctifyBranding:!0,isConsultantProfileReviews:!0,reviewsCount:V?.IgnoreReviewsConsultant?0:V?.ProfileJson?.review?.averageRating||0,reviewsText:"Patients",reviewsTotal:V?.IgnoreReviewsConsultant?0:V?.ProfileJson?.review?.reviewsTotal||0,noReviewsMsg:"This consultant does not have any reviews at the moment.",titleText:i?.fields?.PanelTitle?.value||"PATIENTS REVIEWS",reviewsRef:Z,ignoreReviewsConsultant:V?.IgnoreReviewsConsultant||!1}),V?.ProfileJson?.isLiveDiaryConsultant&&j?.initial_appointment&&j?.follow_appointment&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.default,{backgroundColour:"green",icon:null,isShortInfo:!0,shortText:`${i?.fields?.NextInitialAppointmentText?.value||"Next initial appointment"} ${(0,R.formatDateShort)(j?.initial_appointment)}`}),(0,r.jsx)(d.default,{backgroundColour:"orange",icon:null,isShortInfo:!0,shortText:`${i?.fields?.NextFollowOnAppointmentText?.value||"Next follow up appointment"} ${(0,R.formatDateShort)(j?.follow_appointment)}`}),(0,r.jsx)(l.default,{tag:"p",variation:"body-small",children:`${i?.fields?.LastCheckedText?.value||"Last checked:"} ${j?.refreshedText}
148                          `})]})]})})]}),(0,r.jsxs)(C.default,{showOnMobile:!0,hasCustomBtnMobile:!0,children:[V?.IsLiveDiaryConsultant&&(0,r.jsx)(h.default,{variation:"full-dark",size:"small",contentVariation:"full-width",children:(0,r.jsx)(a.default,{href:`/finder/step-terms-and-conditions?slug=${V?.ProfileJson?.slug}&name=${encodeURIComponent(q)}&gmcNumber=${et}&search=${H?.name||""}&keywordId=${H?.id||""}`,children:(0,r.jsx)("span",{children:i.fields.BookOnlineButtonLink.value.text||"Book online"})})}),!V?.IsLiveDiaryConsultant&&!V?.ProfileJson?.hideAppointmentRequest&&(0,r.jsx)(h.default,{variation:"full-dark",size:"small",contentVariation:"full-width",children:(0,r.jsx)(a.default,{href:`${i?.fields?.EnquireNowButtonLink?.value?.href}?slug=${V?.ProfileJson?.slug}`,children:(0,r.jsx)("span",{children:i?.fields?.EnquireNowButtonLink?.value?.title||"Enquire now"})})}),(0,r.jsx)(h.default,{variation:"outline",size:"small",contentVariation:"full-width",children:(0,r.jsx)("button",{onClick:eo,children:(0,r.jsx)("span",{children:i?.fields?.CallToBookButtonText?.value||"Call to book"})})})]})]})}):(0,r.jsx)(D,{...i})}])},500819,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(405133),o=i.i(123768),s=i.i(293715),l=i.i(257818),u=i.i(319309),c=i.i(514315),d=i.i(770705),h=i.i(308637),f=i.i(249736),p=i.i(623420),m=i.i(725618),g=i.i(855640),_=i.i(955679),y=i.i(239197),v=i.i(6931),x=i.i(218265),b=i.i(286532),w=i.i(425422),T=i.i(211452),E=i.i(190408),S=i.i(673065),A=i.i(628681),C=i.i(632795),I=i.i(906396),k=i.i(751344),R=i.i(902841),M=i.i(630077),L=i.i(545398),P=i.i(139891),O=i.i(597330);let D=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})}),F=i=>{let F=i?.serverSideData?.Insurers.sort((i,r)=>i.name.toLowerCase().localeCompare(r.name.toLowerCase())),N=i?.serverSideData?.LiveDiaryConsultantsSlugs,j=i?.serverSideData?.DoctifyPhoneConsultantsSlugs,{searchString:z,setSearchString:B,setKeywordId:U,searchStringLocations:V,setSearchStringLocations:H,selectedLocationConsultants:G,setSelectedLocationConsultants:q}=(0,n.useContext)(h.ConsultantFinderContext),$=i.params.RenderingIdentifier,W=(0,o.useSearchParams)(),Y=(0,o.useRouter)(),Z=(0,o.usePathname)(),K=(0,n.useMemo)(()=>
148(0,O.getQueryObject)(W),[W]),[X,Q]=(0,n.useState)(0),[J,ee]=(0,n.useState)(0),[et,ei]=(0,n.useState)([]),[er,en]=(0,n.useState)(!0),[ea,eo]=(0,n.useState)(!1),[es,el]=(0,n.useState)(!1),[eu,ec]=(0,n.useState)(""),[ed,eh]=(0,n.useState)(0),[ef,ep]=(0,n.useState)(""),[em,eg]=(0,n.useState)(0),[e_,ey]=(0,n.useState)(!1),[ev,ex]=(0,n.useState)([]),[eb,ew]=(0,n.useState)(!1),[eT,eE]=(0,n.useState)(""),[eS,eA]=(0,n.useState)(!1),[eC,eI]=(0,n.useState)(!1),ek=i?.fields?.API_C2_FirstAppointment_LoadingMsg?.value,[eR,eM]=(0,n.useState)(ek),[eL,eP]=(0,n.useState)(null),eO=(i?.fields?.LocationsList||[]).map(i=>({name:i.fields.name.value,distance:i.fields.distance.value,lat:i.fields.lat.value,lon:i.fields.lon.value})),eD=(0,n.useMemo)(()=>{var r;let n;return i.fields.LocationRegions?.length?(r=i.fields.LocationFilterOptions||[],n=i.fields.LocationRegions.reduce((i,r)=>{let n=r.fields.Value.value;return i[n]={region:n,regionSortOrder:r.fields.Order.value,locations:[]},i},{}),r.forEach(i=>{let r=i.fields.region.value;r&&(n[r]||(n[r]={region:r,regionSortOrder:Number.MAX_SAFE_INTEGER,locations:[]}),n[r].locations.push(i))}),Object.values(n).filter(i=>i.locations.length>0).map(i=>({...i,locations:i.locations.sort((i,r)=>i.fields.Order.value-r.fields.Order.value)})).sort((i,r)=>i.regionSortOrder-r.regionSortOrder)):null},[i.fields.LocationFilterOptions,i.fields.LocationRegions]);(0,n.useEffect)(()=>{er||document.scrollingElement?.scrollTo({top:0,behavior:"smooth"})},[er,et]);let eF=i=>{let r,n=i.target.value;ex(r=i.target.checked?[...ev,n]:ev.filter(i=>i!==n)),eN(r)},eN=i=>{let r={...K};delete r.practice,delete r.requestPath,delete r.offset,i.length>0&&(r.practice=i.join(",")),Y.push((0,O.buildUrl)(Z,{...r,offset:0}))},ej=()=>(window.OnetrustActiveGroups||"").includes("C0003"),ez=i=>{document.cookie=`location=${encodeURIComponent(i)}; path=/; max-age=31536000; SameSite=Lax`};(0,n.useEffect)(()=>{!eS||ej()&&ez(G)},[eS,G]),(0,n.useEffect)(()=>{let i=()=>{let i;if(!ej()||(eI(!0),K.location))return;let r=(i=document.cookie.match(RegExp("(?:^|; )location=([^;]*)")))?decodeURIComponent(i[1]):null,n=K.location?K.location.toString():"";n&&(q(n.length>0?n.toString().charAt(0).toUpperCase()+n.slice(1):"Anywhere"),H(n.length>0?n.toString().charAt(0).toUpperCase()+n.slice(1):"Anywhere")),r?(q(r),H(r)):ez(G||"Anywhere"),eA(!0)};return i(),window.addEventListener("OneTrustGroupsUpdated",i),()=>window.removeEventListener("OneTrustGroupsUpdated",i)},[K]),(0,n.useEffect)(()=>{if(eL&&(eL.cancel(),eP(null)),eb){let r=et.map(i=>i?.registrationBodies?.filter(i=>"General Medical Council"===i.name)[0]?.registrationNumber).map(i=>i).join(","),n=`${i?.fields?.API_C2_FirstAppointment_BaseURL?.value}${r}`,a=d.default.CancelToken.source();eP(a),d.default.get(n,{cancelToken:a.token}).then(i=>{i.data.map((i,r)=>et[r]?et[r].firstAppointment=i:null),eM(""),ei(et)}).catch(i=>{console.log(i)})}},[eb]);let eB=i=>{if(eh(i),0===i){let{insurer:i,offset:r,...n}=K;Y.push((0,O.buildUrl)(Z,{...n,offset:0}))}else Y.push((0,O.buildUrl)(Z,{...K,insurer:i}))};return((0,n.useEffect)(()=>{let r=W.get("location")||void 0,n=W.get("lat")||void 0,a=W.get("lon")||void 0,o=W.get("distance")||void 0;if(r){let i=r.length>0?r.charAt(0).toUpperCase()+r.slice(1).toLowerCase():"Anywhere";q(i),H(i)}else if(n&&a){let i=eO.find(i=>String(i.lat)===n&&String(i.lon)===a&&String(i.distance)===o)||eO.find(i=>String(i.lat)===n&&String(i.lon)===a);i&&(q(i.name),H(i.name))}eg(W.get("offset")?Number(W.get("offset")):0);let s=W.get("practice"),l=W.get("videoConsultation");if(s){let i=s.split(",");ex(i),ex(i)}else ex([]);l?ey(!0):ey(!1);let u=W.get("gender");u?ec(u.toString()):ec("");let c=W.get("insurer");c&&eh(Number(c));let h=W.get("language");h&&ep(h.toString());let f=W.get("search"),p=W.get("keywordId");f?B(f.toString()):B(""),p?U(Number(p)):U(0),en(!0);let{lat:m,lon:g,location:_,distance:y,...v}=Object.fromEntries(W.entries());if(_){let i=_.charAt(0).toUpperCase()+_.slice(1).toLowerCase(),r=eO.find(r=>r.name===i);r&&(m=r.lat,g=r.lon,y=r.distance)}let x=new URLSearchParams({...v,..._&&{location:_},...m&&{lat:m},...g&&{lon:g},...y&&{distance:y}}).toString(),b=i?.fields?.API_DoctifySearch_BaseURL?.value||"https://api.doctify.com/api/hca/search",w=`${b}?${x}`;if(eE(x),0===x.length){en(!1),el(!0),Y.push("/finder/step-intro");return}ew(!1),eM("loading..."),d.default.get(w).then(r=>{ee(r?.data?.total||0),r.data.rows.length>0?(ei(r?.data?.rows||[]),Q(Math.ceil(r.data.total/12)),r.data.rows.length>0&&(i?.serverSideData?.LiveDiaryConsultantsSlugs&&r.data.rows&&r.data.rows.forEach(r=>{r.isLiveDiaryConsultant=i?.serverSideData?.LiveDiaryConsultantsSlugs.indexOf(r?.slug)>-1}),ei(r.data.rows))):(ei([]),Q(0)),en(!1),eo(!1)}).catch(i=>{console.log(i),en(!1),eo(!0)}).finally(()=>{ew(!0)})},[W]),i.fields)?(0,r.jsx)("div",{id:$||void 0,children:!es&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(v.default,{backCta:{text:"Consultant Finder",link:`${i?.fields?.BreadcrumbHomePage?.value?.href||"/finder/step-intro"}`},children:[(0,r.jsx)(R.default,{children:(0,r.jsxs)("a",{href:"/",children:[(0,r.jsx)(M.default,{iconName:"iconHome"}),(0,r.jsx)("span",{className:"sr-only",children:"Home"})]})}),(0,r.jsx)(a.default,{href:`${i?.fields?.BreadcrumbHomePage?.value?.href||"/finder/step-intro"}`,children:i?.fields?.ConsultantFinderNodeText?.value||"Consultant Finder"}),(0,r.jsx)("span",{children:i?.fields?.ResultsNodeText?.value||"Results"})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)(x.default,{children:[(0,r.jsx)(w.default,{children:(0,r.jsx)(g.default,{placeholder:i?.fields?.SearchPlaceholderText?.value||"Type in a service, condition, treatment...",doctifyBaseURL:i?.fields?.API_Autocomplete_BaseURL?.value||"https://api.doctify.com/api/hca/search/autocomplete?search",limit:Number(i?.fields?.API_Autocomplete_Limit?.value)||20,noResultsMsg:i?.fields?.API_Autocomplete_NoResultsMsg?.value||"No matches found, please try typing something else.",specialtyLabel:i?.fields?.SpecialitiesFilterHeaderText?.value||"Specialties",conditionsProceduresLabel:i?.fields?.ConditionsTreatmentsFilterHeaderText?.value||"Conditions/ Procedures",setKeywordId:U,searchString:z,setSearchString:B,searchIcon:i?.fields?.SearchIcon?.fields?.SvgMarkup?.value||null,conditionsTreatmentsList:i?.fields?.ConditionsTreatmentsList||[],specialitiesList:i?.fields?.SpecialitiesList||[],loadingText:i?.fields?.API_Autocomplete_LoadingMsg?.value||"Loading..."})}),(0,r.jsxs)(b.default,{resetBtn:(0,r.jsx)(T.default,{theme:"dark",children:(0,r.jsxs)("button",{onClick:()=>
148{let{offset:i,sortBy:r,language:n,insurer:a,gender:o,videoConsultation:s,practice:l,requestPath:u,search:c,keywordId:d,location:h,distance:f,...p}=K,m={...p};"search"in m&&delete m.search,"keywordId"in m&&delete m.keywordId,"language"in m&&delete m.language,"insurer"in m&&delete m.insurer,"gender"in m&&delete m.gender,"videoConsultation"in m&&delete m.videoConsultation,"practice"in m&&delete m.practice,"location"in m&&delete m.location,m.offset=0,m.sortType="relevance",m.lat="51.507217",m.lon="-0.1275862",m.distance=0,q("Anywhere"),H("Anywhere"),Y.push((0,O.buildUrl)(Z,m))},children:[(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i?.fields?.ResetAllIcon?.fields?.SvgMarkup?.value||""}}),i?.fields?.ResetAllText?.value||"Reset all"]})}),children:[(0,r.jsx)(m.default,{filters:[{title:i?.fields?.LocationFilterTitle?.value||"Locations",contentVariation:"filters",children:(0,r.jsx)("div",{children:eD?eD.map(i=>(0,r.jsxs)("div",{children:[(0,r.jsx)(E.default,{marginTop:"spacing-2",marginBottom:"spacing-2",children:(0,r.jsx)(l.default,{tag:"h3",variation:"body-medium-large",children:i.region})}),i.locations.map(i=>(0,r.jsx)(E.default,{marginTop:"spacing-2",marginBottom:"spacing-2",children:(0,r.jsx)(p.default,{id:i.fields.slug.value,value:i.fields.slug.value,name:i.fields.doctifyName.value,label:i.fields.Value.value,checked:ev.includes(i.fields.slug.value),onChange:eF})},i.id))]},i.region)):i.fields.LocationFilterOptions?.map(i=>(0,r.jsx)(E.default,{marginTop:"spacing-2",marginBottom:"spacing-2",children:(0,r.jsx)(p.default,{id:i.fields.slug.value,value:i.fields.slug.value,name:i.fields.doctifyName.value,label:i.fields.Value.value,checked:ev.includes(i.fields.slug.value),onChange:eF})},i.id))})},{title:i?.fields?.VideoConsultationFilterTitle?.value||"Video Consultation",contentVariation:"filters",children:(0,r.jsx)("div",{children:(0,r.jsx)(p.default,{id:"video",value:"video_consultation",name:"video",label:i?.fields?.VideoConsultationFilterOptionYesLabel?.value||"Yes",checked:e_,onChange:i=>{let r=i.target;ey(r.checked);let n={...K};r.checked?(n.videoConsultation="true",n.offset="0"):(delete n.videoConsultation,delete n.offset),Y.push((0,O.buildUrl)(Z,n))}},"video")})},{title:i?.fields?.GenderFilterTitle?.value||"Gender",contentVariation:"filters",children:(0,r.jsx)("div",{children:i?.fields?.GenderFilterOptions&&(0,r.jsx)(A.default,{children:i?.fields?.GenderFilterOptions?.length>0&&i?.fields?.GenderFilterOptions.map((i,n)=>(0,r.jsx)(C.default,{label:i?.name,name:"gender",value:i?.fields?.Value?.value,onChange:i=>(i=>{ec(i);let{requestPath:r,offset:n,...a}=K;Y.push((0,O.buildUrl)(Z,{...a,gender:i,offset:0}))})(i.target.value),checked:eu===i?.fields?.Value?.value},n))})})},{title:i?.fields?.CoverForTreatmentFilterTitle?.value||"Cover for treatment or procedure",contentVariation:"filters",children:(0,r.jsxs)("div",{children:[(0,r.jsx)(A.default,{children:(0,r.jsx)(C.default,{label:i?.fields?.CoverForTreatmentFilterOptionSelfPayLabel?.value||"I am paying by myself",name:"insurer",value:"
1480",onChange:i=>eB(Number(i.target.value)),checked:0===ed},"self-pay")}),(0,r.jsx)(E.default,{marginTop:"spacing-2",marginBottom:"spacing-2",children:(0,r.jsx)(l.default,{tag:"h3",variation:"body-bold-extra-large",children:i?.fields?.InsurersFilterTitle?.value||"Insurers available"})}),F&&(0,r.jsx)(A.default,{children:F?.length>0&&F.map(i=>(0,r.jsx)(C.default,{label:(0,I.capitalizeFirstLetter)(i.name),name:"insurer",value:i.id,onChange:i=>eB(Number(i.target.value)),checked:ed===i.id},i.id))})]})},{title:i?.fields?.LanguagesFilterOptionTitle?.value||"Languages",contentVariation:"filters",children:(0,r.jsx)("div",{children:i?.fields?.LanguageFilterOptions&&i?.fields?.LanguageFilterOptions?.length>0&&(0,r.jsxs)("select",{name:"language",value:ef,onChange:i=>{let r=i.target.value;if(ep(r),""!==r){let{requestPath:i,...n}=K;Y.push((0,O.buildUrl)(Z,{...n,language:r,offset:0}))}else{let{language:i,...r}=K;Y.push((0,O.buildUrl)(Z,{...r,offset:0}))}},children:[(0,r.jsx)("option",{value:"",children:i?.fields?.LanguagesFilterOptionPleaseSelectText?.value||"Please select language"}),i.fields.LanguageFilterOptions.map(i=>(0,r.jsx)("option",{value:i?.fields?.id?.value,children:i?.fields?.Value?.value},i?.fields?.id?.value))]})})}],resultsCount:J}),(0,r.jsx)(_.default,{options:[{id:"relevance",defaultChecked:"relevance"===K.sortType,labelText:i?.fields?.SortByMostRelevantOptionText?.value||"Most relevant",value:"relevance"},{id:"rating",defaultChecked:"rating"===K.sortType,labelText:i?.fields?.SortByHigestRatedOptionText?.value||"Highest rated by patients",value:"rating"},{id:"nearest",defaultChecked:"nearest"===K.sortType,labelText:i?.fields?.SortByMostNearestOptionText?.value||"Nearest",value:"nearest"}],onChange:i=>{let r=i.target;if(r.checked){let i={...K,sortType:r.value,offset:0};"requestPath"in i&&delete i.requestPath,Y.push((0,O.buildUrl)(Z,i))}}})]})]}),(0,r.jsx)(S.default,{title:(0,r.jsx)(l.default,{tag:"h1",variation:"display-5",children:i?.fields?.TitleText?.value||"Let's get you to the right specialist"}),locationSearch:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(L.default,{isStepIntro:!1,isStepCards:!0,applyLocationToSearch:i=>{let{lat:r,lon:n,distance:a}=(eO.find(r=>r.name===i)||eO.find(i=>"Anywhere"===i.name))??{};q(i);let{requestPath:o,offset:s,location:l,...u}=K;Y.push((0,O.buildUrl)(Z,{...u,lat:r,lon:n,distance:a,offset:0}))},placeholder:i?.fields?.SearchPlaceholderText?.value||"Type in a service, condition, treatment...",doctifyBaseURL:i?.fields?.API_Autocomplete_BaseURL?.value||"https://api.doctify.com/api/hca/search/autocomplete?search",limit:Number(i?.fields?.API_Autocomplete_Limit?.value)||20,noResultsMsg:i?.fields?.API_Autocomplete_NoResultsMsg?.value||"No matches found, please try typing something else.",setKeywordId:U,searchString:V,locationList:eO||[],setSearchString:H,searchIcon:i?.fields?.SearchIcon?.fields?.SvgMarkup?.value||null,loadingText:i?.fields?.API_Autocomplete_LoadingMsg?.value||"Loading...",labelLocationsResults:i?.fields?.LocationsResultsLabelText?.value||"LOCATIONS"}),!eC&&void 0!==window.OneTrust&&(0,r.jsx)(P.default,{title:i.fields?.FunctionalCookieSaveNextTimeTitle?.value||"Save this location for next time?",label:i.fields?.FunctionalCookieSaveNextTimeLabel?.value||"Activate functional cookies"})]})}),er&&(0,r.jsx)(k.default,{loadingMsg:i?.fields?.API_DoctifySearch_LoadingMsg?.value||"Loading...."}),!er&&!ea&&0===et.length&&(0,r.jsx)(E.default,{marginTop:"spacing-5",marginBottom:"spacing-6",children:(0,r.jsx)(l.default,{tag:"p",variation:"body-small",children:"London"===G||"Anywhere"===G?i?.fields?.API_DoctifySearch_NoResultsMsg?.value||"No results":i?.fields?.API_DoctifySearch_NoResultsMsgLocations?.value||"No results, please select another location"})}),(0,r.jsx)(y.default,{children:!er&&!ea&&et.length>0&&et.map(n=>(0,r.jsx)(u.default,{ignoreReviewsConsultantsList:i?.serverSideData?.NoReviewsConsultants||[],profilePhoto:n?.images?.logo||i?.fields?.ProfileImagePlaceholderImage?.value?.src||null,name:`${n?.firstName} ${n?.lastName}`,slug:n?.slug,keywords:n?.keywords||null,hospitals:n?.practices||null,reviewsCount:n?.averageRating||0,reviewsTotal:n?.reviewsTotal||0,doctifyLogo:(0,r.jsx)(s.Image,{field:i.fields.DoctifyLogoImage}),doctifyText:i?.fields?.DoctifyText?.value||"Reviewed By",hideAppointmentRequest:n?.hideAppointmentRequest,consultantsSlugs:N,isLiveDiaryConsultant:n?.isLiveDiaryConsultant,firstAppointment:n?.firstAppointment,loadingNextAppointmentText:eR,enquireNowCTAText:i?.fields?.EnquireNowLink?.value?.text||"Enquire Now",bookNowCTAText:i?.fields?.BookOnlineLink?.value?.text||"Book online",viewProfileCTAText:i?.fields?.ViewProfileLink?.value?.text||"View profile",viewProfileLink:i?.fields?.ViewProfileLink?.value?.href&&i?.fields?.ViewProfileLink?.value?.href.replace(/,-w-,/g,""),bookOnlineLink:i?.fields?.BookOnlineLink?.value?.href,enquireNowLink:i?.fields?.EnquireNowLink?.value?.href,nextAppointmentTitle:i?.fields?.NextAppointmentOnText?.value||"Next appointment on",lastUpdatedText:i?.fields?.LastUpdatedText?.value||"Last checked:",showMoreText:i?.fields?.ShowMoreText?.value||"Show More",showLessText:i?.fields?.ShowLessText?.value||"Show Less",iconShowMore:i?.fields?.ShowMoreIcon?.fields?.SvgMarkup?.value||null,iconShowLess:i?.fields?.ShowLessIcon?.fields?.SvgMarkup?.value||null,practicesTitle:i?.fields?.PracticesTitle?.value||"Practices",treatmentsTitle:i?.fields?.TreatmentsTitle?.value||"Treatments",phoneNumberHref:i?.fields?.PhoneNumberHref?.value||"02070794344",phoneNumberDis
148play:i?.fields?.DisplayNumber?.value||"020 7079 4344",callToBookButtonText:i?.fields?.CallToBookButtonText?.value||"Call to book",callToBookButtonIcon:i?.fields?.CallToBookIcon?.fields?.SvgMarkup?.value||null,gmcNumber:n?.registrationBodies?.filter(i=>"General Medical Council"===i.name)[0]?.registrationNumber||"",callToBookModalTitle:i?.fields?.CallToBookModalTitle?.value||"Appointments at",doctifyPhoneSlugs:j,URLprams:eT},n?.id))}),ea&&!er&&(0,r.jsx)("div",{children:"There was an error, Please try again"}),!ea&&!er&&X>1&&et.length>0&&(0,r.jsx)(E.default,{marginBottom:"spacing-8",children:(0,r.jsx)(f.default,{theme:"A-HCA-White",children:(0,r.jsx)(c.default,{pageCount:X,callback:async i=>{let r=(i-1)*12;eg(r);let{requestPath:n,...a}=K;await Y.push((0,O.buildUrl)(Z,{...a,offset:r}),{scroll:!1})},currentPage:Math.ceil((em+1)/12)})})})]})]})}):(0,r.jsx)(D,{...i})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(F,{...i})})])},307355,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(405133),s=i.i(293715),l=i.i(314816),u=i.i(443107),c=i.i(857690),d=i.i(225659),h=i.i(211452),f=i.i(630077),p=i.i(190408),m=i.i(907771),g=i.i(997380),_=i.i(304684),y=i.i(308637),v=i.i(267770),x=i.i(597330);let b=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Consultant Finder Step"})})}),w=i=>{let w=i.params.RenderingIdentifier,{selectedTypeOfAppointment:T,setSelectedTypeOfAppointment:E}=(0,n.useContext)(y.ConsultantFinderContext),S=(0,a.useRouter)(),A=(0,a.useSearchParams)(),[C,I]=(0,n.useState)(""),[k,R]=(0,n.useState)(""),[M,L]=(0,n.useState)(""),[P,O]=(0,n.useState)(""),[D,F]=(0,n.useState)(""),[N,j]=(0,n.useState)(null),[z,B]=(0,n.useState)("");return((0,n.useEffect)(()=>{window.scrollTo({top:0,behavior:"smooth"}),L((0,x.getQueryValue)(A,"search")),O((0,x.getQueryValue)(A,"keywordId")),I((0,x.getQueryValue)(A,"slug")),R((0,x.getQueryValue)(A,"name")),F((0,x.getQueryValue)(A,"gmcNumber")),j(Number(A.get("reviewsTotal")));let i=A.get("isFollowOnAppointment");i&&E(i.toString())},[A]),i.fields)?(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,id:w||void 0,children:(0,r.jsxs)("div",{className:"component-content",children:[(0,r.jsx)(c.default,{logo:(0,r.jsx)(s.Image,{field:i?.fields?.HCALogo}),progress:(0,r.jsx)(d.default,{currentPage:i?.fields?.CurrentStep?.value,steps:i?.fields?.Steps,slug:C,reviewsTotal:N,name:k})}),(0,r.jsx)(_.default,{withConsultantName:!0,name:k,slug:C,gmcNumber:D,reviewsTotal:N||0,backLink:i?.fields?.BackLink?.value?.href,headingText:i?.fields?.BodyText?.value||"Please choose a type of appointment",backLinkText:i?.fields?.BackLink?.value?.text||"Back",resultsLink:i?.fields?.ResultsLink?.value||"/finder/step-consultant-cards",search:M,keywordId:P}),(0,r.jsx)(g.default,{iconCard1:(0,r.jsx)(v.default,{children:i?.fields?.InitialAppointmentIcon?.fields?.SvgMarkup?.value}),iconCard2:(0,r.jsx)(v.default,{children:i?.fields?.FollowUpAppointmentIcon?.fields?.SvgMarkup?.value}),titleCard1:i?.fields?.InitialAppointmentLink?.value?.text||"Initial appointment",titleCard2:i?.fields?.FollowOnAppointmentLink?.value?.text||"Follow up appointment",textCard1:(0,r.jsx)(l.RichText,{field:i?.fields?.InitialAppointmentBodyText}),textCard2:(0,r.jsx)(l.RichText,{field:i?.fields?.FollowUpAppointmentBodyText}),nextLink:`${i?.fields?.NextLink?.value?.href}?slug=${C}&name=${encodeURIComponent(k)}&gmcNumber=${D}&reviewsTotal=${N}&search=${M}&keywordId=${P}`,isSelected:z,setIsSelected:B}),(0,r.jsxs)(m.default,{hideTextMobile:!0,showOnMobile:!0,children:[(0,r.jsx)("div",{children:(0,r.jsx)(h.default,{children:(0,r.jsxs)(o.default,{href:`${i?.fields?.BackLink?.value?.href}?slug=${C}&name=${encodeURIComponent(k)}&gmcNumber=${D}&reviewsTotal=${N}&search=${M}&keywordId=${P}`,children:[(0,r.jsx)(f.default,{iconName:"iconArrowSmallLeft"}),(0,r.jsx)("span",{children:i?.fields?.BackLink?.value?.text||"Back"})]})})}),(0,r.jsx)(p.default,{children:(0,r.jsx)(u.default,{size:"small",variation:"full-dark",children:(0,r.jsx)("button",{disabled:!z,onClick:()=>S.push(`${i?.fields?.NextLink?.value?.href}?slug=${C}&name=${encodeURIComponent(k)}&gmcNumber=${D}&isFollowOnAppointment=${T}&reviewsTotal=${N}&search=${M}&keywordId=${P}`),children:(0,r.jsx)("span",{children:i?.fields?.NextLink?.value?.text||"Next"})})})})]})]})}):(0,r.jsx)(b,{...i})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(w,{...i})})])},614944,i=>{i.v({branding:"PatietnsReviews-module-scss-module__GD7_jG__branding",date:"PatietnsReviews-module-scss-module__GD7_jG__date","date-branding-wrapper":"PatietnsReviews-module-scss-module__GD7_jG__date-branding-wrapper",header:"PatietnsReviews-module-scss-module__GD7_jG__header",highlight:"PatietnsReviews-module-scss-module__GD7_jG__highlight",image:"PatietnsReviews-module-scss-module__GD7_jG__image","patients-reviews":"PatietnsReviews-module-scss-module__GD7_jG__patients-reviews",reason:"PatietnsReviews-module-scss-module__GD7_jG__reason","reason-text":"PatietnsReviews-module-scss-module__GD7_jG__reason-text","reason-wrapper":"PatietnsReviews-module-scss-module__GD7_jG__reason-wrapper",reply:"PatietnsReviews-module-scss-module__GD7_jG__reply","reply-header":"PatietnsReviews-module-scss-module__GD7_jG__reply-header",review:"PatietnsReviews-module-scss-module__GD7_jG__review","sr-only":"PatietnsReviews-module-scss-module__GD7_jG__sr-only",t
148itle:"PatietnsReviews-module-scss-module__GD7_jG__title"})},80379,i=>{i.v({branding:"PeerReviews-module-scss-module__A9dvYW__branding",connection:"PeerReviews-module-scss-module__A9dvYW__connection",date:"PeerReviews-module-scss-module__A9dvYW__date","date-branding-wrapper":"PeerReviews-module-scss-module__A9dvYW__date-branding-wrapper",header:"PeerReviews-module-scss-module__A9dvYW__header",highlight:"PeerReviews-module-scss-module__A9dvYW__highlight",image:"PeerReviews-module-scss-module__A9dvYW__image","patients-reviews":"PeerReviews-module-scss-module__A9dvYW__patients-reviews",rating:"PeerReviews-module-scss-module__A9dvYW__rating",review:"PeerReviews-module-scss-module__A9dvYW__review","sr-only":"PeerReviews-module-scss-module__A9dvYW__sr-only"})},558526,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(34639),o=i.i(249736),s=i.i(614944),l=i.i(770705),u=i.i(955679),c=i.i(985905),d=i.i(257818),h=i.i(211452),f=i.i(630077),p=i.i(751344),m=i.i(906396),g=i.i(710820);let _=i=>{let[a,o]=(0,n.useState)([]),[_,y]=(0,n.useState)(0),[v,x]=(0,n.useState)(0),[b,w]=(0,n.useState)("desc"),[T,E]=(0,n.useState)(!0),[S,A]=(0,n.use
148State)(!0),[C,I]=(0,n.useState)(""),[k,R]=(0,n.useState)(null);return(0,n.useEffect)(()=>{l.default.get(`${g.DOCTIFY_API_BASE_URL}/specialists/${i.slug}`).then(i=>{A(!1),I(`${i?.data?.title} ${i?.data?.firstName} ${i?.data?.lastName}`),R(i?.data?.images?.logo||null)}).catch(i=>{A(!1),console.log(i)})},[]),(0,n.useEffect)(()=>{let r=i.doctifyReviewsURL?.replace("{slug}",i.slug).replace("{limit}",i.doctifyReviewsLimit?.toString()).replace("{offset}",v.toString()).replace("{order}",b)||`${g.DOCTIFY_API_BASE_URL}/specialists/${i.slug}/reviews?limit=2&offset=${v}&order=${b}`;l.default.get(r).then(i=>{E(!1),o(r=>[...r,...i.data.rows]),y(i.data.total)}).catch(i=>{console.log(i),E(!1)})},[v,b]),(0,r.jsxs)(r.Fragment,{children:[T&&(0,r.jsx)(p.default,{}),!T&&_>0&&(0,r.jsxs)("div",{className:s.default["patients-reviews"],children:[(0,r.jsxs)("div",{className:s.default.header,children:[(0,r.jsx)("div",{className:s.default.title,children:(0,r.jsxs)(d.default,{tag:"p",variation:"body-bold-extra-large",children:[i.reviewsFromPatientsTitleText," (",_,")"]})}),(0,r.jsx)("div",{className:s.default.sort,children:(0,r.jsx)(u.default,{options:[{id:"option-a",defaultChecked:"desc"===b,labelText:"Newest",value:"desc"},{id:"option-b",defaultChecked:"asc"===b,labelText:"Oldest",value:"asc"}],onChange:i=>{let r=i.target;E(!0),o([]),w(r.value),x(0)}})})]}),(0,r.jsxs)("div",{className:s.default["review-wrapper"],children:[a.length>0&&a.map((n,a)=>(0,r.jsxs)("div",{className:s.default.review,children:[(0,r.jsxs)("div",{className:s.default.rating,children:[(0,r.jsx)("div",{children:(0,r.jsx)(d.default,{tag:"p",variation:"body-extra-large",children:"Overall experience"})}),(0,r.jsx)(c.default,{reviewsTotal:5,reviewsCount:n.overallExperience,isConsultantProfileReviews:!1,hasDoctifyBranding:!1})]}),(0,r.jsx)("div",{children:(0,r.jsx)(d.default,{tag:"p",variation:"body-large",children:n.text})}),n.reasonKeywords.length>0&&(0,r.jsxs)("div",{className:s.default["reason-wrapper"],children:[(0,r.jsx)("div",{className:s.default["reason-text"],children:(0,r.jsx)(d.default,{tag:"p",variation:"body-medium",children:"Patient seen for:"})}),n?.reasonKeywords.map((i,n)=>(0,r.jsx)("div",{className:s.default.reason,children:(0,r.jsx)(d.default,{tag:"p",variation:"body-medium",children:i})},n))]}),(0,r.jsxs)("div",{className:s.default["date-branding-wrapper"],children:[n?.createdAt!==null&&n?.createdAt!==""&&(0,r.jsx)("div",{className:s.default.date,children:(0,r.jsx)(d.default,{tag:"p",variation:"body-medium",children:(0,m.formatDate)(n?.createdAt)})}),(0,r.jsxs)("div",{className:s.default.branding,children:[(0,r.jsx)(d.default,{tag:"p",variation:"body-medium",children:i.verifyByDoctifyText}),i.doctifyLogo&&(0,r.jsx)("img",{src:i.doctifyLogo,alt:"doctify logo",width:"83",height:"21"})]})]}),n.comment&&n.comment.text&&n.comment.createdAt&&(0,r.jsx)("div",{className:s.default.reply,children:(0,r.jsxs)("div",{className:s.default["reply-header"],children:[k&&(0,r.jsx)("div",{className:s.default.image,children:(0,r.jsx)("img",{src:k,alt:"profile image",width:"60",height:"60"})}),(0,r.jsxs)("div",{children:[!S&&(0,r.jsxs)(d.default,{tag:"p",variation:"body-medium-medium",children:[C,":"]}),(0,r.jsx)("div",{children:(0,r.jsx)(d.default,{tag:"p",variation:"body-medium",children:n?.comment?.text})}),(0,r.jsx)("div",{children:(0,r.jsx)(d.default,{tag:"p",variation:"body-small",children:(0,m.formatDate)(n?.comment?.createdAt)})})]})]})})]},a)),!T&&a.length<_&&(0,r.jsx)("div",{children:(0,r.jsx)(h.default,{theme:"dark",children:(0,r.jsxs)("button",{onClick:()=>{x(i=>i+2)},children:["Load more",(0,r.jsx)(f.default,{iconName:"iconPlus"})]})})})]})]}),!T&&0===_&&(0,r.jsx)(d.default,{tag:"p",variation:"body-large",children:i.noReviewsText})]})};var y=i.i(80379);let v=i=>
148{let[a,o]=(0,n.useState)([]),[s,u]=(0,n.useState)(0),[c,g]=(0,n.useState)(!0),[_,v]=(0,n.useState)(2);return(0,n.useEffect)(()=>{let r=i.doctifyReviewsURL?.replace("{slug}",i.slug)||`https://api.doctify.com/api/hca/specialists/${i.slug}/peerRecommendations`;l.default.get(r).then(i=>{g(!1),o(i.data.rows),u(i.data.total)}).catch(i=>{console.log(i),g(!1)})},[]),(0,r.jsxs)(r.Fragment,{children:[c&&(0,r.jsx)(p.default,{}),!c&&s>0&&(0,r.jsxs)("div",{className:y.default["patients-reviews"],children:[(0,r.jsx)("div",{className:y.default.header,children:(0,r.jsx)("div",{className:y.default.title,children:(0,r.jsxs)(d.default,{tag:"p",variation:"body-bold-extra-large",children:[i.reviewsFromPeersTitleText," (",s,")"]})})}),(0,r.jsxs)("div",{className:y.default["review-wrapper"],children:[a.length>0&&a?.slice(0,_)?.map((n,a)=>(0,r.jsxs)("div",{className:y.default.review,children:[(0,r.jsxs)("div",{className:y.default.rating,children:[(0,r.jsx)("div",{className:y.default.image,children:(0,r.jsx)("img",{src:n.recommender.image,alt:"peer image",width:"76",height:"76"})}),(0,r.jsxs)("div",{className:y.default.text,children:[(0,r.jsxs)(d.default,{tag:"p",variation:"body-bold-extra-large",children:[n.recommender.title," ",n.recommender.firstName," ",n.recommender.lastName]}),n.keywords.length>0&&(0,r.jsx)(d.default,{tag:"p",variation:"body-small",children:n.keywords.filter(i=>"specialty"===i.type).map(i=>i.name).join(", ")})]})]}),null!==n.connection&&n.connection.length>0&&(0,r.jsx)("div",{className:y.default.connection,children:(0,r.jsx)(d.default,{tag:"p",variation:"body-medium",children:n.connection})}),(0,r.jsx)("div",{children:(0,r.jsx)(d.default,{tag:"p",variation:"body-large",children:n.recommendation})}),(0,r.jsxs)("div",{className:y.default["date-branding-wrapper"],children:[n?.createdAt!==null&&n?.createdAt!==""&&(0,r.jsx)("div",{className:y.default.date,children:(0,r.jsx)(d.default,{tag:"p",variation:"body-medium",children:(0,m.formatDate)(n?.createdAt)})}),(0,r.jsxs)("div",{className:y.default.branding,children:[(0,r.jsx)(d.default,{tag:"p",variation:"body-medium",children:i.verifyByDoctifyText}),i.doctifyLogo&&(0,r.jsx)("img",{src:i.doctifyLogo,alt:"doctify logo",width:"83",height:"21"})]})]})]},a)),!c&&_<a?.length&&(0,r.jsx)("div",{children:(0,r.jsx)(h.default,{theme:"dark",children:(0,r.jsxs)("button",{onClick:()=>{v(_+2)},children:["Load more",(0,r.jsx)(f.default,{iconName:"iconPlus"})]})})})]})]}),!c&&0===s&&(0,r.jsx)(d.default,{tag:"p",variation:"body-large",children:i.noReviewsText})]})};i.s(["default",0,i=>
148{let[s,l]=(0,n.useState)("patient"),[u,c]=(0,n.useState)(null);(0,n.useEffect)(()=>{let i=new URLSearchParams(window.location.search).get("slug");i&&c(i)},[]);let d=()=>{let i=document.body.scrollHeight;if(window.parent){let r=window.parent.document.getElementById("specialistReviews");r&&(r.style.height=i+"px")}};return(0,n.useEffect)(()=>{let i=new MutationObserver(d),r=document.body;return i.observe(r,{childList:!0,subtree:!0}),()=>{i.disconnect()}},[]),(0,r.jsxs)("div",{children:[u&&(0,r.jsxs)("div",{children:[(0,r.jsx)(o.default,{theme:"A-HCA-White",children:(0,r.jsx)(a.default,{callback:i=>{"Patient Reviews"===i.label?l("patient"):"Peer Reviews"===i.label&&l("peer")},tabs:[{label:"Patient Reviews"},{label:"Peer Reviews"}]})}),"patient"===s&&(0,r.jsx)(_,{slug:u,doctifyLogo:i.DoctifyReviewsImage,doctifyReviewsURL:i.DoctifyPatientReviewsURL,doctifyReviewsLimit:i.DoctifyPatientReviewsLimit,reviewsFromPatientsTitleText:i.ReviewsFromPatientsTitleText,verifyByDoctifyText:i.VerifyByDoctifyText,noReviewsText:i.NoReviewsText}),"peer"===s&&(0,r.jsx)(v,{slug:u,doctifyLogo:i.DoctifyReviewsImage,doctifyReviewsURL:i.DoctifyPeerReviewsURL,doctifyReviewsLimit:i.DoctifyPeerReviewsLimit,reviewsFromPeersTitleText:i.ReviewsFromPeersTitleText,verifyByDoctifyText:i.VerifyByDoctifyText,noReviewsText:i.NoReviewsText})]}),null===u&&(0,r.jsx)("div",{children:"No consultant selected"})]})}],558526)},241780,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(123768),o=i.i(770705),s=i.i(218415),l=i.i(597330);let u=i=>(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"No CMA disclosure"})})}),c=i=>{let c=(0,a.useParams)(),d=(0,a.useSearchParams)(),h=i.params.RenderingIdentifier,[f,p]=(0,n.useState)(i.cmaHTML||"Loading...");return((0,n.useEffect)(()=>{if(i.cmaHTML)return;let r=d.get("CmaContentId"),n=(0,l.getPathSegments)(c.path);!r&&n.length>0&&(r=n[n.length-1]);let a=`/api/finderAPI/CMA?cmaId=${r}`;o.default.get(a).then(function(i){p(i.data?.Value)}).catch(function(i){console.warn("error loading cma",i),p("error loading")}).finally(function(){})},[c.path,i.cmaHTML,d]),i.fields)?(0,r.jsx)("div",{className:`component promo ${i.params.styles}`,id:h||void 0,children:(0,r.jsx)(s.default,{children:(0,r.jsx)("div",{dangerouslySetInnerHTML:{__html:f||"No CMA record found"}})})}):(0,r.jsx)(u,{params:i.params})};i.s(["Default",0,i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(c,{...i})})])},758474,i=>{"use strict";i.i(770705).default.interceptors.request.use(i=>(i.url=window?.location?.hostname=="localhost"&&i?.url&&i.url.indexOf("https://api/")>-1?i?.url?.replaceAll("https","http"):i?.url,i)),i.s([])},766850,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(249736),o=i.i(123768),s=i.i(965131),l=i.i(635875),u=i.i(443107),c=i.i(257818),d=i.i(630077),h=i.i(40618),f=i.i(924274),p=i.i(751344),m=i.i(752071);let g=i=>i.page.mode.isEditing?(0,r.jsx)("div",{className:`component promo ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Careers Search Results. Please click to select datasource"})})}):(0,r.jsx)(r.Fragment,{}),_=i=>
148{let _=(0,o.useSearchParams)(),[y,v]=(0,n.useState)(0),[x,b]=(0,n.useState)([]),[w,T]=(0,n.useState)(0),E=(0,m.useTranslations)(i?.page?.siteName),S=(0,n.useMemo)(()=>[..._.entries()].filter(([i,r])=>r?.length&&"limit"!==i&&"offset"!==i).map(([i,r])=>`${i}=${r}`).join("&"),[_]),[A,C]=(0,n.useState)(S),I=A!==S,k=I?0:y;(0,n.useEffect)(()=>{C(S),v(0),b([]),T(0)},[S]);let{data:R,error:M,isLoading:L,isValidating:P}=(0,s.default)(`/api/api-layer/careers/search?verticalKey=jobs&limit=10&offset=${k}${S?`&${S}`:""}`,i=>fetch(i).then(i=>i.json()).then(i=>i.response),{revalidateOnFocus:!1}),O=L||P;if((0,n.useEffect)(()=>{R&&(T(Number(R.resultsCount)||0),b(i=>{let r=R.results||[];if(0===k)return r;let n=new Set(i.map(i=>i.data.id));return[...i,...r.filter(i=>!n.has(i.data.id))]}))},[k,R]),!i?.fields)return(0,r.jsx)(g,{...i});let D=!I&&x.length>0,F=(O||I)&&!D,N=O&&D,j=!I&&x.length<w;return(0,r.jsx)(a.default,{theme:i.params?.Theme||"A-HCA-White",children:F?(0,r.jsx)(h.default,{results:(0,r.jsx)(p.default,{loadingMsg:E("loading-vacancies")})}):D?(0,r.jsx)(h.default,{count:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(c.default,{variation:"heading-1",children:[w," vacancies"]}),(0,r.jsxs)(c.default,{variation:"body-bold-medium",children:["Showing 1 - ",Math.min(w,x.length)]})]}),results:(0,r.jsxs)(r.Fragment,{children:[x.map(n=>(0,r.jsx)(l.default,{location:n.data.jobLocation,city:n.data.jobCity,clinical:n.data.jobFunction,timing:n.data.employmentType,title:(0,r.jsx)(c.default,{variation:"heading-1",children:n.data.name}),cta:(0,r.jsx)(u.default,{contentVariation:"full-width",variation:"full",size:"small",children:(0,r.jsx)("a",{href:n.data.landingPageUrl||n.data.applicationUrl||"#",children:i.fields?.ReadMoreCtaText?.value||"Read More & Apply"})})},n.data.id)),N?(0,r.jsx)(p.default,{loadingMsg:E("loading-vacancies")}):null]}),cta:j?(0,r.jsx)(u.default,{size:"large",variation:"full",children:(0,r.jsxs)("button",{onClick:()=>{j&&!O&&v(x.length)},disabled:O||!j,children:[(0,r.jsx)(d.default,{iconName:"iconPlus"}),(0,r.jsxs)("span",{children:["Show ",(0,r.jsx)("b",{children:"more"})]})]})}):(0,r.jsx)(r.Fragment,{})}):(0,r.jsx)(f.default,{})})};i.s(["Default",0,i=>{let a=(0,m.useTranslations)(i?.page?.siteName);return(0,r.jsx)(n.Suspense,{fallback:(0,r.jsx)(p.default,{loadingMsg:a("loading-vacancies")}),children:(0,r.jsx)(_,{...i})})}])},595387,i=>{i.v({active:"SelectField-module-scss-module__2I-QEW__active",arrow:"SelectField-module-scss-module__2I-QEW__arrow",close:"SelectField-module-scss-module__2I-QEW__close","error-message":"SelectField-module-scss-module__2I-QEW__error-message","form-select-option":"SelectField-module-scss-module__2I-QEW__form-select-option","help-text":"SelectField-module-scss-module__2I-QEW__help-text","hidden-input":"SelectField-module-scss-module__2I-QEW__hidden-input",highlight:"SelectField-module-scss-module__2I-QEW__highlight","mdi-check":"SelectField-module-scss-module__2I-QEW__mdi-check",option:"SelectField-module-scss-module__2I-QEW__option",options:"SelectField-module-scss-module__2I-QEW__options","options-inner-wrapper":"SelectField-module-scss-module__2I-QEW__options-inner-wrapper",select:"SelectField-module-scss-module__2I-QEW__select","sr-only":"SelectField-module-scss-module__2I-QEW__sr-only",wrapper:"SelectField-module-scss-module__2I-QEW__wrapper"})},141786,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(595387),o=i.i(630077),s=i.i(257818),l=i.i(82336);i.s(["default",0,i=>{let{id:u,label:c,placeholder:d,helpText:h,required:f,errorMessage:p,options:m}=i,g=(0,n.useRef)(null),_=(0,n.useRef)(null),y=(0,n.useRef)(null),[v,x]=(0,n.useState)(d||""),b=()=>{y?.current?.close(),_.current?.setAttribute("aria-expanded","false")},w=i=>{let r=i.target.textContent;b(),r&&x(r)};return(0,r.jsxs)("div",{className:a.default.wrapper,ref:g,children:[c&&(0,r.jsxs)("label",{htmlFor:u,children:[c,!f&&" (Optional)"]}),(0,r.jsx)("input",{type:"text",value:v===d?"":v,onChange:()=>{},required:f,className:a.default["hidden-input"],name:v===d?void 0:u,"aria-label":c||u}),(0,r.jsx)("span",{className:a.default.select,children:(0,r.jsxs)("button",{id:u,ref:_,type:"button",role:"combobox","aria-label":"open dropdown","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":"select-dropdown",onClick:()=>y?.current?.open?b():void(y?.current?.show(),_.current?.setAttribute("aria-expanded","true")),children:[(0,r.jsx)("span",{children:v}),(0,r.jsx)(o.default,{iconName:"iconArrowDropdown"})]})}),(0,r.jsxs)(l.default,{ref:y,children:[(0,r.jsx)("button",{className:a.default.close,onClick:b,type:"button",children:"Close"}),(0,r.jsx)("div",{role:"listbox",id:"select-dropdown",className:a.default.options,children:(0,r.jsx)("div",{className:a.default["options-inner-wrapper"],children:m.map((i,n)=>(0,r.jsx)("button",{type:"button",onClick:w,role:"option","aria-selected":i.text===v,className:`${a.default.option} ${i.text===v?a.default.active:""}`,children:(0,r.jsx)(s.default,{tag:"span",variation:"body-medium-large",children:i.text})},n))})})]}),h&&(0,r.jsx)("div",{className:a.default["help-text"],children:(0,r.jsx)(s.default,{tag:"small",variation:"body-large",children:h})}),f&&(0,r.jsxs)("div",{className:a.default["error-message"],children:[(0,r.jsx)(o.default,{iconName:"iconWarning"}),(0,r.jsx)(s.default,{variation:"body-medium-medium",children:p})]})]})}])},123291,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(314816),o=i.i(898205),s=i.i(257818),l=i.i(249736),u=i.i(273723),c=i.i(586936),d=i.i(82037
1485),h=i.i(623420),f=i.i(208024),p=i.i(922861),m=i.i(123768),g=i.i(630077),_=i.i(777912);i.s(["default",0,i=>{let y=(0,m.useSearchParams)(),v=(0,n.useRef)(null),x=(0,m.usePathname)(),b=(0,m.useRouter)();if(!i?.fields?.data?.item)return(0,r.jsx)(r.Fragment,{});let w=i.fields?.data?.item?.filters?.targetItems,T=i.fields?.data?.item?.filters?.targetItems?.map(i=>i.yextFieldId?.value)||[],E=i.facets?.filter(({fieldId:i})=>T.includes(i))?.map(i=>{let r=w?.find(r=>r.yextFieldId?.value===i.fieldId);return{title:r?.displayName?.value,fields:i.options?.map(i=>{let n=r?.filter?.value||"";return{id:`${n}-${i.displayName}`,value:i.displayName,name:n,label:i.displayName,checked:y.getAll(n).includes(i.displayName),onChange:()=>{}}})}}),S=E?.reduce((i,{fields:r})=>[...i,...r.filter(({checked:i})=>i)],[]),A=()=>{let i=v.current;if(!i)return;let r=new URLSearchParams([...new FormData(i).entries()].filter(([,i])=>!!i)),n=`${x}?${r}`;b.replace(n,{scroll:!1})},{headingTag:C,subheadingTag:I}=(0,_.default)(i?.params,i.fields?.data?.contextItem?.subHeading?.jsonValue?.value,"h1");return(0,r.jsx)(l.default,{theme:i.params?.Theme||"D-HCA-Teal",children:(0,r.jsx)("form",{ref:v,onChange:A,onSubmit:i=>{i.preventDefault(),A()},method:"get",children:(0,r.jsx)(c.default,{metatitle:(0,r.jsx)(s.default,{tag:I,variation:"subheading-1",children:(0,r.jsx)(o.Text,{field:i.fields?.data?.contextItem?.subHeading?.jsonValue})}),heading:(0,r.jsx)(s.default,{variation:i.params?.HeadingSize||(0,c.getDynamicTitleStyle)(i.fields?.data?.contextItem?.title?.jsonValue?.value.length),tag:C,children:(0,r.jsx)(o.Text,{field:i.fields?.data?.contextItem?.title?.jsonValue})}),description:(0,r.jsx)(s.default,{tag:"div",variation:"body-large",children:(0,r.jsx)(a.RichText,{field:i.fields?.data?.contextItem?.text?.jsonValue})}),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.default,{preventSubmitOnSuggestion:!1,name:"input",defaultValue:y.get("input")||"",placeholder:i.fields?.data?.item?.searchPhrasePlaceholder?.value,children:(0,r.jsx)(p.default,{buttonText:(0,r.jsxs)("span",{children:[(0,r.jsx)("b",{children:"Filter"})," by"]}),buttonIcon:(0,r.jsx)(g.default,{iconName:"iconFilterCircle"}),filters:E?.map(i=>({title:i.title,contentVariation:"filters",children:(0,r.jsx)(f.default,{children:i.fields?.map(i=>(0,n.createElement)(h.default,{...i,key:i.id}))})}))})}),(0,r.jsx)(d.default,{filters:S||[],clearFilters:()=>{S?.forEach(({id:i},r)=>{let n=document.getElementById(i);n&&(r===S.length-1?n.click():n.checked=!1)})}})]})})})})}])},205081,i=>{"use strict";var r=i.i(677076),n=i.i(2317),a=i.i(159273),o=i.i(898205),s=i.i(249736),l=i.i(257818),u=i.i(40618),c=i.i(922861),d=i.i(208024),h=i.i(630077),f=i.i(623420),p=i.i(123768),m=i.i(965131),g=i.i(443107),_=i.i(635875),y=i.i(924274),v=i.i(267770),x=i.i(363126),b=i.i(777912),w=i.i(751344),T=i.i(752071);let E=i=>i.page.mode.isEditing?(0,r.jsx)("div",{className:`component promo ${i.params?.styles}`,children:(0,r.jsx)("div",{className:"component-content",children:(0,r.jsx)("span",{className:"is-empty-hint",children:"Careers Latest Vacancies. Please click to select datasource"})})}):(0,r.jsx)(r.Fragment,{}),S=i=>{let S=(0,p.useSearchParams)(),A=(0,n.useRef)(null),I=(0,p.useRouter)(),k=(0,p.usePathname)(),R=(0,T.useTranslations)(i?.page?.siteName),M=C(i),L=[...S.entries()].filter(([,i])=>i?.length).map(([i,r])=>`${i}=${r}`),{data:P,error:O,isLoading:D,isValidating:F}=(0,m.default)(`/api/api-layer/careers/search?verticalKey=jobs&retrieveFacets=true&${M}&limit=6&${L.join("&")}`,i=>fetch(i).then(i=>i.json()).then(i=>i.response),{keepPreviousData:!0,revalidateOnFocus:!1}),N=D||F;if(!i?.fields?.data?.item)return(0,r.jsx)(E,{...i});let j=i.fields?.data?.item?.searchConfiguration?.targetItem?.filters?.targetItems,z=i.fields?.data?.item?.searchConfiguration?.targetItem?.filters?.targetItems?.map(i=>i.yextFieldId?.value)||[],B=P?.facets?.filter(({fieldId:i})=>z.includes(i))?.map(i=>{let r=j?.find(r=>r.yextFieldId?.value===i.fieldId);return{title:r?.displayName?.value,fields:i.options?.map(i=>{let n=r?.filter?.value||"";return{id:i.displayName,value:i.displayName,name:n,label:i.displayName,checked:S.getAll(n).includes(i.displayName),onChange:()=>{}}})}}),U=i.fields.data.item?.searchConfiguration?.targetItem?.viewAllVacanciesCTA.jsonValue.value.href&&i.fields.data.item?.searchConfiguration?.targetItem?.viewAllVacanciesCTA.jsonValue.value.text?(0,r.jsx)(g.default,{size:"large",variation:"full",children:(0,r.jsx)(a.Link,{href:`${i.fields.data.item.searchConfiguration.targetItem.viewAllVacanciesCTA.jsonValue.value.href}?${[...L,M].join("&")}`,field:i.fields.data.item?.searchConfiguration?.targetItem?.viewAllVacanciesCTA.jsonValue.value,children:(0,r.jsx)(v.default,{children:i.fields.data.item?.searchConfiguration?.targetItem?.viewAllVacanciesCTA.jsonValue.value.text?.replaceAll(/\s{jobsCount}/gm,P?.resultsCount?` ${P?.resultsCount}`:"")})})}):(0,r.jsx)(r.Fragment,{}),{headingTag:V,subheadingTag:H}=(0,b.default)(i?.params,i.fields?.data?.item?.heading?.jsonValue?.value);return(0,r.jsx)(s.default,{theme:i.params?.Theme||"A-HCA-White",children:(0,r.jsx)("form",{ref:A,onCh
148ange:()=>{if(!A?.current)return;let i=new URLSearchParams([...new FormData(A.current).entries()]),r=`${k}?${i}`;I.replace(r,{scroll:!1})},children:"carousel"===i.variant?N?(0,r.jsx)(w.default,{loadingMsg:R("loading")}):(0,r.jsx)(x.default,{theme:i.params?.Theme||"A-HCA-White",cardsToDisplay:4,link:U,subtitle:(0,r.jsx)(l.default,{tag:H,variation:"subheading-1",children:(0,r.jsx)(o.Text,{field:i.fields?.data?.item?.heading?.jsonValue})}),title:(0,r.jsx)(l.default,{tag:V,variation:i.params?.HeadingSize||"display-3",children:(0,r.jsx)(o.Text,{field:i.fields.data.item?.title?.jsonValue})}),children:O||!P?.resultsCount?[(0,r.jsx)(y.default,{contentVariation:"no-container"},"error")]:P.results.map(n=>(0,r.jsx)(_.default,{variation:"carousel",location:n.data.jobLocation,city:n.data.jobCity,clinical:n.data.jobFunction,timing:n.data.employmentType,title:(0,r.jsx)(l.default,{variation:"heading-1",children:n.data.name}),cta:(0,r.jsx)(g.default,{contentVariation:"full-width",variation:"full",size:"small",children:(0,r.jsx)("a",{href:n.data.landingPageUrl||n.data.applicationUrl||"#",children:i.fields?.data?.item?.searchConfiguration?.targetItem?.readMoreCtaText?.value||"Read More & Apply"})})},n.data.id))}):(0,r.jsx)(u.default,{header:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.default,{tag:i.params?.HeadingTag||"h2",variation:i.params?.HeadingSize||"display-3",children:(0,r.jsx)(o.Text,{field:i.fields.data.item?.title?.jsonValue})}),(0,r.jsx)(c.default,{hideResultsCount:!0,buttonText:(0,r.jsxs)("span",{children:[(0,r.jsx)("b",{children:"Filter"})," by"]}),buttonIcon:(0,r.jsx)(h.default,{iconName:"iconFilterCircle"}),resultsCount:Number(P?.resultsCount),filters:B?.filter(i=>"Job Family"!==i.title||!M?.length).map(i=>({title:i.title,contentVariation:"filters",children:(0,r.jsx)(d.default,{children:i.fields?.map(i=>(0,n.createElement)(f.default,{...i,key:i.id}))})}))})]}),results:N?(0,r.jsx)(w.default,{loadingMsg:R("loading")}):O?(0,r.jsx)(y.default,{contentVariation:"no-container"}):P?.resultsCount?P?.results?.map(n=>(0,r.jsx)(_.default,{location:n.data.jobLocation,city:n.data.jobCity,clinical:n.data.jobFunction,timing:n.data.employmentType,title:(0,r.jsx)(l.default,{variation:"heading-1",children:n.data.name}),cta:(0,r.jsx)(g.default,{contentVariation:"full-width",variation:"full",size:"small",children:(0,r.jsx)("a",{href:n.data.landingPageUrl||n.data.applicationUrl||"#",children:i.fields?.data?.item?.searchConfiguration?.targetItem?.readMoreCtaText?.value||"Read More & Apply"})})},n.data.id)):(0,r.jsx)(y.default,{contentVariation:"no-container"}),cta:N?(0,r.jsx)(r.Fragment,{}):U})})})},A=i=>(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(S,{...i})}),C=i=>{let r=i.fields?.data?.item?.jobFamilies?.targetItems;return r&&0!==r.length?r.map(i=>{let r=i.value?.value,n=i.key?.value;return r?`${n}=${encodeURIComponent(r)}`:""}).filter(Boolean).join("&"):""};i.s(["Carousel",0,i=>i.fields?.data?.item?(0,r.jsx)(A,{...i,variant:"carousel"}):(0,r.jsx)(E,{...i}),"Default",0,A])}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.