diff --git a/assets/About-DPAPI_xR.js b/assets/About-CwFoPN31.js similarity index 93% rename from assets/About-DPAPI_xR.js rename to assets/About-CwFoPN31.js index ca2f90a..f72cec2 100644 --- a/assets/About-DPAPI_xR.js +++ b/assets/About-CwFoPN31.js @@ -1 +1 @@ -import{f as p,j as e,c as b,w as L,N,q as A,s as D,l as F,g as _,M as v}from"./index-CNMbRSP0.js";import{T as x,O as H,b as u,F as I,B as f}from"./Footer-TCVu7l1I.js";import{C as M,a as O,H as w,b as Y}from"./heading-BaecBvU5.js";import{m as C,S as W}from"./stack-u4belbkc.js";import{I as $}from"./image-DKhd7Alb.js";const k=p(function(s,n){const{templateAreas:a,gap:o,rowGap:r,columnGap:l,column:d,row:m,autoFlow:h,autoRows:g,templateRows:T,autoColumns:R,templateColumns:E,...S}=s,B={display:"grid",gridTemplateAreas:a,gridGap:o,gridRowGap:r,gridColumnGap:l,gridAutoColumns:R,gridColumn:d,gridRow:m,gridAutoFlow:h,gridAutoRows:g,gridTemplateRows:T,gridTemplateColumns:E};return e.jsx(b.div,{ref:n,__css:B,...S})});k.displayName="Grid";const y=p(function(s,n){const{columns:a,spacingX:o,spacingY:r,spacing:l,minChildWidth:d,...m}=s,h=L(),g=d?P(d,h):V(a);return e.jsx(k,{ref:n,gap:l,columnGap:o,rowGap:r,templateColumns:g,...m})});y.displayName="SimpleGrid";function z(t){return typeof t=="number"?`${t}px`:t}function P(t,s){return C(t,n=>{const a=N("sizes",n,z(n))(s);return n===null?null:`repeat(auto-fit, minmax(${a}, 1fr))`})}function V(t){return C(t,s=>s===null?null:`repeat(${s}, minmax(0, 1fr))`)}const i=p(function(s,n){const a=A("Link",s),{className:o,isExternal:r,...l}=D(s);return e.jsx(b.a,{target:r?"_blank":void 0,rel:r?"noopener":void 0,ref:n,className:F("chakra-link",o),...l,__css:a})});i.displayName="Link";const G=p((t,s)=>e.jsx(W,{align:"center",...t,direction:"column",ref:s}));G.displayName="VStack";const U=()=>{const{t}=_();return e.jsxs(e.Fragment,{children:[e.jsx(v,{title:t("about.title"),description:t("about.description"),children:e.jsxs(M,{height:"100%",overflow:"auto",padding:"20px",children:[e.jsx(O,{children:e.jsx(w,{children:t("about.title")})}),e.jsx(Y,{children:e.jsxs(G,{spacing:"6",align:"start",children:[e.jsx(x,{children:t("about.introduction")}),e.jsxs(c,{heading:t("about.generalDescription.h"),content:t("about.generalDescription.p"),children:[e.jsx(x,{children:t("about.steps.introduction")}),e.jsxs(H,{children:[e.jsx(u,{children:t("about.steps.1")}),e.jsx(u,{children:t("about.steps.2")}),e.jsx(u,{children:t("about.steps.3")}),e.jsx(u,{children:t("about.steps.4")})]})]}),e.jsx(j,{images:["images/about/about1.png","images/WelcomeMessage2.png","images/WelcomeMessage3.png"]}),e.jsxs(c,{heading:t("about.data.h"),children:[t("about.data.p1")," ",e.jsx(i,{href:"https://www.dwd.de/DE/leistungen/cdc/climate-data-center.html",isExternal:!0,color:"teal",children:"[CC-BY-4.0]"}),", ",t("about.data.p2")," ",e.jsx(i,{href:"https://sonny.4lima.de/",isExternal:!0,color:"teal",children:"[CC-BY-4.0]"}),", ",t("about.data.p3")," ",e.jsx(i,{href:"https://www.bkg.bund.de/DE/Home/home.html",isExternal:!0,color:"teal",children:"[DL-DE/BY-2-0]"}),"."]}),e.jsx(c,{heading:t("about.whyOpenSource.h"),content:t("about.whyOpenSource.p")}),e.jsx(c,{heading:t("about.team.h"),content:t("about.team.p"),children:e.jsx(i,{href:"https://github.com/orgs/open-pv/people",isExternal:!0,color:"teal",children:t("about.team.link")})}),e.jsx(c,{heading:t("about.sponsors.h"),content:t("about.sponsors.p")}),e.jsx(j,{images:["images/about/ptf.png","images/about/bmbf.jpg"],links:["https://prototypefund.de/","https://www.bmbf.de"],objectFit:"contain"})]})})]})}),e.jsx(I,{})]})};function c({content:t,heading:s,children:n}){return e.jsxs(f,{children:[e.jsx(w,{as:"h3",size:"md",children:s}),e.jsx(x,{children:t}),n]})}const j=({images:t,links:s=[],objectFit:n="cover"})=>e.jsx(y,{columns:t.length,spacing:4,children:t.map((a,o)=>{const r=e.jsx($,{src:a,objectFit:n,width:"100%",height:"150px",borderRadius:"md"});return e.jsx(f,{padding:2,children:s[o]?e.jsx(i,{href:s[o],isExternal:!0,children:r}):r},o)})});export{U as default}; +import{f as p,j as e,c as b,w as L,N,q as A,s as D,l as F,g as _,M as v}from"./index-Blxo1hic.js";import{T as x,O as H,b as u,F as I,B as f}from"./Footer-DvQMRGAB.js";import{C as M,a as O,H as w,b as Y}from"./heading-CX4arv15.js";import{m as C,S as W}from"./stack-B32WIkoR.js";import{I as $}from"./image-BuVSjtYu.js";const k=p(function(s,n){const{templateAreas:a,gap:o,rowGap:r,columnGap:l,column:d,row:m,autoFlow:h,autoRows:g,templateRows:T,autoColumns:R,templateColumns:E,...S}=s,B={display:"grid",gridTemplateAreas:a,gridGap:o,gridRowGap:r,gridColumnGap:l,gridAutoColumns:R,gridColumn:d,gridRow:m,gridAutoFlow:h,gridAutoRows:g,gridTemplateRows:T,gridTemplateColumns:E};return e.jsx(b.div,{ref:n,__css:B,...S})});k.displayName="Grid";const y=p(function(s,n){const{columns:a,spacingX:o,spacingY:r,spacing:l,minChildWidth:d,...m}=s,h=L(),g=d?P(d,h):V(a);return e.jsx(k,{ref:n,gap:l,columnGap:o,rowGap:r,templateColumns:g,...m})});y.displayName="SimpleGrid";function z(t){return typeof t=="number"?`${t}px`:t}function P(t,s){return C(t,n=>{const a=N("sizes",n,z(n))(s);return n===null?null:`repeat(auto-fit, minmax(${a}, 1fr))`})}function V(t){return C(t,s=>s===null?null:`repeat(${s}, minmax(0, 1fr))`)}const i=p(function(s,n){const a=A("Link",s),{className:o,isExternal:r,...l}=D(s);return e.jsx(b.a,{target:r?"_blank":void 0,rel:r?"noopener":void 0,ref:n,className:F("chakra-link",o),...l,__css:a})});i.displayName="Link";const G=p((t,s)=>e.jsx(W,{align:"center",...t,direction:"column",ref:s}));G.displayName="VStack";const U=()=>{const{t}=_();return e.jsxs(e.Fragment,{children:[e.jsx(v,{title:t("about.title"),description:t("about.description"),children:e.jsxs(M,{height:"100%",overflow:"auto",padding:"20px",children:[e.jsx(O,{children:e.jsx(w,{children:t("about.title")})}),e.jsx(Y,{children:e.jsxs(G,{spacing:"6",align:"start",children:[e.jsx(x,{children:t("about.introduction")}),e.jsxs(c,{heading:t("about.generalDescription.h"),content:t("about.generalDescription.p"),children:[e.jsx(x,{children:t("about.steps.introduction")}),e.jsxs(H,{children:[e.jsx(u,{children:t("about.steps.1")}),e.jsx(u,{children:t("about.steps.2")}),e.jsx(u,{children:t("about.steps.3")}),e.jsx(u,{children:t("about.steps.4")})]})]}),e.jsx(j,{images:["images/about/about1.png","images/WelcomeMessage2.png","images/WelcomeMessage3.png"]}),e.jsxs(c,{heading:t("about.data.h"),children:[t("about.data.p1")," ",e.jsx(i,{href:"https://www.dwd.de/DE/leistungen/cdc/climate-data-center.html",isExternal:!0,color:"teal",children:"[CC-BY-4.0]"}),", ",t("about.data.p2")," ",e.jsx(i,{href:"https://sonny.4lima.de/",isExternal:!0,color:"teal",children:"[CC-BY-4.0]"}),", ",t("about.data.p3")," ",e.jsx(i,{href:"https://www.bkg.bund.de/DE/Home/home.html",isExternal:!0,color:"teal",children:"[DL-DE/BY-2-0]"}),"."]}),e.jsx(c,{heading:t("about.whyOpenSource.h"),content:t("about.whyOpenSource.p")}),e.jsx(c,{heading:t("about.team.h"),content:t("about.team.p"),children:e.jsx(i,{href:"https://github.com/orgs/open-pv/people",isExternal:!0,color:"teal",children:t("about.team.link")})}),e.jsx(c,{heading:t("about.sponsors.h"),content:t("about.sponsors.p")}),e.jsx(j,{images:["images/about/ptf.png","images/about/bmbf.jpg"],links:["https://prototypefund.de/","https://www.bmbf.de"],objectFit:"contain"})]})})]})}),e.jsx(I,{})]})};function c({content:t,heading:s,children:n}){return e.jsxs(f,{children:[e.jsx(w,{as:"h3",size:"md",children:s}),e.jsx(x,{children:t}),n]})}const j=({images:t,links:s=[],objectFit:n="cover"})=>e.jsx(y,{columns:t.length,spacing:4,children:t.map((a,o)=>{const r=e.jsx($,{src:a,objectFit:n,width:"100%",height:"150px",borderRadius:"md"});return e.jsx(f,{padding:2,children:s[o]?e.jsx(i,{href:s[o],isExternal:!0,children:r}):r},o)})});export{U as default}; diff --git a/assets/Datenschutz-DDnbcbeD.js b/assets/Datenschutz-BPm9eaoX.js similarity index 98% rename from assets/Datenschutz-DDnbcbeD.js rename to assets/Datenschutz-BPm9eaoX.js index 1d55397..ef746d5 100644 --- a/assets/Datenschutz-DDnbcbeD.js +++ b/assets/Datenschutz-BPm9eaoX.js @@ -1 +1 @@ -import{j as e,M as n}from"./index-CNMbRSP0.js";import{C as r,a as i,H as t,b as s}from"./heading-BaecBvU5.js";const a=()=>e.jsx(n,{title:"Datenschutz",description:"Datenschutzerklaerung der Website.",children:e.jsxs(r,{height:"100%",overflow:"auto",children:[e.jsx(i,{children:e.jsx(t,{children:"Datenschutz"})}),e.jsxs(s,{children:[e.jsx("h1",{children:"Datenschutzerklärung"}),e.jsx("p",{children:"Verantwortlicher im Sinne der Datenschutzgesetze, insbesondere der EU-Datenschutzgrundverordnung (DSGVO), ist:"}),e.jsxs("p",{children:["Großhauser Heidler Kotthoff Pöppel GbR ",e.jsx("br",{}),"p r i v a c y @ o p e n p v . d e"]}),e.jsx("h2",{children:"Ihre Betroffenenrechte"}),e.jsx("p",{children:"Unter den angegebenen Kontaktdaten unseres Datenschutzbeauftragten können Sie jederzeit folgende Rechte ausüben:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Auskunft über Ihre bei uns gespeicherten Daten und deren Verarbeitung (Art. 15 DSGVO),"}),e.jsx("li",{children:"Berichtigung unrichtiger personenbezogener Daten (Art. 16 DSGVO),"}),e.jsx("li",{children:"Löschung Ihrer bei uns gespeicherten Daten (Art. 17 DSGVO),"}),e.jsx("li",{children:"Einschränkung der Datenverarbeitung, sofern wir Ihre Daten aufgrund gesetzlicher Pflichten noch nicht löschen dürfen (Art. 18 DSGVO),"}),e.jsx("li",{children:"Widerspruch gegen die Verarbeitung Ihrer Daten bei uns (Art. 21 DSGVO) und"}),e.jsx("li",{children:"Datenübertragbarkeit, sofern Sie in die Datenverarbeitung eingewilligt haben oder einen Vertrag mit uns abgeschlossen haben (Art. 20 DSGVO)."})]}),e.jsx("p",{children:"Sofern Sie uns eine Einwilligung erteilt haben, können Sie diese jederzeit mit Wirkung für die Zukunft widerrufen."}),e.jsx("p",{children:"Sie können sich jederzeit mit einer Beschwerde an eine Aufsichtsbehörde wenden, z. B. an die zuständige Aufsichtsbehörde des Bundeslands Ihres Wohnsitzes oder an die für uns als verantwortliche Stelle zuständige Behörde."}),e.jsxs("p",{children:["Eine Liste der Aufsichtsbehörden (für den nichtöffentlichen Bereich) mit Anschrift finden Sie unter:"," ",e.jsx("a",{href:"https://www.bfdi.bund.de/DE/Service/Anschriften/Laender/Laender-node.html",target:"_blank",rel:"noopener nofollow",children:"https://www.bfdi.bund.de/DE/Service/Anschriften/Laender/Laender-node.html"}),"."]}),e.jsx("p",{}),e.jsx("h2",{children:"Erfassung allgemeiner Informationen beim Besuch unserer Website"}),e.jsx("h3",{children:"Art und Zweck der Verarbeitung:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Verkehrsdaten (wie zB IP-Adresse): Wenn Sie auf unsere Website zugreifen, werden automatisch Informationen allgemeiner Natur erfasst. Diese Informationen (Server-Logfiles) beinhalten die Art des Webbrowsers, das verwendete Betriebssystem, den Domainnamen Ihres Internet-Service-Providers, Ihre IP-Adresse und ähnliches. Ohne die IP-Adresse ist der Dienst und die Funktionsfähigkeit unserer Website nicht gewährleistet. Zudem können einzelne Dienste und Services nicht verfügbar oder eingeschränkt sein. Der Zweck dieser Datenverarbeitung ist die Sicherstellung eines problemlosen Verbindungsaufbaus der Website, Sicherstellung einer reibungslosen Nutzung unserer Website, Auswertung der Systemsicherheit und -stabilität sowie zur Optimierung unserer Website."}),e.jsx("li",{children:'Adresse und Koordinaten: Die Adresse, welche Sie in die Suchmaske eingeben, wird an Nominatim zur Koordinatenermittlung übermittelt. Weitere Infos zu Nominatim finden Sie unter dem Abschnitt "Plugins und Tools". Zur automatischen Adressvervollständigung wird die Eingabe in das Suchfeld an https://photon.komoot.io/ gesendet. Weitere Infos zu Photon von Komoot finden Sie unter dem Abschnitt "Plugins und Tools". Die Koordinaten werden verwendet, um die relevanten Gebäude und Geländedaten von unserem Server zu laden. Die genauen Koordinaten werden nicht auf unserem Server gespeichert. Zu statistischen Zwecken und zur Optimierung unseres Angebotes speichern wir die Region (gerundete Koordinaten) der angefragten Adresse (aufgelöst auf wenige Kilometer).'})]}),e.jsx("p",{children:"Wir verwenden Ihre Daten nicht, um Rückschlüsse auf Ihre Person zu ziehen."}),e.jsx("h3",{children:"Rechtsgrundlage und berechtigtes Interesse:"}),e.jsx("p",{children:"Die Verarbeitung erfolgt gemäß Art. 6 Abs. 1 lit. f DSGVO auf Basis unseres berechtigten Interesses an der Verbesserung der Stabilität und Funktionalität unserer Website."}),e.jsx("h3",{children:"Empfänger:"}),e.jsx("p",{children:"Empfänger der Daten sind technische Dienstleister, die den Betrieb unserer Server ermöglichen. Diese Dienstleister sind die netcup GmbH und Hetzner Online GmbH."}),e.jsx("h3",{children:"Drittlandtransfer:"}),e.jsx("p",{children:"Unsere eigene Datenverarbeitung findet in Deutschland statt. Für die Konvertierung von Adresse in Koordinaten werden Daten über Nominatim in Drittländern (Stand August 2024: Niederlande und UK) verarbeitet. Eine Auflistung dieser Drittländer finden Sie hier: https://osmfoundation.org/wiki/Privacy_Policy#Where_do_we_store_the_data"}),e.jsx("p",{}),e.jsx("h3",{children:"Speicherdauer:"}),e.jsx("p",{children:"Die Daten werden gelöscht, sobald diese für den Zweck der Erhebung nicht mehr erforderlich sind. Dies ist für die Daten, die der Bereitstellung der Website dienen, grundsätzlich der Fall, wenn die jeweilige Sitzung beendet ist."}),e.jsx("p",{children:"Im Falle der Speicherung der Verkehrsdaten in Logfiles ist dies nach 14 Tagen der Fall, es sei denn, es gibt einen besonderen Grund, Informationen länger aufzubewahren (z.B. wenn einzelne IP-Adressen gesperrt werden)."}),e.jsx("h3",{children:"Plugins und Tools"}),e.jsxs("p",{children:["Nominatim Geocoding ",e.jsx("br",{}),"Diese Seite nutzt über eine API Nominatim, den Geocoding Dienst von OpenStreetMaps.nominatim.openstreetmap.org Zur Nutzung der GeoCodingFunktion bei der Umwandlung ihrer Adresse in Koordinaten werden die eingegebenen Adressdaten an Nominatim zur Koordinatenermittlung übermittelt. Die Nutzung von Nominatim erfolgt im Interesse einer ansprechenden Darstellung unserer Online-Angebote und an einer leichten Auffindbarkeit der von uns simulierten PV-Erträge auf der Website. Dies stellt ein berechtigtes Interesse im Sinne von Art. 6 Abs. 1 lit. f DSGVO dar. Mehr Informationen zum Umgang mit Nutzerdaten finden Sie in der Datenschutzerklärung von OpenStreetMaps: https://wiki.osmfoundation.org/wiki/Privacy_Policy"]}),e.jsx("br",{}),e.jsxs("p",{children:["Photon von Komoot ",e.jsx("br",{}),"openpv nutzt die API von komoot zur automatischen Adressvervollständigung. Dabei werden die eingegebenen Buchstaben an https://photon.komoot.io/ gesendet. Die Auswahl einer finalen Adresse wird nicht an komoot mitgeteilt."]}),e.jsx("hr",{}),e.jsx("h2",{children:"Information über Ihr Widerspruchsrecht nach Art. 21 DSGVO"}),e.jsx("h3",{children:"Einzelfallbezogenes Widerspruchsrecht"}),e.jsx("p",{children:"Sie haben das Recht, aus Gründen, die sich aus Ihrer besonderen Situation ergeben, jederzeit gegen die Verarbeitung Sie betreffender personenbezogener Daten, die aufgrund Art. 6 Abs. 1 lit. f DSGVO (Datenverarbeitung auf der Grundlage einer Interessenabwägung) erfolgt, Widerspruch einzulegen."}),e.jsx("p",{children:"Legen Sie Widerspruch ein, werden wir Ihre personenbezogenen Daten nicht mehr verarbeiten, es sei denn, wir können zwingende schutzwürdige Gründe für die Verarbeitung nachweisen, die Ihre Interessen, Rechte und Freiheiten überwiegen, oder die Verarbeitung dient der Geltendmachung, Ausübung oder Verteidigung von Rechtsansprüchen."}),e.jsx("hr",{}),e.jsx("h2",{children:"Änderung unserer Datenschutzbestimmungen"}),e.jsx("p",{children:"Wir behalten uns vor, diese Datenschutzerklärung anzupassen, damit sie stets den aktuellen rechtlichen Anforderungen entspricht oder um Änderungen unserer Leistungen in der Datenschutzerklärung umzusetzen, z.B. bei der Einführung neuer Services. Für Ihren erneuten Besuch gilt dann die neue Datenschutzerklärung."}),e.jsx("h2",{children:"Fragen an den Datenschutzbeauftragten"}),e.jsx("p",{children:"Wenn Sie Fragen zum Datenschutz haben, schreiben Sie uns bitte eine E-Mail oder wenden Sie sich direkt an die für den Datenschutz verantwortliche Person in unserer Organisation:"}),e.jsx("p",{children:e.jsxs("em",{children:["Die Datenschutzerklärung wurde mithilfe der activeMind AG erstellt, den Experten für"," ",e.jsx("a",{href:"https://www.activemind.de/datenschutz/datenschutzbeauftragter/",target:"_blank",rel:"noopener",children:"externe Datenschutzbeauftragte"})," ","(Version #2020-09-30)."]})})]})]})});export{a as default}; +import{j as e,M as n}from"./index-Blxo1hic.js";import{C as r,a as i,H as t,b as s}from"./heading-CX4arv15.js";const a=()=>e.jsx(n,{title:"Datenschutz",description:"Datenschutzerklaerung der Website.",children:e.jsxs(r,{height:"100%",overflow:"auto",children:[e.jsx(i,{children:e.jsx(t,{children:"Datenschutz"})}),e.jsxs(s,{children:[e.jsx("h1",{children:"Datenschutzerklärung"}),e.jsx("p",{children:"Verantwortlicher im Sinne der Datenschutzgesetze, insbesondere der EU-Datenschutzgrundverordnung (DSGVO), ist:"}),e.jsxs("p",{children:["Großhauser Heidler Kotthoff Pöppel GbR ",e.jsx("br",{}),"p r i v a c y @ o p e n p v . d e"]}),e.jsx("h2",{children:"Ihre Betroffenenrechte"}),e.jsx("p",{children:"Unter den angegebenen Kontaktdaten unseres Datenschutzbeauftragten können Sie jederzeit folgende Rechte ausüben:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Auskunft über Ihre bei uns gespeicherten Daten und deren Verarbeitung (Art. 15 DSGVO),"}),e.jsx("li",{children:"Berichtigung unrichtiger personenbezogener Daten (Art. 16 DSGVO),"}),e.jsx("li",{children:"Löschung Ihrer bei uns gespeicherten Daten (Art. 17 DSGVO),"}),e.jsx("li",{children:"Einschränkung der Datenverarbeitung, sofern wir Ihre Daten aufgrund gesetzlicher Pflichten noch nicht löschen dürfen (Art. 18 DSGVO),"}),e.jsx("li",{children:"Widerspruch gegen die Verarbeitung Ihrer Daten bei uns (Art. 21 DSGVO) und"}),e.jsx("li",{children:"Datenübertragbarkeit, sofern Sie in die Datenverarbeitung eingewilligt haben oder einen Vertrag mit uns abgeschlossen haben (Art. 20 DSGVO)."})]}),e.jsx("p",{children:"Sofern Sie uns eine Einwilligung erteilt haben, können Sie diese jederzeit mit Wirkung für die Zukunft widerrufen."}),e.jsx("p",{children:"Sie können sich jederzeit mit einer Beschwerde an eine Aufsichtsbehörde wenden, z. B. an die zuständige Aufsichtsbehörde des Bundeslands Ihres Wohnsitzes oder an die für uns als verantwortliche Stelle zuständige Behörde."}),e.jsxs("p",{children:["Eine Liste der Aufsichtsbehörden (für den nichtöffentlichen Bereich) mit Anschrift finden Sie unter:"," ",e.jsx("a",{href:"https://www.bfdi.bund.de/DE/Service/Anschriften/Laender/Laender-node.html",target:"_blank",rel:"noopener nofollow",children:"https://www.bfdi.bund.de/DE/Service/Anschriften/Laender/Laender-node.html"}),"."]}),e.jsx("p",{}),e.jsx("h2",{children:"Erfassung allgemeiner Informationen beim Besuch unserer Website"}),e.jsx("h3",{children:"Art und Zweck der Verarbeitung:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Verkehrsdaten (wie zB IP-Adresse): Wenn Sie auf unsere Website zugreifen, werden automatisch Informationen allgemeiner Natur erfasst. Diese Informationen (Server-Logfiles) beinhalten die Art des Webbrowsers, das verwendete Betriebssystem, den Domainnamen Ihres Internet-Service-Providers, Ihre IP-Adresse und ähnliches. Ohne die IP-Adresse ist der Dienst und die Funktionsfähigkeit unserer Website nicht gewährleistet. Zudem können einzelne Dienste und Services nicht verfügbar oder eingeschränkt sein. Der Zweck dieser Datenverarbeitung ist die Sicherstellung eines problemlosen Verbindungsaufbaus der Website, Sicherstellung einer reibungslosen Nutzung unserer Website, Auswertung der Systemsicherheit und -stabilität sowie zur Optimierung unserer Website."}),e.jsx("li",{children:'Adresse und Koordinaten: Die Adresse, welche Sie in die Suchmaske eingeben, wird an Nominatim zur Koordinatenermittlung übermittelt. Weitere Infos zu Nominatim finden Sie unter dem Abschnitt "Plugins und Tools". Zur automatischen Adressvervollständigung wird die Eingabe in das Suchfeld an https://photon.komoot.io/ gesendet. Weitere Infos zu Photon von Komoot finden Sie unter dem Abschnitt "Plugins und Tools". Die Koordinaten werden verwendet, um die relevanten Gebäude und Geländedaten von unserem Server zu laden. Die genauen Koordinaten werden nicht auf unserem Server gespeichert. Zu statistischen Zwecken und zur Optimierung unseres Angebotes speichern wir die Region (gerundete Koordinaten) der angefragten Adresse (aufgelöst auf wenige Kilometer).'})]}),e.jsx("p",{children:"Wir verwenden Ihre Daten nicht, um Rückschlüsse auf Ihre Person zu ziehen."}),e.jsx("h3",{children:"Rechtsgrundlage und berechtigtes Interesse:"}),e.jsx("p",{children:"Die Verarbeitung erfolgt gemäß Art. 6 Abs. 1 lit. f DSGVO auf Basis unseres berechtigten Interesses an der Verbesserung der Stabilität und Funktionalität unserer Website."}),e.jsx("h3",{children:"Empfänger:"}),e.jsx("p",{children:"Empfänger der Daten sind technische Dienstleister, die den Betrieb unserer Server ermöglichen. Diese Dienstleister sind die netcup GmbH und Hetzner Online GmbH."}),e.jsx("h3",{children:"Drittlandtransfer:"}),e.jsx("p",{children:"Unsere eigene Datenverarbeitung findet in Deutschland statt. Für die Konvertierung von Adresse in Koordinaten werden Daten über Nominatim in Drittländern (Stand August 2024: Niederlande und UK) verarbeitet. Eine Auflistung dieser Drittländer finden Sie hier: https://osmfoundation.org/wiki/Privacy_Policy#Where_do_we_store_the_data"}),e.jsx("p",{}),e.jsx("h3",{children:"Speicherdauer:"}),e.jsx("p",{children:"Die Daten werden gelöscht, sobald diese für den Zweck der Erhebung nicht mehr erforderlich sind. Dies ist für die Daten, die der Bereitstellung der Website dienen, grundsätzlich der Fall, wenn die jeweilige Sitzung beendet ist."}),e.jsx("p",{children:"Im Falle der Speicherung der Verkehrsdaten in Logfiles ist dies nach 14 Tagen der Fall, es sei denn, es gibt einen besonderen Grund, Informationen länger aufzubewahren (z.B. wenn einzelne IP-Adressen gesperrt werden)."}),e.jsx("h3",{children:"Plugins und Tools"}),e.jsxs("p",{children:["Nominatim Geocoding ",e.jsx("br",{}),"Diese Seite nutzt über eine API Nominatim, den Geocoding Dienst von OpenStreetMaps.nominatim.openstreetmap.org Zur Nutzung der GeoCodingFunktion bei der Umwandlung ihrer Adresse in Koordinaten werden die eingegebenen Adressdaten an Nominatim zur Koordinatenermittlung übermittelt. Die Nutzung von Nominatim erfolgt im Interesse einer ansprechenden Darstellung unserer Online-Angebote und an einer leichten Auffindbarkeit der von uns simulierten PV-Erträge auf der Website. Dies stellt ein berechtigtes Interesse im Sinne von Art. 6 Abs. 1 lit. f DSGVO dar. Mehr Informationen zum Umgang mit Nutzerdaten finden Sie in der Datenschutzerklärung von OpenStreetMaps: https://wiki.osmfoundation.org/wiki/Privacy_Policy"]}),e.jsx("br",{}),e.jsxs("p",{children:["Photon von Komoot ",e.jsx("br",{}),"openpv nutzt die API von komoot zur automatischen Adressvervollständigung. Dabei werden die eingegebenen Buchstaben an https://photon.komoot.io/ gesendet. Die Auswahl einer finalen Adresse wird nicht an komoot mitgeteilt."]}),e.jsx("hr",{}),e.jsx("h2",{children:"Information über Ihr Widerspruchsrecht nach Art. 21 DSGVO"}),e.jsx("h3",{children:"Einzelfallbezogenes Widerspruchsrecht"}),e.jsx("p",{children:"Sie haben das Recht, aus Gründen, die sich aus Ihrer besonderen Situation ergeben, jederzeit gegen die Verarbeitung Sie betreffender personenbezogener Daten, die aufgrund Art. 6 Abs. 1 lit. f DSGVO (Datenverarbeitung auf der Grundlage einer Interessenabwägung) erfolgt, Widerspruch einzulegen."}),e.jsx("p",{children:"Legen Sie Widerspruch ein, werden wir Ihre personenbezogenen Daten nicht mehr verarbeiten, es sei denn, wir können zwingende schutzwürdige Gründe für die Verarbeitung nachweisen, die Ihre Interessen, Rechte und Freiheiten überwiegen, oder die Verarbeitung dient der Geltendmachung, Ausübung oder Verteidigung von Rechtsansprüchen."}),e.jsx("hr",{}),e.jsx("h2",{children:"Änderung unserer Datenschutzbestimmungen"}),e.jsx("p",{children:"Wir behalten uns vor, diese Datenschutzerklärung anzupassen, damit sie stets den aktuellen rechtlichen Anforderungen entspricht oder um Änderungen unserer Leistungen in der Datenschutzerklärung umzusetzen, z.B. bei der Einführung neuer Services. Für Ihren erneuten Besuch gilt dann die neue Datenschutzerklärung."}),e.jsx("h2",{children:"Fragen an den Datenschutzbeauftragten"}),e.jsx("p",{children:"Wenn Sie Fragen zum Datenschutz haben, schreiben Sie uns bitte eine E-Mail oder wenden Sie sich direkt an die für den Datenschutz verantwortliche Person in unserer Organisation:"}),e.jsx("p",{children:e.jsxs("em",{children:["Die Datenschutzerklärung wurde mithilfe der activeMind AG erstellt, den Experten für"," ",e.jsx("a",{href:"https://www.activemind.de/datenschutz/datenschutzbeauftragter/",target:"_blank",rel:"noopener",children:"externe Datenschutzbeauftragte"})," ","(Version #2020-09-30)."]})})]})]})});export{a as default}; diff --git a/assets/Footer-TCVu7l1I.js b/assets/Footer-DvQMRGAB.js similarity index 99% rename from assets/Footer-TCVu7l1I.js rename to assets/Footer-DvQMRGAB.js index b30a302..e541959 100644 --- a/assets/Footer-TCVu7l1I.js +++ b/assets/Footer-DvQMRGAB.js @@ -1,4 +1,4 @@ -import{d as c,i as Hn,Q as Un,S as Vn,T as $n,k as ut,c as N,v as ge,l as I,j as v,H as pe,U as qn,f as O,q as Ft,s as Ue,F as Ae,R as zn,y as Pt,I as Yn,A as ye,P as Xn,V as Kn,m as ie,D as Qn,W as Zn,g as Jn,X as er}from"./index-CNMbRSP0.js";const lt=e=>e?"":void 0,Wo=e=>e?!0:void 0;function J(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function tr(e){return c.Children.toArray(e).filter(t=>c.isValidElement(t))}const nr=e=>e.hasAttribute("tabindex");function rr(e){if(!Hn(e)||Un(e)||Vn(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():$n(e)?!0:nr(e)}const ar=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],or=ar.join(),ir=e=>e.offsetWidth>0&&e.offsetHeight>0;function sr(e){const t=Array.from(e.querySelectorAll(or));return t.unshift(e),t.filter(n=>rr(n)&&ir(n))}function cr(e={}){const{onClose:t,onOpen:n,isOpen:r,id:a}=e,o=ut(n),s=ut(t),[i,m]=c.useState(e.defaultIsOpen||!1),u=r!==void 0?r:i,h=r!==void 0,l=c.useId(),d=a??`disclosure-${l}`,p=c.useCallback(()=>{h||m(!1),s==null||s()},[h,s]),b=c.useCallback(()=>{h||m(!0),o==null||o()},[h,o]),f=c.useCallback(()=>{u?p():b()},[u,b,p]);function g(y={}){return{...y,"aria-expanded":u,"aria-controls":d,onClick(x){var S;(S=y.onClick)==null||S.call(y,x),f()}}}function w(y={}){return{...y,hidden:!u,id:d}}return{isOpen:u,onOpen:b,onClose:p,onToggle:f,isControlled:h,getButtonProps:g,getDisclosureProps:w}}function ur(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Te(...e){return t=>{e.forEach(n=>{ur(n,t)})}}function lr(...e){return c.useMemo(()=>Te(...e),e)}const dt={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Q={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function Ho(e){switch((e==null?void 0:e.direction)??"right"){case"right":return Q.slideRight;case"left":return Q.slideLeft;case"bottom":return Q.slideDown;case"top":return Q.slideUp;default:return Q.slideRight}}const D={enter:{duration:.2,ease:dt.easeOut},exit:{duration:.1,ease:dt.easeIn}},B={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},dr=N("div");dr.displayName="Box";const[Uo,fr]=ge({strict:!1,name:"ButtonGroupContext"});function ee(e){const{children:t,className:n,...r}=e,a=c.isValidElement(t)?c.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=I("chakra-button__icon",n);return v.jsx(N.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o,children:a})}ee.displayName="ButtonIcon";function _e(e){const{label:t,placement:n,spacing:r="0.5rem",children:a=v.jsx(qn,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:s,...i}=e,m=I("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",h=c.useMemo(()=>pe({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...s}),[s,t,u,r]);return v.jsx(N.div,{className:m,...i,__css:h,children:a})}_e.displayName="ButtonSpinner";function vr(e){const[t,n]=c.useState(!e);return{ref:c.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}const Nt=O((e,t)=>{const n=fr(),r=Ft("Button",{...n,...e}),{isDisabled:a=n==null?void 0:n.isDisabled,isLoading:o,isActive:s,children:i,leftIcon:m,rightIcon:u,loadingText:h,iconSpacing:l="0.5rem",type:d,spinner:p,spinnerPlacement:b="start",className:f,as:g,shouldWrapChildren:w,...y}=Ue(e),x=c.useMemo(()=>{const E={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:E}}},[r,n]),{ref:S,type:C}=vr(g),F={rightIcon:u,leftIcon:m,iconSpacing:l,children:i,shouldWrapChildren:w};return v.jsxs(N.button,{disabled:a||o,ref:lr(t,S),as:g,type:d??C,"data-active":lt(s),"data-loading":lt(o),__css:x,className:I("chakra-button",f),...y,children:[o&&b==="start"&&v.jsx(_e,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:l,children:p}),o?h||v.jsx(N.span,{opacity:0,children:v.jsx(ft,{...F})}):v.jsx(ft,{...F}),o&&b==="end"&&v.jsx(_e,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:l,children:p})]})});Nt.displayName="Button";function ft(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:a,shouldWrapChildren:o}=e;return o?v.jsxs("span",{style:{display:"contents"},children:[t&&v.jsx(ee,{marginEnd:a,children:t}),r,n&&v.jsx(ee,{marginStart:a,children:n})]}):v.jsxs(v.Fragment,{children:[t&&v.jsx(ee,{marginEnd:a,children:t}),r,n&&v.jsx(ee,{marginStart:a,children:n})]})}function mr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var Le="data-focus-lock",Et="data-focus-lock-disabled",hr="data-no-focus-lock",pr="data-autofocus-inside",br="data-no-autofocus";function ke(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gr(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var yr=typeof window<"u"?c.useLayoutEffect:c.useEffect,vt=new WeakMap;function It(e,t){var n=gr(null,function(r){return e.forEach(function(a){return ke(a,r)})});return yr(function(){var r=vt.get(n);if(r){var a=new Set(r),o=new Set(e),s=n.current;a.forEach(function(i){o.has(i)||ke(i,null)}),o.forEach(function(i){a.has(i)||ke(i,s)})}vt.set(n,e)},[e]),n}var Fe={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},M=function(){return M=Object.assign||function(t){for(var n,r=1,a=arguments.length;r=0}).sort(jr)},Wr=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Ye=Wr.join(","),Hr="".concat(Ye,", [data-focus-guard]"),$t=function(e,t){return A((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?Hr:Ye)?[r]:[],$t(r))},[])},Ur=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?X([e.contentDocument.body],t):[e]},X=function(e,t){return e.reduce(function(n,r){var a,o=$t(r,t),s=(a=[]).concat.apply(a,o.map(function(i){return Ur(i,t)}));return n.concat(s,r.parentNode?A(r.parentNode.querySelectorAll(Ye)).filter(function(i){return i===r}):[])},[])},Vr=function(e){var t=e.querySelectorAll("[".concat(pr,"]"));return A(t).map(function(n){return X([n])}).reduce(function(n,r){return n.concat(r)},[])},Xe=function(e,t){return A(e).filter(function(n){return Gt(t,n)}).filter(function(n){return Dr(n)})},mt=function(e,t){return t===void 0&&(t=new Map),A(e).filter(function(n){return Wt(t,n)})},Ke=function(e,t,n){return ze(Xe(X(e,n),t),!0,n)},re=function(e,t){return ze(Xe(X(e),t),!1)},$r=function(e,t){return Xe(Vr(e),t)},R=function(e,t){return e.shadowRoot?R(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:A(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var a=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return a?R(a,t):!1}return R(n,t)})},qr=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(a),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(s,i){return!t.has(i)})},qt=function(e){return e.parentNode?qt(e.parentNode):e},Qe=function(e){var t=j(e);return t.filter(Boolean).reduce(function(n,r){var a=r.getAttribute(Le);return n.push.apply(n,a?qr(A(qt(r).querySelectorAll("[".concat(Le,'="').concat(a,'"]:not([').concat(Et,'="disabled"])')))):[r]),n},[])},zr=function(e){try{return e()}catch{return}},ae=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?ae(t.shadowRoot):t instanceof HTMLIFrameElement&&zr(function(){return t.contentWindow.document})?ae(t.contentWindow.document):t}},Yr=function(e,t){return e===t},Xr=function(e,t){return!!A(e.querySelectorAll("iframe")).some(function(n){return Yr(n,t)})},zt=function(e,t){return t===void 0&&(t=ae(Bt(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Qe(e).some(function(n){return R(n,t)||Xr(n,t)})},Kr=function(e){e===void 0&&(e=document);var t=ae(e);return t?A(e.querySelectorAll("[".concat(hr,"]"))).some(function(n){return R(n,t)}):!1},Qr=function(e,t){return t.filter(Vt).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Ze=function(e,t){return Vt(e)&&e.name?Qr(e,t):e},Zr=function(e){var t=new Set;return e.forEach(function(n){return t.add(Ze(n,e))}),e.filter(function(n){return t.has(n)})},ht=function(e){return e[0]&&e.length>1?Ze(e[0],e):e[0]},pt=function(e,t){return e.indexOf(Ze(t,e))},Re="NEW_FOCUS",Jr=function(e,t,n,r,a){var o=e.length,s=e[0],i=e[o-1],m=qe(r);if(!(r&&e.indexOf(r)>=0)){var u=r!==void 0?n.indexOf(r):-1,h=a?n.indexOf(a):u,l=a?e.indexOf(a):-1;if(u===-1)return l!==-1?l:Re;if(l===-1)return Re;var d=u-h,p=n.indexOf(s),b=n.indexOf(i),f=Zr(n),g=r!==void 0?f.indexOf(r):-1,w=g-(a?f.indexOf(a):u);if(!d&&l>=0||t.length===0)return l;var y=pt(e,t[0]),x=pt(e,t[t.length-1]);if(u<=p&&m&&Math.abs(d)>1)return x;if(u>=b&&m&&Math.abs(d)>1)return y;if(d&&Math.abs(w)>1)return l;if(u<=p)return x;if(u>b)return y;if(d)return Math.abs(d)>1?l:(o+l+d)%o}},ea=function(e){return function(t){var n,r=(n=Ht(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},bt=function(e,t,n){var r=e.map(function(o){var s=o.node;return s}),a=mt(r.filter(ea(n)));return a&&a.length?ht(a):ht(mt(t))},je=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&je(e.parentNode.host||e.parentNode,t),t},Pe=function(e,t){for(var n=je(e),r=je(t),a=0;a=0)return o}return!1},Yt=function(e,t,n){var r=j(e),a=j(t),o=r[0],s=!1;return a.filter(Boolean).forEach(function(i){s=Pe(s||i,i)||s,n.filter(Boolean).forEach(function(m){var u=Pe(o,m);u&&(!s||R(u,s)?s=u:s=Pe(u,s))})}),s},gt=function(e,t){return e.reduce(function(n,r){return n.concat($r(r,t))},[])},ta=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(Rr)},na=function(e,t){var n=ae(j(e).length>0?document:Bt(e).ownerDocument),r=Qe(e).filter(Be),a=Yt(n||e,e,r),o=new Map,s=re(r,o),i=s.filter(function(b){var f=b.node;return Be(f)});if(i[0]){var m=re([a],o).map(function(b){var f=b.node;return f}),u=ta(m,i),h=u.map(function(b){var f=b.node;return f}),l=u.filter(function(b){var f=b.tabIndex;return f>=0}).map(function(b){var f=b.node;return f}),d=Jr(h,l,m,n,t);if(d===Re){var p=bt(s,l,gt(r,o))||bt(s,h,gt(r,o));if(p)return{node:p};console.warn("focus-lock: cannot find any node to move focus into");return}return d===void 0?d:u[d]}},ra=function(e){var t=Qe(e).filter(Be),n=Yt(e,e,t),r=ze(X([n],!0),!0,!0),a=X(t,!1);return r.map(function(o){var s=o.node,i=o.index;return{node:s,index:i,lockItem:a.indexOf(s)>=0,guard:qe(s)}})},Je=function(e,t){e&&("focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus())},Ne=0,Ee=!1,Xt=function(e,t,n){n===void 0&&(n={});var r=na(e,t);if(!Ee&&r){if(Ne>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Ee=!0,setTimeout(function(){Ee=!1},1);return}Ne++,Je(r.node,n.focusOptions),Ne--}};function Z(e){if(!e)return null;if(typeof WeakRef>"u")return function(){return e||null};var t=e?new WeakRef(e):null;return function(){return(t==null?void 0:t.deref())||null}}var aa=function(e){if(!e)return null;for(var t=[],n=e;n&&n!==document.body;)t.push({current:Z(n),parent:Z(n.parentElement),left:Z(n.previousElementSibling),right:Z(n.nextElementSibling)}),n=n.parentElement;return{element:Z(e),stack:t,ownerDocument:e.ownerDocument}},oa=function(e){var t,n,r,a,o;if(e)for(var s=e.stack,i=e.ownerDocument,m=new Map,u=0,h=s;u-1&&(g.filter(function(y){var x=y.guard,S=y.node;return x&&S.dataset.focusAutoGuard}).forEach(function(y){var x=y.node;return x.removeAttribute("tabIndex")}),xt(w,g.length,1,g),xt(w,-1,-1,g))}}}return t},tn=function(t){be()&&t&&(t.stopPropagation(),t.preventDefault())},nt=function(){return et(be)},Ca=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||ba(r,n)},ka=function(){return null},nn=function(){tt=!0},rn=function(){tt=!1,oe="just",et(function(){oe="meanwhile"})},Fa=function(){document.addEventListener("focusin",tn),document.addEventListener("focusout",nt),window.addEventListener("focus",nn),window.addEventListener("blur",rn)},Pa=function(){document.removeEventListener("focusin",tn),document.removeEventListener("focusout",nt),window.removeEventListener("focus",nn),window.removeEventListener("blur",rn)};function Na(e){return e.filter(function(t){var n=t.disabled;return!n})}var an={moveFocusInside:Xt,focusInside:zt,focusNextElement:ua,focusPrevElement:la,focusFirstElement:da,focusLastElement:fa,captureFocusRestore:Kt};function Ea(e){var t=e.slice(-1)[0];t&&!q&&Fa();var n=q,r=n&&t&&t.id===n.id;q=t,n&&!r&&(n.onDeactivation(),e.filter(function(a){var o=a.id;return o===n.id}).length||n.returnFocus(!t)),t?(P=null,(!r||n.observed!==t.observed)&&t.onActivation(an),be(),et(be)):(Pa(),P=null)}Lt.assignSyncMedium(Ca);Dt.assignMedium(nt);Sr.assignMedium(function(e){return e(an)});const Ia=Or(Na,Ea)(ka);var Ge=c.forwardRef(function(t,n){return c.createElement($e,Ae({sideCar:Ia,ref:n},t))}),on=$e.propTypes||{};on.sideCar;mr(on,["sideCar"]);Ge.propTypes={};const Oa=Ge.default??Ge,sn=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:a,children:o,isDisabled:s,autoFocus:i,persistentFocus:m,lockFocusAcrossFrames:u}=e,h=c.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&sr(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),l=c.useCallback(()=>{var p;(p=n==null?void 0:n.current)==null||p.focus()},[n]),d=a&&!n;return v.jsx(Oa,{crossFrame:u,persistentFocus:m,autoFocus:i,disabled:s,onActivation:h,onDeactivation:l,returnFocus:d,children:o})};sn.displayName="FocusLock";const[Ma,cn]=ge({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),rt=O(function(t,n){const r=Pt("List",t),{children:a,styleType:o="none",stylePosition:s,spacing:i,...m}=Ue(t),u=tr(a),l=i?{["& > *:not(style) ~ *:not(style)"]:{mt:i}}:{};return v.jsx(Ma,{value:r,children:v.jsx(N.ul,{ref:n,listStyleType:o,listStylePosition:s,role:"list",__css:{...r.container,...l},...m,children:u})})});rt.displayName="List";const Aa=O((e,t)=>{const{as:n,...r}=e;return v.jsx(rt,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});Aa.displayName="OrderedList";const Ta=O(function(t,n){const{as:r,...a}=t;return v.jsx(rt,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...a})});Ta.displayName="UnorderedList";const _a=O(function(t,n){const r=cn();return v.jsx(N.li,{ref:n,...t,__css:r.item})});_a.displayName="ListItem";const La=O(function(t,n){const r=cn();return v.jsx(Yn,{ref:n,role:"presentation",...t,__css:r.icon})});La.displayName="ListIcon";var Da=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},U=new WeakMap,le=new WeakMap,de={},Ie=0,un=function(e){return e&&(e.host||un(e.parentNode))},Ba=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=un(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ra=function(e,t,n,r){var a=Ba(t,Array.isArray(e)?e:[e]);de[n]||(de[n]=new WeakMap);var o=de[n],s=[],i=new Set,m=new Set(a),u=function(l){!l||i.has(l)||(i.add(l),u(l.parentNode))};a.forEach(u);var h=function(l){!l||m.has(l)||Array.prototype.forEach.call(l.children,function(d){if(i.has(d))h(d);else try{var p=d.getAttribute(r),b=p!==null&&p!=="false",f=(U.get(d)||0)+1,g=(o.get(d)||0)+1;U.set(d,f),o.set(d,g),s.push(d),f===1&&b&&le.set(d,!0),g===1&&d.setAttribute(n,"true"),b||d.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",d,w)}})};return h(t),i.clear(),Ie++,function(){s.forEach(function(l){var d=U.get(l)-1,p=o.get(l)-1;U.set(l,d),o.set(l,p),d||(le.has(l)||l.removeAttribute(r),le.delete(l)),p||l.removeAttribute(n)}),Ie--,Ie||(U=new WeakMap,U=new WeakMap,le=new WeakMap,de={})}},ja=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=Da(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),Ra(r,a,n,"aria-hidden")):function(){return null}},Ga=Object.defineProperty,Wa=(e,t,n)=>t in e?Ga(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ha=(e,t,n)=>(Wa(e,t+"",n),n);class Ua{constructor(){Ha(this,"modals"),this.modals=new Set}add(t){return this.modals.add(t),this.modals.size}remove(t){this.modals.delete(t)}isTopModal(t){if(!t)return!1;const n=Array.from(this.modals)[this.modals.size-1];return t===n}}const We=new Ua;function ln(e,t){const[n,r]=c.useState(0);return c.useEffect(()=>{const a=e.current;if(a){if(t){const o=We.add(a);r(o)}return()=>{We.remove(a),r(0)}}},[t,e]),n}function Va(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:a=!0,closeOnEsc:o=!0,useInert:s=!0,onOverlayClick:i,onEsc:m}=e,u=c.useRef(null),h=c.useRef(null),[l,d,p]=qa(r,"chakra-modal","chakra-modal--header","chakra-modal--body");$a(u,t&&s);const b=ln(u,t),f=c.useRef(null),g=c.useCallback(k=>{f.current=k.target},[]),w=c.useCallback(k=>{k.key==="Escape"&&(k.stopPropagation(),o&&(n==null||n()),m==null||m())},[o,n,m]),[y,x]=c.useState(!1),[S,C]=c.useState(!1),F=c.useCallback((k={},K=null)=>({role:"dialog",...k,ref:Te(K,u),id:l,tabIndex:-1,"aria-modal":!0,"aria-labelledby":y?d:void 0,"aria-describedby":S?p:void 0,onClick:J(k.onClick,ce=>ce.stopPropagation())}),[p,S,l,d,y]),E=c.useCallback(k=>{k.stopPropagation(),f.current===k.target&&We.isTopModal(u.current)&&(a&&(n==null||n()),i==null||i())},[n,a,i]),_=c.useCallback((k={},K=null)=>({...k,ref:Te(K,h),onClick:J(k.onClick,E),onKeyDown:J(k.onKeyDown,w),onMouseDown:J(k.onMouseDown,g)}),[w,g,E]);return{isOpen:t,onClose:n,headerId:d,bodyId:p,setBodyMounted:C,setHeaderMounted:x,dialogRef:u,overlayRef:h,getDialogProps:F,getDialogContainerProps:_,index:b}}function $a(e,t){const n=e.current;c.useEffect(()=>{if(!(!e.current||!t))return ja(e.current)},[t,e,n])}function qa(e,...t){const n=c.useId(),r=e||n;return c.useMemo(()=>t.map(a=>`${a}-${r}`),[r,t])}const[za,se]=ge({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Ya,G]=ge({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),dn=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,preserveScrollBarGap:!0,motionPreset:"scale",...e,lockFocusAcrossFrames:e.lockFocusAcrossFrames||!0},{portalProps:n,children:r,autoFocus:a,trapFocus:o,initialFocusRef:s,finalFocusRef:i,returnFocusOnClose:m,blockScrollOnMount:u,allowPinchZoom:h,preserveScrollBarGap:l,motionPreset:d,lockFocusAcrossFrames:p,animatePresenceProps:b,onCloseComplete:f}=t,g=Pt("Modal",t),y={...Va(t),autoFocus:a,trapFocus:o,initialFocusRef:s,finalFocusRef:i,returnFocusOnClose:m,blockScrollOnMount:u,allowPinchZoom:h,preserveScrollBarGap:l,motionPreset:d,lockFocusAcrossFrames:p};return v.jsx(Ya,{value:y,children:v.jsx(za,{value:g,children:v.jsx(ye,{...b,onExitComplete:f,children:y.isOpen&&v.jsx(Xn,{...n,children:r})})})})};dn.displayName="Modal";var me="right-scroll-bar-position",he="width-before-scroll-bar",Xa="with-scroll-bars-hidden",Ka="--removed-body-scroll-bar-size",fn=Tt(),Oe=function(){},xe=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Oe,onWheelCapture:Oe,onTouchMoveCapture:Oe}),a=r[0],o=r[1],s=e.forwardProps,i=e.children,m=e.className,u=e.removeScrollBar,h=e.enabled,l=e.shards,d=e.sideCar,p=e.noIsolation,b=e.inert,f=e.allowPinchZoom,g=e.as,w=g===void 0?"div":g,y=e.gapMode,x=Ot(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=d,C=It([n,t]),F=M(M({},x),a);return c.createElement(c.Fragment,null,h&&c.createElement(S,{sideCar:fn,removeScrollBar:u,shards:l,noIsolation:p,inert:b,setCallbacks:o,allowPinchZoom:!!f,lockRef:n,gapMode:y}),s?c.cloneElement(c.Children.only(i),M(M({},F),{ref:C})):c.createElement(w,M({},F,{className:m,ref:C}),i))});xe.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xe.classNames={fullWidth:he,zeroRight:me};var Qa=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Za(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Qa();return t&&e.setAttribute("nonce",t),e}function Ja(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eo(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var to=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Za())&&(Ja(t,n),eo(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},no=function(){var e=to();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vn=function(){var e=no(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},ro={left:0,top:0,right:0,gap:0},Me=function(e){return parseInt(e||"",10)||0},ao=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Me(n),Me(r),Me(a)]},oo=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ro;var t=ao(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},io=vn(),Y="data-scroll-locked",so=function(e,t,n,r){var a=e.left,o=e.top,s=e.right,i=e.gap;return n===void 0&&(n="margin"),` +import{d as c,i as Hn,Q as Un,S as Vn,T as $n,k as ut,c as N,v as ge,l as I,j as v,H as pe,U as qn,f as O,q as Ft,s as Ue,F as Ae,R as zn,y as Pt,I as Yn,A as ye,P as Xn,V as Kn,m as ie,D as Qn,W as Zn,g as Jn,X as er}from"./index-Blxo1hic.js";const lt=e=>e?"":void 0,Wo=e=>e?!0:void 0;function J(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function tr(e){return c.Children.toArray(e).filter(t=>c.isValidElement(t))}const nr=e=>e.hasAttribute("tabindex");function rr(e){if(!Hn(e)||Un(e)||Vn(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():$n(e)?!0:nr(e)}const ar=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],or=ar.join(),ir=e=>e.offsetWidth>0&&e.offsetHeight>0;function sr(e){const t=Array.from(e.querySelectorAll(or));return t.unshift(e),t.filter(n=>rr(n)&&ir(n))}function cr(e={}){const{onClose:t,onOpen:n,isOpen:r,id:a}=e,o=ut(n),s=ut(t),[i,m]=c.useState(e.defaultIsOpen||!1),u=r!==void 0?r:i,h=r!==void 0,l=c.useId(),d=a??`disclosure-${l}`,p=c.useCallback(()=>{h||m(!1),s==null||s()},[h,s]),b=c.useCallback(()=>{h||m(!0),o==null||o()},[h,o]),f=c.useCallback(()=>{u?p():b()},[u,b,p]);function g(y={}){return{...y,"aria-expanded":u,"aria-controls":d,onClick(x){var S;(S=y.onClick)==null||S.call(y,x),f()}}}function w(y={}){return{...y,hidden:!u,id:d}}return{isOpen:u,onOpen:b,onClose:p,onToggle:f,isControlled:h,getButtonProps:g,getDisclosureProps:w}}function ur(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Te(...e){return t=>{e.forEach(n=>{ur(n,t)})}}function lr(...e){return c.useMemo(()=>Te(...e),e)}const dt={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Q={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function Ho(e){switch((e==null?void 0:e.direction)??"right"){case"right":return Q.slideRight;case"left":return Q.slideLeft;case"bottom":return Q.slideDown;case"top":return Q.slideUp;default:return Q.slideRight}}const D={enter:{duration:.2,ease:dt.easeOut},exit:{duration:.1,ease:dt.easeIn}},B={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},dr=N("div");dr.displayName="Box";const[Uo,fr]=ge({strict:!1,name:"ButtonGroupContext"});function ee(e){const{children:t,className:n,...r}=e,a=c.isValidElement(t)?c.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=I("chakra-button__icon",n);return v.jsx(N.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o,children:a})}ee.displayName="ButtonIcon";function _e(e){const{label:t,placement:n,spacing:r="0.5rem",children:a=v.jsx(qn,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:s,...i}=e,m=I("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",h=c.useMemo(()=>pe({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...s}),[s,t,u,r]);return v.jsx(N.div,{className:m,...i,__css:h,children:a})}_e.displayName="ButtonSpinner";function vr(e){const[t,n]=c.useState(!e);return{ref:c.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}const Nt=O((e,t)=>{const n=fr(),r=Ft("Button",{...n,...e}),{isDisabled:a=n==null?void 0:n.isDisabled,isLoading:o,isActive:s,children:i,leftIcon:m,rightIcon:u,loadingText:h,iconSpacing:l="0.5rem",type:d,spinner:p,spinnerPlacement:b="start",className:f,as:g,shouldWrapChildren:w,...y}=Ue(e),x=c.useMemo(()=>{const E={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:E}}},[r,n]),{ref:S,type:C}=vr(g),F={rightIcon:u,leftIcon:m,iconSpacing:l,children:i,shouldWrapChildren:w};return v.jsxs(N.button,{disabled:a||o,ref:lr(t,S),as:g,type:d??C,"data-active":lt(s),"data-loading":lt(o),__css:x,className:I("chakra-button",f),...y,children:[o&&b==="start"&&v.jsx(_e,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:l,children:p}),o?h||v.jsx(N.span,{opacity:0,children:v.jsx(ft,{...F})}):v.jsx(ft,{...F}),o&&b==="end"&&v.jsx(_e,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:l,children:p})]})});Nt.displayName="Button";function ft(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:a,shouldWrapChildren:o}=e;return o?v.jsxs("span",{style:{display:"contents"},children:[t&&v.jsx(ee,{marginEnd:a,children:t}),r,n&&v.jsx(ee,{marginStart:a,children:n})]}):v.jsxs(v.Fragment,{children:[t&&v.jsx(ee,{marginEnd:a,children:t}),r,n&&v.jsx(ee,{marginStart:a,children:n})]})}function mr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var Le="data-focus-lock",Et="data-focus-lock-disabled",hr="data-no-focus-lock",pr="data-autofocus-inside",br="data-no-autofocus";function ke(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gr(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var yr=typeof window<"u"?c.useLayoutEffect:c.useEffect,vt=new WeakMap;function It(e,t){var n=gr(null,function(r){return e.forEach(function(a){return ke(a,r)})});return yr(function(){var r=vt.get(n);if(r){var a=new Set(r),o=new Set(e),s=n.current;a.forEach(function(i){o.has(i)||ke(i,null)}),o.forEach(function(i){a.has(i)||ke(i,s)})}vt.set(n,e)},[e]),n}var Fe={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},M=function(){return M=Object.assign||function(t){for(var n,r=1,a=arguments.length;r=0}).sort(jr)},Wr=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Ye=Wr.join(","),Hr="".concat(Ye,", [data-focus-guard]"),$t=function(e,t){return A((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?Hr:Ye)?[r]:[],$t(r))},[])},Ur=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?X([e.contentDocument.body],t):[e]},X=function(e,t){return e.reduce(function(n,r){var a,o=$t(r,t),s=(a=[]).concat.apply(a,o.map(function(i){return Ur(i,t)}));return n.concat(s,r.parentNode?A(r.parentNode.querySelectorAll(Ye)).filter(function(i){return i===r}):[])},[])},Vr=function(e){var t=e.querySelectorAll("[".concat(pr,"]"));return A(t).map(function(n){return X([n])}).reduce(function(n,r){return n.concat(r)},[])},Xe=function(e,t){return A(e).filter(function(n){return Gt(t,n)}).filter(function(n){return Dr(n)})},mt=function(e,t){return t===void 0&&(t=new Map),A(e).filter(function(n){return Wt(t,n)})},Ke=function(e,t,n){return ze(Xe(X(e,n),t),!0,n)},re=function(e,t){return ze(Xe(X(e),t),!1)},$r=function(e,t){return Xe(Vr(e),t)},R=function(e,t){return e.shadowRoot?R(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:A(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var a=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return a?R(a,t):!1}return R(n,t)})},qr=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(a),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(s,i){return!t.has(i)})},qt=function(e){return e.parentNode?qt(e.parentNode):e},Qe=function(e){var t=j(e);return t.filter(Boolean).reduce(function(n,r){var a=r.getAttribute(Le);return n.push.apply(n,a?qr(A(qt(r).querySelectorAll("[".concat(Le,'="').concat(a,'"]:not([').concat(Et,'="disabled"])')))):[r]),n},[])},zr=function(e){try{return e()}catch{return}},ae=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?ae(t.shadowRoot):t instanceof HTMLIFrameElement&&zr(function(){return t.contentWindow.document})?ae(t.contentWindow.document):t}},Yr=function(e,t){return e===t},Xr=function(e,t){return!!A(e.querySelectorAll("iframe")).some(function(n){return Yr(n,t)})},zt=function(e,t){return t===void 0&&(t=ae(Bt(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Qe(e).some(function(n){return R(n,t)||Xr(n,t)})},Kr=function(e){e===void 0&&(e=document);var t=ae(e);return t?A(e.querySelectorAll("[".concat(hr,"]"))).some(function(n){return R(n,t)}):!1},Qr=function(e,t){return t.filter(Vt).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Ze=function(e,t){return Vt(e)&&e.name?Qr(e,t):e},Zr=function(e){var t=new Set;return e.forEach(function(n){return t.add(Ze(n,e))}),e.filter(function(n){return t.has(n)})},ht=function(e){return e[0]&&e.length>1?Ze(e[0],e):e[0]},pt=function(e,t){return e.indexOf(Ze(t,e))},Re="NEW_FOCUS",Jr=function(e,t,n,r,a){var o=e.length,s=e[0],i=e[o-1],m=qe(r);if(!(r&&e.indexOf(r)>=0)){var u=r!==void 0?n.indexOf(r):-1,h=a?n.indexOf(a):u,l=a?e.indexOf(a):-1;if(u===-1)return l!==-1?l:Re;if(l===-1)return Re;var d=u-h,p=n.indexOf(s),b=n.indexOf(i),f=Zr(n),g=r!==void 0?f.indexOf(r):-1,w=g-(a?f.indexOf(a):u);if(!d&&l>=0||t.length===0)return l;var y=pt(e,t[0]),x=pt(e,t[t.length-1]);if(u<=p&&m&&Math.abs(d)>1)return x;if(u>=b&&m&&Math.abs(d)>1)return y;if(d&&Math.abs(w)>1)return l;if(u<=p)return x;if(u>b)return y;if(d)return Math.abs(d)>1?l:(o+l+d)%o}},ea=function(e){return function(t){var n,r=(n=Ht(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},bt=function(e,t,n){var r=e.map(function(o){var s=o.node;return s}),a=mt(r.filter(ea(n)));return a&&a.length?ht(a):ht(mt(t))},je=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&je(e.parentNode.host||e.parentNode,t),t},Pe=function(e,t){for(var n=je(e),r=je(t),a=0;a=0)return o}return!1},Yt=function(e,t,n){var r=j(e),a=j(t),o=r[0],s=!1;return a.filter(Boolean).forEach(function(i){s=Pe(s||i,i)||s,n.filter(Boolean).forEach(function(m){var u=Pe(o,m);u&&(!s||R(u,s)?s=u:s=Pe(u,s))})}),s},gt=function(e,t){return e.reduce(function(n,r){return n.concat($r(r,t))},[])},ta=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(Rr)},na=function(e,t){var n=ae(j(e).length>0?document:Bt(e).ownerDocument),r=Qe(e).filter(Be),a=Yt(n||e,e,r),o=new Map,s=re(r,o),i=s.filter(function(b){var f=b.node;return Be(f)});if(i[0]){var m=re([a],o).map(function(b){var f=b.node;return f}),u=ta(m,i),h=u.map(function(b){var f=b.node;return f}),l=u.filter(function(b){var f=b.tabIndex;return f>=0}).map(function(b){var f=b.node;return f}),d=Jr(h,l,m,n,t);if(d===Re){var p=bt(s,l,gt(r,o))||bt(s,h,gt(r,o));if(p)return{node:p};console.warn("focus-lock: cannot find any node to move focus into");return}return d===void 0?d:u[d]}},ra=function(e){var t=Qe(e).filter(Be),n=Yt(e,e,t),r=ze(X([n],!0),!0,!0),a=X(t,!1);return r.map(function(o){var s=o.node,i=o.index;return{node:s,index:i,lockItem:a.indexOf(s)>=0,guard:qe(s)}})},Je=function(e,t){e&&("focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus())},Ne=0,Ee=!1,Xt=function(e,t,n){n===void 0&&(n={});var r=na(e,t);if(!Ee&&r){if(Ne>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Ee=!0,setTimeout(function(){Ee=!1},1);return}Ne++,Je(r.node,n.focusOptions),Ne--}};function Z(e){if(!e)return null;if(typeof WeakRef>"u")return function(){return e||null};var t=e?new WeakRef(e):null;return function(){return(t==null?void 0:t.deref())||null}}var aa=function(e){if(!e)return null;for(var t=[],n=e;n&&n!==document.body;)t.push({current:Z(n),parent:Z(n.parentElement),left:Z(n.previousElementSibling),right:Z(n.nextElementSibling)}),n=n.parentElement;return{element:Z(e),stack:t,ownerDocument:e.ownerDocument}},oa=function(e){var t,n,r,a,o;if(e)for(var s=e.stack,i=e.ownerDocument,m=new Map,u=0,h=s;u-1&&(g.filter(function(y){var x=y.guard,S=y.node;return x&&S.dataset.focusAutoGuard}).forEach(function(y){var x=y.node;return x.removeAttribute("tabIndex")}),xt(w,g.length,1,g),xt(w,-1,-1,g))}}}return t},tn=function(t){be()&&t&&(t.stopPropagation(),t.preventDefault())},nt=function(){return et(be)},Ca=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||ba(r,n)},ka=function(){return null},nn=function(){tt=!0},rn=function(){tt=!1,oe="just",et(function(){oe="meanwhile"})},Fa=function(){document.addEventListener("focusin",tn),document.addEventListener("focusout",nt),window.addEventListener("focus",nn),window.addEventListener("blur",rn)},Pa=function(){document.removeEventListener("focusin",tn),document.removeEventListener("focusout",nt),window.removeEventListener("focus",nn),window.removeEventListener("blur",rn)};function Na(e){return e.filter(function(t){var n=t.disabled;return!n})}var an={moveFocusInside:Xt,focusInside:zt,focusNextElement:ua,focusPrevElement:la,focusFirstElement:da,focusLastElement:fa,captureFocusRestore:Kt};function Ea(e){var t=e.slice(-1)[0];t&&!q&&Fa();var n=q,r=n&&t&&t.id===n.id;q=t,n&&!r&&(n.onDeactivation(),e.filter(function(a){var o=a.id;return o===n.id}).length||n.returnFocus(!t)),t?(P=null,(!r||n.observed!==t.observed)&&t.onActivation(an),be(),et(be)):(Pa(),P=null)}Lt.assignSyncMedium(Ca);Dt.assignMedium(nt);Sr.assignMedium(function(e){return e(an)});const Ia=Or(Na,Ea)(ka);var Ge=c.forwardRef(function(t,n){return c.createElement($e,Ae({sideCar:Ia,ref:n},t))}),on=$e.propTypes||{};on.sideCar;mr(on,["sideCar"]);Ge.propTypes={};const Oa=Ge.default??Ge,sn=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:a,children:o,isDisabled:s,autoFocus:i,persistentFocus:m,lockFocusAcrossFrames:u}=e,h=c.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&sr(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),l=c.useCallback(()=>{var p;(p=n==null?void 0:n.current)==null||p.focus()},[n]),d=a&&!n;return v.jsx(Oa,{crossFrame:u,persistentFocus:m,autoFocus:i,disabled:s,onActivation:h,onDeactivation:l,returnFocus:d,children:o})};sn.displayName="FocusLock";const[Ma,cn]=ge({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),rt=O(function(t,n){const r=Pt("List",t),{children:a,styleType:o="none",stylePosition:s,spacing:i,...m}=Ue(t),u=tr(a),l=i?{["& > *:not(style) ~ *:not(style)"]:{mt:i}}:{};return v.jsx(Ma,{value:r,children:v.jsx(N.ul,{ref:n,listStyleType:o,listStylePosition:s,role:"list",__css:{...r.container,...l},...m,children:u})})});rt.displayName="List";const Aa=O((e,t)=>{const{as:n,...r}=e;return v.jsx(rt,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});Aa.displayName="OrderedList";const Ta=O(function(t,n){const{as:r,...a}=t;return v.jsx(rt,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...a})});Ta.displayName="UnorderedList";const _a=O(function(t,n){const r=cn();return v.jsx(N.li,{ref:n,...t,__css:r.item})});_a.displayName="ListItem";const La=O(function(t,n){const r=cn();return v.jsx(Yn,{ref:n,role:"presentation",...t,__css:r.icon})});La.displayName="ListIcon";var Da=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},U=new WeakMap,le=new WeakMap,de={},Ie=0,un=function(e){return e&&(e.host||un(e.parentNode))},Ba=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=un(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ra=function(e,t,n,r){var a=Ba(t,Array.isArray(e)?e:[e]);de[n]||(de[n]=new WeakMap);var o=de[n],s=[],i=new Set,m=new Set(a),u=function(l){!l||i.has(l)||(i.add(l),u(l.parentNode))};a.forEach(u);var h=function(l){!l||m.has(l)||Array.prototype.forEach.call(l.children,function(d){if(i.has(d))h(d);else try{var p=d.getAttribute(r),b=p!==null&&p!=="false",f=(U.get(d)||0)+1,g=(o.get(d)||0)+1;U.set(d,f),o.set(d,g),s.push(d),f===1&&b&&le.set(d,!0),g===1&&d.setAttribute(n,"true"),b||d.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",d,w)}})};return h(t),i.clear(),Ie++,function(){s.forEach(function(l){var d=U.get(l)-1,p=o.get(l)-1;U.set(l,d),o.set(l,p),d||(le.has(l)||l.removeAttribute(r),le.delete(l)),p||l.removeAttribute(n)}),Ie--,Ie||(U=new WeakMap,U=new WeakMap,le=new WeakMap,de={})}},ja=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=Da(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),Ra(r,a,n,"aria-hidden")):function(){return null}},Ga=Object.defineProperty,Wa=(e,t,n)=>t in e?Ga(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ha=(e,t,n)=>(Wa(e,t+"",n),n);class Ua{constructor(){Ha(this,"modals"),this.modals=new Set}add(t){return this.modals.add(t),this.modals.size}remove(t){this.modals.delete(t)}isTopModal(t){if(!t)return!1;const n=Array.from(this.modals)[this.modals.size-1];return t===n}}const We=new Ua;function ln(e,t){const[n,r]=c.useState(0);return c.useEffect(()=>{const a=e.current;if(a){if(t){const o=We.add(a);r(o)}return()=>{We.remove(a),r(0)}}},[t,e]),n}function Va(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:a=!0,closeOnEsc:o=!0,useInert:s=!0,onOverlayClick:i,onEsc:m}=e,u=c.useRef(null),h=c.useRef(null),[l,d,p]=qa(r,"chakra-modal","chakra-modal--header","chakra-modal--body");$a(u,t&&s);const b=ln(u,t),f=c.useRef(null),g=c.useCallback(k=>{f.current=k.target},[]),w=c.useCallback(k=>{k.key==="Escape"&&(k.stopPropagation(),o&&(n==null||n()),m==null||m())},[o,n,m]),[y,x]=c.useState(!1),[S,C]=c.useState(!1),F=c.useCallback((k={},K=null)=>({role:"dialog",...k,ref:Te(K,u),id:l,tabIndex:-1,"aria-modal":!0,"aria-labelledby":y?d:void 0,"aria-describedby":S?p:void 0,onClick:J(k.onClick,ce=>ce.stopPropagation())}),[p,S,l,d,y]),E=c.useCallback(k=>{k.stopPropagation(),f.current===k.target&&We.isTopModal(u.current)&&(a&&(n==null||n()),i==null||i())},[n,a,i]),_=c.useCallback((k={},K=null)=>({...k,ref:Te(K,h),onClick:J(k.onClick,E),onKeyDown:J(k.onKeyDown,w),onMouseDown:J(k.onMouseDown,g)}),[w,g,E]);return{isOpen:t,onClose:n,headerId:d,bodyId:p,setBodyMounted:C,setHeaderMounted:x,dialogRef:u,overlayRef:h,getDialogProps:F,getDialogContainerProps:_,index:b}}function $a(e,t){const n=e.current;c.useEffect(()=>{if(!(!e.current||!t))return ja(e.current)},[t,e,n])}function qa(e,...t){const n=c.useId(),r=e||n;return c.useMemo(()=>t.map(a=>`${a}-${r}`),[r,t])}const[za,se]=ge({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Ya,G]=ge({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),dn=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,preserveScrollBarGap:!0,motionPreset:"scale",...e,lockFocusAcrossFrames:e.lockFocusAcrossFrames||!0},{portalProps:n,children:r,autoFocus:a,trapFocus:o,initialFocusRef:s,finalFocusRef:i,returnFocusOnClose:m,blockScrollOnMount:u,allowPinchZoom:h,preserveScrollBarGap:l,motionPreset:d,lockFocusAcrossFrames:p,animatePresenceProps:b,onCloseComplete:f}=t,g=Pt("Modal",t),y={...Va(t),autoFocus:a,trapFocus:o,initialFocusRef:s,finalFocusRef:i,returnFocusOnClose:m,blockScrollOnMount:u,allowPinchZoom:h,preserveScrollBarGap:l,motionPreset:d,lockFocusAcrossFrames:p};return v.jsx(Ya,{value:y,children:v.jsx(za,{value:g,children:v.jsx(ye,{...b,onExitComplete:f,children:y.isOpen&&v.jsx(Xn,{...n,children:r})})})})};dn.displayName="Modal";var me="right-scroll-bar-position",he="width-before-scroll-bar",Xa="with-scroll-bars-hidden",Ka="--removed-body-scroll-bar-size",fn=Tt(),Oe=function(){},xe=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Oe,onWheelCapture:Oe,onTouchMoveCapture:Oe}),a=r[0],o=r[1],s=e.forwardProps,i=e.children,m=e.className,u=e.removeScrollBar,h=e.enabled,l=e.shards,d=e.sideCar,p=e.noIsolation,b=e.inert,f=e.allowPinchZoom,g=e.as,w=g===void 0?"div":g,y=e.gapMode,x=Ot(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=d,C=It([n,t]),F=M(M({},x),a);return c.createElement(c.Fragment,null,h&&c.createElement(S,{sideCar:fn,removeScrollBar:u,shards:l,noIsolation:p,inert:b,setCallbacks:o,allowPinchZoom:!!f,lockRef:n,gapMode:y}),s?c.cloneElement(c.Children.only(i),M(M({},F),{ref:C})):c.createElement(w,M({},F,{className:m,ref:C}),i))});xe.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xe.classNames={fullWidth:he,zeroRight:me};var Qa=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Za(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Qa();return t&&e.setAttribute("nonce",t),e}function Ja(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eo(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var to=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Za())&&(Ja(t,n),eo(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},no=function(){var e=to();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vn=function(){var e=no(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},ro={left:0,top:0,right:0,gap:0},Me=function(e){return parseInt(e||"",10)||0},ao=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Me(n),Me(r),Me(a)]},oo=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ro;var t=ao(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},io=vn(),Y="data-scroll-locked",so=function(e,t,n,r){var a=e.left,o=e.top,s=e.right,i=e.gap;return n===void 0&&(n="margin"),` .`.concat(Xa,` { overflow: hidden `).concat(r,`; padding-right: `).concat(i,"px ").concat(r,`; diff --git a/assets/Impressum-Cbmxyvq8.js b/assets/Impressum-DNXAZQkm.js similarity index 97% rename from assets/Impressum-Cbmxyvq8.js rename to assets/Impressum-DNXAZQkm.js index 112fc62..63c6762 100644 --- a/assets/Impressum-Cbmxyvq8.js +++ b/assets/Impressum-DNXAZQkm.js @@ -1 +1 @@ -import{j as e,M as n}from"./index-CNMbRSP0.js";import{C as r,a as t,H as i,b as s}from"./heading-BaecBvU5.js";const l=()=>e.jsx(n,{title:"Impressum",description:"Impressum der Website.",children:e.jsxs(r,{height:"100%",overflow:"auto",children:[e.jsx(t,{children:e.jsx(i,{children:"Impressum"})}),e.jsxs(s,{children:[e.jsxs("p",{children:["Martin Großhauser ",e.jsx("br",{}),"Arnulfstraße 138 ",e.jsx("br",{}),"80634 München ",e.jsx("br",{}),"info@openpv.de ",e.jsx("br",{})]}),e.jsx("h3",{children:"Haftung für Inhalte"}),e.jsx("p",{children:"Alle Inhalte unseres Internetauftritts wurden mit größter Sorgfalt und nach bestem Gewissen erstellt. Für die Richtigkeit, Vollständigkeit und Aktualität der Inhalte können wir jedoch keine Gewähr übernehmen. Als Diensteanbieter sind wir gemäß § 7 Abs.1 TMG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach §§ 8 bis 10 TMG sind wir als Diensteanbieter jedoch nicht verpflichtet, übermittelte oder gespeicherte fremde Informationen zu überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige Tätigkeit hinweisen. Verpflichtungen zur Entfernung oder Sperrung der Nutzung von Informationen nach den allgemeinen Gesetzen bleiben hiervon unberührt. Eine diesbezügliche Haftung ist jedoch erst ab dem Zeitpunkt der Kenntniserlangung einer konkreten Rechtsverletzung möglich. Bei Bekanntwerden von den o.g. Rechtsverletzungen werden wir diese Inhalte unverzüglich entfernen."}),e.jsx("h3",{children:"Haftungsbeschränkung für externe Links"}),e.jsx("p",{children:"Unsere Webseite enthält Links auf externe Webseiten Dritter. Auf die Inhalte dieser direkt oder indirekt verlinkten Webseiten haben wir keinen Einfluss. Daher können wir für die „externen Links“ auch keine Gewähr auf Richtigkeit der Inhalte übernehmen. Für die Inhalte der externen Links sind die jeweilige Anbieter oder Betreiber (Urheber) der Seiten verantwortlich. Die externen Links wurden zum Zeitpunkt der Linksetzung auf eventuelle Rechtsverstöße überprüft und waren im Zeitpunkt der Linksetzung frei von rechtswidrigen Inhalten. Eine ständige inhaltliche Überprüfung der externen Links ist ohne konkrete Anhaltspunkte einer Rechtsverletzung nicht möglich. Bei direkten oder indirekten Verlinkungen auf die Webseiten Dritter, die außerhalb unseres Verantwortungsbereichs liegen, würde eine Haftungsverpflichtung ausschließlich in dem Fall nur bestehen, wenn wir von den Inhalten Kenntnis erlangen und es uns technisch möglich und zumutbar wäre, die Nutzung im Falle rechtswidriger Inhalte zu verhindern. Diese Haftungsausschlusserklärung gilt auch innerhalb des eigenen Internetauftrittes „Name Ihrer Domain“ gesetzten Links und Verweise von Fragestellern, Blogeinträgern, Gästen des Diskussionsforums. Für illegale, fehlerhafte oder unvollständige Inhalte und insbesondere für Schäden, die aus der Nutzung oder Nichtnutzung solcherart dargestellten Informationen entstehen, haftet allein der Diensteanbieter der Seite, auf welche verwiesen wurde, nicht derjenige, der über Links auf die jeweilige Veröffentlichung lediglich verweist. Werden uns Rechtsverletzungen bekannt, werden die externen Links durch uns unverzüglich entfernt."}),e.jsx("h3",{children:"Urheberrecht"}),e.jsx("p",{children:"Die auf unserer Webseite veröffentlichen Inhalte und Werke unterliegen dem deutschen Urheberrecht (http://www.gesetze-im-internet.de/bundesrecht/urhg/gesamt.pdf) . Die Vervielfältigung, Bearbeitung, Verbreitung und jede Art der Verwertung des geistigen Eigentums in ideeller und materieller Sicht des Urhebers außerhalb der Grenzen des Urheberrechtes bedürfen der vorherigen schriftlichen Zustimmung des jeweiligen Urhebers i.S.d. Urhebergesetzes (http://www.gesetze-im-internet.de/bundesrecht/urhg/gesamt.pdf ). Downloads und Kopien dieser Seite sind nur für den privaten und nicht kommerziellen Gebrauch erlaubt. Sind die Inhalte auf unserer Webseite nicht von uns erstellt wurden, sind die Urheberrechte Dritter zu beachten. Die Inhalte Dritter werden als solche kenntlich gemacht. Sollten Sie trotzdem auf eine Urheberrechtsverletzung aufmerksam werden, bitten wir um einen entsprechenden Hinweis. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Inhalte unverzüglich entfernen."})]})]})});export{l as default}; +import{j as e,M as n}from"./index-Blxo1hic.js";import{C as r,a as t,H as i,b as s}from"./heading-CX4arv15.js";const l=()=>e.jsx(n,{title:"Impressum",description:"Impressum der Website.",children:e.jsxs(r,{height:"100%",overflow:"auto",children:[e.jsx(t,{children:e.jsx(i,{children:"Impressum"})}),e.jsxs(s,{children:[e.jsxs("p",{children:["Martin Großhauser ",e.jsx("br",{}),"Arnulfstraße 138 ",e.jsx("br",{}),"80634 München ",e.jsx("br",{}),"info@openpv.de ",e.jsx("br",{})]}),e.jsx("h3",{children:"Haftung für Inhalte"}),e.jsx("p",{children:"Alle Inhalte unseres Internetauftritts wurden mit größter Sorgfalt und nach bestem Gewissen erstellt. Für die Richtigkeit, Vollständigkeit und Aktualität der Inhalte können wir jedoch keine Gewähr übernehmen. Als Diensteanbieter sind wir gemäß § 7 Abs.1 TMG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach §§ 8 bis 10 TMG sind wir als Diensteanbieter jedoch nicht verpflichtet, übermittelte oder gespeicherte fremde Informationen zu überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige Tätigkeit hinweisen. Verpflichtungen zur Entfernung oder Sperrung der Nutzung von Informationen nach den allgemeinen Gesetzen bleiben hiervon unberührt. Eine diesbezügliche Haftung ist jedoch erst ab dem Zeitpunkt der Kenntniserlangung einer konkreten Rechtsverletzung möglich. Bei Bekanntwerden von den o.g. Rechtsverletzungen werden wir diese Inhalte unverzüglich entfernen."}),e.jsx("h3",{children:"Haftungsbeschränkung für externe Links"}),e.jsx("p",{children:"Unsere Webseite enthält Links auf externe Webseiten Dritter. Auf die Inhalte dieser direkt oder indirekt verlinkten Webseiten haben wir keinen Einfluss. Daher können wir für die „externen Links“ auch keine Gewähr auf Richtigkeit der Inhalte übernehmen. Für die Inhalte der externen Links sind die jeweilige Anbieter oder Betreiber (Urheber) der Seiten verantwortlich. Die externen Links wurden zum Zeitpunkt der Linksetzung auf eventuelle Rechtsverstöße überprüft und waren im Zeitpunkt der Linksetzung frei von rechtswidrigen Inhalten. Eine ständige inhaltliche Überprüfung der externen Links ist ohne konkrete Anhaltspunkte einer Rechtsverletzung nicht möglich. Bei direkten oder indirekten Verlinkungen auf die Webseiten Dritter, die außerhalb unseres Verantwortungsbereichs liegen, würde eine Haftungsverpflichtung ausschließlich in dem Fall nur bestehen, wenn wir von den Inhalten Kenntnis erlangen und es uns technisch möglich und zumutbar wäre, die Nutzung im Falle rechtswidriger Inhalte zu verhindern. Diese Haftungsausschlusserklärung gilt auch innerhalb des eigenen Internetauftrittes „Name Ihrer Domain“ gesetzten Links und Verweise von Fragestellern, Blogeinträgern, Gästen des Diskussionsforums. Für illegale, fehlerhafte oder unvollständige Inhalte und insbesondere für Schäden, die aus der Nutzung oder Nichtnutzung solcherart dargestellten Informationen entstehen, haftet allein der Diensteanbieter der Seite, auf welche verwiesen wurde, nicht derjenige, der über Links auf die jeweilige Veröffentlichung lediglich verweist. Werden uns Rechtsverletzungen bekannt, werden die externen Links durch uns unverzüglich entfernt."}),e.jsx("h3",{children:"Urheberrecht"}),e.jsx("p",{children:"Die auf unserer Webseite veröffentlichen Inhalte und Werke unterliegen dem deutschen Urheberrecht (http://www.gesetze-im-internet.de/bundesrecht/urhg/gesamt.pdf) . Die Vervielfältigung, Bearbeitung, Verbreitung und jede Art der Verwertung des geistigen Eigentums in ideeller und materieller Sicht des Urhebers außerhalb der Grenzen des Urheberrechtes bedürfen der vorherigen schriftlichen Zustimmung des jeweiligen Urhebers i.S.d. Urhebergesetzes (http://www.gesetze-im-internet.de/bundesrecht/urhg/gesamt.pdf ). Downloads und Kopien dieser Seite sind nur für den privaten und nicht kommerziellen Gebrauch erlaubt. Sind die Inhalte auf unserer Webseite nicht von uns erstellt wurden, sind die Urheberrechte Dritter zu beachten. Die Inhalte Dritter werden als solche kenntlich gemacht. Sollten Sie trotzdem auf eine Urheberrechtsverletzung aufmerksam werden, bitten wir um einen entsprechenden Hinweis. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Inhalte unverzüglich entfernen."})]})]})});export{l as default}; diff --git a/assets/Map-tZhd2dZT.js b/assets/Map-CLF45QNY.js similarity index 98% rename from assets/Map-tZhd2dZT.js rename to assets/Map-CLF45QNY.js index 5f7b318..cbea5a6 100644 --- a/assets/Map-tZhd2dZT.js +++ b/assets/Map-CLF45QNY.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/maplibre-gl-ppNf9etY.js","assets/index-CNMbRSP0.js","assets/index-BZpzF2_o.css"])))=>i.map(i=>d[i]); -import{f as N,j as d,c as te,t as R,r as I,a as ne,u as oe,b as se,d as i,e as Q,_ as re,g as P,h as ae,M as ie}from"./index-CNMbRSP0.js";import{B as J,T as le,a as j,L as ce,b as ue,u as de,M as fe,c as me,d as he,e as ge,f as pe,g as ve,F as ye}from"./Footer-TCVu7l1I.js";import{I as _e,r as O,M as xe}from"./location-B7jWusd1.js";import{I as be}from"./image-DKhd7Alb.js";const Y=N(function(t,s){const{size:n,centerContent:o=!0,...r}=t,a=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return d.jsx(J,{ref:s,boxSize:n,__css:{...a,flexShrink:0,flexGrow:0},...r})});Y.displayName="Square";const X=N(function(t,s){const{size:n,...o}=t;return d.jsx(Y,{size:n,ref:s,borderRadius:"9999px",...o})});X.displayName="Circle";const ee=N(function(t,s){const{direction:n,align:o,justify:r,wrap:a,basis:l,grow:u,shrink:c,...f}=t,_={display:"flex",flexDirection:n,alignItems:o,justifyContent:r,flexWrap:a,flexBasis:l,flexGrow:u,flexShrink:c};return d.jsx(te.div,{ref:s,__css:_,...f})});ee.displayName="Flex";function Ce(e,t){const s=e??"bottom",o={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[s];return(o==null?void 0:o[t])??s}function Se(e,t){const s=o=>({...t,...o,position:Ce((o==null?void 0:o.position)??(t==null?void 0:t.position),e)}),n=o=>{const r=s(o),a=ne(r);return R.notify(a,r)};return n.update=(o,r)=>{R.update(o,s(r))},n.promise=(o,r)=>{const a=n({...r.loading,status:"loading",duration:null});o.then(l=>n.update(a,{status:"success",duration:5e3,...I(r.success,l)})).catch(l=>n.update(a,{status:"error",duration:5e3,...I(r.error,l)}))},n.closeAll=R.closeAll,n.close=R.close,n.isActive=R.isActive,n}function Me(e){const{theme:t}=oe(),s=se();return i.useMemo(()=>Se(t.direction,{...s,...e}),[e,t.direction,s])}const we=i.createContext(null);function Ee(e,t){const s=Array.isArray(e)?e[0]:e?e.x:0,n=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0;return s===o&&n===r}function M(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let s=0;s{let o=null;"interactive"in n&&(o=Object.assign({},n),delete o.interactive);const r=t[n.ref];if(r){o=o||Object.assign({},n),delete o.ref;for(const a of Re)a in r&&(o[a]=r[a])}return o||n});return{...e,layers:s}}var Z={};const H={version:8,sources:{},layers:[]},q={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},F={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},$={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Te=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],je=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class L{constructor(t,s,n){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=o=>{const r=this.props[$[o.type]];r?r(o):o.type==="error"&&console.error(o.error)},this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const r=this.props[q[o.type]];r&&(this.props.interactiveLayerIds&&o.type!=="mouseover"&&o.type!=="mouseout"&&(o.features=this._hoveredFeatures||this._queryRenderedFeatures(o.point)),r(o),delete o.features)},this._onCameraEvent=o=>{if(!this._internalUpdate){const r=this.props[F[o.type]];r&&r(o)}o.type in this._deferredEvents&&(this._deferredEvents[o.type]=!1)},this._MapClass=t,this.props=s,this._initialize(n)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const s=this.props;this.props=t;const n=this._updateSettings(t,s);n&&this._createShadowTransform(this._map);const o=this._updateSize(t),r=this._updateViewState(t,!0);this._updateStyle(t,s),this._updateStyleComponents(t,s),this._updateHandlers(t,s),(n||o||r&&!this._map.isMoving())&&this.redraw()}static reuse(t,s){const n=L.savedMaps.pop();if(!n)return null;const o=n.map,r=o.getContainer();for(s.className=r.className;r.childNodes.length>0;)s.appendChild(r.childNodes[0]);o._container=s;const a=o._resizeObserver;a&&(a.disconnect(),a.observe(s)),n.setProps({...t,styleDiffing:!1}),o.resize();const{initialViewState:l}=t;return l&&(l.bounds?o.fitBounds(l.bounds,{...l.fitBoundsOptions,duration:0}):n._updateViewState(l,!1)),o.isStyleLoaded()?o.fire("load"):o.once("styledata",()=>o.fire("load")),o._update(),n}_initialize(t){const{props:s}=this,{mapStyle:n=H}=s,o={...s,...s.initialViewState,accessToken:s.mapboxAccessToken||ke()||null,container:t,style:U(n)},r=o.initialViewState||o.viewState||o;if(Object.assign(o,{center:[r.longitude||0,r.latitude||0],zoom:r.zoom||0,pitch:r.pitch||0,bearing:r.bearing||0}),s.gl){const f=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=f,s.gl)}const a=new this._MapClass(o);r.padding&&a.setPadding(r.padding),s.cursor&&(a.getCanvas().style.cursor=s.cursor),this._createShadowTransform(a);const l=a._render;a._render=f=>{this._inRender=!0,l.call(a,f),this._inRender=!1};const u=a._renderTaskQueue.run;a._renderTaskQueue.run=f=>{u.call(a._renderTaskQueue,f),this._onBeforeRepaint()},a.on("render",()=>this._onAfterRepaint());const c=a.fire;a.fire=this._fireEvent.bind(this,c),a.on("resize",()=>{this._renderTransform.resize(a.transform.width,a.transform.height)}),a.on("styledata",()=>{this._updateStyleComponents(this.props,{}),W(a.transform,this._renderTransform)}),a.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const f in q)a.on(f,this._onPointerEvent);for(const f in F)a.on(f,this._onCameraEvent);for(const f in $)a.on(f,this._onEvent);this._map=a}recycle(){const s=this.map.getContainer().querySelector("[mapboxgl-children]");s==null||s.remove(),L.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const s=Le(t.transform);t.painter.transform=s,this._renderTransform=s}_updateSize(t){const{viewState:s}=t;if(s){const n=this._map;if(s.width!==n.transform.width||s.height!==n.transform.height)return n.resize(),!0}return!1}_updateViewState(t,s){if(this._internalUpdate)return!1;const n=this._map,o=this._renderTransform,{zoom:r,pitch:a,bearing:l}=o,u=n.isMoving();u&&(o.cameraElevationReference="sea");const c=V(o,{...B(n.transform),...t});if(u&&(o.cameraElevationReference="ground"),c&&s){const f=this._deferredEvents;f.move=!0,f.zoom||(f.zoom=r!==o.zoom),f.rotate||(f.rotate=l!==o.bearing),f.pitch||(f.pitch=a!==o.pitch)}return u||V(n.transform,t),c}_updateSettings(t,s){const n=this._map;let o=!1;for(const r of Te)if(r in t&&!M(t[r],s[r])){o=!0;const a=n[`set${r[0].toUpperCase()}${r.slice(1)}`];a==null||a.call(n,t[r])}return o}_updateStyle(t,s){if(t.cursor!==s.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==s.mapStyle){const{mapStyle:n=H,styleDiffing:o=!0}=t,r={diff:o};return"localIdeographFontFamily"in t&&(r.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(U(n),r),!0}return!1}_updateStyleComponents(t,s){const n=this._map;let o=!1;return n.isStyleLoaded()&&("light"in t&&n.setLight&&!M(t.light,s.light)&&(o=!0,n.setLight(t.light)),"fog"in t&&n.setFog&&!M(t.fog,s.fog)&&(o=!0,n.setFog(t.fog)),"terrain"in t&&n.setTerrain&&!M(t.terrain,s.terrain)&&(!t.terrain||n.getSource(t.terrain.source))&&(o=!0,n.setTerrain(t.terrain))),o}_updateHandlers(t,s){var n,o;const r=this._map;let a=!1;for(const l of je){const u=(n=t[l])!==null&&n!==void 0?n:!0,c=(o=s[l])!==null&&o!==void 0?o:!0;M(u,c)||(a=!0,u?r[l].enable(u):r[l].disable())}return a}_queryRenderedFeatures(t){const s=this._map,n=s.transform,{interactiveLayerIds:o=[]}=this.props;try{return s.transform=this._renderTransform,s.queryRenderedFeatures(t,{layers:o.filter(s.getLayer.bind(s))})}catch{return[]}finally{s.transform=n}}_updateHover(t){var s;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const r=t.type,a=((s=this._hoveredFeatures)===null||s===void 0?void 0:s.length)>0,l=this._queryRenderedFeatures(t.point),u=l.length>0;!u&&a&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=l,u&&!a&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=r}else this._hoveredFeatures=null}_fireEvent(t,s,n){const o=this._map,r=o.transform,a=typeof s=="string"?s:s.type;return a==="move"&&this._updateViewState(this.props,!1),a in F&&(typeof s=="object"&&(s.viewState=B(r)),this._map.isMoving())?(o.transform=this._renderTransform,t.call(o,s,n),o.transform=r,o):(t.call(o,s,n),o)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const n in this._deferredEvents)this._deferredEvents[n]&&t.fire(n);this._internalUpdate=!1;const s=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{W(this._renderTransform,s),t.transform=s}}}L.savedMaps=[];function ke(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||Z.MapboxAccessToken}catch{}try{e=e||Z.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const Pe=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function ze(e){if(!e)return null;const t=e.map,s={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:n=>{const o=t.transform;t.transform=e.transform;const r=t.project(n);return t.transform=o,r},unproject:n=>{const o=t.transform;t.transform=e.transform;const r=t.unproject(n);return t.transform=o,r},queryTerrainElevation:(n,o)=>{const r=t.transform;t.transform=e.transform;const a=t.queryTerrainElevation(n,o);return t.transform=r,a},queryRenderedFeatures:(n,o)=>{const r=t.transform;t.transform=e.transform;const a=t.queryRenderedFeatures(n,o);return t.transform=r,a}};for(const n of Ae(t))!(n in s)&&!Pe.includes(n)&&(s[n]=t[n].bind(t));return s}function Ae(e){const t=new Set;let s=e;for(;s;){for(const n of Object.getOwnPropertyNames(s))n[0]!=="_"&&typeof e[n]=="function"&&n!=="fire"&&n!=="setEventedParent"&&t.add(n);s=Object.getPrototypeOf(s)}return Array.from(t)}const Fe=typeof document<"u"?i.useLayoutEffect:i.useEffect,Ne=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function De(e,t){for(const n of Ne)n in t&&(e[n]=t[n]);const{RTLTextPlugin:s="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;s&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(s,n=>{n&&console.error(n)},!0)}const z=i.createContext(null);function Ie(e,t,s){const n=i.useContext(we),[o,r]=i.useState(null),a=i.useRef(),{current:l}=i.useRef({mapLib:null,map:null});i.useEffect(()=>{const f=e.mapLib;let _=!0,v;return Promise.resolve(f||s).then(g=>{if(!_)return;if(!g)throw new Error("Invalid mapLib");const p="Map"in g?g:g.default;if(!p.Map)throw new Error("Invalid mapLib");if(De(p,e),!p.supported||p.supported(e))e.reuseMaps&&(v=L.reuse(e,a.current)),v||(v=new L(p.Map,e,a.current)),l.map=ze(v),l.mapLib=p,r(v),n==null||n.onMapMount(l.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(g=>{const{onError:p}=e;p?p({type:"error",target:null,originalEvent:null,error:g}):console.error(g)}),()=>{_=!1,v&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?v.recycle():v.destroy())}},[]),Fe(()=>{o&&o.setProps(e)}),i.useImperativeHandle(t,()=>l.map,[o]);const u=i.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),c={height:"100%"};return i.createElement("div",{id:e.id,ref:a,style:u},o&&i.createElement(z.Provider,{value:l},i.createElement("div",{"mapboxgl-children":"",style:c},e.children)))}const Oe=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function w(e,t){if(!e||!t)return;const s=e.style;for(const n in t){const o=t[n];Number.isFinite(o)&&!Oe.test(n)?s[n]=`${o}px`:s[n]=o}}function We(e,t){const{map:s,mapLib:n}=i.useContext(z),o=i.useRef({props:e});o.current.props=e;const r=i.useMemo(()=>{let S=!1;i.Children.forEach(e.children,m=>{m&&(S=!0)});const E={...e,element:S?document.createElement("div"):null},x=new n.Marker(E);return x.setLngLat([e.longitude,e.latitude]),x.getElement().addEventListener("click",m=>{var h,y;(y=(h=o.current.props).onClick)===null||y===void 0||y.call(h,{type:"click",target:x,originalEvent:m})}),x.on("dragstart",m=>{var h,y;const b=m;b.lngLat=r.getLngLat(),(y=(h=o.current.props).onDragStart)===null||y===void 0||y.call(h,b)}),x.on("drag",m=>{var h,y;const b=m;b.lngLat=r.getLngLat(),(y=(h=o.current.props).onDrag)===null||y===void 0||y.call(h,b)}),x.on("dragend",m=>{var h,y;const b=m;b.lngLat=r.getLngLat(),(y=(h=o.current.props).onDragEnd)===null||y===void 0||y.call(h,b)}),x},[]);i.useEffect(()=>(r.addTo(s.getMap()),()=>{r.remove()}),[]);const{longitude:a,latitude:l,offset:u,style:c,draggable:f=!1,popup:_=null,rotation:v=0,rotationAlignment:g="auto",pitchAlignment:p="auto"}=e;return i.useEffect(()=>{w(r.getElement(),c)},[c]),i.useImperativeHandle(t,()=>r,[]),(r.getLngLat().lng!==a||r.getLngLat().lat!==l)&&r.setLngLat([a,l]),u&&!Ee(r.getOffset(),u)&&r.setOffset(u),r.isDraggable()!==f&&r.setDraggable(f),r.getRotation()!==v&&r.setRotation(v),r.getRotationAlignment()!==g&&r.setRotationAlignment(g),r.getPitchAlignment()!==p&&r.setPitchAlignment(p),r.getPopup()!==_&&r.setPopup(_),Q.createPortal(e.children,r.getElement())}i.memo(i.forwardRef(We));function G(e){return new Set(e?e.trim().split(/\s+/):[])}function Be(e,t){const{map:s,mapLib:n}=i.useContext(z),o=i.useMemo(()=>document.createElement("div"),[]),r=i.useRef({props:e});r.current.props=e;const a=i.useMemo(()=>{const l={...e},u=new n.Popup(l);return u.setLngLat([e.longitude,e.latitude]),u.once("open",c=>{var f,_;(_=(f=r.current.props).onOpen)===null||_===void 0||_.call(f,c)}),u},[]);if(i.useEffect(()=>{const l=u=>{var c,f;(f=(c=r.current.props).onClose)===null||f===void 0||f.call(c,u)};return a.on("close",l),a.setDOMContent(o).addTo(s.getMap()),()=>{a.off("close",l),a.isOpen()&&a.remove()}},[]),i.useEffect(()=>{w(a.getElement(),e.style)},[e.style]),i.useImperativeHandle(t,()=>a,[]),a.isOpen()&&((a.getLngLat().lng!==e.longitude||a.getLngLat().lat!==e.latitude)&&a.setLngLat([e.longitude,e.latitude]),e.offset&&!M(a.options.offset,e.offset)&&a.setOffset(e.offset),(a.options.anchor!==e.anchor||a.options.maxWidth!==e.maxWidth)&&(a.options.anchor=e.anchor,a.setMaxWidth(e.maxWidth)),a.options.className!==e.className)){const l=G(a.options.className),u=G(e.className);for(const c of l)u.has(c)||a.removeClassName(c);for(const c of u)l.has(c)||a.addClassName(c);a.options.className=e.className}return Q.createPortal(e.children,o)}const Ve=i.memo(i.forwardRef(Be));function k(e,t,s,n){const o=i.useContext(z),r=i.useMemo(()=>e(o),[]);return i.useEffect(()=>{const a=t,l=typeof t=="function"&&typeof s=="function"?t:null,u=typeof t=="function"?t:null,{map:c}=o;return c.hasControl(r)||(c.addControl(r,a==null?void 0:a.position),l&&l(o)),()=>{u&&u(o),c.hasControl(r)&&c.removeControl(r)}},[]),r}function Ue(e){const t=k(({mapLib:s})=>new s.AttributionControl(e),{position:e.position});return i.useEffect(()=>{w(t._container,e.style)},[e.style]),null}i.memo(Ue);function Ze(e){const t=k(({mapLib:s})=>new s.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return i.useEffect(()=>{w(t._controlContainer,e.style)},[e.style]),null}i.memo(Ze);function He(e,t){const s=i.useRef({props:e}),n=k(({mapLib:o})=>{const r=new o.GeolocateControl(e),a=r._setupUI;return r._setupUI=l=>{r._container.hasChildNodes()||a(l)},r.on("geolocate",l=>{var u,c;(c=(u=s.current.props).onGeolocate)===null||c===void 0||c.call(u,l)}),r.on("error",l=>{var u,c;(c=(u=s.current.props).onError)===null||c===void 0||c.call(u,l)}),r.on("outofmaxbounds",l=>{var u,c;(c=(u=s.current.props).onOutOfMaxBounds)===null||c===void 0||c.call(u,l)}),r.on("trackuserlocationstart",l=>{var u,c;(c=(u=s.current.props).onTrackUserLocationStart)===null||c===void 0||c.call(u,l)}),r.on("trackuserlocationend",l=>{var u,c;(c=(u=s.current.props).onTrackUserLocationEnd)===null||c===void 0||c.call(u,l)}),r},{position:e.position});return s.current.props=e,i.useImperativeHandle(t,()=>n,[]),i.useEffect(()=>{w(n._container,e.style)},[e.style]),null}i.memo(i.forwardRef(He));function qe(e){const t=k(({mapLib:s})=>new s.NavigationControl(e),{position:e.position});return i.useEffect(()=>{w(t._container,e.style)},[e.style]),null}const $e=i.memo(qe);function Ge(e){const t=k(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),s=i.useRef(e),n=s.current;s.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==n.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==n.unit&&t.setUnit(e.unit),i.useEffect(()=>{w(t._container,o)},[o]),null}i.memo(Ge);const Ke=re(()=>import("./maplibre-gl-ppNf9etY.js").then(e=>e.m),__vite__mapDeps([0,1,2])),Qe=i.forwardRef(function(t,s){return Ie(t,s,Ke)}),Je=Ve,Ye=$e;function K({lat:e,lon:t,display_name:s}){const{t:n}=P(),o=ae(),r=()=>{o(`/simulation/${t}/${e}`)},[a,l]=i.useState(!0);return i.useEffect(()=>{console.log("effect changed"),l(!0)},[e,t]),d.jsx(d.Fragment,{children:a&&d.jsxs(Je,{latitude:e,longitude:t,closeOnClick:!1,onClose:()=>l(!1),children:[d.jsx(le,{children:s}),d.jsx(j,{onClick:r,children:n("startSimulation")})]})})}function Xe({callback:e}){const[t,s]=i.useState(""),[n,o]=i.useState([]),[r,a]=i.useState(!1),[l,u]=i.useState(!1),c=i.useRef([]),f=i.useRef(),_=i.useRef(),[v,g]=i.useState(-1);window.searchFieldInput=t;const{t:p}=P();i.useEffect(()=>{const m=h=>{_.current&&!_.current.contains(h.target)&&(a(!1),g(-1))};return document.addEventListener("mousedown",m),document.addEventListener("touchstart",m),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("touchstart",m)}}),i.useEffect(()=>{const h=setTimeout(async()=>{if(t.length<3&&u(!1),!l){if(t.length>2)try{const y=t.split(" ");let b=null;for(let C of y)if(C[C.length-1]===","&&(C=C.slice(0,-1)),C.length!=5&&/^\d{1,3}[a-zA-Z]?$/.test(C)){b=C;break}const D=await(await fetch(`https://photon.komoot.io/api/?q=${encodeURIComponent(t)}&bbox=5.98865807458,47.3024876979,15.0169958839,54.983104153&limit=5&lang=de&layer=street`)).json();console.log("data",D),o(D.features.map(C=>{let A=C.properties.name;return b&&(A+=" "+b),A+=", "+C.properties.postcode+" "+C.properties.city,A}))}catch(y){console.error("Error fetching suggestions:",y)}else o([]);a(n.length>0)}},200);return()=>clearTimeout(h)},[t,l]);const S=async m=>{m.preventDefault();const h=await O(t);console.warn(h),e(h)},E=m=>{s(m),O(m).then(h=>{console.warn(h),e(h)}),o([]),u(!0)},x=m=>{m.key==="ArrowDown"?(m.preventDefault(),g(h=>hh>-1?h-1:-1)):m.key==="Enter"&&v>-1&&(m.preventDefault(),E(n[v]))};return i.useEffect(()=>{v>-1&&c.current[v]?c.current[v].focus():v===-1&&f.current.focus()},[v]),d.jsxs("form",{ref:_,onSubmit:S,style:{display:"flex",flexDirection:"column",alignItems:"stretch",padding:"5px",position:"relative"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[d.jsx(_e,{ref:f,value:t,placeholder:p("searchField.placeholder"),onChange:m=>s(m.target.value),onKeyDown:x,margin:"5px",autoComplete:"street-address"}),d.jsx(j,{margin:"5px",minWidth:"150px",type:"submit",children:p("Search")})]}),r&&d.jsx(ce,{style:{paddingLeft:"0",marginTop:"0"},borderWidth:1,borderColor:"gray.200",mt:2,position:"absolute",top:"100%",left:0,right:0,zIndex:1,bg:"white",boxShadow:"md",children:n.map((m,h)=>d.jsx(ue,{ref:y=>c.current[h]=y,p:2,style:{paddingLeft:"1em"},cursor:"pointer",_hover:{backgroundColor:"gray.100"},backgroundColor:v===h?"gray.100":"white",onClick:()=>E(m),onKeyDown:x,children:m},h))})]})}function T({image:e,text:t}){return d.jsxs(J,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",children:[e&&d.jsx(be,{src:e.src,alt:e.alt,style:{maxHeight:"200px",width:"auto",margin:"20px"}}),t]})}function et(){const{isOpen:e,onOpen:t,onClose:s}=de({defaultIsOpen:!0}),[n,o]=i.useState(1),{t:r,i18n:a}=P(),l=5,u=()=>{n{n>1&&o(n-1)};return d.jsxs(fe,{isOpen:e,onClose:s,size:"xl",children:[d.jsx(me,{}),d.jsxs(he,{children:[d.jsx(ge,{children:r("WelcomeMessage.title")}),d.jsx(pe,{}),d.jsxs(ve,{children:[n===1&&d.jsx(T,{image:{src:"images/WelcomeMessage1.png",alt:"Screenshot from the Search Input, where some address is written down."},text:r("WelcomeMessage.firstPage")}),n===2&&d.jsx(T,{image:{src:"images/WelcomeMessage2.png",alt:"Screenshot from a possible Simulation Result, where the solar potential of a 3D building is shown."},text:r("WelcomeMessage.secondPage")}),n===3&&d.jsx(T,{image:{src:"images/WelcomeMessage3.png",alt:"Screenshot from a possible Simulation Result, where a PV system was created and the annual result was calculated."},text:r("WelcomeMessage.thirdPage")}),n===4&&d.jsx(T,{image:{src:"images/WelcomeMessage4.png",alt:"Screenshot from a possible Simulation Result, where a PV system was created and the annual result was calculated."},text:r("WelcomeMessage.fourthPage")}),n===5&&d.jsx(T,{text:r("WelcomeMessage.fifthPage")})]}),d.jsxs(xe,{children:[d.jsx(j,{mr:3,onClick:c,isDisabled:n===1,children:r("previous")}),n!=5&&d.jsx(j,{mr:3,onClick:u,isDisabled:n===l,children:r("next")}),n==5&&d.jsx(j,{mr:3,onClick:s,children:r("close")})]}),d.jsx(ee,{justifyContent:"center",mb:4,children:Array.from({length:l},(f,_)=>_+1).map(f=>d.jsx(X,{size:"10px",bg:n===f?"blue.500":"gray.300",m:1},f))})]})]})}function at(){const{t:e}=P(),t=[5.98,47.3,15.1,55],[s,n]=i.useState({bounds:t}),[o,r]=i.useState([]),a=Me(),l=g=>{if(g.length==0)console.error("No search results!"),a({title:e("noSearchResults.title"),description:e("noSearchResults.description"),status:"error",duration:4e3,isClosable:!0});else{g=[g[0]];const p=g.map(x=>x.lon),S=g.map(x=>x.lat),E=[Math.min(...p),Math.min(...S),Math.max(...p),Math.max(...S)];u.current.fitBounds(E,{maxZoom:17,speed:2})}r(g.map(p=>d.jsx(K,{...p},p.key)))},u=i.useRef(),c=i.useCallback(g=>{u.current=g,g!==null&&(g.getMap().dragRotate.disable(),g.getMap().touchZoomRotate.disableRotation())},[]),[f,_]=i.useState(null),v=i.useCallback(g=>{console.log(g);const{lng:p,lat:S}=g.lngLat;_([S,p])});return d.jsxs(ie,{description:e("mainDescription"),children:[d.jsx("header",{children:d.jsx("div",{className:"title",children:d.jsx(Xe,{callback:l})})}),d.jsx(et,{}),d.jsxs("div",{className:"content",children:[d.jsxs(Qe,{ref:c,...s,maxZoom:19,style:{width:"100%",height:"100%"},mapStyle:"https://sgx.geodatenzentrum.de/gdz_basemapde_vektor/styles/bm_web_col.json",onMove:g=>n(g.viewState),onClick:v,attributionControl:!1,maxBounds:[-10,35,30,65],children:[d.jsx(d.Fragment,{children:o}),f&&d.jsx(K,{lat:f[0],lon:f[1],display_name:e("map.userSelection")},"userSelectiion"),d.jsx(Ye,{position:"bottom-right",showCompass:!1})]}),d.jsx(ye,{federalState:"",frontendState:"Map"})]})]})}export{at as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/maplibre-gl-D3WYbw8S.js","assets/index-Blxo1hic.js","assets/index-BZpzF2_o.css"])))=>i.map(i=>d[i]); +import{f as N,j as d,c as te,t as R,r as I,a as ne,u as oe,b as se,d as i,e as Q,_ as re,g as P,h as ae,M as ie}from"./index-Blxo1hic.js";import{B as J,T as le,a as j,L as ce,b as ue,u as de,M as fe,c as me,d as he,e as ge,f as pe,g as ve,F as ye}from"./Footer-DvQMRGAB.js";import{I as _e,r as O,M as xe}from"./location-D9lkPsfw.js";import{I as be}from"./image-BuVSjtYu.js";const Y=N(function(t,s){const{size:n,centerContent:o=!0,...r}=t,a=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return d.jsx(J,{ref:s,boxSize:n,__css:{...a,flexShrink:0,flexGrow:0},...r})});Y.displayName="Square";const X=N(function(t,s){const{size:n,...o}=t;return d.jsx(Y,{size:n,ref:s,borderRadius:"9999px",...o})});X.displayName="Circle";const ee=N(function(t,s){const{direction:n,align:o,justify:r,wrap:a,basis:l,grow:u,shrink:c,...f}=t,_={display:"flex",flexDirection:n,alignItems:o,justifyContent:r,flexWrap:a,flexBasis:l,flexGrow:u,flexShrink:c};return d.jsx(te.div,{ref:s,__css:_,...f})});ee.displayName="Flex";function Ce(e,t){const s=e??"bottom",o={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[s];return(o==null?void 0:o[t])??s}function Se(e,t){const s=o=>({...t,...o,position:Ce((o==null?void 0:o.position)??(t==null?void 0:t.position),e)}),n=o=>{const r=s(o),a=ne(r);return R.notify(a,r)};return n.update=(o,r)=>{R.update(o,s(r))},n.promise=(o,r)=>{const a=n({...r.loading,status:"loading",duration:null});o.then(l=>n.update(a,{status:"success",duration:5e3,...I(r.success,l)})).catch(l=>n.update(a,{status:"error",duration:5e3,...I(r.error,l)}))},n.closeAll=R.closeAll,n.close=R.close,n.isActive=R.isActive,n}function Me(e){const{theme:t}=oe(),s=se();return i.useMemo(()=>Se(t.direction,{...s,...e}),[e,t.direction,s])}const we=i.createContext(null);function Ee(e,t){const s=Array.isArray(e)?e[0]:e?e.x:0,n=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0;return s===o&&n===r}function M(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let s=0;s{let o=null;"interactive"in n&&(o=Object.assign({},n),delete o.interactive);const r=t[n.ref];if(r){o=o||Object.assign({},n),delete o.ref;for(const a of Re)a in r&&(o[a]=r[a])}return o||n});return{...e,layers:s}}var Z={};const H={version:8,sources:{},layers:[]},q={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},F={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},$={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Te=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],je=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class L{constructor(t,s,n){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=o=>{const r=this.props[$[o.type]];r?r(o):o.type==="error"&&console.error(o.error)},this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const r=this.props[q[o.type]];r&&(this.props.interactiveLayerIds&&o.type!=="mouseover"&&o.type!=="mouseout"&&(o.features=this._hoveredFeatures||this._queryRenderedFeatures(o.point)),r(o),delete o.features)},this._onCameraEvent=o=>{if(!this._internalUpdate){const r=this.props[F[o.type]];r&&r(o)}o.type in this._deferredEvents&&(this._deferredEvents[o.type]=!1)},this._MapClass=t,this.props=s,this._initialize(n)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const s=this.props;this.props=t;const n=this._updateSettings(t,s);n&&this._createShadowTransform(this._map);const o=this._updateSize(t),r=this._updateViewState(t,!0);this._updateStyle(t,s),this._updateStyleComponents(t,s),this._updateHandlers(t,s),(n||o||r&&!this._map.isMoving())&&this.redraw()}static reuse(t,s){const n=L.savedMaps.pop();if(!n)return null;const o=n.map,r=o.getContainer();for(s.className=r.className;r.childNodes.length>0;)s.appendChild(r.childNodes[0]);o._container=s;const a=o._resizeObserver;a&&(a.disconnect(),a.observe(s)),n.setProps({...t,styleDiffing:!1}),o.resize();const{initialViewState:l}=t;return l&&(l.bounds?o.fitBounds(l.bounds,{...l.fitBoundsOptions,duration:0}):n._updateViewState(l,!1)),o.isStyleLoaded()?o.fire("load"):o.once("styledata",()=>o.fire("load")),o._update(),n}_initialize(t){const{props:s}=this,{mapStyle:n=H}=s,o={...s,...s.initialViewState,accessToken:s.mapboxAccessToken||ke()||null,container:t,style:U(n)},r=o.initialViewState||o.viewState||o;if(Object.assign(o,{center:[r.longitude||0,r.latitude||0],zoom:r.zoom||0,pitch:r.pitch||0,bearing:r.bearing||0}),s.gl){const f=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=f,s.gl)}const a=new this._MapClass(o);r.padding&&a.setPadding(r.padding),s.cursor&&(a.getCanvas().style.cursor=s.cursor),this._createShadowTransform(a);const l=a._render;a._render=f=>{this._inRender=!0,l.call(a,f),this._inRender=!1};const u=a._renderTaskQueue.run;a._renderTaskQueue.run=f=>{u.call(a._renderTaskQueue,f),this._onBeforeRepaint()},a.on("render",()=>this._onAfterRepaint());const c=a.fire;a.fire=this._fireEvent.bind(this,c),a.on("resize",()=>{this._renderTransform.resize(a.transform.width,a.transform.height)}),a.on("styledata",()=>{this._updateStyleComponents(this.props,{}),W(a.transform,this._renderTransform)}),a.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const f in q)a.on(f,this._onPointerEvent);for(const f in F)a.on(f,this._onCameraEvent);for(const f in $)a.on(f,this._onEvent);this._map=a}recycle(){const s=this.map.getContainer().querySelector("[mapboxgl-children]");s==null||s.remove(),L.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const s=Le(t.transform);t.painter.transform=s,this._renderTransform=s}_updateSize(t){const{viewState:s}=t;if(s){const n=this._map;if(s.width!==n.transform.width||s.height!==n.transform.height)return n.resize(),!0}return!1}_updateViewState(t,s){if(this._internalUpdate)return!1;const n=this._map,o=this._renderTransform,{zoom:r,pitch:a,bearing:l}=o,u=n.isMoving();u&&(o.cameraElevationReference="sea");const c=V(o,{...B(n.transform),...t});if(u&&(o.cameraElevationReference="ground"),c&&s){const f=this._deferredEvents;f.move=!0,f.zoom||(f.zoom=r!==o.zoom),f.rotate||(f.rotate=l!==o.bearing),f.pitch||(f.pitch=a!==o.pitch)}return u||V(n.transform,t),c}_updateSettings(t,s){const n=this._map;let o=!1;for(const r of Te)if(r in t&&!M(t[r],s[r])){o=!0;const a=n[`set${r[0].toUpperCase()}${r.slice(1)}`];a==null||a.call(n,t[r])}return o}_updateStyle(t,s){if(t.cursor!==s.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==s.mapStyle){const{mapStyle:n=H,styleDiffing:o=!0}=t,r={diff:o};return"localIdeographFontFamily"in t&&(r.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(U(n),r),!0}return!1}_updateStyleComponents(t,s){const n=this._map;let o=!1;return n.isStyleLoaded()&&("light"in t&&n.setLight&&!M(t.light,s.light)&&(o=!0,n.setLight(t.light)),"fog"in t&&n.setFog&&!M(t.fog,s.fog)&&(o=!0,n.setFog(t.fog)),"terrain"in t&&n.setTerrain&&!M(t.terrain,s.terrain)&&(!t.terrain||n.getSource(t.terrain.source))&&(o=!0,n.setTerrain(t.terrain))),o}_updateHandlers(t,s){var n,o;const r=this._map;let a=!1;for(const l of je){const u=(n=t[l])!==null&&n!==void 0?n:!0,c=(o=s[l])!==null&&o!==void 0?o:!0;M(u,c)||(a=!0,u?r[l].enable(u):r[l].disable())}return a}_queryRenderedFeatures(t){const s=this._map,n=s.transform,{interactiveLayerIds:o=[]}=this.props;try{return s.transform=this._renderTransform,s.queryRenderedFeatures(t,{layers:o.filter(s.getLayer.bind(s))})}catch{return[]}finally{s.transform=n}}_updateHover(t){var s;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const r=t.type,a=((s=this._hoveredFeatures)===null||s===void 0?void 0:s.length)>0,l=this._queryRenderedFeatures(t.point),u=l.length>0;!u&&a&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=l,u&&!a&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=r}else this._hoveredFeatures=null}_fireEvent(t,s,n){const o=this._map,r=o.transform,a=typeof s=="string"?s:s.type;return a==="move"&&this._updateViewState(this.props,!1),a in F&&(typeof s=="object"&&(s.viewState=B(r)),this._map.isMoving())?(o.transform=this._renderTransform,t.call(o,s,n),o.transform=r,o):(t.call(o,s,n),o)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const n in this._deferredEvents)this._deferredEvents[n]&&t.fire(n);this._internalUpdate=!1;const s=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{W(this._renderTransform,s),t.transform=s}}}L.savedMaps=[];function ke(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||Z.MapboxAccessToken}catch{}try{e=e||Z.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const Pe=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function ze(e){if(!e)return null;const t=e.map,s={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:n=>{const o=t.transform;t.transform=e.transform;const r=t.project(n);return t.transform=o,r},unproject:n=>{const o=t.transform;t.transform=e.transform;const r=t.unproject(n);return t.transform=o,r},queryTerrainElevation:(n,o)=>{const r=t.transform;t.transform=e.transform;const a=t.queryTerrainElevation(n,o);return t.transform=r,a},queryRenderedFeatures:(n,o)=>{const r=t.transform;t.transform=e.transform;const a=t.queryRenderedFeatures(n,o);return t.transform=r,a}};for(const n of Ae(t))!(n in s)&&!Pe.includes(n)&&(s[n]=t[n].bind(t));return s}function Ae(e){const t=new Set;let s=e;for(;s;){for(const n of Object.getOwnPropertyNames(s))n[0]!=="_"&&typeof e[n]=="function"&&n!=="fire"&&n!=="setEventedParent"&&t.add(n);s=Object.getPrototypeOf(s)}return Array.from(t)}const Fe=typeof document<"u"?i.useLayoutEffect:i.useEffect,Ne=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function De(e,t){for(const n of Ne)n in t&&(e[n]=t[n]);const{RTLTextPlugin:s="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;s&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(s,n=>{n&&console.error(n)},!0)}const z=i.createContext(null);function Ie(e,t,s){const n=i.useContext(we),[o,r]=i.useState(null),a=i.useRef(),{current:l}=i.useRef({mapLib:null,map:null});i.useEffect(()=>{const f=e.mapLib;let _=!0,v;return Promise.resolve(f||s).then(g=>{if(!_)return;if(!g)throw new Error("Invalid mapLib");const p="Map"in g?g:g.default;if(!p.Map)throw new Error("Invalid mapLib");if(De(p,e),!p.supported||p.supported(e))e.reuseMaps&&(v=L.reuse(e,a.current)),v||(v=new L(p.Map,e,a.current)),l.map=ze(v),l.mapLib=p,r(v),n==null||n.onMapMount(l.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(g=>{const{onError:p}=e;p?p({type:"error",target:null,originalEvent:null,error:g}):console.error(g)}),()=>{_=!1,v&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?v.recycle():v.destroy())}},[]),Fe(()=>{o&&o.setProps(e)}),i.useImperativeHandle(t,()=>l.map,[o]);const u=i.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),c={height:"100%"};return i.createElement("div",{id:e.id,ref:a,style:u},o&&i.createElement(z.Provider,{value:l},i.createElement("div",{"mapboxgl-children":"",style:c},e.children)))}const Oe=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function w(e,t){if(!e||!t)return;const s=e.style;for(const n in t){const o=t[n];Number.isFinite(o)&&!Oe.test(n)?s[n]=`${o}px`:s[n]=o}}function We(e,t){const{map:s,mapLib:n}=i.useContext(z),o=i.useRef({props:e});o.current.props=e;const r=i.useMemo(()=>{let S=!1;i.Children.forEach(e.children,m=>{m&&(S=!0)});const E={...e,element:S?document.createElement("div"):null},x=new n.Marker(E);return x.setLngLat([e.longitude,e.latitude]),x.getElement().addEventListener("click",m=>{var h,y;(y=(h=o.current.props).onClick)===null||y===void 0||y.call(h,{type:"click",target:x,originalEvent:m})}),x.on("dragstart",m=>{var h,y;const b=m;b.lngLat=r.getLngLat(),(y=(h=o.current.props).onDragStart)===null||y===void 0||y.call(h,b)}),x.on("drag",m=>{var h,y;const b=m;b.lngLat=r.getLngLat(),(y=(h=o.current.props).onDrag)===null||y===void 0||y.call(h,b)}),x.on("dragend",m=>{var h,y;const b=m;b.lngLat=r.getLngLat(),(y=(h=o.current.props).onDragEnd)===null||y===void 0||y.call(h,b)}),x},[]);i.useEffect(()=>(r.addTo(s.getMap()),()=>{r.remove()}),[]);const{longitude:a,latitude:l,offset:u,style:c,draggable:f=!1,popup:_=null,rotation:v=0,rotationAlignment:g="auto",pitchAlignment:p="auto"}=e;return i.useEffect(()=>{w(r.getElement(),c)},[c]),i.useImperativeHandle(t,()=>r,[]),(r.getLngLat().lng!==a||r.getLngLat().lat!==l)&&r.setLngLat([a,l]),u&&!Ee(r.getOffset(),u)&&r.setOffset(u),r.isDraggable()!==f&&r.setDraggable(f),r.getRotation()!==v&&r.setRotation(v),r.getRotationAlignment()!==g&&r.setRotationAlignment(g),r.getPitchAlignment()!==p&&r.setPitchAlignment(p),r.getPopup()!==_&&r.setPopup(_),Q.createPortal(e.children,r.getElement())}i.memo(i.forwardRef(We));function G(e){return new Set(e?e.trim().split(/\s+/):[])}function Be(e,t){const{map:s,mapLib:n}=i.useContext(z),o=i.useMemo(()=>document.createElement("div"),[]),r=i.useRef({props:e});r.current.props=e;const a=i.useMemo(()=>{const l={...e},u=new n.Popup(l);return u.setLngLat([e.longitude,e.latitude]),u.once("open",c=>{var f,_;(_=(f=r.current.props).onOpen)===null||_===void 0||_.call(f,c)}),u},[]);if(i.useEffect(()=>{const l=u=>{var c,f;(f=(c=r.current.props).onClose)===null||f===void 0||f.call(c,u)};return a.on("close",l),a.setDOMContent(o).addTo(s.getMap()),()=>{a.off("close",l),a.isOpen()&&a.remove()}},[]),i.useEffect(()=>{w(a.getElement(),e.style)},[e.style]),i.useImperativeHandle(t,()=>a,[]),a.isOpen()&&((a.getLngLat().lng!==e.longitude||a.getLngLat().lat!==e.latitude)&&a.setLngLat([e.longitude,e.latitude]),e.offset&&!M(a.options.offset,e.offset)&&a.setOffset(e.offset),(a.options.anchor!==e.anchor||a.options.maxWidth!==e.maxWidth)&&(a.options.anchor=e.anchor,a.setMaxWidth(e.maxWidth)),a.options.className!==e.className)){const l=G(a.options.className),u=G(e.className);for(const c of l)u.has(c)||a.removeClassName(c);for(const c of u)l.has(c)||a.addClassName(c);a.options.className=e.className}return Q.createPortal(e.children,o)}const Ve=i.memo(i.forwardRef(Be));function k(e,t,s,n){const o=i.useContext(z),r=i.useMemo(()=>e(o),[]);return i.useEffect(()=>{const a=t,l=typeof t=="function"&&typeof s=="function"?t:null,u=typeof t=="function"?t:null,{map:c}=o;return c.hasControl(r)||(c.addControl(r,a==null?void 0:a.position),l&&l(o)),()=>{u&&u(o),c.hasControl(r)&&c.removeControl(r)}},[]),r}function Ue(e){const t=k(({mapLib:s})=>new s.AttributionControl(e),{position:e.position});return i.useEffect(()=>{w(t._container,e.style)},[e.style]),null}i.memo(Ue);function Ze(e){const t=k(({mapLib:s})=>new s.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return i.useEffect(()=>{w(t._controlContainer,e.style)},[e.style]),null}i.memo(Ze);function He(e,t){const s=i.useRef({props:e}),n=k(({mapLib:o})=>{const r=new o.GeolocateControl(e),a=r._setupUI;return r._setupUI=l=>{r._container.hasChildNodes()||a(l)},r.on("geolocate",l=>{var u,c;(c=(u=s.current.props).onGeolocate)===null||c===void 0||c.call(u,l)}),r.on("error",l=>{var u,c;(c=(u=s.current.props).onError)===null||c===void 0||c.call(u,l)}),r.on("outofmaxbounds",l=>{var u,c;(c=(u=s.current.props).onOutOfMaxBounds)===null||c===void 0||c.call(u,l)}),r.on("trackuserlocationstart",l=>{var u,c;(c=(u=s.current.props).onTrackUserLocationStart)===null||c===void 0||c.call(u,l)}),r.on("trackuserlocationend",l=>{var u,c;(c=(u=s.current.props).onTrackUserLocationEnd)===null||c===void 0||c.call(u,l)}),r},{position:e.position});return s.current.props=e,i.useImperativeHandle(t,()=>n,[]),i.useEffect(()=>{w(n._container,e.style)},[e.style]),null}i.memo(i.forwardRef(He));function qe(e){const t=k(({mapLib:s})=>new s.NavigationControl(e),{position:e.position});return i.useEffect(()=>{w(t._container,e.style)},[e.style]),null}const $e=i.memo(qe);function Ge(e){const t=k(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),s=i.useRef(e),n=s.current;s.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==n.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==n.unit&&t.setUnit(e.unit),i.useEffect(()=>{w(t._container,o)},[o]),null}i.memo(Ge);const Ke=re(()=>import("./maplibre-gl-D3WYbw8S.js").then(e=>e.m),__vite__mapDeps([0,1,2])),Qe=i.forwardRef(function(t,s){return Ie(t,s,Ke)}),Je=Ve,Ye=$e;function K({lat:e,lon:t,display_name:s}){const{t:n}=P(),o=ae(),r=()=>{o(`/simulation/${t}/${e}`)},[a,l]=i.useState(!0);return i.useEffect(()=>{console.log("effect changed"),l(!0)},[e,t]),d.jsx(d.Fragment,{children:a&&d.jsxs(Je,{latitude:e,longitude:t,closeOnClick:!1,onClose:()=>l(!1),children:[d.jsx(le,{children:s}),d.jsx(j,{onClick:r,children:n("startSimulation")})]})})}function Xe({callback:e}){const[t,s]=i.useState(""),[n,o]=i.useState([]),[r,a]=i.useState(!1),[l,u]=i.useState(!1),c=i.useRef([]),f=i.useRef(),_=i.useRef(),[v,g]=i.useState(-1);window.searchFieldInput=t;const{t:p}=P();i.useEffect(()=>{const m=h=>{_.current&&!_.current.contains(h.target)&&(a(!1),g(-1))};return document.addEventListener("mousedown",m),document.addEventListener("touchstart",m),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("touchstart",m)}}),i.useEffect(()=>{const h=setTimeout(async()=>{if(t.length<3&&u(!1),!l){if(t.length>2)try{const y=t.split(" ");let b=null;for(let C of y)if(C[C.length-1]===","&&(C=C.slice(0,-1)),C.length!=5&&/^\d{1,3}[a-zA-Z]?$/.test(C)){b=C;break}const D=await(await fetch(`https://photon.komoot.io/api/?q=${encodeURIComponent(t)}&bbox=5.98865807458,47.3024876979,15.0169958839,54.983104153&limit=5&lang=de&layer=street`)).json();console.log("data",D),o(D.features.map(C=>{let A=C.properties.name;return b&&(A+=" "+b),A+=", "+C.properties.postcode+" "+C.properties.city,A}))}catch(y){console.error("Error fetching suggestions:",y)}else o([]);a(n.length>0)}},200);return()=>clearTimeout(h)},[t,l]);const S=async m=>{m.preventDefault();const h=await O(t);console.warn(h),e(h)},E=m=>{s(m),O(m).then(h=>{console.warn(h),e(h)}),o([]),u(!0)},x=m=>{m.key==="ArrowDown"?(m.preventDefault(),g(h=>hh>-1?h-1:-1)):m.key==="Enter"&&v>-1&&(m.preventDefault(),E(n[v]))};return i.useEffect(()=>{v>-1&&c.current[v]?c.current[v].focus():v===-1&&f.current.focus()},[v]),d.jsxs("form",{ref:_,onSubmit:S,style:{display:"flex",flexDirection:"column",alignItems:"stretch",padding:"5px",position:"relative"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[d.jsx(_e,{ref:f,value:t,placeholder:p("searchField.placeholder"),onChange:m=>s(m.target.value),onKeyDown:x,margin:"5px",autoComplete:"street-address"}),d.jsx(j,{margin:"5px",minWidth:"150px",type:"submit",children:p("Search")})]}),r&&d.jsx(ce,{style:{paddingLeft:"0",marginTop:"0"},borderWidth:1,borderColor:"gray.200",mt:2,position:"absolute",top:"100%",left:0,right:0,zIndex:1,bg:"white",boxShadow:"md",children:n.map((m,h)=>d.jsx(ue,{ref:y=>c.current[h]=y,p:2,style:{paddingLeft:"1em"},cursor:"pointer",_hover:{backgroundColor:"gray.100"},backgroundColor:v===h?"gray.100":"white",onClick:()=>E(m),onKeyDown:x,children:m},h))})]})}function T({image:e,text:t}){return d.jsxs(J,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",children:[e&&d.jsx(be,{src:e.src,alt:e.alt,style:{maxHeight:"200px",width:"auto",margin:"20px"}}),t]})}function et(){const{isOpen:e,onOpen:t,onClose:s}=de({defaultIsOpen:!0}),[n,o]=i.useState(1),{t:r,i18n:a}=P(),l=5,u=()=>{n{n>1&&o(n-1)};return d.jsxs(fe,{isOpen:e,onClose:s,size:"xl",children:[d.jsx(me,{}),d.jsxs(he,{children:[d.jsx(ge,{children:r("WelcomeMessage.title")}),d.jsx(pe,{}),d.jsxs(ve,{children:[n===1&&d.jsx(T,{image:{src:"images/WelcomeMessage1.png",alt:"Screenshot from the Search Input, where some address is written down."},text:r("WelcomeMessage.firstPage")}),n===2&&d.jsx(T,{image:{src:"images/WelcomeMessage2.png",alt:"Screenshot from a possible Simulation Result, where the solar potential of a 3D building is shown."},text:r("WelcomeMessage.secondPage")}),n===3&&d.jsx(T,{image:{src:"images/WelcomeMessage3.png",alt:"Screenshot from a possible Simulation Result, where a PV system was created and the annual result was calculated."},text:r("WelcomeMessage.thirdPage")}),n===4&&d.jsx(T,{image:{src:"images/WelcomeMessage4.png",alt:"Screenshot from a possible Simulation Result, where a PV system was created and the annual result was calculated."},text:r("WelcomeMessage.fourthPage")}),n===5&&d.jsx(T,{text:r("WelcomeMessage.fifthPage")})]}),d.jsxs(xe,{children:[d.jsx(j,{mr:3,onClick:c,isDisabled:n===1,children:r("previous")}),n!=5&&d.jsx(j,{mr:3,onClick:u,isDisabled:n===l,children:r("next")}),n==5&&d.jsx(j,{mr:3,onClick:s,children:r("close")})]}),d.jsx(ee,{justifyContent:"center",mb:4,children:Array.from({length:l},(f,_)=>_+1).map(f=>d.jsx(X,{size:"10px",bg:n===f?"blue.500":"gray.300",m:1},f))})]})]})}function at(){const{t:e}=P(),t=[5.98,47.3,15.1,55],[s,n]=i.useState({bounds:t}),[o,r]=i.useState([]),a=Me(),l=g=>{if(g.length==0)console.error("No search results!"),a({title:e("noSearchResults.title"),description:e("noSearchResults.description"),status:"error",duration:4e3,isClosable:!0});else{g=[g[0]];const p=g.map(x=>x.lon),S=g.map(x=>x.lat),E=[Math.min(...p),Math.min(...S),Math.max(...p),Math.max(...S)];u.current.fitBounds(E,{maxZoom:17,speed:2})}r(g.map(p=>d.jsx(K,{...p},p.key)))},u=i.useRef(),c=i.useCallback(g=>{u.current=g,g!==null&&(g.getMap().dragRotate.disable(),g.getMap().touchZoomRotate.disableRotation())},[]),[f,_]=i.useState(null),v=i.useCallback(g=>{console.log(g);const{lng:p,lat:S}=g.lngLat;_([S,p])});return d.jsxs(ie,{description:e("mainDescription"),children:[d.jsx("header",{children:d.jsx("div",{className:"title",children:d.jsx(Xe,{callback:l})})}),d.jsx(et,{}),d.jsxs("div",{className:"content",children:[d.jsxs(Qe,{ref:c,...s,maxZoom:19,style:{width:"100%",height:"100%"},mapStyle:"https://sgx.geodatenzentrum.de/gdz_basemapde_vektor/styles/bm_web_col.json",onMove:g=>n(g.viewState),onClick:v,attributionControl:!1,maxBounds:[-10,35,30,65],children:[d.jsx(d.Fragment,{children:o}),f&&d.jsx(K,{lat:f[0],lon:f[1],display_name:e("map.userSelection")},"userSelectiion"),d.jsx(Ye,{position:"bottom-right",showCompass:!1})]}),d.jsx(ye,{federalState:"",frontendState:"Map"})]})]})}export{at as default}; diff --git a/assets/NotFound-CAeZ5n7b.js b/assets/NotFound-DuBAwB1-.js similarity index 84% rename from assets/NotFound-CAeZ5n7b.js rename to assets/NotFound-DuBAwB1-.js index 50587ac..7be5004 100644 --- a/assets/NotFound-CAeZ5n7b.js +++ b/assets/NotFound-DuBAwB1-.js @@ -1 +1 @@ -import{j as e,J as n,K as o,L as t}from"./index-CNMbRSP0.js";const r=()=>e.jsx(n,{children:e.jsxs("div",{className:"not-found",children:[e.jsx(o,{title:"404 Not Found",children:e.jsx("meta",{name:"description",content:"The content you are looking for cannot be found."})}),e.jsx("h1",{children:"Page Not Found"}),e.jsxs("p",{children:["Return ",e.jsx(t,{to:"/",children:"home"}),"."]})]})});export{r as default}; +import{j as e,J as n,K as o,L as t}from"./index-Blxo1hic.js";const r=()=>e.jsx(n,{children:e.jsxs("div",{className:"not-found",children:[e.jsx(o,{title:"404 Not Found",children:e.jsx("meta",{name:"description",content:"The content you are looking for cannot be found."})}),e.jsx("h1",{children:"Page Not Found"}),e.jsxs("p",{children:["Return ",e.jsx(t,{to:"/",children:"home"}),"."]})]})});export{r as default}; diff --git a/assets/Simulation-DhU9q6Cl.js b/assets/Simulation-CuB9nlPz.js similarity index 99% rename from assets/Simulation-DhU9q6Cl.js rename to assets/Simulation-CuB9nlPz.js index 5397998..c9aab49 100644 --- a/assets/Simulation-DhU9q6Cl.js +++ b/assets/Simulation-CuB9nlPz.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/raw-Dt1HMqYc.js","assets/basedecoder-DvumDe3Y.js","assets/lzw-DpvbRwG5.js","assets/jpeg-CdeCw_eT.js","assets/deflate-DWOWiK3U.js","assets/index-CNMbRSP0.js","assets/index-BZpzF2_o.css","assets/heading-BaecBvU5.js","assets/Footer-TCVu7l1I.js","assets/location-B7jWusd1.js","assets/stack-u4belbkc.js","assets/packbits-DQnG8s9w.js","assets/lerc-DZUX8qKy.js","assets/webimage-BcnuJlio.js"])))=>i.map(i=>d[i]); -var rI=Object.defineProperty;var aI=(n,t,e)=>t in n?rI(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var ar=(n,t,e)=>aI(n,typeof t!="symbol"?t+"":t,e);import{i as oI,k as vr,d as Z,j as V,A as Nv,m as Ov,l as rs,o as AT,n as Gy,p as TT,f as zi,q as CT,s as gf,c as an,v as k0,w as Fv,x as z0,y as Uv,z as lI,P as cI,g as Ka,I as hI,R as B0,B as yf,_ as pl,C as RT,D as PT,E as uI,F as fI,G as dI,M as pI}from"./index-CNMbRSP0.js";import{C as mI,a as gI,H as yI,b as _I}from"./heading-BaecBvU5.js";import{w as km,h as ou,i as $e,j as Ln,m as za,M as kv,k as kx,l as xI,n as vI,o as MI,p as Vy,u as Qo,a as pr,q as wI,B as aa,c as zv,d as IT,e as Bv,f as Hv,g as Gv,T as Fo,U as LT,b as ko,F as bI}from"./Footer-TCVu7l1I.js";import{u as SI,a as DT,b as EI,c as AI,p as TI,d as zm,F as Wy,I as jy,M as CI,e as RI,x as PI}from"./location-B7jWusd1.js";import{S as II}from"./stack-u4belbkc.js";function LI(n,t,e,i){return n.addEventListener(t,e,i),()=>{n.removeEventListener(t,e,i)}}function DI(n){return n.view??window}function NI(n){const t=DI(n);return typeof t.PointerEvent<"u"&&n instanceof t.PointerEvent?n.pointerType==="mouse":n instanceof t.MouseEvent}function NT(n){return!!n.touches}function OI(n){return NT(n)&&n.touches.length>1}function FI(n,t="page"){const e=n.touches[0]||n.changedTouches[0];return{x:e[`${t}X`],y:e[`${t}Y`]}}function UI(n,t="page"){return{x:n[`${t}X`],y:n[`${t}Y`]}}function OT(n,t="page"){return NT(n)?FI(n,t):UI(n,t)}function kI(n){return t=>{const e=NI(t);(!e||e&&t.button===0)&&n(t)}}function zI(n,t=!1){function e(s){n(s,{point:OT(s)})}return t?kI(e):e}function wm(n,t,e,i){return LI(n,t,zI(e,t==="pointerdown"),i)}function BI(n){const t=parseFloat(n);return typeof t!="number"||Number.isNaN(t)?0:t}function HI(n,t){let e=BI(n);const i=10**(t??10);return e=Math.round(e*i)/i,t?e.toFixed(t):e.toString()}function GI(n){if(!Number.isFinite(n))return 0;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e+=1;return e}function ab(n,t,e){return(n-t)*100/(e-t)}function VI(n,t,e){return(e-t)*n+t}function ob(n,t,e){const i=Math.round((n-t)/e)*e+t,s=GI(e);return HI(i,s)}function Xy(n,t,e){return n==null?n:(e{const{condition:t,message:e}=n};function qy(n,t,e,i){const s=vr(e);return Z.useEffect(()=>{const r=typeof n=="function"?n():n??document;if(!(!e||!r))return r.addEventListener(t,s,i),()=>{r.removeEventListener(t,s,i)}},[t,n,i,s,e]),()=>{const r=typeof n=="function"?n():n??document;r==null||r.removeEventListener(t,s,i)}}function qI(n){const{value:t,defaultValue:e,onChange:i,shouldUpdate:s=(p,m)=>p!==m}=n,r=vr(i),a=vr(s),[o,l]=Z.useState(e),c=t!==void 0,h=c?t:o,u=vr(p=>{const g=typeof p=="function"?p(h):p;a(h,g)&&(c||l(g),r(g))},[c,r,h,a]);return[h,u]}function UT(n){const t=Z.useRef(null);return t.current=n,t}function $I(n,t){if(!n){t(void 0);return}t({width:n.offsetWidth,height:n.offsetHeight});const e=n.ownerDocument.defaultView??window,i=new e.ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const[r]=s;let a,o;if("borderBoxSize"in r){const l=r.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,o=c.blockSize}else a=n.offsetWidth,o=n.offsetHeight;t({width:a,height:o})});return i.observe(n,{box:"border-box"}),()=>i.unobserve(n)}const YI=globalThis!=null&&globalThis.document?Z.useLayoutEffect:Z.useEffect;function ZI(n,t){var s;if(!n||!n.parentElement)return;const e=((s=n.ownerDocument)==null?void 0:s.defaultView)??window,i=new e.MutationObserver(()=>{t()});return i.observe(n.parentElement,{childList:!0}),()=>{i.disconnect()}}function KI({getNodes:n,observeMutation:t=!0}){const[e,i]=Z.useState([]),[s,r]=Z.useState(0);return YI(()=>{const a=n(),o=a.map((l,c)=>$I(l,h=>{i(u=>[...u.slice(0,c),h,...u.slice(c+1)])}));if(t){const l=a[0];o.push(ZI(l,()=>{r(c=>c+1)}))}return()=>{o.forEach(l=>{l==null||l()})}},[s]),e}function JI(n){return typeof n=="object"&&n!==null&&"current"in n}function QI(n){const[t]=KI({observeMutation:!1,getNodes(){return[JI(n)?n.current:n]}});return t}const kT=1/60*1e3,tL=typeof performance<"u"?()=>performance.now():()=>Date.now(),zT=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(tL()),kT);function eL(n){let t=[],e=[],i=0,s=!1,r=!1;const a=new WeakSet,o={schedule:(l,c=!1,h=!1)=>{const u=h&&s,p=u?t:e;return c&&a.add(l),p.indexOf(l)===-1&&(p.push(l),u&&s&&(i=t.length)),l},cancel:l=>{const c=e.indexOf(l);c!==-1&&e.splice(c,1),a.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[t,e]=[e,t],e.length=0,i=t.length,i)for(let c=0;c(n[t]=eL(()=>ku=!0),n),{}),iL=_f.reduce((n,t)=>{const e=H0[t];return n[t]=(i,s=!1,r=!1)=>(ku||aL(),e.schedule(i,s,r)),n},{}),sL=_f.reduce((n,t)=>(n[t]=H0[t].cancel,n),{});_f.reduce((n,t)=>(n[t]=()=>H0[t].process(Pc),n),{});const rL=n=>H0[n].process(Pc),BT=n=>{ku=!1,Pc.delta=zx?kT:Math.max(Math.min(n-Pc.timestamp,nL),1),Pc.timestamp=n,Bx=!0,_f.forEach(rL),Bx=!1,ku&&(zx=!1,zT(BT))},aL=()=>{ku=!0,zx=!0,Bx||zT(BT)},lb=()=>Pc;var oL=Object.defineProperty,lL=(n,t,e)=>t in n?oL(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ps=(n,t,e)=>(lL(n,typeof t!="symbol"?t+"":t,e),e);class cL{constructor(t,e,i){if(Ps(this,"history",[]),Ps(this,"startEvent",null),Ps(this,"lastEvent",null),Ps(this,"lastEventInfo",null),Ps(this,"handlers",{}),Ps(this,"removeListeners",()=>{}),Ps(this,"threshold",3),Ps(this,"win"),Ps(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const o=$y(this.lastEventInfo,this.history),l=this.startEvent!==null,c=dL(o.offset,{x:0,y:0})>=this.threshold;if(!l&&!c)return;const{timestamp:h}=lb();this.history.push({...o.point,timestamp:h});const{onStart:u,onMove:p}=this.handlers;l||(u==null||u(this.lastEvent,o),this.startEvent=this.lastEvent),p==null||p(this.lastEvent,o)}),Ps(this,"onPointerMove",(o,l)=>{this.lastEvent=o,this.lastEventInfo=l,iL.update(this.updatePoint,!0)}),Ps(this,"onPointerUp",(o,l)=>{const c=$y(l,this.history),{onEnd:h,onSessionEnd:u}=this.handlers;u==null||u(o,c),this.end(),!(!h||!this.startEvent)&&(h==null||h(o,c))}),this.win=t.view??window,OI(t))return;this.handlers=e,i&&(this.threshold=i),t.stopPropagation(),t.preventDefault();const s={point:OT(t)},{timestamp:r}=lb();this.history=[{...s.point,timestamp:r}];const{onSessionStart:a}=e;a==null||a(t,$y(s,this.history)),this.removeListeners=fL(wm(this.win,"pointermove",this.onPointerMove),wm(this.win,"pointerup",this.onPointerUp),wm(this.win,"pointercancel",this.onPointerUp))}updateHandlers(t){this.handlers=t}end(){var t;(t=this.removeListeners)==null||t.call(this),sL.update(this.updatePoint)}}function cb(n,t){return{x:n.x-t.x,y:n.y-t.y}}function $y(n,t){return{point:n.point,delta:cb(n.point,t[t.length-1]),offset:cb(n.point,t[0]),velocity:uL(t,.1)}}const hL=n=>n*1e3;function uL(n,t){if(n.length<2)return{x:0,y:0};let e=n.length-1,i=null;const s=n[n.length-1];for(;e>=0&&(i=n[e],!(s.timestamp-i.timestamp>hL(t)));)e--;if(!i)return{x:0,y:0};const r=(s.timestamp-i.timestamp)/1e3;if(r===0)return{x:0,y:0};const a={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function fL(...n){return t=>n.reduce((e,i)=>i(e),t)}function Yy(n,t){return Math.abs(n-t)}function hb(n){return"x"in n&&"y"in n}function dL(n,t){if(typeof n=="number"&&typeof t=="number")return Yy(n,t);if(hb(n)&&hb(t)){const e=Yy(n.x,t.x),i=Yy(n.y,t.y);return Math.sqrt(e**2+i**2)}return 0}function pL(n,t){const{onPan:e,onPanStart:i,onPanEnd:s,onPanSessionStart:r,onPanSessionEnd:a,threshold:o}=t,l=!!(e||i||s||r||a),c=Z.useRef(null),h=UT({onSessionStart:r,onSessionEnd:a,onStart:i,onMove:e,onEnd(u,p){c.current=null,s==null||s(u,p)}});Z.useEffect(()=>{var u;(u=c.current)==null||u.updateHandlers(h.current)}),Z.useEffect(()=>{const u=n.current;if(!u||!l)return;function p(m){c.current=new cL(m,h.current,o)}return wm(u,"pointerdown",p)},[n,l,h,o]),Z.useEffect(()=>()=>{var u;(u=c.current)==null||u.end(),c.current=null},[])}function mL(n,t,e){var i,s;return((s=(i=n.__cssMap)==null?void 0:i[`${t}.${e}`])==null?void 0:s.varRef)??e}const gL=n=>n!=null&&parseInt(n.toString(),10)>0,ub={exit:{height:{duration:.2,ease:ou.ease},opacity:{duration:.3,ease:ou.ease}},enter:{height:{duration:.3,ease:ou.ease},opacity:{duration:.4,ease:ou.ease}}},yL={exit:({animateOpacity:n,startingHeight:t,transition:e,transitionEnd:i,delay:s})=>({...n&&{opacity:gL(t)?1:0},height:t,transitionEnd:i==null?void 0:i.exit,transition:(e==null?void 0:e.exit)??km.exit(ub.exit,s)}),enter:({animateOpacity:n,endingHeight:t,transition:e,transitionEnd:i,delay:s})=>({...n&&{opacity:1},height:t,transitionEnd:i==null?void 0:i.enter,transition:(e==null?void 0:e.enter)??km.enter(ub.enter,s)})},HT=Z.forwardRef((n,t)=>{const{in:e,unmountOnExit:i,animateOpacity:s=!0,startingHeight:r=0,endingHeight:a="auto",style:o,className:l,transition:c,transitionEnd:h,animatePresenceProps:u,...p}=n,[m,g]=Z.useState(!1);Z.useEffect(()=>{const b=setTimeout(()=>{g(!0)});return()=>clearTimeout(b)},[]),XI({condition:Number(r)>0&&!!i,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const x=parseFloat(r.toString())>0,y={startingHeight:r,endingHeight:a,animateOpacity:s,transition:m?c:{enter:{duration:0}},transitionEnd:{enter:h==null?void 0:h.enter,exit:i?h==null?void 0:h.exit:{...h==null?void 0:h.exit,display:x?"block":"none"}}},_=i?e:!0,M=e||i?"enter":"exit";return V.jsx(Nv,{...u,initial:!1,custom:y,children:_&&V.jsx(Ov.div,{ref:t,...p,className:rs("chakra-collapse",l),style:{overflow:"hidden",display:"block",...o},custom:y,variants:yL,initial:i?"exit":!1,animate:M,exit:"exit"})})});HT.displayName="Collapse";var _L=()=>typeof document<"u",fb=!1,xf=null,tl=!1,Hx=!1,Gx=new Set;function Vv(n,t){Gx.forEach(e=>e(n,t))}var xL=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function vL(n){return!(n.metaKey||!xL&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function db(n){tl=!0,vL(n)&&(xf="keyboard",Vv("keyboard",n))}function Nl(n){if(xf="pointer",n.type==="mousedown"||n.type==="pointerdown"){tl=!0;const t=n.composedPath?n.composedPath()[0]:n.target;let e=!1;try{e=t.matches(":focus-visible")}catch{}if(e)return;Vv("pointer",n)}}function ML(n){return n.mozInputSource===0&&n.isTrusted?!0:n.detail===0&&!n.pointerType}function wL(n){ML(n)&&(tl=!0,xf="virtual")}function bL(n){n.target===window||n.target===document||n.target instanceof Element&&n.target.hasAttribute("tabindex")||(!tl&&!Hx&&(xf="virtual",Vv("virtual",n)),tl=!1,Hx=!1)}function SL(){tl=!1,Hx=!0}function pb(){return xf!=="pointer"}function EL(){if(!_L()||fb)return;const{focus:n}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...e){tl=!0,n.apply(this,e)},document.addEventListener("keydown",db,!0),document.addEventListener("keyup",db,!0),document.addEventListener("click",wL,!0),window.addEventListener("focus",bL,!0),window.addEventListener("blur",SL,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Nl,!0),document.addEventListener("pointermove",Nl,!0),document.addEventListener("pointerup",Nl,!0)):(document.addEventListener("mousedown",Nl,!0),document.addEventListener("mousemove",Nl,!0),document.addEventListener("mouseup",Nl,!0)),fb=!0}function AL(n){EL(),n(pb());const t=()=>n(pb());return Gx.add(t),()=>{Gx.delete(t)}}const TL={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function CL(n={}){const t=SI(n),{isDisabled:e,isReadOnly:i,isRequired:s,isInvalid:r,id:a,onBlur:o,onFocus:l,"aria-describedby":c}=t,{defaultChecked:h,isChecked:u,isFocusable:p,onChange:m,isIndeterminate:g,name:x,value:y,tabIndex:_=void 0,"aria-label":M,"aria-labelledby":b,"aria-invalid":S,...P}=n,C=AT(P,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),T=vr(m),L=vr(o),N=vr(l),[E,R]=Z.useState(!1),[z,G]=Z.useState(!1),[W,tt]=Z.useState(!1),[X,at]=Z.useState(!1);Z.useEffect(()=>AL(R),[]);const H=Z.useRef(null),[J,st]=Z.useState(!0),[q,ct]=Z.useState(!!h),mt=u!==void 0,Y=mt?u:q,rt=Z.useCallback(dt=>{if(i||e){dt.preventDefault();return}mt||ct(Y?dt.currentTarget.checked:g?!0:dt.currentTarget.checked),T==null||T(dt)},[i,e,Y,mt,g,T]);Gy(()=>{H.current&&(H.current.indeterminate=!!g)},[g]),TT(()=>{e&&G(!1)},[e,G]),Gy(()=>{const dt=H.current;if(!(dt!=null&&dt.form))return;const St=()=>{ct(!!h)};return dt.form.addEventListener("reset",St),()=>{var Tt;return(Tt=dt.form)==null?void 0:Tt.removeEventListener("reset",St)}},[]);const wt=e&&!p,_t=Z.useCallback(dt=>{dt.key===" "&&at(!0)},[at]),Nt=Z.useCallback(dt=>{dt.key===" "&&at(!1)},[at]);Gy(()=>{if(!H.current)return;H.current.checked!==Y&&ct(H.current.checked)},[H.current]);const Bt=Z.useCallback((dt={},St=null)=>{const Tt=Ht=>{z&&Ht.preventDefault(),at(!0)};return{...dt,ref:St,"data-active":$e(X),"data-hover":$e(W),"data-checked":$e(Y),"data-focus":$e(z),"data-focus-visible":$e(z&&E),"data-indeterminate":$e(g),"data-disabled":$e(e),"data-invalid":$e(r),"data-readonly":$e(i),"aria-hidden":!0,onMouseDown:Ln(dt.onMouseDown,Tt),onMouseUp:Ln(dt.onMouseUp,()=>at(!1)),onMouseEnter:Ln(dt.onMouseEnter,()=>tt(!0)),onMouseLeave:Ln(dt.onMouseLeave,()=>tt(!1))}},[X,Y,e,z,E,W,g,r,i]),Vt=Z.useCallback((dt={},St=null)=>({...dt,ref:St,"data-active":$e(X),"data-hover":$e(W),"data-checked":$e(Y),"data-focus":$e(z),"data-focus-visible":$e(z&&E),"data-indeterminate":$e(g),"data-disabled":$e(e),"data-invalid":$e(r),"data-readonly":$e(i)}),[X,Y,e,z,E,W,g,r,i]),Xt=Z.useCallback((dt={},St=null)=>({...C,...dt,ref:za(St,Tt=>{Tt&&st(Tt.tagName==="LABEL")}),htmlFor:dt.htmlFor!==void 0?dt.htmlFor:J?a:void 0,onClick:Ln(dt.onClick,()=>{var Tt;J||((Tt=H.current)==null||Tt.click(),requestAnimationFrame(()=>{var Ht;(Ht=H.current)==null||Ht.focus({preventScroll:!0})}))}),"data-disabled":$e(e),"data-checked":$e(Y),"data-invalid":$e(r)}),[C,e,Y,r,J,a]),lt=Z.useCallback((dt={},St=null)=>({...dt,ref:za(H,St),type:"checkbox",name:x,value:y,id:a,tabIndex:_,onChange:Ln(dt.onChange,rt),onBlur:Ln(dt.onBlur,L,()=>G(!1)),onFocus:Ln(dt.onFocus,N,()=>G(!0)),onKeyDown:Ln(dt.onKeyDown,_t),onKeyUp:Ln(dt.onKeyUp,Nt),required:s,checked:Y,disabled:wt,readOnly:i,"aria-label":M,"aria-labelledby":b,"aria-invalid":S?!!S:r,"aria-describedby":c,"aria-disabled":e,style:TL}),[x,y,a,rt,L,N,_t,Nt,s,Y,wt,i,M,b,S,r,c,e,_]),U=Z.useCallback((dt={},St=null)=>({...dt,ref:St,onMouseDown:Ln(dt.onMouseDown,RL),"data-disabled":$e(e),"data-checked":$e(Y),"data-invalid":$e(r)}),[Y,e,r]);return{state:{isInvalid:r,isFocused:z,isChecked:Y,isActive:X,isHovered:W,isIndeterminate:g,isDisabled:e,isReadOnly:i,isRequired:s},getRootProps:Xt,getCheckboxProps:Bt,getIndicatorProps:Vt,getInputProps:lt,getLabelProps:U,htmlProps:C}}function RL(n){n.preventDefault(),n.stopPropagation()}const gu=zi(function(t,e){const i=CT("FormLabel",t),s=gf(t),{className:r,children:a,requiredIndicator:o=V.jsx(GT,{}),optionalIndicator:l=null,...c}=s,h=DT(),u=(h==null?void 0:h.getLabelProps(c,e))??{ref:e,...c};return V.jsxs(an.label,{...u,className:rs("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...i},children:[a,h!=null&&h.isRequired?o:l]})});gu.displayName="FormLabel";const GT=zi(function(t,e){const i=DT(),s=EI();if(!(i!=null&&i.isRequired))return null;const r=rs("chakra-form__required-indicator",t.className);return V.jsx(an.span,{...i==null?void 0:i.getRequiredIndicatorProps(t,e),__css:s.requiredIndicator,className:r})});GT.displayName="RequiredIndicator";var Ui="top",ws="bottom",bs="right",ki="left",Wv="auto",vf=[Ui,ws,bs,ki],zc="start",zu="end",PL="clippingParents",VT="viewport",Uh="popper",IL="reference",mb=vf.reduce(function(n,t){return n.concat([t+"-"+zc,t+"-"+zu])},[]),WT=[].concat(vf,[Wv]).reduce(function(n,t){return n.concat([t,t+"-"+zc,t+"-"+zu])},[]),LL="beforeRead",DL="read",NL="afterRead",OL="beforeMain",FL="main",UL="afterMain",kL="beforeWrite",zL="write",BL="afterWrite",HL=[LL,DL,NL,OL,FL,UL,kL,zL,BL];function Cr(n){return n?(n.nodeName||"").toLowerCase():null}function is(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function el(n){var t=is(n).Element;return n instanceof t||n instanceof Element}function Ms(n){var t=is(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function jv(n){if(typeof ShadowRoot>"u")return!1;var t=is(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function GL(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},s=t.attributes[e]||{},r=t.elements[e];!Ms(r)||!Cr(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(a){var o=s[a];o===!1?r.removeAttribute(a):r.setAttribute(a,o===!0?"":o)}))})}function VL(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(i){var s=t.elements[i],r=t.attributes[i]||{},a=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:e[i]),o=a.reduce(function(l,c){return l[c]="",l},{});!Ms(s)||!Cr(s)||(Object.assign(s.style,o),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const WL={name:"applyStyles",enabled:!0,phase:"write",fn:GL,effect:VL,requires:["computeStyles"]};function Mr(n){return n.split("-")[0]}var qo=Math.max,Bm=Math.min,Bc=Math.round;function Vx(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function jT(){return!/^((?!chrome|android).)*safari/i.test(Vx())}function Hc(n,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var i=n.getBoundingClientRect(),s=1,r=1;t&&Ms(n)&&(s=n.offsetWidth>0&&Bc(i.width)/n.offsetWidth||1,r=n.offsetHeight>0&&Bc(i.height)/n.offsetHeight||1);var a=el(n)?is(n):window,o=a.visualViewport,l=!jT()&&e,c=(i.left+(l&&o?o.offsetLeft:0))/s,h=(i.top+(l&&o?o.offsetTop:0))/r,u=i.width/s,p=i.height/r;return{width:u,height:p,top:h,right:c+u,bottom:h+p,left:c,x:c,y:h}}function Xv(n){var t=Hc(n),e=n.offsetWidth,i=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:i}}function XT(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&jv(e)){var i=t;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function oa(n){return is(n).getComputedStyle(n)}function jL(n){return["table","td","th"].indexOf(Cr(n))>=0}function Ja(n){return((el(n)?n.ownerDocument:n.document)||window.document).documentElement}function G0(n){return Cr(n)==="html"?n:n.assignedSlot||n.parentNode||(jv(n)?n.host:null)||Ja(n)}function gb(n){return!Ms(n)||oa(n).position==="fixed"?null:n.offsetParent}function XL(n){var t=/firefox/i.test(Vx()),e=/Trident/i.test(Vx());if(e&&Ms(n)){var i=oa(n);if(i.position==="fixed")return null}var s=G0(n);for(jv(s)&&(s=s.host);Ms(s)&&["html","body"].indexOf(Cr(s))<0;){var r=oa(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function Mf(n){for(var t=is(n),e=gb(n);e&&jL(e)&&oa(e).position==="static";)e=gb(e);return e&&(Cr(e)==="html"||Cr(e)==="body"&&oa(e).position==="static")?t:e||XL(n)||t}function qv(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function yu(n,t,e){return qo(n,Bm(t,e))}function qL(n,t,e){var i=yu(n,t,e);return i>e?e:i}function qT(){return{top:0,right:0,bottom:0,left:0}}function $T(n){return Object.assign({},qT(),n)}function YT(n,t){return t.reduce(function(e,i){return e[i]=n,e},{})}var $L=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,$T(typeof t!="number"?t:YT(t,vf))};function YL(n){var t,e=n.state,i=n.name,s=n.options,r=e.elements.arrow,a=e.modifiersData.popperOffsets,o=Mr(e.placement),l=qv(o),c=[ki,bs].indexOf(o)>=0,h=c?"height":"width";if(!(!r||!a)){var u=$L(s.padding,e),p=Xv(r),m=l==="y"?Ui:ki,g=l==="y"?ws:bs,x=e.rects.reference[h]+e.rects.reference[l]-a[l]-e.rects.popper[h],y=a[l]-e.rects.reference[l],_=Mf(r),M=_?l==="y"?_.clientHeight||0:_.clientWidth||0:0,b=x/2-y/2,S=u[m],P=M-p[h]-u[g],C=M/2-p[h]/2+b,T=yu(S,C,P),L=l;e.modifiersData[i]=(t={},t[L]=T,t.centerOffset=T-C,t)}}function ZL(n){var t=n.state,e=n.options,i=e.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||XT(t.elements.popper,s)&&(t.elements.arrow=s))}const KL={name:"arrow",enabled:!0,phase:"main",fn:YL,effect:ZL,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Gc(n){return n.split("-")[1]}var JL={top:"auto",right:"auto",bottom:"auto",left:"auto"};function QL(n,t){var e=n.x,i=n.y,s=t.devicePixelRatio||1;return{x:Bc(e*s)/s||0,y:Bc(i*s)/s||0}}function yb(n){var t,e=n.popper,i=n.popperRect,s=n.placement,r=n.variation,a=n.offsets,o=n.position,l=n.gpuAcceleration,c=n.adaptive,h=n.roundOffsets,u=n.isFixed,p=a.x,m=p===void 0?0:p,g=a.y,x=g===void 0?0:g,y=typeof h=="function"?h({x:m,y:x}):{x:m,y:x};m=y.x,x=y.y;var _=a.hasOwnProperty("x"),M=a.hasOwnProperty("y"),b=ki,S=Ui,P=window;if(c){var C=Mf(e),T="clientHeight",L="clientWidth";if(C===is(e)&&(C=Ja(e),oa(C).position!=="static"&&o==="absolute"&&(T="scrollHeight",L="scrollWidth")),C=C,s===Ui||(s===ki||s===bs)&&r===zu){S=ws;var N=u&&C===P&&P.visualViewport?P.visualViewport.height:C[T];x-=N-i.height,x*=l?1:-1}if(s===ki||(s===Ui||s===ws)&&r===zu){b=bs;var E=u&&C===P&&P.visualViewport?P.visualViewport.width:C[L];m-=E-i.width,m*=l?1:-1}}var R=Object.assign({position:o},c&&JL),z=h===!0?QL({x:m,y:x},is(e)):{x:m,y:x};if(m=z.x,x=z.y,l){var G;return Object.assign({},R,(G={},G[S]=M?"0":"",G[b]=_?"0":"",G.transform=(P.devicePixelRatio||1)<=1?"translate("+m+"px, "+x+"px)":"translate3d("+m+"px, "+x+"px, 0)",G))}return Object.assign({},R,(t={},t[S]=M?x+"px":"",t[b]=_?m+"px":"",t.transform="",t))}function tD(n){var t=n.state,e=n.options,i=e.gpuAcceleration,s=i===void 0?!0:i,r=e.adaptive,a=r===void 0?!0:r,o=e.roundOffsets,l=o===void 0?!0:o,c={placement:Mr(t.placement),variation:Gc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,yb(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,yb(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const eD={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:tD,data:{}};var Yd={passive:!0};function nD(n){var t=n.state,e=n.instance,i=n.options,s=i.scroll,r=s===void 0?!0:s,a=i.resize,o=a===void 0?!0:a,l=is(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(h){h.addEventListener("scroll",e.update,Yd)}),o&&l.addEventListener("resize",e.update,Yd),function(){r&&c.forEach(function(h){h.removeEventListener("scroll",e.update,Yd)}),o&&l.removeEventListener("resize",e.update,Yd)}}const iD={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:nD,data:{}};var sD={left:"right",right:"left",bottom:"top",top:"bottom"};function bm(n){return n.replace(/left|right|bottom|top/g,function(t){return sD[t]})}var rD={start:"end",end:"start"};function _b(n){return n.replace(/start|end/g,function(t){return rD[t]})}function $v(n){var t=is(n),e=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:e,scrollTop:i}}function Yv(n){return Hc(Ja(n)).left+$v(n).scrollLeft}function aD(n,t){var e=is(n),i=Ja(n),s=e.visualViewport,r=i.clientWidth,a=i.clientHeight,o=0,l=0;if(s){r=s.width,a=s.height;var c=jT();(c||!c&&t==="fixed")&&(o=s.offsetLeft,l=s.offsetTop)}return{width:r,height:a,x:o+Yv(n),y:l}}function oD(n){var t,e=Ja(n),i=$v(n),s=(t=n.ownerDocument)==null?void 0:t.body,r=qo(e.scrollWidth,e.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=qo(e.scrollHeight,e.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),o=-i.scrollLeft+Yv(n),l=-i.scrollTop;return oa(s||e).direction==="rtl"&&(o+=qo(e.clientWidth,s?s.clientWidth:0)-r),{width:r,height:a,x:o,y:l}}function Zv(n){var t=oa(n),e=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+s+i)}function ZT(n){return["html","body","#document"].indexOf(Cr(n))>=0?n.ownerDocument.body:Ms(n)&&Zv(n)?n:ZT(G0(n))}function _u(n,t){var e;t===void 0&&(t=[]);var i=ZT(n),s=i===((e=n.ownerDocument)==null?void 0:e.body),r=is(i),a=s?[r].concat(r.visualViewport||[],Zv(i)?i:[]):i,o=t.concat(a);return s?o:o.concat(_u(G0(a)))}function Wx(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function lD(n,t){var e=Hc(n,!1,t==="fixed");return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function xb(n,t,e){return t===VT?Wx(aD(n,e)):el(t)?lD(t,e):Wx(oD(Ja(n)))}function cD(n){var t=_u(G0(n)),e=["absolute","fixed"].indexOf(oa(n).position)>=0,i=e&&Ms(n)?Mf(n):n;return el(i)?t.filter(function(s){return el(s)&&XT(s,i)&&Cr(s)!=="body"}):[]}function hD(n,t,e,i){var s=t==="clippingParents"?cD(n):[].concat(t),r=[].concat(s,[e]),a=r[0],o=r.reduce(function(l,c){var h=xb(n,c,i);return l.top=qo(h.top,l.top),l.right=Bm(h.right,l.right),l.bottom=Bm(h.bottom,l.bottom),l.left=qo(h.left,l.left),l},xb(n,a,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function KT(n){var t=n.reference,e=n.element,i=n.placement,s=i?Mr(i):null,r=i?Gc(i):null,a=t.x+t.width/2-e.width/2,o=t.y+t.height/2-e.height/2,l;switch(s){case Ui:l={x:a,y:t.y-e.height};break;case ws:l={x:a,y:t.y+t.height};break;case bs:l={x:t.x+t.width,y:o};break;case ki:l={x:t.x-e.width,y:o};break;default:l={x:t.x,y:t.y}}var c=s?qv(s):null;if(c!=null){var h=c==="y"?"height":"width";switch(r){case zc:l[c]=l[c]-(t[h]/2-e[h]/2);break;case zu:l[c]=l[c]+(t[h]/2-e[h]/2);break}}return l}function Bu(n,t){t===void 0&&(t={});var e=t,i=e.placement,s=i===void 0?n.placement:i,r=e.strategy,a=r===void 0?n.strategy:r,o=e.boundary,l=o===void 0?PL:o,c=e.rootBoundary,h=c===void 0?VT:c,u=e.elementContext,p=u===void 0?Uh:u,m=e.altBoundary,g=m===void 0?!1:m,x=e.padding,y=x===void 0?0:x,_=$T(typeof y!="number"?y:YT(y,vf)),M=p===Uh?IL:Uh,b=n.rects.popper,S=n.elements[g?M:p],P=hD(el(S)?S:S.contextElement||Ja(n.elements.popper),l,h,a),C=Hc(n.elements.reference),T=KT({reference:C,element:b,strategy:"absolute",placement:s}),L=Wx(Object.assign({},b,T)),N=p===Uh?L:C,E={top:P.top-N.top+_.top,bottom:N.bottom-P.bottom+_.bottom,left:P.left-N.left+_.left,right:N.right-P.right+_.right},R=n.modifiersData.offset;if(p===Uh&&R){var z=R[s];Object.keys(E).forEach(function(G){var W=[bs,ws].indexOf(G)>=0?1:-1,tt=[Ui,ws].indexOf(G)>=0?"y":"x";E[G]+=z[tt]*W})}return E}function uD(n,t){t===void 0&&(t={});var e=t,i=e.placement,s=e.boundary,r=e.rootBoundary,a=e.padding,o=e.flipVariations,l=e.allowedAutoPlacements,c=l===void 0?WT:l,h=Gc(i),u=h?o?mb:mb.filter(function(g){return Gc(g)===h}):vf,p=u.filter(function(g){return c.indexOf(g)>=0});p.length===0&&(p=u);var m=p.reduce(function(g,x){return g[x]=Bu(n,{placement:x,boundary:s,rootBoundary:r,padding:a})[Mr(x)],g},{});return Object.keys(m).sort(function(g,x){return m[g]-m[x]})}function fD(n){if(Mr(n)===Wv)return[];var t=bm(n);return[_b(n),t,_b(t)]}function dD(n){var t=n.state,e=n.options,i=n.name;if(!t.modifiersData[i]._skip){for(var s=e.mainAxis,r=s===void 0?!0:s,a=e.altAxis,o=a===void 0?!0:a,l=e.fallbackPlacements,c=e.padding,h=e.boundary,u=e.rootBoundary,p=e.altBoundary,m=e.flipVariations,g=m===void 0?!0:m,x=e.allowedAutoPlacements,y=t.options.placement,_=Mr(y),M=_===y,b=l||(M||!g?[bm(y)]:fD(y)),S=[y].concat(b).reduce(function(Y,rt){return Y.concat(Mr(rt)===Wv?uD(t,{placement:rt,boundary:h,rootBoundary:u,padding:c,flipVariations:g,allowedAutoPlacements:x}):rt)},[]),P=t.rects.reference,C=t.rects.popper,T=new Map,L=!0,N=S[0],E=0;E=0,tt=W?"width":"height",X=Bu(t,{placement:R,boundary:h,rootBoundary:u,altBoundary:p,padding:c}),at=W?G?bs:ki:G?ws:Ui;P[tt]>C[tt]&&(at=bm(at));var H=bm(at),J=[];if(r&&J.push(X[z]<=0),o&&J.push(X[at]<=0,X[H]<=0),J.every(function(Y){return Y})){N=R,L=!1;break}T.set(R,J)}if(L)for(var st=g?3:1,q=function(rt){var wt=S.find(function(_t){var Nt=T.get(_t);if(Nt)return Nt.slice(0,rt).every(function(Bt){return Bt})});if(wt)return N=wt,"break"},ct=st;ct>0;ct--){var mt=q(ct);if(mt==="break")break}t.placement!==N&&(t.modifiersData[i]._skip=!0,t.placement=N,t.reset=!0)}}const pD={name:"flip",enabled:!0,phase:"main",fn:dD,requiresIfExists:["offset"],data:{_skip:!1}};function vb(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function Mb(n){return[Ui,bs,ws,ki].some(function(t){return n[t]>=0})}function mD(n){var t=n.state,e=n.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,a=Bu(t,{elementContext:"reference"}),o=Bu(t,{altBoundary:!0}),l=vb(a,i),c=vb(o,s,r),h=Mb(l),u=Mb(c);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":u})}const gD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:mD};function yD(n,t,e){var i=Mr(n),s=[ki,Ui].indexOf(i)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,a=r[0],o=r[1];return a=a||0,o=(o||0)*s,[ki,bs].indexOf(i)>=0?{x:o,y:a}:{x:a,y:o}}function _D(n){var t=n.state,e=n.options,i=n.name,s=e.offset,r=s===void 0?[0,0]:s,a=WT.reduce(function(h,u){return h[u]=yD(u,t.rects,r),h},{}),o=a[t.placement],l=o.x,c=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=a}const xD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:_D};function vD(n){var t=n.state,e=n.name;t.modifiersData[e]=KT({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const MD={name:"popperOffsets",enabled:!0,phase:"read",fn:vD,data:{}};function wD(n){return n==="x"?"y":"x"}function bD(n){var t=n.state,e=n.options,i=n.name,s=e.mainAxis,r=s===void 0?!0:s,a=e.altAxis,o=a===void 0?!1:a,l=e.boundary,c=e.rootBoundary,h=e.altBoundary,u=e.padding,p=e.tether,m=p===void 0?!0:p,g=e.tetherOffset,x=g===void 0?0:g,y=Bu(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:h}),_=Mr(t.placement),M=Gc(t.placement),b=!M,S=qv(_),P=wD(S),C=t.modifiersData.popperOffsets,T=t.rects.reference,L=t.rects.popper,N=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,E=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,z={x:0,y:0};if(C){if(r){var G,W=S==="y"?Ui:ki,tt=S==="y"?ws:bs,X=S==="y"?"height":"width",at=C[S],H=at+y[W],J=at-y[tt],st=m?-L[X]/2:0,q=M===zc?T[X]:L[X],ct=M===zc?-L[X]:-T[X],mt=t.elements.arrow,Y=m&&mt?Xv(mt):{width:0,height:0},rt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:qT(),wt=rt[W],_t=rt[tt],Nt=yu(0,T[X],Y[X]),Bt=b?T[X]/2-st-Nt-wt-E.mainAxis:q-Nt-wt-E.mainAxis,Vt=b?-T[X]/2+st+Nt+_t+E.mainAxis:ct+Nt+_t+E.mainAxis,Xt=t.elements.arrow&&Mf(t.elements.arrow),lt=Xt?S==="y"?Xt.clientTop||0:Xt.clientLeft||0:0,U=(G=R==null?void 0:R[S])!=null?G:0,Ct=at+Bt-U-lt,dt=at+Vt-U,St=yu(m?Bm(H,Ct):H,at,m?qo(J,dt):J);C[S]=St,z[S]=St-at}if(o){var Tt,Ht=S==="x"?Ui:ki,Ft=S==="x"?ws:bs,k=C[P],D=P==="y"?"height":"width",it=k+y[Ht],vt=k-y[Ft],Et=[Ui,ki].indexOf(_)!==-1,bt=(Tt=R==null?void 0:R[P])!=null?Tt:0,ee=Et?it:k-T[D]-L[D]-bt+E.altAxis,Ut=Et?k+T[D]+L[D]-bt-E.altAxis:vt,qt=m&&Et?qL(ee,k,Ut):yu(m?ee:it,k,m?Ut:vt);C[P]=qt,z[P]=qt-k}t.modifiersData[i]=z}}const SD={name:"preventOverflow",enabled:!0,phase:"main",fn:bD,requiresIfExists:["offset"]};function ED(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function AD(n){return n===is(n)||!Ms(n)?$v(n):ED(n)}function TD(n){var t=n.getBoundingClientRect(),e=Bc(t.width)/n.offsetWidth||1,i=Bc(t.height)/n.offsetHeight||1;return e!==1||i!==1}function CD(n,t,e){e===void 0&&(e=!1);var i=Ms(t),s=Ms(t)&&TD(t),r=Ja(t),a=Hc(n,s,e),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!e)&&((Cr(t)!=="body"||Zv(r))&&(o=AD(t)),Ms(t)?(l=Hc(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=Yv(r))),{x:a.left+o.scrollLeft-l.x,y:a.top+o.scrollTop-l.y,width:a.width,height:a.height}}function RD(n){var t=new Map,e=new Set,i=[];n.forEach(function(r){t.set(r.name,r)});function s(r){e.add(r.name);var a=[].concat(r.requires||[],r.requiresIfExists||[]);a.forEach(function(o){if(!e.has(o)){var l=t.get(o);l&&s(l)}}),i.push(r)}return n.forEach(function(r){e.has(r.name)||s(r)}),i}function PD(n){var t=RD(n);return HL.reduce(function(e,i){return e.concat(t.filter(function(s){return s.phase===i}))},[])}function ID(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function LD(n){var t=n.reduce(function(e,i){var s=e[i.name];return e[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,e},{});return Object.keys(t).map(function(e){return t[e]})}var wb={placement:"bottom",modifiers:[],strategy:"absolute"};function bb(){for(var n=arguments.length,t=new Array(n),e=0;e({var:n,varRef:t?`var(${n}, ${t})`:`var(${n})`}),Yn={arrowShadowColor:Ol("--popper-arrow-shadow-color"),arrowSize:Ol("--popper-arrow-size","8px"),arrowSizeHalf:Ol("--popper-arrow-size-half"),arrowBg:Ol("--popper-arrow-bg"),transformOrigin:Ol("--popper-transform-origin"),arrowOffset:Ol("--popper-arrow-offset")};function FD(n){if(n.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(n.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(n.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(n.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}const UD={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},kD=n=>UD[n],Sb={scroll:!0,resize:!0};function zD(n){let t;return typeof n=="object"?t={enabled:!0,options:{...Sb,...n}}:t={enabled:n,options:Sb},t}const BD={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:n})=>{n.styles.popper.width=`${n.rects.reference.width}px`},effect:({state:n})=>()=>{const t=n.elements.reference;n.elements.popper.style.width=`${t.offsetWidth}px`}},HD={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:n})=>{Eb(n)},effect:({state:n})=>()=>{Eb(n)}},Eb=n=>{n.elements.popper.style.setProperty(Yn.transformOrigin.var,kD(n.placement))},GD={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:n})=>{VD(n)}},VD=n=>{var e;if(!n.placement)return;const t=WD(n.placement);if((e=n.elements)!=null&&e.arrow&&t){Object.assign(n.elements.arrow.style,{[t.property]:t.value,width:Yn.arrowSize.varRef,height:Yn.arrowSize.varRef,zIndex:-1});const i={[Yn.arrowSizeHalf.var]:`calc(${Yn.arrowSize.varRef} / 2 - 1px)`,[Yn.arrowOffset.var]:`calc(${Yn.arrowSizeHalf.varRef} * -1)`};for(const s in i)n.elements.arrow.style.setProperty(s,i[s])}},WD=n=>{if(n.startsWith("top"))return{property:"bottom",value:Yn.arrowOffset.varRef};if(n.startsWith("bottom"))return{property:"top",value:Yn.arrowOffset.varRef};if(n.startsWith("left"))return{property:"right",value:Yn.arrowOffset.varRef};if(n.startsWith("right"))return{property:"left",value:Yn.arrowOffset.varRef}},jD={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:n})=>{Ab(n)},effect:({state:n})=>()=>{Ab(n)}},Ab=n=>{if(!n.elements.arrow)return;const t=n.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const e=FD(n.placement);e&&t.style.setProperty("--popper-arrow-default-shadow",e),Object.assign(t.style,{transform:"rotate(45deg)",background:Yn.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},XD={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},qD={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function $D(n,t="ltr"){var i;const e=((i=XD[n])==null?void 0:i[t])||n;return t==="ltr"?e:qD[n]??e}function YD(n={}){const{enabled:t=!0,modifiers:e,placement:i="bottom",strategy:s="absolute",arrowPadding:r=8,eventListeners:a=!0,offset:o,gutter:l=8,flip:c=!0,boundary:h="clippingParents",preventOverflow:u=!0,matchWidth:p,direction:m="ltr"}=n,g=Z.useRef(null),x=Z.useRef(null),y=Z.useRef(null),_=$D(i,m),M=Z.useRef(()=>{}),b=Z.useCallback(()=>{var E;!t||!g.current||!x.current||((E=M.current)==null||E.call(M),y.current=OD(g.current,x.current,{placement:_,modifiers:[jD,GD,HD,{...BD,enabled:!!p},{name:"eventListeners",...zD(a)},{name:"arrow",options:{padding:r}},{name:"offset",options:{offset:o??[0,l]}},{name:"flip",enabled:!!c,options:{padding:8}},{name:"preventOverflow",enabled:!!u,options:{boundary:h}},...e??[]],strategy:s}),y.current.forceUpdate(),M.current=y.current.destroy)},[_,t,e,p,a,r,o,l,c,u,h,s]);Z.useEffect(()=>()=>{var E;!g.current&&!x.current&&((E=y.current)==null||E.destroy(),y.current=null)},[]);const S=Z.useCallback(E=>{g.current=E,b()},[b]),P=Z.useCallback((E={},R=null)=>({...E,ref:za(S,R)}),[S]),C=Z.useCallback(E=>{x.current=E,b()},[b]),T=Z.useCallback((E={},R=null)=>({...E,ref:za(C,R),style:{...E.style,position:s,minWidth:p?void 0:"max-content",inset:"0 auto auto 0"}}),[s,C,p]),L=Z.useCallback((E={},R=null)=>{const{size:z,shadowColor:G,bg:W,style:tt,...X}=E;return{...X,ref:R,"data-popper-arrow":"",style:ZD(E)}},[]),N=Z.useCallback((E={},R=null)=>({...E,ref:R,"data-popper-arrow-inner":""}),[]);return{update(){var E;(E=y.current)==null||E.update()},forceUpdate(){var E;(E=y.current)==null||E.forceUpdate()},transformOrigin:Yn.transformOrigin.varRef,referenceRef:S,popperRef:C,getPopperProps:T,getArrowProps:L,getArrowInnerProps:N,getReferenceProps:P}}function ZD(n){const{size:t,shadowColor:e,bg:i,style:s}=n,r={...s,position:"absolute"};return t&&(r["--popper-arrow-size"]=t),e&&(r["--popper-arrow-shadow-color"]=e),i&&(r["--popper-arrow-bg"]=i),r}const[KD,JD]=k0(),QD={start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}};function tN(n,t){var e;if(n)return((e=QD[n])==null?void 0:e[t])??n}function eN(n){var c;const{isOpen:t,onClose:e,placement:i="right",children:s,...r}=n,a=Fv(),o=(c=a.components)==null?void 0:c.Drawer,l=tN(i,a.direction);return V.jsx(KD,{value:{placement:l},children:V.jsx(kv,{isOpen:t,onClose:e,styleConfig:o,...r,children:s})})}const Tb={exit:{duration:.15,ease:ou.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},nN={exit:({direction:n,transition:t,transitionEnd:e,delay:i})=>{const{exit:s}=kx({direction:n});return{...s,transition:(t==null?void 0:t.exit)??km.exit(Tb.exit,i),transitionEnd:e==null?void 0:e.exit}},enter:({direction:n,transitionEnd:t,transition:e,delay:i})=>{const{enter:s}=kx({direction:n});return{...s,transition:(e==null?void 0:e.enter)??km.enter(Tb.enter,i),transitionEnd:t==null?void 0:t.enter}}},JT=Z.forwardRef(function(t,e){const{direction:i="right",style:s,unmountOnExit:r,in:a,className:o,transition:l,transitionEnd:c,delay:h,motionProps:u,animatePresenceProps:p,...m}=t,g=kx({direction:i}),x=Object.assign({position:"fixed"},g.position,s),y=r?a&&r:!0,_=a||r?"enter":"exit",M={transitionEnd:c,transition:l,direction:i,delay:h};return V.jsx(Nv,{...p,custom:M,children:y&&V.jsx(Ov.div,{...m,ref:e,initial:"exit",className:rs("chakra-slide",o),animate:_,exit:"exit",custom:M,variants:nN,style:x,...u})})});JT.displayName="Slide";const iN=an(JT),QT=zi((n,t)=>{const{className:e,children:i,motionProps:s,containerProps:r,...a}=n,{getDialogProps:o,getDialogContainerProps:l,isOpen:c}=xI(),h=o(a,t),u=l(r),p=rs("chakra-modal__content",e),m=vI(),g={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},x={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{placement:y}=JD();return V.jsx(MI,{children:V.jsx(an.div,{...u,className:"chakra-modal__content-container",__css:x,children:V.jsx(iN,{motionProps:s,direction:y,in:c,className:p,...h,__css:g,children:i})})})});QT.displayName="DrawerContent";function sN(n,t,e){return(n-t)*100/(e-t)}z0({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});z0({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});const rN=z0({"0%":{left:"-40%"},"100%":{left:"100%"}}),aN=z0({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function oN(n){const{value:t=0,min:e,max:i,valueText:s,getValueText:r,isIndeterminate:a,role:o="progressbar"}=n,l=sN(t,e,i);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":i,"aria-valuemin":e,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof r=="function"?r(t,l):s})(),role:o},percent:l,value:t}}const[lN,cN]=k0({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),hN=zi((n,t)=>{const{min:e,max:i,value:s,isIndeterminate:r,role:a,...o}=n,l=oN({value:s,min:e,max:i,isIndeterminate:r,role:a}),h={height:"100%",...cN().filledTrack};return V.jsx(an.div,{ref:t,style:{width:`${l.percent}%`,...o.style},...l.bind,...o,__css:h})}),t2=zi((n,t)=>{var T;const{value:e,min:i=0,max:s=100,hasStripe:r,isAnimated:a,children:o,borderRadius:l,isIndeterminate:c,"aria-label":h,"aria-labelledby":u,"aria-valuetext":p,title:m,role:g,...x}=gf(n),y=Uv("Progress",n),_=l??((T=y.track)==null?void 0:T.borderRadius),M={animation:`${aN} 1s linear infinite`},P={...!c&&r&&a&&M,...c&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${rN} 1s ease infinite normal none running`}},C={overflow:"hidden",position:"relative",...y.track};return V.jsx(an.div,{ref:t,borderRadius:_,__css:C,...x,children:V.jsxs(lN,{value:y,children:[V.jsx(hN,{"aria-label":h,"aria-labelledby":u,"aria-valuetext":p,min:i,max:s,value:e,isIndeterminate:c,css:P,borderRadius:_,title:m,role:g}),o]})})});t2.displayName="Progress";function Zd(n){const{orientation:t,vertical:e,horizontal:i}=n;return t==="vertical"?e:i}const Sm={width:0,height:0},Kd=n=>n||Sm;function uN(n){const{orientation:t,thumbPercents:e,thumbRects:i,isReversed:s}=n,r=x=>{const y=i[x]??Sm;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Zd({orientation:t,vertical:{bottom:`calc(${e[x]}% - ${y.height/2}px)`},horizontal:{left:`calc(${e[x]}% - ${y.width/2}px)`}})}},a=t==="vertical"?i.reduce((x,y)=>Kd(x).height>Kd(y).height?x:y,Sm):i.reduce((x,y)=>Kd(x).width>Kd(y).width?x:y,Sm),o={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Zd({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...Zd({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},c=e.length===1,h=[0,s?100-e[0]:e[0]],u=c?h:e;let p=u[0];!c&&s&&(p=100-p);const m=Math.abs(u[u.length-1]-u[0]),g={...l,...Zd({orientation:t,vertical:s?{height:`${m}%`,top:`${p}%`}:{height:`${m}%`,bottom:`${p}%`},horizontal:s?{width:`${m}%`,right:`${p}%`}:{width:`${m}%`,left:`${p}%`}})};return{trackStyle:l,innerTrackStyle:g,rootStyle:o,getThumbStyle:r}}function fN(n){const{isReversed:t,direction:e,orientation:i}=n;return e==="ltr"||i==="vertical"?t:!t}function dN(n){const{min:t=0,max:e=100,onChange:i,value:s,defaultValue:r,isReversed:a,direction:o="ltr",orientation:l="horizontal",id:c,isDisabled:h,isReadOnly:u,onChangeStart:p,onChangeEnd:m,step:g=1,getAriaValueText:x,"aria-valuetext":y,"aria-label":_,"aria-labelledby":M,name:b,focusThumbOnChange:S=!0,...P}=n,C=vr(p),T=vr(m),L=vr(x),N=fN({isReversed:a,direction:o,orientation:l}),[E,R]=qI({value:s,defaultValue:r??mN(t,e),onChange:i}),[z,G]=Z.useState(!1),[W,tt]=Z.useState(!1),X=!(h||u),at=(e-t)/10,H=g||(e-t)/100,J=Xy(E,t,e),st=e-J+t,ct=ab(N?st:J,t,e),mt=l==="vertical",Y=UT({min:t,max:e,step:g,isDisabled:h,value:J,isInteractive:X,isReversed:N,isVertical:mt,eventSource:null,focusThumbOnChange:S,orientation:l}),rt=Z.useRef(null),wt=Z.useRef(null),_t=Z.useRef(null),Nt=Z.useId(),Bt=c??Nt,[Vt,Xt]=[`slider-thumb-${Bt}`,`slider-track-${Bt}`],lt=Z.useCallback(gt=>{var ft;if(!rt.current)return;const It=Y.current;It.eventSource="pointer";const oe=rt.current.getBoundingClientRect(),{clientX:Wt,clientY:$}=((ft=gt.touches)==null?void 0:ft[0])??gt,Mt=mt?oe.bottom-$:Wt-oe.left,Gt=mt?oe.height:oe.width;let j=Mt/Gt;N&&(j=1-j);let Dt=VI(j,It.min,It.max);return It.step&&(Dt=parseFloat(ob(Dt,It.min,It.step))),Dt=Xy(Dt,It.min,It.max),Dt},[mt,N,Y]),U=Z.useCallback(gt=>{const It=Y.current;It.isInteractive&&(gt=parseFloat(ob(gt,It.min,H)),gt=Xy(gt,It.min,It.max),R(gt))},[H,R,Y]),Ct=Z.useMemo(()=>({stepUp(gt=H){const It=N?J-gt:J+gt;U(It)},stepDown(gt=H){const It=N?J+gt:J-gt;U(It)},reset(){U(r||0)},stepTo(gt){U(gt)}}),[U,N,J,H,r]),dt=Z.useCallback(gt=>{const It=Y.current,Wt={ArrowRight:()=>Ct.stepUp(),ArrowUp:()=>Ct.stepUp(),ArrowLeft:()=>Ct.stepDown(),ArrowDown:()=>Ct.stepDown(),PageUp:()=>Ct.stepUp(at),PageDown:()=>Ct.stepDown(at),Home:()=>U(It.min),End:()=>U(It.max)}[gt.key];Wt&&(gt.preventDefault(),gt.stopPropagation(),Wt(gt),It.eventSource="keyboard")},[Ct,U,at,Y]),St=(L==null?void 0:L(J))??y,Tt=QI(wt),{getThumbStyle:Ht,rootStyle:Ft,trackStyle:k,innerTrackStyle:D}=Z.useMemo(()=>{const gt=Y.current,It=Tt??{width:0,height:0};return uN({isReversed:N,orientation:gt.orientation,thumbRects:[It],thumbPercents:[ct]})},[N,Tt,ct,Y]),it=Z.useCallback(()=>{Y.current.focusThumbOnChange&&setTimeout(()=>{var It;return(It=wt.current)==null?void 0:It.focus()})},[Y]);TT(()=>{const gt=Y.current;it(),gt.eventSource==="keyboard"&&(T==null||T(gt.value))},[J,T]);function vt(gt){const It=lt(gt);It!=null&&It!==Y.current.value&&R(It)}pL(_t,{onPanSessionStart(gt){const It=Y.current;It.isInteractive&&(G(!0),it(),vt(gt),C==null||C(It.value))},onPanSessionEnd(){const gt=Y.current;gt.isInteractive&&(G(!1),T==null||T(gt.value))},onPan(gt){Y.current.isInteractive&&vt(gt)}});const Et=Z.useCallback((gt={},It=null)=>({...gt,...P,ref:za(It,_t),tabIndex:-1,"aria-disabled":Vy(h),"data-focused":$e(W),style:{...gt.style,...Ft}}),[P,h,W,Ft]),bt=Z.useCallback((gt={},It=null)=>({...gt,ref:za(It,rt),id:Xt,"data-disabled":$e(h),style:{...gt.style,...k}}),[h,Xt,k]),ee=Z.useCallback((gt={},It=null)=>({...gt,ref:It,style:{...gt.style,...D}}),[D]),Ut=Z.useCallback((gt={},It=null)=>({...gt,ref:za(It,wt),role:"slider",tabIndex:X?0:void 0,id:Vt,"data-active":$e(z),"aria-valuetext":St,"aria-valuemin":t,"aria-valuemax":e,"aria-valuenow":J,"aria-orientation":l,"aria-disabled":Vy(h),"aria-readonly":Vy(u),"aria-label":_,"aria-labelledby":_?void 0:M,style:{...gt.style,...Ht(0)},onKeyDown:Ln(gt.onKeyDown,dt),onFocus:Ln(gt.onFocus,()=>tt(!0)),onBlur:Ln(gt.onBlur,()=>tt(!1))}),[X,Vt,z,St,t,e,J,l,h,u,_,M,Ht,dt]),qt=Z.useCallback((gt,It=null)=>{const oe=!(gt.valuee),Wt=J>=gt.value,$=ab(gt.value,t,e),Mt={position:"absolute",pointerEvents:"none",...pN({orientation:l,vertical:{bottom:N?`${100-$}%`:`${$}%`},horizontal:{left:N?`${100-$}%`:`${$}%`}})};return{...gt,ref:It,role:"presentation","aria-hidden":!0,"data-disabled":$e(h),"data-invalid":$e(!oe),"data-highlighted":$e(Wt),style:{...gt.style,...Mt}}},[h,N,e,t,l,J]),Te=Z.useCallback((gt={},It=null)=>({...gt,ref:It,type:"hidden",value:J,name:b}),[b,J]);return{state:{value:J,isFocused:W,isDragging:z},actions:Ct,getRootProps:Et,getTrackProps:bt,getInnerTrackProps:ee,getThumbProps:Ut,getMarkerProps:qt,getInputProps:Te}}function pN(n){const{orientation:t,vertical:e,horizontal:i}=n;return t==="vertical"?e:i}function mN(n,t){return t"}),[yN,W0]=k0({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),e2=zi((n,t)=>{const e={...n,orientation:(n==null?void 0:n.orientation)??"horizontal"},i=Uv("Slider",e),s=gf(e),{direction:r}=Fv();s.direction=r;const{getInputProps:a,getRootProps:o,...l}=dN(s),c=o(),h=a({},t);return V.jsx(gN,{value:l,children:V.jsx(yN,{value:i,children:V.jsxs(an.div,{...c,className:rs("chakra-slider",e.className),__css:i.container,children:[e.children,V.jsx("input",{...h})]})})})});e2.displayName="Slider";const n2=zi((n,t)=>{const{getThumbProps:e}=V0(),i=W0(),s=e(n,t);return V.jsx(an.div,{...s,className:rs("chakra-slider__thumb",n.className),__css:i.thumb})});n2.displayName="SliderThumb";const i2=zi((n,t)=>{const{getTrackProps:e}=V0(),i=W0(),s=e(n,t);return V.jsx(an.div,{...s,className:rs("chakra-slider__track",n.className),__css:i.track})});i2.displayName="SliderTrack";const s2=zi((n,t)=>{const{getInnerTrackProps:e}=V0(),i=W0(),s=e(n,t);return V.jsx(an.div,{...s,className:rs("chakra-slider__filled-track",n.className),__css:i.filledTrack})});s2.displayName="SliderFilledTrack";const _N=zi((n,t)=>{const{getMarkerProps:e}=V0(),i=W0(),s=e(n,t);return V.jsx(an.div,{...s,className:rs("chakra-slider__marker",n.className),__css:i.mark})});_N.displayName="SliderMark";const r2=zi(function(t,e){const i=Uv("Switch",t),{spacing:s="0.5rem",children:r,...a}=gf(t),{getIndicatorProps:o,getInputProps:l,getCheckboxProps:c,getRootProps:h,getLabelProps:u}=CL(a),p=Z.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...i.container}),[i.container]),m=Z.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...i.track}),[i.track]),g=Z.useMemo(()=>({userSelect:"none",marginStart:s,...i.label}),[s,i.label]);return V.jsxs(an.label,{...h(),className:rs("chakra-switch",t.className),__css:p,children:[V.jsx("input",{className:"chakra-switch__input",...l({},e)}),V.jsx(an.span,{...c(),className:"chakra-switch__track",__css:m,children:V.jsx(an.span,{__css:i.thumb,className:"chakra-switch__thumb",...o()})}),r&&V.jsx(an.span,{className:"chakra-switch__label",...u(),__css:g,children:r})]})});r2.displayName="Switch";const xN={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},jx=n=>{var t;return((t=n.current)==null?void 0:t.ownerDocument)||document},Em=n=>{var t,e;return((e=(t=n.current)==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)||window};function vN(n={}){const{openDelay:t=0,closeDelay:e=0,closeOnClick:i=!0,closeOnMouseDown:s,closeOnScroll:r,closeOnPointerDown:a=s,closeOnEsc:o=!0,onOpen:l,onClose:c,placement:h,id:u,isOpen:p,defaultIsOpen:m,arrowSize:g=10,arrowShadowColor:x,arrowPadding:y,modifiers:_,isDisabled:M,gutter:b,offset:S,direction:P,...C}=n,{isOpen:T,onOpen:L,onClose:N}=Qo({isOpen:p,defaultIsOpen:m,onOpen:l,onClose:c}),{referenceRef:E,getPopperProps:R,getArrowInnerProps:z,getArrowProps:G}=YD({enabled:T,placement:h,arrowPadding:y,modifiers:_,gutter:b,offset:S,direction:P}),W=Z.useId(),X=`tooltip-${u??W}`,at=Z.useRef(null),H=Z.useRef(),J=Z.useCallback(()=>{H.current&&(clearTimeout(H.current),H.current=void 0)},[]),st=Z.useRef(),q=Z.useCallback(()=>{st.current&&(clearTimeout(st.current),st.current=void 0)},[]),ct=Z.useCallback(()=>{q(),N()},[N,q]),mt=MN(at,ct),Y=Z.useCallback(()=>{if(!M&&!H.current){T&&mt();const lt=Em(at);H.current=lt.setTimeout(L,t)}},[mt,M,T,L,t]),rt=Z.useCallback(()=>{J();const lt=Em(at);st.current=lt.setTimeout(ct,e)},[e,ct,J]),wt=Z.useCallback(()=>{T&&i&&rt()},[i,rt,T]),_t=Z.useCallback(()=>{T&&a&&rt()},[a,rt,T]),Nt=Z.useCallback(lt=>{T&<.key==="Escape"&&rt()},[T,rt]);qy(()=>jx(at),"keydown",o?Nt:void 0),qy(()=>{if(!r)return null;const lt=at.current;if(!lt)return null;const U=FT(lt);return U.localName==="body"?Em(at):U},"scroll",()=>{T&&r&&ct()},{passive:!0,capture:!0}),Z.useEffect(()=>{M&&(J(),T&&N())},[M,T,N,J]),Z.useEffect(()=>()=>{J(),q()},[J,q]),qy(()=>at.current,"pointerleave",rt);const Bt=Z.useCallback((lt={},U=null)=>({...lt,ref:za(at,U,E),onPointerEnter:Ln(lt.onPointerEnter,dt=>{dt.pointerType!=="touch"&&Y()}),onClick:Ln(lt.onClick,wt),onPointerDown:Ln(lt.onPointerDown,_t),onFocus:Ln(lt.onFocus,Y),onBlur:Ln(lt.onBlur,rt),"aria-describedby":T?X:void 0}),[Y,rt,_t,T,X,wt,E]),Vt=Z.useCallback((lt={},U=null)=>R({...lt,style:{...lt.style,[Yn.arrowSize.var]:g?`${g}px`:void 0,[Yn.arrowShadowColor.var]:x}},U),[R,g,x]),Xt=Z.useCallback((lt={},U=null)=>{const Ct={...lt.style,position:"relative",transformOrigin:Yn.transformOrigin.varRef};return{ref:U,...C,...lt,id:X,role:"tooltip",style:Ct}},[C,X]);return{isOpen:T,show:Y,hide:rt,getTriggerProps:Bt,getTooltipProps:Xt,getTooltipPositionerProps:Vt,getArrowProps:G,getArrowInnerProps:z}}const Zy="chakra-ui:close-tooltip";function MN(n,t){return Z.useEffect(()=>{const e=jx(n);return e.addEventListener(Zy,t),()=>e.removeEventListener(Zy,t)},[t,n]),()=>{const e=jx(n),i=Em(n);e.dispatchEvent(new i.CustomEvent(Zy))}}const wN=an(Ov.div),wf=zi((n,t)=>{const e=CT("Tooltip",n),i=gf(n),s=Fv(),{children:r,label:a,shouldWrapChildren:o,"aria-label":l,hasArrow:c,bg:h,portalProps:u,background:p,backgroundColor:m,bgColor:g,motionProps:x,animatePresenceProps:y,..._}=i,M=p??m??h??g;if(M){e.bg=M;const E=mL(s,"colors",M);e[Yn.arrowBg.var]=E}const b=vN({..._,direction:s.direction}),S=typeof r=="string"||o;let P;if(S)P=V.jsx(an.span,{display:"inline-block",tabIndex:0,...b.getTriggerProps(),children:r});else{const E=Z.Children.only(r);P=Z.cloneElement(E,b.getTriggerProps(E.props,E.ref))}const C=!!l,T=b.getTooltipProps({},t),L=C?AT(T,["role","id"]):T,N=lI(T,["role","id"]);return a?V.jsxs(V.Fragment,{children:[P,V.jsx(Nv,{...y,children:b.isOpen&&V.jsx(cI,{...u,children:V.jsx(an.div,{...b.getTooltipPositionerProps(),__css:{zIndex:e.zIndex,pointerEvents:"none"},children:V.jsxs(wN,{variants:xN,initial:"exit",animate:"enter",exit:"exit",...x,...L,__css:e,children:[a,C&&V.jsx(an.span,{srOnly:!0,...N,children:l}),c&&V.jsx(an.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:V.jsx(an.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:e.bg}})})]})})})})]}):V.jsx(V.Fragment,{children:r})});wf.displayName="Tooltip";const Kv=zi(function(t,e){const{spacing:i="0.5rem",spacingX:s,spacingY:r,children:a,justify:o,direction:l,align:c,className:h,shouldWrapChildren:u,...p}=t,m=Z.useMemo(()=>u?Z.Children.map(a,(g,x)=>V.jsx(a2,{children:g},x)):a,[a,u]);return V.jsx(an.div,{ref:e,className:rs("chakra-wrap",h),...p,children:V.jsx(an.ul,{className:"chakra-wrap__list",__css:{display:"flex",flexWrap:"wrap",justifyContent:o,alignItems:c,flexDirection:l,listStyleType:"none",gap:i,columnGap:s,rowGap:r,padding:"0"},children:m})})});Kv.displayName="Wrap";const a2=zi(function(t,e){const{className:i,...s}=t;return V.jsx(an.li,{ref:e,__css:{display:"flex",alignItems:"flex-start"},className:rs("chakra-wrap__listitem",i),...s})});a2.displayName="WrapItem";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/raw-Dt1HMqYc.js","assets/basedecoder-DvumDe3Y.js","assets/lzw-DpvbRwG5.js","assets/jpeg-CdeCw_eT.js","assets/deflate-Daq-M6nQ.js","assets/index-Blxo1hic.js","assets/index-BZpzF2_o.css","assets/heading-CX4arv15.js","assets/Footer-DvQMRGAB.js","assets/location-D9lkPsfw.js","assets/stack-B32WIkoR.js","assets/packbits-DQnG8s9w.js","assets/lerc-CwjFlo57.js","assets/webimage-BcnuJlio.js"])))=>i.map(i=>d[i]); +var rI=Object.defineProperty;var aI=(n,t,e)=>t in n?rI(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var ar=(n,t,e)=>aI(n,typeof t!="symbol"?t+"":t,e);import{i as oI,k as vr,d as Z,j as V,A as Nv,m as Ov,l as rs,o as AT,n as Gy,p as TT,f as zi,q as CT,s as gf,c as an,v as k0,w as Fv,x as z0,y as Uv,z as lI,P as cI,g as Ka,I as hI,R as B0,B as yf,_ as pl,C as RT,D as PT,E as uI,F as fI,G as dI,M as pI}from"./index-Blxo1hic.js";import{C as mI,a as gI,H as yI,b as _I}from"./heading-CX4arv15.js";import{w as km,h as ou,i as $e,j as Ln,m as za,M as kv,k as kx,l as xI,n as vI,o as MI,p as Vy,u as Qo,a as pr,q as wI,B as aa,c as zv,d as IT,e as Bv,f as Hv,g as Gv,T as Fo,U as LT,b as ko,F as bI}from"./Footer-DvQMRGAB.js";import{u as SI,a as DT,b as EI,c as AI,p as TI,d as zm,F as Wy,I as jy,M as CI,e as RI,x as PI}from"./location-D9lkPsfw.js";import{S as II}from"./stack-B32WIkoR.js";function LI(n,t,e,i){return n.addEventListener(t,e,i),()=>{n.removeEventListener(t,e,i)}}function DI(n){return n.view??window}function NI(n){const t=DI(n);return typeof t.PointerEvent<"u"&&n instanceof t.PointerEvent?n.pointerType==="mouse":n instanceof t.MouseEvent}function NT(n){return!!n.touches}function OI(n){return NT(n)&&n.touches.length>1}function FI(n,t="page"){const e=n.touches[0]||n.changedTouches[0];return{x:e[`${t}X`],y:e[`${t}Y`]}}function UI(n,t="page"){return{x:n[`${t}X`],y:n[`${t}Y`]}}function OT(n,t="page"){return NT(n)?FI(n,t):UI(n,t)}function kI(n){return t=>{const e=NI(t);(!e||e&&t.button===0)&&n(t)}}function zI(n,t=!1){function e(s){n(s,{point:OT(s)})}return t?kI(e):e}function wm(n,t,e,i){return LI(n,t,zI(e,t==="pointerdown"),i)}function BI(n){const t=parseFloat(n);return typeof t!="number"||Number.isNaN(t)?0:t}function HI(n,t){let e=BI(n);const i=10**(t??10);return e=Math.round(e*i)/i,t?e.toFixed(t):e.toString()}function GI(n){if(!Number.isFinite(n))return 0;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e+=1;return e}function ab(n,t,e){return(n-t)*100/(e-t)}function VI(n,t,e){return(e-t)*n+t}function ob(n,t,e){const i=Math.round((n-t)/e)*e+t,s=GI(e);return HI(i,s)}function Xy(n,t,e){return n==null?n:(e{const{condition:t,message:e}=n};function qy(n,t,e,i){const s=vr(e);return Z.useEffect(()=>{const r=typeof n=="function"?n():n??document;if(!(!e||!r))return r.addEventListener(t,s,i),()=>{r.removeEventListener(t,s,i)}},[t,n,i,s,e]),()=>{const r=typeof n=="function"?n():n??document;r==null||r.removeEventListener(t,s,i)}}function qI(n){const{value:t,defaultValue:e,onChange:i,shouldUpdate:s=(p,m)=>p!==m}=n,r=vr(i),a=vr(s),[o,l]=Z.useState(e),c=t!==void 0,h=c?t:o,u=vr(p=>{const g=typeof p=="function"?p(h):p;a(h,g)&&(c||l(g),r(g))},[c,r,h,a]);return[h,u]}function UT(n){const t=Z.useRef(null);return t.current=n,t}function $I(n,t){if(!n){t(void 0);return}t({width:n.offsetWidth,height:n.offsetHeight});const e=n.ownerDocument.defaultView??window,i=new e.ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const[r]=s;let a,o;if("borderBoxSize"in r){const l=r.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,o=c.blockSize}else a=n.offsetWidth,o=n.offsetHeight;t({width:a,height:o})});return i.observe(n,{box:"border-box"}),()=>i.unobserve(n)}const YI=globalThis!=null&&globalThis.document?Z.useLayoutEffect:Z.useEffect;function ZI(n,t){var s;if(!n||!n.parentElement)return;const e=((s=n.ownerDocument)==null?void 0:s.defaultView)??window,i=new e.MutationObserver(()=>{t()});return i.observe(n.parentElement,{childList:!0}),()=>{i.disconnect()}}function KI({getNodes:n,observeMutation:t=!0}){const[e,i]=Z.useState([]),[s,r]=Z.useState(0);return YI(()=>{const a=n(),o=a.map((l,c)=>$I(l,h=>{i(u=>[...u.slice(0,c),h,...u.slice(c+1)])}));if(t){const l=a[0];o.push(ZI(l,()=>{r(c=>c+1)}))}return()=>{o.forEach(l=>{l==null||l()})}},[s]),e}function JI(n){return typeof n=="object"&&n!==null&&"current"in n}function QI(n){const[t]=KI({observeMutation:!1,getNodes(){return[JI(n)?n.current:n]}});return t}const kT=1/60*1e3,tL=typeof performance<"u"?()=>performance.now():()=>Date.now(),zT=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(tL()),kT);function eL(n){let t=[],e=[],i=0,s=!1,r=!1;const a=new WeakSet,o={schedule:(l,c=!1,h=!1)=>{const u=h&&s,p=u?t:e;return c&&a.add(l),p.indexOf(l)===-1&&(p.push(l),u&&s&&(i=t.length)),l},cancel:l=>{const c=e.indexOf(l);c!==-1&&e.splice(c,1),a.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[t,e]=[e,t],e.length=0,i=t.length,i)for(let c=0;c(n[t]=eL(()=>ku=!0),n),{}),iL=_f.reduce((n,t)=>{const e=H0[t];return n[t]=(i,s=!1,r=!1)=>(ku||aL(),e.schedule(i,s,r)),n},{}),sL=_f.reduce((n,t)=>(n[t]=H0[t].cancel,n),{});_f.reduce((n,t)=>(n[t]=()=>H0[t].process(Pc),n),{});const rL=n=>H0[n].process(Pc),BT=n=>{ku=!1,Pc.delta=zx?kT:Math.max(Math.min(n-Pc.timestamp,nL),1),Pc.timestamp=n,Bx=!0,_f.forEach(rL),Bx=!1,ku&&(zx=!1,zT(BT))},aL=()=>{ku=!0,zx=!0,Bx||zT(BT)},lb=()=>Pc;var oL=Object.defineProperty,lL=(n,t,e)=>t in n?oL(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ps=(n,t,e)=>(lL(n,typeof t!="symbol"?t+"":t,e),e);class cL{constructor(t,e,i){if(Ps(this,"history",[]),Ps(this,"startEvent",null),Ps(this,"lastEvent",null),Ps(this,"lastEventInfo",null),Ps(this,"handlers",{}),Ps(this,"removeListeners",()=>{}),Ps(this,"threshold",3),Ps(this,"win"),Ps(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const o=$y(this.lastEventInfo,this.history),l=this.startEvent!==null,c=dL(o.offset,{x:0,y:0})>=this.threshold;if(!l&&!c)return;const{timestamp:h}=lb();this.history.push({...o.point,timestamp:h});const{onStart:u,onMove:p}=this.handlers;l||(u==null||u(this.lastEvent,o),this.startEvent=this.lastEvent),p==null||p(this.lastEvent,o)}),Ps(this,"onPointerMove",(o,l)=>{this.lastEvent=o,this.lastEventInfo=l,iL.update(this.updatePoint,!0)}),Ps(this,"onPointerUp",(o,l)=>{const c=$y(l,this.history),{onEnd:h,onSessionEnd:u}=this.handlers;u==null||u(o,c),this.end(),!(!h||!this.startEvent)&&(h==null||h(o,c))}),this.win=t.view??window,OI(t))return;this.handlers=e,i&&(this.threshold=i),t.stopPropagation(),t.preventDefault();const s={point:OT(t)},{timestamp:r}=lb();this.history=[{...s.point,timestamp:r}];const{onSessionStart:a}=e;a==null||a(t,$y(s,this.history)),this.removeListeners=fL(wm(this.win,"pointermove",this.onPointerMove),wm(this.win,"pointerup",this.onPointerUp),wm(this.win,"pointercancel",this.onPointerUp))}updateHandlers(t){this.handlers=t}end(){var t;(t=this.removeListeners)==null||t.call(this),sL.update(this.updatePoint)}}function cb(n,t){return{x:n.x-t.x,y:n.y-t.y}}function $y(n,t){return{point:n.point,delta:cb(n.point,t[t.length-1]),offset:cb(n.point,t[0]),velocity:uL(t,.1)}}const hL=n=>n*1e3;function uL(n,t){if(n.length<2)return{x:0,y:0};let e=n.length-1,i=null;const s=n[n.length-1];for(;e>=0&&(i=n[e],!(s.timestamp-i.timestamp>hL(t)));)e--;if(!i)return{x:0,y:0};const r=(s.timestamp-i.timestamp)/1e3;if(r===0)return{x:0,y:0};const a={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function fL(...n){return t=>n.reduce((e,i)=>i(e),t)}function Yy(n,t){return Math.abs(n-t)}function hb(n){return"x"in n&&"y"in n}function dL(n,t){if(typeof n=="number"&&typeof t=="number")return Yy(n,t);if(hb(n)&&hb(t)){const e=Yy(n.x,t.x),i=Yy(n.y,t.y);return Math.sqrt(e**2+i**2)}return 0}function pL(n,t){const{onPan:e,onPanStart:i,onPanEnd:s,onPanSessionStart:r,onPanSessionEnd:a,threshold:o}=t,l=!!(e||i||s||r||a),c=Z.useRef(null),h=UT({onSessionStart:r,onSessionEnd:a,onStart:i,onMove:e,onEnd(u,p){c.current=null,s==null||s(u,p)}});Z.useEffect(()=>{var u;(u=c.current)==null||u.updateHandlers(h.current)}),Z.useEffect(()=>{const u=n.current;if(!u||!l)return;function p(m){c.current=new cL(m,h.current,o)}return wm(u,"pointerdown",p)},[n,l,h,o]),Z.useEffect(()=>()=>{var u;(u=c.current)==null||u.end(),c.current=null},[])}function mL(n,t,e){var i,s;return((s=(i=n.__cssMap)==null?void 0:i[`${t}.${e}`])==null?void 0:s.varRef)??e}const gL=n=>n!=null&&parseInt(n.toString(),10)>0,ub={exit:{height:{duration:.2,ease:ou.ease},opacity:{duration:.3,ease:ou.ease}},enter:{height:{duration:.3,ease:ou.ease},opacity:{duration:.4,ease:ou.ease}}},yL={exit:({animateOpacity:n,startingHeight:t,transition:e,transitionEnd:i,delay:s})=>({...n&&{opacity:gL(t)?1:0},height:t,transitionEnd:i==null?void 0:i.exit,transition:(e==null?void 0:e.exit)??km.exit(ub.exit,s)}),enter:({animateOpacity:n,endingHeight:t,transition:e,transitionEnd:i,delay:s})=>({...n&&{opacity:1},height:t,transitionEnd:i==null?void 0:i.enter,transition:(e==null?void 0:e.enter)??km.enter(ub.enter,s)})},HT=Z.forwardRef((n,t)=>{const{in:e,unmountOnExit:i,animateOpacity:s=!0,startingHeight:r=0,endingHeight:a="auto",style:o,className:l,transition:c,transitionEnd:h,animatePresenceProps:u,...p}=n,[m,g]=Z.useState(!1);Z.useEffect(()=>{const b=setTimeout(()=>{g(!0)});return()=>clearTimeout(b)},[]),XI({condition:Number(r)>0&&!!i,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const x=parseFloat(r.toString())>0,y={startingHeight:r,endingHeight:a,animateOpacity:s,transition:m?c:{enter:{duration:0}},transitionEnd:{enter:h==null?void 0:h.enter,exit:i?h==null?void 0:h.exit:{...h==null?void 0:h.exit,display:x?"block":"none"}}},_=i?e:!0,M=e||i?"enter":"exit";return V.jsx(Nv,{...u,initial:!1,custom:y,children:_&&V.jsx(Ov.div,{ref:t,...p,className:rs("chakra-collapse",l),style:{overflow:"hidden",display:"block",...o},custom:y,variants:yL,initial:i?"exit":!1,animate:M,exit:"exit"})})});HT.displayName="Collapse";var _L=()=>typeof document<"u",fb=!1,xf=null,tl=!1,Hx=!1,Gx=new Set;function Vv(n,t){Gx.forEach(e=>e(n,t))}var xL=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function vL(n){return!(n.metaKey||!xL&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function db(n){tl=!0,vL(n)&&(xf="keyboard",Vv("keyboard",n))}function Nl(n){if(xf="pointer",n.type==="mousedown"||n.type==="pointerdown"){tl=!0;const t=n.composedPath?n.composedPath()[0]:n.target;let e=!1;try{e=t.matches(":focus-visible")}catch{}if(e)return;Vv("pointer",n)}}function ML(n){return n.mozInputSource===0&&n.isTrusted?!0:n.detail===0&&!n.pointerType}function wL(n){ML(n)&&(tl=!0,xf="virtual")}function bL(n){n.target===window||n.target===document||n.target instanceof Element&&n.target.hasAttribute("tabindex")||(!tl&&!Hx&&(xf="virtual",Vv("virtual",n)),tl=!1,Hx=!1)}function SL(){tl=!1,Hx=!0}function pb(){return xf!=="pointer"}function EL(){if(!_L()||fb)return;const{focus:n}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...e){tl=!0,n.apply(this,e)},document.addEventListener("keydown",db,!0),document.addEventListener("keyup",db,!0),document.addEventListener("click",wL,!0),window.addEventListener("focus",bL,!0),window.addEventListener("blur",SL,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Nl,!0),document.addEventListener("pointermove",Nl,!0),document.addEventListener("pointerup",Nl,!0)):(document.addEventListener("mousedown",Nl,!0),document.addEventListener("mousemove",Nl,!0),document.addEventListener("mouseup",Nl,!0)),fb=!0}function AL(n){EL(),n(pb());const t=()=>n(pb());return Gx.add(t),()=>{Gx.delete(t)}}const TL={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function CL(n={}){const t=SI(n),{isDisabled:e,isReadOnly:i,isRequired:s,isInvalid:r,id:a,onBlur:o,onFocus:l,"aria-describedby":c}=t,{defaultChecked:h,isChecked:u,isFocusable:p,onChange:m,isIndeterminate:g,name:x,value:y,tabIndex:_=void 0,"aria-label":M,"aria-labelledby":b,"aria-invalid":S,...P}=n,C=AT(P,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),T=vr(m),L=vr(o),N=vr(l),[E,R]=Z.useState(!1),[z,G]=Z.useState(!1),[W,tt]=Z.useState(!1),[X,at]=Z.useState(!1);Z.useEffect(()=>AL(R),[]);const H=Z.useRef(null),[J,st]=Z.useState(!0),[q,ct]=Z.useState(!!h),mt=u!==void 0,Y=mt?u:q,rt=Z.useCallback(dt=>{if(i||e){dt.preventDefault();return}mt||ct(Y?dt.currentTarget.checked:g?!0:dt.currentTarget.checked),T==null||T(dt)},[i,e,Y,mt,g,T]);Gy(()=>{H.current&&(H.current.indeterminate=!!g)},[g]),TT(()=>{e&&G(!1)},[e,G]),Gy(()=>{const dt=H.current;if(!(dt!=null&&dt.form))return;const St=()=>{ct(!!h)};return dt.form.addEventListener("reset",St),()=>{var Tt;return(Tt=dt.form)==null?void 0:Tt.removeEventListener("reset",St)}},[]);const wt=e&&!p,_t=Z.useCallback(dt=>{dt.key===" "&&at(!0)},[at]),Nt=Z.useCallback(dt=>{dt.key===" "&&at(!1)},[at]);Gy(()=>{if(!H.current)return;H.current.checked!==Y&&ct(H.current.checked)},[H.current]);const Bt=Z.useCallback((dt={},St=null)=>{const Tt=Ht=>{z&&Ht.preventDefault(),at(!0)};return{...dt,ref:St,"data-active":$e(X),"data-hover":$e(W),"data-checked":$e(Y),"data-focus":$e(z),"data-focus-visible":$e(z&&E),"data-indeterminate":$e(g),"data-disabled":$e(e),"data-invalid":$e(r),"data-readonly":$e(i),"aria-hidden":!0,onMouseDown:Ln(dt.onMouseDown,Tt),onMouseUp:Ln(dt.onMouseUp,()=>at(!1)),onMouseEnter:Ln(dt.onMouseEnter,()=>tt(!0)),onMouseLeave:Ln(dt.onMouseLeave,()=>tt(!1))}},[X,Y,e,z,E,W,g,r,i]),Vt=Z.useCallback((dt={},St=null)=>({...dt,ref:St,"data-active":$e(X),"data-hover":$e(W),"data-checked":$e(Y),"data-focus":$e(z),"data-focus-visible":$e(z&&E),"data-indeterminate":$e(g),"data-disabled":$e(e),"data-invalid":$e(r),"data-readonly":$e(i)}),[X,Y,e,z,E,W,g,r,i]),Xt=Z.useCallback((dt={},St=null)=>({...C,...dt,ref:za(St,Tt=>{Tt&&st(Tt.tagName==="LABEL")}),htmlFor:dt.htmlFor!==void 0?dt.htmlFor:J?a:void 0,onClick:Ln(dt.onClick,()=>{var Tt;J||((Tt=H.current)==null||Tt.click(),requestAnimationFrame(()=>{var Ht;(Ht=H.current)==null||Ht.focus({preventScroll:!0})}))}),"data-disabled":$e(e),"data-checked":$e(Y),"data-invalid":$e(r)}),[C,e,Y,r,J,a]),lt=Z.useCallback((dt={},St=null)=>({...dt,ref:za(H,St),type:"checkbox",name:x,value:y,id:a,tabIndex:_,onChange:Ln(dt.onChange,rt),onBlur:Ln(dt.onBlur,L,()=>G(!1)),onFocus:Ln(dt.onFocus,N,()=>G(!0)),onKeyDown:Ln(dt.onKeyDown,_t),onKeyUp:Ln(dt.onKeyUp,Nt),required:s,checked:Y,disabled:wt,readOnly:i,"aria-label":M,"aria-labelledby":b,"aria-invalid":S?!!S:r,"aria-describedby":c,"aria-disabled":e,style:TL}),[x,y,a,rt,L,N,_t,Nt,s,Y,wt,i,M,b,S,r,c,e,_]),U=Z.useCallback((dt={},St=null)=>({...dt,ref:St,onMouseDown:Ln(dt.onMouseDown,RL),"data-disabled":$e(e),"data-checked":$e(Y),"data-invalid":$e(r)}),[Y,e,r]);return{state:{isInvalid:r,isFocused:z,isChecked:Y,isActive:X,isHovered:W,isIndeterminate:g,isDisabled:e,isReadOnly:i,isRequired:s},getRootProps:Xt,getCheckboxProps:Bt,getIndicatorProps:Vt,getInputProps:lt,getLabelProps:U,htmlProps:C}}function RL(n){n.preventDefault(),n.stopPropagation()}const gu=zi(function(t,e){const i=CT("FormLabel",t),s=gf(t),{className:r,children:a,requiredIndicator:o=V.jsx(GT,{}),optionalIndicator:l=null,...c}=s,h=DT(),u=(h==null?void 0:h.getLabelProps(c,e))??{ref:e,...c};return V.jsxs(an.label,{...u,className:rs("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...i},children:[a,h!=null&&h.isRequired?o:l]})});gu.displayName="FormLabel";const GT=zi(function(t,e){const i=DT(),s=EI();if(!(i!=null&&i.isRequired))return null;const r=rs("chakra-form__required-indicator",t.className);return V.jsx(an.span,{...i==null?void 0:i.getRequiredIndicatorProps(t,e),__css:s.requiredIndicator,className:r})});GT.displayName="RequiredIndicator";var Ui="top",ws="bottom",bs="right",ki="left",Wv="auto",vf=[Ui,ws,bs,ki],zc="start",zu="end",PL="clippingParents",VT="viewport",Uh="popper",IL="reference",mb=vf.reduce(function(n,t){return n.concat([t+"-"+zc,t+"-"+zu])},[]),WT=[].concat(vf,[Wv]).reduce(function(n,t){return n.concat([t,t+"-"+zc,t+"-"+zu])},[]),LL="beforeRead",DL="read",NL="afterRead",OL="beforeMain",FL="main",UL="afterMain",kL="beforeWrite",zL="write",BL="afterWrite",HL=[LL,DL,NL,OL,FL,UL,kL,zL,BL];function Cr(n){return n?(n.nodeName||"").toLowerCase():null}function is(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function el(n){var t=is(n).Element;return n instanceof t||n instanceof Element}function Ms(n){var t=is(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function jv(n){if(typeof ShadowRoot>"u")return!1;var t=is(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function GL(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},s=t.attributes[e]||{},r=t.elements[e];!Ms(r)||!Cr(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(a){var o=s[a];o===!1?r.removeAttribute(a):r.setAttribute(a,o===!0?"":o)}))})}function VL(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(i){var s=t.elements[i],r=t.attributes[i]||{},a=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:e[i]),o=a.reduce(function(l,c){return l[c]="",l},{});!Ms(s)||!Cr(s)||(Object.assign(s.style,o),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const WL={name:"applyStyles",enabled:!0,phase:"write",fn:GL,effect:VL,requires:["computeStyles"]};function Mr(n){return n.split("-")[0]}var qo=Math.max,Bm=Math.min,Bc=Math.round;function Vx(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function jT(){return!/^((?!chrome|android).)*safari/i.test(Vx())}function Hc(n,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var i=n.getBoundingClientRect(),s=1,r=1;t&&Ms(n)&&(s=n.offsetWidth>0&&Bc(i.width)/n.offsetWidth||1,r=n.offsetHeight>0&&Bc(i.height)/n.offsetHeight||1);var a=el(n)?is(n):window,o=a.visualViewport,l=!jT()&&e,c=(i.left+(l&&o?o.offsetLeft:0))/s,h=(i.top+(l&&o?o.offsetTop:0))/r,u=i.width/s,p=i.height/r;return{width:u,height:p,top:h,right:c+u,bottom:h+p,left:c,x:c,y:h}}function Xv(n){var t=Hc(n),e=n.offsetWidth,i=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:i}}function XT(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&jv(e)){var i=t;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function oa(n){return is(n).getComputedStyle(n)}function jL(n){return["table","td","th"].indexOf(Cr(n))>=0}function Ja(n){return((el(n)?n.ownerDocument:n.document)||window.document).documentElement}function G0(n){return Cr(n)==="html"?n:n.assignedSlot||n.parentNode||(jv(n)?n.host:null)||Ja(n)}function gb(n){return!Ms(n)||oa(n).position==="fixed"?null:n.offsetParent}function XL(n){var t=/firefox/i.test(Vx()),e=/Trident/i.test(Vx());if(e&&Ms(n)){var i=oa(n);if(i.position==="fixed")return null}var s=G0(n);for(jv(s)&&(s=s.host);Ms(s)&&["html","body"].indexOf(Cr(s))<0;){var r=oa(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function Mf(n){for(var t=is(n),e=gb(n);e&&jL(e)&&oa(e).position==="static";)e=gb(e);return e&&(Cr(e)==="html"||Cr(e)==="body"&&oa(e).position==="static")?t:e||XL(n)||t}function qv(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function yu(n,t,e){return qo(n,Bm(t,e))}function qL(n,t,e){var i=yu(n,t,e);return i>e?e:i}function qT(){return{top:0,right:0,bottom:0,left:0}}function $T(n){return Object.assign({},qT(),n)}function YT(n,t){return t.reduce(function(e,i){return e[i]=n,e},{})}var $L=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,$T(typeof t!="number"?t:YT(t,vf))};function YL(n){var t,e=n.state,i=n.name,s=n.options,r=e.elements.arrow,a=e.modifiersData.popperOffsets,o=Mr(e.placement),l=qv(o),c=[ki,bs].indexOf(o)>=0,h=c?"height":"width";if(!(!r||!a)){var u=$L(s.padding,e),p=Xv(r),m=l==="y"?Ui:ki,g=l==="y"?ws:bs,x=e.rects.reference[h]+e.rects.reference[l]-a[l]-e.rects.popper[h],y=a[l]-e.rects.reference[l],_=Mf(r),M=_?l==="y"?_.clientHeight||0:_.clientWidth||0:0,b=x/2-y/2,S=u[m],P=M-p[h]-u[g],C=M/2-p[h]/2+b,T=yu(S,C,P),L=l;e.modifiersData[i]=(t={},t[L]=T,t.centerOffset=T-C,t)}}function ZL(n){var t=n.state,e=n.options,i=e.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||XT(t.elements.popper,s)&&(t.elements.arrow=s))}const KL={name:"arrow",enabled:!0,phase:"main",fn:YL,effect:ZL,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Gc(n){return n.split("-")[1]}var JL={top:"auto",right:"auto",bottom:"auto",left:"auto"};function QL(n,t){var e=n.x,i=n.y,s=t.devicePixelRatio||1;return{x:Bc(e*s)/s||0,y:Bc(i*s)/s||0}}function yb(n){var t,e=n.popper,i=n.popperRect,s=n.placement,r=n.variation,a=n.offsets,o=n.position,l=n.gpuAcceleration,c=n.adaptive,h=n.roundOffsets,u=n.isFixed,p=a.x,m=p===void 0?0:p,g=a.y,x=g===void 0?0:g,y=typeof h=="function"?h({x:m,y:x}):{x:m,y:x};m=y.x,x=y.y;var _=a.hasOwnProperty("x"),M=a.hasOwnProperty("y"),b=ki,S=Ui,P=window;if(c){var C=Mf(e),T="clientHeight",L="clientWidth";if(C===is(e)&&(C=Ja(e),oa(C).position!=="static"&&o==="absolute"&&(T="scrollHeight",L="scrollWidth")),C=C,s===Ui||(s===ki||s===bs)&&r===zu){S=ws;var N=u&&C===P&&P.visualViewport?P.visualViewport.height:C[T];x-=N-i.height,x*=l?1:-1}if(s===ki||(s===Ui||s===ws)&&r===zu){b=bs;var E=u&&C===P&&P.visualViewport?P.visualViewport.width:C[L];m-=E-i.width,m*=l?1:-1}}var R=Object.assign({position:o},c&&JL),z=h===!0?QL({x:m,y:x},is(e)):{x:m,y:x};if(m=z.x,x=z.y,l){var G;return Object.assign({},R,(G={},G[S]=M?"0":"",G[b]=_?"0":"",G.transform=(P.devicePixelRatio||1)<=1?"translate("+m+"px, "+x+"px)":"translate3d("+m+"px, "+x+"px, 0)",G))}return Object.assign({},R,(t={},t[S]=M?x+"px":"",t[b]=_?m+"px":"",t.transform="",t))}function tD(n){var t=n.state,e=n.options,i=e.gpuAcceleration,s=i===void 0?!0:i,r=e.adaptive,a=r===void 0?!0:r,o=e.roundOffsets,l=o===void 0?!0:o,c={placement:Mr(t.placement),variation:Gc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,yb(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,yb(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const eD={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:tD,data:{}};var Yd={passive:!0};function nD(n){var t=n.state,e=n.instance,i=n.options,s=i.scroll,r=s===void 0?!0:s,a=i.resize,o=a===void 0?!0:a,l=is(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(h){h.addEventListener("scroll",e.update,Yd)}),o&&l.addEventListener("resize",e.update,Yd),function(){r&&c.forEach(function(h){h.removeEventListener("scroll",e.update,Yd)}),o&&l.removeEventListener("resize",e.update,Yd)}}const iD={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:nD,data:{}};var sD={left:"right",right:"left",bottom:"top",top:"bottom"};function bm(n){return n.replace(/left|right|bottom|top/g,function(t){return sD[t]})}var rD={start:"end",end:"start"};function _b(n){return n.replace(/start|end/g,function(t){return rD[t]})}function $v(n){var t=is(n),e=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:e,scrollTop:i}}function Yv(n){return Hc(Ja(n)).left+$v(n).scrollLeft}function aD(n,t){var e=is(n),i=Ja(n),s=e.visualViewport,r=i.clientWidth,a=i.clientHeight,o=0,l=0;if(s){r=s.width,a=s.height;var c=jT();(c||!c&&t==="fixed")&&(o=s.offsetLeft,l=s.offsetTop)}return{width:r,height:a,x:o+Yv(n),y:l}}function oD(n){var t,e=Ja(n),i=$v(n),s=(t=n.ownerDocument)==null?void 0:t.body,r=qo(e.scrollWidth,e.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=qo(e.scrollHeight,e.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),o=-i.scrollLeft+Yv(n),l=-i.scrollTop;return oa(s||e).direction==="rtl"&&(o+=qo(e.clientWidth,s?s.clientWidth:0)-r),{width:r,height:a,x:o,y:l}}function Zv(n){var t=oa(n),e=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+s+i)}function ZT(n){return["html","body","#document"].indexOf(Cr(n))>=0?n.ownerDocument.body:Ms(n)&&Zv(n)?n:ZT(G0(n))}function _u(n,t){var e;t===void 0&&(t=[]);var i=ZT(n),s=i===((e=n.ownerDocument)==null?void 0:e.body),r=is(i),a=s?[r].concat(r.visualViewport||[],Zv(i)?i:[]):i,o=t.concat(a);return s?o:o.concat(_u(G0(a)))}function Wx(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function lD(n,t){var e=Hc(n,!1,t==="fixed");return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function xb(n,t,e){return t===VT?Wx(aD(n,e)):el(t)?lD(t,e):Wx(oD(Ja(n)))}function cD(n){var t=_u(G0(n)),e=["absolute","fixed"].indexOf(oa(n).position)>=0,i=e&&Ms(n)?Mf(n):n;return el(i)?t.filter(function(s){return el(s)&&XT(s,i)&&Cr(s)!=="body"}):[]}function hD(n,t,e,i){var s=t==="clippingParents"?cD(n):[].concat(t),r=[].concat(s,[e]),a=r[0],o=r.reduce(function(l,c){var h=xb(n,c,i);return l.top=qo(h.top,l.top),l.right=Bm(h.right,l.right),l.bottom=Bm(h.bottom,l.bottom),l.left=qo(h.left,l.left),l},xb(n,a,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function KT(n){var t=n.reference,e=n.element,i=n.placement,s=i?Mr(i):null,r=i?Gc(i):null,a=t.x+t.width/2-e.width/2,o=t.y+t.height/2-e.height/2,l;switch(s){case Ui:l={x:a,y:t.y-e.height};break;case ws:l={x:a,y:t.y+t.height};break;case bs:l={x:t.x+t.width,y:o};break;case ki:l={x:t.x-e.width,y:o};break;default:l={x:t.x,y:t.y}}var c=s?qv(s):null;if(c!=null){var h=c==="y"?"height":"width";switch(r){case zc:l[c]=l[c]-(t[h]/2-e[h]/2);break;case zu:l[c]=l[c]+(t[h]/2-e[h]/2);break}}return l}function Bu(n,t){t===void 0&&(t={});var e=t,i=e.placement,s=i===void 0?n.placement:i,r=e.strategy,a=r===void 0?n.strategy:r,o=e.boundary,l=o===void 0?PL:o,c=e.rootBoundary,h=c===void 0?VT:c,u=e.elementContext,p=u===void 0?Uh:u,m=e.altBoundary,g=m===void 0?!1:m,x=e.padding,y=x===void 0?0:x,_=$T(typeof y!="number"?y:YT(y,vf)),M=p===Uh?IL:Uh,b=n.rects.popper,S=n.elements[g?M:p],P=hD(el(S)?S:S.contextElement||Ja(n.elements.popper),l,h,a),C=Hc(n.elements.reference),T=KT({reference:C,element:b,strategy:"absolute",placement:s}),L=Wx(Object.assign({},b,T)),N=p===Uh?L:C,E={top:P.top-N.top+_.top,bottom:N.bottom-P.bottom+_.bottom,left:P.left-N.left+_.left,right:N.right-P.right+_.right},R=n.modifiersData.offset;if(p===Uh&&R){var z=R[s];Object.keys(E).forEach(function(G){var W=[bs,ws].indexOf(G)>=0?1:-1,tt=[Ui,ws].indexOf(G)>=0?"y":"x";E[G]+=z[tt]*W})}return E}function uD(n,t){t===void 0&&(t={});var e=t,i=e.placement,s=e.boundary,r=e.rootBoundary,a=e.padding,o=e.flipVariations,l=e.allowedAutoPlacements,c=l===void 0?WT:l,h=Gc(i),u=h?o?mb:mb.filter(function(g){return Gc(g)===h}):vf,p=u.filter(function(g){return c.indexOf(g)>=0});p.length===0&&(p=u);var m=p.reduce(function(g,x){return g[x]=Bu(n,{placement:x,boundary:s,rootBoundary:r,padding:a})[Mr(x)],g},{});return Object.keys(m).sort(function(g,x){return m[g]-m[x]})}function fD(n){if(Mr(n)===Wv)return[];var t=bm(n);return[_b(n),t,_b(t)]}function dD(n){var t=n.state,e=n.options,i=n.name;if(!t.modifiersData[i]._skip){for(var s=e.mainAxis,r=s===void 0?!0:s,a=e.altAxis,o=a===void 0?!0:a,l=e.fallbackPlacements,c=e.padding,h=e.boundary,u=e.rootBoundary,p=e.altBoundary,m=e.flipVariations,g=m===void 0?!0:m,x=e.allowedAutoPlacements,y=t.options.placement,_=Mr(y),M=_===y,b=l||(M||!g?[bm(y)]:fD(y)),S=[y].concat(b).reduce(function(Y,rt){return Y.concat(Mr(rt)===Wv?uD(t,{placement:rt,boundary:h,rootBoundary:u,padding:c,flipVariations:g,allowedAutoPlacements:x}):rt)},[]),P=t.rects.reference,C=t.rects.popper,T=new Map,L=!0,N=S[0],E=0;E=0,tt=W?"width":"height",X=Bu(t,{placement:R,boundary:h,rootBoundary:u,altBoundary:p,padding:c}),at=W?G?bs:ki:G?ws:Ui;P[tt]>C[tt]&&(at=bm(at));var H=bm(at),J=[];if(r&&J.push(X[z]<=0),o&&J.push(X[at]<=0,X[H]<=0),J.every(function(Y){return Y})){N=R,L=!1;break}T.set(R,J)}if(L)for(var st=g?3:1,q=function(rt){var wt=S.find(function(_t){var Nt=T.get(_t);if(Nt)return Nt.slice(0,rt).every(function(Bt){return Bt})});if(wt)return N=wt,"break"},ct=st;ct>0;ct--){var mt=q(ct);if(mt==="break")break}t.placement!==N&&(t.modifiersData[i]._skip=!0,t.placement=N,t.reset=!0)}}const pD={name:"flip",enabled:!0,phase:"main",fn:dD,requiresIfExists:["offset"],data:{_skip:!1}};function vb(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function Mb(n){return[Ui,bs,ws,ki].some(function(t){return n[t]>=0})}function mD(n){var t=n.state,e=n.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,a=Bu(t,{elementContext:"reference"}),o=Bu(t,{altBoundary:!0}),l=vb(a,i),c=vb(o,s,r),h=Mb(l),u=Mb(c);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":u})}const gD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:mD};function yD(n,t,e){var i=Mr(n),s=[ki,Ui].indexOf(i)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,a=r[0],o=r[1];return a=a||0,o=(o||0)*s,[ki,bs].indexOf(i)>=0?{x:o,y:a}:{x:a,y:o}}function _D(n){var t=n.state,e=n.options,i=n.name,s=e.offset,r=s===void 0?[0,0]:s,a=WT.reduce(function(h,u){return h[u]=yD(u,t.rects,r),h},{}),o=a[t.placement],l=o.x,c=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=a}const xD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:_D};function vD(n){var t=n.state,e=n.name;t.modifiersData[e]=KT({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const MD={name:"popperOffsets",enabled:!0,phase:"read",fn:vD,data:{}};function wD(n){return n==="x"?"y":"x"}function bD(n){var t=n.state,e=n.options,i=n.name,s=e.mainAxis,r=s===void 0?!0:s,a=e.altAxis,o=a===void 0?!1:a,l=e.boundary,c=e.rootBoundary,h=e.altBoundary,u=e.padding,p=e.tether,m=p===void 0?!0:p,g=e.tetherOffset,x=g===void 0?0:g,y=Bu(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:h}),_=Mr(t.placement),M=Gc(t.placement),b=!M,S=qv(_),P=wD(S),C=t.modifiersData.popperOffsets,T=t.rects.reference,L=t.rects.popper,N=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,E=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,z={x:0,y:0};if(C){if(r){var G,W=S==="y"?Ui:ki,tt=S==="y"?ws:bs,X=S==="y"?"height":"width",at=C[S],H=at+y[W],J=at-y[tt],st=m?-L[X]/2:0,q=M===zc?T[X]:L[X],ct=M===zc?-L[X]:-T[X],mt=t.elements.arrow,Y=m&&mt?Xv(mt):{width:0,height:0},rt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:qT(),wt=rt[W],_t=rt[tt],Nt=yu(0,T[X],Y[X]),Bt=b?T[X]/2-st-Nt-wt-E.mainAxis:q-Nt-wt-E.mainAxis,Vt=b?-T[X]/2+st+Nt+_t+E.mainAxis:ct+Nt+_t+E.mainAxis,Xt=t.elements.arrow&&Mf(t.elements.arrow),lt=Xt?S==="y"?Xt.clientTop||0:Xt.clientLeft||0:0,U=(G=R==null?void 0:R[S])!=null?G:0,Ct=at+Bt-U-lt,dt=at+Vt-U,St=yu(m?Bm(H,Ct):H,at,m?qo(J,dt):J);C[S]=St,z[S]=St-at}if(o){var Tt,Ht=S==="x"?Ui:ki,Ft=S==="x"?ws:bs,k=C[P],D=P==="y"?"height":"width",it=k+y[Ht],vt=k-y[Ft],Et=[Ui,ki].indexOf(_)!==-1,bt=(Tt=R==null?void 0:R[P])!=null?Tt:0,ee=Et?it:k-T[D]-L[D]-bt+E.altAxis,Ut=Et?k+T[D]+L[D]-bt-E.altAxis:vt,qt=m&&Et?qL(ee,k,Ut):yu(m?ee:it,k,m?Ut:vt);C[P]=qt,z[P]=qt-k}t.modifiersData[i]=z}}const SD={name:"preventOverflow",enabled:!0,phase:"main",fn:bD,requiresIfExists:["offset"]};function ED(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function AD(n){return n===is(n)||!Ms(n)?$v(n):ED(n)}function TD(n){var t=n.getBoundingClientRect(),e=Bc(t.width)/n.offsetWidth||1,i=Bc(t.height)/n.offsetHeight||1;return e!==1||i!==1}function CD(n,t,e){e===void 0&&(e=!1);var i=Ms(t),s=Ms(t)&&TD(t),r=Ja(t),a=Hc(n,s,e),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!e)&&((Cr(t)!=="body"||Zv(r))&&(o=AD(t)),Ms(t)?(l=Hc(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=Yv(r))),{x:a.left+o.scrollLeft-l.x,y:a.top+o.scrollTop-l.y,width:a.width,height:a.height}}function RD(n){var t=new Map,e=new Set,i=[];n.forEach(function(r){t.set(r.name,r)});function s(r){e.add(r.name);var a=[].concat(r.requires||[],r.requiresIfExists||[]);a.forEach(function(o){if(!e.has(o)){var l=t.get(o);l&&s(l)}}),i.push(r)}return n.forEach(function(r){e.has(r.name)||s(r)}),i}function PD(n){var t=RD(n);return HL.reduce(function(e,i){return e.concat(t.filter(function(s){return s.phase===i}))},[])}function ID(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function LD(n){var t=n.reduce(function(e,i){var s=e[i.name];return e[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,e},{});return Object.keys(t).map(function(e){return t[e]})}var wb={placement:"bottom",modifiers:[],strategy:"absolute"};function bb(){for(var n=arguments.length,t=new Array(n),e=0;e({var:n,varRef:t?`var(${n}, ${t})`:`var(${n})`}),Yn={arrowShadowColor:Ol("--popper-arrow-shadow-color"),arrowSize:Ol("--popper-arrow-size","8px"),arrowSizeHalf:Ol("--popper-arrow-size-half"),arrowBg:Ol("--popper-arrow-bg"),transformOrigin:Ol("--popper-transform-origin"),arrowOffset:Ol("--popper-arrow-offset")};function FD(n){if(n.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(n.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(n.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(n.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}const UD={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},kD=n=>UD[n],Sb={scroll:!0,resize:!0};function zD(n){let t;return typeof n=="object"?t={enabled:!0,options:{...Sb,...n}}:t={enabled:n,options:Sb},t}const BD={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:n})=>{n.styles.popper.width=`${n.rects.reference.width}px`},effect:({state:n})=>()=>{const t=n.elements.reference;n.elements.popper.style.width=`${t.offsetWidth}px`}},HD={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:n})=>{Eb(n)},effect:({state:n})=>()=>{Eb(n)}},Eb=n=>{n.elements.popper.style.setProperty(Yn.transformOrigin.var,kD(n.placement))},GD={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:n})=>{VD(n)}},VD=n=>{var e;if(!n.placement)return;const t=WD(n.placement);if((e=n.elements)!=null&&e.arrow&&t){Object.assign(n.elements.arrow.style,{[t.property]:t.value,width:Yn.arrowSize.varRef,height:Yn.arrowSize.varRef,zIndex:-1});const i={[Yn.arrowSizeHalf.var]:`calc(${Yn.arrowSize.varRef} / 2 - 1px)`,[Yn.arrowOffset.var]:`calc(${Yn.arrowSizeHalf.varRef} * -1)`};for(const s in i)n.elements.arrow.style.setProperty(s,i[s])}},WD=n=>{if(n.startsWith("top"))return{property:"bottom",value:Yn.arrowOffset.varRef};if(n.startsWith("bottom"))return{property:"top",value:Yn.arrowOffset.varRef};if(n.startsWith("left"))return{property:"right",value:Yn.arrowOffset.varRef};if(n.startsWith("right"))return{property:"left",value:Yn.arrowOffset.varRef}},jD={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:n})=>{Ab(n)},effect:({state:n})=>()=>{Ab(n)}},Ab=n=>{if(!n.elements.arrow)return;const t=n.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const e=FD(n.placement);e&&t.style.setProperty("--popper-arrow-default-shadow",e),Object.assign(t.style,{transform:"rotate(45deg)",background:Yn.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},XD={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},qD={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function $D(n,t="ltr"){var i;const e=((i=XD[n])==null?void 0:i[t])||n;return t==="ltr"?e:qD[n]??e}function YD(n={}){const{enabled:t=!0,modifiers:e,placement:i="bottom",strategy:s="absolute",arrowPadding:r=8,eventListeners:a=!0,offset:o,gutter:l=8,flip:c=!0,boundary:h="clippingParents",preventOverflow:u=!0,matchWidth:p,direction:m="ltr"}=n,g=Z.useRef(null),x=Z.useRef(null),y=Z.useRef(null),_=$D(i,m),M=Z.useRef(()=>{}),b=Z.useCallback(()=>{var E;!t||!g.current||!x.current||((E=M.current)==null||E.call(M),y.current=OD(g.current,x.current,{placement:_,modifiers:[jD,GD,HD,{...BD,enabled:!!p},{name:"eventListeners",...zD(a)},{name:"arrow",options:{padding:r}},{name:"offset",options:{offset:o??[0,l]}},{name:"flip",enabled:!!c,options:{padding:8}},{name:"preventOverflow",enabled:!!u,options:{boundary:h}},...e??[]],strategy:s}),y.current.forceUpdate(),M.current=y.current.destroy)},[_,t,e,p,a,r,o,l,c,u,h,s]);Z.useEffect(()=>()=>{var E;!g.current&&!x.current&&((E=y.current)==null||E.destroy(),y.current=null)},[]);const S=Z.useCallback(E=>{g.current=E,b()},[b]),P=Z.useCallback((E={},R=null)=>({...E,ref:za(S,R)}),[S]),C=Z.useCallback(E=>{x.current=E,b()},[b]),T=Z.useCallback((E={},R=null)=>({...E,ref:za(C,R),style:{...E.style,position:s,minWidth:p?void 0:"max-content",inset:"0 auto auto 0"}}),[s,C,p]),L=Z.useCallback((E={},R=null)=>{const{size:z,shadowColor:G,bg:W,style:tt,...X}=E;return{...X,ref:R,"data-popper-arrow":"",style:ZD(E)}},[]),N=Z.useCallback((E={},R=null)=>({...E,ref:R,"data-popper-arrow-inner":""}),[]);return{update(){var E;(E=y.current)==null||E.update()},forceUpdate(){var E;(E=y.current)==null||E.forceUpdate()},transformOrigin:Yn.transformOrigin.varRef,referenceRef:S,popperRef:C,getPopperProps:T,getArrowProps:L,getArrowInnerProps:N,getReferenceProps:P}}function ZD(n){const{size:t,shadowColor:e,bg:i,style:s}=n,r={...s,position:"absolute"};return t&&(r["--popper-arrow-size"]=t),e&&(r["--popper-arrow-shadow-color"]=e),i&&(r["--popper-arrow-bg"]=i),r}const[KD,JD]=k0(),QD={start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}};function tN(n,t){var e;if(n)return((e=QD[n])==null?void 0:e[t])??n}function eN(n){var c;const{isOpen:t,onClose:e,placement:i="right",children:s,...r}=n,a=Fv(),o=(c=a.components)==null?void 0:c.Drawer,l=tN(i,a.direction);return V.jsx(KD,{value:{placement:l},children:V.jsx(kv,{isOpen:t,onClose:e,styleConfig:o,...r,children:s})})}const Tb={exit:{duration:.15,ease:ou.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},nN={exit:({direction:n,transition:t,transitionEnd:e,delay:i})=>{const{exit:s}=kx({direction:n});return{...s,transition:(t==null?void 0:t.exit)??km.exit(Tb.exit,i),transitionEnd:e==null?void 0:e.exit}},enter:({direction:n,transitionEnd:t,transition:e,delay:i})=>{const{enter:s}=kx({direction:n});return{...s,transition:(e==null?void 0:e.enter)??km.enter(Tb.enter,i),transitionEnd:t==null?void 0:t.enter}}},JT=Z.forwardRef(function(t,e){const{direction:i="right",style:s,unmountOnExit:r,in:a,className:o,transition:l,transitionEnd:c,delay:h,motionProps:u,animatePresenceProps:p,...m}=t,g=kx({direction:i}),x=Object.assign({position:"fixed"},g.position,s),y=r?a&&r:!0,_=a||r?"enter":"exit",M={transitionEnd:c,transition:l,direction:i,delay:h};return V.jsx(Nv,{...p,custom:M,children:y&&V.jsx(Ov.div,{...m,ref:e,initial:"exit",className:rs("chakra-slide",o),animate:_,exit:"exit",custom:M,variants:nN,style:x,...u})})});JT.displayName="Slide";const iN=an(JT),QT=zi((n,t)=>{const{className:e,children:i,motionProps:s,containerProps:r,...a}=n,{getDialogProps:o,getDialogContainerProps:l,isOpen:c}=xI(),h=o(a,t),u=l(r),p=rs("chakra-modal__content",e),m=vI(),g={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},x={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{placement:y}=JD();return V.jsx(MI,{children:V.jsx(an.div,{...u,className:"chakra-modal__content-container",__css:x,children:V.jsx(iN,{motionProps:s,direction:y,in:c,className:p,...h,__css:g,children:i})})})});QT.displayName="DrawerContent";function sN(n,t,e){return(n-t)*100/(e-t)}z0({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});z0({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});const rN=z0({"0%":{left:"-40%"},"100%":{left:"100%"}}),aN=z0({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function oN(n){const{value:t=0,min:e,max:i,valueText:s,getValueText:r,isIndeterminate:a,role:o="progressbar"}=n,l=sN(t,e,i);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":i,"aria-valuemin":e,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof r=="function"?r(t,l):s})(),role:o},percent:l,value:t}}const[lN,cN]=k0({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),hN=zi((n,t)=>{const{min:e,max:i,value:s,isIndeterminate:r,role:a,...o}=n,l=oN({value:s,min:e,max:i,isIndeterminate:r,role:a}),h={height:"100%",...cN().filledTrack};return V.jsx(an.div,{ref:t,style:{width:`${l.percent}%`,...o.style},...l.bind,...o,__css:h})}),t2=zi((n,t)=>{var T;const{value:e,min:i=0,max:s=100,hasStripe:r,isAnimated:a,children:o,borderRadius:l,isIndeterminate:c,"aria-label":h,"aria-labelledby":u,"aria-valuetext":p,title:m,role:g,...x}=gf(n),y=Uv("Progress",n),_=l??((T=y.track)==null?void 0:T.borderRadius),M={animation:`${aN} 1s linear infinite`},P={...!c&&r&&a&&M,...c&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${rN} 1s ease infinite normal none running`}},C={overflow:"hidden",position:"relative",...y.track};return V.jsx(an.div,{ref:t,borderRadius:_,__css:C,...x,children:V.jsxs(lN,{value:y,children:[V.jsx(hN,{"aria-label":h,"aria-labelledby":u,"aria-valuetext":p,min:i,max:s,value:e,isIndeterminate:c,css:P,borderRadius:_,title:m,role:g}),o]})})});t2.displayName="Progress";function Zd(n){const{orientation:t,vertical:e,horizontal:i}=n;return t==="vertical"?e:i}const Sm={width:0,height:0},Kd=n=>n||Sm;function uN(n){const{orientation:t,thumbPercents:e,thumbRects:i,isReversed:s}=n,r=x=>{const y=i[x]??Sm;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Zd({orientation:t,vertical:{bottom:`calc(${e[x]}% - ${y.height/2}px)`},horizontal:{left:`calc(${e[x]}% - ${y.width/2}px)`}})}},a=t==="vertical"?i.reduce((x,y)=>Kd(x).height>Kd(y).height?x:y,Sm):i.reduce((x,y)=>Kd(x).width>Kd(y).width?x:y,Sm),o={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Zd({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...Zd({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},c=e.length===1,h=[0,s?100-e[0]:e[0]],u=c?h:e;let p=u[0];!c&&s&&(p=100-p);const m=Math.abs(u[u.length-1]-u[0]),g={...l,...Zd({orientation:t,vertical:s?{height:`${m}%`,top:`${p}%`}:{height:`${m}%`,bottom:`${p}%`},horizontal:s?{width:`${m}%`,right:`${p}%`}:{width:`${m}%`,left:`${p}%`}})};return{trackStyle:l,innerTrackStyle:g,rootStyle:o,getThumbStyle:r}}function fN(n){const{isReversed:t,direction:e,orientation:i}=n;return e==="ltr"||i==="vertical"?t:!t}function dN(n){const{min:t=0,max:e=100,onChange:i,value:s,defaultValue:r,isReversed:a,direction:o="ltr",orientation:l="horizontal",id:c,isDisabled:h,isReadOnly:u,onChangeStart:p,onChangeEnd:m,step:g=1,getAriaValueText:x,"aria-valuetext":y,"aria-label":_,"aria-labelledby":M,name:b,focusThumbOnChange:S=!0,...P}=n,C=vr(p),T=vr(m),L=vr(x),N=fN({isReversed:a,direction:o,orientation:l}),[E,R]=qI({value:s,defaultValue:r??mN(t,e),onChange:i}),[z,G]=Z.useState(!1),[W,tt]=Z.useState(!1),X=!(h||u),at=(e-t)/10,H=g||(e-t)/100,J=Xy(E,t,e),st=e-J+t,ct=ab(N?st:J,t,e),mt=l==="vertical",Y=UT({min:t,max:e,step:g,isDisabled:h,value:J,isInteractive:X,isReversed:N,isVertical:mt,eventSource:null,focusThumbOnChange:S,orientation:l}),rt=Z.useRef(null),wt=Z.useRef(null),_t=Z.useRef(null),Nt=Z.useId(),Bt=c??Nt,[Vt,Xt]=[`slider-thumb-${Bt}`,`slider-track-${Bt}`],lt=Z.useCallback(gt=>{var ft;if(!rt.current)return;const It=Y.current;It.eventSource="pointer";const oe=rt.current.getBoundingClientRect(),{clientX:Wt,clientY:$}=((ft=gt.touches)==null?void 0:ft[0])??gt,Mt=mt?oe.bottom-$:Wt-oe.left,Gt=mt?oe.height:oe.width;let j=Mt/Gt;N&&(j=1-j);let Dt=VI(j,It.min,It.max);return It.step&&(Dt=parseFloat(ob(Dt,It.min,It.step))),Dt=Xy(Dt,It.min,It.max),Dt},[mt,N,Y]),U=Z.useCallback(gt=>{const It=Y.current;It.isInteractive&&(gt=parseFloat(ob(gt,It.min,H)),gt=Xy(gt,It.min,It.max),R(gt))},[H,R,Y]),Ct=Z.useMemo(()=>({stepUp(gt=H){const It=N?J-gt:J+gt;U(It)},stepDown(gt=H){const It=N?J+gt:J-gt;U(It)},reset(){U(r||0)},stepTo(gt){U(gt)}}),[U,N,J,H,r]),dt=Z.useCallback(gt=>{const It=Y.current,Wt={ArrowRight:()=>Ct.stepUp(),ArrowUp:()=>Ct.stepUp(),ArrowLeft:()=>Ct.stepDown(),ArrowDown:()=>Ct.stepDown(),PageUp:()=>Ct.stepUp(at),PageDown:()=>Ct.stepDown(at),Home:()=>U(It.min),End:()=>U(It.max)}[gt.key];Wt&&(gt.preventDefault(),gt.stopPropagation(),Wt(gt),It.eventSource="keyboard")},[Ct,U,at,Y]),St=(L==null?void 0:L(J))??y,Tt=QI(wt),{getThumbStyle:Ht,rootStyle:Ft,trackStyle:k,innerTrackStyle:D}=Z.useMemo(()=>{const gt=Y.current,It=Tt??{width:0,height:0};return uN({isReversed:N,orientation:gt.orientation,thumbRects:[It],thumbPercents:[ct]})},[N,Tt,ct,Y]),it=Z.useCallback(()=>{Y.current.focusThumbOnChange&&setTimeout(()=>{var It;return(It=wt.current)==null?void 0:It.focus()})},[Y]);TT(()=>{const gt=Y.current;it(),gt.eventSource==="keyboard"&&(T==null||T(gt.value))},[J,T]);function vt(gt){const It=lt(gt);It!=null&&It!==Y.current.value&&R(It)}pL(_t,{onPanSessionStart(gt){const It=Y.current;It.isInteractive&&(G(!0),it(),vt(gt),C==null||C(It.value))},onPanSessionEnd(){const gt=Y.current;gt.isInteractive&&(G(!1),T==null||T(gt.value))},onPan(gt){Y.current.isInteractive&&vt(gt)}});const Et=Z.useCallback((gt={},It=null)=>({...gt,...P,ref:za(It,_t),tabIndex:-1,"aria-disabled":Vy(h),"data-focused":$e(W),style:{...gt.style,...Ft}}),[P,h,W,Ft]),bt=Z.useCallback((gt={},It=null)=>({...gt,ref:za(It,rt),id:Xt,"data-disabled":$e(h),style:{...gt.style,...k}}),[h,Xt,k]),ee=Z.useCallback((gt={},It=null)=>({...gt,ref:It,style:{...gt.style,...D}}),[D]),Ut=Z.useCallback((gt={},It=null)=>({...gt,ref:za(It,wt),role:"slider",tabIndex:X?0:void 0,id:Vt,"data-active":$e(z),"aria-valuetext":St,"aria-valuemin":t,"aria-valuemax":e,"aria-valuenow":J,"aria-orientation":l,"aria-disabled":Vy(h),"aria-readonly":Vy(u),"aria-label":_,"aria-labelledby":_?void 0:M,style:{...gt.style,...Ht(0)},onKeyDown:Ln(gt.onKeyDown,dt),onFocus:Ln(gt.onFocus,()=>tt(!0)),onBlur:Ln(gt.onBlur,()=>tt(!1))}),[X,Vt,z,St,t,e,J,l,h,u,_,M,Ht,dt]),qt=Z.useCallback((gt,It=null)=>{const oe=!(gt.valuee),Wt=J>=gt.value,$=ab(gt.value,t,e),Mt={position:"absolute",pointerEvents:"none",...pN({orientation:l,vertical:{bottom:N?`${100-$}%`:`${$}%`},horizontal:{left:N?`${100-$}%`:`${$}%`}})};return{...gt,ref:It,role:"presentation","aria-hidden":!0,"data-disabled":$e(h),"data-invalid":$e(!oe),"data-highlighted":$e(Wt),style:{...gt.style,...Mt}}},[h,N,e,t,l,J]),Te=Z.useCallback((gt={},It=null)=>({...gt,ref:It,type:"hidden",value:J,name:b}),[b,J]);return{state:{value:J,isFocused:W,isDragging:z},actions:Ct,getRootProps:Et,getTrackProps:bt,getInnerTrackProps:ee,getThumbProps:Ut,getMarkerProps:qt,getInputProps:Te}}function pN(n){const{orientation:t,vertical:e,horizontal:i}=n;return t==="vertical"?e:i}function mN(n,t){return t"}),[yN,W0]=k0({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),e2=zi((n,t)=>{const e={...n,orientation:(n==null?void 0:n.orientation)??"horizontal"},i=Uv("Slider",e),s=gf(e),{direction:r}=Fv();s.direction=r;const{getInputProps:a,getRootProps:o,...l}=dN(s),c=o(),h=a({},t);return V.jsx(gN,{value:l,children:V.jsx(yN,{value:i,children:V.jsxs(an.div,{...c,className:rs("chakra-slider",e.className),__css:i.container,children:[e.children,V.jsx("input",{...h})]})})})});e2.displayName="Slider";const n2=zi((n,t)=>{const{getThumbProps:e}=V0(),i=W0(),s=e(n,t);return V.jsx(an.div,{...s,className:rs("chakra-slider__thumb",n.className),__css:i.thumb})});n2.displayName="SliderThumb";const i2=zi((n,t)=>{const{getTrackProps:e}=V0(),i=W0(),s=e(n,t);return V.jsx(an.div,{...s,className:rs("chakra-slider__track",n.className),__css:i.track})});i2.displayName="SliderTrack";const s2=zi((n,t)=>{const{getInnerTrackProps:e}=V0(),i=W0(),s=e(n,t);return V.jsx(an.div,{...s,className:rs("chakra-slider__filled-track",n.className),__css:i.filledTrack})});s2.displayName="SliderFilledTrack";const _N=zi((n,t)=>{const{getMarkerProps:e}=V0(),i=W0(),s=e(n,t);return V.jsx(an.div,{...s,className:rs("chakra-slider__marker",n.className),__css:i.mark})});_N.displayName="SliderMark";const r2=zi(function(t,e){const i=Uv("Switch",t),{spacing:s="0.5rem",children:r,...a}=gf(t),{getIndicatorProps:o,getInputProps:l,getCheckboxProps:c,getRootProps:h,getLabelProps:u}=CL(a),p=Z.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...i.container}),[i.container]),m=Z.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...i.track}),[i.track]),g=Z.useMemo(()=>({userSelect:"none",marginStart:s,...i.label}),[s,i.label]);return V.jsxs(an.label,{...h(),className:rs("chakra-switch",t.className),__css:p,children:[V.jsx("input",{className:"chakra-switch__input",...l({},e)}),V.jsx(an.span,{...c(),className:"chakra-switch__track",__css:m,children:V.jsx(an.span,{__css:i.thumb,className:"chakra-switch__thumb",...o()})}),r&&V.jsx(an.span,{className:"chakra-switch__label",...u(),__css:g,children:r})]})});r2.displayName="Switch";const xN={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},jx=n=>{var t;return((t=n.current)==null?void 0:t.ownerDocument)||document},Em=n=>{var t,e;return((e=(t=n.current)==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)||window};function vN(n={}){const{openDelay:t=0,closeDelay:e=0,closeOnClick:i=!0,closeOnMouseDown:s,closeOnScroll:r,closeOnPointerDown:a=s,closeOnEsc:o=!0,onOpen:l,onClose:c,placement:h,id:u,isOpen:p,defaultIsOpen:m,arrowSize:g=10,arrowShadowColor:x,arrowPadding:y,modifiers:_,isDisabled:M,gutter:b,offset:S,direction:P,...C}=n,{isOpen:T,onOpen:L,onClose:N}=Qo({isOpen:p,defaultIsOpen:m,onOpen:l,onClose:c}),{referenceRef:E,getPopperProps:R,getArrowInnerProps:z,getArrowProps:G}=YD({enabled:T,placement:h,arrowPadding:y,modifiers:_,gutter:b,offset:S,direction:P}),W=Z.useId(),X=`tooltip-${u??W}`,at=Z.useRef(null),H=Z.useRef(),J=Z.useCallback(()=>{H.current&&(clearTimeout(H.current),H.current=void 0)},[]),st=Z.useRef(),q=Z.useCallback(()=>{st.current&&(clearTimeout(st.current),st.current=void 0)},[]),ct=Z.useCallback(()=>{q(),N()},[N,q]),mt=MN(at,ct),Y=Z.useCallback(()=>{if(!M&&!H.current){T&&mt();const lt=Em(at);H.current=lt.setTimeout(L,t)}},[mt,M,T,L,t]),rt=Z.useCallback(()=>{J();const lt=Em(at);st.current=lt.setTimeout(ct,e)},[e,ct,J]),wt=Z.useCallback(()=>{T&&i&&rt()},[i,rt,T]),_t=Z.useCallback(()=>{T&&a&&rt()},[a,rt,T]),Nt=Z.useCallback(lt=>{T&<.key==="Escape"&&rt()},[T,rt]);qy(()=>jx(at),"keydown",o?Nt:void 0),qy(()=>{if(!r)return null;const lt=at.current;if(!lt)return null;const U=FT(lt);return U.localName==="body"?Em(at):U},"scroll",()=>{T&&r&&ct()},{passive:!0,capture:!0}),Z.useEffect(()=>{M&&(J(),T&&N())},[M,T,N,J]),Z.useEffect(()=>()=>{J(),q()},[J,q]),qy(()=>at.current,"pointerleave",rt);const Bt=Z.useCallback((lt={},U=null)=>({...lt,ref:za(at,U,E),onPointerEnter:Ln(lt.onPointerEnter,dt=>{dt.pointerType!=="touch"&&Y()}),onClick:Ln(lt.onClick,wt),onPointerDown:Ln(lt.onPointerDown,_t),onFocus:Ln(lt.onFocus,Y),onBlur:Ln(lt.onBlur,rt),"aria-describedby":T?X:void 0}),[Y,rt,_t,T,X,wt,E]),Vt=Z.useCallback((lt={},U=null)=>R({...lt,style:{...lt.style,[Yn.arrowSize.var]:g?`${g}px`:void 0,[Yn.arrowShadowColor.var]:x}},U),[R,g,x]),Xt=Z.useCallback((lt={},U=null)=>{const Ct={...lt.style,position:"relative",transformOrigin:Yn.transformOrigin.varRef};return{ref:U,...C,...lt,id:X,role:"tooltip",style:Ct}},[C,X]);return{isOpen:T,show:Y,hide:rt,getTriggerProps:Bt,getTooltipProps:Xt,getTooltipPositionerProps:Vt,getArrowProps:G,getArrowInnerProps:z}}const Zy="chakra-ui:close-tooltip";function MN(n,t){return Z.useEffect(()=>{const e=jx(n);return e.addEventListener(Zy,t),()=>e.removeEventListener(Zy,t)},[t,n]),()=>{const e=jx(n),i=Em(n);e.dispatchEvent(new i.CustomEvent(Zy))}}const wN=an(Ov.div),wf=zi((n,t)=>{const e=CT("Tooltip",n),i=gf(n),s=Fv(),{children:r,label:a,shouldWrapChildren:o,"aria-label":l,hasArrow:c,bg:h,portalProps:u,background:p,backgroundColor:m,bgColor:g,motionProps:x,animatePresenceProps:y,..._}=i,M=p??m??h??g;if(M){e.bg=M;const E=mL(s,"colors",M);e[Yn.arrowBg.var]=E}const b=vN({..._,direction:s.direction}),S=typeof r=="string"||o;let P;if(S)P=V.jsx(an.span,{display:"inline-block",tabIndex:0,...b.getTriggerProps(),children:r});else{const E=Z.Children.only(r);P=Z.cloneElement(E,b.getTriggerProps(E.props,E.ref))}const C=!!l,T=b.getTooltipProps({},t),L=C?AT(T,["role","id"]):T,N=lI(T,["role","id"]);return a?V.jsxs(V.Fragment,{children:[P,V.jsx(Nv,{...y,children:b.isOpen&&V.jsx(cI,{...u,children:V.jsx(an.div,{...b.getTooltipPositionerProps(),__css:{zIndex:e.zIndex,pointerEvents:"none"},children:V.jsxs(wN,{variants:xN,initial:"exit",animate:"enter",exit:"exit",...x,...L,__css:e,children:[a,C&&V.jsx(an.span,{srOnly:!0,...N,children:l}),c&&V.jsx(an.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:V.jsx(an.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:e.bg}})})]})})})})]}):V.jsx(V.Fragment,{children:r})});wf.displayName="Tooltip";const Kv=zi(function(t,e){const{spacing:i="0.5rem",spacingX:s,spacingY:r,children:a,justify:o,direction:l,align:c,className:h,shouldWrapChildren:u,...p}=t,m=Z.useMemo(()=>u?Z.Children.map(a,(g,x)=>V.jsx(a2,{children:g},x)):a,[a,u]);return V.jsx(an.div,{ref:e,className:rs("chakra-wrap",h),...p,children:V.jsx(an.ul,{className:"chakra-wrap__list",__css:{display:"flex",flexWrap:"wrap",justifyContent:o,alignItems:c,flexDirection:l,listStyleType:"none",gap:i,columnGap:s,rowGap:r,padding:"0"},children:m})})});Kv.displayName="Wrap";const a2=zi(function(t,e){const{className:i,...s}=t;return V.jsx(an.li,{ref:e,__css:{display:"flex",alignItems:"flex-start"},className:rs("chakra-wrap__listitem",i),...s})});a2.displayName="WrapItem";/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT @@ -3879,7 +3879,7 @@ Fläche: ${n.area.toPrecision(3)}m²`,position:e})]})},b6=n=>{const t=n.length/3 * SPDX-License-Identifier: MIT */const CR="161",fv=0,N6=1,O6=2,wE=1,bE=100,SE=204,EE=205,AE=3,F6=0,RR=300,TE=1e3,Xp=1001,CE=1002,RE=1003,U6=1006,k6=1008,z6=1009,B6=1014,H6=1015,G6=1020,V6=1023,$_=1026,PE=1027,W6=3e3,Y_=3001,j6=0,Lm="",zs="srgb",$1="srgb-linear",X6="display-p3",PR="display-p3-linear",dv="linear",IE="srgb",LE="rec709",DE="p3",nc=7680,NE=519,q6=515,OE=35044,qp=2e3,FE=2001;class Tg{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[t]===void 0&&(i[t]=[]),i[t].indexOf(e)===-1&&i[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const i=this._listeners;return i[t]!==void 0&&i[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const s=this._listeners[t];if(s!==void 0){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const i=this._listeners[t.type];if(i!==void 0){t.target=this;const s=i.slice(0);for(let r=0,a=s.length;r>8&255]+ai[n>>16&255]+ai[n>>24&255]+"-"+ai[t&255]+ai[t>>8&255]+"-"+ai[t>>16&15|64]+ai[t>>24&255]+"-"+ai[e&63|128]+ai[e>>8&255]+"-"+ai[e>>16&255]+ai[e>>24&255]+ai[i&255]+ai[i>>8&255]+ai[i>>16&255]+ai[i>>24&255]).toLowerCase()}function Di(n,t,e){return Math.max(t,Math.min(e,n))}function $6(n,t){return(n%t+t)%t}function Z_(n,t,e){return(1-e)*n+e*t}function Qh(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ri(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}class Si{constructor(t=0,e=0){Si.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Di(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*i-a*s+t.x,this.y=r*s+a*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class so{constructor(t,e,i,s,r,a,o,l,c){so.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,s,r,a,o,l,c)}set(t,e,i,s,r,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=s,h[2]=o,h[3]=e,h[4]=r,h[5]=l,h[6]=i,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,r=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],h=i[4],u=i[7],p=i[2],m=i[5],g=i[8],x=s[0],y=s[3],_=s[6],M=s[1],b=s[4],S=s[7],P=s[2],C=s[5],T=s[8];return r[0]=a*x+o*M+l*P,r[3]=a*y+o*b+l*C,r[6]=a*_+o*S+l*T,r[1]=c*x+h*M+u*P,r[4]=c*y+h*b+u*C,r[7]=c*_+h*S+u*T,r[2]=p*x+m*M+g*P,r[5]=p*y+m*b+g*C,r[8]=p*_+m*S+g*T,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-i*r*h+i*o*l+s*r*c-s*a*l}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=h*a-o*c,p=o*l-h*r,m=c*r-a*l,g=e*u+i*p+s*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/g;return t[0]=u*x,t[1]=(s*c-h*i)*x,t[2]=(o*i-s*a)*x,t[3]=p*x,t[4]=(h*e-s*l)*x,t[5]=(s*r-o*e)*x,t[6]=m*x,t[7]=(i*l-c*e)*x,t[8]=(a*e-i*r)*x,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,s,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*a+c*o)+a+t,-s*c,s*l,-s*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(K_.makeScale(t,e)),this}rotate(t){return this.premultiply(K_.makeRotation(-t)),this}translate(t,e){return this.premultiply(K_.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,i=t.elements;for(let s=0;s<9;s++)if(e[s]!==i[s])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const K_=new so;function Y6(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function UE(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const kE={};function Dm(n){n in kE||(kE[n]=!0,console.warn(n))}const zE=new so().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),BE=new so().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),$p={[$1]:{transfer:dv,primaries:LE,toReference:n=>n,fromReference:n=>n},[zs]:{transfer:IE,primaries:LE,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[PR]:{transfer:dv,primaries:DE,toReference:n=>n.applyMatrix3(BE),fromReference:n=>n.applyMatrix3(zE)},[X6]:{transfer:IE,primaries:DE,toReference:n=>n.convertSRGBToLinear().applyMatrix3(BE),fromReference:n=>n.applyMatrix3(zE).convertLinearToSRGB()}},Z6=new Set([$1,PR]),Ns={enabled:!0,_workingColorSpace:$1,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!Z6.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,t,e){if(this.enabled===!1||t===e||!t||!e)return n;const i=$p[t].toReference,s=$p[e].fromReference;return s(i(n))},fromWorkingColorSpace:function(n,t){return this.convert(n,this._workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this._workingColorSpace)},getPrimaries:function(n){return $p[n].primaries},getTransfer:function(n){return n===Lm?dv:$p[n].transfer}};function Dc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function J_(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let ic;class K6{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{ic===void 0&&(ic=UE("canvas")),ic.width=t.width,ic.height=t.height;const i=ic.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=ic}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=UE("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const s=i.getImageData(0,0,t.width,t.height),r=s.data;for(let a=0;a0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==RR)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case TE:t.x=t.x-Math.floor(t.x);break;case Xp:t.x=t.x<0?0:1;break;case CE:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case TE:t.y=t.y-Math.floor(t.y);break;case Xp:t.y=t.y<0?0:1;break;case CE:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Dm("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===zs?Y_:W6}set encoding(t){Dm("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===Y_?zs:Lm}}Ha.DEFAULT_IMAGE=null;Ha.DEFAULT_MAPPING=RR;Ha.DEFAULT_ANISOTROPY=1;class Uf{constructor(t=0,e=0,i=0,s=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=s}static slerpFlat(t,e,i,s,r,a,o){let l=i[s+0],c=i[s+1],h=i[s+2],u=i[s+3];const p=r[a+0],m=r[a+1],g=r[a+2],x=r[a+3];if(o===0){t[e+0]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u;return}if(o===1){t[e+0]=p,t[e+1]=m,t[e+2]=g,t[e+3]=x;return}if(u!==x||l!==p||c!==m||h!==g){let y=1-o;const _=l*p+c*m+h*g+u*x,M=_>=0?1:-1,b=1-_*_;if(b>Number.EPSILON){const P=Math.sqrt(b),C=Math.atan2(P,_*M);y=Math.sin(y*C)/P,o=Math.sin(o*C)/P}const S=o*M;if(l=l*y+p*S,c=c*y+m*S,h=h*y+g*S,u=u*y+x*S,y===1-o){const P=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=P,c*=P,h*=P,u*=P}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,s,r,a){const o=i[s],l=i[s+1],c=i[s+2],h=i[s+3],u=r[a],p=r[a+1],m=r[a+2],g=r[a+3];return t[e]=o*g+h*u+l*m-c*p,t[e+1]=l*g+h*p+c*u-o*m,t[e+2]=c*g+h*m+o*p-l*u,t[e+3]=h*g-o*u-l*p-c*m,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,s){return this._x=t,this._y=e,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const i=t._x,s=t._y,r=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(i/2),h=o(s/2),u=o(r/2),p=l(i/2),m=l(s/2),g=l(r/2);switch(a){case"XYZ":this._x=p*h*u+c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u-p*m*g;break;case"YXZ":this._x=p*h*u+c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u+p*m*g;break;case"ZXY":this._x=p*h*u-c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u-p*m*g;break;case"ZYX":this._x=p*h*u-c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u+p*m*g;break;case"YZX":this._x=p*h*u+c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u-p*m*g;break;case"XZY":this._x=p*h*u-c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u+p*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,s=Math.sin(i);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],s=e[4],r=e[8],a=e[1],o=e[5],l=e[9],c=e[2],h=e[6],u=e[10],p=i+o+u;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(r-c)*m,this._z=(a-s)*m}else if(i>o&&i>u){const m=2*Math.sqrt(1+i-o-u);this._w=(h-l)/m,this._x=.25*m,this._y=(s+a)/m,this._z=(r+c)/m}else if(o>u){const m=2*Math.sqrt(1+o-i-u);this._w=(r-c)/m,this._x=(s+a)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+u-i-o);this._w=(a-s)/m,this._x=(r+c)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Di(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const s=Math.min(1,e/i);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,s=t._y,r=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=i*h+a*o+s*c-r*l,this._y=s*h+a*l+r*o-i*c,this._z=r*h+a*c+i*l-s*o,this._w=a*h-i*o-s*l-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,s=this._y,r=this._z,a=this._w;let o=a*t._w+i*t._x+s*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=i,this._y=s,this._z=r,this;const l=1-o*o;if(l<=Number.EPSILON){const m=1-e;return this._w=m*a+e*this._w,this._x=m*i+e*this._x,this._y=m*s+e*this._y,this._z=m*r+e*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-e)*h)/c,p=Math.sin(e*h)/c;return this._w=a*u+this._w*p,this._x=i*u+this._x*p,this._y=s*u+this._y*p,this._z=r*u+this._z*p,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=Math.random(),e=Math.sqrt(1-t),i=Math.sqrt(t),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(s),i*Math.sin(r),i*Math.cos(r),e*Math.sin(s))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Rt{constructor(t=0,e=0,i=0){Rt.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(HE.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(HE.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*a,this}applyQuaternion(t){const e=this.x,i=this.y,s=this.z,r=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*s-o*i),h=2*(o*e-r*s),u=2*(r*i-a*e);return this.x=e+l*c+a*u-o*h,this.y=i+l*h+o*c-r*u,this.z=s+l*u+r*h-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*s,this.y=r[1]*e+r[5]*i+r[9]*s,this.z=r[2]*e+r[6]*i+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,s=t.y,r=t.z,a=e.x,o=e.y,l=e.z;return this.x=s*l-r*o,this.y=r*a-i*l,this.z=i*o-s*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return tx.copy(this).projectOnVector(t),this.sub(tx)}reflect(t){return this.sub(tx.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Di(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const s=Math.sin(e)*t;return this.x=s*Math.sin(i),this.y=Math.cos(e)*t,this.z=s*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=(Math.random()-.5)*2,e=Math.random()*Math.PI*2,i=Math.sqrt(1-t**2);return this.x=i*Math.cos(e),this.y=i*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const tx=new Rt,HE=new Uf;class kf{constructor(t=new Rt(1/0,1/0,1/0),e=new Rt(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Os),Os.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(tu),Zp.subVectors(this.max,tu),sc.subVectors(t.a,tu),rc.subVectors(t.b,tu),ac.subVectors(t.c,tu),Pa.subVectors(rc,sc),Ia.subVectors(ac,rc),Ro.subVectors(sc,ac);let e=[0,-Pa.z,Pa.y,0,-Ia.z,Ia.y,0,-Ro.z,Ro.y,Pa.z,0,-Pa.x,Ia.z,0,-Ia.x,Ro.z,0,-Ro.x,-Pa.y,Pa.x,0,-Ia.y,Ia.x,0,-Ro.y,Ro.x,0];return!ex(e,sc,rc,ac,Zp)||(e=[1,0,0,0,1,0,0,0,1],!ex(e,sc,rc,ac,Zp))?!1:(Kp.crossVectors(Pa,Ia),e=[Kp.x,Kp.y,Kp.z],ex(e,sc,rc,ac,Zp))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Os).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Os).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Vr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Vr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Vr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Vr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Vr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Vr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Vr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Vr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Vr),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Vr=[new Rt,new Rt,new Rt,new Rt,new Rt,new Rt,new Rt,new Rt],Os=new Rt,Yp=new kf,sc=new Rt,rc=new Rt,ac=new Rt,Pa=new Rt,Ia=new Rt,Ro=new Rt,tu=new Rt,Zp=new Rt,Kp=new Rt,Po=new Rt;function ex(n,t,e,i,s){for(let r=0,a=n.length-3;r<=a;r+=3){Po.fromArray(n,r);const o=s.x*Math.abs(Po.x)+s.y*Math.abs(Po.y)+s.z*Math.abs(Po.z),l=t.dot(Po),c=e.dot(Po),h=i.dot(Po);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const e8=new kf,eu=new Rt,nx=new Rt;class IR{constructor(t=new Rt,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;e!==void 0?i.copy(e):e8.setFromPoints(t).getCenter(i);let s=0;for(let r=0,a=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;eu.subVectors(t,this.center);const e=eu.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),s=(i-this.radius)*.5;this.center.addScaledVector(eu,s/i),this.radius+=s}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(nx.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(eu.copy(t.center).add(nx)),this.expandByPoint(eu.copy(t.center).sub(nx))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Wr=new Rt,ix=new Rt,Jp=new Rt,La=new Rt,sx=new Rt,Qp=new Rt,rx=new Rt;class n8{constructor(t=new Rt,e=new Rt(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Wr)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Wr.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Wr.copy(this.origin).addScaledVector(this.direction,e),Wr.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){ix.copy(t).add(e).multiplyScalar(.5),Jp.copy(e).sub(t).normalize(),La.copy(this.origin).sub(ix);const r=t.distanceTo(e)*.5,a=-this.direction.dot(Jp),o=La.dot(this.direction),l=-La.dot(Jp),c=La.lengthSq(),h=Math.abs(1-a*a);let u,p,m,g;if(h>0)if(u=a*l-o,p=a*o-l,g=r*h,u>=0)if(p>=-g)if(p<=g){const x=1/h;u*=x,p*=x,m=u*(u+a*p+2*o)+p*(a*u+p+2*l)+c}else p=r,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p=-r,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p<=-g?(u=Math.max(0,-(-a*r+o)),p=u>0?-r:Math.min(Math.max(-r,-l),r),m=-u*u+p*(p+2*l)+c):p<=g?(u=0,p=Math.min(Math.max(-r,-l),r),m=p*(p+2*l)+c):(u=Math.max(0,-(a*r+o)),p=u>0?r:Math.min(Math.max(-r,-l),r),m=-u*u+p*(p+2*l)+c);else p=a>0?-r:r,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,u),s&&s.copy(ix).addScaledVector(Jp,p),m}intersectSphere(t,e){Wr.subVectors(t.center,this.origin);const i=Wr.dot(this.direction),s=Wr.dot(Wr)-i*i,r=t.radius*t.radius;if(s>r)return null;const a=Math.sqrt(r-s),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return i===null?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,s,r,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,p=this.origin;return c>=0?(i=(t.min.x-p.x)*c,s=(t.max.x-p.x)*c):(i=(t.max.x-p.x)*c,s=(t.min.x-p.x)*c),h>=0?(r=(t.min.y-p.y)*h,a=(t.max.y-p.y)*h):(r=(t.max.y-p.y)*h,a=(t.min.y-p.y)*h),i>a||r>s||((r>i||isNaN(i))&&(i=r),(a=0?(o=(t.min.z-p.z)*u,l=(t.max.z-p.z)*u):(o=(t.max.z-p.z)*u,l=(t.min.z-p.z)*u),i>l||o>s)||((o>i||i!==i)&&(i=o),(l=0?i:s,e)}intersectsBox(t){return this.intersectBox(t,Wr)!==null}intersectTriangle(t,e,i,s,r){sx.subVectors(e,t),Qp.subVectors(i,t),rx.crossVectors(sx,Qp);let a=this.direction.dot(rx),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;La.subVectors(this.origin,t);const l=o*this.direction.dot(Qp.crossVectors(La,Qp));if(l<0)return null;const c=o*this.direction.dot(sx.cross(La));if(c<0||l+c>a)return null;const h=-o*La.dot(rx);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Hs{constructor(t,e,i,s,r,a,o,l,c,h,u,p,m,g,x,y){Hs.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,i,s,r,a,o,l,c,h,u,p,m,g,x,y)}set(t,e,i,s,r,a,o,l,c,h,u,p,m,g,x,y){const _=this.elements;return _[0]=t,_[4]=e,_[8]=i,_[12]=s,_[1]=r,_[5]=a,_[9]=o,_[13]=l,_[2]=c,_[6]=h,_[10]=u,_[14]=p,_[3]=m,_[7]=g,_[11]=x,_[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Hs().fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,s=1/oc.setFromMatrixColumn(t,0).length(),r=1/oc.setFromMatrixColumn(t,1).length(),a=1/oc.setFromMatrixColumn(t,2).length();return e[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*a,e[9]=i[9]*a,e[10]=i[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,s=t.y,r=t.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(s),c=Math.sin(s),h=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const p=a*h,m=a*u,g=o*h,x=o*u;e[0]=l*h,e[4]=-l*u,e[8]=c,e[1]=m+g*c,e[5]=p-x*c,e[9]=-o*l,e[2]=x-p*c,e[6]=g+m*c,e[10]=a*l}else if(t.order==="YXZ"){const p=l*h,m=l*u,g=c*h,x=c*u;e[0]=p+x*o,e[4]=g*o-m,e[8]=a*c,e[1]=a*u,e[5]=a*h,e[9]=-o,e[2]=m*o-g,e[6]=x+p*o,e[10]=a*l}else if(t.order==="ZXY"){const p=l*h,m=l*u,g=c*h,x=c*u;e[0]=p-x*o,e[4]=-a*u,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*h,e[9]=x-p*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const p=a*h,m=a*u,g=o*h,x=o*u;e[0]=l*h,e[4]=g*c-m,e[8]=p*c+x,e[1]=l*u,e[5]=x*c+p,e[9]=m*c-g,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const p=a*l,m=a*c,g=o*l,x=o*c;e[0]=l*h,e[4]=x-p*u,e[8]=g*u+m,e[1]=u,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=m*u+g,e[10]=p-x*u}else if(t.order==="XZY"){const p=a*l,m=a*c,g=o*l,x=o*c;e[0]=l*h,e[4]=-u,e[8]=c*h,e[1]=p*u+x,e[5]=a*h,e[9]=m*u-g,e[2]=g*u-m,e[6]=o*h,e[10]=x*u+p}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(i8,t,s8)}lookAt(t,e,i){const s=this.elements;return $i.subVectors(t,e),$i.lengthSq()===0&&($i.z=1),$i.normalize(),Da.crossVectors(i,$i),Da.lengthSq()===0&&(Math.abs(i.z)===1?$i.x+=1e-4:$i.z+=1e-4,$i.normalize(),Da.crossVectors(i,$i)),Da.normalize(),tm.crossVectors($i,Da),s[0]=Da.x,s[4]=tm.x,s[8]=$i.x,s[1]=Da.y,s[5]=tm.y,s[9]=$i.y,s[2]=Da.z,s[6]=tm.z,s[10]=$i.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,r=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],h=i[1],u=i[5],p=i[9],m=i[13],g=i[2],x=i[6],y=i[10],_=i[14],M=i[3],b=i[7],S=i[11],P=i[15],C=s[0],T=s[4],L=s[8],N=s[12],E=s[1],R=s[5],z=s[9],G=s[13],W=s[2],tt=s[6],X=s[10],at=s[14],H=s[3],J=s[7],st=s[11],q=s[15];return r[0]=a*C+o*E+l*W+c*H,r[4]=a*T+o*R+l*tt+c*J,r[8]=a*L+o*z+l*X+c*st,r[12]=a*N+o*G+l*at+c*q,r[1]=h*C+u*E+p*W+m*H,r[5]=h*T+u*R+p*tt+m*J,r[9]=h*L+u*z+p*X+m*st,r[13]=h*N+u*G+p*at+m*q,r[2]=g*C+x*E+y*W+_*H,r[6]=g*T+x*R+y*tt+_*J,r[10]=g*L+x*z+y*X+_*st,r[14]=g*N+x*G+y*at+_*q,r[3]=M*C+b*E+S*W+P*H,r[7]=M*T+b*R+S*tt+P*J,r[11]=M*L+b*z+S*X+P*st,r[15]=M*N+b*G+S*at+P*q,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],s=t[8],r=t[12],a=t[1],o=t[5],l=t[9],c=t[13],h=t[2],u=t[6],p=t[10],m=t[14],g=t[3],x=t[7],y=t[11],_=t[15];return g*(+r*l*u-s*c*u-r*o*p+i*c*p+s*o*m-i*l*m)+x*(+e*l*m-e*c*p+r*a*p-s*a*m+s*c*h-r*l*h)+y*(+e*c*u-e*o*m-r*a*u+i*a*m+r*o*h-i*c*h)+_*(-s*o*h-e*l*u+e*o*p+s*a*u-i*a*p+i*l*h)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=t[9],p=t[10],m=t[11],g=t[12],x=t[13],y=t[14],_=t[15],M=u*y*c-x*p*c+x*l*m-o*y*m-u*l*_+o*p*_,b=g*p*c-h*y*c-g*l*m+a*y*m+h*l*_-a*p*_,S=h*x*c-g*u*c+g*o*m-a*x*m-h*o*_+a*u*_,P=g*u*l-h*x*l-g*o*p+a*x*p+h*o*y-a*u*y,C=e*M+i*b+s*S+r*P;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/C;return t[0]=M*T,t[1]=(x*p*r-u*y*r-x*s*m+i*y*m+u*s*_-i*p*_)*T,t[2]=(o*y*r-x*l*r+x*s*c-i*y*c-o*s*_+i*l*_)*T,t[3]=(u*l*r-o*p*r-u*s*c+i*p*c+o*s*m-i*l*m)*T,t[4]=b*T,t[5]=(h*y*r-g*p*r+g*s*m-e*y*m-h*s*_+e*p*_)*T,t[6]=(g*l*r-a*y*r-g*s*c+e*y*c+a*s*_-e*l*_)*T,t[7]=(a*p*r-h*l*r+h*s*c-e*p*c-a*s*m+e*l*m)*T,t[8]=S*T,t[9]=(g*u*r-h*x*r-g*i*m+e*x*m+h*i*_-e*u*_)*T,t[10]=(a*x*r-g*o*r+g*i*c-e*x*c-a*i*_+e*o*_)*T,t[11]=(h*o*r-a*u*r-h*i*c+e*u*c+a*i*m-e*o*m)*T,t[12]=P*T,t[13]=(h*x*s-g*u*s+g*i*p-e*x*p-h*i*y+e*u*y)*T,t[14]=(g*o*s-a*x*s-g*i*l+e*x*l+a*i*y-e*o*y)*T,t[15]=(a*u*s-h*o*s+h*i*l-e*u*l-a*i*p+e*o*p)*T,this}scale(t){const e=this.elements,i=t.x,s=t.y,r=t.z;return e[0]*=i,e[4]*=s,e[8]*=r,e[1]*=i,e[5]*=s,e[9]*=r,e[2]*=i,e[6]*=s,e[10]*=r,e[3]*=i,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),s=Math.sin(e),r=1-i,a=t.x,o=t.y,l=t.z,c=r*a,h=r*o;return this.set(c*a+i,c*o-s*l,c*l+s*o,0,c*o+s*l,h*o+i,h*l-s*a,0,c*l-s*o,h*l+s*a,r*l*l+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,s,r,a){return this.set(1,i,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){const s=this.elements,r=e._x,a=e._y,o=e._z,l=e._w,c=r+r,h=a+a,u=o+o,p=r*c,m=r*h,g=r*u,x=a*h,y=a*u,_=o*u,M=l*c,b=l*h,S=l*u,P=i.x,C=i.y,T=i.z;return s[0]=(1-(x+_))*P,s[1]=(m+S)*P,s[2]=(g-b)*P,s[3]=0,s[4]=(m-S)*C,s[5]=(1-(p+_))*C,s[6]=(y+M)*C,s[7]=0,s[8]=(g+b)*T,s[9]=(y-M)*T,s[10]=(1-(p+x))*T,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,i){const s=this.elements;let r=oc.set(s[0],s[1],s[2]).length();const a=oc.set(s[4],s[5],s[6]).length(),o=oc.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],Fs.copy(this);const c=1/r,h=1/a,u=1/o;return Fs.elements[0]*=c,Fs.elements[1]*=c,Fs.elements[2]*=c,Fs.elements[4]*=h,Fs.elements[5]*=h,Fs.elements[6]*=h,Fs.elements[8]*=u,Fs.elements[9]*=u,Fs.elements[10]*=u,e.setFromRotationMatrix(Fs),i.x=r,i.y=a,i.z=o,this}makePerspective(t,e,i,s,r,a,o=qp){const l=this.elements,c=2*r/(e-t),h=2*r/(i-s),u=(e+t)/(e-t),p=(i+s)/(i-s);let m,g;if(o===qp)m=-(a+r)/(a-r),g=-2*a*r/(a-r);else if(o===FE)m=-a/(a-r),g=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=g,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,i,s,r,a,o=qp){const l=this.elements,c=1/(e-t),h=1/(i-s),u=1/(a-r),p=(e+t)*c,m=(i+s)*h;let g,x;if(o===qp)g=(a+r)*u,x=-2*u;else if(o===FE)g=r*u,x=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=x,l[14]=-g,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let s=0;s<16;s++)if(e[s]!==i[s])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const oc=new Rt,Fs=new Hs,i8=new Rt(0,0,0),s8=new Rt(1,1,1),Da=new Rt,tm=new Rt,$i=new Rt,GE=new Hs,VE=new Uf;class Cg{constructor(t=0,e=0,i=0,s=Cg.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,s=this._order){return this._x=t,this._y=e,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const s=t.elements,r=s[0],a=s[4],o=s[8],l=s[1],c=s[5],h=s[9],u=s[2],p=s[6],m=s[10];switch(e){case"XYZ":this._y=Math.asin(Di(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Di(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(Di(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,m),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-Di(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Di(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-Di(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return GE.makeRotationFromQuaternion(t),this.setFromRotationMatrix(GE,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return VE.setFromEuler(this),this.setFromQuaternion(VE,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Cg.DEFAULT_ORDER="XYZ";class r8{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let i=0;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),s.maxGeometryCount=this._maxGeometryCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c0){s.children=[];for(let o=0;o0){s.animations=[];for(let o=0;o0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),h.length>0&&(i.images=h),u.length>0&&(i.shapes=u),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m),g.length>0&&(i.nodes=g)}return i.object=s,i;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,i,s,r){Us.subVectors(s,e),Xr.subVectors(i,e),ax.subVectors(t,e);const a=Us.dot(Us),o=Us.dot(Xr),l=Us.dot(ax),c=Xr.dot(Xr),h=Xr.dot(ax),u=a*c-o*o;if(u===0)return r.set(0,0,0),null;const p=1/u,m=(c*l-o*h)*p,g=(a*h-o*l)*p;return r.set(1-m-g,g,m)}static containsPoint(t,e,i,s){return this.getBarycoord(t,e,i,s,qr)===null?!1:qr.x>=0&&qr.y>=0&&qr.x+qr.y<=1}static getInterpolation(t,e,i,s,r,a,o,l){return this.getBarycoord(t,e,i,s,qr)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,qr.x),l.addScaledVector(a,qr.y),l.addScaledVector(o,qr.z),l)}static isFrontFacing(t,e,i,s){return Us.subVectors(i,e),Xr.subVectors(t,e),Us.cross(Xr).dot(s)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,s){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,i,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Us.subVectors(this.c,this.b),Xr.subVectors(this.a,this.b),Us.cross(Xr).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return mr.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return mr.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,r){return mr.getInterpolation(t,this.a,this.b,this.c,e,i,s,r)}containsPoint(t){return mr.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return mr.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,s=this.b,r=this.c;let a,o;cc.subVectors(s,i),hc.subVectors(r,i),ox.subVectors(t,i);const l=cc.dot(ox),c=hc.dot(ox);if(l<=0&&c<=0)return e.copy(i);lx.subVectors(t,s);const h=cc.dot(lx),u=hc.dot(lx);if(h>=0&&u<=h)return e.copy(s);const p=l*u-h*c;if(p<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(i).addScaledVector(cc,a);cx.subVectors(t,r);const m=cc.dot(cx),g=hc.dot(cx);if(g>=0&&m<=g)return e.copy(r);const x=m*c-l*g;if(x<=0&&c>=0&&g<=0)return o=c/(c-g),e.copy(i).addScaledVector(hc,o);const y=h*g-m*u;if(y<=0&&u-h>=0&&m-g>=0)return $E.subVectors(r,s),o=(u-h)/(u-h+(m-g)),e.copy(s).addScaledVector($E,o);const _=1/(y+x+p);return a=x*_,o=p*_,e.copy(i).addScaledVector(cc,a).addScaledVector(hc,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const LR={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Na={h:0,s:0,l:0},nm={h:0,s:0,l:0};function hx(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}class Kc{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){if(e===void 0&&i===void 0){const s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=zs){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Ns.toWorkingColorSpace(this,e),this}setRGB(t,e,i,s=Ns.workingColorSpace){return this.r=t,this.g=e,this.b=i,Ns.toWorkingColorSpace(this,s),this}setHSL(t,e,i,s=Ns.workingColorSpace){if(t=$6(t,1),e=Di(e,0,1),i=Di(i,0,1),e===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+e):i+e-i*e,a=2*i-r;this.r=hx(a,r,t+1/3),this.g=hx(a,r,t),this.b=hx(a,r,t-1/3)}return Ns.toWorkingColorSpace(this,s),this}setStyle(t,e=zs){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=zs){const i=LR[t.toLowerCase()];return i!==void 0?this.setHex(i,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Dc(t.r),this.g=Dc(t.g),this.b=Dc(t.b),this}copyLinearToSRGB(t){return this.r=J_(t.r),this.g=J_(t.g),this.b=J_(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=zs){return Ns.fromWorkingColorSpace(oi.copy(this),t),Math.round(Di(oi.r*255,0,255))*65536+Math.round(Di(oi.g*255,0,255))*256+Math.round(Di(oi.b*255,0,255))}getHexString(t=zs){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Ns.workingColorSpace){Ns.fromWorkingColorSpace(oi.copy(this),e);const i=oi.r,s=oi.g,r=oi.b,a=Math.max(i,s,r),o=Math.min(i,s,r);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const u=a-o;switch(c=h<=.5?u/(a+o):u/(2-a-o),a){case i:l=(s-r)/u+(s0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const i=t[e];if(i===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[e]=i}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==wE&&(i.blending=this.blending),this.side!==fv&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==SE&&(i.blendSrc=this.blendSrc),this.blendDst!==EE&&(i.blendDst=this.blendDst),this.blendEquation!==bE&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==AE&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==NE&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==nc&&(i.stencilFail=this.stencilFail),this.stencilZFail!==nc&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==nc&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(e){const r=s(t.textures),a=s(t.images);r.length>0&&(i.textures=r),a.length>0&&(i.images=a)}return i}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(e!==null){const s=e.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=e[r].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class f8 extends DR{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Kc(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=F6,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const An=new Rt,im=new Si;class ra{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=i,this.usage=OE,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=H6,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Dm("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let s=0,r=this.itemSize;s0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const l in i){const c=i[l];t.data.attributes[l]=c.toJSON(t.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,p=c.length;u0&&(s[l]=h,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;i!==null&&this.setIndex(i.clone(e));const s=t.attributes;for(const c in s){const h=s[c];this.setAttribute(c,h.clone(e))}const r=t.morphAttributes;for(const c in r){const h=[],u=r[c];for(let p=0,m=u.length;p0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r(t.far-t.near)**2))&&(YE.copy(r).invert(),Io.copy(t.ray).applyMatrix4(YE),!(i.boundingBox!==null&&Io.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,Io)))}_computeIntersections(t,e,i){let s;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,u=r.attributes.normal,p=r.groups,m=r.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,x=p.length;ge.far?null:{distance:c,point:hm.clone(),object:n}}function um(n,t,e,i,s,r,a,o,l,c){n.getVertexPosition(o,fc),n.getVertexPosition(l,dc),n.getVertexPosition(c,pc);const h=y8(n,t,e,i,fc,dc,pc,cm);if(h){s&&(am.fromBufferAttribute(s,o),om.fromBufferAttribute(s,l),lm.fromBufferAttribute(s,c),h.uv=mr.getInterpolation(cm,fc,dc,pc,am,om,lm,new Si)),r&&(am.fromBufferAttribute(r,o),om.fromBufferAttribute(r,l),lm.fromBufferAttribute(r,c),h.uv1=mr.getInterpolation(cm,fc,dc,pc,am,om,lm,new Si),h.uv2=h.uv1),a&&(KE.fromBufferAttribute(a,o),JE.fromBufferAttribute(a,l),QE.fromBufferAttribute(a,c),h.normal=mr.getInterpolation(cm,fc,dc,pc,KE,JE,QE,new Rt),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const u={a:o,b:l,c,normal:new Rt,materialIndex:0};mr.getNormal(fc,dc,pc,u.normal),h.face=u}return h}class _8 extends Ha{constructor(t,e,i,s,r,a,o,l,c,h){if(h=h!==void 0?h:$_,h!==$_&&h!==PE)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===$_&&(i=B6),i===void 0&&h===PE&&(i=G6),super(null,s,r,a,o,l,h,i,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:RE,this.minFilter=l!==void 0?l:RE,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}const x8=new _8(1,1);x8.compareFunction=q6;class v8 extends DR{constructor(t){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Kc(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Kc(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=j6,this.normalScale=new Si(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:CR}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=CR);function tA(n,t=!1){const e=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),s=new Set(Object.keys(n[0].morphAttributes)),r={},a={},o=n[0].morphTargetsRelative,l=new zf;let c=0;for(let h=0;hM8(n,t,e)}function fh(n,t){return Jn(NR(n,t).get)}const{apply:M8,construct:FY,defineProperty:UY,get:kY,getOwnPropertyDescriptor:NR,getPrototypeOf:Y1,has:zY,ownKeys:w8,set:BY,setPrototypeOf:HY}=Reflect,{iterator:Bf,species:GY,toStringTag:b8,for:VY}=Symbol,S8=Object,{create:Z1,defineProperty:E8,freeze:WY,is:jY}=S8,A8=Array,T8=A8.prototype,OR=T8[Bf],C8=Jn(OR),FR=ArrayBuffer,R8=FR.prototype;fh(R8,"byteLength");const nA=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;nA&&fh(nA.prototype,"byteLength");const UR=Y1(Uint8Array);UR.from;const Ei=UR.prototype;Ei[Bf];Jn(Ei.keys);Jn(Ei.values);Jn(Ei.entries);Jn(Ei.set);Jn(Ei.reverse);Jn(Ei.fill);Jn(Ei.copyWithin);Jn(Ei.sort);Jn(Ei.slice);Jn(Ei.subarray);fh(Ei,"buffer");fh(Ei,"byteOffset");fh(Ei,"length");fh(Ei,b8);const P8=Uint8Array,kR=Uint16Array,K1=Uint32Array,I8=Float32Array,nf=Y1([][Bf]()),zR=Jn(nf.next),L8=Jn(function*(){}().next),D8=Y1(nf),N8=DataView.prototype,O8=Jn(N8.getUint16),J1=WeakMap,BR=J1.prototype,HR=Jn(BR.get),F8=Jn(BR.set),GR=new J1,U8=Z1(null,{next:{value:function(){const t=HR(GR,this);return zR(t)}},[Bf]:{value:function(){return this}}});function k8(n){if(n[Bf]===OR&&nf.next===zR)return n;const t=Z1(U8);return F8(GR,t,C8(n)),t}const z8=new J1,B8=Z1(D8,{next:{value:function(){const t=HR(z8,this);return L8(t)},writable:!0,configurable:!0}});for(const n of w8(nf))n!=="next"&&E8(B8,n,NR(nf,n));const VR=new FR(4),H8=new I8(VR),G8=new K1(VR),or=new kR(512),lr=new P8(512);for(let n=0;n<256;++n){const t=n-127;t<-24?(or[n]=0,or[n|256]=32768,lr[n]=24,lr[n|256]=24):t<-14?(or[n]=1024>>-t-14,or[n|256]=1024>>-t-14|32768,lr[n]=-t-1,lr[n|256]=-t-1):t<=15?(or[n]=t+15<<10,or[n|256]=t+15<<10|32768,lr[n]=13,lr[n|256]=13):t<128?(or[n]=31744,or[n|256]=64512,lr[n]=24,lr[n|256]=24):(or[n]=31744,or[n|256]=64512,lr[n]=13,lr[n|256]=13)}const Q1=new K1(2048);for(let n=1;n<1024;++n){let t=n<<13,e=0;for(;!(t&8388608);)t<<=1,e-=8388608;t&=-8388609,e+=947912704,Q1[n]=t|e}for(let n=1024;n<2048;++n)Q1[n]=939524096+(n-1024<<13);const dh=new K1(64);for(let n=1;n<31;++n)dh[n]=n<<23;dh[31]=1199570944;dh[32]=2147483648;for(let n=33;n<63;++n)dh[n]=2147483648+(n-32<<23);dh[63]=3347054592;const WR=new kR(64);for(let n=1;n<64;++n)n!==32&&(WR[n]=1024);function V8(n){const t=n>>10;return G8[0]=Q1[WR[t]+(n&1023)]+dh[t],H8[0]}function jR(n,t,...e){return V8(O8(n,t,...k8(e)))}var tM={exports:{}};function XR(n,t,e){const i=e&&e.debug||!1;i&&console.log("[xml-utils] getting "+t+" in "+n);const s=typeof n=="object"?n.outer:n,r=s.slice(0,s.indexOf(">")+1),a=['"',"'"];for(let o=0;o/]`,r);if(i&&console.log("[xml-utils] start:",a),a===-1)return;const o=n.slice(a+t.length);let l=px(o,"^[^<]*[ /]>",0);const c=l!==-1&&o[l-1]==="/";if(i&&console.log("[xml-utils] selfClosing:",c),c===!1)if(s){let m=0,g=1,x=0;for(;(l=px(o,"[ /]"+t+">",m))!==-1;){const y=o.substring(m,l+1);if(g+=iA(y,"<"+t+`[ - >]`),x+=iA(y,""),x>=g)break;m=l}}else l=px(o,"[ /]"+t+">",0);const h=a+t.length+l+1;if(i&&console.log("[xml-utils] end:",h),h===-1)return;const u=n.slice(a,h);let p;return c?p=null:p=u.slice(u.indexOf(">")+1,u.lastIndexOf("<")),{inner:p,outer:u,start:a,end:h}}nM.exports=ZR;nM.exports.default=ZR;var Y8=nM.exports;const Z8=Y8;function KR(n,t,e){const i=[],s=e&&e.debug||!1,r=e&&typeof e.nested=="boolean"?e.nested:!0;let a=e&&e.startIndex||0,o;for(;o=Z8(n,t,{debug:s,startIndex:a});)r?a=o.start+1+t.length:a=o.end,i.push(o);return s&&console.log("findTagsByName found",i.length,"tags"),i}eM.exports=KR;eM.exports.default=KR;var K8=eM.exports;const J8=yf(K8),Cu={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},ur={};for(const n in Cu)Cu.hasOwnProperty(n)&&(ur[Cu[n]]=parseInt(n,10));const Q8=[ur.BitsPerSample,ur.ExtraSamples,ur.SampleFormat,ur.StripByteCounts,ur.StripOffsets,ur.StripRowCounts,ur.TileByteCounts,ur.TileOffsets,ur.SubIFDs],mx={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},Ee={};for(const n in mx)mx.hasOwnProperty(n)&&(Ee[mx[n]]=parseInt(n,10));const Zi={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},tH={Unspecified:0,Assocalpha:1,Unassalpha:2},XY={Version:0,AddCompression:1},qY={None:0,Deflate:1,Zstandard:2},eH={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function nH(n,t){const{width:e,height:i}=n,s=new Uint8Array(e*i*3);let r;for(let a=0,o=0;a>24,l=n[s+2]<<24>>24;let c=(a+16)/116,h=o/500+c,u=c-l/200,p,m,g;h=oH*(h*h*h>.008856?h*h*h:(h-16/116)/7.787),c=lH*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),u=cH*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),p=h*3.2406+c*-1.5372+u*-.4986,m=h*-.9689+c*1.8758+u*.0415,g=h*.0557+c*-.204+u*1.057,p=p>.0031308?1.055*p**(1/2.4)-.055:12.92*p,m=m>.0031308?1.055*m**(1/2.4)-.055:12.92*m,g=g>.0031308?1.055*g**(1/2.4)-.055:12.92*g,i[r]=Math.max(0,Math.min(1,p))*255,i[r+1]=Math.max(0,Math.min(1,m))*255,i[r+2]=Math.max(0,Math.min(1,g))*255}return i}const JR=new Map;function ro(n,t){Array.isArray(n)||(n=[n]),n.forEach(e=>JR.set(e,t))}async function uH(n){const t=JR.get(n.Compression);if(!t)throw new Error(`Unknown compression method identifier: ${n.Compression}`);const e=await t();return new e(n)}ro([void 0,1],()=>pl(()=>import("./raw-Dt1HMqYc.js"),__vite__mapDeps([0,1])).then(n=>n.default));ro(5,()=>pl(()=>import("./lzw-DpvbRwG5.js"),__vite__mapDeps([2,1])).then(n=>n.default));ro(6,()=>{throw new Error("old style JPEG compression is not supported.")});ro(7,()=>pl(()=>import("./jpeg-CdeCw_eT.js"),__vite__mapDeps([3,1])).then(n=>n.default));ro([8,32946],()=>pl(()=>import("./deflate-DWOWiK3U.js"),__vite__mapDeps([4,1,5,6,7,8,9,10])).then(n=>n.default));ro(32773,()=>pl(()=>import("./packbits-DQnG8s9w.js"),__vite__mapDeps([11,1])).then(n=>n.default));ro(34887,()=>pl(()=>import("./lerc-DZUX8qKy.js"),__vite__mapDeps([12,5,6,1,7,8,9,10])).then(async n=>(await n.zstd.init(),n)).then(n=>n.default));ro(50001,()=>pl(()=>import("./webimage-BcnuJlio.js"),__vite__mapDeps([13,1])).then(n=>n.default));function Rg(n,t,e,i=1){return new(Object.getPrototypeOf(n)).constructor(t*e*i)}function fH(n,t,e,i,s){const r=t/i,a=e/s;return n.map(o=>{const l=Rg(o,i,s);for(let c=0;c{const l=Rg(o,i,s);for(let c=0;c>8-s-C&u;else if(C+s<=16)h[S]=o.getUint16(P)>>16-s-C&u;else if(C+s<=24){const T=o.getUint16(P)<<8|o.getUint8(P+2);h[S]=T>>24-s-C&u}else h[S]=o.getUint32(P)>>32-s-C&u}}}}return h.buffer}class MH{constructor(t,e,i,s,r,a){this.fileDirectory=t,this.geoKeys=e,this.dataView=i,this.littleEndian=s,this.tiles=r?{}:null,this.isTiled=!t.StripOffsets;const o=t.PlanarConfiguration;if(this.planarConfiguration=typeof o>"u"?1:o,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=a}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}getBytesPerPixel(){let t=0;for(let e=0;e=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${t} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}getReaderForSample(t){const e=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,i=this.fileDirectory.BitsPerSample[t];switch(e){case 1:if(i<=8)return DataView.prototype.getUint8;if(i<=16)return DataView.prototype.getUint16;if(i<=32)return DataView.prototype.getUint32;break;case 2:if(i<=8)return DataView.prototype.getInt8;if(i<=16)return DataView.prototype.getInt16;if(i<=32)return DataView.prototype.getInt32;break;case 3:switch(i){case 16:return function(s,r){return jR(this,s,r)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(t=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}getBitsPerSample(t=0){return this.fileDirectory.BitsPerSample[t]}getArrayForSample(t,e){const i=this.getSampleFormat(t),s=this.getBitsPerSample(t);return mv(i,s,e)}async getTileOrStrip(t,e,i,s,r){const a=Math.ceil(this.getWidth()/this.getTileWidth()),o=Math.ceil(this.getHeight()/this.getTileHeight());let l;const{tiles:c}=this;this.planarConfiguration===1?l=e*a+t:this.planarConfiguration===2&&(l=i*a*o+e*a+t);let h,u;this.isTiled?(h=this.fileDirectory.TileOffsets[l],u=this.fileDirectory.TileByteCounts[l]):(h=this.fileDirectory.StripOffsets[l],u=this.fileDirectory.StripByteCounts[l]);const p=(await this.source.fetch([{offset:h,length:u}],r))[0];let m;return c===null||!c[l]?(m=(async()=>{let g=await s.decode(this.fileDirectory,p);const x=this.getSampleFormat(),y=this.getBitsPerSample();return xH(x,y)&&(g=vH(g,x,this.planarConfiguration,this.getSamplesPerPixel(),y,this.getTileWidth(),this.getBlockHeight(e))),g})(),c!==null&&(c[l]=m)):m=c[l],{x:t,y:e,sample:i,data:await m}}async _readRaster(t,e,i,s,r,a,o,l,c){const h=this.getTileWidth(),u=this.getTileHeight(),p=this.getWidth(),m=this.getHeight(),g=Math.max(Math.floor(t[0]/h),0),x=Math.min(Math.ceil(t[2]/h),Math.ceil(p/h)),y=Math.max(Math.floor(t[1]/u),0),_=Math.min(Math.ceil(t[3]/u),Math.ceil(m/u)),M=t[2]-t[0];let b=this.getBytesPerPixel();const S=[],P=[];for(let L=0;L{const X=tt.data,at=new DataView(X),H=this.getBlockHeight(tt.y),J=tt.y*u,st=tt.x*h,q=J+H,ct=(tt.x+1)*h,mt=P[z],Y=Math.min(H,H-(q-t[3]),m-J),rt=Math.min(h,h-(ct-t[2]),p-st);for(let wt=Math.max(0,t[1]-J);wth[2]||h[1]>h[3])throw new Error("Invalid subsets");const u=h[2]-h[0],p=h[3]-h[1],m=u*p,g=this.getSamplesPerPixel();if(!e||!e.length)for(let M=0;M=g)return Promise.reject(new RangeError(`Invalid sample index '${e[M]}'.`));let x;if(i){const M=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,b=Math.max.apply(null,this.fileDirectory.BitsPerSample);x=mv(M,b,m*e.length),l&&x.fill(l)}else{x=[];for(let M=0;Mc[2]||c[1]>c[3])throw new Error("Invalid subsets");const h=this.fileDirectory.PhotometricInterpretation;if(h===Zi.RGB){let _=[0,1,2];if(this.fileDirectory.ExtraSamples!==tH.Unspecified&&o){_=[];for(let M=0;Mdx(r,"sample")===void 0):s=s.filter(r=>Number(dx(r,"sample"))===t);for(let r=0;r[o+s*y+r*_,u+l*y+c*_]),g=m.map(y=>y[0]),x=m.map(y=>y[1]);return[Math.min(...g),Math.min(...x),Math.max(...g),Math.max(...x)]}else{const s=this.getOrigin(),r=this.getResolution(),a=s[0],o=s[1],l=a+r[0]*i,c=o+r[1]*e;return[Math.min(a,l),Math.min(o,c),Math.max(a,l),Math.max(o,c)]}}}class wH{constructor(t){this._dataView=new DataView(t)}get buffer(){return this._dataView.buffer}getUint64(t,e){const i=this.getUint32(t,e),s=this.getUint32(t+4,e);let r;if(e){if(r=i+2**32*s,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}if(r=2**32*i+s,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}getInt64(t,e){let i=0;const s=(this._dataView.getUint8(t+(e?7:0))&128)>0;let r=!0;for(let a=0;a<8;a++){let o=this._dataView.getUint8(t+(e?a:7-a));s&&(r?o!==0&&(o=~(o-1)&255,r=!1):o=~o&255),i+=o*256**a}return s&&(i=-i),i}getUint8(t,e){return this._dataView.getUint8(t,e)}getInt8(t,e){return this._dataView.getInt8(t,e)}getUint16(t,e){return this._dataView.getUint16(t,e)}getInt16(t,e){return this._dataView.getInt16(t,e)}getUint32(t,e){return this._dataView.getUint32(t,e)}getInt32(t,e){return this._dataView.getInt32(t,e)}getFloat16(t,e){return jR(this._dataView,t,e)}getFloat32(t,e){return this._dataView.getFloat32(t,e)}getFloat64(t,e){return this._dataView.getFloat64(t,e)}}class bH{constructor(t,e,i,s){this._dataView=new DataView(t),this._sliceOffset=e,this._littleEndian=i,this._bigTiff=s}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(t,e){return this.sliceOffset<=t&&this.sliceTop>=t+e}readUint8(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}readInt8(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}readUint16(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}readInt16(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}readUint32(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}readInt32(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}readFloat32(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}readFloat64(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}readUint64(t){const e=this.readUint32(t),i=this.readUint32(t+4);let s;if(this._littleEndian){if(s=e+2**32*i,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}if(s=2**32*e+i,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}readInt64(t){let e=0;const i=(this._dataView.getUint8(t+(this._littleEndian?7:0))&128)>0;let s=!0;for(let r=0;r<8;r++){let a=this._dataView.getUint8(t+(this._littleEndian?r:7-r));i&&(s?a!==0&&(a=~(a-1)&255,s=!1):a=~a&255),e+=a*256**r}return i&&(e=-e),e}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}const sA=`\r + >]`),x+=iA(y,""),x>=g)break;m=l}}else l=px(o,"[ /]"+t+">",0);const h=a+t.length+l+1;if(i&&console.log("[xml-utils] end:",h),h===-1)return;const u=n.slice(a,h);let p;return c?p=null:p=u.slice(u.indexOf(">")+1,u.lastIndexOf("<")),{inner:p,outer:u,start:a,end:h}}nM.exports=ZR;nM.exports.default=ZR;var Y8=nM.exports;const Z8=Y8;function KR(n,t,e){const i=[],s=e&&e.debug||!1,r=e&&typeof e.nested=="boolean"?e.nested:!0;let a=e&&e.startIndex||0,o;for(;o=Z8(n,t,{debug:s,startIndex:a});)r?a=o.start+1+t.length:a=o.end,i.push(o);return s&&console.log("findTagsByName found",i.length,"tags"),i}eM.exports=KR;eM.exports.default=KR;var K8=eM.exports;const J8=yf(K8),Cu={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},ur={};for(const n in Cu)Cu.hasOwnProperty(n)&&(ur[Cu[n]]=parseInt(n,10));const Q8=[ur.BitsPerSample,ur.ExtraSamples,ur.SampleFormat,ur.StripByteCounts,ur.StripOffsets,ur.StripRowCounts,ur.TileByteCounts,ur.TileOffsets,ur.SubIFDs],mx={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},Ee={};for(const n in mx)mx.hasOwnProperty(n)&&(Ee[mx[n]]=parseInt(n,10));const Zi={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},tH={Unspecified:0,Assocalpha:1,Unassalpha:2},XY={Version:0,AddCompression:1},qY={None:0,Deflate:1,Zstandard:2},eH={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function nH(n,t){const{width:e,height:i}=n,s=new Uint8Array(e*i*3);let r;for(let a=0,o=0;a>24,l=n[s+2]<<24>>24;let c=(a+16)/116,h=o/500+c,u=c-l/200,p,m,g;h=oH*(h*h*h>.008856?h*h*h:(h-16/116)/7.787),c=lH*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),u=cH*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),p=h*3.2406+c*-1.5372+u*-.4986,m=h*-.9689+c*1.8758+u*.0415,g=h*.0557+c*-.204+u*1.057,p=p>.0031308?1.055*p**(1/2.4)-.055:12.92*p,m=m>.0031308?1.055*m**(1/2.4)-.055:12.92*m,g=g>.0031308?1.055*g**(1/2.4)-.055:12.92*g,i[r]=Math.max(0,Math.min(1,p))*255,i[r+1]=Math.max(0,Math.min(1,m))*255,i[r+2]=Math.max(0,Math.min(1,g))*255}return i}const JR=new Map;function ro(n,t){Array.isArray(n)||(n=[n]),n.forEach(e=>JR.set(e,t))}async function uH(n){const t=JR.get(n.Compression);if(!t)throw new Error(`Unknown compression method identifier: ${n.Compression}`);const e=await t();return new e(n)}ro([void 0,1],()=>pl(()=>import("./raw-Dt1HMqYc.js"),__vite__mapDeps([0,1])).then(n=>n.default));ro(5,()=>pl(()=>import("./lzw-DpvbRwG5.js"),__vite__mapDeps([2,1])).then(n=>n.default));ro(6,()=>{throw new Error("old style JPEG compression is not supported.")});ro(7,()=>pl(()=>import("./jpeg-CdeCw_eT.js"),__vite__mapDeps([3,1])).then(n=>n.default));ro([8,32946],()=>pl(()=>import("./deflate-Daq-M6nQ.js"),__vite__mapDeps([4,1,5,6,7,8,9,10])).then(n=>n.default));ro(32773,()=>pl(()=>import("./packbits-DQnG8s9w.js"),__vite__mapDeps([11,1])).then(n=>n.default));ro(34887,()=>pl(()=>import("./lerc-CwjFlo57.js"),__vite__mapDeps([12,5,6,1,7,8,9,10])).then(async n=>(await n.zstd.init(),n)).then(n=>n.default));ro(50001,()=>pl(()=>import("./webimage-BcnuJlio.js"),__vite__mapDeps([13,1])).then(n=>n.default));function Rg(n,t,e,i=1){return new(Object.getPrototypeOf(n)).constructor(t*e*i)}function fH(n,t,e,i,s){const r=t/i,a=e/s;return n.map(o=>{const l=Rg(o,i,s);for(let c=0;c{const l=Rg(o,i,s);for(let c=0;c>8-s-C&u;else if(C+s<=16)h[S]=o.getUint16(P)>>16-s-C&u;else if(C+s<=24){const T=o.getUint16(P)<<8|o.getUint8(P+2);h[S]=T>>24-s-C&u}else h[S]=o.getUint32(P)>>32-s-C&u}}}}return h.buffer}class MH{constructor(t,e,i,s,r,a){this.fileDirectory=t,this.geoKeys=e,this.dataView=i,this.littleEndian=s,this.tiles=r?{}:null,this.isTiled=!t.StripOffsets;const o=t.PlanarConfiguration;if(this.planarConfiguration=typeof o>"u"?1:o,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=a}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}getBytesPerPixel(){let t=0;for(let e=0;e=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${t} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}getReaderForSample(t){const e=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,i=this.fileDirectory.BitsPerSample[t];switch(e){case 1:if(i<=8)return DataView.prototype.getUint8;if(i<=16)return DataView.prototype.getUint16;if(i<=32)return DataView.prototype.getUint32;break;case 2:if(i<=8)return DataView.prototype.getInt8;if(i<=16)return DataView.prototype.getInt16;if(i<=32)return DataView.prototype.getInt32;break;case 3:switch(i){case 16:return function(s,r){return jR(this,s,r)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(t=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}getBitsPerSample(t=0){return this.fileDirectory.BitsPerSample[t]}getArrayForSample(t,e){const i=this.getSampleFormat(t),s=this.getBitsPerSample(t);return mv(i,s,e)}async getTileOrStrip(t,e,i,s,r){const a=Math.ceil(this.getWidth()/this.getTileWidth()),o=Math.ceil(this.getHeight()/this.getTileHeight());let l;const{tiles:c}=this;this.planarConfiguration===1?l=e*a+t:this.planarConfiguration===2&&(l=i*a*o+e*a+t);let h,u;this.isTiled?(h=this.fileDirectory.TileOffsets[l],u=this.fileDirectory.TileByteCounts[l]):(h=this.fileDirectory.StripOffsets[l],u=this.fileDirectory.StripByteCounts[l]);const p=(await this.source.fetch([{offset:h,length:u}],r))[0];let m;return c===null||!c[l]?(m=(async()=>{let g=await s.decode(this.fileDirectory,p);const x=this.getSampleFormat(),y=this.getBitsPerSample();return xH(x,y)&&(g=vH(g,x,this.planarConfiguration,this.getSamplesPerPixel(),y,this.getTileWidth(),this.getBlockHeight(e))),g})(),c!==null&&(c[l]=m)):m=c[l],{x:t,y:e,sample:i,data:await m}}async _readRaster(t,e,i,s,r,a,o,l,c){const h=this.getTileWidth(),u=this.getTileHeight(),p=this.getWidth(),m=this.getHeight(),g=Math.max(Math.floor(t[0]/h),0),x=Math.min(Math.ceil(t[2]/h),Math.ceil(p/h)),y=Math.max(Math.floor(t[1]/u),0),_=Math.min(Math.ceil(t[3]/u),Math.ceil(m/u)),M=t[2]-t[0];let b=this.getBytesPerPixel();const S=[],P=[];for(let L=0;L{const X=tt.data,at=new DataView(X),H=this.getBlockHeight(tt.y),J=tt.y*u,st=tt.x*h,q=J+H,ct=(tt.x+1)*h,mt=P[z],Y=Math.min(H,H-(q-t[3]),m-J),rt=Math.min(h,h-(ct-t[2]),p-st);for(let wt=Math.max(0,t[1]-J);wth[2]||h[1]>h[3])throw new Error("Invalid subsets");const u=h[2]-h[0],p=h[3]-h[1],m=u*p,g=this.getSamplesPerPixel();if(!e||!e.length)for(let M=0;M=g)return Promise.reject(new RangeError(`Invalid sample index '${e[M]}'.`));let x;if(i){const M=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,b=Math.max.apply(null,this.fileDirectory.BitsPerSample);x=mv(M,b,m*e.length),l&&x.fill(l)}else{x=[];for(let M=0;Mc[2]||c[1]>c[3])throw new Error("Invalid subsets");const h=this.fileDirectory.PhotometricInterpretation;if(h===Zi.RGB){let _=[0,1,2];if(this.fileDirectory.ExtraSamples!==tH.Unspecified&&o){_=[];for(let M=0;Mdx(r,"sample")===void 0):s=s.filter(r=>Number(dx(r,"sample"))===t);for(let r=0;r[o+s*y+r*_,u+l*y+c*_]),g=m.map(y=>y[0]),x=m.map(y=>y[1]);return[Math.min(...g),Math.min(...x),Math.max(...g),Math.max(...x)]}else{const s=this.getOrigin(),r=this.getResolution(),a=s[0],o=s[1],l=a+r[0]*i,c=o+r[1]*e;return[Math.min(a,l),Math.min(o,c),Math.max(a,l),Math.max(o,c)]}}}class wH{constructor(t){this._dataView=new DataView(t)}get buffer(){return this._dataView.buffer}getUint64(t,e){const i=this.getUint32(t,e),s=this.getUint32(t+4,e);let r;if(e){if(r=i+2**32*s,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}if(r=2**32*i+s,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}getInt64(t,e){let i=0;const s=(this._dataView.getUint8(t+(e?7:0))&128)>0;let r=!0;for(let a=0;a<8;a++){let o=this._dataView.getUint8(t+(e?a:7-a));s&&(r?o!==0&&(o=~(o-1)&255,r=!1):o=~o&255),i+=o*256**a}return s&&(i=-i),i}getUint8(t,e){return this._dataView.getUint8(t,e)}getInt8(t,e){return this._dataView.getInt8(t,e)}getUint16(t,e){return this._dataView.getUint16(t,e)}getInt16(t,e){return this._dataView.getInt16(t,e)}getUint32(t,e){return this._dataView.getUint32(t,e)}getInt32(t,e){return this._dataView.getInt32(t,e)}getFloat16(t,e){return jR(this._dataView,t,e)}getFloat32(t,e){return this._dataView.getFloat32(t,e)}getFloat64(t,e){return this._dataView.getFloat64(t,e)}}class bH{constructor(t,e,i,s){this._dataView=new DataView(t),this._sliceOffset=e,this._littleEndian=i,this._bigTiff=s}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(t,e){return this.sliceOffset<=t&&this.sliceTop>=t+e}readUint8(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}readInt8(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}readUint16(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}readInt16(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}readUint32(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}readInt32(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}readFloat32(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}readFloat64(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}readUint64(t){const e=this.readUint32(t),i=this.readUint32(t+4);let s;if(this._littleEndian){if(s=e+2**32*i,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}if(s=2**32*e+i,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}readInt64(t){let e=0;const i=(this._dataView.getUint8(t+(this._littleEndian?7:0))&128)>0;let s=!0;for(let r=0;r<8;r++){let a=this._dataView.getUint8(t+(this._littleEndian?r:7-r));i&&(s?a!==0&&(a=~(a-1)&255,s=!1):a=~a&255),e+=a*256**r}return i&&(e=-e),e}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}const sA=`\r \r `;function QR(n){if(typeof Object.fromEntries<"u")return Object.fromEntries(n);const t={};for(const[e,i]of n)t[e.toLowerCase()]=i;return t}function SH(n){const t=n.split(`\r `).map(e=>{const i=e.split(":").map(s=>s.trim());return i[0]=i[0].toLowerCase(),i});return QR(t)}function EH(n){const[t,...e]=n.split(";").map(s=>s.trim()),i=e.map(s=>s.split("="));return{type:t,params:QR(i)}}function gv(n){let t,e,i;return n&&([,t,e,i]=n.match(/bytes (\d+)-(\d+)\/(\d+)/),t=parseInt(t,10),e=parseInt(e,10),i=parseInt(i,10)),{start:t,end:e,total:i}}function AH(n,t){let e=null;const i=new TextDecoder("ascii"),s=[],r=`--${t}`,a=`${r}--`;for(let o=0;o<10;++o)i.decode(new Uint8Array(n,o,r.length))===r&&(e=o);if(e===null)throw new Error("Could not find initial boundary");for(;ethis.fetchSlice(i,e)))}async fetchSlice(t){throw new Error(`fetching of slice ${t} not possible, not implemented`)}get fileSize(){return null}async close(){}}class TH extends Map{constructor(t={}){if(super(),!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof t.maxAge=="number"&&t.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=t.maxSize,this.maxAge=t.maxAge||Number.POSITIVE_INFINITY,this.onEviction=t.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(t){if(typeof this.onEviction=="function")for(const[e,i]of t)this.onEviction(e,i.value)}_deleteIfExpired(t,e){return typeof e.expiry=="number"&&e.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(t,e.value),this.delete(t)):!1}_getOrDeleteIfExpired(t,e){if(this._deleteIfExpired(t,e)===!1)return e.value}_getItemValue(t,e){return e.expiry?this._getOrDeleteIfExpired(t,e):e.value}_peek(t,e){const i=e.get(t);return this._getItemValue(t,i)}_set(t,e){this.cache.set(t,e),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(t,e){this.oldCache.delete(t),this._set(t,e)}*_entriesAscending(){for(const t of this.oldCache){const[e,i]=t;this.cache.has(e)||this._deleteIfExpired(e,i)===!1&&(yield t)}for(const t of this.cache){const[e,i]=t;this._deleteIfExpired(e,i)===!1&&(yield t)}}get(t){if(this.cache.has(t)){const e=this.cache.get(t);return this._getItemValue(t,e)}if(this.oldCache.has(t)){const e=this.oldCache.get(t);if(this._deleteIfExpired(t,e)===!1)return this._moveToRecent(t,e),e.value}}set(t,e,{maxAge:i=this.maxAge}={}){const s=typeof i=="number"&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;return this.cache.has(t)?this.cache.set(t,{value:e,expiry:s}):this._set(t,{value:e,expiry:s}),this}has(t){return this.cache.has(t)?!this._deleteIfExpired(t,this.cache.get(t)):this.oldCache.has(t)?!this._deleteIfExpired(t,this.oldCache.get(t)):!1}peek(t){if(this.cache.has(t))return this._peek(t,this.cache);if(this.oldCache.has(t))return this._peek(t,this.oldCache)}delete(t){const e=this.cache.delete(t);return e&&this._size--,this.oldCache.delete(t)||e}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(t){if(!(t&&t>0))throw new TypeError("`maxSize` must be a number greater than 0");const e=[...this._entriesAscending()],i=e.length-t;i<0?(this.cache=new Map(e),this.oldCache=new Map,this._size=e.length):(i>0&&this._emitEvictions(e.slice(0,i)),this.oldCache=new Map(e.slice(i)),this.cache=new Map,this._size=0),this.maxSize=t}*keys(){for(const[t]of this)yield t}*values(){for(const[,t]of this)yield t}*[Symbol.iterator](){for(const t of this.cache){const[e,i]=t;this._deleteIfExpired(e,i)===!1&&(yield[e,i.value])}for(const t of this.oldCache){const[e,i]=t;this.cache.has(e)||this._deleteIfExpired(e,i)===!1&&(yield[e,i.value])}}*entriesDescending(){let t=[...this.cache];for(let e=t.length-1;e>=0;--e){const i=t[e],[s,r]=i;this._deleteIfExpired(s,r)===!1&&(yield[s,r.value])}t=[...this.oldCache];for(let e=t.length-1;e>=0;--e){const i=t[e],[s,r]=i;this.cache.has(s)||this._deleteIfExpired(s,r)===!1&&(yield[s,r.value])}}*entriesAscending(){for(const[t,e]of this._entriesAscending())yield[t,e.value]}get size(){if(!this._size)return this.oldCache.size;let t=0;for(const e of this.oldCache.keys())this.cache.has(e)||t++;return Math.min(this._size+t,this.maxSize)}entries(){return this.entriesAscending()}forEach(t,e=this){for(const[i,s]of this.entriesAscending())t.call(e,s,i,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}async function CH(n){return new Promise(t=>setTimeout(t,n))}function RH(n,t){const e=Array.isArray(n)?n:Array.from(n),i=Array.isArray(t)?t:Array.from(t);return e.map((s,r)=>[s,i[r]])}class Jc extends Error{constructor(t){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,Jc),this.name="AbortError"}}class PH extends Error{constructor(t,e){super(e),this.errors=t,this.message=e,this.name="AggregateError"}}const IH=PH;class LH{constructor(t,e,i=null){this.offset=t,this.length=e,this.data=i}get top(){return this.offset+this.length}}class rA{constructor(t,e,i){this.offset=t,this.length=e,this.blockIds=i}}class DH extends t3{constructor(t,{blockSize:e=65536,cacheSize:i=100}={}){super(),this.source=t,this.blockSize=e,this.blockCache=new TH({maxSize:i,onEviction:(s,r)=>{this.evictedBlocks.set(s,r)}}),this.evictedBlocks=new Map,this.blockRequests=new Map,this.blockIdsToFetch=new Set,this.abortedBlockIds=new Set}get fileSize(){return this.source.fileSize}async fetch(t,e){const i=[],s=[],r=[];this.evictedBlocks.clear();for(const{offset:p,length:m}of t){let g=p+m;const{fileSize:x}=this;x!==null&&(g=Math.min(g,x));const y=Math.floor(p/this.blockSize)*this.blockSize;for(let _=y;_this.abortedBlockIds.has(p)||!this.blockCache.has(p));if(l.forEach(p=>this.blockIdsToFetch.add(p)),l.length>0&&e&&!e.aborted){this.fetchBlocks(null);for(const p of l){const m=this.blockRequests.get(p);if(!m)throw new Error(`Block ${p} is not in the block requests`);o.push(m)}await Promise.allSettled(o)}if(e&&e.aborted)throw new Jc("Request was aborted");const c=r.map(p=>this.blockCache.get(p)||this.evictedBlocks.get(p)),h=c.filter(p=>!p);if(h.length)throw new IH(h,"Request failed");const u=new Map(RH(r,c));return this.readSliceData(t,u)}fetchBlocks(t){if(this.blockIdsToFetch.size>0){const e=this.groupBlocks(this.blockIdsToFetch),i=this.source.fetch(e,t);for(let s=0;s{try{const o=(await i)[s],l=a*this.blockSize,c=l-o.offset,h=Math.min(c+this.blockSize,o.data.byteLength),u=o.data.slice(c,h),p=new LH(l,u.byteLength,u,a);this.blockCache.set(a,p),this.abortedBlockIds.delete(a)}catch(o){if(o.name==="AbortError")o.signal=t,this.blockCache.delete(a),this.abortedBlockIds.add(a);else throw o}finally{this.blockRequests.delete(a)}})())}this.blockIdsToFetch.clear()}}groupBlocks(t){const e=Array.from(t).sort((a,o)=>a-o);if(e.length===0)return[];let i=[],s=null;const r=[];for(const a of e)s===null||s+1===a?(i.push(a),s=a):(r.push(new rA(i[0]*this.blockSize,i.length*this.blockSize,i)),i=[a],s=a);return r.push(new rA(i[0]*this.blockSize,i.length*this.blockSize,i)),r}readSliceData(t,e){return t.map(i=>{let s=i.offset+i.length;this.fileSize!==null&&(s=Math.min(this.fileSize,s));const r=Math.floor(i.offset/this.blockSize),a=Math.floor(s/this.blockSize),o=new ArrayBuffer(i.length),l=new Uint8Array(o);for(let c=r;c<=a;++c){const h=e.get(c),u=h.offset-i.offset,p=h.top-s;let m=0,g=0,x;u<0?m=-u:u>0&&(g=u),p<0?x=h.length-m:x=s-h.offset-m;const y=new Uint8Array(h.data,m,x);l.set(y,g)}return o})}}class aM{get ok(){return this.status>=200&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(t){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class oM{constructor(t){this.url=t}async request({headers:t,signal:e}={}){throw new Error("request is not implemented")}}class NH extends aM{constructor(t){super(),this.response=t}get status(){return this.response.status}getHeader(t){return this.response.headers.get(t)}async getData(){return this.response.arrayBuffer?await this.response.arrayBuffer():(await this.response.buffer()).buffer}}class OH extends oM{constructor(t,e){super(t),this.credentials=e}async request({headers:t,signal:e}={}){const i=await fetch(this.url,{headers:t,credentials:this.credentials,signal:e});return new NH(i)}}class FH extends aM{constructor(t,e){super(),this.xhr=t,this.data=e}get status(){return this.xhr.status}getHeader(t){return this.xhr.getResponseHeader(t)}async getData(){return this.data}}class UH extends oM{constructRequest(t,e){return new Promise((i,s)=>{const r=new XMLHttpRequest;r.open("GET",this.url),r.responseType="arraybuffer";for(const[a,o]of Object.entries(t))r.setRequestHeader(a,o);r.onload=()=>{const a=r.response;i(new FH(r,a))},r.onerror=s,r.onabort=()=>s(new Jc("Request aborted")),r.send(),e&&(e.aborted&&r.abort(),e.addEventListener("abort",()=>r.abort()))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}const gx={};class kH extends aM{constructor(t,e){super(),this.response=t,this.dataPromise=e}get status(){return this.response.statusCode}getHeader(t){return this.response.headers[t]}async getData(){return await this.dataPromise}}class zH extends oM{constructor(t){super(t),this.parsedUrl=gx.parse(this.url),this.httpApi=(this.parsedUrl.protocol==="http:",gx)}constructRequest(t,e){return new Promise((i,s)=>{const r=this.httpApi.get({...this.parsedUrl,headers:t},a=>{const o=new Promise(l=>{const c=[];a.on("data",h=>{c.push(h)}),a.on("end",()=>{const h=Buffer.concat(c).buffer;l(h)}),a.on("error",s)});i(new kH(a,o))});r.on("error",s),e&&(e.aborted&&r.destroy(new Jc("Request aborted")),e.addEventListener("abort",()=>r.destroy(new Jc("Request aborted"))))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}class lM extends t3{constructor(t,e,i,s){super(),this.client=t,this.headers=e,this.maxRanges=i,this.allowFullFile=s,this._fileSize=null}async fetch(t,e){return this.maxRanges>=t.length?this.fetchSlices(t,e):(this.maxRanges>0&&t.length>1,Promise.all(t.map(i=>this.fetchSlice(i,e))))}async fetchSlices(t,e){const i=await this.client.request({headers:{...this.headers,Range:`bytes=${t.map(({offset:s,length:r})=>`${s}-${s+r}`).join(",")}`},signal:e});if(i.ok)if(i.status===206){const{type:s,params:r}=EH(i.getHeader("content-type"));if(s==="multipart/byteranges"){const u=AH(await i.getData(),r.boundary);return this._fileSize=u[0].fileSize||null,u}const a=await i.getData(),{start:o,end:l,total:c}=gv(i.getHeader("content-range"));this._fileSize=c||null;const h=[{data:a,offset:o,length:l-o}];if(t.length>1){const u=await Promise.all(t.slice(1).map(p=>this.fetchSlice(p,e)));return h.concat(u)}return h}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const s=await i.getData();return this._fileSize=s.byteLength,[{data:s,offset:0,length:s.byteLength}]}else throw new Error("Error fetching data.")}async fetchSlice(t,e){const{offset:i,length:s}=t,r=await this.client.request({headers:{...this.headers,Range:`bytes=${i}-${i+s}`},signal:e});if(r.ok)if(r.status===206){const a=await r.getData(),{total:o}=gv(r.getHeader("content-range"));return this._fileSize=o||null,{data:a,offset:i,length:s}}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const a=await r.getData();return this._fileSize=a.byteLength,{data:a,offset:0,length:a.byteLength}}else throw new Error("Error fetching data.")}get fileSize(){return this._fileSize}}function cM(n,{blockSize:t,cacheSize:e}){return t===null?n:new DH(n,{blockSize:t,cacheSize:e})}function BH(n,{headers:t={},credentials:e,maxRanges:i=0,allowFullFile:s=!1,...r}={}){const a=new OH(n,e),o=new lM(a,t,i,s);return cM(o,r)}function HH(n,{headers:t={},maxRanges:e=0,allowFullFile:i=!1,...s}={}){const r=new UH(n),a=new lM(r,t,e,i);return cM(a,s)}function GH(n,{headers:t={},maxRanges:e=0,allowFullFile:i=!1,...s}={}){const r=new zH(n),a=new lM(r,t,e,i);return cM(a,s)}function VH(n,{forceXHR:t=!1,...e}={}){return typeof fetch=="function"&&!t?BH(n,e):typeof XMLHttpRequest<"u"?HH(n,e):GH(n,e)}function yv(n){switch(n){case Ee.BYTE:case Ee.ASCII:case Ee.SBYTE:case Ee.UNDEFINED:return 1;case Ee.SHORT:case Ee.SSHORT:return 2;case Ee.LONG:case Ee.SLONG:case Ee.FLOAT:case Ee.IFD:return 4;case Ee.RATIONAL:case Ee.SRATIONAL:case Ee.DOUBLE:case Ee.LONG8:case Ee.SLONG8:case Ee.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${n}`)}}function WH(n){const t=n.GeoKeyDirectory;if(!t)return null;const e={};for(let i=4;i<=t[3]*4;i+=4){const s=eH[t[i]],r=t[i+1]?Cu[t[i+1]]:null,a=t[i+2],o=t[i+3];let l=null;if(!r)l=o;else{if(l=n[r],typeof l>"u"||l===null)throw new Error(`Could not get value of geoKey '${s}'.`);typeof l=="string"?l=l.substring(o,o+a-1):l.subarray&&(l=l.subarray(o,o+a),a===1&&(l=l[0]))}e[s]=l}return e}function mc(n,t,e,i){let s=null,r=null;const a=yv(t);switch(t){case Ee.BYTE:case Ee.ASCII:case Ee.UNDEFINED:s=new Uint8Array(e),r=n.readUint8;break;case Ee.SBYTE:s=new Int8Array(e),r=n.readInt8;break;case Ee.SHORT:s=new Uint16Array(e),r=n.readUint16;break;case Ee.SSHORT:s=new Int16Array(e),r=n.readInt16;break;case Ee.LONG:case Ee.IFD:s=new Uint32Array(e),r=n.readUint32;break;case Ee.SLONG:s=new Int32Array(e),r=n.readInt32;break;case Ee.LONG8:case Ee.IFD8:s=new Array(e),r=n.readUint64;break;case Ee.SLONG8:s=new Array(e),r=n.readInt64;break;case Ee.RATIONAL:s=new Uint32Array(e*2),r=n.readUint32;break;case Ee.SRATIONAL:s=new Int32Array(e*2),r=n.readInt32;break;case Ee.FLOAT:s=new Float32Array(e),r=n.readFloat32;break;case Ee.DOUBLE:s=new Float64Array(e),r=n.readFloat64;break;default:throw new RangeError(`Invalid field type: ${t}`)}if(t===Ee.RATIONAL||t===Ee.SRATIONAL)for(let o=0;og.getWidth()-x.getWidth());for(let g=0;gy||a&&a>_)break}}let p=e;if(o){const[m,g]=l.getOrigin(),[x,y]=c.getResolution(l);p=[Math.round((o[0]-m)/x),Math.round((o[1]-g)/y),Math.round((o[2]-m)/x),Math.round((o[3]-g)/y)],p=[Math.min(p[0],p[2]),Math.min(p[1],p[3]),Math.max(p[0],p[2]),Math.max(p[1],p[3])]}return c.readRasters({...t,window:p})}}class hM extends XH{constructor(t,e,i,s,r={}){super(),this.source=t,this.littleEndian=e,this.bigTiff=i,this.firstIFDOffset=s,this.cache=r.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(t,e){const i=this.bigTiff?4048:1024;return new bH((await this.source.fetch([{offset:t,length:typeof e<"u"?e:i}]))[0],t,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(t){const e=this.bigTiff?20:12,i=this.bigTiff?8:2;let s=await this.getSlice(t);const r=this.bigTiff?s.readUint64(t):s.readUint16(t),a=r*e+(this.bigTiff?16:6);s.covers(t,a)||(s=await this.getSlice(t,a));const o={};let l=t+(this.bigTiff?8:2);for(let u=0;u{const e=await this.ifdRequests[t-1];if(e.nextIFDByteOffset===0)throw new fm(t);return this.parseFileDirectoryAt(e.nextIFDByteOffset)})(),this.ifdRequests[t]}async getImage(t=0){const e=await this.requestIFD(t);return new MH(e.fileDirectory,e.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let t=0,e=!0;for(;e;)try{await this.requestIFD(t),++t}catch(i){if(i instanceof fm)e=!1;else throw i}return t}async getGhostValues(){const t=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const e="GDAL_STRUCTURAL_METADATA_SIZE=",i=e.length+100;let s=await this.getSlice(t,i);if(e===mc(s,Ee.ASCII,e.length,t)){const a=mc(s,Ee.ASCII,i,t).split(` diff --git a/assets/deflate-DWOWiK3U.js b/assets/deflate-DWOWiK3U.js deleted file mode 100644 index d6f96ab..0000000 --- a/assets/deflate-DWOWiK3U.js +++ /dev/null @@ -1 +0,0 @@ -import{i as r}from"./Simulation-DhU9q6Cl.js";import{B as o}from"./basedecoder-DvumDe3Y.js";import"./index-CNMbRSP0.js";import"./heading-BaecBvU5.js";import"./Footer-TCVu7l1I.js";import"./location-B7jWusd1.js";import"./stack-u4belbkc.js";class c extends o{decodeBlock(e){return r(new Uint8Array(e)).buffer}}export{c as default}; diff --git a/assets/deflate-Daq-M6nQ.js b/assets/deflate-Daq-M6nQ.js new file mode 100644 index 0000000..a7f60ce --- /dev/null +++ b/assets/deflate-Daq-M6nQ.js @@ -0,0 +1 @@ +import{i as r}from"./Simulation-CuB9nlPz.js";import{B as o}from"./basedecoder-DvumDe3Y.js";import"./index-Blxo1hic.js";import"./heading-CX4arv15.js";import"./Footer-DvQMRGAB.js";import"./location-D9lkPsfw.js";import"./stack-B32WIkoR.js";class c extends o{decodeBlock(e){return r(new Uint8Array(e)).buffer}}export{c as default}; diff --git a/assets/heading-BaecBvU5.js b/assets/heading-CX4arv15.js similarity index 93% rename from assets/heading-BaecBvU5.js rename to assets/heading-CX4arv15.js index 29fff9c..34a126b 100644 --- a/assets/heading-BaecBvU5.js +++ b/assets/heading-CX4arv15.js @@ -1 +1 @@ -import{Y as h,f as c,s as m,y as x,j as n,c as d,l as i,q as _}from"./index-CNMbRSP0.js";const[g,y]=h("Card"),H=c(function(s,a){const{className:e,children:r,direction:t="column",justify:u,align:C,...f}=m(s),l=x("Card",s);return n.jsx(d.div,{ref:a,className:i("chakra-card",e),__css:{display:"flex",flexDirection:t,justifyContent:u,alignItems:C,position:"relative",minWidth:0,wordWrap:"break-word",...l.container},...f,children:n.jsx(g,{value:l,children:r})})}),k=c(function(s,a){const{className:e,...r}=s,t=y();return n.jsx(d.div,{ref:a,className:i("chakra-card__body",e),__css:t.body,...r})}),v=c(function(s,a){const{className:e,...r}=s,t=y();return n.jsx(d.div,{ref:a,className:i("chakra-card__header",e),__css:t.header,...r})}),N=c(function(s,a){const e=_("Heading",s),{className:r,...t}=m(s);return n.jsx(d.h2,{ref:a,className:i("chakra-heading",s.className),...t,__css:e})});N.displayName="Heading";export{H as C,N as H,v as a,k as b}; +import{Y as h,f as c,s as m,y as x,j as n,c as d,l as i,q as _}from"./index-Blxo1hic.js";const[g,y]=h("Card"),H=c(function(s,a){const{className:e,children:r,direction:t="column",justify:u,align:C,...f}=m(s),l=x("Card",s);return n.jsx(d.div,{ref:a,className:i("chakra-card",e),__css:{display:"flex",flexDirection:t,justifyContent:u,alignItems:C,position:"relative",minWidth:0,wordWrap:"break-word",...l.container},...f,children:n.jsx(g,{value:l,children:r})})}),k=c(function(s,a){const{className:e,...r}=s,t=y();return n.jsx(d.div,{ref:a,className:i("chakra-card__body",e),__css:t.body,...r})}),v=c(function(s,a){const{className:e,...r}=s,t=y();return n.jsx(d.div,{ref:a,className:i("chakra-card__header",e),__css:t.header,...r})}),N=c(function(s,a){const e=_("Heading",s),{className:r,...t}=m(s);return n.jsx(d.h2,{ref:a,className:i("chakra-heading",s.className),...t,__css:e})});N.displayName="Heading";export{H as C,N as H,v as a,k as b}; diff --git a/assets/image-DKhd7Alb.js b/assets/image-BuVSjtYu.js similarity index 91% rename from assets/image-DKhd7Alb.js rename to assets/image-BuVSjtYu.js index 0797f79..91b5879 100644 --- a/assets/image-DKhd7Alb.js +++ b/assets/image-BuVSjtYu.js @@ -1 +1 @@ -import{d as b,n as N,f as v,j as k,o as S,c as j}from"./index-CNMbRSP0.js";function w(c){const{loading:e,src:o,srcSet:s,onLoad:r,onError:t,crossOrigin:i,sizes:g,ignoreFallback:f}=c,[l,u]=b.useState("pending");b.useEffect(()=>{u(o?"loading":"pending")},[o]);const n=b.useRef(),h=b.useCallback(()=>{if(!o)return;d();const a=new Image;a.src=o,i&&(a.crossOrigin=i),s&&(a.srcset=s),g&&(a.sizes=g),e&&(a.loading=e),a.onload=m=>{d(),u("loaded"),r==null||r(m)},a.onerror=m=>{d(),u("failed"),t==null||t(m)},n.current=a},[o,i,s,g,r,t,e]),d=()=>{n.current&&(n.current.onload=null,n.current.onerror=null,n.current=null)};return N(()=>{if(!f)return l==="loading"&&h(),()=>{d()}},[l,h,f]),f?"loaded":l}const O=(c,e)=>c!=="loaded"&&e==="beforeLoadOrError"||c==="failed"&&e==="onError",I=v(function(e,o){const{htmlWidth:s,htmlHeight:r,alt:t,...i}=e;return k.jsx("img",{width:s,height:r,ref:o,alt:t,...i})});I.displayName="NativeImage";const y=v(function(e,o){const{fallbackSrc:s,fallback:r,src:t,srcSet:i,align:g,fit:f,loading:l,ignoreFallback:u,crossOrigin:n,fallbackStrategy:h="beforeLoadOrError",referrerPolicy:d,...a}=e,m=s!==void 0||r!==void 0,p=l!=null||u||!m,x=w({...e,crossOrigin:n,ignoreFallback:p}),E=O(x,h),F={ref:o,objectFit:f,objectPosition:g,...p?a:S(a,["onError","onLoad"])};return E?r||k.jsx(j.img,{as:I,className:"chakra-image__placeholder",src:s,...F}):k.jsx(j.img,{as:I,src:t,srcSet:i,crossOrigin:n,loading:l,referrerPolicy:d,className:"chakra-image",...F})});y.displayName="Image";export{y as I}; +import{d as b,n as N,f as v,j as k,o as S,c as j}from"./index-Blxo1hic.js";function w(c){const{loading:e,src:o,srcSet:s,onLoad:r,onError:t,crossOrigin:i,sizes:g,ignoreFallback:f}=c,[l,u]=b.useState("pending");b.useEffect(()=>{u(o?"loading":"pending")},[o]);const n=b.useRef(),h=b.useCallback(()=>{if(!o)return;d();const a=new Image;a.src=o,i&&(a.crossOrigin=i),s&&(a.srcset=s),g&&(a.sizes=g),e&&(a.loading=e),a.onload=m=>{d(),u("loaded"),r==null||r(m)},a.onerror=m=>{d(),u("failed"),t==null||t(m)},n.current=a},[o,i,s,g,r,t,e]),d=()=>{n.current&&(n.current.onload=null,n.current.onerror=null,n.current=null)};return N(()=>{if(!f)return l==="loading"&&h(),()=>{d()}},[l,h,f]),f?"loaded":l}const O=(c,e)=>c!=="loaded"&&e==="beforeLoadOrError"||c==="failed"&&e==="onError",I=v(function(e,o){const{htmlWidth:s,htmlHeight:r,alt:t,...i}=e;return k.jsx("img",{width:s,height:r,ref:o,alt:t,...i})});I.displayName="NativeImage";const y=v(function(e,o){const{fallbackSrc:s,fallback:r,src:t,srcSet:i,align:g,fit:f,loading:l,ignoreFallback:u,crossOrigin:n,fallbackStrategy:h="beforeLoadOrError",referrerPolicy:d,...a}=e,m=s!==void 0||r!==void 0,p=l!=null||u||!m,x=w({...e,crossOrigin:n,ignoreFallback:p}),E=O(x,h),F={ref:o,objectFit:f,objectPosition:g,...p?a:S(a,["onError","onLoad"])};return E?r||k.jsx(j.img,{as:I,className:"chakra-image__placeholder",src:s,...F}):k.jsx(j.img,{as:I,src:t,srcSet:i,crossOrigin:n,loading:l,referrerPolicy:d,className:"chakra-image",...F})});y.displayName="Image";export{y as I}; diff --git a/assets/index-CNMbRSP0.js b/assets/index-Blxo1hic.js similarity index 99% rename from assets/index-CNMbRSP0.js rename to assets/index-Blxo1hic.js index 9fe44db..78b4a83 100644 --- a/assets/index-CNMbRSP0.js +++ b/assets/index-Blxo1hic.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Map-tZhd2dZT.js","assets/Footer-TCVu7l1I.js","assets/location-B7jWusd1.js","assets/image-DKhd7Alb.js","assets/Map-k4G4I0uA.css","assets/Simulation-DhU9q6Cl.js","assets/heading-BaecBvU5.js","assets/stack-u4belbkc.js","assets/Impressum-Cbmxyvq8.js","assets/Datenschutz-DDnbcbeD.js","assets/About-DPAPI_xR.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Map-CLF45QNY.js","assets/Footer-DvQMRGAB.js","assets/location-D9lkPsfw.js","assets/image-BuVSjtYu.js","assets/Map-k4G4I0uA.css","assets/Simulation-CuB9nlPz.js","assets/heading-CX4arv15.js","assets/stack-B32WIkoR.js","assets/Impressum-DNXAZQkm.js","assets/Datenschutz-BPm9eaoX.js","assets/About-CwFoPN31.js"])))=>i.map(i=>d[i]); var kC=Object.defineProperty;var CC=(e,t,n)=>t in e?kC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var pn=(e,t,n)=>CC(e,typeof t!="symbol"?t+"":t,n);function Iv(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const TC="modulepreload",PC=function(e){return"/"+e},Am={},Yr=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=PC(l),l in Am)return;Am[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":TC,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};var Sn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dv={exports:{}},du={},Fv={exports:{}},G={};/** * @license React * react.production.min.js @@ -374,4 +374,4 @@ Error generating stack: `+o.message+` * * @license MIT */function Zf(){return Zf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function c4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function d4(e,t){return e.button===0&&(!t||t==="_self")&&!c4(e)}const f4=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],h4="6";try{window.__reactRouterVersion=h4}catch{}const p4="startTransition",U0=Pd[p4];function m4(e){let{basename:t,children:n,future:r,window:i}=e,o=x.useRef();o.current==null&&(o.current=SD({window:i,v5Compat:!0}));let s=o.current,[a,l]=x.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=x.useCallback(d=>{u&&U0?U0(()=>l(d)):l(d)},[l,u]);return x.useLayoutEffect(()=>s.listen(c),[s,c]),x.createElement(a4,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}const g4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jf=x.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:s,state:a,target:l,to:u,preventScrollReset:c,unstable_viewTransition:d}=t,f=u4(t,f4),{basename:p}=x.useContext(ti),g,v=!1;if(typeof u=="string"&&y4.test(u)&&(g=u,g4))try{let y=new URL(window.location.href),k=u.startsWith("//")?new URL(y.protocol+u):new URL(u),P=sm(k.pathname,p);k.origin===y.origin&&P!=null?u=P+k.search+k.hash:v=!0}catch{}let S=KD(u,{relative:i}),m=v4(u,{replace:s,state:a,target:l,preventScrollReset:c,relative:i,unstable_viewTransition:d});function h(y){r&&r(y),y.defaultPrevented||m(y)}return x.createElement("a",Zf({},f,{href:g||S,onClick:v||o?r:h,ref:n,target:l}))});var W0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(W0||(W0={}));var H0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(H0||(H0={}));function v4(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:a}=t===void 0?{}:t,l=GD(),u=Ju(),c=Vw(e,{relative:s});return x.useCallback(d=>{if(d4(d,n)){d.preventDefault();let f=r!==void 0?r:iu(u)===iu(c);l(e,{replace:f,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:a})}},[u,l,c,r,i,n,e,o,s,a])}const b4={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class su{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||b4,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i{let[a,l]=s;for(let u=0;u{let[a,l]=s;for(let u=0;u{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},K0=e=>e==null?"":""+e,S4=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},x4=/###/g,G0=e=>e&&e.indexOf("###")>-1?e.replace(x4,"."):e,q0=e=>!e||typeof e=="string",ds=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let i=0;for(;i{const{obj:r,k:i}=ds(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],s=t.slice(0,t.length-1),a=ds(e,s,Object);for(;a.obj===void 0&&s.length;)o=`${s[s.length-1]}.${o}`,s=s.slice(0,s.length-1),a=ds(e,s,Object),a&&a.obj&&typeof a.obj[`${a.k}.${o}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=n},w4=(e,t,n,r)=>{const{obj:i,k:o}=ds(e,t,Object);i[o]=i[o]||[],i[o].push(n)},au=(e,t)=>{const{obj:n,k:r}=ds(e,t);if(n)return n[r]},k4=(e,t,n)=>{const r=au(e,n);return r!==void 0?r:au(t,n)},Hw=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):Hw(e[r],t[r],n):e[r]=t[r]);return e},si=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var C4={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const T4=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>C4[t]):e;class P4{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const E4=[" ",",","?","!",";"],_4=new P4(20),$4=(e,t,n)=>{t=t||"",n=n||"";const r=E4.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const i=_4.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let o=!i.test(e);if(!o){const s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o},eh=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let o=0;o-1&&le&&e.indexOf("_")>0?e.replace("_","-"):e;class Y0 extends ec{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,n],r&&(Array.isArray(r)?a.push(...r):typeof r=="string"&&o?a.push(...r.split(o)):a.push(r)));const l=au(this.data,a);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),l||!s||typeof r!="string"?l:eh(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let a=[t,n];r&&(a=a.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(a=t.split("."),i=n,n=a[1]),this.addNamespaces(n),X0(this.data,a,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),i=r,r=n,n=a[1]),this.addNamespaces(n);let l=au(this.data,a)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?Hw(l,r,o):l={...l,...r},X0(this.data,a,l),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var Kw={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,i))}),t}};const Q0={};class uu extends ec{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),S4(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=sn.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!$4(t,r,i);if(s&&!a){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(t[t.length-1],n),l=a[a.length-1],u=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(c){const k=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${k}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${k}${s}`}return i?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:s}const d=this.resolve(t,n);let f=d&&d.res;const p=d&&d.usedKey||s,g=d&&d.exactUsedKey||s,v=Object.prototype.toString.apply(f),S=["[object Number]","[object Function]","[object RegExp]"],m=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,h=!this.i18nFormat||this.i18nFormat.handleAsObject;if(h&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&S.indexOf(v)<0&&!(typeof m=="string"&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const k=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,f,{...n,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return i?(d.res=k,d.usedParams=this.getUsedParamsDetails(n),d):k}if(o){const k=Array.isArray(f),P=k?[]:{},R=k?g:p;for(const _ in f)if(Object.prototype.hasOwnProperty.call(f,_)){const O=`${R}${o}${_}`;P[_]=this.translate(O,{...n,joinArrays:!1,ns:a}),P[_]===O&&(P[_]=f[_])}f=P}}else if(h&&typeof m=="string"&&Array.isArray(f))f=f.join(m),f&&(f=this.extendTranslation(f,t,n,r));else{let k=!1,P=!1;const R=n.count!==void 0&&typeof n.count!="string",_=uu.hasDefaultValue(n),O=R?this.pluralResolver.getSuffix(u,n.count,n):"",N=n.ordinal&&R?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",I=R&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),K=I&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${O}`]||n[`defaultValue${N}`]||n.defaultValue;!this.isValidLookup(f)&&_&&(k=!0,f=K),this.isValidLookup(f)||(P=!0,f=s);const dt=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:f,je=_&&K!==f&&this.options.updateMissing;if(P||k||je){if(this.logger.log(je?"updateKey":"missingKey",u,l,s,je?K:f),o){const A=this.resolve(s,{...n,keySeparator:!1});A&&A.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 T=[];const L=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&L&&L[0])for(let A=0;A{const Q=_&&z!==f?z:dt;this.options.missingKeyHandler?this.options.missingKeyHandler(A,l,j,Q,je,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(A,l,j,Q,je,n),this.emit("missingKey",A,l,j,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?T.forEach(A=>{const j=this.pluralResolver.getSuffixes(A,n);I&&n[`defaultValue${this.options.pluralSeparator}zero`]&&j.indexOf(`${this.options.pluralSeparator}zero`)<0&&j.push(`${this.options.pluralSeparator}zero`),j.forEach(z=>{F([A],s+z,n[`defaultValue${z}`]||K)})}):F(T,s,K))}f=this.extendTranslation(f,t,n,d,r),P&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${s}`),(P||k)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${s}`:s,k?f:void 0):f=this.options.parseMissingKeyHandler(f))}return i?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(t,n,r,i,o){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(u){const f=t.match(this.interpolator.nestingRegexp);c=f&&f.length}let d=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language||i.usedLng,r),u){const f=t.match(this.interpolator.nestingRegexp),p=f&&f.length;c1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,s,a;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),c=u.key;i=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",p=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),g=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(S=>{this.isValidLookup(r)||(a=S,!Q0[`${v[0]}-${S}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(Q0[`${v[0]}-${S}`]=!0,this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${a}" 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!!!")),v.forEach(m=>{if(this.isValidLookup(r))return;s=m;const h=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(h,c,m,S,n);else{let k;f&&(k=this.pluralResolver.getSuffix(m,n.count,n));const P=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(h.push(c+k),n.ordinal&&k.indexOf(R)===0&&h.push(c+k.replace(R,this.options.pluralSeparator)),p&&h.push(c+P)),g){const _=`${c}${this.options.contextSeparator}${n.context}`;h.push(_),f&&(h.push(_+k),n.ordinal&&k.indexOf(R)===0&&h.push(_+k.replace(R,this.options.pluralSeparator)),p&&h.push(_+P))}}let y;for(;y=h.pop();)this.isValidLookup(r)||(o=y,r=this.getResource(m,S,y,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:s,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const vd=e=>e.charAt(0).toUpperCase()+e.slice(1);class Z0{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=sn.create("languageUtils")}getScriptPartFromCode(t){if(t=lu(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=lu(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(i=>i.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=vd(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=vd(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=vd(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=s=>{s&&(this.isSupportedCode(s)?i.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),r.forEach(s=>{i.indexOf(s)<0&&o(this.formatLanguageCode(s))}),i}}let R4=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],A4={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const O4=["v1","v2","v3"],L4=["v4"],J0={zero:0,one:1,two:2,few:3,many:4,other:5},M4=()=>{const e={};return R4.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:A4[t.fc]}})}),e};class z4{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=sn.create("pluralResolver"),(!this.options.compatibilityJSON||L4.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=M4(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=lu(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const s=new Intl.PluralRules(r,{type:i});return this.pluralRulesCache[o]=s,s}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((i,o)=>J0[i]-J0[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):r.numbers.map(i=>this.getSuffix(t,i,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:this.getSuffixRetroCompatible(i,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let i=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const o=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!O4.includes(this.options.compatibilityJSON)}}const ev=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=k4(e,t,n);return!o&&i&&typeof n=="string"&&(o=eh(e,n,r),o===void 0&&(o=eh(t,n,r))),o},bd=e=>e.replace(/\$/g,"$$$$");class j4{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=sn.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:s,suffix:a,suffixEscaped:l,formatSeparator:u,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:g,nestingSuffixEscaped:v,nestingOptionsSeparator:S,maxReplaces:m,alwaysFormat:h}=t.interpolation;this.escape=n!==void 0?n:T4,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?si(o):s||"{{",this.suffix=a?si(a):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=f?si(f):p||si("$t("),this.nestingSuffix=g?si(g):v||si(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=m||1e3,this.alwaysFormat=h!==void 0?h:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,i){let o,s,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=p=>{if(p.indexOf(this.formatSeparator)<0){const m=ev(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(m,void 0,r,{...i,...n,interpolationkey:p}):m}const g=p.split(this.formatSeparator),v=g.shift().trim(),S=g.join(this.formatSeparator).trim();return this.format(ev(n,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),S,r,{...i,...n,interpolationkey:v})};this.resetRegExp();const c=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>bd(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?bd(this.escape(p)):bd(p)}].forEach(p=>{for(a=0;o=p.regex.exec(t);){const g=o[1].trim();if(s=u(g),s===void 0)if(typeof c=="function"){const S=c(t,o,i);s=typeof S=="string"?S:""}else if(i&&Object.prototype.hasOwnProperty.call(i,g))s="";else if(d){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${t}`),s="";else typeof s!="string"&&!this.useRawValueToEscape&&(s=K0(s));const v=p.safeValue(s);if(t=t.replace(o[0],v),d?(p.regex.lastIndex+=s.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,s;const a=(l,u)=>{const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const d=l.split(new RegExp(`${c}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,s);const p=f.match(/'/g),g=f.match(/"/g);(p&&p.length%2===0&&!g||g.length%2!==0)&&(f=f.replace(/'/g,'"'));try{s=JSON.parse(f),u&&(s={...u,...s})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,v),`${l}${c}${f}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,l};for(;i=this.nestingRegexp.exec(t);){let l=[];s={...r},s=s.replace&&typeof s.replace!="string"?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const c=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=c.shift(),l=c,u=!0}if(o=n(a.call(this,i[1].trim(),s),s),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=K0(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u&&(o=l.reduce((c,d)=>this.format(c,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const I4=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(s=>{if(s){const[a,...l]=s.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),c=a.trim();n[c]||(n[c]=u),u==="false"&&(n[c]=!1),u==="true"&&(n[c]=!0),isNaN(u)||(n[c]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},ai=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const s=r+JSON.stringify(o);let a=t[s];return a||(a=e(lu(r),i),t[s]=a),a(n)}};class D4{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=sn.create("formatter"),this.options=t,this.formats={number:ai((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:ai((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:ai((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:ai((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:ai((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=ai(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(a=>a.indexOf(")")>-1)){const a=o.findIndex(l=>l.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,a)].join(this.formatSeparator)}return o.reduce((a,l)=>{const{formatName:u,formatOptions:c}=I4(l);if(this.formats[u]){let d=a;try{const f=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},p=f.locale||f.lng||i.locale||i.lng||r;d=this.formats[u](a,p,{...c,...i,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${u}`);return a},t)}}const F4=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class N4 extends ec{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=sn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,i.backend,i)}queueLoad(t,n,r,i){const o={},s={},a={},l={};return t.forEach(u=>{let c=!0;n.forEach(d=>{const f=`${u}|${d}`;!r.reload&&this.store.hasResourceBundle(u,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?s[f]===void 0&&(s[f]=!0):(this.state[f]=1,c=!1,s[f]===void 0&&(s[f]=!0),o[f]===void 0&&(o[f]=!0),l[d]===void 0&&(l[d]=!0)))}),c||(a[u]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],s=i[1];n&&this.emit("failedLoading",o,s,n),!n&&r&&this.store.addResourceBundle(o,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const a={};this.queue.forEach(l=>{w4(l.loaded,[o],s),F4(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{a[u]||(a[u]={});const c=l.loaded[u];c.length&&c.forEach(d=>{a[u][d]===void 0&&(a[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:s});return}this.readingCalls++;const a=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&c&&i{this.read.call(this,t,n,r,i+1,o*2,s)},o);return}s(u,c)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(t,n);u&&typeof u.then=="function"?u.then(c=>a(null,c)).catch(a):a(null,u)}catch(u){a(u)}return}return l(t,n,a)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,s),!s&&a&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,a),this.loaded(t,s,a)})}saveMissing(t,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const l={...s,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(t,n,r,i,l):c=u(t,n,r,i),c&&typeof c.then=="function"?c.then(d=>a(null,d)).catch(a):a(null,c)}catch(c){a(c)}else u(t,n,r,i,a,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const tv=()=>({debug:!1,initImmediate:!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:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),nv=e=>(typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Ua=()=>{},B4=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Ws extends ec{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=nv(t),this.services={},this.logger=sn,this.modules={external:[]},B4(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=tv();this.options={...i,...this.options,...nv(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?sn.init(o(this.modules.logger),this.options):sn.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=D4);const d=new Z0(this.options);this.store=new Y0(this.options.resources,this.options);const f=this.services;f.logger=sn,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new z4(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(f.formatter=o(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new j4(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new N4(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(p){for(var g=arguments.length,v=new Array(g>1?g-1:0),S=1;S1?g-1:0),S=1;S{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Ua),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[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(c=>{this[c]=function(){return t.store[c](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=function(){return t.store[c](...arguments),t}});const l=Oo(),u=()=>{const c=(d,f)=>{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),l.resolve(f),r(d,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ua;const i=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],s=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};i?s(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>s(l)),this.options.preload&&this.options.preload.forEach(a=>s(a)),this.services.backendConnector.load(o,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,n,r){const i=Oo();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Ua),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Kw.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=Oo();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,u)=>{u?(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},a=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const u=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,c=>{s(c,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),i}getFixedT(t,n,r){var i=this;const o=function(s,a){let l;if(typeof a!="object"){for(var u=arguments.length,c=new Array(u>2?u-2:0),d=2;d`${l.keyPrefix}${f}${g}`):p=l.keyPrefix?`${l.keyPrefix}${f}${s}`:s,i.t(p,l)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(a,l)=>{const u=this.services.backendConnector.state[`${a}|${l}`];return u===-1||u===0||u===2};if(n.precheck){const a=n.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}loadNamespaces(t,n){const r=Oo();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Oo();typeof t=="string"&&(t=[t]);const i=this.options.preload||[],o=t.filter(s=>i.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return o.length?(this.options.preload=i.concat(o),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["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"],r=this.services&&this.services.languageUtils||new Z0(tv());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Ws(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ua;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Ws(i);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(a=>{o[a]=this[a]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new Y0(this.store.data,i),o.services.resourceStore=o.store),o.translator=new uu(o.services,i),o.translator.on("*",function(a){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c{console!=null&&console.warn&&(Ur(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},rv={},th=(...e)=>{Ur(e[0])&&rv[e[0]]||(Ur(e[0])&&(rv[e[0]]=new Date),V4(...e))},Gw=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},iv=(e,t,n)=>{e.loadNamespaces(t,Gw(e,n))},ov=(e,t,n,r)=>{Ur(n)&&(n=[n]),n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,Gw(e,r))},U4=(e,t,n={})=>!t.languages||!t.languages.length?(th("i18n.languages were undefined or empty",t.languages),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{var o;if(((o=n.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Ur=e=>typeof e=="string",W4=e=>typeof e=="object"&&e!==null,H4=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,K4={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},G4=e=>K4[e],q4=e=>e.replace(H4,G4);let nh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:q4};const X4=(e={})=>{nh={...nh,...e}},Y4=()=>nh;let qw;const Q4=e=>{qw=e},Z4=()=>qw,J4={type:"3rdParty",init(e){X4(e.options.react),Q4(e)}},eF=x.createContext();class tF{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{var r;(r=this.usedNamespaces)[n]??(r[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const nF=(e,t)=>{const n=x.useRef();return x.useEffect(()=>{n.current=e},[e,t]),n.current},Xw=(e,t,n,r)=>e.getFixedT(t,n,r),rF=(e,t,n,r)=>x.useCallback(Xw(e,t,n,r),[e,t,n,r]),Yw=(e,t={})=>{var k,P,R,_;const{i18n:n}=t,{i18n:r,defaultNS:i}=x.useContext(eF)||{},o=n||r||Z4();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new tF),!o){th("You will need to pass in an i18next instance by using initReactI18next");const O=(I,K)=>Ur(K)?K:W4(K)&&Ur(K.defaultValue)?K.defaultValue:Array.isArray(I)?I[I.length-1]:I,N=[O,{},!1];return N.t=O,N.i18n={},N.ready=!1,N}(k=o.options.react)!=null&&k.wait&&th("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...Y4(),...o.options.react,...t},{useSuspense:a,keyPrefix:l}=s;let u=i||((P=o.options)==null?void 0:P.defaultNS);u=Ur(u)?[u]:u||["translation"],(_=(R=o.reportNamespaces).addUsedNamespaces)==null||_.call(R,u);const c=(o.isInitialized||o.initializedStoreOnce)&&u.every(O=>U4(O,o,s)),d=rF(o,t.lng||null,s.nsMode==="fallback"?u:u[0],l),f=()=>d,p=()=>Xw(o,t.lng||null,s.nsMode==="fallback"?u:u[0],l),[g,v]=x.useState(f);let S=u.join();t.lng&&(S=`${t.lng}${S}`);const m=nF(S),h=x.useRef(!0);x.useEffect(()=>{const{bindI18n:O,bindI18nStore:N}=s;h.current=!0,!c&&!a&&(t.lng?ov(o,t.lng,u,()=>{h.current&&v(p)}):iv(o,u,()=>{h.current&&v(p)})),c&&m&&m!==S&&h.current&&v(p);const I=()=>{h.current&&v(p)};return O&&(o==null||o.on(O,I)),N&&(o==null||o.store.on(N,I)),()=>{h.current=!1,o&&(O==null||O.split(" ").forEach(K=>o.off(K,I))),N&&o&&N.split(" ").forEach(K=>o.store.off(K,I))}},[o,S]),x.useEffect(()=>{h.current&&c&&v(f)},[o,l,c]);const y=[g,o,c];if(y.t=g,y.i18n=o,y.ready=c,c||!c&&!a)return y;throw new Promise(O=>{t.lng?ov(o,t.lng,u,()=>O()):iv(o,u,()=>O())})};function rh(e){"@babel/helpers - typeof";return rh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rh(e)}function Qw(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":rh(XMLHttpRequest))==="object"}function iF(e){return!!e&&typeof e.then=="function"}function oF(e){return iF(e)?e:Promise.resolve(e)}function sF(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ih={exports:{}},Wa={exports:{}},sv;function aF(){return sv||(sv=1,function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Sn<"u"&&Sn,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(s){var a=typeof o<"u"&&o||typeof self<"u"&&self||typeof a<"u"&&a,l={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function u(T){return T&&DataView.prototype.isPrototypeOf(T)}if(l.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(T){return T&&c.indexOf(Object.prototype.toString.call(T))>-1};function f(T){if(typeof T!="string"&&(T=String(T)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(T)||T==="")throw new TypeError('Invalid character in header field name: "'+T+'"');return T.toLowerCase()}function p(T){return typeof T!="string"&&(T=String(T)),T}function g(T){var L={next:function(){var F=T.shift();return{done:F===void 0,value:F}}};return l.iterable&&(L[Symbol.iterator]=function(){return L}),L}function v(T){this.map={},T instanceof v?T.forEach(function(L,F){this.append(F,L)},this):Array.isArray(T)?T.forEach(function(L){this.append(L[0],L[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function(L){this.append(L,T[L])},this)}v.prototype.append=function(T,L){T=f(T),L=p(L);var F=this.map[T];this.map[T]=F?F+", "+L:L},v.prototype.delete=function(T){delete this.map[f(T)]},v.prototype.get=function(T){return T=f(T),this.has(T)?this.map[T]:null},v.prototype.has=function(T){return this.map.hasOwnProperty(f(T))},v.prototype.set=function(T,L){this.map[f(T)]=p(L)},v.prototype.forEach=function(T,L){for(var F in this.map)this.map.hasOwnProperty(F)&&T.call(L,this.map[F],F,this)},v.prototype.keys=function(){var T=[];return this.forEach(function(L,F){T.push(F)}),g(T)},v.prototype.values=function(){var T=[];return this.forEach(function(L){T.push(L)}),g(T)},v.prototype.entries=function(){var T=[];return this.forEach(function(L,F){T.push([F,L])}),g(T)},l.iterable&&(v.prototype[Symbol.iterator]=v.prototype.entries);function S(T){if(T.bodyUsed)return Promise.reject(new TypeError("Already read"));T.bodyUsed=!0}function m(T){return new Promise(function(L,F){T.onload=function(){L(T.result)},T.onerror=function(){F(T.error)}})}function h(T){var L=new FileReader,F=m(L);return L.readAsArrayBuffer(T),F}function y(T){var L=new FileReader,F=m(L);return L.readAsText(T),F}function k(T){for(var L=new Uint8Array(T),F=new Array(L.length),A=0;A-1?L:T}function N(T,L){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');L=L||{};var F=L.body;if(T instanceof N){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,L.headers||(this.headers=new v(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!F&&T._bodyInit!=null&&(F=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=L.credentials||this.credentials||"same-origin",(L.headers||!this.headers)&&(this.headers=new v(L.headers)),this.method=O(L.method||this.method||"GET"),this.mode=L.mode||this.mode||null,this.signal=L.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&F)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(F),(this.method==="GET"||this.method==="HEAD")&&(L.cache==="no-store"||L.cache==="no-cache")){var A=/([?&])_=[^&]*/;if(A.test(this.url))this.url=this.url.replace(A,"$1_="+new Date().getTime());else{var j=/\?/;this.url+=(j.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}N.prototype.clone=function(){return new N(this,{body:this._bodyInit})};function I(T){var L=new FormData;return T.trim().split("&").forEach(function(F){if(F){var A=F.split("="),j=A.shift().replace(/\+/g," "),z=A.join("=").replace(/\+/g," ");L.append(decodeURIComponent(j),decodeURIComponent(z))}}),L}function K(T){var L=new v,F=T.replace(/\r?\n[\t ]+/g," ");return F.split("\r").map(function(A){return A.indexOf(` -`)===0?A.substr(1,A.length):A}).forEach(function(A){var j=A.split(":"),z=j.shift().trim();if(z){var Q=j.join(":").trim();L.append(z,Q)}}),L}R.call(N.prototype);function ge(T,L){if(!(this instanceof ge))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');L||(L={}),this.type="default",this.status=L.status===void 0?200:L.status,this.ok=this.status>=200&&this.status<300,this.statusText=L.statusText===void 0?"":""+L.statusText,this.headers=new v(L.headers),this.url=L.url||"",this._initBody(T)}R.call(ge.prototype),ge.prototype.clone=function(){return new ge(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new v(this.headers),url:this.url})},ge.error=function(){var T=new ge(null,{status:0,statusText:""});return T.type="error",T};var dt=[301,302,303,307,308];ge.redirect=function(T,L){if(dt.indexOf(L)===-1)throw new RangeError("Invalid status code");return new ge(null,{status:L,headers:{location:T}})},s.DOMException=a.DOMException;try{new s.DOMException}catch{s.DOMException=function(L,F){this.message=L,this.name=F;var A=Error(L);this.stack=A.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function je(T,L){return new Promise(function(F,A){var j=new N(T,L);if(j.signal&&j.signal.aborted)return A(new s.DOMException("Aborted","AbortError"));var z=new XMLHttpRequest;function Q(){z.abort()}z.onload=function(){var H={status:z.status,statusText:z.statusText,headers:K(z.getAllResponseHeaders()||"")};H.url="responseURL"in z?z.responseURL:H.headers.get("X-Request-URL");var Qe="response"in z?z.response:z.responseText;setTimeout(function(){F(new ge(Qe,H))},0)},z.onerror=function(){setTimeout(function(){A(new TypeError("Network request failed"))},0)},z.ontimeout=function(){setTimeout(function(){A(new TypeError("Network request failed"))},0)},z.onabort=function(){setTimeout(function(){A(new s.DOMException("Aborted","AbortError"))},0)};function xe(H){try{return H===""&&a.location.href?a.location.href:H}catch{return H}}z.open(j.method,xe(j.url),!0),j.credentials==="include"?z.withCredentials=!0:j.credentials==="omit"&&(z.withCredentials=!1),"responseType"in z&&(l.blob?z.responseType="blob":l.arrayBuffer&&j.headers.get("Content-Type")&&j.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(z.responseType="arraybuffer")),L&&typeof L.headers=="object"&&!(L.headers instanceof v)?Object.getOwnPropertyNames(L.headers).forEach(function(H){z.setRequestHeader(H,p(L.headers[H]))}):j.headers.forEach(function(H,Qe){z.setRequestHeader(Qe,H)}),j.signal&&(j.signal.addEventListener("abort",Q),z.onreadystatechange=function(){z.readyState===4&&j.signal.removeEventListener("abort",Q)}),z.send(typeof j._bodyInit>"u"?null:j._bodyInit)})}return je.polyfill=!0,a.fetch||(a.fetch=je,a.Headers=v,a.Request=N,a.Response=ge),s.Headers=v,s.Request=N,s.Response=ge,s.fetch=je,s})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(Wa,Wa.exports)),Wa.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof Sn<"u"&&Sn.fetch?n=Sn.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof sF<"u"&&typeof window>"u"){var r=n||aF();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(ih,ih.exports);var Zw=ih.exports;const Jw=Qr(Zw),av=Iv({__proto__:null,default:Jw},[Zw]);function lv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uv(e){for(var t=1;t"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var s=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,a=uv({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},dv?{}:s),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{cv(n,a,i,l)}catch(u){if(!s||Object.keys(s).length===0||!u.message||u.message.indexOf("not implemented")<0)return i(u);try{Object.keys(s).forEach(function(c){delete a[c]}),cv(n,a,i,l),dv=!0}catch(c){i(c)}}},fF=function(t,n,r,i){r&&Xr(r)==="object"&&(r=oh("",r).slice(1)),t.queryStringParams&&(n=oh(n,t.queryStringParams));try{var o;Hs?o=new Hs:o=new cu("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var s=t.customHeaders;if(s=typeof s=="function"?s():s,s)for(var a in s)o.setRequestHeader(a,s[a]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},hF=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},An&&n.indexOf("file:")!==0)return dF(t,n,r,i);if(Qw()||typeof ActiveXObject=="function")return fF(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function io(e){"@babel/helpers - typeof";return io=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},io(e)}function fv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sd(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};pF(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return gF(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=Sd(Sd(Sd({},vF()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var s=setInterval(function(){return r.reload()},this.options.reloadInterval);io(s)==="object"&&typeof s.unref=="function"&&s.unref()}}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,s){var a=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=oF(l),l.then(function(u){if(!u)return s(null,{});var c=a.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});a.loadUrl(c,s,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var s=this,a=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,u=this.options.parseLoadPayload(a,l);this.options.request(this.options,n,u,function(c,d){if(d&&(d.status>=500&&d.status<600||!d.status))return r("failed loading "+n+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return r("failed loading "+n+"; status code: "+d.status,!1);if(!d&&c&&c.message&&c.message.toLowerCase().indexOf("failed")>-1&&(c.message.indexOf("fetch")>-1||c.message.toLowerCase().indexOf("network")>-1))return r("failed loading "+n+": "+c.message,!0);if(c)return r(c,!1);var f,p;try{typeof d.data=="string"?f=s.options.parse(d.data,i,o):f=d.data}catch{p="failed parsing "+n+" to json"}if(p)return r(p,!1);r(null,f)})}},{key:"create",value:function(n,r,i,o,s){var a=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,c=[],d=[];n.forEach(function(f){var p=a.options.addPath;typeof a.options.addPath=="function"&&(p=a.options.addPath(f,r));var g=a.services.interpolator.interpolate(p,{lng:f,ns:r});a.options.request(a.options,g,l,function(v,S){u+=1,c.push(v),d.push(S),u===n.length&&typeof s=="function"&&s(c,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,s=r.logger,a=i.language;if(!(a&&a.toLowerCase()==="cimode")){var l=[],u=function(d){var f=o.toResolveHierarchy(d);f.forEach(function(p){l.indexOf(p)<0&&l.push(p)})};u(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){n.allOptions.ns.forEach(function(d){i.read(c,d,"read",null,null,function(f,p){f&&s.warn("loading namespace ".concat(d," for language ").concat(c," failed"),f),!f&&p&&s.log("loaded namespace ".concat(d," for language ").concat(c),p),i.loaded("".concat(c,"|").concat(d),f,p)})})})}}}])}();nk.type="backend";Ye.use(nk).use(J4).init({fallbackLng:"de"});var bF=function(e,t,n,r,i,o,s,a){if(!e){var l;if(t===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,s,a],c=0;l=new Error(t.replace(/%s/g,function(){return u[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},SF=bF;const hv=Qr(SF);var xF=function(t,n,r,i){var o=r?r.call(i,t,n):void 0;if(o!==void 0)return!!o;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var s=Object.keys(t),a=Object.keys(n);if(s.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(n),u=0;u(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(rk||{}),xd={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},pv=Object.values(rk),lm={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},kF=Object.entries(lm).reduce((e,[t,n])=>(e[n]=t,e),{}),Vt="data-rh",Ui={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Wi=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},CF=e=>{let t=Wi(e,"title");const n=Wi(e,Ui.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=Wi(e,Ui.DEFAULT_TITLE);return t||r||void 0},TF=e=>Wi(e,Ui.ON_CHANGE_CLIENT_STATE)||(()=>{}),wd=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),PF=(e,t)=>t.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const i=Object.keys(r);for(let o=0;oconsole&&typeof console.warn=="function"&&console.warn(e),Lo=(e,t,n)=>{const r={};return n.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&EF(`Helmet: ${e} should be of type "Array". Instead found type "${typeof i[e]}"`),!1)).map(i=>i[e]).reverse().reduce((i,o)=>{const s={};o.filter(l=>{let u;const c=Object.keys(l);for(let f=0;fi.push(l));const a=Object.keys(s);for(let l=0;l{if(Array.isArray(e)&&e.length){for(let n=0;n({baseTag:PF(["href"],e),bodyAttributes:wd("bodyAttributes",e),defer:Wi(e,Ui.DEFER),encode:Wi(e,Ui.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:wd("htmlAttributes",e),linkTags:Lo("link",["rel","href"],e),metaTags:Lo("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:Lo("noscript",["innerHTML"],e),onChangeClientState:TF(e),scriptTags:Lo("script",["src","innerHTML"],e),styleTags:Lo("style",["cssText"],e),title:CF(e),titleAttributes:wd("titleAttributes",e),prioritizeSeoTags:_F(e,Ui.PRIORITIZE_SEO_TAGS)}),ik=e=>Array.isArray(e)?e.join(""):e,RF=(e,t)=>{const n=Object.keys(e);for(let r=0;rArray.isArray(e)?e.reduce((n,r)=>(RF(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},mv=(e,t)=>({...e,[t]:void 0}),AF=["noscript","script","style"],sh=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),ok=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),OF=(e,t,n,r)=>{const i=ok(n),o=ik(t);return i?`<${e} ${Vt}="true" ${i}>${sh(o,r)}`:`<${e} ${Vt}="true">${sh(o,r)}`},LF=(e,t,n=!0)=>t.reduce((r,i)=>{const o=i,s=Object.keys(o).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,c)=>{const d=typeof o[c]>"u"?c:`${c}="${sh(o[c],n)}"`;return u?`${u} ${d}`:d},""),a=o.innerHTML||o.cssText||"",l=AF.indexOf(e)===-1;return`${r}<${e} ${Vt}="true" ${s}${l?"/>":`>${a}`}`},""),sk=(e,t={})=>Object.keys(e).reduce((n,r)=>{const i=lm[r];return n[i||r]=e[r],n},t),MF=(e,t,n)=>{const r={key:t,[Vt]:!0},i=sk(n,r);return[nn.createElement("title",i,t)]},Sl=(e,t)=>t.map((n,r)=>{const i={key:r,[Vt]:!0};return Object.keys(n).forEach(o=>{const a=lm[o]||o;if(a==="innerHTML"||a==="cssText"){const l=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[a]=n[o]}),nn.createElement(e,i)}),_t=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>MF(e,t.title,t.titleAttributes),toString:()=>OF(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>sk(t),toString:()=>ok(t)};default:return{toComponent:()=>Sl(e,t),toString:()=>LF(e,t,n)}}},zF=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const i=kd(e,xd.meta),o=kd(t,xd.link),s=kd(n,xd.script);return{priorityMethods:{toComponent:()=>[...Sl("meta",i.priority),...Sl("link",o.priority),...Sl("script",s.priority)],toString:()=>`${_t("meta",i.priority,r)} ${_t("link",o.priority,r)} ${_t("script",s.priority,r)}`},metaTags:i.default,linkTags:o.default,scriptTags:s.default}},jF=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:i,noscriptTags:o,styleTags:s,title:a="",titleAttributes:l,prioritizeSeoTags:u}=e;let{linkTags:c,metaTags:d,scriptTags:f}=e,p={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:p,linkTags:c,metaTags:d,scriptTags:f}=zF(e)),{priority:p,base:_t("base",t,r),bodyAttributes:_t("bodyAttributes",n,r),htmlAttributes:_t("htmlAttributes",i,r),link:_t("link",c,r),meta:_t("meta",d,r),noscript:_t("noscript",o,r),script:_t("script",f,r),style:_t("style",s,r),title:_t("title",{title:a,titleAttributes:l},r)}},ah=jF,Ha=[],ak=!!(typeof window<"u"&&window.document&&window.document.createElement),lh=class{constructor(e,t){pn(this,"instances",[]);pn(this,"canUseDOM",ak);pn(this,"context");pn(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Ha:this.instances,add:e=>{(this.canUseDOM?Ha:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Ha:this.instances).indexOf(e);(this.canUseDOM?Ha:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=ah({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},IF={},lk=nn.createContext(IF),jr,uk=(jr=class extends x.Component{constructor(n){super(n);pn(this,"helmetData");this.helmetData=new lh(this.props.context||{},jr.canUseDOM)}render(){return nn.createElement(lk.Provider,{value:this.helmetData.value},this.props.children)}},pn(jr,"canUseDOM",ak),jr),li=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${Vt}]`),i=[].slice.call(r),o=[];let s;return t&&t.length&&t.forEach(a=>{const l=document.createElement(e);for(const u in a)if(Object.prototype.hasOwnProperty.call(a,u))if(u==="innerHTML")l.innerHTML=a.innerHTML;else if(u==="cssText")l.styleSheet?l.styleSheet.cssText=a.cssText:l.appendChild(document.createTextNode(a.cssText));else{const c=u,d=typeof a[c]>"u"?"":a[c];l.setAttribute(u,d)}l.setAttribute(Vt,"true"),i.some((u,c)=>(s=c,l.isEqualNode(u)))?i.splice(s,1):o.push(l)}),i.forEach(a=>{var l;return(l=a.parentNode)==null?void 0:l.removeChild(a)}),o.forEach(a=>n.appendChild(a)),{oldTags:i,newTags:o}},uh=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(Vt),i=r?r.split(","):[],o=[...i],s=Object.keys(t);for(const a of s){const l=t[a]||"";n.getAttribute(a)!==l&&n.setAttribute(a,l),i.indexOf(a)===-1&&i.push(a);const u=o.indexOf(a);u!==-1&&o.splice(u,1)}for(let a=o.length-1;a>=0;a-=1)n.removeAttribute(o[a]);i.length===o.length?n.removeAttribute(Vt):n.getAttribute(Vt)!==s.join(",")&&n.setAttribute(Vt,s.join(","))},DF=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=ik(e)),uh("title",t)},gv=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:i,linkTags:o,metaTags:s,noscriptTags:a,onChangeClientState:l,scriptTags:u,styleTags:c,title:d,titleAttributes:f}=e;uh("body",r),uh("html",i),DF(d,f);const p={baseTag:li("base",n),linkTags:li("link",o),metaTags:li("meta",s),noscriptTags:li("noscript",a),scriptTags:li("script",u),styleTags:li("style",c)},g={},v={};Object.keys(p).forEach(S=>{const{newTags:m,oldTags:h}=p[S];m.length&&(g[S]=m),h.length&&(v[S]=p[S].oldTags)}),t&&t(),l(e,g,v)},Mo=null,FF=e=>{Mo&&cancelAnimationFrame(Mo),e.defer?Mo=requestAnimationFrame(()=>{gv(e,()=>{Mo=null})}):(gv(e),Mo=null)},NF=FF,yv=class extends x.Component{constructor(){super(...arguments);pn(this,"rendered",!1)}shouldComponentUpdate(t){return!wF(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let r=null;const i=$F(t.get().map(o=>{const s={...o.props};return delete s.context,s}));uk.canUseDOM?NF(i):ah&&(r=ah(i)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},Td,BF=(Td=class extends x.Component{shouldComponentUpdate(e){return!vS(mv(this.props,"helmetData"),mv(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return{...t,[e.type]:r,titleAttributes:{...n}};case"body":return{...t,bodyAttributes:{...n}};case"html":return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(r=>{n={...n,[r]:e[r]}}),n}warnOnInvalidChildren(e,t){return hv(pv.some(n=>e.type===n),typeof e.type=="function"?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${pv.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),hv(!t||typeof t=="string"||Array.isArray(t)&&!t.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`} ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let n={};return nn.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:i,...o}=r.props,s=Object.keys(o).reduce((l,u)=>(l[kF[u]||u]=o[u],l),{});let{type:a}=r;switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(r,i),a){case"Symbol(react.fragment)":t=this.mapChildrenToProps(i,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,s,i);break;default:t=this.mapObjectTypeChildren(r,t,s,i);break}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const{children:e,...t}=this.props;let n={...t},{helmetData:r}=t;if(e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof lh)){const i=r;r=new lh(i.context,!0),delete n.helmetData}return r?nn.createElement(yv,{...n,context:r.value}):nn.createElement(lk.Consumer,null,i=>nn.createElement(yv,{...n,context:i}))}},pn(Td,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Td);const ch=[{index:!0,label:"OpenPV",path:"/"},{labelKey:"about.title",label:"about",path:"/about"}],VF=x.lazy(()=>Yr(()=>import("./slide-zAfq0QPP.js").then(e=>e.s),[])),UF=()=>{const[e,t]=x.useState(!1),{t:n,i18n:r}=Yw();return $.jsxs("div",{className:"hamburger-container",children:[$.jsx("nav",{className:"main",id:"hambuger-nav",children:$.jsx("ul",{children:e?$.jsx("li",{className:"menu close-menu",children:$.jsx("div",{onClick:()=>t(!e),className:"menu-hover",children:"✕"})}):$.jsx("li",{className:"menu open-menu",children:$.jsx("div",{onClick:()=>t(!e),className:"menu-hover",children:"☰"})})})}),$.jsx(x.Suspense,{fallback:$.jsx($.Fragment,{}),children:$.jsx(VF,{right:!0,isOpen:e,children:$.jsx("ul",{className:"hamburger-ul",children:ch.map(i=>$.jsx("li",{children:$.jsx(Jf,{to:i.path,onClick:()=>t(!e),children:$.jsx("h3",{className:i.index&&"index-li",children:i.labelKey==null?i.label:n(i.labelKey)})})},i.label))})})})]})},WF=()=>{const{t:e,i18n:t}=Yw();return $.jsxs("header",{id:"header",children:[$.jsx("h1",{className:"index-link",children:ch.filter(n=>n.index).map(n=>$.jsx(Jf,{to:n.path,children:n.label},n.label))}),$.jsx("nav",{className:"links",children:$.jsx("ul",{children:ch.filter(n=>!n.index).map(n=>$.jsx("li",{children:$.jsx(Jf,{to:n.path,children:n.labelKey==null?n.label:e(n.labelKey)})},n.label))})}),$.jsx(UF,{})]})},um=e=>$.jsxs(uk,{children:[$.jsxs(BF,{titleTemplate:"%s | OpenPV",defaultTitle:"OpenPV",defer:!1,children:[e.title&&$.jsx("title",{children:e.title}),$.jsx("meta",{name:"description",content:e.description})]}),$.jsxs("div",{id:"wrapper",children:[$.jsx(WF,{}),$.jsx("div",{id:"main",children:e.children})]})]});um.propTypes={children:Cr.oneOfType([Cr.arrayOf(Cr.node),Cr.node]),fullPage:Cr.bool,title:Cr.string,description:Cr.string};um.defaultProps={children:null,fullPage:!1,title:null,description:"Ermittle das Potential für eine Solaranlage."};var HF={};const{PUBLIC_URL:KF}=HF,GF=x.lazy(()=>Yr(()=>import("./Map-tZhd2dZT.js"),__vite__mapDeps([0,1,2,3,4]))),qF=x.lazy(()=>Yr(()=>import("./Simulation-DhU9q6Cl.js").then(e=>e.S),__vite__mapDeps([5,6,1,2,7]))),XF=x.lazy(()=>Yr(()=>import("./NotFound-CAeZ5n7b.js"),[])),YF=x.lazy(()=>Yr(()=>import("./Impressum-Cbmxyvq8.js"),__vite__mapDeps([8,6]))),QF=x.lazy(()=>Yr(()=>import("./Datenschutz-DDnbcbeD.js"),__vite__mapDeps([9,6]))),vv=x.lazy(()=>Yr(()=>import("./About-DPAPI_xR.js"),__vite__mapDeps([10,1,6,7,3])));window.isTouchDevice=ZF();const bv=()=>$.jsx(pD,{children:$.jsx(nn.StrictMode,{children:$.jsx(m4,{basename:KF,children:$.jsx(x.Suspense,{fallback:$.jsx(um,{}),children:$.jsxs(l4,{children:[$.jsx(Un,{path:"/",element:$.jsx(GF,{})}),$.jsx(Un,{path:"/simulation/:lon/:lat",element:$.jsx(qF,{})}),$.jsx(Un,{path:"/anleitung",element:$.jsx(vv,{})}),$.jsx(Un,{path:"/about",element:$.jsx(vv,{})}),$.jsx(Un,{path:"/impressum",element:$.jsx(YF,{})}),$.jsx(Un,{path:"/datenschutz",element:$.jsx(QF,{})}),$.jsx(Un,{path:"*",element:$.jsx(XF,{})})]})})})})}),Cd=document.getElementById("root");Cd.hasChildNodes()?Ow(Cd,$.jsx(bv,{})):Lw(Cd).render($.jsx(bv,{}));function ZF(){const e="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,t=window.matchMedia("(pointer: coarse)").matches;return console.log(e&&t?"The device is of type touch.":"The device is a laptop."),e&&t}export{Sn as $,m3 as A,Qr as B,wS as C,PS as D,TS as E,Pl as F,uN as G,rN as H,Js as I,uk as J,BF as K,Jf as L,um as M,aN as N,Ut as O,Qu as P,XC as Q,nn as R,nN as S,tN as T,SS as U,wM as V,Yv as W,Ye as X,iN as Y,bD as Z,Yr as _,Z3 as a,lN as b,Kt as c,x as d,im as e,uo as f,Yw as g,GD as h,eN as i,$ as j,cT as k,so as l,c3 as m,_d as n,Zv as o,Dm as p,dp as q,rn as r,vh as s,ts as t,N3 as u,Zr as v,F3 as w,_O as x,V3 as y,sT as z}; +`)===0?A.substr(1,A.length):A}).forEach(function(A){var j=A.split(":"),z=j.shift().trim();if(z){var Q=j.join(":").trim();L.append(z,Q)}}),L}R.call(N.prototype);function ge(T,L){if(!(this instanceof ge))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');L||(L={}),this.type="default",this.status=L.status===void 0?200:L.status,this.ok=this.status>=200&&this.status<300,this.statusText=L.statusText===void 0?"":""+L.statusText,this.headers=new v(L.headers),this.url=L.url||"",this._initBody(T)}R.call(ge.prototype),ge.prototype.clone=function(){return new ge(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new v(this.headers),url:this.url})},ge.error=function(){var T=new ge(null,{status:0,statusText:""});return T.type="error",T};var dt=[301,302,303,307,308];ge.redirect=function(T,L){if(dt.indexOf(L)===-1)throw new RangeError("Invalid status code");return new ge(null,{status:L,headers:{location:T}})},s.DOMException=a.DOMException;try{new s.DOMException}catch{s.DOMException=function(L,F){this.message=L,this.name=F;var A=Error(L);this.stack=A.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function je(T,L){return new Promise(function(F,A){var j=new N(T,L);if(j.signal&&j.signal.aborted)return A(new s.DOMException("Aborted","AbortError"));var z=new XMLHttpRequest;function Q(){z.abort()}z.onload=function(){var H={status:z.status,statusText:z.statusText,headers:K(z.getAllResponseHeaders()||"")};H.url="responseURL"in z?z.responseURL:H.headers.get("X-Request-URL");var Qe="response"in z?z.response:z.responseText;setTimeout(function(){F(new ge(Qe,H))},0)},z.onerror=function(){setTimeout(function(){A(new TypeError("Network request failed"))},0)},z.ontimeout=function(){setTimeout(function(){A(new TypeError("Network request failed"))},0)},z.onabort=function(){setTimeout(function(){A(new s.DOMException("Aborted","AbortError"))},0)};function xe(H){try{return H===""&&a.location.href?a.location.href:H}catch{return H}}z.open(j.method,xe(j.url),!0),j.credentials==="include"?z.withCredentials=!0:j.credentials==="omit"&&(z.withCredentials=!1),"responseType"in z&&(l.blob?z.responseType="blob":l.arrayBuffer&&j.headers.get("Content-Type")&&j.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(z.responseType="arraybuffer")),L&&typeof L.headers=="object"&&!(L.headers instanceof v)?Object.getOwnPropertyNames(L.headers).forEach(function(H){z.setRequestHeader(H,p(L.headers[H]))}):j.headers.forEach(function(H,Qe){z.setRequestHeader(Qe,H)}),j.signal&&(j.signal.addEventListener("abort",Q),z.onreadystatechange=function(){z.readyState===4&&j.signal.removeEventListener("abort",Q)}),z.send(typeof j._bodyInit>"u"?null:j._bodyInit)})}return je.polyfill=!0,a.fetch||(a.fetch=je,a.Headers=v,a.Request=N,a.Response=ge),s.Headers=v,s.Request=N,s.Response=ge,s.fetch=je,s})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(Wa,Wa.exports)),Wa.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof Sn<"u"&&Sn.fetch?n=Sn.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof sF<"u"&&typeof window>"u"){var r=n||aF();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(ih,ih.exports);var Zw=ih.exports;const Jw=Qr(Zw),av=Iv({__proto__:null,default:Jw},[Zw]);function lv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uv(e){for(var t=1;t"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var s=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,a=uv({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},dv?{}:s),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{cv(n,a,i,l)}catch(u){if(!s||Object.keys(s).length===0||!u.message||u.message.indexOf("not implemented")<0)return i(u);try{Object.keys(s).forEach(function(c){delete a[c]}),cv(n,a,i,l),dv=!0}catch(c){i(c)}}},fF=function(t,n,r,i){r&&Xr(r)==="object"&&(r=oh("",r).slice(1)),t.queryStringParams&&(n=oh(n,t.queryStringParams));try{var o;Hs?o=new Hs:o=new cu("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var s=t.customHeaders;if(s=typeof s=="function"?s():s,s)for(var a in s)o.setRequestHeader(a,s[a]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},hF=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},An&&n.indexOf("file:")!==0)return dF(t,n,r,i);if(Qw()||typeof ActiveXObject=="function")return fF(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function io(e){"@babel/helpers - typeof";return io=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},io(e)}function fv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sd(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};pF(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return gF(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=Sd(Sd(Sd({},vF()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var s=setInterval(function(){return r.reload()},this.options.reloadInterval);io(s)==="object"&&typeof s.unref=="function"&&s.unref()}}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,s){var a=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=oF(l),l.then(function(u){if(!u)return s(null,{});var c=a.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});a.loadUrl(c,s,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var s=this,a=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,u=this.options.parseLoadPayload(a,l);this.options.request(this.options,n,u,function(c,d){if(d&&(d.status>=500&&d.status<600||!d.status))return r("failed loading "+n+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return r("failed loading "+n+"; status code: "+d.status,!1);if(!d&&c&&c.message&&c.message.toLowerCase().indexOf("failed")>-1&&(c.message.indexOf("fetch")>-1||c.message.toLowerCase().indexOf("network")>-1))return r("failed loading "+n+": "+c.message,!0);if(c)return r(c,!1);var f,p;try{typeof d.data=="string"?f=s.options.parse(d.data,i,o):f=d.data}catch{p="failed parsing "+n+" to json"}if(p)return r(p,!1);r(null,f)})}},{key:"create",value:function(n,r,i,o,s){var a=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,c=[],d=[];n.forEach(function(f){var p=a.options.addPath;typeof a.options.addPath=="function"&&(p=a.options.addPath(f,r));var g=a.services.interpolator.interpolate(p,{lng:f,ns:r});a.options.request(a.options,g,l,function(v,S){u+=1,c.push(v),d.push(S),u===n.length&&typeof s=="function"&&s(c,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,s=r.logger,a=i.language;if(!(a&&a.toLowerCase()==="cimode")){var l=[],u=function(d){var f=o.toResolveHierarchy(d);f.forEach(function(p){l.indexOf(p)<0&&l.push(p)})};u(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){n.allOptions.ns.forEach(function(d){i.read(c,d,"read",null,null,function(f,p){f&&s.warn("loading namespace ".concat(d," for language ").concat(c," failed"),f),!f&&p&&s.log("loaded namespace ".concat(d," for language ").concat(c),p),i.loaded("".concat(c,"|").concat(d),f,p)})})})}}}])}();nk.type="backend";Ye.use(nk).use(J4).init({fallbackLng:"de"});var bF=function(e,t,n,r,i,o,s,a){if(!e){var l;if(t===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,s,a],c=0;l=new Error(t.replace(/%s/g,function(){return u[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},SF=bF;const hv=Qr(SF);var xF=function(t,n,r,i){var o=r?r.call(i,t,n):void 0;if(o!==void 0)return!!o;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var s=Object.keys(t),a=Object.keys(n);if(s.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(n),u=0;u(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(rk||{}),xd={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},pv=Object.values(rk),lm={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},kF=Object.entries(lm).reduce((e,[t,n])=>(e[n]=t,e),{}),Vt="data-rh",Ui={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Wi=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},CF=e=>{let t=Wi(e,"title");const n=Wi(e,Ui.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=Wi(e,Ui.DEFAULT_TITLE);return t||r||void 0},TF=e=>Wi(e,Ui.ON_CHANGE_CLIENT_STATE)||(()=>{}),wd=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),PF=(e,t)=>t.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const i=Object.keys(r);for(let o=0;oconsole&&typeof console.warn=="function"&&console.warn(e),Lo=(e,t,n)=>{const r={};return n.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&EF(`Helmet: ${e} should be of type "Array". Instead found type "${typeof i[e]}"`),!1)).map(i=>i[e]).reverse().reduce((i,o)=>{const s={};o.filter(l=>{let u;const c=Object.keys(l);for(let f=0;fi.push(l));const a=Object.keys(s);for(let l=0;l{if(Array.isArray(e)&&e.length){for(let n=0;n({baseTag:PF(["href"],e),bodyAttributes:wd("bodyAttributes",e),defer:Wi(e,Ui.DEFER),encode:Wi(e,Ui.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:wd("htmlAttributes",e),linkTags:Lo("link",["rel","href"],e),metaTags:Lo("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:Lo("noscript",["innerHTML"],e),onChangeClientState:TF(e),scriptTags:Lo("script",["src","innerHTML"],e),styleTags:Lo("style",["cssText"],e),title:CF(e),titleAttributes:wd("titleAttributes",e),prioritizeSeoTags:_F(e,Ui.PRIORITIZE_SEO_TAGS)}),ik=e=>Array.isArray(e)?e.join(""):e,RF=(e,t)=>{const n=Object.keys(e);for(let r=0;rArray.isArray(e)?e.reduce((n,r)=>(RF(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},mv=(e,t)=>({...e,[t]:void 0}),AF=["noscript","script","style"],sh=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),ok=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),OF=(e,t,n,r)=>{const i=ok(n),o=ik(t);return i?`<${e} ${Vt}="true" ${i}>${sh(o,r)}`:`<${e} ${Vt}="true">${sh(o,r)}`},LF=(e,t,n=!0)=>t.reduce((r,i)=>{const o=i,s=Object.keys(o).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,c)=>{const d=typeof o[c]>"u"?c:`${c}="${sh(o[c],n)}"`;return u?`${u} ${d}`:d},""),a=o.innerHTML||o.cssText||"",l=AF.indexOf(e)===-1;return`${r}<${e} ${Vt}="true" ${s}${l?"/>":`>${a}`}`},""),sk=(e,t={})=>Object.keys(e).reduce((n,r)=>{const i=lm[r];return n[i||r]=e[r],n},t),MF=(e,t,n)=>{const r={key:t,[Vt]:!0},i=sk(n,r);return[nn.createElement("title",i,t)]},Sl=(e,t)=>t.map((n,r)=>{const i={key:r,[Vt]:!0};return Object.keys(n).forEach(o=>{const a=lm[o]||o;if(a==="innerHTML"||a==="cssText"){const l=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[a]=n[o]}),nn.createElement(e,i)}),_t=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>MF(e,t.title,t.titleAttributes),toString:()=>OF(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>sk(t),toString:()=>ok(t)};default:return{toComponent:()=>Sl(e,t),toString:()=>LF(e,t,n)}}},zF=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const i=kd(e,xd.meta),o=kd(t,xd.link),s=kd(n,xd.script);return{priorityMethods:{toComponent:()=>[...Sl("meta",i.priority),...Sl("link",o.priority),...Sl("script",s.priority)],toString:()=>`${_t("meta",i.priority,r)} ${_t("link",o.priority,r)} ${_t("script",s.priority,r)}`},metaTags:i.default,linkTags:o.default,scriptTags:s.default}},jF=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:i,noscriptTags:o,styleTags:s,title:a="",titleAttributes:l,prioritizeSeoTags:u}=e;let{linkTags:c,metaTags:d,scriptTags:f}=e,p={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:p,linkTags:c,metaTags:d,scriptTags:f}=zF(e)),{priority:p,base:_t("base",t,r),bodyAttributes:_t("bodyAttributes",n,r),htmlAttributes:_t("htmlAttributes",i,r),link:_t("link",c,r),meta:_t("meta",d,r),noscript:_t("noscript",o,r),script:_t("script",f,r),style:_t("style",s,r),title:_t("title",{title:a,titleAttributes:l},r)}},ah=jF,Ha=[],ak=!!(typeof window<"u"&&window.document&&window.document.createElement),lh=class{constructor(e,t){pn(this,"instances",[]);pn(this,"canUseDOM",ak);pn(this,"context");pn(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Ha:this.instances,add:e=>{(this.canUseDOM?Ha:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Ha:this.instances).indexOf(e);(this.canUseDOM?Ha:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=ah({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},IF={},lk=nn.createContext(IF),jr,uk=(jr=class extends x.Component{constructor(n){super(n);pn(this,"helmetData");this.helmetData=new lh(this.props.context||{},jr.canUseDOM)}render(){return nn.createElement(lk.Provider,{value:this.helmetData.value},this.props.children)}},pn(jr,"canUseDOM",ak),jr),li=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${Vt}]`),i=[].slice.call(r),o=[];let s;return t&&t.length&&t.forEach(a=>{const l=document.createElement(e);for(const u in a)if(Object.prototype.hasOwnProperty.call(a,u))if(u==="innerHTML")l.innerHTML=a.innerHTML;else if(u==="cssText")l.styleSheet?l.styleSheet.cssText=a.cssText:l.appendChild(document.createTextNode(a.cssText));else{const c=u,d=typeof a[c]>"u"?"":a[c];l.setAttribute(u,d)}l.setAttribute(Vt,"true"),i.some((u,c)=>(s=c,l.isEqualNode(u)))?i.splice(s,1):o.push(l)}),i.forEach(a=>{var l;return(l=a.parentNode)==null?void 0:l.removeChild(a)}),o.forEach(a=>n.appendChild(a)),{oldTags:i,newTags:o}},uh=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(Vt),i=r?r.split(","):[],o=[...i],s=Object.keys(t);for(const a of s){const l=t[a]||"";n.getAttribute(a)!==l&&n.setAttribute(a,l),i.indexOf(a)===-1&&i.push(a);const u=o.indexOf(a);u!==-1&&o.splice(u,1)}for(let a=o.length-1;a>=0;a-=1)n.removeAttribute(o[a]);i.length===o.length?n.removeAttribute(Vt):n.getAttribute(Vt)!==s.join(",")&&n.setAttribute(Vt,s.join(","))},DF=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=ik(e)),uh("title",t)},gv=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:i,linkTags:o,metaTags:s,noscriptTags:a,onChangeClientState:l,scriptTags:u,styleTags:c,title:d,titleAttributes:f}=e;uh("body",r),uh("html",i),DF(d,f);const p={baseTag:li("base",n),linkTags:li("link",o),metaTags:li("meta",s),noscriptTags:li("noscript",a),scriptTags:li("script",u),styleTags:li("style",c)},g={},v={};Object.keys(p).forEach(S=>{const{newTags:m,oldTags:h}=p[S];m.length&&(g[S]=m),h.length&&(v[S]=p[S].oldTags)}),t&&t(),l(e,g,v)},Mo=null,FF=e=>{Mo&&cancelAnimationFrame(Mo),e.defer?Mo=requestAnimationFrame(()=>{gv(e,()=>{Mo=null})}):(gv(e),Mo=null)},NF=FF,yv=class extends x.Component{constructor(){super(...arguments);pn(this,"rendered",!1)}shouldComponentUpdate(t){return!wF(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let r=null;const i=$F(t.get().map(o=>{const s={...o.props};return delete s.context,s}));uk.canUseDOM?NF(i):ah&&(r=ah(i)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},Td,BF=(Td=class extends x.Component{shouldComponentUpdate(e){return!vS(mv(this.props,"helmetData"),mv(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return{...t,[e.type]:r,titleAttributes:{...n}};case"body":return{...t,bodyAttributes:{...n}};case"html":return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(r=>{n={...n,[r]:e[r]}}),n}warnOnInvalidChildren(e,t){return hv(pv.some(n=>e.type===n),typeof e.type=="function"?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${pv.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),hv(!t||typeof t=="string"||Array.isArray(t)&&!t.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`} ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let n={};return nn.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:i,...o}=r.props,s=Object.keys(o).reduce((l,u)=>(l[kF[u]||u]=o[u],l),{});let{type:a}=r;switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(r,i),a){case"Symbol(react.fragment)":t=this.mapChildrenToProps(i,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,s,i);break;default:t=this.mapObjectTypeChildren(r,t,s,i);break}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const{children:e,...t}=this.props;let n={...t},{helmetData:r}=t;if(e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof lh)){const i=r;r=new lh(i.context,!0),delete n.helmetData}return r?nn.createElement(yv,{...n,context:r.value}):nn.createElement(lk.Consumer,null,i=>nn.createElement(yv,{...n,context:i}))}},pn(Td,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Td);const ch=[{index:!0,label:"OpenPV",path:"/"},{labelKey:"about.title",label:"about",path:"/about"}],VF=x.lazy(()=>Yr(()=>import("./slide-BGBegb0d.js").then(e=>e.s),[])),UF=()=>{const[e,t]=x.useState(!1),{t:n,i18n:r}=Yw();return $.jsxs("div",{className:"hamburger-container",children:[$.jsx("nav",{className:"main",id:"hambuger-nav",children:$.jsx("ul",{children:e?$.jsx("li",{className:"menu close-menu",children:$.jsx("div",{onClick:()=>t(!e),className:"menu-hover",children:"✕"})}):$.jsx("li",{className:"menu open-menu",children:$.jsx("div",{onClick:()=>t(!e),className:"menu-hover",children:"☰"})})})}),$.jsx(x.Suspense,{fallback:$.jsx($.Fragment,{}),children:$.jsx(VF,{right:!0,isOpen:e,children:$.jsx("ul",{className:"hamburger-ul",children:ch.map(i=>$.jsx("li",{children:$.jsx(Jf,{to:i.path,onClick:()=>t(!e),children:$.jsx("h3",{className:i.index&&"index-li",children:i.labelKey==null?i.label:n(i.labelKey)})})},i.label))})})})]})},WF=()=>{const{t:e,i18n:t}=Yw();return $.jsxs("header",{id:"header",children:[$.jsx("h1",{className:"index-link",children:ch.filter(n=>n.index).map(n=>$.jsx(Jf,{to:n.path,children:n.label},n.label))}),$.jsx("nav",{className:"links",children:$.jsx("ul",{children:ch.filter(n=>!n.index).map(n=>$.jsx("li",{children:$.jsx(Jf,{to:n.path,children:n.labelKey==null?n.label:e(n.labelKey)})},n.label))})}),$.jsx(UF,{})]})},um=e=>$.jsxs(uk,{children:[$.jsxs(BF,{titleTemplate:"%s | OpenPV",defaultTitle:"OpenPV",defer:!1,children:[e.title&&$.jsx("title",{children:e.title}),$.jsx("meta",{name:"description",content:e.description})]}),$.jsxs("div",{id:"wrapper",children:[$.jsx(WF,{}),$.jsx("div",{id:"main",children:e.children})]})]});um.propTypes={children:Cr.oneOfType([Cr.arrayOf(Cr.node),Cr.node]),fullPage:Cr.bool,title:Cr.string,description:Cr.string};um.defaultProps={children:null,fullPage:!1,title:null,description:"Ermittle das Potential für eine Solaranlage."};var HF={};const{PUBLIC_URL:KF}=HF,GF=x.lazy(()=>Yr(()=>import("./Map-CLF45QNY.js"),__vite__mapDeps([0,1,2,3,4]))),qF=x.lazy(()=>Yr(()=>import("./Simulation-CuB9nlPz.js").then(e=>e.S),__vite__mapDeps([5,6,1,2,7]))),XF=x.lazy(()=>Yr(()=>import("./NotFound-DuBAwB1-.js"),[])),YF=x.lazy(()=>Yr(()=>import("./Impressum-DNXAZQkm.js"),__vite__mapDeps([8,6]))),QF=x.lazy(()=>Yr(()=>import("./Datenschutz-BPm9eaoX.js"),__vite__mapDeps([9,6]))),vv=x.lazy(()=>Yr(()=>import("./About-CwFoPN31.js"),__vite__mapDeps([10,1,6,7,3])));window.isTouchDevice=ZF();const bv=()=>$.jsx(pD,{children:$.jsx(nn.StrictMode,{children:$.jsx(m4,{basename:KF,children:$.jsx(x.Suspense,{fallback:$.jsx(um,{}),children:$.jsxs(l4,{children:[$.jsx(Un,{path:"/",element:$.jsx(GF,{})}),$.jsx(Un,{path:"/simulation/:lon/:lat",element:$.jsx(qF,{})}),$.jsx(Un,{path:"/anleitung",element:$.jsx(vv,{})}),$.jsx(Un,{path:"/about",element:$.jsx(vv,{})}),$.jsx(Un,{path:"/impressum",element:$.jsx(YF,{})}),$.jsx(Un,{path:"/datenschutz",element:$.jsx(QF,{})}),$.jsx(Un,{path:"*",element:$.jsx(XF,{})})]})})})})}),Cd=document.getElementById("root");Cd.hasChildNodes()?Ow(Cd,$.jsx(bv,{})):Lw(Cd).render($.jsx(bv,{}));function ZF(){const e="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,t=window.matchMedia("(pointer: coarse)").matches;return console.log(e&&t?"The device is of type touch.":"The device is a laptop."),e&&t}export{Sn as $,m3 as A,Qr as B,wS as C,PS as D,TS as E,Pl as F,uN as G,rN as H,Js as I,uk as J,BF as K,Jf as L,um as M,aN as N,Ut as O,Qu as P,XC as Q,nn as R,nN as S,tN as T,SS as U,wM as V,Yv as W,Ye as X,iN as Y,bD as Z,Yr as _,Z3 as a,lN as b,Kt as c,x as d,im as e,uo as f,Yw as g,GD as h,eN as i,$ as j,cT as k,so as l,c3 as m,_d as n,Zv as o,Dm as p,dp as q,rn as r,vh as s,ts as t,N3 as u,Zr as v,F3 as w,_O as x,V3 as y,sT as z}; diff --git a/assets/lerc-DZUX8qKy.js b/assets/lerc-CwjFlo57.js similarity index 99% rename from assets/lerc-DZUX8qKy.js rename to assets/lerc-CwjFlo57.js index 414ed7a..4e0d742 100644 --- a/assets/lerc-DZUX8qKy.js +++ b/assets/lerc-CwjFlo57.js @@ -1 +1 @@ -import{L as oA,a as gA,i as sA}from"./Simulation-DhU9q6Cl.js";import{B as DA}from"./index-CNMbRSP0.js";import{B as nA}from"./basedecoder-DvumDe3Y.js";import"./heading-BaecBvU5.js";import"./Footer-TCVu7l1I.js";import"./location-B7jWusd1.js";import"./stack-u4belbkc.js";var iA={exports:{}};(function(j){/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var J=function(){var u={};u.defaultNoDataValue=-34027999387901484e22,u.decode=function(I,a){a=a||{};var Q=a.encodedMaskData||a.encodedMaskData===null,g=E(I,a.inputOffset||0,Q),D=a.noDataValue!==null?a.noDataValue:u.defaultNoDataValue,B=L(g,a.pixelType||Float32Array,a.encodedMaskData,D,a.returnMask),C={width:g.width,height:g.height,pixelData:B.resultPixels,minValue:B.minValue,maxValue:g.pixels.maxValue,noDataValue:D};return B.resultMask&&(C.maskData=B.resultMask),a.returnEncodedMask&&g.mask&&(C.encodedMaskData=g.mask.bitset?g.mask.bitset:null),a.returnFileInfo&&(C.fileInfo=d(g),a.computeUsedBitDepths&&(C.fileInfo.bitDepths=z(g))),C};var L=function(I,a,Q,g,D){var B=0,C=I.pixels.numBlocksX,o=I.pixels.numBlocksY,r=Math.floor(I.width/C),s=Math.floor(I.height/o),f=2*I.maxZError,e=Number.MAX_VALUE,i;Q=Q||(I.mask?I.mask.bitset:null);var t,F;t=new a(I.width*I.height),D&&Q&&(F=new Uint8Array(I.width*I.height));for(var S=new Float32Array(r*s),h,U,G=0;G<=o;G++){var R=G!==o?s:I.height%o;if(R!==0)for(var w=0;w<=C;w++){var n=w!==C?r:I.width%C;if(n!==0){var l=G*I.width*s+w*r,y=I.width-n,k=I.pixels.blocks[B],M,c,N;k.encoding<2?(k.encoding===0?M=k.rawData:(A(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,f,S,I.pixels.maxValue),M=S),c=0):k.encoding===2?N=0:N=k.offset;var q;if(Q)for(U=0;U>3],q<<=l&7),h=0;h>3]),q&128?(F&&(F[l]=1),i=k.encoding<2?M[c++]:N,e=e>i?i:e,t[l++]=i):(F&&(F[l]=0),t[l++]=g),q<<=1;l+=y}else if(k.encoding<2)for(U=0;Ui?i:e,t[l++]=i;l+=y}else for(e=e>N?N:e,U=0;U0){var C=new Uint8Array(Math.ceil(g.width*g.height/8));B=new DataView(I,a,g.mask.numBytes);var o=B.getInt16(0,!0),r=2,s=0;do{if(o>0)for(;o--;)C[s++]=B.getUint8(r++);else{var f=B.getUint8(r++);for(o=-o;o--;)C[s++]=f}o=B.getInt16(r,!0),r+=2}while(r0?1:0),F=i+(g.height%i>0?1:0);g.pixels.blocks=new Array(t*F);for(var S=0,h=0;h3)throw"Invalid block encoding ("+w.encoding+")";if(w.encoding===2){a++;continue}if(n!==0&&n!==2){if(n>>=6,w.offsetType=n,n===2)w.offset=B.getInt8(1),G++;else if(n===1)w.offset=B.getInt16(1,!0),G+=2;else if(n===0)w.offset=B.getFloat32(1,!0),G+=4;else throw"Invalid block offset type";if(w.encoding===1)if(n=B.getUint8(G),G++,w.bitsPerPixel=n&63,n>>=6,w.numValidPixelsType=n,n===2)w.numValidPixels=B.getUint8(G),G++;else if(n===1)w.numValidPixels=B.getUint16(G,!0),G+=2;else if(n===0)w.numValidPixels=B.getUint32(G,!0),G+=4;else throw"Invalid valid pixel count type"}if(a+=G,w.encoding!==3){var l,y;if(w.encoding===0){var k=(g.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";l=new ArrayBuffer(k*4),y=new Uint8Array(l),y.set(new Uint8Array(I,a,k*4));var M=new Float32Array(l);w.rawData=M,a+=k*4}else if(w.encoding===1){var c=Math.ceil(w.numValidPixels*w.bitsPerPixel/8),N=Math.ceil(c/4);l=new ArrayBuffer(N*4),y=new Uint8Array(l),y.set(new Uint8Array(I,a,c)),w.stuffedData=new Uint32Array(l),a+=c}}}return g.eofOffset=a,g},A=function(I,a,Q,g,D,B,C){var o=(1<=a)e=i>>>f-a&o,f-=a;else{var S=a-f;e=(i&o)<>>f}B[s]=e=I?(f=e>>>s-I&C,s-=I):(i=I-s,f=(e&C)<>>s),A[r]=Q[f];else for(t=Math.ceil((B-g)/D),r=0;r=I?(f=e>>>s-I&C,s-=I):(i=I-s,f=(e&C)<>>s),A[r]=f=A?(s=f>>>r-A&D,r-=A):(o=A-r,s=(f&D)<>>r),e[C]=s=I?(e=i>>>f&C,s-=I,f+=I):(t=I-s,e=i>>>f&C,i=E[o++],s=32-t,e|=(i&(1<=I?(e=i>>>f&C,s-=I,f+=I):(t=I-s,e=i>>>f&C,i=E[o++],s=32-t,e|=(i&(1<=A?(s=e>>>f&D,r-=A,f+=A):(o=A-r,s=e>>>f&D,e=E[B++],r=32-o,s|=(e&(1<=I?(C=o>>>B-I&Q,B-=I):(r=I-B,C=(o&Q)<>>B),A[D]=C;return A},originalUnstuff2:function(E,A,I,a){var Q=(1<=I?(o=r>>>C&Q,B-=I,C+=I):(s=I-B,o=r>>>C&Q,r=E[g++],B=32-s,o|=(r&(1<=359?359:Q;Q-=D;do A+=E[g++]<<8,I+=A+=E[g++];while(--D);A=(A&65535)+(A>>>16),I=(I&65535)+(I>>>16)}return a&1&&(I+=A+=E[g]<<8),A=(A&65535)+(A>>>16),I=(I&65535)+(I>>>16),(I<<16|A)>>>0},readHeaderInfo:function(E,A){var I=A.ptr,a=new Uint8Array(E,I,6),Q={};if(Q.fileIdentifierString=String.fromCharCode.apply(null,a),Q.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+Q.fileIdentifierString;I+=6;var g=new DataView(E,I,8),D=g.getInt32(0,!0);Q.fileVersion=D,I+=4,D>=3&&(Q.checksum=g.getUint32(4,!0),I+=4),g=new DataView(E,I,12),Q.height=g.getUint32(0,!0),Q.width=g.getUint32(4,!0),I+=8,D>=4?(Q.numDims=g.getUint32(8,!0),I+=4):Q.numDims=1,g=new DataView(E,I,40),Q.numValidPixel=g.getUint32(0,!0),Q.microBlockSize=g.getInt32(4,!0),Q.blobSize=g.getInt32(8,!0),Q.imageType=g.getInt32(12,!0),Q.maxZError=g.getFloat64(16,!0),Q.zMin=g.getFloat64(24,!0),Q.zMax=g.getFloat64(32,!0),I+=40,A.headerInfo=Q,A.ptr=I;var B,C;if(D>=3&&(C=D>=4?52:48,B=this.computeChecksumFletcher32(new Uint8Array(E,I-C,Q.blobSize-14)),B!==Q.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(E,A){var I=A.headerInfo,a=this.getDataTypeArray(I.imageType),Q=I.numDims*this.getDataTypeSize(I.imageType),g=this.readSubArray(E,A.ptr,a,Q),D=this.readSubArray(E,A.ptr+Q,a,Q);A.ptr+=2*Q;var B,C=!0;for(B=0;B0){C=new Uint8Array(Math.ceil(Q/8)),D=new DataView(E,I,B.numBytes);var r=D.getInt16(0,!0),s=2,f=0,e=0;do{if(r>0)for(;r--;)C[f++]=D.getUint8(s++);else for(e=D.getUint8(s++),r=-r;r--;)C[f++]=e;r=D.getInt16(s,!0),s+=2}while(s>3],i<<=t&7):i=C[t>>3],i&128&&(o[t]=1);A.pixels.resultMask=o,B.bitset=C,I+=B.numBytes}return A.ptr=I,A.mask=B,!0},readDataOneSweep:function(E,A,I,a){var Q=A.ptr,g=A.headerInfo,D=g.numDims,B=g.width*g.height,C=g.imageType,o=g.numValidPixel*L.getDataTypeSize(C)*D,r,s=A.pixels.resultMask;if(I===Uint8Array)r=new Uint8Array(E,Q,o);else{var f=new ArrayBuffer(o),e=new Uint8Array(f);e.set(new Uint8Array(E,Q,o)),r=new I(f)}if(r.length===B*D)a?A.pixels.resultPixels=L.swapDimensionOrder(r,B,D,I,!0):A.pixels.resultPixels=r;else{A.pixels.resultPixels=new I(B*D);var i=0,t=0,F=0,S=0;if(D>1){if(a){for(t=0;t=B)return!1;var C=new Uint32Array(B-D);L.decodeBits(E,A,C);var o=[],r,s,f,e;for(r=D;r0&&(o[s].second=G<>>32-e,32-U>=e?(U+=e,U===32&&(U=0,R++,G=h[R])):(U+=e-32,R++,G=h[R],o[s].second|=G>>>32-U));var w=0,n=0,l=new d;for(r=0;r=I?n=I:n=w;var y=[],k,M,c,N,q,m;for(r=D;r0)if(k=[e,s],e<=n)for(M=o[s].second<=0;N--)q=M>>>N&1,q?(m.right||(m.right=new d),m=m.right):(m.left||(m.left=new d),m=m.left),N===0&&!m.val&&(m.val=k[1]);return{decodeLut:y,numBitsLUTQick:n,numBitsLUT:w,tree:l,stuffedData:h,srcPtr:R,bitPos:U}},readHuffman:function(E,A,I,a){var Q=A.headerInfo,g=Q.numDims,D=A.headerInfo.height,B=A.headerInfo.width,C=B*D,o=this.readHuffmanTree(E,A),r=o.decodeLut,s=o.tree,f=o.stuffedData,e=o.srcPtr,i=o.bitPos,t=o.numBitsLUTQick,F=o.numBitsLUT,S=A.headerInfo.imageType===0?128:0,h,U,G,R=A.pixels.resultMask,w,n,l,y,k,M,c,N=0;i>0&&(e++,i=0);var q=f[e],m=A.encodeMode===1,O=new I(C*g),v=O,Y;if(g<2||m){for(Y=0;Y1&&(v=new I(O.buffer,C*Y,C),N=0),A.headerInfo.numValidPixel===B*D)for(M=0,y=0;y>>32-t,n=w,32-i>>64-i-t,n=w),r[n])U=r[n][1],i+=r[n][0];else for(w=q<>>32-F,n=w,32-i>>64-i-F,n=w),h=s,c=0;c>>F-c-1&1,h=l?h.right:h.left,!(h.left||h.right)){U=h.val,i=i+c+1;break}i>=32&&(i-=32,e++,q=f[e]),G=U-S,m?(k>0?G+=N:y>0?G+=v[M-B]:G+=N,G&=255,v[M]=G,N=G):v[M]=G}else for(M=0,y=0;y>>32-t,n=w,32-i>>64-i-t,n=w),r[n])U=r[n][1],i+=r[n][0];else for(w=q<>>32-F,n=w,32-i>>64-i-F,n=w),h=s,c=0;c>>F-c-1&1,h=l?h.right:h.left,!(h.left||h.right)){U=h.val,i=i+c+1;break}i>=32&&(i-=32,e++,q=f[e]),G=U-S,m?(k>0&&R[M-1]?G+=N:y>0&&R[M-B]?G+=v[M-B]:G+=N,G&=255,v[M]=G,N=G):v[M]=G}}else for(M=0,y=0;y>>32-t,n=w,32-i>>64-i-t,n=w),r[n])U=r[n][1],i+=r[n][0];else for(w=q<>>32-F,n=w,32-i>>64-i-F,n=w),h=s,c=0;c>>F-c-1&1,h=l?h.right:h.left,!(h.left||h.right)){U=h.val,i=i+c+1;break}i>=32&&(i-=32,e++,q=f[e]),G=U-S,v[M]=G}A.ptr=A.ptr+(e+1)*4+(i>0?4:0),A.pixels.resultPixels=O,g>1&&!a&&(A.pixels.resultPixels=L.swapDimensionOrder(O,C,g,I))},decodeBits:function(E,A,I,a,Q){{var g=A.headerInfo,D=g.fileVersion,B=0,C=E.byteLength-A.ptr>=5?5:E.byteLength-A.ptr,o=new DataView(E,A.ptr,C),r=o.getUint8(0);B++;var s=r>>6,f=s===0?4:3-s,e=(r&32)>0,i=r&31,t=0;if(f===1)t=o.getUint8(B),B++;else if(f===2)t=o.getUint16(B,!0),B+=2;else if(f===4)t=o.getUint32(B,!0),B+=4;else throw"Invalid valid pixel count type";var F=2*g.maxZError,S,h,U,G,R,w,n,l,y,k=g.numDims>1?g.maxValues[Q]:g.zMax;if(e){for(A.counter.lut++,l=o.getUint8(B),B++,G=Math.ceil((l-1)*i/8),R=Math.ceil(G/4),h=new ArrayBuffer(R*4),U=new Uint8Array(h),A.ptr+=B,U.set(new Uint8Array(E,A.ptr,G)),n=new Uint32Array(h),A.ptr+=G,y=0;l-1>>>y;)y++;G=Math.ceil(t*y/8),R=Math.ceil(G/4),h=new ArrayBuffer(R*4),U=new Uint8Array(h),U.set(new Uint8Array(E,A.ptr,G)),S=new Uint32Array(h),A.ptr+=G,D>=3?w=u.unstuffLUT2(n,i,l-1,a,F,k):w=u.unstuffLUT(n,i,l-1,a,F,k),D>=3?u.unstuff2(S,I,y,t,w):u.unstuff(S,I,y,t,w)}else A.counter.bitstuffer++,y=i,A.ptr+=B,y>0&&(G=Math.ceil(t*y/8),R=Math.ceil(G/4),h=new ArrayBuffer(R*4),U=new Uint8Array(h),U.set(new Uint8Array(E,A.ptr,G)),S=new Uint32Array(h),A.ptr+=G,D>=3?a==null?u.originalUnstuff2(S,I,y,t):u.unstuff2(S,I,y,t,!1,a,F,k):a==null?u.originalUnstuff(S,I,y,t):u.unstuff(S,I,y,t,!1,a,F,k))}},readTiles:function(E,A,I,a){var Q=A.headerInfo,g=Q.width,D=Q.height,B=g*D,C=Q.microBlockSize,o=Q.imageType,r=L.getDataTypeSize(o),s=Math.ceil(g/C),f=Math.ceil(D/C);A.pixels.numBlocksY=f,A.pixels.numBlocksX=s,A.pixels.ptr=0;var e=0,i=0,t=0,F=0,S=0,h=0,U=0,G=0,R=0,w=0,n=0,l=0,y=0,k=0,M=0,c=0,N,q,m,O,v,Y,P=new I(C*C),eA=D%C||C,aA=g%C||C,AA,b,$=Q.numDims,W,K=A.pixels.resultMask,H=A.pixels.resultPixels,rA=Q.fileVersion,CA=rA>=5?14:15,p,IA=Q.zMax,V;for(t=0;t1?(V=H,n=t*g*C+F*C,H=new I(A.pixels.resultPixels.buffer,B*W*r,B),IA=Q.maxValues[W]):V=null,U=E.byteLength-A.ptr,N=new DataView(E,A.ptr,Math.min(10,U)),q={},c=0,G=N.getUint8(0),c++,p=Q.fileVersion>=5?G&4:0,R=G>>6&255,w=G>>2&CA,w!==(F*C>>3&CA)||p&&W===0)throw"integrity issue";if(Y=G&3,Y>3)throw A.ptr+=c,"Invalid block encoding ("+Y+")";if(Y===2){if(p)if(K)for(e=0;e1&&!a&&(A.pixels.resultPixels=L.swapDimensionOrder(A.pixels.resultPixels,B,$,I))},formatFileInfo:function(E){return{fileIdentifierString:E.headerInfo.fileIdentifierString,fileVersion:E.headerInfo.fileVersion,imageType:E.headerInfo.imageType,height:E.headerInfo.height,width:E.headerInfo.width,numValidPixel:E.headerInfo.numValidPixel,microBlockSize:E.headerInfo.microBlockSize,blobSize:E.headerInfo.blobSize,maxZError:E.headerInfo.maxZError,pixelType:L.getPixelType(E.headerInfo.imageType),eofOffset:E.eofOffset,mask:E.mask?{numBytes:E.mask.numBytes}:null,pixels:{numBlocksX:E.pixels.numBlocksX,numBlocksY:E.pixels.numBlocksY,maxValue:E.headerInfo.zMax,minValue:E.headerInfo.zMin,noDataValue:E.noDataValue}}},constructConstantSurface:function(E,A){var I=E.headerInfo.zMax,a=E.headerInfo.zMin,Q=E.headerInfo.maxValues,g=E.headerInfo.numDims,D=E.headerInfo.height*E.headerInfo.width,B=0,C=0,o=0,r=E.pixels.resultMask,s=E.pixels.resultPixels;if(r)if(g>1){if(A)for(B=0;B1&&a!==I)if(A)for(B=0;B=-128&&A<=127;break;case 1:I=A>=0&&A<=255;break;case 2:I=A>=-32768&&A<=32767;break;case 3:I=A>=0&&A<=65536;break;case 4:I=A>=-2147483648&&A<=2147483647;break;case 5:I=A>=0&&A<=4294967296;break;case 6:I=A>=-34027999387901484e22&&A<=34027999387901484e22;break;case 7:I=A>=-17976931348623157e292&&A<=17976931348623157e292;break;default:I=!1}return I},getDataTypeSize:function(E){var A=0;switch(E){case 0:case 1:A=1;break;case 2:case 3:A=2;break;case 4:case 5:case 6:A=4;break;case 7:A=8;break;default:A=E}return A},getDataTypeUsed:function(E,A){var I=E;switch(E){case 2:case 4:I=E-A;break;case 3:case 5:I=E-2*A;break;case 6:A===0?I=E:A===1?I=2:I=1;break;case 7:A===0?I=E:I=E-2*A+1;break;default:I=E;break}return I},getOnePixel:function(E,A,I,a){var Q=0;switch(I){case 0:Q=a.getInt8(A);break;case 1:Q=a.getUint8(A);break;case 2:Q=a.getInt16(A,!0);break;case 3:Q=a.getUint16(A,!0);break;case 4:Q=a.getInt32(A,!0);break;case 5:Q=a.getUInt32(A,!0);break;case 6:Q=a.getFloat32(A,!0);break;case 7:Q=a.getFloat64(A,!0);break;default:throw"the decoder does not understand this pixel type"}return Q},swapDimensionOrder:function(E,A,I,a,Q){var g=0,D=0,B=0,C=0,o=E;if(I>1)if(o=new a(A*I),Q)for(g=0;g5)throw"unsupported lerc version 2."+D;L.readMask(E,Q),g.numValidPixel!==g.width*g.height&&!Q.pixels.resultMask&&(Q.pixels.resultMask=A.maskData);var C=g.width*g.height;Q.pixels.resultPixels=new B(C*g.numDims),Q.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var o=!A.returnPixelInterleavedDims;if(g.numValidPixel!==0)if(g.zMax===g.zMin)L.constructConstantSurface(Q,o);else if(D>=4&&L.checkMinMaxRanges(E,Q))L.constructConstantSurface(Q,o);else{var r=new DataView(E,Q.ptr,2),s=r.getUint8(0);if(Q.ptr++,s)L.readDataOneSweep(E,Q,B,o);else if(D>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var f=r.getUint8(1);if(Q.ptr++,Q.encodeMode=f,f>2||D<4&&f>1)throw"Invalid Huffman flag "+f;f?L.readHuffman(E,Q,B,o):L.readTiles(E,Q,B,o)}else L.readTiles(E,Q,B,o)}Q.eofOffset=Q.ptr;var e;A.inputOffset?(e=Q.headerInfo.blobSize+A.inputOffset-Q.ptr,Math.abs(e)>=1&&(Q.eofOffset=A.inputOffset+Q.headerInfo.blobSize)):(e=Q.headerInfo.blobSize-Q.ptr,Math.abs(e)>=1&&(Q.eofOffset=Q.headerInfo.blobSize));var i={width:g.width,height:g.height,pixelData:Q.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:Q.pixels.resultMask};if(Q.pixels.resultMask&&L.isValidPixelValue(g.imageType,I)){var t=Q.pixels.resultMask;for(a=0;a1&&(C&&D.push(C),s.fileInfo.mask&&s.fileInfo.mask.numBytes>0&&r++),a++,o.pixels.push(s.pixelData),o.statistics.push({minValue:s.minValue,maxValue:s.maxValue,noDataValue:s.noDataValue,dimStats:s.dimStats})}var f,e,i;if(I>1&&r>1){for(i=o.width*o.height,o.bandMasks=D,C=new Uint8Array(i),C.set(D[0]),f=1;fJ.arrayBuffer()).then(J=>WebAssembly.instantiate(J,BA)).then(this._init):_=WebAssembly.instantiate(Buffer.from(EA,"base64"),BA).then(this._init),_)}_init(J){x=J.instance,BA.env.emscripten_notify_memory_growth(0)}decode(J,T=0){if(!x)throw new Error("ZSTDDecoder: Await .init() before decoding.");const Z=J.byteLength,X=x.exports.malloc(Z);QA.set(J,X),T=T||Number(x.exports.ZSTD_findDecompressedSize(X,Z));const u=x.exports.malloc(T),L=x.exports.ZSTD_decompress(u,T,X,Z),d=QA.slice(u,u+L);return x.exports.free(X),x.exports.free(u),d}}const EA="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",hA=new wA;class SA extends nA{constructor(J){super(),this.planarConfiguration=typeof J.PlanarConfiguration<"u"?J.PlanarConfiguration:1,this.samplesPerPixel=typeof J.SamplesPerPixel<"u"?J.SamplesPerPixel:1,this.addCompression=J.LercParameters[oA.AddCompression]}decodeBlock(J){switch(this.addCompression){case gA.None:break;case gA.Deflate:J=sA(new Uint8Array(J)).buffer;break;case gA.Zstandard:J=hA.decode(new Uint8Array(J)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return tA.decode(J,{returnPixelInterleavedDims:this.planarConfiguration===1}).pixels[0].buffer}}export{SA as default,hA as zstd}; +import{L as oA,a as gA,i as sA}from"./Simulation-CuB9nlPz.js";import{B as DA}from"./index-Blxo1hic.js";import{B as nA}from"./basedecoder-DvumDe3Y.js";import"./heading-CX4arv15.js";import"./Footer-DvQMRGAB.js";import"./location-D9lkPsfw.js";import"./stack-B32WIkoR.js";var iA={exports:{}};(function(j){/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var J=function(){var u={};u.defaultNoDataValue=-34027999387901484e22,u.decode=function(I,a){a=a||{};var Q=a.encodedMaskData||a.encodedMaskData===null,g=E(I,a.inputOffset||0,Q),D=a.noDataValue!==null?a.noDataValue:u.defaultNoDataValue,B=L(g,a.pixelType||Float32Array,a.encodedMaskData,D,a.returnMask),C={width:g.width,height:g.height,pixelData:B.resultPixels,minValue:B.minValue,maxValue:g.pixels.maxValue,noDataValue:D};return B.resultMask&&(C.maskData=B.resultMask),a.returnEncodedMask&&g.mask&&(C.encodedMaskData=g.mask.bitset?g.mask.bitset:null),a.returnFileInfo&&(C.fileInfo=d(g),a.computeUsedBitDepths&&(C.fileInfo.bitDepths=z(g))),C};var L=function(I,a,Q,g,D){var B=0,C=I.pixels.numBlocksX,o=I.pixels.numBlocksY,r=Math.floor(I.width/C),s=Math.floor(I.height/o),f=2*I.maxZError,e=Number.MAX_VALUE,i;Q=Q||(I.mask?I.mask.bitset:null);var t,F;t=new a(I.width*I.height),D&&Q&&(F=new Uint8Array(I.width*I.height));for(var S=new Float32Array(r*s),h,U,G=0;G<=o;G++){var R=G!==o?s:I.height%o;if(R!==0)for(var w=0;w<=C;w++){var n=w!==C?r:I.width%C;if(n!==0){var l=G*I.width*s+w*r,y=I.width-n,k=I.pixels.blocks[B],M,c,N;k.encoding<2?(k.encoding===0?M=k.rawData:(A(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,f,S,I.pixels.maxValue),M=S),c=0):k.encoding===2?N=0:N=k.offset;var q;if(Q)for(U=0;U>3],q<<=l&7),h=0;h>3]),q&128?(F&&(F[l]=1),i=k.encoding<2?M[c++]:N,e=e>i?i:e,t[l++]=i):(F&&(F[l]=0),t[l++]=g),q<<=1;l+=y}else if(k.encoding<2)for(U=0;Ui?i:e,t[l++]=i;l+=y}else for(e=e>N?N:e,U=0;U0){var C=new Uint8Array(Math.ceil(g.width*g.height/8));B=new DataView(I,a,g.mask.numBytes);var o=B.getInt16(0,!0),r=2,s=0;do{if(o>0)for(;o--;)C[s++]=B.getUint8(r++);else{var f=B.getUint8(r++);for(o=-o;o--;)C[s++]=f}o=B.getInt16(r,!0),r+=2}while(r0?1:0),F=i+(g.height%i>0?1:0);g.pixels.blocks=new Array(t*F);for(var S=0,h=0;h3)throw"Invalid block encoding ("+w.encoding+")";if(w.encoding===2){a++;continue}if(n!==0&&n!==2){if(n>>=6,w.offsetType=n,n===2)w.offset=B.getInt8(1),G++;else if(n===1)w.offset=B.getInt16(1,!0),G+=2;else if(n===0)w.offset=B.getFloat32(1,!0),G+=4;else throw"Invalid block offset type";if(w.encoding===1)if(n=B.getUint8(G),G++,w.bitsPerPixel=n&63,n>>=6,w.numValidPixelsType=n,n===2)w.numValidPixels=B.getUint8(G),G++;else if(n===1)w.numValidPixels=B.getUint16(G,!0),G+=2;else if(n===0)w.numValidPixels=B.getUint32(G,!0),G+=4;else throw"Invalid valid pixel count type"}if(a+=G,w.encoding!==3){var l,y;if(w.encoding===0){var k=(g.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";l=new ArrayBuffer(k*4),y=new Uint8Array(l),y.set(new Uint8Array(I,a,k*4));var M=new Float32Array(l);w.rawData=M,a+=k*4}else if(w.encoding===1){var c=Math.ceil(w.numValidPixels*w.bitsPerPixel/8),N=Math.ceil(c/4);l=new ArrayBuffer(N*4),y=new Uint8Array(l),y.set(new Uint8Array(I,a,c)),w.stuffedData=new Uint32Array(l),a+=c}}}return g.eofOffset=a,g},A=function(I,a,Q,g,D,B,C){var o=(1<=a)e=i>>>f-a&o,f-=a;else{var S=a-f;e=(i&o)<>>f}B[s]=e=I?(f=e>>>s-I&C,s-=I):(i=I-s,f=(e&C)<>>s),A[r]=Q[f];else for(t=Math.ceil((B-g)/D),r=0;r=I?(f=e>>>s-I&C,s-=I):(i=I-s,f=(e&C)<>>s),A[r]=f=A?(s=f>>>r-A&D,r-=A):(o=A-r,s=(f&D)<>>r),e[C]=s=I?(e=i>>>f&C,s-=I,f+=I):(t=I-s,e=i>>>f&C,i=E[o++],s=32-t,e|=(i&(1<=I?(e=i>>>f&C,s-=I,f+=I):(t=I-s,e=i>>>f&C,i=E[o++],s=32-t,e|=(i&(1<=A?(s=e>>>f&D,r-=A,f+=A):(o=A-r,s=e>>>f&D,e=E[B++],r=32-o,s|=(e&(1<=I?(C=o>>>B-I&Q,B-=I):(r=I-B,C=(o&Q)<>>B),A[D]=C;return A},originalUnstuff2:function(E,A,I,a){var Q=(1<=I?(o=r>>>C&Q,B-=I,C+=I):(s=I-B,o=r>>>C&Q,r=E[g++],B=32-s,o|=(r&(1<=359?359:Q;Q-=D;do A+=E[g++]<<8,I+=A+=E[g++];while(--D);A=(A&65535)+(A>>>16),I=(I&65535)+(I>>>16)}return a&1&&(I+=A+=E[g]<<8),A=(A&65535)+(A>>>16),I=(I&65535)+(I>>>16),(I<<16|A)>>>0},readHeaderInfo:function(E,A){var I=A.ptr,a=new Uint8Array(E,I,6),Q={};if(Q.fileIdentifierString=String.fromCharCode.apply(null,a),Q.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+Q.fileIdentifierString;I+=6;var g=new DataView(E,I,8),D=g.getInt32(0,!0);Q.fileVersion=D,I+=4,D>=3&&(Q.checksum=g.getUint32(4,!0),I+=4),g=new DataView(E,I,12),Q.height=g.getUint32(0,!0),Q.width=g.getUint32(4,!0),I+=8,D>=4?(Q.numDims=g.getUint32(8,!0),I+=4):Q.numDims=1,g=new DataView(E,I,40),Q.numValidPixel=g.getUint32(0,!0),Q.microBlockSize=g.getInt32(4,!0),Q.blobSize=g.getInt32(8,!0),Q.imageType=g.getInt32(12,!0),Q.maxZError=g.getFloat64(16,!0),Q.zMin=g.getFloat64(24,!0),Q.zMax=g.getFloat64(32,!0),I+=40,A.headerInfo=Q,A.ptr=I;var B,C;if(D>=3&&(C=D>=4?52:48,B=this.computeChecksumFletcher32(new Uint8Array(E,I-C,Q.blobSize-14)),B!==Q.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(E,A){var I=A.headerInfo,a=this.getDataTypeArray(I.imageType),Q=I.numDims*this.getDataTypeSize(I.imageType),g=this.readSubArray(E,A.ptr,a,Q),D=this.readSubArray(E,A.ptr+Q,a,Q);A.ptr+=2*Q;var B,C=!0;for(B=0;B0){C=new Uint8Array(Math.ceil(Q/8)),D=new DataView(E,I,B.numBytes);var r=D.getInt16(0,!0),s=2,f=0,e=0;do{if(r>0)for(;r--;)C[f++]=D.getUint8(s++);else for(e=D.getUint8(s++),r=-r;r--;)C[f++]=e;r=D.getInt16(s,!0),s+=2}while(s>3],i<<=t&7):i=C[t>>3],i&128&&(o[t]=1);A.pixels.resultMask=o,B.bitset=C,I+=B.numBytes}return A.ptr=I,A.mask=B,!0},readDataOneSweep:function(E,A,I,a){var Q=A.ptr,g=A.headerInfo,D=g.numDims,B=g.width*g.height,C=g.imageType,o=g.numValidPixel*L.getDataTypeSize(C)*D,r,s=A.pixels.resultMask;if(I===Uint8Array)r=new Uint8Array(E,Q,o);else{var f=new ArrayBuffer(o),e=new Uint8Array(f);e.set(new Uint8Array(E,Q,o)),r=new I(f)}if(r.length===B*D)a?A.pixels.resultPixels=L.swapDimensionOrder(r,B,D,I,!0):A.pixels.resultPixels=r;else{A.pixels.resultPixels=new I(B*D);var i=0,t=0,F=0,S=0;if(D>1){if(a){for(t=0;t=B)return!1;var C=new Uint32Array(B-D);L.decodeBits(E,A,C);var o=[],r,s,f,e;for(r=D;r0&&(o[s].second=G<>>32-e,32-U>=e?(U+=e,U===32&&(U=0,R++,G=h[R])):(U+=e-32,R++,G=h[R],o[s].second|=G>>>32-U));var w=0,n=0,l=new d;for(r=0;r=I?n=I:n=w;var y=[],k,M,c,N,q,m;for(r=D;r0)if(k=[e,s],e<=n)for(M=o[s].second<=0;N--)q=M>>>N&1,q?(m.right||(m.right=new d),m=m.right):(m.left||(m.left=new d),m=m.left),N===0&&!m.val&&(m.val=k[1]);return{decodeLut:y,numBitsLUTQick:n,numBitsLUT:w,tree:l,stuffedData:h,srcPtr:R,bitPos:U}},readHuffman:function(E,A,I,a){var Q=A.headerInfo,g=Q.numDims,D=A.headerInfo.height,B=A.headerInfo.width,C=B*D,o=this.readHuffmanTree(E,A),r=o.decodeLut,s=o.tree,f=o.stuffedData,e=o.srcPtr,i=o.bitPos,t=o.numBitsLUTQick,F=o.numBitsLUT,S=A.headerInfo.imageType===0?128:0,h,U,G,R=A.pixels.resultMask,w,n,l,y,k,M,c,N=0;i>0&&(e++,i=0);var q=f[e],m=A.encodeMode===1,O=new I(C*g),v=O,Y;if(g<2||m){for(Y=0;Y1&&(v=new I(O.buffer,C*Y,C),N=0),A.headerInfo.numValidPixel===B*D)for(M=0,y=0;y>>32-t,n=w,32-i>>64-i-t,n=w),r[n])U=r[n][1],i+=r[n][0];else for(w=q<>>32-F,n=w,32-i>>64-i-F,n=w),h=s,c=0;c>>F-c-1&1,h=l?h.right:h.left,!(h.left||h.right)){U=h.val,i=i+c+1;break}i>=32&&(i-=32,e++,q=f[e]),G=U-S,m?(k>0?G+=N:y>0?G+=v[M-B]:G+=N,G&=255,v[M]=G,N=G):v[M]=G}else for(M=0,y=0;y>>32-t,n=w,32-i>>64-i-t,n=w),r[n])U=r[n][1],i+=r[n][0];else for(w=q<>>32-F,n=w,32-i>>64-i-F,n=w),h=s,c=0;c>>F-c-1&1,h=l?h.right:h.left,!(h.left||h.right)){U=h.val,i=i+c+1;break}i>=32&&(i-=32,e++,q=f[e]),G=U-S,m?(k>0&&R[M-1]?G+=N:y>0&&R[M-B]?G+=v[M-B]:G+=N,G&=255,v[M]=G,N=G):v[M]=G}}else for(M=0,y=0;y>>32-t,n=w,32-i>>64-i-t,n=w),r[n])U=r[n][1],i+=r[n][0];else for(w=q<>>32-F,n=w,32-i>>64-i-F,n=w),h=s,c=0;c>>F-c-1&1,h=l?h.right:h.left,!(h.left||h.right)){U=h.val,i=i+c+1;break}i>=32&&(i-=32,e++,q=f[e]),G=U-S,v[M]=G}A.ptr=A.ptr+(e+1)*4+(i>0?4:0),A.pixels.resultPixels=O,g>1&&!a&&(A.pixels.resultPixels=L.swapDimensionOrder(O,C,g,I))},decodeBits:function(E,A,I,a,Q){{var g=A.headerInfo,D=g.fileVersion,B=0,C=E.byteLength-A.ptr>=5?5:E.byteLength-A.ptr,o=new DataView(E,A.ptr,C),r=o.getUint8(0);B++;var s=r>>6,f=s===0?4:3-s,e=(r&32)>0,i=r&31,t=0;if(f===1)t=o.getUint8(B),B++;else if(f===2)t=o.getUint16(B,!0),B+=2;else if(f===4)t=o.getUint32(B,!0),B+=4;else throw"Invalid valid pixel count type";var F=2*g.maxZError,S,h,U,G,R,w,n,l,y,k=g.numDims>1?g.maxValues[Q]:g.zMax;if(e){for(A.counter.lut++,l=o.getUint8(B),B++,G=Math.ceil((l-1)*i/8),R=Math.ceil(G/4),h=new ArrayBuffer(R*4),U=new Uint8Array(h),A.ptr+=B,U.set(new Uint8Array(E,A.ptr,G)),n=new Uint32Array(h),A.ptr+=G,y=0;l-1>>>y;)y++;G=Math.ceil(t*y/8),R=Math.ceil(G/4),h=new ArrayBuffer(R*4),U=new Uint8Array(h),U.set(new Uint8Array(E,A.ptr,G)),S=new Uint32Array(h),A.ptr+=G,D>=3?w=u.unstuffLUT2(n,i,l-1,a,F,k):w=u.unstuffLUT(n,i,l-1,a,F,k),D>=3?u.unstuff2(S,I,y,t,w):u.unstuff(S,I,y,t,w)}else A.counter.bitstuffer++,y=i,A.ptr+=B,y>0&&(G=Math.ceil(t*y/8),R=Math.ceil(G/4),h=new ArrayBuffer(R*4),U=new Uint8Array(h),U.set(new Uint8Array(E,A.ptr,G)),S=new Uint32Array(h),A.ptr+=G,D>=3?a==null?u.originalUnstuff2(S,I,y,t):u.unstuff2(S,I,y,t,!1,a,F,k):a==null?u.originalUnstuff(S,I,y,t):u.unstuff(S,I,y,t,!1,a,F,k))}},readTiles:function(E,A,I,a){var Q=A.headerInfo,g=Q.width,D=Q.height,B=g*D,C=Q.microBlockSize,o=Q.imageType,r=L.getDataTypeSize(o),s=Math.ceil(g/C),f=Math.ceil(D/C);A.pixels.numBlocksY=f,A.pixels.numBlocksX=s,A.pixels.ptr=0;var e=0,i=0,t=0,F=0,S=0,h=0,U=0,G=0,R=0,w=0,n=0,l=0,y=0,k=0,M=0,c=0,N,q,m,O,v,Y,P=new I(C*C),eA=D%C||C,aA=g%C||C,AA,b,$=Q.numDims,W,K=A.pixels.resultMask,H=A.pixels.resultPixels,rA=Q.fileVersion,CA=rA>=5?14:15,p,IA=Q.zMax,V;for(t=0;t1?(V=H,n=t*g*C+F*C,H=new I(A.pixels.resultPixels.buffer,B*W*r,B),IA=Q.maxValues[W]):V=null,U=E.byteLength-A.ptr,N=new DataView(E,A.ptr,Math.min(10,U)),q={},c=0,G=N.getUint8(0),c++,p=Q.fileVersion>=5?G&4:0,R=G>>6&255,w=G>>2&CA,w!==(F*C>>3&CA)||p&&W===0)throw"integrity issue";if(Y=G&3,Y>3)throw A.ptr+=c,"Invalid block encoding ("+Y+")";if(Y===2){if(p)if(K)for(e=0;e1&&!a&&(A.pixels.resultPixels=L.swapDimensionOrder(A.pixels.resultPixels,B,$,I))},formatFileInfo:function(E){return{fileIdentifierString:E.headerInfo.fileIdentifierString,fileVersion:E.headerInfo.fileVersion,imageType:E.headerInfo.imageType,height:E.headerInfo.height,width:E.headerInfo.width,numValidPixel:E.headerInfo.numValidPixel,microBlockSize:E.headerInfo.microBlockSize,blobSize:E.headerInfo.blobSize,maxZError:E.headerInfo.maxZError,pixelType:L.getPixelType(E.headerInfo.imageType),eofOffset:E.eofOffset,mask:E.mask?{numBytes:E.mask.numBytes}:null,pixels:{numBlocksX:E.pixels.numBlocksX,numBlocksY:E.pixels.numBlocksY,maxValue:E.headerInfo.zMax,minValue:E.headerInfo.zMin,noDataValue:E.noDataValue}}},constructConstantSurface:function(E,A){var I=E.headerInfo.zMax,a=E.headerInfo.zMin,Q=E.headerInfo.maxValues,g=E.headerInfo.numDims,D=E.headerInfo.height*E.headerInfo.width,B=0,C=0,o=0,r=E.pixels.resultMask,s=E.pixels.resultPixels;if(r)if(g>1){if(A)for(B=0;B1&&a!==I)if(A)for(B=0;B=-128&&A<=127;break;case 1:I=A>=0&&A<=255;break;case 2:I=A>=-32768&&A<=32767;break;case 3:I=A>=0&&A<=65536;break;case 4:I=A>=-2147483648&&A<=2147483647;break;case 5:I=A>=0&&A<=4294967296;break;case 6:I=A>=-34027999387901484e22&&A<=34027999387901484e22;break;case 7:I=A>=-17976931348623157e292&&A<=17976931348623157e292;break;default:I=!1}return I},getDataTypeSize:function(E){var A=0;switch(E){case 0:case 1:A=1;break;case 2:case 3:A=2;break;case 4:case 5:case 6:A=4;break;case 7:A=8;break;default:A=E}return A},getDataTypeUsed:function(E,A){var I=E;switch(E){case 2:case 4:I=E-A;break;case 3:case 5:I=E-2*A;break;case 6:A===0?I=E:A===1?I=2:I=1;break;case 7:A===0?I=E:I=E-2*A+1;break;default:I=E;break}return I},getOnePixel:function(E,A,I,a){var Q=0;switch(I){case 0:Q=a.getInt8(A);break;case 1:Q=a.getUint8(A);break;case 2:Q=a.getInt16(A,!0);break;case 3:Q=a.getUint16(A,!0);break;case 4:Q=a.getInt32(A,!0);break;case 5:Q=a.getUInt32(A,!0);break;case 6:Q=a.getFloat32(A,!0);break;case 7:Q=a.getFloat64(A,!0);break;default:throw"the decoder does not understand this pixel type"}return Q},swapDimensionOrder:function(E,A,I,a,Q){var g=0,D=0,B=0,C=0,o=E;if(I>1)if(o=new a(A*I),Q)for(g=0;g5)throw"unsupported lerc version 2."+D;L.readMask(E,Q),g.numValidPixel!==g.width*g.height&&!Q.pixels.resultMask&&(Q.pixels.resultMask=A.maskData);var C=g.width*g.height;Q.pixels.resultPixels=new B(C*g.numDims),Q.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var o=!A.returnPixelInterleavedDims;if(g.numValidPixel!==0)if(g.zMax===g.zMin)L.constructConstantSurface(Q,o);else if(D>=4&&L.checkMinMaxRanges(E,Q))L.constructConstantSurface(Q,o);else{var r=new DataView(E,Q.ptr,2),s=r.getUint8(0);if(Q.ptr++,s)L.readDataOneSweep(E,Q,B,o);else if(D>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var f=r.getUint8(1);if(Q.ptr++,Q.encodeMode=f,f>2||D<4&&f>1)throw"Invalid Huffman flag "+f;f?L.readHuffman(E,Q,B,o):L.readTiles(E,Q,B,o)}else L.readTiles(E,Q,B,o)}Q.eofOffset=Q.ptr;var e;A.inputOffset?(e=Q.headerInfo.blobSize+A.inputOffset-Q.ptr,Math.abs(e)>=1&&(Q.eofOffset=A.inputOffset+Q.headerInfo.blobSize)):(e=Q.headerInfo.blobSize-Q.ptr,Math.abs(e)>=1&&(Q.eofOffset=Q.headerInfo.blobSize));var i={width:g.width,height:g.height,pixelData:Q.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:Q.pixels.resultMask};if(Q.pixels.resultMask&&L.isValidPixelValue(g.imageType,I)){var t=Q.pixels.resultMask;for(a=0;a1&&(C&&D.push(C),s.fileInfo.mask&&s.fileInfo.mask.numBytes>0&&r++),a++,o.pixels.push(s.pixelData),o.statistics.push({minValue:s.minValue,maxValue:s.maxValue,noDataValue:s.noDataValue,dimStats:s.dimStats})}var f,e,i;if(I>1&&r>1){for(i=o.width*o.height,o.bandMasks=D,C=new Uint8Array(i),C.set(D[0]),f=1;fJ.arrayBuffer()).then(J=>WebAssembly.instantiate(J,BA)).then(this._init):_=WebAssembly.instantiate(Buffer.from(EA,"base64"),BA).then(this._init),_)}_init(J){x=J.instance,BA.env.emscripten_notify_memory_growth(0)}decode(J,T=0){if(!x)throw new Error("ZSTDDecoder: Await .init() before decoding.");const Z=J.byteLength,X=x.exports.malloc(Z);QA.set(J,X),T=T||Number(x.exports.ZSTD_findDecompressedSize(X,Z));const u=x.exports.malloc(T),L=x.exports.ZSTD_decompress(u,T,X,Z),d=QA.slice(u,u+L);return x.exports.free(X),x.exports.free(u),d}}const EA="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",hA=new wA;class SA extends nA{constructor(J){super(),this.planarConfiguration=typeof J.PlanarConfiguration<"u"?J.PlanarConfiguration:1,this.samplesPerPixel=typeof J.SamplesPerPixel<"u"?J.SamplesPerPixel:1,this.addCompression=J.LercParameters[oA.AddCompression]}decodeBlock(J){switch(this.addCompression){case gA.None:break;case gA.Deflate:J=sA(new Uint8Array(J)).buffer;break;case gA.Zstandard:J=hA.decode(new Uint8Array(J)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return tA.decode(J,{returnPixelInterleavedDims:this.planarConfiguration===1}).pixels[0].buffer}}export{SA as default,hA as zstd}; diff --git a/assets/location-B7jWusd1.js b/assets/location-D9lkPsfw.js similarity index 97% rename from assets/location-B7jWusd1.js rename to assets/location-D9lkPsfw.js index 9c6e5cd..f601b45 100644 --- a/assets/location-B7jWusd1.js +++ b/assets/location-D9lkPsfw.js @@ -1 +1 @@ -import{v as q,f as b,y as N,s as j,l as C,j as y,c as I,d as u,H as B}from"./index-CNMbRSP0.js";import{m as g,i as m,p as k,j as M,n as E}from"./Footer-TCVu7l1I.js";const[A,W]=q({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[G,w]=q({strict:!1,name:"FormControlContext"});function X(s){const{id:e,isRequired:a,isInvalid:t,isDisabled:o,isReadOnly:r,...l}=s,c=u.useId(),n=e||`field-${c}`,h=`${n}-label`,f=`${n}-feedback`,x=`${n}-helptext`,[v,p]=u.useState(!1),[S,P]=u.useState(!1),[F,R]=u.useState(!1),D=u.useCallback((i={},d=null)=>({id:x,...i,ref:g(d,_=>{_&&P(!0)})}),[x]),O=u.useCallback((i={},d=null)=>({...i,ref:d,"data-focus":m(F),"data-disabled":m(o),"data-invalid":m(t),"data-readonly":m(r),id:i.id!==void 0?i.id:h,htmlFor:i.htmlFor!==void 0?i.htmlFor:n}),[n,o,F,t,r,h]),$=u.useCallback((i={},d=null)=>({id:f,...i,ref:g(d,_=>{_&&p(!0)}),"aria-live":"polite"}),[f]),L=u.useCallback((i={},d=null)=>({...i,...l,ref:d,role:"group","data-focus":m(F),"data-disabled":m(o),"data-invalid":m(t),"data-readonly":m(r)}),[l,o,F,t,r]),z=u.useCallback((i={},d=null)=>({...i,ref:d,role:"presentation","aria-hidden":!0,children:i.children||"*"}),[]);return{isRequired:!!a,isInvalid:!!t,isReadOnly:!!r,isDisabled:!!o,isFocused:!!F,onFocus:()=>R(!0),onBlur:()=>R(!1),hasFeedbackText:v,setHasFeedbackText:p,hasHelpText:S,setHasHelpText:P,id:n,labelId:h,feedbackId:f,helpTextId:x,htmlProps:l,getHelpTextProps:D,getErrorMessageProps:$,getRootProps:L,getLabelProps:O,getRequiredIndicatorProps:z}}const Y=b(function(e,a){const t=N("Form",e),o=j(e),{getRootProps:r,htmlProps:l,...c}=X(o),n=C("chakra-form-control",e.className);return y.jsx(G,{value:c,children:y.jsx(A,{value:t,children:y.jsx(I.div,{...r({},a),className:n,__css:t.container})})})});Y.displayName="FormControl";const J=b(function(e,a){const t=w(),o=W(),r=C("chakra-form__helper-text",e.className);return y.jsx(I.div,{...t==null?void 0:t.getHelpTextProps(e,a),__css:o.helperText,className:r})});J.displayName="FormHelperText";function K(s){const{isDisabled:e,isInvalid:a,isReadOnly:t,isRequired:o,...r}=Q(s);return{...r,disabled:e,readOnly:t,required:o,"aria-invalid":k(a),"aria-required":k(o),"aria-readonly":k(t)}}function Q(s){const e=w(),{id:a,disabled:t,readOnly:o,required:r,isRequired:l,isInvalid:c,isReadOnly:n,isDisabled:h,onFocus:f,onBlur:x,...v}=s,p=s["aria-describedby"]?[s["aria-describedby"]]:[];return e!=null&&e.hasFeedbackText&&(e!=null&&e.isInvalid)&&p.push(e.feedbackId),e!=null&&e.hasHelpText&&p.push(e.helpTextId),{...v,"aria-describedby":p.join(" ")||void 0,id:a??(e==null?void 0:e.id),isDisabled:t??h??(e==null?void 0:e.isDisabled),isReadOnly:o??n??(e==null?void 0:e.isReadOnly),isRequired:r??l??(e==null?void 0:e.isRequired),isInvalid:c??(e==null?void 0:e.isInvalid),onFocus:M(e==null?void 0:e.onFocus,f),onBlur:M(e==null?void 0:e.onBlur,x)}}const H=b(function(e,a){const{htmlSize:t,...o}=e,r=N("Input",o),l=j(o),c=K(l),n=C("chakra-input",e.className);return y.jsx(I.input,{size:t,...c,__css:r.field,ref:a,className:n})});H.displayName="Input";H.id="Input";const U=b((s,e)=>{const{className:a,...t}=s,o=C("chakra-modal__footer",a),r=E(),l=B({display:"flex",alignItems:"center",justifyContent:"flex-end",...r.footer});return y.jsx(I.footer,{ref:e,...t,__css:l,className:o})});U.displayName="ModalFooter";var V,Z,ee;async function ne(s){let e=te(s);return e.length==0&&(e=se(s)),e}function te(s){if(/^[-]?(\d+(\.\d+)?),\s*[-]?(\d+(\.\d+)?)$/.test(s)){const[e,a]=s.split(",").map(t=>parseFloat(t.trim()));return[{lat:e,lon:a,display_name:`${e},${a}`,key:"coordinates"}]}else return[]}async function se(s){let e="https://nominatim.openstreetmap.org/search?format=json&addressdetails=1&q=".concat(s).concat("+Germany"),a=await T(e);return a||(e="https://nominatim.openstreetmap.org/search?format=json&addressdetails=1&q=".concat(s.split(" ").join("+")),a=await T(e)),a.map(t=>({lat:t.lat,lon:t.lon,key:t.place_id,display_name:oe(t.address)}))}function oe(s){return(s.road||"")+" "+(s.house_number||"")+", "+(s.postcode||"")+" "+(s.city||"")}async function T(s){try{const e=await fetch(s);if(!e.ok)throw new Error(`Request failed with status ${e.status}`);return await e.json()}catch(e){return console.error("Error:",e),[]}}function ie(s,e){Z=[s,e];const a=e*Math.PI/180,t=Math.pow(2,15),o=t*((s+180)/360),r=t*(1-Math.log(Math.tan(a)+1/Math.cos(a))/Math.PI)/2;return V=[o,r],ee=[1222.992452*o-2003750834e-2,2003750834e-2-1222.992452*r],[o,r]}function le(s,e,a){const t=4007501668e-2,o=t/Math.pow(2,a),r=o*s-t/2,l=r+o,c=t/2-o*e,n=c-o;return[r,c,l,n]}export{Y as F,H as I,U as M,w as a,W as b,Z as c,ee as d,V as e,ie as p,ne as r,Q as u,le as x}; +import{v as q,f as b,y as N,s as j,l as C,j as y,c as I,d as u,H as B}from"./index-Blxo1hic.js";import{m as g,i as m,p as k,j as M,n as E}from"./Footer-DvQMRGAB.js";const[A,W]=q({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[G,w]=q({strict:!1,name:"FormControlContext"});function X(s){const{id:e,isRequired:a,isInvalid:t,isDisabled:o,isReadOnly:r,...l}=s,c=u.useId(),n=e||`field-${c}`,h=`${n}-label`,f=`${n}-feedback`,x=`${n}-helptext`,[v,p]=u.useState(!1),[S,P]=u.useState(!1),[F,R]=u.useState(!1),D=u.useCallback((i={},d=null)=>({id:x,...i,ref:g(d,_=>{_&&P(!0)})}),[x]),O=u.useCallback((i={},d=null)=>({...i,ref:d,"data-focus":m(F),"data-disabled":m(o),"data-invalid":m(t),"data-readonly":m(r),id:i.id!==void 0?i.id:h,htmlFor:i.htmlFor!==void 0?i.htmlFor:n}),[n,o,F,t,r,h]),$=u.useCallback((i={},d=null)=>({id:f,...i,ref:g(d,_=>{_&&p(!0)}),"aria-live":"polite"}),[f]),L=u.useCallback((i={},d=null)=>({...i,...l,ref:d,role:"group","data-focus":m(F),"data-disabled":m(o),"data-invalid":m(t),"data-readonly":m(r)}),[l,o,F,t,r]),z=u.useCallback((i={},d=null)=>({...i,ref:d,role:"presentation","aria-hidden":!0,children:i.children||"*"}),[]);return{isRequired:!!a,isInvalid:!!t,isReadOnly:!!r,isDisabled:!!o,isFocused:!!F,onFocus:()=>R(!0),onBlur:()=>R(!1),hasFeedbackText:v,setHasFeedbackText:p,hasHelpText:S,setHasHelpText:P,id:n,labelId:h,feedbackId:f,helpTextId:x,htmlProps:l,getHelpTextProps:D,getErrorMessageProps:$,getRootProps:L,getLabelProps:O,getRequiredIndicatorProps:z}}const Y=b(function(e,a){const t=N("Form",e),o=j(e),{getRootProps:r,htmlProps:l,...c}=X(o),n=C("chakra-form-control",e.className);return y.jsx(G,{value:c,children:y.jsx(A,{value:t,children:y.jsx(I.div,{...r({},a),className:n,__css:t.container})})})});Y.displayName="FormControl";const J=b(function(e,a){const t=w(),o=W(),r=C("chakra-form__helper-text",e.className);return y.jsx(I.div,{...t==null?void 0:t.getHelpTextProps(e,a),__css:o.helperText,className:r})});J.displayName="FormHelperText";function K(s){const{isDisabled:e,isInvalid:a,isReadOnly:t,isRequired:o,...r}=Q(s);return{...r,disabled:e,readOnly:t,required:o,"aria-invalid":k(a),"aria-required":k(o),"aria-readonly":k(t)}}function Q(s){const e=w(),{id:a,disabled:t,readOnly:o,required:r,isRequired:l,isInvalid:c,isReadOnly:n,isDisabled:h,onFocus:f,onBlur:x,...v}=s,p=s["aria-describedby"]?[s["aria-describedby"]]:[];return e!=null&&e.hasFeedbackText&&(e!=null&&e.isInvalid)&&p.push(e.feedbackId),e!=null&&e.hasHelpText&&p.push(e.helpTextId),{...v,"aria-describedby":p.join(" ")||void 0,id:a??(e==null?void 0:e.id),isDisabled:t??h??(e==null?void 0:e.isDisabled),isReadOnly:o??n??(e==null?void 0:e.isReadOnly),isRequired:r??l??(e==null?void 0:e.isRequired),isInvalid:c??(e==null?void 0:e.isInvalid),onFocus:M(e==null?void 0:e.onFocus,f),onBlur:M(e==null?void 0:e.onBlur,x)}}const H=b(function(e,a){const{htmlSize:t,...o}=e,r=N("Input",o),l=j(o),c=K(l),n=C("chakra-input",e.className);return y.jsx(I.input,{size:t,...c,__css:r.field,ref:a,className:n})});H.displayName="Input";H.id="Input";const U=b((s,e)=>{const{className:a,...t}=s,o=C("chakra-modal__footer",a),r=E(),l=B({display:"flex",alignItems:"center",justifyContent:"flex-end",...r.footer});return y.jsx(I.footer,{ref:e,...t,__css:l,className:o})});U.displayName="ModalFooter";var V,Z,ee;async function ne(s){let e=te(s);return e.length==0&&(e=se(s)),e}function te(s){if(/^[-]?(\d+(\.\d+)?),\s*[-]?(\d+(\.\d+)?)$/.test(s)){const[e,a]=s.split(",").map(t=>parseFloat(t.trim()));return[{lat:e,lon:a,display_name:`${e},${a}`,key:"coordinates"}]}else return[]}async function se(s){let e="https://nominatim.openstreetmap.org/search?format=json&addressdetails=1&q=".concat(s).concat("+Germany"),a=await T(e);return a||(e="https://nominatim.openstreetmap.org/search?format=json&addressdetails=1&q=".concat(s.split(" ").join("+")),a=await T(e)),a.map(t=>({lat:t.lat,lon:t.lon,key:t.place_id,display_name:oe(t.address)}))}function oe(s){return(s.road||"")+" "+(s.house_number||"")+", "+(s.postcode||"")+" "+(s.city||"")}async function T(s){try{const e=await fetch(s);if(!e.ok)throw new Error(`Request failed with status ${e.status}`);return await e.json()}catch(e){return console.error("Error:",e),[]}}function ie(s,e){Z=[s,e];const a=e*Math.PI/180,t=Math.pow(2,15),o=t*((s+180)/360),r=t*(1-Math.log(Math.tan(a)+1/Math.cos(a))/Math.PI)/2;return V=[o,r],ee=[1222.992452*o-2003750834e-2,2003750834e-2-1222.992452*r],[o,r]}function le(s,e,a){const t=4007501668e-2,o=t/Math.pow(2,a),r=o*s-t/2,l=r+o,c=t/2-o*e,n=c-o;return[r,c,l,n]}export{Y as F,H as I,U as M,w as a,W as b,Z as c,ee as d,V as e,ie as p,ne as r,Q as u,le as x}; diff --git a/assets/maplibre-gl-D3WYbw8S.js b/assets/maplibre-gl-D3WYbw8S.js new file mode 100644 index 0000000..6400ae4 --- /dev/null +++ b/assets/maplibre-gl-D3WYbw8S.js @@ -0,0 +1,580 @@ +import{B as zp,$ as Ep}from"./index-Blxo1hic.js";function Dp(Ta,Fl){for(var Fr=0;Frki[Or]})}}}return Object.freeze(Object.defineProperty(Ta,Symbol.toStringTag,{value:"Module"}))}var Bu={exports:{}};/** + * MapLibre GL JS + * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt + */(function(Ta,Fl){(function(Fr,ki){Ta.exports=ki()})(Ep,function(){var Fr={},ki={};function Or(L,p,zi){if(ki[L]=zi,L==="index"){var Xi="var sharedModule = {}; ("+ki.shared+")(sharedModule); ("+ki.worker+")(sharedModule);",Gt={};return ki.shared(Gt),ki.index(Fr,Gt),typeof window<"u"&&Fr.setWorkerUrl(window.URL.createObjectURL(new Blob([Xi],{type:"text/javascript"}))),Fr}}Or("shared",["exports"],function(L){function p(i,t,r,s){return new(r||(r=Promise))(function(l,u){function d(x){try{_(s.next(x))}catch(v){u(v)}}function f(x){try{_(s.throw(x))}catch(v){u(v)}}function _(x){var v;x.done?l(x.value):(v=x.value,v instanceof r?v:new r(function(w){w(v)})).then(d,f)}_((s=s.apply(i,t||[])).next())})}function zi(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var Xi=Gt;function Gt(i,t){this.x=i,this.y=t}Gt.prototype={clone:function(){return new Gt(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,t){return this.clone()._rotateAround(i,t)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var t=i.x-this.x,r=i.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,t){return Math.atan2(this.x*t-this.y*i,this.x*i+this.y*t)},_matMult:function(i){var t=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=t,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var t=Math.cos(i),r=Math.sin(i),s=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=s,this},_rotateAround:function(i,t){var r=Math.cos(i),s=Math.sin(i),l=t.y+s*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-s*(this.y-t.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Gt.convert=function(i){return i instanceof Gt?i:Array.isArray(i)?new Gt(i[0],i[1]):i};var me=zi(Xi),se=Vr;function Vr(i,t,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(s-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=t,this.p2x=r,this.p2y=s}Vr.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,t){if(t===void 0&&(t=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?d=r:f=r,r=.5*(f-d)+d;return r},solve:function(i,t){return this.sampleCurveY(this.solveCurveX(i,t))}};var br=zi(se);let Wi,wr;function hr(){return Wi==null&&(Wi=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Wi}function Hn(){if(wr==null&&(wr=!1,hr())){const t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let s=0;s<5*5;s++){const l=4*s;t.fillStyle=`rgb(${l},${l+1},${l+2})`,t.fillRect(s%5,Math.floor(s/5),1,1)}const r=t.getImageData(0,0,5,5).data;for(let s=0;s<5*5*4;s++)if(s%4!=3&&r[s]!==s){wr=!0;break}}}return wr||!1}function hi(i,t,r,s){const l=new br(i,t,r,s);return u=>l.solve(u)}const Ia=hi(.25,.1,.25,1);function Ei(i,t,r){return Math.min(r,Math.max(t,i))}function Ki(i,t,r){const s=r-t,l=((i-t)%s+s)%s+t;return l===t?r:l}function vi(i,...t){for(const r of t)for(const s in r)i[s]=r[s];return i}let Ps=1;function Ji(i,t,r){const s={};for(const l in i)s[l]=t.call(this,i[l],l,i);return s}function Xn(i,t,r){const s={};for(const l in i)t.call(this,i[l],l,i)&&(s[l]=i[l]);return s}function st(i){return Array.isArray(i)?i.map(st):typeof i=="object"&&i?Ji(i,st):i}const As={};function Ft(i){As[i]||(typeof console<"u"&&console.warn(i),As[i]=!0)}function Ht(i,t,r){return(r.y-i.y)*(t.x-i.x)>(t.y-i.y)*(r.x-i.x)}function ur(i){return typeof WorkerGlobalScope<"u"&&i!==void 0&&i instanceof WorkerGlobalScope}let ln=null;function Yi(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const Ms="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Nr(i,t,r,s,l){return p(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const u=new VideoFrame(i,{timestamp:0});try{const d=u==null?void 0:u.format;if(!d||!d.startsWith("BGR")&&!d.startsWith("RGB"))throw new Error(`Unrecognized format ${d}`);const f=d.startsWith("BGR"),_=new Uint8ClampedArray(s*l*4);if(yield u.copyTo(_,function(x,v,w,I,M){const k=4*Math.max(-v,0),z=(Math.max(0,w)-w)*I*4+k,F=4*I,j=Math.max(0,v),Q=Math.max(0,w);return{rect:{x:j,y:Q,width:Math.min(x.width,v+I)-j,height:Math.min(x.height,w+M)-Q},layout:[{offset:z,stride:F}]}}(i,t,r,s,l)),f)for(let x=0;x<_.length;x+=4){const v=_[x];_[x]=_[x+2],_[x+2]=v}return _}finally{u.close()}})}let dr,ei;const Di="AbortError";function cn(){return new Error(Di)}const Tr={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Qi(i){return Tr.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))]}const hn="global-dispatcher";class ui extends Error{constructor(t,r,s,l){super(`AJAXError: ${r} (${t}): ${s}`),this.status=t,this.statusText=r,this.url=s,this.body=l}}const Li=()=>ur(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,jr=function(i,t){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){const s=Qi(i.url);if(s)return s(i,t);if(ur(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,targetMapId:hn},t)}if(!(/^file:/.test(r=i.url)||/^file:/.test(Li())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(s,l){return p(this,void 0,void 0,function*(){const u=new Request(s.url,{method:s.method||"GET",body:s.body,credentials:s.credentials,headers:s.headers,cache:s.cache,referrer:Li(),signal:l.signal});s.type!=="json"||u.headers.has("Accept")||u.headers.set("Accept","application/json");const d=yield fetch(u);if(!d.ok){const x=yield d.blob();throw new ui(d.status,d.statusText,s.url,x)}let f;f=s.type==="arrayBuffer"||s.type==="image"?d.arrayBuffer():s.type==="json"?d.json():d.text();const _=yield f;if(l.signal.aborted)throw cn();return{data:_,cacheControl:d.headers.get("Cache-Control"),expires:d.headers.get("Expires")}})}(i,t);if(ur(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,mustQueue:!0,targetMapId:hn},t)}var r;return function(s,l){return new Promise((u,d)=>{var f;const _=new XMLHttpRequest;_.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(_.responseType="arraybuffer");for(const x in s.headers)_.setRequestHeader(x,s.headers[x]);s.type==="json"&&(_.responseType="text",!((f=s.headers)===null||f===void 0)&&f.Accept||_.setRequestHeader("Accept","application/json")),_.withCredentials=s.credentials==="include",_.onerror=()=>{d(new Error(_.statusText))},_.onload=()=>{if(!l.signal.aborted)if((_.status>=200&&_.status<300||_.status===0)&&_.response!==null){let x=_.response;if(s.type==="json")try{x=JSON.parse(_.response)}catch(v){return void d(v)}u({data:x,cacheControl:_.getResponseHeader("Cache-Control"),expires:_.getResponseHeader("Expires")})}else{const x=new Blob([_.response],{type:_.getResponseHeader("Content-Type")});d(new ui(_.status,_.statusText,s.url,x))}},l.signal.addEventListener("abort",()=>{_.abort(),d(cn())}),_.send(s.body)})}(i,t)};function Ur(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const t=new URL(i),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function Wn(i,t,r){r[i]&&r[i].indexOf(t)!==-1||(r[i]=r[i]||[],r[i].push(t))}function pr(i,t,r){if(r&&r[i]){const s=r[i].indexOf(t);s!==-1&&r[i].splice(s,1)}}class Sr{constructor(t,r={}){vi(this,r),this.type=t}}class Ir extends Sr{constructor(t,r={}){super("error",vi({error:t},r))}}class un{on(t,r){return this._listeners=this._listeners||{},Wn(t,r,this._listeners),this}off(t,r){return pr(t,r,this._listeners),pr(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Wn(t,r,this._oneTimeListeners),this):new Promise(s=>this.once(t,s))}fire(t,r){typeof t=="string"&&(t=new Sr(t,r||{}));const s=t.type;if(this.listens(s)){t.target=this;const l=this._listeners&&this._listeners[s]?this._listeners[s].slice():[];for(const f of l)f.call(this,t);const u=this._oneTimeListeners&&this._oneTimeListeners[s]?this._oneTimeListeners[s].slice():[];for(const f of u)pr(s,f,this._oneTimeListeners),f.call(this,t);const d=this._eventedParent;d&&(vi(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(t))}else t instanceof Ir&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,r){return this._eventedParent=t,this._eventedParentData=r,this}}var ie={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const $r=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Kn(i,t){const r={};for(const s in i)s!=="ref"&&(r[s]=i[s]);return $r.forEach(s=>{s in t&&(r[s]=t[s])}),r}function et(i,t){if(Array.isArray(i)){if(!Array.isArray(t)||i.length!==t.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${t}>`}return i.kind}const D=[Ar,_e,$e,Be,ti,mr,Ri,A(Ne),Mr,rr,N];function O(i,t){if(t.kind==="error")return null;if(i.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!O(i.itemType,t.itemType))&&(typeof i.N!="number"||i.N===t.N))return null}else{if(i.kind===t.kind)return null;if(i.kind==="value"){for(const r of D)if(!O(r,t))return null}}return`Expected ${P(i)} but found ${P(t)} instead.`}function H(i,t){return t.some(r=>r.kind===i.kind)}function W(i,t){return t.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function Y(i,t){return i.kind==="array"&&t.kind==="array"?i.itemType.kind===t.itemType.kind&&typeof i.N=="number":i.kind===t.kind}const q=.96422,ne=.82521,le=4/29,te=6/29,de=3*te*te,Ee=te*te*te,De=Math.PI/180,Ke=180/Math.PI;function je(i){return(i%=360)<0&&(i+=360),i}function Je([i,t,r,s]){let l,u;const d=Pt((.2225045*(i=Ge(i))+.7168786*(t=Ge(t))+.0606169*(r=Ge(r)))/1);i===t&&t===r?l=u=d:(l=Pt((.4360747*i+.3850649*t+.1430804*r)/q),u=Pt((.0139322*i+.0971045*t+.7141733*r)/ne));const f=116*d-16;return[f<0?0:f,500*(l-d),200*(d-u),s]}function Ge(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Pt(i){return i>Ee?Math.pow(i,1/3):i/de+le}function xt([i,t,r,s]){let l=(i+16)/116,u=isNaN(t)?l:l+t/500,d=isNaN(r)?l:l-r/200;return l=1*rt(l),u=q*rt(u),d=ne*rt(d),[qe(3.1338561*u-1.6168667*l-.4906146*d),qe(-.9787684*u+1.9161415*l+.033454*d),qe(.0719453*u-.2289914*l+1.4052427*d),s]}function qe(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function rt(i){return i>te?i*i*i:de*(i-le)}function gt(i){return parseInt(i.padEnd(2,i),16)/255}function kt(i,t){return Lt(t?i/100:i,0,1)}function Lt(i,t,r){return Math.min(Math.max(t,i),r)}function Wt(i){return!i.some(Number.isNaN)}const pn={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class nt{constructor(t,r,s,l=1,u=!0){this.r=t,this.g=r,this.b=s,this.a=l,u||(this.r*=l,this.g*=l,this.b*=l,l||this.overwriteGetter("rgb",[t,r,s,l]))}static parse(t){if(t instanceof nt)return t;if(typeof t!="string")return;const r=function(s){if((s=s.toLowerCase().trim())==="transparent")return[0,0,0,0];const l=pn[s];if(l){const[d,f,_]=l;return[d/255,f/255,_/255,1]}if(s.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(s)){const d=s.length<6?1:2;let f=1;return[gt(s.slice(f,f+=d)),gt(s.slice(f,f+=d)),gt(s.slice(f,f+=d)),gt(s.slice(f,f+d)||"ff")]}if(s.startsWith("rgb")){const d=s.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[f,_,x,v,w,I,M,k,z,F,j,Q]=d,G=[v||" ",M||" ",F].join("");if(G===" "||G===" /"||G===",,"||G===",,,"){const J=[x,I,z].join(""),re=J==="%%%"?100:J===""?255:0;if(re){const ce=[Lt(+_/re,0,1),Lt(+w/re,0,1),Lt(+k/re,0,1),j?kt(+j,Q):1];if(Wt(ce))return ce}}return}}const u=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){const[d,f,_,x,v,w,I,M,k]=u,z=[_||" ",v||" ",I].join("");if(z===" "||z===" /"||z===",,"||z===",,,"){const F=[+f,Lt(+x,0,100),Lt(+w,0,100),M?kt(+M,k):1];if(Wt(F))return function([j,Q,G,J]){function re(ce){const we=(ce+j/30)%12,Le=Q*Math.min(G,1-G);return G-Le*Math.max(-1,Math.min(we-3,9-we,1))}return j=je(j),Q/=100,G/=100,[re(0),re(8),re(4),J]}(F)}}}(t);return r?new nt(...r,!1):void 0}get rgb(){const{r:t,g:r,b:s,a:l}=this,u=l||1/0;return this.overwriteGetter("rgb",[t/u,r/u,s/u,l])}get hcl(){return this.overwriteGetter("hcl",function(t){const[r,s,l,u]=Je(t),d=Math.sqrt(s*s+l*l);return[Math.round(1e4*d)?je(Math.atan2(l,s)*Ke):NaN,d,r,u]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Je(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){const[t,r,s,l]=this.rgb;return`rgba(${[t,r,s].map(u=>Math.round(255*u)).join(",")},${l})`}}nt.black=new nt(0,0,0,1),nt.white=new nt(1,1,1,1),nt.transparent=new nt(0,0,0,0),nt.red=new nt(1,0,0,1);class Pa{constructor(t,r,s){this.sensitivity=t?r?"variant":"case":r?"accent":"base",this.locale=s,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,r){return this.collator.compare(t,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Aa{constructor(t,r,s,l,u){this.text=t,this.image=r,this.scale=s,this.fontStack=l,this.textColor=u}}class di{constructor(t){this.sections=t}static fromString(t){return new di([new Aa(t,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof di?t:di.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}}class pi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof pi)return t;if(typeof t=="number")return new pi([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new pi(t)}}toString(){return JSON.stringify(this.values)}}const Ol=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class wi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof wi)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let r=0;r=0&&i<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?s===void 0||typeof s=="number"&&s>=0&&s<=1?null:`Invalid rgba value [${[i,t,r,s].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof s=="number"?[i,t,r,s]:[i,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function qr(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof nt||i instanceof Pa||i instanceof di||i instanceof pi||i instanceof wi||i instanceof fi)return!0;if(Array.isArray(i)){for(const t of i)if(!qr(t))return!1;return!0}if(typeof i=="object"){for(const t in i)if(!qr(i[t]))return!1;return!0}return!1}function At(i){if(i===null)return Ar;if(typeof i=="string")return $e;if(typeof i=="boolean")return Be;if(typeof i=="number")return _e;if(i instanceof nt)return ti;if(i instanceof Pa)return ir;if(i instanceof di)return mr;if(i instanceof pi)return Mr;if(i instanceof wi)return N;if(i instanceof fi)return rr;if(Array.isArray(i)){const t=i.length;let r;for(const s of i){const l=At(s);if(r){if(r===l)continue;r=Ne;break}r=l}return A(r||Ne,t)}return Ri}function es(i){const t=typeof i;return i===null?"":t==="string"||t==="number"||t==="boolean"?String(i):i instanceof nt||i instanceof di||i instanceof pi||i instanceof wi||i instanceof fi?i.toString():JSON.stringify(i)}class Bi{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!qr(t[1]))return r.error("invalid value");const s=t[1];let l=At(s);const u=r.expectedType;return l.kind!=="array"||l.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(l=u),new Bi(l,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class St{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const Cs={string:$e,number:_e,boolean:Be,object:Ri};class Fi{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let s,l=1;const u=t[0];if(u==="array"){let f,_;if(t.length>2){const x=t[1];if(typeof x!="string"||!(x in Cs)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=Cs[x],l++}else f=Ne;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);_=t[2],l++}s=A(f,_)}else{if(!Cs[u])throw new Error(`Types doesn't contain name = ${u}`);s=Cs[u]}const d=[];for(;lt.outputDefined())}}const Ma={"to-boolean":Be,"to-color":ti,"to-number":_e,"to-string":$e};class Oi{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const s=t[0];if(!Ma[s])throw new Error(`Can't parse ${s} as it is not part of the known types`);if((s==="to-boolean"||s==="to-string")&&t.length!==2)return r.error("Expected one argument.");const l=Ma[s],u=[];for(let d=1;d4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:fn(r[0],r[1],r[2],r[3]),!s))return new nt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new St(s||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const s of this.args){r=s.evaluate(t);const l=pi.parse(r);if(l)return l}throw new St(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const s of this.args){r=s.evaluate(t);const l=wi.parse(r);if(l)return l}throw new St(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const s of this.args){if(r=s.evaluate(t),r===null)return 0;const l=Number(r);if(!isNaN(l))return l}throw new St(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return di.fromString(es(this.args[0].evaluate(t)));case"resolvedImage":return fi.fromString(es(this.args[0].evaluate(t)));default:return es(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const Vl=["Unknown","Point","LineString","Polygon"];class ks{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Vl[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let r=this._parseColorCache[t];return r||(r=this._parseColorCache[t]=nt.parse(t)),r}}class Zr{constructor(t,r,s=[],l,u=new tr,d=[]){this.registry=t,this.path=s,this.key=s.map(f=>`[${f}]`).join(""),this.scope=u,this.errors=d,this.expectedType=l,this._isConstant=r}parse(t,r,s,l,u={}){return r?this.concat(r,s,l)._parse(t,u):this._parse(t,u)}_parse(t,r){function s(l,u,d){return d==="assert"?new Fi(u,[l]):d==="coerce"?new Oi(u,[l]):l}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const l=t[0];if(typeof l!="string")return this.error(`Expression name must be a string, but found ${typeof l} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const u=this.registry[l];if(u){let d=u.parse(t,this);if(!d)return null;if(this.expectedType){const f=this.expectedType,_=d.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||_.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||_.kind!=="value"&&_.kind!=="string")if(f.kind!=="padding"||_.kind!=="value"&&_.kind!=="number"&&_.kind!=="array")if(f.kind!=="variableAnchorOffsetCollection"||_.kind!=="value"&&_.kind!=="array"){if(this.checkSubtype(f,_))return null}else d=s(d,f,r.typeAnnotation||"coerce");else d=s(d,f,r.typeAnnotation||"coerce");else d=s(d,f,r.typeAnnotation||"coerce");else d=s(d,f,r.typeAnnotation||"assert")}if(!(d instanceof Bi)&&d.type.kind!=="resolvedImage"&&this._isConstant(d)){const f=new ks;try{d=new Bi(d.type,d.evaluate(f))}catch(_){return this.error(_.message),null}}return d}return this.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,r,s){const l=typeof t=="number"?this.path.concat(t):this.path,u=s?this.scope.concat(s):this.scope;return new Zr(this.registry,this._isConstant,l,r||null,u,this.errors)}error(t,...r){const s=`${this.key}${r.map(l=>`[${l}]`).join("")}`;this.errors.push(new Xt(s,t))}checkSubtype(t,r){const s=O(t,r);return s&&this.error(s),s}}class Cr{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const s=[];for(let u=1;u=s.length)throw new St(`Array index out of bounds: ${r} > ${s.length-1}.`);if(r!==Math.floor(r))throw new St(`Array index must be an integer, but found ${r} instead.`);return s[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class ka{constructor(t,r){this.type=Be,this.needle=t,this.haystack=r}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const s=r.parse(t[1],1,Ne),l=r.parse(t[2],2,Ne);return s&&l?H(s.type,[Be,$e,_e,Ar,Ne])?new ka(s,l):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${P(s.type)} instead`):null}evaluate(t){const r=this.needle.evaluate(t),s=this.haystack.evaluate(t);if(!s)return!1;if(!W(r,["boolean","string","number","null"]))throw new St(`Expected first argument to be of type boolean, string, number or null, but found ${P(At(r))} instead.`);if(!W(s,["string","array"]))throw new St(`Expected second argument to be of type array or string, but found ${P(At(s))} instead.`);return s.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class mn{constructor(t,r,s){this.type=_e,this.needle=t,this.haystack=r,this.fromIndex=s}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const s=r.parse(t[1],1,Ne),l=r.parse(t[2],2,Ne);if(!s||!l)return null;if(!H(s.type,[Be,$e,_e,Ar,Ne]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${P(s.type)} instead`);if(t.length===4){const u=r.parse(t[3],3,_e);return u?new mn(s,l,u):null}return new mn(s,l)}evaluate(t){const r=this.needle.evaluate(t),s=this.haystack.evaluate(t);if(!W(r,["boolean","string","number","null"]))throw new St(`Expected first argument to be of type boolean, string, number or null, but found ${P(At(r))} instead.`);let l;if(this.fromIndex&&(l=this.fromIndex.evaluate(t)),W(s,["string"])){const u=s.indexOf(r,l);return u===-1?-1:[...s.slice(0,u)].length}if(W(s,["array"]))return s.indexOf(r,l);throw new St(`Expected second argument to be of type array or string, but found ${P(At(s))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class za{constructor(t,r,s,l,u,d){this.inputType=t,this.type=r,this.input=s,this.cases=l,this.outputs=u,this.otherwise=d}static parse(t,r){if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");let s,l;r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);const u={},d=[];for(let x=2;xNumber.MAX_SAFE_INTEGER)return I.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof k=="number"&&Math.floor(k)!==k)return I.error("Numeric branch labels must be integer values.");if(s){if(I.checkSubtype(s,At(k)))return null}else s=At(k);if(u[String(k)]!==void 0)return I.error("Branch labels must be unique.");u[String(k)]=d.length}const M=r.parse(w,x,l);if(!M)return null;l=l||M.type,d.push(M)}const f=r.parse(t[1],1,Ne);if(!f)return null;const _=r.parse(t[t.length-1],t.length-1,l);return _?f.type.kind!=="value"&&r.concat(1).checkSubtype(s,f.type)?null:new za(s,l,f,u,d,_):null}evaluate(t){const r=this.input.evaluate(t);return(At(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class zs{constructor(t,r,s){this.type=t,this.branches=r,this.otherwise=s}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let s;r.expectedType&&r.expectedType.kind!=="value"&&(s=r.expectedType);const l=[];for(let d=1;dr.outputDefined())&&this.otherwise.outputDefined()}}class ts{constructor(t,r,s,l){this.type=t,this.input=r,this.beginIndex=s,this.endIndex=l}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const s=r.parse(t[1],1,Ne),l=r.parse(t[2],2,_e);if(!s||!l)return null;if(!H(s.type,[A(Ne),$e,Ne]))return r.error(`Expected first argument to be of type array or string, but found ${P(s.type)} instead`);if(t.length===4){const u=r.parse(t[3],3,_e);return u?new ts(s.type,s,l,u):null}return new ts(s.type,s,l)}evaluate(t){const r=this.input.evaluate(t),s=this.beginIndex.evaluate(t);let l;if(this.endIndex&&(l=this.endIndex.evaluate(t)),W(r,["string"]))return[...r].slice(s,l).join("");if(W(r,["array"]))return r.slice(s,l);throw new St(`Expected first argument to be of type array or string, but found ${P(At(r))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Es(i,t){const r=i.length-1;let s,l,u=0,d=r,f=0;for(;u<=d;)if(f=Math.floor((u+d)/2),s=i[f],l=i[f+1],s<=t){if(f===r||tt))throw new St("Input is not a number.");d=f-1}return 0}class _n{constructor(t,r,s){this.type=t,this.input=r,this.labels=[],this.outputs=[];for(const[l,u]of s)this.labels.push(l),this.outputs.push(u)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");const s=r.parse(t[1],1,_e);if(!s)return null;const l=[];let u=null;r.expectedType&&r.expectedType.kind!=="value"&&(u=r.expectedType);for(let d=1;d=f)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const w=r.parse(_,v,u);if(!w)return null;u=u||w.type,l.push([f,w])}return new _n(u,s,l)}evaluate(t){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(t);const l=this.input.evaluate(t);if(l<=r[0])return s[0].evaluate(t);const u=r.length;return l>=r[u-1]?s[u-1].evaluate(t):s[Es(r,l)].evaluate(t)}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Ro(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Nl=Bo;function Bo(i,t,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(s-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=t,this.p2x=r,this.p2y=s}Bo.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,t){if(t===void 0&&(t=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?d=r:f=r,r=.5*(f-d)+d;return r},solve:function(i,t){return this.sampleCurveY(this.solveCurveX(i,t))}};var jl=Ro(Nl);function Gr(i,t,r){return i+r*(t-i)}function is(i,t,r){return i.map((s,l)=>Gr(s,t[l],r))}const ii={number:Gr,color:function(i,t,r,s="rgb"){switch(s){case"rgb":{const[l,u,d,f]=is(i.rgb,t.rgb,r);return new nt(l,u,d,f,!1)}case"hcl":{const[l,u,d,f]=i.hcl,[_,x,v,w]=t.hcl;let I,M;if(isNaN(l)||isNaN(_))isNaN(l)?isNaN(_)?I=NaN:(I=_,d!==1&&d!==0||(M=x)):(I=l,v!==1&&v!==0||(M=u));else{let Q=_-l;_>l&&Q>180?Q-=360:_180&&(Q+=360),I=l+r*Q}const[k,z,F,j]=function([Q,G,J,re]){return Q=isNaN(Q)?0:Q*De,xt([J,Math.cos(Q)*G,Math.sin(Q)*G,re])}([I,M??Gr(u,x,r),Gr(d,v,r),Gr(f,w,r)]);return new nt(k,z,F,j,!1)}case"lab":{const[l,u,d,f]=xt(is(i.lab,t.lab,r));return new nt(l,u,d,f,!1)}}},array:is,padding:function(i,t,r){return new pi(is(i.values,t.values,r))},variableAnchorOffsetCollection:function(i,t,r){const s=i.values,l=t.values;if(s.length!==l.length)throw new St(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${t.toString()}`);const u=[];for(let d=0;dtypeof v!="number"||v<0||v>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);l={name:"cubic-bezier",controlPoints:x}}}if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(u=r.parse(u,2,_e),!u)return null;const f=[];let _=null;s==="interpolate-hcl"||s==="interpolate-lab"?_=ti:r.expectedType&&r.expectedType.kind!=="value"&&(_=r.expectedType);for(let x=0;x=v)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',I);const k=r.parse(w,M,_);if(!k)return null;_=_||k.type,f.push([v,k])}return Y(_,_e)||Y(_,ti)||Y(_,Mr)||Y(_,N)||Y(_,A(_e))?new ri(_,s,l,u,f):r.error(`Type ${P(_)} is not interpolatable.`)}evaluate(t){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(t);const l=this.input.evaluate(t);if(l<=r[0])return s[0].evaluate(t);const u=r.length;if(l>=r[u-1])return s[u-1].evaluate(t);const d=Es(r,l),f=ri.interpolationFactor(this.interpolation,l,r[d],r[d+1]),_=s[d].evaluate(t),x=s[d+1].evaluate(t);switch(this.operator){case"interpolate":return ii[this.type.kind](_,x,f);case"interpolate-hcl":return ii.color(_,x,f,"hcl");case"interpolate-lab":return ii.color(_,x,f,"lab")}}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Ds(i,t,r,s){const l=s-r,u=i-r;return l===0?0:t===1?u/l:(Math.pow(t,u)-1)/(Math.pow(t,l)-1)}class Ls{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expectected at least one argument.");let s=null;const l=r.expectedType;l&&l.kind!=="value"&&(s=l);const u=[];for(const f of t.slice(1)){const _=r.parse(f,1+u.length,s,void 0,{typeAnnotation:"omit"});if(!_)return null;s=s||_.type,u.push(_)}if(!s)throw new Error("No output type");const d=l&&u.some(f=>O(l,f.type));return new Ls(d?Ne:s,u)}evaluate(t){let r,s=null,l=0;for(const u of this.args)if(l++,s=u.evaluate(t),s&&s instanceof fi&&!s.available&&(r||(r=s.name),s=null,l===this.args.length&&(s=r)),s!==null)break;return s}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function Rs(i,t){return i==="=="||i==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Fo(i,t,r,s){return s.compare(t,r)===0}function gn(i,t,r){const s=i!=="=="&&i!=="!=";return class Fu{constructor(u,d,f){this.type=Be,this.lhs=u,this.rhs=d,this.collator=f,this.hasUntypedArgument=u.type.kind==="value"||d.type.kind==="value"}static parse(u,d){if(u.length!==3&&u.length!==4)return d.error("Expected two or three arguments.");const f=u[0];let _=d.parse(u[1],1,Ne);if(!_)return null;if(!Rs(f,_.type))return d.concat(1).error(`"${f}" comparisons are not supported for type '${P(_.type)}'.`);let x=d.parse(u[2],2,Ne);if(!x)return null;if(!Rs(f,x.type))return d.concat(2).error(`"${f}" comparisons are not supported for type '${P(x.type)}'.`);if(_.type.kind!==x.type.kind&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error(`Cannot compare types '${P(_.type)}' and '${P(x.type)}'.`);s&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new Fi(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new Fi(_.type,[x])));let v=null;if(u.length===4){if(_.type.kind!=="string"&&x.type.kind!=="string"&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error("Cannot use collator to compare non-string types.");if(v=d.parse(u[3],3,ir),!v)return null}return new Fu(_,x,v)}evaluate(u){const d=this.lhs.evaluate(u),f=this.rhs.evaluate(u);if(s&&this.hasUntypedArgument){const _=At(d),x=At(f);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new St(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${_.kind}, ${x.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const _=At(d),x=At(f);if(_.kind!=="string"||x.kind!=="string")return t(u,d,f)}return this.collator?r(u,d,f,this.collator.evaluate(u)):t(u,d,f)}eachChild(u){u(this.lhs),u(this.rhs),this.collator&&u(this.collator)}outputDefined(){return!0}}}const Ul=gn("==",function(i,t,r){return t===r},Fo),Oo=gn("!=",function(i,t,r){return t!==r},function(i,t,r,s){return!Fo(0,t,r,s)}),Vo=gn("<",function(i,t,r){return t",function(i,t,r){return t>r},function(i,t,r,s){return s.compare(t,r)>0}),ql=gn("<=",function(i,t,r){return t<=r},function(i,t,r,s){return s.compare(t,r)<=0}),No=gn(">=",function(i,t,r){return t>=r},function(i,t,r,s){return s.compare(t,r)>=0});class rs{constructor(t,r,s){this.type=ir,this.locale=s,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");const s=t[1];if(typeof s!="object"||Array.isArray(s))return r.error("Collator options argument must be an object.");const l=r.parse(s["case-sensitive"]!==void 0&&s["case-sensitive"],1,Be);if(!l)return null;const u=r.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,Be);if(!u)return null;let d=null;return s.locale&&(d=r.parse(s.locale,1,$e),!d)?null:new rs(l,u,d)}evaluate(t){return new Pa(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class Ea{constructor(t,r,s,l,u){this.type=$e,this.number=t,this.locale=r,this.currency=s,this.minFractionDigits=l,this.maxFractionDigits=u}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");const s=r.parse(t[1],1,_e);if(!s)return null;const l=t[2];if(typeof l!="object"||Array.isArray(l))return r.error("NumberFormat options argument must be an object.");let u=null;if(l.locale&&(u=r.parse(l.locale,1,$e),!u))return null;let d=null;if(l.currency&&(d=r.parse(l.currency,1,$e),!d))return null;let f=null;if(l["min-fraction-digits"]&&(f=r.parse(l["min-fraction-digits"],1,_e),!f))return null;let _=null;return l["max-fraction-digits"]&&(_=r.parse(l["max-fraction-digits"],1,_e),!_)?null:new Ea(s,u,d,f,_)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Bs{constructor(t){this.type=mr,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const s=t[1];if(!Array.isArray(s)&&typeof s=="object")return r.error("First argument must be an image or text section.");const l=[];let u=!1;for(let d=1;d<=t.length-1;++d){const f=t[d];if(u&&typeof f=="object"&&!Array.isArray(f)){u=!1;let _=null;if(f["font-scale"]&&(_=r.parse(f["font-scale"],1,_e),!_))return null;let x=null;if(f["text-font"]&&(x=r.parse(f["text-font"],1,A($e)),!x))return null;let v=null;if(f["text-color"]&&(v=r.parse(f["text-color"],1,ti),!v))return null;const w=l[l.length-1];w.scale=_,w.font=x,w.textColor=v}else{const _=r.parse(t[d],1,Ne);if(!_)return null;const x=_.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,l.push({content:_,scale:null,font:null,textColor:null})}}return new Bs(l)}evaluate(t){return new di(this.sections.map(r=>{const s=r.content.evaluate(t);return At(s)===rr?new Aa("",s,null,null,null):new Aa(es(s),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null)}))}eachChild(t){for(const r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}outputDefined(){return!1}}class Da{constructor(t){this.type=rr,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");const s=r.parse(t[1],1,$e);return s?new Da(s):r.error("No image name provided.")}evaluate(t){const r=this.input.evaluate(t),s=fi.fromString(r);return s&&t.availableImages&&(s.available=t.availableImages.indexOf(r)>-1),s}eachChild(t){t(this.input)}outputDefined(){return!1}}class La{constructor(t){this.type=_e,this.input=t}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);const s=r.parse(t[1],1);return s?s.type.kind!=="array"&&s.type.kind!=="string"&&s.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${P(s.type)} instead.`):new La(s):null}evaluate(t){const r=this.input.evaluate(t);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new St(`Expected value to be of type string or array, but found ${P(At(r))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const nr=8192;function Zl(i,t){const r=(180+i[0])/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,l=Math.pow(2,t.z);return[Math.round(r*l*nr),Math.round(s*l*nr)]}function Ra(i,t){const r=Math.pow(2,t.z);return[(l=(i[0]/nr+t.x)/r,360*l-180),(s=(i[1]/nr+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90)];var s,l}function Hr(i,t){i[0]=Math.min(i[0],t[0]),i[1]=Math.min(i[1],t[1]),i[2]=Math.max(i[2],t[0]),i[3]=Math.max(i[3],t[1])}function kr(i,t){return!(i[0]<=t[0]||i[2]>=t[2]||i[1]<=t[1]||i[3]>=t[3])}function it(i,t,r){const s=i[0]-t[0],l=i[1]-t[1],u=i[0]-r[0],d=i[1]-r[1];return s*d-u*l==0&&s*u<=0&&l*d<=0}function Fs(i,t,r,s){return(l=[s[0]-r[0],s[1]-r[1]])[0]*(u=[t[0]-i[0],t[1]-i[1]])[1]-l[1]*u[0]!=0&&!(!Uo(i,t,r,s)||!Uo(r,s,i,t));var l,u}function Gl(i,t,r){for(const s of r)for(let l=0;l(l=i)[1]!=(d=f[_+1])[1]>l[1]&&l[0]<(d[0]-u[0])*(l[1]-u[1])/(d[1]-u[1])+u[0]&&(s=!s)}var l,u,d;return s}function Hl(i,t){for(const r of t)if(yn(i,r))return!0;return!1}function jo(i,t){for(const r of i)if(!yn(r,t))return!1;for(let r=0;r0&&f<0||d<0&&f>0}function Ba(i,t,r){const s=[];for(let l=0;lr[2]){const l=.5*s;let u=i[0]-r[0]>l?-s:r[0]-i[0]>l?s:0;u===0&&(u=i[0]-r[2]>l?-s:r[2]-i[0]>l?s:0),i[0]+=u}Hr(t,i)}function Zo(i,t,r,s){const l=Math.pow(2,s.z)*nr,u=[s.x*nr,s.y*nr],d=[];for(const f of i)for(const _ of f){const x=[_.x+u[0],_.y+u[1]];qo(x,t,r,l),d.push(x)}return d}function Go(i,t,r,s){const l=Math.pow(2,s.z)*nr,u=[s.x*nr,s.y*nr],d=[];for(const _ of i){const x=[];for(const v of _){const w=[v.x+u[0],v.y+u[1]];Hr(t,w),x.push(w)}d.push(x)}if(t[2]-t[0]<=l/2){(f=t)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const _ of d)for(const x of _)qo(x,t,r,l)}var f;return d}class Xr{constructor(t,r){this.type=Be,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(qr(t[1])){const s=t[1];if(s.type==="FeatureCollection"){const l=[];for(const u of s.features){const{type:d,coordinates:f}=u.geometry;d==="Polygon"&&l.push(f),d==="MultiPolygon"&&l.push(...f)}if(l.length)return new Xr(s,{type:"MultiPolygon",coordinates:l})}else if(s.type==="Feature"){const l=s.geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new Xr(s,s.geometry)}else if(s.type==="Polygon"||s.type==="MultiPolygon")return new Xr(s,s)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(r,s){const l=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(s.type==="Polygon"){const f=Ba(s.coordinates,u,d),_=Zo(r.geometry(),l,u,d);if(!kr(l,u))return!1;for(const x of _)if(!yn(x,f))return!1}if(s.type==="MultiPolygon"){const f=$o(s.coordinates,u,d),_=Zo(r.geometry(),l,u,d);if(!kr(l,u))return!1;for(const x of _)if(!Hl(x,f))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(r,s){const l=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(s.type==="Polygon"){const f=Ba(s.coordinates,u,d),_=Go(r.geometry(),l,u,d);if(!kr(l,u))return!1;for(const x of _)if(!jo(x,f))return!1}if(s.type==="MultiPolygon"){const f=$o(s.coordinates,u,d),_=Go(r.geometry(),l,u,d);if(!kr(l,u))return!1;for(const x of _)if(!Xl(x,f))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Ho=class{constructor(i=[],t=(r,s)=>rs?1:0){if(this.data=i,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(i){this.data.push(i),this._up(this.length++)}pop(){if(this.length===0)return;const i=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),i}peek(){return this.data[0]}_up(i){const{data:t,compare:r}=this,s=t[i];for(;i>0;){const l=i-1>>1,u=t[l];if(r(s,u)>=0)break;t[i]=u,i=l}t[i]=s}_down(i){const{data:t,compare:r}=this,s=this.length>>1,l=t[i];for(;i=0)break;t[i]=t[u],i=u}t[i]=l}};function Wl(i,t,r,s,l){Xo(i,t,r,s||i.length-1,l||Kl)}function Xo(i,t,r,s,l){for(;s>r;){if(s-r>600){var u=s-r+1,d=t-r+1,f=Math.log(u),_=.5*Math.exp(2*f/3),x=.5*Math.sqrt(f*_*(u-_)/u)*(d-u/2<0?-1:1);Xo(i,t,Math.max(r,Math.floor(t-d*_/u+x)),Math.min(s,Math.floor(t+(u-d)*_/u+x)),l)}var v=i[t],w=r,I=s;for(ns(i,r,t),l(i[s],v)>0&&ns(i,r,s);w0;)I--}l(i[r],v)===0?ns(i,r,I):ns(i,++I,s),I<=t&&(r=I+1),t<=I&&(s=I-1)}}function ns(i,t,r){var s=i[t];i[t]=i[r],i[r]=s}function Kl(i,t){return it?1:0}function Os(i,t){if(i.length<=1)return[i];const r=[];let s,l;for(const u of i){const d=Yl(u);d!==0&&(u.area=Math.abs(d),l===void 0&&(l=d<0),l===d<0?(s&&r.push(s),s=[u]):s.push(u))}if(s&&r.push(s),t>1)for(let u=0;u1?(x=t[_+1][0],v=t[_+1][1]):M>0&&(x+=w/this.kx*M,v+=I/this.ky*M)),w=this.wrap(r[0]-x)*this.kx,I=(r[1]-v)*this.ky;const k=w*w+I*I;k180;)t-=360;return t}}function Yo(i,t){return t[0]-i[0]}function Vs(i){return i[1]-i[0]+1}function _r(i,t){return i[1]>=i[0]&&i[1]i[1])return[null,null];const r=Vs(i);if(t){if(r===2)return[i,null];const l=Math.floor(r/2);return[[i[0],i[0]+l],[i[0]+l,i[1]]]}if(r===1)return[i,null];const s=Math.floor(r/2)-1;return[[i[0],i[0]+s],[i[0]+s+1,i[1]]]}function Va(i,t){if(!_r(t,i.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let s=t[0];s<=t[1];++s)Hr(r,i[s]);return r}function Na(i){const t=[1/0,1/0,-1/0,-1/0];for(const r of i)for(const s of r)Hr(t,s);return t}function Ns(i){return i[0]!==-1/0&&i[1]!==-1/0&&i[2]!==1/0&&i[3]!==1/0}function ja(i,t,r){if(!Ns(i)||!Ns(t))return NaN;let s=0,l=0;return i[2]t[2]&&(s=i[0]-t[2]),i[1]>t[3]&&(l=i[1]-t[3]),i[3]=s)return s;if(kr(l,u)){if(js(i,t))return 0}else if(js(t,i))return 0;let d=1/0;for(const f of i)for(let _=0,x=f.length,v=x-1;_0;){const _=d.pop();if(_[0]>=u)continue;const x=_[1],v=t?50:100;if(Vs(x)<=v){if(!_r(x,i.length))return NaN;if(t){const w=Ze(i,x,r,s);if(isNaN(w)||w===0)return w;u=Math.min(u,w)}else for(let w=x[0];w<=x[1];++w){const I=ec(i[w],r,s);if(u=Math.min(u,I),u===0)return 0}}else{const w=Oa(x,t);at(d,u,s,i,f,w[0]),at(d,u,s,i,f,w[1])}}return u}function as(i,t,r,s,l,u=1/0){let d=Math.min(u,l.distance(i[0],r[0]));if(d===0)return d;const f=new Ho([[0,[0,i.length-1],[0,r.length-1]]],Yo);for(;f.length>0;){const _=f.pop();if(_[0]>=d)continue;const x=_[1],v=_[2],w=t?50:100,I=s?50:100;if(Vs(x)<=w&&Vs(v)<=I){if(!_r(x,i.length)&&_r(v,r.length))return NaN;let M;if(t&&s)M=Ql(i,x,r,v,l),d=Math.min(d,M);else if(t&&!s){const k=i.slice(x[0],x[1]+1);for(let z=v[0];z<=v[1];++z)if(M=Wr(r[z],k,l),d=Math.min(d,M),d===0)return d}else if(!t&&s){const k=r.slice(v[0],v[1]+1);for(let z=x[0];z<=x[1];++z)if(M=Wr(i[z],k,l),d=Math.min(d,M),d===0)return d}else M=bt(i,x,r,v,l),d=Math.min(d,M)}else{const M=Oa(x,t),k=Oa(v,s);Kr(f,d,l,i,r,M[0],k[0]),Kr(f,d,l,i,r,M[0],k[1]),Kr(f,d,l,i,r,M[1],k[0]),Kr(f,d,l,i,r,M[1],k[1])}}return d}function $a(i){return i.type==="MultiPolygon"?i.coordinates.map(t=>({type:"Polygon",coordinates:t})):i.type==="MultiLineString"?i.coordinates.map(t=>({type:"LineString",coordinates:t})):i.type==="MultiPoint"?i.coordinates.map(t=>({type:"Point",coordinates:t})):[i]}class Jr{constructor(t,r){this.type=_e,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(qr(t[1])){const s=t[1];if(s.type==="FeatureCollection")return new Jr(s,s.features.map(l=>$a(l.geometry)).flat());if(s.type==="Feature")return new Jr(s,$a(s.geometry));if("type"in s&&"coordinates"in s)return new Jr(s,$a(s))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(r,s){const l=r.geometry(),u=l.flat().map(_=>Ra([_.x,_.y],r.canonical));if(l.length===0)return NaN;const d=new Fa(u[0][1]);let f=1/0;for(const _ of s){switch(_.type){case"Point":f=Math.min(f,as(u,!1,[_.coordinates],!1,d,f));break;case"LineString":f=Math.min(f,as(u,!1,_.coordinates,!0,d,f));break;case"Polygon":f=Math.min(f,ss(u,!1,_.coordinates,d,f))}if(f===0)return f}return f}(t,this.geometries);if(t.geometryType()==="LineString")return function(r,s){const l=r.geometry(),u=l.flat().map(_=>Ra([_.x,_.y],r.canonical));if(l.length===0)return NaN;const d=new Fa(u[0][1]);let f=1/0;for(const _ of s){switch(_.type){case"Point":f=Math.min(f,as(u,!0,[_.coordinates],!1,d,f));break;case"LineString":f=Math.min(f,as(u,!0,_.coordinates,!0,d,f));break;case"Polygon":f=Math.min(f,ss(u,!0,_.coordinates,d,f))}if(f===0)return f}return f}(t,this.geometries);if(t.geometryType()==="Polygon")return function(r,s){const l=r.geometry();if(l.length===0||l[0].length===0)return NaN;const u=Os(l,0).map(_=>_.map(x=>x.map(v=>Ra([v.x,v.y],r.canonical)))),d=new Fa(u[0][0][0][1]);let f=1/0;for(const _ of s)for(const x of u){switch(_.type){case"Point":f=Math.min(f,ss([_.coordinates],!1,x,d,f));break;case"LineString":f=Math.min(f,ss(_.coordinates,!0,x,d,f));break;case"Polygon":f=Math.min(f,ht(x,_.coordinates,d,f))}if(f===0)return f}return f}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const xn={"==":Ul,"!=":Oo,">":$l,"<":Vo,">=":No,"<=":ql,array:Fi,at:Ca,boolean:Fi,case:zs,coalesce:Ls,collator:rs,format:Bs,image:Da,in:ka,"index-of":mn,interpolate:ri,"interpolate-hcl":ri,"interpolate-lab":ri,length:La,let:Cr,literal:Bi,match:za,number:Fi,"number-format":Ea,object:Fi,slice:ts,step:_n,string:Fi,"to-boolean":Oi,"to-color":Oi,"to-number":Oi,"to-string":Oi,var:tt,within:Xr,distance:Jr};class Ti{constructor(t,r,s,l){this.name=t,this.type=r,this._evaluate=s,this.args=l}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){const s=t[0],l=Ti.definitions[s];if(!l)return r.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0);const u=Array.isArray(l)?l[0]:l.type,d=Array.isArray(l)?[[l[1],l[2]]]:l.overloads,f=d.filter(([x])=>!Array.isArray(x)||x.length===t.length-1);let _=null;for(const[x,v]of f){_=new Zr(r.registry,os,r.path,null,r.scope);const w=[];let I=!1;for(let M=1;M{return I=w,Array.isArray(I)?`(${I.map(P).join(", ")})`:`(${P(I.type)}...)`;var I}).join(" | "),v=[];for(let w=1;w{r=t?r&&os(s):r&&s instanceof Bi}),!!r&&ls(i)&&cs(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function ls(i){if(i instanceof Ti&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof Xr||i instanceof Jr)return!1;let t=!0;return i.eachChild(r=>{t&&!ls(r)&&(t=!1)}),t}function vn(i){if(i instanceof Ti&&i.name==="feature-state")return!1;let t=!0;return i.eachChild(r=>{t&&!vn(r)&&(t=!1)}),t}function cs(i,t){if(i instanceof Ti&&t.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(s=>{r&&!cs(s,t)&&(r=!1)}),r}function Us(i){return{result:"success",value:i}}function bn(i){return{result:"error",value:i}}function wn(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Qo(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Ha(i){return!!i.expression&&i.expression.interpolated}function Ye(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function $s(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function tc(i){return i}function el(i,t){const r=t.type==="color",s=i.stops&&typeof i.stops[0][0]=="object",l=s||!(s||i.property!==void 0),u=i.type||(Ha(t)?"exponential":"interval");if(r||t.type==="padding"){const v=r?nt.parse:pi.parse;(i=er({},i)).stops&&(i.stops=i.stops.map(w=>[w[0],v(w[1])])),i.default=v(i.default?i.default:t.default)}if(i.colorSpace&&(d=i.colorSpace)!=="rgb"&&d!=="hcl"&&d!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var d;let f,_,x;if(u==="exponential")f=il;else if(u==="interval")f=qs;else if(u==="categorical"){f=tl,_=Object.create(null);for(const v of i.stops)_[v[0]]=v[1];x=typeof i.stops[0][0]}else{if(u!=="identity")throw new Error(`Unknown function type "${u}"`);f=rl}if(s){const v={},w=[];for(let k=0;kk[0]),evaluate:({zoom:k},z)=>il({stops:I,base:i.base},t,k).evaluate(k,z)}}if(l){const v=u==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:v,interpolationFactor:ri.interpolationFactor.bind(void 0,v),zoomStops:i.stops.map(w=>w[0]),evaluate:({zoom:w})=>f(i,t,w,_,x)}}return{kind:"source",evaluate(v,w){const I=w&&w.properties?w.properties[i.property]:void 0;return I===void 0?Tn(i.default,t.default):f(i,t,I,_,x)}}}function Tn(i,t,r){return i!==void 0?i:t!==void 0?t:r!==void 0?r:void 0}function tl(i,t,r,s,l){return Tn(typeof r===l?s[r]:void 0,i.default,t.default)}function qs(i,t,r){if(Ye(r)!=="number")return Tn(i.default,t.default);const s=i.stops.length;if(s===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[s-1][0])return i.stops[s-1][1];const l=Es(i.stops.map(u=>u[0]),r);return i.stops[l][1]}function il(i,t,r){const s=i.base!==void 0?i.base:1;if(Ye(r)!=="number")return Tn(i.default,t.default);const l=i.stops.length;if(l===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[l-1][0])return i.stops[l-1][1];const u=Es(i.stops.map(v=>v[0]),r),d=function(v,w,I,M){const k=M-I,z=v-I;return k===0?0:w===1?z/k:(Math.pow(w,z)-1)/(Math.pow(w,k)-1)}(r,s,i.stops[u][0],i.stops[u+1][0]),f=i.stops[u][1],_=i.stops[u+1][1],x=ii[t.type]||tc;return typeof f.evaluate=="function"?{evaluate(...v){const w=f.evaluate.apply(void 0,v),I=_.evaluate.apply(void 0,v);if(w!==void 0&&I!==void 0)return x(w,I,d,i.colorSpace)}}:x(f,_,d,i.colorSpace)}function rl(i,t,r){switch(t.type){case"color":r=nt.parse(r);break;case"formatted":r=di.fromString(r.toString());break;case"resolvedImage":r=fi.fromString(r.toString());break;case"padding":r=pi.parse(r);break;default:Ye(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0)}return Tn(r,i.default,t.default)}Ti.register(xn,{error:[{kind:"error"},[$e],(i,[t])=>{throw new St(t.evaluate(i))}],typeof:[$e,[Ne],(i,[t])=>P(At(t.evaluate(i)))],"to-rgba":[A(_e,4),[ti],(i,[t])=>{const[r,s,l,u]=t.evaluate(i).rgb;return[255*r,255*s,255*l,u]}],rgb:[ti,[_e,_e,_e],qa],rgba:[ti,[_e,_e,_e,_e],qa],has:{type:Be,overloads:[[[$e],(i,[t])=>Za(t.evaluate(i),i.properties())],[[$e,Ri],(i,[t,r])=>Za(t.evaluate(i),r.evaluate(i))]]},get:{type:Ne,overloads:[[[$e],(i,[t])=>Ga(t.evaluate(i),i.properties())],[[$e,Ri],(i,[t,r])=>Ga(t.evaluate(i),r.evaluate(i))]]},"feature-state":[Ne,[$e],(i,[t])=>Ga(t.evaluate(i),i.featureState||{})],properties:[Ri,[],i=>i.properties()],"geometry-type":[$e,[],i=>i.geometryType()],id:[Ne,[],i=>i.id()],zoom:[_e,[],i=>i.globals.zoom],"heatmap-density":[_e,[],i=>i.globals.heatmapDensity||0],"line-progress":[_e,[],i=>i.globals.lineProgress||0],accumulated:[Ne,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[_e,Yr(_e),(i,t)=>{let r=0;for(const s of t)r+=s.evaluate(i);return r}],"*":[_e,Yr(_e),(i,t)=>{let r=1;for(const s of t)r*=s.evaluate(i);return r}],"-":{type:_e,overloads:[[[_e,_e],(i,[t,r])=>t.evaluate(i)-r.evaluate(i)],[[_e],(i,[t])=>-t.evaluate(i)]]},"/":[_e,[_e,_e],(i,[t,r])=>t.evaluate(i)/r.evaluate(i)],"%":[_e,[_e,_e],(i,[t,r])=>t.evaluate(i)%r.evaluate(i)],ln2:[_e,[],()=>Math.LN2],pi:[_e,[],()=>Math.PI],e:[_e,[],()=>Math.E],"^":[_e,[_e,_e],(i,[t,r])=>Math.pow(t.evaluate(i),r.evaluate(i))],sqrt:[_e,[_e],(i,[t])=>Math.sqrt(t.evaluate(i))],log10:[_e,[_e],(i,[t])=>Math.log(t.evaluate(i))/Math.LN10],ln:[_e,[_e],(i,[t])=>Math.log(t.evaluate(i))],log2:[_e,[_e],(i,[t])=>Math.log(t.evaluate(i))/Math.LN2],sin:[_e,[_e],(i,[t])=>Math.sin(t.evaluate(i))],cos:[_e,[_e],(i,[t])=>Math.cos(t.evaluate(i))],tan:[_e,[_e],(i,[t])=>Math.tan(t.evaluate(i))],asin:[_e,[_e],(i,[t])=>Math.asin(t.evaluate(i))],acos:[_e,[_e],(i,[t])=>Math.acos(t.evaluate(i))],atan:[_e,[_e],(i,[t])=>Math.atan(t.evaluate(i))],min:[_e,Yr(_e),(i,t)=>Math.min(...t.map(r=>r.evaluate(i)))],max:[_e,Yr(_e),(i,t)=>Math.max(...t.map(r=>r.evaluate(i)))],abs:[_e,[_e],(i,[t])=>Math.abs(t.evaluate(i))],round:[_e,[_e],(i,[t])=>{const r=t.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[_e,[_e],(i,[t])=>Math.floor(t.evaluate(i))],ceil:[_e,[_e],(i,[t])=>Math.ceil(t.evaluate(i))],"filter-==":[Be,[$e,Ne],(i,[t,r])=>i.properties()[t.value]===r.value],"filter-id-==":[Be,[Ne],(i,[t])=>i.id()===t.value],"filter-type-==":[Be,[$e],(i,[t])=>i.geometryType()===t.value],"filter-<":[Be,[$e,Ne],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s{const r=i.id(),s=t.value;return typeof r==typeof s&&r":[Be,[$e,Ne],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s>l}],"filter-id->":[Be,[Ne],(i,[t])=>{const r=i.id(),s=t.value;return typeof r==typeof s&&r>s}],"filter-<=":[Be,[$e,Ne],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s<=l}],"filter-id-<=":[Be,[Ne],(i,[t])=>{const r=i.id(),s=t.value;return typeof r==typeof s&&r<=s}],"filter->=":[Be,[$e,Ne],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s>=l}],"filter-id->=":[Be,[Ne],(i,[t])=>{const r=i.id(),s=t.value;return typeof r==typeof s&&r>=s}],"filter-has":[Be,[Ne],(i,[t])=>t.value in i.properties()],"filter-has-id":[Be,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Be,[A($e)],(i,[t])=>t.value.indexOf(i.geometryType())>=0],"filter-id-in":[Be,[A(Ne)],(i,[t])=>t.value.indexOf(i.id())>=0],"filter-in-small":[Be,[$e,A(Ne)],(i,[t,r])=>r.value.indexOf(i.properties()[t.value])>=0],"filter-in-large":[Be,[$e,A(Ne)],(i,[t,r])=>function(s,l,u,d){for(;u<=d;){const f=u+d>>1;if(l[f]===s)return!0;l[f]>s?d=f-1:u=f+1}return!1}(i.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Be,overloads:[[[Be,Be],(i,[t,r])=>t.evaluate(i)&&r.evaluate(i)],[Yr(Be),(i,t)=>{for(const r of t)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Be,overloads:[[[Be,Be],(i,[t,r])=>t.evaluate(i)||r.evaluate(i)],[Yr(Be),(i,t)=>{for(const r of t)if(r.evaluate(i))return!0;return!1}]]},"!":[Be,[Be],(i,[t])=>!t.evaluate(i)],"is-supported-script":[Be,[$e],(i,[t])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(t.evaluate(i))}],upcase:[$e,[$e],(i,[t])=>t.evaluate(i).toUpperCase()],downcase:[$e,[$e],(i,[t])=>t.evaluate(i).toLowerCase()],concat:[$e,Yr(Ne),(i,t)=>t.map(r=>es(r.evaluate(i))).join("")],"resolved-locale":[$e,[ir],(i,[t])=>t.evaluate(i).resolvedLocale()]});class Zs{constructor(t,r){var s;this.expression=t,this._warningHistory={},this._evaluator=new ks,this._defaultValue=r?(s=r).type==="color"&&$s(s.default)?new nt(0,0,0,0):s.type==="color"?nt.parse(s.default)||null:s.type==="padding"?pi.parse(s.default)||null:s.type==="variableAnchorOffsetCollection"?wi.parse(s.default)||null:s.default===void 0?null:s.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(t,r,s,l,u,d){return this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=s,this._evaluator.canonical=l,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(t,r,s,l,u,d){this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=s||null,this._evaluator.canonical=l,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d||null;try{const f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new St(`Expected value to be one of ${Object.keys(this._enumValues).map(_=>JSON.stringify(_)).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function Gs(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in xn}function Sn(i,t){const r=new Zr(xn,os,[],t?function(l){const u={color:ti,string:$e,number:_e,enum:$e,boolean:Be,formatted:mr,padding:Mr,resolvedImage:rr,variableAnchorOffsetCollection:N};return l.type==="array"?A(u[l.value]||Ne,l.length):u[l.type]}(t):void 0),s=r.parse(i,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?Us(new Zs(s,t)):bn(r.errors)}class In{constructor(t,r){this.kind=t,this._styleExpression=r,this.isStateDependent=t!=="constant"&&!vn(r.expression)}evaluateWithoutErrorHandling(t,r,s,l,u,d){return this._styleExpression.evaluateWithoutErrorHandling(t,r,s,l,u,d)}evaluate(t,r,s,l,u,d){return this._styleExpression.evaluate(t,r,s,l,u,d)}}class Pn{constructor(t,r,s,l){this.kind=t,this.zoomStops=s,this._styleExpression=r,this.isStateDependent=t!=="camera"&&!vn(r.expression),this.interpolationType=l}evaluateWithoutErrorHandling(t,r,s,l,u,d){return this._styleExpression.evaluateWithoutErrorHandling(t,r,s,l,u,d)}evaluate(t,r,s,l,u,d){return this._styleExpression.evaluate(t,r,s,l,u,d)}interpolationFactor(t,r,s){return this.interpolationType?ri.interpolationFactor(this.interpolationType,t,r,s):0}}function Xa(i,t){const r=Sn(i,t);if(r.result==="error")return r;const s=r.value.expression,l=ls(s);if(!l&&!wn(t))return bn([new Xt("","data expressions not supported")]);const u=cs(s,["zoom"]);if(!u&&!Qo(t))return bn([new Xt("","zoom expressions not supported")]);const d=hs(s);return d||u?d instanceof Xt?bn([d]):d instanceof ri&&!Ha(t)?bn([new Xt("",'"interpolate" expressions cannot be used with this property')]):Us(d?new Pn(l?"camera":"composite",r.value,d.labels,d instanceof ri?d.interpolation:void 0):new In(l?"constant":"source",r.value)):bn([new Xt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class An{constructor(t,r){this._parameters=t,this._specification=r,er(this,el(this._parameters,this._specification))}static deserialize(t){return new An(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function hs(i){let t=null;if(i instanceof Cr)t=hs(i.result);else if(i instanceof Ls){for(const r of i.args)if(t=hs(r),t)break}else(i instanceof _n||i instanceof ri)&&i.input instanceof Ti&&i.input.name==="zoom"&&(t=i);return t instanceof Xt||i.eachChild(r=>{const s=hs(r);s instanceof Xt?t=s:!t&&s?t=new Xt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&s&&t!==s&&(t=new Xt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function Hs(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const t of i.slice(1))if(!Hs(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const Xs={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Wa(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Hs(i)||(i=Ws(i));const t=Sn(i,Xs);if(t.result==="error")throw new Error(t.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,s,l)=>t.value.evaluate(r,s,{},l),needGeometry:nl(i)}}function ic(i,t){return it?1:0}function nl(i){if(!Array.isArray(i))return!1;if(i[0]==="within"||i[0]==="distance")return!0;for(let t=1;t"||t==="<="||t===">="?Ka(i[1],i[2],t):t==="any"?(r=i.slice(1),["any"].concat(r.map(Ws))):t==="all"?["all"].concat(i.slice(1).map(Ws)):t==="none"?["all"].concat(i.slice(1).map(Ws).map(Ot)):t==="in"?us(i[1],i.slice(2)):t==="!in"?Ot(us(i[1],i.slice(2))):t==="has"?ds(i[1]):t!=="!has"||Ot(ds(i[1]));var r}function Ka(i,t,r){switch(i){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,i,t]}}function us(i,t){if(t.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(r=>typeof r!=typeof t[0])?["filter-in-large",i,["literal",t.sort(ic)]]:["filter-in-small",i,["literal",t]]}}function ds(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Ot(i){return["!",i]}function Qr(i){const t=typeof i;if(t==="number"||t==="boolean"||t==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let l="[";for(const u of i)l+=`${Qr(u)},`;return`${l}]`}const r=Object.keys(i).sort();let s="{";for(let l=0;ls.maximum?[new ue(t,r,`${r} is greater than the maximum value ${s.maximum}`)]:[]}function Ks(i){const t=i.valueSpec,r=wt(i.value.type);let s,l,u,d={};const f=r!=="categorical"&&i.value.property===void 0,_=!f,x=Ye(i.value.stops)==="array"&&Ye(i.value.stops[0])==="array"&&Ye(i.value.stops[0][0])==="object",v=mi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(M){if(r==="identity")return[new ue(M.key,M.value,'identity function may not have a "stops" property')];let k=[];const z=M.value;return k=k.concat(ps({key:M.key,value:z,valueSpec:M.valueSpec,validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec,arrayElementValidator:w})),Ye(z)==="array"&&z.length===0&&k.push(new ue(M.key,z,"array must have at least one stop")),k},default:function(M){return M.validateSpec({key:M.key,value:M.value,valueSpec:t,validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec})}}});return r==="identity"&&f&&v.push(new ue(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||v.push(new ue(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Ha(i.valueSpec)&&v.push(new ue(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(_&&!wn(i.valueSpec)?v.push(new ue(i.key,i.value,"property functions not supported")):f&&!Qo(i.valueSpec)&&v.push(new ue(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||v.push(new ue(i.key,i.value,'"property" property is required')),v;function w(M){let k=[];const z=M.value,F=M.key;if(Ye(z)!=="array")return[new ue(F,z,`array expected, ${Ye(z)} found`)];if(z.length!==2)return[new ue(F,z,`array length 2 expected, length ${z.length} found`)];if(x){if(Ye(z[0])!=="object")return[new ue(F,z,`object expected, ${Ye(z[0])} found`)];if(z[0].zoom===void 0)return[new ue(F,z,"object stop key must have zoom")];if(z[0].value===void 0)return[new ue(F,z,"object stop key must have value")];if(u&&u>wt(z[0].zoom))return[new ue(F,z[0].zoom,"stop zoom values must appear in ascending order")];wt(z[0].zoom)!==u&&(u=wt(z[0].zoom),l=void 0,d={}),k=k.concat(mi({key:`${F}[0]`,value:z[0],valueSpec:{zoom:{}},validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec,objectElementValidators:{zoom:Ja,value:I}}))}else k=k.concat(I({key:`${F}[0]`,value:z[0],valueSpec:{},validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec},z));return Gs(Vi(z[1]))?k.concat([new ue(`${F}[1]`,z[1],"expressions are not allowed in function stops.")]):k.concat(M.validateSpec({key:`${F}[1]`,value:z[1],valueSpec:t,validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec}))}function I(M,k){const z=Ye(M.value),F=wt(M.value),j=M.value!==null?M.value:k;if(s){if(z!==s)return[new ue(M.key,j,`${z} stop domain type must match previous stop domain type ${s}`)]}else s=z;if(z!=="number"&&z!=="string"&&z!=="boolean")return[new ue(M.key,j,"stop domain value must be a number, string, or boolean")];if(z!=="number"&&r!=="categorical"){let Q=`number expected, ${z} found`;return wn(t)&&r===void 0&&(Q+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ue(M.key,j,Q)]}return r!=="categorical"||z!=="number"||isFinite(F)&&Math.floor(F)===F?r!=="categorical"&&z==="number"&&l!==void 0&&Fnew ue(`${i.key}${s.key}`,i.value,s.message));const r=t.value.expression||t.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new ue(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!vn(r))return[new ue(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!vn(r))return[new ue(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!cs(r,["zoom","feature-state"]))return[new ue(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!ls(r))return[new ue(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function gr(i){const t=i.key,r=i.value,s=i.valueSpec,l=[];return Array.isArray(s.values)?s.values.indexOf(wt(r))===-1&&l.push(new ue(t,r,`expected one of [${s.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(s.values).indexOf(wt(r))===-1&&l.push(new ue(t,r,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(r)} found`)),l}function Ya(i){return Hs(Vi(i.value))?Mn(er({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Js(i)}function Js(i){const t=i.value,r=i.key;if(Ye(t)!=="array")return[new ue(r,t,`array expected, ${Ye(t)} found`)];const s=i.styleSpec;let l,u=[];if(t.length<1)return[new ue(r,t,"filter array must have at least 1 element")];switch(u=u.concat(gr({key:`${r}[0]`,value:t[0],valueSpec:s.filter_operator,style:i.style,styleSpec:i.styleSpec})),wt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&wt(t[1])==="$type"&&u.push(new ue(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&u.push(new ue(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(l=Ye(t[1]),l!=="string"&&u.push(new ue(`${r}[1]`,t[1],`string expected, ${l} found`)));for(let d=2;d{x in r&&t.push(new ue(s,r[x],`"${x}" is prohibited for ref layers`))}),l.layers.forEach(x=>{wt(x.id)===f&&(_=x)}),_?_.ref?t.push(new ue(s,r.ref,"ref cannot reference another ref layer")):d=wt(_.type):t.push(new ue(s,r.ref,`ref layer "${f}" not found`))}else if(d!=="background")if(r.source){const _=l.sources&&l.sources[r.source],x=_&&wt(_.type);_?x==="vector"&&d==="raster"?t.push(new ue(s,r.source,`layer "${r.id}" requires a raster source`)):x!=="raster-dem"&&d==="hillshade"?t.push(new ue(s,r.source,`layer "${r.id}" requires a raster-dem source`)):x==="raster"&&d!=="raster"?t.push(new ue(s,r.source,`layer "${r.id}" requires a vector source`)):x!=="vector"||r["source-layer"]?x==="raster-dem"&&d!=="hillshade"?t.push(new ue(s,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):d!=="line"||!r.paint||!r.paint["line-gradient"]||x==="geojson"&&_.lineMetrics||t.push(new ue(s,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ue(s,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new ue(s,r.source,`source "${r.source}" not found`))}else t.push(new ue(s,r,'missing required property "source"'));return t=t.concat(mi({key:s,value:r,valueSpec:u.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${s}.type`,value:r.type,valueSpec:u.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:Ya,layout:_=>mi({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>eo(er({layerType:d},x))}}),paint:_=>mi({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>Ys(er({layerType:d},x))}})}})),t}function en(i){const t=i.value,r=i.key,s=Ye(t);return s!=="string"?[new ue(r,t,`string expected, ${s} found`)]:[]}const Qs={promoteId:function({key:i,value:t}){if(Ye(t)==="string")return en({key:i,value:t});{const r=[];for(const s in t)r.push(...en({key:`${i}.${s}`,value:t[s]}));return r}}};function fs(i){const t=i.value,r=i.key,s=i.styleSpec,l=i.style,u=i.validateSpec;if(!t.type)return[new ue(r,t,'"type" is required')];const d=wt(t.type);let f;switch(d){case"vector":case"raster":return f=mi({key:r,value:t,valueSpec:s[`source_${d.replace("-","_")}`],style:i.style,styleSpec:s,objectElementValidators:Qs,validateSpec:u}),f;case"raster-dem":return f=function(_){var x;const v=(x=_.sourceName)!==null&&x!==void 0?x:"",w=_.value,I=_.styleSpec,M=I.source_raster_dem,k=_.style;let z=[];const F=Ye(w);if(w===void 0)return z;if(F!=="object")return z.push(new ue("source_raster_dem",w,`object expected, ${F} found`)),z;const j=wt(w.encoding)==="custom",Q=["redFactor","greenFactor","blueFactor","baseShift"],G=_.value.encoding?`"${_.value.encoding}"`:"Default";for(const J in w)!j&&Q.includes(J)?z.push(new ue(J,w[J],`In "${v}": "${J}" is only valid when "encoding" is set to "custom". ${G} encoding found`)):M[J]?z=z.concat(_.validateSpec({key:J,value:w[J],valueSpec:M[J],validateSpec:_.validateSpec,style:k,styleSpec:I})):z.push(new ue(J,w[J],`unknown property "${J}"`));return z}({sourceName:r,value:t,style:i.style,styleSpec:s,validateSpec:u}),f;case"geojson":if(f=mi({key:r,value:t,valueSpec:s.source_geojson,style:l,styleSpec:s,validateSpec:u,objectElementValidators:Qs}),t.cluster)for(const _ in t.clusterProperties){const[x,v]=t.clusterProperties[_],w=typeof x=="string"?[x,["accumulated"],["get",_]]:x;f.push(...Mn({key:`${r}.${_}.map`,value:v,validateSpec:u,expressionContext:"cluster-map"})),f.push(...Mn({key:`${r}.${_}.reduce`,value:w,validateSpec:u,expressionContext:"cluster-reduce"}))}return f;case"video":return mi({key:r,value:t,valueSpec:s.source_video,style:l,validateSpec:u,styleSpec:s});case"image":return mi({key:r,value:t,valueSpec:s.source_image,style:l,validateSpec:u,styleSpec:s});case"canvas":return[new ue(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return gr({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:l,validateSpec:u,styleSpec:s})}}function io(i){const t=i.value,r=i.styleSpec,s=r.light,l=i.style;let u=[];const d=Ye(t);if(t===void 0)return u;if(d!=="object")return u=u.concat([new ue("light",t,`object expected, ${d} found`)]),u;for(const f in t){const _=f.match(/^(.*)-transition$/);u=u.concat(_&&s[_[1]]&&s[_[1]].transition?i.validateSpec({key:f,value:t[f],valueSpec:r.transition,validateSpec:i.validateSpec,style:l,styleSpec:r}):s[f]?i.validateSpec({key:f,value:t[f],valueSpec:s[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new ue(f,t[f],`unknown property "${f}"`)])}return u}function ro(i){const t=i.value,r=i.styleSpec,s=r.sky,l=i.style,u=Ye(t);if(t===void 0)return[];if(u!=="object")return[new ue("sky",t,`object expected, ${u} found`)];let d=[];for(const f in t)d=d.concat(s[f]?i.validateSpec({key:f,value:t[f],valueSpec:s[f],style:l,styleSpec:r}):[new ue(f,t[f],`unknown property "${f}"`)]);return d}function no(i){const t=i.value,r=i.styleSpec,s=r.terrain,l=i.style;let u=[];const d=Ye(t);if(t===void 0)return u;if(d!=="object")return u=u.concat([new ue("terrain",t,`object expected, ${d} found`)]),u;for(const f in t)u=u.concat(s[f]?i.validateSpec({key:f,value:t[f],valueSpec:s[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new ue(f,t[f],`unknown property "${f}"`)]);return u}function so(i){let t=[];const r=i.value,s=i.key;if(Array.isArray(r)){const l=[],u=[];for(const d in r)r[d].id&&l.includes(r[d].id)&&t.push(new ue(s,r,`all the sprites' ids must be unique, but ${r[d].id} is duplicated`)),l.push(r[d].id),r[d].url&&u.includes(r[d].url)&&t.push(new ue(s,r,`all the sprites' URLs must be unique, but ${r[d].url} is duplicated`)),u.push(r[d].url),t=t.concat(mi({key:`${s}[${d}]`,value:r[d],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return t}return en({key:s,value:r})}const ea={"*":()=>[],array:ps,boolean:function(i){const t=i.value,r=i.key,s=Ye(t);return s!=="boolean"?[new ue(r,t,`boolean expected, ${s} found`)]:[]},number:Ja,color:function(i){const t=i.key,r=i.value,s=Ye(r);return s!=="string"?[new ue(t,r,`color expected, ${s} found`)]:nt.parse(String(r))?[]:[new ue(t,r,`color expected, "${r}" found`)]},constants:al,enum:gr,filter:Ya,function:Ks,layer:to,object:mi,source:fs,light:io,sky:ro,terrain:no,projection:function(i){const t=i.value,r=i.styleSpec,s=r.projection,l=i.style,u=Ye(t);if(t===void 0)return[];if(u!=="object")return[new ue("projection",t,`object expected, ${u} found`)];let d=[];for(const f in t)d=d.concat(s[f]?i.validateSpec({key:f,value:t[f],valueSpec:s[f],style:l,styleSpec:r}):[new ue(f,t[f],`unknown property "${f}"`)]);return d},string:en,formatted:function(i){return en(i).length===0?[]:Mn(i)},resolvedImage:function(i){return en(i).length===0?[]:Mn(i)},padding:function(i){const t=i.key,r=i.value;if(Ye(r)==="array"){if(r.length<1||r.length>4)return[new ue(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];const s={type:"number"};let l=[];for(let u=0;u[]}})),i.constants&&(r=r.concat(al({key:"constants",value:i.constants,style:i,styleSpec:t,validateSpec:Cn}))),ao(r)}function sr(i){return function(t){return i({...t,validateSpec:Cn})}}function ao(i){return[].concat(i).sort((t,r)=>t.line-r.line)}function Ni(i){return function(...t){return ao(i.apply(this,t))}}Si.source=Ni(sr(fs)),Si.sprite=Ni(sr(so)),Si.glyphs=Ni(sr(ol)),Si.light=Ni(sr(io)),Si.sky=Ni(sr(ro)),Si.terrain=Ni(sr(no)),Si.layer=Ni(sr(to)),Si.filter=Ni(sr(Ya)),Si.paintProperty=Ni(sr(Ys)),Si.layoutProperty=Ni(sr(eo));const tn=Si,rc=tn.light,nc=tn.sky,ll=tn.paintProperty,cl=tn.layoutProperty;function oo(i,t){let r=!1;if(t&&t.length)for(const s of t)i.fire(new Ir(new Error(s.message))),r=!0;return r}class kn{constructor(t,r,s){const l=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const d=new Int32Array(this.arrayBuffer);t=d[0],this.d=(r=d[1])+2*(s=d[2]);for(let _=0;_=w[k+0]&&l>=w[k+1])?(f[M]=!0,d.push(v[M])):f[M]=!1}}}}_forEachCell(t,r,s,l,u,d,f,_){const x=this._convertToCellCoord(t),v=this._convertToCellCoord(r),w=this._convertToCellCoord(s),I=this._convertToCellCoord(l);for(let M=x;M<=w;M++)for(let k=v;k<=I;k++){const z=this.d*k+M;if((!_||_(this._convertFromCellCoord(M),this._convertFromCellCoord(k),this._convertFromCellCoord(M+1),this._convertFromCellCoord(k+1)))&&u.call(this,t,r,s,l,z,d,f,_))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,r=3+this.cells.length+1+1;let s=0;for(let d=0;d=0)continue;const d=i[u];l[u]=Ii[r].shallow.indexOf(u)>=0?d:zn(d,t)}i instanceof Error&&(l.message=i.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(l.$name=r),l}function En(i){if(hl(i))return i;if(Array.isArray(i))return i.map(En);if(typeof i!="object")throw new Error("can't deserialize object of type "+typeof i);const t=lo(i)||"Object";if(!Ii[t])throw new Error(`can't deserialize unregistered class ${t}`);const{klass:r}=Ii[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(i);const s=Object.create(r.prototype);for(const l of Object.keys(i)){if(l==="$name")continue;const u=i[l];s[l]=Ii[t].shallow.indexOf(l)>=0?u:En(u)}return s}class co{constructor(){this.first=!0}update(t,r){const s=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=s,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=s,!0):(this.lastFloorZoom>s?(this.lastIntegerZoom=s+1,this.lastIntegerZoomTime=r):this.lastFloorZoomi>=128&&i<=255,"Hangul Jamo":i=>i>=4352&&i<=4607,Khmer:i=>i>=6016&&i<=6143,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Katakana:i=>i>=12448&&i<=12543,Kanbun:i=>i>=12688&&i<=12703,"CJK Strokes":i=>i>=12736&&i<=12783,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"Private Use Area":i=>i>=57344&&i<=63743,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function ho(i){for(const t of i)if(po(t.charCodeAt(0)))return!0;return!1}function sc(i){for(const t of i)if(!Dn(t.charCodeAt(0)))return!1;return!0}function uo(i){const t=i.map(r=>{try{return new RegExp(`\\p{sc=${r}}`,"u").source}catch{return null}}).filter(r=>r);return new RegExp(t.join("|"),"u")}const ac=uo(["Arab","Dupl","Mong","Ougr","Syrc"]);function Dn(i){return!ac.test(String.fromCodePoint(i))}const ul=uo(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function po(i){return!(i!==746&&i!==747&&(i<4352||!(Xe["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||Xe["CJK Compatibility"](i)||Xe["CJK Strokes"](i)||!(!Xe["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||Xe["Enclosed CJK Letters and Months"](i)||Xe["Ideographic Description Characters"](i)||Xe.Kanbun(i)||Xe.Katakana(i)&&i!==12540||!(!Xe["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!Xe["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||Xe["Vertical Forms"](i)||Xe["Yijing Hexagram Symbols"](i)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(i))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(i))||ul.test(String.fromCodePoint(i)))))}function dl(i){return!(po(i)||function(t){return!!(Xe["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Xe["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Xe["Letterlike Symbols"](t)||Xe["Number Forms"](t)||Xe["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Xe["Control Pictures"](t)&&t!==9251||Xe["Optical Character Recognition"](t)||Xe["Enclosed Alphanumerics"](t)||Xe["Geometric Shapes"](t)||Xe["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Xe["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Xe["CJK Symbols and Punctuation"](t)||Xe.Katakana(t)||Xe["Private Use Area"](t)||Xe["CJK Compatibility Forms"](t)||Xe["Small Form Variants"](t)||Xe["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(i))}const oc=uo(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function fo(i){return oc.test(String.fromCodePoint(i))}function lc(i,t){return!(!t&&fo(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||Xe.Khmer(i))}function cc(i){for(const t of i)if(fo(t.charCodeAt(0)))return!0;return!1}const _i=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(i){this.pluginStatus=i.pluginStatus,this.pluginURL=i.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(i){this.applyArabicShaping=i.applyArabicShaping,this.processBidirectionalText=i.processBidirectionalText,this.processStyledBidirectionalText=i.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class dt{constructor(t,r){this.zoom=t,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new co,this.transition={})}isSupportedScript(t){return function(r,s){for(const l of r)if(!lc(l.charCodeAt(0),s))return!1;return!0}(t,_i.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,r=t-Math.floor(t),s=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*s}:{fromScale:.5,toScale:1,t:1-(1-s)*r}}}class Ln{constructor(t,r){this.property=t,this.value=r,this.expression=function(s,l){if($s(s))return new An(s,l);if(Gs(s)){const u=Xa(s,l);if(u.result==="error")throw new Error(u.value.map(d=>`${d.key}: ${d.message}`).join(", "));return u.value}{let u=s;return l.type==="color"&&typeof s=="string"?u=nt.parse(s):l.type!=="padding"||typeof s!="number"&&!Array.isArray(s)?l.type==="variableAnchorOffsetCollection"&&Array.isArray(s)&&(u=wi.parse(s)):u=pi.parse(s),{kind:"constant",evaluate:()=>u}}}(r===void 0?t.specification.default:r,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,r,s){return this.property.possiblyEvaluate(this,t,r,s)}}class ia{constructor(t){this.property=t,this.value=new Ln(t,void 0)}transitioned(t,r){return new pl(this.property,this.value,r,vi({},t.transition,this.transition),t.now)}untransitioned(){return new pl(this.property,this.value,null,{},0)}}class ra{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return st(this._values[t].value.value)}setValue(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new ia(this._values[t].property)),this._values[t].value=new Ln(this._values[t].property,r===null?void 0:st(r))}getTransition(t){return st(this._values[t].transition)}setTransition(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new ia(this._values[t].property)),this._values[t].transition=st(r)||void 0}serialize(){const t={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(t[r]=s);const l=this.getTransition(r);l!==void 0&&(t[`${r}-transition`]=l)}return t}transitioned(t,r){const s=new ms(this._properties);for(const l of Object.keys(this._values))s._values[l]=this._values[l].transitioned(t,r._values[l]);return s}untransitioned(){const t=new ms(this._properties);for(const r of Object.keys(this._values))t._values[r]=this._values[r].untransitioned();return t}}class pl{constructor(t,r,s,l,u){this.property=t,this.value=r,this.begin=u+l.delay||0,this.end=this.begin+l.duration||0,t.specification.transition&&(l.delay||l.duration)&&(this.prior=s)}possiblyEvaluate(t,r,s){const l=t.now||0,u=this.value.possiblyEvaluate(t,r,s),d=this.prior;if(d){if(l>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(l=1)return 1;const x=_*_,v=x*_;return 4*(_<.5?v:3*(_-x)+v-.75)}(f))}}return u}}class ms{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,r,s){const l=new gs(this._properties);for(const u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(t,r,s);return l}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class _s{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return this._values[t].value!==void 0}getValue(t){return st(this._values[t].value)}setValue(t,r){this._values[t]=new Ln(this._values[t].property,r===null?void 0:st(r))}serialize(){const t={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(t[r]=s)}return t}possiblyEvaluate(t,r,s){const l=new gs(this._properties);for(const u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(t,r,s);return l}}class ar{constructor(t,r,s){this.property=t,this.value=r,this.parameters=s}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,r,s,l){return this.property.evaluate(this.value,this.parameters,t,r,s,l)}}class gs{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Ae{constructor(t){this.specification=t}possiblyEvaluate(t,r){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(r)}interpolate(t,r,s){const l=ii[this.specification.type];return l?l(t,r,s):t}}class Re{constructor(t,r){this.specification=t,this.overrides=r}possiblyEvaluate(t,r,s,l){return new ar(this,t.expression.kind==="constant"||t.expression.kind==="camera"?{kind:"constant",value:t.expression.evaluate(r,null,{},s,l)}:t.expression,r)}interpolate(t,r,s){if(t.value.kind!=="constant"||r.value.kind!=="constant")return t;if(t.value.value===void 0||r.value.value===void 0)return new ar(this,{kind:"constant",value:void 0},t.parameters);const l=ii[this.specification.type];if(l){const u=l(t.value.value,r.value.value,s);return new ar(this,{kind:"constant",value:u},t.parameters)}return t}evaluate(t,r,s,l,u,d){return t.kind==="constant"?t.value:t.evaluate(r,s,l,u,d)}}class na extends Re{possiblyEvaluate(t,r,s,l){if(t.value===void 0)return new ar(this,{kind:"constant",value:void 0},r);if(t.expression.kind==="constant"){const u=t.expression.evaluate(r,null,{},s,l),d=t.property.specification.type==="resolvedImage"&&typeof u!="string"?u.name:u,f=this._calculate(d,d,d,r);return new ar(this,{kind:"constant",value:f},r)}if(t.expression.kind==="camera"){const u=this._calculate(t.expression.evaluate({zoom:r.zoom-1}),t.expression.evaluate({zoom:r.zoom}),t.expression.evaluate({zoom:r.zoom+1}),r);return new ar(this,{kind:"constant",value:u},r)}return new ar(this,t.expression,r)}evaluate(t,r,s,l,u,d){if(t.kind==="source"){const f=t.evaluate(r,s,l,u,d);return this._calculate(f,f,f,r)}return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(r.zoom)-1},s,l),t.evaluate({zoom:Math.floor(r.zoom)},s,l),t.evaluate({zoom:Math.floor(r.zoom)+1},s,l),r):t.value}_calculate(t,r,s,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:s,to:r}}interpolate(t){return t}}class sa{constructor(t){this.specification=t}possiblyEvaluate(t,r,s,l){if(t.value!==void 0){if(t.expression.kind==="constant"){const u=t.expression.evaluate(r,null,{},s,l);return this._calculate(u,u,u,r)}return this._calculate(t.expression.evaluate(new dt(Math.floor(r.zoom-1),r)),t.expression.evaluate(new dt(Math.floor(r.zoom),r)),t.expression.evaluate(new dt(Math.floor(r.zoom+1),r)),r)}}_calculate(t,r,s,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:s,to:r}}interpolate(t){return t}}class mo{constructor(t){this.specification=t}possiblyEvaluate(t,r,s,l){return!!t.expression.evaluate(r,null,{},s,l)}interpolate(){return!1}}class h{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in t){const s=t[r];s.specification.overridable&&this.overridableProperties.push(r);const l=this.defaultPropertyValues[r]=new Ln(s,void 0),u=this.defaultTransitionablePropertyValues[r]=new ia(s);this.defaultTransitioningPropertyValues[r]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=l.possiblyEvaluate({})}}}Ie("DataDrivenProperty",Re),Ie("DataConstantProperty",Ae),Ie("CrossFadedDataDrivenProperty",na),Ie("CrossFadedProperty",sa),Ie("ColorRampProperty",mo);const e="-transition";class n extends un{constructor(t,r){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new _s(r.layout)),r.paint)){this._transitionablePaint=new ra(r.paint);for(const s in t.paint)this.setPaintProperty(s,t.paint[s],{validate:!1});for(const s in t.layout)this.setLayoutProperty(s,t.layout[s],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new gs(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,r,s={}){r!=null&&this._validate(cl,`layers.${this.id}.layout.${t}`,t,r,s)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,r):this.visibility=r)}getPaintProperty(t){return t.endsWith(e)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,r,s={}){if(r!=null&&this._validate(ll,`layers.${this.id}.paint.${t}`,t,r,s))return!1;if(t.endsWith(e))return this._transitionablePaint.setTransition(t.slice(0,-11),r||void 0),!1;{const l=this._transitionablePaint._values[t],u=l.property.specification["property-type"]==="cross-faded-data-driven",d=l.value.isDataDriven(),f=l.value;this._transitionablePaint.setValue(t,r),this._handleSpecialPaintPropertyUpdate(t);const _=this._transitionablePaint._values[t].value;return _.isDataDriven()||d||u||this._handleOverridablePaintPropertyUpdate(t,f,_)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,r,s){return!1}isHidden(t){return!!(this.minzoom&&t=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,r){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,r)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),Xn(t,(r,s)=>!(r===void 0||s==="layout"&&!Object.keys(r).length||s==="paint"&&!Object.keys(r).length))}_validate(t,r,s,l,u={}){return(!u||u.validate!==!1)&&oo(this,t.call(tn,{key:r,layerType:this.type,objectKey:s,value:l,styleSpec:ie,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const r=this.paint.get(t);if(r instanceof ar&&wn(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const a={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class o{constructor(t,r){this._structArray=t,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class c{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,r){return t._trim(),r&&(t.isTransferred=!0,r.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const r=Object.create(this.prototype);return r.arrayBuffer=t.arrayBuffer,r.length=t.length,r.capacity=t.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function m(i,t=1){let r=0,s=0;return{members:i.map(l=>{const u=a[l.type].BYTES_PER_ELEMENT,d=r=g(r,Math.max(t,u)),f=l.components||1;return s=Math.max(s,u),r+=u*f,{name:l.name,type:l.type,components:f,offset:d}}),size:g(r,Math.max(s,t)),alignment:t}}function g(i,t){return Math.ceil(i/t)*t}class y extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r){const s=this.length;return this.resize(s+1),this.emplace(s,t,r)}emplace(t,r,s){const l=2*t;return this.int16[l+0]=r,this.int16[l+1]=s,t}}y.prototype.bytesPerElement=4,Ie("StructArrayLayout2i4",y);class b extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,s)}emplace(t,r,s,l){const u=3*t;return this.int16[u+0]=r,this.int16[u+1]=s,this.int16[u+2]=l,t}}b.prototype.bytesPerElement=6,Ie("StructArrayLayout3i6",b);class T extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s,l){const u=this.length;return this.resize(u+1),this.emplace(u,t,r,s,l)}emplace(t,r,s,l,u){const d=4*t;return this.int16[d+0]=r,this.int16[d+1]=s,this.int16[d+2]=l,this.int16[d+3]=u,t}}T.prototype.bytesPerElement=8,Ie("StructArrayLayout4i8",T);class S extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,s,l,u,d)}emplace(t,r,s,l,u,d,f){const _=6*t;return this.int16[_+0]=r,this.int16[_+1]=s,this.int16[_+2]=l,this.int16[_+3]=u,this.int16[_+4]=d,this.int16[_+5]=f,t}}S.prototype.bytesPerElement=12,Ie("StructArrayLayout2i4i12",S);class C extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,s,l,u,d)}emplace(t,r,s,l,u,d,f){const _=4*t,x=8*t;return this.int16[_+0]=r,this.int16[_+1]=s,this.uint8[x+4]=l,this.uint8[x+5]=u,this.uint8[x+6]=d,this.uint8[x+7]=f,t}}C.prototype.bytesPerElement=8,Ie("StructArrayLayout2i4ub8",C);class E extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r){const s=this.length;return this.resize(s+1),this.emplace(s,t,r)}emplace(t,r,s){const l=2*t;return this.float32[l+0]=r,this.float32[l+1]=s,t}}E.prototype.bytesPerElement=8,Ie("StructArrayLayout2f8",E);class R extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,u,d,f,_,x,v){const w=this.length;return this.resize(w+1),this.emplace(w,t,r,s,l,u,d,f,_,x,v)}emplace(t,r,s,l,u,d,f,_,x,v,w){const I=10*t;return this.uint16[I+0]=r,this.uint16[I+1]=s,this.uint16[I+2]=l,this.uint16[I+3]=u,this.uint16[I+4]=d,this.uint16[I+5]=f,this.uint16[I+6]=_,this.uint16[I+7]=x,this.uint16[I+8]=v,this.uint16[I+9]=w,t}}R.prototype.bytesPerElement=20,Ie("StructArrayLayout10ui20",R);class V extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,u,d,f,_,x,v,w,I){const M=this.length;return this.resize(M+1),this.emplace(M,t,r,s,l,u,d,f,_,x,v,w,I)}emplace(t,r,s,l,u,d,f,_,x,v,w,I,M){const k=12*t;return this.int16[k+0]=r,this.int16[k+1]=s,this.int16[k+2]=l,this.int16[k+3]=u,this.uint16[k+4]=d,this.uint16[k+5]=f,this.uint16[k+6]=_,this.uint16[k+7]=x,this.int16[k+8]=v,this.int16[k+9]=w,this.int16[k+10]=I,this.int16[k+11]=M,t}}V.prototype.bytesPerElement=24,Ie("StructArrayLayout4i4ui4i24",V);class U extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,s)}emplace(t,r,s,l){const u=3*t;return this.float32[u+0]=r,this.float32[u+1]=s,this.float32[u+2]=l,t}}U.prototype.bytesPerElement=12,Ie("StructArrayLayout3f12",U);class $ extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint32[1*t+0]=r,t}}$.prototype.bytesPerElement=4,Ie("StructArrayLayout1ul4",$);class Z extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,u,d,f,_,x){const v=this.length;return this.resize(v+1),this.emplace(v,t,r,s,l,u,d,f,_,x)}emplace(t,r,s,l,u,d,f,_,x,v){const w=10*t,I=5*t;return this.int16[w+0]=r,this.int16[w+1]=s,this.int16[w+2]=l,this.int16[w+3]=u,this.int16[w+4]=d,this.int16[w+5]=f,this.uint32[I+3]=_,this.uint16[w+8]=x,this.uint16[w+9]=v,t}}Z.prototype.bytesPerElement=20,Ie("StructArrayLayout6i1ul2ui20",Z);class B extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,s,l,u,d)}emplace(t,r,s,l,u,d,f){const _=6*t;return this.int16[_+0]=r,this.int16[_+1]=s,this.int16[_+2]=l,this.int16[_+3]=u,this.int16[_+4]=d,this.int16[_+5]=f,t}}B.prototype.bytesPerElement=12,Ie("StructArrayLayout2i2i2i12",B);class X extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,u){const d=this.length;return this.resize(d+1),this.emplace(d,t,r,s,l,u)}emplace(t,r,s,l,u,d){const f=4*t,_=8*t;return this.float32[f+0]=r,this.float32[f+1]=s,this.float32[f+2]=l,this.int16[_+6]=u,this.int16[_+7]=d,t}}X.prototype.bytesPerElement=16,Ie("StructArrayLayout2f1f2i16",X);class K extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,s,l,u,d)}emplace(t,r,s,l,u,d,f){const _=16*t,x=4*t,v=8*t;return this.uint8[_+0]=r,this.uint8[_+1]=s,this.float32[x+1]=l,this.float32[x+2]=u,this.int16[v+6]=d,this.int16[v+7]=f,t}}K.prototype.bytesPerElement=16,Ie("StructArrayLayout2ub2f2i16",K);class ee extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,s)}emplace(t,r,s,l){const u=3*t;return this.uint16[u+0]=r,this.uint16[u+1]=s,this.uint16[u+2]=l,t}}ee.prototype.bytesPerElement=6,Ie("StructArrayLayout3ui6",ee);class oe extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,s,l,u,d,f,_,x,v,w,I,M,k,z,F,j){const Q=this.length;return this.resize(Q+1),this.emplace(Q,t,r,s,l,u,d,f,_,x,v,w,I,M,k,z,F,j)}emplace(t,r,s,l,u,d,f,_,x,v,w,I,M,k,z,F,j,Q){const G=24*t,J=12*t,re=48*t;return this.int16[G+0]=r,this.int16[G+1]=s,this.uint16[G+2]=l,this.uint16[G+3]=u,this.uint32[J+2]=d,this.uint32[J+3]=f,this.uint32[J+4]=_,this.uint16[G+10]=x,this.uint16[G+11]=v,this.uint16[G+12]=w,this.float32[J+7]=I,this.float32[J+8]=M,this.uint8[re+36]=k,this.uint8[re+37]=z,this.uint8[re+38]=F,this.uint32[J+10]=j,this.int16[G+22]=Q,t}}oe.prototype.bytesPerElement=48,Ie("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",oe);class he extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,s,l,u,d,f,_,x,v,w,I,M,k,z,F,j,Q,G,J,re,ce,we,Le,ve,ye,ke,Pe){const Se=this.length;return this.resize(Se+1),this.emplace(Se,t,r,s,l,u,d,f,_,x,v,w,I,M,k,z,F,j,Q,G,J,re,ce,we,Le,ve,ye,ke,Pe)}emplace(t,r,s,l,u,d,f,_,x,v,w,I,M,k,z,F,j,Q,G,J,re,ce,we,Le,ve,ye,ke,Pe,Se){const ae=32*t,ze=16*t;return this.int16[ae+0]=r,this.int16[ae+1]=s,this.int16[ae+2]=l,this.int16[ae+3]=u,this.int16[ae+4]=d,this.int16[ae+5]=f,this.int16[ae+6]=_,this.int16[ae+7]=x,this.uint16[ae+8]=v,this.uint16[ae+9]=w,this.uint16[ae+10]=I,this.uint16[ae+11]=M,this.uint16[ae+12]=k,this.uint16[ae+13]=z,this.uint16[ae+14]=F,this.uint16[ae+15]=j,this.uint16[ae+16]=Q,this.uint16[ae+17]=G,this.uint16[ae+18]=J,this.uint16[ae+19]=re,this.uint16[ae+20]=ce,this.uint16[ae+21]=we,this.uint16[ae+22]=Le,this.uint32[ze+12]=ve,this.float32[ze+13]=ye,this.float32[ze+14]=ke,this.uint16[ae+30]=Pe,this.uint16[ae+31]=Se,t}}he.prototype.bytesPerElement=64,Ie("StructArrayLayout8i15ui1ul2f2ui64",he);class xe extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.float32[1*t+0]=r,t}}xe.prototype.bytesPerElement=4,Ie("StructArrayLayout1f4",xe);class Te extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,s)}emplace(t,r,s,l){const u=3*t;return this.uint16[6*t+0]=r,this.float32[u+1]=s,this.float32[u+2]=l,t}}Te.prototype.bytesPerElement=12,Ie("StructArrayLayout1ui2f12",Te);class fe extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,s)}emplace(t,r,s,l){const u=4*t;return this.uint32[2*t+0]=r,this.uint16[u+2]=s,this.uint16[u+3]=l,t}}fe.prototype.bytesPerElement=8,Ie("StructArrayLayout1ul2ui8",fe);class pe extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r){const s=this.length;return this.resize(s+1),this.emplace(s,t,r)}emplace(t,r,s){const l=2*t;return this.uint16[l+0]=r,this.uint16[l+1]=s,t}}pe.prototype.bytesPerElement=4,Ie("StructArrayLayout2ui4",pe);class Me extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint16[1*t+0]=r,t}}Me.prototype.bytesPerElement=2,Ie("StructArrayLayout1ui2",Me);class Ve extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,s,l){const u=this.length;return this.resize(u+1),this.emplace(u,t,r,s,l)}emplace(t,r,s,l,u){const d=4*t;return this.float32[d+0]=r,this.float32[d+1]=s,this.float32[d+2]=l,this.float32[d+3]=u,t}}Ve.prototype.bytesPerElement=16,Ie("StructArrayLayout4f16",Ve);class ge extends o{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new me(this.anchorPointX,this.anchorPointY)}}ge.prototype.size=20;class be extends Z{get(t){return new ge(this,t)}}Ie("CollisionBoxArray",be);class Fe extends o{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Fe.prototype.size=48;class pt extends oe{get(t){return new Fe(this,t)}}Ie("PlacedSymbolArray",pt);class Ue extends o{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Ue.prototype.size=64;class He extends he{get(t){return new Ue(this,t)}}Ie("SymbolInstanceArray",He);class ft extends xe{getoffsetX(t){return this.float32[1*t+0]}}Ie("GlyphOffsetArray",ft);class Vt extends b{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Ie("SymbolLineVertexArray",Vt);class ji extends o{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}ji.prototype.size=12;class mt extends Te{get(t){return new ji(this,t)}}Ie("TextAnchorOffsetArray",mt);class ni extends o{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]}}ni.prototype.size=8;class Kt extends fe{get(t){return new ni(this,t)}}Ie("FeatureIndexArray",Kt);class Nt extends y{}class Jt extends y{}class or extends y{}class Rn extends S{}class aa extends C{}class Bn extends E{}class Pi extends R{}class oa extends V{}class _o extends U{}class Ai extends ${}class Mi extends B{}class zr extends K{}class Ui extends ee{}class Rt extends pe{}const jt=m([{name:"a_pos",components:2,type:"Int16"}],4),{members:gi}=jt;class We{constructor(t=[]){this.segments=t}prepareSegment(t,r,s,l){let u=this.segments[this.segments.length-1];return t>We.MAX_VERTEX_ARRAY_LENGTH&&Ft(`Max vertices per segment is ${We.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!u||u.vertexLength+t>We.MAX_VERTEX_ARRAY_LENGTH||u.sortKey!==l)&&(u={vertexOffset:r.length,primitiveOffset:s.length,vertexLength:0,primitiveLength:0},l!==void 0&&(u.sortKey=l),this.segments.push(u)),u}get(){return this.segments}destroy(){for(const t of this.segments)for(const r in t.vaos)t.vaos[r].destroy()}static simpleSegment(t,r,s,l){return new We([{vertexOffset:t,primitiveOffset:r,vertexLength:s,primitiveLength:l,vaos:{},sortKey:0}])}}function rn(i,t){return 256*(i=Ei(Math.floor(i),0,255))+Ei(Math.floor(t),0,255)}We.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ie("SegmentVector",We);const Fn=m([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var On={exports:{}},fl={exports:{}};fl.exports=function(i,t){var r,s,l,u,d,f,_,x;for(s=i.length-(r=3&i.length),l=t,d=3432918353,f=461845907,x=0;x>>16)*d&65535)<<16)&4294967295)<<15|_>>>17))*f+(((_>>>16)*f&65535)<<16)&4294967295)<<13|l>>>19))+((5*(l>>>16)&65535)<<16)&4294967295))+((58964+(u>>>16)&65535)<<16);switch(_=0,r){case 3:_^=(255&i.charCodeAt(x+2))<<16;case 2:_^=(255&i.charCodeAt(x+1))<<8;case 1:l^=_=(65535&(_=(_=(65535&(_^=255&i.charCodeAt(x)))*d+(((_>>>16)*d&65535)<<16)&4294967295)<<15|_>>>17))*f+(((_>>>16)*f&65535)<<16)&4294967295}return l^=i.length,l=2246822507*(65535&(l^=l>>>16))+((2246822507*(l>>>16)&65535)<<16)&4294967295,l=3266489909*(65535&(l^=l>>>13))+((3266489909*(l>>>16)&65535)<<16)&4294967295,(l^=l>>>16)>>>0};var hc=fl.exports,ml={exports:{}};ml.exports=function(i,t){for(var r,s=i.length,l=t^s,u=0;s>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(u)|(255&i.charCodeAt(++u))<<8|(255&i.charCodeAt(++u))<<16|(255&i.charCodeAt(++u))<<24))+((1540483477*(r>>>16)&65535)<<16),l=1540483477*(65535&l)+((1540483477*(l>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),s-=4,++u;switch(s){case 3:l^=(255&i.charCodeAt(u+2))<<16;case 2:l^=(255&i.charCodeAt(u+1))<<8;case 1:l=1540483477*(65535&(l^=255&i.charCodeAt(u)))+((1540483477*(l>>>16)&65535)<<16)}return l=1540483477*(65535&(l^=l>>>13))+((1540483477*(l>>>16)&65535)<<16),(l^=l>>>15)>>>0};var Er=hc,_l=ml.exports;On.exports=Er,On.exports.murmur3=Er,On.exports.murmur2=_l;var la=zi(On.exports);class ys{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,r,s,l){this.ids.push(ca(t)),this.positions.push(r,s,l)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=ca(t);let s=0,l=this.ids.length-1;for(;s>1;this.ids[d]>=r?l=d:s=d+1}const u=[];for(;this.ids[s]===r;)u.push({index:this.positions[3*s],start:this.positions[3*s+1],end:this.positions[3*s+2]}),s++;return u}static serialize(t,r){const s=new Float64Array(t.ids),l=new Uint32Array(t.positions);return ha(s,l,0,s.length-1),r&&r.push(s.buffer,l.buffer),{ids:s,positions:l}}static deserialize(t){const r=new ys;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}}function ca(i){const t=+i;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:la(String(i))}function ha(i,t,r,s){for(;r>1];let u=r-1,d=s+1;for(;;){do u++;while(i[u]l);if(u>=d)break;Vn(i,u,d),Vn(t,3*u,3*d),Vn(t,3*u+1,3*d+1),Vn(t,3*u+2,3*d+2)}d-r`u_${l}`),this.type=s}setUniform(t,r,s){t.set(s.constantOr(this.value))}getBinding(t,r,s){return this.type==="color"?new eh(t,r):new gl(t,r)}}class ua{constructor(t,r){this.uniformNames=r.map(s=>`u_${s}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=t.tlbr}setUniform(t,r,s,l){const u=l==="u_pattern_to"?this.patternTo:l==="u_pattern_from"?this.patternFrom:l==="u_pixel_ratio_to"?this.pixelRatioTo:l==="u_pixel_ratio_from"?this.pixelRatioFrom:null;u&&t.set(u)}getBinding(t,r,s){return s.substr(0,9)==="u_pattern"?new Qc(t,r):new gl(t,r)}}class nn{constructor(t,r,s,l){this.expression=t,this.type=s,this.maxValue=0,this.paintVertexAttributes=r.map(u=>({name:`a_${u}`,type:"Float32",components:s==="color"?2:1,offset:0})),this.paintVertexArray=new l}populatePaintArray(t,r,s,l,u){const d=this.paintVertexArray.length,f=this.expression.evaluate(new dt(0),r,{},l,[],u);this.paintVertexArray.resize(t),this._setPaintValue(d,t,f)}updatePaintArray(t,r,s,l){const u=this.expression.evaluate({zoom:0},s,l);this._setPaintValue(t,r,u)}_setPaintValue(t,r,s){if(this.type==="color"){const l=uc(s);for(let u=t;u`u_${f}_t`),this.type=s,this.useIntegerZoom=l,this.zoom=u,this.maxValue=0,this.paintVertexAttributes=r.map(f=>({name:`a_${f}`,type:"Float32",components:s==="color"?4:2,offset:0})),this.paintVertexArray=new d}populatePaintArray(t,r,s,l,u){const d=this.expression.evaluate(new dt(this.zoom),r,{},l,[],u),f=this.expression.evaluate(new dt(this.zoom+1),r,{},l,[],u),_=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(_,t,d,f)}updatePaintArray(t,r,s,l){const u=this.expression.evaluate({zoom:this.zoom},s,l),d=this.expression.evaluate({zoom:this.zoom+1},s,l);this._setPaintValue(t,r,u,d)}_setPaintValue(t,r,s,l){if(this.type==="color"){const u=uc(s),d=uc(l);for(let f=t;f`#define HAS_UNIFORM_${l}`))}return t}getBinderAttributes(){const t=[];for(const r in this.binders){const s=this.binders[r];if(s instanceof nn||s instanceof yr)for(let l=0;l!0){this.programConfigurations={};for(const l of t)this.programConfigurations[l.id]=new th(l,r,s);this.needsUpload=!1,this._featureMap=new ys,this._bufferOffset=0}populatePaintArrays(t,r,s,l,u,d){for(const f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(t,r,l,u,d);r.id!==void 0&&this._featureMap.add(r.id,s,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,r,s,l){for(const u of s)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(t,this._featureMap,r,u,l)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function Nu(i,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${t}-`,"").replace(/-/g,"_")]}function ih(i,t,r){const s={color:{source:E,composite:Ve},number:{source:xe,composite:E}},l=function(u){return{"line-pattern":{source:Pi,composite:Pi},"fill-pattern":{source:Pi,composite:Pi},"fill-extrusion-pattern":{source:Pi,composite:Pi}}[u]}(i);return l&&l[r]||s[t][r]}Ie("ConstantBinder",go),Ie("CrossFadedConstantBinder",ua),Ie("SourceExpressionBinder",nn),Ie("CrossFadedCompositeBinder",Nn),Ie("CompositeExpressionBinder",yr),Ie("ProgramConfiguration",th,{omit:["_buffers"]}),Ie("ProgramConfigurationSet",vs);const Mt=8192,dc=Math.pow(2,14)-1,rh=-dc-1;function bs(i){const t=Mt/i.extent,r=i.loadGeometry();for(let s=0;sd.x+1||_d.y+1)&&Ft("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function ws(i,t){return{type:i.type,id:i.id,properties:i.properties,geometry:t?bs(i):[]}}function yl(i,t,r,s,l){i.emplaceBack(2*t+(s+1)/2,2*r+(l+1)/2)}class pc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Jt,this.indexArray=new Ui,this.segments=new We,this.programConfigurations=new vs(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,s){const l=this.layers[0],u=[];let d=null,f=!1;l.type==="circle"&&(d=l.layout.get("circle-sort-key"),f=!d.isConstant());for(const{feature:_,id:x,index:v,sourceLayerIndex:w}of t){const I=this.layers[0]._featureFilter.needGeometry,M=ws(_,I);if(!this.layers[0]._featureFilter.filter(new dt(this.zoom),M,s))continue;const k=f?d.evaluate(M,{},s):void 0,z={id:x,properties:_.properties,type:_.type,sourceLayerIndex:w,index:v,geometry:I?M.geometry:bs(_),patterns:{},sortKey:k};u.push(z)}f&&u.sort((_,x)=>_.sortKey-x.sortKey);for(const _ of u){const{geometry:x,index:v,sourceLayerIndex:w}=_,I=t[v].feature;this.addFeature(_,x,v,s),r.featureIndex.insert(I,x,v,w,this.index)}}update(t,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,gi),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,r,s,l){for(const u of r)for(const d of u){const f=d.x,_=d.y;if(f<0||f>=Mt||_<0||_>=Mt)continue;const x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),v=x.vertexLength;yl(this.layoutVertexArray,f,_,-1,-1),yl(this.layoutVertexArray,f,_,1,-1),yl(this.layoutVertexArray,f,_,1,1),yl(this.layoutVertexArray,f,_,-1,1),this.indexArray.emplaceBack(v,v+1,v+2),this.indexArray.emplaceBack(v,v+3,v+2),x.vertexLength+=4,x.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,s,{},l)}}function nh(i,t){for(let r=0;r1){if(fc(i,t))return!0;for(let s=0;s1?r:r.sub(t)._mult(l)._add(t))}function oh(i,t){let r,s,l,u=!1;for(let d=0;dt.y!=l.y>t.y&&t.x<(l.x-s.x)*(t.y-s.y)/(l.y-s.y)+s.x&&(u=!u)}return u}function da(i,t){let r=!1;for(let s=0,l=i.length-1;st.y!=d.y>t.y&&t.x<(d.x-u.x)*(t.y-u.y)/(d.y-u.y)+u.x&&(r=!r)}return r}function qu(i,t,r){const s=r[0],l=r[2];if(i.xl.x&&t.x>l.x||i.yl.y&&t.y>l.y)return!1;const u=Ht(i,t,r[0]);return u!==Ht(i,t,r[1])||u!==Ht(i,t,r[2])||u!==Ht(i,t,r[3])}function yo(i,t,r){const s=t.paint.get(i).value;return s.kind==="constant"?s.value:r.programConfigurations.get(t.id).getMaxValue(i)}function xl(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function vl(i,t,r,s,l){if(!t[0]&&!t[1])return i;const u=me.convert(t)._mult(l);r==="viewport"&&u._rotate(-s);const d=[];for(let f=0;fuh(F,z))}(x,_),M=w?v*f:v;for(const k of l)for(const z of k){const F=w?z:uh(z,_);let j=M;const Q=bl([],[z.x,z.y,0,1],_);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?j*=Q[3]/d.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(j*=d.cameraToCenterDistance/Q[3]),ju(I,F,j))return!0}return!1}}function uh(i,t){const r=bl([],[i.x,i.y,0,1],t);return new me(r[0]/r[3],r[1]/r[3])}class dh extends pc{}let ph;Ie("HeatmapBucket",dh,{omit:["layers"]});var Xu={get paint(){return ph=ph||new h({"heatmap-radius":new Re(ie.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Re(ie.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ae(ie.paint_heatmap["heatmap-intensity"]),"heatmap-color":new mo(ie.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ae(ie.paint_heatmap["heatmap-opacity"])})}};function gc(i,{width:t,height:r},s,l){if(l){if(l instanceof Uint8ClampedArray)l=new Uint8Array(l.buffer);else if(l.length!==t*r*s)throw new RangeError(`mismatched image size. expected: ${l.length} but got: ${t*r*s}`)}else l=new Uint8Array(t*r*s);return i.width=t,i.height=r,i.data=l,i}function fh(i,{width:t,height:r},s){if(t===i.width&&r===i.height)return;const l=gc({},{width:t,height:r},s);yc(i,l,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,t),height:Math.min(i.height,r)},s),i.width=t,i.height=r,i.data=l.data}function yc(i,t,r,s,l,u){if(l.width===0||l.height===0)return t;if(l.width>i.width||l.height>i.height||r.x>i.width-l.width||r.y>i.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>t.width||l.height>t.height||s.x>t.width-l.width||s.y>t.height-l.height)throw new RangeError("out of range destination coordinates for image copy");const d=i.data,f=t.data;if(d===f)throw new Error("srcData equals dstData, so image is already copied");for(let _=0;_{t[i.evaluationKey]=_;const x=i.expression.evaluate(t);l.data[d+f+0]=Math.floor(255*x.r/x.a),l.data[d+f+1]=Math.floor(255*x.g/x.a),l.data[d+f+2]=Math.floor(255*x.b/x.a),l.data[d+f+3]=Math.floor(255*x.a)};if(i.clips)for(let d=0,f=0;d80*r){f=1/0,_=1/0;let v=-1/0,w=-1/0;for(let I=r;Iv&&(v=M),k>w&&(w=k)}x=Math.max(v-f,w-_),x=x!==0?32767/x:0}return bo(u,d,r,f,_,x,0),d}function yh(i,t,r,s,l){let u;if(l===function(d,f,_,x){let v=0;for(let w=f,I=_-x;w<_;w+=x)v+=(d[I]-d[w])*(d[w+1]+d[I+1]),I=w;return v}(i,t,r,s)>0)for(let d=t;d=t;d-=s)u=bh(d/s|0,i[d],i[d+1],u);return u&&wl(u,u.next)&&(To(u),u=u.next),u}function Ts(i,t){if(!i)return i;t||(t=i);let r,s=i;do if(r=!1,s.steiner||!wl(s,s.next)&&It(s.prev,s,s.next)!==0)s=s.next;else{if(To(s),s=t=s.prev,s===s.next)break;r=!0}while(r||s!==t);return t}function bo(i,t,r,s,l,u,d){if(!i)return;!d&&u&&function(_,x,v,w){let I=_;do I.z===0&&(I.z=vc(I.x,I.y,x,v,w)),I.prevZ=I.prev,I.nextZ=I.next,I=I.next;while(I!==_);I.prevZ.nextZ=null,I.prevZ=null,function(M){let k,z=1;do{let F,j=M;M=null;let Q=null;for(k=0;j;){k++;let G=j,J=0;for(let ce=0;ce0||re>0&&G;)J!==0&&(re===0||!G||j.z<=G.z)?(F=j,j=j.nextZ,J--):(F=G,G=G.nextZ,re--),Q?Q.nextZ=F:M=F,F.prevZ=Q,Q=F;j=G}Q.nextZ=null,z*=2}while(k>1)}(I)}(i,s,l,u);let f=i;for(;i.prev!==i.next;){const _=i.prev,x=i.next;if(u?td(i,s,l,u):ed(i))t.push(_.i,i.i,x.i),To(i),i=x.next,f=x.next;else if((i=x)===f){d?d===1?bo(i=id(Ts(i),t),t,r,s,l,u,2):d===2&&rd(i,t,r,s,l,u):bo(Ts(i),t,r,s,l,u,1);break}}}function ed(i){const t=i.prev,r=i,s=i.next;if(It(t,r,s)>=0)return!1;const l=t.x,u=r.x,d=s.x,f=t.y,_=r.y,x=s.y,v=lu?l>d?l:d:u>d?u:d,M=f>_?f>x?f:x:_>x?_:x;let k=s.next;for(;k!==t;){if(k.x>=v&&k.x<=I&&k.y>=w&&k.y<=M&&fa(l,f,u,_,d,x,k.x,k.y)&&It(k.prev,k,k.next)>=0)return!1;k=k.next}return!0}function td(i,t,r,s){const l=i.prev,u=i,d=i.next;if(It(l,u,d)>=0)return!1;const f=l.x,_=u.x,x=d.x,v=l.y,w=u.y,I=d.y,M=f<_?f_?f>x?f:x:_>x?_:x,F=v>w?v>I?v:I:w>I?w:I,j=vc(M,k,t,r,s),Q=vc(z,F,t,r,s);let G=i.prevZ,J=i.nextZ;for(;G&&G.z>=j&&J&&J.z<=Q;){if(G.x>=M&&G.x<=z&&G.y>=k&&G.y<=F&&G!==l&&G!==d&&fa(f,v,_,w,x,I,G.x,G.y)&&It(G.prev,G,G.next)>=0||(G=G.prevZ,J.x>=M&&J.x<=z&&J.y>=k&&J.y<=F&&J!==l&&J!==d&&fa(f,v,_,w,x,I,J.x,J.y)&&It(J.prev,J,J.next)>=0))return!1;J=J.nextZ}for(;G&&G.z>=j;){if(G.x>=M&&G.x<=z&&G.y>=k&&G.y<=F&&G!==l&&G!==d&&fa(f,v,_,w,x,I,G.x,G.y)&&It(G.prev,G,G.next)>=0)return!1;G=G.prevZ}for(;J&&J.z<=Q;){if(J.x>=M&&J.x<=z&&J.y>=k&&J.y<=F&&J!==l&&J!==d&&fa(f,v,_,w,x,I,J.x,J.y)&&It(J.prev,J,J.next)>=0)return!1;J=J.nextZ}return!0}function id(i,t){let r=i;do{const s=r.prev,l=r.next.next;!wl(s,l)&&xh(s,r,r.next,l)&&wo(s,l)&&wo(l,s)&&(t.push(s.i,r.i,l.i),To(r),To(r.next),r=i=l),r=r.next}while(r!==i);return Ts(r)}function rd(i,t,r,s,l,u){let d=i;do{let f=d.next.next;for(;f!==d.prev;){if(d.i!==f.i&&ld(d,f)){let _=vh(d,f);return d=Ts(d,d.next),_=Ts(_,_.next),bo(d,t,r,s,l,u,0),void bo(_,t,r,s,l,u,0)}f=f.next}d=d.next}while(d!==i)}function nd(i,t){return i.x-t.x}function sd(i,t){const r=function(l,u){let d=u;const f=l.x,_=l.y;let x,v=-1/0;do{if(_<=d.y&&_>=d.next.y&&d.next.y!==d.y){const z=d.x+(_-d.y)*(d.next.x-d.x)/(d.next.y-d.y);if(z<=f&&z>v&&(v=z,x=d.x=d.x&&d.x>=I&&f!==d.x&&fa(_x.x||d.x===x.x&&ad(x,d)))&&(x=d,k=z)}d=d.next}while(d!==w);return x}(i,t);if(!r)return t;const s=vh(r,i);return Ts(s,s.next),Ts(r,r.next)}function ad(i,t){return It(i.prev,i,t.prev)<0&&It(t.next,i,i.next)<0}function vc(i,t,r,s,l){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*l|0)|i<<8))|i<<4))|i<<2))|i<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-s)*l|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function od(i){let t=i,r=i;do(t.x=(i-d)*(u-f)&&(i-d)*(s-f)>=(r-d)*(t-f)&&(r-d)*(u-f)>=(l-d)*(s-f)}function ld(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!function(r,s){let l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==s.i&&l.next.i!==s.i&&xh(l,l.next,r,s))return!0;l=l.next}while(l!==r);return!1}(i,t)&&(wo(i,t)&&wo(t,i)&&function(r,s){let l=r,u=!1;const d=(r.x+s.x)/2,f=(r.y+s.y)/2;do l.y>f!=l.next.y>f&&l.next.y!==l.y&&d<(l.next.x-l.x)*(f-l.y)/(l.next.y-l.y)+l.x&&(u=!u),l=l.next;while(l!==r);return u}(i,t)&&(It(i.prev,i,t.prev)||It(i,t.prev,t))||wl(i,t)&&It(i.prev,i,i.next)>0&&It(t.prev,t,t.next)>0)}function It(i,t,r){return(t.y-i.y)*(r.x-t.x)-(t.x-i.x)*(r.y-t.y)}function wl(i,t){return i.x===t.x&&i.y===t.y}function xh(i,t,r,s){const l=Sl(It(i,t,r)),u=Sl(It(i,t,s)),d=Sl(It(r,s,i)),f=Sl(It(r,s,t));return l!==u&&d!==f||!(l!==0||!Tl(i,r,t))||!(u!==0||!Tl(i,s,t))||!(d!==0||!Tl(r,i,s))||!(f!==0||!Tl(r,t,s))}function Tl(i,t,r){return t.x<=Math.max(i.x,r.x)&&t.x>=Math.min(i.x,r.x)&&t.y<=Math.max(i.y,r.y)&&t.y>=Math.min(i.y,r.y)}function Sl(i){return i>0?1:i<0?-1:0}function wo(i,t){return It(i.prev,i,i.next)<0?It(i,t,i.next)>=0&&It(i,i.prev,t)>=0:It(i,t,i.prev)<0||It(i,i.next,t)<0}function vh(i,t){const r=bc(i.i,i.x,i.y),s=bc(t.i,t.x,t.y),l=i.next,u=t.prev;return i.next=t,t.prev=i,r.next=l,l.prev=r,s.next=r,r.prev=s,u.next=s,s.prev=u,s}function bh(i,t,r,s){const l=bc(i,t,r);return s?(l.next=s.next,l.prev=s,s.next.prev=l,s.next=l):(l.prev=l,l.next=l),l}function To(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 bc(i,t,r){return{i,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function wc(i,t,r){const s=r.patternDependencies;let l=!1;for(const u of t){const d=u.paint.get(`${i}-pattern`);d.isConstant()||(l=!0);const f=d.constantOr(null);f&&(l=!0,s[f.to]=!0,s[f.from]=!0)}return l}function Tc(i,t,r,s,l){const u=l.patternDependencies;for(const d of t){const f=d.paint.get(`${i}-pattern`).value;if(f.kind!=="constant"){let _=f.evaluate({zoom:s-1},r,{},l.availableImages),x=f.evaluate({zoom:s},r,{},l.availableImages),v=f.evaluate({zoom:s+1},r,{},l.availableImages);_=_&&_.name?_.name:_,x=x&&x.name?x.name:x,v=v&&v.name?v.name:v,u[_]=!0,u[x]=!0,u[v]=!0,r.patterns[d.id]={min:_,mid:x,max:v}}}return r}class Sc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new or,this.indexArray=new Ui,this.indexArray2=new Rt,this.programConfigurations=new vs(t.layers,t.zoom),this.segments=new We,this.segments2=new We,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,s){this.hasPattern=wc("fill",this.layers,r);const l=this.layers[0].layout.get("fill-sort-key"),u=!l.isConstant(),d=[];for(const{feature:f,id:_,index:x,sourceLayerIndex:v}of t){const w=this.layers[0]._featureFilter.needGeometry,I=ws(f,w);if(!this.layers[0]._featureFilter.filter(new dt(this.zoom),I,s))continue;const M=u?l.evaluate(I,{},s,r.availableImages):void 0,k={id:_,properties:f.properties,type:f.type,sourceLayerIndex:v,index:x,geometry:w?I.geometry:bs(f),patterns:{},sortKey:M};d.push(k)}u&&d.sort((f,_)=>f.sortKey-_.sortKey);for(const f of d){const{geometry:_,index:x,sourceLayerIndex:v}=f;if(this.hasPattern){const w=Tc("fill",this.layers,f,this.zoom,r);this.patternFeatures.push(w)}else this.addFeature(f,_,x,s,{});r.featureIndex.insert(t[x].feature,_,x,v,this.index)}}update(t,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,s)}addFeatures(t,r,s){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Qu),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,r,s,l,u){for(const d of Os(r,500)){let f=0;for(const M of d)f+=M.length;const _=this.segments.prepareSegment(f,this.layoutVertexArray,this.indexArray),x=_.vertexLength,v=[],w=[];for(const M of d){if(M.length===0)continue;M!==d[0]&&w.push(v.length/2);const k=this.segments2.prepareSegment(M.length,this.layoutVertexArray,this.indexArray2),z=k.vertexLength;this.layoutVertexArray.emplaceBack(M[0].x,M[0].y),this.indexArray2.emplaceBack(z+M.length-1,z),v.push(M[0].x),v.push(M[0].y);for(let F=1;F>3}if(l--,s===1||s===2)u+=i.readSVarint(),d+=i.readSVarint(),s===1&&(t&&f.push(t),t=[]),t.push(new fd(u,d));else{if(s!==7)throw new Error("unknown command "+s);t&&t.push(t[0].clone())}}return t&&f.push(t),f},ma.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var t=i.readVarint()+i.pos,r=1,s=0,l=0,u=0,d=1/0,f=-1/0,_=1/0,x=-1/0;i.pos>3}if(s--,r===1||r===2)(l+=i.readSVarint())f&&(f=l),(u+=i.readSVarint())<_&&(_=u),u>x&&(x=u);else if(r!==7)throw new Error("unknown command "+r)}return[d,_,f,x]},ma.prototype.toGeoJSON=function(i,t,r){var s,l,u=this.extent*Math.pow(2,r),d=this.extent*i,f=this.extent*t,_=this.loadGeometry(),x=ma.types[this.type];function v(M){for(var k=0;k>3;l=d===1?s.readString():d===2?s.readFloat():d===3?s.readDouble():d===4?s.readVarint64():d===5?s.readVarint():d===6?s.readSVarint():d===7?s.readBoolean():null}return l}(r))}Ph.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var t=this._pbf.readVarint()+this._pbf.pos;return new gd(this._pbf,t,this.extent,this._keys,this._values)};var xd=Ih;function vd(i,t,r){if(i===3){var s=new xd(r,r.readVarint()+r.pos);s.length&&(t[s.name]=s)}}jn.VectorTile=function(i,t){this.layers=i.readFields(vd,{},t)},jn.VectorTileFeature=Sh,jn.VectorTileLayer=Ih;const bd=jn.VectorTileFeature.types,Ic=Math.pow(2,13);function So(i,t,r,s,l,u,d,f){i.emplaceBack(t,r,2*Math.floor(s*Ic)+d,l*Ic*2,u*Ic*2,Math.round(f))}class Pc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Rn,this.centroidVertexArray=new Nt,this.indexArray=new Ui,this.programConfigurations=new vs(t.layers,t.zoom),this.segments=new We,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,s){this.features=[],this.hasPattern=wc("fill-extrusion",this.layers,r);for(const{feature:l,id:u,index:d,sourceLayerIndex:f}of t){const _=this.layers[0]._featureFilter.needGeometry,x=ws(l,_);if(!this.layers[0]._featureFilter.filter(new dt(this.zoom),x,s))continue;const v={id:u,sourceLayerIndex:f,index:d,geometry:_?x.geometry:bs(l),properties:l.properties,type:l.type,patterns:{}};this.hasPattern?this.features.push(Tc("fill-extrusion",this.layers,v,this.zoom,r)):this.addFeature(v,v.geometry,d,s,{}),r.featureIndex.insert(l,v.geometry,d,f,this.index,!0)}}addFeatures(t,r,s){for(const l of this.features){const{geometry:u}=l;this.addFeature(l,u,l.index,r,s)}}update(t,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,pd),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,dd.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,r,s,l,u){for(const d of Os(r,500)){const f={x:0,y:0,vertexCount:0};let _=0;for(const k of d)_+=k.length;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const k of d){if(k.length===0||Td(k))continue;let z=0;for(let F=0;F=1){const Q=k[F-1];if(!wd(j,Q)){x.vertexLength+4>We.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const G=j.sub(Q)._perp()._unit(),J=Q.dist(j);z+J>32768&&(z=0),So(this.layoutVertexArray,j.x,j.y,G.x,G.y,0,0,z),So(this.layoutVertexArray,j.x,j.y,G.x,G.y,0,1,z),f.x+=2*j.x,f.y+=2*j.y,f.vertexCount+=2,z+=J,So(this.layoutVertexArray,Q.x,Q.y,G.x,G.y,0,0,z),So(this.layoutVertexArray,Q.x,Q.y,G.x,G.y,0,1,z),f.x+=2*Q.x,f.y+=2*Q.y,f.vertexCount+=2;const re=x.vertexLength;this.indexArray.emplaceBack(re,re+2,re+1),this.indexArray.emplaceBack(re+1,re+2,re+3),x.vertexLength+=4,x.primitiveLength+=2}}}}if(x.vertexLength+_>We.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(_,this.layoutVertexArray,this.indexArray)),bd[t.type]!=="Polygon")continue;const v=[],w=[],I=x.vertexLength;for(const k of d)if(k.length!==0){k!==d[0]&&w.push(v.length/2);for(let z=0;zMt)||i.y===t.y&&(i.y<0||i.y>Mt)}function Td(i){return i.every(t=>t.x<0)||i.every(t=>t.x>Mt)||i.every(t=>t.y<0)||i.every(t=>t.y>Mt)}let Ah;Ie("FillExtrusionBucket",Pc,{omit:["layers","features"]});var Sd={get paint(){return Ah=Ah||new h({"fill-extrusion-opacity":new Ae(ie["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Re(ie["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ae(ie["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ae(ie["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new na(ie["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Re(ie["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Re(ie["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ae(ie["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Id extends n{constructor(t){super(t,Sd)}createBucket(t){return new Pc(t)}queryRadius(){return xl(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,r,s,l,u,d,f,_){const x=vl(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),d.angle,f),v=this.paint.get("fill-extrusion-height").evaluate(r,s),w=this.paint.get("fill-extrusion-base").evaluate(r,s),I=function(k,z,F,j){const Q=[];for(const G of k){const J=[G.x,G.y,0,1];bl(J,J,z),Q.push(new me(J[0]/J[3],J[1]/J[3]))}return Q}(x,_),M=function(k,z,F,j){const Q=[],G=[],J=j[8]*z,re=j[9]*z,ce=j[10]*z,we=j[11]*z,Le=j[8]*F,ve=j[9]*F,ye=j[10]*F,ke=j[11]*F;for(const Pe of k){const Se=[],ae=[];for(const ze of Pe){const Ce=ze.x,Oe=ze.y,ct=j[0]*Ce+j[4]*Oe+j[12],lt=j[1]*Ce+j[5]*Oe+j[13],zt=j[2]*Ce+j[6]*Oe+j[14],lr=j[3]*Ce+j[7]*Oe+j[15],$t=zt+ce,Et=lr+we,ai=ct+Le,oi=lt+ve,li=zt+ye,Tt=lr+ke,Dt=new me((ct+J)/Et,(lt+re)/Et);Dt.z=$t/Et,Se.push(Dt);const Yt=new me(ai/Tt,oi/Tt);Yt.z=li/Tt,ae.push(Yt)}Q.push(Se),G.push(ae)}return[Q,G]}(l,w,v,_);return function(k,z,F){let j=1/0;sh(F,z)&&(j=Mh(F,z[0]));for(let Q=0;Qr.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new aa,this.layoutVertexArray2=new Bn,this.indexArray=new Ui,this.programConfigurations=new vs(t.layers,t.zoom),this.segments=new We,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,s){this.hasPattern=wc("line",this.layers,r);const l=this.layers[0].layout.get("line-sort-key"),u=!l.isConstant(),d=[];for(const{feature:f,id:_,index:x,sourceLayerIndex:v}of t){const w=this.layers[0]._featureFilter.needGeometry,I=ws(f,w);if(!this.layers[0]._featureFilter.filter(new dt(this.zoom),I,s))continue;const M=u?l.evaluate(I,{},s):void 0,k={id:_,properties:f.properties,type:f.type,sourceLayerIndex:v,index:x,geometry:w?I.geometry:bs(f),patterns:{},sortKey:M};d.push(k)}u&&d.sort((f,_)=>f.sortKey-_.sortKey);for(const f of d){const{geometry:_,index:x,sourceLayerIndex:v}=f;if(this.hasPattern){const w=Tc("line",this.layers,f,this.zoom,r);this.patternFeatures.push(w)}else this.addFeature(f,_,x,s,{});r.featureIndex.insert(t[x].feature,_,x,v,this.index)}}update(t,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,s)}addFeatures(t,r,s){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Cd)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ad),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,r,s,l,u){const d=this.layers[0].layout,f=d.get("line-join").evaluate(t,{}),_=d.get("line-cap"),x=d.get("line-miter-limit"),v=d.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const w of r)this.addLine(w,t,f,_,x,v);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,s,u,l)}addLine(t,r,s,l,u,d){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let j=0;j=2&&t[_-1].equals(t[_-2]);)_--;let x=0;for(;x<_-1&&t[x].equals(t[x+1]);)x++;if(_<(f?3:2))return;s==="bevel"&&(u=1.05);const v=this.overscaling<=16?15*Mt/(512*this.overscaling):0,w=this.segments.prepareSegment(10*_,this.layoutVertexArray,this.indexArray);let I,M,k,z,F;this.e1=this.e2=-1,f&&(I=t[_-2],F=t[x].sub(I)._unit()._perp());for(let j=x;j<_;j++){if(k=j===_-1?f?t[x+1]:void 0:t[j+1],k&&t[j].equals(k))continue;F&&(z=F),I&&(M=I),I=t[j],F=k?k.sub(I)._unit()._perp():z,z=z||F;let Q=z.add(F);Q.x===0&&Q.y===0||Q._unit();const G=z.x*F.x+z.y*F.y,J=Q.x*F.x+Q.y*F.y,re=J!==0?1/J:1/0,ce=2*Math.sqrt(2-2*J),we=J0;if(we&&j>x){const ke=I.dist(M);if(ke>2*v){const Pe=I.sub(I.sub(M)._mult(v/ke)._round());this.updateDistance(M,Pe),this.addCurrentVertex(Pe,z,0,0,w),M=Pe}}const ve=M&&k;let ye=ve?s:f?"butt":l;if(ve&&ye==="round"&&(reu&&(ye="bevel"),ye==="bevel"&&(re>2&&(ye="flipbevel"),re100)Q=F.mult(-1);else{const ke=re*z.add(F).mag()/z.sub(F).mag();Q._perp()._mult(ke*(Le?-1:1))}this.addCurrentVertex(I,Q,0,0,w),this.addCurrentVertex(I,Q.mult(-1),0,0,w)}else if(ye==="bevel"||ye==="fakeround"){const ke=-Math.sqrt(re*re-1),Pe=Le?ke:0,Se=Le?0:ke;if(M&&this.addCurrentVertex(I,z,Pe,Se,w),ye==="fakeround"){const ae=Math.round(180*ce/Math.PI/20);for(let ze=1;ze2*v){const Pe=I.add(k.sub(I)._mult(v/ke)._round());this.updateDistance(I,Pe),this.addCurrentVertex(Pe,F,0,0,w),I=Pe}}}}addCurrentVertex(t,r,s,l,u,d=!1){const f=r.y*l-r.x,_=-r.y-r.x*l;this.addHalfVertex(t,r.x+r.y*s,r.y-r.x*s,d,!1,s,u),this.addHalfVertex(t,f,_,d,!0,-l,u),this.distance>Ch/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,r,s,l,u,d))}addHalfVertex({x:t,y:r},s,l,u,d,f,_){const x=.5*(this.lineClips?this.scaledDistance*(Ch-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(u?1:0),(r<<1)+(d?1:0),Math.round(63*s)+128,Math.round(63*l)+128,1+(f===0?0:f<0?-1:1)|(63&x)<<2,x>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const v=_.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,v),_.primitiveLength++),d?this.e2=v:this.e1=v}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,r){this.distance+=t.dist(r),this.updateScaledDistance()}}let kh,zh;Ie("LineBucket",Ac,{omit:["layers","patternFeatures"]});var Eh={get paint(){return zh=zh||new h({"line-opacity":new Re(ie.paint_line["line-opacity"]),"line-color":new Re(ie.paint_line["line-color"]),"line-translate":new Ae(ie.paint_line["line-translate"]),"line-translate-anchor":new Ae(ie.paint_line["line-translate-anchor"]),"line-width":new Re(ie.paint_line["line-width"]),"line-gap-width":new Re(ie.paint_line["line-gap-width"]),"line-offset":new Re(ie.paint_line["line-offset"]),"line-blur":new Re(ie.paint_line["line-blur"]),"line-dasharray":new sa(ie.paint_line["line-dasharray"]),"line-pattern":new na(ie.paint_line["line-pattern"]),"line-gradient":new mo(ie.paint_line["line-gradient"])})},get layout(){return kh=kh||new h({"line-cap":new Ae(ie.layout_line["line-cap"]),"line-join":new Re(ie.layout_line["line-join"]),"line-miter-limit":new Ae(ie.layout_line["line-miter-limit"]),"line-round-limit":new Ae(ie.layout_line["line-round-limit"]),"line-sort-key":new Re(ie.layout_line["line-sort-key"])})}};class Ed extends Re{possiblyEvaluate(t,r){return r=new dt(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(t,r)}evaluate(t,r,s,l){return r=vi({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(t,r,s,l)}}let Il;class Dd extends n{constructor(t){super(t,Eh),this.gradientVersion=0,Il||(Il=new Ed(Eh.paint.properties["line-width"].specification),Il.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!function(s){return s._styleExpression!==void 0}(r)&&r._styleExpression.expression instanceof _n,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,r){super.recalculate(t,r),this.paint._values["line-floorwidth"]=Il.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Ac(t)}queryRadius(t){const r=t,s=Dh(yo("line-width",this,r),yo("line-gap-width",this,r)),l=yo("line-offset",this,r);return s/2+Math.abs(l)+xl(this.paint.get("line-translate"))}queryIntersectsFeature(t,r,s,l,u,d,f){const _=vl(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),d.angle,f),x=f/2*Dh(this.paint.get("line-width").evaluate(r,s),this.paint.get("line-gap-width").evaluate(r,s)),v=this.paint.get("line-offset").evaluate(r,s);return v&&(l=function(w,I){const M=[];for(let k=0;k=3){for(let F=0;F0?t+2*i:i}const Ld=m([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Rd=m([{name:"a_projected_pos",components:3,type:"Float32"}],4);m([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Bd=m([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);m([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Lh=m([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Fd=m([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Od(i,t,r){return i.sections.forEach(s=>{s.text=function(l,u,d){const f=u.layout.get("text-transform").evaluate(d,{});return f==="uppercase"?l=l.toLocaleUpperCase():f==="lowercase"&&(l=l.toLocaleLowerCase()),_i.applyArabicShaping&&(l=_i.applyArabicShaping(l)),l}(s.text,t,r)}),i}m([{name:"triangle",components:3,type:"Uint16"}]),m([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),m([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),m([{type:"Float32",name:"offsetX"}]),m([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),m([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Po={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Ct=24,Rh=ot,Bh=function(i,t,r,s,l){var u,d,f=8*l-s-1,_=(1<>1,v=-7,w=l-1,I=-1,M=i[t+w];for(w+=I,u=M&(1<<-v)-1,M>>=-v,v+=f;v>0;u=256*u+i[t+w],w+=I,v-=8);for(d=u&(1<<-v)-1,u>>=-v,v+=s;v>0;d=256*d+i[t+w],w+=I,v-=8);if(u===0)u=1-x;else{if(u===_)return d?NaN:1/0*(M?-1:1);d+=Math.pow(2,s),u-=x}return(M?-1:1)*d*Math.pow(2,u-s)},Fh=function(i,t,r,s,l,u){var d,f,_,x=8*u-l-1,v=(1<>1,I=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=0,k=1,z=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,d=v):(d=Math.floor(Math.log(t)/Math.LN2),t*(_=Math.pow(2,-d))<1&&(d--,_*=2),(t+=d+w>=1?I/_:I*Math.pow(2,1-w))*_>=2&&(d++,_/=2),d+w>=v?(f=0,d=v):d+w>=1?(f=(t*_-1)*Math.pow(2,l),d+=w):(f=t*Math.pow(2,w-1)*Math.pow(2,l),d=0));l>=8;i[r+M]=255&f,M+=k,f/=256,l-=8);for(d=d<0;i[r+M]=255&d,M+=k,d/=256,x-=8);i[r+M-k]|=128*z};function ot(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}ot.Varint=0,ot.Fixed64=1,ot.Bytes=2,ot.Fixed32=5;var Mc=4294967296,Oh=1/Mc,Vh=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function sn(i){return i.type===ot.Bytes?i.readVarint()+i.pos:i.pos+1}function _a(i,t,r){return r?4294967296*t+(i>>>0):4294967296*(t>>>0)+(i>>>0)}function Nh(i,t,r){var s=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(s);for(var l=r.pos-1;l>=i;l--)r.buf[l+s]=r.buf[l]}function Vd(i,t){for(var r=0;r>>8,i[r+2]=t>>>16,i[r+3]=t>>>24}function jh(i,t){return(i[t]|i[t+1]<<8|i[t+2]<<16)+(i[t+3]<<24)}ot.prototype={destroy:function(){this.buf=null},readFields:function(i,t,r){for(r=r||this.length;this.pos>3,u=this.pos;this.type=7&s,i(l,t,this),this.pos===u&&this.skip(s)}return t},readMessage:function(i,t){return this.readFields(i,t,this.readVarint()+this.pos)},readFixed32:function(){var i=Pl(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=jh(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Pl(this.buf,this.pos)+Pl(this.buf,this.pos+4)*Mc;return this.pos+=8,i},readSFixed64:function(){var i=Pl(this.buf,this.pos)+jh(this.buf,this.pos+4)*Mc;return this.pos+=8,i},readFloat:function(){var i=Bh(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=Bh(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var t,r,s=this.buf;return t=127&(r=s[this.pos++]),r<128?t:(t|=(127&(r=s[this.pos++]))<<7,r<128?t:(t|=(127&(r=s[this.pos++]))<<14,r<128?t:(t|=(127&(r=s[this.pos++]))<<21,r<128?t:function(l,u,d){var f,_,x=d.buf;if(f=(112&(_=x[d.pos++]))>>4,_<128||(f|=(127&(_=x[d.pos++]))<<3,_<128)||(f|=(127&(_=x[d.pos++]))<<10,_<128)||(f|=(127&(_=x[d.pos++]))<<17,_<128)||(f|=(127&(_=x[d.pos++]))<<24,_<128)||(f|=(1&(_=x[d.pos++]))<<31,_<128))return _a(l,f,u);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=s[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,t=this.pos;return this.pos=i,i-t>=12&&Vh?function(r,s,l){return Vh.decode(r.subarray(s,l))}(this.buf,t,i):function(r,s,l){for(var u="",d=s;d239?4:v>223?3:v>191?2:1;if(d+I>l)break;I===1?v<128&&(w=v):I===2?(192&(f=r[d+1]))==128&&(w=(31&v)<<6|63&f)<=127&&(w=null):I===3?(_=r[d+2],(192&(f=r[d+1]))==128&&(192&_)==128&&((w=(15&v)<<12|(63&f)<<6|63&_)<=2047||w>=55296&&w<=57343)&&(w=null)):I===4&&(_=r[d+2],x=r[d+3],(192&(f=r[d+1]))==128&&(192&_)==128&&(192&x)==128&&((w=(15&v)<<18|(63&f)<<12|(63&_)<<6|63&x)<=65535||w>=1114112)&&(w=null)),w===null?(w=65533,I=1):w>65535&&(w-=65536,u+=String.fromCharCode(w>>>10&1023|55296),w=56320|1023&w),u+=String.fromCharCode(w),d+=I}return u}(this.buf,t,i)},readBytes:function(){var i=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,i);return this.pos=i,t},readPackedVarint:function(i,t){if(this.type!==ot.Bytes)return i.push(this.readVarint(t));var r=sn(this);for(i=i||[];this.pos127;);else if(t===ot.Bytes)this.pos=this.readVarint()+this.pos;else if(t===ot.Fixed32)this.pos+=4;else{if(t!==ot.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(i,t){this.writeVarint(i<<3|t)},realloc:function(i){for(var t=this.length||16;t268435455||i<0?function(t,r){var s,l;if(t>=0?(s=t%4294967296|0,l=t/4294967296|0):(l=~(-t/4294967296),4294967295^(s=~(-t%4294967296))?s=s+1|0:(s=0,l=l+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(u,d,f){f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,f.buf[f.pos]=127&(u>>>=7)}(s,0,r),function(u,d){var f=(7&u)<<4;d.buf[d.pos++]|=f|((u>>>=3)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u)))))}(l,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var t=this.pos;this.pos=function(s,l,u){for(var d,f,_=0;_55295&&d<57344){if(!f){d>56319||_+1===l.length?(s[u++]=239,s[u++]=191,s[u++]=189):f=d;continue}if(d<56320){s[u++]=239,s[u++]=191,s[u++]=189,f=d;continue}d=f-55296<<10|d-56320|65536,f=null}else f&&(s[u++]=239,s[u++]=191,s[u++]=189,f=null);d<128?s[u++]=d:(d<2048?s[u++]=d>>6|192:(d<65536?s[u++]=d>>12|224:(s[u++]=d>>18|240,s[u++]=d>>12&63|128),s[u++]=d>>6&63|128),s[u++]=63&d|128)}return u}(this.buf,i,this.pos);var r=this.pos-t;r>=128&&Nh(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),Fh(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),Fh(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var t=i.length;this.writeVarint(t),this.realloc(t);for(var r=0;r=128&&Nh(r,s,this),this.pos=r-1,this.writeVarint(s),this.pos+=s},writeMessage:function(i,t,r){this.writeTag(i,ot.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(i,t){t.length&&this.writeMessage(i,Vd,t)},writePackedSVarint:function(i,t){t.length&&this.writeMessage(i,Nd,t)},writePackedBoolean:function(i,t){t.length&&this.writeMessage(i,$d,t)},writePackedFloat:function(i,t){t.length&&this.writeMessage(i,jd,t)},writePackedDouble:function(i,t){t.length&&this.writeMessage(i,Ud,t)},writePackedFixed32:function(i,t){t.length&&this.writeMessage(i,qd,t)},writePackedSFixed32:function(i,t){t.length&&this.writeMessage(i,Zd,t)},writePackedFixed64:function(i,t){t.length&&this.writeMessage(i,Gd,t)},writePackedSFixed64:function(i,t){t.length&&this.writeMessage(i,Hd,t)},writeBytesField:function(i,t){this.writeTag(i,ot.Bytes),this.writeBytes(t)},writeFixed32Field:function(i,t){this.writeTag(i,ot.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(i,t){this.writeTag(i,ot.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(i,t){this.writeTag(i,ot.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(i,t){this.writeTag(i,ot.Fixed64),this.writeSFixed64(t)},writeVarintField:function(i,t){this.writeTag(i,ot.Varint),this.writeVarint(t)},writeSVarintField:function(i,t){this.writeTag(i,ot.Varint),this.writeSVarint(t)},writeStringField:function(i,t){this.writeTag(i,ot.Bytes),this.writeString(t)},writeFloatField:function(i,t){this.writeTag(i,ot.Fixed32),this.writeFloat(t)},writeDoubleField:function(i,t){this.writeTag(i,ot.Fixed64),this.writeDouble(t)},writeBooleanField:function(i,t){this.writeVarintField(i,!!t)}};var Cc=zi(Rh);const kc=3;function Xd(i,t,r){i===1&&r.readMessage(Wd,t)}function Wd(i,t,r){if(i===3){const{id:s,bitmap:l,width:u,height:d,left:f,top:_,advance:x}=r.readMessage(Kd,{});t.push({id:s,bitmap:new vo({width:u+2*kc,height:d+2*kc},l),metrics:{width:u,height:d,left:f,top:_,advance:x}})}}function Kd(i,t,r){i===1?t.id=r.readVarint():i===2?t.bitmap=r.readBytes():i===3?t.width=r.readVarint():i===4?t.height=r.readVarint():i===5?t.left=r.readSVarint():i===6?t.top=r.readSVarint():i===7&&(t.advance=r.readVarint())}const Uh=kc;function $h(i){let t=0,r=0;for(const d of i)t+=d.w*d.h,r=Math.max(r,d.w);i.sort((d,f)=>f.h-d.h);const s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let l=0,u=0;for(const d of i)for(let f=s.length-1;f>=0;f--){const _=s[f];if(!(d.w>_.w||d.h>_.h)){if(d.x=_.x,d.y=_.y,u=Math.max(u,d.y+d.h),l=Math.max(l,d.x+d.w),d.w===_.w&&d.h===_.h){const x=s.pop();f=0&&s>=t&&Ml[this.text.charCodeAt(s)];s--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)}substring(t,r){const s=new ya;return s.text=this.text.substring(t,r),s.sectionIndex=this.sectionIndex.slice(t,r),s.sections=this.sections,s}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,r)=>Math.max(t,this.sections[r].scale),0)}addTextSection(t,r){this.text+=t.text,this.sections.push(Mo.forText(t.scale,t.fontStack||r));const s=this.sections.length-1;for(let l=0;l=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Al(i,t,r,s,l,u,d,f,_,x,v,w,I,M,k){const z=ya.fromFeature(i,l);let F;w===L.ah.vertical&&z.verticalizePunctuation();const{processBidirectionalText:j,processStyledBidirectionalText:Q}=_i;if(j&&z.sections.length===1){F=[];const re=j(z.toString(),Ec(z,x,u,t,s,M));for(const ce of re){const we=new ya;we.text=ce,we.sections=z.sections;for(let Le=0;Le0&&an>Zt&&(Zt=an)}else{const Gi=we[Qe.fontStack],Bt=Gi&&Gi[_t];if(Bt&&Bt.rect)wa=Bt.rect,vt=Bt.metrics;else{const an=ce[Qe.fontStack],Lo=an&&an[_t];if(!Lo)continue;vt=Lo.metrics}Ci=(Dt-Qe.scale)*Ct}cr?(re.verticalizable=!0,ci.push({glyph:_t,imageName:Lr,x:Oe,y:ct+Ci,vertical:cr,scale:Qe.scale,fontStack:Qe.fontStack,sectionIndex:ut,metrics:vt,rect:wa}),Oe+=Rr*Qe.scale+ae):(ci.push({glyph:_t,imageName:Lr,x:Oe,y:ct+Ci,vertical:cr,scale:Qe.scale,fontStack:Qe.fontStack,sectionIndex:ut,metrics:vt,rect:wa}),Oe+=vt.advance*Qe.scale+ae)}ci.length!==0&&(lt=Math.max(Oe-ae,lt),ep(ci,0,ci.length-1,lr,Zt)),Oe=0;const Zi=ye*Dt+Zt;qt.lineOffset=Math.max(Zt,Yt),ct+=Zi,zt=Math.max(Zi,zt),++$t}var Et;const ai=ct-Ao,{horizontalAlign:oi,verticalAlign:li}=Dc(ke);(function(Tt,Dt,Yt,qt,ci,Zt,Zi,xi,Qe){const ut=(Dt-Yt)*ci;let _t=0;_t=Zt!==Zi?-xi*qt-Ao:(-qt*Qe+.5)*Zi;for(const Ci of Tt)for(const vt of Ci.positionedGlyphs)vt.x+=ut,vt.y+=_t})(re.positionedLines,lr,oi,li,lt,zt,ye,ai,ve.length),re.top+=-li*ai,re.bottom=re.top+ai,re.left+=-oi*lt,re.right=re.left+lt}(J,t,r,s,F,d,f,_,w,x,I,k),!function(re){for(const ce of re)if(ce.positionedGlyphs.length!==0)return!1;return!0}(G)&&J}const Ml={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Jd={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Yd={40:!0};function Zh(i,t,r,s,l,u){if(t.imageName){const d=s[t.imageName];return d?d.displaySize[0]*t.scale*Ct/u+l:0}{const d=r[t.fontStack],f=d&&d[i];return f?f.metrics.advance*t.scale+l:0}}function Gh(i,t,r,s){const l=Math.pow(i-t,2);return s?i=0;let x=0;for(let w=0;wx){const v=Math.ceil(u/x);l*=v/d,d=v}return{x1:s,y1:l,x2:s+u,y2:l+d}}function Kh(i,t,r,s,l,u){const d=i.image;let f;if(d.content){const F=d.content,j=d.pixelRatio||1;f=[F[0]/j,F[1]/j,d.displaySize[0]-F[2]/j,d.displaySize[1]-F[3]/j]}const _=t.left*u,x=t.right*u;let v,w,I,M;r==="width"||r==="both"?(M=l[0]+_-s[3],w=l[0]+x+s[1]):(M=l[0]+(_+x-d.displaySize[0])/2,w=M+d.displaySize[0]);const k=t.top*u,z=t.bottom*u;return r==="height"||r==="both"?(v=l[1]+k-s[0],I=l[1]+z+s[2]):(v=l[1]+(k+z-d.displaySize[1])/2,I=v+d.displaySize[1]),{image:d,top:v,right:w,bottom:I,left:M,collisionPadding:f}}const Co=255,Dr=128,$n=Co*Dr;function Jh(i,t){const{expression:r}=t;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new dt(i+1))};if(r.kind==="source")return{kind:"source"};{const{zoomStops:s,interpolationType:l}=r;let u=0;for(;ud.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=_c([]),this.placementViewportMatrix=_c([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Jh(this.zoom,r["text-size"]),this.iconSizeData=Jh(this.zoom,r["icon-size"]);const s=this.layers[0].layout,l=s.get("symbol-sort-key"),u=s.get("symbol-z-order");this.canOverlap=Lc(s,"text-overlap","text-allow-overlap")!=="never"||Lc(s,"icon-overlap","icon-allow-overlap")!=="never"||s.get("text-ignore-placement")||s.get("icon-ignore-placement"),this.sortFeaturesByKey=u!=="viewport-y"&&!l.isConstant(),this.sortFeaturesByY=(u==="viewport-y"||u==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,s.get("symbol-placement")==="point"&&(this.writingModes=s.get("text-writing-mode").map(d=>L.ah[d])),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id),this.sourceID=t.sourceID}createArrays(){this.text=new Bc(new vs(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new Bc(new vs(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new ft,this.lineVertexArray=new Vt,this.symbolInstances=new He,this.textAnchorOffsets=new mt}calculateGlyphDependencies(t,r,s,l,u){for(let d=0;d0)&&(d.value.kind!=="constant"||d.value.value.length>0),v=_.value.kind!=="constant"||!!_.value.value||Object.keys(_.parameters).length>0,w=u.get("symbol-sort-key");if(this.features=[],!x&&!v)return;const I=r.iconDependencies,M=r.glyphDependencies,k=r.availableImages,z=new dt(this.zoom);for(const{feature:F,id:j,index:Q,sourceLayerIndex:G}of t){const J=l._featureFilter.needGeometry,re=ws(F,J);if(!l._featureFilter.filter(z,re,s))continue;let ce,we;if(J||(re.geometry=bs(F)),x){const ve=l.getValueAndResolveTokens("text-field",re,s,k),ye=di.factory(ve),ke=this.hasRTLText=this.hasRTLText||np(ye);(!ke||_i.getRTLTextPluginStatus()==="unavailable"||ke&&_i.isParsed())&&(ce=Od(ye,l,re))}if(v){const ve=l.getValueAndResolveTokens("icon-image",re,s,k);we=ve instanceof fi?ve:fi.fromString(ve)}if(!ce&&!we)continue;const Le=this.sortFeaturesByKey?w.evaluate(re,{},s):void 0;if(this.features.push({id:j,text:ce,icon:we,index:Q,sourceLayerIndex:G,geometry:re.geometry,properties:F.properties,type:ip[F.type],sortKey:Le}),we&&(I[we.name]=!0),ce){const ve=d.evaluate(re,{},s).join(","),ye=u.get("text-rotation-alignment")!=="viewport"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(L.ah.vertical)>=0;for(const ke of ce.sections)if(ke.image)I[ke.image.name]=!0;else{const Pe=ho(ce.toString()),Se=ke.fontStack||ve,ae=M[Se]=M[Se]||{};this.calculateGlyphDependencies(ke.text,ae,ye,this.allowVerticalPlacement,Pe)}}}u.get("symbol-placement")==="line"&&(this.features=function(F){const j={},Q={},G=[];let J=0;function re(ve){G.push(F[ve]),J++}function ce(ve,ye,ke){const Pe=Q[ve];return delete Q[ve],Q[ye]=Pe,G[Pe].geometry[0].pop(),G[Pe].geometry[0]=G[Pe].geometry[0].concat(ke[0]),Pe}function we(ve,ye,ke){const Pe=j[ye];return delete j[ye],j[ve]=Pe,G[Pe].geometry[0].shift(),G[Pe].geometry[0]=ke[0].concat(G[Pe].geometry[0]),Pe}function Le(ve,ye,ke){const Pe=ke?ye[0][ye[0].length-1]:ye[0][0];return`${ve}:${Pe.x}:${Pe.y}`}for(let ve=0;veve.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((F,j)=>F.sortKey-j.sortKey)}update(t,r,s){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,r,this.layers,s),this.icon.programConfigurations.updatePaintArrays(t,r,this.layers,s))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,r){const s=this.lineVertexArray.length;if(t.segment!==void 0){let l=t.dist(r[t.segment+1]),u=t.dist(r[t.segment]);const d={};for(let f=t.segment+1;f=0;f--)d[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:u},f>0&&(u+=r[f-1].dist(r[f]));for(let f=0;f0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,r){const s=t.placedSymbolArray.get(r),l=s.vertexStartIndex+4*s.numGlyphs;for(let u=s.vertexStartIndex;ul[f]-l[_]||u[_]-u[f]),d}addToSortKeyRanges(t,r){const s=this.sortKeyRanges[this.sortKeyRanges.length-1];s&&s.sortKey===r?s.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const s=this.symbolInstances.get(r);this.featureSortOrder.push(s.featureIndex),[s.rightJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.leftJustifiedTextSymbolIndex].forEach((l,u,d)=>{l>=0&&d.indexOf(l)===u&&this.addIndicesForPlacedSymbol(this.text,l)}),s.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,s.verticalPlacedTextSymbolIndex),s.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.placedIconSymbolIndex),s.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Yh,Qh;Ie("SymbolBucket",xa,{omit:["layers","collisionBoxArray","features","compareText"]}),xa.MAX_GLYPHS=65535,xa.addDynamicAttributes=Rc;var Oc={get paint(){return Qh=Qh||new h({"icon-opacity":new Re(ie.paint_symbol["icon-opacity"]),"icon-color":new Re(ie.paint_symbol["icon-color"]),"icon-halo-color":new Re(ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new Re(ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Re(ie.paint_symbol["icon-halo-blur"]),"icon-translate":new Ae(ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ae(ie.paint_symbol["icon-translate-anchor"]),"text-opacity":new Re(ie.paint_symbol["text-opacity"]),"text-color":new Re(ie.paint_symbol["text-color"],{runtimeType:ti,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Re(ie.paint_symbol["text-halo-color"]),"text-halo-width":new Re(ie.paint_symbol["text-halo-width"]),"text-halo-blur":new Re(ie.paint_symbol["text-halo-blur"]),"text-translate":new Ae(ie.paint_symbol["text-translate"]),"text-translate-anchor":new Ae(ie.paint_symbol["text-translate-anchor"])})},get layout(){return Yh=Yh||new h({"symbol-placement":new Ae(ie.layout_symbol["symbol-placement"]),"symbol-spacing":new Ae(ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ae(ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Re(ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ae(ie.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ae(ie.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ae(ie.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ae(ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ae(ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ae(ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new Re(ie.layout_symbol["icon-size"]),"icon-text-fit":new Ae(ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ae(ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new Re(ie.layout_symbol["icon-image"]),"icon-rotate":new Re(ie.layout_symbol["icon-rotate"]),"icon-padding":new Re(ie.layout_symbol["icon-padding"]),"icon-keep-upright":new Ae(ie.layout_symbol["icon-keep-upright"]),"icon-offset":new Re(ie.layout_symbol["icon-offset"]),"icon-anchor":new Re(ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ae(ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ae(ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ae(ie.layout_symbol["text-rotation-alignment"]),"text-field":new Re(ie.layout_symbol["text-field"]),"text-font":new Re(ie.layout_symbol["text-font"]),"text-size":new Re(ie.layout_symbol["text-size"]),"text-max-width":new Re(ie.layout_symbol["text-max-width"]),"text-line-height":new Ae(ie.layout_symbol["text-line-height"]),"text-letter-spacing":new Re(ie.layout_symbol["text-letter-spacing"]),"text-justify":new Re(ie.layout_symbol["text-justify"]),"text-radial-offset":new Re(ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ae(ie.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Re(ie.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Re(ie.layout_symbol["text-anchor"]),"text-max-angle":new Ae(ie.layout_symbol["text-max-angle"]),"text-writing-mode":new Ae(ie.layout_symbol["text-writing-mode"]),"text-rotate":new Re(ie.layout_symbol["text-rotate"]),"text-padding":new Ae(ie.layout_symbol["text-padding"]),"text-keep-upright":new Ae(ie.layout_symbol["text-keep-upright"]),"text-transform":new Re(ie.layout_symbol["text-transform"]),"text-offset":new Re(ie.layout_symbol["text-offset"]),"text-allow-overlap":new Ae(ie.layout_symbol["text-allow-overlap"]),"text-overlap":new Ae(ie.layout_symbol["text-overlap"]),"text-ignore-placement":new Ae(ie.layout_symbol["text-ignore-placement"]),"text-optional":new Ae(ie.layout_symbol["text-optional"])})}};class eu{constructor(t){if(t.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:Ar,this.defaultValue=t}evaluate(t){if(t.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(t.formattedSection))return r.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ie("FormatSectionOverride",eu,{omit:["defaultValue"]});class kl extends n{constructor(t){super(t,Oc)}recalculate(t,r){if(super.recalculate(t,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const s=this.layout.get("text-writing-mode");if(s){const l=[];for(const u of s)l.indexOf(u)<0&&l.push(u);this.layout._values["text-writing-mode"]=l}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,r,s,l){const u=this.layout.get(t).evaluate(r,{},s,l),d=this._unevaluatedLayout._values[t];return d.isDataDriven()||Gs(d.value)||!u?u:function(f,_){return _.replace(/{([^{}]+)}/g,(x,v)=>f&&v in f?String(f[v]):"")}(r.properties,u)}createBucket(t){return new xa(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of Oc.paint.overridableProperties){if(!kl.hasPaintOverride(this.layout,t))continue;const r=this.paint.get(t),s=new eu(r),l=new Zs(s,r.property.specification);let u=null;u=r.value.kind==="constant"||r.value.kind==="source"?new In("source",l):new Pn("composite",l,r.value.zoomStops),this.paint._values[t]=new ar(r.property,u,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,s){return!(!this.layout||r.isDataDriven()||s.isDataDriven())&&kl.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,r){const s=t.get("text-field"),l=Oc.paint.properties[r];let u=!1;const d=f=>{for(const _ of f)if(l.overrides&&l.overrides.hasOverride(_))return void(u=!0)};if(s.value.kind==="constant"&&s.value.value instanceof di)d(s.value.value.sections);else if(s.value.kind==="source"){const f=x=>{u||(x instanceof Bi&&At(x.value)===mr?d(x.value.sections):x instanceof Bs?d(x.sections):x.eachChild(f))},_=s.value;_._styleExpression&&f(_._styleExpression.expression)}return u}}let tu;var sp={get paint(){return tu=tu||new h({"background-color":new Ae(ie.paint_background["background-color"]),"background-pattern":new sa(ie.paint_background["background-pattern"]),"background-opacity":new Ae(ie.paint_background["background-opacity"])})}};class ap extends n{constructor(t){super(t,sp)}}let iu;var op={get paint(){return iu=iu||new h({"raster-opacity":new Ae(ie.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ae(ie.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ae(ie.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ae(ie.paint_raster["raster-brightness-max"]),"raster-saturation":new Ae(ie.paint_raster["raster-saturation"]),"raster-contrast":new Ae(ie.paint_raster["raster-contrast"]),"raster-resampling":new Ae(ie.paint_raster["raster-resampling"]),"raster-fade-duration":new Ae(ie.paint_raster["raster-fade-duration"])})}};class lp extends n{constructor(t){super(t,op)}}class cp extends n{constructor(t){super(t,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class hp{constructor(t){this._methodToThrottle=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const Vc=63710088e-1;class qn{constructor(t,r){if(isNaN(t)||isNaN(r))throw new Error(`Invalid LngLat object: (${t}, ${r})`);if(this.lng=+t,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new qn(Ki(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const r=Math.PI/180,s=this.lat*r,l=t.lat*r,u=Math.sin(s)*Math.sin(l)+Math.cos(s)*Math.cos(l)*Math.cos((t.lng-this.lng)*r);return Vc*Math.acos(Math.min(u,1))}static convert(t){if(t instanceof qn)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new qn(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new qn(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const ru=2*Math.PI*Vc;function nu(i){return ru*Math.cos(i*Math.PI/180)}function su(i){return(180+i)/360}function au(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function ou(i,t){return i/nu(t)}function Nc(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class ko{constructor(t,r,s=0){this.x=+t,this.y=+r,this.z=+s}static fromLngLat(t,r=0){const s=qn.convert(t);return new ko(su(s.lng),au(s.lat),ou(r,s.lat))}toLngLat(){return new qn(360*this.x-180,Nc(this.y))}toAltitude(){return this.z*nu(Nc(this.y))}meterInMercatorCoordinateUnits(){return 1/ru*(t=Nc(this.y),1/Math.cos(t*Math.PI/180));var t}}function lu(i,t,r){var s=2*Math.PI*6378137/256/Math.pow(2,r);return[i*s-2*Math.PI*6378137/2,t*s-2*Math.PI*6378137/2]}class jc{constructor(t,r,s){if(!function(l,u,d){return!(l<0||l>25||d<0||d>=Math.pow(2,l)||u<0||u>=Math.pow(2,l))}(t,r,s))throw new Error(`x=${r}, y=${s}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=r,this.y=s,this.key=zo(0,t,t,r,s)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,r,s){const l=(d=this.y,f=this.z,_=lu(256*(u=this.x),256*(d=Math.pow(2,f)-d-1),f),x=lu(256*(u+1),256*(d+1),f),_[0]+","+_[1]+","+x[0]+","+x[1]);var u,d,f,_,x;const v=function(w,I,M){let k,z="";for(let F=w;F>0;F--)k=1<1?"@2x":"").replace(/{quadkey}/g,v).replace(/{bbox-epsg-3857}/g,l)}isChildOf(t){const r=this.z-t.z;return r>0&&t.x===this.x>>r&&t.y===this.y>>r}getTilePoint(t){const r=Math.pow(2,this.z);return new me((t.x*r-this.x)*Mt,(t.y*r-this.y)*Mt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class cu{constructor(t,r){this.wrap=t,this.canonical=r,this.key=zo(t,r.z,r.z,r.x,r.y)}}class qi{constructor(t,r,s,l,u){if(t= z; overscaledZ = ${t}; z = ${s}`);this.overscaledZ=t,this.wrap=r,this.canonical=new jc(s,+l,+u),this.key=zo(r,t,s,l,u)}clone(){return new qi(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-t;return t>this.canonical.z?new qi(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new qi(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(t,r){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const s=this.canonical.z-t;return t>this.canonical.z?zo(this.wrap*+r,t,this.canonical.z,this.canonical.x,this.canonical.y):zo(this.wrap*+r,t,t,this.canonical.x>>s,this.canonical.y>>s)}isChildOf(t){if(t.wrap!==this.wrap)return!1;const r=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ>r&&t.canonical.y===this.canonical.y>>r}children(t){if(this.overscaledZ>=t)return[new qi(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,s=2*this.canonical.x,l=2*this.canonical.y;return[new qi(r,this.wrap,r,s,l),new qi(r,this.wrap,r,s+1,l),new qi(r,this.wrap,r,s,l+1),new qi(r,this.wrap,r,s+1,l+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.ythis.max&&(this.max=w),w=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(t+1)}unpack(t,r,s){return t*this.redFactor+r*this.greenFactor+s*this.blueFactor-this.baseShift}getPixels(){return new $i({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,r,s){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let l=r*this.dim,u=r*this.dim+this.dim,d=s*this.dim,f=s*this.dim+this.dim;switch(r){case-1:l=u-1;break;case 1:u=l+1}switch(s){case-1:d=f-1;break;case 1:f=d+1}const _=-r*this.dim,x=-s*this.dim;for(let v=d;v=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class du{constructor(t,r,s,l,u){this.type="Feature",this._vectorTileFeature=t,t._z=r,t._x=s,t._y=l,this.properties=t.properties,this.id=u}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(t[r]=this[r]);return t}}class pu{constructor(t,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new kn(Mt,16,0),this.grid3D=new kn(Mt,16,0),this.featureIndexArray=new Kt,this.promoteId=r}insert(t,r,s,l,u,d){const f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(s,l,u);const _=d?this.grid3D:this.grid;for(let x=0;x=0&&w[3]>=0&&_.insert(f,w[0],w[1],w[2],w[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new jn.VectorTile(new Cc(this.rawTileData)).layers,this.sourceLayerCoder=new uu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,r,s,l){this.loadVTLayers();const u=t.params||{},d=Mt/t.tileSize/t.scale,f=Wa(u.filter),_=t.queryGeometry,x=t.queryPadding*d,v=mu(_),w=this.grid.query(v.minX-x,v.minY-x,v.maxX+x,v.maxY+x),I=mu(t.cameraQueryGeometry),M=this.grid3D.query(I.minX-x,I.minY-x,I.maxX+x,I.maxY+x,(F,j,Q,G)=>function(J,re,ce,we,Le){for(const ye of J)if(re<=ye.x&&ce<=ye.y&&we>=ye.x&&Le>=ye.y)return!0;const ve=[new me(re,ce),new me(re,Le),new me(we,Le),new me(we,ce)];if(J.length>2){for(const ye of ve)if(da(J,ye))return!0}for(let ye=0;ye(G||(G=bs(J)),re.queryIntersectsFeature(_,J,ce,G,this.z,t.transform,d,t.pixelPosMatrix)))}return k}loadMatchingFeature(t,r,s,l,u,d,f,_,x,v,w){const I=this.bucketLayerIDs[r];if(d&&!function(F,j){for(let Q=0;Q=0)return!0;return!1}(d,I))return;const M=this.sourceLayerCoder.decode(s),k=this.vtLayers[M].feature(l);if(u.needGeometry){const F=ws(k,!0);if(!u.filter(new dt(this.tileID.overscaledZ),F,this.tileID.canonical))return}else if(!u.filter(new dt(this.tileID.overscaledZ),k))return;const z=this.getId(k,M);for(let F=0;F{const f=t instanceof gs?t.get(d):null;return f&&f.evaluate?f.evaluate(r,s,l):f})}function mu(i){let t=1/0,r=1/0,s=-1/0,l=-1/0;for(const u of i)t=Math.min(t,u.x),r=Math.min(r,u.y),s=Math.max(s,u.x),l=Math.max(l,u.y);return{minX:t,minY:r,maxX:s,maxY:l}}function up(i,t){return t-i}function _u(i,t,r,s,l){const u=[];for(let d=0;d=s&&w.x>=s||(v.x>=s?v=new me(s,v.y+(s-v.x)/(w.x-v.x)*(w.y-v.y))._round():w.x>=s&&(w=new me(s,v.y+(s-v.x)/(w.x-v.x)*(w.y-v.y))._round()),v.y>=l&&w.y>=l||(v.y>=l?v=new me(v.x+(l-v.y)/(w.y-v.y)*(w.x-v.x),l)._round():w.y>=l&&(w=new me(v.x+(l-v.y)/(w.y-v.y)*(w.x-v.x),l)._round()),_&&v.equals(_[_.length-1])||(_=[v],u.push(_)),_.push(w)))))}}return u}Ie("FeatureIndex",pu,{omit:["rawTileData","sourceLayerCoder"]});class Zn extends me{constructor(t,r,s,l){super(t,r),this.angle=s,l!==void 0&&(this.segment=l)}clone(){return new Zn(this.x,this.y,this.angle,this.segment)}}function gu(i,t,r,s,l){if(t.segment===void 0||r===0)return!0;let u=t,d=t.segment+1,f=0;for(;f>-r/2;){if(d--,d<0)return!1;f-=i[d].dist(u),u=i[d]}f+=i[d].dist(i[d+1]),d++;const _=[];let x=0;for(;fs;)x-=_.shift().angleDelta;if(x>l)return!1;d++,f+=v.dist(w)}return!0}function yu(i){let t=0;for(let r=0;rx){const k=(x-_)/M,z=ii.number(w.x,I.x,k),F=ii.number(w.y,I.y,k),j=new Zn(z,F,I.angleTo(w),v);return j._round(),!d||gu(i,j,f,d,t)?j:void 0}_+=M}}function pp(i,t,r,s,l,u,d,f,_){const x=xu(s,u,d),v=vu(s,l),w=v*d,I=i[0].x===0||i[0].x===_||i[0].y===0||i[0].y===_;return t-w=0&&J<_&&re>=0&&re<_&&I-x>=0&&I+x<=v){const ce=new Zn(J,re,Q,k);ce._round(),s&&!gu(i,ce,u,s,l)||M.push(ce)}}w+=j}return f||M.length||d||(M=bu(i,w/2,r,s,l,u,d,!0,_)),M}Ie("Anchor",Zn);const va=yi;function wu(i,t,r,s){const l=[],u=i.image,d=u.pixelRatio,f=u.paddedRect.w-2*va,_=u.paddedRect.h-2*va;let x={x1:i.left,y1:i.top,x2:i.right,y2:i.bottom};const v=u.stretchX||[[0,f]],w=u.stretchY||[[0,_]],I=(ae,ze)=>ae+ze[1]-ze[0],M=v.reduce(I,0),k=w.reduce(I,0),z=f-M,F=_-k;let j=0,Q=M,G=0,J=k,re=0,ce=z,we=0,Le=F;if(u.content&&s){const ae=u.content,ze=ae[2]-ae[0],Ce=ae[3]-ae[1];(u.textFitWidth||u.textFitHeight)&&(x=Wh(i)),j=zl(v,0,ae[0]),G=zl(w,0,ae[1]),Q=zl(v,ae[0],ae[2]),J=zl(w,ae[1],ae[3]),re=ae[0]-j,we=ae[1]-G,ce=ze-Q,Le=Ce-J}const ve=x.x1,ye=x.y1,ke=x.x2-ve,Pe=x.y2-ye,Se=(ae,ze,Ce,Oe)=>{const ct=El(ae.stretch-j,Q,ke,ve),lt=Dl(ae.fixed-re,ce,ae.stretch,M),zt=El(ze.stretch-G,J,Pe,ye),lr=Dl(ze.fixed-we,Le,ze.stretch,k),$t=El(Ce.stretch-j,Q,ke,ve),Et=Dl(Ce.fixed-re,ce,Ce.stretch,M),ai=El(Oe.stretch-G,J,Pe,ye),oi=Dl(Oe.fixed-we,Le,Oe.stretch,k),li=new me(ct,zt),Tt=new me($t,zt),Dt=new me($t,ai),Yt=new me(ct,ai),qt=new me(lt/d,lr/d),ci=new me(Et/d,oi/d),Zt=t*Math.PI/180;if(Zt){const Qe=Math.sin(Zt),ut=Math.cos(Zt),_t=[ut,-Qe,Qe,ut];li._matMult(_t),Tt._matMult(_t),Yt._matMult(_t),Dt._matMult(_t)}const Zi=ae.stretch+ae.fixed,xi=ze.stretch+ze.fixed;return{tl:li,tr:Tt,bl:Yt,br:Dt,tex:{x:u.paddedRect.x+va+Zi,y:u.paddedRect.y+va+xi,w:Ce.stretch+Ce.fixed-Zi,h:Oe.stretch+Oe.fixed-xi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:qt,pixelOffsetBR:ci,minFontScaleX:ce/d/ke,minFontScaleY:Le/d/Pe,isSDF:r}};if(s&&(u.stretchX||u.stretchY)){const ae=Tu(v,z,M),ze=Tu(w,F,k);for(let Ce=0;Ce0&&(z=Math.max(10,z),this.circleDiameter=z)}else{const I=!((w=d.image)===null||w===void 0)&&w.content&&(d.image.textFitWidth||d.image.textFitHeight)?Wh(d):{x1:d.left,y1:d.top,x2:d.right,y2:d.bottom};I.y1=I.y1*f-_[0],I.y2=I.y2*f+_[2],I.x1=I.x1*f-_[3],I.x2=I.x2*f+_[1];const M=d.collisionPadding;if(M&&(I.x1-=M[0]*f,I.y1-=M[1]*f,I.x2+=M[2]*f,I.y2+=M[3]*f),v){const k=new me(I.x1,I.y1),z=new me(I.x2,I.y1),F=new me(I.x1,I.y2),j=new me(I.x2,I.y2),Q=v*Math.PI/180;k._rotate(Q),z._rotate(Q),F._rotate(Q),j._rotate(Q),I.x1=Math.min(k.x,z.x,F.x,j.x),I.x2=Math.max(k.x,z.x,F.x,j.x),I.y1=Math.min(k.y,z.y,F.y,j.y),I.y2=Math.max(k.y,z.y,F.y,j.y)}t.emplaceBack(r.x,r.y,I.x1,I.y1,I.x2,I.y2,s,l,u)}this.boxEndIndex=t.length}}class fp{constructor(t=[],r=(s,l)=>sl?1:0){if(this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(let s=(this.length>>1)-1;s>=0;s--)this._down(s)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;const t=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:r,compare:s}=this,l=r[t];for(;t>0;){const u=t-1>>1,d=r[u];if(s(l,d)>=0)break;r[t]=d,t=u}r[t]=l}_down(t){const{data:r,compare:s}=this,l=this.length>>1,u=r[t];for(;t=0)break;r[t]=r[d],t=d}r[t]=u}}function mp(i,t=1,r=!1){let s=1/0,l=1/0,u=-1/0,d=-1/0;const f=i[0];for(let M=0;Mu)&&(u=k.x),(!M||k.y>d)&&(d=k.y)}const _=Math.min(u-s,d-l);let x=_/2;const v=new fp([],_p);if(_===0)return new me(s,l);for(let M=s;Mw.d||!w.d)&&(w=M,r&&console.log("found best %d after %d probes",Math.round(1e4*M.d)/1e4,I)),M.max-w.d<=t||(x=M.h/2,v.push(new ba(M.p.x-x,M.p.y-x,x,i)),v.push(new ba(M.p.x+x,M.p.y-x,x,i)),v.push(new ba(M.p.x-x,M.p.y+x,x,i)),v.push(new ba(M.p.x+x,M.p.y+x,x,i)),I+=4)}return r&&(console.log(`num probes: ${I}`),console.log(`best distance: ${w.d}`)),w.p}function _p(i,t){return t.max-i.max}function ba(i,t,r,s){this.p=new me(i,t),this.h=r,this.d=function(l,u){let d=!1,f=1/0;for(let _=0;_l.y!=k.y>l.y&&l.x<(k.x-M.x)*(l.y-M.y)/(k.y-M.y)+M.x&&(d=!d),f=Math.min(f,ah(l,M,k))}}return(d?1:-1)*Math.sqrt(f)}(this.p,s),this.max=this.d+this.h*Math.SQRT2}var Ut;L.aq=void 0,(Ut=L.aq||(L.aq={}))[Ut.center=1]="center",Ut[Ut.left=2]="left",Ut[Ut.right=3]="right",Ut[Ut.top=4]="top",Ut[Ut.bottom=5]="bottom",Ut[Ut["top-left"]=6]="top-left",Ut[Ut["top-right"]=7]="top-right",Ut[Ut["bottom-left"]=8]="bottom-left",Ut[Ut["bottom-right"]=9]="bottom-right";const Gn=7,Uc=Number.POSITIVE_INFINITY;function Su(i,t){return t[1]!==Uc?function(r,s,l){let u=0,d=0;switch(s=Math.abs(s),l=Math.abs(l),r){case"top-right":case"top-left":case"top":d=l-Gn;break;case"bottom-right":case"bottom-left":case"bottom":d=-l+Gn}switch(r){case"top-right":case"bottom-right":case"right":u=-s;break;case"top-left":case"bottom-left":case"left":u=s}return[u,d]}(i,t[0],t[1]):function(r,s){let l=0,u=0;s<0&&(s=0);const d=s/Math.SQRT2;switch(r){case"top-right":case"top-left":u=d-Gn;break;case"bottom-right":case"bottom-left":u=-d+Gn;break;case"bottom":u=-s+Gn;break;case"top":u=s-Gn}switch(r){case"top-right":case"bottom-right":l=-d;break;case"top-left":case"bottom-left":l=d;break;case"left":l=s;break;case"right":l=-s}return[l,u]}(i,t[0])}function Iu(i,t,r){var s;const l=i.layout,u=(s=l.get("text-variable-anchor-offset"))===null||s===void 0?void 0:s.evaluate(t,{},r);if(u){const f=u.values,_=[];for(let x=0;xI*Ct);v.startsWith("top")?w[1]-=Gn:v.startsWith("bottom")&&(w[1]+=Gn),_[x+1]=w}return new wi(_)}const d=l.get("text-variable-anchor");if(d){let f;f=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[l.get("text-radial-offset").evaluate(t,{},r)*Ct,Uc]:l.get("text-offset").evaluate(t,{},r).map(x=>x*Ct);const _=[];for(const x of d)_.push(x,Su(x,f));return new wi(_)}return null}function $c(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 gp(i,t,r,s,l,u,d,f,_,x,v){let w=u.textMaxSize.evaluate(t,{});w===void 0&&(w=d);const I=i.layers[0].layout,M=I.get("icon-offset").evaluate(t,{},v),k=Au(r.horizontal),z=d/24,F=i.tilePixelRatio*z,j=i.tilePixelRatio*w/24,Q=i.tilePixelRatio*f,G=i.tilePixelRatio*I.get("symbol-spacing"),J=I.get("text-padding")*i.tilePixelRatio,re=function(ae,ze,Ce,Oe=1){const ct=ae.get("icon-padding").evaluate(ze,{},Ce),lt=ct&&ct.values;return[lt[0]*Oe,lt[1]*Oe,lt[2]*Oe,lt[3]*Oe]}(I,t,v,i.tilePixelRatio),ce=I.get("text-max-angle")/180*Math.PI,we=I.get("text-rotation-alignment")!=="viewport"&&I.get("symbol-placement")!=="point",Le=I.get("icon-rotation-alignment")==="map"&&I.get("symbol-placement")!=="point",ve=I.get("symbol-placement"),ye=G/2,ke=I.get("icon-text-fit");let Pe;s&&ke!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(Pe=Kh(s,r.vertical,ke,I.get("icon-text-fit-padding"),M,z)),k&&(s=Kh(s,k,ke,I.get("icon-text-fit-padding"),M,z)));const Se=(ae,ze)=>{ze.x<0||ze.x>=Mt||ze.y<0||ze.y>=Mt||function(Ce,Oe,ct,lt,zt,lr,$t,Et,ai,oi,li,Tt,Dt,Yt,qt,ci,Zt,Zi,xi,Qe,ut,_t,Ci,vt,wa){const Lr=Ce.addToLineVertexArray(Oe,ct);let Rr,cr,Gi,Bt,an=0,Lo=0,zu=0,Eu=0,Jc=-1,Yc=-1;const on={};let Du=la("");if(Ce.allowVerticalPlacement&<.vertical){const Qt=Et.layout.get("text-rotate").evaluate(ut,{},vt)+90;Gi=new Ll(ai,Oe,oi,li,Tt,lt.vertical,Dt,Yt,qt,Qt),$t&&(Bt=new Ll(ai,Oe,oi,li,Tt,$t,Zt,Zi,qt,Qt))}if(zt){const Qt=Et.layout.get("icon-rotate").evaluate(ut,{}),Hi=Et.layout.get("icon-text-fit")!=="none",Ss=wu(zt,Qt,Ci,Hi),vr=$t?wu($t,Qt,Ci,Hi):void 0;cr=new Ll(ai,Oe,oi,li,Tt,zt,Zt,Zi,!1,Qt),an=4*Ss.length;const Is=Ce.iconSizeData;let Br=null;Is.kind==="source"?(Br=[Dr*Et.layout.get("icon-size").evaluate(ut,{})],Br[0]>$n&&Ft(`${Ce.layerIds[0]}: Value for "icon-size" is >= ${Co}. Reduce your "icon-size".`)):Is.kind==="composite"&&(Br=[Dr*_t.compositeIconSizes[0].evaluate(ut,{},vt),Dr*_t.compositeIconSizes[1].evaluate(ut,{},vt)],(Br[0]>$n||Br[1]>$n)&&Ft(`${Ce.layerIds[0]}: Value for "icon-size" is >= ${Co}. Reduce your "icon-size".`)),Ce.addSymbols(Ce.icon,Ss,Br,Qe,xi,ut,L.ah.none,Oe,Lr.lineStartIndex,Lr.lineLength,-1,vt),Jc=Ce.icon.placedSymbolArray.length-1,vr&&(Lo=4*vr.length,Ce.addSymbols(Ce.icon,vr,Br,Qe,xi,ut,L.ah.vertical,Oe,Lr.lineStartIndex,Lr.lineLength,-1,vt),Yc=Ce.icon.placedSymbolArray.length-1)}const Lu=Object.keys(lt.horizontal);for(const Qt of Lu){const Hi=lt.horizontal[Qt];if(!Rr){Du=la(Hi.text);const vr=Et.layout.get("text-rotate").evaluate(ut,{},vt);Rr=new Ll(ai,Oe,oi,li,Tt,Hi,Dt,Yt,qt,vr)}const Ss=Hi.positionedLines.length===1;if(zu+=Pu(Ce,Oe,Hi,lr,Et,qt,ut,ci,Lr,lt.vertical?L.ah.horizontal:L.ah.horizontalOnly,Ss?Lu:[Qt],on,Jc,_t,vt),Ss)break}lt.vertical&&(Eu+=Pu(Ce,Oe,lt.vertical,lr,Et,qt,ut,ci,Lr,L.ah.vertical,["vertical"],on,Yc,_t,vt));const vp=Rr?Rr.boxStartIndex:Ce.collisionBoxArray.length,bp=Rr?Rr.boxEndIndex:Ce.collisionBoxArray.length,wp=Gi?Gi.boxStartIndex:Ce.collisionBoxArray.length,Tp=Gi?Gi.boxEndIndex:Ce.collisionBoxArray.length,Sp=cr?cr.boxStartIndex:Ce.collisionBoxArray.length,Ip=cr?cr.boxEndIndex:Ce.collisionBoxArray.length,Pp=Bt?Bt.boxStartIndex:Ce.collisionBoxArray.length,Ap=Bt?Bt.boxEndIndex:Ce.collisionBoxArray.length;let xr=-1;const Bl=(Qt,Hi)=>Qt&&Qt.circleDiameter?Math.max(Qt.circleDiameter,Hi):Hi;xr=Bl(Rr,xr),xr=Bl(Gi,xr),xr=Bl(cr,xr),xr=Bl(Bt,xr);const Ru=xr>-1?1:0;Ru&&(xr*=wa/Ct),Ce.glyphOffsetArray.length>=xa.MAX_GLYPHS&&Ft("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),ut.sortKey!==void 0&&Ce.addToSortKeyRanges(Ce.symbolInstances.length,ut.sortKey);const Mp=Iu(Et,ut,vt),[Cp,kp]=function(Qt,Hi){const Ss=Qt.length,vr=Hi==null?void 0:Hi.values;if((vr==null?void 0:vr.length)>0)for(let Is=0;Is=0?on.right:-1,on.center>=0?on.center:-1,on.left>=0?on.left:-1,on.vertical||-1,Jc,Yc,Du,vp,bp,wp,Tp,Sp,Ip,Pp,Ap,oi,zu,Eu,an,Lo,Ru,0,Dt,xr,Cp,kp)}(i,ze,ae,r,s,l,Pe,i.layers[0],i.collisionBoxArray,t.index,t.sourceLayerIndex,i.index,F,[J,J,J,J],we,_,Q,re,Le,M,t,u,x,v,d)};if(ve==="line")for(const ae of _u(t.geometry,0,0,Mt,Mt)){const ze=pp(ae,G,ce,r.vertical||k,s,24,j,i.overscaling,Mt);for(const Ce of ze)k&&yp(i,k.text,ye,Ce)||Se(ae,Ce)}else if(ve==="line-center"){for(const ae of t.geometry)if(ae.length>1){const ze=dp(ae,ce,r.vertical||k,s,24,j);ze&&Se(ae,ze)}}else if(t.type==="Polygon")for(const ae of Os(t.geometry,0)){const ze=mp(ae,16);Se(ae[0],new Zn(ze.x,ze.y,0))}else if(t.type==="LineString")for(const ae of t.geometry)Se(ae,new Zn(ae[0].x,ae[0].y,0));else if(t.type==="Point")for(const ae of t.geometry)for(const ze of ae)Se([ze],new Zn(ze.x,ze.y,0))}function Pu(i,t,r,s,l,u,d,f,_,x,v,w,I,M,k){const z=function(Q,G,J,re,ce,we,Le,ve){const ye=re.layout.get("text-rotate").evaluate(we,{})*Math.PI/180,ke=[];for(const Pe of G.positionedLines)for(const Se of Pe.positionedGlyphs){if(!Se.rect)continue;const ae=Se.rect||{};let ze=Uh+1,Ce=!0,Oe=1,ct=0;const lt=(ce||ve)&&Se.vertical,zt=Se.metrics.advance*Se.scale/2;if(ve&&G.verticalizable&&(ct=Pe.lineOffset/2-(Se.imageName?-(Ct-Se.metrics.width*Se.scale)/2:(Se.scale-1)*Ct)),Se.imageName){const Qe=Le[Se.imageName];Ce=Qe.sdf,Oe=Qe.pixelRatio,ze=yi/Oe}const lr=ce?[Se.x+zt,Se.y]:[0,0];let $t=ce?[0,0]:[Se.x+zt+J[0],Se.y+J[1]-ct],Et=[0,0];lt&&(Et=$t,$t=[0,0]);const ai=Se.metrics.isDoubleResolution?2:1,oi=(Se.metrics.left-ze)*Se.scale-zt+$t[0],li=(-Se.metrics.top-ze)*Se.scale+$t[1],Tt=oi+ae.w/ai*Se.scale/Oe,Dt=li+ae.h/ai*Se.scale/Oe,Yt=new me(oi,li),qt=new me(Tt,li),ci=new me(oi,Dt),Zt=new me(Tt,Dt);if(lt){const Qe=new me(-zt,zt-Ao),ut=-Math.PI/2,_t=Ct/2-zt,Ci=new me(5-Ao-_t,-(Se.imageName?_t:0)),vt=new me(...Et);Yt._rotateAround(ut,Qe)._add(Ci)._add(vt),qt._rotateAround(ut,Qe)._add(Ci)._add(vt),ci._rotateAround(ut,Qe)._add(Ci)._add(vt),Zt._rotateAround(ut,Qe)._add(Ci)._add(vt)}if(ye){const Qe=Math.sin(ye),ut=Math.cos(ye),_t=[ut,-Qe,Qe,ut];Yt._matMult(_t),qt._matMult(_t),ci._matMult(_t),Zt._matMult(_t)}const Zi=new me(0,0),xi=new me(0,0);ke.push({tl:Yt,tr:qt,bl:ci,br:Zt,tex:ae,writingMode:G.writingMode,glyphOffset:lr,sectionIndex:Se.sectionIndex,isSDF:Ce,pixelOffsetTL:Zi,pixelOffsetBR:xi,minFontScaleX:0,minFontScaleY:0})}return ke}(0,r,f,l,u,d,s,i.allowVerticalPlacement),F=i.textSizeData;let j=null;F.kind==="source"?(j=[Dr*l.layout.get("text-size").evaluate(d,{})],j[0]>$n&&Ft(`${i.layerIds[0]}: Value for "text-size" is >= ${Co}. Reduce your "text-size".`)):F.kind==="composite"&&(j=[Dr*M.compositeTextSizes[0].evaluate(d,{},k),Dr*M.compositeTextSizes[1].evaluate(d,{},k)],(j[0]>$n||j[1]>$n)&&Ft(`${i.layerIds[0]}: Value for "text-size" is >= ${Co}. Reduce your "text-size".`)),i.addSymbols(i.text,z,j,f,u,d,x,t,_.lineStartIndex,_.lineLength,I,k);for(const Q of v)w[Q]=i.text.placedSymbolArray.length-1;return 4*z.length}function Au(i){for(const t in i)return i[t];return null}function yp(i,t,r,s){const l=i.compareText;if(t in l){const u=l[t];for(let d=u.length-1;d>=0;d--)if(s.dist(u[d])>4;if(l!==1)throw new Error(`Got v${l} data when expected v1.`);const u=Mu[15&s];if(!u)throw new Error("Unrecognized array type.");const[d]=new Uint16Array(t,2,1),[f]=new Uint32Array(t,4,1);return new qc(f,d,u,t)}constructor(t,r=64,s=Float64Array,l){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=s,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const u=Mu.indexOf(this.ArrayType),d=2*t*this.ArrayType.BYTES_PER_ELEMENT,f=t*this.IndexArrayType.BYTES_PER_ELEMENT,_=(8-f%8)%8;if(u<0)throw new Error(`Unexpected typed array class: ${s}.`);l&&l instanceof ArrayBuffer?(this.data=l,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+f+_,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+d+f+_),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+f+_,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+u]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}add(t,r){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=t,this.coords[this._pos++]=r,s}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Zc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,s,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:d,nodeSize:f}=this,_=[0,u.length-1,0],x=[];for(;_.length;){const v=_.pop()||0,w=_.pop()||0,I=_.pop()||0;if(w-I<=f){for(let F=I;F<=w;F++){const j=d[2*F],Q=d[2*F+1];j>=t&&j<=s&&Q>=r&&Q<=l&&x.push(u[F])}continue}const M=I+w>>1,k=d[2*M],z=d[2*M+1];k>=t&&k<=s&&z>=r&&z<=l&&x.push(u[M]),(v===0?t<=k:r<=z)&&(_.push(I),_.push(M-1),_.push(1-v)),(v===0?s>=k:l>=z)&&(_.push(M+1),_.push(w),_.push(1-v))}return x}within(t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:l,coords:u,nodeSize:d}=this,f=[0,l.length-1,0],_=[],x=s*s;for(;f.length;){const v=f.pop()||0,w=f.pop()||0,I=f.pop()||0;if(w-I<=d){for(let F=I;F<=w;F++)ku(u[2*F],u[2*F+1],t,r)<=x&&_.push(l[F]);continue}const M=I+w>>1,k=u[2*M],z=u[2*M+1];ku(k,z,t,r)<=x&&_.push(l[M]),(v===0?t-s<=k:r-s<=z)&&(f.push(I),f.push(M-1),f.push(1-v)),(v===0?t+s>=k:r+s>=z)&&(f.push(M+1),f.push(w),f.push(1-v))}return _}}function Zc(i,t,r,s,l,u){if(l-s<=r)return;const d=s+l>>1;Cu(i,t,d,s,l,u),Zc(i,t,r,s,d-1,1-u),Zc(i,t,r,d+1,l,1-u)}function Cu(i,t,r,s,l,u){for(;l>s;){if(l-s>600){const x=l-s+1,v=r-s+1,w=Math.log(x),I=.5*Math.exp(2*w/3),M=.5*Math.sqrt(w*I*(x-I)/x)*(v-x/2<0?-1:1);Cu(i,t,r,Math.max(s,Math.floor(r-v*I/x+M)),Math.min(l,Math.floor(r+(x-v)*I/x+M)),u)}const d=t[2*r+u];let f=s,_=l;for(Eo(i,t,s,r),t[2*l+u]>d&&Eo(i,t,s,l);f<_;){for(Eo(i,t,f,_),f++,_--;t[2*f+u]d;)_--}t[2*s+u]===d?Eo(i,t,s,_):(_++,Eo(i,t,_,l)),_<=r&&(s=_+1),r<=_&&(l=_-1)}}function Eo(i,t,r,s){Gc(i,r,s),Gc(t,2*r,2*s),Gc(t,2*r+1,2*s+1)}function Gc(i,t,r){const s=i[t];i[t]=i[r],i[r]=s}function ku(i,t,r,s){const l=i-r,u=t-s;return l*l+u*u}var Hc;L.bg=void 0,(Hc=L.bg||(L.bg={})).create="create",Hc.load="load",Hc.fullLoad="fullLoad";let Rl=null,Do=[];const Xc=1e3/60,Wc="loadTime",Kc="fullLoadTime",xp={mark(i){performance.mark(i)},frame(i){const t=i;Rl!=null&&Do.push(t-Rl),Rl=t},clearMetrics(){Rl=null,Do=[],performance.clearMeasures(Wc),performance.clearMeasures(Kc);for(const i in L.bg)performance.clearMarks(L.bg[i])},getPerformanceMetrics(){performance.measure(Wc,L.bg.create,L.bg.load),performance.measure(Kc,L.bg.create,L.bg.fullLoad);const i=performance.getEntriesByName(Wc)[0].duration,t=performance.getEntriesByName(Kc)[0].duration,r=Do.length,s=1/(Do.reduce((u,d)=>u+d,0)/r/1e3),l=Do.filter(u=>u>Xc).reduce((u,d)=>u+(d-Xc)/Xc,0);return{loadTime:i,fullLoadTime:t,fps:s,percentDroppedFrames:l/(r+l)*100,totalFrames:r}}};L.$=class extends T{},L.A=pa,L.B=nc,L.C=function(i){if(ln==null){const t=i.navigator?i.navigator.userAgent:null;ln=!!i.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return ln},L.D=Ae,L.E=un,L.F=class{constructor(i,t){this.target=i,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new hp(()=>this.process()),this.subscription=function(r,s,l,u){return r.addEventListener(s,l,!1),{unsubscribe:()=>{r.removeEventListener(s,l,!1)}}}(this.target,"message",r=>this.receive(r)),this.globalScope=ur(self)?i:window}registerMessageHandler(i,t){this.messageHandlers[i]=t}sendAsync(i,t){return new Promise((r,s)=>{const l=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[l]={resolve:r,reject:s},t&&t.signal.addEventListener("abort",()=>{delete this.resolveRejects[l];const f={id:l,type:"",origin:location.origin,targetMapId:i.targetMapId,sourceMapId:this.mapId};this.target.postMessage(f)},{once:!0});const u=[],d=Object.assign(Object.assign({},i),{id:l,sourceMapId:this.mapId,origin:location.origin,data:zn(i.data,u)});this.target.postMessage(d,{transfer:u})})}receive(i){const t=i.data,r=t.id;if(!(t.origin!=="file://"&&location.origin!=="file://"&&t.origin!=="resource://android"&&location.origin!=="resource://android"&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type===""){delete this.tasks[r];const s=this.abortControllers[r];return delete this.abortControllers[r],void(s&&s.abort())}if(ur(self)||t.mustQueue)return this.tasks[r]=t,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,t)}}process(){if(this.taskQueue.length===0)return;const i=this.taskQueue.shift(),t=this.tasks[i];delete this.tasks[i],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(i,t)}processTask(i,t){return p(this,void 0,void 0,function*(){if(t.type===""){const l=this.resolveRejects[i];return delete this.resolveRejects[i],l?void(t.error?l.reject(En(t.error)):l.resolve(En(t.data))):void 0}if(!this.messageHandlers[t.type])return void this.completeTask(i,new Error(`Could not find a registered handler for ${t.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const r=En(t.data),s=new AbortController;this.abortControllers[i]=s;try{const l=yield this.messageHandlers[t.type](t.sourceMapId,r,s);this.completeTask(i,null,l)}catch(l){this.completeTask(i,l)}})}completeTask(i,t,r){const s=[];delete this.abortControllers[i];const l={id:i,type:"",sourceMapId:this.mapId,origin:location.origin,error:t?zn(t):null,data:zn(r,s)};this.target.postMessage(l,{transfer:s})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},L.G=hn,L.H=function(){var i=new pa(16);return pa!=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},L.I=zc,L.J=function(i,t,r){var s,l,u,d,f,_,x,v,w,I,M,k,z=r[0],F=r[1],j=r[2];return t===i?(i[12]=t[0]*z+t[4]*F+t[8]*j+t[12],i[13]=t[1]*z+t[5]*F+t[9]*j+t[13],i[14]=t[2]*z+t[6]*F+t[10]*j+t[14],i[15]=t[3]*z+t[7]*F+t[11]*j+t[15]):(l=t[1],u=t[2],d=t[3],f=t[4],_=t[5],x=t[6],v=t[7],w=t[8],I=t[9],M=t[10],k=t[11],i[0]=s=t[0],i[1]=l,i[2]=u,i[3]=d,i[4]=f,i[5]=_,i[6]=x,i[7]=v,i[8]=w,i[9]=I,i[10]=M,i[11]=k,i[12]=s*z+f*F+w*j+t[12],i[13]=l*z+_*F+I*j+t[13],i[14]=u*z+x*F+M*j+t[14],i[15]=d*z+v*F+k*j+t[15]),i},L.K=function(i,t,r){var s=r[0],l=r[1],u=r[2];return i[0]=t[0]*s,i[1]=t[1]*s,i[2]=t[2]*s,i[3]=t[3]*s,i[4]=t[4]*l,i[5]=t[5]*l,i[6]=t[6]*l,i[7]=t[7]*l,i[8]=t[8]*u,i[9]=t[9]*u,i[10]=t[10]*u,i[11]=t[11]*u,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i},L.L=hh,L.M=function(i,t){const r={};for(let s=0;s{const t=window.document.createElement("video");return t.muted=!0,new Promise(r=>{t.onloadstart=()=>{r(t)};for(const s of i){const l=window.document.createElement("source");Ur(s)||(t.crossOrigin="Anonymous"),l.src=s,t.appendChild(l)}})},L.a4=function(){return Ps++},L.a5=be,L.a6=xa,L.a7=Wa,L.a8=ws,L.a9=du,L.aA=function(i){if(i.type==="custom")return new cp(i);switch(i.type){case"background":return new ap(i);case"circle":return new Hu(i);case"fill":return new hd(i);case"fill-extrusion":return new Id(i);case"heatmap":return new Wu(i);case"hillshade":return new Ju(i);case"line":return new Dd(i);case"raster":return new lp(i);case"symbol":return new kl(i)}},L.aB=st,L.aC=function(i,t){if(!i)return[{command:"setStyle",args:[t]}];let r=[];try{if(!et(i.version,t.version))return[{command:"setStyle",args:[t]}];et(i.center,t.center)||r.push({command:"setCenter",args:[t.center]}),et(i.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),et(i.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),et(i.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),et(i.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),et(i.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),et(i.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),et(i.light,t.light)||r.push({command:"setLight",args:[t.light]}),et(i.terrain,t.terrain)||r.push({command:"setTerrain",args:[t.terrain]}),et(i.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),et(i.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});const s={},l=[];(function(d,f,_,x){let v;for(v in f=f||{},d=d||{})Object.prototype.hasOwnProperty.call(d,v)&&(Object.prototype.hasOwnProperty.call(f,v)||Pr(v,_,x));for(v in f)Object.prototype.hasOwnProperty.call(f,v)&&(Object.prototype.hasOwnProperty.call(d,v)?et(d[v],f[v])||(d[v].type==="geojson"&&f[v].type==="geojson"&&dn(d,f,v)?yt(_,{command:"setGeoJSONSourceData",args:[v,f[v].data]}):fr(v,f,_,x)):Jn(v,f,_))})(i.sources,t.sources,l,s);const u=[];i.layers&&i.layers.forEach(d=>{"source"in d&&s[d.source]?r.push({command:"removeLayer",args:[d.id]}):u.push(d)}),r=r.concat(l),function(d,f,_){f=f||[];const x=(d=d||[]).map(Yn),v=f.map(Yn),w=d.reduce(Qn,{}),I=f.reduce(Qn,{}),M=x.slice(),k=Object.create(null);let z,F,j,Q,G;for(let J=0,re=0;J@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,s,l,u)=>{const d=l||u;return t[s]=!d||d.toLowerCase(),""}),t["max-age"]){const r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t},L.ab=function(i,t){const r=[];for(const s in i)s in t||r.push(s);return r},L.ac=Ei,L.ad=function(i,t,r){var s=Math.sin(r),l=Math.cos(r),u=t[0],d=t[1],f=t[2],_=t[3],x=t[4],v=t[5],w=t[6],I=t[7];return t!==i&&(i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]),i[0]=u*l+x*s,i[1]=d*l+v*s,i[2]=f*l+w*s,i[3]=_*l+I*s,i[4]=x*l-u*s,i[5]=v*l-d*s,i[6]=w*l-f*s,i[7]=I*l-_*s,i},L.ae=function(i){var t=new pa(16);return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],t},L.af=bl,L.ag=function(i,t){let r=0,s=0;if(i.kind==="constant")s=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:l,minZoom:u,maxZoom:d}=i,f=l?Ei(ri.interpolationFactor(l,t,u,d),0,1):0;i.kind==="camera"?s=ii.number(i.minSize,i.maxSize,f):r=f}return{uSizeT:r,uSize:s}},L.ai=function(i,{uSize:t,uSizeT:r},{lowerSize:s,upperSize:l}){return i.kind==="source"?s/Dr:i.kind==="composite"?ii.number(s/Dr,l/Dr,r):t},L.aj=Rc,L.ak=function(i,t,r,s){const l=t.y-i.y,u=t.x-i.x,d=s.y-r.y,f=s.x-r.x,_=d*u-f*l;if(_===0)return null;const x=(f*(i.y-r.y)-d*(i.x-r.x))/_;return new me(i.x+x*u,i.y+x*l)},L.al=_u,L.am=nh,L.an=_c,L.ao=function(i){let t=1/0,r=1/0,s=-1/0,l=-1/0;for(const u of i)t=Math.min(t,u.x),r=Math.min(r,u.y),s=Math.max(s,u.x),l=Math.max(l,u.y);return[t,r,s,l]},L.ap=Ct,L.ar=Lc,L.as=function(i,t){var r=t[0],s=t[1],l=t[2],u=t[3],d=t[4],f=t[5],_=t[6],x=t[7],v=t[8],w=t[9],I=t[10],M=t[11],k=t[12],z=t[13],F=t[14],j=t[15],Q=r*f-s*d,G=r*_-l*d,J=r*x-u*d,re=s*_-l*f,ce=s*x-u*f,we=l*x-u*_,Le=v*z-w*k,ve=v*F-I*k,ye=v*j-M*k,ke=w*F-I*z,Pe=w*j-M*z,Se=I*j-M*F,ae=Q*Se-G*Pe+J*ke+re*ye-ce*ve+we*Le;return ae?(i[0]=(f*Se-_*Pe+x*ke)*(ae=1/ae),i[1]=(l*Pe-s*Se-u*ke)*ae,i[2]=(z*we-F*ce+j*re)*ae,i[3]=(I*ce-w*we-M*re)*ae,i[4]=(_*ye-d*Se-x*ve)*ae,i[5]=(r*Se-l*ye+u*ve)*ae,i[6]=(F*J-k*we-j*G)*ae,i[7]=(v*we-I*J+M*G)*ae,i[8]=(d*Pe-f*ye+x*Le)*ae,i[9]=(s*ye-r*Pe-u*Le)*ae,i[10]=(k*ce-z*J+j*Q)*ae,i[11]=(w*J-v*ce-M*Q)*ae,i[12]=(f*ve-d*ke-_*Le)*ae,i[13]=(r*ke-s*ve+l*Le)*ae,i[14]=(z*G-k*re-F*Q)*ae,i[15]=(v*re-w*G+I*Q)*ae,i):null},L.at=$c,L.au=Dc,L.av=qc,L.aw=function(){const i={},t=ie.$version;for(const r in ie.$root){const s=ie.$root[r];if(s.required){let l=null;l=r==="version"?t:s.type==="array"?[]:{},l!=null&&(i[r]=l)}}return i},L.ax=co,L.ay=Li,L.az=function(i){i=i.slice();const t=Object.create(null);for(let r=0;r25||s<0||s>=1||r<0||r>=1)},L.bc=function(i,t){return i[0]=t[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=t[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=t[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},L.bd=class extends b{},L.be=Vc,L.bf=xp,L.bh=ui,L.bi=function(i,t){Tr.REGISTERED_PROTOCOLS[i]=t},L.bj=function(i){delete Tr.REGISTERED_PROTOCOLS[i]},L.bk=function(i,t){const r={};for(let l=0;lSe*Ct)}let ve=d?"center":r.get("text-justify").evaluate(x,{},i.canonical);const ye=r.get("symbol-placement")==="point"?r.get("text-max-width").evaluate(x,{},i.canonical)*Ct:1/0,ke=()=>{i.bucket.allowVerticalPlacement&&ho(J)&&(k.vertical=Al(z,i.glyphMap,i.glyphPositions,i.imagePositions,v,ye,u,we,"left",ce,j,L.ah.vertical,!0,I,w))};if(!d&&Le){const Pe=new Set;if(ve==="auto")for(let ae=0;aep(void 0,void 0,void 0,function*(){if(i.byteLength===0)return createImageBitmap(new ImageData(1,1));const t=new Blob([new Uint8Array(i)],{type:"image/png"});try{return createImageBitmap(t)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),L.e=vi,L.f=i=>new Promise((t,r)=>{const s=new Image;s.onload=()=>{t(s),URL.revokeObjectURL(s.src),s.onload=null,window.requestAnimationFrame(()=>{s.src=Ms})},s.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const l=new Blob([new Uint8Array(i)],{type:"image/png"});s.src=i.byteLength?URL.createObjectURL(l):Ms}),L.g=Qi,L.h=(i,t)=>jr(vi(i,{type:"json"}),t),L.i=ur,L.j=Ir,L.k=Sr,L.l=(i,t)=>jr(vi(i,{type:"arrayBuffer"}),t),L.m=jr,L.n=function(i){return new Cc(i).readFields(Xd,[])},L.o=vo,L.p=$h,L.q=h,L.r=rc,L.s=Ur,L.t=oo,L.u=tn,L.v=ie,L.w=Ft,L.x=function([i,t,r]){return t+=90,t*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(t)*Math.sin(r),y:i*Math.sin(t)*Math.sin(r),z:i*Math.cos(r)}},L.y=ii,L.z=dt}),Or("worker",["./shared"],function(L){class p{constructor(A){this.keyCache={},A&&this.replace(A)}replace(A){this._layerConfigs={},this._layers={},this.update(A,[])}update(A,P){for(const O of A){this._layerConfigs[O.id]=O;const H=this._layers[O.id]=L.aA(O);H._featureFilter=L.a7(H.filter),this.keyCache[O.id]&&delete this.keyCache[O.id]}for(const O of P)delete this.keyCache[O],delete this._layerConfigs[O],delete this._layers[O];this.familiesBySource={};const D=L.bk(Object.values(this._layerConfigs),this.keyCache);for(const O of D){const H=O.map(te=>this._layers[te.id]),W=H[0];if(W.visibility==="none")continue;const Y=W.source||"";let q=this.familiesBySource[Y];q||(q=this.familiesBySource[Y]={});const ne=W.sourceLayer||"_geojsonTileLayer";let le=q[ne];le||(le=q[ne]=[]),le.push(H)}}}class zi{constructor(A){const P={},D=[];for(const Y in A){const q=A[Y],ne=P[Y]={};for(const le in q){const te=q[+le];if(!te||te.bitmap.width===0||te.bitmap.height===0)continue;const de={x:0,y:0,w:te.bitmap.width+2,h:te.bitmap.height+2};D.push(de),ne[le]={rect:de,metrics:te.metrics}}}const{w:O,h:H}=L.p(D),W=new L.o({width:O||1,height:H||1});for(const Y in A){const q=A[Y];for(const ne in q){const le=q[+ne];if(!le||le.bitmap.width===0||le.bitmap.height===0)continue;const te=P[Y][ne].rect;L.o.copy(le.bitmap,W,{x:0,y:0},{x:te.x+1,y:te.y+1},le.bitmap)}}this.image=W,this.positions=P}}L.bl("GlyphAtlas",zi);class Xi{constructor(A){this.tileID=new L.S(A.tileID.overscaledZ,A.tileID.wrap,A.tileID.canonical.z,A.tileID.canonical.x,A.tileID.canonical.y),this.uid=A.uid,this.zoom=A.zoom,this.pixelRatio=A.pixelRatio,this.tileSize=A.tileSize,this.source=A.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=A.showCollisionBoxes,this.collectResourceTiming=!!A.collectResourceTiming,this.returnDependencies=!!A.returnDependencies,this.promoteId=A.promoteId,this.inFlightDependencies=[]}parse(A,P,D,O){return L._(this,void 0,void 0,function*(){this.status="parsing",this.data=A,this.collisionBoxArray=new L.a5;const H=new L.bm(Object.keys(A.layers).sort()),W=new L.bn(this.tileID,this.promoteId);W.bucketLayerIDs=[];const Y={},q={featureIndex:W,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:D},ne=P.familiesBySource[this.source];for(const qe in ne){const rt=A.layers[qe];if(!rt)continue;rt.version===1&&L.w(`Vector tile source "${this.source}" layer "${qe}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const gt=H.encode(qe),kt=[];for(let Lt=0;Lt=Wt.maxzoom||Wt.visibility!=="none"&&(Gt(Lt,this.zoom,D),(Y[Wt.id]=Wt.createBucket({index:W.bucketLayerIDs.length,layers:Lt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:gt,sourceID:this.source})).populate(kt,q,this.tileID.canonical),W.bucketLayerIDs.push(Lt.map(pn=>pn.id)))}}const le=L.aF(q.glyphDependencies,qe=>Object.keys(qe).map(Number));this.inFlightDependencies.forEach(qe=>qe==null?void 0:qe.abort()),this.inFlightDependencies=[];let te=Promise.resolve({});if(Object.keys(le).length){const qe=new AbortController;this.inFlightDependencies.push(qe),te=O.sendAsync({type:"GG",data:{stacks:le,source:this.source,tileID:this.tileID,type:"glyphs"}},qe)}const de=Object.keys(q.iconDependencies);let Ee=Promise.resolve({});if(de.length){const qe=new AbortController;this.inFlightDependencies.push(qe),Ee=O.sendAsync({type:"GI",data:{icons:de,source:this.source,tileID:this.tileID,type:"icons"}},qe)}const De=Object.keys(q.patternDependencies);let Ke=Promise.resolve({});if(De.length){const qe=new AbortController;this.inFlightDependencies.push(qe),Ke=O.sendAsync({type:"GI",data:{icons:De,source:this.source,tileID:this.tileID,type:"patterns"}},qe)}const[je,Je,Ge]=yield Promise.all([te,Ee,Ke]),Pt=new zi(je),xt=new L.bo(Je,Ge);for(const qe in Y){const rt=Y[qe];rt instanceof L.a6?(Gt(rt.layers,this.zoom,D),L.bp({bucket:rt,glyphMap:je,glyphPositions:Pt.positions,imageMap:Je,imagePositions:xt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):rt.hasPattern&&(rt instanceof L.bq||rt instanceof L.br||rt instanceof L.bs)&&(Gt(rt.layers,this.zoom,D),rt.addFeatures(q,this.tileID.canonical,xt.patternPositions))}return this.status="done",{buckets:Object.values(Y).filter(qe=>!qe.isEmpty()),featureIndex:W,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Pt.image,imageAtlas:xt,glyphMap:this.returnDependencies?je:null,iconMap:this.returnDependencies?Je:null,glyphPositions:this.returnDependencies?Pt.positions:null}})}}function Gt(N,A,P){const D=new L.z(A);for(const O of N)O.recalculate(D,P)}class me{constructor(A,P,D){this.actor=A,this.layerIndex=P,this.availableImages=D,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(A,P){return L._(this,void 0,void 0,function*(){const D=yield L.l(A.request,P);try{return{vectorTile:new L.bt.VectorTile(new L.bu(D.data)),rawData:D.data,cacheControl:D.cacheControl,expires:D.expires}}catch(O){const H=new Uint8Array(D.data);let W=`Unable to parse the tile at ${A.request.url}, `;throw W+=H[0]===31&&H[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${O.message}`,new Error(W)}})}loadTile(A){return L._(this,void 0,void 0,function*(){const P=A.uid,D=!!(A&&A.request&&A.request.collectResourceTiming)&&new L.bv(A.request),O=new Xi(A);this.loading[P]=O;const H=new AbortController;O.abort=H;try{const W=yield this.loadVectorTile(A,H);if(delete this.loading[P],!W)return null;const Y=W.rawData,q={};W.expires&&(q.expires=W.expires),W.cacheControl&&(q.cacheControl=W.cacheControl);const ne={};if(D){const te=D.finish();te&&(ne.resourceTiming=JSON.parse(JSON.stringify(te)))}O.vectorTile=W.vectorTile;const le=O.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[P]=O,this.fetching[P]={rawTileData:Y,cacheControl:q,resourceTiming:ne};try{const te=yield le;return L.e({rawTileData:Y.slice(0)},te,q,ne)}finally{delete this.fetching[P]}}catch(W){throw delete this.loading[P],O.status="done",this.loaded[P]=O,W}})}reloadTile(A){return L._(this,void 0,void 0,function*(){const P=A.uid;if(!this.loaded||!this.loaded[P])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const D=this.loaded[P];if(D.showCollisionBoxes=A.showCollisionBoxes,D.status==="parsing"){const O=yield D.parse(D.vectorTile,this.layerIndex,this.availableImages,this.actor);let H;if(this.fetching[P]){const{rawTileData:W,cacheControl:Y,resourceTiming:q}=this.fetching[P];delete this.fetching[P],H=L.e({rawTileData:W.slice(0)},O,Y,q)}else H=O;return H}if(D.status==="done"&&D.vectorTile)return D.parse(D.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(A){return L._(this,void 0,void 0,function*(){const P=this.loading,D=A.uid;P&&P[D]&&P[D].abort&&(P[D].abort.abort(),delete P[D])})}removeTile(A){return L._(this,void 0,void 0,function*(){this.loaded&&this.loaded[A.uid]&&delete this.loaded[A.uid]})}}class se{constructor(){this.loaded={}}loadTile(A){return L._(this,void 0,void 0,function*(){const{uid:P,encoding:D,rawImageData:O,redFactor:H,greenFactor:W,blueFactor:Y,baseShift:q}=A,ne=O.width+2,le=O.height+2,te=L.b(O)?new L.R({width:ne,height:le},yield L.bw(O,-1,-1,ne,le)):O,de=new L.bx(P,te,D,H,W,Y,q);return this.loaded=this.loaded||{},this.loaded[P]=de,de})}removeTile(A){const P=this.loaded,D=A.uid;P&&P[D]&&delete P[D]}}function Vr(N,A){if(N.length!==0){br(N[0],A);for(var P=1;P=Math.abs(Y)?P-q+Y:Y-q+P,P=q}P+D>=0!=!!A&&N.reverse()}var Wi=L.by(function N(A,P){var D,O=A&&A.type;if(O==="FeatureCollection")for(D=0;D>31}function ur(N,A){for(var P=N.loadGeometry(),D=N.type,O=0,H=0,W=P.length,Y=0;YN},Nr=Math.fround||(dr=new Float32Array(1),N=>(dr[0]=+N,dr[0]));var dr;const ei=3,Di=5,cn=6;class Tr{constructor(A){this.options=Object.assign(Object.create(Ms),A),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(A){const{log:P,minZoom:D,maxZoom:O}=this.options;P&&console.time("total time");const H=`prepare ${A.length} points`;P&&console.time(H),this.points=A;const W=[];for(let q=0;q=D;q--){const ne=+Date.now();Y=this.trees[q]=this._createTree(this._cluster(Y,q)),P&&console.log("z%d: %d clusters in %dms",q,Y.numItems,+Date.now()-ne)}return P&&console.timeEnd("total time"),this}getClusters(A,P){let D=((A[0]+180)%360+360)%360-180;const O=Math.max(-90,Math.min(90,A[1]));let H=A[2]===180?180:((A[2]+180)%360+360)%360-180;const W=Math.max(-90,Math.min(90,A[3]));if(A[2]-A[0]>=360)D=-180,H=180;else if(D>H){const te=this.getClusters([D,O,180,W],P),de=this.getClusters([-180,O,H,W],P);return te.concat(de)}const Y=this.trees[this._limitZoom(P)],q=Y.range(ui(D),Li(W),ui(H),Li(O)),ne=Y.data,le=[];for(const te of q){const de=this.stride*te;le.push(ne[de+Di]>1?Qi(ne,de,this.clusterProps):this.points[ne[de+ei]])}return le}getChildren(A){const P=this._getOriginId(A),D=this._getOriginZoom(A),O="No cluster with the specified id.",H=this.trees[D];if(!H)throw new Error(O);const W=H.data;if(P*this.stride>=W.length)throw new Error(O);const Y=this.options.radius/(this.options.extent*Math.pow(2,D-1)),q=H.within(W[P*this.stride],W[P*this.stride+1],Y),ne=[];for(const le of q){const te=le*this.stride;W[te+4]===A&&ne.push(W[te+Di]>1?Qi(W,te,this.clusterProps):this.points[W[te+ei]])}if(ne.length===0)throw new Error(O);return ne}getLeaves(A,P,D){const O=[];return this._appendLeaves(O,A,P=P||10,D=D||0,0),O}getTile(A,P,D){const O=this.trees[this._limitZoom(A)],H=Math.pow(2,A),{extent:W,radius:Y}=this.options,q=Y/W,ne=(D-q)/H,le=(D+1+q)/H,te={features:[]};return this._addTileFeatures(O.range((P-q)/H,ne,(P+1+q)/H,le),O.data,P,D,H,te),P===0&&this._addTileFeatures(O.range(1-q/H,ne,1,le),O.data,H,D,H,te),P===H-1&&this._addTileFeatures(O.range(0,ne,q/H,le),O.data,-1,D,H,te),te.features.length?te:null}getClusterExpansionZoom(A){let P=this._getOriginZoom(A)-1;for(;P<=this.options.maxZoom;){const D=this.getChildren(A);if(P++,D.length!==1)break;A=D[0].properties.cluster_id}return P}_appendLeaves(A,P,D,O,H){const W=this.getChildren(P);for(const Y of W){const q=Y.properties;if(q&&q.cluster?H+q.point_count<=O?H+=q.point_count:H=this._appendLeaves(A,q.cluster_id,D,O,H):H1;let le,te,de;if(ne)le=hn(P,q,this.clusterProps),te=P[q],de=P[q+1];else{const Ke=this.points[P[q+ei]];le=Ke.properties;const[je,Je]=Ke.geometry.coordinates;te=ui(je),de=Li(Je)}const Ee={type:1,geometry:[[Math.round(this.options.extent*(te*H-D)),Math.round(this.options.extent*(de*H-O))]],tags:le};let De;De=ne||this.options.generateId?P[q+ei]:this.points[P[q+ei]].id,De!==void 0&&(Ee.id=De),W.features.push(Ee)}}_limitZoom(A){return Math.max(this.options.minZoom,Math.min(Math.floor(+A),this.options.maxZoom+1))}_cluster(A,P){const{radius:D,extent:O,reduce:H,minPoints:W}=this.options,Y=D/(O*Math.pow(2,P)),q=A.data,ne=[],le=this.stride;for(let te=0;teP&&(je+=q[Ge+Di])}if(je>Ke&&je>=W){let Je,Ge=de*Ke,Pt=Ee*Ke,xt=-1;const qe=((te/le|0)<<5)+(P+1)+this.points.length;for(const rt of De){const gt=rt*le;if(q[gt+2]<=P)continue;q[gt+2]=P;const kt=q[gt+Di];Ge+=q[gt]*kt,Pt+=q[gt+1]*kt,q[gt+4]=qe,H&&(Je||(Je=this._map(q,te,!0),xt=this.clusterProps.length,this.clusterProps.push(Je)),H(Je,this._map(q,gt)))}q[te+4]=qe,ne.push(Ge/je,Pt/je,1/0,qe,-1,je),H&&ne.push(xt)}else{for(let Je=0;Je1)for(const Je of De){const Ge=Je*le;if(!(q[Ge+2]<=P)){q[Ge+2]=P;for(let Pt=0;Pt>5}_getOriginZoom(A){return(A-this.points.length)%32}_map(A,P,D){if(A[P+Di]>1){const W=this.clusterProps[A[P+cn]];return D?Object.assign({},W):W}const O=this.points[A[P+ei]].properties,H=this.options.map(O);return D&&H===O?Object.assign({},H):H}}function Qi(N,A,P){return{type:"Feature",id:N[A+ei],properties:hn(N,A,P),geometry:{type:"Point",coordinates:[(D=N[A],360*(D-.5)),jr(N[A+1])]}};var D}function hn(N,A,P){const D=N[A+Di],O=D>=1e4?`${Math.round(D/1e3)}k`:D>=1e3?Math.round(D/100)/10+"k":D,H=N[A+cn],W=H===-1?{}:Object.assign({},P[H]);return Object.assign(W,{cluster:!0,cluster_id:N[A+ei],point_count:D,point_count_abbreviated:O})}function ui(N){return N/360+.5}function Li(N){const A=Math.sin(N*Math.PI/180),P=.5-.25*Math.log((1+A)/(1-A))/Math.PI;return P<0?0:P>1?1:P}function jr(N){const A=(180-360*N)*Math.PI/180;return 360*Math.atan(Math.exp(A))/Math.PI-90}function Ur(N,A,P,D){let O=D;const H=A+(P-A>>1);let W,Y=P-A;const q=N[A],ne=N[A+1],le=N[P],te=N[P+1];for(let de=A+3;deO)W=de,O=Ee;else if(Ee===O){const De=Math.abs(de-H);DeD&&(W-A>3&&Ur(N,A,W,D),N[W+2]=O,P-W>3&&Ur(N,W,P,D))}function Wn(N,A,P,D,O,H){let W=O-P,Y=H-D;if(W!==0||Y!==0){const q=((N-P)*W+(A-D)*Y)/(W*W+Y*Y);q>1?(P=O,D=H):q>0&&(P+=W*q,D+=Y*q)}return W=N-P,Y=A-D,W*W+Y*Y}function pr(N,A,P,D){const O={id:N??null,type:A,geometry:P,tags:D,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(A==="Point"||A==="MultiPoint"||A==="LineString")Sr(O,P);else if(A==="Polygon")Sr(O,P[0]);else if(A==="MultiLineString")for(const H of P)Sr(O,H);else if(A==="MultiPolygon")for(const H of P)Sr(O,H[0]);return O}function Sr(N,A){for(let P=0;P0&&(W+=D?(O*le-ne*H)/2:Math.sqrt(Math.pow(ne-O,2)+Math.pow(le-H,2))),O=ne,H=le}const Y=A.length-3;A[2]=1,Ur(A,0,Y,P),A[Y+2]=1,A.size=Math.abs(W),A.start=0,A.end=A.size}function $r(N,A,P,D){for(let O=0;O1?1:P}function yt(N,A,P,D,O,H,W,Y){if(D/=A,H>=(P/=A)&&W=D)return null;const q=[];for(const ne of N){const le=ne.geometry;let te=ne.type;const de=O===0?ne.minX:ne.minY,Ee=O===0?ne.maxX:ne.maxY;if(de>=P&&Ee=D)continue;let De=[];if(te==="Point"||te==="MultiPoint")Jn(le,De,P,D,O);else if(te==="LineString")Pr(le,De,P,D,O,!1,Y.lineMetrics);else if(te==="MultiLineString")dn(le,De,P,D,O,!1);else if(te==="Polygon")dn(le,De,P,D,O,!0);else if(te==="MultiPolygon")for(const Ke of le){const je=[];dn(Ke,je,P,D,O,!0),je.length&&De.push(je)}if(De.length){if(Y.lineMetrics&&te==="LineString"){for(const Ke of De)q.push(pr(ne.id,te,Ke,ne.tags));continue}te!=="LineString"&&te!=="MultiLineString"||(De.length===1?(te="LineString",De=De[0]):te="MultiLineString"),te!=="Point"&&te!=="MultiPoint"||(te=De.length===3?"Point":"MultiPoint"),q.push(pr(ne.id,te,De,ne.tags))}}return q.length?q:null}function Jn(N,A,P,D,O){for(let H=0;H=P&&W<=D&&bi(A,N[H],N[H+1],N[H+2])}}function Pr(N,A,P,D,O,H,W){let Y=fr(N);const q=O===0?Yn:Qn;let ne,le,te=N.start;for(let je=0;jeP&&(le=q(Y,Je,Ge,xt,qe,P),W&&(Y.start=te+ne*le)):rt>D?gt=P&&(le=q(Y,Je,Ge,xt,qe,P),kt=!0),gt>D&&rt<=D&&(le=q(Y,Je,Ge,xt,qe,D),kt=!0),!H&&kt&&(W&&(Y.end=te+ne*le),A.push(Y),Y=fr(N)),W&&(te+=ne)}let de=N.length-3;const Ee=N[de],De=N[de+1],Ke=O===0?Ee:De;Ke>=P&&Ke<=D&&bi(Y,Ee,De,N[de+2]),de=Y.length-3,H&&de>=3&&(Y[de]!==Y[0]||Y[de+1]!==Y[1])&&bi(Y,Y[0],Y[1],Y[2]),Y.length&&A.push(Y)}function fr(N){const A=[];return A.size=N.size,A.start=N.start,A.end=N.end,A}function dn(N,A,P,D,O,H){for(const W of N)Pr(W,A,P,D,O,H,!1)}function bi(N,A,P,D){N.push(A,P,D)}function Yn(N,A,P,D,O,H){const W=(H-A)/(D-A);return bi(N,H,P+(O-P)*W,1),W}function Qn(N,A,P,D,O,H){const W=(H-P)/(O-P);return bi(N,A+(D-A)*W,H,1),W}function ue(N,A){const P=[];for(let D=0;D0&&A.size<(O?W:D))return void(P.numPoints+=A.length/3);const Y=[];for(let q=0;qW)&&(P.numSimplified++,Y.push(A[q],A[q+1])),P.numPoints++;O&&function(q,ne){let le=0;for(let te=0,de=q.length,Ee=de-2;te0===ne)for(let te=0,de=q.length;te24)throw new Error("maxZoom should be in the 0-24 range");if(P.promoteId&&P.generateId)throw new Error("promoteId and generateId cannot be used together.");let O=function(H,W){const Y=[];if(H.type==="FeatureCollection")for(let q=0;q1&&console.time("creation"),Ee=this.tiles[de]=Ar(A,P,D,O,ne),this.tileCoords.push({z:P,x:D,y:O}),le)){le>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",P,D,O,Ee.numFeatures,Ee.numPoints,Ee.numSimplified),console.timeEnd("creation"));const kt=`z${P}`;this.stats[kt]=(this.stats[kt]||0)+1,this.total++}if(Ee.source=A,H==null){if(P===ne.indexMaxZoom||Ee.numPoints<=ne.indexMaxPoints)continue}else{if(P===ne.maxZoom||P===H)continue;if(H!=null){const kt=H-P;if(D!==W>>kt||O!==Y>>kt)continue}}if(Ee.source=null,A.length===0)continue;le>1&&console.time("clipping");const De=.5*ne.buffer/ne.extent,Ke=.5-De,je=.5+De,Je=1+De;let Ge=null,Pt=null,xt=null,qe=null,rt=yt(A,te,D-De,D+je,0,Ee.minX,Ee.maxX,ne),gt=yt(A,te,D+Ke,D+Je,0,Ee.minX,Ee.maxX,ne);A=null,rt&&(Ge=yt(rt,te,O-De,O+je,1,Ee.minY,Ee.maxY,ne),Pt=yt(rt,te,O+Ke,O+Je,1,Ee.minY,Ee.maxY,ne),rt=null),gt&&(xt=yt(gt,te,O-De,O+je,1,Ee.minY,Ee.maxY,ne),qe=yt(gt,te,O+Ke,O+Je,1,Ee.minY,Ee.maxY,ne),gt=null),le>1&&console.timeEnd("clipping"),q.push(Ge||[],P+1,2*D,2*O),q.push(Pt||[],P+1,2*D,2*O+1),q.push(xt||[],P+1,2*D+1,2*O),q.push(qe||[],P+1,2*D+1,2*O+1)}}getTile(A,P,D){A=+A,P=+P,D=+D;const O=this.options,{extent:H,debug:W}=O;if(A<0||A>24)return null;const Y=1<1&&console.log("drilling down to z%d-%d-%d",A,P,D);let ne,le=A,te=P,de=D;for(;!ne&&le>0;)le--,te>>=1,de>>=1,ne=this.tiles[Ri(le,te,de)];return ne&&ne.source?(W>1&&(console.log("found parent tile z%d-%d-%d",le,te,de),console.time("drilling down")),this.splitTile(ne.source,le,te,de,A,P,D),W>1&&console.timeEnd("drilling down"),this.tiles[q]?Xt(this.tiles[q],H):null):null}}function Ri(N,A,P){return 32*((1<{te.properties=Ee;const De={};for(const Ke of de)De[Ke]=q[Ke].evaluate(le,te);return De},W.reduce=(Ee,De)=>{te.properties=De;for(const Ke of de)le.accumulated=Ee[Ke],Ee[Ke]=ne[Ke].evaluate(le,te)},W}(A)).load((yield this._pendingData).features):(O=yield this._pendingData,new ti(O,A.geojsonVtOptions)),this.loaded={};const H={};if(D){const W=D.finish();W&&(H.resourceTiming={},H.resourceTiming[A.source]=JSON.parse(JSON.stringify(W)))}return H}catch(H){if(delete this._pendingRequest,L.bB(H))return{abandoned:!0};throw H}var O})}getData(){return L._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(A){const P=this.loaded;return P&&P[A.uid]?super.reloadTile(A):this.loadTile(A)}loadAndProcessGeoJSON(A,P){return L._(this,void 0,void 0,function*(){let D=yield this.loadGeoJSON(A,P);if(delete this._pendingRequest,typeof D!="object")throw new Error(`Input data given to '${A.source}' is not a valid GeoJSON object.`);if(Wi(D,!0),A.filter){const O=L.bC(A.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(O.result==="error")throw new Error(O.value.map(W=>`${W.key}: ${W.message}`).join(", "));D={type:"FeatureCollection",features:D.features.filter(W=>O.value.evaluate({zoom:0},W))}}return D})}loadGeoJSON(A,P){return L._(this,void 0,void 0,function*(){const{promoteId:D}=A;if(A.request){const O=yield L.h(A.request,P);return this._dataUpdateable=ir(O.data,D)?mr(O.data,D):void 0,O.data}if(typeof A.data=="string")try{const O=JSON.parse(A.data);return this._dataUpdateable=ir(O,D)?mr(O,D):void 0,O}catch{throw new Error(`Input data given to '${A.source}' is not a valid GeoJSON object.`)}if(!A.dataDiff)throw new Error(`Input data given to '${A.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${A.source}`);return function(O,H,W){var Y,q,ne,le;if(H.removeAll&&O.clear(),H.remove)for(const te of H.remove)O.delete(te);if(H.add)for(const te of H.add){const de=Ne(te,W);de!=null&&O.set(de,te)}if(H.update)for(const te of H.update){let de=O.get(te.id);if(de==null)continue;const Ee=!te.removeAllProperties&&(((Y=te.removeProperties)===null||Y===void 0?void 0:Y.length)>0||((q=te.addOrUpdateProperties)===null||q===void 0?void 0:q.length)>0);if((te.newGeometry||te.removeAllProperties||Ee)&&(de=Object.assign({},de),O.set(te.id,de),Ee&&(de.properties=Object.assign({},de.properties))),te.newGeometry&&(de.geometry=te.newGeometry),te.removeAllProperties)de.properties={};else if(((ne=te.removeProperties)===null||ne===void 0?void 0:ne.length)>0)for(const De of te.removeProperties)Object.prototype.hasOwnProperty.call(de.properties,De)&&delete de.properties[De];if(((le=te.addOrUpdateProperties)===null||le===void 0?void 0:le.length)>0)for(const{key:De,value:Ke}of te.addOrUpdateProperties)de.properties[De]=Ke}}(this._dataUpdateable,A.dataDiff,D),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(A){return L._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(A){return this._geoJSONIndex.getClusterExpansionZoom(A.clusterId)}getClusterChildren(A){return this._geoJSONIndex.getChildren(A.clusterId)}getClusterLeaves(A){return this._geoJSONIndex.getLeaves(A.clusterId,A.limit,A.offset)}}class rr{constructor(A){this.self=A,this.actor=new L.F(A),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(P,D)=>{if(this.externalWorkerSourceTypes[P])throw new Error(`Worker source with name "${P}" already registered.`);this.externalWorkerSourceTypes[P]=D},this.self.addProtocol=L.bi,this.self.removeProtocol=L.bj,this.self.registerRTLTextPlugin=P=>{if(L.bD.isParsed())throw new Error("RTL text plugin already registered.");L.bD.setMethods(P)},this.actor.registerMessageHandler("LDT",(P,D)=>this._getDEMWorkerSource(P,D.source).loadTile(D)),this.actor.registerMessageHandler("RDT",(P,D)=>L._(this,void 0,void 0,function*(){this._getDEMWorkerSource(P,D.source).removeTile(D)})),this.actor.registerMessageHandler("GCEZ",(P,D)=>L._(this,void 0,void 0,function*(){return this._getWorkerSource(P,D.type,D.source).getClusterExpansionZoom(D)})),this.actor.registerMessageHandler("GCC",(P,D)=>L._(this,void 0,void 0,function*(){return this._getWorkerSource(P,D.type,D.source).getClusterChildren(D)})),this.actor.registerMessageHandler("GCL",(P,D)=>L._(this,void 0,void 0,function*(){return this._getWorkerSource(P,D.type,D.source).getClusterLeaves(D)})),this.actor.registerMessageHandler("LD",(P,D)=>this._getWorkerSource(P,D.type,D.source).loadData(D)),this.actor.registerMessageHandler("GD",(P,D)=>this._getWorkerSource(P,D.type,D.source).getData()),this.actor.registerMessageHandler("LT",(P,D)=>this._getWorkerSource(P,D.type,D.source).loadTile(D)),this.actor.registerMessageHandler("RT",(P,D)=>this._getWorkerSource(P,D.type,D.source).reloadTile(D)),this.actor.registerMessageHandler("AT",(P,D)=>this._getWorkerSource(P,D.type,D.source).abortTile(D)),this.actor.registerMessageHandler("RMT",(P,D)=>this._getWorkerSource(P,D.type,D.source).removeTile(D)),this.actor.registerMessageHandler("RS",(P,D)=>L._(this,void 0,void 0,function*(){if(!this.workerSources[P]||!this.workerSources[P][D.type]||!this.workerSources[P][D.type][D.source])return;const O=this.workerSources[P][D.type][D.source];delete this.workerSources[P][D.type][D.source],O.removeSource!==void 0&&O.removeSource(D)})),this.actor.registerMessageHandler("RM",P=>L._(this,void 0,void 0,function*(){delete this.layerIndexes[P],delete this.availableImages[P],delete this.workerSources[P],delete this.demWorkerSources[P]})),this.actor.registerMessageHandler("SR",(P,D)=>L._(this,void 0,void 0,function*(){this.referrer=D})),this.actor.registerMessageHandler("SRPS",(P,D)=>this._syncRTLPluginState(P,D)),this.actor.registerMessageHandler("IS",(P,D)=>L._(this,void 0,void 0,function*(){this.self.importScripts(D)})),this.actor.registerMessageHandler("SI",(P,D)=>this._setImages(P,D)),this.actor.registerMessageHandler("UL",(P,D)=>L._(this,void 0,void 0,function*(){this._getLayerIndex(P).update(D.layers,D.removedIds)})),this.actor.registerMessageHandler("SL",(P,D)=>L._(this,void 0,void 0,function*(){this._getLayerIndex(P).replace(D)}))}_setImages(A,P){return L._(this,void 0,void 0,function*(){this.availableImages[A]=P;for(const D in this.workerSources[A]){const O=this.workerSources[A][D];for(const H in O)O[H].availableImages=P}})}_syncRTLPluginState(A,P){return L._(this,void 0,void 0,function*(){if(L.bD.isParsed())return L.bD.getState();if(P.pluginStatus!=="loading")return L.bD.setState(P),P;const D=P.pluginURL;if(this.self.importScripts(D),L.bD.isParsed()){const O={pluginStatus:"loaded",pluginURL:D};return L.bD.setState(O),O}throw L.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${D}`)})}_getAvailableImages(A){let P=this.availableImages[A];return P||(P=[]),P}_getLayerIndex(A){let P=this.layerIndexes[A];return P||(P=this.layerIndexes[A]=new p),P}_getWorkerSource(A,P,D){if(this.workerSources[A]||(this.workerSources[A]={}),this.workerSources[A][P]||(this.workerSources[A][P]={}),!this.workerSources[A][P][D]){const O={sendAsync:(H,W)=>(H.targetMapId=A,this.actor.sendAsync(H,W))};switch(P){case"vector":this.workerSources[A][P][D]=new me(O,this._getLayerIndex(A),this._getAvailableImages(A));break;case"geojson":this.workerSources[A][P][D]=new Mr(O,this._getLayerIndex(A),this._getAvailableImages(A));break;default:this.workerSources[A][P][D]=new this.externalWorkerSourceTypes[P](O,this._getLayerIndex(A),this._getAvailableImages(A))}}return this.workerSources[A][P][D]}_getDEMWorkerSource(A,P){return this.demWorkerSources[A]||(this.demWorkerSources[A]={}),this.demWorkerSources[A][P]||(this.demWorkerSources[A][P]=new se),this.demWorkerSources[A][P]}}return L.i(self)&&(self.worker=new rr(self)),rr}),Or("index",["exports","./shared"],function(L,p){var zi="4.7.1";let Xi,Gt;const me={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:h=>new Promise((e,n)=>{const a=requestAnimationFrame(e);h.signal.addEventListener("abort",()=>{cancelAnimationFrame(a),n(p.c())})}),getImageData(h,e=0){return this.getImageCanvasContext(h).getImageData(-e,-e,h.width+2*e,h.height+2*e)},getImageCanvasContext(h){const e=window.document.createElement("canvas"),n=e.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return e.width=h.width,e.height=h.height,n.drawImage(h,0,0,h.width,h.height),n},resolveURL:h=>(Xi||(Xi=document.createElement("a")),Xi.href=h,Xi.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Gt==null&&(Gt=matchMedia("(prefers-reduced-motion: reduce)")),Gt.matches)}};class se{static testProp(e){if(!se.docStyle)return e[0];for(let n=0;n{window.removeEventListener("click",se.suppressClickInternal,!0)},0)}static getScale(e){const n=e.getBoundingClientRect();return{x:n.width/e.offsetWidth||1,y:n.height/e.offsetHeight||1,boundingClientRect:n}}static getPoint(e,n,a){const o=n.boundingClientRect;return new p.P((a.clientX-o.left)/n.x-e.clientLeft,(a.clientY-o.top)/n.y-e.clientTop)}static mousePos(e,n){const a=se.getScale(e);return se.getPoint(e,a,n)}static touchPos(e,n){const a=[],o=se.getScale(e);for(let c=0;c{br&&Hn(br),br=null,hr=!0},Wi.onerror=()=>{wr=!0,br=null},Wi.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(h){let e,n,a,o;h.resetRequestQueue=()=>{e=[],n=0,a=0,o={}},h.addThrottleControl=y=>{const b=a++;return o[b]=y,b},h.removeThrottleControl=y=>{delete o[y],m()},h.getImage=(y,b,T=!0)=>new Promise((S,C)=>{Vr.supported&&(y.headers||(y.headers={}),y.headers.accept="image/webp,*/*"),p.e(y,{type:"image"}),e.push({abortController:b,requestParameters:y,supportImageRefresh:T,state:"queued",onError:E=>{C(E)},onSuccess:E=>{S(E)}}),m()});const c=y=>p._(this,void 0,void 0,function*(){y.state="running";const{requestParameters:b,supportImageRefresh:T,onError:S,onSuccess:C,abortController:E}=y,R=T===!1&&!p.i(self)&&!p.g(b.url)&&(!b.headers||Object.keys(b.headers).reduce(($,Z)=>$&&Z==="accept",!0));n++;const V=R?g(b,E):p.m(b,E);try{const $=yield V;delete y.abortController,y.state="completed",$.data instanceof HTMLImageElement||p.b($.data)?C($):$.data&&C({data:yield(U=$.data,typeof createImageBitmap=="function"?p.d(U):p.f(U)),cacheControl:$.cacheControl,expires:$.expires})}catch($){delete y.abortController,S($)}finally{n--,m()}var U}),m=()=>{const y=(()=>{for(const b of Object.keys(o))if(o[b]())return!0;return!1})()?p.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:p.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let b=n;b0;b++){const T=e.shift();T.abortController.signal.aborted?b--:c(T)}},g=(y,b)=>new Promise((T,S)=>{const C=new Image,E=y.url,R=y.credentials;R&&R==="include"?C.crossOrigin="use-credentials":(R&&R==="same-origin"||!p.s(E))&&(C.crossOrigin="anonymous"),b.signal.addEventListener("abort",()=>{C.src="",S(p.c())}),C.fetchPriority="high",C.onload=()=>{C.onerror=C.onload=null,T({data:C})},C.onerror=()=>{C.onerror=C.onload=null,b.signal.aborted||S(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},C.src=E})}(hi||(hi={})),hi.resetRequestQueue();class Ia{constructor(e){this._transformRequestFn=e}transformRequest(e,n){return this._transformRequestFn&&this._transformRequestFn(e,n)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function Ei(h){var e=new p.A(3);return e[0]=h[0],e[1]=h[1],e[2]=h[2],e}var Ki,vi=function(h,e,n){return h[0]=e[0]-n[0],h[1]=e[1]-n[1],h[2]=e[2]-n[2],h};Ki=new p.A(3),p.A!=Float32Array&&(Ki[0]=0,Ki[1]=0,Ki[2]=0);var Ps=function(h){var e=h[0],n=h[1];return e*e+n*n};function Ji(h){const e=[];if(typeof h=="string")e.push({id:"default",url:h});else if(h&&h.length>0){const n=[];for(const{id:a,url:o}of h){const c=`${a}${o}`;n.indexOf(c)===-1&&(n.push(c),e.push({id:a,url:o}))}}return e}function Xn(h,e,n){const a=h.split("?");return a[0]+=`${e}${n}`,a.join("?")}(function(){var h=new p.A(2);p.A!=Float32Array&&(h[0]=0,h[1]=0)})();class st{constructor(e,n,a,o){this.context=e,this.format=a,this.texture=e.gl.createTexture(),this.update(n,o)}update(e,n,a){const{width:o,height:c}=e,m=!(this.size&&this.size[0]===o&&this.size[1]===c||a),{context:g}=this,{gl:y}=g;if(this.useMipmap=!!(n&&n.useMipmap),y.bindTexture(y.TEXTURE_2D,this.texture),g.pixelStoreUnpackFlipY.set(!1),g.pixelStoreUnpack.set(1),g.pixelStoreUnpackPremultiplyAlpha.set(this.format===y.RGBA&&(!n||n.premultiply!==!1)),m)this.size=[o,c],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||p.b(e)?y.texImage2D(y.TEXTURE_2D,0,this.format,this.format,y.UNSIGNED_BYTE,e):y.texImage2D(y.TEXTURE_2D,0,this.format,o,c,0,this.format,y.UNSIGNED_BYTE,e.data);else{const{x:b,y:T}=a||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||p.b(e)?y.texSubImage2D(y.TEXTURE_2D,0,b,T,y.RGBA,y.UNSIGNED_BYTE,e):y.texSubImage2D(y.TEXTURE_2D,0,b,T,o,c,y.RGBA,y.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&y.generateMipmap(y.TEXTURE_2D)}bind(e,n,a){const{context:o}=this,{gl:c}=o;c.bindTexture(c.TEXTURE_2D,this.texture),a!==c.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(a=c.LINEAR),e!==this.filter&&(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,e),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a||e),this.filter=e),n!==this.wrap&&(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,n),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function As(h){const{userImage:e}=h;return!!(e&&e.render&&e.render())&&(h.data.replace(new Uint8Array(e.data.buffer)),!0)}class Ft extends p.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new p.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:n,promiseResolve:a}of this.requestors)a(this._getImagesForIds(n));this.requestors=[]}}getImage(e){const n=this.images[e];if(n&&!n.data&&n.spriteData){const a=n.spriteData;n.data=new p.R({width:a.width,height:a.height},a.context.getImageData(a.x,a.y,a.width,a.height).data),n.spriteData=null}return n}addImage(e,n){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,n)&&(this.images[e]=n)}_validate(e,n){let a=!0;const o=n.data||n.spriteData;return this._validateStretch(n.stretchX,o&&o.width)||(this.fire(new p.j(new Error(`Image "${e}" has invalid "stretchX" value`))),a=!1),this._validateStretch(n.stretchY,o&&o.height)||(this.fire(new p.j(new Error(`Image "${e}" has invalid "stretchY" value`))),a=!1),this._validateContent(n.content,n)||(this.fire(new p.j(new Error(`Image "${e}" has invalid "content" value`))),a=!1),a}_validateStretch(e,n){if(!e)return!0;let a=0;for(const o of e){if(o[0]{let o=!0;if(!this.isLoaded())for(const c of e)this.images[c]||(o=!1);this.isLoaded()||o?n(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:n})})}_getImagesForIds(e){const n={};for(const a of e){let o=this.getImage(a);o||(this.fire(new p.k("styleimagemissing",{id:a})),o=this.getImage(a)),o?n[a]={data:o.data.clone(),pixelRatio:o.pixelRatio,sdf:o.sdf,version:o.version,stretchX:o.stretchX,stretchY:o.stretchY,content:o.content,textFitWidth:o.textFitWidth,textFitHeight:o.textFitHeight,hasRenderCallback:!!(o.userImage&&o.userImage.render)}:p.w(`Image "${a}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return n}getPixelSize(){const{width:e,height:n}=this.atlasImage;return{width:e,height:n}}getPattern(e){const n=this.patterns[e],a=this.getImage(e);if(!a)return null;if(n&&n.position.version===a.version)return n.position;if(n)n.position.version=a.version;else{const o={w:a.data.width+2,h:a.data.height+2,x:0,y:0},c=new p.I(o,a);this.patterns[e]={bin:o,position:c}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const n=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new st(e,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const c in this.patterns)e.push(this.patterns[c].bin);const{w:n,h:a}=p.p(e),o=this.atlasImage;o.resize({width:n||1,height:a||1});for(const c in this.patterns){const{bin:m}=this.patterns[c],g=m.x+1,y=m.y+1,b=this.getImage(c).data,T=b.width,S=b.height;p.R.copy(b,o,{x:0,y:0},{x:g,y},{width:T,height:S}),p.R.copy(b,o,{x:0,y:S-1},{x:g,y:y-1},{width:T,height:1}),p.R.copy(b,o,{x:0,y:0},{x:g,y:y+S},{width:T,height:1}),p.R.copy(b,o,{x:T-1,y:0},{x:g-1,y},{width:1,height:S}),p.R.copy(b,o,{x:0,y:0},{x:g+T,y},{width:1,height:S})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const n of e){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;const a=this.getImage(n);a||p.w(`Image with ID: "${n}" was not found`),As(a)&&this.updateImage(n,a)}}}const Ht=1e20;function ur(h,e,n,a,o,c,m,g,y){for(let b=e;b-1);y++,c[y]=g,m[y]=b,m[y+1]=Ht}for(let g=0,y=0;g65535)throw new Error("glyphs > 65535 not supported");if(a.ranges[c])return{stack:e,id:n,glyph:o};if(!this.url)throw new Error("glyphsUrl is not set");if(!a.requests[c]){const g=Yi.loadGlyphRange(e,c,this.url,this.requestManager);a.requests[c]=g}const m=yield a.requests[c];for(const g in m)this._doesCharSupportLocalGlyph(+g)||(a.glyphs[+g]=m[+g]);return a.ranges[c]=!0,{stack:e,id:n,glyph:m[n]||null}})}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(e))}_tinySDF(e,n,a){const o=this.localIdeographFontFamily;if(!o||!this._doesCharSupportLocalGlyph(a))return;let c=e.tinySDF;if(!c){let g="400";/bold/i.test(n)?g="900":/medium/i.test(n)?g="500":/light/i.test(n)&&(g="200"),c=e.tinySDF=new Yi.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:o,fontWeight:g})}const m=c.draw(String.fromCharCode(a));return{id:a,bitmap:new p.o({width:m.width||60,height:m.height||60},m.data),metrics:{width:m.glyphWidth/2||24,height:m.glyphHeight/2||24,left:m.glyphLeft/2+.5||0,top:m.glyphTop/2-27.5||-8,advance:m.glyphAdvance/2||24,isDoubleResolution:!0}}}}Yi.loadGlyphRange=function(h,e,n,a){return p._(this,void 0,void 0,function*(){const o=256*e,c=o+255,m=a.transformRequest(n.replace("{fontstack}",h).replace("{range}",`${o}-${c}`),"Glyphs"),g=yield p.l(m,new AbortController);if(!g||!g.data)throw new Error(`Could not load glyph range. range: ${e}, ${o}-${c}`);const y={};for(const b of p.n(g.data))y[b.id]=b;return y})},Yi.TinySDF=class{constructor({fontSize:h=24,buffer:e=3,radius:n=8,cutoff:a=.25,fontFamily:o="sans-serif",fontWeight:c="normal",fontStyle:m="normal"}={}){this.buffer=e,this.cutoff=a,this.radius=n;const g=this.size=h+4*e,y=this._createCanvas(g),b=this.ctx=y.getContext("2d",{willReadFrequently:!0});b.font=`${m} ${c} ${h}px ${o}`,b.textBaseline="alphabetic",b.textAlign="left",b.fillStyle="black",this.gridOuter=new Float64Array(g*g),this.gridInner=new Float64Array(g*g),this.f=new Float64Array(g),this.z=new Float64Array(g+1),this.v=new Uint16Array(g)}_createCanvas(h){const e=document.createElement("canvas");return e.width=e.height=h,e}draw(h){const{width:e,actualBoundingBoxAscent:n,actualBoundingBoxDescent:a,actualBoundingBoxLeft:o,actualBoundingBoxRight:c}=this.ctx.measureText(h),m=Math.ceil(n),g=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(c-o))),y=Math.min(this.size-this.buffer,m+Math.ceil(a)),b=g+2*this.buffer,T=y+2*this.buffer,S=Math.max(b*T,0),C=new Uint8ClampedArray(S),E={data:C,width:b,height:T,glyphWidth:g,glyphHeight:y,glyphTop:m,glyphLeft:0,glyphAdvance:e};if(g===0||y===0)return E;const{ctx:R,buffer:V,gridInner:U,gridOuter:$}=this;R.clearRect(V,V,g,y),R.fillText(h,V,V+m);const Z=R.getImageData(V,V,g,y);$.fill(Ht,0,S),U.fill(0,0,S);for(let B=0;B0?oe*oe:0,U[ee]=oe<0?oe*oe:0}}ur($,0,0,b,T,b,this.f,this.v,this.z),ur(U,V,V,g,y,b,this.f,this.v,this.z);for(let B=0;B1&&(y=e[++g]);const T=Math.abs(b-y.left),S=Math.abs(b-y.right),C=Math.min(T,S);let E;const R=c/a*(o+1);if(y.isDash){const V=o-Math.abs(R);E=Math.sqrt(C*C+V*V)}else E=o-Math.sqrt(C*C+R*R);this.data[m+b]=Math.max(0,Math.min(255,E+128))}}}addRegularDash(e){for(let g=e.length-1;g>=0;--g){const y=e[g],b=e[g+1];y.zeroLength?e.splice(g,1):b&&b.isDash===y.isDash&&(b.left=y.left,e.splice(g,1))}const n=e[0],a=e[e.length-1];n.isDash===a.isDash&&(n.left=a.left-this.width,a.right=n.right+this.width);const o=this.width*this.nextRow;let c=0,m=e[c];for(let g=0;g1&&(m=e[++c]);const y=Math.abs(g-m.left),b=Math.abs(g-m.right),T=Math.min(y,b);this.data[o+g]=Math.max(0,Math.min(255,(m.isDash?T:-T)+128))}}addDash(e,n){const a=n?7:0,o=2*a+1;if(this.nextRow+o>this.height)return p.w("LineAtlas out of space"),null;let c=0;for(let g=0;g{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Tr]}numActive(){return Object.keys(this.active).length}}const hn=Math.floor(me.hardwareConcurrency/2);let ui,Li;function jr(){return ui||(ui=new Qi),ui}Qi.workerCount=p.C(globalThis)?Math.max(Math.min(hn,3),1):1;class Ur{constructor(e,n){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=n;const a=this.workerPool.acquire(n);for(let o=0;o{n.remove()}),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,n){for(const a of this.actors)a.registerMessageHandler(e,n)}}function Wn(){return Li||(Li=new Ur(jr(),p.G),Li.registerMessageHandler("GR",(h,e,n)=>p.m(e,n))),Li}function pr(h,e){const n=p.H();return p.J(n,n,[1,1,0]),p.K(n,n,[.5*h.width,.5*h.height,1]),p.L(n,n,h.calculatePosMatrix(e.toUnwrapped()))}function Sr(h,e,n,a,o,c){const m=function(S,C,E){if(S)for(const R of S){const V=C[R];if(V&&V.source===E&&V.type==="fill-extrusion")return!0}else for(const R in C){const V=C[R];if(V.source===E&&V.type==="fill-extrusion")return!0}return!1}(o&&o.layers,e,h.id),g=c.maxPitchScaleFactor(),y=h.tilesIn(a,g,m);y.sort(Ir);const b=[];for(const S of y)b.push({wrappedTileID:S.tileID.wrapped().key,queryResults:S.tile.queryRenderedFeatures(e,n,h._state,S.queryGeometry,S.cameraQueryGeometry,S.scale,o,c,g,pr(h.transform,S.tileID))});const T=function(S){const C={},E={};for(const R of S){const V=R.queryResults,U=R.wrappedTileID,$=E[U]=E[U]||{};for(const Z in V){const B=V[Z],X=$[Z]=$[Z]||{},K=C[Z]=C[Z]||[];for(const ee of B)X[ee.featureIndex]||(X[ee.featureIndex]=!0,K.push(ee))}}return C}(b);for(const S in T)T[S].forEach(C=>{const E=C.feature,R=h.getFeatureState(E.layer["source-layer"],E.id);E.source=E.layer.source,E.layer["source-layer"]&&(E.sourceLayer=E.layer["source-layer"]),E.state=R});return T}function Ir(h,e){const n=h.tileID,a=e.tileID;return n.overscaledZ-a.overscaledZ||n.canonical.y-a.canonical.y||n.wrap-a.wrap||n.canonical.x-a.canonical.x}function un(h,e,n){return p._(this,void 0,void 0,function*(){let a=h;if(h.url?a=(yield p.h(e.transformRequest(h.url,"Source"),n)).data:yield me.frameAsync(n),!a)return null;const o=p.M(p.e(a,h),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in a&&a.vector_layers&&(o.vectorLayerIds=a.vector_layers.map(c=>c.id)),o})}class ie{constructor(e,n){e&&(n?this.setSouthWest(e).setNorthEast(n):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof p.N?new p.N(e.lng,e.lat):p.N.convert(e),this}setSouthWest(e){return this._sw=e instanceof p.N?new p.N(e.lng,e.lat):p.N.convert(e),this}extend(e){const n=this._sw,a=this._ne;let o,c;if(e instanceof p.N)o=e,c=e;else{if(!(e instanceof ie))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(ie.convert(e)):this.extend(p.N.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(p.N.convert(e)):this;if(o=e._sw,c=e._ne,!o||!c)return this}return n||a?(n.lng=Math.min(o.lng,n.lng),n.lat=Math.min(o.lat,n.lat),a.lng=Math.max(c.lng,a.lng),a.lat=Math.max(c.lat,a.lat)):(this._sw=new p.N(o.lng,o.lat),this._ne=new p.N(c.lng,c.lat)),this}getCenter(){return new p.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new p.N(this.getWest(),this.getNorth())}getSouthEast(){return new p.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:n,lat:a}=p.N.convert(e);let o=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&o}static convert(e){return e instanceof ie?e:e&&new ie(e)}static fromLngLat(e,n=0){const a=360*n/40075017,o=a/Math.cos(Math.PI/180*e.lat);return new ie(new p.N(e.lng-o,e.lat-a),new p.N(e.lng+o,e.lat+a))}adjustAntiMeridian(){const e=new p.N(this._sw.lng,this._sw.lat),n=new p.N(this._ne.lng,this._ne.lat);return new ie(e,e.lng>n.lng?new p.N(n.lng+360,n.lat):n)}}class $r{constructor(e,n,a){this.bounds=ie.convert(this.validateBounds(e)),this.minzoom=n||0,this.maxzoom=a||24}validateBounds(e){return Array.isArray(e)&&e.length===4?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){const n=Math.pow(2,e.z),a=Math.floor(p.O(this.bounds.getWest())*n),o=Math.floor(p.Q(this.bounds.getNorth())*n),c=Math.ceil(p.O(this.bounds.getEast())*n),m=Math.ceil(p.Q(this.bounds.getSouth())*n);return e.x>=a&&e.x=o&&e.y{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return p.e({},this._options)}loadTile(e){return p._(this,void 0,void 0,function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),a={request:this.map._requestManager.transformRequest(n,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};a.request.collectResourceTiming=this._collectResourceTiming;let o="RT";if(e.actor&&e.state!=="expired"){if(e.state==="loading")return new Promise((c,m)=>{e.reloadPromise={resolve:c,reject:m}})}else e.actor=this.dispatcher.getActor(),o="LT";e.abortController=new AbortController;try{const c=yield e.actor.sendAsync({type:o,data:a},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,c)}catch(c){if(delete e.abortController,e.aborted)return;if(c&&c.status!==404)throw c;this._afterTileLoadWorkerResponse(e,null)}})}_afterTileLoadWorkerResponse(e,n){if(n&&n.resourceTiming&&(e.resourceTiming=n.resourceTiming),n&&this.map._refreshExpiredTiles&&e.setExpiryData(n),e.loadVectorData(n,this.map.painter),e.reloadPromise){const a=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(a.resolve).catch(a.reject)}}abortTile(e){return p._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))})}unloadTile(e){return p._(this,void 0,void 0,function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class et extends p.E{constructor(e,n,a,o){super(),this.id=e,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=p.e({type:"raster"},n),p.e(this,p.M(n,["url","scheme","tileSize"]))}load(){return p._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new p.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield un(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,e&&(p.e(this,e),e.bounds&&(this.tileBounds=new $r(e.bounds,this.minzoom,this.maxzoom)),this.fire(new p.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new p.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new p.j(e))}})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return p.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return p._(this,void 0,void 0,function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{const a=yield hi.getImage(this.map._requestManager.transformRequest(n,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(a&&a.data){this.map._refreshExpiredTiles&&a.cacheControl&&a.expires&&e.setExpiryData({cacheControl:a.cacheControl,expires:a.expires});const o=this.map.painter.context,c=o.gl,m=a.data;e.texture=this.map.painter.getTileTexture(m.width),e.texture?e.texture.update(m,{useMipmap:!0}):(e.texture=new st(o,m,c.RGBA,{useMipmap:!0}),e.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE,c.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(a){if(delete e.abortController,e.aborted)e.state="unloaded";else if(a)throw e.state="errored",a}})}abortTile(e){return p._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)})}unloadTile(e){return p._(this,void 0,void 0,function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)})}hasTransition(){return!1}}class yt extends et{constructor(e,n,a,o){super(e,n,a,o),this.type="raster-dem",this.maxzoom=22,this._options=p.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(e){return p._(this,void 0,void 0,function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),a=this.map._requestManager.transformRequest(n,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{const o=yield hi.getImage(a,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(o&&o.data){const c=o.data;this.map._refreshExpiredTiles&&o.cacheControl&&o.expires&&e.setExpiryData({cacheControl:o.cacheControl,expires:o.expires});const m=p.b(c)&&p.U()?c:yield this.readImageNow(c),g={type:this.type,uid:e.uid,source:this.id,rawImageData:m,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||e.state==="expired"){e.actor=this.dispatcher.getActor();const y=yield e.actor.sendAsync({type:"LDT",data:g});e.dem=y,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(o){if(delete e.abortController,e.aborted)e.state="unloaded";else if(o)throw e.state="errored",o}})}readImageNow(e){return p._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&p.V()){const n=e.width+2,a=e.height+2;try{return new p.R({width:n,height:a},yield p.W(e,-1,-1,n,a))}catch{}}return me.getImageData(e,1)})}_getNeighboringTiles(e){const n=e.canonical,a=Math.pow(2,n.z),o=(n.x-1+a)%a,c=n.x===0?e.wrap-1:e.wrap,m=(n.x+1+a)%a,g=n.x+1===a?e.wrap+1:e.wrap,y={};return y[new p.S(e.overscaledZ,c,n.z,o,n.y).key]={backfilled:!1},y[new p.S(e.overscaledZ,g,n.z,m,n.y).key]={backfilled:!1},n.y>0&&(y[new p.S(e.overscaledZ,c,n.z,o,n.y-1).key]={backfilled:!1},y[new p.S(e.overscaledZ,e.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},y[new p.S(e.overscaledZ,g,n.z,m,n.y-1).key]={backfilled:!1}),n.y+10&&p.e(c,{resourceTiming:o}),this.fire(new p.k("data",Object.assign(Object.assign({},c),{sourceDataType:"metadata"}))),this.fire(new p.k("data",Object.assign(Object.assign({},c),{sourceDataType:"content"})))}catch(a){if(this._pendingLoads--,this._removed)return void this.fire(new p.k("dataabort",{dataType:"source"}));this.fire(new p.j(a))}})}loaded(){return this._pendingLoads===0}loadTile(e){return p._(this,void 0,void 0,function*(){const n=e.actor?"RT":"LT";e.actor=this.actor;const a={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.abortController=new AbortController;const o=yield this.actor.sendAsync({type:n,data:a},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(o,this.map.painter,n==="RT")})}abortTile(e){return p._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0})}unloadTile(e){return p._(this,void 0,void 0,function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return p.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Pr=p.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class fr extends p.E{constructor(e,n,a,o){super(),this.id=e,this.dispatcher=a,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(o),this.options=n}load(e){return p._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new p.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const n=yield hi.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,n&&n.data&&(this.image=n.data,e&&(this.coordinates=e),this._finishLoading())}catch(n){this._request=null,this._loaded=!0,this.fire(new p.j(n))}})}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new p.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;const n=e.map(p.Z.fromLngLat);this.tileID=function(o){let c=1/0,m=1/0,g=-1/0,y=-1/0;for(const C of o)c=Math.min(c,C.x),m=Math.min(m,C.y),g=Math.max(g,C.x),y=Math.max(y,C.y);const b=Math.max(g-c,y-m),T=Math.max(0,Math.floor(-Math.log(b)/Math.LN2)),S=Math.pow(2,T);return new p.a1(T,Math.floor((c+g)/2*S),Math.floor((m+y)/2*S))}(n),this.minzoom=this.maxzoom=this.tileID.z;const a=n.map(o=>this.tileID.getTilePoint(o)._round());return this._boundsArray=new p.$,this._boundsArray.emplaceBack(a[0].x,a[0].y,0,0),this._boundsArray.emplaceBack(a[1].x,a[1].y,p.X,0),this._boundsArray.emplaceBack(a[3].x,a[3].y,0,p.X),this._boundsArray.emplaceBack(a[2].x,a[2].y,p.X,p.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new p.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const e=this.map.painter.context,n=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,Pr.members)),this.boundsSegments||(this.boundsSegments=p.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new st(e,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let a=!1;for(const o in this.tiles){const c=this.tiles[o];c.state!=="loaded"&&(c.state="loaded",c.texture=this.texture,a=!0)}a&&this.fire(new p.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return p._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class dn extends fr{constructor(e,n,a,o){super(e,n,a,o),this.roundZoom=!0,this.type="video",this.options=n}load(){return p._(this,void 0,void 0,function*(){this._loaded=!1;const e=this.options;this.urls=[];for(const n of e.urls)this.urls.push(this.map._requestManager.transformRequest(n,"Source").url);try{const n=yield p.a3(this.urls);if(this._loaded=!0,!n)return;this.video=n,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(n){this.fire(new p.j(n))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const n=this.video.seekable;en.end(0)?this.fire(new p.j(new p.a2(`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=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const e=this.map.painter.context,n=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,Pr.members)),this.boundsSegments||(this.boundsSegments=p.a0.simpleSegment(0,0,4,2)),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 st(e,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let a=!1;for(const o in this.tiles){const c=this.tiles[o];c.state!=="loaded"&&(c.state="loaded",c.texture=this.texture,a=!0)}a&&this.fire(new p.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class bi extends fr{constructor(e,n,a,o){super(e,n,a,o),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(c=>!Array.isArray(c)||c.length!==2||c.some(m=>typeof m!="number"))||this.fire(new p.j(new p.a2(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new p.j(new p.a2(`sources.${e}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new p.j(new p.a2(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new p.j(new p.a2(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new p.j(new p.a2(`sources.${e}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){return p._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new p.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context,a=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Pr.members)),this.boundsSegments||(this.boundsSegments=p.a0.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new st(n,this.canvas,a.RGBA,{premultiply:!0});let o=!1;for(const c in this.tiles){const m=this.tiles[c];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture,o=!0)}o&&this.fire(new p.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const Yn={},Qn=h=>{switch(h){case"geojson":return Jn;case"image":return fr;case"raster":return et;case"raster-dem":return yt;case"vector":return Kn;case"video":return dn;case"canvas":return bi}return Yn[h]},ue="RTLPluginLoaded";class er extends p.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Wn()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch(n=>{throw this.status="error",n})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return p._(this,arguments,void 0,function*(n,a=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=me.resolveURL(n),!this.url)throw new Error(`requested url ${n} is invalid`);if(this.status==="unavailable"){if(!a)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return p._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new p.k(ue))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Xt=null;function tr(){return Xt||(Xt=new er),Xt}class Ar{constructor(e,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=p.a4(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){const n=e+this.timeAdded;nc.getLayer(b)).filter(Boolean);if(y.length!==0){g.layers=y,g.stateDependentLayerIds&&(g.stateDependentLayers=g.stateDependentLayerIds.map(b=>y.filter(T=>T.id===b)[0]));for(const b of y)m[b.id]=g}}return m}(e.buckets,n.style),this.hasSymbolBuckets=!1;for(const o in this.buckets){const c=this.buckets[o];if(c instanceof p.a6){if(this.hasSymbolBuckets=!0,!a)break;c.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const o in this.buckets){const c=this.buckets[o];if(c instanceof p.a6&&c.hasRTLText){this.hasRTLText=!0,tr().lazyLoad();break}}this.queryPadding=0;for(const o in this.buckets){const c=this.buckets[o];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(o).queryRadius(c))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new p.a5}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const a in this.buckets){const o=this.buckets[a];o.uploadPending()&&o.upload(e)}const n=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new st(e,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new st(e,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,n,a,o,c,m,g,y,b,T){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:o,cameraQueryGeometry:c,scale:m,tileSize:this.tileSize,pixelPosMatrix:T,transform:y,params:g,queryPadding:this.queryPadding*b},e,n,a):{}}querySourceFeatures(e,n){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const o=a.loadVTLayers(),c=n&&n.sourceLayer?n.sourceLayer:"",m=o._geojsonTileLayer||o[c];if(!m)return;const g=p.a7(n&&n.filter),{z:y,x:b,y:T}=this.tileID.canonical,S={z:y,x:b,y:T};for(let C=0;Ca)o=!1;else if(n)if(this.expirationTime{this.remove(e,c)},a)),this.data[o].push(c),this.order.push(o),this.order.length>this.max){const m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const n=this.data[e].shift();return n.timeout&&clearTimeout(n.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),n.value}getByKey(e){const n=this.data[e];return n?n[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,n){if(!this.has(e))return this;const a=e.wrapped().key,o=n===void 0?0:this.data[a].indexOf(n),c=this.data[a][o];return this.data[a].splice(o,1),c.timeout&&clearTimeout(c.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(c.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(e){const n=[];for(const a in this.data)for(const o of this.data[a])e(o.value)||n.push(o);for(const a of n)this.remove(a.value.tileID,a)}}class $e{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,n,a){const o=String(n);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][o]=this.stateChanges[e][o]||{},p.e(this.stateChanges[e][o],a),this.deletedStates[e]===null){this.deletedStates[e]={};for(const c in this.state[e])c!==o&&(this.deletedStates[e][c]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][o]===null){this.deletedStates[e][o]={};for(const c in this.state[e][o])a[c]||(this.deletedStates[e][o][c]=null)}else for(const c in a)this.deletedStates[e]&&this.deletedStates[e][o]&&this.deletedStates[e][o][c]===null&&delete this.deletedStates[e][o][c]}removeFeatureState(e,n,a){if(this.deletedStates[e]===null)return;const o=String(n);if(this.deletedStates[e]=this.deletedStates[e]||{},a&&n!==void 0)this.deletedStates[e][o]!==null&&(this.deletedStates[e][o]=this.deletedStates[e][o]||{},this.deletedStates[e][o][a]=null);else if(n!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][o])for(a in this.deletedStates[e][o]={},this.stateChanges[e][o])this.deletedStates[e][o][a]=null;else this.deletedStates[e][o]=null;else this.deletedStates[e]=null}getState(e,n){const a=String(n),o=p.e({},(this.state[e]||{})[a],(this.stateChanges[e]||{})[a]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){const c=this.deletedStates[e][n];if(c===null)return{};for(const m in c)delete o[m]}return o}initializeTileState(e,n){e.setFeatureState(this.state,n)}coalesceChanges(e,n){const a={};for(const o in this.stateChanges){this.state[o]=this.state[o]||{};const c={};for(const m in this.stateChanges[o])this.state[o][m]||(this.state[o][m]={}),p.e(this.state[o][m],this.stateChanges[o][m]),c[m]=this.state[o][m];a[o]=c}for(const o in this.deletedStates){this.state[o]=this.state[o]||{};const c={};if(this.deletedStates[o]===null)for(const m in this.state[o])c[m]={},this.state[o][m]={};else for(const m in this.deletedStates[o]){if(this.deletedStates[o][m]===null)this.state[o][m]={};else for(const g of Object.keys(this.deletedStates[o][m]))delete this.state[o][m][g];c[m]=this.state[o][m]}a[o]=a[o]||{},p.e(a[o],c)}if(this.stateChanges={},this.deletedStates={},Object.keys(a).length!==0)for(const o in e)e[o].setFeatureState(a,n)}}class Be extends p.E{constructor(e,n,a){super(),this.id=e,this.dispatcher=a,this.on("data",o=>this._dataHandler(o)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((o,c,m,g)=>{const y=new(Qn(c.type))(o,c,m,g);if(y.id!==o)throw new Error(`Expected Source id to be ${o} instead of ${y.id}`);return y})(e,n,a,this),this._tiles={},this._cache=new _e(0,o=>this._unloadTile(o)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new $e,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const e in this._tiles){const n=this._tiles[e];if(n.state!=="loaded"&&n.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,n,a){return p._(this,void 0,void 0,function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,n,a)}catch(o){e.state="errored",o.status!==404?this._source.fire(new p.j(o,{tile:e})):this.update(this.transform,this.terrain)}})}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new p.k("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const n in this._tiles){const a=this._tiles[n];a.upload(e),a.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(ti).map(e=>e.key)}getRenderableIds(e){const n=[];for(const a in this._tiles)this._isIdRenderable(a,e)&&n.push(this._tiles[a]);return e?n.sort((a,o)=>{const c=a.tileID,m=o.tileID,g=new p.P(c.canonical.x,c.canonical.y)._rotate(this.transform.angle),y=new p.P(m.canonical.x,m.canonical.y)._rotate(this.transform.angle);return c.overscaledZ-m.overscaledZ||y.y-g.y||y.x-g.x}).map(a=>a.tileID.key):n.map(a=>a.tileID).sort(ti).map(a=>a.key)}hasRenderableParent(e){const n=this.findLoadedParent(e,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(e,n){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(n||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)this._tiles[e].state!=="errored"&&this._reloadTile(e,"reloading")}}_reloadTile(e,n){return p._(this,void 0,void 0,function*(){const a=this._tiles[e];a&&(a.state!=="loading"&&(a.state=n),yield this._loadTile(a,e,n))})}_tileLoaded(e,n,a){e.timeAdded=me.now(),a==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(n,e),this.getSource().type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new p.k("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){const n=this.getRenderableIds();for(let o=0;o1||(Math.abs(m)>1&&(Math.abs(m+y)===1?m+=y:Math.abs(m-y)===1&&(m-=y)),c.dem&&o.dem&&(o.dem.backfillBorder(c.dem,m,g),o.neighboringTiles&&o.neighboringTiles[b]&&(o.neighboringTiles[b].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,n,a,o){for(const c in this._tiles){let m=this._tiles[c];if(o[c]||!m.hasData()||m.tileID.overscaledZ<=n||m.tileID.overscaledZ>a)continue;let g=m.tileID;for(;m&&m.tileID.overscaledZ>n+1;){const b=m.tileID.scaledTo(m.tileID.overscaledZ-1);m=this._tiles[b.key],m&&m.hasData()&&(g=b)}let y=g;for(;y.overscaledZ>n;)if(y=y.scaledTo(y.overscaledZ-1),e[y.key]){o[g.key]=g;break}}}findLoadedParent(e,n){if(e.key in this._loadedParentTiles){const a=this._loadedParentTiles[e.key];return a&&a.tileID.overscaledZ>=n?a:null}for(let a=e.overscaledZ-1;a>=n;a--){const o=e.scaledTo(a),c=this._getLoadedTile(o);if(c)return c}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){const n=this._tiles[e.key];return n&&n.hasData()?n:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){const n=Math.ceil(e.width/this._source.tileSize)+1,a=Math.ceil(e.height/this._source.tileSize)+1,o=Math.floor(n*a*(this._maxTileCacheZoomLevels===null?p.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),c=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(c)}handleWrapJump(e){const n=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,n){const a={};for(const o in this._tiles){const c=this._tiles[o];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+n),a[c.tileID.key]=c}this._tiles=a;for(const o in this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(const o in this._tiles)this._setTileReloadTimer(o,this._tiles[o])}}_updateCoveredAndRetainedTiles(e,n,a,o,c,m){const g={},y={},b=Object.keys(e),T=me.now();for(const S of b){const C=e[S],E=this._tiles[S];if(!E||E.fadeEndTime!==0&&E.fadeEndTime<=T)continue;const R=this.findLoadedParent(C,n),V=this.findLoadedSibling(C),U=R||V||null;U&&(this._addTile(U.tileID),g[U.tileID.key]=U.tileID),y[S]=C}this._retainLoadedChildren(y,o,a,e);for(const S in g)e[S]||(this._coveredTiles[S]=!0,e[S]=g[S]);if(m){const S={},C={};for(const E of c)this._tiles[E.key].hasData()?S[E.key]=E:C[E.key]=E;for(const E in C){const R=C[E].children(this._source.maxzoom);this._tiles[R[0].key]&&this._tiles[R[1].key]&&this._tiles[R[2].key]&&this._tiles[R[3].key]&&(S[R[0].key]=e[R[0].key]=R[0],S[R[1].key]=e[R[1].key]=R[1],S[R[2].key]=e[R[2].key]=R[2],S[R[3].key]=e[R[3].key]=R[3],delete C[E])}for(const E in C){const R=C[E],V=this.findLoadedParent(R,this._source.minzoom),U=this.findLoadedSibling(R),$=V||U||null;if($){S[$.tileID.key]=e[$.tileID.key]=$.tileID;for(const Z in S)S[Z].isChildOf($.tileID)&&delete S[Z]}}for(const E in this._tiles)S[E]||(this._coveredTiles[E]=!0)}}update(e,n){if(!this._sourceLoaded||this._paused)return;let a;this.transform=e,this.terrain=n,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(T=>new p.S(T.canonical.z,T.wrap,T.canonical.z,T.canonical.x,T.canonical.y)):(a=e.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(a=a.filter(T=>this._source.hasTile(T)))):a=[];const o=e.coveringZoomLevel(this._source),c=Math.max(o-Be.maxOverzooming,this._source.minzoom),m=Math.max(o+Be.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const T={};for(const S of a)if(S.canonical.z>this._source.minzoom){const C=S.scaledTo(S.canonical.z-1);T[C.key]=C;const E=S.scaledTo(Math.max(this._source.minzoom,Math.min(S.canonical.z,5)));T[E.key]=E}a=a.concat(Object.values(T))}const g=a.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,g&&this.fire(new p.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const y=this._updateRetainedTiles(a,o);Ri(this._source.type)&&this._updateCoveredAndRetainedTiles(y,c,m,o,a,n);for(const T in y)this._tiles[T].clearFadeHold();const b=p.ab(this._tiles,y);for(const T of b){const S=this._tiles[T];S.hasSymbolBuckets&&!S.holdingForFade()?S.setHoldDuration(this.map._fadeDuration):S.hasSymbolBuckets&&!S.symbolFadeFinished()||this._removeTile(T)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,n){var a;const o={},c={},m=Math.max(n-Be.maxOverzooming,this._source.minzoom),g=Math.max(n+Be.maxUnderzooming,this._source.minzoom),y={};for(const b of e){const T=this._addTile(b);o[b.key]=b,T.hasData()||nthis._source.maxzoom){const C=b.children(this._source.maxzoom)[0],E=this.getTile(C);if(E&&E.hasData()){o[C.key]=C;continue}}else{const C=b.children(this._source.maxzoom);if(o[C[0].key]&&o[C[1].key]&&o[C[2].key]&&o[C[3].key])continue}let S=T.wasRequested();for(let C=b.overscaledZ-1;C>=m;--C){const E=b.scaledTo(C);if(c[E.key])break;if(c[E.key]=!0,T=this.getTile(E),!T&&S&&(T=this._addTile(E)),T){const R=T.hasData();if((R||!(!((a=this.map)===null||a===void 0)&&a.cancelPendingTileRequestsWhileZooming)||S)&&(o[E.key]=E),S=T.wasRequested(),R)break}}}return o}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const n=[];let a,o=this._tiles[e].tileID;for(;o.overscaledZ>0;){if(o.key in this._loadedParentTiles){a=this._loadedParentTiles[o.key];break}n.push(o.key);const c=o.scaledTo(o.overscaledZ-1);if(a=this._getLoadedTile(c),a)break;o=c}for(const c of n)this._loadedParentTiles[c]=a}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const e in this._tiles){const n=this._tiles[e].tileID,a=this._getLoadedTile(n);this._loadedSiblingTiles[n.key]=a}}_addTile(e){let n=this._tiles[e.key];if(n)return n;n=this._cache.getAndRemove(e),n&&(this._setTileReloadTimer(e.key,n),n.tileID=e,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,n)));const a=n;return n||(n=new Ar(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(n,e.key,n.state)),n.uses++,this._tiles[e.key]=n,a||this._source.fire(new p.k("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(e,n){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const a=n.getExpiryTimeout();a&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},a))}_removeTile(e){const n=this._tiles[e];n&&(n.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}_dataHandler(e){const n=e.sourceDataType;e.dataType==="source"&&n==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&e.dataType==="source"&&n==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,n,a){const o=[],c=this.transform;if(!c)return o;const m=a?c.getCameraQueryGeometry(e):e,g=e.map(R=>c.pointCoordinate(R,this.terrain)),y=m.map(R=>c.pointCoordinate(R,this.terrain)),b=this.getIds();let T=1/0,S=1/0,C=-1/0,E=-1/0;for(const R of y)T=Math.min(T,R.x),S=Math.min(S,R.y),C=Math.max(C,R.x),E=Math.max(E,R.y);for(let R=0;R=0&&B[1].y+Z>=0){const X=g.map(ee=>U.getTilePoint(ee)),K=y.map(ee=>U.getTilePoint(ee));o.push({tile:V,tileID:U,queryGeometry:X,cameraQueryGeometry:K,scale:$})}}return o}getVisibleCoordinates(e){const n=this.getRenderableIds(e).map(a=>this._tiles[a].tileID);for(const a of n)a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(Ri(this._source.type)){const e=me.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=e)return!0}return!1}setFeatureState(e,n,a){this._state.updateState(e=e||"_geojsonTileLayer",n,a)}removeFeatureState(e,n,a){this._state.removeFeatureState(e=e||"_geojsonTileLayer",n,a)}getFeatureState(e,n){return this._state.getState(e=e||"_geojsonTileLayer",n)}setDependencies(e,n,a){const o=this._tiles[e];o&&o.setDependencies(n,a)}reloadTilesForDependencies(e,n){for(const a in this._tiles)this._tiles[a].hasDependency(e,n)&&this._reloadTile(a,"reloading");this._cache.filter(a=>!a.hasDependency(e,n))}}function ti(h,e){const n=Math.abs(2*h.wrap)-+(h.wrap<0),a=Math.abs(2*e.wrap)-+(e.wrap<0);return h.overscaledZ-e.overscaledZ||a-n||e.canonical.y-h.canonical.y||e.canonical.x-h.canonical.x}function Ri(h){return h==="raster"||h==="image"||h==="video"}Be.maxOverzooming=10,Be.maxUnderzooming=3;class Ne{constructor(e,n){this.reset(e,n)}reset(e,n){this.points=e||[],this._distances=[0];for(let a=1;a0?(o-m)/g:0;return this.points[c].mult(1-y).add(this.points[n].mult(y))}}function ir(h,e){let n=!0;return h==="always"||h!=="never"&&e!=="never"||(n=!1),n}class mr{constructor(e,n,a){const o=this.boxCells=[],c=this.circleCells=[];this.xCellCount=Math.ceil(e/a),this.yCellCount=Math.ceil(n/a);for(let m=0;mthis.width||o<0||n>this.height)return[];const y=[];if(e<=0&&n<=0&&this.width<=a&&this.height<=o){if(c)return[{key:null,x1:e,y1:n,x2:a,y2:o}];for(let b=0;b0}hitTestCircle(e,n,a,o,c){const m=e-a,g=e+a,y=n-a,b=n+a;if(g<0||m>this.width||b<0||y>this.height)return!1;const T=[];return this._forEachCell(m,y,g,b,this._queryCellCircle,T,{hitTest:!0,overlapMode:o,circle:{x:e,y:n,radius:a},seenUids:{box:{},circle:{}}},c),T.length>0}_queryCell(e,n,a,o,c,m,g,y){const{seenUids:b,hitTest:T,overlapMode:S}=g,C=this.boxCells[c];if(C!==null){const R=this.bboxes;for(const V of C)if(!b.box[V]){b.box[V]=!0;const U=4*V,$=this.boxKeys[V];if(e<=R[U+2]&&n<=R[U+3]&&a>=R[U+0]&&o>=R[U+1]&&(!y||y($))&&(!T||!ir(S,$.overlapMode))&&(m.push({key:$,x1:R[U],y1:R[U+1],x2:R[U+2],y2:R[U+3]}),T))return!0}}const E=this.circleCells[c];if(E!==null){const R=this.circles;for(const V of E)if(!b.circle[V]){b.circle[V]=!0;const U=3*V,$=this.circleKeys[V];if(this._circleAndRectCollide(R[U],R[U+1],R[U+2],e,n,a,o)&&(!y||y($))&&(!T||!ir(S,$.overlapMode))){const Z=R[U],B=R[U+1],X=R[U+2];if(m.push({key:$,x1:Z-X,y1:B-X,x2:Z+X,y2:B+X}),T)return!0}}}return!1}_queryCellCircle(e,n,a,o,c,m,g,y){const{circle:b,seenUids:T,overlapMode:S}=g,C=this.boxCells[c];if(C!==null){const R=this.bboxes;for(const V of C)if(!T.box[V]){T.box[V]=!0;const U=4*V,$=this.boxKeys[V];if(this._circleAndRectCollide(b.x,b.y,b.radius,R[U+0],R[U+1],R[U+2],R[U+3])&&(!y||y($))&&!ir(S,$.overlapMode))return m.push(!0),!0}}const E=this.circleCells[c];if(E!==null){const R=this.circles;for(const V of E)if(!T.circle[V]){T.circle[V]=!0;const U=3*V,$=this.circleKeys[V];if(this._circlesCollide(R[U],R[U+1],R[U+2],b.x,b.y,b.radius)&&(!y||y($))&&!ir(S,$.overlapMode))return m.push(!0),!0}}}_forEachCell(e,n,a,o,c,m,g,y){const b=this._convertToXCellCoord(e),T=this._convertToYCellCoord(n),S=this._convertToXCellCoord(a),C=this._convertToYCellCoord(o);for(let E=b;E<=S;E++)for(let R=T;R<=C;R++)if(c.call(this,e,n,a,o,this.xCellCount*R+E,m,g,y))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,n,a,o,c,m){const g=o-e,y=c-n,b=a+m;return b*b>g*g+y*y}_circleAndRectCollide(e,n,a,o,c,m,g){const y=(m-o)/2,b=Math.abs(e-(o+y));if(b>y+a)return!1;const T=(g-c)/2,S=Math.abs(n-(c+T));if(S>T+a)return!1;if(b<=y||S<=T)return!0;const C=b-y,E=S-T;return C*C+E*E<=a*a}}function Mr(h,e,n,a,o){const c=p.H();return e?(p.K(c,c,[1/o,1/o,1]),n||p.ad(c,c,a.angle)):p.L(c,a.labelPlaneMatrix,h),c}function rr(h,e,n,a,o){if(e){const c=p.ae(h);return p.K(c,c,[o,o,1]),n||p.ad(c,c,-a.angle),c}return a.glCoordMatrix}function N(h,e,n,a){let o;a?(o=[h,e,a(h,e),1],p.af(o,o,n)):(o=[h,e,0,1],Ke(o,o,n));const c=o[3];return{point:new p.P(o[0]/c,o[1]/c),signedDistanceFromCamera:c,isOccluded:!1}}function A(h,e){return .5+h/e*.5}function P(h,e){return h.x>=-e[0]&&h.x<=e[0]&&h.y>=-e[1]&&h.y<=e[1]}function D(h,e,n,a,o,c,m,g,y,b,T,S,C,E,R){const V=a?h.textSizeData:h.iconSizeData,U=p.ag(V,n.transform.zoom),$=[256/n.width*2+1,256/n.height*2+1],Z=a?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;Z.clear();const B=h.lineVertexArray,X=a?h.text.placedSymbolArray:h.icon.placedSymbolArray,K=n.transform.width/n.transform.height;let ee=!1;for(let oe=0;oeMath.abs(n.x-e.x)*a?{useVertical:!0}:(h===p.ah.vertical?e.yn.x)?{needsFlipping:!0}:null}function W(h,e,n,a,o,c,m,g,y,b,T){const S=n/24,C=e.lineOffsetX*S,E=e.lineOffsetY*S;let R;if(e.numGlyphs>1){const V=e.glyphStartIndex+e.numGlyphs,U=e.lineStartIndex,$=e.lineStartIndex+e.lineLength,Z=O(S,g,C,E,a,e,T,h);if(!Z)return{notEnoughRoom:!0};const B=N(Z.first.point.x,Z.first.point.y,m,h.getElevation).point,X=N(Z.last.point.x,Z.last.point.y,m,h.getElevation).point;if(o&&!a){const K=H(e.writingMode,B,X,b);if(K)return K}R=[Z.first];for(let K=e.glyphStartIndex+1;K0?B.point:function(ee,oe,he,xe,Te,fe){return Y(ee,oe,he,1,Te,fe)}(h.tileAnchorPoint,Z,U,0,c,h),K=H(e.writingMode,U,X,b);if(K)return K}const V=de(S*g.getoffsetX(e.glyphStartIndex),C,E,a,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,h,T);if(!V||h.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};R=[V]}for(const V of R)p.aj(y,V.point,V.angle);return{}}function Y(h,e,n,a,o,c){const m=h.add(h.sub(e)._unit()),g=o!==void 0?N(m.x,m.y,o,c.getElevation).point:ne(m.x,m.y,c).point,y=n.sub(g);return n.add(y._mult(a/y.mag()))}function q(h,e,n){const a=e.projectionCache;if(a.projections[h])return a.projections[h];const o=new p.P(e.lineVertexArray.getx(h),e.lineVertexArray.gety(h)),c=ne(o.x,o.y,e);if(c.signedDistanceFromCamera>0)return a.projections[h]=c.point,a.anyProjectionOccluded=a.anyProjectionOccluded||c.isOccluded,c.point;const m=h-n.direction;return function(g,y,b,T,S){return Y(g,y,b,T,void 0,S)}(n.distanceFromAnchor===0?e.tileAnchorPoint:new p.P(e.lineVertexArray.getx(m),e.lineVertexArray.gety(m)),o,n.previousVertex,n.absOffsetX-n.distanceFromAnchor+1,e)}function ne(h,e,n){const a=h+n.translation[0],o=e+n.translation[1];let c;return!n.pitchWithMap&&n.projection.useSpecialProjectionForSymbols?(c=n.projection.projectTileCoordinates(a,o,n.unwrappedTileID,n.getElevation),c.point.x=(.5*c.point.x+.5)*n.width,c.point.y=(.5*-c.point.y+.5)*n.height):(c=N(a,o,n.labelPlaneMatrix,n.getElevation),c.isOccluded=!1),c}function le(h,e,n){return h._unit()._perp()._mult(e*n)}function te(h,e,n,a,o,c,m,g,y){if(g.projectionCache.offsets[h])return g.projectionCache.offsets[h];const b=n.add(e);if(h+y.direction=o)return g.projectionCache.offsets[h]=b,b;const T=q(h+y.direction,g,y),S=le(T.sub(n),m,y.direction),C=n.add(S),E=T.add(S);return g.projectionCache.offsets[h]=p.ak(c,b,C,E)||b,g.projectionCache.offsets[h]}function de(h,e,n,a,o,c,m,g,y){const b=a?h-e:h+e;let T=b>0?1:-1,S=0;a&&(T*=-1,S=Math.PI),T<0&&(S+=Math.PI);let C,E=T>0?c+o:c+o+1;g.projectionCache.cachedAnchorPoint?C=g.projectionCache.cachedAnchorPoint:(C=ne(g.tileAnchorPoint.x,g.tileAnchorPoint.y,g).point,g.projectionCache.cachedAnchorPoint=C);let R,V,U=C,$=C,Z=0,B=0;const X=Math.abs(b),K=[];let ee;for(;Z+B<=X;){if(E+=T,E=m)return null;Z+=B,$=U,V=R;const xe={absOffsetX:X,direction:T,distanceFromAnchor:Z,previousVertex:$};if(U=q(E,g,xe),n===0)K.push($),ee=U.sub($);else{let Te;const fe=U.sub($);Te=fe.mag()===0?le(q(E+T,g,xe).sub(U),n,T):le(fe,n,T),V||(V=$.add(Te)),R=te(E,Te,U,c,m,V,n,g,xe),K.push(V),ee=R.sub(V)}B=ee.mag()}const oe=ee._mult((X-Z)/B)._add(V||$),he=S+Math.atan2(U.y-$.y,U.x-$.x);return K.push(oe),{point:oe,angle:y?he:0,path:K}}const Ee=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function De(h,e){for(let n=0;n=1;Ue--)be.push(Ve.path[Ue]);for(let Ue=1;UeHe.signedDistanceFromCamera<=0)?[]:Ue.map(He=>He.point)}let pt=[];if(be.length>0){const Ue=be[0].clone(),He=be[0].clone();for(let ft=1;ft=fe.x&&He.x<=pe.x&&Ue.y>=fe.y&&He.y<=pe.y?[be]:He.xpe.x||He.ype.y?[]:p.al([be],fe.x,fe.y,pe.x,pe.y)}for(const Ue of pt){Me.reset(Ue,.25*Te);let He=0;He=Me.length<=.5*Te?1:Math.ceil(Me.paddedLength/Fe)+1;for(let ft=0;ftN(o.x,o.y,a,n.getElevation))}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const n=[];let a=1/0,o=1/0,c=-1/0,m=-1/0;for(const T of e){const S=new p.P(T.x+je,T.y+je);a=Math.min(a,S.x),o=Math.min(o,S.y),c=Math.max(c,S.x),m=Math.max(m,S.y),n.push(S)}const g=this.grid.query(a,o,c,m).concat(this.ignoredGrid.query(a,o,c,m)),y={},b={};for(const T of g){const S=T.key;if(y[S.bucketInstanceId]===void 0&&(y[S.bucketInstanceId]={}),y[S.bucketInstanceId][S.featureIndex])continue;const C=[new p.P(T.x1,T.y1),new p.P(T.x2,T.y1),new p.P(T.x2,T.y2),new p.P(T.x1,T.y2)];p.am(n,C)&&(y[S.bucketInstanceId][S.featureIndex]=!0,b[S.bucketInstanceId]===void 0&&(b[S.bucketInstanceId]=[]),b[S.bucketInstanceId].push(S.featureIndex))}return b}insertCollisionBox(e,n,a,o,c,m){(a?this.ignoredGrid:this.grid).insert({bucketInstanceId:o,featureIndex:c,collisionGroupID:m,overlapMode:n},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,n,a,o,c,m){const g=a?this.ignoredGrid:this.grid,y={bucketInstanceId:o,featureIndex:c,collisionGroupID:m,overlapMode:n};for(let b=0;b=this.screenRightBoundary||othis.screenBottomBoundary}isInsideGrid(e,n,a,o){return a>=0&&e=0&&nthis.projectAndGetPerspectiveRatio(a,Te.x,Te.y,o,b));he=xe.some(Te=>!Te.isOccluded),oe=xe.map(Te=>Te.point)}else he=!0;return{box:p.ao(oe),allPointsOccluded:!he}}}function Ge(h,e,n){return e*(p.X/(h.tileSize*Math.pow(2,n-h.tileID.overscaledZ)))}class Pt{constructor(e,n,a,o){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?n:-n))):o&&a?1:0,this.placed=a}isHidden(){return this.opacity===0&&!this.placed}}class xt{constructor(e,n,a,o,c){this.text=new Pt(e?e.text:null,n,a,c),this.icon=new Pt(e?e.icon:null,n,o,c)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class qe{constructor(e,n,a){this.text=e,this.icon=n,this.skipFade=a}}class rt{constructor(){this.invProjMatrix=p.H(),this.viewportMatrix=p.H(),this.circles=[]}}class gt{constructor(e,n,a,o,c){this.bucketInstanceId=e,this.featureIndex=n,this.sourceLayerIndex=a,this.bucketIndex=o,this.tileID=c}}class kt{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const n=++this.maxGroupID;this.collisionGroups[e]={ID:n,predicate:a=>a.collisionGroupID===n}}return this.collisionGroups[e]}}function Lt(h,e,n,a,o){const{horizontalAlign:c,verticalAlign:m}=p.au(h);return new p.P(-(c-.5)*e+a[0]*o,-(m-.5)*n+a[1]*o)}class Wt{constructor(e,n,a,o,c,m){this.transform=e.clone(),this.terrain=a,this.collisionIndex=new Je(this.transform,n),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new kt(c),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=m,m&&(m.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){const n=this.terrain;return n?(a,o)=>n.getElevation(e,a,o):null}getBucketParts(e,n,a,o){const c=a.getBucket(n),m=a.latestFeatureIndex;if(!c||!m||n.id!==c.layerIds[0])return;const g=a.collisionBoxArray,y=c.layers[0].layout,b=c.layers[0].paint,T=Math.pow(2,this.transform.zoom-a.tileID.overscaledZ),S=a.tileSize/p.X,C=a.tileID.toUnwrapped(),E=this.transform.calculatePosMatrix(C),R=y.get("text-pitch-alignment")==="map",V=y.get("text-rotation-alignment")==="map",U=Ge(a,1,this.transform.zoom),$=this.collisionIndex.mapProjection.translatePosition(this.transform,a,b.get("text-translate"),b.get("text-translate-anchor")),Z=this.collisionIndex.mapProjection.translatePosition(this.transform,a,b.get("icon-translate"),b.get("icon-translate-anchor")),B=Mr(E,R,V,this.transform,U);let X=null;if(R){const ee=rr(E,R,V,this.transform,U);X=p.L([],this.transform.labelPlaneMatrix,ee)}this.retainedQueryData[c.bucketInstanceId]=new gt(c.bucketInstanceId,m,c.sourceLayerIndex,c.index,a.tileID);const K={bucket:c,layout:y,translationText:$,translationIcon:Z,posMatrix:E,unwrappedTileID:C,textLabelPlaneMatrix:B,labelToScreenMatrix:X,scale:T,textPixelRatio:S,holdingForFade:a.holdingForFade(),collisionBoxArray:g,partiallyEvaluatedTextSize:p.ag(c.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(c.sourceID)};if(o)for(const ee of c.sortKeyRanges){const{sortKey:oe,symbolInstanceStart:he,symbolInstanceEnd:xe}=ee;e.push({sortKey:oe,symbolInstanceStart:he,symbolInstanceEnd:xe,parameters:K})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:c.symbolInstances.length,parameters:K})}attemptAnchorPlacement(e,n,a,o,c,m,g,y,b,T,S,C,E,R,V,U,$,Z,B){const X=p.aq[e.textAnchor],K=[e.textOffset0,e.textOffset1],ee=Lt(X,a,o,K,c),oe=this.collisionIndex.placeCollisionBox(n,C,y,b,T,g,m,U,S.predicate,B,ee);if((!Z||this.collisionIndex.placeCollisionBox(Z,C,y,b,T,g,m,$,S.predicate,B,ee).placeable)&&oe.placeable){let he;if(this.prevPlacement&&this.prevPlacement.variableOffsets[E.crossTileID]&&this.prevPlacement.placements[E.crossTileID]&&this.prevPlacement.placements[E.crossTileID].text&&(he=this.prevPlacement.variableOffsets[E.crossTileID].anchor),E.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[E.crossTileID]={textOffset:K,width:a,height:o,anchor:X,textBoxScale:c,prevAnchor:he},this.markUsedJustification(R,X,E,V),R.allowVerticalPlacement&&(this.markUsedOrientation(R,V,E),this.placedOrientations[E.crossTileID]=V),{shift:ee,placedGlyphBoxes:oe}}}placeLayerBucketPart(e,n,a){const{bucket:o,layout:c,translationText:m,translationIcon:g,posMatrix:y,unwrappedTileID:b,textLabelPlaneMatrix:T,labelToScreenMatrix:S,textPixelRatio:C,holdingForFade:E,collisionBoxArray:R,partiallyEvaluatedTextSize:V,collisionGroup:U}=e.parameters,$=c.get("text-optional"),Z=c.get("icon-optional"),B=p.ar(c,"text-overlap","text-allow-overlap"),X=B==="always",K=p.ar(c,"icon-overlap","icon-allow-overlap"),ee=K==="always",oe=c.get("text-rotation-alignment")==="map",he=c.get("text-pitch-alignment")==="map",xe=c.get("icon-text-fit")!=="none",Te=c.get("symbol-z-order")==="viewport-y",fe=X&&(ee||!o.hasIconData()||Z),pe=ee&&(X||!o.hasTextData()||$);!o.collisionArrays&&R&&o.deserializeCollisionBoxes(R);const Me=this._getTerrainElevationFunc(this.retainedQueryData[o.bucketInstanceId].tileID),Ve=(ge,be,Fe)=>{var pt,Ue;if(n[ge.crossTileID])return;if(E)return void(this.placements[ge.crossTileID]=new qe(!1,!1,!1));let He=!1,ft=!1,Vt=!0,ji=null,mt={box:null,placeable:!1,offscreen:null},ni={box:null,placeable:!1,offscreen:null},Kt=null,Nt=null,Jt=null,or=0,Rn=0,aa=0;be.textFeatureIndex?or=be.textFeatureIndex:ge.useRuntimeCollisionCircles&&(or=ge.featureIndex),be.verticalTextFeatureIndex&&(Rn=be.verticalTextFeatureIndex);const Bn=be.textBox;if(Bn){const Ai=Rt=>{let jt=p.ah.horizontal;if(o.allowVerticalPlacement&&!Rt&&this.prevPlacement){const gi=this.prevPlacement.placedOrientations[ge.crossTileID];gi&&(this.placedOrientations[ge.crossTileID]=gi,jt=gi,this.markUsedOrientation(o,jt,ge))}return jt},Mi=(Rt,jt)=>{if(o.allowVerticalPlacement&&ge.numVerticalGlyphVertices>0&&be.verticalTextBox){for(const gi of o.writingModes)if(gi===p.ah.vertical?(mt=jt(),ni=mt):mt=Rt(),mt&&mt.placeable)break}else mt=Rt()},zr=ge.textAnchorOffsetStartIndex,Ui=ge.textAnchorOffsetEndIndex;if(Ui===zr){const Rt=(jt,gi)=>{const We=this.collisionIndex.placeCollisionBox(jt,B,C,y,b,he,oe,m,U.predicate,Me);return We&&We.placeable&&(this.markUsedOrientation(o,gi,ge),this.placedOrientations[ge.crossTileID]=gi),We};Mi(()=>Rt(Bn,p.ah.horizontal),()=>{const jt=be.verticalTextBox;return o.allowVerticalPlacement&&ge.numVerticalGlyphVertices>0&&jt?Rt(jt,p.ah.vertical):{box:null,offscreen:null}}),Ai(mt&&mt.placeable)}else{let Rt=p.aq[(Ue=(pt=this.prevPlacement)===null||pt===void 0?void 0:pt.variableOffsets[ge.crossTileID])===null||Ue===void 0?void 0:Ue.anchor];const jt=(We,rn,Fn)=>{const On=We.x2-We.x1,fl=We.y2-We.y1,hc=ge.textBoxScale,ml=xe&&K==="never"?rn:null;let Er=null,_l=B==="never"?1:2,la="never";Rt&&_l++;for(let ys=0;ys<_l;ys++){for(let ca=zr;cajt(Bn,be.iconBox,p.ah.horizontal),()=>{const We=be.verticalTextBox;return o.allowVerticalPlacement&&(!mt||!mt.placeable)&&ge.numVerticalGlyphVertices>0&&We?jt(We,be.verticalIconBox,p.ah.vertical):{box:null,occluded:!0,offscreen:null}}),mt&&(He=mt.placeable,Vt=mt.offscreen);const gi=Ai(mt&&mt.placeable);if(!He&&this.prevPlacement){const We=this.prevPlacement.variableOffsets[ge.crossTileID];We&&(this.variableOffsets[ge.crossTileID]=We,this.markUsedJustification(o,We.anchor,ge,gi))}}}if(Kt=mt,He=Kt&&Kt.placeable,Vt=Kt&&Kt.offscreen,ge.useRuntimeCollisionCircles){const Ai=o.text.placedSymbolArray.get(ge.centerJustifiedTextSymbolIndex),Mi=p.ai(o.textSizeData,V,Ai),zr=c.get("text-padding");Nt=this.collisionIndex.placeCollisionCircles(B,Ai,o.lineVertexArray,o.glyphOffsetArray,Mi,y,b,T,S,a,he,U.predicate,ge.collisionCircleDiameter,zr,m,Me),Nt.circles.length&&Nt.collisionDetected&&!a&&p.w("Collisions detected, but collision boxes are not shown"),He=X||Nt.circles.length>0&&!Nt.collisionDetected,Vt=Vt&&Nt.offscreen}if(be.iconFeatureIndex&&(aa=be.iconFeatureIndex),be.iconBox){const Ai=Mi=>this.collisionIndex.placeCollisionBox(Mi,K,C,y,b,he,oe,g,U.predicate,Me,xe&&ji?ji:void 0);ni&&ni.placeable&&be.verticalIconBox?(Jt=Ai(be.verticalIconBox),ft=Jt.placeable):(Jt=Ai(be.iconBox),ft=Jt.placeable),Vt=Vt&&Jt.offscreen}const Pi=$||ge.numHorizontalGlyphVertices===0&&ge.numVerticalGlyphVertices===0,oa=Z||ge.numIconVertices===0;Pi||oa?oa?Pi||(ft=ft&&He):He=ft&&He:ft=He=ft&&He;const _o=ft&&Jt.placeable;if(He&&Kt.placeable&&this.collisionIndex.insertCollisionBox(Kt.box,B,c.get("text-ignore-placement"),o.bucketInstanceId,ni&&ni.placeable&&Rn?Rn:or,U.ID),_o&&this.collisionIndex.insertCollisionBox(Jt.box,K,c.get("icon-ignore-placement"),o.bucketInstanceId,aa,U.ID),Nt&&He&&this.collisionIndex.insertCollisionCircles(Nt.circles,B,c.get("text-ignore-placement"),o.bucketInstanceId,or,U.ID),a&&this.storeCollisionData(o.bucketInstanceId,Fe,be,Kt,Jt,Nt),ge.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(o.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[ge.crossTileID]=new qe(He||fe,ft||pe,Vt||o.justReloaded),n[ge.crossTileID]=!0};if(Te){if(e.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const ge=o.getSortedSymbolIndexes(this.transform.angle);for(let be=ge.length-1;be>=0;--be){const Fe=ge[be];Ve(o.symbolInstances.get(Fe),o.collisionArrays[Fe],Fe)}}else for(let ge=e.symbolInstanceStart;ge=0&&(e.text.placedSymbolArray.get(g).crossTileID=c>=0&&g!==c?0:a.crossTileID)}markUsedOrientation(e,n,a){const o=n===p.ah.horizontal||n===p.ah.horizontalOnly?n:0,c=n===p.ah.vertical?n:0,m=[a.leftJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.rightJustifiedTextSymbolIndex];for(const g of m)e.text.placedSymbolArray.get(g).placedOrientation=o;a.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).placedOrientation=c)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let a=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const o=n?n.symbolFadeChange(e):1,c=n?n.opacities:{},m=n?n.variableOffsets:{},g=n?n.placedOrientations:{};for(const y in this.placements){const b=this.placements[y],T=c[y];T?(this.opacities[y]=new xt(T,o,b.text,b.icon),a=a||b.text!==T.text.placed||b.icon!==T.icon.placed):(this.opacities[y]=new xt(null,o,b.text,b.icon,b.skipFade),a=a||b.text||b.icon)}for(const y in c){const b=c[y];if(!this.opacities[y]){const T=new xt(b,o,!1,!1);T.isHidden()||(this.opacities[y]=T,a=a||b.text.placed||b.icon.placed)}}for(const y in m)this.variableOffsets[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.variableOffsets[y]=m[y]);for(const y in g)this.placedOrientations[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.placedOrientations[y]=g[y]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");a?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:e)}updateLayerOpacities(e,n){const a={};for(const o of n){const c=o.getBucket(e);c&&o.latestFeatureIndex&&e.id===c.layerIds[0]&&this.updateBucketOpacities(c,o.tileID,a,o.collisionBoxArray)}}updateBucketOpacities(e,n,a,o){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const c=e.layers[0],m=c.layout,g=new xt(null,0,!1,!1,!0),y=m.get("text-allow-overlap"),b=m.get("icon-allow-overlap"),T=c._unevaluatedLayout.hasValue("text-variable-anchor")||c._unevaluatedLayout.hasValue("text-variable-anchor-offset"),S=m.get("text-rotation-alignment")==="map",C=m.get("text-pitch-alignment")==="map",E=m.get("icon-text-fit")!=="none",R=new xt(null,0,y&&(b||!e.hasIconData()||m.get("icon-optional")),b&&(y||!e.hasTextData()||m.get("text-optional")),!0);!e.collisionArrays&&o&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(o);const V=($,Z,B)=>{for(let X=0;X0,he=this.placedOrientations[Z.crossTileID],xe=he===p.ah.vertical,Te=he===p.ah.horizontal||he===p.ah.horizontalOnly;if(B>0||X>0){const pe=fi(ee.text);V(e.text,B,xe?fn:pe),V(e.text,X,Te?fn:pe);const Me=ee.text.isHidden();[Z.rightJustifiedTextSymbolIndex,Z.centerJustifiedTextSymbolIndex,Z.leftJustifiedTextSymbolIndex].forEach(be=>{be>=0&&(e.text.placedSymbolArray.get(be).hidden=Me||xe?1:0)}),Z.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(Z.verticalPlacedTextSymbolIndex).hidden=Me||Te?1:0);const Ve=this.variableOffsets[Z.crossTileID];Ve&&this.markUsedJustification(e,Ve.anchor,Z,he);const ge=this.placedOrientations[Z.crossTileID];ge&&(this.markUsedJustification(e,"left",Z,ge),this.markUsedOrientation(e,ge,Z))}if(oe){const pe=fi(ee.icon),Me=!(E&&Z.verticalPlacedIconSymbolIndex&&xe);Z.placedIconSymbolIndex>=0&&(V(e.icon,Z.numIconVertices,Me?pe:fn),e.icon.placedSymbolArray.get(Z.placedIconSymbolIndex).hidden=ee.icon.isHidden()),Z.verticalPlacedIconSymbolIndex>=0&&(V(e.icon,Z.numVerticalIconVertices,Me?fn:pe),e.icon.placedSymbolArray.get(Z.verticalPlacedIconSymbolIndex).hidden=ee.icon.isHidden())}const fe=U&&U.has($)?U.get($):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const pe=e.collisionArrays[$];if(pe){let Me=new p.P(0,0);if(pe.textBox||pe.verticalTextBox){let Ve=!0;if(T){const ge=this.variableOffsets[K];ge?(Me=Lt(ge.anchor,ge.width,ge.height,ge.textOffset,ge.textBoxScale),S&&Me._rotate(C?this.transform.angle:-this.transform.angle)):Ve=!1}if(pe.textBox||pe.verticalTextBox){let ge;pe.textBox&&(ge=xe),pe.verticalTextBox&&(ge=Te),pn(e.textCollisionBox.collisionVertexArray,ee.text.placed,!Ve||ge,fe.text,Me.x,Me.y)}}if(pe.iconBox||pe.verticalIconBox){const Ve=!!(!Te&&pe.verticalIconBox);let ge;pe.iconBox&&(ge=Ve),pe.verticalIconBox&&(ge=!Ve),pn(e.iconCollisionBox.collisionVertexArray,ee.icon.placed,ge,fe.icon,E?Me.x:0,E?Me.y:0)}}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);if(e.bucketInstanceId in this.collisionCircleArrays){const $=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=$.invProjMatrix,e.placementViewportMatrix=$.viewportMatrix,e.collisionCircleArray=$.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTimee}setStale(){this.stale=!0}}function pn(h,e,n,a,o,c){a&&a.length!==0||(a=[0,0,0,0]);const m=a[0]-je,g=a[1]-je,y=a[2]-je,b=a[3]-je;h.emplaceBack(e?1:0,n?1:0,o||0,c||0,m,g),h.emplaceBack(e?1:0,n?1:0,o||0,c||0,y,g),h.emplaceBack(e?1:0,n?1:0,o||0,c||0,y,b),h.emplaceBack(e?1:0,n?1:0,o||0,c||0,m,b)}const nt=Math.pow(2,25),Pa=Math.pow(2,24),Aa=Math.pow(2,17),di=Math.pow(2,16),pi=Math.pow(2,9),Ol=Math.pow(2,8),wi=Math.pow(2,1);function fi(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;const e=h.placed?1:0,n=Math.floor(127*h.opacity);return n*nt+e*Pa+n*Aa+e*di+n*pi+e*Ol+n*wi+e}const fn=0;function qr(){return{isOccluded:(h,e,n)=>!1,getPitchedTextCorrection:(h,e,n)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(h,e,n,a){throw new Error("Not implemented.")},translatePosition:(h,e,n,a)=>function(o,c,m,g,y=!1){if(!m[0]&&!m[1])return[0,0];const b=y?g==="map"?o.angle:0:g==="viewport"?-o.angle:0;if(b){const T=Math.sin(b),S=Math.cos(b);m=[m[0]*S-m[1]*T,m[0]*T+m[1]*S]}return[y?m[0]:Ge(c,m[0],o.zoom),y?m[1]:Ge(c,m[1],o.zoom)]}(h,e,n,a),getCircleRadiusCorrection:h=>1}}class At{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,n,a,o,c){const m=this._bucketParts;for(;this._currentTileIndexg.sortKey-y.sortKey));this._currentPartIndex!this._forceFullPlacement&&me.now()-o>2;for(;this._currentPlacementIndex>=0;){const m=n[e[this._currentPlacementIndex]],g=this.placement.collisionIndex.transform.zoom;if(m.type==="symbol"&&(!m.minzoom||m.minzoom<=g)&&(!m.maxzoom||m.maxzoom>g)){if(this._inProgressLayer||(this._inProgressLayer=new At(m)),this._inProgressLayer.continuePlacement(a[m.source],this.placement,this._showCollisionBoxes,m,c))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const Bi=512/p.X/2;class St{constructor(e,n,a){this.tileID=e,this.bucketInstanceId=a,this._symbolsByKey={};const o=new Map;for(let c=0;c({x:Math.floor(y.anchorX*Bi),y:Math.floor(y.anchorY*Bi)})),crossTileIDs:m.map(y=>y.crossTileID)};if(g.positions.length>128){const y=new p.av(g.positions.length,16,Uint16Array);for(const{x:b,y:T}of g.positions)y.add(b,T);y.finish(),delete g.positions,g.index=y}this._symbolsByKey[c]=g}}getScaledCoordinates(e,n){const{x:a,y:o,z:c}=this.tileID.canonical,{x:m,y:g,z:y}=n.canonical,b=Bi/Math.pow(2,y-c),T=(g*p.X+e.anchorY)*b,S=o*p.X*Bi;return{x:Math.floor((m*p.X+e.anchorX)*b-a*p.X*Bi),y:Math.floor(T-S)}}findMatches(e,n,a){const o=this.tileID.canonical.ze)}}class Cs{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Fi{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const n=Math.round((e-this.lng)/360);if(n!==0)for(const a in this.indexes){const o=this.indexes[a],c={};for(const m in o){const g=o[m];g.tileID=g.tileID.unwrapTo(g.tileID.wrap+n),c[g.tileID.key]=g}this.indexes[a]=c}this.lng=e}addBucket(e,n,a){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let c=0;ce.overscaledZ)for(const g in m){const y=m[g];y.tileID.isChildOf(e)&&y.findMatches(n.symbolInstances,e,o)}else{const g=m[e.scaledTo(Number(c)).key];g&&g.findMatches(n.symbolInstances,e,o)}}for(let c=0;c{n[a]=!0});for(const a in this.layerIndexes)n[a]||delete this.layerIndexes[a]}}const Oi=(h,e)=>p.t(h,e&&e.filter(n=>n.identifier!=="source.canvas")),Vl=p.aw();class ks extends p.E{constructor(e,n={}){super(),this._rtlPluginLoaded=()=>{for(const a in this.sourceCaches){const o=this.sourceCaches[a].getSource().type;o!=="vector"&&o!=="geojson"||this.sourceCaches[a].reload()}},this.map=e,this.dispatcher=new Ur(jr(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",(a,o)=>this.getGlyphs(a,o)),this.dispatcher.registerMessageHandler("GI",(a,o)=>this.getImages(a,o)),this.imageManager=new Ft,this.imageManager.setEventedParent(this),this.glyphManager=new Yi(e._requestManager,n.localIdeographFontFamily),this.lineAtlas=new cn(256,512),this.crossTileSymbolIndex=new Ma,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new p.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",p.ay()),tr().on(ue,this._rtlPluginLoaded),this.on("data",a=>{if(a.dataType!=="source"||a.sourceDataType!=="metadata")return;const o=this.sourceCaches[a.sourceId];if(!o)return;const c=o.getSource();if(c&&c.vectorLayerIds)for(const m in this._layers){const g=this._layers[m];g.source===c.id&&this._validateLayer(g)}})}loadURL(e,n={},a){this.fire(new p.k("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const o=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;const c=this._loadStyleRequest;p.h(o,this._loadStyleRequest).then(m=>{this._loadStyleRequest=null,this._load(m.data,n,a)}).catch(m=>{this._loadStyleRequest=null,m&&!c.signal.aborted&&this.fire(new p.j(m))})}loadJSON(e,n={},a){this.fire(new p.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,me.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,n.validate=n.validate!==!1,this._load(e,n,a)}).catch(()=>{})}loadEmpty(){this.fire(new p.k("dataloading",{dataType:"style"})),this._load(Vl,{validate:!1})}_load(e,n,a){var o;const c=n.transformStyle?n.transformStyle(a,e):e;if(!n.validate||!Oi(this,p.u(c))){this._loaded=!0,this.stylesheet=c;for(const m in c.sources)this.addSource(m,c.sources[m],{validate:!1});c.sprite?this._loadSprite(c.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(c.glyphs),this._createLayers(),this.light=new dr(this.stylesheet.light),this.sky=new Di(this.stylesheet.sky),this.map.setTerrain((o=this.stylesheet.terrain)!==null&&o!==void 0?o:null),this.fire(new p.k("data",{dataType:"style"})),this.fire(new p.k("style.load"))}}_createLayers(){const e=p.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",e),this._order=e.map(n=>n.id),this._layers={},this._serializedLayers=null;for(const n of e){const a=p.aA(n);a.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=a}}_loadSprite(e,n=!1,a=void 0){let o;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(c,m,g,y){return p._(this,void 0,void 0,function*(){const b=Ji(c),T=g>1?"@2x":"",S={},C={};for(const{id:E,url:R}of b){const V=m.transformRequest(Xn(R,T,".json"),"SpriteJSON");S[E]=p.h(V,y);const U=m.transformRequest(Xn(R,T,".png"),"SpriteImage");C[E]=hi.getImage(U,y)}return yield Promise.all([...Object.values(S),...Object.values(C)]),function(E,R){return p._(this,void 0,void 0,function*(){const V={};for(const U in E){V[U]={};const $=me.getImageCanvasContext((yield R[U]).data),Z=(yield E[U]).data;for(const B in Z){const{width:X,height:K,x:ee,y:oe,sdf:he,pixelRatio:xe,stretchX:Te,stretchY:fe,content:pe,textFitWidth:Me,textFitHeight:Ve}=Z[B];V[U][B]={data:null,pixelRatio:xe,sdf:he,stretchX:Te,stretchY:fe,content:pe,textFitWidth:Me,textFitHeight:Ve,spriteData:{width:X,height:K,x:ee,y:oe,context:$}}}}return V})}(S,C)})}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(c=>{if(this._spriteRequest=null,c)for(const m in c){this._spritesImagesIds[m]=[];const g=this._spritesImagesIds[m]?this._spritesImagesIds[m].filter(y=>!(y in c)):[];for(const y of g)this.imageManager.removeImage(y),this._changedImages[y]=!0;for(const y in c[m]){const b=m==="default"?y:`${m}:${y}`;this._spritesImagesIds[m].push(b),b in this.imageManager.images?this.imageManager.updateImage(b,c[m][y],!1):this.imageManager.addImage(b,c[m][y]),n&&(this._changedImages[b]=!0)}}}).catch(c=>{this._spriteRequest=null,o=c,this.fire(new p.j(o))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"})),a&&a(o)})}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"}))}_validateLayer(e){const n=this.sourceCaches[e.source];if(!n)return;const a=e.sourceLayer;if(!a)return;const o=n.getSource();(o.type==="geojson"||o.vectorLayerIds&&o.vectorLayerIds.indexOf(a)===-1)&&this.fire(new p.j(new Error(`Source layer "${a}" does not exist on source "${o.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e,n=!1){const a=this._serializedAllLayers();if(!e||e.length===0)return Object.values(n?p.aB(a):a);const o=[];for(const c of e)if(a[c]){const m=n?p.aB(a[c]):a[c];o.push(m)}return o}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};const n=Object.keys(this._layers);for(const a of n){const o=this._layers[a];o.type!=="custom"&&(e[a]=o.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const n=this._changed;if(n){const o=Object.keys(this._updatedLayers),c=Object.keys(this._removedLayers);(o.length||c.length)&&this._updateWorkerLayers(o,c);for(const m in this._updatedSources){const g=this._updatedSources[m];if(g==="reload")this._reloadSource(m);else{if(g!=="clear")throw new Error(`Invalid action ${g}`);this._clearSource(m)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const m in this._updatedPaintProps)this._layers[m].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}const a={};for(const o in this.sourceCaches){const c=this.sourceCaches[o];a[o]=c.used,c.used=!1}for(const o of this._order){const c=this._layers[o];c.recalculate(e,this._availableImages),!c.isHidden(e.zoom)&&c.source&&(this.sourceCaches[c.source].used=!0)}for(const o in a){const c=this.sourceCaches[o];!!a[o]!=!!c.used&&c.fire(new p.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:o}))}this.light.recalculate(e),this.sky.recalculate(e),this.z=e.zoom,n&&this.fire(new p.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,n){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,n={}){var a;this._checkLoaded();const o=this.serialize();if(e=n.transformStyle?n.transformStyle(o,e):e,((a=n.validate)===null||a===void 0||a)&&Oi(this,p.u(e)))return!1;(e=p.aB(e)).layers=p.az(e.layers);const c=p.aC(o,e),m=this._getOperationsToPerform(c);if(m.unimplemented.length>0)throw new Error(`Unimplemented: ${m.unimplemented.join(", ")}.`);if(m.operations.length===0)return!1;for(const g of m.operations)g();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){const n=[],a=[];for(const o of e)switch(o.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":n.push(()=>this.addLayer.apply(this,o.args));break;case"removeLayer":n.push(()=>this.removeLayer.apply(this,o.args));break;case"setPaintProperty":n.push(()=>this.setPaintProperty.apply(this,o.args));break;case"setLayoutProperty":n.push(()=>this.setLayoutProperty.apply(this,o.args));break;case"setFilter":n.push(()=>this.setFilter.apply(this,o.args));break;case"addSource":n.push(()=>this.addSource.apply(this,o.args));break;case"removeSource":n.push(()=>this.removeSource.apply(this,o.args));break;case"setLayerZoomRange":n.push(()=>this.setLayerZoomRange.apply(this,o.args));break;case"setLight":n.push(()=>this.setLight.apply(this,o.args));break;case"setGeoJSONSourceData":n.push(()=>this.setGeoJSONSourceData.apply(this,o.args));break;case"setGlyphs":n.push(()=>this.setGlyphs.apply(this,o.args));break;case"setSprite":n.push(()=>this.setSprite.apply(this,o.args));break;case"setSky":n.push(()=>this.setSky.apply(this,o.args));break;case"setTerrain":n.push(()=>this.map.setTerrain.apply(this,o.args));break;case"setTransition":n.push(()=>{});break;default:a.push(o.command)}return{operations:n,unimplemented:a}}addImage(e,n){if(this.getImage(e))return this.fire(new p.j(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,n),this._afterImageUpdated(e)}updateImage(e,n){this.imageManager.updateImage(e,n)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new p.j(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,n,a={}){if(this._checkLoaded(),this.sourceCaches[e]!==void 0)throw new Error(`Source "${e}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(p.u.source,`sources.${e}`,n,null,a))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const o=this.sourceCaches[e]=new Be(e,n,this.dispatcher);o.style=this,o.setEventedParent(this,()=>({isSourceLoaded:o.loaded(),source:o.serialize(),sourceId:e})),o.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error("There is no source with this ID");for(const a in this._layers)if(this._layers[a].source===e)return this.fire(new p.j(new Error(`Source "${e}" cannot be removed while layer "${a}" is using it.`)));const n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new p.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,n){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error(`There is no source with this ID=${e}`);const a=this.sourceCaches[e].getSource();if(a.type!=="geojson")throw new Error(`geojsonSource.type is ${a.type}, which is !== 'geojson`);a.setData(n),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,n,a={}){this._checkLoaded();const o=e.id;if(this.getLayer(o))return void this.fire(new p.j(new Error(`Layer "${o}" already exists on this map.`)));let c;if(e.type==="custom"){if(Oi(this,p.aD(e)))return;c=p.aA(e)}else{if("source"in e&&typeof e.source=="object"&&(this.addSource(o,e.source),e=p.aB(e),e=p.e(e,{source:o})),this._validate(p.u.layer,`layers.${o}`,e,{arrayIndex:-1},a))return;c=p.aA(e),this._validateLayer(c),c.setEventedParent(this,{layer:{id:o}})}const m=n?this._order.indexOf(n):this._order.length;if(n&&m===-1)this.fire(new p.j(new Error(`Cannot add layer "${o}" before non-existing layer "${n}".`)));else{if(this._order.splice(m,0,o),this._layerOrderChanged=!0,this._layers[o]=c,this._removedLayers[o]&&c.source&&c.type!=="custom"){const g=this._removedLayers[o];delete this._removedLayers[o],g.type!==c.type?this._updatedSources[c.source]="clear":(this._updatedSources[c.source]="reload",this.sourceCaches[c.source].pause())}this._updateLayer(c),c.onAdd&&c.onAdd(this.map)}}moveLayer(e,n){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new p.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===n)return;const a=this._order.indexOf(e);this._order.splice(a,1);const o=n?this._order.indexOf(n):this._order.length;n&&o===-1?this.fire(new p.j(new Error(`Cannot move layer "${e}" before non-existing layer "${n}".`))):(this._order.splice(o,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();const n=this._layers[e];if(!n)return void this.fire(new p.j(new Error(`Cannot remove non-existing layer "${e}".`)));n.setEventedParent(null);const a=this._order.indexOf(e);this._order.splice(a,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=n,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],n.onRemove&&n.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,n,a){this._checkLoaded();const o=this.getLayer(e);o?o.minzoom===n&&o.maxzoom===a||(n!=null&&(o.minzoom=n),a!=null&&(o.maxzoom=a),this._updateLayer(o)):this.fire(new p.j(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,n,a={}){this._checkLoaded();const o=this.getLayer(e);if(o){if(!p.aE(o.filter,n))return n==null?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(p.u.filter,`layers.${o.id}.filter`,n,null,a)||(o.filter=p.aB(n),this._updateLayer(o)))}else this.fire(new p.j(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return p.aB(this.getLayer(e).filter)}setLayoutProperty(e,n,a,o={}){this._checkLoaded();const c=this.getLayer(e);c?p.aE(c.getLayoutProperty(n),a)||(c.setLayoutProperty(n,a,o),this._updateLayer(c)):this.fire(new p.j(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,n){const a=this.getLayer(e);if(a)return a.getLayoutProperty(n);this.fire(new p.j(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,n,a,o={}){this._checkLoaded();const c=this.getLayer(e);c?p.aE(c.getPaintProperty(n),a)||(c.setPaintProperty(n,a,o)&&this._updateLayer(c),this._changed=!0,this._updatedPaintProps[e]=!0,this._serializedLayers=null):this.fire(new p.j(new Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,n){return this.getLayer(e).getPaintProperty(n)}setFeatureState(e,n){this._checkLoaded();const a=e.source,o=e.sourceLayer,c=this.sourceCaches[a];if(c===void 0)return void this.fire(new p.j(new Error(`The source '${a}' does not exist in the map's style.`)));const m=c.getSource().type;m==="geojson"&&o?this.fire(new p.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):m!=="vector"||o?(e.id===void 0&&this.fire(new p.j(new Error("The feature id parameter must be provided."))),c.setFeatureState(o,e.id,n)):this.fire(new p.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,n){this._checkLoaded();const a=e.source,o=this.sourceCaches[a];if(o===void 0)return void this.fire(new p.j(new Error(`The source '${a}' does not exist in the map's style.`)));const c=o.getSource().type,m=c==="vector"?e.sourceLayer:void 0;c!=="vector"||m?n&&typeof e.id!="string"&&typeof e.id!="number"?this.fire(new p.j(new Error("A feature id is required to remove its specific state property."))):o.removeFeatureState(m,e.id,n):this.fire(new p.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();const n=e.source,a=e.sourceLayer,o=this.sourceCaches[n];if(o!==void 0)return o.getSource().type!=="vector"||a?(e.id===void 0&&this.fire(new p.j(new Error("The feature id parameter must be provided."))),o.getFeatureState(a,e.id)):void this.fire(new p.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new p.j(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return p.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const e=p.aF(this.sourceCaches,c=>c.serialize()),n=this._serializeByIds(this._order,!0),a=this.map.getTerrain()||void 0,o=this.stylesheet;return p.aG({version:o.version,name:o.name,metadata:o.metadata,light:o.light,sky:o.sky,center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,sprite:o.sprite,glyphs:o.glyphs,transition:o.transition,sources:e,layers:n,terrain:a},c=>c!==void 0)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.sourceCaches[e.source].getSource().type!=="raster"&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){const n=m=>this._layers[m].type==="fill-extrusion",a={},o=[];for(let m=this._order.length-1;m>=0;m--){const g=this._order[m];if(n(g)){a[g]=m;for(const y of e){const b=y[g];if(b)for(const T of b)o.push(T)}}}o.sort((m,g)=>g.intersectionZ-m.intersectionZ);const c=[];for(let m=this._order.length-1;m>=0;m--){const g=this._order[m];if(n(g))for(let y=o.length-1;y>=0;y--){const b=o[y].feature;if(a[b.layer.id]{const he=$.featureSortOrder;if(he){const xe=he.indexOf(ee.featureIndex);return he.indexOf(oe.featureIndex)-xe}return oe.featureIndex-ee.featureIndex});for(const ee of K)X.push(ee)}}for(const $ in R)R[$].forEach(Z=>{const B=Z.feature,X=b[g[$].source].getFeatureState(B.layer["source-layer"],B.id);B.source=B.layer.source,B.layer["source-layer"]&&(B.sourceLayer=B.layer["source-layer"]),B.state=X});return R}(this._layers,m,this.sourceCaches,e,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)}querySourceFeatures(e,n){n&&n.filter&&this._validate(p.u.filter,"querySourceFeatures.filter",n.filter,null,n);const a=this.sourceCaches[e];return a?function(o,c){const m=o.getRenderableIds().map(b=>o.getTileByID(b)),g=[],y={};for(let b=0;bC.getTileByID(E)).sort((E,R)=>R.tileID.overscaledZ-E.tileID.overscaledZ||(E.tileID.isLessThan(R.tileID)?-1:1))}const S=this.crossTileSymbolIndex.addLayer(T,y[T.source],e.center.lng);m=m||S}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((c=c||this._layerOrderChanged||a===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(me.now(),e.zoom))&&(this.pauseablePlacement=new es(e,this.map.terrain,this._order,c,n,a,o,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,y),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(me.now()),g=!0),m&&this.pauseablePlacement.placement.setStale()),g||m)for(const b of this._order){const T=this._layers[b];T.type==="symbol"&&this.placement.updateLayerOpacities(T,y[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(me.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,n){return p._(this,void 0,void 0,function*(){const a=yield this.imageManager.getImages(n.icons);this._updateTilesForChangedImages();const o=this.sourceCaches[n.source];return o&&o.setDependencies(n.tileID.key,n.type,n.icons),a})}getGlyphs(e,n){return p._(this,void 0,void 0,function*(){const a=yield this.glyphManager.getGlyphs(n.stacks),o=this.sourceCaches[n.source];return o&&o.setDependencies(n.tileID.key,n.type,[""]),a})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,n={}){this._checkLoaded(),e&&this._validate(p.u.glyphs,"glyphs",e,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,n,a={},o){this._checkLoaded();const c=[{id:e,url:n}],m=[...Ji(this.stylesheet.sprite),...c];this._validate(p.u.sprite,"sprite",m,null,a)||(this.stylesheet.sprite=m,this._loadSprite(c,!0,o))}removeSprite(e){this._checkLoaded();const n=Ji(this.stylesheet.sprite);if(n.find(a=>a.id===e)){if(this._spritesImagesIds[e])for(const a of this._spritesImagesIds[e])this.imageManager.removeImage(a),this._changedImages[a]=!0;n.splice(n.findIndex(a=>a.id===e),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"}))}else this.fire(new p.j(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return Ji(this.stylesheet.sprite)}setSprite(e,n={},a){this._checkLoaded(),e&&this._validate(p.u.sprite,"sprite",e,null,n)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,a):(this._unloadSprite(),a&&a(null)))}}var Zr=p.Y([{name:"a_pos",type:"Int16",components:2}]);const Cr={prelude:tt(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 +);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} +#ifdef TERRAIN3D +uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; +#endif +const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { +#ifdef TERRAIN3D +highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; +#else +return 0.0; +#endif +}`),background:tt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:tt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:tt(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:tt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:tt(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:tt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:tt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:tt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;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(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:tt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:tt(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_FragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:tt(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:tt(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:tt(`#ifdef GL_ES +precision highp float; +#endif +uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:tt(`varying vec4 v_color;void main() {gl_FragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec4 v_color; +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec3 normal=a_normal_ed.xyz; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:tt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 +? a_pos +: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:tt(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:tt(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; +#define PI 3.141592653589793 +void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:tt(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:tt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_width2=vec2(outset,inset);}`),linePattern:tt(`#ifdef GL_ES +precision highp float; +#endif +uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:tt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:tt(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:tt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:tt(`#define SDF_PX 8.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:tt(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:tt("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:tt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:tt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:tt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function tt(h,e){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,a=e.match(/attribute ([\w]+) ([\w]+)/g),o=h.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),c=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=c?c.concat(o):o,g={};return{fragmentSource:h=h.replace(n,(y,b,T,S,C)=>(g[C]=!0,b==="define"?` +#ifndef HAS_UNIFORM_u_${C} +varying ${T} ${S} ${C}; +#else +uniform ${T} ${S} u_${C}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${C} + ${T} ${S} ${C} = u_${C}; +#endif +`)),vertexSource:e=e.replace(n,(y,b,T,S,C)=>{const E=S==="float"?"vec2":"vec4",R=C.match(/color/)?"color":E;return g[C]?b==="define"?` +#ifndef HAS_UNIFORM_u_${C} +uniform lowp float u_${C}_t; +attribute ${T} ${E} a_${C}; +varying ${T} ${S} ${C}; +#else +uniform ${T} ${S} u_${C}; +#endif +`:R==="vec4"?` +#ifndef HAS_UNIFORM_u_${C} + ${C} = a_${C}; +#else + ${T} ${S} ${C} = u_${C}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${C} + ${C} = unpack_mix_${R}(a_${C}, u_${C}_t); +#else + ${T} ${S} ${C} = u_${C}; +#endif +`:b==="define"?` +#ifndef HAS_UNIFORM_u_${C} +uniform lowp float u_${C}_t; +attribute ${T} ${E} a_${C}; +#else +uniform ${T} ${S} u_${C}; +#endif +`:R==="vec4"?` +#ifndef HAS_UNIFORM_u_${C} + ${T} ${S} ${C} = a_${C}; +#else + ${T} ${S} ${C} = u_${C}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${C} + ${T} ${S} ${C} = unpack_mix_${R}(a_${C}, u_${C}_t); +#else + ${T} ${S} ${C} = u_${C}; +#endif +`}),staticAttributes:a,staticUniforms:m}}class Ca{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,n,a,o,c,m,g,y,b){this.context=e;let T=this.boundPaintVertexBuffers.length!==o.length;for(let S=0;!T&&S({u_matrix:h,u_texture:0,u_ele_delta:e,u_fog_matrix:n,u_fog_color:a?a.properties.get("fog-color"):p.aM.white,u_fog_ground_blend:a?a.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:a?a.calculateFogBlendOpacity(o):0,u_horizon_color:a?a.properties.get("horizon-color"):p.aM.white,u_horizon_fog_blend:a?a.properties.get("horizon-fog-blend"):1});function mn(h){const e=[];for(let n=0;n({u_depth:new p.aH(ee,oe.u_depth),u_terrain:new p.aH(ee,oe.u_terrain),u_terrain_dim:new p.aI(ee,oe.u_terrain_dim),u_terrain_matrix:new p.aJ(ee,oe.u_terrain_matrix),u_terrain_unpack:new p.aK(ee,oe.u_terrain_unpack),u_terrain_exaggeration:new p.aI(ee,oe.u_terrain_exaggeration)}))(e,K),this.binderUniforms=a?a.getUniforms(e,K):[]}draw(e,n,a,o,c,m,g,y,b,T,S,C,E,R,V,U,$,Z){const B=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(a),e.setStencilMode(o),e.setColorMode(c),e.setCullFace(m),y){e.activeTexture.set(B.TEXTURE2),B.bindTexture(B.TEXTURE_2D,y.depthTexture),e.activeTexture.set(B.TEXTURE3),B.bindTexture(B.TEXTURE_2D,y.texture);for(const K in this.terrainUniforms)this.terrainUniforms[K].set(y[K])}for(const K in this.fixedUniforms)this.fixedUniforms[K].set(g[K]);V&&V.setUniforms(e,this.binderUniforms,E,{zoom:R});let X=0;switch(n){case B.LINES:X=2;break;case B.TRIANGLES:X=3;break;case B.LINE_STRIP:X=1}for(const K of C.get()){const ee=K.vaos||(K.vaos={});(ee[b]||(ee[b]=new Ca)).bind(e,this,T,V?V.getPaintVertexBuffers():[],S,K.vertexOffset,U,$,Z),B.drawElements(n,K.primitiveLength*X,B.UNSIGNED_SHORT,K.primitiveOffset*X*2)}}}function zs(h,e,n){const a=1/Ge(n,1,e.transform.tileZoom),o=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,e.transform.tileZoom)/o,m=c*(n.tileID.canonical.x+n.tileID.wrap*o),g=c*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[a,h.fromScale,h.toScale],u_fade:h.t,u_pixel_coord_upper:[m>>16,g>>16],u_pixel_coord_lower:[65535&m,65535&g]}}const ts=(h,e,n,a)=>{const o=e.style.light,c=o.properties.get("position"),m=[c.x,c.y,c.z],g=function(){var b=new p.A(9);return p.A!=Float32Array&&(b[1]=0,b[2]=0,b[3]=0,b[5]=0,b[6]=0,b[7]=0),b[0]=1,b[4]=1,b[8]=1,b}();o.properties.get("anchor")==="viewport"&&function(b,T){var S=Math.sin(T),C=Math.cos(T);b[0]=C,b[1]=S,b[2]=0,b[3]=-S,b[4]=C,b[5]=0,b[6]=0,b[7]=0,b[8]=1}(g,-e.transform.angle),function(b,T,S){var C=T[0],E=T[1],R=T[2];b[0]=C*S[0]+E*S[3]+R*S[6],b[1]=C*S[1]+E*S[4]+R*S[7],b[2]=C*S[2]+E*S[5]+R*S[8]}(m,m,g);const y=o.properties.get("color");return{u_matrix:h,u_lightpos:m,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[y.r,y.g,y.b],u_vertical_gradient:+n,u_opacity:a}},Es=(h,e,n,a,o,c,m)=>p.e(ts(h,e,n,a),zs(c,e,m),{u_height_factor:-Math.pow(2,o.overscaledZ)/m.tileSize/8}),_n=h=>({u_matrix:h}),Ro=(h,e,n,a)=>p.e(_n(h),zs(n,e,a)),Nl=(h,e)=>({u_matrix:h,u_world:e}),Bo=(h,e,n,a,o)=>p.e(Ro(h,e,n,a),{u_world:o}),jl=(h,e,n,a)=>{const o=h.transform;let c,m;if(a.paint.get("circle-pitch-alignment")==="map"){const g=Ge(n,1,o.zoom);c=!0,m=[g,g]}else c=!1,m=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+(a.paint.get("circle-pitch-scale")==="map"),u_matrix:h.translatePosMatrix(e.posMatrix,n,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_pitch_with_map:+c,u_device_pixel_ratio:h.pixelRatio,u_extrude_scale:m}},Gr=(h,e,n)=>({u_matrix:h,u_inv_matrix:e,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}),is=(h,e,n=1)=>({u_matrix:h,u_color:e,u_overlay:0,u_overlay_scale:n}),ii=h=>({u_matrix:h}),ri=(h,e,n,a)=>({u_matrix:h,u_extrude_scale:Ge(e,1,n),u_intensity:a}),Ds=(h,e,n,a)=>{const o=p.H();p.aP(o,0,h.width,h.height,0,0,1);const c=h.context.gl;return{u_matrix:o,u_world:[c.drawingBufferWidth,c.drawingBufferHeight],u_image:n,u_color_ramp:a,u_opacity:e.paint.get("heatmap-opacity")}};function Ls(h,e){const n=Math.pow(2,e.canonical.z),a=e.canonical.y;return[new p.Z(0,a/n).toLngLat().lat,new p.Z(0,(a+1)/n).toLngLat().lat]}const Rs=(h,e,n,a)=>{const o=h.transform;return{u_matrix:Vo(h,e,n,a),u_ratio:1/Ge(e,1,o.zoom),u_device_pixel_ratio:h.pixelRatio,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Fo=(h,e,n,a,o)=>p.e(Rs(h,e,n,o),{u_image:0,u_image_height:a}),gn=(h,e,n,a,o)=>{const c=h.transform,m=Oo(e,c);return{u_matrix:Vo(h,e,n,o),u_texsize:e.imageAtlasTexture.size,u_ratio:1/Ge(e,1,c.zoom),u_device_pixel_ratio:h.pixelRatio,u_image:0,u_scale:[m,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},Ul=(h,e,n,a,o,c)=>{const m=h.lineAtlas,g=Oo(e,h.transform),y=n.layout.get("line-cap")==="round",b=m.getDash(a.from,y),T=m.getDash(a.to,y),S=b.width*o.fromScale,C=T.width*o.toScale;return p.e(Rs(h,e,n,c),{u_patternscale_a:[g/S,-b.height/2],u_patternscale_b:[g/C,-T.height/2],u_sdfgamma:m.width/(256*Math.min(S,C)*h.pixelRatio)/2,u_image:0,u_tex_y_a:b.y,u_tex_y_b:T.y,u_mix:o.t})};function Oo(h,e){return 1/Ge(h,1,e.tileZoom)}function Vo(h,e,n,a){return h.translatePosMatrix(a?a.posMatrix:e.tileID.posMatrix,e,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const $l=(h,e,n,a,o)=>{return{u_matrix:h,u_tl_parent:e,u_scale_parent:n,u_buffer_scale:1,u_fade_t:a.mix,u_opacity:a.opacity*o.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:o.paint.get("raster-brightness-min"),u_brightness_high:o.paint.get("raster-brightness-max"),u_saturation_factor:(m=o.paint.get("raster-saturation"),m>0?1-1/(1.001-m):-m),u_contrast_factor:(c=o.paint.get("raster-contrast"),c>0?1/(1-c):1+c),u_spin_weights:ql(o.paint.get("raster-hue-rotate"))};var c,m};function ql(h){h*=Math.PI/180;const e=Math.sin(h),n=Math.cos(h);return[(2*n+1)/3,(-Math.sqrt(3)*e-n+1)/3,(Math.sqrt(3)*e-n+1)/3]}const No=(h,e,n,a,o,c,m,g,y,b,T,S,C,E)=>{const R=m.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:R.cameraToCenterDistance,u_pitch:R.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:R.width/R.height,u_fade_change:m.options.fadeDuration?m.symbolFadeChange:1,u_matrix:g,u_label_plane_matrix:y,u_coord_matrix:b,u_is_text:+S,u_pitch_with_map:+a,u_is_along_line:o,u_is_variable_anchor:c,u_texsize:C,u_texture:0,u_translation:T,u_pitched_scale:E}},rs=(h,e,n,a,o,c,m,g,y,b,T,S,C,E,R)=>{const V=m.transform;return p.e(No(h,e,n,a,o,c,m,g,y,b,T,S,C,R),{u_gamma_scale:a?Math.cos(V._pitch)*V.cameraToCenterDistance:1,u_device_pixel_ratio:m.pixelRatio,u_is_halo:+E})},Ea=(h,e,n,a,o,c,m,g,y,b,T,S,C,E)=>p.e(rs(h,e,n,a,o,c,m,g,y,b,T,!0,S,!0,E),{u_texsize_icon:C,u_texture_icon:1}),Bs=(h,e,n)=>({u_matrix:h,u_opacity:e,u_color:n}),Da=(h,e,n,a,o,c)=>p.e(function(m,g,y,b){const T=y.imageManager.getPattern(m.from.toString()),S=y.imageManager.getPattern(m.to.toString()),{width:C,height:E}=y.imageManager.getPixelSize(),R=Math.pow(2,b.tileID.overscaledZ),V=b.tileSize*Math.pow(2,y.transform.tileZoom)/R,U=V*(b.tileID.canonical.x+b.tileID.wrap*R),$=V*b.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:T.tl,u_pattern_br_a:T.br,u_pattern_tl_b:S.tl,u_pattern_br_b:S.br,u_texsize:[C,E],u_mix:g.t,u_pattern_size_a:T.displaySize,u_pattern_size_b:S.displaySize,u_scale_a:g.fromScale,u_scale_b:g.toScale,u_tile_units_to_pixels:1/Ge(b,1,y.transform.tileZoom),u_pixel_coord_upper:[U>>16,$>>16],u_pixel_coord_lower:[65535&U,65535&$]}}(a,c,n,o),{u_matrix:h,u_opacity:e}),La={fillExtrusion:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_lightpos:new p.aN(h,e.u_lightpos),u_lightintensity:new p.aI(h,e.u_lightintensity),u_lightcolor:new p.aN(h,e.u_lightcolor),u_vertical_gradient:new p.aI(h,e.u_vertical_gradient),u_opacity:new p.aI(h,e.u_opacity)}),fillExtrusionPattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_lightpos:new p.aN(h,e.u_lightpos),u_lightintensity:new p.aI(h,e.u_lightintensity),u_lightcolor:new p.aN(h,e.u_lightcolor),u_vertical_gradient:new p.aI(h,e.u_vertical_gradient),u_height_factor:new p.aI(h,e.u_height_factor),u_image:new p.aH(h,e.u_image),u_texsize:new p.aO(h,e.u_texsize),u_pixel_coord_upper:new p.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new p.aO(h,e.u_pixel_coord_lower),u_scale:new p.aN(h,e.u_scale),u_fade:new p.aI(h,e.u_fade),u_opacity:new p.aI(h,e.u_opacity)}),fill:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix)}),fillPattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_image:new p.aH(h,e.u_image),u_texsize:new p.aO(h,e.u_texsize),u_pixel_coord_upper:new p.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new p.aO(h,e.u_pixel_coord_lower),u_scale:new p.aN(h,e.u_scale),u_fade:new p.aI(h,e.u_fade)}),fillOutline:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_world:new p.aO(h,e.u_world)}),fillOutlinePattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_world:new p.aO(h,e.u_world),u_image:new p.aH(h,e.u_image),u_texsize:new p.aO(h,e.u_texsize),u_pixel_coord_upper:new p.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new p.aO(h,e.u_pixel_coord_lower),u_scale:new p.aN(h,e.u_scale),u_fade:new p.aI(h,e.u_fade)}),circle:(h,e)=>({u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_scale_with_map:new p.aH(h,e.u_scale_with_map),u_pitch_with_map:new p.aH(h,e.u_pitch_with_map),u_extrude_scale:new p.aO(h,e.u_extrude_scale),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_matrix:new p.aJ(h,e.u_matrix)}),collisionBox:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_pixel_extrude_scale:new p.aO(h,e.u_pixel_extrude_scale)}),collisionCircle:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_inv_matrix:new p.aJ(h,e.u_inv_matrix),u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_viewport_size:new p.aO(h,e.u_viewport_size)}),debug:(h,e)=>({u_color:new p.aL(h,e.u_color),u_matrix:new p.aJ(h,e.u_matrix),u_overlay:new p.aH(h,e.u_overlay),u_overlay_scale:new p.aI(h,e.u_overlay_scale)}),clippingMask:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix)}),heatmap:(h,e)=>({u_extrude_scale:new p.aI(h,e.u_extrude_scale),u_intensity:new p.aI(h,e.u_intensity),u_matrix:new p.aJ(h,e.u_matrix)}),heatmapTexture:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_world:new p.aO(h,e.u_world),u_image:new p.aH(h,e.u_image),u_color_ramp:new p.aH(h,e.u_color_ramp),u_opacity:new p.aI(h,e.u_opacity)}),hillshade:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_image:new p.aH(h,e.u_image),u_latrange:new p.aO(h,e.u_latrange),u_light:new p.aO(h,e.u_light),u_shadow:new p.aL(h,e.u_shadow),u_highlight:new p.aL(h,e.u_highlight),u_accent:new p.aL(h,e.u_accent)}),hillshadePrepare:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_image:new p.aH(h,e.u_image),u_dimension:new p.aO(h,e.u_dimension),u_zoom:new p.aI(h,e.u_zoom),u_unpack:new p.aK(h,e.u_unpack)}),line:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_ratio:new p.aI(h,e.u_ratio),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_units_to_pixels:new p.aO(h,e.u_units_to_pixels)}),lineGradient:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_ratio:new p.aI(h,e.u_ratio),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_units_to_pixels:new p.aO(h,e.u_units_to_pixels),u_image:new p.aH(h,e.u_image),u_image_height:new p.aI(h,e.u_image_height)}),linePattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_texsize:new p.aO(h,e.u_texsize),u_ratio:new p.aI(h,e.u_ratio),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_image:new p.aH(h,e.u_image),u_units_to_pixels:new p.aO(h,e.u_units_to_pixels),u_scale:new p.aN(h,e.u_scale),u_fade:new p.aI(h,e.u_fade)}),lineSDF:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_ratio:new p.aI(h,e.u_ratio),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_units_to_pixels:new p.aO(h,e.u_units_to_pixels),u_patternscale_a:new p.aO(h,e.u_patternscale_a),u_patternscale_b:new p.aO(h,e.u_patternscale_b),u_sdfgamma:new p.aI(h,e.u_sdfgamma),u_image:new p.aH(h,e.u_image),u_tex_y_a:new p.aI(h,e.u_tex_y_a),u_tex_y_b:new p.aI(h,e.u_tex_y_b),u_mix:new p.aI(h,e.u_mix)}),raster:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_tl_parent:new p.aO(h,e.u_tl_parent),u_scale_parent:new p.aI(h,e.u_scale_parent),u_buffer_scale:new p.aI(h,e.u_buffer_scale),u_fade_t:new p.aI(h,e.u_fade_t),u_opacity:new p.aI(h,e.u_opacity),u_image0:new p.aH(h,e.u_image0),u_image1:new p.aH(h,e.u_image1),u_brightness_low:new p.aI(h,e.u_brightness_low),u_brightness_high:new p.aI(h,e.u_brightness_high),u_saturation_factor:new p.aI(h,e.u_saturation_factor),u_contrast_factor:new p.aI(h,e.u_contrast_factor),u_spin_weights:new p.aN(h,e.u_spin_weights)}),symbolIcon:(h,e)=>({u_is_size_zoom_constant:new p.aH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new p.aH(h,e.u_is_size_feature_constant),u_size_t:new p.aI(h,e.u_size_t),u_size:new p.aI(h,e.u_size),u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_pitch:new p.aI(h,e.u_pitch),u_rotate_symbol:new p.aH(h,e.u_rotate_symbol),u_aspect_ratio:new p.aI(h,e.u_aspect_ratio),u_fade_change:new p.aI(h,e.u_fade_change),u_matrix:new p.aJ(h,e.u_matrix),u_label_plane_matrix:new p.aJ(h,e.u_label_plane_matrix),u_coord_matrix:new p.aJ(h,e.u_coord_matrix),u_is_text:new p.aH(h,e.u_is_text),u_pitch_with_map:new p.aH(h,e.u_pitch_with_map),u_is_along_line:new p.aH(h,e.u_is_along_line),u_is_variable_anchor:new p.aH(h,e.u_is_variable_anchor),u_texsize:new p.aO(h,e.u_texsize),u_texture:new p.aH(h,e.u_texture),u_translation:new p.aO(h,e.u_translation),u_pitched_scale:new p.aI(h,e.u_pitched_scale)}),symbolSDF:(h,e)=>({u_is_size_zoom_constant:new p.aH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new p.aH(h,e.u_is_size_feature_constant),u_size_t:new p.aI(h,e.u_size_t),u_size:new p.aI(h,e.u_size),u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_pitch:new p.aI(h,e.u_pitch),u_rotate_symbol:new p.aH(h,e.u_rotate_symbol),u_aspect_ratio:new p.aI(h,e.u_aspect_ratio),u_fade_change:new p.aI(h,e.u_fade_change),u_matrix:new p.aJ(h,e.u_matrix),u_label_plane_matrix:new p.aJ(h,e.u_label_plane_matrix),u_coord_matrix:new p.aJ(h,e.u_coord_matrix),u_is_text:new p.aH(h,e.u_is_text),u_pitch_with_map:new p.aH(h,e.u_pitch_with_map),u_is_along_line:new p.aH(h,e.u_is_along_line),u_is_variable_anchor:new p.aH(h,e.u_is_variable_anchor),u_texsize:new p.aO(h,e.u_texsize),u_texture:new p.aH(h,e.u_texture),u_gamma_scale:new p.aI(h,e.u_gamma_scale),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_is_halo:new p.aH(h,e.u_is_halo),u_translation:new p.aO(h,e.u_translation),u_pitched_scale:new p.aI(h,e.u_pitched_scale)}),symbolTextAndIcon:(h,e)=>({u_is_size_zoom_constant:new p.aH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new p.aH(h,e.u_is_size_feature_constant),u_size_t:new p.aI(h,e.u_size_t),u_size:new p.aI(h,e.u_size),u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_pitch:new p.aI(h,e.u_pitch),u_rotate_symbol:new p.aH(h,e.u_rotate_symbol),u_aspect_ratio:new p.aI(h,e.u_aspect_ratio),u_fade_change:new p.aI(h,e.u_fade_change),u_matrix:new p.aJ(h,e.u_matrix),u_label_plane_matrix:new p.aJ(h,e.u_label_plane_matrix),u_coord_matrix:new p.aJ(h,e.u_coord_matrix),u_is_text:new p.aH(h,e.u_is_text),u_pitch_with_map:new p.aH(h,e.u_pitch_with_map),u_is_along_line:new p.aH(h,e.u_is_along_line),u_is_variable_anchor:new p.aH(h,e.u_is_variable_anchor),u_texsize:new p.aO(h,e.u_texsize),u_texsize_icon:new p.aO(h,e.u_texsize_icon),u_texture:new p.aH(h,e.u_texture),u_texture_icon:new p.aH(h,e.u_texture_icon),u_gamma_scale:new p.aI(h,e.u_gamma_scale),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_is_halo:new p.aH(h,e.u_is_halo),u_translation:new p.aO(h,e.u_translation),u_pitched_scale:new p.aI(h,e.u_pitched_scale)}),background:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_opacity:new p.aI(h,e.u_opacity),u_color:new p.aL(h,e.u_color)}),backgroundPattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_opacity:new p.aI(h,e.u_opacity),u_image:new p.aH(h,e.u_image),u_pattern_tl_a:new p.aO(h,e.u_pattern_tl_a),u_pattern_br_a:new p.aO(h,e.u_pattern_br_a),u_pattern_tl_b:new p.aO(h,e.u_pattern_tl_b),u_pattern_br_b:new p.aO(h,e.u_pattern_br_b),u_texsize:new p.aO(h,e.u_texsize),u_mix:new p.aI(h,e.u_mix),u_pattern_size_a:new p.aO(h,e.u_pattern_size_a),u_pattern_size_b:new p.aO(h,e.u_pattern_size_b),u_scale_a:new p.aI(h,e.u_scale_a),u_scale_b:new p.aI(h,e.u_scale_b),u_pixel_coord_upper:new p.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new p.aO(h,e.u_pixel_coord_lower),u_tile_units_to_pixels:new p.aI(h,e.u_tile_units_to_pixels)}),terrain:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_texture:new p.aH(h,e.u_texture),u_ele_delta:new p.aI(h,e.u_ele_delta),u_fog_matrix:new p.aJ(h,e.u_fog_matrix),u_fog_color:new p.aL(h,e.u_fog_color),u_fog_ground_blend:new p.aI(h,e.u_fog_ground_blend),u_fog_ground_blend_opacity:new p.aI(h,e.u_fog_ground_blend_opacity),u_horizon_color:new p.aL(h,e.u_horizon_color),u_horizon_fog_blend:new p.aI(h,e.u_horizon_fog_blend)}),terrainDepth:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_ele_delta:new p.aI(h,e.u_ele_delta)}),terrainCoords:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_texture:new p.aH(h,e.u_texture),u_terrain_coords_id:new p.aI(h,e.u_terrain_coords_id),u_ele_delta:new p.aI(h,e.u_ele_delta)}),sky:(h,e)=>({u_sky_color:new p.aL(h,e.u_sky_color),u_horizon_color:new p.aL(h,e.u_horizon_color),u_horizon:new p.aI(h,e.u_horizon),u_sky_horizon_blend:new p.aI(h,e.u_sky_horizon_blend)})};class nr{constructor(e,n,a){this.context=e;const o=e.gl;this.buffer=o.createBuffer(),this.dynamicDraw=!!a,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Zl={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ra{constructor(e,n,a,o){this.length=n.length,this.attributes=a,this.itemSize=n.bytesPerElement,this.dynamicDraw=o,this.context=e;const c=e.gl;this.buffer=c.createBuffer(),e.bindVertexBuffer.set(this.buffer),c.bufferData(c.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,n){for(let a=0;a0){const ee=p.H();p.aQ(ee,B.placementInvProjMatrix,h.transform.glCoordMatrix),p.aQ(ee,ee,B.placementViewportMatrix),y.push({circleArray:K,circleOffset:T,transform:Z.posMatrix,invTransform:ee,coord:Z}),b+=K.length/4,T=b}X&&g.draw(c,m.LINES,Ze.disabled,ht.disabled,h.colorModeForRenderPass(),at.disabled,{u_matrix:Z.posMatrix,u_pixel_extrude_scale:[1/(S=h.transform).width,1/S.height]},h.style.map.terrain&&h.style.map.terrain.getTerrainData(Z),n.id,X.layoutVertexBuffer,X.indexBuffer,X.segments,null,h.transform.zoom,null,null,X.collisionVertexBuffer)}var S;if(!o||!y.length)return;const C=h.useProgram("collisionCircle"),E=new p.aR;E.resize(4*b),E._trim();let R=0;for(const $ of y)for(let Z=0;Z<$.circleArray.length/4;Z++){const B=4*Z,X=$.circleArray[B+0],K=$.circleArray[B+1],ee=$.circleArray[B+2],oe=$.circleArray[B+3];E.emplace(R++,X,K,ee,oe,0),E.emplace(R++,X,K,ee,oe,1),E.emplace(R++,X,K,ee,oe,2),E.emplace(R++,X,K,ee,oe,3)}(!Kr||Kr.length<2*b)&&(Kr=function($){const Z=2*$,B=new p.aT;B.resize(Z),B._trim();for(let X=0;X=0&&($[B.associatedIconIndex]={shiftedAnchor:Fe,angle:pt})}else De(B.numGlyphs,V)}if(b){U.clear();const Z=h.icon.placedSymbolArray;for(let B=0;Bh.style.map.terrain.getElevation(fe,Fn,On):null,rn=n.layout.get("text-rotation-alignment")==="map";D(Me,fe.posMatrix,h,o,Rn,Bn,$,b,rn,V,fe.toUnwrapped(),R.width,R.height,Pi,We)}const Ai=fe.posMatrix,Mi=o&&he||_o,zr=Z||Mi?as:Rn,Ui=aa,Rt=be&&n.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let jt;jt=be?Me.iconsInText?Ea(Fe.kind,He,B,$,Z,Mi,h,Ai,zr,Ui,Pi,Vt,Kt,Te):rs(Fe.kind,He,B,$,Z,Mi,h,Ai,zr,Ui,Pi,o,Vt,!0,Te):No(Fe.kind,He,B,$,Z,Mi,h,Ai,zr,Ui,Pi,o,Vt,Te);const gi={program:Ue,buffers:Ve,uniformValues:jt,atlasTexture:ji,atlasTextureIcon:Nt,atlasInterpolation:mt,atlasInterpolationIcon:ni,isSDF:be,hasHalo:Rt};if(K&&Me.canOverlap){ee=!0;const We=Ve.segments.get();for(const rn of We)xe.push({segments:new p.a0([rn]),sortKey:rn.sortKey,state:gi,terrainData:ft})}else xe.push({segments:Ve.segments,sortKey:0,state:gi,terrainData:ft})}ee&&xe.sort((fe,pe)=>fe.sortKey-pe.sortKey);for(const fe of xe){const pe=fe.state;if(C.activeTexture.set(E.TEXTURE0),pe.atlasTexture.bind(pe.atlasInterpolation,E.CLAMP_TO_EDGE),pe.atlasTextureIcon&&(C.activeTexture.set(E.TEXTURE1),pe.atlasTextureIcon&&pe.atlasTextureIcon.bind(pe.atlasInterpolationIcon,E.CLAMP_TO_EDGE)),pe.isSDF){const Me=pe.uniformValues;pe.hasHalo&&(Me.u_is_halo=1,Za(pe.buffers,fe.segments,n,h,pe.program,oe,T,S,Me,fe.terrainData)),Me.u_is_halo=0}Za(pe.buffers,fe.segments,n,h,pe.program,oe,T,S,pe.uniformValues,fe.terrainData)}}function Za(h,e,n,a,o,c,m,g,y,b){const T=a.context;o.draw(T,T.gl.TRIANGLES,c,m,g,at.disabled,y,b,n.id,h.layoutVertexBuffer,h.indexBuffer,e,n.paint,a.transform.zoom,h.programConfigurations.get(n.id),h.dynamicLayoutVertexBuffer,h.opacityVertexBuffer)}function Ga(h,e,n,a){const o=h.context,c=o.gl,m=ht.disabled,g=new bt([c.ONE,c.ONE],p.aM.transparent,[!0,!0,!0,!0]),y=e.getBucket(n);if(!y)return;const b=a.key;let T=n.heatmapFbos.get(b);T||(T=os(o,e.tileSize,e.tileSize),n.heatmapFbos.set(b,T)),o.bindFramebuffer.set(T.framebuffer),o.viewport.set([0,0,e.tileSize,e.tileSize]),o.clear({color:p.aM.transparent});const S=y.programConfigurations.get(n.id),C=h.useProgram("heatmap",S),E=h.style.map.terrain.getTerrainData(a);C.draw(o,c.TRIANGLES,Ze.disabled,m,g,at.disabled,ri(a.posMatrix,e,h.transform.zoom,n.paint.get("heatmap-intensity")),E,n.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,n.paint,h.transform.zoom,S)}function Yr(h,e,n){const a=h.context,o=a.gl;a.setColorMode(h.colorModeForRenderPass());const c=ls(a,e),m=n.key,g=e.heatmapFbos.get(m);g&&(a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,g.colorAttachment.get()),a.activeTexture.set(o.TEXTURE1),c.bind(o.LINEAR,o.CLAMP_TO_EDGE),h.useProgram("heatmapTexture").draw(a,o.TRIANGLES,Ze.disabled,ht.disabled,h.colorModeForRenderPass(),at.disabled,Ds(h,e,0,1),null,e.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments,e.paint,h.transform.zoom),g.destroy(),e.heatmapFbos.delete(m))}function os(h,e,n){var a,o;const c=h.gl,m=c.createTexture();c.bindTexture(c.TEXTURE_2D,m),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR);const g=(a=h.HALF_FLOAT)!==null&&a!==void 0?a:c.UNSIGNED_BYTE,y=(o=h.RGBA16F)!==null&&o!==void 0?o:c.RGBA;c.texImage2D(c.TEXTURE_2D,0,y,e,n,0,c.RGBA,g,null);const b=h.createFramebuffer(e,n,!1,!1);return b.colorAttachment.set(m),b}function ls(h,e){return e.colorRampTexture||(e.colorRampTexture=new st(h,e.colorRamp,h.gl.RGBA)),e.colorRampTexture}function vn(h,e,n,a,o){if(!n||!a||!a.imageAtlas)return;const c=a.imageAtlas.patternPositions;let m=c[n.to.toString()],g=c[n.from.toString()];if(!m&&g&&(m=g),!g&&m&&(g=m),!m||!g){const y=o.getPaintProperty(e);m=c[y],g=c[y]}m&&g&&h.setConstantPatternPositions(m,g)}function cs(h,e,n,a,o,c,m){const g=h.context.gl,y="fill-pattern",b=n.paint.get(y),T=b&&b.constantOr(1),S=n.getCrossfadeParameters();let C,E,R,V,U;m?(E=T&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",C=g.LINES):(E=T?"fillPattern":"fill",C=g.TRIANGLES);const $=b.constantOr(null);for(const Z of a){const B=e.getTile(Z);if(T&&!B.patternsLoaded())continue;const X=B.getBucket(n);if(!X)continue;const K=X.programConfigurations.get(n.id),ee=h.useProgram(E,K),oe=h.style.map.terrain&&h.style.map.terrain.getTerrainData(Z);T&&(h.context.activeTexture.set(g.TEXTURE0),B.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),K.updatePaintBuffers(S)),vn(K,y,$,B,n);const he=oe?Z:null,xe=h.translatePosMatrix(he?he.posMatrix:Z.posMatrix,B,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(m){V=X.indexBuffer2,U=X.segments2;const Te=[g.drawingBufferWidth,g.drawingBufferHeight];R=E==="fillOutlinePattern"&&T?Bo(xe,h,S,B,Te):Nl(xe,Te)}else V=X.indexBuffer,U=X.segments,R=T?Ro(xe,h,S,B):_n(xe);ee.draw(h.context,C,o,h.stencilModeForClipping(Z),c,at.disabled,R,oe,n.id,X.layoutVertexBuffer,V,U,n.paint,h.transform.zoom,K)}}function Us(h,e,n,a,o,c,m){const g=h.context,y=g.gl,b="fill-extrusion-pattern",T=n.paint.get(b),S=T.constantOr(1),C=n.getCrossfadeParameters(),E=n.paint.get("fill-extrusion-opacity"),R=T.constantOr(null);for(const V of a){const U=e.getTile(V),$=U.getBucket(n);if(!$)continue;const Z=h.style.map.terrain&&h.style.map.terrain.getTerrainData(V),B=$.programConfigurations.get(n.id),X=h.useProgram(S?"fillExtrusionPattern":"fillExtrusion",B);S&&(h.context.activeTexture.set(y.TEXTURE0),U.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),B.updatePaintBuffers(C)),vn(B,b,R,U,n);const K=h.translatePosMatrix(V.posMatrix,U,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),ee=n.paint.get("fill-extrusion-vertical-gradient"),oe=S?Es(K,h,ee,E,V,C,U):ts(K,h,ee,E);X.draw(g,g.gl.TRIANGLES,o,c,m,at.backCCW,oe,Z,n.id,$.layoutVertexBuffer,$.indexBuffer,$.segments,n.paint,h.transform.zoom,B,h.style.map.terrain&&$.centroidVertexBuffer)}}function bn(h,e,n,a,o,c,m){const g=h.context,y=g.gl,b=n.fbo;if(!b)return;const T=h.useProgram("hillshade"),S=h.style.map.terrain&&h.style.map.terrain.getTerrainData(e);g.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,b.colorAttachment.get()),T.draw(g,y.TRIANGLES,o,c,m,at.disabled,((C,E,R,V)=>{const U=R.paint.get("hillshade-shadow-color"),$=R.paint.get("hillshade-highlight-color"),Z=R.paint.get("hillshade-accent-color");let B=R.paint.get("hillshade-illumination-direction")*(Math.PI/180);R.paint.get("hillshade-illumination-anchor")==="viewport"&&(B-=C.transform.angle);const X=!C.options.moving;return{u_matrix:V?V.posMatrix:C.transform.calculatePosMatrix(E.tileID.toUnwrapped(),X),u_image:0,u_latrange:Ls(0,E.tileID),u_light:[R.paint.get("hillshade-exaggeration"),B],u_shadow:U,u_highlight:$,u_accent:Z}})(h,n,a,S?e:null),S,a.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments)}function wn(h,e,n,a,o,c){const m=h.context,g=m.gl,y=e.dem;if(y&&y.data){const b=y.dim,T=y.stride,S=y.getPixels();if(m.activeTexture.set(g.TEXTURE1),m.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||h.getTileTexture(T),e.demTexture){const E=e.demTexture;E.update(S,{premultiply:!1}),E.bind(g.NEAREST,g.CLAMP_TO_EDGE)}else e.demTexture=new st(m,S,g.RGBA,{premultiply:!1}),e.demTexture.bind(g.NEAREST,g.CLAMP_TO_EDGE);m.activeTexture.set(g.TEXTURE0);let C=e.fbo;if(!C){const E=new st(m,{width:b,height:b,data:null},g.RGBA);E.bind(g.LINEAR,g.CLAMP_TO_EDGE),C=e.fbo=m.createFramebuffer(b,b,!0,!1),C.colorAttachment.set(E.texture)}m.bindFramebuffer.set(C.framebuffer),m.viewport.set([0,0,b,b]),h.useProgram("hillshadePrepare").draw(m,g.TRIANGLES,a,o,c,at.disabled,((E,R)=>{const V=R.stride,U=p.H();return p.aP(U,0,p.X,-p.X,0,0,1),p.J(U,U,[0,-p.X,0]),{u_matrix:U,u_image:1,u_dimension:[V,V],u_zoom:E.overscaledZ,u_unpack:R.getUnpackVector()}})(e.tileID,y),null,n.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments),e.needsHillshadePrepare=!1}}function Qo(h,e,n,a,o,c){const m=a.paint.get("raster-fade-duration");if(!c&&m>0){const g=me.now(),y=(g-h.timeAdded)/m,b=e?(g-e.timeAdded)/m:-1,T=n.getSource(),S=o.coveringZoomLevel({tileSize:T.tileSize,roundZoom:T.roundZoom}),C=!e||Math.abs(e.tileID.overscaledZ-S)>Math.abs(h.tileID.overscaledZ-S),E=C&&h.refreshedUponExpiration?1:p.ac(C?y:1-b,0,1);return h.refreshedUponExpiration&&y>=1&&(h.refreshedUponExpiration=!1),e?{opacity:1,mix:1-E}:{opacity:E,mix:0}}return{opacity:1,mix:0}}const Ha=new p.aM(1,0,0,1),Ye=new p.aM(0,1,0,1),$s=new p.aM(0,0,1,1),tc=new p.aM(1,0,1,1),el=new p.aM(0,1,1,1);function Tn(h,e,n,a){qs(h,0,e+n/2,h.transform.width,n,a)}function tl(h,e,n,a){qs(h,e-n/2,0,n,h.transform.height,a)}function qs(h,e,n,a,o,c){const m=h.context,g=m.gl;g.enable(g.SCISSOR_TEST),g.scissor(e*h.pixelRatio,n*h.pixelRatio,a*h.pixelRatio,o*h.pixelRatio),m.clear({color:c}),g.disable(g.SCISSOR_TEST)}function il(h,e,n){const a=h.context,o=a.gl,c=n.posMatrix,m=h.useProgram("debug"),g=Ze.disabled,y=ht.disabled,b=h.colorModeForRenderPass(),T="$debug",S=h.style.map.terrain&&h.style.map.terrain.getTerrainData(n);a.activeTexture.set(o.TEXTURE0);const C=e.getTileByID(n.key).latestRawTileData,E=Math.floor((C&&C.byteLength||0)/1024),R=e.getTile(n).tileSize,V=512/Math.min(R,512)*(n.overscaledZ/h.transform.zoom)*.5;let U=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(U+=` => ${n.overscaledZ}`),function($,Z){$.initDebugOverlayCanvas();const B=$.debugOverlayCanvas,X=$.context.gl,K=$.debugOverlayCanvas.getContext("2d");K.clearRect(0,0,B.width,B.height),K.shadowColor="white",K.shadowBlur=2,K.lineWidth=1.5,K.strokeStyle="white",K.textBaseline="top",K.font="bold 36px Open Sans, sans-serif",K.fillText(Z,5,5),K.strokeText(Z,5,5),$.debugOverlayTexture.update(B),$.debugOverlayTexture.bind(X.LINEAR,X.CLAMP_TO_EDGE)}(h,`${U} ${E}kB`),m.draw(a,o.TRIANGLES,g,y,bt.alphaBlended,at.disabled,is(c,p.aM.transparent,V),null,T,h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments),m.draw(a,o.LINE_STRIP,g,y,b,at.disabled,is(c,p.aM.red),S,T,h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments)}function rl(h,e,n){const a=h.context,o=a.gl,c=h.colorModeForRenderPass(),m=new Ze(o.LEQUAL,Ze.ReadWrite,h.depthRangeFor3D),g=h.useProgram("terrain"),y=e.getTerrainMesh();a.bindFramebuffer.set(null),a.viewport.set([0,0,h.width,h.height]);for(const b of n){const T=h.renderToTexture.getTexture(b),S=e.getTerrainData(b.tileID);a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,T.texture);const C=h.transform.calculatePosMatrix(b.tileID.toUnwrapped()),E=e.getMeshFrameDelta(h.transform.zoom),R=h.transform.calculateFogMatrix(b.tileID.toUnwrapped()),V=ka(C,E,R,h.style.sky,h.transform.pitch);g.draw(a,o.TRIANGLES,m,ht.disabled,c,at.backCCW,V,S,"terrain",y.vertexBuffer,y.indexBuffer,y.segments)}}class Zs{constructor(e,n,a){this.vertexBuffer=e,this.indexBuffer=n,this.segments=a}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Gs{constructor(e,n){this.context=new ec(e),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:p.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Be.maxUnderzooming+Be.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ma}resize(e,n,a){if(this.width=Math.floor(e*a),this.height=Math.floor(n*a),this.pixelRatio=a,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const o of this.style._order)this.style._layers[o].resize()}setup(){const e=this.context,n=new p.aX;n.emplaceBack(0,0),n.emplaceBack(p.X,0),n.emplaceBack(0,p.X),n.emplaceBack(p.X,p.X),this.tileExtentBuffer=e.createVertexBuffer(n,Zr.members),this.tileExtentSegments=p.a0.simpleSegment(0,0,4,2);const a=new p.aX;a.emplaceBack(0,0),a.emplaceBack(p.X,0),a.emplaceBack(0,p.X),a.emplaceBack(p.X,p.X),this.debugBuffer=e.createVertexBuffer(a,Zr.members),this.debugSegments=p.a0.simpleSegment(0,0,4,5);const o=new p.$;o.emplaceBack(0,0,0,0),o.emplaceBack(p.X,0,p.X,0),o.emplaceBack(0,p.X,0,p.X),o.emplaceBack(p.X,p.X,p.X,p.X),this.rasterBoundsBuffer=e.createVertexBuffer(o,Pr.members),this.rasterBoundsSegments=p.a0.simpleSegment(0,0,4,2);const c=new p.aX;c.emplaceBack(0,0),c.emplaceBack(1,0),c.emplaceBack(0,1),c.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(c,Zr.members),this.viewportSegments=p.a0.simpleSegment(0,0,4,2);const m=new p.aZ;m.emplaceBack(0),m.emplaceBack(1),m.emplaceBack(3),m.emplaceBack(2),m.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(m);const g=new p.aY;g.emplaceBack(0,1,2),g.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(g);const y=this.context.gl;this.stencilClearMode=new ht({func:y.ALWAYS,mask:0},0,255,y.ZERO,y.ZERO,y.ZERO)}clearStencil(){const e=this.context,n=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const a=p.H();p.aP(a,0,this.width,this.height,0,0,1),p.K(a,a,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,n.TRIANGLES,Ze.disabled,this.stencilClearMode,bt.disabled,at.disabled,ii(a),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,n){if(this.currentStencilSource===e.source||!e.isTileClipped()||!n||!n.length)return;this.currentStencilSource=e.source;const a=this.context,o=a.gl;this.nextStencilID+n.length>256&&this.clearStencil(),a.setColorMode(bt.disabled),a.setDepthMode(Ze.disabled);const c=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const m of n){const g=this._tileClippingMaskIDs[m.key]=this.nextStencilID++,y=this.style.map.terrain&&this.style.map.terrain.getTerrainData(m);c.draw(a,o.TRIANGLES,Ze.disabled,new ht({func:o.ALWAYS,mask:0},g,255,o.KEEP,o.KEEP,o.REPLACE),bt.disabled,at.disabled,ii(m.posMatrix),y,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,n=this.context.gl;return new ht({func:n.NOTEQUAL,mask:255},e,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(e){const n=this.context.gl;return new ht({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(e){const n=this.context.gl,a=e.sort((m,g)=>g.overscaledZ-m.overscaledZ),o=a[a.length-1].overscaledZ,c=a[0].overscaledZ-o+1;if(c>1){this.currentStencilSource=void 0,this.nextStencilID+c>256&&this.clearStencil();const m={};for(let g=0;g({u_sky_color:$.properties.get("sky-color"),u_horizon_color:$.properties.get("horizon-color"),u_horizon:(Z.height/2+Z.getHorizon())*B,u_sky_horizon_blend:$.properties.get("sky-horizon-blend")*Z.height/2*B}))(b,y.style.map.transform,y.pixelRatio),E=new Ze(S.LEQUAL,Ze.ReadWrite,[0,1]),R=ht.disabled,V=y.colorModeForRenderPass(),U=y.useProgram("sky");if(!b.mesh){const $=new p.aX;$.emplaceBack(-1,-1),$.emplaceBack(1,-1),$.emplaceBack(1,1),$.emplaceBack(-1,1);const Z=new p.aY;Z.emplaceBack(0,1,2),Z.emplaceBack(0,2,3),b.mesh=new Zs(T.createVertexBuffer($,Zr.members),T.createIndexBuffer(Z),p.a0.simpleSegment(0,0,$.length,Z.length))}U.draw(T,S.TRIANGLES,E,R,V,at.disabled,C,void 0,"sky",b.mesh.vertexBuffer,b.mesh.indexBuffer,b.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=a.length-1;this.currentLayer>=0;this.currentLayer--){const y=this.style._layers[a[this.currentLayer]],b=o[y.source],T=c[y.source];this._renderTileClippingMasks(y,T),this.renderLayer(this,b,y,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerU.source&&!U.isHidden(T)?[b.sourceCaches[U.source]]:[]),E=C.filter(U=>U.getSource().type==="vector"),R=C.filter(U=>U.getSource().type!=="vector"),V=U=>{(!S||S.getSource().maxzoomV(U)),S||R.forEach(U=>V(U)),S}(this.style,this.transform.zoom);y&&function(b,T,S){for(let C=0;C0),o&&(p.b0(n,a),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(c,m){const g=c.context,y=g.gl,b=bt.unblended,T=new Ze(y.LEQUAL,Ze.ReadWrite,[0,1]),S=m.getTerrainMesh(),C=m.sourceCache.getRenderableTiles(),E=c.useProgram("terrainDepth");g.bindFramebuffer.set(m.getFramebuffer("depth").framebuffer),g.viewport.set([0,0,c.width/devicePixelRatio,c.height/devicePixelRatio]),g.clear({color:p.aM.transparent,depth:1});for(const R of C){const V=m.getTerrainData(R.tileID),U={u_matrix:c.transform.calculatePosMatrix(R.tileID.toUnwrapped()),u_ele_delta:m.getMeshFrameDelta(c.transform.zoom)};E.draw(g,y.TRIANGLES,T,ht.disabled,b,at.backCCW,U,V,"terrain",S.vertexBuffer,S.indexBuffer,S.segments)}g.bindFramebuffer.set(null),g.viewport.set([0,0,c.width,c.height])}(this,this.style.map.terrain),function(c,m){const g=c.context,y=g.gl,b=bt.unblended,T=new Ze(y.LEQUAL,Ze.ReadWrite,[0,1]),S=m.getTerrainMesh(),C=m.getCoordsTexture(),E=m.sourceCache.getRenderableTiles(),R=c.useProgram("terrainCoords");g.bindFramebuffer.set(m.getFramebuffer("coords").framebuffer),g.viewport.set([0,0,c.width/devicePixelRatio,c.height/devicePixelRatio]),g.clear({color:p.aM.transparent,depth:1}),m.coordsIndex=[];for(const V of E){const U=m.getTerrainData(V.tileID);g.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,C.texture);const $={u_matrix:c.transform.calculatePosMatrix(V.tileID.toUnwrapped()),u_terrain_coords_id:(255-m.coordsIndex.length)/255,u_texture:0,u_ele_delta:m.getMeshFrameDelta(c.transform.zoom)};R.draw(g,y.TRIANGLES,T,ht.disabled,b,at.backCCW,$,U,"terrain",S.vertexBuffer,S.indexBuffer,S.segments),m.coordsIndex.push(V.tileID.key)}g.bindFramebuffer.set(null),g.viewport.set([0,0,c.width,c.height])}(this,this.style.map.terrain))}renderLayer(e,n,a,o){if(!a.isHidden(this.transform.zoom)&&(a.type==="background"||a.type==="custom"||(o||[]).length))switch(this.id=a.id,a.type){case"symbol":(function(c,m,g,y,b){if(c.renderPass!=="translucent")return;const T=ht.disabled,S=c.colorModeForRenderPass();(g._unevaluatedLayout.hasValue("text-variable-anchor")||g._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(C,E,R,V,U,$,Z,B,X){const K=E.transform,ee=qr(),oe=U==="map",he=$==="map";for(const xe of C){const Te=V.getTile(xe),fe=Te.getBucket(R);if(!fe||!fe.text||!fe.text.segments.get().length)continue;const pe=p.ag(fe.textSizeData,K.zoom),Me=Ge(Te,1,E.transform.zoom),Ve=Mr(xe.posMatrix,he,oe,E.transform,Me),ge=R.layout.get("icon-text-fit")!=="none"&&fe.hasIconData();if(pe){const be=Math.pow(2,K.zoom-Te.tileID.overscaledZ),Fe=E.style.map.terrain?(Ue,He)=>E.style.map.terrain.getElevation(xe,Ue,He):null,pt=ee.translatePosition(K,Te,Z,B);xn(fe,oe,he,X,K,Ve,xe.posMatrix,be,pe,ge,ee,pt,xe.toUnwrapped(),Fe)}}}(y,c,g,m,g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),b),g.paint.get("icon-opacity").constantOr(1)!==0&&qa(c,m,g,y,!1,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),g.layout.get("icon-rotation-alignment"),g.layout.get("icon-pitch-alignment"),g.layout.get("icon-keep-upright"),T,S),g.paint.get("text-opacity").constantOr(1)!==0&&qa(c,m,g,y,!0,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),g.layout.get("text-keep-upright"),T,S),m.map.showCollisionBoxes&&(ss(c,m,g,y,!0),ss(c,m,g,y,!1))})(e,n,a,o,this.style.placement.variableOffsets);break;case"circle":(function(c,m,g,y){if(c.renderPass!=="translucent")return;const b=g.paint.get("circle-opacity"),T=g.paint.get("circle-stroke-width"),S=g.paint.get("circle-stroke-opacity"),C=!g.layout.get("circle-sort-key").isConstant();if(b.constantOr(1)===0&&(T.constantOr(1)===0||S.constantOr(1)===0))return;const E=c.context,R=E.gl,V=c.depthModeForSublayer(0,Ze.ReadOnly),U=ht.disabled,$=c.colorModeForRenderPass(),Z=[];for(let B=0;BB.sortKey-X.sortKey);for(const B of Z){const{programConfiguration:X,program:K,layoutVertexBuffer:ee,indexBuffer:oe,uniformValues:he,terrainData:xe}=B.state;K.draw(E,R.TRIANGLES,V,U,$,at.disabled,he,xe,g.id,ee,oe,B.segments,g.paint,c.transform.zoom,X)}})(e,n,a,o);break;case"heatmap":(function(c,m,g,y){if(g.paint.get("heatmap-opacity")===0)return;const b=c.context;if(c.style.map.terrain){for(const T of y){const S=m.getTile(T);m.hasRenderableParent(T)||(c.renderPass==="offscreen"?Ga(c,S,g,T):c.renderPass==="translucent"&&Yr(c,g,T))}b.viewport.set([0,0,c.width,c.height])}else c.renderPass==="offscreen"?function(T,S,C,E){const R=T.context,V=R.gl,U=ht.disabled,$=new bt([V.ONE,V.ONE],p.aM.transparent,[!0,!0,!0,!0]);(function(Z,B,X){const K=Z.gl;Z.activeTexture.set(K.TEXTURE1),Z.viewport.set([0,0,B.width/4,B.height/4]);let ee=X.heatmapFbos.get(p.aU);ee?(K.bindTexture(K.TEXTURE_2D,ee.colorAttachment.get()),Z.bindFramebuffer.set(ee.framebuffer)):(ee=os(Z,B.width/4,B.height/4),X.heatmapFbos.set(p.aU,ee))})(R,T,C),R.clear({color:p.aM.transparent});for(let Z=0;Z20&&T.texParameterf(T.TEXTURE_2D,b.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,b.extTextureFilterAnisotropicMax);const fe=c.style.map.terrain&&c.style.map.terrain.getTerrainData(Z),pe=fe?Z:null,Me=pe?pe.posMatrix:c.transform.calculatePosMatrix(Z.toUnwrapped(),$),Ve=$l(Me,xe||[0,0],he||1,oe,g);S instanceof fr?C.draw(b,T.TRIANGLES,B,ht.disabled,E,at.disabled,Ve,fe,g.id,S.boundsBuffer,c.quadTriangleIndexBuffer,S.boundsSegments):C.draw(b,T.TRIANGLES,B,R[Z.overscaledZ],E,at.disabled,Ve,fe,g.id,c.rasterBoundsBuffer,c.quadTriangleIndexBuffer,c.rasterBoundsSegments)}})(e,n,a,o);break;case"background":(function(c,m,g,y){const b=g.paint.get("background-color"),T=g.paint.get("background-opacity");if(T===0)return;const S=c.context,C=S.gl,E=c.transform,R=E.tileSize,V=g.paint.get("background-pattern");if(c.isPatternMissing(V))return;const U=!V&&b.a===1&&T===1&&c.opaquePassEnabledForLayer()?"opaque":"translucent";if(c.renderPass!==U)return;const $=ht.disabled,Z=c.depthModeForSublayer(0,U==="opaque"?Ze.ReadWrite:Ze.ReadOnly),B=c.colorModeForRenderPass(),X=c.useProgram(V?"backgroundPattern":"background"),K=y||E.coveringTiles({tileSize:R,terrain:c.style.map.terrain});V&&(S.activeTexture.set(C.TEXTURE0),c.imageManager.bind(c.context));const ee=g.getCrossfadeParameters();for(const oe of K){const he=y?oe.posMatrix:c.transform.calculatePosMatrix(oe.toUnwrapped()),xe=V?Da(he,T,c,V,{tileID:oe,tileSize:R},ee):Bs(he,T,b),Te=c.style.map.terrain&&c.style.map.terrain.getTerrainData(oe);X.draw(S,C.TRIANGLES,Z,$,B,at.disabled,xe,Te,g.id,c.tileExtentBuffer,c.quadTriangleIndexBuffer,c.tileExtentSegments)}})(e,0,a,o);break;case"custom":(function(c,m,g){const y=c.context,b=g.implementation;if(c.renderPass==="offscreen"){const T=b.prerender;T&&(c.setCustomLayerDefaults(),y.setColorMode(c.colorModeForRenderPass()),T.call(b,y.gl,c.transform.customLayerMatrix()),y.setDirty(),c.setBaseState())}else if(c.renderPass==="translucent"){c.setCustomLayerDefaults(),y.setColorMode(c.colorModeForRenderPass()),y.setStencilMode(ht.disabled);const T=b.renderingMode==="3d"?new Ze(c.context.gl.LEQUAL,Ze.ReadWrite,c.depthRangeFor3D):c.depthModeForSublayer(0,Ze.ReadOnly);y.setDepthMode(T),b.render(y.gl,c.transform.customLayerMatrix(),{farZ:c.transform.farZ,nearZ:c.transform.nearZ,fov:c.transform._fov,modelViewProjectionMatrix:c.transform.modelViewProjectionMatrix,projectionMatrix:c.transform.projectionMatrix}),y.setDirty(),c.setBaseState(),y.bindFramebuffer.set(null)}})(e,0,a)}}translatePosMatrix(e,n,a,o,c){if(!a[0]&&!a[1])return e;const m=c?o==="map"?this.transform.angle:0:o==="viewport"?-this.transform.angle:0;if(m){const b=Math.sin(m),T=Math.cos(m);a=[a[0]*T-a[1]*b,a[0]*b+a[1]*T]}const g=[c?a[0]:Ge(n,a[0],this.transform.zoom),c?a[1]:Ge(n,a[1],this.transform.zoom),0],y=new Float32Array(16);return p.J(y,e,g),y}saveTileTexture(e){const n=this._tileTextures[e.size[0]];n?n.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const n=this._tileTextures[e];return n&&n.length>0?n.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const n=this.imageManager.getPattern(e.from.toString()),a=this.imageManager.getPattern(e.to.toString());return!n||!a}useProgram(e,n){this.cache=this.cache||{};const a=e+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[a]||(this.cache[a]=new za(this.context,Cr[e],n,La[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[a]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new st(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:n}=this.context.gl;return this.width!==e||this.height!==n}}class Sn{constructor(e,n){this.points=e,this.planes=n}static fromInvProjectionMatrix(e,n,a){const o=Math.pow(2,a),c=[[-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(g=>{const y=1/(g=p.af([],g,e))[3]/n*o;return p.b1(g,g,[y,y,1/g[3],y])}),m=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(g=>{const y=function(C,E){var R=E[0],V=E[1],U=E[2],$=R*R+V*V+U*U;return $>0&&($=1/Math.sqrt($)),C[0]=E[0]*$,C[1]=E[1]*$,C[2]=E[2]*$,C}([],function(C,E,R){var V=E[0],U=E[1],$=E[2],Z=R[0],B=R[1],X=R[2];return C[0]=U*X-$*B,C[1]=$*Z-V*X,C[2]=V*B-U*Z,C}([],vi([],c[g[0]],c[g[1]]),vi([],c[g[2]],c[g[1]]))),b=-((T=y)[0]*(S=c[g[1]])[0]+T[1]*S[1]+T[2]*S[2]);var T,S;return y.concat(b)});return new Sn(c,m)}}class In{constructor(e,n){this.min=e,this.max=n,this.center=function(a,o,c){return a[0]=.5*o[0],a[1]=.5*o[1],a[2]=.5*o[2],a}([],function(a,o,c){return a[0]=o[0]+c[0],a[1]=o[1]+c[1],a[2]=o[2]+c[2],a}([],this.min,this.max))}quadrant(e){const n=[e%2==0,e<2],a=Ei(this.min),o=Ei(this.max);for(let c=0;c=0&&m++;if(m===0)return 0;m!==n.length&&(a=!1)}if(a)return 2;for(let o=0;o<3;o++){let c=Number.MAX_VALUE,m=-Number.MAX_VALUE;for(let g=0;gthis.max[o]-this.min[o])return 0}return 1}}class Pn{constructor(e=0,n=0,a=0,o=0){if(isNaN(e)||e<0||isNaN(n)||n<0||isNaN(a)||a<0||isNaN(o)||o<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=n,this.left=a,this.right=o}interpolate(e,n,a){return n.top!=null&&e.top!=null&&(this.top=p.y.number(e.top,n.top,a)),n.bottom!=null&&e.bottom!=null&&(this.bottom=p.y.number(e.bottom,n.bottom,a)),n.left!=null&&e.left!=null&&(this.left=p.y.number(e.left,n.left,a)),n.right!=null&&e.right!=null&&(this.right=p.y.number(e.right,n.right,a)),this}getCenter(e,n){const a=p.ac((this.left+e-this.right)/2,0,e),o=p.ac((this.top+n-this.bottom)/2,0,n);return new p.P(a,o)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Pn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Xa=85.051129;class An{constructor(e,n,a,o,c){this.tileSize=512,this._renderWorldCopies=c===void 0||!!c,this._minZoom=e||0,this._maxZoom=n||22,this._minPitch=a??0,this._maxPitch=o??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new p.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Pn,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const e=new An(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.lngRange=e.lngRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.minElevationForCurrentTile=e.minElevationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new p.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const n=-p.b3(e,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=function(){var a=new p.A(4);return p.A!=Float32Array&&(a[1]=0,a[2]=0),a[0]=1,a[3]=1,a}(),function(a,o,c){var m=o[0],g=o[1],y=o[2],b=o[3],T=Math.sin(c),S=Math.cos(c);a[0]=m*S+y*T,a[1]=g*S+b*T,a[2]=m*-T+y*S,a[3]=g*-T+b*S}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const n=p.ac(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){const n=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,n,a){this._unmodified=!1,this._edgeInsets.interpolate(e,n,a),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const n=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(e){const n=[new p.b4(0,e)];if(this._renderWorldCopies){const a=this.pointCoordinate(new p.P(0,0)),o=this.pointCoordinate(new p.P(this.width,0)),c=this.pointCoordinate(new p.P(this.width,this.height)),m=this.pointCoordinate(new p.P(0,this.height)),g=Math.floor(Math.min(a.x,o.x,c.x,m.x)),y=Math.floor(Math.max(a.x,o.x,c.x,m.x)),b=1;for(let T=g-b;T<=y+b;T++)T!==0&&n.push(new p.b4(T,e))}return n}coveringTiles(e){var n,a;let o=this.coveringZoomLevel(e);const c=o;if(e.minzoom!==void 0&&oe.maxzoom&&(o=e.maxzoom);const m=this.pointCoordinate(this.getCameraPoint()),g=p.Z.fromLngLat(this.center),y=Math.pow(2,o),b=[y*m.x,y*m.y,0],T=[y*g.x,y*g.y,0],S=Sn.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,o);let C=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(C=o);const E=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,R=B=>({aabb:new In([B*y,0,0],[(B+1)*y,y,0]),zoom:0,x:0,y:0,wrap:B,fullyVisible:!1}),V=[],U=[],$=o,Z=e.reparseOverscaled?c:o;if(this._renderWorldCopies)for(let B=1;B<=3;B++)V.push(R(-B)),V.push(R(B));for(V.push(R(0));V.length>0;){const B=V.pop(),X=B.x,K=B.y;let ee=B.fullyVisible;if(!ee){const fe=B.aabb.intersects(S);if(fe===0)continue;ee=fe===2}const oe=e.terrain?b:T,he=B.aabb.distanceX(oe),xe=B.aabb.distanceY(oe),Te=Math.max(Math.abs(he),Math.abs(xe));if(B.zoom===$||Te>E+(1<<$-B.zoom)-2&&B.zoom>=C){const fe=$-B.zoom,pe=b[0]-.5-(X<>1),Ve=B.zoom+1;let ge=B.aabb.quadrant(fe);if(e.terrain){const be=new p.S(Ve,B.wrap,Ve,pe,Me),Fe=e.terrain.getMinMaxElevation(be),pt=(n=Fe.minElevation)!==null&&n!==void 0?n:this.elevation,Ue=(a=Fe.maxElevation)!==null&&a!==void 0?a:this.elevation;ge=new In([ge.min[0],ge.min[1],pt],[ge.max[0],ge.max[1],Ue])}V.push({aabb:ge,zoom:Ve,x:pe,y:Me,wrap:B.wrap,fullyVisible:ee})}}return U.sort((B,X)=>B.distanceSq-X.distanceSq).map(B=>B.tileID)}resize(e,n){this.width=e,this.height=n,this.pixelsToGLUnits=[2/e,-2/n],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){const n=p.ac(e.lat,-85.051129,Xa);return new p.P(p.O(e.lng)*this.worldSize,p.Q(n)*this.worldSize)}unproject(e){return new p.Z(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(e){const n=this.elevation,a=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,o=this.pointLocation(this.centerPoint,e),c=e.getElevationForLngLatZoom(o,this.tileZoom);if(!(this.elevation-c))return;const m=a+n-c,g=Math.cos(this._pitch)*this.cameraToCenterDistance/m/p.b5(1,o.lat),y=this.scaleZoom(g/this.tileSize);this._elevation=c,this._center=o,this.zoom=y}setLocationAtPoint(e,n){const a=this.pointCoordinate(n),o=this.pointCoordinate(this.centerPoint),c=this.locationCoordinate(e),m=new p.Z(c.x-(a.x-o.x),c.y-(a.y-o.y));this.center=this.coordinateLocation(m),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,n){return n?this.coordinatePoint(this.locationCoordinate(e),n.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,n){return this.coordinateLocation(this.pointCoordinate(e,n))}locationCoordinate(e){return p.Z.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,n){if(n){const C=n.pointCoordinate(e);if(C!=null)return C}const a=[e.x,e.y,0,1],o=[e.x,e.y,1,1];p.af(a,a,this.pixelMatrixInverse),p.af(o,o,this.pixelMatrixInverse);const c=a[3],m=o[3],g=a[1]/c,y=o[1]/m,b=a[2]/c,T=o[2]/m,S=b===T?0:(0-b)/(T-b);return new p.Z(p.y.number(a[0]/c,o[0]/m,S)/this.worldSize,p.y.number(g,y,S)/this.worldSize)}coordinatePoint(e,n=0,a=this.pixelMatrix){const o=[e.x*this.worldSize,e.y*this.worldSize,n,1];return p.af(o,o,a),new p.P(o[0]/o[3],o[1]/o[3])}getBounds(){const e=Math.max(0,this.height/2-this.getHorizon());return new ie().extend(this.pointLocation(new p.P(0,e))).extend(this.pointLocation(new p.P(this.width,e))).extend(this.pointLocation(new p.P(this.width,this.height))).extend(this.pointLocation(new p.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new ie([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Xa])}calculateTileMatrix(e){const n=e.canonical,a=this.worldSize/this.zoomScale(n.z),o=n.x+Math.pow(2,n.z)*e.wrap,c=p.an(new Float64Array(16));return p.J(c,c,[o*a,n.y*a,0]),p.K(c,c,[a/p.X,a/p.X,1]),c}calculatePosMatrix(e,n=!1){const a=e.key,o=n?this._alignedPosMatrixCache:this._posMatrixCache;if(o[a])return o[a];const c=this.calculateTileMatrix(e);return p.L(c,n?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,c),o[a]=new Float32Array(c),o[a]}calculateFogMatrix(e){const n=e.key,a=this._fogMatrixCache;if(a[n])return a[n];const o=this.calculateTileMatrix(e);return p.L(o,this.fogMatrix,o),a[n]=new Float32Array(o),a[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,n){n=p.ac(+n,this.minZoom,this.maxZoom);const a={center:new p.N(e.lng,e.lat),zoom:n};let o=this.lngRange;if(!this._renderWorldCopies&&o===null){const B=179.9999999999;o=[-B,B]}const c=this.tileSize*this.zoomScale(a.zoom);let m=0,g=c,y=0,b=c,T=0,S=0;const{x:C,y:E}=this.size;if(this.latRange){const B=this.latRange;m=p.Q(B[1])*c,g=p.Q(B[0])*c,g-mg&&($=g-B)}if(o){const B=(y+b)/2;let X=R;this._renderWorldCopies&&(X=p.b3(R,B-c/2,B+c/2));const K=C/2;X-Kb&&(U=b-K)}if(U!==void 0||$!==void 0){const B=new p.P(U??R,$??V);a.center=this.unproject.call({worldSize:c},B).wrap()}return a}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const e=this._unmodified,{center:n,zoom:a}=this.getConstrained(this.center,this.zoom);this.center=n,this.zoom=a,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;const e=this.centerOffset,n=this.point.x,a=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=p.b5(1,this.center.lat)*this.worldSize;let o=p.an(new Float64Array(16));p.K(o,o,[this.width/2,-this.height/2,1]),p.J(o,o,[1,-1,0]),this.labelPlaneMatrix=o,o=p.an(new Float64Array(16)),p.K(o,o,[1,-1,1]),p.J(o,o,[-1,-1,0]),p.K(o,o,[2/this.width,2/this.height,1]),this.glCoordMatrix=o;const c=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),m=Math.min(this.elevation,this.minElevationForCurrentTile),g=c-m*this._pixelPerMeter/Math.cos(this._pitch),y=m<0?g:c,b=Math.PI/2+this._pitch,T=this._fov*(.5+e.y/this.height),S=Math.sin(T)*y/Math.sin(p.ac(Math.PI-b-T,.01,Math.PI-.01)),C=this.getHorizon(),E=2*Math.atan(C/this.cameraToCenterDistance)*(.5+e.y/(2*C)),R=Math.sin(E)*y/Math.sin(p.ac(Math.PI-b-E,.01,Math.PI-.01)),V=Math.min(S,R);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*V+y),this.nearZ=this.height/50,o=new Float64Array(16),p.b6(o,this._fov,this.width/this.height,this.nearZ,this.farZ),o[8]=2*-e.x/this.width,o[9]=2*e.y/this.height,this.projectionMatrix=p.ae(o),p.K(o,o,[1,-1,1]),p.J(o,o,[0,0,-this.cameraToCenterDistance]),p.b7(o,o,this._pitch),p.ad(o,o,this.angle),p.J(o,o,[-n,-a,0]),this.mercatorMatrix=p.K([],o,[this.worldSize,this.worldSize,this.worldSize]),p.K(o,o,[1,1,this._pixelPerMeter]),this.pixelMatrix=p.L(new Float64Array(16),this.labelPlaneMatrix,o),p.J(o,o,[0,0,-this.elevation]),this.modelViewProjectionMatrix=o,this.invModelViewProjectionMatrix=p.as([],o),this.fogMatrix=new Float64Array(16),p.b6(this.fogMatrix,this._fov,this.width/this.height,c,this.farZ),this.fogMatrix[8]=2*-e.x/this.width,this.fogMatrix[9]=2*e.y/this.height,p.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),p.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),p.b7(this.fogMatrix,this.fogMatrix,this._pitch),p.ad(this.fogMatrix,this.fogMatrix,this.angle),p.J(this.fogMatrix,this.fogMatrix,[-n,-a,0]),p.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),p.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=p.L(new Float64Array(16),this.labelPlaneMatrix,o);const U=this.width%2/2,$=this.height%2/2,Z=Math.cos(this.angle),B=Math.sin(this.angle),X=n-Math.round(n)+Z*U+B*$,K=a-Math.round(a)+Z*$+B*U,ee=new Float64Array(o);if(p.J(ee,ee,[X>.5?X-1:X,K>.5?K-1:K,0]),this.alignedModelViewProjectionMatrix=ee,o=p.as(new Float64Array(16),this.pixelMatrix),!o)throw new Error("failed to invert matrix");this.pixelMatrixInverse=o,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const e=this.pointCoordinate(new p.P(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return p.af(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new p.P(0,e))}getCameraQueryGeometry(e){const n=this.getCameraPoint();if(e.length===1)return[e[0],n];{let a=n.x,o=n.y,c=n.x,m=n.y;for(const g of e)a=Math.min(a,g.x),o=Math.min(o,g.y),c=Math.max(c,g.x),m=Math.max(m,g.y);return[new p.P(a,o),new p.P(c,o),new p.P(c,m),new p.P(a,m),new p.P(a,o)]}}lngLatToCameraDepth(e,n){const a=this.locationCoordinate(e),o=[a.x*this.worldSize,a.y*this.worldSize,n,1];return p.af(o,o,this.modelViewProjectionMatrix),o[2]/o[3]}}function hs(h,e){let n,a=!1,o=null,c=null;const m=()=>{o=null,a&&(h.apply(c,n),o=setTimeout(m,e),a=!1)};return(...g)=>(a=!0,c=this,n=g,o||m(),o)}class Hs{constructor(e){this._getCurrentHash=()=>{const n=window.location.hash.replace("#","");if(this._hashName){let a;return n.split("&").map(o=>o.split("=")).forEach(o=>{o[0]===this._hashName&&(a=o)}),(a&&a[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{const n=this._getCurrentHash();if(n.length>=3&&!n.some(a=>isNaN(a))){const a=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:a,pitch:+(n[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const n=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,n)},this._removeHash=()=>{const n=this._getCurrentHash();if(n.length===0)return;const a=n.join("/");let o=a;o.split("&").length>0&&(o=o.split("&")[0]),this._hashName&&(o=`${this._hashName}=${a}`);let c=window.location.hash.replace(o,"");c.startsWith("#&")?c=c.slice(0,1)+c.slice(2):c==="#"&&(c="");let m=window.location.href.replace(/(#.+)?$/,c);m=m.replace("&&","&"),window.history.replaceState(window.history.state,null,m)},this._updateHash=hs(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const n=this._map.getCenter(),a=Math.round(100*this._map.getZoom())/100,o=Math.ceil((a*Math.LN2+Math.log(512/360/.5))/Math.LN10),c=Math.pow(10,o),m=Math.round(n.lng*c)/c,g=Math.round(n.lat*c)/c,y=this._map.getBearing(),b=this._map.getPitch();let T="";if(T+=e?`/${m}/${g}/${a}`:`${a}/${g}/${m}`,(y||b)&&(T+="/"+Math.round(10*y)/10),b&&(T+=`/${Math.round(b)}`),this._hashName){const S=this._hashName;let C=!1;const E=window.location.hash.slice(1).split("&").map(R=>{const V=R.split("=")[0];return V===S?(C=!0,`${V}=${T}`):R}).filter(R=>R);return C||E.push(`${S}=${T}`),`#${E.join("&")}`}return`#${T}`}}const Xs={linearity:.3,easing:p.b8(0,0,.3,1)},Wa=p.e({deceleration:2500,maxSpeed:1400},Xs),ic=p.e({deceleration:20,maxSpeed:1400},Xs),nl=p.e({deceleration:1e3,maxSpeed:360},Xs),Ws=p.e({deceleration:1e3,maxSpeed:90},Xs);class Ka{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:me.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,n=me.now();for(;e.length>0&&n-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new p.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:c}of this._inertiaBuffer)n.zoom+=c.zoomDelta||0,n.bearing+=c.bearingDelta||0,n.pitch+=c.pitchDelta||0,c.panDelta&&n.pan._add(c.panDelta),c.around&&(n.around=c.around),c.pinchAround&&(n.pinchAround=c.pinchAround);const a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,o={};if(n.pan.mag()){const c=ds(n.pan.mag(),a,p.e({},Wa,e||{}));o.offset=n.pan.mult(c.amount/n.pan.mag()),o.center=this._map.transform.center,us(o,c)}if(n.zoom){const c=ds(n.zoom,a,ic);o.zoom=this._map.transform.zoom+c.amount,us(o,c)}if(n.bearing){const c=ds(n.bearing,a,nl);o.bearing=this._map.transform.bearing+p.ac(c.amount,-179,179),us(o,c)}if(n.pitch){const c=ds(n.pitch,a,Ws);o.pitch=this._map.transform.pitch+c.amount,us(o,c)}if(o.zoom||o.bearing){const c=n.pinchAround===void 0?n.around:n.pinchAround;o.around=c?this._map.unproject(c):this._map.getCenter()}return this.clear(),p.e(o,{noMoveStart:!0})}}function us(h,e){(!h.duration||h.durationn.unproject(y)),g=c.reduce((y,b,T,S)=>y.add(b.div(S.length)),new p.P(0,0));super(e,{points:c,point:g,lngLats:m,lngLat:n.unproject(g),originalEvent:a}),this._defaultPrevented=!1}}class sl extends p.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,a){super(e,{originalEvent:a}),this._defaultPrevented=!1}}class al{constructor(e,n){this._map=e,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new sl(e.type,this._map,e))}mousedown(e,n){return this._mousedownPos=n,this._firePreventable(new Ot(e.type,this._map,e))}mouseup(e){this._map.fire(new Ot(e.type,this._map,e))}click(e,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new Ot(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Ot(e.type,this._map,e))}mouseover(e){this._map.fire(new Ot(e.type,this._map,e))}mouseout(e){this._map.fire(new Ot(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Qr(e.type,this._map,e))}touchmove(e){this._map.fire(new Qr(e.type,this._map,e))}touchend(e){this._map.fire(new Qr(e.type,this._map,e))}touchcancel(e){this._map.fire(new Qr(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class wt{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Ot(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ot("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Ot(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Vi{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.pointLocation(p.P.convert(e),this._map.terrain)}}class mi{constructor(e,n){this._map=e,this._tr=new Vi(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,n){this.isEnabled()&&e.shiftKey&&e.button===0&&(se.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(e,n){if(!this._active)return;const a=n;if(this._lastPos.equals(a)||!this._box&&a.dist(this._startPos)c.fitScreenCoordinates(a,o,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(se.remove(this._box),this._box=null),se.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,n){return this._map.fire(new p.k(e,{originalEvent:n}))}}function ps(h,e){if(h.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${h.length}, points ${e.length}`);const n={};for(let a=0;athis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),a.length===this.numTouches&&(this.centroid=function(o){const c=new p.P(0,0);for(const m of o)c._add(m);return c.div(o.length)}(n),this.touches=ps(a,n)))}touchmove(e,n,a){if(this.aborted||!this.centroid)return;const o=ps(a,n);for(const c in this.touches){const m=o[c];(!m||m.dist(this.touches[c])>30)&&(this.aborted=!0)}}touchend(e,n,a){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),a.length===0){const o=!this.aborted&&this.centroid;if(this.reset(),o)return o}}}class Ks{constructor(e){this.singleTap=new Ja(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,n,a){this.singleTap.touchstart(e,n,a)}touchmove(e,n,a){this.singleTap.touchmove(e,n,a)}touchend(e,n,a){const o=this.singleTap.touchend(e,n,a);if(o){const c=e.timeStamp-this.lastTime<500,m=!this.lastTap||this.lastTap.dist(o)<30;if(c&&m||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=o,this.count===this.numTaps)return this.reset(),o}}}class Mn{constructor(e){this._tr=new Vi(e),this._zoomIn=new Ks({numTouches:1,numTaps:2}),this._zoomOut=new Ks({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,n,a){this._zoomIn.touchstart(e,n,a),this._zoomOut.touchstart(e,n,a)}touchmove(e,n,a){this._zoomIn.touchmove(e,n,a),this._zoomOut.touchmove(e,n,a)}touchend(e,n,a){const o=this._zoomIn.touchend(e,n,a),c=this._zoomOut.touchend(e,n,a),m=this._tr;return o?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:m.zoom+1,around:m.unproject(o)},{originalEvent:e})}):c?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:m.zoom-1,around:m.unproject(c)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gr{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const n=this._moveFunction(...e);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(e,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,n){if(!this.isEnabled())return;const a=this._lastPoint;if(!a)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const o=n.length?n[0]:n;return!this._moved&&o.dist(a){h.mousedown=h.dragStart,h.mousemoveWindow=h.dragMove,h.mouseup=h.dragEnd,h.contextmenu=e=>{e.preventDefault()}},eo=({enable:h,clickTolerance:e,bearingDegreesPerPixelMoved:n=.8})=>{const a=new Js({checkCorrectEvent:o=>se.mouseButton(o)===0&&o.ctrlKey||se.mouseButton(o)===2});return new gr({clickTolerance:e,move:(o,c)=>({bearingDelta:(c.x-o.x)*n}),moveStateManager:a,enable:h,assignEvents:Ys})},to=({enable:h,clickTolerance:e,pitchDegreesPerPixelMoved:n=-.5})=>{const a=new Js({checkCorrectEvent:o=>se.mouseButton(o)===0&&o.ctrlKey||se.mouseButton(o)===2});return new gr({clickTolerance:e,move:(o,c)=>({pitchDelta:(c.y-o.y)*n}),moveStateManager:a,enable:h,assignEvents:Ys})};class en{constructor(e,n){this._clickTolerance=e.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new p.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,n,a){return this._calculateTransform(e,n,a)}touchmove(e,n,a){if(this._active){if(!this._shouldBePrevented(a.length))return e.preventDefault(),this._calculateTransform(e,n,a);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,n,a){this._calculateTransform(e,n,a),this._active&&this._shouldBePrevented(a.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,n,a){a.length>0&&(this._active=!0);const o=ps(a,n),c=new p.P(0,0),m=new p.P(0,0);let g=0;for(const b in o){const T=o[b],S=this._touches[b];S&&(c._add(T),m._add(T.sub(S)),g++,o[b]=T)}if(this._touches=o,this._shouldBePrevented(g)||!m.mag())return;const y=m.div(g);return this._sum._add(y),this._sum.mag()Math.abs(h.x)}class Cn extends Qs{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,n,a){super.touchstart(e,n,a),this._currentTouchCount=a.length}_start(e){this._lastPoints=e,ea(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,n,a){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const o=e[0].sub(this._lastPoints[0]),c=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(o,c,a.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(o.y+c.y)/2*-.5}):void 0}gestureBeginsVertically(e,n,a){if(this._valid!==void 0)return this._valid;const o=e.mag()>=2,c=n.mag()>=2;if(!o&&!c)return;if(!o||!c)return this._firstMove===void 0&&(this._firstMove=a),a-this._firstMove<100&&void 0;const m=e.y>0==n.y>0;return ea(e)&&ea(n)&&m}}const ol={panStep:100,bearingStep:15,pitchStep:10};class Si{constructor(e){this._tr=new Vi(e);const n=ol;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let n=0,a=0,o=0,c=0,m=0;switch(e.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:e.shiftKey?a=-1:(e.preventDefault(),c=-1);break;case 39:e.shiftKey?a=1:(e.preventDefault(),c=1);break;case 38:e.shiftKey?o=1:(e.preventDefault(),m=-1);break;case 40:e.shiftKey?o=-1:(e.preventDefault(),m=1);break;default:return}return this._rotationDisabled&&(a=0,o=0),{cameraAnimation:g=>{const y=this._tr;g.easeTo({duration:300,easeId:"keyboardHandler",easing:sr,zoom:n?Math.round(y.zoom)+n*(e.shiftKey?2:1):y.zoom,bearing:y.bearing+a*this._bearingStep,pitch:y.pitch+o*this._pitchStep,offset:[-c*this._panStep,-m*this._panStep],center:y.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function sr(h){return h*(2-h)}const ao=4.000244140625;class Ni{constructor(e,n){this._onTimeout=a=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)},this._map=e,this._tr=new Vi(e),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let n=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const a=me.now(),o=a-(this._lastWheelEventTime||0);this._lastWheelEventTime=a,n!==0&&n%ao==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":o>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(o*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),e.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=e,this._delta-=n,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const n=se.mousePos(this._map.getCanvas(),e),a=this._tr;this._around=n.y>a.transform.height/2-a.transform.getHorizon()?p.N.convert(this._aroundCenter?a.center:a.unproject(n)):p.N.convert(a.center),this._aroundPoint=a.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(this._delta!==0){const y=this._type==="wheel"&&Math.abs(this._delta)>ao?this._wheelZoomRate:this._defaultZoomRate;let b=2/(1+Math.exp(-Math.abs(this._delta*y)));this._delta<0&&b!==0&&(b=1/b);const T=typeof this._targetZoom=="number"?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(T*b))),this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom=="number"?this._targetZoom:e.zoom,a=this._startZoom,o=this._easing;let c,m=!1;const g=me.now()-this._lastWheelEventTime;if(this._type==="wheel"&&a&&o&&g){const y=Math.min(g/200,1),b=o(y);c=p.y.number(a,n,b),y<1?this._frameId||(this._frameId=!0):m=!0}else c=n,m=!0;return this._active=!0,m&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!m,zoomDelta:c-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let n=p.b9;if(this._prevEase){const a=this._prevEase,o=(me.now()-a.start)/a.duration,c=a.easing(o+.01)-a.easing(o),m=.27/Math.sqrt(c*c+1e-4)*.01,g=Math.sqrt(.0729-m*m);n=p.b8(m,g,.25,1)}return this._prevEase={start:me.now(),duration:e,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class tn{constructor(e,n){this._clickZoom=e,this._tapZoom=n}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 rc{constructor(e){this._tr=new Vi(e),this.reset()}reset(){this._active=!1}dblclick(e,n){return e.preventDefault(),{cameraAnimation:a=>{a.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class nc{constructor(){this._tap=new Ks({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,n,a){if(!this._swipePoint)if(this._tapTime){const o=n[0],c=e.timeStamp-this._tapTime<500,m=this._tapPoint.dist(o)<30;c&&m?a.length>0&&(this._swipePoint=o,this._swipeTouch=a[0].identifier):this.reset()}else this._tap.touchstart(e,n,a)}touchmove(e,n,a){if(this._tapTime){if(this._swipePoint){if(a[0].identifier!==this._swipeTouch)return;const o=n[0],c=o.y-this._swipePoint.y;return this._swipePoint=o,e.preventDefault(),this._active=!0,{zoomDelta:c/128}}}else this._tap.touchmove(e,n,a)}touchend(e,n,a){if(this._tapTime)this._swipePoint&&a.length===0&&this.reset();else{const o=this._tap.touchend(e,n,a);o&&(this._tapTime=e.timeStamp,this._tapPoint=o)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ll{constructor(e,n,a){this._el=e,this._mousePan=n,this._touchPan=a}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class cl{constructor(e,n,a){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=n,this._mousePitch=a}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class oo{constructor(e,n,a,o){this._el=e,this._touchZoom=n,this._touchRotate=a,this._tapDragZoom=o,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class kn{constructor(e,n){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=e,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=se.create("div","maplibregl-cooperative-gesture-screen",e);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const a=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),o=document.createElement("div");o.className="maplibregl-desktop-message",o.textContent=n,this._container.appendChild(o);const c=document.createElement("div");c.className="maplibregl-mobile-message",c.textContent=a,this._container.appendChild(c),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(se.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,n){this._enabled&&(this._map.fire(new p.k("cooperativegestureprevented",{gestureType:e,originalEvent:n})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Ii=h=>h.zoom||h.drag||h.pitch||h.rotate;class Ie extends p.k{}function ta(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta}class lo{constructor(e,n){this.handleWindowEvent=o=>{this.handleEvent(o,`${o.type}Window`)},this.handleEvent=(o,c)=>{if(o.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const m=o.type==="renderFrame"?void 0:o,g={needsRenderFrame:!1},y={},b={},T=o.touches,S=T?this._getMapTouches(T):void 0,C=S?se.touchPos(this._map.getCanvas(),S):se.mousePos(this._map.getCanvas(),o);for(const{handlerName:V,handler:U,allowed:$}of this._handlers){if(!U.isEnabled())continue;let Z;this._blockedByActive(b,$,V)?U.reset():U[c||o.type]&&(Z=U[c||o.type](o,C,S),this.mergeHandlerResult(g,y,Z,V,m),Z&&Z.needsRenderFrame&&this._triggerRenderFrame()),(Z||U.isActive())&&(b[V]=U)}const E={};for(const V in this._previousActiveHandlers)b[V]||(E[V]=m);this._previousActiveHandlers=b,(Object.keys(E).length||ta(g))&&(this._changes.push([g,y,E]),this._triggerRenderFrame()),(Object.keys(b).length||ta(g))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:R}=g;R&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],R(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ka(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);const a=this._el;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]];for(const[o,c,m]of this._listeners)se.addEventListener(o,c,o===document?this.handleWindowEvent:this.handleEvent,m)}destroy(){for(const[e,n,a]of this._listeners)se.removeEventListener(e,n,e===document?this.handleWindowEvent:this.handleEvent,a)}_addDefaultHandlers(e){const n=this._map,a=n.getCanvasContainer();this._add("mapEvent",new al(n,e));const o=n.boxZoom=new mi(n,e);this._add("boxZoom",o),e.interactive&&e.boxZoom&&o.enable();const c=n.cooperativeGestures=new kn(n,e.cooperativeGestures);this._add("cooperativeGestures",c),e.cooperativeGestures&&c.enable();const m=new Mn(n),g=new rc(n);n.doubleClickZoom=new tn(g,m),this._add("tapZoom",m),this._add("clickZoom",g),e.interactive&&e.doubleClickZoom&&n.doubleClickZoom.enable();const y=new nc;this._add("tapDragZoom",y);const b=n.touchPitch=new Cn(n);this._add("touchPitch",b),e.interactive&&e.touchPitch&&n.touchPitch.enable(e.touchPitch);const T=eo(e),S=to(e);n.dragRotate=new cl(e,T,S),this._add("mouseRotate",T,["mousePitch"]),this._add("mousePitch",S,["mouseRotate"]),e.interactive&&e.dragRotate&&n.dragRotate.enable();const C=(({enable:Z,clickTolerance:B})=>{const X=new Js({checkCorrectEvent:K=>se.mouseButton(K)===0&&!K.ctrlKey});return new gr({clickTolerance:B,move:(K,ee)=>({around:ee,panDelta:ee.sub(K)}),activateOnStart:!0,moveStateManager:X,enable:Z,assignEvents:Ys})})(e),E=new en(e,n);n.dragPan=new ll(a,C,E),this._add("mousePan",C),this._add("touchPan",E,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&n.dragPan.enable(e.dragPan);const R=new so,V=new ro;n.touchZoomRotate=new oo(a,V,R,y),this._add("touchRotate",R,["touchPan","touchZoom"]),this._add("touchZoom",V,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&n.touchZoomRotate.enable(e.touchZoomRotate);const U=n.scrollZoom=new Ni(n,()=>this._triggerRenderFrame());this._add("scrollZoom",U,["mousePan"]),e.interactive&&e.scrollZoom&&n.scrollZoom.enable(e.scrollZoom);const $=n.keyboard=new Si(n);this._add("keyboard",$),e.interactive&&e.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new wt(n))}_add(e,n,a){this._handlers.push({handlerName:e,handler:n,allowed:a}),this._handlersById[e]=n}stop(e){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Ii(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,n,a){for(const o in e)if(o!==a&&(!n||n.indexOf(o)<0))return!0;return!1}_getMapTouches(e){const n=[];for(const a of e)this._el.contains(a.target)&&n.push(a);return n}mergeHandlerResult(e,n,a,o,c){if(!a)return;p.e(e,a);const m={handlerName:o,originalEvent:a.originalEvent||c};a.zoomDelta!==void 0&&(n.zoom=m),a.panDelta!==void 0&&(n.drag=m),a.pitchDelta!==void 0&&(n.pitch=m),a.bearingDelta!==void 0&&(n.rotate=m)}_applyChanges(){const e={},n={},a={};for(const[o,c,m]of this._changes)o.panDelta&&(e.panDelta=(e.panDelta||new p.P(0,0))._add(o.panDelta)),o.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+o.zoomDelta),o.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+o.bearingDelta),o.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+o.pitchDelta),o.around!==void 0&&(e.around=o.around),o.pinchAround!==void 0&&(e.pinchAround=o.pinchAround),o.noInertia&&(e.noInertia=o.noInertia),p.e(n,c),p.e(a,m);this._updateMapTransform(e,n,a),this._changes=[]}_updateMapTransform(e,n,a){const o=this._map,c=o._getTransformForUpdate(),m=o.terrain;if(!(ta(e)||m&&this._terrainMovement))return this._fireEvents(n,a,!0);let{panDelta:g,zoomDelta:y,bearingDelta:b,pitchDelta:T,around:S,pinchAround:C}=e;C!==void 0&&(S=C),o._stop(!0),S=S||o.transform.centerPoint;const E=c.pointLocation(g?S.sub(g):S);b&&(c.bearing+=b),T&&(c.pitch+=T),y&&(c.zoom+=y),m?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?c.center=c.pointLocation(c.centerPoint.sub(g)):c.setLocationAtPoint(E,S):(this._terrainMovement=!0,this._map._elevationFreeze=!0,c.setLocationAtPoint(E,S)):c.setLocationAtPoint(E,S),o._applyUpdatedTransform(c),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(n,a,!0)}_fireEvents(e,n,a){const o=Ii(this._eventsInProgress),c=Ii(e),m={};for(const S in e){const{originalEvent:C}=e[S];this._eventsInProgress[S]||(m[`${S}start`]=C),this._eventsInProgress[S]=e[S]}!o&&c&&this._fireEvent("movestart",c.originalEvent);for(const S in m)this._fireEvent(S,m[S]);c&&this._fireEvent("move",c.originalEvent);for(const S in e){const{originalEvent:C}=e[S];this._fireEvent(S,C)}const g={};let y;for(const S in this._eventsInProgress){const{handlerName:C,originalEvent:E}=this._eventsInProgress[S];this._handlersById[C].isActive()||(delete this._eventsInProgress[S],y=n[C]||E,g[`${S}end`]=y)}for(const S in g)this._fireEvent(S,g[S]);const b=Ii(this._eventsInProgress),T=(o||c)&&!b;if(T&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const S=this._map._getTransformForUpdate();S.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(S)}if(a&&T){this._updatingCamera=!0;const S=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),C=E=>E!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Ie("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class hl extends p.E{constructor(e,n){super(),this._renderFrameCallback=()=>{const a=Math.min((me.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(a)),a<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=n.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new p.N(this.transform.center.lng,this.transform.center.lat)}setCenter(e,n){return this.jumpTo({center:e},n)}panBy(e,n,a){return e=p.P.convert(e).mult(-1),this.panTo(this.transform.center,p.e({offset:e},n),a)}panTo(e,n,a){return this.easeTo(p.e({center:e},n),a)}getZoom(){return this.transform.zoom}setZoom(e,n){return this.jumpTo({zoom:e},n),this}zoomTo(e,n,a){return this.easeTo(p.e({zoom:e},n),a)}zoomIn(e,n){return this.zoomTo(this.getZoom()+1,e,n),this}zoomOut(e,n){return this.zoomTo(this.getZoom()-1,e,n),this}getBearing(){return this.transform.bearing}setBearing(e,n){return this.jumpTo({bearing:e},n),this}getPadding(){return this.transform.padding}setPadding(e,n){return this.jumpTo({padding:e},n),this}rotateTo(e,n,a){return this.easeTo(p.e({bearing:e},n),a)}resetNorth(e,n){return this.rotateTo(0,p.e({duration:1e3},e),n),this}resetNorthPitch(e,n){return this.easeTo(p.e({bearing:0,pitch:0,duration:1e3},e),n),this}snapToNorth(e,n){return Math.abs(this.getBearing()){if(this._zooming&&(o.zoom=p.y.number(c,U,oe)),this._rotating&&(o.bearing=p.y.number(m,b,oe)),this._pitching&&(o.pitch=p.y.number(g,T,oe)),this._padding&&(o.interpolatePadding(y,S,oe),E=o.centerPoint.add(C)),this.terrain&&!e.freezeElevation&&this._updateElevation(oe),X)o.setLocationAtPoint(X,K);else{const he=o.zoomScale(o.zoom-c),xe=U>c?Math.min(2,B):Math.max(.5,B),Te=Math.pow(xe,1-oe),fe=o.unproject($.add(Z.mult(oe*Te)).mult(he));o.setLocationAtPoint(o.renderWorldCopies?fe.wrap():fe,E)}this._applyUpdatedTransform(o),this._fireMoveEvents(n)},oe=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n,oe)},e),this}_prepareEase(e,n,a={}){this._moving=!0,n||a.moving||this.fire(new p.k("movestart",e)),this._zooming&&!a.zooming&&this.fire(new p.k("zoomstart",e)),this._rotating&&!a.rotating&&this.fire(new p.k("rotatestart",e)),this._pitching&&!a.pitching&&this.fire(new p.k("pitchstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&n!==this._elevationTarget){const a=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(a-(n-(a*e+this._elevationStart))/(1-e)),this._elevationTarget=n}this.transform.elevation=p.y.number(this._elevationStart,this._elevationTarget,e)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){const n=e.getCameraPosition(),a=this.terrain.getElevationForLngLatZoom(n.lngLat,e.zoom);if(n.altitudethis._elevateCameraIfInsideTerrain(o)),this.transformCameraUpdate&&n.push(o=>this.transformCameraUpdate(o)),!n.length)return;const a=e.clone();for(const o of n){const c=a.clone(),{center:m,zoom:g,pitch:y,bearing:b,elevation:T}=o(c);m&&(c.center=m),g!==void 0&&(c.zoom=g),y!==void 0&&(c.pitch=y),b!==void 0&&(c.bearing=b),T!==void 0&&(c.elevation=T),a.apply(c)}this.transform.apply(a)}_fireMoveEvents(e){this.fire(new p.k("move",e)),this._zooming&&this.fire(new p.k("zoom",e)),this._rotating&&this.fire(new p.k("rotate",e)),this._pitching&&this.fire(new p.k("pitch",e))}_afterEase(e,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const a=this._zooming,o=this._rotating,c=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,a&&this.fire(new p.k("zoomend",e)),o&&this.fire(new p.k("rotateend",e)),c&&this.fire(new p.k("pitchend",e)),this.fire(new p.k("moveend",e))}flyTo(e,n){var a;if(!e.essential&&me.prefersReducedMotion){const be=p.M(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(be,n)}this.stop(),e=p.e({offset:[0,0],speed:1.2,curve:1.42,easing:p.b9},e);const o=this._getTransformForUpdate(),c=o.zoom,m=o.bearing,g=o.pitch,y=o.padding,b="bearing"in e?this._normalizeBearing(e.bearing,m):m,T="pitch"in e?+e.pitch:g,S="padding"in e?e.padding:o.padding,C=p.P.convert(e.offset);let E=o.centerPoint.add(C);const R=o.pointLocation(E),{center:V,zoom:U}=o.getConstrained(p.N.convert(e.center||R),(a=e.zoom)!==null&&a!==void 0?a:c);this._normalizeCenter(V,o);const $=o.zoomScale(U-c),Z=o.project(R),B=o.project(V).sub(Z);let X=e.curve;const K=Math.max(o.width,o.height),ee=K/$,oe=B.mag();if("minZoom"in e){const be=p.ac(Math.min(e.minZoom,c,U),o.minZoom,o.maxZoom),Fe=K/o.zoomScale(be-c);X=Math.sqrt(Fe/oe*2)}const he=X*X;function xe(be){const Fe=(ee*ee-K*K+(be?-1:1)*he*he*oe*oe)/(2*(be?ee:K)*he*oe);return Math.log(Math.sqrt(Fe*Fe+1)-Fe)}function Te(be){return(Math.exp(be)-Math.exp(-be))/2}function fe(be){return(Math.exp(be)+Math.exp(-be))/2}const pe=xe(!1);let Me=function(be){return fe(pe)/fe(pe+X*be)},Ve=function(be){return K*((fe(pe)*(Te(Fe=pe+X*be)/fe(Fe))-Te(pe))/he)/oe;var Fe},ge=(xe(!0)-pe)/X;if(Math.abs(oe)<1e-6||!isFinite(ge)){if(Math.abs(K-ee)<1e-6)return this.easeTo(e,n);const be=ee0,Me=Fe=>Math.exp(be*X*Fe)}return e.duration="duration"in e?+e.duration:1e3*ge/("screenSpeed"in e?+e.screenSpeed/X:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=m!==b,this._pitching=T!==g,this._padding=!o.isPaddingEqual(S),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(V),this._ease(be=>{const Fe=be*ge,pt=1/Me(Fe);o.zoom=be===1?U:c+o.scaleZoom(pt),this._rotating&&(o.bearing=p.y.number(m,b,be)),this._pitching&&(o.pitch=p.y.number(g,T,be)),this._padding&&(o.interpolatePadding(y,S,be),E=o.centerPoint.add(C)),this.terrain&&!e.freezeElevation&&this._updateElevation(be);const Ue=be===1?V:o.unproject(Z.add(B.mult(Ve(Fe))).mult(pt));o.setLocationAtPoint(o.renderWorldCopies?Ue.wrap():Ue,E),this._applyUpdatedTransform(o),this._fireMoveEvents(n)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,n){var a;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const o=this._onEaseEnd;delete this._onEaseEnd,o.call(this,n)}return e||(a=this.handlers)===null||a===void 0||a.stop(!1),this}_ease(e,n,a){a.animate===!1||a.duration===0?(e(1),n()):(this._easeStart=me.now(),this._easeOptions=a,this._onEaseFrame=e,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,n){e=p.b3(e,-180,180);const a=Math.abs(e-n);return Math.abs(e-360-n)180?-360:a<-180?360:0}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(p.N.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}const zn={compact:!0,customAttribution:'MapLibre'};class En{constructor(e=zn){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=se.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=se.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=se.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){se.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,n){const a=this._map._getUIString(`AttributionControl.${n}`);e.title=a,e.setAttribute("aria-label",a)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(o=>typeof o!="string"?"":o)):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const o=this._map.style.stylesheet;this.styleOwner=o.owner,this.styleId=o.id}const n=this._map.style.sourceCaches;for(const o in n){const c=n[o];if(c.used||c.usedForTerrain){const m=c.getSource();m.attribution&&e.indexOf(m.attribution)<0&&e.push(m.attribution)}}e=e.filter(o=>String(o).trim()),e.sort((o,c)=>o.length-c.length),e=e.filter((o,c)=>{for(let m=c+1;m=0)return!1;return!0});const a=e.join(" | ");a!==this._attribHTML&&(this._attribHTML=a,e.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class co{constructor(e={}){this._updateCompact=()=>{const n=this._container.children;if(n.length){const a=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&a.classList.add("maplibregl-compact"):a.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=se.create("div","maplibregl-ctrl");const n=se.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){se.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Xe{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const n=++this._id;return this._queue.push({callback:e,id:n,cancelled:!1}),n}remove(e){const n=this._currentlyRunning,a=n?this._queue.concat(n):this._queue;for(const o of a)if(o.id===e)return void(o.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const a of n)if(!a.cancelled&&(a.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var ho=p.Y([{name:"a_pos3d",type:"Int16",components:3}]);class sc extends p.E{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,n){this.sourceCache.update(e,n),this._renderableTilesKeys=[];const a={};for(const o of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))a[o.key]=!0,this._renderableTilesKeys.push(o.key),this._tiles[o.key]||(o.posMatrix=new Float64Array(16),p.aP(o.posMatrix,0,p.X,0,p.X,0,1),this._tiles[o.key]=new Ar(o,this.tileSize));for(const o in this._tiles)a[o]||delete this._tiles[o]}freeRtt(e){for(const n in this._tiles){const a=this._tiles[n];(!e||a.tileID.equals(e)||a.tileID.isChildOf(e)||e.isChildOf(a.tileID))&&(a.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){const n={};for(const a of this._renderableTilesKeys){const o=this._tiles[a].tileID;if(o.canonical.equals(e.canonical)){const c=e.clone();c.posMatrix=new Float64Array(16),p.aP(c.posMatrix,0,p.X,0,p.X,0,1),n[a]=c}else if(o.canonical.isChildOf(e.canonical)){const c=e.clone();c.posMatrix=new Float64Array(16);const m=o.canonical.z-e.canonical.z,g=o.canonical.x-(o.canonical.x>>m<>m<>m;p.aP(c.posMatrix,0,b,0,b,0,1),p.J(c.posMatrix,c.posMatrix,[-g*b,-y*b,0]),n[a]=c}else if(e.canonical.isChildOf(o.canonical)){const c=e.clone();c.posMatrix=new Float64Array(16);const m=e.canonical.z-o.canonical.z,g=e.canonical.x-(e.canonical.x>>m<>m<>m;p.aP(c.posMatrix,0,p.X,0,p.X,0,1),p.J(c.posMatrix,c.posMatrix,[g*b,y*b,0]),p.K(c.posMatrix,c.posMatrix,[1/2**m,1/2**m,0]),n[a]=c}}return n}getSourceTile(e,n){const a=this.sourceCache._source;let o=e.overscaledZ-this.deltaZoom;if(o>a.maxzoom&&(o=a.maxzoom),o=a.minzoom&&(!c||!c.dem);)c=this.sourceCache.getTileByID(e.scaledTo(o--).key);return c}tilesAfterTime(e=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=e)}}class uo{constructor(e,n,a){this.painter=e,this.sourceCache=new sc(n),this.options=a,this.exaggeration=typeof a.exaggeration=="number"?a.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,n,a,o=p.X){var c;if(!(n>=0&&n=0&&ae.canonical.z&&(e.canonical.z>=o?c=e.canonical.z-o:p.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const m=e.canonical.x-(e.canonical.x>>c<>c<>8<<4|c>>8,n[m+3]=0;const a=new p.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),o=new st(e,a,e.gl.RGBA,{premultiply:!1});return o.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=o,o}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const n=new Uint8Array(4),a=this.painter.context,o=a.gl,c=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),m=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),g=Math.round(this.painter.height/devicePixelRatio);a.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),o.readPixels(c,g-m-1,1,1,o.RGBA,o.UNSIGNED_BYTE,n),a.bindFramebuffer.set(null);const y=n[0]+(n[2]>>4<<8),b=n[1]+((15&n[2])<<8),T=this.coordsIndex[255-n[3]],S=T&&this.sourceCache.getTileByID(T);if(!S)return null;const C=this._coordsTextureSize,E=(1<e.id!==n),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length!e.inUse)===!1}}const Dn={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class ul{constructor(e,n){this.painter=e,this.terrain=n,this.pool=new ac(e.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(a=>!e._layers[a].isHidden(n)),this._coordsDescendingInv={};for(const a in e.sourceCaches){this._coordsDescendingInv[a]={};const o=e.sourceCaches[a].getVisibleCoordinates();for(const c of o){const m=this.terrain.sourceCache.getTerrainCoords(c);for(const g in m)this._coordsDescendingInv[a][g]||(this._coordsDescendingInv[a][g]=[]),this._coordsDescendingInv[a][g].push(m[g])}}this._coordsDescendingInvStr={};for(const a of e._order){const o=e._layers[a],c=o.source;if(Dn[o.type]&&!this._coordsDescendingInvStr[c]){this._coordsDescendingInvStr[c]={};for(const m in this._coordsDescendingInv[c])this._coordsDescendingInvStr[c][m]=this._coordsDescendingInv[c][m].map(g=>g.key).sort().join()}}for(const a of this._renderableTiles)for(const o in this._coordsDescendingInvStr){const c=this._coordsDescendingInvStr[o][a.tileID.key];c&&c!==a.rttCoords[o]&&(a.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;const n=e.type,a=this.painter,o=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(Dn[n]&&(this._prevType&&Dn[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(e.id),!o))return!0;if(Dn[this._prevType]||Dn[n]&&o){this._prevType=n;const c=this._stacks.length-1,m=this._stacks[c]||[];for(const g of this._renderableTiles){if(this.pool.isFull()&&(rl(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(g),g.rtt[c]){const b=this.pool.getObjectForId(g.rtt[c].id);if(b.stamp===g.rtt[c].stamp){this.pool.useObject(b);continue}}const y=this.pool.getOrCreateFreeObject();this.pool.useObject(y),this.pool.stampObject(y),g.rtt[c]={id:y.id,stamp:y.stamp},a.context.bindFramebuffer.set(y.fbo.framebuffer),a.context.clear({color:p.aM.transparent,stencil:0}),a.currentStencilSource=void 0;for(let b=0;b{h.touchstart=h.dragStart,h.touchmoveWindow=h.dragMove,h.touchend=h.dragEnd},lc={showCompass:!0,showZoom:!0,visualizePitch:!1};class cc{constructor(e,n,a=!1){this.mousedown=m=>{this.startMouse(p.e({},m,{ctrlKey:!0,preventDefault:()=>m.preventDefault()}),se.mousePos(this.element,m)),se.addEventListener(window,"mousemove",this.mousemove),se.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=m=>{this.moveMouse(m,se.mousePos(this.element,m))},this.mouseup=m=>{this.mouseRotate.dragEnd(m),this.mousePitch&&this.mousePitch.dragEnd(m),this.offTemp()},this.touchstart=m=>{m.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=se.touchPos(this.element,m.targetTouches)[0],this.startTouch(m,this._startPos),se.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),se.addEventListener(window,"touchend",this.touchend))},this.touchmove=m=>{m.targetTouches.length!==1?this.reset():(this._lastPos=se.touchPos(this.element,m.targetTouches)[0],this.moveTouch(m,this._lastPos))},this.touchend=m=>{m.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const o=e.dragRotate._mouseRotate.getClickTolerance(),c=e.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=eo({clickTolerance:o,enable:!0}),this.touchRotate=(({enable:m,clickTolerance:g,bearingDegreesPerPixelMoved:y=.8})=>{const b=new Qa;return new gr({clickTolerance:g,move:(T,S)=>({bearingDelta:(S.x-T.x)*y}),moveStateManager:b,enable:m,assignEvents:fo})})({clickTolerance:o,enable:!0}),this.map=e,a&&(this.mousePitch=to({clickTolerance:c,enable:!0}),this.touchPitch=(({enable:m,clickTolerance:g,pitchDegreesPerPixelMoved:y=-.5})=>{const b=new Qa;return new gr({clickTolerance:g,move:(T,S)=>({pitchDelta:(S.y-T.y)*y}),moveStateManager:b,enable:m,assignEvents:fo})})({clickTolerance:c,enable:!0})),se.addEventListener(n,"mousedown",this.mousedown),se.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),se.addEventListener(n,"touchcancel",this.reset)}startMouse(e,n){this.mouseRotate.dragStart(e,n),this.mousePitch&&this.mousePitch.dragStart(e,n),se.disableDrag()}startTouch(e,n){this.touchRotate.dragStart(e,n),this.touchPitch&&this.touchPitch.dragStart(e,n),se.disableDrag()}moveMouse(e,n){const a=this.map,{bearingDelta:o}=this.mouseRotate.dragMove(e,n)||{};if(o&&a.setBearing(a.getBearing()+o),this.mousePitch){const{pitchDelta:c}=this.mousePitch.dragMove(e,n)||{};c&&a.setPitch(a.getPitch()+c)}}moveTouch(e,n){const a=this.map,{bearingDelta:o}=this.touchRotate.dragMove(e,n)||{};if(o&&a.setBearing(a.getBearing()+o),this.touchPitch){const{pitchDelta:c}=this.touchPitch.dragMove(e,n)||{};c&&a.setPitch(a.getPitch()+c)}}off(){const e=this.element;se.removeEventListener(e,"mousedown",this.mousedown),se.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),se.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),se.removeEventListener(window,"touchend",this.touchend),se.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){se.enableDrag(),se.removeEventListener(window,"mousemove",this.mousemove),se.removeEventListener(window,"mouseup",this.mouseup),se.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),se.removeEventListener(window,"touchend",this.touchend)}}let _i;function dt(h,e,n){const a=new p.N(h.lng,h.lat);if(h=new p.N(h.lng,h.lat),e){const o=new p.N(h.lng-360,h.lat),c=new p.N(h.lng+360,h.lat),m=n.locationPoint(h).distSqr(e);n.locationPoint(o).distSqr(e)180;){const o=n.locationPoint(h);if(o.x>=0&&o.y>=0&&o.x<=n.width&&o.y<=n.height)break;h.lng>n.center.lng?h.lng-=360:h.lng+=360}return h.lng!==a.lng&&n.locationPoint(h).y>n.height/2-n.getHorizon()?h:a}const Ln={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function ia(h,e,n){const a=h.classList;for(const o in Ln)a.remove(`maplibregl-${n}-anchor-${o}`);a.add(`maplibregl-${n}-anchor-${e}`)}class ra extends p.E{constructor(e){if(super(),this._onKeyPress=n=>{const a=n.code,o=n.charCode||n.keyCode;a!=="Space"&&a!=="Enter"&&o!==32&&o!==13||this.togglePopup()},this._onMapClick=n=>{const a=n.originalEvent.target,o=this._element;this._popup&&(a===o||o.contains(a))&&this.togglePopup()},this._update=n=>{var a;if(!this._map)return;const o=this._map.loaded()&&!this._map.isMoving();((n==null?void 0:n.type)==="terrain"||(n==null?void 0:n.type)==="render"&&!o)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?dt(this._lngLat,this._flatPos,this._map.transform):(a=this._lngLat)===null||a===void 0?void 0:a.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let c="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?c=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(c=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let m="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?m="rotateX(0deg)":this._pitchAlignment==="map"&&(m=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||n&&n.type!=="moveend"||(this._pos=this._pos.round()),se.setTransform(this._element,`${Ln[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${m} ${c}`),me.frameAsync(new AbortController).then(()=>{this._updateOpacity(n&&n.type==="moveend")}).catch(()=>{})},this._onMove=n=>{if(!this._isDragging){const a=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=a}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new p.k("dragstart"))),this.fire(new p.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new p.k("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(e==null?void 0:e.opacity,e==null?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=p.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=se.create("div");const n=se.createNS("http://www.w3.org/2000/svg","svg"),a=41,o=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${a}px`),n.setAttributeNS(null,"width",`${o}px`),n.setAttributeNS(null,"viewBox",`0 0 ${o} ${a}`);const c=se.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"stroke","none"),c.setAttributeNS(null,"stroke-width","1"),c.setAttributeNS(null,"fill","none"),c.setAttributeNS(null,"fill-rule","evenodd");const m=se.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"fill-rule","nonzero");const g=se.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(3.0, 29.0)"),g.setAttributeNS(null,"fill","#000000");const y=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const $ of y){const Z=se.createNS("http://www.w3.org/2000/svg","ellipse");Z.setAttributeNS(null,"opacity","0.04"),Z.setAttributeNS(null,"cx","10.5"),Z.setAttributeNS(null,"cy","5.80029008"),Z.setAttributeNS(null,"rx",$.rx),Z.setAttributeNS(null,"ry",$.ry),g.appendChild(Z)}const b=se.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"fill",this._color);const T=se.createNS("http://www.w3.org/2000/svg","path");T.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),b.appendChild(T);const S=se.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"opacity","0.25"),S.setAttributeNS(null,"fill","#000000");const C=se.createNS("http://www.w3.org/2000/svg","path");C.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),S.appendChild(C);const E=se.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"transform","translate(6.0, 7.0)"),E.setAttributeNS(null,"fill","#FFFFFF");const R=se.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"transform","translate(8.0, 8.0)");const V=se.createNS("http://www.w3.org/2000/svg","circle");V.setAttributeNS(null,"fill","#000000"),V.setAttributeNS(null,"opacity","0.25"),V.setAttributeNS(null,"cx","5.5"),V.setAttributeNS(null,"cy","5.5"),V.setAttributeNS(null,"r","5.4999962");const U=se.createNS("http://www.w3.org/2000/svg","circle");U.setAttributeNS(null,"fill","#FFFFFF"),U.setAttributeNS(null,"cx","5.5"),U.setAttributeNS(null,"cy","5.5"),U.setAttributeNS(null,"r","5.4999962"),R.appendChild(V),R.appendChild(U),m.appendChild(g),m.appendChild(b),m.appendChild(S),m.appendChild(E),m.appendChild(R),n.appendChild(m),n.setAttributeNS(null,"height",a*this._scale+"px"),n.setAttributeNS(null,"width",o*this._scale+"px"),this._element.appendChild(n),this._offset=p.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",n=>{n.preventDefault()}),this._element.addEventListener("mousedown",n=>{n.preventDefault()}),ia(this._element,this._anchor,"marker"),e&&e.className)for(const n of e.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),se.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=p.N.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const o=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[o,-1*(38.1-13.5+o)],"bottom-right":[-o,-1*(38.1-13.5+o)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var n,a;if(!(!((n=this._map)===null||n===void 0)&&n.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const o=this._map,c=o.terrain.depthAtPoint(this._pos),m=o.terrain.getElevationForLngLatZoom(this._lngLat,o.transform.tileZoom);if(o.transform.lngLatToCameraDepth(this._lngLat,m)-c<.006)return void(this._element.style.opacity=this._opacity);const g=-this._offset.y/o.transform._pixelPerMeter,y=Math.sin(o.getPitch()*Math.PI/180)*g,b=o.terrain.depthAtPoint(new p.P(this._pos.x,this._pos.y-this._offset.y)),T=o.transform.lngLatToCameraDepth(this._lngLat,m+y)-b>.006;!((a=this._popup)===null||a===void 0)&&a.isOpen()&&T&&this._popup.remove(),this._element.style.opacity=T?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=p.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,n){return e===void 0&&n===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=e),n!==void 0&&(this._opacityWhenCovered=n),this._map&&this._updateOpacity(!0),this}}const pl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let ms=0,_s=!1;const ar={maxWidth:100,unit:"metric"};function gs(h,e,n){const a=n&&n.maxWidth||100,o=h._container.clientHeight/2,c=h.unproject([0,o]),m=h.unproject([a,o]),g=c.distanceTo(m);if(n&&n.unit==="imperial"){const y=3.2808*g;y>5280?Ae(e,a,y/5280,h._getUIString("ScaleControl.Miles")):Ae(e,a,y,h._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?Ae(e,a,g/1852,h._getUIString("ScaleControl.NauticalMiles")):g>=1e3?Ae(e,a,g/1e3,h._getUIString("ScaleControl.Kilometers")):Ae(e,a,g,h._getUIString("ScaleControl.Meters"))}function Ae(h,e,n,a){const o=function(c){const m=Math.pow(10,`${Math.floor(c)}`.length-1);let g=c/m;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:g>=1?1:function(y){const b=Math.pow(10,Math.ceil(-Math.log(y)/Math.LN10));return Math.round(y*b)/b}(g),m*g}(n);h.style.width=e*(o/n)+"px",h.innerHTML=`${o} ${a}`}const Re={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},na=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function sa(h){if(h){if(typeof h=="number"){const e=Math.round(Math.abs(h)/Math.SQRT2);return{center:new p.P(0,0),top:new p.P(0,h),"top-left":new p.P(e,e),"top-right":new p.P(-e,e),bottom:new p.P(0,-h),"bottom-left":new p.P(e,-e),"bottom-right":new p.P(-e,-e),left:new p.P(h,0),right:new p.P(-h,0)}}if(h instanceof p.P||Array.isArray(h)){const e=p.P.convert(h);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:p.P.convert(h.center||[0,0]),top:p.P.convert(h.top||[0,0]),"top-left":p.P.convert(h["top-left"]||[0,0]),"top-right":p.P.convert(h["top-right"]||[0,0]),bottom:p.P.convert(h.bottom||[0,0]),"bottom-left":p.P.convert(h["bottom-left"]||[0,0]),"bottom-right":p.P.convert(h["bottom-right"]||[0,0]),left:p.P.convert(h.left||[0,0]),right:p.P.convert(h.right||[0,0])}}return sa(new p.P(0,0))}const mo=zi;L.AJAXError=p.bh,L.Evented=p.E,L.LngLat=p.N,L.MercatorCoordinate=p.Z,L.Point=p.P,L.addProtocol=p.bi,L.config=p.a,L.removeProtocol=p.bj,L.AttributionControl=En,L.BoxZoomHandler=mi,L.CanvasSource=bi,L.CooperativeGesturesHandler=kn,L.DoubleClickZoomHandler=tn,L.DragPanHandler=ll,L.DragRotateHandler=cl,L.EdgeInsets=Pn,L.FullscreenControl=class extends p.E{constructor(h={}){super(),this._onFullscreenChange=()=>{var e;let n=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((e=n==null?void 0:n.shadowRoot)===null||e===void 0)&&e.fullscreenElement;)n=n.shadowRoot.fullscreenElement;n===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,h&&h.container&&(h.container instanceof HTMLElement?this._container=h.container:p.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=se.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){se.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const h=this._fullscreenButton=se.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);se.create("span","maplibregl-ctrl-icon",h).setAttribute("aria-hidden","true"),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new p.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new p.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},L.GeoJSONSource=Jn,L.GeolocateControl=class extends p.E{constructor(h){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new p.k("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new p.k("geolocate",e)),this._finish()}},this._updateCamera=e=>{const n=new p.N(e.coords.longitude,e.coords.latitude),a=e.coords.accuracy,o=this._map.getBearing(),c=p.e({bearing:o},this.options.fitBoundsOptions),m=ie.fromLngLat(n,a);this._map.fitBounds(m,c,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const n=new p.N(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(this.options.trackUserLocation)if(e.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&_s)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new p.k("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=se.create("button","maplibregl-ctrl-geolocate",this._container),se.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){p.w("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=se.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new ra({element:this._dotElement}),this._circleElement=se.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ra({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",n=>{n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||n.originalEvent&&n.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new p.k("trackuserlocationend")),this.fire(new p.k("userlocationlostfocus")))})}},this.options=p.e({},pl,h)}onAdd(h){return this._map=h,this._container=se.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return p._(this,arguments,void 0,function*(e=!1){if(_i!==void 0&&!e)return _i;if(window.navigator.permissions===void 0)return _i=!!window.navigator.geolocation,_i;try{_i=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{_i=!!window.navigator.geolocation}return _i})}().then(e=>this._finishSetupUI(e)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),se.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ms=0,_s=!1}_isOutOfMapMaxBounds(h){const e=this._map.getMaxBounds(),n=h.coords;return e&&(n.longitudee.getEast()||n.latitudee.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const h=this._map.getBounds(),e=h.getSouthEast(),n=h.getNorthEast(),a=e.distanceTo(n),o=Math.ceil(this._accuracy/(a/this._map._container.clientHeight)*2);this._circleElement.style.width=`${o}px`,this._circleElement.style.height=`${o}px`}trigger(){if(!this._setup)return p.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new p.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ms--,_s=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new p.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new p.k("trackuserlocationstart")),this.fire(new p.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let h;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ms++,ms>1?(h={maximumAge:6e5,timeout:0},_s=!0):(h=this.options.positionOptions,_s=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,h)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},L.Hash=Hs,L.ImageSource=fr,L.KeyboardHandler=Si,L.LngLatBounds=ie,L.LogoControl=co,L.Map=class extends hl{constructor(h){p.bf.mark(p.bg.create);const e=Object.assign(Object.assign({},oc),h);if(e.minZoom!=null&&e.maxZoom!=null&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(e.minPitch!=null&&e.maxPitch!=null&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(e.minPitch!=null&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(e.maxPitch!=null&&e.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new An(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies),{bearingSnap:e.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Xe,this._controls=[],this._mapId=p.a4(),this._contextLost=n=>{n.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new p.k("webglcontextlost",{originalEvent:n}))},this._contextRestored=n=>{this._setupPainter(),this.resize(),this._update(),this.fire(new p.k("webglcontextrestored",{originalEvent:n}))},this._onMapScroll=n=>{if(n.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._maxTileCacheZoomLevels=e.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=e.preserveDrawingBuffer===!0,this._antialias=e.antialias===!0,this._trackResize=e.trackResize===!0,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles===!0,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions===!0,this._collectResourceTiming=e.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},po),e.locale),this._clickTolerance=e.clickTolerance,this._overridePixelRatio=e.pixelRatio,this._maxCanvasSize=e.maxCanvasSize,this.transformCameraUpdate=e.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=e.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=hi.addThrottleControl(()=>this.isMoving()),this._requestManager=new Ia(e.transformRequest),typeof e.container=="string"){if(this._container=document.getElementById(e.container),!this._container)throw new Error(`Container '${e.container}' not found.`)}else{if(!(e.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let n=!1;const a=hs(o=>{this._trackResize&&!this._removed&&(this.resize(o),this.redraw())},50);this._resizeObserver=new ResizeObserver(o=>{n?a(o):n=!0}),this._resizeObserver.observe(this._container)}this.handlers=new lo(this,e),this._hash=e.hash&&new Hs(typeof e.hash=="string"&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,p.e({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,this._validateStyle=e.validateStyle,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new En(typeof e.attributionControl=="boolean"?void 0:e.attributionControl)),e.maplibreLogo&&this.addControl(new co,e.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",n=>{this._update(n.dataType==="style"),this.fire(new p.k(`${n.dataType}data`,n))}),this.on("dataloading",n=>{this.fire(new p.k(`${n.dataType}dataloading`,n))}),this.on("dataabort",n=>{this.fire(new p.k("sourcedataabort",n))})}_getMapId(){return this._mapId}addControl(h,e){if(e===void 0&&(e=h.getDefaultPosition?h.getDefaultPosition():"top-right"),!h||!h.onAdd)return this.fire(new p.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=h.onAdd(this);this._controls.push(h);const a=this._controlPositions[e];return e.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this}removeControl(h){if(!h||!h.onRemove)return this.fire(new p.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(h);return e>-1&&this._controls.splice(e,1),h.onRemove(this),this}hasControl(h){return this._controls.indexOf(h)>-1}calculateCameraOptionsFromTo(h,e,n,a){return a==null&&this.terrain&&(a=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(h,e,n,a)}resize(h){var e;const n=this._containerDimensions(),a=n[0],o=n[1],c=this._getClampedPixelRatio(a,o);if(this._resizeCanvas(a,o,c),this.painter.resize(a,o,c),this.painter.overLimit()){const g=this.painter.context.gl;this._maxCanvasSize=[g.drawingBufferWidth,g.drawingBufferHeight];const y=this._getClampedPixelRatio(a,o);this._resizeCanvas(a,o,y),this.painter.resize(a,o,y)}this.transform.resize(a,o),(e=this._requestedCameraState)===null||e===void 0||e.resize(a,o);const m=!this._moving;return m&&(this.stop(),this.fire(new p.k("movestart",h)).fire(new p.k("move",h))),this.fire(new p.k("resize",h)),m&&this.fire(new p.k("moveend",h)),this}_getClampedPixelRatio(h,e){const{0:n,1:a}=this._maxCanvasSize,o=this.getPixelRatio(),c=h*o,m=e*o;return Math.min(c>n?n/c:1,m>a?a/m:1)*o}getPixelRatio(){var h;return(h=this._overridePixelRatio)!==null&&h!==void 0?h:devicePixelRatio}setPixelRatio(h){this._overridePixelRatio=h,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(h){return this.transform.setMaxBounds(ie.convert(h)),this._update()}setMinZoom(h){if((h=h??-2)>=-2&&h<=this.transform.maxZoom)return this.transform.minZoom=h,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=h,this._update(),this.getZoom()>h&&this.setZoom(h),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(h){if((h=h??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(h>=0&&h<=this.transform.maxPitch)return this.transform.minPitch=h,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(h>=this.transform.minPitch)return this.transform.maxPitch=h,this._update(),this.getPitch()>h&&this.setPitch(h),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(h){return this.transform.renderWorldCopies=h,this._update()}project(h){return this.transform.locationPoint(p.N.convert(h),this.style&&this.terrain)}unproject(h){return this.transform.pointLocation(p.P.convert(h),this.terrain)}isMoving(){var h;return this._moving||((h=this.handlers)===null||h===void 0?void 0:h.isMoving())}isZooming(){var h;return this._zooming||((h=this.handlers)===null||h===void 0?void 0:h.isZooming())}isRotating(){var h;return this._rotating||((h=this.handlers)===null||h===void 0?void 0:h.isRotating())}_createDelegatedListener(h,e,n){if(h==="mouseenter"||h==="mouseover"){let a=!1;return{layers:e,listener:n,delegates:{mousemove:c=>{const m=e.filter(y=>this.getLayer(y)),g=m.length!==0?this.queryRenderedFeatures(c.point,{layers:m}):[];g.length?a||(a=!0,n.call(this,new Ot(h,this,c.originalEvent,{features:g}))):a=!1},mouseout:()=>{a=!1}}}}if(h==="mouseleave"||h==="mouseout"){let a=!1;return{layers:e,listener:n,delegates:{mousemove:m=>{const g=e.filter(y=>this.getLayer(y));(g.length!==0?this.queryRenderedFeatures(m.point,{layers:g}):[]).length?a=!0:a&&(a=!1,n.call(this,new Ot(h,this,m.originalEvent)))},mouseout:m=>{a&&(a=!1,n.call(this,new Ot(h,this,m.originalEvent)))}}}}{const a=o=>{const c=e.filter(g=>this.getLayer(g)),m=c.length!==0?this.queryRenderedFeatures(o.point,{layers:c}):[];m.length&&(o.features=m,n.call(this,o),delete o.features)};return{layers:e,listener:n,delegates:{[h]:a}}}}_saveDelegatedListener(h,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[h]=this._delegatedListeners[h]||[],this._delegatedListeners[h].push(e)}_removeDelegatedListener(h,e,n){if(!this._delegatedListeners||!this._delegatedListeners[h])return;const a=this._delegatedListeners[h];for(let o=0;oe.includes(m))){for(const m in c.delegates)this.off(m,c.delegates[m]);return void a.splice(o,1)}}}on(h,e,n){if(n===void 0)return super.on(h,e);const a=this._createDelegatedListener(h,typeof e=="string"?[e]:e,n);this._saveDelegatedListener(h,a);for(const o in a.delegates)this.on(o,a.delegates[o]);return this}once(h,e,n){if(n===void 0)return super.once(h,e);const a=typeof e=="string"?[e]:e,o=this._createDelegatedListener(h,a,n);for(const c in o.delegates){const m=o.delegates[c];o.delegates[c]=(...g)=>{this._removeDelegatedListener(h,a,n),m(...g)}}this._saveDelegatedListener(h,o);for(const c in o.delegates)this.once(c,o.delegates[c]);return this}off(h,e,n){return n===void 0?super.off(h,e):(this._removeDelegatedListener(h,typeof e=="string"?[e]:e,n),this)}queryRenderedFeatures(h,e){if(!this.style)return[];let n;const a=h instanceof p.P||Array.isArray(h),o=a?h:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(a?{}:h)||{},o instanceof p.P||typeof o[0]=="number")n=[p.P.convert(o)];else{const c=p.P.convert(o[0]),m=p.P.convert(o[1]);n=[c,new p.P(m.x,c.y),m,new p.P(c.x,m.y),c]}return this.style.queryRenderedFeatures(n,e,this.transform)}querySourceFeatures(h,e){return this.style.querySourceFeatures(h,e)}setStyle(h,e){return(e=p.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&h?(this._diffStyle(h,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(h,e))}setTransformRequest(h){return this._requestManager.setTransformRequest(h),this}_getUIString(h){const e=this._locale[h];if(e==null)throw new Error(`Missing UI string '${h}'`);return e}_updateStyle(h,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(h,e));const n=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!h)),h?(this.style=new ks(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof h=="string"?this.style.loadURL(h,e,n):this.style.loadJSON(h,e,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ks(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(h,e){if(typeof h=="string"){const n=this._requestManager.transformRequest(h,"Style");p.h(n,new AbortController).then(a=>{this._updateDiff(a.data,e)}).catch(a=>{a&&this.fire(new p.j(a))})}else typeof h=="object"&&this._updateDiff(h,e)}_updateDiff(h,e){try{this.style.setState(h,e)&&this._update(!0)}catch(n){p.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(h,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():p.w("There is no style added to the map.")}addSource(h,e){return this._lazyInitEmptyStyle(),this.style.addSource(h,e),this._update(!0)}isSourceLoaded(h){const e=this.style&&this.style.sourceCaches[h];if(e!==void 0)return e.loaded();this.fire(new p.j(new Error(`There is no source with ID '${h}'`)))}setTerrain(h){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),h){const e=this.style.sourceCaches[h.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${h.source}`);this.terrain===null&&e.reload();for(const n in this.style._layers){const a=this.style._layers[n];a.type==="hillshade"&&a.source===h.source&&p.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new uo(this.painter,e,h),this.painter.renderToTexture=new ul(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId!==h.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new p.k("terrain",{terrain:h})),this}getTerrain(){var h,e;return(e=(h=this.terrain)===null||h===void 0?void 0:h.options)!==null&&e!==void 0?e:null}areTilesLoaded(){const h=this.style&&this.style.sourceCaches;for(const e in h){const n=h[e]._tiles;for(const a in n){const o=n[a];if(o.state!=="loaded"&&o.state!=="errored")return!1}}return!0}removeSource(h){return this.style.removeSource(h),this._update(!0)}getSource(h){return this.style.getSource(h)}addImage(h,e,n={}){const{pixelRatio:a=1,sdf:o=!1,stretchX:c,stretchY:m,content:g,textFitWidth:y,textFitHeight:b}=n;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||p.b(e))){if(e.width===void 0||e.height===void 0)return this.fire(new p.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:T,height:S,data:C}=e,E=e;return this.style.addImage(h,{data:new p.R({width:T,height:S},new Uint8Array(C)),pixelRatio:a,stretchX:c,stretchY:m,content:g,textFitWidth:y,textFitHeight:b,sdf:o,version:0,userImage:E}),E.onAdd&&E.onAdd(this,h),this}}{const{width:T,height:S,data:C}=me.getImageData(e);this.style.addImage(h,{data:new p.R({width:T,height:S},C),pixelRatio:a,stretchX:c,stretchY:m,content:g,textFitWidth:y,textFitHeight:b,sdf:o,version:0})}}updateImage(h,e){const n=this.style.getImage(h);if(!n)return this.fire(new p.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const a=e instanceof HTMLImageElement||p.b(e)?me.getImageData(e):e,{width:o,height:c,data:m}=a;if(o===void 0||c===void 0)return this.fire(new p.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==n.data.width||c!==n.data.height)return this.fire(new p.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const g=!(e instanceof HTMLImageElement||p.b(e));return n.data.replace(m,g),this.style.updateImage(h,n),this}getImage(h){return this.style.getImage(h)}hasImage(h){return h?!!this.style.getImage(h):(this.fire(new p.j(new Error("Missing required image id"))),!1)}removeImage(h){this.style.removeImage(h)}loadImage(h){return hi.getImage(this._requestManager.transformRequest(h,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(h,e){return this._lazyInitEmptyStyle(),this.style.addLayer(h,e),this._update(!0)}moveLayer(h,e){return this.style.moveLayer(h,e),this._update(!0)}removeLayer(h){return this.style.removeLayer(h),this._update(!0)}getLayer(h){return this.style.getLayer(h)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(h,e,n){return this.style.setLayerZoomRange(h,e,n),this._update(!0)}setFilter(h,e,n={}){return this.style.setFilter(h,e,n),this._update(!0)}getFilter(h){return this.style.getFilter(h)}setPaintProperty(h,e,n,a={}){return this.style.setPaintProperty(h,e,n,a),this._update(!0)}getPaintProperty(h,e){return this.style.getPaintProperty(h,e)}setLayoutProperty(h,e,n,a={}){return this.style.setLayoutProperty(h,e,n,a),this._update(!0)}getLayoutProperty(h,e){return this.style.getLayoutProperty(h,e)}setGlyphs(h,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(h,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(h,e,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(h,e,n,a=>{a||this._update(!0)}),this}removeSprite(h){return this._lazyInitEmptyStyle(),this.style.removeSprite(h),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(h,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(h,e,n=>{n||this._update(!0)}),this}setLight(h,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(h,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(h){return this._lazyInitEmptyStyle(),this.style.setSky(h),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(h,e){return this.style.setFeatureState(h,e),this._update()}removeFeatureState(h,e){return this.style.removeFeatureState(h,e),this._update()}getFeatureState(h){return this.style.getFeatureState(h)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let h=0,e=0;return this._container&&(h=this._container.clientWidth||400,e=this._container.clientHeight||300),[h,e]}_setupContainer(){const h=this._container;h.classList.add("maplibregl-map");const e=this._canvasContainer=se.create("div","maplibregl-canvas-container",h);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=se.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const n=this._containerDimensions(),a=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],a);const o=this._controlContainer=se.create("div","maplibregl-control-container",h),c=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(m=>{c[m]=se.create("div",`maplibregl-ctrl-${m} `,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(h,e,n){this._canvas.width=Math.floor(n*h),this._canvas.height=Math.floor(n*e),this._canvas.style.width=`${h}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const h={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let e=null;this._canvas.addEventListener("webglcontextcreationerror",a=>{e={requestedAttributes:h},a&&(e.statusMessage=a.statusMessage,e.type=a.type)},{once:!0});const n=this._canvas.getContext("webgl2",h)||this._canvas.getContext("webgl",h);if(!n){const a="Failed to initialize WebGL";throw e?(e.message=a,new Error(JSON.stringify(e))):new Error(a)}this.painter=new Gs(n,this.transform),Vr.testSupport(n)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(h){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||h,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(h){return this._update(),this._renderTaskQueue.add(h)}_cancelRenderFrame(h){this._renderTaskQueue.remove(h)}_render(h){const e=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(h),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const o=this.transform.zoom,c=me.now();this.style.zoomHistory.update(o,c);const m=new p.z(o,{now:c,fadeDuration:e,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),g=m.crossFadingFactor();g===1&&g===this._crossFadingFactor||(n=!0,this._crossFadingFactor=g),this.style.update(m)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,e,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:e,showPadding:this.showPadding}),this.fire(new p.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,p.bf.mark(p.bg.load),this.fire(new p.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const a=this._sourcesDirty||this._styleDirty||this._placementDirty;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new p.k("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0,p.bf.mark(p.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var h;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),hi.removeThrottleControl(this._imageQueueHandle),(h=this._resizeObserver)===null||h===void 0||h.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e!=null&&e.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),se.remove(this._canvasContainer),se.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),p.bf.clearMetrics(),this._removed=!0,this.fire(new p.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,me.frameAsync(this._frameRequest).then(h=>{p.bf.frame(h),this._frameRequest=null,this._render(h)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(h){this._showTileBoundaries!==h&&(this._showTileBoundaries=h,this._update())}get showPadding(){return!!this._showPadding}set showPadding(h){this._showPadding!==h&&(this._showPadding=h,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(h){this._showCollisionBoxes!==h&&(this._showCollisionBoxes=h,h?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(h){this._showOverdrawInspector!==h&&(this._showOverdrawInspector=h,this._update())}get repaint(){return!!this._repaint}set repaint(h){this._repaint!==h&&(this._repaint=h,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(h){this._vertices=h,this._update()}get version(){return dl}getCameraTargetElevation(){return this.transform.elevation}},L.MapMouseEvent=Ot,L.MapTouchEvent=Qr,L.MapWheelEvent=sl,L.Marker=ra,L.NavigationControl=class{constructor(h){this._updateZoomButtons=()=>{const e=this._map.getZoom(),n=e===this._map.getMaxZoom(),a=e===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=a,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",a.toString())},this._rotateCompassArrow=()=>{const e=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=e},this._setButtonTitle=(e,n)=>{const a=this._map._getUIString(`NavigationControl.${n}`);e.title=a,e.setAttribute("aria-label",a)},this.options=p.e({},lc,h),this._container=se.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),se.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),se.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=se.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(h){return this._map=h,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new cc(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){se.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(h,e){const n=se.create("button",h,this._container);return n.type="button",n.addEventListener("click",e),n}},L.Popup=class extends p.E{constructor(h){super(),this.remove=()=>(this._content&&se.remove(this._content),this._container&&(se.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new p.k("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var n;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=se.create("div","maplibregl-popup",this._map.getContainer()),this._tip=se.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const g of this.options.className.split(" "))this._container.classList.add(g);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?dt(this._lngLat,this._flatPos,this._map.transform):(n=this._lngLat)===null||n===void 0?void 0:n.wrap(),this._trackPointer&&!e)return;const a=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationPoint(this._lngLat));let o=this.options.anchor;const c=sa(this.options.offset);if(!o){const g=this._container.offsetWidth,y=this._container.offsetHeight;let b;b=a.y+c.bottom.ythis._map.transform.height-y?["bottom"]:[],a.xthis._map.transform.width-g/2&&b.push("right"),o=b.length===0?"bottom":b.join("-")}let m=a.add(c[o]);this.options.subpixelPositioning||(m=m.round()),se.setTransform(this._container,`${Ln[o]} translate(${m.x}px,${m.y}px)`),ia(this._container,o,"popup")},this._onClose=()=>{this.remove()},this.options=p.e(Object.create(Re),h)}addTo(h){return this._map&&this.remove(),this._map=h,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new p.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(h){return this._lngLat=p.N.convert(h),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(h){return this.setDOMContent(document.createTextNode(h))}setHTML(h){const e=document.createDocumentFragment(),n=document.createElement("body");let a;for(n.innerHTML=h;a=n.firstChild,a;)e.appendChild(a);return this.setDOMContent(e)}getMaxWidth(){var h;return(h=this._container)===null||h===void 0?void 0:h.style.maxWidth}setMaxWidth(h){return this.options.maxWidth=h,this._update(),this}setDOMContent(h){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=se.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(h),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(h){return this._container&&this._container.classList.add(h),this}removeClassName(h){return this._container&&this._container.classList.remove(h),this}setOffset(h){return this.options.offset=h,this._update(),this}toggleClassName(h){if(this._container)return this._container.classList.toggle(h)}setSubpixelPositioning(h){this.options.subpixelPositioning=h}_createCloseButton(){this.options.closeButton&&(this._closeButton=se.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const h=this._container.querySelector(na);h&&h.focus()}},L.RasterDEMTileSource=yt,L.RasterTileSource=et,L.ScaleControl=class{constructor(h){this._onMove=()=>{gs(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,gs(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},ar),h)}getDefaultPosition(){return"bottom-left"}onAdd(h){return this._map=h,this._container=se.create("div","maplibregl-ctrl maplibregl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){se.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},L.ScrollZoomHandler=Ni,L.Style=ks,L.TerrainControl=class{constructor(h){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=h}onAdd(h){return this._map=h,this._container=se.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=se.create("button","maplibregl-ctrl-terrain",this._container),se.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){se.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},L.TwoFingersTouchPitchHandler=Cn,L.TwoFingersTouchRotateHandler=so,L.TwoFingersTouchZoomHandler=ro,L.TwoFingersTouchZoomRotateHandler=oo,L.VectorTileSource=Kn,L.VideoSource=dn,L.addSourceType=(h,e)=>p._(void 0,void 0,void 0,function*(){if(Qn(h))throw new Error(`A source type called "${h}" already exists.`);((n,a)=>{Yn[n]=a})(h,e)}),L.clearPrewarmedResources=function(){const h=ui;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(Tr),ui=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()"))},L.getMaxParallelImageRequests=function(){return p.a.MAX_PARALLEL_IMAGE_REQUESTS},L.getRTLTextPluginStatus=function(){return tr().getRTLTextPluginStatus()},L.getVersion=function(){return mo},L.getWorkerCount=function(){return Qi.workerCount},L.getWorkerUrl=function(){return p.a.WORKER_URL},L.importScriptInWorkers=function(h){return Wn().broadcast("IS",h)},L.prewarm=function(){jr().acquire(Tr)},L.setMaxParallelImageRequests=function(h){p.a.MAX_PARALLEL_IMAGE_REQUESTS=h},L.setRTLTextPlugin=function(h,e){return tr().setRTLTextPlugin(h,e)},L.setWorkerCount=function(h){Qi.workerCount=h},L.setWorkerUrl=function(h){p.a.WORKER_URL=h}});var Sa=Fr;return Sa})})(Bu);var Ou=Bu.exports;const Lp=zp(Ou),Bp=Dp({__proto__:null,default:Lp},[Ou]);export{Bp as m}; diff --git a/assets/maplibre-gl-ppNf9etY.js b/assets/maplibre-gl-ppNf9etY.js deleted file mode 100644 index 0899a7f..0000000 --- a/assets/maplibre-gl-ppNf9etY.js +++ /dev/null @@ -1,580 +0,0 @@ -import{B as kp,$ as zp}from"./index-CNMbRSP0.js";function Ep(va,Bl){for(var Or=0;OrIi[Vr]})}}}return Object.freeze(Object.defineProperty(va,Symbol.toStringTag,{value:"Module"}))}var Lu={exports:{}};/** - * MapLibre GL JS - * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.6.0/LICENSE.txt - */(function(va,Bl){(function(Or,Ii){va.exports=Ii()})(zp,function(){var Or={},Ii={};function Vr(L,p,Pi){if(Ii[L]=Pi,L==="index"){var qi="var sharedModule = {}; ("+Ii.shared+")(sharedModule); ("+Ii.worker+")(sharedModule);",Gt={};return Ii.shared(Gt),Ii.index(Or,Gt),typeof window<"u"&&Or.setWorkerUrl(window.URL.createObjectURL(new Blob([qi],{type:"text/javascript"}))),Or}}Vr("shared",["exports"],function(L){function p(i,t,r,s){return new(r||(r=Promise))(function(l,c){function d(x){try{_(s.next(x))}catch(b){c(b)}}function f(x){try{_(s.throw(x))}catch(b){c(b)}}function _(x){var b;x.done?l(x.value):(b=x.value,b instanceof r?b:new r(function(w){w(b)})).then(d,f)}_((s=s.apply(i,t||[])).next())})}function Pi(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var qi=Gt;function Gt(i,t){this.x=i,this.y=t}Gt.prototype={clone:function(){return new Gt(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,t){return this.clone()._rotateAround(i,t)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var t=i.x-this.x,r=i.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,t){return Math.atan2(this.x*t-this.y*i,this.x*i+this.y*t)},_matMult:function(i){var t=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=t,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var t=Math.cos(i),r=Math.sin(i),s=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=s,this},_rotateAround:function(i,t){var r=Math.cos(i),s=Math.sin(i),l=t.y+s*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-s*(this.y-t.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Gt.convert=function(i){return i instanceof Gt?i:Array.isArray(i)?new Gt(i[0],i[1]):i};var _e=Pi(qi),se=Nr;function Nr(i,t,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(s-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=t,this.p2x=r,this.p2y=s}Nr.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,t){if(t===void 0&&(t=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?d=r:f=r,r=.5*(f-d)+d;return r},solve:function(i,t){return this.sampleCurveY(this.solveCurveX(i,t))}};var yr=Pi(se);let Zi,xr;function ar(){return Zi==null&&(Zi=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Zi}function Ln(){if(xr==null&&(xr=!1,ar())){const t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let s=0;s<5*5;s++){const l=4*s;t.fillStyle=`rgb(${l},${l+1},${l+2})`,t.fillRect(s%5,Math.floor(s/5),1,1)}const r=t.getImageData(0,0,5,5).data;for(let s=0;s<5*5*4;s++)if(s%4!=3&&r[s]!==s){xr=!0;break}}}return xr||!1}function oi(i,t,r,s){const l=new yr(i,t,r,s);return c=>l.solve(c)}const wa=oi(.25,.1,.25,1);function Ai(i,t,r){return Math.min(r,Math.max(t,i))}function Gi(i,t,r){const s=r-t,l=((i-t)%s+s)%s+t;return l===t?r:l}function xi(i,...t){for(const r of t)for(const s in r)i[s]=r[s];return i}let Ss=1;function Hi(i,t,r){const s={};for(const l in i)s[l]=t.call(this,i[l],l,i);return s}function Rn(i,t,r){const s={};for(const l in i)t.call(this,i[l],l,i)&&(s[l]=i[l]);return s}function tt(i){return Array.isArray(i)?i.map(tt):typeof i=="object"&&i?Hi(i,tt):i}const Is={};function Lt(i){Is[i]||(typeof console<"u"&&console.warn(i),Is[i]=!0)}function Ht(i,t,r){return(r.y-i.y)*(t.x-i.x)>(t.y-i.y)*(r.x-i.x)}function or(i){return typeof WorkerGlobalScope<"u"&&i!==void 0&&i instanceof WorkerGlobalScope}let ln=null;function Xi(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const Ps="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function jr(i,t,r,s,l){return p(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const c=new VideoFrame(i,{timestamp:0});try{const d=c==null?void 0:c.format;if(!d||!d.startsWith("BGR")&&!d.startsWith("RGB"))throw new Error(`Unrecognized format ${d}`);const f=d.startsWith("BGR"),_=new Uint8ClampedArray(s*l*4);if(yield c.copyTo(_,function(x,b,w,I,M){const k=4*Math.max(-b,0),z=(Math.max(0,w)-w)*I*4+k,O=4*I,$=Math.max(0,b),Q=Math.max(0,w);return{rect:{x:$,y:Q,width:Math.min(x.width,b+I)-$,height:Math.min(x.height,w+M)-Q},layout:[{offset:z,stride:O}]}}(i,t,r,s,l)),f)for(let x=0;x<_.length;x+=4){const b=_[x];_[x]=_[x+2],_[x+2]=b}return _}finally{c.close()}})}let lr,Qt;const Mi="AbortError";function cn(){return new Error(Mi)}const vr={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Wi(i){return vr.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))]}const hn="global-dispatcher";class li extends Error{constructor(t,r,s,l){super(`AJAXError: ${r} (${t}): ${s}`),this.status=t,this.statusText=r,this.url=s,this.body=l}}const Ci=()=>or(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Ur=function(i,t){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){const s=Wi(i.url);if(s)return s(i,t);if(or(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,targetMapId:hn},t)}if(!(/^file:/.test(r=i.url)||/^file:/.test(Ci())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(s,l){return p(this,void 0,void 0,function*(){const c=new Request(s.url,{method:s.method||"GET",body:s.body,credentials:s.credentials,headers:s.headers,cache:s.cache,referrer:Ci(),signal:l.signal});s.type!=="json"||c.headers.has("Accept")||c.headers.set("Accept","application/json");const d=yield fetch(c);if(!d.ok){const x=yield d.blob();throw new li(d.status,d.statusText,s.url,x)}let f;f=s.type==="arrayBuffer"||s.type==="image"?d.arrayBuffer():s.type==="json"?d.json():d.text();const _=yield f;if(l.signal.aborted)throw cn();return{data:_,cacheControl:d.headers.get("Cache-Control"),expires:d.headers.get("Expires")}})}(i,t);if(or(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,mustQueue:!0,targetMapId:hn},t)}var r;return function(s,l){return new Promise((c,d)=>{var f;const _=new XMLHttpRequest;_.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(_.responseType="arraybuffer");for(const x in s.headers)_.setRequestHeader(x,s.headers[x]);s.type==="json"&&(_.responseType="text",!((f=s.headers)===null||f===void 0)&&f.Accept||_.setRequestHeader("Accept","application/json")),_.withCredentials=s.credentials==="include",_.onerror=()=>{d(new Error(_.statusText))},_.onload=()=>{if(!l.signal.aborted)if((_.status>=200&&_.status<300||_.status===0)&&_.response!==null){let x=_.response;if(s.type==="json")try{x=JSON.parse(_.response)}catch(b){return void d(b)}c({data:x,cacheControl:_.getResponseHeader("Cache-Control"),expires:_.getResponseHeader("Expires")})}else{const x=new Blob([_.response],{type:_.getResponseHeader("Content-Type")});d(new li(_.status,_.statusText,s.url,x))}},l.signal.addEventListener("abort",()=>{_.abort(),d(cn())}),_.send(s.body)})}(i,t)};function $r(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const t=new URL(i),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function Bn(i,t,r){r[i]&&r[i].indexOf(t)!==-1||(r[i]=r[i]||[],r[i].push(t))}function cr(i,t,r){if(r&&r[i]){const s=r[i].indexOf(t);s!==-1&&r[i].splice(s,1)}}class br{constructor(t,r={}){xi(this,r),this.type=t}}class wr extends br{constructor(t,r={}){super("error",xi({error:t},r))}}class un{on(t,r){return this._listeners=this._listeners||{},Bn(t,r,this._listeners),this}off(t,r){return cr(t,r,this._listeners),cr(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Bn(t,r,this._oneTimeListeners),this):new Promise(s=>this.once(t,s))}fire(t,r){typeof t=="string"&&(t=new br(t,r||{}));const s=t.type;if(this.listens(s)){t.target=this;const l=this._listeners&&this._listeners[s]?this._listeners[s].slice():[];for(const f of l)f.call(this,t);const c=this._oneTimeListeners&&this._oneTimeListeners[s]?this._oneTimeListeners[s].slice():[];for(const f of c)cr(s,f,this._oneTimeListeners),f.call(this,t);const d=this._eventedParent;d&&(xi(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(t))}else t instanceof wr&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,r){return this._eventedParent=t,this._eventedParentData=r,this}}var ie={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const qr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Fn(i,t){const r={};for(const s in i)s!=="ref"&&(r[s]=i[s]);return qr.forEach(s=>{s in t&&(r[s]=t[s])}),r}function Je(i,t){if(Array.isArray(i)){if(!Array.isArray(t)||i.length!==t.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${t}>`}return i.kind}const E=[Sr,ge,Ue,Le,ei,ur,ki,A(Oe),Ir,Qi,j];function V(i,t){if(t.kind==="error")return null;if(i.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!V(i.itemType,t.itemType))&&(typeof i.N!="number"||i.N===t.N))return null}else{if(i.kind===t.kind)return null;if(i.kind==="value"){for(const r of E)if(!V(r,t))return null}}return`Expected ${P(i)} but found ${P(t)} instead.`}function H(i,t){return t.some(r=>r.kind===i.kind)}function X(i,t){return t.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function J(i,t){return i.kind==="array"&&t.kind==="array"?i.itemType.kind===t.itemType.kind&&typeof i.N=="number":i.kind===t.kind}const q=.96422,ne=.82521,le=4/29,te=6/29,fe=3*te*te,ze=te*te*te,Ee=Math.PI/180,Ne=180/Math.PI;function We(i){return(i%=360)<0&&(i+=360),i}function Ve([i,t,r,s]){let l,c;const d=_t((.2225045*(i=at(i))+.7168786*(t=at(t))+.0606169*(r=at(r)))/1);i===t&&t===r?l=c=d:(l=_t((.4360747*i+.3850649*t+.1430804*r)/q),c=_t((.0139322*i+.0971045*t+.7141733*r)/ne));const f=116*d-16;return[f<0?0:f,500*(l-d),200*(d-c),s]}function at(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function _t(i){return i>ze?Math.pow(i,1/3):i/fe+le}function St([i,t,r,s]){let l=(i+16)/116,c=isNaN(t)?l:l+t/500,d=isNaN(r)?l:l-r/200;return l=1*Qe(l),c=q*Qe(c),d=ne*Qe(d),[$e(3.1338561*c-1.6168667*l-.4906146*d),$e(-.9787684*c+1.9161415*l+.033454*d),$e(.0719453*c-.2289914*l+1.4052427*d),s]}function $e(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function Qe(i){return i>te?i*i*i:fe*(i-le)}function pt(i){return parseInt(i.padEnd(2,i),16)/255}function At(i,t){return Rt(t?i/100:i,0,1)}function Rt(i,t,r){return Math.min(Math.max(t,i),r)}function Bt(i){return!i.some(Number.isNaN)}const jn={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class et{constructor(t,r,s,l=1,c=!0){this.r=t,this.g=r,this.b=s,this.a=l,c||(this.r*=l,this.g*=l,this.b*=l,l||this.overwriteGetter("rgb",[t,r,s,l]))}static parse(t){if(t instanceof et)return t;if(typeof t!="string")return;const r=function(s){if((s=s.toLowerCase().trim())==="transparent")return[0,0,0,0];const l=jn[s];if(l){const[d,f,_]=l;return[d/255,f/255,_/255,1]}if(s.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(s)){const d=s.length<6?1:2;let f=1;return[pt(s.slice(f,f+=d)),pt(s.slice(f,f+=d)),pt(s.slice(f,f+=d)),pt(s.slice(f,f+d)||"ff")]}if(s.startsWith("rgb")){const d=s.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[f,_,x,b,w,I,M,k,z,O,$,Q]=d,G=[b||" ",M||" ",O].join("");if(G===" "||G===" /"||G===",,"||G===",,,"){const K=[x,I,z].join(""),re=K==="%%%"?100:K===""?255:0;if(re){const ce=[Rt(+_/re,0,1),Rt(+w/re,0,1),Rt(+k/re,0,1),$?At(+$,Q):1];if(Bt(ce))return ce}}return}}const c=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(c){const[d,f,_,x,b,w,I,M,k]=c,z=[_||" ",b||" ",I].join("");if(z===" "||z===" /"||z===",,"||z===",,,"){const O=[+f,Rt(+x,0,100),Rt(+w,0,100),M?At(+M,k):1];if(Bt(O))return function([$,Q,G,K]){function re(ce){const be=(ce+$/30)%12,De=Q*Math.min(G,1-G);return G-De*Math.max(-1,Math.min(be-3,9-be,1))}return $=We($),Q/=100,G/=100,[re(0),re(8),re(4),K]}(O)}}}(t);return r?new et(...r,!1):void 0}get rgb(){const{r:t,g:r,b:s,a:l}=this,c=l||1/0;return this.overwriteGetter("rgb",[t/c,r/c,s/c,l])}get hcl(){return this.overwriteGetter("hcl",function(t){const[r,s,l,c]=Ve(t),d=Math.sqrt(s*s+l*l);return[Math.round(1e4*d)?We(Math.atan2(l,s)*Ne):NaN,d,r,c]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ve(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){const[t,r,s,l]=this.rgb;return`rgba(${[t,r,s].map(c=>Math.round(255*c)).join(",")},${l})`}}et.black=new et(0,0,0,1),et.white=new et(1,1,1,1),et.transparent=new et(0,0,0,0),et.red=new et(1,0,0,1);class Ta{constructor(t,r,s){this.sensitivity=t?r?"variant":"case":r?"accent":"base",this.locale=s,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,r){return this.collator.compare(t,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Sa{constructor(t,r,s,l,c){this.text=t,this.image=r,this.scale=s,this.fontStack=l,this.textColor=c}}class ci{constructor(t){this.sections=t}static fromString(t){return new ci([new Sa(t,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof ci?t:ci.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}}class hi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof hi)return t;if(typeof t=="number")return new hi([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new hi(t)}}toString(){return JSON.stringify(this.values)}}const Fl=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ui{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ui)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let r=0;r=0&&i<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?s===void 0||typeof s=="number"&&s>=0&&s<=1?null:`Invalid rgba value [${[i,t,r,s].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof s=="number"?[i,t,r,s]:[i,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Un(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof et||i instanceof Ta||i instanceof ci||i instanceof hi||i instanceof ui||i instanceof Ft)return!0;if(Array.isArray(i)){for(const t of i)if(!Un(t))return!1;return!0}if(typeof i=="object"){for(const t in i)if(!Un(i[t]))return!1;return!0}return!1}function It(i){if(i===null)return Sr;if(typeof i=="string")return Ue;if(typeof i=="boolean")return Le;if(typeof i=="number")return ge;if(i instanceof et)return ei;if(i instanceof Ta)return Yi;if(i instanceof ci)return ur;if(i instanceof hi)return Ir;if(i instanceof ui)return j;if(i instanceof Ft)return Qi;if(Array.isArray(i)){const t=i.length;let r;for(const s of i){const l=It(s);if(r){if(r===l)continue;r=Oe;break}r=l}return A(r||Oe,t)}return ki}function dr(i){const t=typeof i;return i===null?"":t==="string"||t==="number"||t==="boolean"?String(i):i instanceof et||i instanceof ci||i instanceof hi||i instanceof ui||i instanceof Ft?i.toString():JSON.stringify(i)}class Zr{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Un(t[1]))return r.error("invalid value");const s=t[1];let l=It(s);const c=r.expectedType;return l.kind!=="array"||l.N!==0||!c||c.kind!=="array"||typeof c.N=="number"&&c.N!==0||(l=c),new Zr(l,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class wt{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const Ms={string:Ue,number:ge,boolean:Le,object:ki};class bi{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let s,l=1;const c=t[0];if(c==="array"){let f,_;if(t.length>2){const x=t[1];if(typeof x!="string"||!(x in Ms)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=Ms[x],l++}else f=Oe;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);_=t[2],l++}s=A(f,_)}else{if(!Ms[c])throw new Error(`Types doesn't contain name = ${c}`);s=Ms[c]}const d=[];for(;lt.outputDefined())}}const $n={"to-boolean":Le,"to-color":ei,"to-number":ge,"to-string":Ue};class Pr{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const s=t[0];if(!$n[s])throw new Error(`Can't parse ${s} as it is not part of the known types`);if((s==="to-boolean"||s==="to-string")&&t.length!==2)return r.error("Expected one argument.");const l=$n[s],c=[];for(let d=1;d4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:As(r[0],r[1],r[2],r[3]),!s))return new et(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new wt(s||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const s of this.args){r=s.evaluate(t);const l=hi.parse(r);if(l)return l}throw new wt(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const s of this.args){r=s.evaluate(t);const l=ui.parse(r);if(l)return l}throw new wt(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const s of this.args){if(r=s.evaluate(t),r===null)return 0;const l=Number(r);if(!isNaN(l))return l}throw new wt(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return ci.fromString(dr(this.args[0].evaluate(t)));case"resolvedImage":return Ft.fromString(dr(this.args[0].evaluate(t)));default:return dr(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const Ia=["Unknown","Point","LineString","Polygon"];class qn{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ia[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let r=this._parseColorCache[t];return r||(r=this._parseColorCache[t]=et.parse(t)),r}}class Ar{constructor(t,r,s=[],l,c=new Ji,d=[]){this.registry=t,this.path=s,this.key=s.map(f=>`[${f}]`).join(""),this.scope=c,this.errors=d,this.expectedType=l,this._isConstant=r}parse(t,r,s,l,c={}){return r?this.concat(r,s,l)._parse(t,c):this._parse(t,c)}_parse(t,r){function s(l,c,d){return d==="assert"?new bi(c,[l]):d==="coerce"?new Pr(c,[l]):l}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const l=t[0];if(typeof l!="string")return this.error(`Expression name must be a string, but found ${typeof l} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const c=this.registry[l];if(c){let d=c.parse(t,this);if(!d)return null;if(this.expectedType){const f=this.expectedType,_=d.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||_.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||_.kind!=="value"&&_.kind!=="string")if(f.kind!=="padding"||_.kind!=="value"&&_.kind!=="number"&&_.kind!=="array")if(f.kind!=="variableAnchorOffsetCollection"||_.kind!=="value"&&_.kind!=="array"){if(this.checkSubtype(f,_))return null}else d=s(d,f,r.typeAnnotation||"coerce");else d=s(d,f,r.typeAnnotation||"coerce");else d=s(d,f,r.typeAnnotation||"coerce");else d=s(d,f,r.typeAnnotation||"assert")}if(!(d instanceof Zr)&&d.type.kind!=="resolvedImage"&&this._isConstant(d)){const f=new qn;try{d=new Zr(d.type,d.evaluate(f))}catch(_){return this.error(_.message),null}}return d}return this.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,r,s){const l=typeof t=="number"?this.path.concat(t):this.path,c=s?this.scope.concat(s):this.scope;return new Ar(this.registry,this._isConstant,l,r||null,c,this.errors)}error(t,...r){const s=`${this.key}${r.map(l=>`[${l}]`).join("")}`;this.errors.push(new Xt(s,t))}checkSubtype(t,r){const s=V(t,r);return s&&this.error(s),s}}class Ye{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const s=[];for(let c=1;c=s.length)throw new wt(`Array index out of bounds: ${r} > ${s.length-1}.`);if(r!==Math.floor(r))throw new wt(`Array index must be an integer, but found ${r} instead.`);return s[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Zn{constructor(t,r){this.type=Le,this.needle=t,this.haystack=r}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const s=r.parse(t[1],1,Oe),l=r.parse(t[2],2,Oe);return s&&l?H(s.type,[Le,Ue,ge,Sr,Oe])?new Zn(s,l):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${P(s.type)} instead`):null}evaluate(t){const r=this.needle.evaluate(t),s=this.haystack.evaluate(t);if(!s)return!1;if(!X(r,["boolean","string","number","null"]))throw new wt(`Expected first argument to be of type boolean, string, number or null, but found ${P(It(r))} instead.`);if(!X(s,["string","array"]))throw new wt(`Expected second argument to be of type array or string, but found ${P(It(s))} instead.`);return s.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class ks{constructor(t,r,s){this.type=ge,this.needle=t,this.haystack=r,this.fromIndex=s}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const s=r.parse(t[1],1,Oe),l=r.parse(t[2],2,Oe);if(!s||!l)return null;if(!H(s.type,[Le,Ue,ge,Sr,Oe]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${P(s.type)} instead`);if(t.length===4){const c=r.parse(t[3],3,ge);return c?new ks(s,l,c):null}return new ks(s,l)}evaluate(t){const r=this.needle.evaluate(t),s=this.haystack.evaluate(t);if(!X(r,["boolean","string","number","null"]))throw new wt(`Expected first argument to be of type boolean, string, number or null, but found ${P(It(r))} instead.`);let l;if(this.fromIndex&&(l=this.fromIndex.evaluate(t)),X(s,["string"])){const c=s.indexOf(r,l);return c===-1?-1:[...s.slice(0,c)].length}if(X(s,["array"]))return s.indexOf(r,l);throw new wt(`Expected second argument to be of type array or string, but found ${P(It(s))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class zs{constructor(t,r,s,l,c,d){this.inputType=t,this.type=r,this.input=s,this.cases=l,this.outputs=c,this.otherwise=d}static parse(t,r){if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");let s,l;r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);const c={},d=[];for(let x=2;xNumber.MAX_SAFE_INTEGER)return I.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof k=="number"&&Math.floor(k)!==k)return I.error("Numeric branch labels must be integer values.");if(s){if(I.checkSubtype(s,It(k)))return null}else s=It(k);if(c[String(k)]!==void 0)return I.error("Branch labels must be unique.");c[String(k)]=d.length}const M=r.parse(w,x,l);if(!M)return null;l=l||M.type,d.push(M)}const f=r.parse(t[1],1,Oe);if(!f)return null;const _=r.parse(t[t.length-1],t.length-1,l);return _?f.type.kind!=="value"&&r.concat(1).checkSubtype(s,f.type)?null:new zs(s,l,f,c,d,_):null}evaluate(t){const r=this.input.evaluate(t);return(It(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class Es{constructor(t,r,s){this.type=t,this.branches=r,this.otherwise=s}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let s;r.expectedType&&r.expectedType.kind!=="value"&&(s=r.expectedType);const l=[];for(let d=1;dr.outputDefined())&&this.otherwise.outputDefined()}}class Ds{constructor(t,r,s,l){this.type=t,this.input=r,this.beginIndex=s,this.endIndex=l}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const s=r.parse(t[1],1,Oe),l=r.parse(t[2],2,ge);if(!s||!l)return null;if(!H(s.type,[A(Oe),Ue,Oe]))return r.error(`Expected first argument to be of type array or string, but found ${P(s.type)} instead`);if(t.length===4){const c=r.parse(t[3],3,ge);return c?new Ds(s.type,s,l,c):null}return new Ds(s.type,s,l)}evaluate(t){const r=this.input.evaluate(t),s=this.beginIndex.evaluate(t);let l;if(this.endIndex&&(l=this.endIndex.evaluate(t)),X(r,["string"]))return[...r].slice(s,l).join("");if(X(r,["array"]))return r.slice(s,l);throw new wt(`Expected first argument to be of type array or string, but found ${P(It(r))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Gn(i,t){const r=i.length-1;let s,l,c=0,d=r,f=0;for(;c<=d;)if(f=Math.floor((c+d)/2),s=i[f],l=i[f+1],s<=t){if(f===r||tt))throw new wt("Input is not a number.");d=f-1}return 0}class pn{constructor(t,r,s){this.type=t,this.input=r,this.labels=[],this.outputs=[];for(const[l,c]of s)this.labels.push(l),this.outputs.push(c)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");const s=r.parse(t[1],1,ge);if(!s)return null;const l=[];let c=null;r.expectedType&&r.expectedType.kind!=="value"&&(c=r.expectedType);for(let d=1;d=f)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const w=r.parse(_,b,c);if(!w)return null;c=c||w.type,l.push([f,w])}return new pn(c,s,l)}evaluate(t){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(t);const l=this.input.evaluate(t);if(l<=r[0])return s[0].evaluate(t);const c=r.length;return l>=r[c-1]?s[c-1].evaluate(t):s[Gn(r,l)].evaluate(t)}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Ol(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Vl=Do;function Do(i,t,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(s-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=t,this.p2x=r,this.p2y=s}Do.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,t){if(t===void 0&&(t=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?d=r:f=r,r=.5*(f-d)+d;return r},solve:function(i,t){return this.sampleCurveY(this.solveCurveX(i,t))}};var Nl=Ol(Vl);function Mr(i,t,r){return i+r*(t-i)}function Hn(i,t,r){return i.map((s,l)=>Mr(s,t[l],r))}const di={number:Mr,color:function(i,t,r,s="rgb"){switch(s){case"rgb":{const[l,c,d,f]=Hn(i.rgb,t.rgb,r);return new et(l,c,d,f,!1)}case"hcl":{const[l,c,d,f]=i.hcl,[_,x,b,w]=t.hcl;let I,M;if(isNaN(l)||isNaN(_))isNaN(l)?isNaN(_)?I=NaN:(I=_,d!==1&&d!==0||(M=x)):(I=l,b!==1&&b!==0||(M=c));else{let Q=_-l;_>l&&Q>180?Q-=360:_180&&(Q+=360),I=l+r*Q}const[k,z,O,$]=function([Q,G,K,re]){return Q=isNaN(Q)?0:Q*Ee,St([K,Math.cos(Q)*G,Math.sin(Q)*G,re])}([I,M??Mr(c,x,r),Mr(d,b,r),Mr(f,w,r)]);return new et(k,z,O,$,!1)}case"lab":{const[l,c,d,f]=St(Hn(i.lab,t.lab,r));return new et(l,c,d,f,!1)}}},array:Hn,padding:function(i,t,r){return new hi(Hn(i.values,t.values,r))},variableAnchorOffsetCollection:function(i,t,r){const s=i.values,l=t.values;if(s.length!==l.length)throw new wt(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${t.toString()}`);const c=[];for(let d=0;dtypeof b!="number"||b<0||b>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);l={name:"cubic-bezier",controlPoints:x}}}if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(c=r.parse(c,2,ge),!c)return null;const f=[];let _=null;s==="interpolate-hcl"||s==="interpolate-lab"?_=ei:r.expectedType&&r.expectedType.kind!=="value"&&(_=r.expectedType);for(let x=0;x=b)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',I);const k=r.parse(w,M,_);if(!k)return null;_=_||k.type,f.push([b,k])}return J(_,ge)||J(_,ei)||J(_,Ir)||J(_,j)||J(_,A(ge))?new pi(_,s,l,c,f):r.error(`Type ${P(_)} is not interpolatable.`)}evaluate(t){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(t);const l=this.input.evaluate(t);if(l<=r[0])return s[0].evaluate(t);const c=r.length;if(l>=r[c-1])return s[c-1].evaluate(t);const d=Gn(r,l),f=pi.interpolationFactor(this.interpolation,l,r[d],r[d+1]),_=s[d].evaluate(t),x=s[d+1].evaluate(t);switch(this.operator){case"interpolate":return di[this.type.kind](_,x,f);case"interpolate-hcl":return di.color(_,x,f,"hcl");case"interpolate-lab":return di.color(_,x,f,"lab")}}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Xn(i,t,r,s){const l=s-r,c=i-r;return l===0?0:t===1?c/l:(Math.pow(t,c)-1)/(Math.pow(t,l)-1)}class Ls{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expectected at least one argument.");let s=null;const l=r.expectedType;l&&l.kind!=="value"&&(s=l);const c=[];for(const f of t.slice(1)){const _=r.parse(f,1+c.length,s,void 0,{typeAnnotation:"omit"});if(!_)return null;s=s||_.type,c.push(_)}if(!s)throw new Error("No output type");const d=l&&c.some(f=>V(l,f.type));return new Ls(d?Oe:s,c)}evaluate(t){let r,s=null,l=0;for(const c of this.args)if(l++,s=c.evaluate(t),s&&s instanceof Ft&&!s.available&&(r||(r=s.name),s=null,l===this.args.length&&(s=r)),s!==null)break;return s}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function Lo(i,t){return i==="=="||i==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Ro(i,t,r,s){return s.compare(t,r)===0}function Gr(i,t,r){const s=i!=="=="&&i!=="!=";return class Ru{constructor(c,d,f){this.type=Le,this.lhs=c,this.rhs=d,this.collator=f,this.hasUntypedArgument=c.type.kind==="value"||d.type.kind==="value"}static parse(c,d){if(c.length!==3&&c.length!==4)return d.error("Expected two or three arguments.");const f=c[0];let _=d.parse(c[1],1,Oe);if(!_)return null;if(!Lo(f,_.type))return d.concat(1).error(`"${f}" comparisons are not supported for type '${P(_.type)}'.`);let x=d.parse(c[2],2,Oe);if(!x)return null;if(!Lo(f,x.type))return d.concat(2).error(`"${f}" comparisons are not supported for type '${P(x.type)}'.`);if(_.type.kind!==x.type.kind&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error(`Cannot compare types '${P(_.type)}' and '${P(x.type)}'.`);s&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new bi(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new bi(_.type,[x])));let b=null;if(c.length===4){if(_.type.kind!=="string"&&x.type.kind!=="string"&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error("Cannot use collator to compare non-string types.");if(b=d.parse(c[3],3,Yi),!b)return null}return new Ru(_,x,b)}evaluate(c){const d=this.lhs.evaluate(c),f=this.rhs.evaluate(c);if(s&&this.hasUntypedArgument){const _=It(d),x=It(f);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new wt(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${_.kind}, ${x.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const _=It(d),x=It(f);if(_.kind!=="string"||x.kind!=="string")return t(c,d,f)}return this.collator?r(c,d,f,this.collator.evaluate(c)):t(c,d,f)}eachChild(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)}outputDefined(){return!0}}}const Bo=Gr("==",function(i,t,r){return t===r},Ro),jl=Gr("!=",function(i,t,r){return t!==r},function(i,t,r,s){return!Ro(0,t,r,s)}),Ul=Gr("<",function(i,t,r){return t",function(i,t,r){return t>r},function(i,t,r,s){return s.compare(t,r)>0}),Oo=Gr("<=",function(i,t,r){return t<=r},function(i,t,r,s){return s.compare(t,r)<=0}),$l=Gr(">=",function(i,t,r){return t>=r},function(i,t,r,s){return s.compare(t,r)>=0});class Rs{constructor(t,r,s){this.type=Yi,this.locale=s,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");const s=t[1];if(typeof s!="object"||Array.isArray(s))return r.error("Collator options argument must be an object.");const l=r.parse(s["case-sensitive"]!==void 0&&s["case-sensitive"],1,Le);if(!l)return null;const c=r.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,Le);if(!c)return null;let d=null;return s.locale&&(d=r.parse(s.locale,1,Ue),!d)?null:new Rs(l,c,d)}evaluate(t){return new Ta(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class Aa{constructor(t,r,s,l,c){this.type=Ue,this.number=t,this.locale=r,this.currency=s,this.minFractionDigits=l,this.maxFractionDigits=c}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");const s=r.parse(t[1],1,ge);if(!s)return null;const l=t[2];if(typeof l!="object"||Array.isArray(l))return r.error("NumberFormat options argument must be an object.");let c=null;if(l.locale&&(c=r.parse(l.locale,1,Ue),!c))return null;let d=null;if(l.currency&&(d=r.parse(l.currency,1,Ue),!d))return null;let f=null;if(l["min-fraction-digits"]&&(f=r.parse(l["min-fraction-digits"],1,ge),!f))return null;let _=null;return l["max-fraction-digits"]&&(_=r.parse(l["max-fraction-digits"],1,ge),!_)?null:new Aa(s,c,d,f,_)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Bs{constructor(t){this.type=ur,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const s=t[1];if(!Array.isArray(s)&&typeof s=="object")return r.error("First argument must be an image or text section.");const l=[];let c=!1;for(let d=1;d<=t.length-1;++d){const f=t[d];if(c&&typeof f=="object"&&!Array.isArray(f)){c=!1;let _=null;if(f["font-scale"]&&(_=r.parse(f["font-scale"],1,ge),!_))return null;let x=null;if(f["text-font"]&&(x=r.parse(f["text-font"],1,A(Ue)),!x))return null;let b=null;if(f["text-color"]&&(b=r.parse(f["text-color"],1,ei),!b))return null;const w=l[l.length-1];w.scale=_,w.font=x,w.textColor=b}else{const _=r.parse(t[d],1,Oe);if(!_)return null;const x=_.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");c=!0,l.push({content:_,scale:null,font:null,textColor:null})}}return new Bs(l)}evaluate(t){return new ci(this.sections.map(r=>{const s=r.content.evaluate(t);return It(s)===Qi?new Sa("",s,null,null,null):new Sa(dr(s),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null)}))}eachChild(t){for(const r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}outputDefined(){return!1}}class Ma{constructor(t){this.type=Qi,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");const s=r.parse(t[1],1,Ue);return s?new Ma(s):r.error("No image name provided.")}evaluate(t){const r=this.input.evaluate(t),s=Ft.fromString(r);return s&&t.availableImages&&(s.available=t.availableImages.indexOf(r)>-1),s}eachChild(t){t(this.input)}outputDefined(){return!1}}class Ca{constructor(t){this.type=ge,this.input=t}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);const s=r.parse(t[1],1);return s?s.type.kind!=="array"&&s.type.kind!=="string"&&s.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${P(s.type)} instead.`):new Ca(s):null}evaluate(t){const r=this.input.evaluate(t);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new wt(`Expected value to be of type string or array, but found ${P(It(r))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const er=8192;function ka(i,t){const r=(180+i[0])/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,l=Math.pow(2,t.z);return[Math.round(r*l*er),Math.round(s*l*er)]}function fn(i,t){const r=Math.pow(2,t.z);return[(l=(i[0]/er+t.x)/r,360*l-180),(s=(i[1]/er+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90)];var s,l}function Xe(i,t){i[0]=Math.min(i[0],t[0]),i[1]=Math.min(i[1],t[1]),i[2]=Math.max(i[2],t[0]),i[3]=Math.max(i[3],t[1])}function Wn(i,t){return!(i[0]<=t[0]||i[2]>=t[2]||i[1]<=t[1]||i[3]>=t[3])}function ql(i,t,r){const s=i[0]-t[0],l=i[1]-t[1],c=i[0]-r[0],d=i[1]-r[1];return s*d-c*l==0&&s*c<=0&&l*d<=0}function Fs(i,t,r,s){return(l=[s[0]-r[0],s[1]-r[1]])[0]*(c=[t[0]-i[0],t[1]-i[1]])[1]-l[1]*c[0]!=0&&!(!No(i,t,r,s)||!No(r,s,i,t));var l,c}function Zl(i,t,r){for(const s of r)for(let l=0;l(l=i)[1]!=(d=f[_+1])[1]>l[1]&&l[0]<(d[0]-c[0])*(l[1]-c[1])/(d[1]-c[1])+c[0]&&(s=!s)}var l,c,d;return s}function Gl(i,t){for(const r of t)if(mn(i,r))return!0;return!1}function Vo(i,t){for(const r of i)if(!mn(r,t))return!1;for(let r=0;r0&&f<0||d<0&&f>0}function za(i,t,r){const s=[];for(let l=0;lr[2]){const l=.5*s;let c=i[0]-r[0]>l?-s:r[0]-i[0]>l?s:0;c===0&&(c=i[0]-r[2]>l?-s:r[2]-i[0]>l?s:0),i[0]+=c}Xe(t,i)}function $o(i,t,r,s){const l=Math.pow(2,s.z)*er,c=[s.x*er,s.y*er],d=[];for(const f of i)for(const _ of f){const x=[_.x+c[0],_.y+c[1]];Uo(x,t,r,l),d.push(x)}return d}function qo(i,t,r,s){const l=Math.pow(2,s.z)*er,c=[s.x*er,s.y*er],d=[];for(const _ of i){const x=[];for(const b of _){const w=[b.x+c[0],b.y+c[1]];Xe(t,w),x.push(w)}d.push(x)}if(t[2]-t[0]<=l/2){(f=t)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const _ of d)for(const x of _)Uo(x,t,r,l)}var f;return d}class Hr{constructor(t,r){this.type=Le,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Un(t[1])){const s=t[1];if(s.type==="FeatureCollection"){const l=[];for(const c of s.features){const{type:d,coordinates:f}=c.geometry;d==="Polygon"&&l.push(f),d==="MultiPolygon"&&l.push(...f)}if(l.length)return new Hr(s,{type:"MultiPolygon",coordinates:l})}else if(s.type==="Feature"){const l=s.geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new Hr(s,s.geometry)}else if(s.type==="Polygon"||s.type==="MultiPolygon")return new Hr(s,s)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(r,s){const l=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(s.type==="Polygon"){const f=za(s.coordinates,c,d),_=$o(r.geometry(),l,c,d);if(!Wn(l,c))return!1;for(const x of _)if(!mn(x,f))return!1}if(s.type==="MultiPolygon"){const f=jo(s.coordinates,c,d),_=$o(r.geometry(),l,c,d);if(!Wn(l,c))return!1;for(const x of _)if(!Gl(x,f))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(r,s){const l=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(s.type==="Polygon"){const f=za(s.coordinates,c,d),_=qo(r.geometry(),l,c,d);if(!Wn(l,c))return!1;for(const x of _)if(!Vo(x,f))return!1}if(s.type==="MultiPolygon"){const f=jo(s.coordinates,c,d),_=qo(r.geometry(),l,c,d);if(!Wn(l,c))return!1;for(const x of _)if(!Hl(x,f))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Zo=class{constructor(i=[],t=(r,s)=>rs?1:0){if(this.data=i,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(i){this.data.push(i),this._up(this.length++)}pop(){if(this.length===0)return;const i=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),i}peek(){return this.data[0]}_up(i){const{data:t,compare:r}=this,s=t[i];for(;i>0;){const l=i-1>>1,c=t[l];if(r(s,c)>=0)break;t[i]=c,i=l}t[i]=s}_down(i){const{data:t,compare:r}=this,s=this.length>>1,l=t[i];for(;i=0)break;t[i]=t[c],i=c}t[i]=l}};function Xl(i,t,r,s,l){Go(i,t,r,s||i.length-1,l||Wl)}function Go(i,t,r,s,l){for(;s>r;){if(s-r>600){var c=s-r+1,d=t-r+1,f=Math.log(c),_=.5*Math.exp(2*f/3),x=.5*Math.sqrt(f*_*(c-_)/c)*(d-c/2<0?-1:1);Go(i,t,Math.max(r,Math.floor(t-d*_/c+x)),Math.min(s,Math.floor(t+(c-d)*_/c+x)),l)}var b=i[t],w=r,I=s;for(Kn(i,r,t),l(i[s],b)>0&&Kn(i,r,s);w0;)I--}l(i[r],b)===0?Kn(i,r,I):Kn(i,++I,s),I<=t&&(r=I+1),t<=I&&(s=I-1)}}function Kn(i,t,r){var s=i[t];i[t]=i[r],i[r]=s}function Wl(i,t){return it?1:0}function Os(i,t){if(i.length<=1)return[i];const r=[];let s,l;for(const c of i){const d=Jl(c);d!==0&&(c.area=Math.abs(d),l===void 0&&(l=d<0),l===d<0?(s&&r.push(s),s=[c]):s.push(c))}if(s&&r.push(s),t>1)for(let c=0;c1?(x=t[_+1][0],b=t[_+1][1]):M>0&&(x+=w/this.kx*M,b+=I/this.ky*M)),w=this.wrap(r[0]-x)*this.kx,I=(r[1]-b)*this.ky;const k=w*w+I*I;k180;)t-=360;return t}}function Ko(i,t){return t[0]-i[0]}function Vs(i){return i[1]-i[0]+1}function pr(i,t){return i[1]>=i[0]&&i[1]i[1])return[null,null];const r=Vs(i);if(t){if(r===2)return[i,null];const l=Math.floor(r/2);return[[i[0],i[0]+l],[i[0]+l,i[1]]]}if(r===1)return[i,null];const s=Math.floor(r/2)-1;return[[i[0],i[0]+s],[i[0]+s+1,i[1]]]}function Jn(i,t){if(!pr(t,i.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let s=t[0];s<=t[1];++s)Xe(r,i[s]);return r}function La(i){const t=[1/0,1/0,-1/0,-1/0];for(const r of i)for(const s of r)Xe(t,s);return t}function Jo(i){return i[0]!==-1/0&&i[1]!==-1/0&&i[2]!==1/0&&i[3]!==1/0}function Ra(i,t,r){if(!Jo(i)||!Jo(t))return NaN;let s=0,l=0;return i[2]t[2]&&(s=i[0]-t[2]),i[1]>t[3]&&(l=i[1]-t[3]),i[3]=s)return s;if(Wn(l,c)){if(ot(i,t))return 0}else if(ot(t,i))return 0;let d=1/0;for(const f of i)for(let _=0,x=f.length,b=x-1;_0;){const _=d.pop();if(_[0]>=c)continue;const x=_[1],b=t?50:100;if(Vs(x)<=b){if(!pr(x,i.length))return NaN;if(t){const w=ft(i,x,r,s);if(isNaN(w)||w===0)return w;c=Math.min(c,w)}else for(let w=x[0];w<=x[1];++w){const I=Ba(i[w],r,s);if(c=Math.min(c,I),c===0)return 0}}else{const w=Da(x,t);Fa(d,c,s,i,f,w[0]),Fa(d,c,s,i,f,w[1])}}return c}function Us(i,t,r,s,l,c=1/0){let d=Math.min(c,l.distance(i[0],r[0]));if(d===0)return d;const f=new Zo([[0,[0,i.length-1],[0,r.length-1]]],Ko);for(;f.length>0;){const _=f.pop();if(_[0]>=d)continue;const x=_[1],b=_[2],w=t?50:100,I=s?50:100;if(Vs(x)<=w&&Vs(b)<=I){if(!pr(x,i.length)&&pr(b,r.length))return NaN;let M;if(t&&s)M=Yl(i,x,r,b,l),d=Math.min(d,M);else if(t&&!s){const k=i.slice(x[0],x[1]+1);for(let z=b[0];z<=b[1];++z)if(M=Xr(r[z],k,l),d=Math.min(d,M),d===0)return d}else if(!t&&s){const k=r.slice(b[0],b[1]+1);for(let z=x[0];z<=x[1];++z)if(M=Xr(i[z],k,l),d=Math.min(d,M),d===0)return d}else M=Ze(i,x,r,b,l),d=Math.min(d,M)}else{const M=Da(x,t),k=Da(b,s);Yn(f,d,l,i,r,M[0],k[0]),Yn(f,d,l,i,r,M[0],k[1]),Yn(f,d,l,i,r,M[1],k[0]),Yn(f,d,l,i,r,M[1],k[1])}}return d}function Oa(i){return i.type==="MultiPolygon"?i.coordinates.map(t=>({type:"Polygon",coordinates:t})):i.type==="MultiLineString"?i.coordinates.map(t=>({type:"LineString",coordinates:t})):i.type==="MultiPoint"?i.coordinates.map(t=>({type:"Point",coordinates:t})):[i]}class Wr{constructor(t,r){this.type=ge,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Un(t[1])){const s=t[1];if(s.type==="FeatureCollection")return new Wr(s,s.features.map(l=>Oa(l.geometry)).flat());if(s.type==="Feature")return new Wr(s,Oa(s.geometry));if("type"in s&&"coordinates"in s)return new Wr(s,Oa(s))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(r,s){const l=r.geometry(),c=l.flat().map(_=>fn([_.x,_.y],r.canonical));if(l.length===0)return NaN;const d=new Ea(c[0][1]);let f=1/0;for(const _ of s){switch(_.type){case"Point":f=Math.min(f,Us(c,!1,[_.coordinates],!1,d,f));break;case"LineString":f=Math.min(f,Us(c,!1,_.coordinates,!0,d,f));break;case"Polygon":f=Math.min(f,js(c,!1,_.coordinates,d,f))}if(f===0)return f}return f}(t,this.geometries);if(t.geometryType()==="LineString")return function(r,s){const l=r.geometry(),c=l.flat().map(_=>fn([_.x,_.y],r.canonical));if(l.length===0)return NaN;const d=new Ea(c[0][1]);let f=1/0;for(const _ of s){switch(_.type){case"Point":f=Math.min(f,Us(c,!0,[_.coordinates],!1,d,f));break;case"LineString":f=Math.min(f,Us(c,!0,_.coordinates,!0,d,f));break;case"Polygon":f=Math.min(f,js(c,!0,_.coordinates,d,f))}if(f===0)return f}return f}(t,this.geometries);if(t.geometryType()==="Polygon")return function(r,s){const l=r.geometry();if(l.length===0||l[0].length===0)return NaN;const c=Os(l,0).map(_=>_.map(x=>x.map(b=>fn([b.x,b.y],r.canonical)))),d=new Ea(c[0][0][0][1]);let f=1/0;for(const _ of s)for(const x of c){switch(_.type){case"Point":f=Math.min(f,js([_.coordinates],!1,x,d,f));break;case"LineString":f=Math.min(f,js(_.coordinates,!0,x,d,f));break;case"Polygon":f=Math.min(f,Ns(x,_.coordinates,d,f))}if(f===0)return f}return f}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Kr={"==":Bo,"!=":jl,">":Fo,"<":Ul,">=":$l,"<=":Oo,array:bi,at:Pa,boolean:bi,case:Es,coalesce:Ls,collator:Rs,format:Bs,image:Ma,in:Zn,"index-of":ks,interpolate:pi,"interpolate-hcl":pi,"interpolate-lab":pi,length:Ca,let:Ye,literal:Zr,match:zs,number:bi,"number-format":Aa,object:bi,slice:Ds,step:pn,string:bi,"to-boolean":Pr,"to-color":Pr,"to-number":Pr,"to-string":Pr,var:Cs,within:Hr,distance:Wr};class fi{constructor(t,r,s,l){this.name=t,this.type=r,this._evaluate=s,this.args=l}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){const s=t[0],l=fi.definitions[s];if(!l)return r.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0);const c=Array.isArray(l)?l[0]:l.type,d=Array.isArray(l)?[[l[1],l[2]]]:l.overloads,f=d.filter(([x])=>!Array.isArray(x)||x.length===t.length-1);let _=null;for(const[x,b]of f){_=new Ar(r.registry,$s,r.path,null,r.scope);const w=[];let I=!1;for(let M=1;M{return I=w,Array.isArray(I)?`(${I.map(P).join(", ")})`:`(${P(I.type)}...)`;var I}).join(" | "),b=[];for(let w=1;w{r=t?r&&$s(s):r&&s instanceof Zr}),!!r&&qs(i)&&Zs(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function qs(i){if(i instanceof fi&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof Hr||i instanceof Wr)return!1;let t=!0;return i.eachChild(r=>{t&&!qs(r)&&(t=!1)}),t}function es(i){if(i instanceof fi&&i.name==="feature-state")return!1;let t=!0;return i.eachChild(r=>{t&&!es(r)&&(t=!1)}),t}function Zs(i,t){if(i instanceof fi&&t.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(s=>{r&&!Zs(s,t)&&(r=!1)}),r}function Yo(i){return{result:"success",value:i}}function _n(i){return{result:"error",value:i}}function gn(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function ja(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Gs(i){return!!i.expression&&i.expression.interpolated}function He(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function Hs(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Qo(i){return i}function Ua(i,t){const r=t.type==="color",s=i.stops&&typeof i.stops[0][0]=="object",l=s||!(s||i.property!==void 0),c=i.type||(Gs(t)?"exponential":"interval");if(r||t.type==="padding"){const b=r?et.parse:hi.parse;(i=Ki({},i)).stops&&(i.stops=i.stops.map(w=>[w[0],b(w[1])])),i.default=b(i.default?i.default:t.default)}if(i.colorSpace&&(d=i.colorSpace)!=="rgb"&&d!=="hcl"&&d!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var d;let f,_,x;if(c==="exponential")f=is;else if(c==="interval")f=Xs;else if(c==="categorical"){f=$a,_=Object.create(null);for(const b of i.stops)_[b[0]]=b[1];x=typeof i.stops[0][0]}else{if(c!=="identity")throw new Error(`Unknown function type "${c}"`);f=el}if(s){const b={},w=[];for(let k=0;kk[0]),evaluate:({zoom:k},z)=>is({stops:I,base:i.base},t,k).evaluate(k,z)}}if(l){const b=c==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:pi.interpolationFactor.bind(void 0,b),zoomStops:i.stops.map(w=>w[0]),evaluate:({zoom:w})=>f(i,t,w,_,x)}}return{kind:"source",evaluate(b,w){const I=w&&w.properties?w.properties[i.property]:void 0;return I===void 0?ts(i.default,t.default):f(i,t,I,_,x)}}}function ts(i,t,r){return i!==void 0?i:t!==void 0?t:r!==void 0?r:void 0}function $a(i,t,r,s,l){return ts(typeof r===l?s[r]:void 0,i.default,t.default)}function Xs(i,t,r){if(He(r)!=="number")return ts(i.default,t.default);const s=i.stops.length;if(s===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[s-1][0])return i.stops[s-1][1];const l=Gn(i.stops.map(c=>c[0]),r);return i.stops[l][1]}function is(i,t,r){const s=i.base!==void 0?i.base:1;if(He(r)!=="number")return ts(i.default,t.default);const l=i.stops.length;if(l===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[l-1][0])return i.stops[l-1][1];const c=Gn(i.stops.map(b=>b[0]),r),d=function(b,w,I,M){const k=M-I,z=b-I;return k===0?0:w===1?z/k:(Math.pow(w,z)-1)/(Math.pow(w,k)-1)}(r,s,i.stops[c][0],i.stops[c+1][0]),f=i.stops[c][1],_=i.stops[c+1][1],x=di[t.type]||Qo;return typeof f.evaluate=="function"?{evaluate(...b){const w=f.evaluate.apply(void 0,b),I=_.evaluate.apply(void 0,b);if(w!==void 0&&I!==void 0)return x(w,I,d,i.colorSpace)}}:x(f,_,d,i.colorSpace)}function el(i,t,r){switch(t.type){case"color":r=et.parse(r);break;case"formatted":r=ci.fromString(r.toString());break;case"resolvedImage":r=Ft.fromString(r.toString());break;case"padding":r=hi.parse(r);break;default:He(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0)}return ts(r,i.default,t.default)}fi.register(Kr,{error:[{kind:"error"},[Ue],(i,[t])=>{throw new wt(t.evaluate(i))}],typeof:[Ue,[Oe],(i,[t])=>P(It(t.evaluate(i)))],"to-rgba":[A(ge,4),[ei],(i,[t])=>{const[r,s,l,c]=t.evaluate(i).rgb;return[255*r,255*s,255*l,c]}],rgb:[ei,[ge,ge,ge],Va],rgba:[ei,[ge,ge,ge,ge],Va],has:{type:Le,overloads:[[[Ue],(i,[t])=>Na(t.evaluate(i),i.properties())],[[Ue,ki],(i,[t,r])=>Na(t.evaluate(i),r.evaluate(i))]]},get:{type:Oe,overloads:[[[Ue],(i,[t])=>Qn(t.evaluate(i),i.properties())],[[Ue,ki],(i,[t,r])=>Qn(t.evaluate(i),r.evaluate(i))]]},"feature-state":[Oe,[Ue],(i,[t])=>Qn(t.evaluate(i),i.featureState||{})],properties:[ki,[],i=>i.properties()],"geometry-type":[Ue,[],i=>i.geometryType()],id:[Oe,[],i=>i.id()],zoom:[ge,[],i=>i.globals.zoom],"heatmap-density":[ge,[],i=>i.globals.heatmapDensity||0],"line-progress":[ge,[],i=>i.globals.lineProgress||0],accumulated:[Oe,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[ge,Jr(ge),(i,t)=>{let r=0;for(const s of t)r+=s.evaluate(i);return r}],"*":[ge,Jr(ge),(i,t)=>{let r=1;for(const s of t)r*=s.evaluate(i);return r}],"-":{type:ge,overloads:[[[ge,ge],(i,[t,r])=>t.evaluate(i)-r.evaluate(i)],[[ge],(i,[t])=>-t.evaluate(i)]]},"/":[ge,[ge,ge],(i,[t,r])=>t.evaluate(i)/r.evaluate(i)],"%":[ge,[ge,ge],(i,[t,r])=>t.evaluate(i)%r.evaluate(i)],ln2:[ge,[],()=>Math.LN2],pi:[ge,[],()=>Math.PI],e:[ge,[],()=>Math.E],"^":[ge,[ge,ge],(i,[t,r])=>Math.pow(t.evaluate(i),r.evaluate(i))],sqrt:[ge,[ge],(i,[t])=>Math.sqrt(t.evaluate(i))],log10:[ge,[ge],(i,[t])=>Math.log(t.evaluate(i))/Math.LN10],ln:[ge,[ge],(i,[t])=>Math.log(t.evaluate(i))],log2:[ge,[ge],(i,[t])=>Math.log(t.evaluate(i))/Math.LN2],sin:[ge,[ge],(i,[t])=>Math.sin(t.evaluate(i))],cos:[ge,[ge],(i,[t])=>Math.cos(t.evaluate(i))],tan:[ge,[ge],(i,[t])=>Math.tan(t.evaluate(i))],asin:[ge,[ge],(i,[t])=>Math.asin(t.evaluate(i))],acos:[ge,[ge],(i,[t])=>Math.acos(t.evaluate(i))],atan:[ge,[ge],(i,[t])=>Math.atan(t.evaluate(i))],min:[ge,Jr(ge),(i,t)=>Math.min(...t.map(r=>r.evaluate(i)))],max:[ge,Jr(ge),(i,t)=>Math.max(...t.map(r=>r.evaluate(i)))],abs:[ge,[ge],(i,[t])=>Math.abs(t.evaluate(i))],round:[ge,[ge],(i,[t])=>{const r=t.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[ge,[ge],(i,[t])=>Math.floor(t.evaluate(i))],ceil:[ge,[ge],(i,[t])=>Math.ceil(t.evaluate(i))],"filter-==":[Le,[Ue,Oe],(i,[t,r])=>i.properties()[t.value]===r.value],"filter-id-==":[Le,[Oe],(i,[t])=>i.id()===t.value],"filter-type-==":[Le,[Ue],(i,[t])=>i.geometryType()===t.value],"filter-<":[Le,[Ue,Oe],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s{const r=i.id(),s=t.value;return typeof r==typeof s&&r":[Le,[Ue,Oe],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s>l}],"filter-id->":[Le,[Oe],(i,[t])=>{const r=i.id(),s=t.value;return typeof r==typeof s&&r>s}],"filter-<=":[Le,[Ue,Oe],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s<=l}],"filter-id-<=":[Le,[Oe],(i,[t])=>{const r=i.id(),s=t.value;return typeof r==typeof s&&r<=s}],"filter->=":[Le,[Ue,Oe],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s>=l}],"filter-id->=":[Le,[Oe],(i,[t])=>{const r=i.id(),s=t.value;return typeof r==typeof s&&r>=s}],"filter-has":[Le,[Oe],(i,[t])=>t.value in i.properties()],"filter-has-id":[Le,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Le,[A(Ue)],(i,[t])=>t.value.indexOf(i.geometryType())>=0],"filter-id-in":[Le,[A(Oe)],(i,[t])=>t.value.indexOf(i.id())>=0],"filter-in-small":[Le,[Ue,A(Oe)],(i,[t,r])=>r.value.indexOf(i.properties()[t.value])>=0],"filter-in-large":[Le,[Ue,A(Oe)],(i,[t,r])=>function(s,l,c,d){for(;c<=d;){const f=c+d>>1;if(l[f]===s)return!0;l[f]>s?d=f-1:c=f+1}return!1}(i.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Le,overloads:[[[Le,Le],(i,[t,r])=>t.evaluate(i)&&r.evaluate(i)],[Jr(Le),(i,t)=>{for(const r of t)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Le,overloads:[[[Le,Le],(i,[t,r])=>t.evaluate(i)||r.evaluate(i)],[Jr(Le),(i,t)=>{for(const r of t)if(r.evaluate(i))return!0;return!1}]]},"!":[Le,[Le],(i,[t])=>!t.evaluate(i)],"is-supported-script":[Le,[Ue],(i,[t])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(t.evaluate(i))}],upcase:[Ue,[Ue],(i,[t])=>t.evaluate(i).toUpperCase()],downcase:[Ue,[Ue],(i,[t])=>t.evaluate(i).toLowerCase()],concat:[Ue,Jr(Oe),(i,t)=>t.map(r=>dr(r.evaluate(i))).join("")],"resolved-locale":[Ue,[Yi],(i,[t])=>t.evaluate(i).resolvedLocale()]});class rs{constructor(t,r){var s;this.expression=t,this._warningHistory={},this._evaluator=new qn,this._defaultValue=r?(s=r).type==="color"&&Hs(s.default)?new et(0,0,0,0):s.type==="color"?et.parse(s.default)||null:s.type==="padding"?hi.parse(s.default)||null:s.type==="variableAnchorOffsetCollection"?ui.parse(s.default)||null:s.default===void 0?null:s.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(t,r,s,l,c,d){return this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=s,this._evaluator.canonical=l,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(t,r,s,l,c,d){this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=s||null,this._evaluator.canonical=l,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=d||null;try{const f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new wt(`Expected value to be one of ${Object.keys(this._enumValues).map(_=>JSON.stringify(_)).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function ns(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Kr}function ss(i,t){const r=new Ar(Kr,$s,[],t?function(l){const c={color:ei,string:Ue,number:ge,enum:Ue,boolean:Le,formatted:ur,padding:Ir,resolvedImage:Qi,variableAnchorOffsetCollection:j};return l.type==="array"?A(c[l.value]||Oe,l.length):c[l.type]}(t):void 0),s=r.parse(i,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?Yo(new rs(s,t)):_n(r.errors)}class yn{constructor(t,r){this.kind=t,this._styleExpression=r,this.isStateDependent=t!=="constant"&&!es(r.expression)}evaluateWithoutErrorHandling(t,r,s,l,c,d){return this._styleExpression.evaluateWithoutErrorHandling(t,r,s,l,c,d)}evaluate(t,r,s,l,c,d){return this._styleExpression.evaluate(t,r,s,l,c,d)}}class qa{constructor(t,r,s,l){this.kind=t,this.zoomStops=s,this._styleExpression=r,this.isStateDependent=t!=="camera"&&!es(r.expression),this.interpolationType=l}evaluateWithoutErrorHandling(t,r,s,l,c,d){return this._styleExpression.evaluateWithoutErrorHandling(t,r,s,l,c,d)}evaluate(t,r,s,l,c,d){return this._styleExpression.evaluate(t,r,s,l,c,d)}interpolationFactor(t,r,s){return this.interpolationType?pi.interpolationFactor(this.interpolationType,t,r,s):0}}function tl(i,t){const r=ss(i,t);if(r.result==="error")return r;const s=r.value.expression,l=qs(s);if(!l&&!gn(t))return _n([new Xt("","data expressions not supported")]);const c=Zs(s,["zoom"]);if(!c&&!ja(t))return _n([new Xt("","zoom expressions not supported")]);const d=Ks(s);return d||c?d instanceof Xt?_n([d]):d instanceof pi&&!Gs(t)?_n([new Xt("",'"interpolate" expressions cannot be used with this property')]):Yo(d?new qa(l?"camera":"composite",r.value,d.labels,d instanceof pi?d.interpolation:void 0):new yn(l?"constant":"source",r.value)):_n([new Xt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ws{constructor(t,r){this._parameters=t,this._specification=r,Ki(this,Ua(this._parameters,this._specification))}static deserialize(t){return new Ws(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Ks(i){let t=null;if(i instanceof Ye)t=Ks(i.result);else if(i instanceof Ls){for(const r of i.args)if(t=Ks(r),t)break}else(i instanceof pn||i instanceof pi)&&i.input instanceof fi&&i.input.name==="zoom"&&(t=i);return t instanceof Xt||i.eachChild(r=>{const s=Ks(r);s instanceof Xt?t=s:!t&&s?t=new Xt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&s&&t!==s&&(t=new Xt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function Za(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const t of i.slice(1))if(!Za(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const Js={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function xn(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Za(i)||(i=as(i));const t=ss(i,Js);if(t.result==="error")throw new Error(t.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,s,l)=>t.value.evaluate(r,s,{},l),needGeometry:vn(i)}}function mi(i,t){return it?1:0}function vn(i){if(!Array.isArray(i))return!1;if(i[0]==="within"||i[0]==="distance")return!0;for(let t=1;t"||t==="<="||t===">="?Ga(i[1],i[2],t):t==="any"?(r=i.slice(1),["any"].concat(r.map(as))):t==="all"?["all"].concat(i.slice(1).map(as)):t==="none"?["all"].concat(i.slice(1).map(as).map(os)):t==="in"?il(i[1],i.slice(2)):t==="!in"?os(il(i[1],i.slice(2))):t==="has"?bn(i[1]):t!=="!has"||os(bn(i[1]));var r}function Ga(i,t,r){switch(i){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,i,t]}}function il(i,t){if(t.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(r=>typeof r!=typeof t[0])?["filter-in-large",i,["literal",t.sort(mi)]]:["filter-in-small",i,["literal",t]]}}function bn(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function os(i){return["!",i]}function ls(i){const t=typeof i;if(t==="number"||t==="boolean"||t==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let l="[";for(const c of i)l+=`${ls(c)},`;return`${l}]`}const r=Object.keys(i).sort();let s="{";for(let l=0;ls.maximum?[new pe(t,r,`${r} is greater than the maximum value ${s.maximum}`)]:[]}function ea(i){const t=i.valueSpec,r=vt(i.value.type);let s,l,c,d={};const f=r!=="categorical"&&i.value.property===void 0,_=!f,x=He(i.value.stops)==="array"&&He(i.value.stops[0])==="array"&&He(i.value.stops[0][0])==="object",b=wi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(M){if(r==="identity")return[new pe(M.key,M.value,'identity function may not have a "stops" property')];let k=[];const z=M.value;return k=k.concat(cs({key:M.key,value:z,valueSpec:M.valueSpec,validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec,arrayElementValidator:w})),He(z)==="array"&&z.length===0&&k.push(new pe(M.key,z,"array must have at least one stop")),k},default:function(M){return M.validateSpec({key:M.key,value:M.value,valueSpec:t,validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec})}}});return r==="identity"&&f&&b.push(new pe(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||b.push(new pe(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Gs(i.valueSpec)&&b.push(new pe(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(_&&!gn(i.valueSpec)?b.push(new pe(i.key,i.value,"property functions not supported")):f&&!ja(i.valueSpec)&&b.push(new pe(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||b.push(new pe(i.key,i.value,'"property" property is required')),b;function w(M){let k=[];const z=M.value,O=M.key;if(He(z)!=="array")return[new pe(O,z,`array expected, ${He(z)} found`)];if(z.length!==2)return[new pe(O,z,`array length 2 expected, length ${z.length} found`)];if(x){if(He(z[0])!=="object")return[new pe(O,z,`object expected, ${He(z[0])} found`)];if(z[0].zoom===void 0)return[new pe(O,z,"object stop key must have zoom")];if(z[0].value===void 0)return[new pe(O,z,"object stop key must have value")];if(c&&c>vt(z[0].zoom))return[new pe(O,z[0].zoom,"stop zoom values must appear in ascending order")];vt(z[0].zoom)!==c&&(c=vt(z[0].zoom),l=void 0,d={}),k=k.concat(wi({key:`${O}[0]`,value:z[0],valueSpec:{zoom:{}},validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec,objectElementValidators:{zoom:Qs,value:I}}))}else k=k.concat(I({key:`${O}[0]`,value:z[0],valueSpec:{},validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec},z));return ns(zi(z[1]))?k.concat([new pe(`${O}[1]`,z[1],"expressions are not allowed in function stops.")]):k.concat(M.validateSpec({key:`${O}[1]`,value:z[1],valueSpec:t,validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec}))}function I(M,k){const z=He(M.value),O=vt(M.value),$=M.value!==null?M.value:k;if(s){if(z!==s)return[new pe(M.key,$,`${z} stop domain type must match previous stop domain type ${s}`)]}else s=z;if(z!=="number"&&z!=="string"&&z!=="boolean")return[new pe(M.key,$,"stop domain value must be a number, string, or boolean")];if(z!=="number"&&r!=="categorical"){let Q=`number expected, ${z} found`;return gn(t)&&r===void 0&&(Q+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new pe(M.key,$,Q)]}return r!=="categorical"||z!=="number"||isFinite(O)&&Math.floor(O)===O?r!=="categorical"&&z==="number"&&l!==void 0&&Onew pe(`${i.key}${s.key}`,i.value,s.message));const r=t.value.expression||t.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new pe(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!es(r))return[new pe(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!es(r))return[new pe(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Zs(r,["zoom","feature-state"]))return[new pe(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!qs(r))return[new pe(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function wn(i){const t=i.key,r=i.value,s=i.valueSpec,l=[];return Array.isArray(s.values)?s.values.indexOf(vt(r))===-1&&l.push(new pe(t,r,`expected one of [${s.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(s.values).indexOf(vt(r))===-1&&l.push(new pe(t,r,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(r)} found`)),l}function Ha(i){return Za(zi(i.value))?Yr(Ki({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ta(i)}function ta(i){const t=i.value,r=i.key;if(He(t)!=="array")return[new pe(r,t,`array expected, ${He(t)} found`)];const s=i.styleSpec;let l,c=[];if(t.length<1)return[new pe(r,t,"filter array must have at least 1 element")];switch(c=c.concat(wn({key:`${r}[0]`,value:t[0],valueSpec:s.filter_operator,style:i.style,styleSpec:i.styleSpec})),vt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&vt(t[1])==="$type"&&c.push(new pe(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&c.push(new pe(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(l=He(t[1]),l!=="string"&&c.push(new pe(`${r}[1]`,t[1],`string expected, ${l} found`)));for(let d=2;d{x in r&&t.push(new pe(s,r[x],`"${x}" is prohibited for ref layers`))}),l.layers.forEach(x=>{vt(x.id)===f&&(_=x)}),_?_.ref?t.push(new pe(s,r.ref,"ref cannot reference another ref layer")):d=vt(_.type):t.push(new pe(s,r.ref,`ref layer "${f}" not found`))}else if(d!=="background")if(r.source){const _=l.sources&&l.sources[r.source],x=_&&vt(_.type);_?x==="vector"&&d==="raster"?t.push(new pe(s,r.source,`layer "${r.id}" requires a raster source`)):x!=="raster-dem"&&d==="hillshade"?t.push(new pe(s,r.source,`layer "${r.id}" requires a raster-dem source`)):x==="raster"&&d!=="raster"?t.push(new pe(s,r.source,`layer "${r.id}" requires a vector source`)):x!=="vector"||r["source-layer"]?x==="raster-dem"&&d!=="hillshade"?t.push(new pe(s,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):d!=="line"||!r.paint||!r.paint["line-gradient"]||x==="geojson"&&_.lineMetrics||t.push(new pe(s,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new pe(s,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new pe(s,r.source,`source "${r.source}" not found`))}else t.push(new pe(s,r,'missing required property "source"'));return t=t.concat(wi({key:s,value:r,valueSpec:c.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${s}.type`,value:r.type,valueSpec:c.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:Ha,layout:_=>wi({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>Wa(Ki({layerType:d},x))}}),paint:_=>wi({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>Xa(Ki({layerType:d},x))}})}})),t}function Cr(i){const t=i.value,r=i.key,s=He(t);return s!=="string"?[new pe(r,t,`string expected, ${s} found`)]:[]}const ia={promoteId:function({key:i,value:t}){if(He(t)==="string")return Cr({key:i,value:t});{const r=[];for(const s in t)r.push(...Cr({key:`${i}.${s}`,value:t[s]}));return r}}};function Ja(i){const t=i.value,r=i.key,s=i.styleSpec,l=i.style,c=i.validateSpec;if(!t.type)return[new pe(r,t,'"type" is required')];const d=vt(t.type);let f;switch(d){case"vector":case"raster":return f=wi({key:r,value:t,valueSpec:s[`source_${d.replace("-","_")}`],style:i.style,styleSpec:s,objectElementValidators:ia,validateSpec:c}),f;case"raster-dem":return f=function(_){var x;const b=(x=_.sourceName)!==null&&x!==void 0?x:"",w=_.value,I=_.styleSpec,M=I.source_raster_dem,k=_.style;let z=[];const O=He(w);if(w===void 0)return z;if(O!=="object")return z.push(new pe("source_raster_dem",w,`object expected, ${O} found`)),z;const $=vt(w.encoding)==="custom",Q=["redFactor","greenFactor","blueFactor","baseShift"],G=_.value.encoding?`"${_.value.encoding}"`:"Default";for(const K in w)!$&&Q.includes(K)?z.push(new pe(K,w[K],`In "${b}": "${K}" is only valid when "encoding" is set to "custom". ${G} encoding found`)):M[K]?z=z.concat(_.validateSpec({key:K,value:w[K],valueSpec:M[K],validateSpec:_.validateSpec,style:k,styleSpec:I})):z.push(new pe(K,w[K],`unknown property "${K}"`));return z}({sourceName:r,value:t,style:i.style,styleSpec:s,validateSpec:c}),f;case"geojson":if(f=wi({key:r,value:t,valueSpec:s.source_geojson,style:l,styleSpec:s,validateSpec:c,objectElementValidators:ia}),t.cluster)for(const _ in t.clusterProperties){const[x,b]=t.clusterProperties[_],w=typeof x=="string"?[x,["accumulated"],["get",_]]:x;f.push(...Yr({key:`${r}.${_}.map`,value:b,validateSpec:c,expressionContext:"cluster-map"})),f.push(...Yr({key:`${r}.${_}.reduce`,value:w,validateSpec:c,expressionContext:"cluster-reduce"}))}return f;case"video":return wi({key:r,value:t,valueSpec:s.source_video,style:l,validateSpec:c,styleSpec:s});case"image":return wi({key:r,value:t,valueSpec:s.source_image,style:l,validateSpec:c,styleSpec:s});case"canvas":return[new pe(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return wn({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:l,validateSpec:c,styleSpec:s})}}function rl(i){const t=i.value,r=i.styleSpec,s=r.light,l=i.style;let c=[];const d=He(t);if(t===void 0)return c;if(d!=="object")return c=c.concat([new pe("light",t,`object expected, ${d} found`)]),c;for(const f in t){const _=f.match(/^(.*)-transition$/);c=c.concat(_&&s[_[1]]&&s[_[1]].transition?i.validateSpec({key:f,value:t[f],valueSpec:r.transition,validateSpec:i.validateSpec,style:l,styleSpec:r}):s[f]?i.validateSpec({key:f,value:t[f],valueSpec:s[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new pe(f,t[f],`unknown property "${f}"`)])}return c}function Ya(i){const t=i.value,r=i.styleSpec,s=r.sky,l=i.style,c=He(t);if(t===void 0)return[];if(c!=="object")return[new pe("sky",t,`object expected, ${c} found`)];let d=[];for(const f in t)d=d.concat(s[f]?i.validateSpec({key:f,value:t[f],valueSpec:s[f],style:l,styleSpec:r}):[new pe(f,t[f],`unknown property "${f}"`)]);return d}function nl(i){const t=i.value,r=i.styleSpec,s=r.terrain,l=i.style;let c=[];const d=He(t);if(t===void 0)return c;if(d!=="object")return c=c.concat([new pe("terrain",t,`object expected, ${d} found`)]),c;for(const f in t)c=c.concat(s[f]?i.validateSpec({key:f,value:t[f],valueSpec:s[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new pe(f,t[f],`unknown property "${f}"`)]);return c}function Qa(i){let t=[];const r=i.value,s=i.key;if(Array.isArray(r)){const l=[],c=[];for(const d in r)r[d].id&&l.includes(r[d].id)&&t.push(new pe(s,r,`all the sprites' ids must be unique, but ${r[d].id} is duplicated`)),l.push(r[d].id),r[d].url&&c.includes(r[d].url)&&t.push(new pe(s,r,`all the sprites' URLs must be unique, but ${r[d].url} is duplicated`)),c.push(r[d].url),t=t.concat(wi({key:`${s}[${d}]`,value:r[d],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return t}return Cr({key:s,value:r})}const eo={"*":()=>[],array:cs,boolean:function(i){const t=i.value,r=i.key,s=He(t);return s!=="boolean"?[new pe(r,t,`boolean expected, ${s} found`)]:[]},number:Qs,color:function(i){const t=i.key,r=i.value,s=He(r);return s!=="string"?[new pe(t,r,`color expected, ${s} found`)]:et.parse(String(r))?[]:[new pe(t,r,`color expected, "${r}" found`)]},constants:Ys,enum:wn,filter:Ha,function:ea,layer:Ka,object:wi,source:Ja,light:rl,sky:Ya,terrain:nl,projection:function(i){const t=i.value,r=i.styleSpec,s=r.projection,l=i.style,c=He(t);if(t===void 0)return[];if(c!=="object")return[new pe("projection",t,`object expected, ${c} found`)];let d=[];for(const f in t)d=d.concat(s[f]?i.validateSpec({key:f,value:t[f],valueSpec:s[f],style:l,styleSpec:r}):[new pe(f,t[f],`unknown property "${f}"`)]);return d},string:Cr,formatted:function(i){return Cr(i).length===0?[]:Yr(i)},resolvedImage:function(i){return Cr(i).length===0?[]:Yr(i)},padding:function(i){const t=i.key,r=i.value;if(He(r)==="array"){if(r.length<1||r.length>4)return[new pe(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];const s={type:"number"};let l=[];for(let c=0;c[]}})),i.constants&&(r=r.concat(Ys({key:"constants",value:i.constants,style:i,styleSpec:t,validateSpec:Tn}))),to(r)}function Di(i){return function(t){return i({...t,validateSpec:Tn})}}function to(i){return[].concat(i).sort((t,r)=>t.line-r.line)}function Li(i){return function(...t){return to(i.apply(this,t))}}Ei.source=Li(Di(Ja)),Ei.sprite=Li(Di(Qa)),Ei.glyphs=Li(Di(sl)),Ei.light=Li(Di(rl)),Ei.sky=Li(Di(Ya)),Ei.terrain=Li(Di(nl)),Ei.layer=Li(Di(Ka)),Ei.filter=Li(Di(Ha)),Ei.paintProperty=Li(Di(Xa)),Ei.layoutProperty=Li(Di(Wa));const Qr=Ei,ra=Qr.light,ec=Qr.sky,io=Qr.paintProperty,tc=Qr.layoutProperty;function al(i,t){let r=!1;if(t&&t.length)for(const s of t)i.fire(new wr(new Error(s.message))),r=!0;return r}class Sn{constructor(t,r,s){const l=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const d=new Int32Array(this.arrayBuffer);t=d[0],this.d=(r=d[1])+2*(s=d[2]);for(let _=0;_=w[k+0]&&l>=w[k+1])?(f[M]=!0,d.push(b[M])):f[M]=!1}}}}_forEachCell(t,r,s,l,c,d,f,_){const x=this._convertToCellCoord(t),b=this._convertToCellCoord(r),w=this._convertToCellCoord(s),I=this._convertToCellCoord(l);for(let M=x;M<=w;M++)for(let k=b;k<=I;k++){const z=this.d*k+M;if((!_||_(this._convertFromCellCoord(M),this._convertFromCellCoord(k),this._convertFromCellCoord(M+1),this._convertFromCellCoord(k+1)))&&c.call(this,t,r,s,l,z,d,f,_))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,r=3+this.cells.length+1+1;let s=0;for(let d=0;d=0)continue;const d=i[c];l[c]=tr[r].shallow.indexOf(c)>=0?d:us(d,t)}i instanceof Error&&(l.message=i.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(l.$name=r),l}function ds(i){if(ll(i))return i;if(Array.isArray(i))return i.map(ds);if(typeof i!="object")throw new Error("can't deserialize object of type "+typeof i);const t=ro(i)||"Object";if(!tr[t])throw new Error(`can't deserialize unregistered class ${t}`);const{klass:r}=tr[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(i);const s=Object.create(r.prototype);for(const l of Object.keys(i)){if(l==="$name")continue;const c=i[l];s[l]=tr[t].shallow.indexOf(l)>=0?c:ds(c)}return s}class en{constructor(){this.first=!0}update(t,r){const s=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=s,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=s,!0):(this.lastFloorZoom>s?(this.lastIntegerZoom=s+1,this.lastIntegerZoomTime=r):this.lastFloorZoomi>=128&&i<=255,"Hangul Jamo":i=>i>=4352&&i<=4607,Khmer:i=>i>=6016&&i<=6143,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Katakana:i=>i>=12448&&i<=12543,Kanbun:i=>i>=12688&&i<=12703,"CJK Strokes":i=>i>=12736&&i<=12783,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"Private Use Area":i=>i>=57344&&i<=63743,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function no(i){for(const t of i)if(fr(t.charCodeAt(0)))return!0;return!1}function ic(i){for(const t of i)if(!rc(t.charCodeAt(0)))return!1;return!0}function so(i){const t=i.map(r=>{try{return new RegExp(`\\p{sc=${r}}`,"u").source}catch{return null}}).filter(r=>r);return new RegExp(t.join("|"),"u")}const cl=so(["Arab","Dupl","Mong","Ougr","Syrc"]);function rc(i){return!cl.test(String.fromCodePoint(i))}const hl=so(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function fr(i){return!(i!==746&&i!==747&&(i<4352||!(Ge["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||Ge["CJK Compatibility"](i)||Ge["CJK Strokes"](i)||!(!Ge["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||Ge["Enclosed CJK Letters and Months"](i)||Ge["Ideographic Description Characters"](i)||Ge.Kanbun(i)||Ge.Katakana(i)&&i!==12540||!(!Ge["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!Ge["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||Ge["Vertical Forms"](i)||Ge["Yijing Hexagram Symbols"](i)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(i))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(i))||hl.test(String.fromCodePoint(i)))))}function ao(i){return!(fr(i)||function(t){return!!(Ge["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Ge["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Ge["Letterlike Symbols"](t)||Ge["Number Forms"](t)||Ge["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Ge["Control Pictures"](t)&&t!==9251||Ge["Optical Character Recognition"](t)||Ge["Enclosed Alphanumerics"](t)||Ge["Geometric Shapes"](t)||Ge["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Ge["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Ge["CJK Symbols and Punctuation"](t)||Ge.Katakana(t)||Ge["Private Use Area"](t)||Ge["CJK Compatibility Forms"](t)||Ge["Small Form Variants"](t)||Ge["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(i))}const oo=so(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function lo(i){return oo.test(String.fromCodePoint(i))}function co(i,t){return!(!t&&lo(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||Ge.Khmer(i))}function nc(i){for(const t of i)if(lo(t.charCodeAt(0)))return!0;return!1}const ir=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(i){this.pluginStatus=i.pluginStatus,this.pluginURL=i.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(i){this.applyArabicShaping=i.applyArabicShaping,this.processBidirectionalText=i.processBidirectionalText,this.processStyledBidirectionalText=i.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class it{constructor(t,r){this.zoom=t,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new en,this.transition={})}isSupportedScript(t){return function(r,s){for(const l of r)if(!co(l.charCodeAt(0),s))return!1;return!0}(t,ir.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,r=t-Math.floor(t),s=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*s}:{fromScale:.5,toScale:1,t:1-(1-s)*r}}}class na{constructor(t,r){this.property=t,this.value=r,this.expression=function(s,l){if(Hs(s))return new Ws(s,l);if(ns(s)){const c=tl(s,l);if(c.result==="error")throw new Error(c.value.map(d=>`${d.key}: ${d.message}`).join(", "));return c.value}{let c=s;return l.type==="color"&&typeof s=="string"?c=et.parse(s):l.type!=="padding"||typeof s!="number"&&!Array.isArray(s)?l.type==="variableAnchorOffsetCollection"&&Array.isArray(s)&&(c=ui.parse(s)):c=hi.parse(s),{kind:"constant",evaluate:()=>c}}}(r===void 0?t.specification.default:r,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,r,s){return this.property.possiblyEvaluate(this,t,r,s)}}class sa{constructor(t){this.property=t,this.value=new na(t,void 0)}transitioned(t,r){return new ul(this.property,this.value,r,xi({},t.transition,this.transition),t.now)}untransitioned(){return new ul(this.property,this.value,null,{},0)}}class In{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return tt(this._values[t].value.value)}setValue(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new sa(this._values[t].property)),this._values[t].value=new na(this._values[t].property,r===null?void 0:tt(r))}getTransition(t){return tt(this._values[t].transition)}setTransition(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new sa(this._values[t].property)),this._values[t].transition=tt(r)||void 0}serialize(){const t={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(t[r]=s);const l=this.getTransition(r);l!==void 0&&(t[`${r}-transition`]=l)}return t}transitioned(t,r){const s=new dl(this._properties);for(const l of Object.keys(this._values))s._values[l]=this._values[l].transitioned(t,r._values[l]);return s}untransitioned(){const t=new dl(this._properties);for(const r of Object.keys(this._values))t._values[r]=this._values[r].untransitioned();return t}}class ul{constructor(t,r,s,l,c){this.property=t,this.value=r,this.begin=c+l.delay||0,this.end=this.begin+l.duration||0,t.specification.transition&&(l.delay||l.duration)&&(this.prior=s)}possiblyEvaluate(t,r,s){const l=t.now||0,c=this.value.possiblyEvaluate(t,r,s),d=this.prior;if(d){if(l>this.end)return this.prior=null,c;if(this.value.isDataDriven())return this.prior=null,c;if(l=1)return 1;const x=_*_,b=x*_;return 4*(_<.5?b:3*(_-x)+b-.75)}(f))}}return c}}class dl{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,r,s){const l=new h(this._properties);for(const c of Object.keys(this._values))l._values[c]=this._values[c].possiblyEvaluate(t,r,s);return l}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class pl{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return this._values[t].value!==void 0}getValue(t){return tt(this._values[t].value)}setValue(t,r){this._values[t]=new na(this._values[t].property,r===null?void 0:tt(r))}serialize(){const t={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(t[r]=s)}return t}possiblyEvaluate(t,r,s){const l=new h(this._properties);for(const c of Object.keys(this._values))l._values[c]=this._values[c].possiblyEvaluate(t,r,s);return l}}class rr{constructor(t,r,s){this.property=t,this.value=r,this.parameters=s}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,r,s,l){return this.property.evaluate(this.value,this.parameters,t,r,s,l)}}class h{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class e{constructor(t){this.specification=t}possiblyEvaluate(t,r){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(r)}interpolate(t,r,s){const l=di[this.specification.type];return l?l(t,r,s):t}}class n{constructor(t,r){this.specification=t,this.overrides=r}possiblyEvaluate(t,r,s,l){return new rr(this,t.expression.kind==="constant"||t.expression.kind==="camera"?{kind:"constant",value:t.expression.evaluate(r,null,{},s,l)}:t.expression,r)}interpolate(t,r,s){if(t.value.kind!=="constant"||r.value.kind!=="constant")return t;if(t.value.value===void 0||r.value.value===void 0)return new rr(this,{kind:"constant",value:void 0},t.parameters);const l=di[this.specification.type];if(l){const c=l(t.value.value,r.value.value,s);return new rr(this,{kind:"constant",value:c},t.parameters)}return t}evaluate(t,r,s,l,c,d){return t.kind==="constant"?t.value:t.evaluate(r,s,l,c,d)}}class a extends n{possiblyEvaluate(t,r,s,l){if(t.value===void 0)return new rr(this,{kind:"constant",value:void 0},r);if(t.expression.kind==="constant"){const c=t.expression.evaluate(r,null,{},s,l),d=t.property.specification.type==="resolvedImage"&&typeof c!="string"?c.name:c,f=this._calculate(d,d,d,r);return new rr(this,{kind:"constant",value:f},r)}if(t.expression.kind==="camera"){const c=this._calculate(t.expression.evaluate({zoom:r.zoom-1}),t.expression.evaluate({zoom:r.zoom}),t.expression.evaluate({zoom:r.zoom+1}),r);return new rr(this,{kind:"constant",value:c},r)}return new rr(this,t.expression,r)}evaluate(t,r,s,l,c,d){if(t.kind==="source"){const f=t.evaluate(r,s,l,c,d);return this._calculate(f,f,f,r)}return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(r.zoom)-1},s,l),t.evaluate({zoom:Math.floor(r.zoom)},s,l),t.evaluate({zoom:Math.floor(r.zoom)+1},s,l),r):t.value}_calculate(t,r,s,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:s,to:r}}interpolate(t){return t}}class o{constructor(t){this.specification=t}possiblyEvaluate(t,r,s,l){if(t.value!==void 0){if(t.expression.kind==="constant"){const c=t.expression.evaluate(r,null,{},s,l);return this._calculate(c,c,c,r)}return this._calculate(t.expression.evaluate(new it(Math.floor(r.zoom-1),r)),t.expression.evaluate(new it(Math.floor(r.zoom),r)),t.expression.evaluate(new it(Math.floor(r.zoom+1),r)),r)}}_calculate(t,r,s,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:s,to:r}}interpolate(t){return t}}class u{constructor(t){this.specification=t}possiblyEvaluate(t,r,s,l){return!!t.expression.evaluate(r,null,{},s,l)}interpolate(){return!1}}class m{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in t){const s=t[r];s.specification.overridable&&this.overridableProperties.push(r);const l=this.defaultPropertyValues[r]=new na(s,void 0),c=this.defaultTransitionablePropertyValues[r]=new sa(s);this.defaultTransitioningPropertyValues[r]=c.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=l.possiblyEvaluate({})}}}Se("DataDrivenProperty",n),Se("DataConstantProperty",e),Se("CrossFadedDataDrivenProperty",a),Se("CrossFadedProperty",o),Se("ColorRampProperty",u);const g="-transition";class y extends un{constructor(t,r){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new pl(r.layout)),r.paint)){this._transitionablePaint=new In(r.paint);for(const s in t.paint)this.setPaintProperty(s,t.paint[s],{validate:!1});for(const s in t.layout)this.setLayoutProperty(s,t.layout[s],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new h(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,r,s={}){r!=null&&this._validate(tc,`layers.${this.id}.layout.${t}`,t,r,s)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,r):this.visibility=r)}getPaintProperty(t){return t.endsWith(g)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,r,s={}){if(r!=null&&this._validate(io,`layers.${this.id}.paint.${t}`,t,r,s))return!1;if(t.endsWith(g))return this._transitionablePaint.setTransition(t.slice(0,-11),r||void 0),!1;{const l=this._transitionablePaint._values[t],c=l.property.specification["property-type"]==="cross-faded-data-driven",d=l.value.isDataDriven(),f=l.value;this._transitionablePaint.setValue(t,r),this._handleSpecialPaintPropertyUpdate(t);const _=this._transitionablePaint._values[t].value;return _.isDataDriven()||d||c||this._handleOverridablePaintPropertyUpdate(t,f,_)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,r,s){return!1}isHidden(t){return!!(this.minzoom&&t=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,r){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,r)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),Rn(t,(r,s)=>!(r===void 0||s==="layout"&&!Object.keys(r).length||s==="paint"&&!Object.keys(r).length))}_validate(t,r,s,l,c={}){return(!c||c.validate!==!1)&&al(this,t.call(Qr,{key:r,layerType:this.type,objectKey:s,value:l,styleSpec:ie,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const r=this.paint.get(t);if(r instanceof rr&&gn(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const v={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class S{constructor(t,r){this._structArray=t,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class T{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,r){return t._trim(),r&&(t.isTransferred=!0,r.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const r=Object.create(this.prototype);return r.arrayBuffer=t.arrayBuffer,r.length=t.length,r.capacity=t.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function C(i,t=1){let r=0,s=0;return{members:i.map(l=>{const c=v[l.type].BYTES_PER_ELEMENT,d=r=D(r,Math.max(t,c)),f=l.components||1;return s=Math.max(s,c),r+=c*f,{name:l.name,type:l.type,components:f,offset:d}}),size:D(r,Math.max(s,t)),alignment:t}}function D(i,t){return Math.ceil(i/t)*t}class R extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r){const s=this.length;return this.resize(s+1),this.emplace(s,t,r)}emplace(t,r,s){const l=2*t;return this.int16[l+0]=r,this.int16[l+1]=s,t}}R.prototype.bytesPerElement=4,Se("StructArrayLayout2i4",R);class N extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,s)}emplace(t,r,s,l){const c=3*t;return this.int16[c+0]=r,this.int16[c+1]=s,this.int16[c+2]=l,t}}N.prototype.bytesPerElement=6,Se("StructArrayLayout3i6",N);class B extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s,l){const c=this.length;return this.resize(c+1),this.emplace(c,t,r,s,l)}emplace(t,r,s,l,c){const d=4*t;return this.int16[d+0]=r,this.int16[d+1]=s,this.int16[d+2]=l,this.int16[d+3]=c,t}}B.prototype.bytesPerElement=8,Se("StructArrayLayout4i8",B);class U extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,c,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,s,l,c,d)}emplace(t,r,s,l,c,d,f){const _=6*t;return this.int16[_+0]=r,this.int16[_+1]=s,this.int16[_+2]=l,this.int16[_+3]=c,this.int16[_+4]=d,this.int16[_+5]=f,t}}U.prototype.bytesPerElement=12,Se("StructArrayLayout2i4i12",U);class Z extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,c,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,s,l,c,d)}emplace(t,r,s,l,c,d,f){const _=4*t,x=8*t;return this.int16[_+0]=r,this.int16[_+1]=s,this.uint8[x+4]=l,this.uint8[x+5]=c,this.uint8[x+6]=d,this.uint8[x+7]=f,t}}Z.prototype.bytesPerElement=8,Se("StructArrayLayout2i4ub8",Z);class F extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r){const s=this.length;return this.resize(s+1),this.emplace(s,t,r)}emplace(t,r,s){const l=2*t;return this.float32[l+0]=r,this.float32[l+1]=s,t}}F.prototype.bytesPerElement=8,Se("StructArrayLayout2f8",F);class W extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,c,d,f,_,x,b){const w=this.length;return this.resize(w+1),this.emplace(w,t,r,s,l,c,d,f,_,x,b)}emplace(t,r,s,l,c,d,f,_,x,b,w){const I=10*t;return this.uint16[I+0]=r,this.uint16[I+1]=s,this.uint16[I+2]=l,this.uint16[I+3]=c,this.uint16[I+4]=d,this.uint16[I+5]=f,this.uint16[I+6]=_,this.uint16[I+7]=x,this.uint16[I+8]=b,this.uint16[I+9]=w,t}}W.prototype.bytesPerElement=20,Se("StructArrayLayout10ui20",W);class Y extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,c,d,f,_,x,b,w,I){const M=this.length;return this.resize(M+1),this.emplace(M,t,r,s,l,c,d,f,_,x,b,w,I)}emplace(t,r,s,l,c,d,f,_,x,b,w,I,M){const k=12*t;return this.int16[k+0]=r,this.int16[k+1]=s,this.int16[k+2]=l,this.int16[k+3]=c,this.uint16[k+4]=d,this.uint16[k+5]=f,this.uint16[k+6]=_,this.uint16[k+7]=x,this.int16[k+8]=b,this.int16[k+9]=w,this.int16[k+10]=I,this.int16[k+11]=M,t}}Y.prototype.bytesPerElement=24,Se("StructArrayLayout4i4ui4i24",Y);class ee extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,s)}emplace(t,r,s,l){const c=3*t;return this.float32[c+0]=r,this.float32[c+1]=s,this.float32[c+2]=l,t}}ee.prototype.bytesPerElement=12,Se("StructArrayLayout3f12",ee);class oe extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint32[1*t+0]=r,t}}oe.prototype.bytesPerElement=4,Se("StructArrayLayout1ul4",oe);class he extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,c,d,f,_,x){const b=this.length;return this.resize(b+1),this.emplace(b,t,r,s,l,c,d,f,_,x)}emplace(t,r,s,l,c,d,f,_,x,b){const w=10*t,I=5*t;return this.int16[w+0]=r,this.int16[w+1]=s,this.int16[w+2]=l,this.int16[w+3]=c,this.int16[w+4]=d,this.int16[w+5]=f,this.uint32[I+3]=_,this.uint16[w+8]=x,this.uint16[w+9]=b,t}}he.prototype.bytesPerElement=20,Se("StructArrayLayout6i1ul2ui20",he);class we extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,c,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,s,l,c,d)}emplace(t,r,s,l,c,d,f){const _=6*t;return this.int16[_+0]=r,this.int16[_+1]=s,this.int16[_+2]=l,this.int16[_+3]=c,this.int16[_+4]=d,this.int16[_+5]=f,t}}we.prototype.bytesPerElement=12,Se("StructArrayLayout2i2i2i12",we);class Te extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,c){const d=this.length;return this.resize(d+1),this.emplace(d,t,r,s,l,c)}emplace(t,r,s,l,c,d){const f=4*t,_=8*t;return this.float32[f+0]=r,this.float32[f+1]=s,this.float32[f+2]=l,this.int16[_+6]=c,this.int16[_+7]=d,t}}Te.prototype.bytesPerElement=16,Se("StructArrayLayout2f1f2i16",Te);class ue extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,s,l,c,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,s,l,c,d)}emplace(t,r,s,l,c,d,f){const _=16*t,x=4*t,b=8*t;return this.uint8[_+0]=r,this.uint8[_+1]=s,this.float32[x+1]=l,this.float32[x+2]=c,this.int16[b+6]=d,this.int16[b+7]=f,t}}ue.prototype.bytesPerElement=16,Se("StructArrayLayout2ub2f2i16",ue);class de extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,s)}emplace(t,r,s,l){const c=3*t;return this.uint16[c+0]=r,this.uint16[c+1]=s,this.uint16[c+2]=l,t}}de.prototype.bytesPerElement=6,Se("StructArrayLayout3ui6",de);class Ae extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,s,l,c,d,f,_,x,b,w,I,M,k,z,O,$){const Q=this.length;return this.resize(Q+1),this.emplace(Q,t,r,s,l,c,d,f,_,x,b,w,I,M,k,z,O,$)}emplace(t,r,s,l,c,d,f,_,x,b,w,I,M,k,z,O,$,Q){const G=24*t,K=12*t,re=48*t;return this.int16[G+0]=r,this.int16[G+1]=s,this.uint16[G+2]=l,this.uint16[G+3]=c,this.uint32[K+2]=d,this.uint32[K+3]=f,this.uint32[K+4]=_,this.uint16[G+10]=x,this.uint16[G+11]=b,this.uint16[G+12]=w,this.float32[K+7]=I,this.float32[K+8]=M,this.uint8[re+36]=k,this.uint8[re+37]=z,this.uint8[re+38]=O,this.uint32[K+10]=$,this.int16[G+22]=Q,t}}Ae.prototype.bytesPerElement=48,Se("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ae);class Fe extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,s,l,c,d,f,_,x,b,w,I,M,k,z,O,$,Q,G,K,re,ce,be,De,ve,ye,Ce,Pe){const Ie=this.length;return this.resize(Ie+1),this.emplace(Ie,t,r,s,l,c,d,f,_,x,b,w,I,M,k,z,O,$,Q,G,K,re,ce,be,De,ve,ye,Ce,Pe)}emplace(t,r,s,l,c,d,f,_,x,b,w,I,M,k,z,O,$,Q,G,K,re,ce,be,De,ve,ye,Ce,Pe,Ie){const ae=32*t,ke=16*t;return this.int16[ae+0]=r,this.int16[ae+1]=s,this.int16[ae+2]=l,this.int16[ae+3]=c,this.int16[ae+4]=d,this.int16[ae+5]=f,this.int16[ae+6]=_,this.int16[ae+7]=x,this.uint16[ae+8]=b,this.uint16[ae+9]=w,this.uint16[ae+10]=I,this.uint16[ae+11]=M,this.uint16[ae+12]=k,this.uint16[ae+13]=z,this.uint16[ae+14]=O,this.uint16[ae+15]=$,this.uint16[ae+16]=Q,this.uint16[ae+17]=G,this.uint16[ae+18]=K,this.uint16[ae+19]=re,this.uint16[ae+20]=ce,this.uint16[ae+21]=be,this.uint16[ae+22]=De,this.uint32[ke+12]=ve,this.float32[ke+13]=ye,this.float32[ke+14]=Ce,this.uint16[ae+30]=Pe,this.uint16[ae+31]=Ie,t}}Fe.prototype.bytesPerElement=64,Se("StructArrayLayout8i15ui1ul2f2ui64",Fe);class me extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.float32[1*t+0]=r,t}}me.prototype.bytesPerElement=4,Se("StructArrayLayout1f4",me);class xe extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,s)}emplace(t,r,s,l){const c=3*t;return this.uint16[6*t+0]=r,this.float32[c+1]=s,this.float32[c+2]=l,t}}xe.prototype.bytesPerElement=12,Se("StructArrayLayout1ui2f12",xe);class Re extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,s)}emplace(t,r,s,l){const c=4*t;return this.uint32[2*t+0]=r,this.uint16[c+2]=s,this.uint16[c+3]=l,t}}Re.prototype.bytesPerElement=8,Se("StructArrayLayout1ul2ui8",Re);class lt extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r){const s=this.length;return this.resize(s+1),this.emplace(s,t,r)}emplace(t,r,s){const l=2*t;return this.uint16[l+0]=r,this.uint16[l+1]=s,t}}lt.prototype.bytesPerElement=4,Se("StructArrayLayout2ui4",lt);class je extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint16[1*t+0]=r,t}}je.prototype.bytesPerElement=2,Se("StructArrayLayout1ui2",je);class qe extends T{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,s,l){const c=this.length;return this.resize(c+1),this.emplace(c,t,r,s,l)}emplace(t,r,s,l,c){const d=4*t;return this.float32[d+0]=r,this.float32[d+1]=s,this.float32[d+2]=l,this.float32[d+3]=c,t}}qe.prototype.bytesPerElement=16,Se("StructArrayLayout4f16",qe);class ht extends S{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new _e(this.anchorPointX,this.anchorPointY)}}ht.prototype.size=20;class Ot extends he{get(t){return new ht(this,t)}}Se("CollisionBoxArray",Ot);class Ri extends S{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Ri.prototype.size=48;class ut extends Ae{get(t){return new Ri(this,t)}}Se("PlacedSymbolArray",ut);class ti extends S{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}ti.prototype.size=64;class Wt extends Fe{get(t){return new ti(this,t)}}Se("SymbolInstanceArray",Wt);class Vt extends me{getoffsetX(t){return this.float32[1*t+0]}}Se("GlyphOffsetArray",Vt);class Nt extends N{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Se("SymbolLineVertexArray",Nt);class Bi extends S{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Bi.prototype.size=12;class tn extends xe{get(t){return new Bi(this,t)}}Se("TextAnchorOffsetArray",tn);class ps extends S{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]}}ps.prototype.size=8;class rn extends Re{get(t){return new ps(this,t)}}Se("FeatureIndexArray",rn);class kr extends R{}class aa extends R{}class ho extends R{}class Ti extends U{}class Fi extends Z{}class zr extends F{}class Oi extends W{}class Kt extends Y{}class jt extends ee{}class _i extends oe{}class yt extends we{}class Pn extends ue{}class Er extends de{}class fs extends lt{}const sc=C([{name:"a_pos",components:2,type:"Int16"}],4),{members:ac}=sc;class Et{constructor(t=[]){this.segments=t}prepareSegment(t,r,s,l){let c=this.segments[this.segments.length-1];return t>Et.MAX_VERTEX_ARRAY_LENGTH&&Lt(`Max vertices per segment is ${Et.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!c||c.vertexLength+t>Et.MAX_VERTEX_ARRAY_LENGTH||c.sortKey!==l)&&(c={vertexOffset:r.length,primitiveOffset:s.length,vertexLength:0,primitiveLength:0},l!==void 0&&(c.sortKey=l),this.segments.push(c)),c}get(){return this.segments}destroy(){for(const t of this.segments)for(const r in t.vaos)t.vaos[r].destroy()}static simpleSegment(t,r,s,l){return new Et([{vertexOffset:t,primitiveOffset:r,vertexLength:s,primitiveLength:l,vaos:{},sortKey:0}])}}function Dr(i,t){return 256*(i=Ai(Math.floor(i),0,255))+Ai(Math.floor(t),0,255)}Et.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Se("SegmentVector",Et);const ms=C([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var _s={exports:{}},uo={exports:{}};uo.exports=function(i,t){var r,s,l,c,d,f,_,x;for(s=i.length-(r=3&i.length),l=t,d=3432918353,f=461845907,x=0;x>>16)*d&65535)<<16)&4294967295)<<15|_>>>17))*f+(((_>>>16)*f&65535)<<16)&4294967295)<<13|l>>>19))+((5*(l>>>16)&65535)<<16)&4294967295))+((58964+(c>>>16)&65535)<<16);switch(_=0,r){case 3:_^=(255&i.charCodeAt(x+2))<<16;case 2:_^=(255&i.charCodeAt(x+1))<<8;case 1:l^=_=(65535&(_=(_=(65535&(_^=255&i.charCodeAt(x)))*d+(((_>>>16)*d&65535)<<16)&4294967295)<<15|_>>>17))*f+(((_>>>16)*f&65535)<<16)&4294967295}return l^=i.length,l=2246822507*(65535&(l^=l>>>16))+((2246822507*(l>>>16)&65535)<<16)&4294967295,l=3266489909*(65535&(l^=l>>>13))+((3266489909*(l>>>16)&65535)<<16)&4294967295,(l^=l>>>16)>>>0};var po=uo.exports,fo={exports:{}};fo.exports=function(i,t){for(var r,s=i.length,l=t^s,c=0;s>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(c)|(255&i.charCodeAt(++c))<<8|(255&i.charCodeAt(++c))<<16|(255&i.charCodeAt(++c))<<24))+((1540483477*(r>>>16)&65535)<<16),l=1540483477*(65535&l)+((1540483477*(l>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),s-=4,++c;switch(s){case 3:l^=(255&i.charCodeAt(c+2))<<16;case 2:l^=(255&i.charCodeAt(c+1))<<8;case 1:l=1540483477*(65535&(l^=255&i.charCodeAt(c)))+((1540483477*(l>>>16)&65535)<<16)}return l=1540483477*(65535&(l^=l>>>13))+((1540483477*(l>>>16)&65535)<<16),(l^=l>>>15)>>>0};var oa=po,Fu=fo.exports;_s.exports=oa,_s.exports.murmur3=oa,_s.exports.murmur2=Fu;var oc=Pi(_s.exports);class fl{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,r,s,l){this.ids.push(Kc(t)),this.positions.push(r,s,l)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=Kc(t);let s=0,l=this.ids.length-1;for(;s>1;this.ids[d]>=r?l=d:s=d+1}const c=[];for(;this.ids[s]===r;)c.push({index:this.positions[3*s],start:this.positions[3*s+1],end:this.positions[3*s+2]}),s++;return c}static serialize(t,r){const s=new Float64Array(t.ids),l=new Uint32Array(t.positions);return lc(s,l,0,s.length-1),r&&r.push(s.buffer,l.buffer),{ids:s,positions:l}}static deserialize(t){const r=new fl;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}}function Kc(i){const t=+i;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:oc(String(i))}function lc(i,t,r,s){for(;r>1];let c=r-1,d=s+1;for(;;){do c++;while(i[c]l);if(c>=d)break;ml(i,c,d),ml(t,3*c,3*d),ml(t,3*c+1,3*d+1),ml(t,3*c+2,3*d+2)}d-r`u_${l}`),this.type=s}setUniform(t,r,s){t.set(s.constantOr(this.value))}getBinding(t,r,s){return this.type==="color"?new Yc(t,r):new _l(t,r)}}class la{constructor(t,r){this.uniformNames=r.map(s=>`u_${s}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=t.tlbr}setUniform(t,r,s,l){const c=l==="u_pattern_to"?this.patternTo:l==="u_pattern_from"?this.patternFrom:l==="u_pixel_ratio_to"?this.pixelRatioTo:l==="u_pixel_ratio_from"?this.pixelRatioFrom:null;c&&t.set(c)}getBinding(t,r,s){return s.substr(0,9)==="u_pattern"?new Jc(t,r):new _l(t,r)}}class nn{constructor(t,r,s,l){this.expression=t,this.type=s,this.maxValue=0,this.paintVertexAttributes=r.map(c=>({name:`a_${c}`,type:"Float32",components:s==="color"?2:1,offset:0})),this.paintVertexArray=new l}populatePaintArray(t,r,s,l,c){const d=this.paintVertexArray.length,f=this.expression.evaluate(new it(0),r,{},l,[],c);this.paintVertexArray.resize(t),this._setPaintValue(d,t,f)}updatePaintArray(t,r,s,l){const c=this.expression.evaluate({zoom:0},s,l);this._setPaintValue(t,r,c)}_setPaintValue(t,r,s){if(this.type==="color"){const l=cc(s);for(let c=t;c`u_${f}_t`),this.type=s,this.useIntegerZoom=l,this.zoom=c,this.maxValue=0,this.paintVertexAttributes=r.map(f=>({name:`a_${f}`,type:"Float32",components:s==="color"?4:2,offset:0})),this.paintVertexArray=new d}populatePaintArray(t,r,s,l,c){const d=this.expression.evaluate(new it(this.zoom),r,{},l,[],c),f=this.expression.evaluate(new it(this.zoom+1),r,{},l,[],c),_=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(_,t,d,f)}updatePaintArray(t,r,s,l){const c=this.expression.evaluate({zoom:this.zoom},s,l),d=this.expression.evaluate({zoom:this.zoom+1},s,l);this._setPaintValue(t,r,c,d)}_setPaintValue(t,r,s,l){if(this.type==="color"){const c=cc(s),d=cc(l);for(let f=t;f`#define HAS_UNIFORM_${l}`))}return t}getBinderAttributes(){const t=[];for(const r in this.binders){const s=this.binders[r];if(s instanceof nn||s instanceof mr)for(let l=0;l!0){this.programConfigurations={};for(const l of t)this.programConfigurations[l.id]=new Qc(l,r,s);this.needsUpload=!1,this._featureMap=new fl,this._bufferOffset=0}populatePaintArrays(t,r,s,l,c,d){for(const f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(t,r,l,c,d);r.id!==void 0&&this._featureMap.add(r.id,s,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,r,s,l){for(const c of s)this.needsUpload=this.programConfigurations[c.id].updatePaintArrays(t,this._featureMap,r,c,l)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function Vu(i,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${t}-`,"").replace(/-/g,"_")]}function eh(i,t,r){const s={color:{source:F,composite:qe},number:{source:me,composite:F}},l=function(c){return{"line-pattern":{source:Oi,composite:Oi},"fill-pattern":{source:Oi,composite:Oi},"fill-extrusion-pattern":{source:Oi,composite:Oi}}[c]}(i);return l&&l[r]||s[t][r]}Se("ConstantBinder",mo),Se("CrossFadedConstantBinder",la),Se("SourceExpressionBinder",nn),Se("CrossFadedCompositeBinder",An),Se("CompositeExpressionBinder",mr),Se("ProgramConfiguration",Qc,{omit:["_buffers"]}),Se("ProgramConfigurationSet",ys);const Pt=8192,hc=Math.pow(2,14)-1,th=-hc-1;function xs(i){const t=Pt/i.extent,r=i.loadGeometry();for(let s=0;sd.x+1||_d.y+1)&&Lt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function vs(i,t){return{type:i.type,id:i.id,properties:i.properties,geometry:t?xs(i):[]}}function gl(i,t,r,s,l){i.emplaceBack(2*t+(s+1)/2,2*r+(l+1)/2)}class uc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new aa,this.indexArray=new Er,this.segments=new Et,this.programConfigurations=new ys(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,s){const l=this.layers[0],c=[];let d=null,f=!1;l.type==="circle"&&(d=l.layout.get("circle-sort-key"),f=!d.isConstant());for(const{feature:_,id:x,index:b,sourceLayerIndex:w}of t){const I=this.layers[0]._featureFilter.needGeometry,M=vs(_,I);if(!this.layers[0]._featureFilter.filter(new it(this.zoom),M,s))continue;const k=f?d.evaluate(M,{},s):void 0,z={id:x,properties:_.properties,type:_.type,sourceLayerIndex:w,index:b,geometry:I?M.geometry:xs(_),patterns:{},sortKey:k};c.push(z)}f&&c.sort((_,x)=>_.sortKey-x.sortKey);for(const _ of c){const{geometry:x,index:b,sourceLayerIndex:w}=_,I=t[b].feature;this.addFeature(_,x,b,s),r.featureIndex.insert(I,x,b,w,this.index)}}update(t,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ac),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,r,s,l){for(const c of r)for(const d of c){const f=d.x,_=d.y;if(f<0||f>=Pt||_<0||_>=Pt)continue;const x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),b=x.vertexLength;gl(this.layoutVertexArray,f,_,-1,-1),gl(this.layoutVertexArray,f,_,1,-1),gl(this.layoutVertexArray,f,_,1,1),gl(this.layoutVertexArray,f,_,-1,1),this.indexArray.emplaceBack(b,b+1,b+2),this.indexArray.emplaceBack(b,b+3,b+2),x.vertexLength+=4,x.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,s,{},l)}}function ih(i,t){for(let r=0;r1){if(dc(i,t))return!0;for(let s=0;s1?r:r.sub(t)._mult(l)._add(t))}function sh(i,t){let r,s,l,c=!1;for(let d=0;dt.y!=l.y>t.y&&t.x<(l.x-s.x)*(t.y-s.y)/(l.y-s.y)+s.x&&(c=!c)}return c}function ca(i,t){let r=!1;for(let s=0,l=i.length-1;st.y!=d.y>t.y&&t.x<(d.x-c.x)*(t.y-c.y)/(d.y-c.y)+c.x&&(r=!r)}return r}function $u(i,t,r){const s=r[0],l=r[2];if(i.xl.x&&t.x>l.x||i.yl.y&&t.y>l.y)return!1;const c=Ht(i,t,r[0]);return c!==Ht(i,t,r[1])||c!==Ht(i,t,r[2])||c!==Ht(i,t,r[3])}function _o(i,t,r){const s=t.paint.get(i).value;return s.kind==="constant"?s.value:r.programConfigurations.get(t.id).getMaxValue(i)}function yl(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function xl(i,t,r,s,l){if(!t[0]&&!t[1])return i;const c=_e.convert(t)._mult(l);r==="viewport"&&c._rotate(-s);const d=[];for(let f=0;fch(O,z))}(x,_),M=w?b*f:b;for(const k of l)for(const z of k){const O=w?z:ch(z,_);let $=M;const Q=vl([],[z.x,z.y,0,1],_);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?$*=Q[3]/d.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&($*=d.cameraToCenterDistance/Q[3]),Nu(I,O,$))return!0}return!1}}function ch(i,t){const r=vl([],[i.x,i.y,0,1],t);return new _e(r[0]/r[3],r[1]/r[3])}class hh extends uc{}let uh;Se("HeatmapBucket",hh,{omit:["layers"]});var Hu={get paint(){return uh=uh||new m({"heatmap-radius":new n(ie.paint_heatmap["heatmap-radius"]),"heatmap-weight":new n(ie.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new e(ie.paint_heatmap["heatmap-intensity"]),"heatmap-color":new u(ie.paint_heatmap["heatmap-color"]),"heatmap-opacity":new e(ie.paint_heatmap["heatmap-opacity"])})}};function mc(i,{width:t,height:r},s,l){if(l){if(l instanceof Uint8ClampedArray)l=new Uint8Array(l.buffer);else if(l.length!==t*r*s)throw new RangeError(`mismatched image size. expected: ${l.length} but got: ${t*r*s}`)}else l=new Uint8Array(t*r*s);return i.width=t,i.height=r,i.data=l,i}function dh(i,{width:t,height:r},s){if(t===i.width&&r===i.height)return;const l=mc({},{width:t,height:r},s);_c(i,l,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,t),height:Math.min(i.height,r)},s),i.width=t,i.height=r,i.data=l.data}function _c(i,t,r,s,l,c){if(l.width===0||l.height===0)return t;if(l.width>i.width||l.height>i.height||r.x>i.width-l.width||r.y>i.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>t.width||l.height>t.height||s.x>t.width-l.width||s.y>t.height-l.height)throw new RangeError("out of range destination coordinates for image copy");const d=i.data,f=t.data;if(d===f)throw new Error("srcData equals dstData, so image is already copied");for(let _=0;_{t[i.evaluationKey]=_;const x=i.expression.evaluate(t);l.data[d+f+0]=Math.floor(255*x.r/x.a),l.data[d+f+1]=Math.floor(255*x.g/x.a),l.data[d+f+2]=Math.floor(255*x.b/x.a),l.data[d+f+3]=Math.floor(255*x.a)};if(i.clips)for(let d=0,f=0;d80*r){f=1/0,_=1/0;let b=-1/0,w=-1/0;for(let I=r;Ib&&(b=M),k>w&&(w=k)}x=Math.max(b-f,w-_),x=x!==0?32767/x:0}return xo(c,d,r,f,_,x,0),d}function _h(i,t,r,s,l){let c;if(l===function(d,f,_,x){let b=0;for(let w=f,I=_-x;w<_;w+=x)b+=(d[I]-d[w])*(d[w+1]+d[I+1]),I=w;return b}(i,t,r,s)>0)for(let d=t;d=t;d-=s)c=xh(d/s|0,i[d],i[d+1],c);return c&&bl(c,c.next)&&(bo(c),c=c.next),c}function bs(i,t){if(!i)return i;t||(t=i);let r,s=i;do if(r=!1,s.steiner||!bl(s,s.next)&&Tt(s.prev,s,s.next)!==0)s=s.next;else{if(bo(s),s=t=s.prev,s===s.next)break;r=!0}while(r||s!==t);return t}function xo(i,t,r,s,l,c,d){if(!i)return;!d&&c&&function(_,x,b,w){let I=_;do I.z===0&&(I.z=gc(I.x,I.y,x,b,w)),I.prevZ=I.prev,I.nextZ=I.next,I=I.next;while(I!==_);I.prevZ.nextZ=null,I.prevZ=null,function(M){let k,z=1;do{let O,$=M;M=null;let Q=null;for(k=0;$;){k++;let G=$,K=0;for(let ce=0;ce0||re>0&&G;)K!==0&&(re===0||!G||$.z<=G.z)?(O=$,$=$.nextZ,K--):(O=G,G=G.nextZ,re--),Q?Q.nextZ=O:M=O,O.prevZ=Q,Q=O;$=G}Q.nextZ=null,z*=2}while(k>1)}(I)}(i,s,l,c);let f=i;for(;i.prev!==i.next;){const _=i.prev,x=i.next;if(c?ed(i,s,l,c):Qu(i))t.push(_.i,i.i,x.i),bo(i),i=x.next,f=x.next;else if((i=x)===f){d?d===1?xo(i=td(bs(i),t),t,r,s,l,c,2):d===2&&id(i,t,r,s,l,c):xo(bs(i),t,r,s,l,c,1);break}}}function Qu(i){const t=i.prev,r=i,s=i.next;if(Tt(t,r,s)>=0)return!1;const l=t.x,c=r.x,d=s.x,f=t.y,_=r.y,x=s.y,b=lc?l>d?l:d:c>d?c:d,M=f>_?f>x?f:x:_>x?_:x;let k=s.next;for(;k!==t;){if(k.x>=b&&k.x<=I&&k.y>=w&&k.y<=M&&ua(l,f,c,_,d,x,k.x,k.y)&&Tt(k.prev,k,k.next)>=0)return!1;k=k.next}return!0}function ed(i,t,r,s){const l=i.prev,c=i,d=i.next;if(Tt(l,c,d)>=0)return!1;const f=l.x,_=c.x,x=d.x,b=l.y,w=c.y,I=d.y,M=f<_?f_?f>x?f:x:_>x?_:x,O=b>w?b>I?b:I:w>I?w:I,$=gc(M,k,t,r,s),Q=gc(z,O,t,r,s);let G=i.prevZ,K=i.nextZ;for(;G&&G.z>=$&&K&&K.z<=Q;){if(G.x>=M&&G.x<=z&&G.y>=k&&G.y<=O&&G!==l&&G!==d&&ua(f,b,_,w,x,I,G.x,G.y)&&Tt(G.prev,G,G.next)>=0||(G=G.prevZ,K.x>=M&&K.x<=z&&K.y>=k&&K.y<=O&&K!==l&&K!==d&&ua(f,b,_,w,x,I,K.x,K.y)&&Tt(K.prev,K,K.next)>=0))return!1;K=K.nextZ}for(;G&&G.z>=$;){if(G.x>=M&&G.x<=z&&G.y>=k&&G.y<=O&&G!==l&&G!==d&&ua(f,b,_,w,x,I,G.x,G.y)&&Tt(G.prev,G,G.next)>=0)return!1;G=G.prevZ}for(;K&&K.z<=Q;){if(K.x>=M&&K.x<=z&&K.y>=k&&K.y<=O&&K!==l&&K!==d&&ua(f,b,_,w,x,I,K.x,K.y)&&Tt(K.prev,K,K.next)>=0)return!1;K=K.nextZ}return!0}function td(i,t){let r=i;do{const s=r.prev,l=r.next.next;!bl(s,l)&&gh(s,r,r.next,l)&&vo(s,l)&&vo(l,s)&&(t.push(s.i,r.i,l.i),bo(r),bo(r.next),r=i=l),r=r.next}while(r!==i);return bs(r)}function id(i,t,r,s,l,c){let d=i;do{let f=d.next.next;for(;f!==d.prev;){if(d.i!==f.i&&od(d,f)){let _=yh(d,f);return d=bs(d,d.next),_=bs(_,_.next),xo(d,t,r,s,l,c,0),void xo(_,t,r,s,l,c,0)}f=f.next}d=d.next}while(d!==i)}function rd(i,t){return i.x-t.x}function nd(i,t){const r=function(l,c){let d=c;const f=l.x,_=l.y;let x,b=-1/0;do{if(_<=d.y&&_>=d.next.y&&d.next.y!==d.y){const z=d.x+(_-d.y)*(d.next.x-d.x)/(d.next.y-d.y);if(z<=f&&z>b&&(b=z,x=d.x=d.x&&d.x>=I&&f!==d.x&&ua(_x.x||d.x===x.x&&sd(x,d)))&&(x=d,k=z)}d=d.next}while(d!==w);return x}(i,t);if(!r)return t;const s=yh(r,i);return bs(s,s.next),bs(r,r.next)}function sd(i,t){return Tt(i.prev,i,t.prev)<0&&Tt(t.next,i,i.next)<0}function gc(i,t,r,s,l){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*l|0)|i<<8))|i<<4))|i<<2))|i<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-s)*l|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function ad(i){let t=i,r=i;do(t.x=(i-d)*(c-f)&&(i-d)*(s-f)>=(r-d)*(t-f)&&(r-d)*(c-f)>=(l-d)*(s-f)}function od(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!function(r,s){let l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==s.i&&l.next.i!==s.i&&gh(l,l.next,r,s))return!0;l=l.next}while(l!==r);return!1}(i,t)&&(vo(i,t)&&vo(t,i)&&function(r,s){let l=r,c=!1;const d=(r.x+s.x)/2,f=(r.y+s.y)/2;do l.y>f!=l.next.y>f&&l.next.y!==l.y&&d<(l.next.x-l.x)*(f-l.y)/(l.next.y-l.y)+l.x&&(c=!c),l=l.next;while(l!==r);return c}(i,t)&&(Tt(i.prev,i,t.prev)||Tt(i,t.prev,t))||bl(i,t)&&Tt(i.prev,i,i.next)>0&&Tt(t.prev,t,t.next)>0)}function Tt(i,t,r){return(t.y-i.y)*(r.x-t.x)-(t.x-i.x)*(r.y-t.y)}function bl(i,t){return i.x===t.x&&i.y===t.y}function gh(i,t,r,s){const l=Tl(Tt(i,t,r)),c=Tl(Tt(i,t,s)),d=Tl(Tt(r,s,i)),f=Tl(Tt(r,s,t));return l!==c&&d!==f||!(l!==0||!wl(i,r,t))||!(c!==0||!wl(i,s,t))||!(d!==0||!wl(r,i,s))||!(f!==0||!wl(r,t,s))}function wl(i,t,r){return t.x<=Math.max(i.x,r.x)&&t.x>=Math.min(i.x,r.x)&&t.y<=Math.max(i.y,r.y)&&t.y>=Math.min(i.y,r.y)}function Tl(i){return i>0?1:i<0?-1:0}function vo(i,t){return Tt(i.prev,i,i.next)<0?Tt(i,t,i.next)>=0&&Tt(i,i.prev,t)>=0:Tt(i,t,i.prev)<0||Tt(i,i.next,t)<0}function yh(i,t){const r=yc(i.i,i.x,i.y),s=yc(t.i,t.x,t.y),l=i.next,c=t.prev;return i.next=t,t.prev=i,r.next=l,l.prev=r,s.next=r,r.prev=s,c.next=s,s.prev=c,s}function xh(i,t,r,s){const l=yc(i,t,r);return s?(l.next=s.next,l.prev=s,s.next.prev=l,s.next=l):(l.prev=l,l.next=l),l}function bo(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 yc(i,t,r){return{i,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function xc(i,t,r){const s=r.patternDependencies;let l=!1;for(const c of t){const d=c.paint.get(`${i}-pattern`);d.isConstant()||(l=!0);const f=d.constantOr(null);f&&(l=!0,s[f.to]=!0,s[f.from]=!0)}return l}function vc(i,t,r,s,l){const c=l.patternDependencies;for(const d of t){const f=d.paint.get(`${i}-pattern`).value;if(f.kind!=="constant"){let _=f.evaluate({zoom:s-1},r,{},l.availableImages),x=f.evaluate({zoom:s},r,{},l.availableImages),b=f.evaluate({zoom:s+1},r,{},l.availableImages);_=_&&_.name?_.name:_,x=x&&x.name?x.name:x,b=b&&b.name?b.name:b,c[_]=!0,c[x]=!0,c[b]=!0,r.patterns[d.id]={min:_,mid:x,max:b}}}return r}class bc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ho,this.indexArray=new Er,this.indexArray2=new fs,this.programConfigurations=new ys(t.layers,t.zoom),this.segments=new Et,this.segments2=new Et,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,s){this.hasPattern=xc("fill",this.layers,r);const l=this.layers[0].layout.get("fill-sort-key"),c=!l.isConstant(),d=[];for(const{feature:f,id:_,index:x,sourceLayerIndex:b}of t){const w=this.layers[0]._featureFilter.needGeometry,I=vs(f,w);if(!this.layers[0]._featureFilter.filter(new it(this.zoom),I,s))continue;const M=c?l.evaluate(I,{},s,r.availableImages):void 0,k={id:_,properties:f.properties,type:f.type,sourceLayerIndex:b,index:x,geometry:w?I.geometry:xs(f),patterns:{},sortKey:M};d.push(k)}c&&d.sort((f,_)=>f.sortKey-_.sortKey);for(const f of d){const{geometry:_,index:x,sourceLayerIndex:b}=f;if(this.hasPattern){const w=vc("fill",this.layers,f,this.zoom,r);this.patternFeatures.push(w)}else this.addFeature(f,_,x,s,{});r.featureIndex.insert(t[x].feature,_,x,b,this.index)}}update(t,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,s)}addFeatures(t,r,s){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Yu),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,r,s,l,c){for(const d of Os(r,500)){let f=0;for(const M of d)f+=M.length;const _=this.segments.prepareSegment(f,this.layoutVertexArray,this.indexArray),x=_.vertexLength,b=[],w=[];for(const M of d){if(M.length===0)continue;M!==d[0]&&w.push(b.length/2);const k=this.segments2.prepareSegment(M.length,this.layoutVertexArray,this.indexArray2),z=k.vertexLength;this.layoutVertexArray.emplaceBack(M[0].x,M[0].y),this.indexArray2.emplaceBack(z+M.length-1,z),b.push(M[0].x),b.push(M[0].y);for(let O=1;O>3}if(l--,s===1||s===2)c+=i.readSVarint(),d+=i.readSVarint(),s===1&&(t&&f.push(t),t=[]),t.push(new pd(c,d));else{if(s!==7)throw new Error("unknown command "+s);t&&t.push(t[0].clone())}}return t&&f.push(t),f},da.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var t=i.readVarint()+i.pos,r=1,s=0,l=0,c=0,d=1/0,f=-1/0,_=1/0,x=-1/0;i.pos>3}if(s--,r===1||r===2)(l+=i.readSVarint())f&&(f=l),(c+=i.readSVarint())<_&&(_=c),c>x&&(x=c);else if(r!==7)throw new Error("unknown command "+r)}return[d,_,f,x]},da.prototype.toGeoJSON=function(i,t,r){var s,l,c=this.extent*Math.pow(2,r),d=this.extent*i,f=this.extent*t,_=this.loadGeometry(),x=da.types[this.type];function b(M){for(var k=0;k>3;l=d===1?s.readString():d===2?s.readFloat():d===3?s.readDouble():d===4?s.readVarint64():d===5?s.readVarint():d===6?s.readSVarint():d===7?s.readBoolean():null}return l}(r))}Sh.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var t=this._pbf.readVarint()+this._pbf.pos;return new _d(this._pbf,t,this.extent,this._keys,this._values)};var yd=Th;function xd(i,t,r){if(i===3){var s=new yd(r,r.readVarint()+r.pos);s.length&&(t[s.name]=s)}}Mn.VectorTile=function(i,t){this.layers=i.readFields(xd,{},t)},Mn.VectorTileFeature=wh,Mn.VectorTileLayer=Th;const vd=Mn.VectorTileFeature.types,wc=Math.pow(2,13);function wo(i,t,r,s,l,c,d,f){i.emplaceBack(t,r,2*Math.floor(s*wc)+d,l*wc*2,c*wc*2,Math.round(f))}class Tc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ti,this.centroidVertexArray=new kr,this.indexArray=new Er,this.programConfigurations=new ys(t.layers,t.zoom),this.segments=new Et,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,s){this.features=[],this.hasPattern=xc("fill-extrusion",this.layers,r);for(const{feature:l,id:c,index:d,sourceLayerIndex:f}of t){const _=this.layers[0]._featureFilter.needGeometry,x=vs(l,_);if(!this.layers[0]._featureFilter.filter(new it(this.zoom),x,s))continue;const b={id:c,sourceLayerIndex:f,index:d,geometry:_?x.geometry:xs(l),properties:l.properties,type:l.type,patterns:{}};this.hasPattern?this.features.push(vc("fill-extrusion",this.layers,b,this.zoom,r)):this.addFeature(b,b.geometry,d,s,{}),r.featureIndex.insert(l,b.geometry,d,f,this.index,!0)}}addFeatures(t,r,s){for(const l of this.features){const{geometry:c}=l;this.addFeature(l,c,l.index,r,s)}}update(t,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,dd),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,ud.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,r,s,l,c){for(const d of Os(r,500)){const f={x:0,y:0,vertexCount:0};let _=0;for(const k of d)_+=k.length;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const k of d){if(k.length===0||wd(k))continue;let z=0;for(let O=0;O=1){const Q=k[O-1];if(!bd($,Q)){x.vertexLength+4>Et.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const G=$.sub(Q)._perp()._unit(),K=Q.dist($);z+K>32768&&(z=0),wo(this.layoutVertexArray,$.x,$.y,G.x,G.y,0,0,z),wo(this.layoutVertexArray,$.x,$.y,G.x,G.y,0,1,z),f.x+=2*$.x,f.y+=2*$.y,f.vertexCount+=2,z+=K,wo(this.layoutVertexArray,Q.x,Q.y,G.x,G.y,0,0,z),wo(this.layoutVertexArray,Q.x,Q.y,G.x,G.y,0,1,z),f.x+=2*Q.x,f.y+=2*Q.y,f.vertexCount+=2;const re=x.vertexLength;this.indexArray.emplaceBack(re,re+2,re+1),this.indexArray.emplaceBack(re+1,re+2,re+3),x.vertexLength+=4,x.primitiveLength+=2}}}}if(x.vertexLength+_>Et.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(_,this.layoutVertexArray,this.indexArray)),vd[t.type]!=="Polygon")continue;const b=[],w=[],I=x.vertexLength;for(const k of d)if(k.length!==0){k!==d[0]&&w.push(b.length/2);for(let z=0;zPt)||i.y===t.y&&(i.y<0||i.y>Pt)}function wd(i){return i.every(t=>t.x<0)||i.every(t=>t.x>Pt)||i.every(t=>t.y<0)||i.every(t=>t.y>Pt)}let Ih;Se("FillExtrusionBucket",Tc,{omit:["layers","features"]});var Td={get paint(){return Ih=Ih||new m({"fill-extrusion-opacity":new e(ie["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new n(ie["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new e(ie["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new e(ie["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new a(ie["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new n(ie["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new n(ie["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new e(ie["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Sd extends y{constructor(t){super(t,Td)}createBucket(t){return new Tc(t)}queryRadius(){return yl(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,r,s,l,c,d,f,_){const x=xl(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),d.angle,f),b=this.paint.get("fill-extrusion-height").evaluate(r,s),w=this.paint.get("fill-extrusion-base").evaluate(r,s),I=function(k,z,O,$){const Q=[];for(const G of k){const K=[G.x,G.y,0,1];vl(K,K,z),Q.push(new _e(K[0]/K[3],K[1]/K[3]))}return Q}(x,_),M=function(k,z,O,$){const Q=[],G=[],K=$[8]*z,re=$[9]*z,ce=$[10]*z,be=$[11]*z,De=$[8]*O,ve=$[9]*O,ye=$[10]*O,Ce=$[11]*O;for(const Pe of k){const Ie=[],ae=[];for(const ke of Pe){const Me=ke.x,Be=ke.y,st=$[0]*Me+$[4]*Be+$[12],nt=$[1]*Me+$[5]*Be+$[13],Ct=$[2]*Me+$[6]*Be+$[14],nr=$[3]*Me+$[7]*Be+$[15],$t=Ct+ce,kt=nr+be,ri=st+De,ni=nt+ve,si=Ct+ye,bt=nr+Ce,zt=new _e((st+K)/kt,(nt+re)/kt);zt.z=$t/kt,Ie.push(zt);const Jt=new _e(ri/bt,ni/bt);Jt.z=si/bt,ae.push(Jt)}Q.push(Ie),G.push(ae)}return[Q,G]}(l,w,b,_);return function(k,z,O){let $=1/0;rh(O,z)&&($=Ph(O,z[0]));for(let Q=0;Qr.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new Fi,this.layoutVertexArray2=new zr,this.indexArray=new Er,this.programConfigurations=new ys(t.layers,t.zoom),this.segments=new Et,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,s){this.hasPattern=xc("line",this.layers,r);const l=this.layers[0].layout.get("line-sort-key"),c=!l.isConstant(),d=[];for(const{feature:f,id:_,index:x,sourceLayerIndex:b}of t){const w=this.layers[0]._featureFilter.needGeometry,I=vs(f,w);if(!this.layers[0]._featureFilter.filter(new it(this.zoom),I,s))continue;const M=c?l.evaluate(I,{},s):void 0,k={id:_,properties:f.properties,type:f.type,sourceLayerIndex:b,index:x,geometry:w?I.geometry:xs(f),patterns:{},sortKey:M};d.push(k)}c&&d.sort((f,_)=>f.sortKey-_.sortKey);for(const f of d){const{geometry:_,index:x,sourceLayerIndex:b}=f;if(this.hasPattern){const w=vc("line",this.layers,f,this.zoom,r);this.patternFeatures.push(w)}else this.addFeature(f,_,x,s,{});r.featureIndex.insert(t[x].feature,_,x,b,this.index)}}update(t,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,s)}addFeatures(t,r,s){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Md)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Pd),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,r,s,l,c){const d=this.layers[0].layout,f=d.get("line-join").evaluate(t,{}),_=d.get("line-cap"),x=d.get("line-miter-limit"),b=d.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const w of r)this.addLine(w,t,f,_,x,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,s,c,l)}addLine(t,r,s,l,c,d){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let $=0;$=2&&t[_-1].equals(t[_-2]);)_--;let x=0;for(;x<_-1&&t[x].equals(t[x+1]);)x++;if(_<(f?3:2))return;s==="bevel"&&(c=1.05);const b=this.overscaling<=16?15*Pt/(512*this.overscaling):0,w=this.segments.prepareSegment(10*_,this.layoutVertexArray,this.indexArray);let I,M,k,z,O;this.e1=this.e2=-1,f&&(I=t[_-2],O=t[x].sub(I)._unit()._perp());for(let $=x;$<_;$++){if(k=$===_-1?f?t[x+1]:void 0:t[$+1],k&&t[$].equals(k))continue;O&&(z=O),I&&(M=I),I=t[$],O=k?k.sub(I)._unit()._perp():z,z=z||O;let Q=z.add(O);Q.x===0&&Q.y===0||Q._unit();const G=z.x*O.x+z.y*O.y,K=Q.x*O.x+Q.y*O.y,re=K!==0?1/K:1/0,ce=2*Math.sqrt(2-2*K),be=K0;if(be&&$>x){const Ce=I.dist(M);if(Ce>2*b){const Pe=I.sub(I.sub(M)._mult(b/Ce)._round());this.updateDistance(M,Pe),this.addCurrentVertex(Pe,z,0,0,w),M=Pe}}const ve=M&&k;let ye=ve?s:f?"butt":l;if(ve&&ye==="round"&&(rec&&(ye="bevel"),ye==="bevel"&&(re>2&&(ye="flipbevel"),re100)Q=O.mult(-1);else{const Ce=re*z.add(O).mag()/z.sub(O).mag();Q._perp()._mult(Ce*(De?-1:1))}this.addCurrentVertex(I,Q,0,0,w),this.addCurrentVertex(I,Q.mult(-1),0,0,w)}else if(ye==="bevel"||ye==="fakeround"){const Ce=-Math.sqrt(re*re-1),Pe=De?Ce:0,Ie=De?0:Ce;if(M&&this.addCurrentVertex(I,z,Pe,Ie,w),ye==="fakeround"){const ae=Math.round(180*ce/Math.PI/20);for(let ke=1;ke2*b){const Pe=I.add(k.sub(I)._mult(b/Ce)._round());this.updateDistance(I,Pe),this.addCurrentVertex(Pe,O,0,0,w),I=Pe}}}}addCurrentVertex(t,r,s,l,c,d=!1){const f=r.y*l-r.x,_=-r.y-r.x*l;this.addHalfVertex(t,r.x+r.y*s,r.y-r.x*s,d,!1,s,c),this.addHalfVertex(t,f,_,d,!0,-l,c),this.distance>Ah/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,r,s,l,c,d))}addHalfVertex({x:t,y:r},s,l,c,d,f,_){const x=.5*(this.lineClips?this.scaledDistance*(Ah-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(c?1:0),(r<<1)+(d?1:0),Math.round(63*s)+128,Math.round(63*l)+128,1+(f===0?0:f<0?-1:1)|(63&x)<<2,x>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const b=_.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),_.primitiveLength++),d?this.e2=b:this.e1=b}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,r){this.distance+=t.dist(r),this.updateScaledDistance()}}let Mh,Ch;Se("LineBucket",Sc,{omit:["layers","patternFeatures"]});var kh={get paint(){return Ch=Ch||new m({"line-opacity":new n(ie.paint_line["line-opacity"]),"line-color":new n(ie.paint_line["line-color"]),"line-translate":new e(ie.paint_line["line-translate"]),"line-translate-anchor":new e(ie.paint_line["line-translate-anchor"]),"line-width":new n(ie.paint_line["line-width"]),"line-gap-width":new n(ie.paint_line["line-gap-width"]),"line-offset":new n(ie.paint_line["line-offset"]),"line-blur":new n(ie.paint_line["line-blur"]),"line-dasharray":new o(ie.paint_line["line-dasharray"]),"line-pattern":new a(ie.paint_line["line-pattern"]),"line-gradient":new u(ie.paint_line["line-gradient"])})},get layout(){return Mh=Mh||new m({"line-cap":new e(ie.layout_line["line-cap"]),"line-join":new n(ie.layout_line["line-join"]),"line-miter-limit":new e(ie.layout_line["line-miter-limit"]),"line-round-limit":new e(ie.layout_line["line-round-limit"]),"line-sort-key":new n(ie.layout_line["line-sort-key"])})}};class zd extends n{possiblyEvaluate(t,r){return r=new it(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(t,r)}evaluate(t,r,s,l){return r=xi({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(t,r,s,l)}}let Sl;class Ed extends y{constructor(t){super(t,kh),this.gradientVersion=0,Sl||(Sl=new zd(kh.paint.properties["line-width"].specification),Sl.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!function(s){return s._styleExpression!==void 0}(r)&&r._styleExpression.expression instanceof pn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,r){super.recalculate(t,r),this.paint._values["line-floorwidth"]=Sl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Sc(t)}queryRadius(t){const r=t,s=zh(_o("line-width",this,r),_o("line-gap-width",this,r)),l=_o("line-offset",this,r);return s/2+Math.abs(l)+yl(this.paint.get("line-translate"))}queryIntersectsFeature(t,r,s,l,c,d,f){const _=xl(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),d.angle,f),x=f/2*zh(this.paint.get("line-width").evaluate(r,s),this.paint.get("line-gap-width").evaluate(r,s)),b=this.paint.get("line-offset").evaluate(r,s);return b&&(l=function(w,I){const M=[];for(let k=0;k=3){for(let O=0;O0?t+2*i:i}const Dd=C([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ld=C([{name:"a_projected_pos",components:3,type:"Float32"}],4);C([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Rd=C([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);C([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Eh=C([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Bd=C([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Fd(i,t,r){return i.sections.forEach(s=>{s.text=function(l,c,d){const f=c.layout.get("text-transform").evaluate(d,{});return f==="uppercase"?l=l.toLocaleUpperCase():f==="lowercase"&&(l=l.toLocaleLowerCase()),ir.applyArabicShaping&&(l=ir.applyArabicShaping(l)),l}(s.text,t,r)}),i}C([{name:"triangle",components:3,type:"Uint16"}]),C([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),C([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),C([{type:"Float32",name:"offsetX"}]),C([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),C([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const So={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Mt=24,Dh=rt,Lh=function(i,t,r,s,l){var c,d,f=8*l-s-1,_=(1<>1,b=-7,w=l-1,I=-1,M=i[t+w];for(w+=I,c=M&(1<<-b)-1,M>>=-b,b+=f;b>0;c=256*c+i[t+w],w+=I,b-=8);for(d=c&(1<<-b)-1,c>>=-b,b+=s;b>0;d=256*d+i[t+w],w+=I,b-=8);if(c===0)c=1-x;else{if(c===_)return d?NaN:1/0*(M?-1:1);d+=Math.pow(2,s),c-=x}return(M?-1:1)*d*Math.pow(2,c-s)},Rh=function(i,t,r,s,l,c){var d,f,_,x=8*c-l-1,b=(1<>1,I=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=0,k=1,z=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,d=b):(d=Math.floor(Math.log(t)/Math.LN2),t*(_=Math.pow(2,-d))<1&&(d--,_*=2),(t+=d+w>=1?I/_:I*Math.pow(2,1-w))*_>=2&&(d++,_/=2),d+w>=b?(f=0,d=b):d+w>=1?(f=(t*_-1)*Math.pow(2,l),d+=w):(f=t*Math.pow(2,w-1)*Math.pow(2,l),d=0));l>=8;i[r+M]=255&f,M+=k,f/=256,l-=8);for(d=d<0;i[r+M]=255&d,M+=k,d/=256,x-=8);i[r+M-k]|=128*z};function rt(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}rt.Varint=0,rt.Fixed64=1,rt.Bytes=2,rt.Fixed32=5;var Ic=4294967296,Bh=1/Ic,Fh=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function sn(i){return i.type===rt.Bytes?i.readVarint()+i.pos:i.pos+1}function pa(i,t,r){return r?4294967296*t+(i>>>0):4294967296*(t>>>0)+(i>>>0)}function Oh(i,t,r){var s=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(s);for(var l=r.pos-1;l>=i;l--)r.buf[l+s]=r.buf[l]}function Od(i,t){for(var r=0;r>>8,i[r+2]=t>>>16,i[r+3]=t>>>24}function Vh(i,t){return(i[t]|i[t+1]<<8|i[t+2]<<16)+(i[t+3]<<24)}rt.prototype={destroy:function(){this.buf=null},readFields:function(i,t,r){for(r=r||this.length;this.pos>3,c=this.pos;this.type=7&s,i(l,t,this),this.pos===c&&this.skip(s)}return t},readMessage:function(i,t){return this.readFields(i,t,this.readVarint()+this.pos)},readFixed32:function(){var i=Il(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=Vh(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Il(this.buf,this.pos)+Il(this.buf,this.pos+4)*Ic;return this.pos+=8,i},readSFixed64:function(){var i=Il(this.buf,this.pos)+Vh(this.buf,this.pos+4)*Ic;return this.pos+=8,i},readFloat:function(){var i=Lh(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=Lh(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var t,r,s=this.buf;return t=127&(r=s[this.pos++]),r<128?t:(t|=(127&(r=s[this.pos++]))<<7,r<128?t:(t|=(127&(r=s[this.pos++]))<<14,r<128?t:(t|=(127&(r=s[this.pos++]))<<21,r<128?t:function(l,c,d){var f,_,x=d.buf;if(f=(112&(_=x[d.pos++]))>>4,_<128||(f|=(127&(_=x[d.pos++]))<<3,_<128)||(f|=(127&(_=x[d.pos++]))<<10,_<128)||(f|=(127&(_=x[d.pos++]))<<17,_<128)||(f|=(127&(_=x[d.pos++]))<<24,_<128)||(f|=(1&(_=x[d.pos++]))<<31,_<128))return pa(l,f,c);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=s[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,t=this.pos;return this.pos=i,i-t>=12&&Fh?function(r,s,l){return Fh.decode(r.subarray(s,l))}(this.buf,t,i):function(r,s,l){for(var c="",d=s;d239?4:b>223?3:b>191?2:1;if(d+I>l)break;I===1?b<128&&(w=b):I===2?(192&(f=r[d+1]))==128&&(w=(31&b)<<6|63&f)<=127&&(w=null):I===3?(_=r[d+2],(192&(f=r[d+1]))==128&&(192&_)==128&&((w=(15&b)<<12|(63&f)<<6|63&_)<=2047||w>=55296&&w<=57343)&&(w=null)):I===4&&(_=r[d+2],x=r[d+3],(192&(f=r[d+1]))==128&&(192&_)==128&&(192&x)==128&&((w=(15&b)<<18|(63&f)<<12|(63&_)<<6|63&x)<=65535||w>=1114112)&&(w=null)),w===null?(w=65533,I=1):w>65535&&(w-=65536,c+=String.fromCharCode(w>>>10&1023|55296),w=56320|1023&w),c+=String.fromCharCode(w),d+=I}return c}(this.buf,t,i)},readBytes:function(){var i=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,i);return this.pos=i,t},readPackedVarint:function(i,t){if(this.type!==rt.Bytes)return i.push(this.readVarint(t));var r=sn(this);for(i=i||[];this.pos127;);else if(t===rt.Bytes)this.pos=this.readVarint()+this.pos;else if(t===rt.Fixed32)this.pos+=4;else{if(t!==rt.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(i,t){this.writeVarint(i<<3|t)},realloc:function(i){for(var t=this.length||16;t268435455||i<0?function(t,r){var s,l;if(t>=0?(s=t%4294967296|0,l=t/4294967296|0):(l=~(-t/4294967296),4294967295^(s=~(-t%4294967296))?s=s+1|0:(s=0,l=l+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(c,d,f){f.buf[f.pos++]=127&c|128,c>>>=7,f.buf[f.pos++]=127&c|128,c>>>=7,f.buf[f.pos++]=127&c|128,c>>>=7,f.buf[f.pos++]=127&c|128,f.buf[f.pos]=127&(c>>>=7)}(s,0,r),function(c,d){var f=(7&c)<<4;d.buf[d.pos++]|=f|((c>>>=3)?128:0),c&&(d.buf[d.pos++]=127&c|((c>>>=7)?128:0),c&&(d.buf[d.pos++]=127&c|((c>>>=7)?128:0),c&&(d.buf[d.pos++]=127&c|((c>>>=7)?128:0),c&&(d.buf[d.pos++]=127&c|((c>>>=7)?128:0),c&&(d.buf[d.pos++]=127&c)))))}(l,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var t=this.pos;this.pos=function(s,l,c){for(var d,f,_=0;_55295&&d<57344){if(!f){d>56319||_+1===l.length?(s[c++]=239,s[c++]=191,s[c++]=189):f=d;continue}if(d<56320){s[c++]=239,s[c++]=191,s[c++]=189,f=d;continue}d=f-55296<<10|d-56320|65536,f=null}else f&&(s[c++]=239,s[c++]=191,s[c++]=189,f=null);d<128?s[c++]=d:(d<2048?s[c++]=d>>6|192:(d<65536?s[c++]=d>>12|224:(s[c++]=d>>18|240,s[c++]=d>>12&63|128),s[c++]=d>>6&63|128),s[c++]=63&d|128)}return c}(this.buf,i,this.pos);var r=this.pos-t;r>=128&&Oh(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),Rh(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),Rh(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var t=i.length;this.writeVarint(t),this.realloc(t);for(var r=0;r=128&&Oh(r,s,this),this.pos=r-1,this.writeVarint(s),this.pos+=s},writeMessage:function(i,t,r){this.writeTag(i,rt.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(i,t){t.length&&this.writeMessage(i,Od,t)},writePackedSVarint:function(i,t){t.length&&this.writeMessage(i,Vd,t)},writePackedBoolean:function(i,t){t.length&&this.writeMessage(i,Ud,t)},writePackedFloat:function(i,t){t.length&&this.writeMessage(i,Nd,t)},writePackedDouble:function(i,t){t.length&&this.writeMessage(i,jd,t)},writePackedFixed32:function(i,t){t.length&&this.writeMessage(i,$d,t)},writePackedSFixed32:function(i,t){t.length&&this.writeMessage(i,qd,t)},writePackedFixed64:function(i,t){t.length&&this.writeMessage(i,Zd,t)},writePackedSFixed64:function(i,t){t.length&&this.writeMessage(i,Gd,t)},writeBytesField:function(i,t){this.writeTag(i,rt.Bytes),this.writeBytes(t)},writeFixed32Field:function(i,t){this.writeTag(i,rt.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(i,t){this.writeTag(i,rt.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(i,t){this.writeTag(i,rt.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(i,t){this.writeTag(i,rt.Fixed64),this.writeSFixed64(t)},writeVarintField:function(i,t){this.writeTag(i,rt.Varint),this.writeVarint(t)},writeSVarintField:function(i,t){this.writeTag(i,rt.Varint),this.writeSVarint(t)},writeStringField:function(i,t){this.writeTag(i,rt.Bytes),this.writeString(t)},writeFloatField:function(i,t){this.writeTag(i,rt.Fixed32),this.writeFloat(t)},writeDoubleField:function(i,t){this.writeTag(i,rt.Fixed64),this.writeDouble(t)},writeBooleanField:function(i,t){this.writeVarintField(i,!!t)}};var Pc=Pi(Dh);const Ac=3;function Hd(i,t,r){i===1&&r.readMessage(Xd,t)}function Xd(i,t,r){if(i===3){const{id:s,bitmap:l,width:c,height:d,left:f,top:_,advance:x}=r.readMessage(Wd,{});t.push({id:s,bitmap:new yo({width:c+2*Ac,height:d+2*Ac},l),metrics:{width:c,height:d,left:f,top:_,advance:x}})}}function Wd(i,t,r){i===1?t.id=r.readVarint():i===2?t.bitmap=r.readBytes():i===3?t.width=r.readVarint():i===4?t.height=r.readVarint():i===5?t.left=r.readSVarint():i===6?t.top=r.readSVarint():i===7&&(t.advance=r.readVarint())}const Nh=Ac;function jh(i){let t=0,r=0;for(const d of i)t+=d.w*d.h,r=Math.max(r,d.w);i.sort((d,f)=>f.h-d.h);const s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let l=0,c=0;for(const d of i)for(let f=s.length-1;f>=0;f--){const _=s[f];if(!(d.w>_.w||d.h>_.h)){if(d.x=_.x,d.y=_.y,c=Math.max(c,d.y+d.h),l=Math.max(l,d.x+d.w),d.w===_.w&&d.h===_.h){const x=s.pop();f=0&&s>=t&&Al[this.text.charCodeAt(s)];s--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)}substring(t,r){const s=new ma;return s.text=this.text.substring(t,r),s.sectionIndex=this.sectionIndex.slice(t,r),s.sections=this.sections,s}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,r)=>Math.max(t,this.sections[r].scale),0)}addTextSection(t,r){this.text+=t.text,this.sections.push(Po.forText(t.scale,t.fontStack||r));const s=this.sections.length-1;for(let l=0;l=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Pl(i,t,r,s,l,c,d,f,_,x,b,w,I,M,k){const z=ma.fromFeature(i,l);let O;w===L.ah.vertical&&z.verticalizePunctuation();const{processBidirectionalText:$,processStyledBidirectionalText:Q}=ir;if($&&z.sections.length===1){O=[];const re=$(z.toString(),Cc(z,x,c,t,s,M));for(const ce of re){const be=new ma;be.text=ce,be.sections=z.sections;for(let De=0;De0&&an>Zt&&(Zt=an)}else{const Ui=be[Ke.fontStack],Dt=Ui&&Ui[dt];if(Dt&&Dt.rect)xa=Dt.rect,xt=Dt.metrics;else{const an=ce[Ke.fontStack],Eo=an&&an[dt];if(!Eo)continue;xt=Eo.metrics}Si=(zt-Ke.scale)*Mt}sr?(re.verticalizable=!0,ai.push({glyph:dt,imageName:Rr,x:Be,y:st+Si,vertical:sr,scale:Ke.scale,fontStack:Ke.fontStack,sectionIndex:ct,metrics:xt,rect:xa}),Be+=Br*Ke.scale+ae):(ai.push({glyph:dt,imageName:Rr,x:Be,y:st+Si,vertical:sr,scale:Ke.scale,fontStack:Ke.fontStack,sectionIndex:ct,metrics:xt,rect:xa}),Be+=xt.advance*Ke.scale+ae)}ai.length!==0&&(nt=Math.max(Be-ae,nt),Qd(ai,0,ai.length-1,nr,Zt)),Be=0;const ji=ye*zt+Zt;qt.lineOffset=Math.max(Zt,Jt),st+=ji,Ct=Math.max(ji,Ct),++$t}var kt;const ri=st-Io,{horizontalAlign:ni,verticalAlign:si}=kc(Ce);(function(bt,zt,Jt,qt,ai,Zt,ji,yi,Ke){const ct=(zt-Jt)*ai;let dt=0;dt=Zt!==ji?-yi*qt-Io:(-qt*Ke+.5)*ji;for(const Si of bt)for(const xt of Si.positionedGlyphs)xt.x+=ct,xt.y+=dt})(re.positionedLines,nr,ni,si,nt,Ct,ye,ri,ve.length),re.top+=-si*ri,re.bottom=re.top+ri,re.left+=-ni*nt,re.right=re.left+nt}(K,t,r,s,O,d,f,_,w,x,I,k),!function(re){for(const ce of re)if(ce.positionedGlyphs.length!==0)return!1;return!0}(G)&&K}const Al={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Kd={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Jd={40:!0};function $h(i,t,r,s,l,c){if(t.imageName){const d=s[t.imageName];return d?d.displaySize[0]*t.scale*Mt/c+l:0}{const d=r[t.fontStack],f=d&&d[i];return f?f.metrics.advance*t.scale+l:0}}function qh(i,t,r,s){const l=Math.pow(i-t,2);return s?i=0;let x=0;for(let w=0;wx){const b=Math.ceil(c/x);l*=b/d,d=b}return{x1:s,y1:l,x2:s+c,y2:l+d}}function Xh(i,t,r,s,l,c){const d=i.image;let f;if(d.content){const O=d.content,$=d.pixelRatio||1;f=[O[0]/$,O[1]/$,d.displaySize[0]-O[2]/$,d.displaySize[1]-O[3]/$]}const _=t.left*c,x=t.right*c;let b,w,I,M;r==="width"||r==="both"?(M=l[0]+_-s[3],w=l[0]+x+s[1]):(M=l[0]+(_+x-d.displaySize[0])/2,w=M+d.displaySize[0]);const k=t.top*c,z=t.bottom*c;return r==="height"||r==="both"?(b=l[1]+k-s[0],I=l[1]+z+s[2]):(b=l[1]+(k+z-d.displaySize[1])/2,I=b+d.displaySize[1]),{image:d,top:b,right:w,bottom:I,left:M,collisionPadding:f}}const Ao=255,Lr=128,kn=Ao*Lr;function Wh(i,t){const{expression:r}=t;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new it(i+1))};if(r.kind==="source")return{kind:"source"};{const{zoomStops:s,interpolationType:l}=r;let c=0;for(;cd.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=fc([]),this.placementViewportMatrix=fc([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Wh(this.zoom,r["text-size"]),this.iconSizeData=Wh(this.zoom,r["icon-size"]);const s=this.layers[0].layout,l=s.get("symbol-sort-key"),c=s.get("symbol-z-order");this.canOverlap=zc(s,"text-overlap","text-allow-overlap")!=="never"||zc(s,"icon-overlap","icon-allow-overlap")!=="never"||s.get("text-ignore-placement")||s.get("icon-ignore-placement"),this.sortFeaturesByKey=c!=="viewport-y"&&!l.isConstant(),this.sortFeaturesByY=(c==="viewport-y"||c==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,s.get("symbol-placement")==="point"&&(this.writingModes=s.get("text-writing-mode").map(d=>L.ah[d])),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id),this.sourceID=t.sourceID}createArrays(){this.text=new Dc(new ys(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new Dc(new ys(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new Vt,this.lineVertexArray=new Nt,this.symbolInstances=new Wt,this.textAnchorOffsets=new tn}calculateGlyphDependencies(t,r,s,l,c){for(let d=0;d0)&&(d.value.kind!=="constant"||d.value.value.length>0),b=_.value.kind!=="constant"||!!_.value.value||Object.keys(_.parameters).length>0,w=c.get("symbol-sort-key");if(this.features=[],!x&&!b)return;const I=r.iconDependencies,M=r.glyphDependencies,k=r.availableImages,z=new it(this.zoom);for(const{feature:O,id:$,index:Q,sourceLayerIndex:G}of t){const K=l._featureFilter.needGeometry,re=vs(O,K);if(!l._featureFilter.filter(z,re,s))continue;let ce,be;if(K||(re.geometry=xs(O)),x){const ve=l.getValueAndResolveTokens("text-field",re,s,k),ye=ci.factory(ve),Ce=this.hasRTLText=this.hasRTLText||rp(ye);(!Ce||ir.getRTLTextPluginStatus()==="unavailable"||Ce&&ir.isParsed())&&(ce=Fd(ye,l,re))}if(b){const ve=l.getValueAndResolveTokens("icon-image",re,s,k);be=ve instanceof Ft?ve:Ft.fromString(ve)}if(!ce&&!be)continue;const De=this.sortFeaturesByKey?w.evaluate(re,{},s):void 0;if(this.features.push({id:$,text:ce,icon:be,index:Q,sourceLayerIndex:G,geometry:re.geometry,properties:O.properties,type:tp[O.type],sortKey:De}),be&&(I[be.name]=!0),ce){const ve=d.evaluate(re,{},s).join(","),ye=c.get("text-rotation-alignment")!=="viewport"&&c.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(L.ah.vertical)>=0;for(const Ce of ce.sections)if(Ce.image)I[Ce.image.name]=!0;else{const Pe=no(ce.toString()),Ie=Ce.fontStack||ve,ae=M[Ie]=M[Ie]||{};this.calculateGlyphDependencies(Ce.text,ae,ye,this.allowVerticalPlacement,Pe)}}}c.get("symbol-placement")==="line"&&(this.features=function(O){const $={},Q={},G=[];let K=0;function re(ve){G.push(O[ve]),K++}function ce(ve,ye,Ce){const Pe=Q[ve];return delete Q[ve],Q[ye]=Pe,G[Pe].geometry[0].pop(),G[Pe].geometry[0]=G[Pe].geometry[0].concat(Ce[0]),Pe}function be(ve,ye,Ce){const Pe=$[ye];return delete $[ye],$[ve]=Pe,G[Pe].geometry[0].shift(),G[Pe].geometry[0]=Ce[0].concat(G[Pe].geometry[0]),Pe}function De(ve,ye,Ce){const Pe=Ce?ye[0][ye[0].length-1]:ye[0][0];return`${ve}:${Pe.x}:${Pe.y}`}for(let ve=0;veve.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((O,$)=>O.sortKey-$.sortKey)}update(t,r,s){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,r,this.layers,s),this.icon.programConfigurations.updatePaintArrays(t,r,this.layers,s))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,r){const s=this.lineVertexArray.length;if(t.segment!==void 0){let l=t.dist(r[t.segment+1]),c=t.dist(r[t.segment]);const d={};for(let f=t.segment+1;f=0;f--)d[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:c},f>0&&(c+=r[f-1].dist(r[f]));for(let f=0;f0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,r){const s=t.placedSymbolArray.get(r),l=s.vertexStartIndex+4*s.numGlyphs;for(let c=s.vertexStartIndex;cl[f]-l[_]||c[_]-c[f]),d}addToSortKeyRanges(t,r){const s=this.sortKeyRanges[this.sortKeyRanges.length-1];s&&s.sortKey===r?s.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const s=this.symbolInstances.get(r);this.featureSortOrder.push(s.featureIndex),[s.rightJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.leftJustifiedTextSymbolIndex].forEach((l,c,d)=>{l>=0&&d.indexOf(l)===c&&this.addIndicesForPlacedSymbol(this.text,l)}),s.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,s.verticalPlacedTextSymbolIndex),s.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.placedIconSymbolIndex),s.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Kh,Jh;Se("SymbolBucket",_a,{omit:["layers","collisionBoxArray","features","compareText"]}),_a.MAX_GLYPHS=65535,_a.addDynamicAttributes=Ec;var Rc={get paint(){return Jh=Jh||new m({"icon-opacity":new n(ie.paint_symbol["icon-opacity"]),"icon-color":new n(ie.paint_symbol["icon-color"]),"icon-halo-color":new n(ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new n(ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new n(ie.paint_symbol["icon-halo-blur"]),"icon-translate":new e(ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new e(ie.paint_symbol["icon-translate-anchor"]),"text-opacity":new n(ie.paint_symbol["text-opacity"]),"text-color":new n(ie.paint_symbol["text-color"],{runtimeType:ei,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new n(ie.paint_symbol["text-halo-color"]),"text-halo-width":new n(ie.paint_symbol["text-halo-width"]),"text-halo-blur":new n(ie.paint_symbol["text-halo-blur"]),"text-translate":new e(ie.paint_symbol["text-translate"]),"text-translate-anchor":new e(ie.paint_symbol["text-translate-anchor"])})},get layout(){return Kh=Kh||new m({"symbol-placement":new e(ie.layout_symbol["symbol-placement"]),"symbol-spacing":new e(ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new e(ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new n(ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new e(ie.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new e(ie.layout_symbol["icon-allow-overlap"]),"icon-overlap":new e(ie.layout_symbol["icon-overlap"]),"icon-ignore-placement":new e(ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new e(ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new e(ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new n(ie.layout_symbol["icon-size"]),"icon-text-fit":new e(ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new e(ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new n(ie.layout_symbol["icon-image"]),"icon-rotate":new n(ie.layout_symbol["icon-rotate"]),"icon-padding":new n(ie.layout_symbol["icon-padding"]),"icon-keep-upright":new e(ie.layout_symbol["icon-keep-upright"]),"icon-offset":new n(ie.layout_symbol["icon-offset"]),"icon-anchor":new n(ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new e(ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new e(ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new e(ie.layout_symbol["text-rotation-alignment"]),"text-field":new n(ie.layout_symbol["text-field"]),"text-font":new n(ie.layout_symbol["text-font"]),"text-size":new n(ie.layout_symbol["text-size"]),"text-max-width":new n(ie.layout_symbol["text-max-width"]),"text-line-height":new e(ie.layout_symbol["text-line-height"]),"text-letter-spacing":new n(ie.layout_symbol["text-letter-spacing"]),"text-justify":new n(ie.layout_symbol["text-justify"]),"text-radial-offset":new n(ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new e(ie.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new n(ie.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new n(ie.layout_symbol["text-anchor"]),"text-max-angle":new e(ie.layout_symbol["text-max-angle"]),"text-writing-mode":new e(ie.layout_symbol["text-writing-mode"]),"text-rotate":new n(ie.layout_symbol["text-rotate"]),"text-padding":new e(ie.layout_symbol["text-padding"]),"text-keep-upright":new e(ie.layout_symbol["text-keep-upright"]),"text-transform":new n(ie.layout_symbol["text-transform"]),"text-offset":new n(ie.layout_symbol["text-offset"]),"text-allow-overlap":new e(ie.layout_symbol["text-allow-overlap"]),"text-overlap":new e(ie.layout_symbol["text-overlap"]),"text-ignore-placement":new e(ie.layout_symbol["text-ignore-placement"]),"text-optional":new e(ie.layout_symbol["text-optional"])})}};class Yh{constructor(t){if(t.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:Sr,this.defaultValue=t}evaluate(t){if(t.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(t.formattedSection))return r.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Se("FormatSectionOverride",Yh,{omit:["defaultValue"]});class Cl extends y{constructor(t){super(t,Rc)}recalculate(t,r){if(super.recalculate(t,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const s=this.layout.get("text-writing-mode");if(s){const l=[];for(const c of s)l.indexOf(c)<0&&l.push(c);this.layout._values["text-writing-mode"]=l}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,r,s,l){const c=this.layout.get(t).evaluate(r,{},s,l),d=this._unevaluatedLayout._values[t];return d.isDataDriven()||ns(d.value)||!c?c:function(f,_){return _.replace(/{([^{}]+)}/g,(x,b)=>f&&b in f?String(f[b]):"")}(r.properties,c)}createBucket(t){return new _a(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of Rc.paint.overridableProperties){if(!Cl.hasPaintOverride(this.layout,t))continue;const r=this.paint.get(t),s=new Yh(r),l=new rs(s,r.property.specification);let c=null;c=r.value.kind==="constant"||r.value.kind==="source"?new yn("source",l):new qa("composite",l,r.value.zoomStops),this.paint._values[t]=new rr(r.property,c,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,s){return!(!this.layout||r.isDataDriven()||s.isDataDriven())&&Cl.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,r){const s=t.get("text-field"),l=Rc.paint.properties[r];let c=!1;const d=f=>{for(const _ of f)if(l.overrides&&l.overrides.hasOverride(_))return void(c=!0)};if(s.value.kind==="constant"&&s.value.value instanceof ci)d(s.value.value.sections);else if(s.value.kind==="source"){const f=x=>{c||(x instanceof Zr&&It(x.value)===ur?d(x.value.sections):x instanceof Bs?d(x.sections):x.eachChild(f))},_=s.value;_._styleExpression&&f(_._styleExpression.expression)}return c}}let Qh;var np={get paint(){return Qh=Qh||new m({"background-color":new e(ie.paint_background["background-color"]),"background-pattern":new o(ie.paint_background["background-pattern"]),"background-opacity":new e(ie.paint_background["background-opacity"])})}};class sp extends y{constructor(t){super(t,np)}}let eu;var ap={get paint(){return eu=eu||new m({"raster-opacity":new e(ie.paint_raster["raster-opacity"]),"raster-hue-rotate":new e(ie.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new e(ie.paint_raster["raster-brightness-min"]),"raster-brightness-max":new e(ie.paint_raster["raster-brightness-max"]),"raster-saturation":new e(ie.paint_raster["raster-saturation"]),"raster-contrast":new e(ie.paint_raster["raster-contrast"]),"raster-resampling":new e(ie.paint_raster["raster-resampling"]),"raster-fade-duration":new e(ie.paint_raster["raster-fade-duration"])})}};class op extends y{constructor(t){super(t,ap)}}class lp extends y{constructor(t){super(t,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class cp{constructor(t){this._methodToThrottle=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const Bc=63710088e-1;class zn{constructor(t,r){if(isNaN(t)||isNaN(r))throw new Error(`Invalid LngLat object: (${t}, ${r})`);if(this.lng=+t,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new zn(Gi(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const r=Math.PI/180,s=this.lat*r,l=t.lat*r,c=Math.sin(s)*Math.sin(l)+Math.cos(s)*Math.cos(l)*Math.cos((t.lng-this.lng)*r);return Bc*Math.acos(Math.min(c,1))}static convert(t){if(t instanceof zn)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new zn(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new zn(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const tu=2*Math.PI*Bc;function iu(i){return tu*Math.cos(i*Math.PI/180)}function ru(i){return(180+i)/360}function nu(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function su(i,t){return i/iu(t)}function Fc(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class Mo{constructor(t,r,s=0){this.x=+t,this.y=+r,this.z=+s}static fromLngLat(t,r=0){const s=zn.convert(t);return new Mo(ru(s.lng),nu(s.lat),su(r,s.lat))}toLngLat(){return new zn(360*this.x-180,Fc(this.y))}toAltitude(){return this.z*iu(Fc(this.y))}meterInMercatorCoordinateUnits(){return 1/tu*(t=Fc(this.y),1/Math.cos(t*Math.PI/180));var t}}function au(i,t,r){var s=2*Math.PI*6378137/256/Math.pow(2,r);return[i*s-2*Math.PI*6378137/2,t*s-2*Math.PI*6378137/2]}class Oc{constructor(t,r,s){if(!function(l,c,d){return!(l<0||l>25||d<0||d>=Math.pow(2,l)||c<0||c>=Math.pow(2,l))}(t,r,s))throw new Error(`x=${r}, y=${s}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=r,this.y=s,this.key=Co(0,t,t,r,s)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,r,s){const l=(d=this.y,f=this.z,_=au(256*(c=this.x),256*(d=Math.pow(2,f)-d-1),f),x=au(256*(c+1),256*(d+1),f),_[0]+","+_[1]+","+x[0]+","+x[1]);var c,d,f,_,x;const b=function(w,I,M){let k,z="";for(let O=w;O>0;O--)k=1<1?"@2x":"").replace(/{quadkey}/g,b).replace(/{bbox-epsg-3857}/g,l)}isChildOf(t){const r=this.z-t.z;return r>0&&t.x===this.x>>r&&t.y===this.y>>r}getTilePoint(t){const r=Math.pow(2,this.z);return new _e((t.x*r-this.x)*Pt,(t.y*r-this.y)*Pt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class ou{constructor(t,r){this.wrap=t,this.canonical=r,this.key=Co(t,r.z,r.z,r.x,r.y)}}class Ni{constructor(t,r,s,l,c){if(t= z; overscaledZ = ${t}; z = ${s}`);this.overscaledZ=t,this.wrap=r,this.canonical=new Oc(s,+l,+c),this.key=Co(r,t,s,l,c)}clone(){return new Ni(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-t;return t>this.canonical.z?new Ni(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ni(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(t,r){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const s=this.canonical.z-t;return t>this.canonical.z?Co(this.wrap*+r,t,this.canonical.z,this.canonical.x,this.canonical.y):Co(this.wrap*+r,t,t,this.canonical.x>>s,this.canonical.y>>s)}isChildOf(t){if(t.wrap!==this.wrap)return!1;const r=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ>r&&t.canonical.y===this.canonical.y>>r}children(t){if(this.overscaledZ>=t)return[new Ni(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,s=2*this.canonical.x,l=2*this.canonical.y;return[new Ni(r,this.wrap,r,s,l),new Ni(r,this.wrap,r,s+1,l),new Ni(r,this.wrap,r,s,l+1),new Ni(r,this.wrap,r,s+1,l+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.ythis.max&&(this.max=w),w=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(t+1)}unpack(t,r,s){return t*this.redFactor+r*this.greenFactor+s*this.blueFactor-this.baseShift}getPixels(){return new Vi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,r,s){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let l=r*this.dim,c=r*this.dim+this.dim,d=s*this.dim,f=s*this.dim+this.dim;switch(r){case-1:l=c-1;break;case 1:c=l+1}switch(s){case-1:d=f-1;break;case 1:f=d+1}const _=-r*this.dim,x=-s*this.dim;for(let b=d;b=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class hu{constructor(t,r,s,l,c){this.type="Feature",this._vectorTileFeature=t,t._z=r,t._x=s,t._y=l,this.properties=t.properties,this.id=c}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(t[r]=this[r]);return t}}class uu{constructor(t,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Sn(Pt,16,0),this.grid3D=new Sn(Pt,16,0),this.featureIndexArray=new rn,this.promoteId=r}insert(t,r,s,l,c,d){const f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(s,l,c);const _=d?this.grid3D:this.grid;for(let x=0;x=0&&w[3]>=0&&_.insert(f,w[0],w[1],w[2],w[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Mn.VectorTile(new Pc(this.rawTileData)).layers,this.sourceLayerCoder=new cu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,r,s,l){this.loadVTLayers();const c=t.params||{},d=Pt/t.tileSize/t.scale,f=xn(c.filter),_=t.queryGeometry,x=t.queryPadding*d,b=pu(_),w=this.grid.query(b.minX-x,b.minY-x,b.maxX+x,b.maxY+x),I=pu(t.cameraQueryGeometry),M=this.grid3D.query(I.minX-x,I.minY-x,I.maxX+x,I.maxY+x,(O,$,Q,G)=>function(K,re,ce,be,De){for(const ye of K)if(re<=ye.x&&ce<=ye.y&&be>=ye.x&&De>=ye.y)return!0;const ve=[new _e(re,ce),new _e(re,De),new _e(be,De),new _e(be,ce)];if(K.length>2){for(const ye of ve)if(ca(K,ye))return!0}for(let ye=0;ye(G||(G=xs(K)),re.queryIntersectsFeature(_,K,ce,G,this.z,t.transform,d,t.pixelPosMatrix)))}return k}loadMatchingFeature(t,r,s,l,c,d,f,_,x,b,w){const I=this.bucketLayerIDs[r];if(d&&!function(O,$){for(let Q=0;Q=0)return!0;return!1}(d,I))return;const M=this.sourceLayerCoder.decode(s),k=this.vtLayers[M].feature(l);if(c.needGeometry){const O=vs(k,!0);if(!c.filter(new it(this.tileID.overscaledZ),O,this.tileID.canonical))return}else if(!c.filter(new it(this.tileID.overscaledZ),k))return;const z=this.getId(k,M);for(let O=0;O{const f=t instanceof h?t.get(d):null;return f&&f.evaluate?f.evaluate(r,s,l):f})}function pu(i){let t=1/0,r=1/0,s=-1/0,l=-1/0;for(const c of i)t=Math.min(t,c.x),r=Math.min(r,c.y),s=Math.max(s,c.x),l=Math.max(l,c.y);return{minX:t,minY:r,maxX:s,maxY:l}}function hp(i,t){return t-i}function fu(i,t,r,s,l){const c=[];for(let d=0;d=s&&w.x>=s||(b.x>=s?b=new _e(s,b.y+(s-b.x)/(w.x-b.x)*(w.y-b.y))._round():w.x>=s&&(w=new _e(s,b.y+(s-b.x)/(w.x-b.x)*(w.y-b.y))._round()),b.y>=l&&w.y>=l||(b.y>=l?b=new _e(b.x+(l-b.y)/(w.y-b.y)*(w.x-b.x),l)._round():w.y>=l&&(w=new _e(b.x+(l-b.y)/(w.y-b.y)*(w.x-b.x),l)._round()),_&&b.equals(_[_.length-1])||(_=[b],c.push(_)),_.push(w)))))}}return c}Se("FeatureIndex",uu,{omit:["rawTileData","sourceLayerCoder"]});class En extends _e{constructor(t,r,s,l){super(t,r),this.angle=s,l!==void 0&&(this.segment=l)}clone(){return new En(this.x,this.y,this.angle,this.segment)}}function mu(i,t,r,s,l){if(t.segment===void 0||r===0)return!0;let c=t,d=t.segment+1,f=0;for(;f>-r/2;){if(d--,d<0)return!1;f-=i[d].dist(c),c=i[d]}f+=i[d].dist(i[d+1]),d++;const _=[];let x=0;for(;fs;)x-=_.shift().angleDelta;if(x>l)return!1;d++,f+=b.dist(w)}return!0}function _u(i){let t=0;for(let r=0;rx){const k=(x-_)/M,z=di.number(w.x,I.x,k),O=di.number(w.y,I.y,k),$=new En(z,O,I.angleTo(w),b);return $._round(),!d||mu(i,$,f,d,t)?$:void 0}_+=M}}function dp(i,t,r,s,l,c,d,f,_){const x=gu(s,c,d),b=yu(s,l),w=b*d,I=i[0].x===0||i[0].x===_||i[0].y===0||i[0].y===_;return t-w=0&&K<_&&re>=0&&re<_&&I-x>=0&&I+x<=b){const ce=new En(K,re,Q,k);ce._round(),s&&!mu(i,ce,c,s,l)||M.push(ce)}}w+=$}return f||M.length||d||(M=xu(i,w/2,r,s,l,c,d,!0,_)),M}Se("Anchor",En);const ga=gi;function vu(i,t,r,s){const l=[],c=i.image,d=c.pixelRatio,f=c.paddedRect.w-2*ga,_=c.paddedRect.h-2*ga;let x={x1:i.left,y1:i.top,x2:i.right,y2:i.bottom};const b=c.stretchX||[[0,f]],w=c.stretchY||[[0,_]],I=(ae,ke)=>ae+ke[1]-ke[0],M=b.reduce(I,0),k=w.reduce(I,0),z=f-M,O=_-k;let $=0,Q=M,G=0,K=k,re=0,ce=z,be=0,De=O;if(c.content&&s){const ae=c.content,ke=ae[2]-ae[0],Me=ae[3]-ae[1];(c.textFitWidth||c.textFitHeight)&&(x=Hh(i)),$=kl(b,0,ae[0]),G=kl(w,0,ae[1]),Q=kl(b,ae[0],ae[2]),K=kl(w,ae[1],ae[3]),re=ae[0]-$,be=ae[1]-G,ce=ke-Q,De=Me-K}const ve=x.x1,ye=x.y1,Ce=x.x2-ve,Pe=x.y2-ye,Ie=(ae,ke,Me,Be)=>{const st=zl(ae.stretch-$,Q,Ce,ve),nt=El(ae.fixed-re,ce,ae.stretch,M),Ct=zl(ke.stretch-G,K,Pe,ye),nr=El(ke.fixed-be,De,ke.stretch,k),$t=zl(Me.stretch-$,Q,Ce,ve),kt=El(Me.fixed-re,ce,Me.stretch,M),ri=zl(Be.stretch-G,K,Pe,ye),ni=El(Be.fixed-be,De,Be.stretch,k),si=new _e(st,Ct),bt=new _e($t,Ct),zt=new _e($t,ri),Jt=new _e(st,ri),qt=new _e(nt/d,nr/d),ai=new _e(kt/d,ni/d),Zt=t*Math.PI/180;if(Zt){const Ke=Math.sin(Zt),ct=Math.cos(Zt),dt=[ct,-Ke,Ke,ct];si._matMult(dt),bt._matMult(dt),Jt._matMult(dt),zt._matMult(dt)}const ji=ae.stretch+ae.fixed,yi=ke.stretch+ke.fixed;return{tl:si,tr:bt,bl:Jt,br:zt,tex:{x:c.paddedRect.x+ga+ji,y:c.paddedRect.y+ga+yi,w:Me.stretch+Me.fixed-ji,h:Be.stretch+Be.fixed-yi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:qt,pixelOffsetBR:ai,minFontScaleX:ce/d/Ce,minFontScaleY:De/d/Pe,isSDF:r}};if(s&&(c.stretchX||c.stretchY)){const ae=bu(b,z,M),ke=bu(w,O,k);for(let Me=0;Me0&&(z=Math.max(10,z),this.circleDiameter=z)}else{const I=!((w=d.image)===null||w===void 0)&&w.content&&(d.image.textFitWidth||d.image.textFitHeight)?Hh(d):{x1:d.left,y1:d.top,x2:d.right,y2:d.bottom};I.y1=I.y1*f-_[0],I.y2=I.y2*f+_[2],I.x1=I.x1*f-_[3],I.x2=I.x2*f+_[1];const M=d.collisionPadding;if(M&&(I.x1-=M[0]*f,I.y1-=M[1]*f,I.x2+=M[2]*f,I.y2+=M[3]*f),b){const k=new _e(I.x1,I.y1),z=new _e(I.x2,I.y1),O=new _e(I.x1,I.y2),$=new _e(I.x2,I.y2),Q=b*Math.PI/180;k._rotate(Q),z._rotate(Q),O._rotate(Q),$._rotate(Q),I.x1=Math.min(k.x,z.x,O.x,$.x),I.x2=Math.max(k.x,z.x,O.x,$.x),I.y1=Math.min(k.y,z.y,O.y,$.y),I.y2=Math.max(k.y,z.y,O.y,$.y)}t.emplaceBack(r.x,r.y,I.x1,I.y1,I.x2,I.y2,s,l,c)}this.boxEndIndex=t.length}}class pp{constructor(t=[],r=(s,l)=>sl?1:0){if(this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(let s=(this.length>>1)-1;s>=0;s--)this._down(s)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;const t=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:r,compare:s}=this,l=r[t];for(;t>0;){const c=t-1>>1,d=r[c];if(s(l,d)>=0)break;r[t]=d,t=c}r[t]=l}_down(t){const{data:r,compare:s}=this,l=this.length>>1,c=r[t];for(;t=0)break;r[t]=r[d],t=d}r[t]=c}}function fp(i,t=1,r=!1){let s=1/0,l=1/0,c=-1/0,d=-1/0;const f=i[0];for(let M=0;Mc)&&(c=k.x),(!M||k.y>d)&&(d=k.y)}const _=Math.min(c-s,d-l);let x=_/2;const b=new pp([],mp);if(_===0)return new _e(s,l);for(let M=s;Mw.d||!w.d)&&(w=M,r&&console.log("found best %d after %d probes",Math.round(1e4*M.d)/1e4,I)),M.max-w.d<=t||(x=M.h/2,b.push(new ya(M.p.x-x,M.p.y-x,x,i)),b.push(new ya(M.p.x+x,M.p.y-x,x,i)),b.push(new ya(M.p.x-x,M.p.y+x,x,i)),b.push(new ya(M.p.x+x,M.p.y+x,x,i)),I+=4)}return r&&(console.log(`num probes: ${I}`),console.log(`best distance: ${w.d}`)),w.p}function mp(i,t){return t.max-i.max}function ya(i,t,r,s){this.p=new _e(i,t),this.h=r,this.d=function(l,c){let d=!1,f=1/0;for(let _=0;_l.y!=k.y>l.y&&l.x<(k.x-M.x)*(l.y-M.y)/(k.y-M.y)+M.x&&(d=!d),f=Math.min(f,nh(l,M,k))}}return(d?1:-1)*Math.sqrt(f)}(this.p,s),this.max=this.d+this.h*Math.SQRT2}var Ut;L.aq=void 0,(Ut=L.aq||(L.aq={}))[Ut.center=1]="center",Ut[Ut.left=2]="left",Ut[Ut.right=3]="right",Ut[Ut.top=4]="top",Ut[Ut.bottom=5]="bottom",Ut[Ut["top-left"]=6]="top-left",Ut[Ut["top-right"]=7]="top-right",Ut[Ut["bottom-left"]=8]="bottom-left",Ut[Ut["bottom-right"]=9]="bottom-right";const Dn=7,Vc=Number.POSITIVE_INFINITY;function wu(i,t){return t[1]!==Vc?function(r,s,l){let c=0,d=0;switch(s=Math.abs(s),l=Math.abs(l),r){case"top-right":case"top-left":case"top":d=l-Dn;break;case"bottom-right":case"bottom-left":case"bottom":d=-l+Dn}switch(r){case"top-right":case"bottom-right":case"right":c=-s;break;case"top-left":case"bottom-left":case"left":c=s}return[c,d]}(i,t[0],t[1]):function(r,s){let l=0,c=0;s<0&&(s=0);const d=s/Math.SQRT2;switch(r){case"top-right":case"top-left":c=d-Dn;break;case"bottom-right":case"bottom-left":c=-d+Dn;break;case"bottom":c=-s+Dn;break;case"top":c=s-Dn}switch(r){case"top-right":case"bottom-right":l=-d;break;case"top-left":case"bottom-left":l=d;break;case"left":l=s;break;case"right":l=-s}return[l,c]}(i,t[0])}function Tu(i,t,r){var s;const l=i.layout,c=(s=l.get("text-variable-anchor-offset"))===null||s===void 0?void 0:s.evaluate(t,{},r);if(c){const f=c.values,_=[];for(let x=0;xI*Mt);b.startsWith("top")?w[1]-=Dn:b.startsWith("bottom")&&(w[1]+=Dn),_[x+1]=w}return new ui(_)}const d=l.get("text-variable-anchor");if(d){let f;f=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[l.get("text-radial-offset").evaluate(t,{},r)*Mt,Vc]:l.get("text-offset").evaluate(t,{},r).map(x=>x*Mt);const _=[];for(const x of d)_.push(x,wu(x,f));return new ui(_)}return null}function Nc(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 _p(i,t,r,s,l,c,d,f,_,x,b){let w=c.textMaxSize.evaluate(t,{});w===void 0&&(w=d);const I=i.layers[0].layout,M=I.get("icon-offset").evaluate(t,{},b),k=Iu(r.horizontal),z=d/24,O=i.tilePixelRatio*z,$=i.tilePixelRatio*w/24,Q=i.tilePixelRatio*f,G=i.tilePixelRatio*I.get("symbol-spacing"),K=I.get("text-padding")*i.tilePixelRatio,re=function(ae,ke,Me,Be=1){const st=ae.get("icon-padding").evaluate(ke,{},Me),nt=st&&st.values;return[nt[0]*Be,nt[1]*Be,nt[2]*Be,nt[3]*Be]}(I,t,b,i.tilePixelRatio),ce=I.get("text-max-angle")/180*Math.PI,be=I.get("text-rotation-alignment")!=="viewport"&&I.get("symbol-placement")!=="point",De=I.get("icon-rotation-alignment")==="map"&&I.get("symbol-placement")!=="point",ve=I.get("symbol-placement"),ye=G/2,Ce=I.get("icon-text-fit");let Pe;s&&Ce!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(Pe=Xh(s,r.vertical,Ce,I.get("icon-text-fit-padding"),M,z)),k&&(s=Xh(s,k,Ce,I.get("icon-text-fit-padding"),M,z)));const Ie=(ae,ke)=>{ke.x<0||ke.x>=Pt||ke.y<0||ke.y>=Pt||function(Me,Be,st,nt,Ct,nr,$t,kt,ri,ni,si,bt,zt,Jt,qt,ai,Zt,ji,yi,Ke,ct,dt,Si,xt,xa){const Rr=Me.addToLineVertexArray(Be,st);let Br,sr,Ui,Dt,an=0,Eo=0,Cu=0,ku=0,Xc=-1,Wc=-1;const on={};let zu=oc("");if(Me.allowVerticalPlacement&&nt.vertical){const Yt=kt.layout.get("text-rotate").evaluate(ct,{},xt)+90;Ui=new Dl(ri,Be,ni,si,bt,nt.vertical,zt,Jt,qt,Yt),$t&&(Dt=new Dl(ri,Be,ni,si,bt,$t,Zt,ji,qt,Yt))}if(Ct){const Yt=kt.layout.get("icon-rotate").evaluate(ct,{}),$i=kt.layout.get("icon-text-fit")!=="none",ws=vu(Ct,Yt,Si,$i),gr=$t?vu($t,Yt,Si,$i):void 0;sr=new Dl(ri,Be,ni,si,bt,Ct,Zt,ji,!1,Yt),an=4*ws.length;const Ts=Me.iconSizeData;let Fr=null;Ts.kind==="source"?(Fr=[Lr*kt.layout.get("icon-size").evaluate(ct,{})],Fr[0]>kn&&Lt(`${Me.layerIds[0]}: Value for "icon-size" is >= ${Ao}. Reduce your "icon-size".`)):Ts.kind==="composite"&&(Fr=[Lr*dt.compositeIconSizes[0].evaluate(ct,{},xt),Lr*dt.compositeIconSizes[1].evaluate(ct,{},xt)],(Fr[0]>kn||Fr[1]>kn)&&Lt(`${Me.layerIds[0]}: Value for "icon-size" is >= ${Ao}. Reduce your "icon-size".`)),Me.addSymbols(Me.icon,ws,Fr,Ke,yi,ct,L.ah.none,Be,Rr.lineStartIndex,Rr.lineLength,-1,xt),Xc=Me.icon.placedSymbolArray.length-1,gr&&(Eo=4*gr.length,Me.addSymbols(Me.icon,gr,Fr,Ke,yi,ct,L.ah.vertical,Be,Rr.lineStartIndex,Rr.lineLength,-1,xt),Wc=Me.icon.placedSymbolArray.length-1)}const Eu=Object.keys(nt.horizontal);for(const Yt of Eu){const $i=nt.horizontal[Yt];if(!Br){zu=oc($i.text);const gr=kt.layout.get("text-rotate").evaluate(ct,{},xt);Br=new Dl(ri,Be,ni,si,bt,$i,zt,Jt,qt,gr)}const ws=$i.positionedLines.length===1;if(Cu+=Su(Me,Be,$i,nr,kt,qt,ct,ai,Rr,nt.vertical?L.ah.horizontal:L.ah.horizontalOnly,ws?Eu:[Yt],on,Xc,dt,xt),ws)break}nt.vertical&&(ku+=Su(Me,Be,nt.vertical,nr,kt,qt,ct,ai,Rr,L.ah.vertical,["vertical"],on,Wc,dt,xt));const xp=Br?Br.boxStartIndex:Me.collisionBoxArray.length,vp=Br?Br.boxEndIndex:Me.collisionBoxArray.length,bp=Ui?Ui.boxStartIndex:Me.collisionBoxArray.length,wp=Ui?Ui.boxEndIndex:Me.collisionBoxArray.length,Tp=sr?sr.boxStartIndex:Me.collisionBoxArray.length,Sp=sr?sr.boxEndIndex:Me.collisionBoxArray.length,Ip=Dt?Dt.boxStartIndex:Me.collisionBoxArray.length,Pp=Dt?Dt.boxEndIndex:Me.collisionBoxArray.length;let _r=-1;const Rl=(Yt,$i)=>Yt&&Yt.circleDiameter?Math.max(Yt.circleDiameter,$i):$i;_r=Rl(Br,_r),_r=Rl(Ui,_r),_r=Rl(sr,_r),_r=Rl(Dt,_r);const Du=_r>-1?1:0;Du&&(_r*=xa/Mt),Me.glyphOffsetArray.length>=_a.MAX_GLYPHS&&Lt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),ct.sortKey!==void 0&&Me.addToSortKeyRanges(Me.symbolInstances.length,ct.sortKey);const Ap=Tu(kt,ct,xt),[Mp,Cp]=function(Yt,$i){const ws=Yt.length,gr=$i==null?void 0:$i.values;if((gr==null?void 0:gr.length)>0)for(let Ts=0;Ts=0?on.right:-1,on.center>=0?on.center:-1,on.left>=0?on.left:-1,on.vertical||-1,Xc,Wc,zu,xp,vp,bp,wp,Tp,Sp,Ip,Pp,ni,Cu,ku,an,Eo,Du,0,zt,_r,Mp,Cp)}(i,ke,ae,r,s,l,Pe,i.layers[0],i.collisionBoxArray,t.index,t.sourceLayerIndex,i.index,O,[K,K,K,K],be,_,Q,re,De,M,t,c,x,b,d)};if(ve==="line")for(const ae of fu(t.geometry,0,0,Pt,Pt)){const ke=dp(ae,G,ce,r.vertical||k,s,24,$,i.overscaling,Pt);for(const Me of ke)k&&gp(i,k.text,ye,Me)||Ie(ae,Me)}else if(ve==="line-center"){for(const ae of t.geometry)if(ae.length>1){const ke=up(ae,ce,r.vertical||k,s,24,$);ke&&Ie(ae,ke)}}else if(t.type==="Polygon")for(const ae of Os(t.geometry,0)){const ke=fp(ae,16);Ie(ae[0],new En(ke.x,ke.y,0))}else if(t.type==="LineString")for(const ae of t.geometry)Ie(ae,new En(ae[0].x,ae[0].y,0));else if(t.type==="Point")for(const ae of t.geometry)for(const ke of ae)Ie([ke],new En(ke.x,ke.y,0))}function Su(i,t,r,s,l,c,d,f,_,x,b,w,I,M,k){const z=function(Q,G,K,re,ce,be,De,ve){const ye=re.layout.get("text-rotate").evaluate(be,{})*Math.PI/180,Ce=[];for(const Pe of G.positionedLines)for(const Ie of Pe.positionedGlyphs){if(!Ie.rect)continue;const ae=Ie.rect||{};let ke=Nh+1,Me=!0,Be=1,st=0;const nt=(ce||ve)&&Ie.vertical,Ct=Ie.metrics.advance*Ie.scale/2;if(ve&&G.verticalizable&&(st=Pe.lineOffset/2-(Ie.imageName?-(Mt-Ie.metrics.width*Ie.scale)/2:(Ie.scale-1)*Mt)),Ie.imageName){const Ke=De[Ie.imageName];Me=Ke.sdf,Be=Ke.pixelRatio,ke=gi/Be}const nr=ce?[Ie.x+Ct,Ie.y]:[0,0];let $t=ce?[0,0]:[Ie.x+Ct+K[0],Ie.y+K[1]-st],kt=[0,0];nt&&(kt=$t,$t=[0,0]);const ri=Ie.metrics.isDoubleResolution?2:1,ni=(Ie.metrics.left-ke)*Ie.scale-Ct+$t[0],si=(-Ie.metrics.top-ke)*Ie.scale+$t[1],bt=ni+ae.w/ri*Ie.scale/Be,zt=si+ae.h/ri*Ie.scale/Be,Jt=new _e(ni,si),qt=new _e(bt,si),ai=new _e(ni,zt),Zt=new _e(bt,zt);if(nt){const Ke=new _e(-Ct,Ct-Io),ct=-Math.PI/2,dt=Mt/2-Ct,Si=new _e(5-Io-dt,-(Ie.imageName?dt:0)),xt=new _e(...kt);Jt._rotateAround(ct,Ke)._add(Si)._add(xt),qt._rotateAround(ct,Ke)._add(Si)._add(xt),ai._rotateAround(ct,Ke)._add(Si)._add(xt),Zt._rotateAround(ct,Ke)._add(Si)._add(xt)}if(ye){const Ke=Math.sin(ye),ct=Math.cos(ye),dt=[ct,-Ke,Ke,ct];Jt._matMult(dt),qt._matMult(dt),ai._matMult(dt),Zt._matMult(dt)}const ji=new _e(0,0),yi=new _e(0,0);Ce.push({tl:Jt,tr:qt,bl:ai,br:Zt,tex:ae,writingMode:G.writingMode,glyphOffset:nr,sectionIndex:Ie.sectionIndex,isSDF:Me,pixelOffsetTL:ji,pixelOffsetBR:yi,minFontScaleX:0,minFontScaleY:0})}return Ce}(0,r,f,l,c,d,s,i.allowVerticalPlacement),O=i.textSizeData;let $=null;O.kind==="source"?($=[Lr*l.layout.get("text-size").evaluate(d,{})],$[0]>kn&&Lt(`${i.layerIds[0]}: Value for "text-size" is >= ${Ao}. Reduce your "text-size".`)):O.kind==="composite"&&($=[Lr*M.compositeTextSizes[0].evaluate(d,{},k),Lr*M.compositeTextSizes[1].evaluate(d,{},k)],($[0]>kn||$[1]>kn)&&Lt(`${i.layerIds[0]}: Value for "text-size" is >= ${Ao}. Reduce your "text-size".`)),i.addSymbols(i.text,z,$,f,c,d,x,t,_.lineStartIndex,_.lineLength,I,k);for(const Q of b)w[Q]=i.text.placedSymbolArray.length-1;return 4*z.length}function Iu(i){for(const t in i)return i[t];return null}function gp(i,t,r,s){const l=i.compareText;if(t in l){const c=l[t];for(let d=c.length-1;d>=0;d--)if(s.dist(c[d])>4;if(l!==1)throw new Error(`Got v${l} data when expected v1.`);const c=Pu[15&s];if(!c)throw new Error("Unrecognized array type.");const[d]=new Uint16Array(t,2,1),[f]=new Uint32Array(t,4,1);return new jc(f,d,c,t)}constructor(t,r=64,s=Float64Array,l){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=s,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const c=Pu.indexOf(this.ArrayType),d=2*t*this.ArrayType.BYTES_PER_ELEMENT,f=t*this.IndexArrayType.BYTES_PER_ELEMENT,_=(8-f%8)%8;if(c<0)throw new Error(`Unexpected typed array class: ${s}.`);l&&l instanceof ArrayBuffer?(this.data=l,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+f+_,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+d+f+_),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+f+_,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+c]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}add(t,r){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=t,this.coords[this._pos++]=r,s}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Uc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,s,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:c,coords:d,nodeSize:f}=this,_=[0,c.length-1,0],x=[];for(;_.length;){const b=_.pop()||0,w=_.pop()||0,I=_.pop()||0;if(w-I<=f){for(let O=I;O<=w;O++){const $=d[2*O],Q=d[2*O+1];$>=t&&$<=s&&Q>=r&&Q<=l&&x.push(c[O])}continue}const M=I+w>>1,k=d[2*M],z=d[2*M+1];k>=t&&k<=s&&z>=r&&z<=l&&x.push(c[M]),(b===0?t<=k:r<=z)&&(_.push(I),_.push(M-1),_.push(1-b)),(b===0?s>=k:l>=z)&&(_.push(M+1),_.push(w),_.push(1-b))}return x}within(t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:l,coords:c,nodeSize:d}=this,f=[0,l.length-1,0],_=[],x=s*s;for(;f.length;){const b=f.pop()||0,w=f.pop()||0,I=f.pop()||0;if(w-I<=d){for(let O=I;O<=w;O++)Mu(c[2*O],c[2*O+1],t,r)<=x&&_.push(l[O]);continue}const M=I+w>>1,k=c[2*M],z=c[2*M+1];Mu(k,z,t,r)<=x&&_.push(l[M]),(b===0?t-s<=k:r-s<=z)&&(f.push(I),f.push(M-1),f.push(1-b)),(b===0?t+s>=k:r+s>=z)&&(f.push(M+1),f.push(w),f.push(1-b))}return _}}function Uc(i,t,r,s,l,c){if(l-s<=r)return;const d=s+l>>1;Au(i,t,d,s,l,c),Uc(i,t,r,s,d-1,1-c),Uc(i,t,r,d+1,l,1-c)}function Au(i,t,r,s,l,c){for(;l>s;){if(l-s>600){const x=l-s+1,b=r-s+1,w=Math.log(x),I=.5*Math.exp(2*w/3),M=.5*Math.sqrt(w*I*(x-I)/x)*(b-x/2<0?-1:1);Au(i,t,r,Math.max(s,Math.floor(r-b*I/x+M)),Math.min(l,Math.floor(r+(x-b)*I/x+M)),c)}const d=t[2*r+c];let f=s,_=l;for(ko(i,t,s,r),t[2*l+c]>d&&ko(i,t,s,l);f<_;){for(ko(i,t,f,_),f++,_--;t[2*f+c]d;)_--}t[2*s+c]===d?ko(i,t,s,_):(_++,ko(i,t,_,l)),_<=r&&(s=_+1),r<=_&&(l=_-1)}}function ko(i,t,r,s){$c(i,r,s),$c(t,2*r,2*s),$c(t,2*r+1,2*s+1)}function $c(i,t,r){const s=i[t];i[t]=i[r],i[r]=s}function Mu(i,t,r,s){const l=i-r,c=t-s;return l*l+c*c}var qc;L.bf=void 0,(qc=L.bf||(L.bf={})).create="create",qc.load="load",qc.fullLoad="fullLoad";let Ll=null,zo=[];const Zc=1e3/60,Gc="loadTime",Hc="fullLoadTime",yp={mark(i){performance.mark(i)},frame(i){const t=i;Ll!=null&&zo.push(t-Ll),Ll=t},clearMetrics(){Ll=null,zo=[],performance.clearMeasures(Gc),performance.clearMeasures(Hc);for(const i in L.bf)performance.clearMarks(L.bf[i])},getPerformanceMetrics(){performance.measure(Gc,L.bf.create,L.bf.load),performance.measure(Hc,L.bf.create,L.bf.fullLoad);const i=performance.getEntriesByName(Gc)[0].duration,t=performance.getEntriesByName(Hc)[0].duration,r=zo.length,s=1/(zo.reduce((c,d)=>c+d,0)/r/1e3),l=zo.filter(c=>c>Zc).reduce((c,d)=>c+(d-Zc)/Zc,0);return{loadTime:i,fullLoadTime:t,fps:s,percentDroppedFrames:l/(r+l)*100,totalFrames:r}}};L.$=class extends B{},L.A=ha,L.B=ec,L.C=function(i){if(ln==null){const t=i.navigator?i.navigator.userAgent:null;ln=!!i.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return ln},L.D=e,L.E=un,L.F=class{constructor(i,t){this.target=i,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new cp(()=>this.process()),this.subscription=function(r,s,l,c){return r.addEventListener(s,l,!1),{unsubscribe:()=>{r.removeEventListener(s,l,!1)}}}(this.target,"message",r=>this.receive(r)),this.globalScope=or(self)?i:window}registerMessageHandler(i,t){this.messageHandlers[i]=t}sendAsync(i,t){return new Promise((r,s)=>{const l=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[l]={resolve:r,reject:s},t&&t.signal.addEventListener("abort",()=>{delete this.resolveRejects[l];const f={id:l,type:"",origin:location.origin,targetMapId:i.targetMapId,sourceMapId:this.mapId};this.target.postMessage(f)},{once:!0});const c=[],d=Object.assign(Object.assign({},i),{id:l,sourceMapId:this.mapId,origin:location.origin,data:us(i.data,c)});this.target.postMessage(d,{transfer:c})})}receive(i){const t=i.data,r=t.id;if(!(t.origin!=="file://"&&location.origin!=="file://"&&t.origin!=="resource://android"&&location.origin!=="resource://android"&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type===""){delete this.tasks[r];const s=this.abortControllers[r];return delete this.abortControllers[r],void(s&&s.abort())}if(or(self)||t.mustQueue)return this.tasks[r]=t,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,t)}}process(){if(this.taskQueue.length===0)return;const i=this.taskQueue.shift(),t=this.tasks[i];delete this.tasks[i],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(i,t)}processTask(i,t){return p(this,void 0,void 0,function*(){if(t.type===""){const l=this.resolveRejects[i];return delete this.resolveRejects[i],l?void(t.error?l.reject(ds(t.error)):l.resolve(ds(t.data))):void 0}if(!this.messageHandlers[t.type])return void this.completeTask(i,new Error(`Could not find a registered handler for ${t.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const r=ds(t.data),s=new AbortController;this.abortControllers[i]=s;try{const l=yield this.messageHandlers[t.type](t.sourceMapId,r,s);this.completeTask(i,null,l)}catch(l){this.completeTask(i,l)}})}completeTask(i,t,r){const s=[];delete this.abortControllers[i];const l={id:i,type:"",sourceMapId:this.mapId,origin:location.origin,error:t?us(t):null,data:us(r,s)};this.target.postMessage(l,{transfer:s})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},L.G=hn,L.H=function(){var i=new ha(16);return ha!=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},L.I=Mc,L.J=function(i,t,r){var s,l,c,d,f,_,x,b,w,I,M,k,z=r[0],O=r[1],$=r[2];return t===i?(i[12]=t[0]*z+t[4]*O+t[8]*$+t[12],i[13]=t[1]*z+t[5]*O+t[9]*$+t[13],i[14]=t[2]*z+t[6]*O+t[10]*$+t[14],i[15]=t[3]*z+t[7]*O+t[11]*$+t[15]):(l=t[1],c=t[2],d=t[3],f=t[4],_=t[5],x=t[6],b=t[7],w=t[8],I=t[9],M=t[10],k=t[11],i[0]=s=t[0],i[1]=l,i[2]=c,i[3]=d,i[4]=f,i[5]=_,i[6]=x,i[7]=b,i[8]=w,i[9]=I,i[10]=M,i[11]=k,i[12]=s*z+f*O+w*$+t[12],i[13]=l*z+_*O+I*$+t[13],i[14]=c*z+x*O+M*$+t[14],i[15]=d*z+b*O+k*$+t[15]),i},L.K=function(i,t,r){var s=r[0],l=r[1],c=r[2];return i[0]=t[0]*s,i[1]=t[1]*s,i[2]=t[2]*s,i[3]=t[3]*s,i[4]=t[4]*l,i[5]=t[5]*l,i[6]=t[6]*l,i[7]=t[7]*l,i[8]=t[8]*c,i[9]=t[9]*c,i[10]=t[10]*c,i[11]=t[11]*c,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i},L.L=lh,L.M=function(i,t){const r={};for(let s=0;s{const t=window.document.createElement("video");return t.muted=!0,new Promise(r=>{t.onloadstart=()=>{r(t)};for(const s of i){const l=window.document.createElement("source");$r(s)||(t.crossOrigin="Anonymous"),l.src=s,t.appendChild(l)}})},L.a4=function(){return Ss++},L.a5=Ot,L.a6=_a,L.a7=xn,L.a8=vs,L.a9=hu,L.aA=function(i){if(i.type==="custom")return new lp(i);switch(i.type){case"background":return new sp(i);case"circle":return new Gu(i);case"fill":return new cd(i);case"fill-extrusion":return new Sd(i);case"heatmap":return new Xu(i);case"hillshade":return new Ku(i);case"line":return new Ed(i);case"raster":return new op(i);case"symbol":return new Cl(i)}},L.aB=tt,L.aC=function(i,t){if(!i)return[{command:"setStyle",args:[t]}];let r=[];try{if(!Je(i.version,t.version))return[{command:"setStyle",args:[t]}];Je(i.center,t.center)||r.push({command:"setCenter",args:[t.center]}),Je(i.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),Je(i.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),Je(i.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),Je(i.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),Je(i.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),Je(i.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),Je(i.light,t.light)||r.push({command:"setLight",args:[t.light]}),Je(i.terrain,t.terrain)||r.push({command:"setTerrain",args:[t.terrain]}),Je(i.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),Je(i.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});const s={},l=[];(function(d,f,_,x){let b;for(b in f=f||{},d=d||{})Object.prototype.hasOwnProperty.call(d,b)&&(Object.prototype.hasOwnProperty.call(f,b)||Tr(b,_,x));for(b in f)Object.prototype.hasOwnProperty.call(f,b)&&(Object.prototype.hasOwnProperty.call(d,b)?Je(d[b],f[b])||(d[b].type==="geojson"&&f[b].type==="geojson"&&dn(d,f,b)?mt(_,{command:"setGeoJSONSourceData",args:[b,f[b].data]}):hr(b,f,_,x)):On(b,f,_))})(i.sources,t.sources,l,s);const c=[];i.layers&&i.layers.forEach(d=>{"source"in d&&s[d.source]?r.push({command:"removeLayer",args:[d.id]}):c.push(d)}),r=r.concat(l),function(d,f,_){f=f||[];const x=(d=d||[]).map(Vn),b=f.map(Vn),w=d.reduce(Nn,{}),I=f.reduce(Nn,{}),M=x.slice(),k=Object.create(null);let z,O,$,Q,G;for(let K=0,re=0;K@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,s,l,c)=>{const d=l||c;return t[s]=!d||d.toLowerCase(),""}),t["max-age"]){const r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t},L.ab=function(i,t){const r=[];for(const s in i)s in t||r.push(s);return r},L.ac=Ai,L.ad=function(i,t,r){var s=Math.sin(r),l=Math.cos(r),c=t[0],d=t[1],f=t[2],_=t[3],x=t[4],b=t[5],w=t[6],I=t[7];return t!==i&&(i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]),i[0]=c*l+x*s,i[1]=d*l+b*s,i[2]=f*l+w*s,i[3]=_*l+I*s,i[4]=x*l-c*s,i[5]=b*l-d*s,i[6]=w*l-f*s,i[7]=I*l-_*s,i},L.ae=function(i){var t=new ha(16);return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],t},L.af=vl,L.ag=function(i,t){let r=0,s=0;if(i.kind==="constant")s=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:l,minZoom:c,maxZoom:d}=i,f=l?Ai(pi.interpolationFactor(l,t,c,d),0,1):0;i.kind==="camera"?s=di.number(i.minSize,i.maxSize,f):r=f}return{uSizeT:r,uSize:s}},L.ai=function(i,{uSize:t,uSizeT:r},{lowerSize:s,upperSize:l}){return i.kind==="source"?s/Lr:i.kind==="composite"?di.number(s/Lr,l/Lr,r):t},L.aj=Ec,L.ak=function(i,t,r,s){const l=t.y-i.y,c=t.x-i.x,d=s.y-r.y,f=s.x-r.x,_=d*c-f*l;if(_===0)return null;const x=(f*(i.y-r.y)-d*(i.x-r.x))/_;return new _e(i.x+x*c,i.y+x*l)},L.al=fu,L.am=ih,L.an=fc,L.ao=function(i){let t=1/0,r=1/0,s=-1/0,l=-1/0;for(const c of i)t=Math.min(t,c.x),r=Math.min(r,c.y),s=Math.max(s,c.x),l=Math.max(l,c.y);return[t,r,s,l]},L.ap=Mt,L.ar=zc,L.as=function(i,t){var r=t[0],s=t[1],l=t[2],c=t[3],d=t[4],f=t[5],_=t[6],x=t[7],b=t[8],w=t[9],I=t[10],M=t[11],k=t[12],z=t[13],O=t[14],$=t[15],Q=r*f-s*d,G=r*_-l*d,K=r*x-c*d,re=s*_-l*f,ce=s*x-c*f,be=l*x-c*_,De=b*z-w*k,ve=b*O-I*k,ye=b*$-M*k,Ce=w*O-I*z,Pe=w*$-M*z,Ie=I*$-M*O,ae=Q*Ie-G*Pe+K*Ce+re*ye-ce*ve+be*De;return ae?(i[0]=(f*Ie-_*Pe+x*Ce)*(ae=1/ae),i[1]=(l*Pe-s*Ie-c*Ce)*ae,i[2]=(z*be-O*ce+$*re)*ae,i[3]=(I*ce-w*be-M*re)*ae,i[4]=(_*ye-d*Ie-x*ve)*ae,i[5]=(r*Ie-l*ye+c*ve)*ae,i[6]=(O*K-k*be-$*G)*ae,i[7]=(b*be-I*K+M*G)*ae,i[8]=(d*Pe-f*ye+x*De)*ae,i[9]=(s*ye-r*Pe-c*De)*ae,i[10]=(k*ce-z*K+$*Q)*ae,i[11]=(w*K-b*ce-M*Q)*ae,i[12]=(f*ve-d*Ce-_*De)*ae,i[13]=(r*Ce-s*ve+l*De)*ae,i[14]=(z*G-k*re-O*Q)*ae,i[15]=(b*re-w*G+I*Q)*ae,i):null},L.at=Nc,L.au=kc,L.av=jc,L.aw=function(){const i={},t=ie.$version;for(const r in ie.$root){const s=ie.$root[r];if(s.required){let l=null;l=r==="version"?t:s.type==="array"?[]:{},l!=null&&(i[r]=l)}}return i},L.ax=en,L.ay=Ci,L.az=function(i){i=i.slice();const t=Object.create(null);for(let r=0;r25||s<0||s>=1||r<0||r>=1)},L.bb=function(i,t){return i[0]=t[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=t[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=t[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},L.bc=class extends N{},L.bd=Bc,L.be=yp,L.bg=li,L.bh=function(i,t){vr.REGISTERED_PROTOCOLS[i]=t},L.bi=function(i){delete vr.REGISTERED_PROTOCOLS[i]},L.bj=function(i,t){const r={};for(let l=0;lIe*Mt)}let ve=d?"center":r.get("text-justify").evaluate(x,{},i.canonical);const ye=r.get("symbol-placement")==="point"?r.get("text-max-width").evaluate(x,{},i.canonical)*Mt:1/0,Ce=()=>{i.bucket.allowVerticalPlacement&&no(K)&&(k.vertical=Pl(z,i.glyphMap,i.glyphPositions,i.imagePositions,b,ye,c,be,"left",ce,$,L.ah.vertical,!0,I,w))};if(!d&&De){const Pe=new Set;if(ve==="auto")for(let ae=0;aep(void 0,void 0,void 0,function*(){if(i.byteLength===0)return createImageBitmap(new ImageData(1,1));const t=new Blob([new Uint8Array(i)],{type:"image/png"});try{return createImageBitmap(t)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),L.e=xi,L.f=i=>new Promise((t,r)=>{const s=new Image;s.onload=()=>{t(s),URL.revokeObjectURL(s.src),s.onload=null,window.requestAnimationFrame(()=>{s.src=Ps})},s.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const l=new Blob([new Uint8Array(i)],{type:"image/png"});s.src=i.byteLength?URL.createObjectURL(l):Ps}),L.g=Wi,L.h=(i,t)=>Ur(xi(i,{type:"json"}),t),L.i=or,L.j=wr,L.k=br,L.l=(i,t)=>Ur(xi(i,{type:"arrayBuffer"}),t),L.m=Ur,L.n=function(i){return new Pc(i).readFields(Hd,[])},L.o=yo,L.p=jh,L.q=m,L.r=ra,L.s=$r,L.t=al,L.u=Qr,L.v=ie,L.w=Lt,L.x=function([i,t,r]){return t+=90,t*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(t)*Math.sin(r),y:i*Math.sin(t)*Math.sin(r),z:i*Math.cos(r)}},L.y=di,L.z=it}),Vr("worker",["./shared"],function(L){class p{constructor(A){this.keyCache={},A&&this.replace(A)}replace(A){this._layerConfigs={},this._layers={},this.update(A,[])}update(A,P){for(const V of A){this._layerConfigs[V.id]=V;const H=this._layers[V.id]=L.aA(V);H._featureFilter=L.a7(H.filter),this.keyCache[V.id]&&delete this.keyCache[V.id]}for(const V of P)delete this.keyCache[V],delete this._layerConfigs[V],delete this._layers[V];this.familiesBySource={};const E=L.bj(Object.values(this._layerConfigs),this.keyCache);for(const V of E){const H=V.map(te=>this._layers[te.id]),X=H[0];if(X.visibility==="none")continue;const J=X.source||"";let q=this.familiesBySource[J];q||(q=this.familiesBySource[J]={});const ne=X.sourceLayer||"_geojsonTileLayer";let le=q[ne];le||(le=q[ne]=[]),le.push(H)}}}class Pi{constructor(A){const P={},E=[];for(const J in A){const q=A[J],ne=P[J]={};for(const le in q){const te=q[+le];if(!te||te.bitmap.width===0||te.bitmap.height===0)continue;const fe={x:0,y:0,w:te.bitmap.width+2,h:te.bitmap.height+2};E.push(fe),ne[le]={rect:fe,metrics:te.metrics}}}const{w:V,h:H}=L.p(E),X=new L.o({width:V||1,height:H||1});for(const J in A){const q=A[J];for(const ne in q){const le=q[+ne];if(!le||le.bitmap.width===0||le.bitmap.height===0)continue;const te=P[J][ne].rect;L.o.copy(le.bitmap,X,{x:0,y:0},{x:te.x+1,y:te.y+1},le.bitmap)}}this.image=X,this.positions=P}}L.bk("GlyphAtlas",Pi);class qi{constructor(A){this.tileID=new L.S(A.tileID.overscaledZ,A.tileID.wrap,A.tileID.canonical.z,A.tileID.canonical.x,A.tileID.canonical.y),this.uid=A.uid,this.zoom=A.zoom,this.pixelRatio=A.pixelRatio,this.tileSize=A.tileSize,this.source=A.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=A.showCollisionBoxes,this.collectResourceTiming=!!A.collectResourceTiming,this.returnDependencies=!!A.returnDependencies,this.promoteId=A.promoteId,this.inFlightDependencies=[]}parse(A,P,E,V){return L._(this,void 0,void 0,function*(){this.status="parsing",this.data=A,this.collisionBoxArray=new L.a5;const H=new L.bl(Object.keys(A.layers).sort()),X=new L.bm(this.tileID,this.promoteId);X.bucketLayerIDs=[];const J={},q={featureIndex:X,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:E},ne=P.familiesBySource[this.source];for(const $e in ne){const Qe=A.layers[$e];if(!Qe)continue;Qe.version===1&&L.w(`Vector tile source "${this.source}" layer "${$e}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const pt=H.encode($e),At=[];for(let Rt=0;Rt=Bt.maxzoom||Bt.visibility!=="none"&&(Gt(Rt,this.zoom,E),(J[Bt.id]=Bt.createBucket({index:X.bucketLayerIDs.length,layers:Rt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:pt,sourceID:this.source})).populate(At,q,this.tileID.canonical),X.bucketLayerIDs.push(Rt.map(jn=>jn.id)))}}const le=L.aF(q.glyphDependencies,$e=>Object.keys($e).map(Number));this.inFlightDependencies.forEach($e=>$e==null?void 0:$e.abort()),this.inFlightDependencies=[];let te=Promise.resolve({});if(Object.keys(le).length){const $e=new AbortController;this.inFlightDependencies.push($e),te=V.sendAsync({type:"GG",data:{stacks:le,source:this.source,tileID:this.tileID,type:"glyphs"}},$e)}const fe=Object.keys(q.iconDependencies);let ze=Promise.resolve({});if(fe.length){const $e=new AbortController;this.inFlightDependencies.push($e),ze=V.sendAsync({type:"GI",data:{icons:fe,source:this.source,tileID:this.tileID,type:"icons"}},$e)}const Ee=Object.keys(q.patternDependencies);let Ne=Promise.resolve({});if(Ee.length){const $e=new AbortController;this.inFlightDependencies.push($e),Ne=V.sendAsync({type:"GI",data:{icons:Ee,source:this.source,tileID:this.tileID,type:"patterns"}},$e)}const[We,Ve,at]=yield Promise.all([te,ze,Ne]),_t=new Pi(We),St=new L.bn(Ve,at);for(const $e in J){const Qe=J[$e];Qe instanceof L.a6?(Gt(Qe.layers,this.zoom,E),L.bo({bucket:Qe,glyphMap:We,glyphPositions:_t.positions,imageMap:Ve,imagePositions:St.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Qe.hasPattern&&(Qe instanceof L.bp||Qe instanceof L.bq||Qe instanceof L.br)&&(Gt(Qe.layers,this.zoom,E),Qe.addFeatures(q,this.tileID.canonical,St.patternPositions))}return this.status="done",{buckets:Object.values(J).filter($e=>!$e.isEmpty()),featureIndex:X,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:_t.image,imageAtlas:St,glyphMap:this.returnDependencies?We:null,iconMap:this.returnDependencies?Ve:null,glyphPositions:this.returnDependencies?_t.positions:null}})}}function Gt(j,A,P){const E=new L.z(A);for(const V of j)V.recalculate(E,P)}class _e{constructor(A,P,E){this.actor=A,this.layerIndex=P,this.availableImages=E,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(A,P){return L._(this,void 0,void 0,function*(){const E=yield L.l(A.request,P);try{return{vectorTile:new L.bs.VectorTile(new L.bt(E.data)),rawData:E.data,cacheControl:E.cacheControl,expires:E.expires}}catch(V){const H=new Uint8Array(E.data);let X=`Unable to parse the tile at ${A.request.url}, `;throw X+=H[0]===31&&H[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${V.message}`,new Error(X)}})}loadTile(A){return L._(this,void 0,void 0,function*(){const P=A.uid,E=!!(A&&A.request&&A.request.collectResourceTiming)&&new L.bu(A.request),V=new qi(A);this.loading[P]=V;const H=new AbortController;V.abort=H;try{const X=yield this.loadVectorTile(A,H);if(delete this.loading[P],!X)return null;const J=X.rawData,q={};X.expires&&(q.expires=X.expires),X.cacheControl&&(q.cacheControl=X.cacheControl);const ne={};if(E){const te=E.finish();te&&(ne.resourceTiming=JSON.parse(JSON.stringify(te)))}V.vectorTile=X.vectorTile;const le=V.parse(X.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[P]=V,this.fetching[P]={rawTileData:J,cacheControl:q,resourceTiming:ne};try{const te=yield le;return L.e({rawTileData:J.slice(0)},te,q,ne)}finally{delete this.fetching[P]}}catch(X){throw delete this.loading[P],V.status="done",this.loaded[P]=V,X}})}reloadTile(A){return L._(this,void 0,void 0,function*(){const P=A.uid;if(!this.loaded||!this.loaded[P])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const E=this.loaded[P];if(E.showCollisionBoxes=A.showCollisionBoxes,E.status==="parsing"){const V=yield E.parse(E.vectorTile,this.layerIndex,this.availableImages,this.actor);let H;if(this.fetching[P]){const{rawTileData:X,cacheControl:J,resourceTiming:q}=this.fetching[P];delete this.fetching[P],H=L.e({rawTileData:X.slice(0)},V,J,q)}else H=V;return H}if(E.status==="done"&&E.vectorTile)return E.parse(E.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(A){return L._(this,void 0,void 0,function*(){const P=this.loading,E=A.uid;P&&P[E]&&P[E].abort&&(P[E].abort.abort(),delete P[E])})}removeTile(A){return L._(this,void 0,void 0,function*(){this.loaded&&this.loaded[A.uid]&&delete this.loaded[A.uid]})}}class se{constructor(){this.loaded={}}loadTile(A){return L._(this,void 0,void 0,function*(){const{uid:P,encoding:E,rawImageData:V,redFactor:H,greenFactor:X,blueFactor:J,baseShift:q}=A,ne=V.width+2,le=V.height+2,te=L.b(V)?new L.R({width:ne,height:le},yield L.bv(V,-1,-1,ne,le)):V,fe=new L.bw(P,te,E,H,X,J,q);return this.loaded=this.loaded||{},this.loaded[P]=fe,fe})}removeTile(A){const P=this.loaded,E=A.uid;P&&P[E]&&delete P[E]}}function Nr(j,A){if(j.length!==0){yr(j[0],A);for(var P=1;P=Math.abs(J)?P-q+J:J-q+P,P=q}P+E>=0!=!!A&&j.reverse()}var Zi=L.bx(function j(A,P){var E,V=A&&A.type;if(V==="FeatureCollection")for(E=0;E>31}function or(j,A){for(var P=j.loadGeometry(),E=j.type,V=0,H=0,X=P.length,J=0;Jj},jr=Math.fround||(lr=new Float32Array(1),j=>(lr[0]=+j,lr[0]));var lr;const Qt=3,Mi=5,cn=6;class vr{constructor(A){this.options=Object.assign(Object.create(Ps),A),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(A){const{log:P,minZoom:E,maxZoom:V}=this.options;P&&console.time("total time");const H=`prepare ${A.length} points`;P&&console.time(H),this.points=A;const X=[];for(let q=0;q=E;q--){const ne=+Date.now();J=this.trees[q]=this._createTree(this._cluster(J,q)),P&&console.log("z%d: %d clusters in %dms",q,J.numItems,+Date.now()-ne)}return P&&console.timeEnd("total time"),this}getClusters(A,P){let E=((A[0]+180)%360+360)%360-180;const V=Math.max(-90,Math.min(90,A[1]));let H=A[2]===180?180:((A[2]+180)%360+360)%360-180;const X=Math.max(-90,Math.min(90,A[3]));if(A[2]-A[0]>=360)E=-180,H=180;else if(E>H){const te=this.getClusters([E,V,180,X],P),fe=this.getClusters([-180,V,H,X],P);return te.concat(fe)}const J=this.trees[this._limitZoom(P)],q=J.range(li(E),Ci(X),li(H),Ci(V)),ne=J.data,le=[];for(const te of q){const fe=this.stride*te;le.push(ne[fe+Mi]>1?Wi(ne,fe,this.clusterProps):this.points[ne[fe+Qt]])}return le}getChildren(A){const P=this._getOriginId(A),E=this._getOriginZoom(A),V="No cluster with the specified id.",H=this.trees[E];if(!H)throw new Error(V);const X=H.data;if(P*this.stride>=X.length)throw new Error(V);const J=this.options.radius/(this.options.extent*Math.pow(2,E-1)),q=H.within(X[P*this.stride],X[P*this.stride+1],J),ne=[];for(const le of q){const te=le*this.stride;X[te+4]===A&&ne.push(X[te+Mi]>1?Wi(X,te,this.clusterProps):this.points[X[te+Qt]])}if(ne.length===0)throw new Error(V);return ne}getLeaves(A,P,E){const V=[];return this._appendLeaves(V,A,P=P||10,E=E||0,0),V}getTile(A,P,E){const V=this.trees[this._limitZoom(A)],H=Math.pow(2,A),{extent:X,radius:J}=this.options,q=J/X,ne=(E-q)/H,le=(E+1+q)/H,te={features:[]};return this._addTileFeatures(V.range((P-q)/H,ne,(P+1+q)/H,le),V.data,P,E,H,te),P===0&&this._addTileFeatures(V.range(1-q/H,ne,1,le),V.data,H,E,H,te),P===H-1&&this._addTileFeatures(V.range(0,ne,q/H,le),V.data,-1,E,H,te),te.features.length?te:null}getClusterExpansionZoom(A){let P=this._getOriginZoom(A)-1;for(;P<=this.options.maxZoom;){const E=this.getChildren(A);if(P++,E.length!==1)break;A=E[0].properties.cluster_id}return P}_appendLeaves(A,P,E,V,H){const X=this.getChildren(P);for(const J of X){const q=J.properties;if(q&&q.cluster?H+q.point_count<=V?H+=q.point_count:H=this._appendLeaves(A,q.cluster_id,E,V,H):H1;let le,te,fe;if(ne)le=hn(P,q,this.clusterProps),te=P[q],fe=P[q+1];else{const Ne=this.points[P[q+Qt]];le=Ne.properties;const[We,Ve]=Ne.geometry.coordinates;te=li(We),fe=Ci(Ve)}const ze={type:1,geometry:[[Math.round(this.options.extent*(te*H-E)),Math.round(this.options.extent*(fe*H-V))]],tags:le};let Ee;Ee=ne||this.options.generateId?P[q+Qt]:this.points[P[q+Qt]].id,Ee!==void 0&&(ze.id=Ee),X.features.push(ze)}}_limitZoom(A){return Math.max(this.options.minZoom,Math.min(Math.floor(+A),this.options.maxZoom+1))}_cluster(A,P){const{radius:E,extent:V,reduce:H,minPoints:X}=this.options,J=E/(V*Math.pow(2,P)),q=A.data,ne=[],le=this.stride;for(let te=0;teP&&(We+=q[at+Mi])}if(We>Ne&&We>=X){let Ve,at=fe*Ne,_t=ze*Ne,St=-1;const $e=((te/le|0)<<5)+(P+1)+this.points.length;for(const Qe of Ee){const pt=Qe*le;if(q[pt+2]<=P)continue;q[pt+2]=P;const At=q[pt+Mi];at+=q[pt]*At,_t+=q[pt+1]*At,q[pt+4]=$e,H&&(Ve||(Ve=this._map(q,te,!0),St=this.clusterProps.length,this.clusterProps.push(Ve)),H(Ve,this._map(q,pt)))}q[te+4]=$e,ne.push(at/We,_t/We,1/0,$e,-1,We),H&&ne.push(St)}else{for(let Ve=0;Ve1)for(const Ve of Ee){const at=Ve*le;if(!(q[at+2]<=P)){q[at+2]=P;for(let _t=0;_t>5}_getOriginZoom(A){return(A-this.points.length)%32}_map(A,P,E){if(A[P+Mi]>1){const X=this.clusterProps[A[P+cn]];return E?Object.assign({},X):X}const V=this.points[A[P+Qt]].properties,H=this.options.map(V);return E&&H===V?Object.assign({},H):H}}function Wi(j,A,P){return{type:"Feature",id:j[A+Qt],properties:hn(j,A,P),geometry:{type:"Point",coordinates:[(E=j[A],360*(E-.5)),Ur(j[A+1])]}};var E}function hn(j,A,P){const E=j[A+Mi],V=E>=1e4?`${Math.round(E/1e3)}k`:E>=1e3?Math.round(E/100)/10+"k":E,H=j[A+cn],X=H===-1?{}:Object.assign({},P[H]);return Object.assign(X,{cluster:!0,cluster_id:j[A+Qt],point_count:E,point_count_abbreviated:V})}function li(j){return j/360+.5}function Ci(j){const A=Math.sin(j*Math.PI/180),P=.5-.25*Math.log((1+A)/(1-A))/Math.PI;return P<0?0:P>1?1:P}function Ur(j){const A=(180-360*j)*Math.PI/180;return 360*Math.atan(Math.exp(A))/Math.PI-90}function $r(j,A,P,E){let V=E;const H=A+(P-A>>1);let X,J=P-A;const q=j[A],ne=j[A+1],le=j[P],te=j[P+1];for(let fe=A+3;feV)X=fe,V=ze;else if(ze===V){const Ee=Math.abs(fe-H);EeE&&(X-A>3&&$r(j,A,X,E),j[X+2]=V,P-X>3&&$r(j,X,P,E))}function Bn(j,A,P,E,V,H){let X=V-P,J=H-E;if(X!==0||J!==0){const q=((j-P)*X+(A-E)*J)/(X*X+J*J);q>1?(P=V,E=H):q>0&&(P+=X*q,E+=J*q)}return X=j-P,J=A-E,X*X+J*J}function cr(j,A,P,E){const V={id:j??null,type:A,geometry:P,tags:E,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(A==="Point"||A==="MultiPoint"||A==="LineString")br(V,P);else if(A==="Polygon")br(V,P[0]);else if(A==="MultiLineString")for(const H of P)br(V,H);else if(A==="MultiPolygon")for(const H of P)br(V,H[0]);return V}function br(j,A){for(let P=0;P0&&(X+=E?(V*le-ne*H)/2:Math.sqrt(Math.pow(ne-V,2)+Math.pow(le-H,2))),V=ne,H=le}const J=A.length-3;A[2]=1,$r(A,0,J,P),A[J+2]=1,A.size=Math.abs(X),A.start=0,A.end=A.size}function qr(j,A,P,E){for(let V=0;V1?1:P}function mt(j,A,P,E,V,H,X,J){if(E/=A,H>=(P/=A)&&X=E)return null;const q=[];for(const ne of j){const le=ne.geometry;let te=ne.type;const fe=V===0?ne.minX:ne.minY,ze=V===0?ne.maxX:ne.maxY;if(fe>=P&&ze=E)continue;let Ee=[];if(te==="Point"||te==="MultiPoint")On(le,Ee,P,E,V);else if(te==="LineString")Tr(le,Ee,P,E,V,!1,J.lineMetrics);else if(te==="MultiLineString")dn(le,Ee,P,E,V,!1);else if(te==="Polygon")dn(le,Ee,P,E,V,!0);else if(te==="MultiPolygon")for(const Ne of le){const We=[];dn(Ne,We,P,E,V,!0),We.length&&Ee.push(We)}if(Ee.length){if(J.lineMetrics&&te==="LineString"){for(const Ne of Ee)q.push(cr(ne.id,te,Ne,ne.tags));continue}te!=="LineString"&&te!=="MultiLineString"||(Ee.length===1?(te="LineString",Ee=Ee[0]):te="MultiLineString"),te!=="Point"&&te!=="MultiPoint"||(te=Ee.length===3?"Point":"MultiPoint"),q.push(cr(ne.id,te,Ee,ne.tags))}}return q.length?q:null}function On(j,A,P,E,V){for(let H=0;H=P&&X<=E&&vi(A,j[H],j[H+1],j[H+2])}}function Tr(j,A,P,E,V,H,X){let J=hr(j);const q=V===0?Vn:Nn;let ne,le,te=j.start;for(let We=0;WeP&&(le=q(J,Ve,at,St,$e,P),X&&(J.start=te+ne*le)):Qe>E?pt=P&&(le=q(J,Ve,at,St,$e,P),At=!0),pt>E&&Qe<=E&&(le=q(J,Ve,at,St,$e,E),At=!0),!H&&At&&(X&&(J.end=te+ne*le),A.push(J),J=hr(j)),X&&(te+=ne)}let fe=j.length-3;const ze=j[fe],Ee=j[fe+1],Ne=V===0?ze:Ee;Ne>=P&&Ne<=E&&vi(J,ze,Ee,j[fe+2]),fe=J.length-3,H&&fe>=3&&(J[fe]!==J[0]||J[fe+1]!==J[1])&&vi(J,J[0],J[1],J[2]),J.length&&A.push(J)}function hr(j){const A=[];return A.size=j.size,A.start=j.start,A.end=j.end,A}function dn(j,A,P,E,V,H){for(const X of j)Tr(X,A,P,E,V,H,!1)}function vi(j,A,P,E){j.push(A,P,E)}function Vn(j,A,P,E,V,H){const X=(H-A)/(E-A);return vi(j,H,P+(V-P)*X,1),X}function Nn(j,A,P,E,V,H){const X=(H-P)/(V-P);return vi(j,A+(E-A)*X,H,1),X}function pe(j,A){const P=[];for(let E=0;E0&&A.size<(V?X:E))return void(P.numPoints+=A.length/3);const J=[];for(let q=0;qX)&&(P.numSimplified++,J.push(A[q],A[q+1])),P.numPoints++;V&&function(q,ne){let le=0;for(let te=0,fe=q.length,ze=fe-2;te0===ne)for(let te=0,fe=q.length;te24)throw new Error("maxZoom should be in the 0-24 range");if(P.promoteId&&P.generateId)throw new Error("promoteId and generateId cannot be used together.");let V=function(H,X){const J=[];if(H.type==="FeatureCollection")for(let q=0;q1&&console.time("creation"),ze=this.tiles[fe]=Sr(A,P,E,V,ne),this.tileCoords.push({z:P,x:E,y:V}),le)){le>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",P,E,V,ze.numFeatures,ze.numPoints,ze.numSimplified),console.timeEnd("creation"));const At=`z${P}`;this.stats[At]=(this.stats[At]||0)+1,this.total++}if(ze.source=A,H==null){if(P===ne.indexMaxZoom||ze.numPoints<=ne.indexMaxPoints)continue}else{if(P===ne.maxZoom||P===H)continue;if(H!=null){const At=H-P;if(E!==X>>At||V!==J>>At)continue}}if(ze.source=null,A.length===0)continue;le>1&&console.time("clipping");const Ee=.5*ne.buffer/ne.extent,Ne=.5-Ee,We=.5+Ee,Ve=1+Ee;let at=null,_t=null,St=null,$e=null,Qe=mt(A,te,E-Ee,E+We,0,ze.minX,ze.maxX,ne),pt=mt(A,te,E+Ne,E+Ve,0,ze.minX,ze.maxX,ne);A=null,Qe&&(at=mt(Qe,te,V-Ee,V+We,1,ze.minY,ze.maxY,ne),_t=mt(Qe,te,V+Ne,V+Ve,1,ze.minY,ze.maxY,ne),Qe=null),pt&&(St=mt(pt,te,V-Ee,V+We,1,ze.minY,ze.maxY,ne),$e=mt(pt,te,V+Ne,V+Ve,1,ze.minY,ze.maxY,ne),pt=null),le>1&&console.timeEnd("clipping"),q.push(at||[],P+1,2*E,2*V),q.push(_t||[],P+1,2*E,2*V+1),q.push(St||[],P+1,2*E+1,2*V),q.push($e||[],P+1,2*E+1,2*V+1)}}getTile(A,P,E){A=+A,P=+P,E=+E;const V=this.options,{extent:H,debug:X}=V;if(A<0||A>24)return null;const J=1<1&&console.log("drilling down to z%d-%d-%d",A,P,E);let ne,le=A,te=P,fe=E;for(;!ne&&le>0;)le--,te>>=1,fe>>=1,ne=this.tiles[ki(le,te,fe)];return ne&&ne.source?(X>1&&(console.log("found parent tile z%d-%d-%d",le,te,fe),console.time("drilling down")),this.splitTile(ne.source,le,te,fe,A,P,E),X>1&&console.timeEnd("drilling down"),this.tiles[q]?Xt(this.tiles[q],H):null):null}}function ki(j,A,P){return 32*((1<{te.properties=ze;const Ee={};for(const Ne of fe)Ee[Ne]=q[Ne].evaluate(le,te);return Ee},X.reduce=(ze,Ee)=>{te.properties=Ee;for(const Ne of fe)le.accumulated=ze[Ne],ze[Ne]=ne[Ne].evaluate(le,te)},X}(A)).load((yield this._pendingData).features):(V=yield this._pendingData,new ei(V,A.geojsonVtOptions)),this.loaded={};const H={};if(E){const X=E.finish();X&&(H.resourceTiming={},H.resourceTiming[A.source]=JSON.parse(JSON.stringify(X)))}return H}catch(H){if(delete this._pendingRequest,L.bA(H))return{abandoned:!0};throw H}var V})}getData(){return L._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(A){const P=this.loaded;return P&&P[A.uid]?super.reloadTile(A):this.loadTile(A)}loadAndProcessGeoJSON(A,P){return L._(this,void 0,void 0,function*(){let E=yield this.loadGeoJSON(A,P);if(delete this._pendingRequest,typeof E!="object")throw new Error(`Input data given to '${A.source}' is not a valid GeoJSON object.`);if(Zi(E,!0),A.filter){const V=L.bB(A.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(V.result==="error")throw new Error(V.value.map(X=>`${X.key}: ${X.message}`).join(", "));E={type:"FeatureCollection",features:E.features.filter(X=>V.value.evaluate({zoom:0},X))}}return E})}loadGeoJSON(A,P){return L._(this,void 0,void 0,function*(){const{promoteId:E}=A;if(A.request){const V=yield L.h(A.request,P);return this._dataUpdateable=Yi(V.data,E)?ur(V.data,E):void 0,V.data}if(typeof A.data=="string")try{const V=JSON.parse(A.data);return this._dataUpdateable=Yi(V,E)?ur(V,E):void 0,V}catch{throw new Error(`Input data given to '${A.source}' is not a valid GeoJSON object.`)}if(!A.dataDiff)throw new Error(`Input data given to '${A.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${A.source}`);return function(V,H,X){var J,q,ne,le;if(H.removeAll&&V.clear(),H.remove)for(const te of H.remove)V.delete(te);if(H.add)for(const te of H.add){const fe=Oe(te,X);fe!=null&&V.set(fe,te)}if(H.update)for(const te of H.update){let fe=V.get(te.id);if(fe==null)continue;const ze=!te.removeAllProperties&&(((J=te.removeProperties)===null||J===void 0?void 0:J.length)>0||((q=te.addOrUpdateProperties)===null||q===void 0?void 0:q.length)>0);if((te.newGeometry||te.removeAllProperties||ze)&&(fe=Object.assign({},fe),V.set(te.id,fe),ze&&(fe.properties=Object.assign({},fe.properties))),te.newGeometry&&(fe.geometry=te.newGeometry),te.removeAllProperties)fe.properties={};else if(((ne=te.removeProperties)===null||ne===void 0?void 0:ne.length)>0)for(const Ee of te.removeProperties)Object.prototype.hasOwnProperty.call(fe.properties,Ee)&&delete fe.properties[Ee];if(((le=te.addOrUpdateProperties)===null||le===void 0?void 0:le.length)>0)for(const{key:Ee,value:Ne}of te.addOrUpdateProperties)fe.properties[Ee]=Ne}}(this._dataUpdateable,A.dataDiff,E),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(A){return L._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(A){return this._geoJSONIndex.getClusterExpansionZoom(A.clusterId)}getClusterChildren(A){return this._geoJSONIndex.getChildren(A.clusterId)}getClusterLeaves(A){return this._geoJSONIndex.getLeaves(A.clusterId,A.limit,A.offset)}}class Qi{constructor(A){this.self=A,this.actor=new L.F(A),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(P,E)=>{if(this.externalWorkerSourceTypes[P])throw new Error(`Worker source with name "${P}" already registered.`);this.externalWorkerSourceTypes[P]=E},this.self.addProtocol=L.bh,this.self.removeProtocol=L.bi,this.self.registerRTLTextPlugin=P=>{if(L.bC.isParsed())throw new Error("RTL text plugin already registered.");L.bC.setMethods(P)},this.actor.registerMessageHandler("LDT",(P,E)=>this._getDEMWorkerSource(P,E.source).loadTile(E)),this.actor.registerMessageHandler("RDT",(P,E)=>L._(this,void 0,void 0,function*(){this._getDEMWorkerSource(P,E.source).removeTile(E)})),this.actor.registerMessageHandler("GCEZ",(P,E)=>L._(this,void 0,void 0,function*(){return this._getWorkerSource(P,E.type,E.source).getClusterExpansionZoom(E)})),this.actor.registerMessageHandler("GCC",(P,E)=>L._(this,void 0,void 0,function*(){return this._getWorkerSource(P,E.type,E.source).getClusterChildren(E)})),this.actor.registerMessageHandler("GCL",(P,E)=>L._(this,void 0,void 0,function*(){return this._getWorkerSource(P,E.type,E.source).getClusterLeaves(E)})),this.actor.registerMessageHandler("LD",(P,E)=>this._getWorkerSource(P,E.type,E.source).loadData(E)),this.actor.registerMessageHandler("GD",(P,E)=>this._getWorkerSource(P,E.type,E.source).getData()),this.actor.registerMessageHandler("LT",(P,E)=>this._getWorkerSource(P,E.type,E.source).loadTile(E)),this.actor.registerMessageHandler("RT",(P,E)=>this._getWorkerSource(P,E.type,E.source).reloadTile(E)),this.actor.registerMessageHandler("AT",(P,E)=>this._getWorkerSource(P,E.type,E.source).abortTile(E)),this.actor.registerMessageHandler("RMT",(P,E)=>this._getWorkerSource(P,E.type,E.source).removeTile(E)),this.actor.registerMessageHandler("RS",(P,E)=>L._(this,void 0,void 0,function*(){if(!this.workerSources[P]||!this.workerSources[P][E.type]||!this.workerSources[P][E.type][E.source])return;const V=this.workerSources[P][E.type][E.source];delete this.workerSources[P][E.type][E.source],V.removeSource!==void 0&&V.removeSource(E)})),this.actor.registerMessageHandler("RM",P=>L._(this,void 0,void 0,function*(){delete this.layerIndexes[P],delete this.availableImages[P],delete this.workerSources[P],delete this.demWorkerSources[P]})),this.actor.registerMessageHandler("SR",(P,E)=>L._(this,void 0,void 0,function*(){this.referrer=E})),this.actor.registerMessageHandler("SRPS",(P,E)=>this._syncRTLPluginState(P,E)),this.actor.registerMessageHandler("IS",(P,E)=>L._(this,void 0,void 0,function*(){this.self.importScripts(E)})),this.actor.registerMessageHandler("SI",(P,E)=>this._setImages(P,E)),this.actor.registerMessageHandler("UL",(P,E)=>L._(this,void 0,void 0,function*(){this._getLayerIndex(P).update(E.layers,E.removedIds)})),this.actor.registerMessageHandler("SL",(P,E)=>L._(this,void 0,void 0,function*(){this._getLayerIndex(P).replace(E)}))}_setImages(A,P){return L._(this,void 0,void 0,function*(){this.availableImages[A]=P;for(const E in this.workerSources[A]){const V=this.workerSources[A][E];for(const H in V)V[H].availableImages=P}})}_syncRTLPluginState(A,P){return L._(this,void 0,void 0,function*(){if(L.bC.isParsed())return L.bC.getState();if(P.pluginStatus!=="loading")return L.bC.setState(P),P;const E=P.pluginURL;if(this.self.importScripts(E),L.bC.isParsed()){const V={pluginStatus:"loaded",pluginURL:E};return L.bC.setState(V),V}throw L.bC.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${E}`)})}_getAvailableImages(A){let P=this.availableImages[A];return P||(P=[]),P}_getLayerIndex(A){let P=this.layerIndexes[A];return P||(P=this.layerIndexes[A]=new p),P}_getWorkerSource(A,P,E){if(this.workerSources[A]||(this.workerSources[A]={}),this.workerSources[A][P]||(this.workerSources[A][P]={}),!this.workerSources[A][P][E]){const V={sendAsync:(H,X)=>(H.targetMapId=A,this.actor.sendAsync(H,X))};switch(P){case"vector":this.workerSources[A][P][E]=new _e(V,this._getLayerIndex(A),this._getAvailableImages(A));break;case"geojson":this.workerSources[A][P][E]=new Ir(V,this._getLayerIndex(A),this._getAvailableImages(A));break;default:this.workerSources[A][P][E]=new this.externalWorkerSourceTypes[P](V,this._getLayerIndex(A),this._getAvailableImages(A))}}return this.workerSources[A][P][E]}_getDEMWorkerSource(A,P){return this.demWorkerSources[A]||(this.demWorkerSources[A]={}),this.demWorkerSources[A][P]||(this.demWorkerSources[A][P]=new se),this.demWorkerSources[A][P]}}return L.i(self)&&(self.worker=new Qi(self)),Qi}),Vr("index",["exports","./shared"],function(L,p){var Pi="4.6.0";let qi,Gt;const _e={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:h=>new Promise((e,n)=>{const a=requestAnimationFrame(e);h.signal.addEventListener("abort",()=>{cancelAnimationFrame(a),n(p.c())})}),getImageData(h,e=0){return this.getImageCanvasContext(h).getImageData(-e,-e,h.width+2*e,h.height+2*e)},getImageCanvasContext(h){const e=window.document.createElement("canvas"),n=e.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return e.width=h.width,e.height=h.height,n.drawImage(h,0,0,h.width,h.height),n},resolveURL:h=>(qi||(qi=document.createElement("a")),qi.href=h,qi.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Gt==null&&(Gt=matchMedia("(prefers-reduced-motion: reduce)")),Gt.matches)}};class se{static testProp(e){if(!se.docStyle)return e[0];for(let n=0;n{window.removeEventListener("click",se.suppressClickInternal,!0)},0)}static getScale(e){const n=e.getBoundingClientRect();return{x:n.width/e.offsetWidth||1,y:n.height/e.offsetHeight||1,boundingClientRect:n}}static getPoint(e,n,a){const o=n.boundingClientRect;return new p.P((a.clientX-o.left)/n.x-e.clientLeft,(a.clientY-o.top)/n.y-e.clientTop)}static mousePos(e,n){const a=se.getScale(e);return se.getPoint(e,a,n)}static touchPos(e,n){const a=[],o=se.getScale(e);for(let u=0;u{yr&&Ln(yr),yr=null,ar=!0},Zi.onerror=()=>{xr=!0,yr=null},Zi.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(h){let e,n,a,o;h.resetRequestQueue=()=>{e=[],n=0,a=0,o={}},h.addThrottleControl=y=>{const v=a++;return o[v]=y,v},h.removeThrottleControl=y=>{delete o[y],m()},h.getImage=(y,v,S=!0)=>new Promise((T,C)=>{Nr.supported&&(y.headers||(y.headers={}),y.headers.accept="image/webp,*/*"),p.e(y,{type:"image"}),e.push({abortController:v,requestParameters:y,supportImageRefresh:S,state:"queued",onError:D=>{C(D)},onSuccess:D=>{T(D)}}),m()});const u=y=>p._(this,void 0,void 0,function*(){y.state="running";const{requestParameters:v,supportImageRefresh:S,onError:T,onSuccess:C,abortController:D}=y,R=S===!1&&!p.i(self)&&!p.g(v.url)&&(!v.headers||Object.keys(v.headers).reduce((U,Z)=>U&&Z==="accept",!0));n++;const N=R?g(v,D):p.m(v,D);try{const U=yield N;delete y.abortController,y.state="completed",U.data instanceof HTMLImageElement||p.b(U.data)?C(U):U.data&&C({data:yield(B=U.data,typeof createImageBitmap=="function"?p.d(B):p.f(B)),cacheControl:U.cacheControl,expires:U.expires})}catch(U){delete y.abortController,T(U)}finally{n--,m()}var B}),m=()=>{const y=(()=>{for(const v of Object.keys(o))if(o[v]())return!0;return!1})()?p.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:p.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let v=n;v0;v++){const S=e.shift();S.abortController.signal.aborted?v--:u(S)}},g=(y,v)=>new Promise((S,T)=>{const C=new Image,D=y.url,R=y.credentials;R&&R==="include"?C.crossOrigin="use-credentials":(R&&R==="same-origin"||!p.s(D))&&(C.crossOrigin="anonymous"),v.signal.addEventListener("abort",()=>{C.src="",T(p.c())}),C.fetchPriority="high",C.onload=()=>{C.onerror=C.onload=null,S({data:C})},C.onerror=()=>{C.onerror=C.onload=null,v.signal.aborted||T(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},C.src=D})}(oi||(oi={})),oi.resetRequestQueue();class wa{constructor(e){this._transformRequestFn=e}transformRequest(e,n){return this._transformRequestFn&&this._transformRequestFn(e,n)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function Ai(h){var e=new p.A(3);return e[0]=h[0],e[1]=h[1],e[2]=h[2],e}var Gi,xi=function(h,e,n){return h[0]=e[0]-n[0],h[1]=e[1]-n[1],h[2]=e[2]-n[2],h};Gi=new p.A(3),p.A!=Float32Array&&(Gi[0]=0,Gi[1]=0,Gi[2]=0);var Ss=function(h){var e=h[0],n=h[1];return e*e+n*n};function Hi(h){const e=[];if(typeof h=="string")e.push({id:"default",url:h});else if(h&&h.length>0){const n=[];for(const{id:a,url:o}of h){const u=`${a}${o}`;n.indexOf(u)===-1&&(n.push(u),e.push({id:a,url:o}))}}return e}function Rn(h,e,n){const a=h.split("?");return a[0]+=`${e}${n}`,a.join("?")}(function(){var h=new p.A(2);p.A!=Float32Array&&(h[0]=0,h[1]=0)})();class tt{constructor(e,n,a,o){this.context=e,this.format=a,this.texture=e.gl.createTexture(),this.update(n,o)}update(e,n,a){const{width:o,height:u}=e,m=!(this.size&&this.size[0]===o&&this.size[1]===u||a),{context:g}=this,{gl:y}=g;if(this.useMipmap=!!(n&&n.useMipmap),y.bindTexture(y.TEXTURE_2D,this.texture),g.pixelStoreUnpackFlipY.set(!1),g.pixelStoreUnpack.set(1),g.pixelStoreUnpackPremultiplyAlpha.set(this.format===y.RGBA&&(!n||n.premultiply!==!1)),m)this.size=[o,u],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||p.b(e)?y.texImage2D(y.TEXTURE_2D,0,this.format,this.format,y.UNSIGNED_BYTE,e):y.texImage2D(y.TEXTURE_2D,0,this.format,o,u,0,this.format,y.UNSIGNED_BYTE,e.data);else{const{x:v,y:S}=a||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||p.b(e)?y.texSubImage2D(y.TEXTURE_2D,0,v,S,y.RGBA,y.UNSIGNED_BYTE,e):y.texSubImage2D(y.TEXTURE_2D,0,v,S,o,u,y.RGBA,y.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&y.generateMipmap(y.TEXTURE_2D)}bind(e,n,a){const{context:o}=this,{gl:u}=o;u.bindTexture(u.TEXTURE_2D,this.texture),a!==u.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(a=u.LINEAR),e!==this.filter&&(u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,a||e),this.filter=e),n!==this.wrap&&(u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,n),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function Is(h){const{userImage:e}=h;return!!(e&&e.render&&e.render())&&(h.data.replace(new Uint8Array(e.data.buffer)),!0)}class Lt extends p.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new p.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:n,promiseResolve:a}of this.requestors)a(this._getImagesForIds(n));this.requestors=[]}}getImage(e){const n=this.images[e];if(n&&!n.data&&n.spriteData){const a=n.spriteData;n.data=new p.R({width:a.width,height:a.height},a.context.getImageData(a.x,a.y,a.width,a.height).data),n.spriteData=null}return n}addImage(e,n){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,n)&&(this.images[e]=n)}_validate(e,n){let a=!0;const o=n.data||n.spriteData;return this._validateStretch(n.stretchX,o&&o.width)||(this.fire(new p.j(new Error(`Image "${e}" has invalid "stretchX" value`))),a=!1),this._validateStretch(n.stretchY,o&&o.height)||(this.fire(new p.j(new Error(`Image "${e}" has invalid "stretchY" value`))),a=!1),this._validateContent(n.content,n)||(this.fire(new p.j(new Error(`Image "${e}" has invalid "content" value`))),a=!1),a}_validateStretch(e,n){if(!e)return!0;let a=0;for(const o of e){if(o[0]{let o=!0;if(!this.isLoaded())for(const u of e)this.images[u]||(o=!1);this.isLoaded()||o?n(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:n})})}_getImagesForIds(e){const n={};for(const a of e){let o=this.getImage(a);o||(this.fire(new p.k("styleimagemissing",{id:a})),o=this.getImage(a)),o?n[a]={data:o.data.clone(),pixelRatio:o.pixelRatio,sdf:o.sdf,version:o.version,stretchX:o.stretchX,stretchY:o.stretchY,content:o.content,textFitWidth:o.textFitWidth,textFitHeight:o.textFitHeight,hasRenderCallback:!!(o.userImage&&o.userImage.render)}:p.w(`Image "${a}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return n}getPixelSize(){const{width:e,height:n}=this.atlasImage;return{width:e,height:n}}getPattern(e){const n=this.patterns[e],a=this.getImage(e);if(!a)return null;if(n&&n.position.version===a.version)return n.position;if(n)n.position.version=a.version;else{const o={w:a.data.width+2,h:a.data.height+2,x:0,y:0},u=new p.I(o,a);this.patterns[e]={bin:o,position:u}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const n=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new tt(e,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const u in this.patterns)e.push(this.patterns[u].bin);const{w:n,h:a}=p.p(e),o=this.atlasImage;o.resize({width:n||1,height:a||1});for(const u in this.patterns){const{bin:m}=this.patterns[u],g=m.x+1,y=m.y+1,v=this.getImage(u).data,S=v.width,T=v.height;p.R.copy(v,o,{x:0,y:0},{x:g,y},{width:S,height:T}),p.R.copy(v,o,{x:0,y:T-1},{x:g,y:y-1},{width:S,height:1}),p.R.copy(v,o,{x:0,y:0},{x:g,y:y+T},{width:S,height:1}),p.R.copy(v,o,{x:S-1,y:0},{x:g-1,y},{width:1,height:T}),p.R.copy(v,o,{x:0,y:0},{x:g+S,y},{width:1,height:T})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const n of e){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;const a=this.getImage(n);a||p.w(`Image with ID: "${n}" was not found`),Is(a)&&this.updateImage(n,a)}}}const Ht=1e20;function or(h,e,n,a,o,u,m,g,y){for(let v=e;v-1);y++,u[y]=g,m[y]=v,m[y+1]=Ht}for(let g=0,y=0;g65535)throw new Error("glyphs > 65535 not supported");if(a.ranges[u])return{stack:e,id:n,glyph:o};if(!this.url)throw new Error("glyphsUrl is not set");if(!a.requests[u]){const g=Xi.loadGlyphRange(e,u,this.url,this.requestManager);a.requests[u]=g}const m=yield a.requests[u];for(const g in m)this._doesCharSupportLocalGlyph(+g)||(a.glyphs[+g]=m[+g]);return a.ranges[u]=!0,{stack:e,id:n,glyph:m[n]||null}})}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(e))}_tinySDF(e,n,a){const o=this.localIdeographFontFamily;if(!o||!this._doesCharSupportLocalGlyph(a))return;let u=e.tinySDF;if(!u){let g="400";/bold/i.test(n)?g="900":/medium/i.test(n)?g="500":/light/i.test(n)&&(g="200"),u=e.tinySDF=new Xi.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:o,fontWeight:g})}const m=u.draw(String.fromCharCode(a));return{id:a,bitmap:new p.o({width:m.width||60,height:m.height||60},m.data),metrics:{width:m.glyphWidth/2||24,height:m.glyphHeight/2||24,left:m.glyphLeft/2+.5||0,top:m.glyphTop/2-27.5||-8,advance:m.glyphAdvance/2||24,isDoubleResolution:!0}}}}Xi.loadGlyphRange=function(h,e,n,a){return p._(this,void 0,void 0,function*(){const o=256*e,u=o+255,m=a.transformRequest(n.replace("{fontstack}",h).replace("{range}",`${o}-${u}`),"Glyphs"),g=yield p.l(m,new AbortController);if(!g||!g.data)throw new Error(`Could not load glyph range. range: ${e}, ${o}-${u}`);const y={};for(const v of p.n(g.data))y[v.id]=v;return y})},Xi.TinySDF=class{constructor({fontSize:h=24,buffer:e=3,radius:n=8,cutoff:a=.25,fontFamily:o="sans-serif",fontWeight:u="normal",fontStyle:m="normal"}={}){this.buffer=e,this.cutoff=a,this.radius=n;const g=this.size=h+4*e,y=this._createCanvas(g),v=this.ctx=y.getContext("2d",{willReadFrequently:!0});v.font=`${m} ${u} ${h}px ${o}`,v.textBaseline="alphabetic",v.textAlign="left",v.fillStyle="black",this.gridOuter=new Float64Array(g*g),this.gridInner=new Float64Array(g*g),this.f=new Float64Array(g),this.z=new Float64Array(g+1),this.v=new Uint16Array(g)}_createCanvas(h){const e=document.createElement("canvas");return e.width=e.height=h,e}draw(h){const{width:e,actualBoundingBoxAscent:n,actualBoundingBoxDescent:a,actualBoundingBoxLeft:o,actualBoundingBoxRight:u}=this.ctx.measureText(h),m=Math.ceil(n),g=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(u-o))),y=Math.min(this.size-this.buffer,m+Math.ceil(a)),v=g+2*this.buffer,S=y+2*this.buffer,T=Math.max(v*S,0),C=new Uint8ClampedArray(T),D={data:C,width:v,height:S,glyphWidth:g,glyphHeight:y,glyphTop:m,glyphLeft:0,glyphAdvance:e};if(g===0||y===0)return D;const{ctx:R,buffer:N,gridInner:B,gridOuter:U}=this;R.clearRect(N,N,g,y),R.fillText(h,N,N+m);const Z=R.getImageData(N,N,g,y);U.fill(Ht,0,T),B.fill(0,0,T);for(let F=0;F0?oe*oe:0,B[ee]=oe<0?oe*oe:0}}or(U,0,0,v,S,v,this.f,this.v,this.z),or(B,N,N,g,y,v,this.f,this.v,this.z);for(let F=0;F1&&(y=e[++g]);const S=Math.abs(v-y.left),T=Math.abs(v-y.right),C=Math.min(S,T);let D;const R=u/a*(o+1);if(y.isDash){const N=o-Math.abs(R);D=Math.sqrt(C*C+N*N)}else D=o-Math.sqrt(C*C+R*R);this.data[m+v]=Math.max(0,Math.min(255,D+128))}}}addRegularDash(e){for(let g=e.length-1;g>=0;--g){const y=e[g],v=e[g+1];y.zeroLength?e.splice(g,1):v&&v.isDash===y.isDash&&(v.left=y.left,e.splice(g,1))}const n=e[0],a=e[e.length-1];n.isDash===a.isDash&&(n.left=a.left-this.width,a.right=n.right+this.width);const o=this.width*this.nextRow;let u=0,m=e[u];for(let g=0;g1&&(m=e[++u]);const y=Math.abs(g-m.left),v=Math.abs(g-m.right),S=Math.min(y,v);this.data[o+g]=Math.max(0,Math.min(255,(m.isDash?S:-S)+128))}}addDash(e,n){const a=n?7:0,o=2*a+1;if(this.nextRow+o>this.height)return p.w("LineAtlas out of space"),null;let u=0;for(let g=0;g{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[vr]}numActive(){return Object.keys(this.active).length}}const hn=Math.floor(_e.hardwareConcurrency/2);let li,Ci;function Ur(){return li||(li=new Wi),li}Wi.workerCount=p.C(globalThis)?Math.max(Math.min(hn,3),1):1;class $r{constructor(e,n){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=n;const a=this.workerPool.acquire(n);for(let o=0;o{n.remove()}),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,n){for(const a of this.actors)a.registerMessageHandler(e,n)}}function Bn(){return Ci||(Ci=new $r(Ur(),p.G),Ci.registerMessageHandler("GR",(h,e,n)=>p.m(e,n))),Ci}function cr(h,e){const n=p.H();return p.J(n,n,[1,1,0]),p.K(n,n,[.5*h.width,.5*h.height,1]),p.L(n,n,h.calculatePosMatrix(e.toUnwrapped()))}function br(h,e,n,a,o,u){const m=function(T,C,D){if(T)for(const R of T){const N=C[R];if(N&&N.source===D&&N.type==="fill-extrusion")return!0}else for(const R in C){const N=C[R];if(N.source===D&&N.type==="fill-extrusion")return!0}return!1}(o&&o.layers,e,h.id),g=u.maxPitchScaleFactor(),y=h.tilesIn(a,g,m);y.sort(wr);const v=[];for(const T of y)v.push({wrappedTileID:T.tileID.wrapped().key,queryResults:T.tile.queryRenderedFeatures(e,n,h._state,T.queryGeometry,T.cameraQueryGeometry,T.scale,o,u,g,cr(h.transform,T.tileID))});const S=function(T){const C={},D={};for(const R of T){const N=R.queryResults,B=R.wrappedTileID,U=D[B]=D[B]||{};for(const Z in N){const F=N[Z],W=U[Z]=U[Z]||{},Y=C[Z]=C[Z]||[];for(const ee of F)W[ee.featureIndex]||(W[ee.featureIndex]=!0,Y.push(ee))}}return C}(v);for(const T in S)S[T].forEach(C=>{const D=C.feature,R=h.getFeatureState(D.layer["source-layer"],D.id);D.source=D.layer.source,D.layer["source-layer"]&&(D.sourceLayer=D.layer["source-layer"]),D.state=R});return S}function wr(h,e){const n=h.tileID,a=e.tileID;return n.overscaledZ-a.overscaledZ||n.canonical.y-a.canonical.y||n.wrap-a.wrap||n.canonical.x-a.canonical.x}function un(h,e,n){return p._(this,void 0,void 0,function*(){let a=h;if(h.url?a=(yield p.h(e.transformRequest(h.url,"Source"),n)).data:yield _e.frameAsync(n),!a)return null;const o=p.M(p.e(a,h),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in a&&a.vector_layers&&(o.vectorLayerIds=a.vector_layers.map(u=>u.id)),o})}class ie{constructor(e,n){e&&(n?this.setSouthWest(e).setNorthEast(n):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof p.N?new p.N(e.lng,e.lat):p.N.convert(e),this}setSouthWest(e){return this._sw=e instanceof p.N?new p.N(e.lng,e.lat):p.N.convert(e),this}extend(e){const n=this._sw,a=this._ne;let o,u;if(e instanceof p.N)o=e,u=e;else{if(!(e instanceof ie))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(ie.convert(e)):this.extend(p.N.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(p.N.convert(e)):this;if(o=e._sw,u=e._ne,!o||!u)return this}return n||a?(n.lng=Math.min(o.lng,n.lng),n.lat=Math.min(o.lat,n.lat),a.lng=Math.max(u.lng,a.lng),a.lat=Math.max(u.lat,a.lat)):(this._sw=new p.N(o.lng,o.lat),this._ne=new p.N(u.lng,u.lat)),this}getCenter(){return new p.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new p.N(this.getWest(),this.getNorth())}getSouthEast(){return new p.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:n,lat:a}=p.N.convert(e);let o=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&o}static convert(e){return e instanceof ie?e:e&&new ie(e)}static fromLngLat(e,n=0){const a=360*n/40075017,o=a/Math.cos(Math.PI/180*e.lat);return new ie(new p.N(e.lng-o,e.lat-a),new p.N(e.lng+o,e.lat+a))}}class qr{constructor(e,n,a){this.bounds=ie.convert(this.validateBounds(e)),this.minzoom=n||0,this.maxzoom=a||24}validateBounds(e){return Array.isArray(e)&&e.length===4?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){const n=Math.pow(2,e.z),a=Math.floor(p.O(this.bounds.getWest())*n),o=Math.floor(p.Q(this.bounds.getNorth())*n),u=Math.ceil(p.O(this.bounds.getEast())*n),m=Math.ceil(p.Q(this.bounds.getSouth())*n);return e.x>=a&&e.x=o&&e.y{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return p.e({},this._options)}loadTile(e){return p._(this,void 0,void 0,function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),a={request:this.map._requestManager.transformRequest(n,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};a.request.collectResourceTiming=this._collectResourceTiming;let o="RT";if(e.actor&&e.state!=="expired"){if(e.state==="loading")return new Promise((u,m)=>{e.reloadPromise={resolve:u,reject:m}})}else e.actor=this.dispatcher.getActor(),o="LT";e.abortController=new AbortController;try{const u=yield e.actor.sendAsync({type:o,data:a},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,u)}catch(u){if(delete e.abortController,e.aborted)return;if(u&&u.status!==404)throw u;this._afterTileLoadWorkerResponse(e,null)}})}_afterTileLoadWorkerResponse(e,n){if(n&&n.resourceTiming&&(e.resourceTiming=n.resourceTiming),n&&this.map._refreshExpiredTiles&&e.setExpiryData(n),e.loadVectorData(n,this.map.painter),e.reloadPromise){const a=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(a.resolve).catch(a.reject)}}abortTile(e){return p._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))})}unloadTile(e){return p._(this,void 0,void 0,function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Je extends p.E{constructor(e,n,a,o){super(),this.id=e,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=p.e({type:"raster"},n),p.e(this,p.M(n,["url","scheme","tileSize"]))}load(){return p._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new p.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield un(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,e&&(p.e(this,e),e.bounds&&(this.tileBounds=new qr(e.bounds,this.minzoom,this.maxzoom)),this.fire(new p.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new p.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new p.j(e))}})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return p.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return p._(this,void 0,void 0,function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{const a=yield oi.getImage(this.map._requestManager.transformRequest(n,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(a&&a.data){this.map._refreshExpiredTiles&&a.cacheControl&&a.expires&&e.setExpiryData({cacheControl:a.cacheControl,expires:a.expires});const o=this.map.painter.context,u=o.gl,m=a.data;e.texture=this.map.painter.getTileTexture(m.width),e.texture?e.texture.update(m,{useMipmap:!0}):(e.texture=new tt(o,m,u.RGBA,{useMipmap:!0}),e.texture.bind(u.LINEAR,u.CLAMP_TO_EDGE,u.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(a){if(delete e.abortController,e.aborted)e.state="unloaded";else if(a)throw e.state="errored",a}})}abortTile(e){return p._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)})}unloadTile(e){return p._(this,void 0,void 0,function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)})}hasTransition(){return!1}}class mt extends Je{constructor(e,n,a,o){super(e,n,a,o),this.type="raster-dem",this.maxzoom=22,this._options=p.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(e){return p._(this,void 0,void 0,function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),a=this.map._requestManager.transformRequest(n,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{const o=yield oi.getImage(a,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(o&&o.data){const u=o.data;this.map._refreshExpiredTiles&&o.cacheControl&&o.expires&&e.setExpiryData({cacheControl:o.cacheControl,expires:o.expires});const m=p.b(u)&&p.U()?u:yield this.readImageNow(u),g={type:this.type,uid:e.uid,source:this.id,rawImageData:m,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||e.state==="expired"){e.actor=this.dispatcher.getActor();const y=yield e.actor.sendAsync({type:"LDT",data:g});e.dem=y,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(o){if(delete e.abortController,e.aborted)e.state="unloaded";else if(o)throw e.state="errored",o}})}readImageNow(e){return p._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&p.V()){const n=e.width+2,a=e.height+2;try{return new p.R({width:n,height:a},yield p.W(e,-1,-1,n,a))}catch{}}return _e.getImageData(e,1)})}_getNeighboringTiles(e){const n=e.canonical,a=Math.pow(2,n.z),o=(n.x-1+a)%a,u=n.x===0?e.wrap-1:e.wrap,m=(n.x+1+a)%a,g=n.x+1===a?e.wrap+1:e.wrap,y={};return y[new p.S(e.overscaledZ,u,n.z,o,n.y).key]={backfilled:!1},y[new p.S(e.overscaledZ,g,n.z,m,n.y).key]={backfilled:!1},n.y>0&&(y[new p.S(e.overscaledZ,u,n.z,o,n.y-1).key]={backfilled:!1},y[new p.S(e.overscaledZ,e.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},y[new p.S(e.overscaledZ,g,n.z,m,n.y-1).key]={backfilled:!1}),n.y+10&&p.e(u,{resourceTiming:o}),this.fire(new p.k("data",Object.assign(Object.assign({},u),{sourceDataType:"metadata"}))),this.fire(new p.k("data",Object.assign(Object.assign({},u),{sourceDataType:"content"})))}catch(a){if(this._pendingLoads--,this._removed)return void this.fire(new p.k("dataabort",{dataType:"source"}));this.fire(new p.j(a))}})}loaded(){return this._pendingLoads===0}loadTile(e){return p._(this,void 0,void 0,function*(){const n=e.actor?"RT":"LT";e.actor=this.actor;const a={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.abortController=new AbortController;const o=yield this.actor.sendAsync({type:n,data:a},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(o,this.map.painter,n==="RT")})}abortTile(e){return p._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0})}unloadTile(e){return p._(this,void 0,void 0,function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return p.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Tr=p.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class hr extends p.E{constructor(e,n,a,o){super(),this.id=e,this.dispatcher=a,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(o),this.options=n}load(e){return p._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new p.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const n=yield oi.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,n&&n.data&&(this.image=n.data,e&&(this.coordinates=e),this._finishLoading())}catch(n){this._request=null,this._loaded=!0,this.fire(new p.j(n))}})}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new p.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;const n=e.map(p.Z.fromLngLat);this.tileID=function(o){let u=1/0,m=1/0,g=-1/0,y=-1/0;for(const C of o)u=Math.min(u,C.x),m=Math.min(m,C.y),g=Math.max(g,C.x),y=Math.max(y,C.y);const v=Math.max(g-u,y-m),S=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),T=Math.pow(2,S);return new p.a1(S,Math.floor((u+g)/2*T),Math.floor((m+y)/2*T))}(n),this.minzoom=this.maxzoom=this.tileID.z;const a=n.map(o=>this.tileID.getTilePoint(o)._round());return this._boundsArray=new p.$,this._boundsArray.emplaceBack(a[0].x,a[0].y,0,0),this._boundsArray.emplaceBack(a[1].x,a[1].y,p.X,0),this._boundsArray.emplaceBack(a[3].x,a[3].y,0,p.X),this._boundsArray.emplaceBack(a[2].x,a[2].y,p.X,p.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new p.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const e=this.map.painter.context,n=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,Tr.members)),this.boundsSegments||(this.boundsSegments=p.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new tt(e,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let a=!1;for(const o in this.tiles){const u=this.tiles[o];u.state!=="loaded"&&(u.state="loaded",u.texture=this.texture,a=!0)}a&&this.fire(new p.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return p._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class dn extends hr{constructor(e,n,a,o){super(e,n,a,o),this.roundZoom=!0,this.type="video",this.options=n}load(){return p._(this,void 0,void 0,function*(){this._loaded=!1;const e=this.options;this.urls=[];for(const n of e.urls)this.urls.push(this.map._requestManager.transformRequest(n,"Source").url);try{const n=yield p.a3(this.urls);if(this._loaded=!0,!n)return;this.video=n,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(n){this.fire(new p.j(n))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const n=this.video.seekable;en.end(0)?this.fire(new p.j(new p.a2(`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=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const e=this.map.painter.context,n=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,Tr.members)),this.boundsSegments||(this.boundsSegments=p.a0.simpleSegment(0,0,4,2)),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 tt(e,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let a=!1;for(const o in this.tiles){const u=this.tiles[o];u.state!=="loaded"&&(u.state="loaded",u.texture=this.texture,a=!0)}a&&this.fire(new p.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class vi extends hr{constructor(e,n,a,o){super(e,n,a,o),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(u=>!Array.isArray(u)||u.length!==2||u.some(m=>typeof m!="number"))||this.fire(new p.j(new p.a2(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new p.j(new p.a2(`sources.${e}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new p.j(new p.a2(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new p.j(new p.a2(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new p.j(new p.a2(`sources.${e}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){return p._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new p.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context,a=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Tr.members)),this.boundsSegments||(this.boundsSegments=p.a0.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new tt(n,this.canvas,a.RGBA,{premultiply:!0});let o=!1;for(const u in this.tiles){const m=this.tiles[u];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture,o=!0)}o&&this.fire(new p.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const Vn={},Nn=h=>{switch(h){case"geojson":return On;case"image":return hr;case"raster":return Je;case"raster-dem":return mt;case"vector":return Fn;case"video":return dn;case"canvas":return vi}return Vn[h]},pe="RTLPluginLoaded";class Ki extends p.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Bn()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch(n=>{throw this.status="error",n})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return p._(this,arguments,void 0,function*(n,a=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=_e.resolveURL(n),!this.url)throw new Error(`requested url ${n} is invalid`);if(this.status==="unavailable"){if(!a)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return p._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new p.k(pe))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Xt=null;function Ji(){return Xt||(Xt=new Ki),Xt}class Sr{constructor(e,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=p.a4(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){const n=e+this.timeAdded;nu.getLayer(v)).filter(Boolean);if(y.length!==0){g.layers=y,g.stateDependentLayerIds&&(g.stateDependentLayers=g.stateDependentLayerIds.map(v=>y.filter(S=>S.id===v)[0]));for(const v of y)m[v.id]=g}}return m}(e.buckets,n.style),this.hasSymbolBuckets=!1;for(const o in this.buckets){const u=this.buckets[o];if(u instanceof p.a6){if(this.hasSymbolBuckets=!0,!a)break;u.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const o in this.buckets){const u=this.buckets[o];if(u instanceof p.a6&&u.hasRTLText){this.hasRTLText=!0,Ji().lazyLoad();break}}this.queryPadding=0;for(const o in this.buckets){const u=this.buckets[o];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(o).queryRadius(u))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new p.a5}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const a in this.buckets){const o=this.buckets[a];o.uploadPending()&&o.upload(e)}const n=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new tt(e,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new tt(e,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,n,a,o,u,m,g,y,v,S){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:o,cameraQueryGeometry:u,scale:m,tileSize:this.tileSize,pixelPosMatrix:S,transform:y,params:g,queryPadding:this.queryPadding*v},e,n,a):{}}querySourceFeatures(e,n){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const o=a.loadVTLayers(),u=n&&n.sourceLayer?n.sourceLayer:"",m=o._geojsonTileLayer||o[u];if(!m)return;const g=p.a7(n&&n.filter),{z:y,x:v,y:S}=this.tileID.canonical,T={z:y,x:v,y:S};for(let C=0;Ca)o=!1;else if(n)if(this.expirationTime{this.remove(e,u)},a)),this.data[o].push(u),this.order.push(o),this.order.length>this.max){const m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const n=this.data[e].shift();return n.timeout&&clearTimeout(n.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),n.value}getByKey(e){const n=this.data[e];return n?n[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,n){if(!this.has(e))return this;const a=e.wrapped().key,o=n===void 0?0:this.data[a].indexOf(n),u=this.data[a][o];return this.data[a].splice(o,1),u.timeout&&clearTimeout(u.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(u.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(e){const n=[];for(const a in this.data)for(const o of this.data[a])e(o.value)||n.push(o);for(const a of n)this.remove(a.value.tileID,a)}}class Ue{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,n,a){const o=String(n);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][o]=this.stateChanges[e][o]||{},p.e(this.stateChanges[e][o],a),this.deletedStates[e]===null){this.deletedStates[e]={};for(const u in this.state[e])u!==o&&(this.deletedStates[e][u]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][o]===null){this.deletedStates[e][o]={};for(const u in this.state[e][o])a[u]||(this.deletedStates[e][o][u]=null)}else for(const u in a)this.deletedStates[e]&&this.deletedStates[e][o]&&this.deletedStates[e][o][u]===null&&delete this.deletedStates[e][o][u]}removeFeatureState(e,n,a){if(this.deletedStates[e]===null)return;const o=String(n);if(this.deletedStates[e]=this.deletedStates[e]||{},a&&n!==void 0)this.deletedStates[e][o]!==null&&(this.deletedStates[e][o]=this.deletedStates[e][o]||{},this.deletedStates[e][o][a]=null);else if(n!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][o])for(a in this.deletedStates[e][o]={},this.stateChanges[e][o])this.deletedStates[e][o][a]=null;else this.deletedStates[e][o]=null;else this.deletedStates[e]=null}getState(e,n){const a=String(n),o=p.e({},(this.state[e]||{})[a],(this.stateChanges[e]||{})[a]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){const u=this.deletedStates[e][n];if(u===null)return{};for(const m in u)delete o[m]}return o}initializeTileState(e,n){e.setFeatureState(this.state,n)}coalesceChanges(e,n){const a={};for(const o in this.stateChanges){this.state[o]=this.state[o]||{};const u={};for(const m in this.stateChanges[o])this.state[o][m]||(this.state[o][m]={}),p.e(this.state[o][m],this.stateChanges[o][m]),u[m]=this.state[o][m];a[o]=u}for(const o in this.deletedStates){this.state[o]=this.state[o]||{};const u={};if(this.deletedStates[o]===null)for(const m in this.state[o])u[m]={},this.state[o][m]={};else for(const m in this.deletedStates[o]){if(this.deletedStates[o][m]===null)this.state[o][m]={};else for(const g of Object.keys(this.deletedStates[o][m]))delete this.state[o][m][g];u[m]=this.state[o][m]}a[o]=a[o]||{},p.e(a[o],u)}if(this.stateChanges={},this.deletedStates={},Object.keys(a).length!==0)for(const o in e)e[o].setFeatureState(a,n)}}class Le extends p.E{constructor(e,n,a){super(),this.id=e,this.dispatcher=a,this.on("data",o=>this._dataHandler(o)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((o,u,m,g)=>{const y=new(Nn(u.type))(o,u,m,g);if(y.id!==o)throw new Error(`Expected Source id to be ${o} instead of ${y.id}`);return y})(e,n,a,this),this._tiles={},this._cache=new ge(0,o=>this._unloadTile(o)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ue,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const e in this._tiles){const n=this._tiles[e];if(n.state!=="loaded"&&n.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,n,a){return p._(this,void 0,void 0,function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,n,a)}catch(o){e.state="errored",o.status!==404?this._source.fire(new p.j(o,{tile:e})):this.update(this.transform,this.terrain)}})}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new p.k("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const n in this._tiles){const a=this._tiles[n];a.upload(e),a.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(ei).map(e=>e.key)}getRenderableIds(e){const n=[];for(const a in this._tiles)this._isIdRenderable(a,e)&&n.push(this._tiles[a]);return e?n.sort((a,o)=>{const u=a.tileID,m=o.tileID,g=new p.P(u.canonical.x,u.canonical.y)._rotate(this.transform.angle),y=new p.P(m.canonical.x,m.canonical.y)._rotate(this.transform.angle);return u.overscaledZ-m.overscaledZ||y.y-g.y||y.x-g.x}).map(a=>a.tileID.key):n.map(a=>a.tileID).sort(ei).map(a=>a.key)}hasRenderableParent(e){const n=this.findLoadedParent(e,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(e,n){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(n||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)this._tiles[e].state!=="errored"&&this._reloadTile(e,"reloading")}}_reloadTile(e,n){return p._(this,void 0,void 0,function*(){const a=this._tiles[e];a&&(a.state!=="loading"&&(a.state=n),yield this._loadTile(a,e,n))})}_tileLoaded(e,n,a){e.timeAdded=_e.now(),a==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(n,e),this.getSource().type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new p.k("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){const n=this.getRenderableIds();for(let o=0;o1||(Math.abs(m)>1&&(Math.abs(m+y)===1?m+=y:Math.abs(m-y)===1&&(m-=y)),u.dem&&o.dem&&(o.dem.backfillBorder(u.dem,m,g),o.neighboringTiles&&o.neighboringTiles[v]&&(o.neighboringTiles[v].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,n,a,o){for(const u in this._tiles){let m=this._tiles[u];if(o[u]||!m.hasData()||m.tileID.overscaledZ<=n||m.tileID.overscaledZ>a)continue;let g=m.tileID;for(;m&&m.tileID.overscaledZ>n+1;){const v=m.tileID.scaledTo(m.tileID.overscaledZ-1);m=this._tiles[v.key],m&&m.hasData()&&(g=v)}let y=g;for(;y.overscaledZ>n;)if(y=y.scaledTo(y.overscaledZ-1),e[y.key]){o[g.key]=g;break}}}findLoadedParent(e,n){if(e.key in this._loadedParentTiles){const a=this._loadedParentTiles[e.key];return a&&a.tileID.overscaledZ>=n?a:null}for(let a=e.overscaledZ-1;a>=n;a--){const o=e.scaledTo(a),u=this._getLoadedTile(o);if(u)return u}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){const n=this._tiles[e.key];return n&&n.hasData()?n:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){const n=Math.ceil(e.width/this._source.tileSize)+1,a=Math.ceil(e.height/this._source.tileSize)+1,o=Math.floor(n*a*(this._maxTileCacheZoomLevels===null?p.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),u=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(u)}handleWrapJump(e){const n=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,n){const a={};for(const o in this._tiles){const u=this._tiles[o];u.tileID=u.tileID.unwrapTo(u.tileID.wrap+n),a[u.tileID.key]=u}this._tiles=a;for(const o in this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(const o in this._tiles)this._setTileReloadTimer(o,this._tiles[o])}}_updateCoveredAndRetainedTiles(e,n,a,o,u,m){const g={},y={},v=Object.keys(e),S=_e.now();for(const T of v){const C=e[T],D=this._tiles[T];if(!D||D.fadeEndTime!==0&&D.fadeEndTime<=S)continue;const R=this.findLoadedParent(C,n),N=this.findLoadedSibling(C),B=R||N||null;B&&(this._addTile(B.tileID),g[B.tileID.key]=B.tileID),y[T]=C}this._retainLoadedChildren(y,o,a,e);for(const T in g)e[T]||(this._coveredTiles[T]=!0,e[T]=g[T]);if(m){const T={},C={};for(const D of u)this._tiles[D.key].hasData()?T[D.key]=D:C[D.key]=D;for(const D in C){const R=C[D].children(this._source.maxzoom);this._tiles[R[0].key]&&this._tiles[R[1].key]&&this._tiles[R[2].key]&&this._tiles[R[3].key]&&(T[R[0].key]=e[R[0].key]=R[0],T[R[1].key]=e[R[1].key]=R[1],T[R[2].key]=e[R[2].key]=R[2],T[R[3].key]=e[R[3].key]=R[3],delete C[D])}for(const D in C){const R=C[D],N=this.findLoadedParent(R,this._source.minzoom),B=this.findLoadedSibling(R),U=N||B||null;if(U){T[U.tileID.key]=e[U.tileID.key]=U.tileID;for(const Z in T)T[Z].isChildOf(U.tileID)&&delete T[Z]}}for(const D in this._tiles)T[D]||(this._coveredTiles[D]=!0)}}update(e,n){if(!this._sourceLoaded||this._paused)return;let a;this.transform=e,this.terrain=n,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(S=>new p.S(S.canonical.z,S.wrap,S.canonical.z,S.canonical.x,S.canonical.y)):(a=e.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(a=a.filter(S=>this._source.hasTile(S)))):a=[];const o=e.coveringZoomLevel(this._source),u=Math.max(o-Le.maxOverzooming,this._source.minzoom),m=Math.max(o+Le.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const S={};for(const T of a)if(T.canonical.z>this._source.minzoom){const C=T.scaledTo(T.canonical.z-1);S[C.key]=C;const D=T.scaledTo(Math.max(this._source.minzoom,Math.min(T.canonical.z,5)));S[D.key]=D}a=a.concat(Object.values(S))}const g=a.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,g&&this.fire(new p.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const y=this._updateRetainedTiles(a,o);ki(this._source.type)&&this._updateCoveredAndRetainedTiles(y,u,m,o,a,n);for(const S in y)this._tiles[S].clearFadeHold();const v=p.ab(this._tiles,y);for(const S of v){const T=this._tiles[S];T.hasSymbolBuckets&&!T.holdingForFade()?T.setHoldDuration(this.map._fadeDuration):T.hasSymbolBuckets&&!T.symbolFadeFinished()||this._removeTile(S)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,n){var a;const o={},u={},m=Math.max(n-Le.maxOverzooming,this._source.minzoom),g=Math.max(n+Le.maxUnderzooming,this._source.minzoom),y={};for(const v of e){const S=this._addTile(v);o[v.key]=v,S.hasData()||nthis._source.maxzoom){const C=v.children(this._source.maxzoom)[0],D=this.getTile(C);if(D&&D.hasData()){o[C.key]=C;continue}}else{const C=v.children(this._source.maxzoom);if(o[C[0].key]&&o[C[1].key]&&o[C[2].key]&&o[C[3].key])continue}let T=S.wasRequested();for(let C=v.overscaledZ-1;C>=m;--C){const D=v.scaledTo(C);if(u[D.key])break;if(u[D.key]=!0,S=this.getTile(D),!S&&T&&(S=this._addTile(D)),S){const R=S.hasData();if((R||!(!((a=this.map)===null||a===void 0)&&a.cancelPendingTileRequestsWhileZooming)||T)&&(o[D.key]=D),T=S.wasRequested(),R)break}}}return o}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const n=[];let a,o=this._tiles[e].tileID;for(;o.overscaledZ>0;){if(o.key in this._loadedParentTiles){a=this._loadedParentTiles[o.key];break}n.push(o.key);const u=o.scaledTo(o.overscaledZ-1);if(a=this._getLoadedTile(u),a)break;o=u}for(const u of n)this._loadedParentTiles[u]=a}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const e in this._tiles){const n=this._tiles[e].tileID,a=this._getLoadedTile(n);this._loadedSiblingTiles[n.key]=a}}_addTile(e){let n=this._tiles[e.key];if(n)return n;n=this._cache.getAndRemove(e),n&&(this._setTileReloadTimer(e.key,n),n.tileID=e,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,n)));const a=n;return n||(n=new Sr(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(n,e.key,n.state)),n.uses++,this._tiles[e.key]=n,a||this._source.fire(new p.k("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(e,n){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const a=n.getExpiryTimeout();a&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},a))}_removeTile(e){const n=this._tiles[e];n&&(n.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}_dataHandler(e){const n=e.sourceDataType;e.dataType==="source"&&n==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&e.dataType==="source"&&n==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,n,a){const o=[],u=this.transform;if(!u)return o;const m=a?u.getCameraQueryGeometry(e):e,g=e.map(R=>u.pointCoordinate(R,this.terrain)),y=m.map(R=>u.pointCoordinate(R,this.terrain)),v=this.getIds();let S=1/0,T=1/0,C=-1/0,D=-1/0;for(const R of y)S=Math.min(S,R.x),T=Math.min(T,R.y),C=Math.max(C,R.x),D=Math.max(D,R.y);for(let R=0;R=0&&F[1].y+Z>=0){const W=g.map(ee=>B.getTilePoint(ee)),Y=y.map(ee=>B.getTilePoint(ee));o.push({tile:N,tileID:B,queryGeometry:W,cameraQueryGeometry:Y,scale:U})}}return o}getVisibleCoordinates(e){const n=this.getRenderableIds(e).map(a=>this._tiles[a].tileID);for(const a of n)a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(ki(this._source.type)){const e=_e.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=e)return!0}return!1}setFeatureState(e,n,a){this._state.updateState(e=e||"_geojsonTileLayer",n,a)}removeFeatureState(e,n,a){this._state.removeFeatureState(e=e||"_geojsonTileLayer",n,a)}getFeatureState(e,n){return this._state.getState(e=e||"_geojsonTileLayer",n)}setDependencies(e,n,a){const o=this._tiles[e];o&&o.setDependencies(n,a)}reloadTilesForDependencies(e,n){for(const a in this._tiles)this._tiles[a].hasDependency(e,n)&&this._reloadTile(a,"reloading");this._cache.filter(a=>!a.hasDependency(e,n))}}function ei(h,e){const n=Math.abs(2*h.wrap)-+(h.wrap<0),a=Math.abs(2*e.wrap)-+(e.wrap<0);return h.overscaledZ-e.overscaledZ||a-n||e.canonical.y-h.canonical.y||e.canonical.x-h.canonical.x}function ki(h){return h==="raster"||h==="image"||h==="video"}Le.maxOverzooming=10,Le.maxUnderzooming=3;class Oe{constructor(e,n){this.reset(e,n)}reset(e,n){this.points=e||[],this._distances=[0];for(let a=1;a0?(o-m)/g:0;return this.points[u].mult(1-y).add(this.points[n].mult(y))}}function Yi(h,e){let n=!0;return h==="always"||h!=="never"&&e!=="never"||(n=!1),n}class ur{constructor(e,n,a){const o=this.boxCells=[],u=this.circleCells=[];this.xCellCount=Math.ceil(e/a),this.yCellCount=Math.ceil(n/a);for(let m=0;mthis.width||o<0||n>this.height)return[];const y=[];if(e<=0&&n<=0&&this.width<=a&&this.height<=o){if(u)return[{key:null,x1:e,y1:n,x2:a,y2:o}];for(let v=0;v0}hitTestCircle(e,n,a,o,u){const m=e-a,g=e+a,y=n-a,v=n+a;if(g<0||m>this.width||v<0||y>this.height)return!1;const S=[];return this._forEachCell(m,y,g,v,this._queryCellCircle,S,{hitTest:!0,overlapMode:o,circle:{x:e,y:n,radius:a},seenUids:{box:{},circle:{}}},u),S.length>0}_queryCell(e,n,a,o,u,m,g,y){const{seenUids:v,hitTest:S,overlapMode:T}=g,C=this.boxCells[u];if(C!==null){const R=this.bboxes;for(const N of C)if(!v.box[N]){v.box[N]=!0;const B=4*N,U=this.boxKeys[N];if(e<=R[B+2]&&n<=R[B+3]&&a>=R[B+0]&&o>=R[B+1]&&(!y||y(U))&&(!S||!Yi(T,U.overlapMode))&&(m.push({key:U,x1:R[B],y1:R[B+1],x2:R[B+2],y2:R[B+3]}),S))return!0}}const D=this.circleCells[u];if(D!==null){const R=this.circles;for(const N of D)if(!v.circle[N]){v.circle[N]=!0;const B=3*N,U=this.circleKeys[N];if(this._circleAndRectCollide(R[B],R[B+1],R[B+2],e,n,a,o)&&(!y||y(U))&&(!S||!Yi(T,U.overlapMode))){const Z=R[B],F=R[B+1],W=R[B+2];if(m.push({key:U,x1:Z-W,y1:F-W,x2:Z+W,y2:F+W}),S)return!0}}}return!1}_queryCellCircle(e,n,a,o,u,m,g,y){const{circle:v,seenUids:S,overlapMode:T}=g,C=this.boxCells[u];if(C!==null){const R=this.bboxes;for(const N of C)if(!S.box[N]){S.box[N]=!0;const B=4*N,U=this.boxKeys[N];if(this._circleAndRectCollide(v.x,v.y,v.radius,R[B+0],R[B+1],R[B+2],R[B+3])&&(!y||y(U))&&!Yi(T,U.overlapMode))return m.push(!0),!0}}const D=this.circleCells[u];if(D!==null){const R=this.circles;for(const N of D)if(!S.circle[N]){S.circle[N]=!0;const B=3*N,U=this.circleKeys[N];if(this._circlesCollide(R[B],R[B+1],R[B+2],v.x,v.y,v.radius)&&(!y||y(U))&&!Yi(T,U.overlapMode))return m.push(!0),!0}}}_forEachCell(e,n,a,o,u,m,g,y){const v=this._convertToXCellCoord(e),S=this._convertToYCellCoord(n),T=this._convertToXCellCoord(a),C=this._convertToYCellCoord(o);for(let D=v;D<=T;D++)for(let R=S;R<=C;R++)if(u.call(this,e,n,a,o,this.xCellCount*R+D,m,g,y))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,n,a,o,u,m){const g=o-e,y=u-n,v=a+m;return v*v>g*g+y*y}_circleAndRectCollide(e,n,a,o,u,m,g){const y=(m-o)/2,v=Math.abs(e-(o+y));if(v>y+a)return!1;const S=(g-u)/2,T=Math.abs(n-(u+S));if(T>S+a)return!1;if(v<=y||T<=S)return!0;const C=v-y,D=T-S;return C*C+D*D<=a*a}}function Ir(h,e,n,a,o){const u=p.H();return e?(p.K(u,u,[1/o,1/o,1]),n||p.ad(u,u,a.angle)):p.L(u,a.labelPlaneMatrix,h),u}function Qi(h,e,n,a,o){if(e){const u=p.ae(h);return p.K(u,u,[o,o,1]),n||p.ad(u,u,-a.angle),u}return a.glCoordMatrix}function j(h,e,n){let a;n?(a=[h.x,h.y,n(h.x,h.y),1],p.af(a,a,e)):(a=[h.x,h.y,0,1],function(u,m,g){const y=m[0],v=m[1];u[0]=g[0]*y+g[4]*v+g[12],u[1]=g[1]*y+g[5]*v+g[13],u[3]=g[3]*y+g[7]*v+g[15]}(a,a,e));const o=a[3];return{point:new p.P(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function A(h,e){return .5+h/e*.5}function P(h,e){return h.x>=-e[0]&&h.x<=e[0]&&h.y>=-e[1]&&h.y<=e[1]}function E(h,e,n,a,o,u,m,g,y,v,S,T,C,D,R){const N=a?h.textSizeData:h.iconSizeData,B=p.ag(N,n.transform.zoom),U=[256/n.width*2+1,256/n.height*2+1],Z=a?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;Z.clear();const F=h.lineVertexArray,W=a?h.text.placedSymbolArray:h.icon.placedSymbolArray,Y=n.transform.width/n.transform.height;let ee=!1;for(let oe=0;oeMath.abs(n.x-e.x)*a?{useVertical:!0}:(h===p.ah.vertical?e.yn.x)?{needsFlipping:!0}:null}function X(h,e,n,a,o,u,m,g,y,v,S){const T=n/24,C=e.lineOffsetX*T,D=e.lineOffsetY*T;let R;if(e.numGlyphs>1){const N=e.glyphStartIndex+e.numGlyphs,B=e.lineStartIndex,U=e.lineStartIndex+e.lineLength,Z=V(T,g,C,D,a,e,S,h);if(!Z)return{notEnoughRoom:!0};const F=j(Z.first.point,m,h.getElevation).point,W=j(Z.last.point,m,h.getElevation).point;if(o&&!a){const Y=H(e.writingMode,F,W,v);if(Y)return Y}R=[Z.first];for(let Y=e.glyphStartIndex+1;Y0?F.point:function(ee,oe,he,we,Te,ue){return J(ee,oe,he,1,Te,ue)}(h.tileAnchorPoint,Z,B,0,u,h),Y=H(e.writingMode,B,W,v);if(Y)return Y}const N=fe(T*g.getoffsetX(e.glyphStartIndex),C,D,a,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,h,S);if(!N||h.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};R=[N]}for(const N of R)p.aj(y,N.point,N.angle);return{}}function J(h,e,n,a,o,u){const m=h.add(h.sub(e)._unit()),g=o!==void 0?j(m,o,u.getElevation).point:ne(m.x,m.y,u).point,y=n.sub(g);return n.add(y._mult(a/y.mag()))}function q(h,e,n){const a=e.projectionCache;if(a.projections[h])return a.projections[h];const o=new p.P(e.lineVertexArray.getx(h),e.lineVertexArray.gety(h)),u=ne(o.x,o.y,e);if(u.signedDistanceFromCamera>0)return a.projections[h]=u.point,a.anyProjectionOccluded=a.anyProjectionOccluded||u.isOccluded,u.point;const m=h-n.direction;return function(g,y,v,S,T){return J(g,y,v,S,void 0,T)}(n.distanceFromAnchor===0?e.tileAnchorPoint:new p.P(e.lineVertexArray.getx(m),e.lineVertexArray.gety(m)),o,n.previousVertex,n.absOffsetX-n.distanceFromAnchor+1,e)}function ne(h,e,n){const a=h+n.translation[0],o=e+n.translation[1];let u;return!n.pitchWithMap&&n.projection.useSpecialProjectionForSymbols?(u=n.projection.projectTileCoordinates(a,o,n.unwrappedTileID,n.getElevation),u.point.x=(.5*u.point.x+.5)*n.width,u.point.y=(.5*-u.point.y+.5)*n.height):(u=j(new p.P(a,o),n.labelPlaneMatrix,n.getElevation),u.isOccluded=!1),u}function le(h,e,n){return h._unit()._perp()._mult(e*n)}function te(h,e,n,a,o,u,m,g,y){if(g.projectionCache.offsets[h])return g.projectionCache.offsets[h];const v=n.add(e);if(h+y.direction=o)return g.projectionCache.offsets[h]=v,v;const S=q(h+y.direction,g,y),T=le(S.sub(n),m,y.direction),C=n.add(T),D=S.add(T);return g.projectionCache.offsets[h]=p.ak(u,v,C,D)||v,g.projectionCache.offsets[h]}function fe(h,e,n,a,o,u,m,g,y){const v=a?h-e:h+e;let S=v>0?1:-1,T=0;a&&(S*=-1,T=Math.PI),S<0&&(T+=Math.PI);let C,D=S>0?u+o:u+o+1;g.projectionCache.cachedAnchorPoint?C=g.projectionCache.cachedAnchorPoint:(C=ne(g.tileAnchorPoint.x,g.tileAnchorPoint.y,g).point,g.projectionCache.cachedAnchorPoint=C);let R,N,B=C,U=C,Z=0,F=0;const W=Math.abs(v),Y=[];let ee;for(;Z+F<=W;){if(D+=S,D=m)return null;Z+=F,U=B,N=R;const we={absOffsetX:W,direction:S,distanceFromAnchor:Z,previousVertex:U};if(B=q(D,g,we),n===0)Y.push(U),ee=B.sub(U);else{let Te;const ue=B.sub(U);Te=ue.mag()===0?le(q(D+S,g,we).sub(B),n,S):le(ue,n,S),N||(N=U.add(Te)),R=te(D,Te,B,u,m,N,n,g,we),Y.push(N),ee=R.sub(N)}F=ee.mag()}const oe=ee._mult((W-Z)/F)._add(N||U),he=T+Math.atan2(B.y-U.y,B.x-U.x);return Y.push(oe),{point:oe,angle:y?he:0,path:Y}}const ze=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ee(h,e){for(let n=0;n=1;je--)xe.push(Fe.path[je]);for(let je=1;jeqe.signedDistanceFromCamera<=0)?[]:je.map(qe=>qe.point)}let lt=[];if(xe.length>0){const je=xe[0].clone(),qe=xe[0].clone();for(let ht=1;ht=ue.x&&qe.x<=de.x&&je.y>=ue.y&&qe.y<=de.y?[xe]:qe.xde.x||qe.yde.y?[]:p.al([xe],ue.x,ue.y,de.x,de.y)}for(const je of lt){Ae.reset(je,.25*Te);let qe=0;qe=Ae.length<=.5*Te?1:Math.ceil(Ae.paddedLength/Re)+1;for(let ht=0;htj(o,a,n.getElevation))}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const n=[];let a=1/0,o=1/0,u=-1/0,m=-1/0;for(const S of e){const T=new p.P(S.x+Ne,S.y+Ne);a=Math.min(a,T.x),o=Math.min(o,T.y),u=Math.max(u,T.x),m=Math.max(m,T.y),n.push(T)}const g=this.grid.query(a,o,u,m).concat(this.ignoredGrid.query(a,o,u,m)),y={},v={};for(const S of g){const T=S.key;if(y[T.bucketInstanceId]===void 0&&(y[T.bucketInstanceId]={}),y[T.bucketInstanceId][T.featureIndex])continue;const C=[new p.P(S.x1,S.y1),new p.P(S.x2,S.y1),new p.P(S.x2,S.y2),new p.P(S.x1,S.y2)];p.am(n,C)&&(y[T.bucketInstanceId][T.featureIndex]=!0,v[T.bucketInstanceId]===void 0&&(v[T.bucketInstanceId]=[]),v[T.bucketInstanceId].push(T.featureIndex))}return v}insertCollisionBox(e,n,a,o,u,m){(a?this.ignoredGrid:this.grid).insert({bucketInstanceId:o,featureIndex:u,collisionGroupID:m,overlapMode:n},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,n,a,o,u,m){const g=a?this.ignoredGrid:this.grid,y={bucketInstanceId:o,featureIndex:u,collisionGroupID:m,overlapMode:n};for(let v=0;v=this.screenRightBoundary||othis.screenBottomBoundary}isInsideGrid(e,n,a,o){return a>=0&&e=0&&nthis.projectAndGetPerspectiveRatio(a,ue.x,ue.y,o,v));we=Te.some(ue=>!ue.isOccluded),he=Te.map(ue=>ue.point)}else we=!0;return{box:p.ao(he),allPointsOccluded:!we}}}function Ve(h,e,n){return e*(p.X/(h.tileSize*Math.pow(2,n-h.tileID.overscaledZ)))}class at{constructor(e,n,a,o){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?n:-n))):o&&a?1:0,this.placed=a}isHidden(){return this.opacity===0&&!this.placed}}class _t{constructor(e,n,a,o,u){this.text=new at(e?e.text:null,n,a,u),this.icon=new at(e?e.icon:null,n,o,u)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class St{constructor(e,n,a){this.text=e,this.icon=n,this.skipFade=a}}class $e{constructor(){this.invProjMatrix=p.H(),this.viewportMatrix=p.H(),this.circles=[]}}class Qe{constructor(e,n,a,o,u){this.bucketInstanceId=e,this.featureIndex=n,this.sourceLayerIndex=a,this.bucketIndex=o,this.tileID=u}}class pt{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const n=++this.maxGroupID;this.collisionGroups[e]={ID:n,predicate:a=>a.collisionGroupID===n}}return this.collisionGroups[e]}}function At(h,e,n,a,o){const{horizontalAlign:u,verticalAlign:m}=p.au(h);return new p.P(-(u-.5)*e+a[0]*o,-(m-.5)*n+a[1]*o)}class Rt{constructor(e,n,a,o,u,m){this.transform=e.clone(),this.terrain=a,this.collisionIndex=new We(this.transform,n),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new pt(u),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=m,m&&(m.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){const n=this.terrain;return n?(a,o)=>n.getElevation(e,a,o):null}getBucketParts(e,n,a,o){const u=a.getBucket(n),m=a.latestFeatureIndex;if(!u||!m||n.id!==u.layerIds[0])return;const g=a.collisionBoxArray,y=u.layers[0].layout,v=u.layers[0].paint,S=Math.pow(2,this.transform.zoom-a.tileID.overscaledZ),T=a.tileSize/p.X,C=a.tileID.toUnwrapped(),D=this.transform.calculatePosMatrix(C),R=y.get("text-pitch-alignment")==="map",N=y.get("text-rotation-alignment")==="map",B=Ve(a,1,this.transform.zoom),U=this.collisionIndex.mapProjection.translatePosition(this.transform,a,v.get("text-translate"),v.get("text-translate-anchor")),Z=this.collisionIndex.mapProjection.translatePosition(this.transform,a,v.get("icon-translate"),v.get("icon-translate-anchor")),F=Ir(D,R,N,this.transform,B);let W=null;if(R){const ee=Qi(D,R,N,this.transform,B);W=p.L([],this.transform.labelPlaneMatrix,ee)}this.retainedQueryData[u.bucketInstanceId]=new Qe(u.bucketInstanceId,m,u.sourceLayerIndex,u.index,a.tileID);const Y={bucket:u,layout:y,translationText:U,translationIcon:Z,posMatrix:D,unwrappedTileID:C,textLabelPlaneMatrix:F,labelToScreenMatrix:W,scale:S,textPixelRatio:T,holdingForFade:a.holdingForFade(),collisionBoxArray:g,partiallyEvaluatedTextSize:p.ag(u.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(u.sourceID)};if(o)for(const ee of u.sortKeyRanges){const{sortKey:oe,symbolInstanceStart:he,symbolInstanceEnd:we}=ee;e.push({sortKey:oe,symbolInstanceStart:he,symbolInstanceEnd:we,parameters:Y})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:u.symbolInstances.length,parameters:Y})}attemptAnchorPlacement(e,n,a,o,u,m,g,y,v,S,T,C,D,R,N,B,U,Z,F){const W=p.aq[e.textAnchor],Y=[e.textOffset0,e.textOffset1],ee=At(W,a,o,Y,u),oe=this.collisionIndex.placeCollisionBox(n,C,y,v,S,g,m,B,T.predicate,F,ee);if((!Z||this.collisionIndex.placeCollisionBox(Z,C,y,v,S,g,m,U,T.predicate,F,ee).placeable)&&oe.placeable){let he;if(this.prevPlacement&&this.prevPlacement.variableOffsets[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID].text&&(he=this.prevPlacement.variableOffsets[D.crossTileID].anchor),D.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[D.crossTileID]={textOffset:Y,width:a,height:o,anchor:W,textBoxScale:u,prevAnchor:he},this.markUsedJustification(R,W,D,N),R.allowVerticalPlacement&&(this.markUsedOrientation(R,N,D),this.placedOrientations[D.crossTileID]=N),{shift:ee,placedGlyphBoxes:oe}}}placeLayerBucketPart(e,n,a){const{bucket:o,layout:u,translationText:m,translationIcon:g,posMatrix:y,unwrappedTileID:v,textLabelPlaneMatrix:S,labelToScreenMatrix:T,textPixelRatio:C,holdingForFade:D,collisionBoxArray:R,partiallyEvaluatedTextSize:N,collisionGroup:B}=e.parameters,U=u.get("text-optional"),Z=u.get("icon-optional"),F=p.ar(u,"text-overlap","text-allow-overlap"),W=F==="always",Y=p.ar(u,"icon-overlap","icon-allow-overlap"),ee=Y==="always",oe=u.get("text-rotation-alignment")==="map",he=u.get("text-pitch-alignment")==="map",we=u.get("icon-text-fit")!=="none",Te=u.get("symbol-z-order")==="viewport-y",ue=W&&(ee||!o.hasIconData()||Z),de=ee&&(W||!o.hasTextData()||U);!o.collisionArrays&&R&&o.deserializeCollisionBoxes(R);const Ae=this._getTerrainElevationFunc(this.retainedQueryData[o.bucketInstanceId].tileID),Fe=(me,xe,Re)=>{var lt,je;if(n[me.crossTileID])return;if(D)return void(this.placements[me.crossTileID]=new St(!1,!1,!1));let qe=!1,ht=!1,Ot=!0,Ri=null,ut={box:null,placeable:!1,offscreen:null},ti={box:null,placeable:!1,offscreen:null},Wt=null,Vt=null,Nt=null,Bi=0,tn=0,ps=0;xe.textFeatureIndex?Bi=xe.textFeatureIndex:me.useRuntimeCollisionCircles&&(Bi=me.featureIndex),xe.verticalTextFeatureIndex&&(tn=xe.verticalTextFeatureIndex);const rn=xe.textBox;if(rn){const Ti=Kt=>{let jt=p.ah.horizontal;if(o.allowVerticalPlacement&&!Kt&&this.prevPlacement){const _i=this.prevPlacement.placedOrientations[me.crossTileID];_i&&(this.placedOrientations[me.crossTileID]=_i,jt=_i,this.markUsedOrientation(o,jt,me))}return jt},Fi=(Kt,jt)=>{if(o.allowVerticalPlacement&&me.numVerticalGlyphVertices>0&&xe.verticalTextBox){for(const _i of o.writingModes)if(_i===p.ah.vertical?(ut=jt(),ti=ut):ut=Kt(),ut&&ut.placeable)break}else ut=Kt()},zr=me.textAnchorOffsetStartIndex,Oi=me.textAnchorOffsetEndIndex;if(Oi===zr){const Kt=(jt,_i)=>{const yt=this.collisionIndex.placeCollisionBox(jt,F,C,y,v,he,oe,m,B.predicate,Ae);return yt&&yt.placeable&&(this.markUsedOrientation(o,_i,me),this.placedOrientations[me.crossTileID]=_i),yt};Fi(()=>Kt(rn,p.ah.horizontal),()=>{const jt=xe.verticalTextBox;return o.allowVerticalPlacement&&me.numVerticalGlyphVertices>0&&jt?Kt(jt,p.ah.vertical):{box:null,offscreen:null}}),Ti(ut&&ut.placeable)}else{let Kt=p.aq[(je=(lt=this.prevPlacement)===null||lt===void 0?void 0:lt.variableOffsets[me.crossTileID])===null||je===void 0?void 0:je.anchor];const jt=(yt,Pn,Er)=>{const fs=yt.x2-yt.x1,sc=yt.y2-yt.y1,ac=me.textBoxScale,Et=we&&Y==="never"?Pn:null;let Dr=null,ms=F==="never"?1:2,_s="never";Kt&&ms++;for(let uo=0;uojt(rn,xe.iconBox,p.ah.horizontal),()=>{const yt=xe.verticalTextBox;return o.allowVerticalPlacement&&(!ut||!ut.placeable)&&me.numVerticalGlyphVertices>0&&yt?jt(yt,xe.verticalIconBox,p.ah.vertical):{box:null,occluded:!0,offscreen:null}}),ut&&(qe=ut.placeable,Ot=ut.offscreen);const _i=Ti(ut&&ut.placeable);if(!qe&&this.prevPlacement){const yt=this.prevPlacement.variableOffsets[me.crossTileID];yt&&(this.variableOffsets[me.crossTileID]=yt,this.markUsedJustification(o,yt.anchor,me,_i))}}}if(Wt=ut,qe=Wt&&Wt.placeable,Ot=Wt&&Wt.offscreen,me.useRuntimeCollisionCircles){const Ti=o.text.placedSymbolArray.get(me.centerJustifiedTextSymbolIndex),Fi=p.ai(o.textSizeData,N,Ti),zr=u.get("text-padding");Vt=this.collisionIndex.placeCollisionCircles(F,Ti,o.lineVertexArray,o.glyphOffsetArray,Fi,y,v,S,T,a,he,B.predicate,me.collisionCircleDiameter,zr,m,Ae),Vt.circles.length&&Vt.collisionDetected&&!a&&p.w("Collisions detected, but collision boxes are not shown"),qe=W||Vt.circles.length>0&&!Vt.collisionDetected,Ot=Ot&&Vt.offscreen}if(xe.iconFeatureIndex&&(ps=xe.iconFeatureIndex),xe.iconBox){const Ti=Fi=>this.collisionIndex.placeCollisionBox(Fi,Y,C,y,v,he,oe,g,B.predicate,Ae,we&&Ri?Ri:void 0);ti&&ti.placeable&&xe.verticalIconBox?(Nt=Ti(xe.verticalIconBox),ht=Nt.placeable):(Nt=Ti(xe.iconBox),ht=Nt.placeable),Ot=Ot&&Nt.offscreen}const kr=U||me.numHorizontalGlyphVertices===0&&me.numVerticalGlyphVertices===0,aa=Z||me.numIconVertices===0;kr||aa?aa?kr||(ht=ht&&qe):qe=ht&&qe:ht=qe=ht&&qe;const ho=ht&&Nt.placeable;if(qe&&Wt.placeable&&this.collisionIndex.insertCollisionBox(Wt.box,F,u.get("text-ignore-placement"),o.bucketInstanceId,ti&&ti.placeable&&tn?tn:Bi,B.ID),ho&&this.collisionIndex.insertCollisionBox(Nt.box,Y,u.get("icon-ignore-placement"),o.bucketInstanceId,ps,B.ID),Vt&&qe&&this.collisionIndex.insertCollisionCircles(Vt.circles,F,u.get("text-ignore-placement"),o.bucketInstanceId,Bi,B.ID),a&&this.storeCollisionData(o.bucketInstanceId,Re,xe,Wt,Nt,Vt),me.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(o.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[me.crossTileID]=new St(qe||ue,ht||de,Ot||o.justReloaded),n[me.crossTileID]=!0};if(Te){if(e.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const me=o.getSortedSymbolIndexes(this.transform.angle);for(let xe=me.length-1;xe>=0;--xe){const Re=me[xe];Fe(o.symbolInstances.get(Re),o.collisionArrays[Re],Re)}}else for(let me=e.symbolInstanceStart;me=0&&(e.text.placedSymbolArray.get(g).crossTileID=u>=0&&g!==u?0:a.crossTileID)}markUsedOrientation(e,n,a){const o=n===p.ah.horizontal||n===p.ah.horizontalOnly?n:0,u=n===p.ah.vertical?n:0,m=[a.leftJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.rightJustifiedTextSymbolIndex];for(const g of m)e.text.placedSymbolArray.get(g).placedOrientation=o;a.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).placedOrientation=u)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let a=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const o=n?n.symbolFadeChange(e):1,u=n?n.opacities:{},m=n?n.variableOffsets:{},g=n?n.placedOrientations:{};for(const y in this.placements){const v=this.placements[y],S=u[y];S?(this.opacities[y]=new _t(S,o,v.text,v.icon),a=a||v.text!==S.text.placed||v.icon!==S.icon.placed):(this.opacities[y]=new _t(null,o,v.text,v.icon,v.skipFade),a=a||v.text||v.icon)}for(const y in u){const v=u[y];if(!this.opacities[y]){const S=new _t(v,o,!1,!1);S.isHidden()||(this.opacities[y]=S,a=a||v.text.placed||v.icon.placed)}}for(const y in m)this.variableOffsets[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.variableOffsets[y]=m[y]);for(const y in g)this.placedOrientations[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.placedOrientations[y]=g[y]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");a?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:e)}updateLayerOpacities(e,n){const a={};for(const o of n){const u=o.getBucket(e);u&&o.latestFeatureIndex&&e.id===u.layerIds[0]&&this.updateBucketOpacities(u,o.tileID,a,o.collisionBoxArray)}}updateBucketOpacities(e,n,a,o){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const u=e.layers[0],m=u.layout,g=new _t(null,0,!1,!1,!0),y=m.get("text-allow-overlap"),v=m.get("icon-allow-overlap"),S=u._unevaluatedLayout.hasValue("text-variable-anchor")||u._unevaluatedLayout.hasValue("text-variable-anchor-offset"),T=m.get("text-rotation-alignment")==="map",C=m.get("text-pitch-alignment")==="map",D=m.get("icon-text-fit")!=="none",R=new _t(null,0,y&&(v||!e.hasIconData()||m.get("icon-optional")),v&&(y||!e.hasTextData()||m.get("text-optional")),!0);!e.collisionArrays&&o&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(o);const N=(U,Z,F)=>{for(let W=0;W0,he=this.placedOrientations[Z.crossTileID],we=he===p.ah.vertical,Te=he===p.ah.horizontal||he===p.ah.horizontalOnly;if(F>0||W>0){const de=ui(ee.text);N(e.text,F,we?Ft:de),N(e.text,W,Te?Ft:de);const Ae=ee.text.isHidden();[Z.rightJustifiedTextSymbolIndex,Z.centerJustifiedTextSymbolIndex,Z.leftJustifiedTextSymbolIndex].forEach(xe=>{xe>=0&&(e.text.placedSymbolArray.get(xe).hidden=Ae||we?1:0)}),Z.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(Z.verticalPlacedTextSymbolIndex).hidden=Ae||Te?1:0);const Fe=this.variableOffsets[Z.crossTileID];Fe&&this.markUsedJustification(e,Fe.anchor,Z,he);const me=this.placedOrientations[Z.crossTileID];me&&(this.markUsedJustification(e,"left",Z,me),this.markUsedOrientation(e,me,Z))}if(oe){const de=ui(ee.icon),Ae=!(D&&Z.verticalPlacedIconSymbolIndex&&we);Z.placedIconSymbolIndex>=0&&(N(e.icon,Z.numIconVertices,Ae?de:Ft),e.icon.placedSymbolArray.get(Z.placedIconSymbolIndex).hidden=ee.icon.isHidden()),Z.verticalPlacedIconSymbolIndex>=0&&(N(e.icon,Z.numVerticalIconVertices,Ae?Ft:de),e.icon.placedSymbolArray.get(Z.verticalPlacedIconSymbolIndex).hidden=ee.icon.isHidden())}const ue=B&&B.has(U)?B.get(U):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const de=e.collisionArrays[U];if(de){let Ae=new p.P(0,0);if(de.textBox||de.verticalTextBox){let Fe=!0;if(S){const me=this.variableOffsets[Y];me?(Ae=At(me.anchor,me.width,me.height,me.textOffset,me.textBoxScale),T&&Ae._rotate(C?this.transform.angle:-this.transform.angle)):Fe=!1}if(de.textBox||de.verticalTextBox){let me;de.textBox&&(me=we),de.verticalTextBox&&(me=Te),Bt(e.textCollisionBox.collisionVertexArray,ee.text.placed,!Fe||me,ue.text,Ae.x,Ae.y)}}if(de.iconBox||de.verticalIconBox){const Fe=!!(!Te&&de.verticalIconBox);let me;de.iconBox&&(me=Fe),de.verticalIconBox&&(me=!Fe),Bt(e.iconCollisionBox.collisionVertexArray,ee.icon.placed,me,ue.icon,D?Ae.x:0,D?Ae.y:0)}}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);if(e.bucketInstanceId in this.collisionCircleArrays){const U=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=U.invProjMatrix,e.placementViewportMatrix=U.viewportMatrix,e.collisionCircleArray=U.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTimee}setStale(){this.stale=!0}}function Bt(h,e,n,a,o,u){a&&a.length!==0||(a=[0,0,0,0]);const m=a[0]-Ne,g=a[1]-Ne,y=a[2]-Ne,v=a[3]-Ne;h.emplaceBack(e?1:0,n?1:0,o||0,u||0,m,g),h.emplaceBack(e?1:0,n?1:0,o||0,u||0,y,g),h.emplaceBack(e?1:0,n?1:0,o||0,u||0,y,v),h.emplaceBack(e?1:0,n?1:0,o||0,u||0,m,v)}const jn=Math.pow(2,25),et=Math.pow(2,24),Ta=Math.pow(2,17),Sa=Math.pow(2,16),ci=Math.pow(2,9),hi=Math.pow(2,8),Fl=Math.pow(2,1);function ui(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;const e=h.placed?1:0,n=Math.floor(127*h.opacity);return n*jn+e*et+n*Ta+e*Sa+n*ci+e*hi+n*Fl+e}const Ft=0;function As(){return{isOccluded:(h,e,n)=>!1,getPitchedTextCorrection:(h,e,n)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(h,e,n,a){throw new Error("Not implemented.")},translatePosition:(h,e,n,a)=>function(o,u,m,g,y=!1){if(!m[0]&&!m[1])return[0,0];const v=y?g==="map"?o.angle:0:g==="viewport"?-o.angle:0;if(v){const S=Math.sin(v),T=Math.cos(v);m=[m[0]*T-m[1]*S,m[0]*S+m[1]*T]}return[y?m[0]:Ve(u,m[0],o.zoom),y?m[1]:Ve(u,m[1],o.zoom)]}(h,e,n,a),getCircleRadiusCorrection:h=>1}}class Un{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,n,a,o,u){const m=this._bucketParts;for(;this._currentTileIndexg.sortKey-y.sortKey));this._currentPartIndex!this._forceFullPlacement&&_e.now()-o>2;for(;this._currentPlacementIndex>=0;){const m=n[e[this._currentPlacementIndex]],g=this.placement.collisionIndex.transform.zoom;if(m.type==="symbol"&&(!m.minzoom||m.minzoom<=g)&&(!m.maxzoom||m.maxzoom>g)){if(this._inProgressLayer||(this._inProgressLayer=new Un(m)),this._inProgressLayer.continuePlacement(a[m.source],this.placement,this._showCollisionBoxes,m,u))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const dr=512/p.X/2;class Zr{constructor(e,n,a){this.tileID=e,this.bucketInstanceId=a,this._symbolsByKey={};const o=new Map;for(let u=0;u({x:Math.floor(y.anchorX*dr),y:Math.floor(y.anchorY*dr)})),crossTileIDs:m.map(y=>y.crossTileID)};if(g.positions.length>128){const y=new p.av(g.positions.length,16,Uint16Array);for(const{x:v,y:S}of g.positions)y.add(v,S);y.finish(),delete g.positions,g.index=y}this._symbolsByKey[u]=g}}getScaledCoordinates(e,n){const{x:a,y:o,z:u}=this.tileID.canonical,{x:m,y:g,z:y}=n.canonical,v=dr/Math.pow(2,y-u),S=(g*p.X+e.anchorY)*v,T=o*p.X*dr;return{x:Math.floor((m*p.X+e.anchorX)*v-a*p.X*dr),y:Math.floor(S-T)}}findMatches(e,n,a){const o=this.tileID.canonical.ze)}}class wt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Ms{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const n=Math.round((e-this.lng)/360);if(n!==0)for(const a in this.indexes){const o=this.indexes[a],u={};for(const m in o){const g=o[m];g.tileID=g.tileID.unwrapTo(g.tileID.wrap+n),u[g.tileID.key]=g}this.indexes[a]=u}this.lng=e}addBucket(e,n,a){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let u=0;ue.overscaledZ)for(const g in m){const y=m[g];y.tileID.isChildOf(e)&&y.findMatches(n.symbolInstances,e,o)}else{const g=m[e.scaledTo(Number(u)).key];g&&g.findMatches(n.symbolInstances,e,o)}}for(let u=0;u{n[a]=!0});for(const a in this.layerIndexes)n[a]||delete this.layerIndexes[a]}}const $n=(h,e)=>p.t(h,e&&e.filter(n=>n.identifier!=="source.canvas")),Pr=p.aw();class Ia extends p.E{constructor(e,n={}){super(),this._rtlPluginLoaded=()=>{for(const a in this.sourceCaches){const o=this.sourceCaches[a].getSource().type;o!=="vector"&&o!=="geojson"||this.sourceCaches[a].reload()}},this.map=e,this.dispatcher=new $r(Ur(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",(a,o)=>this.getGlyphs(a,o)),this.dispatcher.registerMessageHandler("GI",(a,o)=>this.getImages(a,o)),this.imageManager=new Lt,this.imageManager.setEventedParent(this),this.glyphManager=new Xi(e._requestManager,n.localIdeographFontFamily),this.lineAtlas=new cn(256,512),this.crossTileSymbolIndex=new bi,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new p.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",p.ay()),Ji().on(pe,this._rtlPluginLoaded),this.on("data",a=>{if(a.dataType!=="source"||a.sourceDataType!=="metadata")return;const o=this.sourceCaches[a.sourceId];if(!o)return;const u=o.getSource();if(u&&u.vectorLayerIds)for(const m in this._layers){const g=this._layers[m];g.source===u.id&&this._validateLayer(g)}})}loadURL(e,n={},a){this.fire(new p.k("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const o=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;const u=this._loadStyleRequest;p.h(o,this._loadStyleRequest).then(m=>{this._loadStyleRequest=null,this._load(m.data,n,a)}).catch(m=>{this._loadStyleRequest=null,m&&!u.signal.aborted&&this.fire(new p.j(m))})}loadJSON(e,n={},a){this.fire(new p.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,_e.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,n.validate=n.validate!==!1,this._load(e,n,a)}).catch(()=>{})}loadEmpty(){this.fire(new p.k("dataloading",{dataType:"style"})),this._load(Pr,{validate:!1})}_load(e,n,a){var o;const u=n.transformStyle?n.transformStyle(a,e):e;if(!n.validate||!$n(this,p.u(u))){this._loaded=!0,this.stylesheet=u;for(const m in u.sources)this.addSource(m,u.sources[m],{validate:!1});u.sprite?this._loadSprite(u.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(u.glyphs),this._createLayers(),this.light=new lr(this.stylesheet.light),this.sky=new Mi(this.stylesheet.sky),this.map.setTerrain((o=this.stylesheet.terrain)!==null&&o!==void 0?o:null),this.fire(new p.k("data",{dataType:"style"})),this.fire(new p.k("style.load"))}}_createLayers(){const e=p.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",e),this._order=e.map(n=>n.id),this._layers={},this._serializedLayers=null;for(const n of e){const a=p.aA(n);a.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=a}}_loadSprite(e,n=!1,a=void 0){let o;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(u,m,g,y){return p._(this,void 0,void 0,function*(){const v=Hi(u),S=g>1?"@2x":"",T={},C={};for(const{id:D,url:R}of v){const N=m.transformRequest(Rn(R,S,".json"),"SpriteJSON");T[D]=p.h(N,y);const B=m.transformRequest(Rn(R,S,".png"),"SpriteImage");C[D]=oi.getImage(B,y)}return yield Promise.all([...Object.values(T),...Object.values(C)]),function(D,R){return p._(this,void 0,void 0,function*(){const N={};for(const B in D){N[B]={};const U=_e.getImageCanvasContext((yield R[B]).data),Z=(yield D[B]).data;for(const F in Z){const{width:W,height:Y,x:ee,y:oe,sdf:he,pixelRatio:we,stretchX:Te,stretchY:ue,content:de,textFitWidth:Ae,textFitHeight:Fe}=Z[F];N[B][F]={data:null,pixelRatio:we,sdf:he,stretchX:Te,stretchY:ue,content:de,textFitWidth:Ae,textFitHeight:Fe,spriteData:{width:W,height:Y,x:ee,y:oe,context:U}}}}return N})}(T,C)})}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(u=>{if(this._spriteRequest=null,u)for(const m in u){this._spritesImagesIds[m]=[];const g=this._spritesImagesIds[m]?this._spritesImagesIds[m].filter(y=>!(y in u)):[];for(const y of g)this.imageManager.removeImage(y),this._changedImages[y]=!0;for(const y in u[m]){const v=m==="default"?y:`${m}:${y}`;this._spritesImagesIds[m].push(v),v in this.imageManager.images?this.imageManager.updateImage(v,u[m][y],!1):this.imageManager.addImage(v,u[m][y]),n&&(this._changedImages[v]=!0)}}}).catch(u=>{this._spriteRequest=null,o=u,this.fire(new p.j(o))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"})),a&&a(o)})}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"}))}_validateLayer(e){const n=this.sourceCaches[e.source];if(!n)return;const a=e.sourceLayer;if(!a)return;const o=n.getSource();(o.type==="geojson"||o.vectorLayerIds&&o.vectorLayerIds.indexOf(a)===-1)&&this.fire(new p.j(new Error(`Source layer "${a}" does not exist on source "${o.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e,n=!1){const a=this._serializedAllLayers();if(!e||e.length===0)return Object.values(n?p.aB(a):a);const o=[];for(const u of e)if(a[u]){const m=n?p.aB(a[u]):a[u];o.push(m)}return o}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};const n=Object.keys(this._layers);for(const a of n){const o=this._layers[a];o.type!=="custom"&&(e[a]=o.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const n=this._changed;if(n){const o=Object.keys(this._updatedLayers),u=Object.keys(this._removedLayers);(o.length||u.length)&&this._updateWorkerLayers(o,u);for(const m in this._updatedSources){const g=this._updatedSources[m];if(g==="reload")this._reloadSource(m);else{if(g!=="clear")throw new Error(`Invalid action ${g}`);this._clearSource(m)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const m in this._updatedPaintProps)this._layers[m].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}const a={};for(const o in this.sourceCaches){const u=this.sourceCaches[o];a[o]=u.used,u.used=!1}for(const o of this._order){const u=this._layers[o];u.recalculate(e,this._availableImages),!u.isHidden(e.zoom)&&u.source&&(this.sourceCaches[u.source].used=!0)}for(const o in a){const u=this.sourceCaches[o];!!a[o]!=!!u.used&&u.fire(new p.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:o}))}this.light.recalculate(e),this.sky.recalculate(e),this.z=e.zoom,n&&this.fire(new p.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,n){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,n={}){var a;this._checkLoaded();const o=this.serialize();if(e=n.transformStyle?n.transformStyle(o,e):e,((a=n.validate)===null||a===void 0||a)&&$n(this,p.u(e)))return!1;(e=p.aB(e)).layers=p.az(e.layers);const u=p.aC(o,e),m=this._getOperationsToPerform(u);if(m.unimplemented.length>0)throw new Error(`Unimplemented: ${m.unimplemented.join(", ")}.`);if(m.operations.length===0)return!1;for(const g of m.operations)g();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){const n=[],a=[];for(const o of e)switch(o.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":n.push(()=>this.addLayer.apply(this,o.args));break;case"removeLayer":n.push(()=>this.removeLayer.apply(this,o.args));break;case"setPaintProperty":n.push(()=>this.setPaintProperty.apply(this,o.args));break;case"setLayoutProperty":n.push(()=>this.setLayoutProperty.apply(this,o.args));break;case"setFilter":n.push(()=>this.setFilter.apply(this,o.args));break;case"addSource":n.push(()=>this.addSource.apply(this,o.args));break;case"removeSource":n.push(()=>this.removeSource.apply(this,o.args));break;case"setLayerZoomRange":n.push(()=>this.setLayerZoomRange.apply(this,o.args));break;case"setLight":n.push(()=>this.setLight.apply(this,o.args));break;case"setGeoJSONSourceData":n.push(()=>this.setGeoJSONSourceData.apply(this,o.args));break;case"setGlyphs":n.push(()=>this.setGlyphs.apply(this,o.args));break;case"setSprite":n.push(()=>this.setSprite.apply(this,o.args));break;case"setSky":n.push(()=>this.setSky.apply(this,o.args));break;case"setTerrain":n.push(()=>this.map.setTerrain.apply(this,o.args));break;case"setTransition":n.push(()=>{});break;default:a.push(o.command)}return{operations:n,unimplemented:a}}addImage(e,n){if(this.getImage(e))return this.fire(new p.j(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,n),this._afterImageUpdated(e)}updateImage(e,n){this.imageManager.updateImage(e,n)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new p.j(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,n,a={}){if(this._checkLoaded(),this.sourceCaches[e]!==void 0)throw new Error(`Source "${e}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(p.u.source,`sources.${e}`,n,null,a))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const o=this.sourceCaches[e]=new Le(e,n,this.dispatcher);o.style=this,o.setEventedParent(this,()=>({isSourceLoaded:o.loaded(),source:o.serialize(),sourceId:e})),o.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error("There is no source with this ID");for(const a in this._layers)if(this._layers[a].source===e)return this.fire(new p.j(new Error(`Source "${e}" cannot be removed while layer "${a}" is using it.`)));const n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new p.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,n){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error(`There is no source with this ID=${e}`);const a=this.sourceCaches[e].getSource();if(a.type!=="geojson")throw new Error(`geojsonSource.type is ${a.type}, which is !== 'geojson`);a.setData(n),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,n,a={}){this._checkLoaded();const o=e.id;if(this.getLayer(o))return void this.fire(new p.j(new Error(`Layer "${o}" already exists on this map.`)));let u;if(e.type==="custom"){if($n(this,p.aD(e)))return;u=p.aA(e)}else{if("source"in e&&typeof e.source=="object"&&(this.addSource(o,e.source),e=p.aB(e),e=p.e(e,{source:o})),this._validate(p.u.layer,`layers.${o}`,e,{arrayIndex:-1},a))return;u=p.aA(e),this._validateLayer(u),u.setEventedParent(this,{layer:{id:o}})}const m=n?this._order.indexOf(n):this._order.length;if(n&&m===-1)this.fire(new p.j(new Error(`Cannot add layer "${o}" before non-existing layer "${n}".`)));else{if(this._order.splice(m,0,o),this._layerOrderChanged=!0,this._layers[o]=u,this._removedLayers[o]&&u.source&&u.type!=="custom"){const g=this._removedLayers[o];delete this._removedLayers[o],g.type!==u.type?this._updatedSources[u.source]="clear":(this._updatedSources[u.source]="reload",this.sourceCaches[u.source].pause())}this._updateLayer(u),u.onAdd&&u.onAdd(this.map)}}moveLayer(e,n){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new p.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===n)return;const a=this._order.indexOf(e);this._order.splice(a,1);const o=n?this._order.indexOf(n):this._order.length;n&&o===-1?this.fire(new p.j(new Error(`Cannot move layer "${e}" before non-existing layer "${n}".`))):(this._order.splice(o,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();const n=this._layers[e];if(!n)return void this.fire(new p.j(new Error(`Cannot remove non-existing layer "${e}".`)));n.setEventedParent(null);const a=this._order.indexOf(e);this._order.splice(a,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=n,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],n.onRemove&&n.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,n,a){this._checkLoaded();const o=this.getLayer(e);o?o.minzoom===n&&o.maxzoom===a||(n!=null&&(o.minzoom=n),a!=null&&(o.maxzoom=a),this._updateLayer(o)):this.fire(new p.j(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,n,a={}){this._checkLoaded();const o=this.getLayer(e);if(o){if(!p.aE(o.filter,n))return n==null?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(p.u.filter,`layers.${o.id}.filter`,n,null,a)||(o.filter=p.aB(n),this._updateLayer(o)))}else this.fire(new p.j(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return p.aB(this.getLayer(e).filter)}setLayoutProperty(e,n,a,o={}){this._checkLoaded();const u=this.getLayer(e);u?p.aE(u.getLayoutProperty(n),a)||(u.setLayoutProperty(n,a,o),this._updateLayer(u)):this.fire(new p.j(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,n){const a=this.getLayer(e);if(a)return a.getLayoutProperty(n);this.fire(new p.j(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,n,a,o={}){this._checkLoaded();const u=this.getLayer(e);u?p.aE(u.getPaintProperty(n),a)||(u.setPaintProperty(n,a,o)&&this._updateLayer(u),this._changed=!0,this._updatedPaintProps[e]=!0,this._serializedLayers=null):this.fire(new p.j(new Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,n){return this.getLayer(e).getPaintProperty(n)}setFeatureState(e,n){this._checkLoaded();const a=e.source,o=e.sourceLayer,u=this.sourceCaches[a];if(u===void 0)return void this.fire(new p.j(new Error(`The source '${a}' does not exist in the map's style.`)));const m=u.getSource().type;m==="geojson"&&o?this.fire(new p.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):m!=="vector"||o?(e.id===void 0&&this.fire(new p.j(new Error("The feature id parameter must be provided."))),u.setFeatureState(o,e.id,n)):this.fire(new p.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,n){this._checkLoaded();const a=e.source,o=this.sourceCaches[a];if(o===void 0)return void this.fire(new p.j(new Error(`The source '${a}' does not exist in the map's style.`)));const u=o.getSource().type,m=u==="vector"?e.sourceLayer:void 0;u!=="vector"||m?n&&typeof e.id!="string"&&typeof e.id!="number"?this.fire(new p.j(new Error("A feature id is required to remove its specific state property."))):o.removeFeatureState(m,e.id,n):this.fire(new p.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();const n=e.source,a=e.sourceLayer,o=this.sourceCaches[n];if(o!==void 0)return o.getSource().type!=="vector"||a?(e.id===void 0&&this.fire(new p.j(new Error("The feature id parameter must be provided."))),o.getFeatureState(a,e.id)):void this.fire(new p.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new p.j(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return p.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const e=p.aF(this.sourceCaches,u=>u.serialize()),n=this._serializeByIds(this._order,!0),a=this.map.getTerrain()||void 0,o=this.stylesheet;return p.aG({version:o.version,name:o.name,metadata:o.metadata,light:o.light,sky:o.sky,center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,sprite:o.sprite,glyphs:o.glyphs,transition:o.transition,sources:e,layers:n,terrain:a},u=>u!==void 0)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.sourceCaches[e.source].getSource().type!=="raster"&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){const n=m=>this._layers[m].type==="fill-extrusion",a={},o=[];for(let m=this._order.length-1;m>=0;m--){const g=this._order[m];if(n(g)){a[g]=m;for(const y of e){const v=y[g];if(v)for(const S of v)o.push(S)}}}o.sort((m,g)=>g.intersectionZ-m.intersectionZ);const u=[];for(let m=this._order.length-1;m>=0;m--){const g=this._order[m];if(n(g))for(let y=o.length-1;y>=0;y--){const v=o[y].feature;if(a[v.layer.id]{const he=U.featureSortOrder;if(he){const we=he.indexOf(ee.featureIndex);return he.indexOf(oe.featureIndex)-we}return oe.featureIndex-ee.featureIndex});for(const ee of Y)W.push(ee)}}for(const U in R)R[U].forEach(Z=>{const F=Z.feature,W=v[g[U].source].getFeatureState(F.layer["source-layer"],F.id);F.source=F.layer.source,F.layer["source-layer"]&&(F.sourceLayer=F.layer["source-layer"]),F.state=W});return R}(this._layers,m,this.sourceCaches,e,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)}querySourceFeatures(e,n){n&&n.filter&&this._validate(p.u.filter,"querySourceFeatures.filter",n.filter,null,n);const a=this.sourceCaches[e];return a?function(o,u){const m=o.getRenderableIds().map(v=>o.getTileByID(v)),g=[],y={};for(let v=0;vC.getTileByID(D)).sort((D,R)=>R.tileID.overscaledZ-D.tileID.overscaledZ||(D.tileID.isLessThan(R.tileID)?-1:1))}const T=this.crossTileSymbolIndex.addLayer(S,y[S.source],e.center.lng);m=m||T}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((u=u||this._layerOrderChanged||a===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(_e.now(),e.zoom))&&(this.pauseablePlacement=new It(e,this.map.terrain,this._order,u,n,a,o,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,y),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(_e.now()),g=!0),m&&this.pauseablePlacement.placement.setStale()),g||m)for(const v of this._order){const S=this._layers[v];S.type==="symbol"&&this.placement.updateLayerOpacities(S,y[S.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(_e.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,n){return p._(this,void 0,void 0,function*(){const a=yield this.imageManager.getImages(n.icons);this._updateTilesForChangedImages();const o=this.sourceCaches[n.source];return o&&o.setDependencies(n.tileID.key,n.type,n.icons),a})}getGlyphs(e,n){return p._(this,void 0,void 0,function*(){const a=yield this.glyphManager.getGlyphs(n.stacks),o=this.sourceCaches[n.source];return o&&o.setDependencies(n.tileID.key,n.type,[""]),a})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,n={}){this._checkLoaded(),e&&this._validate(p.u.glyphs,"glyphs",e,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,n,a={},o){this._checkLoaded();const u=[{id:e,url:n}],m=[...Hi(this.stylesheet.sprite),...u];this._validate(p.u.sprite,"sprite",m,null,a)||(this.stylesheet.sprite=m,this._loadSprite(u,!0,o))}removeSprite(e){this._checkLoaded();const n=Hi(this.stylesheet.sprite);if(n.find(a=>a.id===e)){if(this._spritesImagesIds[e])for(const a of this._spritesImagesIds[e])this.imageManager.removeImage(a),this._changedImages[a]=!0;n.splice(n.findIndex(a=>a.id===e),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"}))}else this.fire(new p.j(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return Hi(this.stylesheet.sprite)}setSprite(e,n={},a){this._checkLoaded(),e&&this._validate(p.u.sprite,"sprite",e,null,n)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,a):(this._unloadSprite(),a&&a(null)))}}var qn=p.Y([{name:"a_pos",type:"Int16",components:2}]);const Ar={prelude:Ye(`#ifdef GL_ES -precision mediump float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif -`,`#ifdef GL_ES -precision highp float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif -vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 -);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} -#ifdef TERRAIN3D -uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; -#endif -const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { -#ifdef TERRAIN3D -highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); -#else -return 1.0; -#endif -}float calculate_visibility(vec4 pos) { -#ifdef TERRAIN3D -vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; -#else -return 1.0; -#endif -}float ele(vec2 pos) { -#ifdef TERRAIN3D -vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; -#else -return 0.0; -#endif -}float get_elevation(vec2 pos) { -#ifdef TERRAIN3D -vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; -#else -return 0.0; -#endif -}`),background:Ye(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Ye(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Ye(`varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main(void) { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Ye("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Ye(`uniform highp float u_intensity;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#define GAUSS_COEF 0.3989422804014327 -void main() { -#pragma mapbox: initialize highp float weight -float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#pragma mapbox: define mediump float radius -const highp float ZERO=1.0/255.0/16.0; -#define GAUSS_COEF 0.3989422804014327 -void main(void) { -#pragma mapbox: initialize highp float weight -#pragma mapbox: initialize mediump float radius -vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Ye(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(0.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Ye("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Ye("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;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(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Ye("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Ye(`#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_FragColor=color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Ye(`varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Ye(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Ye(`#ifdef GL_ES -precision highp float; -#endif -uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Ye(`varying vec4 v_color;void main() {gl_FragColor=v_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; -#ifdef TERRAIN3D -attribute vec2 a_centroid; -#endif -varying vec4 v_color; -#pragma mapbox: define highp float base -#pragma mapbox: define highp float height -#pragma mapbox: define highp vec4 color -void main() { -#pragma mapbox: initialize highp float base -#pragma mapbox: initialize highp float height -#pragma mapbox: initialize highp vec4 color -vec3 normal=a_normal_ed.xyz; -#ifdef TERRAIN3D -float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); -#else -float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; -#endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Ye(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; -#ifdef TERRAIN3D -attribute vec2 a_centroid; -#endif -varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; -#ifdef TERRAIN3D -float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); -#else -float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; -#endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 -? a_pos -: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Ye(`#ifdef GL_ES -precision highp float; -#endif -uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Ye(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; -#define PI 3.141592653589793 -void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Ye(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_width2=vec2(outset,inset);}`),lineGradient:Ye(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_width2=vec2(outset,inset);}`),linePattern:Ye(`#ifdef GL_ES -precision highp float; -#endif -uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Ye(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Ye(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Ye(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Ye(`#define SDF_PX 8.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Ye(`#define SDF_PX 8.0 -#define SDF 1.0 -#define ICON 0.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Ye("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:Ye("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:Ye("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:Ye("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function Ye(h,e){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,a=e.match(/attribute ([\w]+) ([\w]+)/g),o=h.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),u=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=u?u.concat(o):o,g={};return{fragmentSource:h=h.replace(n,(y,v,S,T,C)=>(g[C]=!0,v==="define"?` -#ifndef HAS_UNIFORM_u_${C} -varying ${S} ${T} ${C}; -#else -uniform ${S} ${T} u_${C}; -#endif -`:` -#ifdef HAS_UNIFORM_u_${C} - ${S} ${T} ${C} = u_${C}; -#endif -`)),vertexSource:e=e.replace(n,(y,v,S,T,C)=>{const D=T==="float"?"vec2":"vec4",R=C.match(/color/)?"color":D;return g[C]?v==="define"?` -#ifndef HAS_UNIFORM_u_${C} -uniform lowp float u_${C}_t; -attribute ${S} ${D} a_${C}; -varying ${S} ${T} ${C}; -#else -uniform ${S} ${T} u_${C}; -#endif -`:R==="vec4"?` -#ifndef HAS_UNIFORM_u_${C} - ${C} = a_${C}; -#else - ${S} ${T} ${C} = u_${C}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${C} - ${C} = unpack_mix_${R}(a_${C}, u_${C}_t); -#else - ${S} ${T} ${C} = u_${C}; -#endif -`:v==="define"?` -#ifndef HAS_UNIFORM_u_${C} -uniform lowp float u_${C}_t; -attribute ${S} ${D} a_${C}; -#else -uniform ${S} ${T} u_${C}; -#endif -`:R==="vec4"?` -#ifndef HAS_UNIFORM_u_${C} - ${S} ${T} ${C} = a_${C}; -#else - ${S} ${T} ${C} = u_${C}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${C} - ${S} ${T} ${C} = unpack_mix_${R}(a_${C}, u_${C}_t); -#else - ${S} ${T} ${C} = u_${C}; -#endif -`}),staticAttributes:a,staticUniforms:m}}class Cs{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,n,a,o,u,m,g,y,v){this.context=e;let S=this.boundPaintVertexBuffers.length!==o.length;for(let T=0;!S&&T({u_matrix:h,u_texture:0,u_ele_delta:e,u_fog_matrix:n,u_fog_color:a?a.properties.get("fog-color"):p.aM.white,u_fog_ground_blend:a?a.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:a?a.calculateFogBlendOpacity(o):0,u_horizon_color:a?a.properties.get("horizon-color"):p.aM.white,u_horizon_fog_blend:a?a.properties.get("horizon-fog-blend"):1});function Zn(h){const e=[];for(let n=0;n({u_depth:new p.aH(ee,oe.u_depth),u_terrain:new p.aH(ee,oe.u_terrain),u_terrain_dim:new p.aI(ee,oe.u_terrain_dim),u_terrain_matrix:new p.aJ(ee,oe.u_terrain_matrix),u_terrain_unpack:new p.aK(ee,oe.u_terrain_unpack),u_terrain_exaggeration:new p.aI(ee,oe.u_terrain_exaggeration)}))(e,Y),this.binderUniforms=a?a.getUniforms(e,Y):[]}draw(e,n,a,o,u,m,g,y,v,S,T,C,D,R,N,B,U,Z){const F=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(a),e.setStencilMode(o),e.setColorMode(u),e.setCullFace(m),y){e.activeTexture.set(F.TEXTURE2),F.bindTexture(F.TEXTURE_2D,y.depthTexture),e.activeTexture.set(F.TEXTURE3),F.bindTexture(F.TEXTURE_2D,y.texture);for(const Y in this.terrainUniforms)this.terrainUniforms[Y].set(y[Y])}for(const Y in this.fixedUniforms)this.fixedUniforms[Y].set(g[Y]);N&&N.setUniforms(e,this.binderUniforms,D,{zoom:R});let W=0;switch(n){case F.LINES:W=2;break;case F.TRIANGLES:W=3;break;case F.LINE_STRIP:W=1}for(const Y of C.get()){const ee=Y.vaos||(Y.vaos={});(ee[v]||(ee[v]=new Cs)).bind(e,this,S,N?N.getPaintVertexBuffers():[],T,Y.vertexOffset,B,U,Z),F.drawElements(n,Y.primitiveLength*W,F.UNSIGNED_SHORT,Y.primitiveOffset*W*2)}}}function zs(h,e,n){const a=1/Ve(n,1,e.transform.tileZoom),o=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,e.transform.tileZoom)/o,m=u*(n.tileID.canonical.x+n.tileID.wrap*o),g=u*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[a,h.fromScale,h.toScale],u_fade:h.t,u_pixel_coord_upper:[m>>16,g>>16],u_pixel_coord_lower:[65535&m,65535&g]}}const Es=(h,e,n,a)=>{const o=e.style.light,u=o.properties.get("position"),m=[u.x,u.y,u.z],g=function(){var v=new p.A(9);return p.A!=Float32Array&&(v[1]=0,v[2]=0,v[3]=0,v[5]=0,v[6]=0,v[7]=0),v[0]=1,v[4]=1,v[8]=1,v}();o.properties.get("anchor")==="viewport"&&function(v,S){var T=Math.sin(S),C=Math.cos(S);v[0]=C,v[1]=T,v[2]=0,v[3]=-T,v[4]=C,v[5]=0,v[6]=0,v[7]=0,v[8]=1}(g,-e.transform.angle),function(v,S,T){var C=S[0],D=S[1],R=S[2];v[0]=C*T[0]+D*T[3]+R*T[6],v[1]=C*T[1]+D*T[4]+R*T[7],v[2]=C*T[2]+D*T[5]+R*T[8]}(m,m,g);const y=o.properties.get("color");return{u_matrix:h,u_lightpos:m,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[y.r,y.g,y.b],u_vertical_gradient:+n,u_opacity:a}},Ds=(h,e,n,a,o,u,m)=>p.e(Es(h,e,n,a),zs(u,e,m),{u_height_factor:-Math.pow(2,o.overscaledZ)/m.tileSize/8}),Gn=h=>({u_matrix:h}),pn=(h,e,n,a)=>p.e(Gn(h),zs(n,e,a)),Ol=(h,e)=>({u_matrix:h,u_world:e}),Vl=(h,e,n,a,o)=>p.e(pn(h,e,n,a),{u_world:o}),Do=(h,e,n,a)=>{const o=h.transform;let u,m;if(a.paint.get("circle-pitch-alignment")==="map"){const g=Ve(n,1,o.zoom);u=!0,m=[g,g]}else u=!1,m=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+(a.paint.get("circle-pitch-scale")==="map"),u_matrix:h.translatePosMatrix(e.posMatrix,n,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_pitch_with_map:+u,u_device_pixel_ratio:h.pixelRatio,u_extrude_scale:m}},Nl=(h,e,n)=>({u_matrix:h,u_inv_matrix:e,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}),Mr=(h,e,n=1)=>({u_matrix:h,u_color:e,u_overlay:0,u_overlay_scale:n}),Hn=h=>({u_matrix:h}),di=(h,e,n,a)=>({u_matrix:h,u_extrude_scale:Ve(e,1,n),u_intensity:a});function pi(h,e){const n=Math.pow(2,e.canonical.z),a=e.canonical.y;return[new p.Z(0,a/n).toLngLat().lat,new p.Z(0,(a+1)/n).toLngLat().lat]}const Xn=(h,e,n,a)=>{const o=h.transform;return{u_matrix:Bo(h,e,n,a),u_ratio:1/Ve(e,1,o.zoom),u_device_pixel_ratio:h.pixelRatio,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Ls=(h,e,n,a,o)=>p.e(Xn(h,e,n,o),{u_image:0,u_image_height:a}),Lo=(h,e,n,a,o)=>{const u=h.transform,m=Gr(e,u);return{u_matrix:Bo(h,e,n,o),u_texsize:e.imageAtlasTexture.size,u_ratio:1/Ve(e,1,u.zoom),u_device_pixel_ratio:h.pixelRatio,u_image:0,u_scale:[m,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]]}},Ro=(h,e,n,a,o,u)=>{const m=h.lineAtlas,g=Gr(e,h.transform),y=n.layout.get("line-cap")==="round",v=m.getDash(a.from,y),S=m.getDash(a.to,y),T=v.width*o.fromScale,C=S.width*o.toScale;return p.e(Xn(h,e,n,u),{u_patternscale_a:[g/T,-v.height/2],u_patternscale_b:[g/C,-S.height/2],u_sdfgamma:m.width/(256*Math.min(T,C)*h.pixelRatio)/2,u_image:0,u_tex_y_a:v.y,u_tex_y_b:S.y,u_mix:o.t})};function Gr(h,e){return 1/Ve(h,1,e.tileZoom)}function Bo(h,e,n,a){return h.translatePosMatrix(a?a.posMatrix:e.tileID.posMatrix,e,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const jl=(h,e,n,a,o)=>{return{u_matrix:h,u_tl_parent:e,u_scale_parent:n,u_buffer_scale:1,u_fade_t:a.mix,u_opacity:a.opacity*o.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:o.paint.get("raster-brightness-min"),u_brightness_high:o.paint.get("raster-brightness-max"),u_saturation_factor:(m=o.paint.get("raster-saturation"),m>0?1-1/(1.001-m):-m),u_contrast_factor:(u=o.paint.get("raster-contrast"),u>0?1/(1-u):1+u),u_spin_weights:Ul(o.paint.get("raster-hue-rotate"))};var u,m};function Ul(h){h*=Math.PI/180;const e=Math.sin(h),n=Math.cos(h);return[(2*n+1)/3,(-Math.sqrt(3)*e-n+1)/3,(Math.sqrt(3)*e-n+1)/3]}const Fo=(h,e,n,a,o,u,m,g,y,v,S,T,C,D)=>{const R=m.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:R.cameraToCenterDistance,u_pitch:R.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:R.width/R.height,u_fade_change:m.options.fadeDuration?m.symbolFadeChange:1,u_matrix:g,u_label_plane_matrix:y,u_coord_matrix:v,u_is_text:+T,u_pitch_with_map:+a,u_is_along_line:o,u_is_variable_anchor:u,u_texsize:C,u_texture:0,u_translation:S,u_pitched_scale:D}},Oo=(h,e,n,a,o,u,m,g,y,v,S,T,C,D,R)=>{const N=m.transform;return p.e(Fo(h,e,n,a,o,u,m,g,y,v,S,T,C,R),{u_gamma_scale:a?Math.cos(N._pitch)*N.cameraToCenterDistance:1,u_device_pixel_ratio:m.pixelRatio,u_is_halo:+D})},$l=(h,e,n,a,o,u,m,g,y,v,S,T,C,D)=>p.e(Oo(h,e,n,a,o,u,m,g,y,v,S,!0,T,!0,D),{u_texsize_icon:C,u_texture_icon:1}),Rs=(h,e,n)=>({u_matrix:h,u_opacity:e,u_color:n}),Aa=(h,e,n,a,o,u)=>p.e(function(m,g,y,v){const S=y.imageManager.getPattern(m.from.toString()),T=y.imageManager.getPattern(m.to.toString()),{width:C,height:D}=y.imageManager.getPixelSize(),R=Math.pow(2,v.tileID.overscaledZ),N=v.tileSize*Math.pow(2,y.transform.tileZoom)/R,B=N*(v.tileID.canonical.x+v.tileID.wrap*R),U=N*v.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:S.tl,u_pattern_br_a:S.br,u_pattern_tl_b:T.tl,u_pattern_br_b:T.br,u_texsize:[C,D],u_mix:g.t,u_pattern_size_a:S.displaySize,u_pattern_size_b:T.displaySize,u_scale_a:g.fromScale,u_scale_b:g.toScale,u_tile_units_to_pixels:1/Ve(v,1,y.transform.tileZoom),u_pixel_coord_upper:[B>>16,U>>16],u_pixel_coord_lower:[65535&B,65535&U]}}(a,u,n,o),{u_matrix:h,u_opacity:e}),Bs={fillExtrusion:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_lightpos:new p.aN(h,e.u_lightpos),u_lightintensity:new p.aI(h,e.u_lightintensity),u_lightcolor:new p.aN(h,e.u_lightcolor),u_vertical_gradient:new p.aI(h,e.u_vertical_gradient),u_opacity:new p.aI(h,e.u_opacity)}),fillExtrusionPattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_lightpos:new p.aN(h,e.u_lightpos),u_lightintensity:new p.aI(h,e.u_lightintensity),u_lightcolor:new p.aN(h,e.u_lightcolor),u_vertical_gradient:new p.aI(h,e.u_vertical_gradient),u_height_factor:new p.aI(h,e.u_height_factor),u_image:new p.aH(h,e.u_image),u_texsize:new p.aO(h,e.u_texsize),u_pixel_coord_upper:new p.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new p.aO(h,e.u_pixel_coord_lower),u_scale:new p.aN(h,e.u_scale),u_fade:new p.aI(h,e.u_fade),u_opacity:new p.aI(h,e.u_opacity)}),fill:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix)}),fillPattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_image:new p.aH(h,e.u_image),u_texsize:new p.aO(h,e.u_texsize),u_pixel_coord_upper:new p.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new p.aO(h,e.u_pixel_coord_lower),u_scale:new p.aN(h,e.u_scale),u_fade:new p.aI(h,e.u_fade)}),fillOutline:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_world:new p.aO(h,e.u_world)}),fillOutlinePattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_world:new p.aO(h,e.u_world),u_image:new p.aH(h,e.u_image),u_texsize:new p.aO(h,e.u_texsize),u_pixel_coord_upper:new p.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new p.aO(h,e.u_pixel_coord_lower),u_scale:new p.aN(h,e.u_scale),u_fade:new p.aI(h,e.u_fade)}),circle:(h,e)=>({u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_scale_with_map:new p.aH(h,e.u_scale_with_map),u_pitch_with_map:new p.aH(h,e.u_pitch_with_map),u_extrude_scale:new p.aO(h,e.u_extrude_scale),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_matrix:new p.aJ(h,e.u_matrix)}),collisionBox:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_pixel_extrude_scale:new p.aO(h,e.u_pixel_extrude_scale)}),collisionCircle:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_inv_matrix:new p.aJ(h,e.u_inv_matrix),u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_viewport_size:new p.aO(h,e.u_viewport_size)}),debug:(h,e)=>({u_color:new p.aL(h,e.u_color),u_matrix:new p.aJ(h,e.u_matrix),u_overlay:new p.aH(h,e.u_overlay),u_overlay_scale:new p.aI(h,e.u_overlay_scale)}),clippingMask:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix)}),heatmap:(h,e)=>({u_extrude_scale:new p.aI(h,e.u_extrude_scale),u_intensity:new p.aI(h,e.u_intensity),u_matrix:new p.aJ(h,e.u_matrix)}),heatmapTexture:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_world:new p.aO(h,e.u_world),u_image:new p.aH(h,e.u_image),u_color_ramp:new p.aH(h,e.u_color_ramp),u_opacity:new p.aI(h,e.u_opacity)}),hillshade:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_image:new p.aH(h,e.u_image),u_latrange:new p.aO(h,e.u_latrange),u_light:new p.aO(h,e.u_light),u_shadow:new p.aL(h,e.u_shadow),u_highlight:new p.aL(h,e.u_highlight),u_accent:new p.aL(h,e.u_accent)}),hillshadePrepare:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_image:new p.aH(h,e.u_image),u_dimension:new p.aO(h,e.u_dimension),u_zoom:new p.aI(h,e.u_zoom),u_unpack:new p.aK(h,e.u_unpack)}),line:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_ratio:new p.aI(h,e.u_ratio),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_units_to_pixels:new p.aO(h,e.u_units_to_pixels)}),lineGradient:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_ratio:new p.aI(h,e.u_ratio),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_units_to_pixels:new p.aO(h,e.u_units_to_pixels),u_image:new p.aH(h,e.u_image),u_image_height:new p.aI(h,e.u_image_height)}),linePattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_texsize:new p.aO(h,e.u_texsize),u_ratio:new p.aI(h,e.u_ratio),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_image:new p.aH(h,e.u_image),u_units_to_pixels:new p.aO(h,e.u_units_to_pixels),u_scale:new p.aN(h,e.u_scale),u_fade:new p.aI(h,e.u_fade)}),lineSDF:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_ratio:new p.aI(h,e.u_ratio),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_units_to_pixels:new p.aO(h,e.u_units_to_pixels),u_patternscale_a:new p.aO(h,e.u_patternscale_a),u_patternscale_b:new p.aO(h,e.u_patternscale_b),u_sdfgamma:new p.aI(h,e.u_sdfgamma),u_image:new p.aH(h,e.u_image),u_tex_y_a:new p.aI(h,e.u_tex_y_a),u_tex_y_b:new p.aI(h,e.u_tex_y_b),u_mix:new p.aI(h,e.u_mix)}),raster:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_tl_parent:new p.aO(h,e.u_tl_parent),u_scale_parent:new p.aI(h,e.u_scale_parent),u_buffer_scale:new p.aI(h,e.u_buffer_scale),u_fade_t:new p.aI(h,e.u_fade_t),u_opacity:new p.aI(h,e.u_opacity),u_image0:new p.aH(h,e.u_image0),u_image1:new p.aH(h,e.u_image1),u_brightness_low:new p.aI(h,e.u_brightness_low),u_brightness_high:new p.aI(h,e.u_brightness_high),u_saturation_factor:new p.aI(h,e.u_saturation_factor),u_contrast_factor:new p.aI(h,e.u_contrast_factor),u_spin_weights:new p.aN(h,e.u_spin_weights)}),symbolIcon:(h,e)=>({u_is_size_zoom_constant:new p.aH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new p.aH(h,e.u_is_size_feature_constant),u_size_t:new p.aI(h,e.u_size_t),u_size:new p.aI(h,e.u_size),u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_pitch:new p.aI(h,e.u_pitch),u_rotate_symbol:new p.aH(h,e.u_rotate_symbol),u_aspect_ratio:new p.aI(h,e.u_aspect_ratio),u_fade_change:new p.aI(h,e.u_fade_change),u_matrix:new p.aJ(h,e.u_matrix),u_label_plane_matrix:new p.aJ(h,e.u_label_plane_matrix),u_coord_matrix:new p.aJ(h,e.u_coord_matrix),u_is_text:new p.aH(h,e.u_is_text),u_pitch_with_map:new p.aH(h,e.u_pitch_with_map),u_is_along_line:new p.aH(h,e.u_is_along_line),u_is_variable_anchor:new p.aH(h,e.u_is_variable_anchor),u_texsize:new p.aO(h,e.u_texsize),u_texture:new p.aH(h,e.u_texture),u_translation:new p.aO(h,e.u_translation),u_pitched_scale:new p.aI(h,e.u_pitched_scale)}),symbolSDF:(h,e)=>({u_is_size_zoom_constant:new p.aH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new p.aH(h,e.u_is_size_feature_constant),u_size_t:new p.aI(h,e.u_size_t),u_size:new p.aI(h,e.u_size),u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_pitch:new p.aI(h,e.u_pitch),u_rotate_symbol:new p.aH(h,e.u_rotate_symbol),u_aspect_ratio:new p.aI(h,e.u_aspect_ratio),u_fade_change:new p.aI(h,e.u_fade_change),u_matrix:new p.aJ(h,e.u_matrix),u_label_plane_matrix:new p.aJ(h,e.u_label_plane_matrix),u_coord_matrix:new p.aJ(h,e.u_coord_matrix),u_is_text:new p.aH(h,e.u_is_text),u_pitch_with_map:new p.aH(h,e.u_pitch_with_map),u_is_along_line:new p.aH(h,e.u_is_along_line),u_is_variable_anchor:new p.aH(h,e.u_is_variable_anchor),u_texsize:new p.aO(h,e.u_texsize),u_texture:new p.aH(h,e.u_texture),u_gamma_scale:new p.aI(h,e.u_gamma_scale),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_is_halo:new p.aH(h,e.u_is_halo),u_translation:new p.aO(h,e.u_translation),u_pitched_scale:new p.aI(h,e.u_pitched_scale)}),symbolTextAndIcon:(h,e)=>({u_is_size_zoom_constant:new p.aH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new p.aH(h,e.u_is_size_feature_constant),u_size_t:new p.aI(h,e.u_size_t),u_size:new p.aI(h,e.u_size),u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_pitch:new p.aI(h,e.u_pitch),u_rotate_symbol:new p.aH(h,e.u_rotate_symbol),u_aspect_ratio:new p.aI(h,e.u_aspect_ratio),u_fade_change:new p.aI(h,e.u_fade_change),u_matrix:new p.aJ(h,e.u_matrix),u_label_plane_matrix:new p.aJ(h,e.u_label_plane_matrix),u_coord_matrix:new p.aJ(h,e.u_coord_matrix),u_is_text:new p.aH(h,e.u_is_text),u_pitch_with_map:new p.aH(h,e.u_pitch_with_map),u_is_along_line:new p.aH(h,e.u_is_along_line),u_is_variable_anchor:new p.aH(h,e.u_is_variable_anchor),u_texsize:new p.aO(h,e.u_texsize),u_texsize_icon:new p.aO(h,e.u_texsize_icon),u_texture:new p.aH(h,e.u_texture),u_texture_icon:new p.aH(h,e.u_texture_icon),u_gamma_scale:new p.aI(h,e.u_gamma_scale),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_is_halo:new p.aH(h,e.u_is_halo),u_translation:new p.aO(h,e.u_translation),u_pitched_scale:new p.aI(h,e.u_pitched_scale)}),background:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_opacity:new p.aI(h,e.u_opacity),u_color:new p.aL(h,e.u_color)}),backgroundPattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_opacity:new p.aI(h,e.u_opacity),u_image:new p.aH(h,e.u_image),u_pattern_tl_a:new p.aO(h,e.u_pattern_tl_a),u_pattern_br_a:new p.aO(h,e.u_pattern_br_a),u_pattern_tl_b:new p.aO(h,e.u_pattern_tl_b),u_pattern_br_b:new p.aO(h,e.u_pattern_br_b),u_texsize:new p.aO(h,e.u_texsize),u_mix:new p.aI(h,e.u_mix),u_pattern_size_a:new p.aO(h,e.u_pattern_size_a),u_pattern_size_b:new p.aO(h,e.u_pattern_size_b),u_scale_a:new p.aI(h,e.u_scale_a),u_scale_b:new p.aI(h,e.u_scale_b),u_pixel_coord_upper:new p.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new p.aO(h,e.u_pixel_coord_lower),u_tile_units_to_pixels:new p.aI(h,e.u_tile_units_to_pixels)}),terrain:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_texture:new p.aH(h,e.u_texture),u_ele_delta:new p.aI(h,e.u_ele_delta),u_fog_matrix:new p.aJ(h,e.u_fog_matrix),u_fog_color:new p.aL(h,e.u_fog_color),u_fog_ground_blend:new p.aI(h,e.u_fog_ground_blend),u_fog_ground_blend_opacity:new p.aI(h,e.u_fog_ground_blend_opacity),u_horizon_color:new p.aL(h,e.u_horizon_color),u_horizon_fog_blend:new p.aI(h,e.u_horizon_fog_blend)}),terrainDepth:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_ele_delta:new p.aI(h,e.u_ele_delta)}),terrainCoords:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_texture:new p.aH(h,e.u_texture),u_terrain_coords_id:new p.aI(h,e.u_terrain_coords_id),u_ele_delta:new p.aI(h,e.u_ele_delta)}),sky:(h,e)=>({u_sky_color:new p.aL(h,e.u_sky_color),u_horizon_color:new p.aL(h,e.u_horizon_color),u_horizon:new p.aI(h,e.u_horizon),u_sky_horizon_blend:new p.aI(h,e.u_sky_horizon_blend)})};class Ma{constructor(e,n,a){this.context=e;const o=e.gl;this.buffer=o.createBuffer(),this.dynamicDraw=!!a,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ca={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class er{constructor(e,n,a,o){this.length=n.length,this.attributes=a,this.itemSize=n.bytesPerElement,this.dynamicDraw=o,this.context=e;const u=e.gl;this.buffer=u.createBuffer(),e.bindVertexBuffer.set(this.buffer),u.bufferData(u.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?u.DYNAMIC_DRAW:u.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,n){for(let a=0;a0){const ee=p.H();p.aQ(ee,F.placementInvProjMatrix,h.transform.glCoordMatrix),p.aQ(ee,ee,F.placementViewportMatrix),y.push({circleArray:Y,circleOffset:S,transform:Z.posMatrix,invTransform:ee,coord:Z}),v+=Y.length/4,S=v}W&&g.draw(u,m.LINES,Ze.disabled,ft.disabled,h.colorModeForRenderPass(),ot.disabled,{u_matrix:Z.posMatrix,u_pixel_extrude_scale:[1/(T=h.transform).width,1/T.height]},h.style.map.terrain&&h.style.map.terrain.getTerrainData(Z),n.id,W.layoutVertexBuffer,W.indexBuffer,W.segments,null,h.transform.zoom,null,null,W.collisionVertexBuffer)}var T;if(!o||!y.length)return;const C=h.useProgram("collisionCircle"),D=new p.aR;D.resize(4*v),D._trim();let R=0;for(const U of y)for(let Z=0;Z=0&&(U[F.associatedIconIndex]={shiftedAnchor:Re,angle:lt})}else Ee(F.numGlyphs,N)}if(v){B.clear();const Z=h.icon.placedSymbolArray;for(let F=0;Fh.style.map.terrain.getElevation(ue,Er,fs):null,Pn=n.layout.get("text-rotation-alignment")==="map";E(Ae,ue.posMatrix,h,o,tn,rn,U,v,Pn,N,ue.toUnwrapped(),R.width,R.height,kr,yt)}const Ti=ue.posMatrix,Fi=o&&he||ho,zr=Z||Fi?Yn:tn,Oi=ps,Kt=xe&&n.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let jt;jt=xe?Ae.iconsInText?$l(Re.kind,qe,F,U,Z,Fi,h,Ti,zr,Oi,kr,Ot,Wt,Te):Oo(Re.kind,qe,F,U,Z,Fi,h,Ti,zr,Oi,kr,o,Ot,!0,Te):Fo(Re.kind,qe,F,U,Z,Fi,h,Ti,zr,Oi,kr,o,Ot,Te);const _i={program:je,buffers:Fe,uniformValues:jt,atlasTexture:Ri,atlasTextureIcon:Vt,atlasInterpolation:ut,atlasInterpolationIcon:ti,isSDF:xe,hasHalo:Kt};if(Y&&Ae.canOverlap){ee=!0;const yt=Fe.segments.get();for(const Pn of yt)we.push({segments:new p.a0([Pn]),sortKey:Pn.sortKey,state:_i,terrainData:ht})}else we.push({segments:Fe.segments,sortKey:0,state:_i,terrainData:ht})}ee&&we.sort((ue,de)=>ue.sortKey-de.sortKey);for(const ue of we){const de=ue.state;if(C.activeTexture.set(D.TEXTURE0),de.atlasTexture.bind(de.atlasInterpolation,D.CLAMP_TO_EDGE),de.atlasTextureIcon&&(C.activeTexture.set(D.TEXTURE1),de.atlasTextureIcon&&de.atlasTextureIcon.bind(de.atlasInterpolationIcon,D.CLAMP_TO_EDGE)),de.isSDF){const Ae=de.uniformValues;de.hasHalo&&(Ae.u_is_halo=1,fi(de.buffers,ue.segments,n,h,de.program,oe,S,T,Ae,ue.terrainData)),Ae.u_is_halo=0}fi(de.buffers,ue.segments,n,h,de.program,oe,S,T,de.uniformValues,ue.terrainData)}}function fi(h,e,n,a,o,u,m,g,y,v){const S=a.context;o.draw(S,S.gl.TRIANGLES,u,m,g,ot.disabled,y,v,n.id,h.layoutVertexBuffer,h.indexBuffer,e,n.paint,a.transform.zoom,h.programConfigurations.get(n.id),h.dynamicLayoutVertexBuffer,h.opacityVertexBuffer)}function Va(h,e,n,a,o){if(!n||!a||!a.imageAtlas)return;const u=a.imageAtlas.patternPositions;let m=u[n.to.toString()],g=u[n.from.toString()];if(!m&&g&&(m=g),!g&&m&&(g=m),!m||!g){const y=o.getPaintProperty(e);m=u[y],g=u[y]}m&&g&&h.setConstantPatternPositions(m,g)}function Na(h,e,n,a,o,u,m){const g=h.context.gl,y="fill-pattern",v=n.paint.get(y),S=v&&v.constantOr(1),T=n.getCrossfadeParameters();let C,D,R,N,B;m?(D=S&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",C=g.LINES):(D=S?"fillPattern":"fill",C=g.TRIANGLES);const U=v.constantOr(null);for(const Z of a){const F=e.getTile(Z);if(S&&!F.patternsLoaded())continue;const W=F.getBucket(n);if(!W)continue;const Y=W.programConfigurations.get(n.id),ee=h.useProgram(D,Y),oe=h.style.map.terrain&&h.style.map.terrain.getTerrainData(Z);S&&(h.context.activeTexture.set(g.TEXTURE0),F.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),Y.updatePaintBuffers(T)),Va(Y,y,U,F,n);const he=oe?Z:null,we=h.translatePosMatrix(he?he.posMatrix:Z.posMatrix,F,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(m){N=W.indexBuffer2,B=W.segments2;const Te=[g.drawingBufferWidth,g.drawingBufferHeight];R=D==="fillOutlinePattern"&&S?Vl(we,h,T,F,Te):Ol(we,Te)}else N=W.indexBuffer,B=W.segments,R=S?pn(we,h,T,F):Gn(we);ee.draw(h.context,C,o,h.stencilModeForClipping(Z),u,ot.disabled,R,oe,n.id,W.layoutVertexBuffer,N,B,n.paint,h.transform.zoom,Y)}}function Qn(h,e,n,a,o,u,m){const g=h.context,y=g.gl,v="fill-extrusion-pattern",S=n.paint.get(v),T=S.constantOr(1),C=n.getCrossfadeParameters(),D=n.paint.get("fill-extrusion-opacity"),R=S.constantOr(null);for(const N of a){const B=e.getTile(N),U=B.getBucket(n);if(!U)continue;const Z=h.style.map.terrain&&h.style.map.terrain.getTerrainData(N),F=U.programConfigurations.get(n.id),W=h.useProgram(T?"fillExtrusionPattern":"fillExtrusion",F);T&&(h.context.activeTexture.set(y.TEXTURE0),B.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),F.updatePaintBuffers(C)),Va(F,v,R,B,n);const Y=h.translatePosMatrix(N.posMatrix,B,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),ee=n.paint.get("fill-extrusion-vertical-gradient"),oe=T?Ds(Y,h,ee,D,N,C,B):Es(Y,h,ee,D);W.draw(g,g.gl.TRIANGLES,o,u,m,ot.backCCW,oe,Z,n.id,U.layoutVertexBuffer,U.indexBuffer,U.segments,n.paint,h.transform.zoom,F,h.style.map.terrain&&U.centroidVertexBuffer)}}function Jr(h,e,n,a,o,u,m){const g=h.context,y=g.gl,v=n.fbo;if(!v)return;const S=h.useProgram("hillshade"),T=h.style.map.terrain&&h.style.map.terrain.getTerrainData(e);g.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,v.colorAttachment.get()),S.draw(g,y.TRIANGLES,o,u,m,ot.disabled,((C,D,R,N)=>{const B=R.paint.get("hillshade-shadow-color"),U=R.paint.get("hillshade-highlight-color"),Z=R.paint.get("hillshade-accent-color");let F=R.paint.get("hillshade-illumination-direction")*(Math.PI/180);R.paint.get("hillshade-illumination-anchor")==="viewport"&&(F-=C.transform.angle);const W=!C.options.moving;return{u_matrix:N?N.posMatrix:C.transform.calculatePosMatrix(D.tileID.toUnwrapped(),W),u_image:0,u_latrange:pi(0,D.tileID),u_light:[R.paint.get("hillshade-exaggeration"),F],u_shadow:B,u_highlight:U,u_accent:Z}})(h,n,a,T?e:null),T,a.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments)}function $s(h,e,n,a,o,u){const m=h.context,g=m.gl,y=e.dem;if(y&&y.data){const v=y.dim,S=y.stride,T=y.getPixels();if(m.activeTexture.set(g.TEXTURE1),m.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||h.getTileTexture(S),e.demTexture){const D=e.demTexture;D.update(T,{premultiply:!1}),D.bind(g.NEAREST,g.CLAMP_TO_EDGE)}else e.demTexture=new tt(m,T,g.RGBA,{premultiply:!1}),e.demTexture.bind(g.NEAREST,g.CLAMP_TO_EDGE);m.activeTexture.set(g.TEXTURE0);let C=e.fbo;if(!C){const D=new tt(m,{width:v,height:v,data:null},g.RGBA);D.bind(g.LINEAR,g.CLAMP_TO_EDGE),C=e.fbo=m.createFramebuffer(v,v,!0,!1),C.colorAttachment.set(D.texture)}m.bindFramebuffer.set(C.framebuffer),m.viewport.set([0,0,v,v]),h.useProgram("hillshadePrepare").draw(m,g.TRIANGLES,a,o,u,ot.disabled,((D,R)=>{const N=R.stride,B=p.H();return p.aP(B,0,p.X,-p.X,0,0,1),p.J(B,B,[0,-p.X,0]),{u_matrix:B,u_image:1,u_dimension:[N,N],u_zoom:D.overscaledZ,u_unpack:R.getUnpackVector()}})(e.tileID,y),null,n.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments),e.needsHillshadePrepare=!1}}function qs(h,e,n,a,o,u){const m=a.paint.get("raster-fade-duration");if(!u&&m>0){const g=_e.now(),y=(g-h.timeAdded)/m,v=e?(g-e.timeAdded)/m:-1,S=n.getSource(),T=o.coveringZoomLevel({tileSize:S.tileSize,roundZoom:S.roundZoom}),C=!e||Math.abs(e.tileID.overscaledZ-T)>Math.abs(h.tileID.overscaledZ-T),D=C&&h.refreshedUponExpiration?1:p.ac(C?y:1-v,0,1);return h.refreshedUponExpiration&&y>=1&&(h.refreshedUponExpiration=!1),e?{opacity:1,mix:1-D}:{opacity:D,mix:0}}return{opacity:1,mix:0}}const es=new p.aM(1,0,0,1),Zs=new p.aM(0,1,0,1),Yo=new p.aM(0,0,1,1),_n=new p.aM(1,0,1,1),gn=new p.aM(0,1,1,1);function ja(h,e,n,a){He(h,0,e+n/2,h.transform.width,n,a)}function Gs(h,e,n,a){He(h,e-n/2,0,n,h.transform.height,a)}function He(h,e,n,a,o,u){const m=h.context,g=m.gl;g.enable(g.SCISSOR_TEST),g.scissor(e*h.pixelRatio,n*h.pixelRatio,a*h.pixelRatio,o*h.pixelRatio),m.clear({color:u}),g.disable(g.SCISSOR_TEST)}function Hs(h,e,n){const a=h.context,o=a.gl,u=n.posMatrix,m=h.useProgram("debug"),g=Ze.disabled,y=ft.disabled,v=h.colorModeForRenderPass(),S="$debug",T=h.style.map.terrain&&h.style.map.terrain.getTerrainData(n);a.activeTexture.set(o.TEXTURE0);const C=e.getTileByID(n.key).latestRawTileData,D=Math.floor((C&&C.byteLength||0)/1024),R=e.getTile(n).tileSize,N=512/Math.min(R,512)*(n.overscaledZ/h.transform.zoom)*.5;let B=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(B+=` => ${n.overscaledZ}`),function(U,Z){U.initDebugOverlayCanvas();const F=U.debugOverlayCanvas,W=U.context.gl,Y=U.debugOverlayCanvas.getContext("2d");Y.clearRect(0,0,F.width,F.height),Y.shadowColor="white",Y.shadowBlur=2,Y.lineWidth=1.5,Y.strokeStyle="white",Y.textBaseline="top",Y.font="bold 36px Open Sans, sans-serif",Y.fillText(Z,5,5),Y.strokeText(Z,5,5),U.debugOverlayTexture.update(F),U.debugOverlayTexture.bind(W.LINEAR,W.CLAMP_TO_EDGE)}(h,`${B} ${D}kB`),m.draw(a,o.TRIANGLES,g,y,gt.alphaBlended,ot.disabled,Mr(u,p.aM.transparent,N),null,S,h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments),m.draw(a,o.LINE_STRIP,g,y,v,ot.disabled,Mr(u,p.aM.red),T,S,h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments)}function Qo(h,e,n){const a=h.context,o=a.gl,u=h.colorModeForRenderPass(),m=new Ze(o.LEQUAL,Ze.ReadWrite,h.depthRangeFor3D),g=h.useProgram("terrain"),y=e.getTerrainMesh();a.bindFramebuffer.set(null),a.viewport.set([0,0,h.width,h.height]);for(const v of n){const S=h.renderToTexture.getTexture(v),T=e.getTerrainData(v.tileID);a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,S.texture);const C=h.transform.calculatePosMatrix(v.tileID.toUnwrapped()),D=e.getMeshFrameDelta(h.transform.zoom),R=h.transform.calculateFogMatrix(v.tileID.toUnwrapped()),N=Pa(C,D,R,h.style.sky,h.transform.pitch);g.draw(a,o.TRIANGLES,m,ft.disabled,u,ot.backCCW,N,T,"terrain",y.vertexBuffer,y.indexBuffer,y.segments)}}class Ua{constructor(e,n,a){this.vertexBuffer=e,this.indexBuffer=n,this.segments=a}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class ts{constructor(e,n){this.context=new Yl(e),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:p.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Le.maxUnderzooming+Le.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new bi}resize(e,n,a){if(this.width=Math.floor(e*a),this.height=Math.floor(n*a),this.pixelRatio=a,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const o of this.style._order)this.style._layers[o].resize()}setup(){const e=this.context,n=new p.aW;n.emplaceBack(0,0),n.emplaceBack(p.X,0),n.emplaceBack(0,p.X),n.emplaceBack(p.X,p.X),this.tileExtentBuffer=e.createVertexBuffer(n,qn.members),this.tileExtentSegments=p.a0.simpleSegment(0,0,4,2);const a=new p.aW;a.emplaceBack(0,0),a.emplaceBack(p.X,0),a.emplaceBack(0,p.X),a.emplaceBack(p.X,p.X),this.debugBuffer=e.createVertexBuffer(a,qn.members),this.debugSegments=p.a0.simpleSegment(0,0,4,5);const o=new p.$;o.emplaceBack(0,0,0,0),o.emplaceBack(p.X,0,p.X,0),o.emplaceBack(0,p.X,0,p.X),o.emplaceBack(p.X,p.X,p.X,p.X),this.rasterBoundsBuffer=e.createVertexBuffer(o,Tr.members),this.rasterBoundsSegments=p.a0.simpleSegment(0,0,4,2);const u=new p.aW;u.emplaceBack(0,0),u.emplaceBack(1,0),u.emplaceBack(0,1),u.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(u,qn.members),this.viewportSegments=p.a0.simpleSegment(0,0,4,2);const m=new p.aY;m.emplaceBack(0),m.emplaceBack(1),m.emplaceBack(3),m.emplaceBack(2),m.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(m);const g=new p.aX;g.emplaceBack(0,1,2),g.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(g);const y=this.context.gl;this.stencilClearMode=new ft({func:y.ALWAYS,mask:0},0,255,y.ZERO,y.ZERO,y.ZERO)}clearStencil(){const e=this.context,n=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const a=p.H();p.aP(a,0,this.width,this.height,0,0,1),p.K(a,a,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,n.TRIANGLES,Ze.disabled,this.stencilClearMode,gt.disabled,ot.disabled,Hn(a),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,n){if(this.currentStencilSource===e.source||!e.isTileClipped()||!n||!n.length)return;this.currentStencilSource=e.source;const a=this.context,o=a.gl;this.nextStencilID+n.length>256&&this.clearStencil(),a.setColorMode(gt.disabled),a.setDepthMode(Ze.disabled);const u=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const m of n){const g=this._tileClippingMaskIDs[m.key]=this.nextStencilID++,y=this.style.map.terrain&&this.style.map.terrain.getTerrainData(m);u.draw(a,o.TRIANGLES,Ze.disabled,new ft({func:o.ALWAYS,mask:0},g,255,o.KEEP,o.KEEP,o.REPLACE),gt.disabled,ot.disabled,Hn(m.posMatrix),y,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,n=this.context.gl;return new ft({func:n.NOTEQUAL,mask:255},e,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(e){const n=this.context.gl;return new ft({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(e){const n=this.context.gl,a=e.sort((m,g)=>g.overscaledZ-m.overscaledZ),o=a[a.length-1].overscaledZ,u=a[0].overscaledZ-o+1;if(u>1){this.currentStencilSource=void 0,this.nextStencilID+u>256&&this.clearStencil();const m={};for(let g=0;g({u_sky_color:U.properties.get("sky-color"),u_horizon_color:U.properties.get("horizon-color"),u_horizon:(Z.height/2+Z.getHorizon())*F,u_sky_horizon_blend:U.properties.get("sky-horizon-blend")*Z.height/2*F}))(v,y.style.map.transform,y.pixelRatio),D=new Ze(T.LEQUAL,Ze.ReadWrite,[0,1]),R=ft.disabled,N=y.colorModeForRenderPass(),B=y.useProgram("sky");if(!v.mesh){const U=new p.aW;U.emplaceBack(-1,-1),U.emplaceBack(1,-1),U.emplaceBack(1,1),U.emplaceBack(-1,1);const Z=new p.aX;Z.emplaceBack(0,1,2),Z.emplaceBack(0,2,3),v.mesh=new Ua(S.createVertexBuffer(U,qn.members),S.createIndexBuffer(Z),p.a0.simpleSegment(0,0,U.length,Z.length))}B.draw(S,T.TRIANGLES,D,R,N,ot.disabled,C,void 0,"sky",v.mesh.vertexBuffer,v.mesh.indexBuffer,v.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=a.length-1;this.currentLayer>=0;this.currentLayer--){const y=this.style._layers[a[this.currentLayer]],v=o[y.source],S=u[y.source];this._renderTileClippingMasks(y,S),this.renderLayer(this,v,y,S)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerB.source&&!B.isHidden(S)?[v.sourceCaches[B.source]]:[]),D=C.filter(B=>B.getSource().type==="vector"),R=C.filter(B=>B.getSource().type!=="vector"),N=B=>{(!T||T.getSource().maxzoomN(B)),T||R.forEach(B=>N(B)),T}(this.style,this.transform.zoom);y&&function(v,S,T){for(let C=0;C0),o&&(p.a$(n,a),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(u,m){const g=u.context,y=g.gl,v=gt.unblended,S=new Ze(y.LEQUAL,Ze.ReadWrite,[0,1]),T=m.getTerrainMesh(),C=m.sourceCache.getRenderableTiles(),D=u.useProgram("terrainDepth");g.bindFramebuffer.set(m.getFramebuffer("depth").framebuffer),g.viewport.set([0,0,u.width/devicePixelRatio,u.height/devicePixelRatio]),g.clear({color:p.aM.transparent,depth:1});for(const R of C){const N=m.getTerrainData(R.tileID),B={u_matrix:u.transform.calculatePosMatrix(R.tileID.toUnwrapped()),u_ele_delta:m.getMeshFrameDelta(u.transform.zoom)};D.draw(g,y.TRIANGLES,S,ft.disabled,v,ot.backCCW,B,N,"terrain",T.vertexBuffer,T.indexBuffer,T.segments)}g.bindFramebuffer.set(null),g.viewport.set([0,0,u.width,u.height])}(this,this.style.map.terrain),function(u,m){const g=u.context,y=g.gl,v=gt.unblended,S=new Ze(y.LEQUAL,Ze.ReadWrite,[0,1]),T=m.getTerrainMesh(),C=m.getCoordsTexture(),D=m.sourceCache.getRenderableTiles(),R=u.useProgram("terrainCoords");g.bindFramebuffer.set(m.getFramebuffer("coords").framebuffer),g.viewport.set([0,0,u.width/devicePixelRatio,u.height/devicePixelRatio]),g.clear({color:p.aM.transparent,depth:1}),m.coordsIndex=[];for(const N of D){const B=m.getTerrainData(N.tileID);g.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,C.texture);const U={u_matrix:u.transform.calculatePosMatrix(N.tileID.toUnwrapped()),u_terrain_coords_id:(255-m.coordsIndex.length)/255,u_texture:0,u_ele_delta:m.getMeshFrameDelta(u.transform.zoom)};R.draw(g,y.TRIANGLES,S,ft.disabled,v,ot.backCCW,U,B,"terrain",T.vertexBuffer,T.indexBuffer,T.segments),m.coordsIndex.push(N.tileID.key)}g.bindFramebuffer.set(null),g.viewport.set([0,0,u.width,u.height])}(this,this.style.map.terrain))}renderLayer(e,n,a,o){if(!a.isHidden(this.transform.zoom)&&(a.type==="background"||a.type==="custom"||(o||[]).length))switch(this.id=a.id,a.type){case"symbol":(function(u,m,g,y,v){if(u.renderPass!=="translucent")return;const S=ft.disabled,T=u.colorModeForRenderPass();(g._unevaluatedLayout.hasValue("text-variable-anchor")||g._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(C,D,R,N,B,U,Z,F,W){const Y=D.transform,ee=As(),oe=B==="map",he=U==="map";for(const we of C){const Te=N.getTile(we),ue=Te.getBucket(R);if(!ue||!ue.text||!ue.text.segments.get().length)continue;const de=p.ag(ue.textSizeData,Y.zoom),Ae=Ve(Te,1,D.transform.zoom),Fe=Ir(we.posMatrix,he,oe,D.transform,Ae),me=R.layout.get("icon-text-fit")!=="none"&&ue.hasIconData();if(de){const xe=Math.pow(2,Y.zoom-Te.tileID.overscaledZ),Re=D.style.map.terrain?(je,qe)=>D.style.map.terrain.getElevation(we,je,qe):null,lt=ee.translatePosition(Y,Te,Z,F);Oa(ue,oe,he,W,Y,Fe,we.posMatrix,xe,de,me,ee,lt,we.toUnwrapped(),Re)}}}(y,u,g,m,g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),v),g.paint.get("icon-opacity").constantOr(1)!==0&&Kr(u,m,g,y,!1,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),g.layout.get("icon-rotation-alignment"),g.layout.get("icon-pitch-alignment"),g.layout.get("icon-keep-upright"),S,T),g.paint.get("text-opacity").constantOr(1)!==0&&Kr(u,m,g,y,!0,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),g.layout.get("text-keep-upright"),S,T),m.map.showCollisionBoxes&&(Fa(u,m,g,y,!0),Fa(u,m,g,y,!1))})(e,n,a,o,this.style.placement.variableOffsets);break;case"circle":(function(u,m,g,y){if(u.renderPass!=="translucent")return;const v=g.paint.get("circle-opacity"),S=g.paint.get("circle-stroke-width"),T=g.paint.get("circle-stroke-opacity"),C=!g.layout.get("circle-sort-key").isConstant();if(v.constantOr(1)===0&&(S.constantOr(1)===0||T.constantOr(1)===0))return;const D=u.context,R=D.gl,N=u.depthModeForSublayer(0,Ze.ReadOnly),B=ft.disabled,U=u.colorModeForRenderPass(),Z=[];for(let F=0;FF.sortKey-W.sortKey);for(const F of Z){const{programConfiguration:W,program:Y,layoutVertexBuffer:ee,indexBuffer:oe,uniformValues:he,terrainData:we}=F.state;Y.draw(D,R.TRIANGLES,N,B,U,ot.disabled,he,we,g.id,ee,oe,F.segments,g.paint,u.transform.zoom,W)}})(e,n,a,o);break;case"heatmap":(function(u,m,g,y){if(g.paint.get("heatmap-opacity")!==0)if(u.renderPass==="offscreen"){const v=u.context,S=v.gl,T=ft.disabled,C=new gt([S.ONE,S.ONE],p.aM.transparent,[!0,!0,!0,!0]);(function(D,R,N){const B=D.gl;D.activeTexture.set(B.TEXTURE1),D.viewport.set([0,0,R.width/4,R.height/4]);let U=N.heatmapFbo;if(U)B.bindTexture(B.TEXTURE_2D,U.colorAttachment.get()),D.bindFramebuffer.set(U.framebuffer);else{const Z=B.createTexture();B.bindTexture(B.TEXTURE_2D,Z),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MAG_FILTER,B.LINEAR),U=N.heatmapFbo=D.createFramebuffer(R.width/4,R.height/4,!1,!1),function(F,W,Y,ee){var oe,he;const we=F.gl,Te=(oe=F.HALF_FLOAT)!==null&&oe!==void 0?oe:we.UNSIGNED_BYTE,ue=(he=F.RGBA16F)!==null&&he!==void 0?he:we.RGBA;we.texImage2D(we.TEXTURE_2D,0,ue,W.width/4,W.height/4,0,we.RGBA,Te,null),ee.colorAttachment.set(Y)}(D,R,Z,U)}})(v,u,g),v.clear({color:p.aM.transparent});for(let D=0;D{const F=p.H();p.aP(F,0,N.width,N.height,0,0,1);const W=N.context.gl;return{u_matrix:F,u_world:[W.drawingBufferWidth,W.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:B.paint.get("heatmap-opacity")}})(v,S),null,S.id,v.viewportBuffer,v.quadTriangleIndexBuffer,v.viewportSegments,S.paint,v.transform.zoom)}(u,g))})(e,n,a,o);break;case"line":(function(u,m,g,y){if(u.renderPass!=="translucent")return;const v=g.paint.get("line-opacity"),S=g.paint.get("line-width");if(v.constantOr(1)===0||S.constantOr(1)===0)return;const T=u.depthModeForSublayer(0,Ze.ReadOnly),C=u.colorModeForRenderPass(),D=g.paint.get("line-dasharray"),R=g.paint.get("line-pattern"),N=R.constantOr(1),B=g.paint.get("line-gradient"),U=g.getCrossfadeParameters(),Z=N?"linePattern":D?"lineSDF":B?"lineGradient":"line",F=u.context,W=F.gl;let Y=!0;for(const ee of y){const oe=m.getTile(ee);if(N&&!oe.patternsLoaded())continue;const he=oe.getBucket(g);if(!he)continue;const we=he.programConfigurations.get(g.id),Te=u.context.program.get(),ue=u.useProgram(Z,we),de=Y||ue.program!==Te,Ae=u.style.map.terrain&&u.style.map.terrain.getTerrainData(ee),Fe=R.constantOr(null);if(Fe&&oe.imageAtlas){const Re=oe.imageAtlas,lt=Re.patternPositions[Fe.to.toString()],je=Re.patternPositions[Fe.from.toString()];lt&&je&&we.setConstantPatternPositions(lt,je)}const me=Ae?ee:null,xe=N?Lo(u,oe,g,U,me):D?Ro(u,oe,g,D,U,me):B?Ls(u,oe,g,he.lineClipsArray.length,me):Xn(u,oe,g,me);if(N)F.activeTexture.set(W.TEXTURE0),oe.imageAtlasTexture.bind(W.LINEAR,W.CLAMP_TO_EDGE),we.updatePaintBuffers(U);else if(D&&(de||u.lineAtlas.dirty))F.activeTexture.set(W.TEXTURE0),u.lineAtlas.bind(F);else if(B){const Re=he.gradients[g.id];let lt=Re.texture;if(g.gradientVersion!==Re.version){let je=256;if(g.stepInterpolant){const qe=m.getSource().maxzoom,ht=ee.canonical.z===qe?Math.ceil(1<20&&S.texParameterf(S.TEXTURE_2D,v.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,v.extTextureFilterAnisotropicMax);const ue=u.style.map.terrain&&u.style.map.terrain.getTerrainData(Z),de=ue?Z:null,Ae=de?de.posMatrix:u.transform.calculatePosMatrix(Z.toUnwrapped(),U),Fe=jl(Ae,we||[0,0],he||1,oe,g);T instanceof hr?C.draw(v,S.TRIANGLES,F,ft.disabled,D,ot.disabled,Fe,ue,g.id,T.boundsBuffer,u.quadTriangleIndexBuffer,T.boundsSegments):C.draw(v,S.TRIANGLES,F,R[Z.overscaledZ],D,ot.disabled,Fe,ue,g.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments)}})(e,n,a,o);break;case"background":(function(u,m,g,y){const v=g.paint.get("background-color"),S=g.paint.get("background-opacity");if(S===0)return;const T=u.context,C=T.gl,D=u.transform,R=D.tileSize,N=g.paint.get("background-pattern");if(u.isPatternMissing(N))return;const B=!N&&v.a===1&&S===1&&u.opaquePassEnabledForLayer()?"opaque":"translucent";if(u.renderPass!==B)return;const U=ft.disabled,Z=u.depthModeForSublayer(0,B==="opaque"?Ze.ReadWrite:Ze.ReadOnly),F=u.colorModeForRenderPass(),W=u.useProgram(N?"backgroundPattern":"background"),Y=y||D.coveringTiles({tileSize:R,terrain:u.style.map.terrain});N&&(T.activeTexture.set(C.TEXTURE0),u.imageManager.bind(u.context));const ee=g.getCrossfadeParameters();for(const oe of Y){const he=y?oe.posMatrix:u.transform.calculatePosMatrix(oe.toUnwrapped()),we=N?Aa(he,S,u,N,{tileID:oe,tileSize:R},ee):Rs(he,S,v),Te=u.style.map.terrain&&u.style.map.terrain.getTerrainData(oe);W.draw(T,C.TRIANGLES,Z,U,F,ot.disabled,we,Te,g.id,u.tileExtentBuffer,u.quadTriangleIndexBuffer,u.tileExtentSegments)}})(e,0,a,o);break;case"custom":(function(u,m,g){const y=u.context,v=g.implementation;if(u.renderPass==="offscreen"){const S=v.prerender;S&&(u.setCustomLayerDefaults(),y.setColorMode(u.colorModeForRenderPass()),S.call(v,y.gl,u.transform.customLayerMatrix()),y.setDirty(),u.setBaseState())}else if(u.renderPass==="translucent"){u.setCustomLayerDefaults(),y.setColorMode(u.colorModeForRenderPass()),y.setStencilMode(ft.disabled);const S=v.renderingMode==="3d"?new Ze(u.context.gl.LEQUAL,Ze.ReadWrite,u.depthRangeFor3D):u.depthModeForSublayer(0,Ze.ReadOnly);y.setDepthMode(S),v.render(y.gl,u.transform.customLayerMatrix(),{farZ:u.transform.farZ,nearZ:u.transform.nearZ,fov:u.transform._fov,modelViewProjectionMatrix:u.transform.modelViewProjectionMatrix,projectionMatrix:u.transform.projectionMatrix}),y.setDirty(),u.setBaseState(),y.bindFramebuffer.set(null)}})(e,0,a)}}translatePosMatrix(e,n,a,o,u){if(!a[0]&&!a[1])return e;const m=u?o==="map"?this.transform.angle:0:o==="viewport"?-this.transform.angle:0;if(m){const v=Math.sin(m),S=Math.cos(m);a=[a[0]*S-a[1]*v,a[0]*v+a[1]*S]}const g=[u?a[0]:Ve(n,a[0],this.transform.zoom),u?a[1]:Ve(n,a[1],this.transform.zoom),0],y=new Float32Array(16);return p.J(y,e,g),y}saveTileTexture(e){const n=this._tileTextures[e.size[0]];n?n.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const n=this._tileTextures[e];return n&&n.length>0?n.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const n=this.imageManager.getPattern(e.from.toString()),a=this.imageManager.getPattern(e.to.toString());return!n||!a}useProgram(e,n){this.cache=this.cache||{};const a=e+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[a]||(this.cache[a]=new ks(this.context,Ar[e],n,Bs[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[a]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new tt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:n}=this.context.gl;return this.width!==e||this.height!==n}}class $a{constructor(e,n){this.points=e,this.planes=n}static fromInvProjectionMatrix(e,n,a){const o=Math.pow(2,a),u=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(g=>{const y=1/(g=p.af([],g,e))[3]/n*o;return p.b0(g,g,[y,y,1/g[3],y])}),m=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(g=>{const y=function(C,D){var R=D[0],N=D[1],B=D[2],U=R*R+N*N+B*B;return U>0&&(U=1/Math.sqrt(U)),C[0]=D[0]*U,C[1]=D[1]*U,C[2]=D[2]*U,C}([],function(C,D,R){var N=D[0],B=D[1],U=D[2],Z=R[0],F=R[1],W=R[2];return C[0]=B*W-U*F,C[1]=U*Z-N*W,C[2]=N*F-B*Z,C}([],xi([],u[g[0]],u[g[1]]),xi([],u[g[2]],u[g[1]]))),v=-((S=y)[0]*(T=u[g[1]])[0]+S[1]*T[1]+S[2]*T[2]);var S,T;return y.concat(v)});return new $a(u,m)}}class Xs{constructor(e,n){this.min=e,this.max=n,this.center=function(a,o,u){return a[0]=.5*o[0],a[1]=.5*o[1],a[2]=.5*o[2],a}([],function(a,o,u){return a[0]=o[0]+u[0],a[1]=o[1]+u[1],a[2]=o[2]+u[2],a}([],this.min,this.max))}quadrant(e){const n=[e%2==0,e<2],a=Ai(this.min),o=Ai(this.max);for(let u=0;u=0&&m++;if(m===0)return 0;m!==n.length&&(a=!1)}if(a)return 2;for(let o=0;o<3;o++){let u=Number.MAX_VALUE,m=-Number.MAX_VALUE;for(let g=0;gthis.max[o]-this.min[o])return 0}return 1}}class is{constructor(e=0,n=0,a=0,o=0){if(isNaN(e)||e<0||isNaN(n)||n<0||isNaN(a)||a<0||isNaN(o)||o<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=n,this.left=a,this.right=o}interpolate(e,n,a){return n.top!=null&&e.top!=null&&(this.top=p.y.number(e.top,n.top,a)),n.bottom!=null&&e.bottom!=null&&(this.bottom=p.y.number(e.bottom,n.bottom,a)),n.left!=null&&e.left!=null&&(this.left=p.y.number(e.left,n.left,a)),n.right!=null&&e.right!=null&&(this.right=p.y.number(e.right,n.right,a)),this}getCenter(e,n){const a=p.ac((this.left+e-this.right)/2,0,e),o=p.ac((this.top+n-this.bottom)/2,0,n);return new p.P(a,o)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new is(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const el=85.051129;class rs{constructor(e,n,a,o,u){this.tileSize=512,this._renderWorldCopies=u===void 0||!!u,this._minZoom=e||0,this._maxZoom=n||22,this._minPitch=a??0,this._maxPitch=o??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new p.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new is,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const e=new rs(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.minElevationForCurrentTile=e.minElevationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new p.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const n=-p.b2(e,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=function(){var a=new p.A(4);return p.A!=Float32Array&&(a[1]=0,a[2]=0),a[0]=1,a[3]=1,a}(),function(a,o,u){var m=o[0],g=o[1],y=o[2],v=o[3],S=Math.sin(u),T=Math.cos(u);a[0]=m*T+y*S,a[1]=g*T+v*S,a[2]=m*-S+y*T,a[3]=g*-S+v*T}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const n=p.ac(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){const n=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,n,a){this._unmodified=!1,this._edgeInsets.interpolate(e,n,a),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const n=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(e){const n=[new p.b3(0,e)];if(this._renderWorldCopies){const a=this.pointCoordinate(new p.P(0,0)),o=this.pointCoordinate(new p.P(this.width,0)),u=this.pointCoordinate(new p.P(this.width,this.height)),m=this.pointCoordinate(new p.P(0,this.height)),g=Math.floor(Math.min(a.x,o.x,u.x,m.x)),y=Math.floor(Math.max(a.x,o.x,u.x,m.x)),v=1;for(let S=g-v;S<=y+v;S++)S!==0&&n.push(new p.b3(S,e))}return n}coveringTiles(e){var n,a;let o=this.coveringZoomLevel(e);const u=o;if(e.minzoom!==void 0&&oe.maxzoom&&(o=e.maxzoom);const m=this.pointCoordinate(this.getCameraPoint()),g=p.Z.fromLngLat(this.center),y=Math.pow(2,o),v=[y*m.x,y*m.y,0],S=[y*g.x,y*g.y,0],T=$a.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,o);let C=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(C=o);const D=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,R=F=>({aabb:new Xs([F*y,0,0],[(F+1)*y,y,0]),zoom:0,x:0,y:0,wrap:F,fullyVisible:!1}),N=[],B=[],U=o,Z=e.reparseOverscaled?u:o;if(this._renderWorldCopies)for(let F=1;F<=3;F++)N.push(R(-F)),N.push(R(F));for(N.push(R(0));N.length>0;){const F=N.pop(),W=F.x,Y=F.y;let ee=F.fullyVisible;if(!ee){const ue=F.aabb.intersects(T);if(ue===0)continue;ee=ue===2}const oe=e.terrain?v:S,he=F.aabb.distanceX(oe),we=F.aabb.distanceY(oe),Te=Math.max(Math.abs(he),Math.abs(we));if(F.zoom===U||Te>D+(1<=C){const ue=U-F.zoom,de=v[0]-.5-(W<>1),Fe=F.zoom+1;let me=F.aabb.quadrant(ue);if(e.terrain){const xe=new p.S(Fe,F.wrap,Fe,de,Ae),Re=e.terrain.getMinMaxElevation(xe),lt=(n=Re.minElevation)!==null&&n!==void 0?n:this.elevation,je=(a=Re.maxElevation)!==null&&a!==void 0?a:this.elevation;me=new Xs([me.min[0],me.min[1],lt],[me.max[0],me.max[1],je])}N.push({aabb:me,zoom:Fe,x:de,y:Ae,wrap:F.wrap,fullyVisible:ee})}}return B.sort((F,W)=>F.distanceSq-W.distanceSq).map(F=>F.tileID)}resize(e,n){this.width=e,this.height=n,this.pixelsToGLUnits=[2/e,-2/n],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){const n=p.ac(e.lat,-85.051129,el);return new p.P(p.O(e.lng)*this.worldSize,p.Q(n)*this.worldSize)}unproject(e){return new p.Z(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(e){const n=this.elevation,a=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,o=this.pointLocation(this.centerPoint,e),u=e.getElevationForLngLatZoom(o,this.tileZoom);if(!(this.elevation-u))return;const m=a+n-u,g=Math.cos(this._pitch)*this.cameraToCenterDistance/m/p.b4(1,o.lat),y=this.scaleZoom(g/this.tileSize);this._elevation=u,this._center=o,this.zoom=y}setLocationAtPoint(e,n){const a=this.pointCoordinate(n),o=this.pointCoordinate(this.centerPoint),u=this.locationCoordinate(e),m=new p.Z(u.x-(a.x-o.x),u.y-(a.y-o.y));this.center=this.coordinateLocation(m),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,n){return n?this.coordinatePoint(this.locationCoordinate(e),n.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,n){return this.coordinateLocation(this.pointCoordinate(e,n))}locationCoordinate(e){return p.Z.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,n){if(n){const C=n.pointCoordinate(e);if(C!=null)return C}const a=[e.x,e.y,0,1],o=[e.x,e.y,1,1];p.af(a,a,this.pixelMatrixInverse),p.af(o,o,this.pixelMatrixInverse);const u=a[3],m=o[3],g=a[1]/u,y=o[1]/m,v=a[2]/u,S=o[2]/m,T=v===S?0:(0-v)/(S-v);return new p.Z(p.y.number(a[0]/u,o[0]/m,T)/this.worldSize,p.y.number(g,y,T)/this.worldSize)}coordinatePoint(e,n=0,a=this.pixelMatrix){const o=[e.x*this.worldSize,e.y*this.worldSize,n,1];return p.af(o,o,a),new p.P(o[0]/o[3],o[1]/o[3])}getBounds(){const e=Math.max(0,this.height/2-this.getHorizon());return new ie().extend(this.pointLocation(new p.P(0,e))).extend(this.pointLocation(new p.P(this.width,e))).extend(this.pointLocation(new p.P(this.width,this.height))).extend(this.pointLocation(new p.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new ie([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,el])}calculateTileMatrix(e){const n=e.canonical,a=this.worldSize/this.zoomScale(n.z),o=n.x+Math.pow(2,n.z)*e.wrap,u=p.an(new Float64Array(16));return p.J(u,u,[o*a,n.y*a,0]),p.K(u,u,[a/p.X,a/p.X,1]),u}calculatePosMatrix(e,n=!1){const a=e.key,o=n?this._alignedPosMatrixCache:this._posMatrixCache;if(o[a])return o[a];const u=this.calculateTileMatrix(e);return p.L(u,n?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,u),o[a]=new Float32Array(u),o[a]}calculateFogMatrix(e){const n=e.key,a=this._fogMatrixCache;if(a[n])return a[n];const o=this.calculateTileMatrix(e);return p.L(o,this.fogMatrix,o),a[n]=new Float32Array(o),a[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,n){n=p.ac(+n,this.minZoom,this.maxZoom);const a={center:new p.N(e.lng,e.lat),zoom:n};let o=this.lngRange;if(!this._renderWorldCopies&&o===null){const F=179.9999999999;o=[-F,F]}const u=this.tileSize*this.zoomScale(a.zoom);let m=0,g=u,y=0,v=u,S=0,T=0;const{x:C,y:D}=this.size;if(this.latRange){const F=this.latRange;m=p.Q(F[1])*u,g=p.Q(F[0])*u,g-mg&&(U=g-F)}if(o){const F=(y+v)/2;let W=R;this._renderWorldCopies&&(W=p.b2(R,F-u/2,F+u/2));const Y=C/2;W-Yv&&(B=v-Y)}if(B!==void 0||U!==void 0){const F=new p.P(B??R,U??N);a.center=this.unproject.call({worldSize:u},F).wrap()}return a}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const e=this._unmodified,{center:n,zoom:a}=this.getConstrained(this.center,this.zoom);this.center=n,this.zoom=a,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;const e=this.centerOffset,n=this.point.x,a=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=p.b4(1,this.center.lat)*this.worldSize;let o=p.an(new Float64Array(16));p.K(o,o,[this.width/2,-this.height/2,1]),p.J(o,o,[1,-1,0]),this.labelPlaneMatrix=o,o=p.an(new Float64Array(16)),p.K(o,o,[1,-1,1]),p.J(o,o,[-1,-1,0]),p.K(o,o,[2/this.width,2/this.height,1]),this.glCoordMatrix=o;const u=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),m=Math.min(this.elevation,this.minElevationForCurrentTile),g=u-m*this._pixelPerMeter/Math.cos(this._pitch),y=m<0?g:u,v=Math.PI/2+this._pitch,S=this._fov*(.5+e.y/this.height),T=Math.sin(S)*y/Math.sin(p.ac(Math.PI-v-S,.01,Math.PI-.01)),C=this.getHorizon(),D=2*Math.atan(C/this.cameraToCenterDistance)*(.5+e.y/(2*C)),R=Math.sin(D)*y/Math.sin(p.ac(Math.PI-v-D,.01,Math.PI-.01)),N=Math.min(T,R);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*N+y),this.nearZ=this.height/50,o=new Float64Array(16),p.b5(o,this._fov,this.width/this.height,this.nearZ,this.farZ),o[8]=2*-e.x/this.width,o[9]=2*e.y/this.height,this.projectionMatrix=p.ae(o),p.K(o,o,[1,-1,1]),p.J(o,o,[0,0,-this.cameraToCenterDistance]),p.b6(o,o,this._pitch),p.ad(o,o,this.angle),p.J(o,o,[-n,-a,0]),this.mercatorMatrix=p.K([],o,[this.worldSize,this.worldSize,this.worldSize]),p.K(o,o,[1,1,this._pixelPerMeter]),this.pixelMatrix=p.L(new Float64Array(16),this.labelPlaneMatrix,o),p.J(o,o,[0,0,-this.elevation]),this.modelViewProjectionMatrix=o,this.invModelViewProjectionMatrix=p.as([],o),this.fogMatrix=new Float64Array(16),p.b5(this.fogMatrix,this._fov,this.width/this.height,u,this.farZ),this.fogMatrix[8]=2*-e.x/this.width,this.fogMatrix[9]=2*e.y/this.height,p.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),p.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),p.b6(this.fogMatrix,this.fogMatrix,this._pitch),p.ad(this.fogMatrix,this.fogMatrix,this.angle),p.J(this.fogMatrix,this.fogMatrix,[-n,-a,0]),p.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),p.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=p.L(new Float64Array(16),this.labelPlaneMatrix,o);const B=this.width%2/2,U=this.height%2/2,Z=Math.cos(this.angle),F=Math.sin(this.angle),W=n-Math.round(n)+Z*B+F*U,Y=a-Math.round(a)+Z*U+F*B,ee=new Float64Array(o);if(p.J(ee,ee,[W>.5?W-1:W,Y>.5?Y-1:Y,0]),this.alignedModelViewProjectionMatrix=ee,o=p.as(new Float64Array(16),this.pixelMatrix),!o)throw new Error("failed to invert matrix");this.pixelMatrixInverse=o,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const e=this.pointCoordinate(new p.P(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return p.af(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new p.P(0,e))}getCameraQueryGeometry(e){const n=this.getCameraPoint();if(e.length===1)return[e[0],n];{let a=n.x,o=n.y,u=n.x,m=n.y;for(const g of e)a=Math.min(a,g.x),o=Math.min(o,g.y),u=Math.max(u,g.x),m=Math.max(m,g.y);return[new p.P(a,o),new p.P(u,o),new p.P(u,m),new p.P(a,m),new p.P(a,o)]}}lngLatToCameraDepth(e,n){const a=this.locationCoordinate(e),o=[a.x*this.worldSize,a.y*this.worldSize,n,1];return p.af(o,o,this.modelViewProjectionMatrix),o[2]/o[3]}}function ns(h,e){let n,a=!1,o=null,u=null;const m=()=>{o=null,a&&(h.apply(u,n),o=setTimeout(m,e),a=!1)};return(...g)=>(a=!0,u=this,n=g,o||m(),o)}class ss{constructor(e){this._getCurrentHash=()=>{const n=window.location.hash.replace("#","");if(this._hashName){let a;return n.split("&").map(o=>o.split("=")).forEach(o=>{o[0]===this._hashName&&(a=o)}),(a&&a[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{const n=this._getCurrentHash();if(n.length>=3&&!n.some(a=>isNaN(a))){const a=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:a,pitch:+(n[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const n=window.location.href.replace(/(#.+)?$/,this.getHashString());window.history.replaceState(window.history.state,null,n)},this._removeHash=()=>{const n=this._getCurrentHash();if(n.length===0)return;const a=n.join("/");let o=a;o.split("&").length>0&&(o=o.split("&")[0]),this._hashName&&(o=`${this._hashName}=${a}`);let u=window.location.hash.replace(o,"");u.startsWith("#&")?u=u.slice(0,1)+u.slice(2):u==="#"&&(u="");let m=window.location.href.replace(/(#.+)?$/,u);m=m.replace("&&","&"),window.history.replaceState(window.history.state,null,m)},this._updateHash=ns(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const n=this._map.getCenter(),a=Math.round(100*this._map.getZoom())/100,o=Math.ceil((a*Math.LN2+Math.log(512/360/.5))/Math.LN10),u=Math.pow(10,o),m=Math.round(n.lng*u)/u,g=Math.round(n.lat*u)/u,y=this._map.getBearing(),v=this._map.getPitch();let S="";if(S+=e?`/${m}/${g}/${a}`:`${a}/${g}/${m}`,(y||v)&&(S+="/"+Math.round(10*y)/10),v&&(S+=`/${Math.round(v)}`),this._hashName){const T=this._hashName;let C=!1;const D=window.location.hash.slice(1).split("&").map(R=>{const N=R.split("=")[0];return N===T?(C=!0,`${N}=${S}`):R}).filter(R=>R);return C||D.push(`${T}=${S}`),`#${D.join("&")}`}return`#${S}`}}const yn={linearity:.3,easing:p.b7(0,0,.3,1)},qa=p.e({deceleration:2500,maxSpeed:1400},yn),tl=p.e({deceleration:20,maxSpeed:1400},yn),Ws=p.e({deceleration:1e3,maxSpeed:360},yn),Ks=p.e({deceleration:1e3,maxSpeed:90},yn);class Za{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:_e.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,n=_e.now();for(;e.length>0&&n-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new p.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:u}of this._inertiaBuffer)n.zoom+=u.zoomDelta||0,n.bearing+=u.bearingDelta||0,n.pitch+=u.pitchDelta||0,u.panDelta&&n.pan._add(u.panDelta),u.around&&(n.around=u.around),u.pinchAround&&(n.pinchAround=u.pinchAround);const a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,o={};if(n.pan.mag()){const u=xn(n.pan.mag(),a,p.e({},qa,e||{}));o.offset=n.pan.mult(u.amount/n.pan.mag()),o.center=this._map.transform.center,Js(o,u)}if(n.zoom){const u=xn(n.zoom,a,tl);o.zoom=this._map.transform.zoom+u.amount,Js(o,u)}if(n.bearing){const u=xn(n.bearing,a,Ws);o.bearing=this._map.transform.bearing+p.ac(u.amount,-179,179),Js(o,u)}if(n.pitch){const u=xn(n.pitch,a,Ks);o.pitch=this._map.transform.pitch+u.amount,Js(o,u)}if(o.zoom||o.bearing){const u=n.pinchAround===void 0?n.around:n.pinchAround;o.around=u?this._map.unproject(u):this._map.getCenter()}return this.clear(),p.e(o,{noMoveStart:!0})}}function Js(h,e){(!h.duration||h.durationn.unproject(y)),g=u.reduce((y,v,S,T)=>y.add(v.div(T.length)),new p.P(0,0));super(e,{points:u,point:g,lngLats:m,lngLat:n.unproject(g),originalEvent:a}),this._defaultPrevented=!1}}class as extends p.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,a){super(e,{originalEvent:a}),this._defaultPrevented=!1}}class Ga{constructor(e,n){this._map=e,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new as(e.type,this._map,e))}mousedown(e,n){return this._mousedownPos=n,this._firePreventable(new mi(e.type,this._map,e))}mouseup(e){this._map.fire(new mi(e.type,this._map,e))}click(e,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new mi(e.type,this._map,e))}dblclick(e){return this._firePreventable(new mi(e.type,this._map,e))}mouseover(e){this._map.fire(new mi(e.type,this._map,e))}mouseout(e){this._map.fire(new mi(e.type,this._map,e))}touchstart(e){return this._firePreventable(new vn(e.type,this._map,e))}touchmove(e){this._map.fire(new vn(e.type,this._map,e))}touchend(e){this._map.fire(new vn(e.type,this._map,e))}touchcancel(e){this._map.fire(new vn(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class il{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new mi(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new mi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new mi(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class bn{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.pointLocation(p.P.convert(e),this._map.terrain)}}class os{constructor(e,n){this._map=e,this._tr=new bn(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,n){this.isEnabled()&&e.shiftKey&&e.button===0&&(se.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(e,n){if(!this._active)return;const a=n;if(this._lastPos.equals(a)||!this._box&&a.dist(this._startPos)u.fitScreenCoordinates(a,o,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(se.remove(this._box),this._box=null),se.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,n){return this._map.fire(new p.k(e,{originalEvent:n}))}}function ls(h,e){if(h.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${h.length}, points ${e.length}`);const n={};for(let a=0;athis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),a.length===this.numTouches&&(this.centroid=function(o){const u=new p.P(0,0);for(const m of o)u._add(m);return u.div(o.length)}(n),this.touches=ls(a,n)))}touchmove(e,n,a){if(this.aborted||!this.centroid)return;const o=ls(a,n);for(const u in this.touches){const m=o[u];(!m||m.dist(this.touches[u])>30)&&(this.aborted=!0)}}touchend(e,n,a){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),a.length===0){const o=!this.aborted&&this.centroid;if(this.reset(),o)return o}}}class Ys{constructor(e){this.singleTap=new Ql(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,n,a){this.singleTap.touchstart(e,n,a)}touchmove(e,n,a){this.singleTap.touchmove(e,n,a)}touchend(e,n,a){const o=this.singleTap.touchend(e,n,a);if(o){const u=e.timeStamp-this.lastTime<500,m=!this.lastTap||this.lastTap.dist(o)<30;if(u&&m||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=o,this.count===this.numTaps)return this.reset(),o}}}class vt{constructor(e){this._tr=new bn(e),this._zoomIn=new Ys({numTouches:1,numTaps:2}),this._zoomOut=new Ys({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,n,a){this._zoomIn.touchstart(e,n,a),this._zoomOut.touchstart(e,n,a)}touchmove(e,n,a){this._zoomIn.touchmove(e,n,a),this._zoomOut.touchmove(e,n,a)}touchend(e,n,a){const o=this._zoomIn.touchend(e,n,a),u=this._zoomOut.touchend(e,n,a),m=this._tr;return o?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:m.zoom+1,around:m.unproject(o)},{originalEvent:e})}):u?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:m.zoom-1,around:m.unproject(u)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class zi{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const n=this._moveFunction(...e);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(e,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,n){if(!this.isEnabled())return;const a=this._lastPoint;if(!a)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const o=n.length?n[0]:n;return!this._moved&&o.dist(a){h.mousedown=h.dragStart,h.mousemoveWindow=h.dragMove,h.mouseup=h.dragEnd,h.contextmenu=e=>{e.preventDefault()}},Yr=({enable:h,clickTolerance:e,bearingDegreesPerPixelMoved:n=.8})=>{const a=new cs({checkCorrectEvent:o=>se.mouseButton(o)===0&&o.ctrlKey||se.mouseButton(o)===2});return new zi({clickTolerance:e,move:(o,u)=>({bearingDelta:(u.x-o.x)*n}),moveStateManager:a,enable:h,assignEvents:ea})},wn=({enable:h,clickTolerance:e,pitchDegreesPerPixelMoved:n=-.5})=>{const a=new cs({checkCorrectEvent:o=>se.mouseButton(o)===0&&o.ctrlKey||se.mouseButton(o)===2});return new zi({clickTolerance:e,move:(o,u)=>({pitchDelta:(u.y-o.y)*n}),moveStateManager:a,enable:h,assignEvents:ea})};class Ha{constructor(e,n){this._clickTolerance=e.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new p.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,n,a){return this._calculateTransform(e,n,a)}touchmove(e,n,a){if(this._active){if(!this._shouldBePrevented(a.length))return e.preventDefault(),this._calculateTransform(e,n,a);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,n,a){this._calculateTransform(e,n,a),this._active&&this._shouldBePrevented(a.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,n,a){a.length>0&&(this._active=!0);const o=ls(a,n),u=new p.P(0,0),m=new p.P(0,0);let g=0;for(const v in o){const S=o[v],T=this._touches[v];T&&(u._add(S),m._add(S.sub(T)),g++,o[v]=S)}if(this._touches=o,this._shouldBePrevented(g)||!m.mag())return;const y=m.div(g);return this._sum._add(y),this._sum.mag()Math.abs(h.x)}class Ja extends ta{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,n,a){super.touchstart(e,n,a),this._currentTouchCount=a.length}_start(e){this._lastPoints=e,ia(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,n,a){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const o=e[0].sub(this._lastPoints[0]),u=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(o,u,a.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(o.y+u.y)/2*-.5}):void 0}gestureBeginsVertically(e,n,a){if(this._valid!==void 0)return this._valid;const o=e.mag()>=2,u=n.mag()>=2;if(!o&&!u)return;if(!o||!u)return this._firstMove===void 0&&(this._firstMove=a),a-this._firstMove<100&&void 0;const m=e.y>0==n.y>0;return ia(e)&&ia(n)&&m}}const rl={panStep:100,bearingStep:15,pitchStep:10};class Ya{constructor(e){this._tr=new bn(e);const n=rl;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let n=0,a=0,o=0,u=0,m=0;switch(e.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:e.shiftKey?a=-1:(e.preventDefault(),u=-1);break;case 39:e.shiftKey?a=1:(e.preventDefault(),u=1);break;case 38:e.shiftKey?o=1:(e.preventDefault(),m=-1);break;case 40:e.shiftKey?o=-1:(e.preventDefault(),m=1);break;default:return}return this._rotationDisabled&&(a=0,o=0),{cameraAnimation:g=>{const y=this._tr;g.easeTo({duration:300,easeId:"keyboardHandler",easing:nl,zoom:n?Math.round(y.zoom)+n*(e.shiftKey?2:1):y.zoom,bearing:y.bearing+a*this._bearingStep,pitch:y.pitch+o*this._pitchStep,offset:[-u*this._panStep,-m*this._panStep],center:y.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function nl(h){return h*(2-h)}const Qa=4.000244140625;class eo{constructor(e,n){this._onTimeout=a=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)},this._map=e,this._tr=new bn(e),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let n=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const a=_e.now(),o=a-(this._lastWheelEventTime||0);this._lastWheelEventTime=a,n!==0&&n%Qa==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":o>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(o*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),e.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=e,this._delta-=n,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const n=se.mousePos(this._map.getCanvas(),e),a=this._tr;this._around=n.y>a.transform.height/2-a.transform.getHorizon()?p.N.convert(this._aroundCenter?a.center:a.unproject(n)):p.N.convert(a.center),this._aroundPoint=a.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(this._delta!==0){const y=this._type==="wheel"&&Math.abs(this._delta)>Qa?this._wheelZoomRate:this._defaultZoomRate;let v=2/(1+Math.exp(-Math.abs(this._delta*y)));this._delta<0&&v!==0&&(v=1/v);const S=typeof this._targetZoom=="number"?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(S*v))),this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom=="number"?this._targetZoom:e.zoom,a=this._startZoom,o=this._easing;let u,m=!1;const g=_e.now()-this._lastWheelEventTime;if(this._type==="wheel"&&a&&o&&g){const y=Math.min(g/200,1),v=o(y);u=p.y.number(a,n,v),y<1?this._frameId||(this._frameId=!0):m=!0}else u=n,m=!0;return this._active=!0,m&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!m,zoomDelta:u-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let n=p.b8;if(this._prevEase){const a=this._prevEase,o=(_e.now()-a.start)/a.duration,u=a.easing(o+.01)-a.easing(o),m=.27/Math.sqrt(u*u+1e-4)*.01,g=Math.sqrt(.0729-m*m);n=p.b7(m,g,.25,1)}return this._prevEase={start:_e.now(),duration:e,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Tn{constructor(e,n){this._clickZoom=e,this._tapZoom=n}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 sl{constructor(e){this._tr=new bn(e),this.reset()}reset(){this._active=!1}dblclick(e,n){return e.preventDefault(),{cameraAnimation:a=>{a.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ei{constructor(){this._tap=new Ys({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,n,a){if(!this._swipePoint)if(this._tapTime){const o=n[0],u=e.timeStamp-this._tapTime<500,m=this._tapPoint.dist(o)<30;u&&m?a.length>0&&(this._swipePoint=o,this._swipeTouch=a[0].identifier):this.reset()}else this._tap.touchstart(e,n,a)}touchmove(e,n,a){if(this._tapTime){if(this._swipePoint){if(a[0].identifier!==this._swipeTouch)return;const o=n[0],u=o.y-this._swipePoint.y;return this._swipePoint=o,e.preventDefault(),this._active=!0,{zoomDelta:u/128}}}else this._tap.touchmove(e,n,a)}touchend(e,n,a){if(this._tapTime)this._swipePoint&&a.length===0&&this.reset();else{const o=this._tap.touchend(e,n,a);o&&(this._tapTime=e.timeStamp,this._tapPoint=o)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Di{constructor(e,n,a){this._el=e,this._mousePan=n,this._touchPan=a}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class to{constructor(e,n,a){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=n,this._mousePitch=a}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Li{constructor(e,n,a,o){this._el=e,this._touchZoom=n,this._touchRotate=a,this._tapDragZoom=o,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Qr{constructor(e,n){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=e,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=se.create("div","maplibregl-cooperative-gesture-screen",e);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const a=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),o=document.createElement("div");o.className="maplibregl-desktop-message",o.textContent=n,this._container.appendChild(o);const u=document.createElement("div");u.className="maplibregl-mobile-message",u.textContent=a,this._container.appendChild(u),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(se.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,n){this._enabled&&(this._map.fire(new p.k("cooperativegestureprevented",{gestureType:e,originalEvent:n})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const ra=h=>h.zoom||h.drag||h.pitch||h.rotate;class ec extends p.k{}function io(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta}class tc{constructor(e,n){this.handleWindowEvent=o=>{this.handleEvent(o,`${o.type}Window`)},this.handleEvent=(o,u)=>{if(o.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const m=o.type==="renderFrame"?void 0:o,g={needsRenderFrame:!1},y={},v={},S=o.touches,T=S?this._getMapTouches(S):void 0,C=T?se.touchPos(this._map.getCanvas(),T):se.mousePos(this._map.getCanvas(),o);for(const{handlerName:N,handler:B,allowed:U}of this._handlers){if(!B.isEnabled())continue;let Z;this._blockedByActive(v,U,N)?B.reset():B[u||o.type]&&(Z=B[u||o.type](o,C,T),this.mergeHandlerResult(g,y,Z,N,m),Z&&Z.needsRenderFrame&&this._triggerRenderFrame()),(Z||B.isActive())&&(v[N]=B)}const D={};for(const N in this._previousActiveHandlers)v[N]||(D[N]=m);this._previousActiveHandlers=v,(Object.keys(D).length||io(g))&&(this._changes.push([g,y,D]),this._triggerRenderFrame()),(Object.keys(v).length||io(g))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:R}=g;R&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],R(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Za(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);const a=this._el;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]];for(const[o,u,m]of this._listeners)se.addEventListener(o,u,o===document?this.handleWindowEvent:this.handleEvent,m)}destroy(){for(const[e,n,a]of this._listeners)se.removeEventListener(e,n,e===document?this.handleWindowEvent:this.handleEvent,a)}_addDefaultHandlers(e){const n=this._map,a=n.getCanvasContainer();this._add("mapEvent",new Ga(n,e));const o=n.boxZoom=new os(n,e);this._add("boxZoom",o),e.interactive&&e.boxZoom&&o.enable();const u=n.cooperativeGestures=new Qr(n,e.cooperativeGestures);this._add("cooperativeGestures",u),e.cooperativeGestures&&u.enable();const m=new vt(n),g=new sl(n);n.doubleClickZoom=new Tn(g,m),this._add("tapZoom",m),this._add("clickZoom",g),e.interactive&&e.doubleClickZoom&&n.doubleClickZoom.enable();const y=new Ei;this._add("tapDragZoom",y);const v=n.touchPitch=new Ja(n);this._add("touchPitch",v),e.interactive&&e.touchPitch&&n.touchPitch.enable(e.touchPitch);const S=Yr(e),T=wn(e);n.dragRotate=new to(e,S,T),this._add("mouseRotate",S,["mousePitch"]),this._add("mousePitch",T,["mouseRotate"]),e.interactive&&e.dragRotate&&n.dragRotate.enable();const C=(({enable:Z,clickTolerance:F})=>{const W=new cs({checkCorrectEvent:Y=>se.mouseButton(Y)===0&&!Y.ctrlKey});return new zi({clickTolerance:F,move:(Y,ee)=>({around:ee,panDelta:ee.sub(Y)}),activateOnStart:!0,moveStateManager:W,enable:Z,assignEvents:ea})})(e),D=new Ha(e,n);n.dragPan=new Di(a,C,D),this._add("mousePan",C),this._add("touchPan",D,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&n.dragPan.enable(e.dragPan);const R=new Cr,N=new Wa;n.touchZoomRotate=new Li(a,N,R,y),this._add("touchRotate",R,["touchPan","touchZoom"]),this._add("touchZoom",N,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&n.touchZoomRotate.enable(e.touchZoomRotate);const B=n.scrollZoom=new eo(n,()=>this._triggerRenderFrame());this._add("scrollZoom",B,["mousePan"]),e.interactive&&e.scrollZoom&&n.scrollZoom.enable(e.scrollZoom);const U=n.keyboard=new Ya(n);this._add("keyboard",U),e.interactive&&e.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new il(n))}_add(e,n,a){this._handlers.push({handlerName:e,handler:n,allowed:a}),this._handlersById[e]=n}stop(e){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!ra(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,n,a){for(const o in e)if(o!==a&&(!n||n.indexOf(o)<0))return!0;return!1}_getMapTouches(e){const n=[];for(const a of e)this._el.contains(a.target)&&n.push(a);return n}mergeHandlerResult(e,n,a,o,u){if(!a)return;p.e(e,a);const m={handlerName:o,originalEvent:a.originalEvent||u};a.zoomDelta!==void 0&&(n.zoom=m),a.panDelta!==void 0&&(n.drag=m),a.pitchDelta!==void 0&&(n.pitch=m),a.bearingDelta!==void 0&&(n.rotate=m)}_applyChanges(){const e={},n={},a={};for(const[o,u,m]of this._changes)o.panDelta&&(e.panDelta=(e.panDelta||new p.P(0,0))._add(o.panDelta)),o.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+o.zoomDelta),o.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+o.bearingDelta),o.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+o.pitchDelta),o.around!==void 0&&(e.around=o.around),o.pinchAround!==void 0&&(e.pinchAround=o.pinchAround),o.noInertia&&(e.noInertia=o.noInertia),p.e(n,u),p.e(a,m);this._updateMapTransform(e,n,a),this._changes=[]}_updateMapTransform(e,n,a){const o=this._map,u=o._getTransformForUpdate(),m=o.terrain;if(!(io(e)||m&&this._terrainMovement))return this._fireEvents(n,a,!0);let{panDelta:g,zoomDelta:y,bearingDelta:v,pitchDelta:S,around:T,pinchAround:C}=e;C!==void 0&&(T=C),o._stop(!0),T=T||o.transform.centerPoint;const D=u.pointLocation(g?T.sub(g):T);v&&(u.bearing+=v),S&&(u.pitch+=S),y&&(u.zoom+=y),m?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?u.center=u.pointLocation(u.centerPoint.sub(g)):u.setLocationAtPoint(D,T):(this._terrainMovement=!0,this._map._elevationFreeze=!0,u.setLocationAtPoint(D,T)):u.setLocationAtPoint(D,T),o._applyUpdatedTransform(u),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(n,a,!0)}_fireEvents(e,n,a){const o=ra(this._eventsInProgress),u=ra(e),m={};for(const T in e){const{originalEvent:C}=e[T];this._eventsInProgress[T]||(m[`${T}start`]=C),this._eventsInProgress[T]=e[T]}!o&&u&&this._fireEvent("movestart",u.originalEvent);for(const T in m)this._fireEvent(T,m[T]);u&&this._fireEvent("move",u.originalEvent);for(const T in e){const{originalEvent:C}=e[T];this._fireEvent(T,C)}const g={};let y;for(const T in this._eventsInProgress){const{handlerName:C,originalEvent:D}=this._eventsInProgress[T];this._handlersById[C].isActive()||(delete this._eventsInProgress[T],y=n[C]||D,g[`${T}end`]=y)}for(const T in g)this._fireEvent(T,g[T]);const v=ra(this._eventsInProgress),S=(o||u)&&!v;if(S&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const T=this._map._getTransformForUpdate();T.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(T)}if(a&&S){this._updatingCamera=!0;const T=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),C=D=>D!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new ec("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class al extends p.E{constructor(e,n){super(),this._renderFrameCallback=()=>{const a=Math.min((_e.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(a)),a<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=n.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new p.N(this.transform.center.lng,this.transform.center.lat)}setCenter(e,n){return this.jumpTo({center:e},n)}panBy(e,n,a){return e=p.P.convert(e).mult(-1),this.panTo(this.transform.center,p.e({offset:e},n),a)}panTo(e,n,a){return this.easeTo(p.e({center:e},n),a)}getZoom(){return this.transform.zoom}setZoom(e,n){return this.jumpTo({zoom:e},n),this}zoomTo(e,n,a){return this.easeTo(p.e({zoom:e},n),a)}zoomIn(e,n){return this.zoomTo(this.getZoom()+1,e,n),this}zoomOut(e,n){return this.zoomTo(this.getZoom()-1,e,n),this}getBearing(){return this.transform.bearing}setBearing(e,n){return this.jumpTo({bearing:e},n),this}getPadding(){return this.transform.padding}setPadding(e,n){return this.jumpTo({padding:e},n),this}rotateTo(e,n,a){return this.easeTo(p.e({bearing:e},n),a)}resetNorth(e,n){return this.rotateTo(0,p.e({duration:1e3},e),n),this}resetNorthPitch(e,n){return this.easeTo(p.e({bearing:0,pitch:0,duration:1e3},e),n),this}snapToNorth(e,n){return Math.abs(this.getBearing()){if(this._zooming&&(o.zoom=p.y.number(u,B,oe)),this._rotating&&(o.bearing=p.y.number(m,v,oe)),this._pitching&&(o.pitch=p.y.number(g,S,oe)),this._padding&&(o.interpolatePadding(y,T,oe),D=o.centerPoint.add(C)),this.terrain&&!e.freezeElevation&&this._updateElevation(oe),W)o.setLocationAtPoint(W,Y);else{const he=o.zoomScale(o.zoom-u),we=B>u?Math.min(2,F):Math.max(.5,F),Te=Math.pow(we,1-oe),ue=o.unproject(U.add(Z.mult(oe*Te)).mult(he));o.setLocationAtPoint(o.renderWorldCopies?ue.wrap():ue,D)}this._applyUpdatedTransform(o),this._fireMoveEvents(n)},oe=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n,oe)},e),this}_prepareEase(e,n,a={}){this._moving=!0,n||a.moving||this.fire(new p.k("movestart",e)),this._zooming&&!a.zooming&&this.fire(new p.k("zoomstart",e)),this._rotating&&!a.rotating&&this.fire(new p.k("rotatestart",e)),this._pitching&&!a.pitching&&this.fire(new p.k("pitchstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&n!==this._elevationTarget){const a=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(a-(n-(a*e+this._elevationStart))/(1-e)),this._elevationTarget=n}this.transform.elevation=p.y.number(this._elevationStart,this._elevationTarget,e)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){const n=e.getCameraPosition(),a=this.terrain.getElevationForLngLatZoom(n.lngLat,e.zoom);if(n.altitudethis._elevateCameraIfInsideTerrain(o)),this.transformCameraUpdate&&n.push(o=>this.transformCameraUpdate(o)),!n.length)return;const a=e.clone();for(const o of n){const u=a.clone(),{center:m,zoom:g,pitch:y,bearing:v,elevation:S}=o(u);m&&(u.center=m),g!==void 0&&(u.zoom=g),y!==void 0&&(u.pitch=y),v!==void 0&&(u.bearing=v),S!==void 0&&(u.elevation=S),a.apply(u)}this.transform.apply(a)}_fireMoveEvents(e){this.fire(new p.k("move",e)),this._zooming&&this.fire(new p.k("zoom",e)),this._rotating&&this.fire(new p.k("rotate",e)),this._pitching&&this.fire(new p.k("pitch",e))}_afterEase(e,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const a=this._zooming,o=this._rotating,u=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,a&&this.fire(new p.k("zoomend",e)),o&&this.fire(new p.k("rotateend",e)),u&&this.fire(new p.k("pitchend",e)),this.fire(new p.k("moveend",e))}flyTo(e,n){var a;if(!e.essential&&_e.prefersReducedMotion){const xe=p.M(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(xe,n)}this.stop(),e=p.e({offset:[0,0],speed:1.2,curve:1.42,easing:p.b8},e);const o=this._getTransformForUpdate(),u=o.zoom,m=o.bearing,g=o.pitch,y=o.padding,v="bearing"in e?this._normalizeBearing(e.bearing,m):m,S="pitch"in e?+e.pitch:g,T="padding"in e?e.padding:o.padding,C=p.P.convert(e.offset);let D=o.centerPoint.add(C);const R=o.pointLocation(D),{center:N,zoom:B}=o.getConstrained(p.N.convert(e.center||R),(a=e.zoom)!==null&&a!==void 0?a:u);this._normalizeCenter(N,o);const U=o.zoomScale(B-u),Z=o.project(R),F=o.project(N).sub(Z);let W=e.curve;const Y=Math.max(o.width,o.height),ee=Y/U,oe=F.mag();if("minZoom"in e){const xe=p.ac(Math.min(e.minZoom,u,B),o.minZoom,o.maxZoom),Re=Y/o.zoomScale(xe-u);W=Math.sqrt(Re/oe*2)}const he=W*W;function we(xe){const Re=(ee*ee-Y*Y+(xe?-1:1)*he*he*oe*oe)/(2*(xe?ee:Y)*he*oe);return Math.log(Math.sqrt(Re*Re+1)-Re)}function Te(xe){return(Math.exp(xe)-Math.exp(-xe))/2}function ue(xe){return(Math.exp(xe)+Math.exp(-xe))/2}const de=we(!1);let Ae=function(xe){return ue(de)/ue(de+W*xe)},Fe=function(xe){return Y*((ue(de)*(Te(Re=de+W*xe)/ue(Re))-Te(de))/he)/oe;var Re},me=(we(!0)-de)/W;if(Math.abs(oe)<1e-6||!isFinite(me)){if(Math.abs(Y-ee)<1e-6)return this.easeTo(e,n);const xe=ee0,Ae=Re=>Math.exp(xe*W*Re)}return e.duration="duration"in e?+e.duration:1e3*me/("screenSpeed"in e?+e.screenSpeed/W:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=m!==v,this._pitching=S!==g,this._padding=!o.isPaddingEqual(T),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(N),this._ease(xe=>{const Re=xe*me,lt=1/Ae(Re);o.zoom=xe===1?B:u+o.scaleZoom(lt),this._rotating&&(o.bearing=p.y.number(m,v,xe)),this._pitching&&(o.pitch=p.y.number(g,S,xe)),this._padding&&(o.interpolatePadding(y,T,xe),D=o.centerPoint.add(C)),this.terrain&&!e.freezeElevation&&this._updateElevation(xe);const je=xe===1?N:o.unproject(Z.add(F.mult(Fe(Re))).mult(lt));o.setLocationAtPoint(o.renderWorldCopies?je.wrap():je,D),this._applyUpdatedTransform(o),this._fireMoveEvents(n)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,n){var a;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const o=this._onEaseEnd;delete this._onEaseEnd,o.call(this,n)}return e||(a=this.handlers)===null||a===void 0||a.stop(!1),this}_ease(e,n,a){a.animate===!1||a.duration===0?(e(1),n()):(this._easeStart=_e.now(),this._easeOptions=a,this._onEaseFrame=e,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,n){e=p.b2(e,-180,180);const a=Math.abs(e-n);return Math.abs(e-360-n)180?-360:a<-180?360:0}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(p.N.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}const Sn={compact:!0,customAttribution:'MapLibre'};class tr{constructor(e=Sn){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=se.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=se.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=se.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){se.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,n){const a=this._map._getUIString(`AttributionControl.${n}`);e.title=a,e.setAttribute("aria-label",a)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(o=>typeof o!="string"?"":o)):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const o=this._map.style.stylesheet;this.styleOwner=o.owner,this.styleId=o.id}const n=this._map.style.sourceCaches;for(const o in n){const u=n[o];if(u.used||u.usedForTerrain){const m=u.getSource();m.attribution&&e.indexOf(m.attribution)<0&&e.push(m.attribution)}}e=e.filter(o=>String(o).trim()),e.sort((o,u)=>o.length-u.length),e=e.filter((o,u)=>{for(let m=u+1;m=0)return!1;return!0});const a=e.join(" | ");a!==this._attribHTML&&(this._attribHTML=a,e.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Se{constructor(e={}){this._updateCompact=()=>{const n=this._container.children;if(n.length){const a=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&a.classList.add("maplibregl-compact"):a.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=se.create("div","maplibregl-ctrl");const n=se.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){se.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class ol{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const n=++this._id;return this._queue.push({callback:e,id:n,cancelled:!1}),n}remove(e){const n=this._currentlyRunning,a=n?this._queue.concat(n):this._queue;for(const o of a)if(o.id===e)return void(o.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const a of n)if(!a.cancelled&&(a.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var ro=p.Y([{name:"a_pos3d",type:"Int16",components:3}]);class ll extends p.E{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,n){this.sourceCache.update(e,n),this._renderableTilesKeys=[];const a={};for(const o of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))a[o.key]=!0,this._renderableTilesKeys.push(o.key),this._tiles[o.key]||(o.posMatrix=new Float64Array(16),p.aP(o.posMatrix,0,p.X,0,p.X,0,1),this._tiles[o.key]=new Sr(o,this.tileSize));for(const o in this._tiles)a[o]||delete this._tiles[o]}freeRtt(e){for(const n in this._tiles){const a=this._tiles[n];(!e||a.tileID.equals(e)||a.tileID.isChildOf(e)||e.isChildOf(a.tileID))&&(a.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){const n={};for(const a of this._renderableTilesKeys){const o=this._tiles[a].tileID;if(o.canonical.equals(e.canonical)){const u=e.clone();u.posMatrix=new Float64Array(16),p.aP(u.posMatrix,0,p.X,0,p.X,0,1),n[a]=u}else if(o.canonical.isChildOf(e.canonical)){const u=e.clone();u.posMatrix=new Float64Array(16);const m=o.canonical.z-e.canonical.z,g=o.canonical.x-(o.canonical.x>>m<>m<>m;p.aP(u.posMatrix,0,v,0,v,0,1),p.J(u.posMatrix,u.posMatrix,[-g*v,-y*v,0]),n[a]=u}else if(e.canonical.isChildOf(o.canonical)){const u=e.clone();u.posMatrix=new Float64Array(16);const m=e.canonical.z-o.canonical.z,g=e.canonical.x-(e.canonical.x>>m<>m<>m;p.aP(u.posMatrix,0,p.X,0,p.X,0,1),p.J(u.posMatrix,u.posMatrix,[g*v,y*v,0]),p.K(u.posMatrix,u.posMatrix,[1/2**m,1/2**m,0]),n[a]=u}}return n}getSourceTile(e,n){const a=this.sourceCache._source;let o=e.overscaledZ-this.deltaZoom;if(o>a.maxzoom&&(o=a.maxzoom),o=a.minzoom&&(!u||!u.dem);)u=this.sourceCache.getTileByID(e.scaledTo(o--).key);return u}tilesAfterTime(e=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=e)}}class us{constructor(e,n,a){this.painter=e,this.sourceCache=new ll(n),this.options=a,this.exaggeration=typeof a.exaggeration=="number"?a.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,n,a,o=p.X){var u;if(!(n>=0&&n=0&&ae.canonical.z&&(e.canonical.z>=o?u=e.canonical.z-o:p.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const m=e.canonical.x-(e.canonical.x>>u<>u<>8<<4|u>>8,n[m+3]=0;const a=new p.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),o=new tt(e,a,e.gl.RGBA,{premultiply:!1});return o.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=o,o}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const n=new Uint8Array(4),a=this.painter.context,o=a.gl,u=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),m=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),g=Math.round(this.painter.height/devicePixelRatio);a.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),o.readPixels(u,g-m-1,1,1,o.RGBA,o.UNSIGNED_BYTE,n),a.bindFramebuffer.set(null);const y=n[0]+(n[2]>>4<<8),v=n[1]+((15&n[2])<<8),S=this.coordsIndex[255-n[3]],T=S&&this.sourceCache.getTileByID(S);if(!T)return null;const C=this._coordsTextureSize,D=(1<e.id!==n),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length!e.inUse)===!1}}const en={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Ge{constructor(e,n){this.painter=e,this.terrain=n,this.pool=new ds(e.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(a=>!e._layers[a].isHidden(n)),this._coordsDescendingInv={};for(const a in e.sourceCaches){this._coordsDescendingInv[a]={};const o=e.sourceCaches[a].getVisibleCoordinates();for(const u of o){const m=this.terrain.sourceCache.getTerrainCoords(u);for(const g in m)this._coordsDescendingInv[a][g]||(this._coordsDescendingInv[a][g]=[]),this._coordsDescendingInv[a][g].push(m[g])}}this._coordsDescendingInvStr={};for(const a of e._order){const o=e._layers[a],u=o.source;if(en[o.type]&&!this._coordsDescendingInvStr[u]){this._coordsDescendingInvStr[u]={};for(const m in this._coordsDescendingInv[u])this._coordsDescendingInvStr[u][m]=this._coordsDescendingInv[u][m].map(g=>g.key).sort().join()}}for(const a of this._renderableTiles)for(const o in this._coordsDescendingInvStr){const u=this._coordsDescendingInvStr[o][a.tileID.key];u&&u!==a.rttCoords[o]&&(a.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;const n=e.type,a=this.painter,o=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(en[n]&&(this._prevType&&en[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(e.id),!o))return!0;if(en[this._prevType]||en[n]&&o){this._prevType=n;const u=this._stacks.length-1,m=this._stacks[u]||[];for(const g of this._renderableTiles){if(this.pool.isFull()&&(Qo(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(g),g.rtt[u]){const v=this.pool.getObjectForId(g.rtt[u].id);if(v.stamp===g.rtt[u].stamp){this.pool.useObject(v);continue}}const y=this.pool.getOrCreateFreeObject();this.pool.useObject(y),this.pool.stampObject(y),g.rtt[u]={id:y.id,stamp:y.stamp},a.context.bindFramebuffer.set(y.fbo.framebuffer),a.context.clear({color:p.aM.transparent,stencil:0}),a.currentStencilSource=void 0;for(let v=0;v{h.touchstart=h.dragStart,h.touchmoveWindow=h.dragMove,h.touchend=h.dragEnd},rc={showCompass:!0,showZoom:!0,visualizePitch:!1};class hl{constructor(e,n,a=!1){this.mousedown=m=>{this.startMouse(p.e({},m,{ctrlKey:!0,preventDefault:()=>m.preventDefault()}),se.mousePos(this.element,m)),se.addEventListener(window,"mousemove",this.mousemove),se.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=m=>{this.moveMouse(m,se.mousePos(this.element,m))},this.mouseup=m=>{this.mouseRotate.dragEnd(m),this.mousePitch&&this.mousePitch.dragEnd(m),this.offTemp()},this.touchstart=m=>{m.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=se.touchPos(this.element,m.targetTouches)[0],this.startTouch(m,this._startPos),se.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),se.addEventListener(window,"touchend",this.touchend))},this.touchmove=m=>{m.targetTouches.length!==1?this.reset():(this._lastPos=se.touchPos(this.element,m.targetTouches)[0],this.moveTouch(m,this._lastPos))},this.touchend=m=>{m.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const o=e.dragRotate._mouseRotate.getClickTolerance(),u=e.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=Yr({clickTolerance:o,enable:!0}),this.touchRotate=(({enable:m,clickTolerance:g,bearingDegreesPerPixelMoved:y=.8})=>{const v=new Qs;return new zi({clickTolerance:g,move:(S,T)=>({bearingDelta:(T.x-S.x)*y}),moveStateManager:v,enable:m,assignEvents:cl})})({clickTolerance:o,enable:!0}),this.map=e,a&&(this.mousePitch=wn({clickTolerance:u,enable:!0}),this.touchPitch=(({enable:m,clickTolerance:g,pitchDegreesPerPixelMoved:y=-.5})=>{const v=new Qs;return new zi({clickTolerance:g,move:(S,T)=>({pitchDelta:(T.y-S.y)*y}),moveStateManager:v,enable:m,assignEvents:cl})})({clickTolerance:u,enable:!0})),se.addEventListener(n,"mousedown",this.mousedown),se.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),se.addEventListener(n,"touchcancel",this.reset)}startMouse(e,n){this.mouseRotate.dragStart(e,n),this.mousePitch&&this.mousePitch.dragStart(e,n),se.disableDrag()}startTouch(e,n){this.touchRotate.dragStart(e,n),this.touchPitch&&this.touchPitch.dragStart(e,n),se.disableDrag()}moveMouse(e,n){const a=this.map,{bearingDelta:o}=this.mouseRotate.dragMove(e,n)||{};if(o&&a.setBearing(a.getBearing()+o),this.mousePitch){const{pitchDelta:u}=this.mousePitch.dragMove(e,n)||{};u&&a.setPitch(a.getPitch()+u)}}moveTouch(e,n){const a=this.map,{bearingDelta:o}=this.touchRotate.dragMove(e,n)||{};if(o&&a.setBearing(a.getBearing()+o),this.touchPitch){const{pitchDelta:u}=this.touchPitch.dragMove(e,n)||{};u&&a.setPitch(a.getPitch()+u)}}off(){const e=this.element;se.removeEventListener(e,"mousedown",this.mousedown),se.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),se.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),se.removeEventListener(window,"touchend",this.touchend),se.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){se.enableDrag(),se.removeEventListener(window,"mousemove",this.mousemove),se.removeEventListener(window,"mouseup",this.mouseup),se.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),se.removeEventListener(window,"touchend",this.touchend)}}let fr;function ao(h,e,n){const a=new p.N(h.lng,h.lat);if(h=new p.N(h.lng,h.lat),e){const o=new p.N(h.lng-360,h.lat),u=new p.N(h.lng+360,h.lat),m=n.locationPoint(h).distSqr(e);n.locationPoint(o).distSqr(e)180;){const o=n.locationPoint(h);if(o.x>=0&&o.y>=0&&o.x<=n.width&&o.y<=n.height)break;h.lng>n.center.lng?h.lng-=360:h.lng+=360}return h.lng!==a.lng&&n.locationPoint(h).y>n.height/2-n.getHorizon()?h:a}const oo={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function lo(h,e,n){const a=h.classList;for(const o in oo)a.remove(`maplibregl-${n}-anchor-${o}`);a.add(`maplibregl-${n}-anchor-${e}`)}class co extends p.E{constructor(e){if(super(),this._onKeyPress=n=>{const a=n.code,o=n.charCode||n.keyCode;a!=="Space"&&a!=="Enter"&&o!==32&&o!==13||this.togglePopup()},this._onMapClick=n=>{const a=n.originalEvent.target,o=this._element;this._popup&&(a===o||o.contains(a))&&this.togglePopup()},this._update=n=>{var a;if(!this._map)return;const o=this._map.loaded()&&!this._map.isMoving();((n==null?void 0:n.type)==="terrain"||(n==null?void 0:n.type)==="render"&&!o)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?ao(this._lngLat,this._flatPos,this._map.transform):(a=this._lngLat)===null||a===void 0?void 0:a.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let u="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?u=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(u=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let m="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?m="rotateX(0deg)":this._pitchAlignment==="map"&&(m=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||n&&n.type!=="moveend"||(this._pos=this._pos.round()),se.setTransform(this._element,`${oo[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${m} ${u}`),_e.frameAsync(new AbortController).then(()=>{this._updateOpacity(n&&n.type==="moveend")}).catch(()=>{})},this._onMove=n=>{if(!this._isDragging){const a=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=a}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new p.k("dragstart"))),this.fire(new p.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new p.k("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(e==null?void 0:e.opacity,e==null?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=p.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=se.create("div");const n=se.createNS("http://www.w3.org/2000/svg","svg"),a=41,o=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${a}px`),n.setAttributeNS(null,"width",`${o}px`),n.setAttributeNS(null,"viewBox",`0 0 ${o} ${a}`);const u=se.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"stroke","none"),u.setAttributeNS(null,"stroke-width","1"),u.setAttributeNS(null,"fill","none"),u.setAttributeNS(null,"fill-rule","evenodd");const m=se.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"fill-rule","nonzero");const g=se.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(3.0, 29.0)"),g.setAttributeNS(null,"fill","#000000");const y=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const U of y){const Z=se.createNS("http://www.w3.org/2000/svg","ellipse");Z.setAttributeNS(null,"opacity","0.04"),Z.setAttributeNS(null,"cx","10.5"),Z.setAttributeNS(null,"cy","5.80029008"),Z.setAttributeNS(null,"rx",U.rx),Z.setAttributeNS(null,"ry",U.ry),g.appendChild(Z)}const v=se.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"fill",this._color);const S=se.createNS("http://www.w3.org/2000/svg","path");S.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),v.appendChild(S);const T=se.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"opacity","0.25"),T.setAttributeNS(null,"fill","#000000");const C=se.createNS("http://www.w3.org/2000/svg","path");C.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),T.appendChild(C);const D=se.createNS("http://www.w3.org/2000/svg","g");D.setAttributeNS(null,"transform","translate(6.0, 7.0)"),D.setAttributeNS(null,"fill","#FFFFFF");const R=se.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"transform","translate(8.0, 8.0)");const N=se.createNS("http://www.w3.org/2000/svg","circle");N.setAttributeNS(null,"fill","#000000"),N.setAttributeNS(null,"opacity","0.25"),N.setAttributeNS(null,"cx","5.5"),N.setAttributeNS(null,"cy","5.5"),N.setAttributeNS(null,"r","5.4999962");const B=se.createNS("http://www.w3.org/2000/svg","circle");B.setAttributeNS(null,"fill","#FFFFFF"),B.setAttributeNS(null,"cx","5.5"),B.setAttributeNS(null,"cy","5.5"),B.setAttributeNS(null,"r","5.4999962"),R.appendChild(N),R.appendChild(B),m.appendChild(g),m.appendChild(v),m.appendChild(T),m.appendChild(D),m.appendChild(R),n.appendChild(m),n.setAttributeNS(null,"height",a*this._scale+"px"),n.setAttributeNS(null,"width",o*this._scale+"px"),this._element.appendChild(n),this._offset=p.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",n=>{n.preventDefault()}),this._element.addEventListener("mousedown",n=>{n.preventDefault()}),lo(this._element,this._anchor,"marker"),e&&e.className)for(const n of e.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),se.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=p.N.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const o=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[o,-1*(38.1-13.5+o)],"bottom-right":[-o,-1*(38.1-13.5+o)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var n,a;if(!(!((n=this._map)===null||n===void 0)&&n.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const o=this._map,u=o.terrain.depthAtPoint(this._pos),m=o.terrain.getElevationForLngLatZoom(this._lngLat,o.transform.tileZoom);if(o.transform.lngLatToCameraDepth(this._lngLat,m)-u<.006)return void(this._element.style.opacity=this._opacity);const g=-this._offset.y/o.transform._pixelPerMeter,y=Math.sin(o.getPitch()*Math.PI/180)*g,v=o.terrain.depthAtPoint(new p.P(this._pos.x,this._pos.y-this._offset.y)),S=o.transform.lngLatToCameraDepth(this._lngLat,m+y)-v>.006;!((a=this._popup)===null||a===void 0)&&a.isOpen()&&S&&this._popup.remove(),this._element.style.opacity=S?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=p.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,n){return e===void 0&&n===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=e),n!==void 0&&(this._opacityWhenCovered=n),this._map&&this._updateOpacity(!0),this}}const nc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let ir=0,it=!1;const na={maxWidth:100,unit:"metric"};function sa(h,e,n){const a=n&&n.maxWidth||100,o=h._container.clientHeight/2,u=h.unproject([0,o]),m=h.unproject([a,o]),g=u.distanceTo(m);if(n&&n.unit==="imperial"){const y=3.2808*g;y>5280?In(e,a,y/5280,h._getUIString("ScaleControl.Miles")):In(e,a,y,h._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?In(e,a,g/1852,h._getUIString("ScaleControl.NauticalMiles")):g>=1e3?In(e,a,g/1e3,h._getUIString("ScaleControl.Kilometers")):In(e,a,g,h._getUIString("ScaleControl.Meters"))}function In(h,e,n,a){const o=function(u){const m=Math.pow(10,`${Math.floor(u)}`.length-1);let g=u/m;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:g>=1?1:function(y){const v=Math.pow(10,Math.ceil(-Math.log(y)/Math.LN10));return Math.round(y*v)/v}(g),m*g}(n);h.style.width=e*(o/n)+"px",h.innerHTML=`${o} ${a}`}const ul={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},dl=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function pl(h){if(h){if(typeof h=="number"){const e=Math.round(Math.abs(h)/Math.SQRT2);return{center:new p.P(0,0),top:new p.P(0,h),"top-left":new p.P(e,e),"top-right":new p.P(-e,e),bottom:new p.P(0,-h),"bottom-left":new p.P(e,-e),"bottom-right":new p.P(-e,-e),left:new p.P(h,0),right:new p.P(-h,0)}}if(h instanceof p.P||Array.isArray(h)){const e=p.P.convert(h);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:p.P.convert(h.center||[0,0]),top:p.P.convert(h.top||[0,0]),"top-left":p.P.convert(h["top-left"]||[0,0]),"top-right":p.P.convert(h["top-right"]||[0,0]),bottom:p.P.convert(h.bottom||[0,0]),"bottom-left":p.P.convert(h["bottom-left"]||[0,0]),"bottom-right":p.P.convert(h["bottom-right"]||[0,0]),left:p.P.convert(h.left||[0,0]),right:p.P.convert(h.right||[0,0])}}return pl(new p.P(0,0))}const rr=Pi;L.AJAXError=p.bg,L.Evented=p.E,L.LngLat=p.N,L.MercatorCoordinate=p.Z,L.Point=p.P,L.addProtocol=p.bh,L.config=p.a,L.removeProtocol=p.bi,L.AttributionControl=tr,L.BoxZoomHandler=os,L.CanvasSource=vi,L.CooperativeGesturesHandler=Qr,L.DoubleClickZoomHandler=Tn,L.DragPanHandler=Di,L.DragRotateHandler=to,L.EdgeInsets=is,L.FullscreenControl=class extends p.E{constructor(h={}){super(),this._onFullscreenChange=()=>{var e;let n=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((e=n==null?void 0:n.shadowRoot)===null||e===void 0)&&e.fullscreenElement;)n=n.shadowRoot.fullscreenElement;n===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,h&&h.container&&(h.container instanceof HTMLElement?this._container=h.container:p.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=se.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){se.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const h=this._fullscreenButton=se.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);se.create("span","maplibregl-ctrl-icon",h).setAttribute("aria-hidden","true"),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new p.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new p.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},L.GeoJSONSource=On,L.GeolocateControl=class extends p.E{constructor(h){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new p.k("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new p.k("geolocate",e)),this._finish()}},this._updateCamera=e=>{const n=new p.N(e.coords.longitude,e.coords.latitude),a=e.coords.accuracy,o=this._map.getBearing(),u=p.e({bearing:o},this.options.fitBoundsOptions),m=ie.fromLngLat(n,a);this._map.fitBounds(m,u,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const n=new p.N(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(this.options.trackUserLocation)if(e.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&it)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new p.k("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=se.create("button","maplibregl-ctrl-geolocate",this._container),se.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){p.w("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=se.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new co({element:this._dotElement}),this._circleElement=se.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new co({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",n=>{n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||n.originalEvent&&n.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new p.k("trackuserlocationend")),this.fire(new p.k("userlocationlostfocus")))})}},this.options=p.e({},nc,h)}onAdd(h){return this._map=h,this._container=se.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return p._(this,arguments,void 0,function*(e=!1){if(fr!==void 0&&!e)return fr;if(window.navigator.permissions===void 0)return fr=!!window.navigator.geolocation,fr;try{fr=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{fr=!!window.navigator.geolocation}return fr})}().then(e=>this._finishSetupUI(e)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),se.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ir=0,it=!1}_isOutOfMapMaxBounds(h){const e=this._map.getMaxBounds(),n=h.coords;return e&&(n.longitudee.getEast()||n.latitudee.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const h=this._map.getBounds(),e=h.getSouthEast(),n=h.getNorthEast(),a=e.distanceTo(n),o=Math.ceil(this._accuracy/(a/this._map._container.clientHeight)*2);this._circleElement.style.width=`${o}px`,this._circleElement.style.height=`${o}px`}trigger(){if(!this._setup)return p.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new p.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ir--,it=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new p.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new p.k("trackuserlocationstart")),this.fire(new p.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let h;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ir++,ir>1?(h={maximumAge:6e5,timeout:0},it=!0):(h=this.options.positionOptions,it=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,h)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},L.Hash=ss,L.ImageSource=hr,L.KeyboardHandler=Ya,L.LngLatBounds=ie,L.LogoControl=Se,L.Map=class extends al{constructor(h){p.be.mark(p.bf.create);const e=Object.assign(Object.assign({},so),h);if(e.minZoom!=null&&e.maxZoom!=null&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(e.minPitch!=null&&e.maxPitch!=null&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(e.minPitch!=null&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(e.maxPitch!=null&&e.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new rs(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies),{bearingSnap:e.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new ol,this._controls=[],this._mapId=p.a4(),this._contextLost=n=>{n.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new p.k("webglcontextlost",{originalEvent:n}))},this._contextRestored=n=>{this._setupPainter(),this.resize(),this._update(),this.fire(new p.k("webglcontextrestored",{originalEvent:n}))},this._onMapScroll=n=>{if(n.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._maxTileCacheZoomLevels=e.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=e.preserveDrawingBuffer===!0,this._antialias=e.antialias===!0,this._trackResize=e.trackResize===!0,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles===!0,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions===!0,this._collectResourceTiming=e.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},no),e.locale),this._clickTolerance=e.clickTolerance,this._overridePixelRatio=e.pixelRatio,this._maxCanvasSize=e.maxCanvasSize,this.transformCameraUpdate=e.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=e.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=oi.addThrottleControl(()=>this.isMoving()),this._requestManager=new wa(e.transformRequest),typeof e.container=="string"){if(this._container=document.getElementById(e.container),!this._container)throw new Error(`Container '${e.container}' not found.`)}else{if(!(e.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let n=!1;const a=ns(o=>{this._trackResize&&!this._removed&&this.resize(o)._update()},50);this._resizeObserver=new ResizeObserver(o=>{n?a(o):n=!0}),this._resizeObserver.observe(this._container)}this.handlers=new tc(this,e),this._hash=e.hash&&new ss(typeof e.hash=="string"&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,p.e({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,this._validateStyle=e.validateStyle,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new tr(typeof e.attributionControl=="boolean"?void 0:e.attributionControl)),e.maplibreLogo&&this.addControl(new Se,e.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",n=>{this._update(n.dataType==="style"),this.fire(new p.k(`${n.dataType}data`,n))}),this.on("dataloading",n=>{this.fire(new p.k(`${n.dataType}dataloading`,n))}),this.on("dataabort",n=>{this.fire(new p.k("sourcedataabort",n))})}_getMapId(){return this._mapId}addControl(h,e){if(e===void 0&&(e=h.getDefaultPosition?h.getDefaultPosition():"top-right"),!h||!h.onAdd)return this.fire(new p.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=h.onAdd(this);this._controls.push(h);const a=this._controlPositions[e];return e.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this}removeControl(h){if(!h||!h.onRemove)return this.fire(new p.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(h);return e>-1&&this._controls.splice(e,1),h.onRemove(this),this}hasControl(h){return this._controls.indexOf(h)>-1}calculateCameraOptionsFromTo(h,e,n,a){return a==null&&this.terrain&&(a=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(h,e,n,a)}resize(h){var e;const n=this._containerDimensions(),a=n[0],o=n[1],u=this._getClampedPixelRatio(a,o);if(this._resizeCanvas(a,o,u),this.painter.resize(a,o,u),this.painter.overLimit()){const g=this.painter.context.gl;this._maxCanvasSize=[g.drawingBufferWidth,g.drawingBufferHeight];const y=this._getClampedPixelRatio(a,o);this._resizeCanvas(a,o,y),this.painter.resize(a,o,y)}this.transform.resize(a,o),(e=this._requestedCameraState)===null||e===void 0||e.resize(a,o);const m=!this._moving;return m&&(this.stop(),this.fire(new p.k("movestart",h)).fire(new p.k("move",h))),this.fire(new p.k("resize",h)),m&&this.fire(new p.k("moveend",h)),this}_getClampedPixelRatio(h,e){const{0:n,1:a}=this._maxCanvasSize,o=this.getPixelRatio(),u=h*o,m=e*o;return Math.min(u>n?n/u:1,m>a?a/m:1)*o}getPixelRatio(){var h;return(h=this._overridePixelRatio)!==null&&h!==void 0?h:devicePixelRatio}setPixelRatio(h){this._overridePixelRatio=h,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(h){return this.transform.setMaxBounds(ie.convert(h)),this._update()}setMinZoom(h){if((h=h??-2)>=-2&&h<=this.transform.maxZoom)return this.transform.minZoom=h,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=h,this._update(),this.getZoom()>h&&this.setZoom(h),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(h){if((h=h??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(h>=0&&h<=this.transform.maxPitch)return this.transform.minPitch=h,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(h>=this.transform.minPitch)return this.transform.maxPitch=h,this._update(),this.getPitch()>h&&this.setPitch(h),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(h){return this.transform.renderWorldCopies=h,this._update()}project(h){return this.transform.locationPoint(p.N.convert(h),this.style&&this.terrain)}unproject(h){return this.transform.pointLocation(p.P.convert(h),this.terrain)}isMoving(){var h;return this._moving||((h=this.handlers)===null||h===void 0?void 0:h.isMoving())}isZooming(){var h;return this._zooming||((h=this.handlers)===null||h===void 0?void 0:h.isZooming())}isRotating(){var h;return this._rotating||((h=this.handlers)===null||h===void 0?void 0:h.isRotating())}_createDelegatedListener(h,e,n){if(h==="mouseenter"||h==="mouseover"){let a=!1;return{layer:e,listener:n,delegates:{mousemove:u=>{const m=this.getLayer(e)?this.queryRenderedFeatures(u.point,{layers:[e]}):[];m.length?a||(a=!0,n.call(this,new mi(h,this,u.originalEvent,{features:m}))):a=!1},mouseout:()=>{a=!1}}}}if(h==="mouseleave"||h==="mouseout"){let a=!1;return{layer:e,listener:n,delegates:{mousemove:m=>{(this.getLayer(e)?this.queryRenderedFeatures(m.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,n.call(this,new mi(h,this,m.originalEvent)))},mouseout:m=>{a&&(a=!1,n.call(this,new mi(h,this,m.originalEvent)))}}}}{const a=o=>{const u=this.getLayer(e)?this.queryRenderedFeatures(o.point,{layers:[e]}):[];u.length&&(o.features=u,n.call(this,o),delete o.features)};return{layer:e,listener:n,delegates:{[h]:a}}}}on(h,e,n){if(n===void 0)return super.on(h,e);const a=this._createDelegatedListener(h,e,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[h]=this._delegatedListeners[h]||[],this._delegatedListeners[h].push(a);for(const o in a.delegates)this.on(o,a.delegates[o]);return this}once(h,e,n){if(n===void 0)return super.once(h,e);const a=this._createDelegatedListener(h,e,n);for(const o in a.delegates)this.once(o,a.delegates[o]);return this}off(h,e,n){return n===void 0?super.off(h,e):(this._delegatedListeners&&this._delegatedListeners[h]&&(a=>{const o=this._delegatedListeners[h];for(let u=0;uthis._updateStyle(h,e));const n=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!h)),h?(this.style=new Ia(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof h=="string"?this.style.loadURL(h,e,n):this.style.loadJSON(h,e,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ia(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(h,e){if(typeof h=="string"){const n=this._requestManager.transformRequest(h,"Style");p.h(n,new AbortController).then(a=>{this._updateDiff(a.data,e)}).catch(a=>{a&&this.fire(new p.j(a))})}else typeof h=="object"&&this._updateDiff(h,e)}_updateDiff(h,e){try{this.style.setState(h,e)&&this._update(!0)}catch(n){p.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(h,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():p.w("There is no style added to the map.")}addSource(h,e){return this._lazyInitEmptyStyle(),this.style.addSource(h,e),this._update(!0)}isSourceLoaded(h){const e=this.style&&this.style.sourceCaches[h];if(e!==void 0)return e.loaded();this.fire(new p.j(new Error(`There is no source with ID '${h}'`)))}setTerrain(h){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),h){const e=this.style.sourceCaches[h.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${h.source}`);this.terrain===null&&e.reload();for(const n in this.style._layers){const a=this.style._layers[n];a.type==="hillshade"&&a.source===h.source&&p.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new us(this.painter,e,h),this.painter.renderToTexture=new Ge(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId!==h.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new p.k("terrain",{terrain:h})),this}getTerrain(){var h,e;return(e=(h=this.terrain)===null||h===void 0?void 0:h.options)!==null&&e!==void 0?e:null}areTilesLoaded(){const h=this.style&&this.style.sourceCaches;for(const e in h){const n=h[e]._tiles;for(const a in n){const o=n[a];if(o.state!=="loaded"&&o.state!=="errored")return!1}}return!0}removeSource(h){return this.style.removeSource(h),this._update(!0)}getSource(h){return this.style.getSource(h)}addImage(h,e,n={}){const{pixelRatio:a=1,sdf:o=!1,stretchX:u,stretchY:m,content:g,textFitWidth:y,textFitHeight:v}=n;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||p.b(e))){if(e.width===void 0||e.height===void 0)return this.fire(new p.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:S,height:T,data:C}=e,D=e;return this.style.addImage(h,{data:new p.R({width:S,height:T},new Uint8Array(C)),pixelRatio:a,stretchX:u,stretchY:m,content:g,textFitWidth:y,textFitHeight:v,sdf:o,version:0,userImage:D}),D.onAdd&&D.onAdd(this,h),this}}{const{width:S,height:T,data:C}=_e.getImageData(e);this.style.addImage(h,{data:new p.R({width:S,height:T},C),pixelRatio:a,stretchX:u,stretchY:m,content:g,textFitWidth:y,textFitHeight:v,sdf:o,version:0})}}updateImage(h,e){const n=this.style.getImage(h);if(!n)return this.fire(new p.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const a=e instanceof HTMLImageElement||p.b(e)?_e.getImageData(e):e,{width:o,height:u,data:m}=a;if(o===void 0||u===void 0)return this.fire(new p.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==n.data.width||u!==n.data.height)return this.fire(new p.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const g=!(e instanceof HTMLImageElement||p.b(e));return n.data.replace(m,g),this.style.updateImage(h,n),this}getImage(h){return this.style.getImage(h)}hasImage(h){return h?!!this.style.getImage(h):(this.fire(new p.j(new Error("Missing required image id"))),!1)}removeImage(h){this.style.removeImage(h)}loadImage(h){return oi.getImage(this._requestManager.transformRequest(h,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(h,e){return this._lazyInitEmptyStyle(),this.style.addLayer(h,e),this._update(!0)}moveLayer(h,e){return this.style.moveLayer(h,e),this._update(!0)}removeLayer(h){return this.style.removeLayer(h),this._update(!0)}getLayer(h){return this.style.getLayer(h)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(h,e,n){return this.style.setLayerZoomRange(h,e,n),this._update(!0)}setFilter(h,e,n={}){return this.style.setFilter(h,e,n),this._update(!0)}getFilter(h){return this.style.getFilter(h)}setPaintProperty(h,e,n,a={}){return this.style.setPaintProperty(h,e,n,a),this._update(!0)}getPaintProperty(h,e){return this.style.getPaintProperty(h,e)}setLayoutProperty(h,e,n,a={}){return this.style.setLayoutProperty(h,e,n,a),this._update(!0)}getLayoutProperty(h,e){return this.style.getLayoutProperty(h,e)}setGlyphs(h,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(h,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(h,e,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(h,e,n,a=>{a||this._update(!0)}),this}removeSprite(h){return this._lazyInitEmptyStyle(),this.style.removeSprite(h),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(h,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(h,e,n=>{n||this._update(!0)}),this}setLight(h,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(h,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(h){return this._lazyInitEmptyStyle(),this.style.setSky(h),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(h,e){return this.style.setFeatureState(h,e),this._update()}removeFeatureState(h,e){return this.style.removeFeatureState(h,e),this._update()}getFeatureState(h){return this.style.getFeatureState(h)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let h=0,e=0;return this._container&&(h=this._container.clientWidth||400,e=this._container.clientHeight||300),[h,e]}_setupContainer(){const h=this._container;h.classList.add("maplibregl-map");const e=this._canvasContainer=se.create("div","maplibregl-canvas-container",h);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=se.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const n=this._containerDimensions(),a=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],a);const o=this._controlContainer=se.create("div","maplibregl-control-container",h),u=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(m=>{u[m]=se.create("div",`maplibregl-ctrl-${m} `,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(h,e,n){this._canvas.width=Math.floor(n*h),this._canvas.height=Math.floor(n*e),this._canvas.style.width=`${h}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const h={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let e=null;this._canvas.addEventListener("webglcontextcreationerror",a=>{e={requestedAttributes:h},a&&(e.statusMessage=a.statusMessage,e.type=a.type)},{once:!0});const n=this._canvas.getContext("webgl2",h)||this._canvas.getContext("webgl",h);if(!n){const a="Failed to initialize WebGL";throw e?(e.message=a,new Error(JSON.stringify(e))):new Error(a)}this.painter=new ts(n,this.transform),Nr.testSupport(n)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(h){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||h,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(h){return this._update(),this._renderTaskQueue.add(h)}_cancelRenderFrame(h){this._renderTaskQueue.remove(h)}_render(h){const e=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(h),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const o=this.transform.zoom,u=_e.now();this.style.zoomHistory.update(o,u);const m=new p.z(o,{now:u,fadeDuration:e,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),g=m.crossFadingFactor();g===1&&g===this._crossFadingFactor||(n=!0,this._crossFadingFactor=g),this.style.update(m)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,e,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:e,showPadding:this.showPadding}),this.fire(new p.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,p.be.mark(p.bf.load),this.fire(new p.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const a=this._sourcesDirty||this._styleDirty||this._placementDirty;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new p.k("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0,p.be.mark(p.bf.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var h;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),oi.removeThrottleControl(this._imageQueueHandle),(h=this._resizeObserver)===null||h===void 0||h.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e!=null&&e.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),se.remove(this._canvasContainer),se.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),p.be.clearMetrics(),this._removed=!0,this.fire(new p.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,_e.frameAsync(this._frameRequest).then(h=>{p.be.frame(h),this._frameRequest=null,this._render(h)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(h){this._showTileBoundaries!==h&&(this._showTileBoundaries=h,this._update())}get showPadding(){return!!this._showPadding}set showPadding(h){this._showPadding!==h&&(this._showPadding=h,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(h){this._showCollisionBoxes!==h&&(this._showCollisionBoxes=h,h?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(h){this._showOverdrawInspector!==h&&(this._showOverdrawInspector=h,this._update())}get repaint(){return!!this._repaint}set repaint(h){this._repaint!==h&&(this._repaint=h,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(h){this._vertices=h,this._update()}get version(){return ic}getCameraTargetElevation(){return this.transform.elevation}},L.MapMouseEvent=mi,L.MapTouchEvent=vn,L.MapWheelEvent=as,L.Marker=co,L.NavigationControl=class{constructor(h){this._updateZoomButtons=()=>{const e=this._map.getZoom(),n=e===this._map.getMaxZoom(),a=e===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=a,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",a.toString())},this._rotateCompassArrow=()=>{const e=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=e},this._setButtonTitle=(e,n)=>{const a=this._map._getUIString(`NavigationControl.${n}`);e.title=a,e.setAttribute("aria-label",a)},this.options=p.e({},rc,h),this._container=se.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),se.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),se.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=se.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(h){return this._map=h,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new hl(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){se.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(h,e){const n=se.create("button",h,this._container);return n.type="button",n.addEventListener("click",e),n}},L.Popup=class extends p.E{constructor(h){super(),this.remove=()=>(this._content&&se.remove(this._content),this._container&&(se.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new p.k("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var n;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=se.create("div","maplibregl-popup",this._map.getContainer()),this._tip=se.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const g of this.options.className.split(" "))this._container.classList.add(g);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?ao(this._lngLat,this._flatPos,this._map.transform):(n=this._lngLat)===null||n===void 0?void 0:n.wrap(),this._trackPointer&&!e)return;const a=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationPoint(this._lngLat));let o=this.options.anchor;const u=pl(this.options.offset);if(!o){const g=this._container.offsetWidth,y=this._container.offsetHeight;let v;v=a.y+u.bottom.ythis._map.transform.height-y?["bottom"]:[],a.xthis._map.transform.width-g/2&&v.push("right"),o=v.length===0?"bottom":v.join("-")}let m=a.add(u[o]);this.options.subpixelPositioning||(m=m.round()),se.setTransform(this._container,`${oo[o]} translate(${m.x}px,${m.y}px)`),lo(this._container,o,"popup")},this._onClose=()=>{this.remove()},this.options=p.e(Object.create(ul),h)}addTo(h){return this._map&&this.remove(),this._map=h,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new p.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(h){return this._lngLat=p.N.convert(h),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(h){return this.setDOMContent(document.createTextNode(h))}setHTML(h){const e=document.createDocumentFragment(),n=document.createElement("body");let a;for(n.innerHTML=h;a=n.firstChild,a;)e.appendChild(a);return this.setDOMContent(e)}getMaxWidth(){var h;return(h=this._container)===null||h===void 0?void 0:h.style.maxWidth}setMaxWidth(h){return this.options.maxWidth=h,this._update(),this}setDOMContent(h){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=se.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(h),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(h){return this._container&&this._container.classList.add(h),this}removeClassName(h){return this._container&&this._container.classList.remove(h),this}setOffset(h){return this.options.offset=h,this._update(),this}toggleClassName(h){if(this._container)return this._container.classList.toggle(h)}setSubpixelPositioning(h){this.options.subpixelPositioning=h}_createCloseButton(){this.options.closeButton&&(this._closeButton=se.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const h=this._container.querySelector(dl);h&&h.focus()}},L.RasterDEMTileSource=mt,L.RasterTileSource=Je,L.ScaleControl=class{constructor(h){this._onMove=()=>{sa(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,sa(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},na),h)}getDefaultPosition(){return"bottom-left"}onAdd(h){return this._map=h,this._container=se.create("div","maplibregl-ctrl maplibregl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){se.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},L.ScrollZoomHandler=eo,L.Style=Ia,L.TerrainControl=class{constructor(h){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=h}onAdd(h){return this._map=h,this._container=se.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=se.create("button","maplibregl-ctrl-terrain",this._container),se.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){se.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},L.TwoFingersTouchPitchHandler=Ja,L.TwoFingersTouchRotateHandler=Cr,L.TwoFingersTouchZoomHandler=Wa,L.TwoFingersTouchZoomRotateHandler=Li,L.VectorTileSource=Fn,L.VideoSource=dn,L.addSourceType=(h,e)=>p._(void 0,void 0,void 0,function*(){if(Nn(h))throw new Error(`A source type called "${h}" already exists.`);((n,a)=>{Vn[n]=a})(h,e)}),L.clearPrewarmedResources=function(){const h=li;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(vr),li=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()"))},L.getMaxParallelImageRequests=function(){return p.a.MAX_PARALLEL_IMAGE_REQUESTS},L.getRTLTextPluginStatus=function(){return Ji().getRTLTextPluginStatus()},L.getVersion=function(){return rr},L.getWorkerCount=function(){return Wi.workerCount},L.getWorkerUrl=function(){return p.a.WORKER_URL},L.importScriptInWorkers=function(h){return Bn().broadcast("IS",h)},L.prewarm=function(){Ur().acquire(vr)},L.setMaxParallelImageRequests=function(h){p.a.MAX_PARALLEL_IMAGE_REQUESTS=h},L.setRTLTextPlugin=function(h,e){return Ji().setRTLTextPlugin(h,e)},L.setWorkerCount=function(h){Wi.workerCount=h},L.setWorkerUrl=function(h){p.a.WORKER_URL=h}});var ba=Or;return ba})})(Lu);var Bu=Lu.exports;const Dp=kp(Bu),Rp=Ep({__proto__:null,default:Dp},[Bu]);export{Rp as m}; diff --git a/assets/slide-zAfq0QPP.js b/assets/slide-BGBegb0d.js similarity index 99% rename from assets/slide-zAfq0QPP.js rename to assets/slide-BGBegb0d.js index 81a7448..03ff673 100644 --- a/assets/slide-zAfq0QPP.js +++ b/assets/slide-BGBegb0d.js @@ -1 +1 @@ -import{d as Z,Z as G,e as de,B as ve}from"./index-CNMbRSP0.js";function pe(f,m){for(var h=0;hd[i]})}}}return Object.freeze(Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}))}var z={exports:{}},H={exports:{}},K={exports:{}};(function(f,m){Object.defineProperty(m,"__esModule",{value:!0});var h={overlay:function(i){return{position:"fixed",zIndex:1e3,width:"100%",height:"100%",background:"rgba(0, 0, 0, 0.3)",opacity:i?1:0,MozTransform:i?"":"translate3d(100%, 0, 0)",MsTransform:i?"":"translate3d(100%, 0, 0)",OTransform:i?"":"translate3d(100%, 0, 0)",WebkitTransform:i?"":"translate3d(100%, 0, 0)",transform:i?"":"translate3d(100%, 0, 0)",transition:i?"opacity 0.3s":"opacity 0.3s, transform 0s 0.3s"}},menuWrap:function(i,C,u){return{position:"fixed",right:u?0:"inherit",zIndex:1100,width:C,height:"100%",MozTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",MsTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",OTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",WebkitTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",transform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",transition:"all 0.5s"}},menu:function(){return{height:"100%",boxSizing:"border-box",overflow:"auto"}},itemList:function(){return{height:"100%"}},item:function(){return{display:"block"}}};m.default=h,f.exports=m.default})(K,K.exports);var ye=K.exports,B={};Object.defineProperty(B,"__esModule",{value:!0});B.focusOnFirstMenuItem=te;B.focusOnLastMenuItem=ne;B.focusOnCrossButton=re;B.focusOnMenuButton=ge;B.focusOnMenuItem=J;B.focusOnNextMenuItem=he;B.focusOnPreviousMenuItem=be;function te(){var f=Array.from(document.getElementsByClassName("bm-item")).shift();f&&f.focus()}function ne(){var f=Array.from(document.getElementsByClassName("bm-item")).pop();f&&f.focus()}function re(){var f=document.getElementById("react-burger-cross-btn");f&&f.focus()}function ge(){var f=document.getElementById("react-burger-menu-btn");f&&f.focus()}function J(f){if(document.activeElement.className.includes("bm-item")){var m=document.activeElement[f];m?m.focus():re()}else f==="previousElementSibling"?ne():te()}function he(){J("nextElementSibling")}function be(){J("previousElementSibling")}var $={exports:{}};(function(f,m){Object.defineProperty(m,"__esModule",{value:!0});var h=Object.assign||function(o){for(var e=1;ed[i]})}}}return Object.freeze(Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}))}var z={exports:{}},H={exports:{}},K={exports:{}};(function(f,m){Object.defineProperty(m,"__esModule",{value:!0});var h={overlay:function(i){return{position:"fixed",zIndex:1e3,width:"100%",height:"100%",background:"rgba(0, 0, 0, 0.3)",opacity:i?1:0,MozTransform:i?"":"translate3d(100%, 0, 0)",MsTransform:i?"":"translate3d(100%, 0, 0)",OTransform:i?"":"translate3d(100%, 0, 0)",WebkitTransform:i?"":"translate3d(100%, 0, 0)",transform:i?"":"translate3d(100%, 0, 0)",transition:i?"opacity 0.3s":"opacity 0.3s, transform 0s 0.3s"}},menuWrap:function(i,C,u){return{position:"fixed",right:u?0:"inherit",zIndex:1100,width:C,height:"100%",MozTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",MsTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",OTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",WebkitTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",transform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",transition:"all 0.5s"}},menu:function(){return{height:"100%",boxSizing:"border-box",overflow:"auto"}},itemList:function(){return{height:"100%"}},item:function(){return{display:"block"}}};m.default=h,f.exports=m.default})(K,K.exports);var ye=K.exports,B={};Object.defineProperty(B,"__esModule",{value:!0});B.focusOnFirstMenuItem=te;B.focusOnLastMenuItem=ne;B.focusOnCrossButton=re;B.focusOnMenuButton=ge;B.focusOnMenuItem=J;B.focusOnNextMenuItem=he;B.focusOnPreviousMenuItem=be;function te(){var f=Array.from(document.getElementsByClassName("bm-item")).shift();f&&f.focus()}function ne(){var f=Array.from(document.getElementsByClassName("bm-item")).pop();f&&f.focus()}function re(){var f=document.getElementById("react-burger-cross-btn");f&&f.focus()}function ge(){var f=document.getElementById("react-burger-menu-btn");f&&f.focus()}function J(f){if(document.activeElement.className.includes("bm-item")){var m=document.activeElement[f];m?m.focus():re()}else f==="previousElementSibling"?ne():te()}function he(){J("nextElementSibling")}function be(){J("previousElementSibling")}var $={exports:{}};(function(f,m){Object.defineProperty(m,"__esModule",{value:!0});var h=Object.assign||function(o){for(var e=1;er===null?null:t(r)):D(e)?Object.keys(e).reduce((r,s)=>(r[s]=t(e[s]),r),{}):e!=null?t(e):null}const W=e=>c.jsx(p.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});W.displayName="StackItem";function A(e){const{spacing:t,direction:r}=e,s={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":R(r,d=>s[d])}}const M=I((e,t)=>{const{isInline:r,direction:s,align:d,justify:_,spacing:a="0.5rem",wrap:j,children:f,divider:l,className:g,shouldWrapChildren:m,...S}=e,u=r?"row":s??"column",x=o.useMemo(()=>A({spacing:a,direction:u}),[a,u]),i=!!l,y=!m&&!i,w=o.useMemo(()=>{const h=O(f);return y?h:h.map((n,v)=>{const k=typeof n.key<"u"?n.key:v,N=v+1===h.length,b=m?c.jsx(W,{children:n},k):n;if(!i)return b;const L=o.cloneElement(l,{__css:x}),B=N?null:L;return c.jsxs(o.Fragment,{children:[b,B]},k)})},[l,x,i,y,m,f]),C=E("chakra-stack",g);return c.jsx(p.div,{ref:t,display:"flex",alignItems:d,justifyContent:_,flexDirection:u,flexWrap:j,gap:i?void 0:a,className:C,...S,children:w})});M.displayName="Stack";export{M as S,R as m}; +import{O as D,j as c,c as p,f as I,d as o,l as E}from"./index-Blxo1hic.js";import{r as O}from"./Footer-DvQMRGAB.js";function R(e,t){return Array.isArray(e)?e.map(r=>r===null?null:t(r)):D(e)?Object.keys(e).reduce((r,s)=>(r[s]=t(e[s]),r),{}):e!=null?t(e):null}const W=e=>c.jsx(p.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});W.displayName="StackItem";function A(e){const{spacing:t,direction:r}=e,s={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":R(r,d=>s[d])}}const M=I((e,t)=>{const{isInline:r,direction:s,align:d,justify:_,spacing:a="0.5rem",wrap:j,children:f,divider:l,className:g,shouldWrapChildren:m,...S}=e,u=r?"row":s??"column",x=o.useMemo(()=>A({spacing:a,direction:u}),[a,u]),i=!!l,y=!m&&!i,w=o.useMemo(()=>{const h=O(f);return y?h:h.map((n,v)=>{const k=typeof n.key<"u"?n.key:v,N=v+1===h.length,b=m?c.jsx(W,{children:n},k):n;if(!i)return b;const L=o.cloneElement(l,{__css:x}),B=N?null:L;return c.jsxs(o.Fragment,{children:[b,B]},k)})},[l,x,i,y,m,f]),C=E("chakra-stack",g);return c.jsx(p.div,{ref:t,display:"flex",alignItems:d,justifyContent:_,flexDirection:u,flexWrap:j,gap:i?void 0:a,className:C,...S,children:w})});M.displayName="Stack";export{M as S,R as m}; diff --git a/index.html b/index.html index 9059f7a..faad9d8 100644 --- a/index.html +++ b/index.html @@ -38,7 +38,7 @@ content="/images/favicon/browserconfig.xml" /> - +