diff --git a/client/.gitignore b/client/.gitignore new file mode 100644 index 0000000..d5f19d8 --- /dev/null +++ b/client/.gitignore @@ -0,0 +1,2 @@ +node_modules +package-lock.json diff --git a/client/README.md b/client/README.md new file mode 100644 index 0000000..d50dad8 Binary files /dev/null and b/client/README.md differ diff --git a/client/build/asset-manifest.json b/client/build/asset-manifest.json new file mode 100644 index 0000000..becd83c --- /dev/null +++ b/client/build/asset-manifest.json @@ -0,0 +1,26 @@ +{ + "files": { + "main.css": "/static/css/main.a3ee530a.chunk.css", + "main.js": "/static/js/main.9fbc5a9a.chunk.js", + "main.js.map": "/static/js/main.9fbc5a9a.chunk.js.map", + "runtime-main.js": "/static/js/runtime-main.1dc66141.js", + "runtime-main.js.map": "/static/js/runtime-main.1dc66141.js.map", + "static/js/2.a9e2dd78.chunk.js": "/static/js/2.a9e2dd78.chunk.js", + "static/js/2.a9e2dd78.chunk.js.map": "/static/js/2.a9e2dd78.chunk.js.map", + "index.html": "/index.html", + "precache-manifest.427b5bc5575ba30105e2f96a59bc3bcd.js": "/precache-manifest.427b5bc5575ba30105e2f96a59bc3bcd.js", + "service-worker.js": "/service-worker.js", + "static/css/main.a3ee530a.chunk.css.map": "/static/css/main.a3ee530a.chunk.css.map", + "static/js/2.a9e2dd78.chunk.js.LICENSE": "/static/js/2.a9e2dd78.chunk.js.LICENSE", + "static/media/index.css": "/static/media/Signika-Bold.6bc3acea.ttf", + "static/media/close.svg": "/static/media/close.a50ed734.svg", + "static/media/info.svg": "/static/media/info.6992069b.svg", + "static/media/twitter.svg": "/static/media/twitter.7a17a52d.svg" + }, + "entrypoints": [ + "static/js/runtime-main.1dc66141.js", + "static/js/2.a9e2dd78.chunk.js", + "static/css/main.a3ee530a.chunk.css", + "static/js/main.9fbc5a9a.chunk.js" + ] +} \ No newline at end of file diff --git a/client/build/favicon.ico b/client/build/favicon.ico new file mode 100644 index 0000000..fd7048d Binary files /dev/null and b/client/build/favicon.ico differ diff --git a/client/build/index.html b/client/build/index.html new file mode 100644 index 0000000..180e266 --- /dev/null +++ b/client/build/index.html @@ -0,0 +1,14 @@ +हैकरgram Web Developer Puzzler #1
\ No newline at end of file diff --git a/client/build/logo192.png b/client/build/logo192.png new file mode 100644 index 0000000..5da5564 Binary files /dev/null and b/client/build/logo192.png differ diff --git a/client/build/logo512.png b/client/build/logo512.png new file mode 100644 index 0000000..d8284fb Binary files /dev/null and b/client/build/logo512.png differ diff --git a/client/build/manifest.json b/client/build/manifest.json new file mode 100644 index 0000000..84fb46f --- /dev/null +++ b/client/build/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "CAA protests", + "name": "CAA protest visualization", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/client/build/precache-manifest.427b5bc5575ba30105e2f96a59bc3bcd.js b/client/build/precache-manifest.427b5bc5575ba30105e2f96a59bc3bcd.js new file mode 100644 index 0000000..66e9fcc --- /dev/null +++ b/client/build/precache-manifest.427b5bc5575ba30105e2f96a59bc3bcd.js @@ -0,0 +1,54 @@ +self.__precacheManifest = (self.__precacheManifest || []).concat([ + { + "revision": "4271cf68a057f138d1bcd6f117e4c3f4", + "url": "/index.html" + }, + { + "revision": "4aff442d8f42da2d5271", + "url": "/static/css/main.a3ee530a.chunk.css" + }, + { + "revision": "dd2536e14a0ef4219801", + "url": "/static/js/2.a9e2dd78.chunk.js" + }, + { + "revision": "67ec752e578893db050e41ae792e22e0", + "url": "/static/js/2.a9e2dd78.chunk.js.LICENSE" + }, + { + "revision": "4aff442d8f42da2d5271", + "url": "/static/js/main.9fbc5a9a.chunk.js" + }, + { + "revision": "6b3defdcd169e5f902d5", + "url": "/static/js/runtime-main.1dc66141.js" + }, + { + "revision": "5ebb24ee1112dd9562629375c387879a", + "url": "/static/media/Roboto-Black.5ebb24ee.ttf" + }, + { + "revision": "88823c2015ffd5fa89d567e17297a137", + "url": "/static/media/Roboto-Light.88823c20.ttf" + }, + { + "revision": "11eabca2251325cfc5589c9c6fb57b46", + "url": "/static/media/Roboto-Regular.11eabca2.ttf" + }, + { + "revision": "6bc3acea783745482f8f9ec47d484e95", + "url": "/static/media/Signika-Bold.6bc3acea.ttf" + }, + { + "revision": "a50ed734b74d1f77538e1559192d0421", + "url": "/static/media/close.a50ed734.svg" + }, + { + "revision": "6992069bbf19f28c476eb6b9f821a6f1", + "url": "/static/media/info.6992069b.svg" + }, + { + "revision": "7a17a52de705cddc0900c72c2f8a624f", + "url": "/static/media/twitter.7a17a52d.svg" + } +]); \ No newline at end of file diff --git a/client/build/robots.txt b/client/build/robots.txt new file mode 100644 index 0000000..01b0f9a --- /dev/null +++ b/client/build/robots.txt @@ -0,0 +1,2 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * diff --git a/client/build/service-worker.js b/client/build/service-worker.js new file mode 100644 index 0000000..1c233d3 --- /dev/null +++ b/client/build/service-worker.js @@ -0,0 +1,39 @@ +/** + * Welcome to your Workbox-powered service worker! + * + * You'll need to register this file in your web app and you should + * disable HTTP caching for this file too. + * See https://goo.gl/nhQhGp + * + * The rest of the code is auto-generated. Please don't update this file + * directly; instead, make changes to your Workbox build configuration + * and re-run your build process. + * See https://goo.gl/2aRDsh + */ + +importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); + +importScripts( + "/precache-manifest.427b5bc5575ba30105e2f96a59bc3bcd.js" +); + +self.addEventListener('message', (event) => { + if (event.data && event.data.type === 'SKIP_WAITING') { + self.skipWaiting(); + } +}); + +workbox.core.clientsClaim(); + +/** + * The workboxSW.precacheAndRoute() method efficiently caches and responds to + * requests for URLs in the manifest. + * See https://goo.gl/S9QRab + */ +self.__precacheManifest = [].concat(self.__precacheManifest || []); +workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); + +workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/index.html"), { + + blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/], +}); diff --git a/client/build/static/css/main.a3ee530a.chunk.css b/client/build/static/css/main.a3ee530a.chunk.css new file mode 100644 index 0000000..63e0d48 --- /dev/null +++ b/client/build/static/css/main.a3ee530a.chunk.css @@ -0,0 +1,2 @@ +@font-face{font-family:Roboto;src:url(/static/media/Roboto-Black.5ebb24ee.ttf) format("truetype");font-weight:900}@font-face{font-family:Roboto;src:url(/static/media/Roboto-Regular.11eabca2.ttf) format("truetype");font-weight:400}@font-face{font-family:Roboto;src:url(/static/media/Roboto-Light.88823c20.ttf) format("truetype");font-weight:300}@font-face{font-family:Signika;src:url(/static/media/Signika-Bold.6bc3acea.ttf) format("truetype")}*,:after,:before{box-sizing:border-box;-webkit-box-sizing:border-box!important;-moz-box-sizing:border-box!important;-ms-box-sizing:border-box!important}body{margin:0;font-family:Roboto,sans-serif;font-size:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:fixed;overflow:hidden;-ms-scroll-chaining:none;overscroll-behavior:contain;--accent-color-1:#ff5853;--base-black-1:#1f2532;--base-white-1:#fffcf2;--display-font:"Signika";--body-font:"Roboto"}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.mapLayer{height:100vh;height:calc(var(--vh, 1vh)*100);overflow:hidden}.cityDetailView,.mapLayer{width:100vw;width:calc(var(--vw, 1vw)*100)}.cityDetailView{position:absolute;height:90vh;height:calc(var(--vh, 1vh)*90);bottom:0;right:0;overflow:scroll;background-color:var(--base-white-1);color:var(--base-black-1);display:grid;grid-template-rows:7rem 1fr;grid-template-columns:1fr minmax(0,33rem) 1fr;z-index:10;overflow-wrap:break-word;word-wrap:break-word}.cityDetailView_Header{display:flex;width:inherit;justify-content:space-between;padding:1.3rem;grid-column:span 3;border-bottom:1px solid var(--base-black-1);font-family:var(--body-font),sans-serif;font-weight:900}.cityDetailView_videoList{padding:0 1.3rem 10rem;grid-column:2;max-width:100%;display:inline-block}@media(min-width:1024px){.cityDetailView{top:0;right:0;height:100vh;height:calc(var(--vh, 1vh)*100);grid-template-columns:100vw;grid-template-columns:calc(var(--vw, 1vw)*100)}.cityDetailView_Header,.cityDetailView_videoList{width:inherit;grid-column:1}.cityDetailView_videoList{justify-self:start}}.close_btn,.marker_btn{background:none;border:none;cursor:pointer}.marker_btn{display:grid;justify-items:center}.marker_txt{background-color:var(--accent-color-1);opacity:.8;color:var(--base-white-1);font-weight:700;font-size:.9rem;margin-bottom:0;border-radius:3rem;display:flex;align-items:center}.marker_txt p{flex-grow:1}.close_btn{width:3rem;height:3rem;align-self:center}.close_btn img{display:block;width:1.5rem;height:1.5rem;margin:0 auto}.linkCard{margin-bottom:2.5rem;padding-bottom:1.5rem;border-bottom:1px solid var(--base-black-1);font-weight:400}.linkCard,.linkCard h2{font-family:var(--body-font),sans-serif}.linkCard h2{font-weight:900;font-size:1.2rem}.linkCard p{color:#888}.rawLink{display:"block";margin-bottom:.5rem;color:var(--accent-color-1)}.submitFormContainer{position:absolute;right:0;width:100%;background-color:var(--base-black-1);color:var(--base-white-1);border-radius:8px 8px 0 0;box-shadow:-2.8px -2.8px 2.2px rgba(0,0,0,.034),-6.7px -6.7px 5.3px rgba(0,0,0,.048),-12.5px -12.5px 10px rgba(0,0,0,.06),-22.3px -22.3px 17.9px rgba(0,0,0,.072),-41.8px -41.8px 33.4px rgba(0,0,0,.086),-100px -100px 80px rgba(0,0,0,.12);z-index:20;overflow:hidden}@media(min-width:1024px){.submitFormContainer{width:380px}}.submitFormBody{padding:0 1.3rem 3rem}.submitFormContainer form{display:grid;grid-template-columns:2.5rem 1fr;grid-gap:1rem;margin:2rem 0}.field{grid-column:span 2;display:grid;grid-gap:inherit;grid-template-columns:2.5em 1fr;grid-template-columns:subgrid;align-items:center}.field input{border-radius:.5em;border:none;padding:1em;opacity:.9;max-width:50rem;font-size:1rem}.primary_btn{cursor:pointer;background-color:var(--accent-color-1);color:var(--base-white-1);border:none;font-weight:700;border-radius:1rem;font-size:.9rem}.submitFormContainer .submitButton{grid-column:2;height:3.5em;max-width:16em}.sendVideoMessage{font-size:.9rem}.toggleCloseButton{display:flex;width:100%;height:50px;border:none;border-radius:8px 8px 0 0;color:var(--base-white-1);cursor:pointer;padding:5px 20px;align-items:center}.toggleCloseButton img{margin-right:.5rem}.toggleCloseButton p{font-weight:700;font-size:.9rem}@media(max-width:720px){.toggleCloseButton:focus{outline:none}}.thankYouBody{padding:1.3rem;display:flex;flex-direction:column;align-items:center;text-align:center}.thankYouBody h1{margin-bottom:.1rem}.thankYouBody p{margin-bottom:.5rem}.thankYouBody img{order:-1;height:10rem}.doneButton{width:10rem;height:3rem;margin-top:1rem}.introScreenContainer{width:100vw;width:calc(var(--vw, 1vw)*100);height:100vh;height:calc(var(--vh, 1vh)*100);position:absolute;padding:0 2rem;background-color:rgba(255,88,83,.9);color:var(--base-white-1);top:0;left:0;z-index:30;text-align:center;display:grid;grid-template-columns:1fr minmax(320px,500px) 1fr;align-items:center;overflow:scroll;font-family:var(--display-font),var(--body-font),sans-serif}.introScreenContent{grid-column:2;opacity:1;font-size:1rem}.introScreenContent p{font-family:var(--body-font),sans-serif;font-size:1rem;line-height:1.4}@media(min-width:1024px){.introScreenContent p{font-size:1.2rem}}.introScreenContent button{width:12em;height:3em;margin-top:1em;background-color:var(--base-white-1);color:var(--accent-color-1);font-size:1.1rem}.secNavContainer{display:flex;list-style:none;position:absolute;top:1.3rem;right:1.3rem;z-index:5;padding-left:0}.secNavContainer li{margin-right:1em}.secNavContainer li:last-of-type{margin-right:0}.secNavContainer a{color:var(--base-white-1);text-decoration:none;background-repeat:no-repeat;padding:1.2rem;background-position:100%}.secNavContainer a:hover{font-weight:700}@media(min-width:1024px){.secNavContainer a{background-position:0;padding-left:2rem}.secNavContainer a:after{content:attr(datacontent)}.secNavContainer a:hover{opacity:1}}@media(max-width:720px){#twitterNav{display:none}.secNavContainer li{margin-right:0}}.aboutContainer{width:100vw;width:calc(var(--vw, 1vw)*100);height:100vh;height:calc(var(--vh, 1vh)*100);position:absolute;z-index:40;top:0;left:0;display:grid}.aboutBGscreen{top:0;left:0;background-color:rgba(31,37,50,.8);width:100%;height:100%;cursor:pointer}.aboutBGscreen,.aboutContent{grid-column:1/-1;grid-row:1/-1}.aboutContent{align-self:center;justify-self:center;background-color:var(--base-white-1);border-radius:8px;height:90vh;height:calc(var(--vh, 1vh)*90);width:90vw;width:calc(var(--vw, 1vw)*90);max-height:40rem;max-width:30rem;padding:1.3rem 1.3rem 0;overflow:scroll}.aboutContentHeader{display:flex}.aboutContentHeader h1{flex-grow:1;font-family:var(--display-font),sans-serif}.aboutContentBody p,.aboutHGcontent p{line-height:1.4}.aboutCardContainer{text-decoration:none}.aboutCard{display:flex;align-items:center;background-color:#fff;padding:1.3rem;border-radius:8px;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);margin-bottom:1rem}.aboutCard img{max-width:3rem;height:auto;margin-right:1rem;border-radius:8px}.smalltext{color:var(--base-black-1)}.aboutCard .smalltext{margin-bottom:.2rem;font-size:.9rem}.socialLink{font-weight:700;margin-top:0;color:var(--accent-color-1)}.aboutCAAcontent{background-color:#dad6d6;margin-left:-1.3rem;margin-right:-1.3rem;padding:1.3rem;margin-top:2rem}.aboutCAAcontent ul{list-style:none;padding-left:0}.aboutCAAcontent h4{margin-bottom:0}.aboutCAAcontent li{padding:.5rem 0}.link,.link:visited{color:var(--accent-color-1)}.link:hover{font-weight:700} +/*# sourceMappingURL=main.a3ee530a.chunk.css.map */ \ No newline at end of file diff --git a/client/build/static/css/main.a3ee530a.chunk.css.map b/client/build/static/css/main.a3ee530a.chunk.css.map new file mode 100644 index 0000000..0393941 --- /dev/null +++ b/client/build/static/css/main.a3ee530a.chunk.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.css","App.css"],"names":[],"mappings":"AAAA,WACE,kBAAqB,CACrB,mEAAqD,CACrD,eACF,CACA,WACE,kBAAqB,CACrB,qEAAuD,CACvD,eACF,CACA,WACE,kBAAqB,CACrB,mEAAqD,CACrD,eACF,CACA,WACE,mBAAsB,CACtB,mEACF,CAQA,iBACE,qBAAsB,CACtB,uCAAyC,CACzC,oCAAsC,CACtC,mCACF,CAEA,KACE,QAAS,CAIT,6BAAiC,CACjC,cAAe,CACf,kCAAmC,CACnC,iCAAkC,CAClC,cAAe,CACf,eAAgB,CAChB,wBAA4B,CAA5B,2BAA4B,CAC5B,wBAAyB,CACzB,sBAAuB,CACvB,sBAAuB,CACvB,wBAAyB,CACzB,oBACF,CAEA,KACE,uEAEF,CCvDA,UAEE,YAAkC,CAAlC,+BAAkC,CAClC,eACF,CAEA,0BALE,WAAiC,CAAjC,8BAoBF,CAfA,gBACE,iBAAkB,CAElB,WAAiC,CAAjC,8BAAiC,CACjC,QAAS,CACT,OAAQ,CACR,eAAgB,CAChB,oCAAqC,CACrC,yBAA0B,CAC1B,YAAa,CACb,2BAA4B,CAC5B,6CAA+C,CAC/C,UAAW,CACX,wBAAyB,CACzB,oBACF,CAEA,uBACE,YAAa,CACb,aAAc,CACd,6BAA8B,CAC9B,cAAe,CACf,kBAAmB,CACnB,2CAA4C,CAC5C,uCAAyC,CACzC,eACF,CAEA,0BACE,sBAA8B,CAC9B,aAAc,CACd,cAAe,CACf,oBACF,CAEA,yBACE,gBACE,KAAM,CACN,OAAQ,CACR,YAAkC,CAAlC,+BAAkC,CAClC,2BAAiD,CAAjD,8CACF,CAKA,iDAHE,aAAc,CACd,aAMF,CAJA,0BAGE,kBACF,CACF,CAEA,uBACE,eAAgB,CAChB,WAAY,CACZ,cACF,CAEA,YACE,YAAa,CACb,oBACF,CAEA,YACE,sCAAuC,CACvC,UAAa,CAIb,yBAA0B,CAC1B,eAAiB,CACjB,eAAiB,CACjB,eAAmB,CACnB,kBAAmB,CACnB,YAAa,CACb,kBACF,CAEA,cACE,WACF,CAEA,WACE,UAAW,CACX,WAAY,CACZ,iBACF,CAEA,eACE,aAAc,CACd,YAAa,CACb,aAAc,CACd,aACF,CAEA,UACE,oBAAqB,CACrB,qBAAsB,CACtB,2CAA4C,CAE5C,eACF,CAEA,uBAJE,uCAQF,CAJA,aAEE,eAAgB,CAChB,gBACF,CAEA,YACE,UACF,CAEA,SACE,eAAgB,CAChB,mBAAqB,CACrB,2BACF,CAGA,qBACE,iBAAkB,CAClB,OAAU,CACV,UAAW,CACX,oCAAqC,CACrC,yBAA0B,CAC1B,yBAA0B,CAe1B,4OAMwC,CACxC,UAAW,CACX,eACF,CAEA,yBACE,qBACE,WACF,CACF,CAEA,gBACE,qBACF,CAEA,0BACE,YAAa,CACb,gCAAiC,CACjC,aAAc,CACd,aACF,CAEA,OACE,kBAAmB,CACnB,YAAa,CACb,gBAAiB,CACjB,+BAAgC,CAChC,6BAA8B,CAC9B,kBACF,CAEA,aACE,kBAAoB,CACpB,WAAY,CACZ,WAAY,CACZ,UAAY,CACZ,eAAgB,CAChB,cACF,CAEA,aACE,cAAe,CACf,sCAAuC,CACvC,yBAA0B,CAC1B,WAAY,CACZ,eAAiB,CACjB,kBAAmB,CACnB,eACF,CAEA,mCACE,aAAc,CACd,YAAa,CACb,cACF,CAEA,kBACE,eACF,CAEA,mBACE,YAAa,CACb,UAAW,CACX,WAAY,CACZ,WAAY,CACZ,yBAA2B,CAC3B,yBAA0B,CAC1B,cAAe,CACf,gBAAiB,CACjB,kBACF,CAEA,uBACE,kBACF,CAEA,qBACE,eAAiB,CACjB,eACF,CAEA,wBACE,yBACE,YACF,CACF,CAEA,cACE,cAAe,CACf,YAAa,CACb,qBAAsB,CACtB,kBAAmB,CACnB,iBACF,CAEA,iBACE,mBACF,CAEA,gBACE,mBACF,CAEA,kBACE,QAAS,CACT,YACF,CAEA,YACE,WAAY,CACZ,WAAY,CACZ,eACF,CAEA,sBACE,WAAiC,CAAjC,8BAAiC,CACjC,YAAkC,CAAlC,+BAAkC,CAClC,iBAAkB,CAClB,cAAsB,CACtB,mCAAwC,CACxC,yBAA0B,CAC1B,KAAM,CACN,MAAO,CACP,UAAW,CACX,iBAAkB,CAClB,YAAa,CACb,iDAAmD,CACnD,kBAAmB,CACnB,eAAgB,CAChB,2DACF,CAEA,oBACE,aAAc,CACd,SAAY,CACZ,cACF,CAEA,sBACE,uCAAyC,CACzC,cAAe,CACf,eACF,CAEA,yBACE,sBACE,gBACF,CACF,CAEA,2BACE,UAAW,CACX,UAAW,CACX,cAAe,CACf,oCAAqC,CACrC,2BAA4B,CAC5B,gBACF,CAEA,iBACE,YAAa,CACb,eAAgB,CAChB,iBAAkB,CAClB,UAAW,CACX,YAAa,CACb,SAAU,CACV,cACF,CAEA,oBACE,gBACF,CAEA,iCACE,cACF,CAEA,mBACE,yBAA0B,CAC1B,oBAAqB,CACrB,2BAA4B,CAC5B,cAAe,CACf,wBACF,CAEA,yBACE,eACF,CAEA,yBACE,mBACE,qBAAgC,CAChC,iBACF,CACA,yBACE,yBACF,CACA,yBACE,SACF,CACF,CAEA,wBACE,YACE,YACF,CACA,oBACE,cACF,CACF,CAEA,gBACE,WAAiC,CAAjC,8BAAiC,CACjC,YAAkC,CAAlC,+BAAkC,CAClC,iBAAkB,CAClB,UAAW,CACX,KAAM,CACN,MAAO,CACP,YACF,CAEA,eAGE,KAAM,CACN,MAAO,CACP,kCAAsC,CACtC,UAAW,CACX,WAAY,CACZ,cACF,CAEA,6BAVE,gBAAiB,CACjB,aAsBF,CAbA,cAGE,iBAAkB,CAClB,mBAAoB,CACpB,oCAAqC,CACrC,iBAAkB,CAClB,WAAiC,CAAjC,8BAAiC,CACjC,UAAgC,CAAhC,6BAAgC,CAChC,gBAAiB,CACjB,eAAgB,CAChB,uBAA+B,CAC/B,eACF,CAEA,oBACE,YACF,CAEA,uBACE,WAAY,CACZ,0CACF,CAEA,sCACE,eACF,CAEA,oBACE,oBACF,CAEA,WACE,YAAa,CACb,kBAAmB,CAGnB,qBAAqC,CACrC,cAAe,CACf,iBAAkB,CAClB,uEAAiF,CACjF,kBACF,CAEA,eACE,cAAe,CACf,WAAY,CACZ,iBAAkB,CAClB,iBACF,CAEA,WACE,yBACF,CAEA,sBACE,mBAAqB,CACrB,eACF,CAEA,YACE,eAAiB,CACjB,YAAa,CACb,2BACF,CAEA,iBACE,wBAAyB,CACzB,mBAAoB,CACpB,oBAAqB,CACrB,cAAe,CACf,eACF,CAEA,oBACE,eAAgB,CAChB,cACF,CAEA,oBACE,eACF,CAEA,oBACE,eACF,CAEA,oBACE,2BACF,CAEA,YACE,eACF","file":"main.a3ee530a.chunk.css","sourcesContent":["@font-face {\r\n font-family: 'Roboto';\r\n src: url(./fonts/Roboto-Black.ttf) format('truetype');\r\n font-weight: 900\r\n}\r\n@font-face {\r\n font-family: 'Roboto';\r\n src: url(./fonts/Roboto-Regular.ttf) format('truetype');\r\n font-weight: 400;\r\n}\r\n@font-face {\r\n font-family: 'Roboto';\r\n src: url(./fonts/Roboto-Light.ttf) format('truetype');\r\n font-weight: 300;\r\n}\r\n@font-face {\r\n font-family: 'Signika';\r\n src: url(./fonts/Signika-Bold.ttf) format('truetype');\r\n}\r\n\r\n* {\r\n box-sizing: border-box;\r\n -webkit-box-sizing: border-box !important;\r\n -moz-box-sizing: border-box !important;\r\n -ms-box-sizing: border-box !important;\r\n}\r\n*, *::before, *::after {\r\n box-sizing: border-box;\r\n -webkit-box-sizing: border-box !important;\r\n -moz-box-sizing: border-box !important;\r\n -ms-box-sizing: border-box !important;\r\n}\r\n\r\nbody {\r\n margin: 0;\r\n /* font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\r\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\r\n sans-serif; */\r\n font-family: 'Roboto', sans-serif;\r\n font-size: 100%;\r\n -webkit-font-smoothing: antialiased;\r\n -moz-osx-font-smoothing: grayscale;\r\n position: fixed;\r\n overflow: hidden;\r\n overscroll-behavior: contain;\r\n --accent-color-1: #FF5853;\r\n --base-black-1: #1f2532;\r\n --base-white-1: #fffcf2;\r\n --display-font: 'Signika';\r\n --body-font: 'Roboto';\r\n}\r\n\r\ncode {\r\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\r\n monospace;\r\n}\r\n",".mapLayer {\r\n width: calc(var(--vw, 1vw) * 100);\r\n height: calc(var(--vh, 1vh) * 100);\r\n overflow: hidden;\r\n}\r\n\r\n.cityDetailView {\r\n position: absolute;\r\n width: calc(var(--vw, 1vw) * 100);\r\n height: calc(var(--vh, 1vh) * 90);\r\n bottom: 0;\r\n right: 0;\r\n overflow: scroll;\r\n background-color: var(--base-white-1);\r\n color: var(--base-black-1);\r\n display: grid;\r\n grid-template-rows: 7rem 1fr;\r\n grid-template-columns: 1fr minmax(0, 33rem) 1fr;\r\n z-index: 10;\r\n overflow-wrap: break-word;\r\n word-wrap: break-word;\r\n}\r\n\r\n.cityDetailView_Header {\r\n display: flex;\r\n width: inherit;\r\n justify-content: space-between;\r\n padding: 1.3rem;\r\n grid-column: span 3;\r\n border-bottom: 1px solid var(--base-black-1);\r\n font-family: var(--body-font), sans-serif;\r\n font-weight: 900;\r\n}\r\n\r\n.cityDetailView_videoList {\r\n padding: 0 1.3rem 10rem 1.3rem;\r\n grid-column: 2;\r\n max-width: 100%;\r\n display: inline-block;\r\n}\r\n\r\n@media(min-width: 1024px) {\r\n .cityDetailView {\r\n top: 0;\r\n right: 0;\r\n height: calc(var(--vh, 1vh) * 100);\r\n grid-template-columns: calc(var(--vw, 1vw) * 100);\r\n }\r\n .cityDetailView_Header {\r\n width: inherit;\r\n grid-column: 1;\r\n }\r\n .cityDetailView_videoList {\r\n width: inherit;\r\n grid-column: 1;\r\n justify-self: start;\r\n }\r\n}\r\n\r\n.marker_btn, .close_btn {\r\n background: none;\r\n border: none;\r\n cursor: pointer;\r\n}\r\n\r\n.marker_btn {\r\n display: grid;\r\n justify-items: center;\r\n}\r\n\r\n.marker_txt {\r\n background-color: var(--accent-color-1);\r\n opacity: 0.80;\r\n /* width: 3rem;\r\n height: 3rem;\r\n line-height: 3rem; */\r\n color: var(--base-white-1);\r\n font-weight: bold;\r\n font-size: 0.9rem;\r\n margin-bottom: 0rem;\r\n border-radius: 3rem;\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n.marker_txt p{\r\n flex-grow: 1;\r\n}\r\n\r\n.close_btn {\r\n width: 3rem;\r\n height: 3rem;\r\n align-self: center;\r\n}\r\n\r\n.close_btn img {\r\n display: block;\r\n width: 1.5rem;\r\n height: 1.5rem;\r\n margin: 0 auto;\r\n}\r\n\r\n.linkCard {\r\n margin-bottom: 2.5rem;\r\n padding-bottom: 1.5rem;\r\n border-bottom: 1px solid var(--base-black-1);\r\n font-family: var(--body-font), sans-serif;\r\n font-weight: 400;\r\n}\r\n\r\n.linkCard h2{\r\n font-family: var(--body-font), sans-serif;\r\n font-weight: 900;\r\n font-size: 1.2rem;\r\n}\r\n\r\n.linkCard p {\r\n color: #888;\r\n}\r\n\r\n.rawLink {\r\n display: \"block\";\r\n margin-bottom: 0.5rem;\r\n color: var(--accent-color-1);\r\n}\r\n\r\n\r\n.submitFormContainer {\r\n position: absolute;\r\n right: 0px;\r\n width: 100%;\r\n background-color: var(--base-black-1);\r\n color: var(--base-white-1);\r\n border-radius: 8px 8px 0 0;\r\n -moz-box-shadow:\r\n -2.8px -2.8px 2.2px rgba(0, 0, 0, 0.034),\r\n -6.7px -6.7px 5.3px rgba(0, 0, 0, 0.048),\r\n -12.5px -12.5px 10px rgba(0, 0, 0, 0.06),\r\n -22.3px -22.3px 17.9px rgba(0, 0, 0, 0.072),\r\n -41.8px -41.8px 33.4px rgba(0, 0, 0, 0.086),\r\n -100px -100px 80px rgba(0, 0, 0, 0.12);\r\n -webkit-box-shadow:\r\n -2.8px -2.8px 2.2px rgba(0, 0, 0, 0.034),\r\n -6.7px -6.7px 5.3px rgba(0, 0, 0, 0.048),\r\n -12.5px -12.5px 10px rgba(0, 0, 0, 0.06),\r\n -22.3px -22.3px 17.9px rgba(0, 0, 0, 0.072),\r\n -41.8px -41.8px 33.4px rgba(0, 0, 0, 0.086),\r\n -100px -100px 80px rgba(0, 0, 0, 0.12);\r\n box-shadow:\r\n -2.8px -2.8px 2.2px rgba(0, 0, 0, 0.034),\r\n -6.7px -6.7px 5.3px rgba(0, 0, 0, 0.048),\r\n -12.5px -12.5px 10px rgba(0, 0, 0, 0.06),\r\n -22.3px -22.3px 17.9px rgba(0, 0, 0, 0.072),\r\n -41.8px -41.8px 33.4px rgba(0, 0, 0, 0.086),\r\n -100px -100px 80px rgba(0, 0, 0, 0.12);\r\n z-index: 20;\r\n overflow: hidden;\r\n}\r\n\r\n@media(min-width: 1024px) {\r\n .submitFormContainer {\r\n width: 380px;\r\n }\r\n}\r\n\r\n.submitFormBody{\r\n padding: 0 1.3rem 3rem 1.3rem;\r\n}\r\n\r\n.submitFormContainer form {\r\n display: grid;\r\n grid-template-columns: 2.5rem 1fr;\r\n grid-gap: 1rem;\r\n margin: 2rem 0 2rem 0;\r\n}\r\n\r\n.field {\r\n grid-column: span 2;\r\n display: grid;\r\n grid-gap: inherit;\r\n grid-template-columns: 2.5em 1fr;\r\n grid-template-columns: subgrid;\r\n align-items: center;\r\n}\r\n\r\n.field input {\r\n border-radius: 0.5em;\r\n border: none;\r\n padding: 1em;\r\n opacity: 0.9;\r\n max-width: 50rem;\r\n font-size: 1rem;\r\n}\r\n\r\n.primary_btn {\r\n cursor: pointer;\r\n background-color: var(--accent-color-1);\r\n color: var(--base-white-1);\r\n border: none;\r\n font-weight: bold;\r\n border-radius: 1rem;\r\n font-size: 0.9rem;\r\n}\r\n\r\n.submitFormContainer .submitButton {\r\n grid-column: 2;\r\n height: 3.5em;\r\n max-width: 16em;\r\n}\r\n\r\n.sendVideoMessage {\r\n font-size: 0.9rem;\r\n}\r\n\r\n.toggleCloseButton {\r\n display: flex;\r\n width: 100%;\r\n height: 50px;\r\n border: none;\r\n border-radius: 8px 8px 0 0 ;\r\n color: var(--base-white-1);\r\n cursor: pointer;\r\n padding: 5px 20px;\r\n align-items: center;\r\n}\r\n\r\n.toggleCloseButton img{\r\n margin-right: 0.5rem;\r\n}\r\n\r\n.toggleCloseButton p {\r\n font-weight: bold;\r\n font-size: 0.9rem;\r\n}\r\n\r\n@media(max-width: 720px) {\r\n .toggleCloseButton:focus {\r\n outline: none;\r\n }\r\n}\r\n\r\n.thankYouBody {\r\n padding: 1.3rem;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n text-align: center ;\r\n}\r\n\r\n.thankYouBody h1 {\r\n margin-bottom: 0.1rem;\r\n}\r\n\r\n.thankYouBody p {\r\n margin-bottom: 0.5rem;\r\n}\r\n\r\n.thankYouBody img {\r\n order: -1;\r\n height: 10rem;\r\n}\r\n\r\n.doneButton {\r\n width: 10rem;\r\n height: 3rem;\r\n margin-top: 1rem;\r\n}\r\n\r\n.introScreenContainer {\r\n width: calc(var(--vw, 1vw) * 100);\r\n height: calc(var(--vh, 1vh) * 100);\r\n position: absolute;\r\n padding: 0 2rem 0 2rem;\r\n background-color: rgb(255, 88, 83, 0.90);\r\n color: var(--base-white-1);\r\n top: 0;\r\n left: 0;\r\n z-index: 30;\r\n text-align: center;\r\n display: grid;\r\n grid-template-columns: 1fr minmax(320px, 500px) 1fr;\r\n align-items: center;\r\n overflow: scroll;\r\n font-family: var(--display-font), var(--body-font), sans-serif;\r\n}\r\n\r\n.introScreenContent {\r\n grid-column: 2;\r\n opacity: 1.0;\r\n font-size: 1rem;\r\n}\r\n\r\n.introScreenContent p {\r\n font-family: var(--body-font), sans-serif;\r\n font-size: 1rem;\r\n line-height: 1.4;\r\n}\r\n\r\n@media(min-width: 1024px) {\r\n .introScreenContent p{\r\n font-size: 1.2rem;\r\n }\r\n}\r\n\r\n.introScreenContent button {\r\n width: 12em;\r\n height: 3em;\r\n margin-top: 1em;\r\n background-color: var(--base-white-1);\r\n color: var(--accent-color-1);\r\n font-size: 1.1rem;\r\n}\r\n\r\n.secNavContainer {\r\n display: flex;\r\n list-style: none;\r\n position: absolute;\r\n top: 1.3rem;\r\n right: 1.3rem;\r\n z-index: 5;\r\n padding-left: 0;\r\n}\r\n\r\n.secNavContainer li {\r\n margin-right: 1em;\r\n}\r\n\r\n.secNavContainer li:last-of-type {\r\n margin-right: 0;\r\n}\r\n\r\n.secNavContainer a {\r\n color: var(--base-white-1);\r\n text-decoration: none;\r\n background-repeat: no-repeat;\r\n padding: 1.2rem;\r\n background-position: center right;\r\n}\r\n\r\n.secNavContainer a:hover {\r\n font-weight: bold;\r\n}\r\n\r\n@media(min-width: 1024px) {\r\n .secNavContainer a {\r\n background-position: center left;\r\n padding-left: 2rem;\r\n }\r\n .secNavContainer a::after {\r\n content: attr(datacontent);\r\n }\r\n .secNavContainer a:hover {\r\n opacity: 1;\r\n }\r\n}\r\n\r\n@media(max-width: 720px) {\r\n #twitterNav {\r\n display: none;\r\n }\r\n .secNavContainer li {\r\n margin-right: 0;\r\n }\r\n}\r\n\r\n.aboutContainer {\r\n width: calc(var(--vw, 1vw) * 100);\r\n height: calc(var(--vh, 1vh) * 100);\r\n position: absolute;\r\n z-index: 40;\r\n top: 0;\r\n left: 0;\r\n display: grid;\r\n}\r\n\r\n.aboutBGscreen {\r\n grid-column: 1/-1;\r\n grid-row: 1/-1;\r\n top: 0;\r\n left: 0;\r\n background-color: rgb(31, 37, 50, 0.8);\r\n width: 100%;\r\n height: 100%;\r\n cursor: pointer;\r\n}\r\n\r\n.aboutContent {\r\n grid-column: 1/-1;\r\n grid-row: 1/-1;\r\n align-self: center;\r\n justify-self: center;\r\n background-color: var(--base-white-1);\r\n border-radius: 8px;\r\n height: calc(var(--vh, 1vh) * 90);\r\n width: calc(var(--vw, 1vw) * 90);\r\n max-height: 40rem;\r\n max-width: 30rem;\r\n padding: 1.3rem 1.3rem 0 1.3rem;\r\n overflow: scroll;\r\n}\r\n\r\n.aboutContentHeader {\r\n display: flex;\r\n}\r\n\r\n.aboutContentHeader h1 {\r\n flex-grow: 1;\r\n font-family: var(--display-font), sans-serif;\r\n}\r\n\r\n.aboutContentBody p, .aboutHGcontent p{\r\n line-height: 1.4;\r\n}\r\n\r\n.aboutCardContainer {\r\n text-decoration: none;\r\n}\r\n\r\n.aboutCard {\r\n display: flex;\r\n align-items: center;\r\n /* border-top: 1px solid var(--base-black-1);\r\n border-bottom: 1px solid var(--base-black-1); */\r\n background-color: rgba(255, 255, 255);\r\n padding: 1.3rem;\r\n border-radius: 8px;\r\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\r\n margin-bottom: 1rem;\r\n}\r\n\r\n.aboutCard img{\r\n max-width: 3rem;\r\n height: auto;\r\n margin-right: 1rem;\r\n border-radius: 8px;\r\n}\r\n\r\n.smalltext {\r\n color: var(--base-black-1);\r\n}\r\n\r\n.aboutCard .smalltext {\r\n margin-bottom: 0.2rem;\r\n font-size: 0.9rem;\r\n}\r\n\r\n.socialLink {\r\n font-weight: bold;\r\n margin-top: 0;\r\n color: var(--accent-color-1);\r\n}\r\n\r\n.aboutCAAcontent {\r\n background-color: #dad6d6;\r\n margin-left: -1.3rem;\r\n margin-right: -1.3rem;\r\n padding: 1.3rem;\r\n margin-top: 2rem;\r\n}\r\n\r\n.aboutCAAcontent ul {\r\n list-style: none;\r\n padding-left: 0;\r\n}\r\n\r\n.aboutCAAcontent h4 {\r\n margin-bottom: 0;\r\n}\r\n\r\n.aboutCAAcontent li {\r\n padding: 0.5rem 0;\r\n}\r\n\r\n.link, .link:visited {\r\n color: var(--accent-color-1);\r\n}\r\n\r\n.link:hover {\r\n font-weight: bold;\r\n}\r\n"]} \ No newline at end of file diff --git a/client/build/static/js/2.a9e2dd78.chunk.js b/client/build/static/js/2.a9e2dd78.chunk.js new file mode 100644 index 0000000..9c7daa6 --- /dev/null +++ b/client/build/static/js/2.a9e2dd78.chunk.js @@ -0,0 +1,3 @@ +/*! For license information please see 2.a9e2dd78.chunk.js.LICENSE */ +(this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[2],[function(t,e,n){"use strict";t.exports=n(46)},function(t,e,n){t.exports=n(62)()},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__exportStar",(function(){return p})),n.d(e,"__values",(function(){return f})),n.d(e,"__read",(function(){return d})),n.d(e,"__spread",(function(){return m})),n.d(e,"__spreadArrays",(function(){return y})),n.d(e,"__await",(function(){return g})),n.d(e,"__asyncGenerator",(function(){return v})),n.d(e,"__asyncDelegator",(function(){return _})),n.d(e,"__asyncValues",(function(){return b})),n.d(e,"__makeTemplateObject",(function(){return w})),n.d(e,"__importStar",(function(){return x})),n.d(e,"__importDefault",(function(){return E}));var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function h(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function d(t,e){var n="function"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function m(){for(var t=[],e=0;e1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof g?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:g(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function b(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=f(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function w(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function x(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function E(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){for(var n=0;n=0&&m.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n ")}var w=v.initializeApp;v.initializeApp=function(){for(var t=[],e=0;e>6|192,e[n++]=63&i|128):55296===(64512&i)&&r+1>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},u={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"===typeof atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i>2,h=(3&o)<<4|s>>4,p=(15&s)<<2|c>>6,f=63&c;u||(f=64,a||(p=64)),r.push(n[l],n[h],n[p],n[f])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(s(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n191&&i<224){var o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var a=((7&i)<<18|(63&(o=t[n++]))<<12|(63&(s=t[n++]))<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(1023&a))}else{o=t[n++];var s=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i>4;if(r.push(c),64!==s){var l=a<<4&240|s>>2;if(r.push(l),64!==u){var h=s<<6&192|u;r.push(h)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},c=function(t){try{return u.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function l(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var n in e)e.hasOwnProperty(n)&&(t[n]=l(t[n],e[n]));return t}var h=function(){function t(){var t=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))}return t.prototype.wrapCallback=function(t){var e=this;return function(n,r){n?e.reject(n):e.resolve(r),"function"===typeof t&&(e.promise.catch((function(){})),1===t.length?t(n):t(n,r))}},t}();function p(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""}var f="FirebaseError",d=function(t){function e(n,r){var i=t.call(this,r)||this;return i.code=n,i.name=f,Object.setPrototypeOf(i,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,m.prototype.create),i}return r.__extends(e,t),e}(Error),m=function(){function t(t,e,n){this.service=t,this.serviceName=e,this.errors=n}return t.prototype.create=function(t){for(var e=[],n=1;n"}))}var g=/\{\$([^}]+)}/g;function v(t){return JSON.parse(t)}var _=function(t){var e={},n={},r={},i="";try{var o=t.split(".");e=v(c(o[0])||""),n=v(c(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(a){}return{header:e,claims:n,data:r,signature:i}};var b=function(){function t(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var t=1;t>>31)}var o,a,s=this.chain_[0],u=this.chain_[1],c=this.chain_[2],l=this.chain_[3],h=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(o=l^u&(c^l),a=1518500249):(o=u^c^l,a=1859775393):r<60?(o=u&c|l&(u|c),a=2400959708):(o=u^c^l,a=3395469782);i=(s<<5|s>>>27)+o+h+a+n[r]&4294967295;h=l,l=c,c=4294967295&(u<<30|u>>>2),u=s,s=i}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+u&4294967295,this.chain_[2]=this.chain_[2]+c&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+h&4294967295},t.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);for(var n=e-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r=56;n--)this.buf_[n]=255&e,e/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)t[r]=this.chain_[n]>>i&255,++r;return t},t}();var w=function(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((function(){t(n)})).catch((function(t){n.error(t)}))}return t.prototype.next=function(t){this.forEachObserver((function(e){e.next(t)}))},t.prototype.error=function(t){this.forEachObserver((function(e){e.error(t)})),this.close(t)},t.prototype.complete=function(){this.forEachObserver((function(t){t.complete()})),this.close()},t.prototype.subscribe=function(t,e,n){var r,i=this;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(t,e){if("object"!==typeof t||null===t)return!1;for(var n=0,r=e;n 4. Need to update it?")}var i=t+" failed: ";return i+=r+" argument "}e.CONSTANTS=i,e.Deferred=h,e.ErrorFactory=m,e.FirebaseError=d,e.Sha1=b,e.assert=o,e.assertionError=a,e.async=function(t,e){return function(){for(var n=[],r=0;r=r&&n<=i},e.issuedAtTime=function(t){var e=_(t).claims;return"object"===typeof e&&e.hasOwnProperty("iat")?e.iat:null},e.jsonEval=v,e.map=function(t,e,n){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=e.call(n,t[i],i,t));return r},e.querystring=function(t){for(var e=[],n=function(t,n){Array.isArray(n)?n.forEach((function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))})):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))},r=0,i=Object.entries(t);r=55296&&r<=56319?(e+=4,n++):e+=3}return e},e.stringToByteArray=function(t){for(var e=[],n=0,r=0;r=55296&&i<=56319){var a=i-55296;r++,o(r>6|192,e[n++]=63&i|128):i<65536?(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},e.stringify=function(t){return JSON.stringify(t)},e.validateArgCount=function(t,e,n,r){var i;if(rn&&(i=0===n?"none":"no more than "+n),i)throw new Error(t+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")},e.validateCallback=function(t,e,n,r){if((!r||n)&&"function"!==typeof n)throw new Error(E(t,e,r)+"must be a valid function.")},e.validateContextObject=function(t,e,n,r){if((!r||n)&&("object"!==typeof n||null===n))throw new Error(E(t,e,r)+"must be a valid context object.")},e.validateNamespace=function(t,e,n,r){if((!r||n)&&"string"!==typeof n)throw new Error(E(t,e,r)+"must be a valid firebase namespace.")}}).call(this,n(20))},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var r="undefined"!==typeof window?window:t,i=("undefined"!==typeof t||window,"undefined"!==typeof document?document:{})}).call(this,n(20))},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"reversed",(function(){return nt})),n.d(r,"mirrored",(function(){return rt})),n.d(r,"createReversedEasing",(function(){return it})),n.d(r,"createMirroredEasing",(function(){return ot})),n.d(r,"createExpoIn",(function(){return at})),n.d(r,"createBackIn",(function(){return st})),n.d(r,"createAnticipateEasing",(function(){return ut})),n.d(r,"linear",(function(){return ct})),n.d(r,"easeIn",(function(){return lt})),n.d(r,"easeOut",(function(){return ht})),n.d(r,"easeInOut",(function(){return pt})),n.d(r,"circIn",(function(){return ft})),n.d(r,"circOut",(function(){return dt})),n.d(r,"circInOut",(function(){return mt})),n.d(r,"backIn",(function(){return yt})),n.d(r,"backOut",(function(){return gt})),n.d(r,"backInOut",(function(){return vt})),n.d(r,"anticipate",(function(){return _t})),n.d(r,"bounceOut",(function(){return bt})),n.d(r,"bounceIn",(function(){return wt})),n.d(r,"bounceInOut",(function(){return xt})),n.d(r,"cubicBezier",(function(){return Nt}));var i=n(2),o=n(0),a=n.n(o),s=function(){},u=function(){};var c,l=0,h="undefined"!==typeof window&&void 0!==window.requestAnimationFrame?function(t){return window.requestAnimationFrame(t)}:function(t){var e=Date.now(),n=Math.max(0,16.7-(e-l));l=e+n,setTimeout((function(){return t(l)}),n)};!function(t){t.Read="read",t.Update="update",t.Render="render",t.PostRender="postRender",t.FixedUpdate="fixedUpdate"}(c||(c={}));var p=1/60*1e3,f=!0,d=!1,m=!1,y={delta:0,timestamp:0},g=[c.Read,c.Update,c.Render,c.PostRender],v=function(t){return d=t},_=g.reduce((function(t,e){var n=function(t){var e=[],n=[],r=0,i=!1,o=0,a=new WeakSet,s=new WeakSet,c={cancel:function(t){var e=n.indexOf(t);a.add(t),-1!==e&&n.splice(e,1)},process:function(u){var l,h;if(i=!0,e=(l=[n,e])[0],(n=l[1]).length=0,r=e.length)for(o=0;o4?(e=t.substr(1,2),n=t.substr(3,2),r=t.substr(5,2)):(e=t.substr(1,1),n=t.substr(2,1),r=t.substr(3,1),e+=e,n+=n,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:1}}}),$={test:function(t){return"string"===typeof t&&M.test(t)||G(t)||H(t)},parse:function(t){return Y.test(t)?Y.parse(t):Z.test(t)?Z.parse(t):J.test(t)?J.parse(t):t},transform:function(t){return G(t)?Y.transform(t):H(t)?Z.transform(t):t}},tt=function(t){return"number"===typeof t?0:t},et={test:function(t){if("string"!==typeof t||!isNaN(t))return!1;var e=0,n=t.match(P),r=t.match(D);return n&&(e+=n.length),r&&(e+=r.length),e>0},parse:function(t){var e=t,n=[],r=e.match(D);r&&(e=e.replace(D,"${c}"),n.push.apply(n,r.map($.parse)));var i=e.match(P);return i&&n.push.apply(n,i.map(R.parse)),n},createTransformer:function(t){var e=t,n=0,r=t.match(D),i=r?r.length:0;if(r)for(var o=0;o=Tt?function(e,r){for(var i=0,o=0;i0?i=a:r=a}while(Math.abs(o)>St&&++s=i.numNumbers,"Complex values '"+t+"' and '"+e+"' too different to mix. Ensure all colors are of the same type."),$t(ee(r.parsed,i.parsed),n)};var ie,oe=function(t){return t},ae=function(t){return void 0===t&&(t=oe),jt((function(e,n,r){var i=n-r,o=-(0-e+1)*(0-t(Math.abs(i)));return i<=0?n+o:n-o}))},se=(ae(),ae(Math.sqrt),function(t,e){return e?t*(1e3/e):0}),ue=(jt((function(t,e,n){var r=e-t;return((n-t)%r+r)%r+t})),zt(0,1),function(t){var e=t.onRead,n=t.onRender,r=t.uncachedValues,o=void 0===r?new Set:r,a=t.useCache,s=void 0===a||a;return function(t){void 0===t&&(t={});var r=Object(i.__rest)(t,[]),a={},u=[],c=!1;function l(t,e){t.startsWith("--")&&(r.hasCSSVariable=!0);var n=a[t];a[t]=e,a[t]!==n&&(-1===u.indexOf(t)&&u.push(t),c||(c=!0,I.render(h.render)))}var h={get:function(t,n){return void 0===n&&(n=!1),!n&&s&&!o.has(t)&&void 0!==a[t]?a[t]:e(t,r)},set:function(t,e){if("string"===typeof t)l(t,e);else for(var n in t)l(n,t[n]);return this},render:function(t){return void 0===t&&(t=!1),(c||!0===t)&&(n(a,r,u),c=!1,u.length=0),this}};return h}}),ce=/([a-z])([A-Z])/g,le=function(t){return t.replace(ce,"$1-$2").toLowerCase()},he=new Map,pe=new Map,fe=["Webkit","Moz","O","ms",""],de=fe.length,me="undefined"!==typeof document,ye=function(t,e){return pe.set(t,le(e))},ge=function(t,e){void 0===e&&(e=!1);var n=e?pe:he;return n.has(t)||(me?function(t){ie=ie||document.createElement("div");for(var e=0;ef||i<-f;r(o?v+i:v),o||(x.update(_),n())}),!0);return{stop:function(){return x.update(_)}}}))}),{from:R.test,modifyTarget:function(t){return"function"===typeof t},velocity:R.test}),fn=ln((function(t){return void 0===t&&(t={}),en((function(e){var n=e.update,r=e.complete,i=t.velocity,o=void 0===i?0:i,a=t.from,s=void 0===a?0:a,u=t.to,c=void 0===u?0:u,l=t.stiffness,h=void 0===l?100:l,p=t.damping,f=void 0===p?10:p,d=t.mass,m=void 0===d?1:d,y=t.restSpeed,g=void 0===y?.01:y,v=t.restDelta,_=void 0===v?.01:v,b=o?-o/1e3:0,w=0,E=c-s,T=s,S=T,C=I.update((function(t){var e=t.delta;w+=e;var i=f/(2*Math.sqrt(h*m)),a=Math.sqrt(h/m)/1e3;if(S=T,i<1){var s=Math.exp(-i*a*w),u=a*Math.sqrt(1-i*i);T=c-s*((b+i*a*E)/u*Math.sin(u*w)+E*Math.cos(u*w))}else{s=Math.exp(-a*w);T=c-s*(E+(b+a*E)*w)}o=se(T-S,e);var l=Math.abs(o)<=g,p=Math.abs(c-T)<=_;l&&p?(n(T=c),x.update(C),r()):n(T)}),!0);return{stop:function(){return x.update(C)}}}))}),{from:R.test,to:R.test,stiffness:R.test,damping:R.test,mass:R.test,velocity:R.test}),dn=ln((function(t){var e=t.from,n=void 0===e?0:e,r=t.velocity,o=void 0===r?0:r,a=t.min,s=t.max,u=t.power,c=void 0===u?.8:u,l=t.timeConstant,h=void 0===l?700:l,p=t.bounceStiffness,f=void 0===p?500:p,d=t.bounceDamping,m=void 0===d?10:d,y=t.restDelta,g=void 0===y?1:y,v=t.modifyTarget;return en((function(t){var e,r=t.update,u=t.complete,l=n,p=n,d=!1,y=function(t){return void 0!==a&&t<=a},_=function(t){return void 0!==s&&t>=s},b=function(t){return y(t)||_(t)},w=function(t){r(t),l=p,o=se((p=t)-l,C().delta),e&&!d&&function(t,e){return y(t)&&e<0||_(t)&&e>0}(t,o)&&E({from:t,velocity:o})},x=function(t,n){e&&e.stop(),e=t.start({update:w,complete:function(){n?n():u()}})},E=function(t){d=!0,x(fn(Object(i.__assign)({},t,{to:y(t.from)?a:s,stiffness:f,damping:m,restDelta:g})))};if(b(n))E({from:n,velocity:o});else if(0!==o){var T=pn({from:n,velocity:o,timeConstant:h,power:c,restDelta:b(n)?20:g,modifyTarget:v});x(T,(function(){b(p)?E({from:p,velocity:o}):u()}))}else u();return{stop:function(){return e&&e.stop()}}}))}),{from:R.test,velocity:R.test,min:R.test,max:R.test,damping:R.test,stiffness:R.test,modifyTarget:function(t){return"function"===typeof t}}),mn=ln((function(t){var e=t.from,n=void 0===e?0:e,r=t.to,i=void 0===r?1:r,o=t.ease,a=void 0===o?ct:o,s=t.reverseEase;return void 0!==s&&s&&(a=it(a)),en((function(t){var e=t.update;return{seek:function(t){return e(t)}}})).pipe(a,(function(t){return Gt(n,i,t)}))}),{ease:function(t){return"function"===typeof t},from:R.test,to:R.test}),yn=zt(0,1),gn=function(t){return void 0===t&&(t={}),en((function(e){var n,r=e.update,i=e.complete,o=t.duration,a=void 0===o?300:o,s=t.ease,u=void 0===s?ht:s,c=t.flip,l=void 0===c?0:c,h=t.loop,p=void 0===h?0:h,f=t.yoyo,d=void 0===f?0:f,m=t.repeatDelay,y=void 0===m?0:m,g=t.from,v=void 0===g?0:g,_=t.to,b=void 0===_?1:_,w=t.elapsed,E=void 0===w?0:w,T=t.flipCount,S=void 0===T?0:T,C=t.yoyoCount,k=void 0===C?0:C,A=t.loopCount,O=void 0===A?0:A,P=mn({from:v,to:b,ease:u}).start(r),D=0,M=!1,R=function(t){var e;void 0===t&&(t=!1),P=mn({from:v=(e=[b,v])[0],to:b=e[1],ease:u,reverseEase:t}).start(r)},N=function(){D=yn(Wt(0,a,E)),P.seek(D)},L=function(){M=!0,n=I.update((function(t){var e=t.delta;E+=e,N(),function(){var t=M&&E>a+y;return!!t&&(!(!t||p||l||d)||(E=E-a-y,p&&O=t[i]&&a[o].seek(1);for(var n=1;ne||n===i);n++);var s=Wt(t[n-1],t[n],e);a[n-1].seek(vn(s))}}(o,u,t)}))},bn=function(t,e,n){return en((function(r){var i=r.update,o=e.split(" ").map((function(e){return t.addEventListener(e,i,n),e}));return{stop:function(){return o.forEach((function(e){return t.removeEventListener(e,i,n)}))}}}))},wn=function(){return{clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}},xn=function(t,e){return void 0===e&&(e={clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}),e.clientX=e.x=t.clientX,e.clientY=e.y=t.clientY,e.pageX=t.pageX,e.pageY=t.pageY,e},En=[wn()];if("undefined"!==typeof document){bn(document,"touchstart touchmove",{passive:!0,capture:!0}).start((function(t){var e=t.touches;!0;var n=e.length;En.length=0;for(var r=0;r=0&&(i=n[r],!(o.timestamp-i.timestamp>cr(e)));)r--;if(!i)return{x:0,y:0};var a=(o.timestamp-i.timestamp)/1e3;if(0===a)return{x:0,y:0};var s={x:(o.x-i.x)/a,y:(o.y-i.y)/a};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Zr(t,e){var n=t.onPan,r=t.onPanStart,a=t.onPanEnd,u=t.onPanSessionStart,c=n||r||a||u,l=Object(o.useRef)(null),h=Object(o.useRef)(null),p=Object(o.useRef)(null),f=Object(o.useContext)(Cr).transformPagePoint,d=Object(o.useRef)(null),m=Dr({onPanSessionStart:u,onPanStart:r,onPan:n,onPanEnd:a});function y(){d.current&&d.current(),d.current=null}function g(t){var e=t.point,n=l.current;return{point:e,delta:Er.subtract(e,Xr(n)),offset:Er.subtract(e,Qr(n)),velocity:Yr(n,.1)}}function v(t){return{point:f(t.point)}}function _(){y(),x.update(b),Ar()}function b(){if(!l.current||!h.current||!p.current)return s(!1,"onPointerMove fired without pointer session"),void _();var t=g(p.current),e=void 0!==l.current.startEvent,n=qt(t.offset,{x:0,y:0})>=3;if(e||n){var r=t.point,o=C().timestamp;l.current.pointHistory.push(Object(i.__assign)({},r,{timestamp:o}));var a=m.current,u=a.onPanStart,c=a.onPan;e||(u&&u(h.current,t),l.current.startEvent=h.current),c&&c(h.current,t)}}function w(t,e){h.current=t,p.current=v(e),Or(t)&&0===t.buttons?E(t,e):I.update(b,!0)}function E(t,e){if(_(),l.current){var n=m.current.onPanEnd;n&&n(t,g(v(e))),l.current=null}else s(!1,"onPointerUp fired without pointer session")}Kr(e,"pointerdown",c&&function(t,e){if(!(Pr(t)&&t.touches.length>1)){var n=v(e),r=n.point,o=C().timestamp;l.current={target:t.target,pointHistory:[Object(i.__assign)({},r,{timestamp:o})]};var a=m.current.onPanSessionStart;a&&a(t,g(n)),y();var s=Hr(window,"pointermove",w),u=Hr(window,"pointerup",E);d.current=function(){s&&s(),u&&u()}}}),Mr(_)}var Jr=function t(e,n){return!!n&&(e===n||t(e,n.parentElement))},$r=["whileHover","whileTap","whileDrag"],ti=function(t){return $r.indexOf(t)+1};function ei(t){var e=null;return function(){return null===e&&(e=t,function(){e=null})}}var ni=ei("dragHorizontal"),ri=ei("dragVertical");function ii(t){var e=!1;if("y"===t)e=ri();else if("x"===t)e=ni();else{var n=ni(),r=ri();n&&r?e=function(){n(),r()}:(n&&n(),r&&r())}return e}var oi=ti("whileTap");var ai=ti("whileHover"),si=function(t){return function(e,n){Or(e)&&t(e,n)}};function ui(t,e){Zr(t,e),function(t,e){var n=t.onTap,r=t.onTapStart,i=t.onTapCancel,a=t.whileTap,s=t.controls,u=n||r||i||a,c=Object(o.useRef)(!1),l=Object(o.useRef)(null);function h(){l.current&&l.current(),l.current=null}a&&s&&s.setOverride(a,oi);var p=Object(o.useRef)(null);p.current=function(t,r){var o=e.current;if(h(),c.current&&o){c.current=!1,s&&a&&s.clearOverride(oi);var u=ii(!0);u&&(u(),Jr(o,t.target)?n&&n(t,r):i&&i(t,r))}},Kr(e,"pointerdown",u?function(t,n){h(),l.current=Hr(window,"pointerup",(function(t,e){return p.current(t,e)})),e.current&&!c.current&&(c.current=!0,r&&r(t,n),s&&a&&s.startOverride(oi))}:void 0),Mr(h)}(t,e),function(t,e){var n=t.whileHover,r=t.onHoverStart,i=t.onHoverEnd,o=t.controls;n&&o&&o.setOverride(n,ai),Kr(e,"pointerenter",si((function(t,e){r&&r(t,e),n&&o&&o.startOverride(ai)}))),Kr(e,"pointerleave",si((function(t,e){i&&i(t,e),n&&o&&o.clearOverride(ai)})))}(t,e)}var ci=function(t){return function(e){return t(e),null}},li=["drag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","whileTap","whileHover","onHoverStart","onHoverEnd"],hi={key:"gestures",shouldRender:function(t){return li.some((function(e){return t.hasOwnProperty(e)}))},Component:ci((function(t){var e=t.innerRef;ui(Object(i.__rest)(t,["innerRef"]),e)}))},pi=function(t){return"object"===typeof t&&t.hasOwnProperty("current")};function fi(t){return An((function(){return kn(t)}))}var di=new Set(["INPUT","TEXTAREA","SELECT"]),mi=function(t,e){var n=t.current.getBoundingClientRect(),r=e({x:n.left,y:n.top}),i=r.x,o=r.y,a=e({x:n.width,y:n.height});return{left:i,top:o,width:a.x,height:a.y}},yi=function(t){return t?t.get():0},gi=function(t,e,n,r){u(null!==t.current&&null!==e.current,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");var i=mi(t,r),o=mi(e,r),a=i.left-o.left+yi(n.x),s=i.top-o.top+yi(n.y);return{top:s,left:a,right:i.width-o.width+a,bottom:i.height-o.height+s}};function vi(t,e,n){return(!0===e||e===t)&&(null===n||n===t)}var _i=function(t,e){var n=e.top,r=e.right,i=e.bottom,o=e.left;return"x"===t?{min:o,max:r}:{min:n,max:i}};function bi(t,e,n,r){var i=e instanceof In?e.get():e;if(!n)return i;var o=_i(t,n),a=o.min,s=o.max;return void 0!==a&&is&&(i=r?wi(s,i,r):Math.min(s,i)),e instanceof In&&e.set(i),i}function wi(t,e,n){return Gt(t,e,"number"===typeof n?n:.35)}function xi(t){return[t("x"),t("y")]}function Ei(t,e,n,r){var a,s,u=t.drag,c=void 0!==u&&u,l=t.dragDirectionLock,h=void 0!==l&&l,p=t.dragPropagation,f=void 0!==p&&p,d=t.dragConstraints,m=void 0!==d&&d,y=t.dragElastic,g=void 0===y||y,v=t.dragMomentum,_=void 0===v||v,b=t._dragValueX,w=t._dragValueY,x=t._dragTransitionControls,E=t.dragOriginX,T=t.dragOriginY,S=t.dragTransition,C=t.onDirectionLock,I=t.onDragStart,k=t.onDrag,A=t.onDragEnd,O=t.onDragTransitionEnd,P=pi(m),D=Object(o.useRef)({isDragging:!1,currentDirection:null,constraints:!1}).current,M=Dr({onDragStart:I,onDrag:k,onDragEnd:A,onDirectionLock:C,onDragTransitionEnd:O}),R=Object(o.useRef)({}).current,N=fi(0),L=fi(0),F={x:E||N,y:T||L},j=Object(o.useRef)(null),z=Object(o.useContext)(Cr).transformPagePoint,B=Object(o.useRef)({width:0,height:0,x:0,y:0}).current,U=function(){if(pi(m)){var t=mi(m,z),n=mi(e,z),r=function(e,r){var i=R[e];if(i){if(i.isAnimating())return i.stop(),void V();var o=B[r]?(t[r]-n[r])/B[r]:1;i.set(B[e]*o)}};r("x","width"),r("y","height")}};a=m,s=U,Object(o.useEffect)((function(){if(a&&pi(a))return window.addEventListener("resize",s),function(){return window.removeEventListener("resize",s)}}),[a,s]);var V=function(t){if(t){var e=t.right,n=t.left,r=t.bottom,i=t.top;B.width=(e||0)-(n||0),B.height=(r||0)-(i||0)}R.x&&(B.x=R.x.get()),R.y&&(B.y=R.y.get())},q=function(t){return xi((function(e){var n=R[e];n&&!n.isAnimating()&&bi(e,n,t,0)}))};function W(t){return Object(i.__assign)({},t,{point:{x:R.x?R.x.get():0,y:R.y?R.y.get():0}})}function G(t,e){var n=R[t];if(vi(t,c,D.currentDirection)&&n){var r=bi(t,F[t].get()+e[t],D.constraints,g);n.set(r)}}function H(){Ar(),D.isDragging=!1,!f&&j.current&&(j.current(),j.current=null)}Object(o.useEffect)((function(){if(P){var t=gi(m,e,R,z);q(t),V(t)}else!D.isDragging&&D.constraints&&q(D.constraints)}),[]),D.constraints=P?D.constraints||!1:m,xi((function(t){if(vi(t,c,D.currentDirection)){var e="x"===t?b:w;R[t]=e||n.get(t,0)}})),Zr(c?{onPan:function(t,e){if(f||j.current){var n=e.offset;if(h&&null===D.currentDirection){if(D.currentDirection=function(t,e){void 0===e&&(e=10);var n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(n),null!==D.currentDirection){var r=M.current.onDirectionLock;r&&r(D.currentDirection)}}else{G("x",n),G("y",n);var i=M.current.onDrag;i&&i(t,W(e))}}},onPanStart:function(t,n){if(P&&(D.constraints=gi(m,e,R,z),q(D.constraints)),xi((function(t){var e=R[t];e&&(F[t].set(e.get()),e.stop())})),f||(j.current&&j.current(),j.current=ii(c),j.current)){D.isDragging=!0,D.currentDirection=null;var r=M.current.onDragStart;r&&r(t,W(n))}},onPanEnd:function(t,e){var n=D.isDragging;if(H(),n){if(_||g)!function(t){var e=xi((function(e){var n;if(vi(e,c,D.currentDirection)){var o=D.constraints?_i(e,D.constraints):{},a=g?200:1e6,s=g?40:1e7;return(x||r).start(((n={})[e]=0,n.transition=Object(i.__assign)({type:"inertia",velocity:_?t[e]:0,bounceStiffness:a,bounceDamping:s,timeConstant:750,restDelta:1},S,o),n))}}));Promise.all(e).then((function(){V(D.constraints),U();var t=M.current.onDragTransitionEnd;t&&t()}))}(e.velocity);else V(D.constraints);var o=M.current.onDragEnd;o&&o(t,W(e))}},onPanSessionStart:function(t){t.target&&!di.has(t.target.tagName)&&(Ur()||(t.preventDefault(),document.activeElement instanceof HTMLElement&&document.activeElement.blur())),kr(),xi((function(t){var e=R[t];e&&e.stop()}))}}:{},e),Mr((function(){return D.isDragging&&H()}))}var Ti={key:"drag",shouldRender:function(t){return!!t.drag},Component:ci((function(t){var e=t.innerRef,n=t.values,r=t.controls;return Ei(Object(i.__rest)(t,["innerRef","values","controls"]),e,n,r)}))};function Si(t){return"string"===typeof t&&t.startsWith("var(--")}var Ci=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;var Ii=4;function ki(t,e,n){void 0===n&&(n=1),u(n<=Ii,'Max CSS variable fallback depth detected in property "'+t+'". This may indicate a circular fallback dependency.');var r=function(t){var e=Ci.exec(t);return e?[e[1],e[2]]:[,]}(t),i=r[0],o=r[1];if(i){var a=window.getComputedStyle(e).getPropertyValue(i);return a||(Si(o)?ki(o,e,n+1):o)}}var Ai,Oi=new Set(["width","height","top","left","right","bottom","x","y"]),Pi=function(t){return Oi.has(t)},Di=function(t){return Object.keys(t).some(Pi)},Mi=function(t,e){t.set(e,!1),t.set(e)},Ri=function(t){return t===R||t===B};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Ai||(Ai={}));var Ni=function(t,e){return parseFloat(t.split(", ")[e])},Li=function(t,e){return function(n,r){var i=r.transform;if("none"===i||!i)return 0;var o=i.match(/^matrix3d\((.+)\)$/);if(o)return Ni(o[1],e);var a=i.match(/^matrix\((.+)\)$/);return Ni(a[1],t)}},Fi=new Set(["x","y","z"]),ji=_e.filter((function(t){return!Fi.has(t)}));var zi={width:function(t){var e=t.width;return e},height:function(t){var e=t.height;return e},top:function(t,e){var n=e.top;return parseFloat(n)},left:function(t,e){var n=e.left;return parseFloat(n)},bottom:function(t,e){var n=t.height,r=e.top;return parseFloat(r)+n},right:function(t,e){var n=t.width,r=e.left;return parseFloat(r)+n},x:Li(4,13),y:Li(5,14)},Bi=function(t,e,n,r){void 0===r&&(r={}),n=Object(i.__assign)({},n),r=Object(i.__assign)({},r);var o=e.current,a=Ze(o),s=Object.keys(n).filter(Pi),c=[],l=!1,h=s.reduce((function(e,i){var o=t.get(i);if(!o)return e;var s,h=o.get(),p=n[i],f=Jn(h);if(Kn(p))for(var d=p.length,m=null===p[0]?1:0;m\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),t.apply(this,arguments)}}u="function"!==typeof Object.assign?function(t){if(t===s||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n-1}function A(t){return t.trim().split(/\s+/g)}function O(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;rn[e]})):r.sort()),r}function M(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o1&&!n.firstMultiple?n.firstMultiple=nt(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,u=a?a.center:o.center,c=e.center=rt(r);e.timeStamp=d(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=st(u,c),e.distance=at(u,c),function(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};e.eventType!==B&&o.eventType!==V||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y});e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}(n,e),e.offsetDirection=ot(e.deltaX,e.deltaY);var l=it(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=l.x,e.overallVelocityY=l.y,e.overallVelocity=f(l.x)>f(l.y)?l.x:l.y,e.scale=a?(h=a.pointers,p=r,at(p[0],p[1],$)/at(h[0],h[1],$)):1,e.rotation=a?function(t,e){return st(e[1],e[0],$)+st(t[1],t[0],$)}(a.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,r,i,o,a=t.lastInterval||e,u=e.timeStamp-a.timeStamp;if(e.eventType!=q&&(u>z||a.velocity===s)){var c=e.deltaX-a.deltaX,l=e.deltaY-a.deltaY,h=it(u,c,l);r=h.x,i=h.y,n=f(h.x)>f(h.y)?h.x:h.y,o=ot(c,l),t.lastInterval=e}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=o}(n,e);var h,p;var m=t.element;I(e.srcEvent.target,m)&&(m=e.srcEvent.target);e.target=m}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function nt(t){for(var e=[],n=0;n=f(e)?t<0?G:H:e<0?K:Q}function at(t,e,n){n||(n=J);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function st(t,e,n){n||(n=J);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}tt.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(N(this.element),this.evWin,this.domHandler)}};var ut={mousedown:B,mousemove:U,mouseup:V},ct="mousedown",lt="mousemove mouseup";function ht(){this.evEl=ct,this.evWin=lt,this.pressed=!1,tt.apply(this,arguments)}w(ht,tt,{handler:function(t){var e=ut[t.type];e&B&&0===t.button&&(this.pressed=!0),e&U&&1!==t.which&&(e=V),this.pressed&&(e&V&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var pt={pointerdown:B,pointermove:U,pointerup:V,pointercancel:q,pointerout:q},ft={2:"touch",3:"pen",4:"mouse",5:"kinect"},dt="pointerdown",mt="pointermove pointerup pointercancel";function yt(){this.evEl=dt,this.evWin=mt,tt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(dt="MSPointerDown",mt="MSPointerMove MSPointerUp MSPointerCancel"),w(yt,tt,{handler:function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=pt[r],o=ft[t.pointerType]||t.pointerType,a="touch"==o,s=O(e,t.pointerId,"pointerId");i&B&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):i&(V|q)&&(n=!0),s<0||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(s,1))}});var gt={touchstart:B,touchmove:U,touchend:V,touchcancel:q},vt="touchstart",_t="touchstart touchmove touchend touchcancel";function bt(){this.evTarget=vt,this.evWin=_t,this.started=!1,tt.apply(this,arguments)}function wt(t,e){var n=P(t.touches),r=P(t.changedTouches);return e&(V|q)&&(n=D(n.concat(r),"identifier",!0)),[n,r]}w(bt,tt,{handler:function(t){var e=gt[t.type];if(e===B&&(this.started=!0),this.started){var n=wt.call(this,t,e);e&(V|q)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}}});var xt={touchstart:B,touchmove:U,touchend:V,touchcancel:q},Et="touchstart touchmove touchend touchcancel";function Tt(){this.evTarget=Et,this.targetIds={},tt.apply(this,arguments)}function St(t,e){var n=P(t.touches),r=this.targetIds;if(e&(B|U)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=P(t.changedTouches),s=[],u=this.target;if(o=n.filter((function(t){return I(t.target,u)})),e===B)for(i=0;i-1&&r.splice(t,1)}),Ct)}}function Pt(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,r=0;r-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,n=this.state;function r(n){e.manager.emit(n,t)}n=Wt&&r(e.options.event+Qt(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;te.threshold&&i&e.direction},attrTest:function(t){return Zt.prototype.attrTest.call(this,t)&&(this.state&Vt||!(this.state&Vt)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Xt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),w($t,Zt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Lt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&Vt)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),w(te,Kt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Rt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distancee.time;if(this._input=t,!r||!n||t.eventType&(V|q)&&!i)this.reset();else if(t.eventType&B)this.reset(),this._timer=m((function(){this.state=Gt,this.tryEmit()}),e.time,this);else if(t.eventType&V)return Gt;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===Gt&&(t&&t.eventType&V?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),w(ee,Zt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Lt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&Vt)}}),w(ne,Zt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:X|Y,pointers:1},getTouchAction:function(){return Jt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(X|Y)?e=t.overallVelocity:n&X?e=t.overallVelocityX:n&Y&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&f(e)>this.options.velocity&&t.eventType&V},emit:function(t){var e=Xt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),w(re,Kt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Nt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance=500&&e.status<600?[2,t()]:[2,e]}}))}))}function C(t,e){var n=e.fid;return Object(s.__awaiter)(this,void 0,void 0,(function(){var e,r,i,o,a,u;return Object(s.__generator)(this,(function(s){switch(s.label){case 0:return e=b(t),r=E(t),i={fid:n,authVersion:d,appId:t.appId,sdkVersion:f},o={method:"POST",headers:r,body:JSON.stringify(i)},[4,S((function(){return fetch(e,o)}))];case 1:return(a=s.sent()).ok?[4,a.json()]:[3,3];case 2:return u=s.sent(),[2,{fid:u.fid||n,registrationStatus:2,refreshToken:u.refreshToken,authToken:w(u.authToken)}];case 3:return[4,x("Create Installation",a)];case 4:throw s.sent()}}))}))}function I(t){return new Promise((function(e){setTimeout(e,t)}))}var k=/^[cdef][\w-]{21}$/,A="";function O(){try{var t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;var e=function(t){return(e=t,btoa(String.fromCharCode.apply(String,Object(s.__spread)(e))).replace(/\+/g,"-").replace(/\//g,"_")).substr(0,22);var e}(t);return k.test(e)?e:A}catch(r){return A}}var P="firebase-installations-database",D=1,M="firebase-installations-store",R=null;function N(){return R||(R=Object(c.openDb)(P,D,(function(t){switch(t.oldVersion){case 0:t.createObjectStore(M)}}))),R}function L(t,e){return Object(s.__awaiter)(this,void 0,void 0,(function(){var n,r,i;return Object(s.__generator)(this,(function(o){switch(o.label){case 0:return n=z(t),[4,N()];case 1:return r=o.sent(),[4,(i=r.transaction(M,"readwrite")).objectStore(M).put(e,n)];case 2:return o.sent(),[4,i.complete];case 3:return o.sent(),[2,e]}}))}))}function F(t){return Object(s.__awaiter)(this,void 0,void 0,(function(){var e,n,r;return Object(s.__generator)(this,(function(i){switch(i.label){case 0:return e=z(t),[4,N()];case 1:return n=i.sent(),[4,(r=n.transaction(M,"readwrite")).objectStore(M).delete(e)];case 2:return i.sent(),[4,r.complete];case 3:return i.sent(),[2]}}))}))}function j(t,e){return Object(s.__awaiter)(this,void 0,void 0,(function(){var n,r,i,o,a,u;return Object(s.__generator)(this,(function(s){switch(s.label){case 0:return n=z(t),[4,N()];case 1:return r=s.sent(),i=r.transaction(M,"readwrite"),[4,(o=i.objectStore(M)).get(n)];case 2:return a=s.sent(),void 0!==(u=e(a))?[3,4]:[4,o.delete(n)];case 3:return s.sent(),[3,6];case 4:return[4,o.put(u,n)];case 5:s.sent(),s.label=6;case 6:return[4,i.complete];case 7:return s.sent(),[2,u]}}))}))}function z(t){return t.appName+"!"+t.appId}function B(t){return Object(s.__awaiter)(this,void 0,void 0,(function(){var e,n,r;return Object(s.__generator)(this,(function(i){switch(i.label){case 0:return[4,j(t,(function(n){var r=function(t){return q(t||{fid:O(),registrationStatus:0})}(n),i=function(t,e){if(0===e.registrationStatus){if(!navigator.onLine){var n=Promise.reject(v.create("app-offline"));return{installationEntry:e,registrationPromise:n}}var r={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},i=function(t,e){return Object(s.__awaiter)(this,void 0,void 0,(function(){var n,r;return Object(s.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,7]),[4,C(t,e)];case 1:return n=i.sent(),[2,L(t,n)];case 2:return _(r=i.sent())&&409===r.serverCode?[4,F(t)]:[3,4];case 3:return i.sent(),[3,6];case 4:return[4,L(t,{fid:e.fid,registrationStatus:0})];case 5:i.sent(),i.label=6;case 6:throw r;case 7:return[2]}}))}))}(t,r);return{installationEntry:r,registrationPromise:i}}return 1===e.registrationStatus?{installationEntry:e,registrationPromise:U(t)}:{installationEntry:e}}(t,r);return e=i.registrationPromise,i.installationEntry}))];case 1:return(n=i.sent()).fid!==A?[3,3]:(r={},[4,e]);case 2:return[2,(r.installationEntry=i.sent(),r)];case 3:return[2,{installationEntry:n,registrationPromise:e}]}}))}))}function U(t){return Object(s.__awaiter)(this,void 0,void 0,(function(){var e,n,r,i;return Object(s.__generator)(this,(function(o){switch(o.label){case 0:return[4,V(t)];case 1:e=o.sent(),o.label=2;case 2:return 1!==e.registrationStatus?[3,5]:[4,I(100)];case 3:return o.sent(),[4,V(t)];case 4:return e=o.sent(),[3,2];case 5:return 0!==e.registrationStatus?[3,7]:[4,B(t)];case 6:return n=o.sent(),r=n.installationEntry,(i=n.registrationPromise)?[2,i]:[2,r];case 7:return[2,e]}}))}))}function V(t){return j(t,(function(t){if(!t)throw v.create("installation-not-found");return q(t)}))}function q(t){return 1===(e=t).registrationStatus&&e.registrationTime+p1&&void 0!==arguments[1]?arguments[1]:"component";t.debug&&s.a.checkPropTypes(c,t,"prop",e)}var p=function(){function t(e){var n=this;if(Object(r.a)(this,t),Object(o.a)(this,"mapboxgl",void 0),Object(o.a)(this,"props",l),Object(o.a)(this,"_map",null),Object(o.a)(this,"width",0),Object(o.a)(this,"height",0),Object(o.a)(this,"_fireLoadEvent",(function(){n.props.onLoad({type:"load",target:n._map})})),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,t.initialized||(t.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}return Object(i.a)(t,[{key:"finalize",value:function(){return this._destroy(),this}},{key:"setProps",value:function(t){return this._update(this.props,t),this}},{key:"resize",value:function(){return this._map.resize(),this}},{key:"redraw",value:function(){var t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}},{key:"getMap",value:function(){return this._map}},{key:"_reuse",value:function(e){this._map=t.savedMap;var n=this._map.getContainer(),r=e.container;for(r.classList.add("mapboxgl-map");n.childNodes.length>0;)r.appendChild(n.childNodes[0]);this._map._container=r,t.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!1}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}},{key:"_create",value:function(e){if(e.reuseMaps&&t.savedMap)this._reuse(e);else{if(e.gl){var n=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=n,e.gl}}var r={container:e.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:e.mapStyle,interactive:!1,trackResize:!1,attributionControl:e.attributionControl,preserveDrawingBuffer:e.preserveDrawingBuffer};e.transformRequest&&(r.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},r,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}},{key:"_destroy",value:function(){this._map&&(t.savedMap?this._map.remove():(t.savedMap=this._map,this._map.off("load",this.props.onLoad),this._map.off("error",this.props.onError),this._map.off("styledata",this._fireLoadEvent)),this._map=null)}},{key:"_initialize",value:function(t){var e=this;h(t=Object.assign({},l,t),"Mapbox"),this.mapboxgl.accessToken=t.mapboxApiAccessToken||l.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=t.mapboxApiUrl,this._create(t);var n=t.container;Object.defineProperty(n,"offsetWidth",{get:function(){return e.width}}),Object.defineProperty(n,"clientWidth",{get:function(){return e.width}}),Object.defineProperty(n,"offsetHeight",{get:function(){return e.height}}),Object.defineProperty(n,"clientHeight",{get:function(){return e.height}});var r=this._map.getCanvas();r&&(r.style.outline="none"),this._updateMapViewport({},t),this._updateMapSize({},t),this.props=t}},{key:"_update",value:function(t,e){if(this._map){h(e=Object.assign({},this.props,e),"Mapbox");var n=this._updateMapViewport(t,e),r=this._updateMapSize(t,e);e.asyncRender||!n&&!r||this.redraw(),this.props=e}}},{key:"_updateMapSize",value:function(t,e){var n=t.width!==e.width||t.height!==e.height;return n&&(this.width=e.width,this.height=e.height,this.resize()),n}},{key:"_updateMapViewport",value:function(t,e){var n=this._getViewState(t),r=this._getViewState(e),i=r.latitude!==n.latitude||r.longitude!==n.longitude||r.zoom!==n.zoom||r.pitch!==n.pitch||r.bearing!==n.bearing||r.altitude!==n.altitude;return i&&(this._map.jumpTo(this._viewStateToMapboxProps(r)),r.altitude!==n.altitude&&(this._map.transform.altitude=r.altitude)),i}},{key:"_getViewState",value:function(t){var e=t.viewState||t,n=e.longitude,r=e.latitude,i=e.zoom,o=e.pitch,a=void 0===o?0:o,s=e.bearing,u=void 0===s?0:s,c=e.altitude;return{longitude:n,latitude:r,zoom:i,pitch:a,bearing:u,altitude:void 0===c?1.5:c}}},{key:"_checkStyleSheet",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0.47.0";if("undefined"!==typeof u.a)try{var e=u.a.createElement("div");e.className="mapboxgl-map",e.style.display="none",u.a.body.append(e);var n="static"!==window.getComputedStyle(e).position;if(!n){var r=u.a.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v".concat(t,"/mapbox-gl.css")),u.a.head.append(r)}}catch(i){}}},{key:"_viewStateToMapboxProps",value:function(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}}}]),t}();Object(o.a)(p,"initialized",!1),Object(o.a)(p,"propTypes",c),Object(o.a)(p,"defaultProps",l),Object(o.a)(p,"savedMap",null)}).call(this,n(30))},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"initialize",(function(){return V})),n.d(r,"ga",(function(){return q})),n.d(r,"set",(function(){return W})),n.d(r,"send",(function(){return G})),n.d(r,"pageview",(function(){return H})),n.d(r,"modalview",(function(){return K})),n.d(r,"timing",(function(){return Q})),n.d(r,"event",(function(){return X})),n.d(r,"exception",(function(){return Y})),n.d(r,"plugin",(function(){return Z})),n.d(r,"outboundLink",(function(){return J})),n.d(r,"testModeAPI",(function(){return $})),n.d(r,"default",(function(){return tt}));var i=n(0),o=n.n(i),a=n(1),s=n.n(a);function u(t){console.warn("[react-ga]",t)}function c(t){return(c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function p(t,e){for(var n=0;n0&&e+t.length!==n.length&&t.search(w)>-1&&":"!==n.charAt(e-2)&&("-"!==n.charAt(e+t.length)||"-"===n.charAt(e-1))&&n.charAt(e-1).search(/[^\s-]/)<0?t.toLowerCase():t.substr(1).search(/[A-Z]|\../)>-1?t:t.charAt(0).toUpperCase()+t.substr(1)})):t}var T=function(t){var e,n,r,i,o,a,s,u="https://www.google-analytics.com/analytics.js";t&&t.gaAddress?u=t.gaAddress:t&&t.debug&&(u="https://www.google-analytics.com/analytics_debug.js"),e=window,n=document,r="script",i=u,o="ga",e.GoogleAnalyticsObject=o,e.ga=e.ga||function(){(e.ga.q=e.ga.q||[]).push(arguments)},e.ga.l=1*new Date,a=n.createElement(r),s=n.getElementsByTagName(r)[0],a.async=1,a.src=i,s.parentNode.insertBefore(a,s)};function S(t){console.info("[react-ga]",t)}var C=[],I={calls:C,ga:function(){for(var t=arguments.length,e=new Array(t),n=0;n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function A(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function P(t){return(P="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1?e-1:0),r=1;r0&&(j.apply(void 0,e),R&&(S("called ga('arguments');"),S("with arguments: ".concat(JSON.stringify(e))))),window.ga}function W(t,e){t?"object"===P(t)?(0===Object.keys(t).length&&u("empty `fieldsObject` given to .set()"),B(e,"set",t),R&&(S("called ga('set', fieldsObject);"),S("with fieldsObject: ".concat(JSON.stringify(t))))):u("Expected `fieldsObject` arg to be an Object"):u("`fieldsObject` is required in .set()")}function G(t,e){B(e,"send",t),R&&(S("called ga('send', fieldObject);"),S("with fieldObject: ".concat(JSON.stringify(t))),S("with trackers: ".concat(JSON.stringify(e))))}function H(t,e,n){if(t){var r=b(t);if(""!==r){var i={};if(n&&(i.title=n),B(e,"send",function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=t.category,n=t.variable,r=t.value,i=t.label,o=arguments.length>1?arguments[1]:void 0;if(e&&n&&r&&"number"===typeof r){var a={hitType:"timing",timingCategory:z(e),timingVar:z(n),timingValue:r};i&&(a.timingLabel=z(i)),G(a,o)}else u("args.category, args.variable AND args.value are required in timing() AND args.value has to be a number")}function X(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.category,n=t.action,r=t.label,i=t.value,o=t.nonInteraction,a=t.transport,s=k(t,["category","action","label","value","nonInteraction","transport"]),c=arguments.length>1?arguments[1]:void 0;if(e&&n){var l={hitType:"event",eventCategory:z(e),eventAction:z(n)};r&&(l.eventLabel=z(r)),"undefined"!==typeof i&&("number"!==typeof i?u("Expected `args.value` arg to be a Number."):l.eventValue=i),"undefined"!==typeof o&&("boolean"!==typeof o?u("`args.nonInteraction` must be a boolean."):l.nonInteraction=o),"undefined"!==typeof a&&("string"!==typeof a?u("`args.transport` must be a string."):(-1===["beacon","xhr","image"].indexOf(a)&&u("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`"),l.transport=a)),Object.keys(s).filter((function(t){return"dimension"===t.substr(0,"dimension".length)})).forEach((function(t){l[t]=s[t]})),Object.keys(s).filter((function(t){return"metric"===t.substr(0,"metric".length)})).forEach((function(t){l[t]=s[t]})),G(l,c)}else u("args.category AND args.action are required in event()")}function Y(t,e){var n=t.description,r=t.fatal,i={hitType:"exception"};n&&(i.exDescription=z(n)),"undefined"!==typeof r&&("boolean"!==typeof r?u("`args.fatal` must be a boolean."):i.exFatal=r),G(i,e)}var Z={require:function(t,e,n){if(t){var r=b(t);if(""!==r){var i=n?"".concat(n,".require"):"require";if(e){if("object"!==P(e))return void u("Expected `options` arg to be an Object");0===Object.keys(e).length&&u("Empty `options` given to .require()"),q(i,r,e),R&&S("called ga('require', '".concat(r,"', ").concat(JSON.stringify(e)))}else q(i,r),R&&S("called ga('require', '".concat(r,"');"))}else u("`name` cannot be an empty string in .require()")}else u("`name` is required in .require()")},execute:function(t,e){var n,r;if(1===(arguments.length<=2?0:arguments.length-2)?n=arguments.length<=2?void 0:arguments[2]:(r=arguments.length<=2?void 0:arguments[2],n=arguments.length<=3?void 0:arguments[3]),"string"!==typeof t)u("Expected `pluginName` arg to be a String.");else if("string"!==typeof e)u("Expected `action` arg to be a String.");else{var i="".concat(t,":").concat(e);n=n||null,r&&n?(q(i,r,n),R&&(S("called ga('".concat(i,"');")),S('actionType: "'.concat(r,'" with payload: ').concat(JSON.stringify(n))))):n?(q(i,n),R&&(S("called ga('".concat(i,"');")),S("with payload: ".concat(JSON.stringify(n))))):(q(i),R&&S("called ga('".concat(i,"');")))}}};function J(t,e,n){if("function"===typeof e)if(t&&t.label){var r={hitType:"event",eventCategory:"Outbound",eventAction:"Click",eventLabel:z(t.label)},i=!1,o=setTimeout((function(){i=!0,e()}),250);r.hitCallback=function(){clearTimeout(o),i||e()},G(r,n)}else u("args.label is required in outboundLink()");else u("hitCallback function is required")}var $=I,tt={initialize:V,ga:q,set:W,send:G,pageview:H,modalview:K,timing:Q,event:X,exception:Y,plugin:Z,outboundLink:J,testModeAPI:I};function et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function nt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}_.origTrackLink=_.trackLink,_.trackLink=J;var rt=_;e.a=function(t){for(var e=1;e1)for(var n=1;n with the name of a component - i.e. auth, database, etc):\n\nCommonJS Modules:\nconst firebase = require('firebase/app');\nrequire('firebase/');\n\nES Modules:\nimport firebase from 'firebase/app';\nimport 'firebase/';\n\nTypescript:\nimport * as firebase from 'firebase/app';\nimport 'firebase/';\n"),i.registerVersion("firebase","7.6.1"),t.exports=i},function(t,e,n){"use strict";function r(){return(r=Object.assign||function(t){for(var e=1;e=-90&&i<=90,"invalid latitude");var o=i*N;return[(e*=F)*(r*N+M)/(2*M),e*(M-Math.log(Math.tan(R+.5*o)))/(2*M)]}function q(t,e){var n=Object(_.a)(t,2),r=n[0],i=n[1],o=r/(e*=F)*(2*M)-M,a=2*(Math.atan(Math.exp(M-i/e*(2*M)))-R);return[o*L,a*L]}function W(t){var e=t.latitude,n=t.longitude,r=t.zoom,i=t.scale,o=t.highPrecision,a=void 0!==o&&o;i=void 0!==i?i:B(r),D(Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(i));var s={},u=F*i,c=Math.cos(e*N),l=u/360,h=l/c,p=u/j/c;if(s.pixelsPerMeter=[p,-p,p],s.metersPerPixel=[1/p,-1/p,1/p],s.pixelsPerDegree=[l,-h,p],s.degreesPerPixel=[1/l,-1/h,1/p],a){var f=N*Math.tan(e*N)/c,d=l*f/2,m=u/j*f,y=m/h*p;s.pixelsPerDegree2=[0,-d,m],s.pixelsPerMeter2=[y,0,y]}return s}function G(t){var e,n,r=t.height,i=t.pitch,o=t.bearing,a=t.altitude,s=t.center,u=void 0===s?null:s,c=t.flipY,l=void 0!==c&&c,h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return S(h,h,[0,0,-a]),C(h,h,[1,1,1/r]),function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],p=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r}(h,h,-i*N),function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],p=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+p*r,t[4]=c*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=p*i-u*r}(h,h,o*N),l&&C(h,h,[1,-1,1]),u&&S(h,h,((e=[])[0]=-(n=u)[0],e[1]=-n[1],e[2]=-n[2],e)),h}function H(t){var e=t.width,n=t.height,r=t.pitch,i=function(t){var e=t.width,n=t.height,r=t.altitude,i=void 0===r?z:r,o=t.pitch,a=void 0===o?0:o,s=t.nearZMultiplier,u=void 0===s?1:s,c=t.farZMultiplier,l=void 0===c?1:c,h=a*N,p=Math.atan(.5/i),f=Math.sin(p)*i/Math.sin(Math.PI/2-h-p),d=Math.cos(Math.PI/2-h)*f+i;return{fov:2*Math.atan(n/2/i),aspect:e/n,focalDistance:i,near:u,far:d*l}}({width:e,height:n,altitude:t.altitude,pitch:r,nearZMultiplier:t.nearZMultiplier,farZMultiplier:t.farZMultiplier});return function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}([],i.fov,i.aspect,i.near,i.far)}function K(t,e){var n=Object(_.a)(t,3),r=n[0],i=n[1],o=n[2],a=void 0===o?0:o;return D(Number.isFinite(r)&&Number.isFinite(i)&&Number.isFinite(a)),x(e,[r,i,a,1])}function Q(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Object(_.a)(t,3),i=r[0],o=r[1],a=r[2];if(D(Number.isFinite(i)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(a))return x(e,[i,o,a,1]);var s=x(e,[i,o,0,1]),u=x(e,[i,o,1,1]),c=s[2],l=u[2];return function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}([],s,u,c===l?0:((n||0)-c)/(l-c))}var X=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function Y(t){var e=t.width,n=t.height,r=t.bounds,i=t.minExtent,o=void 0===i?0:i,a=t.maxZoom,s=void 0===a?24:a,u=t.padding,c=void 0===u?0:u,l=t.offset,h=void 0===l?[0,0]:l,p=Object(_.a)(r,2),f=Object(_.a)(p[0],2),d=f[0],m=f[1],y=Object(_.a)(p[1],2),g=y[0],v=y[1];if(Number.isFinite(c)){c={top:c,bottom:c,left:c,right:c}}else D(Number.isFinite(c.top)&&Number.isFinite(c.bottom)&&Number.isFinite(c.left)&&Number.isFinite(c.right));var b=new Z({width:e,height:n,longitude:0,latitude:0,zoom:0}),w=b.project([d,v]),x=b.project([g,m]),E=[Math.max(Math.abs(x[0]-w[0]),o),Math.max(Math.abs(x[1]-w[1]),o)],T=[e-c.left-c.right-2*Math.abs(h[0]),n-c.top-c.bottom-2*Math.abs(h[1])];D(T[0]>0&&T[1]>0);var S=T[0]/E[0],C=T[1]/E[1],I=(c.right-c.left)/2/S,k=(c.bottom-c.top)/2/C,A=[(x[0]+w[0])/2+I,(x[1]+w[1])/2+k],O=b.unproject(A),P=b.zoom+Math.log2(Math.abs(Math.min(S,C)));return{longitude:O[0],latitude:O[1],zoom:Math.min(P,s)}}var Z=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,u=n.height,c=n.latitude,l=void 0===c?0:c,h=n.longitude,p=void 0===h?0:h,f=n.zoom,d=void 0===f?0:f,m=n.pitch,y=void 0===m?0:m,g=n.bearing,v=void 0===g?0:g,_=n.altitude,b=void 0===_?1.5:_,w=n.nearZMultiplier,x=n.farZMultiplier;Object(i.a)(this,e),r=r||1,u=u||1;var E=B(d);b=Math.max(.75,b);var T=V([p,l],E);T[2]=0;var S=H({width:r,height:u,pitch:y,bearing:v,altitude:b,nearZMultiplier:w||1/u,farZMultiplier:x||1.01}),C=G({height:u,center:T,pitch:y,bearing:v,altitude:b,flipY:!0});return(t=Object(o.a)(this,Object(a.a)(e).call(this,{width:r,height:u,viewMatrix:C,projectionMatrix:S}))).latitude=l,t.longitude=p,t.zoom=d,t.pitch=y,t.bearing=v,t.altitude=b,t.scale=E,t.center=T,t.pixelsPerMeter=W(Object(s.a)(Object(s.a)(t))).pixelsPerMeter[2],Object.freeze(Object(s.a)(Object(s.a)(t))),t}return Object(c.a)(e,t),Object(u.a)(e,[{key:"projectFlat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return V(t,e)}},{key:"unprojectFlat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return q(t,e)}},{key:"getMapCenterByLngLatPosition",value:function(t){var e,n,r=t.lngLat,i=Q(t.pos,this.pixelUnprojectionMatrix),o=k([],V(r,this.scale),((e=[])[0]=-(n=i)[0],e[1]=-n[1],e));return q(k([],this.center,o),this.scale)}},{key:"getLocationAtPoint",value:function(t){var e=t.lngLat,n=t.pos;return this.getMapCenterByLngLatPosition({lngLat:e,pos:n})}},{key:"fitBounds",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=Y(Object.assign({width:r,height:i,bounds:t},n)),a=o.longitude,s=o.latitude,u=o.zoom;return new e({width:r,height:i,longitude:a,latitude:s,zoom:u})}}]),e}(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width,r=e.height,o=e.viewMatrix,a=void 0===o?X:o,s=e.projectionMatrix,u=void 0===s?X:s;Object(i.a)(this,t),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=a,this.projectionMatrix=u;var c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];T(c,c,this.projectionMatrix),T(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];C(l,l,[this.width/2,-this.height/2,1]),S(l,l,[1,-1,0]),T(l,l,this.viewProjectionMatrix);var h=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],y=e[14],g=e[15],v=n*s-r*a,_=n*u-i*a,b=n*c-o*a,w=r*u-i*s,x=r*c-o*s,E=i*c-o*u,T=l*m-h*d,S=l*y-p*d,C=l*g-f*d,I=h*y-p*m,k=h*g-f*m,A=p*g-f*y,O=v*A-_*k+b*I+w*C-x*S+E*T;return O?(O=1/O,t[0]=(s*A-u*k+c*I)*O,t[1]=(i*k-r*A-o*I)*O,t[2]=(m*E-y*x+g*w)*O,t[3]=(p*x-h*E-f*w)*O,t[4]=(u*C-a*A-c*S)*O,t[5]=(n*A-i*C+o*S)*O,t[6]=(y*b-d*E-g*_)*O,t[7]=(l*E-p*b+f*_)*O,t[8]=(a*k-s*C+c*T)*O,t[9]=(r*C-n*k-o*T)*O,t[10]=(d*x-m*b+g*v)*O,t[11]=(h*b-l*x-f*v)*O,t[12]=(s*S-a*I-u*T)*O,t[13]=(n*I-r*S+i*T)*O,t[14]=(m*_-d*w-y*v)*O,t[15]=(l*w-h*_+p*v)*O,t):null}([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l);if(!h)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=l,this.pixelUnprojectionMatrix=h,this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return Object(u.a)(t,[{key:"equals",value:function(e){return e instanceof t&&(e.width===this.width&&e.height===this.height&&I(e.projectionMatrix,this.projectionMatrix)&&I(e.viewMatrix,this.viewMatrix))}},{key:"project",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,i=this.projectPosition(t),o=K(i,this.pixelProjectionMatrix),a=Object(_.a)(o,2),s=a[0],u=a[1],c=r?u:this.height-u;return 2===t.length?[s,c]:[s,c,o[2]]}},{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,i=e.targetZ,o=Object(_.a)(t,3),a=o[0],s=o[1],u=o[2],c=r?s:this.height-s,l=i&&i*this.pixelsPerMeter,h=Q([a,c,u],this.pixelUnprojectionMatrix,l),p=this.unprojectPosition(h),f=Object(_.a)(p,3),d=f[0],m=f[1],y=f[2];return Number.isFinite(u)?[d,m,y]:Number.isFinite(i)?[d,m,i]:[d,m]}},{key:"projectPosition",value:function(t){var e=this.projectFlat(t),n=Object(_.a)(e,2);return[n[0],n[1],(t[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(t){var e=this.unprojectFlat(t),n=Object(_.a)(e,2);return[n[0],n[1],(t[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(t){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return t}},{key:"unprojectFlat",value:function(t){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return t}}]),t}()),J=n(38),$=n(28),tt=n(33),et=n.n(tt),nt=85.05113,rt=-85.05113;var it=1e-7;function ot(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function at(t,e){if(t===e)return!0;if(ot(t)&&ot(e)){if(t.length!==e.length)return!1;for(var n=0;n180&&(n=n<0?n+360:n-360),n}var vt=["longitude","latitude","zoom","bearing","pitch"],_t=["latitude","longitude","zoom","width","height"],bt=["bearing","pitch"],wt={speed:1.2,curve:1.414},xt=(function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.a)(this,e),t=Object(o.a)(this,Object(a.a)(e).call(this)),Object(l.a)(Object(s.a)(t),"speed",void 0),Object(l.a)(Object(s.a)(t),"propNames",vt),Object(l.a)(Object(s.a)(t),"props",void 0),t.props=Object.assign({},wt,n),t}Object(c.a)(e,t),Object(u.a)(e,[{key:"initializeProps",value:function(t,e){var n={},r={},i=!0,o=!1,a=void 0;try{for(var s,u=_t[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value,l=t[c],h=e[c];ct(yt(l)&&yt(h),"".concat(c," must be supplied for transition")),n[c]=l,r[c]=gt(c,l,h)}}catch(b){o=!0,a=b}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}var p=!0,f=!1,d=void 0;try{for(var m,y=bt[Symbol.iterator]();!(p=(m=y.next()).done);p=!0){var g=m.value,v=t[g]||0,_=e[g]||0;n[g]=v,r[g]=gt(g,v,_)}}catch(b){f=!0,d=b}finally{try{p||null==y.return||y.return()}finally{if(f)throw d}}return{start:n,end:r}}},{key:"interpolateProps",value:function(t,e,n){var r=function(t,e,n){var r,i={},o=dt(t,e,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),a=o.startZoom,s=o.startCenterXY,u=o.uDelta,c=o.w0,l=o.u1,h=o.S,p=o.rho,f=o.rho2,d=o.r0;if(Math.abs(l)2&&void 0!==arguments[2]?arguments[2]:{},i=r=Object.assign({},ft,r),o=i.screenSpeed,a=i.speed,s=i.maxDuration,u=dt(t,e,r),c=u.S,l=u.rho,h=1e3*c;return n=Number.isFinite(o)?h/(o/l):h/a,Number.isFinite(s)&&n>s?0:n}(t,e,this.props)),n}}])}(lt),["longitude","latitude","zoom","bearing","pitch"]),Et=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.a)(this,e),t=Object(o.a)(this,Object(a.a)(e).call(this)),Object(l.a)(Object(s.a)(t),"around",void 0),Array.isArray(n)&&(n={transitionProps:n}),t.propNames=n.transitionProps||xt,n.around&&(t.around=n.around),t}return Object(c.a)(e,t),Object(u.a)(e,[{key:"initializeProps",value:function(t,e){var n={},r={};if(this.around){n.around=this.around;var i=new Z(t).unproject(this.around);Object.assign(r,e,{around:new Z(e).project(i),aroundLngLat:i})}var o=!0,a=!1,s=void 0;try{for(var u,c=this.propNames[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var l=u.value,h=t[l],p=e[l];ct(yt(h)&&yt(p),"".concat(l," must be supplied for transition")),n[l]=h,r[l]=gt(l,h,p)}}catch(f){a=!0,s=f}finally{try{o||null==c.return||c.return()}finally{if(a)throw s}}return{start:n,end:r}}},{key:"interpolateProps",value:function(t,e,n){var r={},i=!0,o=!1,a=void 0;try{for(var s,u=this.propNames[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;r[c]=ut(t[c],e[c],n)}}catch(d){o=!0,a=d}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}if(e.around){var l=new Z(Object.assign({},e,r)).getMapCenterByLngLatPosition({lngLat:e.aroundLngLat,pos:ut(t.around,e.around,n)}),h=Object(_.a)(l,2),p=h[0],f=h[1];r.longitude=p,r.latitude=f}return r}}]),e}(lt),Tt={minZoom:0,maxZoom:24,minPitch:0,maxPitch:60},St={pitch:0,bearing:0,altitude:1.5},Ct=function(){function t(e){var n=e.width,r=e.height,o=e.latitude,a=e.longitude,s=e.zoom,u=e.bearing,c=void 0===u?St.bearing:u,h=e.pitch,p=void 0===h?St.pitch:h,f=e.altitude,d=void 0===f?St.altitude:f,m=e.maxZoom,y=void 0===m?Tt.maxZoom:m,g=e.minZoom,v=void 0===g?Tt.minZoom:g,_=e.maxPitch,b=void 0===_?Tt.maxPitch:_,w=e.minPitch,x=void 0===w?Tt.minPitch:w,E=e.transitionDuration,T=e.transitionEasing,S=e.transitionInterpolator,C=e.transitionInterruption,I=e.startPanLngLat,k=e.startZoomLngLat,A=e.startBearing,O=e.startPitch,P=e.startZoom;Object(i.a)(this,t),Object(l.a)(this,"_viewportProps",void 0),Object(l.a)(this,"_interactiveState",void 0),ct(Number.isFinite(n),"`width` must be supplied"),ct(Number.isFinite(r),"`height` must be supplied"),ct(Number.isFinite(a),"`longitude` must be supplied"),ct(Number.isFinite(o),"`latitude` must be supplied"),ct(Number.isFinite(s),"`zoom` must be supplied"),this._viewportProps=this._applyConstraints({width:n,height:r,latitude:o,longitude:a,zoom:s,bearing:c,pitch:p,altitude:d,maxZoom:y,minZoom:v,maxPitch:b,minPitch:x,transitionDuration:E,transitionEasing:T,transitionInterpolator:S,transitionInterruption:C}),this._interactiveState={startPanLngLat:I,startZoomLngLat:k,startBearing:A,startPitch:O,startZoom:P}}return Object(u.a)(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startPanLngLat:this._unproject(e)})}},{key:"pan",value:function(t){var e=t.pos,n=t.startPos,r=this._interactiveState.startPanLngLat||this._unproject(n);if(!r)return this;var i=this._calculateNewLngLat({startPanLngLat:r,pos:e}),o=Object(_.a)(i,2),a=o[0],s=o[1];return this._getUpdatedMapState({longitude:a,latitude:s})}},{key:"panEnd",value:function(){return this._getUpdatedMapState({startPanLngLat:null})}},{key:"rotateStart",value:function(t){t.pos;return this._getUpdatedMapState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(t){var e=t.deltaScaleX,n=void 0===e?0:e,r=t.deltaScaleY,i=void 0===r?0:r,o=this._interactiveState,a=o.startBearing,s=o.startPitch;if(!Number.isFinite(a)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:i,startBearing:a||0,startPitch:s||0}),c=u.pitch,l=u.bearing;return this._getUpdatedMapState({bearing:l,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedMapState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(t){var e=t.pos,n=t.startPos,r=t.scale;ct(r>0,"`scale` must be a positive number");var i=this._interactiveState,o=i.startZoom,a=i.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,a=this._unproject(n)||this._unproject(e)),ct(a,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var s=this._calculateNewZoom({scale:r,startZoom:o||0}),u=new Z(Object.assign({},this._viewportProps,{zoom:s})).getMapCenterByLngLatPosition({lngLat:a,pos:e}),c=Object(_.a)(u,2),l=c[0],h=c[1];return this._getUpdatedMapState({zoom:s,longitude:l,latitude:h})}},{key:"zoomEnd",value:function(){return this._getUpdatedMapState({startZoomLngLat:null,startZoom:null})}},{key:"_getUpdatedMapState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(t){var e=t.maxZoom,n=t.minZoom,r=t.zoom;t.zoom=st(r,n,e);var i=t.maxPitch,o=t.minPitch,a=t.pitch;return t.pitch=st(a,o,i),Object.assign(t,function(t){var e=t.width,n=t.height,r=t.longitude,i=t.latitude,o=t.zoom,a=t.pitch,s=void 0===a?0:a,u=t.bearing,c=void 0===u?0:u;(r<-180||r>180)&&(r=E(r+180,360)-180),(c<-180||c>180)&&(c=E(c+180,360)-180);var l=new Z({width:e,height:n,longitude:r,latitude:i,zoom:o}),h=l.project([r,nt])[1],p=l.project([r,rt])[1],f=0;return p-h0?f=h:p0?u=i+n*(s-i):n<0&&(u=i-n*(a-i)),{pitch:u,bearing:r+180*e}}}]),t}();var It=Object(h.createContext)({viewport:null,map:null,mapContainer:null,onViewportChange:null,onViewStateChange:null,eventManager:null,isDragging:!1});function kt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function At(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return n._map.queryRenderedFeatures(t,e)})),Object(l.a)(Object(s.a)(n),"_mapboxMapError",(function(t){(t.error&&t.error.status||t.status)!==Pt||n.state.accessTokenInvalid||(console.error(Ot),n.setState({accessTokenInvalid:!0})),n.props.onError(t)})),n}return Object(c.a)(e,t),Object(u.a)(e,[{key:"componentDidMount",value:function(){if(e.supported()){var t=this.props.mapStyle;this._mapbox=new $.a(Object.assign({},this.props,{mapboxgl:et.a,width:this._width,height:this._height,container:this._mapboxMapRef.current,onError:this._mapboxMapError,mapStyle:v(t)})),this._map=this._mapbox.getMap()}}},{key:"componentDidUpdate",value:function(t){this._mapbox&&(this._updateMapStyle(t,this.props),this._updateMapProps(this.props))}},{key:"componentWillUnmount",value:function(){this._mapbox&&(this._mapbox.finalize(),this._mapbox=null,this._map=null)}},{key:"_updateMapSize",value:function(t,e){this._width===t&&this._height===e||(this._width=t,this._height=e,this._updateMapProps(this.props))}},{key:"_updateMapStyle",value:function(t,e){var n=e.mapStyle;n!==t.mapStyle&&n&&this._map.setStyle(v(n),{diff:!this.props.preventStyleDiffing})}},{key:"_updateMapProps",value:function(t){this._mapbox&&this._mapbox.setProps(Object.assign({},t,{width:this._width,height:this._height}))}},{key:"_renderNoTokenWarning",value:function(){if(this.state.accessTokenInvalid&&!this.props.disableTokenWarning){return p.a.createElement("div",{key:"warning",id:"no-token-warning",style:{position:"absolute",left:0,top:0}},p.a.createElement("h3",{key:"header"},"NO_TOKEN_WARNING"),p.a.createElement("div",{key:"text"},"For information on setting up your basemap, read"),p.a.createElement("a",{key:"link",href:"https://uber.github.io/react-map-gl/#/Documentation/getting-started/about-mapbox-tokens"},"Note on Map Tokens"))}return null}},{key:"_renderOverlays",value:function(t){var e=this,n=t.width,r=void 0===n?Number(this.props.width):n,i=t.height,o=void 0===i?Number(this.props.height):i;return this._updateMapSize(r,o),p.a.createElement(It.Consumer,null,(function(t){var n=At({},t,{viewport:new Z(At({},e.props,{},e.props.viewState,{width:r,height:o})),map:e._map,mapContainer:t.mapContainer||e._mapContainerRef.current});return p.a.createElement(It.Provider,{value:n},p.a.createElement("div",{key:"map-overlays",className:"overlays",style:Dt},e.props.children))}))}},{key:"render",value:function(){var t=this.props,e=t.className,n=t.width,r=t.height,i=t.style,o=t.visibilityConstraints,a=Object.assign({position:"relative"},i,{width:n,height:r}),s=this.props.visible&&function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tt;for(var r in n){var i=r.slice(0,3),o=(e=r.slice(3))[0].toLowerCase()+e.slice(1);if("min"===i&&t[o]n[r])return!1}return!0}(this.props.viewState||this.props,o),u=Object.assign({},Dt,{visibility:s?"inherit":"hidden"});return p.a.createElement("div",{key:"map-container",style:a,ref:this._mapContainerRef},p.a.createElement("div",{key:"map-mapbox",ref:this._mapboxMapRef,style:u,className:e}),p.a.createElement(J.a,{key:"autosizer",disableWidth:Number.isFinite(n),disableHeight:Number.isFinite(r),onResize:this.props.onResize},this._renderOverlays.bind(this)),this._renderNoTokenWarning())}}],[{key:"supported",value:function(){return et.a&&et.a.supported()}}]),e}(h.PureComponent);Object(l.a)(Nt,"propTypes",Mt),Object(l.a)(Nt,"defaultProps",Rt);var Lt=function(){};var Ft=1,jt=2,zt=3,Bt=4,Ut={transitionDuration:0,transitionEasing:function(t){return t},transitionInterpolator:new Et,transitionInterruption:Ft,onTransitionStart:Lt,onTransitionInterrupt:Lt,onTransitionEnd:Lt,onViewportChange:Lt,onStateChange:Lt},Vt=function(){function t(e,n){var r=this;Object(i.a)(this,t),Object(l.a)(this,"props",void 0),Object(l.a)(this,"state",void 0),Object(l.a)(this,"time",void 0),Object(l.a)(this,"_animationFrame",null),Object(l.a)(this,"_onTransitionFrame",(function(){r._animationFrame=requestAnimationFrame(r._onTransitionFrame),r._updateViewport()})),e&&(this.props=e),this.time=n||Date.now}return Object(u.a)(t,[{key:"getViewportInTransition",value:function(){return this._animationFrame?this.state.propsInTransition:null}},{key:"processViewportChange",value:function(t){var e=this.props;if(this.props=t,this._shouldIgnoreViewportChange(e,t))return!1;if(this._isTransitionEnabled(t)){var n=Object.assign({},e),r=Object.assign({},t);if(this._isTransitionInProgress()&&(e.onTransitionInterrupt(),this.state.interruption===jt?Object.assign(n,this.state.endProps):Object.assign(n,this.state.propsInTransition),this.state.interruption===Bt)){var i=this.time(),o=(i-this.state.startTime)/this.state.duration;r.transitionDuration=this.state.duration-(i-this.state.startTime),r.transitionEasing=function(t,e){var n=t(e);return function(r){return 1/(1-n)*(t(r*(1-e)+e)-n)}}(this.state.easing,o),r.transitionInterpolator=n.transitionInterpolator}return r.onTransitionStart(),this._triggerTransition(n,r),!0}return this._isTransitionInProgress()&&(e.onTransitionInterrupt(),this._endTransition()),!1}},{key:"_isTransitionInProgress",value:function(){return Boolean(this._animationFrame)}},{key:"_isTransitionEnabled",value:function(t){var e=t.transitionDuration,n=t.transitionInterpolator;return(e>0||"auto"===e)&&Boolean(n)}},{key:"_isUpdateDueToCurrentTransition",value:function(t){return!!this.state.propsInTransition&&this.state.interpolator.arePropsEqual(t,this.state.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(t,e){return!t||(this._isTransitionInProgress()?this.state.interruption===zt||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e))}},{key:"_triggerTransition",value:function(t,e){ct(this._isTransitionEnabled(e),"Transition is not enabled"),this._animationFrame&&cancelAnimationFrame(this._animationFrame);var n=e.transitionInterpolator,r=n.getDuration?n.getDuration(t,e):e.transitionDuration,i=e.transitionInterpolator.initializeProps(t,e),o={inTransition:!0,isZooming:t.zoom!==e.zoom,isPanning:t.longitude!==e.longitude||t.latitude!==e.latitude,isRotating:t.bearing!==e.bearing||t.pitch!==e.pitch};this.state={duration:r,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startTime:this.time(),startProps:i.start,endProps:i.end,animation:null,propsInTransition:{},interactionState:o},this._onTransitionFrame(),this.props.onStateChange(o)}},{key:"_endTransition",value:function(){this._animationFrame&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=null),this.props.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1})}},{key:"_updateViewport",value:function(){var t=this.time(),e=this.state,n=e.startTime,r=e.duration,i=e.easing,o=e.interpolator,a=e.startProps,s=e.endProps,u=!1,c=(t-n)/r;c>=1&&(c=1,u=!0),c=i(c);var l=o.interpolateProps(a,s,c),h=new Ct(Object.assign({},this.props,l));this.state.propsInTransition=h.getViewportProps(),this.props.onViewportChange(this.state.propsInTransition,this.state.interactionState,this.props),u&&(this._endTransition(),this.props.onTransitionEnd())}}]),t}();Object(l.a)(Vt,"defaultProps",Ut);var qt=n(25),Wt=n.n(qt),Gt=1,Ht=2,Kt=4,Qt={mousedown:Gt,mousemove:Ht,mouseup:Kt};!function(t){var e=t.prototype.handler;t.prototype.handler=function(t){var n=this.store;t.button>0&&(function(t,e){for(var n=0;n=0&&(this.pressed=!0),e&Ht&&0===t.which&&(e=Kt),this.pressed&&(e&Kt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))};var Xt=Wt.a.Manager,Yt=Wt.a,Zt=Yt?[[Yt.Rotate,{enable:!1}],[Yt.Pinch,{enable:!1}],[Yt.Swipe,{enable:!1}],[Yt.Pan,{threshold:0,enable:!1}],[Yt.Press,{enable:!1}],[Yt.Tap,{event:"doubletap",taps:2,enable:!1}],[Yt.Tap,{event:"anytap",enable:!1}],[Yt.Tap,{enable:!1}]]:null,Jt={rotate:["pinch"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},$t={doubletap:["tap"]},te={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},ee=["keydown","keyup"],ne=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],re=["wheel","mousewheel","DOMMouseScroll"],ie={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},oe={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},ae=n(21),se=-1!==ae.b.indexOf("firefox"),ue=re,ce=function(){function t(e,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(i.a)(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},o),this.events=ue.concat(o.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent,!!ae.a&&{passive:!1})}))}return Object(u.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"wheel"===t&&(this.options.enable=e)}},{key:"handleEvent",value:function(t){if(this.options.enable){var e=t.deltaY;ae.c.WheelEvent&&(se&&t.deltaMode===ae.c.WheelEvent.DOM_DELTA_PIXEL&&(e/=ae.c.devicePixelRatio),t.deltaMode===ae.c.WheelEvent.DOM_DELTA_LINE&&(e*=40));var n={x:t.clientX,y:t.clientY};0!==e&&e%4.000244140625===0&&(e=Math.floor(e/4.000244140625)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,n)}}},{key:"_onWheel",value:function(t,e,n){this.callback({type:"wheel",center:n,delta:e,srcEvent:t,pointerType:"mouse",target:t.target})}}]),t}(),le=ne,he=function(){function t(e,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(i.a)(this,t),this.element=e,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},o),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=le.concat(o.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent)}))}return Object(u.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"pointermove"===t&&(this.enableMoveEvent=e),"pointerover"===t&&(this.enableOverEvent=e),"pointerout"===t&&(this.enableOutEvent=e),"pointerleave"===t&&(this.enableLeaveEvent=e)}},{key:"handleEvent",value:function(t){this.handleOverEvent(t),this.handleOutEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)}},{key:"handleOverEvent",value:function(t){this.enableOverEvent&&"mouseover"===t.type&&this.callback({type:"pointerover",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleOutEvent",value:function(t){this.enableOutEvent&&"mouseout"===t.type&&this.callback({type:"pointerout",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleLeaveEvent",value:function(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this.callback({type:"pointerleave",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleMoveEvent",value:function(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:t,pointerType:"mouse",target:t.target});break;case"mouseup":this.pressed=!1}}}]),t}(),pe=ee,fe=function(){function t(e,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(i.a)(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},o),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=pe.concat(o.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=1,e.style.outline="none",this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent)}))}return Object(u.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"keydown"===t&&(this.enableDownEvent=e),"keyup"===t&&(this.enableUpEvent=e)}},{key:"handleEvent",value:function(t){var e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:"keydown",srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:"keyup",srcEvent:t,key:t.key,target:t.target}))}}]),t}(),de=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(i.a)(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},r),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}return Object(u.a)(t,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(t,e){"contextmenu"===t&&(this.options.enable=e)}},{key:"handleEvent",value:function(t){this.options.enable&&this.callback({type:"contextmenu",center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}]),t}(),me=1,ye=2,ge=4,ve={pointerdown:me,pointermove:ye,pointerup:ge,mousedown:me,mousemove:ye,mouseup:ge},_e=1,be=2,we=3,xe=0,Ee=1,Te=2,Se=1,Ce=2,Ie=4;var ke=function(){function t(e){Object(i.a)(this,t),this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this)}return Object(u.a)(t,[{key:"isEmpty",value:function(){return 0===this.handlers.length}},{key:"add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.handlers,o=this.handlersByElement;o.has(n)||o.set(n,[]);var a={type:t,handler:e,srcElement:n,once:r};i.push(a),o.get(n).push(a)}},{key:"remove",value:function(t,e){for(var n=this.handlers,r=this.handlersByElement,i=n.length-1;i>=0;i--){var o=n[i];if(o.type===t&&o.handler===e){n.splice(i,1);var a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}}},{key:"handleEvent",value:function(t){if(!this.isEmpty()){for(var e=this._normalizeEvent(t),n=t.srcEvent.target;n&&n!==e.rootElement;){if(this._emit(e,n),e.handled)return;n=n.parentNode}this._emit(e,"root")}}},{key:"_emit",value:function(t,e){var n=this.handlersByElement.get(e);if(n){for(var r=!1,i=function(){t.handled=!0},o=function(){t.handled=!0,r=!0},a=[],s=0;s0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t),this.options=Object.assign({},Ae,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(e);var r=n.events;r&&this.on(r)}return Object(u.a)(t,[{key:"setElement",value:function(t){var e=this;if(this.element&&this.destroy(),this.element=t,t){var n=this.options,r=n.Manager;for(var i in this.manager=new r(t,{touchAction:n.touchAction,recognizers:n.recognizers||Zt}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(Jt).forEach((function(t){var n=e.manager.get(t);n&&Jt[t].forEach((function(t){n.recognizeWith(t)}))})),n.recognizerOptions){var o=this.manager.get(i);if(o){var a=n.recognizerOptions[i];delete a.enable,o.set(a)}}this.wheelInput=new ce(t,this._onOtherEvent,{enable:!1}),this.moveInput=new he(t,this._onOtherEvent,{enable:!1}),this.keyInput=new fe(t,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new de(t,this._onOtherEvent,{enable:!1});var s=!0,u=!1,c=void 0;try{for(var l,h=this.events[Symbol.iterator]();!(s=(l=h.next()).done);s=!0){var p=Object(_.a)(l.value,2),f=p[0],d=p[1];d.isEmpty()||(this._toggleRecognizer(d.recognizerName,!0),this.manager.on(f,d.handleEvent))}}catch(m){u=!0,c=m}finally{try{s||null==h.return||h.return()}finally{if(u)throw c}}}}},{key:"destroy",value:function(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}},{key:"on",value:function(t,e,n){this._addEventHandler(t,e,n,!1)}},{key:"once",value:function(t,e,n){this._addEventHandler(t,e,n,!0)}},{key:"off",value:function(t,e){this._removeEventHandler(t,e)}},{key:"_toggleRecognizer",value:function(t,e){var n=this.manager;if(n){var r=n.get(t);if(r&&r.options.enable!==e){r.set({enable:e});var i=$t[t];i&&!this.options.recognizers&&i.forEach((function(i){var o=n.get(i);e?(o.requireFailure(t),r.dropRequireFailure(i)):o.dropRequireFailure(t)}))}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}}},{key:"_addEventHandler",value:function(t,e,n,r){if("string"===typeof t){var i=this.manager,o=this.events,a=oe[t]||t,s=o.get(a);s||(s=new ke(this),o.set(a,s),s.recognizerName=ie[a]||a,i&&i.on(a,s.handleEvent)),this._toggleRecognizer(s.recognizerName,!0),s.add(t,e,n,r)}else for(var u in n=e,t)this._addEventHandler(u,t[u],n,r)}},{key:"_removeEventHandler",value:function(t,e){if("string"===typeof t){var n=this.events,r=oe[t]||t,i=n.get(r);if(i&&(i.remove(t,e),i.isEmpty())){var o=i.recognizerName,a=!1,s=!0,u=!1,c=void 0;try{for(var l,h=n.values()[Symbol.iterator]();!(s=(l=h.next()).done);s=!0){var p=l.value;if(p.recognizerName===o&&!p.isEmpty()){a=!0;break}}}catch(d){u=!0,c=d}finally{try{s||null==h.return||h.return()}finally{if(u)throw c}}a||this._toggleRecognizer(o,!1)}}else for(var f in t)this._removeEventHandler(f,t[f])}},{key:"_onBasicInput",value:function(t){var e=t.srcEvent,n=te[e.type];n&&this.manager.emit(n,t)}},{key:"_onOtherEvent",value:function(t){this.manager.emit(t.type,t)}}]),t}();var Pe={transitionDuration:0},De={transitionDuration:300,transitionEasing:function(t){return t},transitionInterpolator:new Et,transitionInterruption:Ft},Me=["wheel"],Re=["panstart","panmove","panend"],Ne=["pinchstart","pinchmove","pinchend","pinchcancel"],Le=["doubletap"],Fe=["keydown"],je=function(){function t(){var e=this;Object(i.a)(this,t),Object(l.a)(this,"events",[]),Object(l.a)(this,"mapState",void 0),Object(l.a)(this,"onViewportChange",void 0),Object(l.a)(this,"onStateChange",void 0),Object(l.a)(this,"mapStateProps",void 0),Object(l.a)(this,"eventManager",void 0),Object(l.a)(this,"scrollZoom",!0),Object(l.a)(this,"dragPan",!0),Object(l.a)(this,"dragRotate",!0),Object(l.a)(this,"doubleClickZoom",!0),Object(l.a)(this,"touchZoom",!0),Object(l.a)(this,"touchRotate",!1),Object(l.a)(this,"keyboard",!0),Object(l.a)(this,"_state",{isDragging:!1}),Object(l.a)(this,"_events",{}),Object(l.a)(this,"_transitionManager",new Vt),Object(l.a)(this,"setState",(function(t){Object.assign(e._state,t),e.onStateChange&&e.onStateChange(e._state)})),this.handleEvent=this.handleEvent.bind(this),this._onWheelEnd=function(t,e){var n,r,i,o=function(){return i=null,t.apply(n,r)};return function(){n=this,r=arguments,i&&clearTimeout(i),i=setTimeout(o,e)}}(this._onWheelEnd,100)}return Object(u.a)(t,[{key:"handleEvent",value:function(t){switch(this.mapState=this.getMapState(),t.type){case"panstart":return this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchcancel":case"pinchend":return this._onPinchEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}},{key:"getCenter",value:function(t){var e=t.offsetCenter;return[e.x,e.y]}},{key:"isFunctionKeyPressed",value:function(t){var e=t.srcEvent;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}},{key:"updateViewport",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.mapState?this.mapState.getViewportProps():{},i=Object.assign({},t.getViewportProps(),e),o=Object.keys(i).some((function(t){return r[t]!==i[t]}));o&&this.onViewportChange(i,n,r),this.setState(Object.assign({},t.getInteractiveState(),n))}},{key:"getMapState",value:function(t){return new Ct(Object.assign({},this.mapStateProps,this._state,t))}},{key:"setOptions",value:function(t){var e=t.onViewportChange,n=t.onStateChange,r=t.eventManager,i=void 0===r?this.eventManager:r,o=t.isInteractive,a=void 0===o||o,s=t.scrollZoom,u=void 0===s?this.scrollZoom:s,c=t.dragPan,l=void 0===c?this.dragPan:c,h=t.dragRotate,p=void 0===h?this.dragRotate:h,f=t.doubleClickZoom,d=void 0===f?this.doubleClickZoom:f,m=t.touchZoom,y=void 0===m?this.touchZoom:m,g=t.touchRotate,v=void 0===g?this.touchRotate:g,_=t.keyboard,b=void 0===_?this.keyboard:_;this.onViewportChange=e,this.onStateChange=n,this.mapStateProps&&this.mapStateProps.height===t.height||this.updateViewport(new Ct(t)),this.mapStateProps=t,this._transitionManager.processViewportChange(Object.assign({},t,{onStateChange:this.setState})),this.eventManager!==i&&(this.eventManager=i,this._events={},this.toggleEvents(this.events,!0)),this.toggleEvents(Me,a&&u),this.toggleEvents(Re,a&&(l||p)),this.toggleEvents(Ne,a&&(y||v)),this.toggleEvents(Le,a&&d),this.toggleEvents(Fe,a&&b),this.scrollZoom=u,this.dragPan=l,this.dragRotate=p,this.doubleClickZoom=d,this.touchZoom=y,this.touchRotate=v,this.keyboard=b}},{key:"toggleEvents",value:function(t,e){var n=this;this.eventManager&&t.forEach((function(t){n._events[t]!==e&&(n._events[t]=e,e?n.eventManager.on(t,n.handleEvent):n.eventManager.off(t,n.handleEvent))}))}},{key:"_onPanStart",value:function(t){var e=this.getCenter(t),n=this.mapState.panStart({pos:e}).rotateStart({pos:e});return this.updateViewport(n,Pe,{isDragging:!0}),!0}},{key:"_onPan",value:function(t){return this.isFunctionKeyPressed(t)||t.rightButton?this._onPanRotate(t):this._onPanMove(t)}},{key:"_onPanEnd",value:function(t){var e=this.mapState.panEnd().rotateEnd();return this.updateViewport(e,null,{isDragging:!1,isPanning:!1,isRotating:!1}),!0}},{key:"_onPanMove",value:function(t){if(!this.dragPan)return!1;var e=this.getCenter(t),n=this.mapState.pan({pos:e});return this.updateViewport(n,Pe,{isPanning:!0}),!0}},{key:"_onPanRotate",value:function(t){if(!this.dragRotate)return!1;var e=t.deltaX,n=t.deltaY,r=this.getCenter(t),i=Object(_.a)(r,2)[1],o=i-n,a=this.mapState.getViewportProps(),s=a.width,u=a.height,c=e/s,l=0;n>0?Math.abs(u-o)>5&&(l=n/(o-u)*1.2):n<0&&o>5&&(l=1-i/o),l=Math.min(1,Math.max(-1,l));var h=this.mapState.rotate({deltaScaleX:c,deltaScaleY:l});return this.updateViewport(h,Pe,{isRotating:!0}),!0}},{key:"_onWheel",value:function(t){if(!this.scrollZoom)return!1;t.preventDefault();var e=this.getCenter(t),n=t.delta,r=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==r&&(r=1/r);var i=this.mapState.zoom({pos:e,scale:r});return this.updateViewport(i,Pe,{isZooming:!0}),this._onWheelEnd(),!0}},{key:"_onWheelEnd",value:function(){this.setState({isZooming:!1})}},{key:"_onPinchStart",value:function(t){var e=this.getCenter(t),n=this.mapState.zoomStart({pos:e}).rotateStart({pos:e});return this._state.startPinchRotation=t.rotation,this.updateViewport(n,Pe,{isDragging:!0}),!0}},{key:"_onPinch",value:function(t){if(!this.touchZoom&&!this.touchRotate)return!1;var e=this.mapState;if(this.touchZoom){var n=t.scale,r=this.getCenter(t);e=e.zoom({pos:r,scale:n})}if(this.touchRotate){var i=t.rotation,o=this._state.startPinchRotation;e=e.rotate({deltaScaleX:-(i-o)/180})}return this.updateViewport(e,Pe,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),!0}},{key:"_onPinchEnd",value:function(t){var e=this.mapState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(e,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(t){if(!this.doubleClickZoom)return!1;var e=this.getCenter(t),n=this.isFunctionKeyPressed(t),r=this.mapState.zoom({pos:e,scale:n?.5:2});return this.updateViewport(r,Object.assign({},De,{transitionInterpolator:new Et({around:e})})),!0}},{key:"_onKeyDown",value:function(t){if(!this.keyboard)return!1;var e,n=this.isFunctionKeyPressed(t),r=this.mapStateProps;switch(t.srcEvent.keyCode){case 189:e=n?this.getMapState({zoom:r.zoom-2}):this.getMapState({zoom:r.zoom-1});break;case 187:e=n?this.getMapState({zoom:r.zoom+2}):this.getMapState({zoom:r.zoom+1});break;case 37:e=n?this.getMapState({bearing:r.bearing-15}):this.mapState.pan({pos:[100,0],startPos:[0,0]});break;case 39:e=n?this.getMapState({bearing:r.bearing+15}):this.mapState.pan({pos:[-100,0],startPos:[0,0]});break;case 38:e=n?this.getMapState({pitch:r.pitch+10}):this.mapState.pan({pos:[0,100],startPos:[0,0]});break;case 40:e=n?this.getMapState({pitch:r.pitch-10}):this.mapState.pan({pos:[0,-100],startPos:[0,0]});break;default:return!1}return this.updateViewport(e,De)}}]),t}(),ze=[{old:"onChangeViewport",new:"onViewportChange"},{old:"perspectiveEnabled",new:"dragRotate"},{old:"onHoverFeatures",new:"onHover"},{old:"onClickFeatures",new:"onClick"},{old:"touchZoomRotate",new:"touchZoom, touchRotate"},{old:"mapControls",new:"controller"}];function Be(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ze.forEach((function(e){if(t.hasOwnProperty(e.old)){var n=(r=e.old,"react-map-gl: `".concat(r,"` is removed."));e.new&&(n="".concat(n," ").concat(function(t){return"Use `".concat(t,"` instead.")}(e.new))),console.warn(n)}var r}))}var Ue=Object.assign({},Nt.propTypes,{maxZoom:d.a.number,minZoom:d.a.number,maxPitch:d.a.number,minPitch:d.a.number,onViewStateChange:d.a.func,onViewportChange:d.a.func,onInteractionStateChange:d.a.func,transitionDuration:d.a.oneOfType([d.a.number,d.a.string]),transitionInterpolator:d.a.object,transitionInterruption:d.a.number,transitionEasing:d.a.func,onTransitionStart:d.a.func,onTransitionInterrupt:d.a.func,onTransitionEnd:d.a.func,scrollZoom:d.a.bool,dragPan:d.a.bool,dragRotate:d.a.bool,doubleClickZoom:d.a.bool,touchZoom:d.a.bool,touchRotate:d.a.bool,keyboard:d.a.bool,onHover:d.a.func,onClick:d.a.func,onDblClick:d.a.func,onContextMenu:d.a.func,onMouseDown:d.a.func,onMouseMove:d.a.func,onMouseUp:d.a.func,onTouchStart:d.a.func,onTouchMove:d.a.func,onTouchEnd:d.a.func,onMouseEnter:d.a.func,onMouseLeave:d.a.func,onMouseOut:d.a.func,onWheel:d.a.func,touchAction:d.a.string,clickRadius:d.a.number,interactiveLayerIds:d.a.array,getCursor:d.a.func,controller:d.a.instanceOf(je)}),Ve=Object.assign({},Nt.defaultProps,Tt,Vt.defaultProps,{onViewStateChange:null,onViewportChange:null,onClick:null,onNativeClick:null,onHover:null,onContextMenu:function(t){return t.preventDefault()},scrollZoom:!0,dragPan:!0,dragRotate:!0,doubleClickZoom:!0,touchZoom:!0,touchRotate:!1,keyboard:!0,touchAction:"none",clickRadius:0,getCursor:function(t){var e=t.isDragging,n=t.isHovering;return e?"grabbing":n?"pointer":"grab"}}),qe=function(t){function e(t){var n;return Object(i.a)(this,e),n=Object(o.a)(this,Object(a.a)(e).call(this,t)),Object(l.a)(Object(s.a)(n),"state",{isLoaded:!1,isDragging:!1,isHovering:!1}),Object(l.a)(Object(s.a)(n),"_controller",void 0),Object(l.a)(Object(s.a)(n),"_eventManager",void 0),Object(l.a)(Object(s.a)(n),"_interactiveContext",void 0),Object(l.a)(Object(s.a)(n),"_width",0),Object(l.a)(Object(s.a)(n),"_height",0),Object(l.a)(Object(s.a)(n),"_eventCanvasRef",Object(h.createRef)()),Object(l.a)(Object(s.a)(n),"_staticMapRef",Object(h.createRef)()),Object(l.a)(Object(s.a)(n),"getMap",(function(){return n._staticMapRef.current?n._staticMapRef.current.getMap():null})),Object(l.a)(Object(s.a)(n),"queryRenderedFeatures",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.getMap();return r&&r.queryRenderedFeatures(t,e)})),Object(l.a)(Object(s.a)(n),"_onInteractionStateChange",(function(t){var e=t.isDragging,r=void 0!==e&&e;r!==n.state.isDragging&&(n._updateInteractiveContext({isDragging:r}),n.setState({isDragging:r}));var i=n.props.onInteractionStateChange;i&&i(t)})),Object(l.a)(Object(s.a)(n),"_onResize",(function(t){var e=t.width,r=t.height;n._width=e,n._height=r,n._setControllerProps(n.props),n.props.onResize({width:e,height:r})})),Object(l.a)(Object(s.a)(n),"_onViewportChange",(function(t,e,r){var i=n.props,o=i.onViewStateChange,a=i.onViewportChange;o&&o({viewState:t,interactionState:e,oldViewState:r}),a&&a(t,e,r)})),Object(l.a)(Object(s.a)(n),"_onLoad",(function(t){n.setState({isLoaded:!0}),n.props.onLoad(t)})),Object(l.a)(Object(s.a)(n),"_onEvent",(function(t,e){var r=n.props[t];r&&r(n._normalizeEvent(e))})),Object(l.a)(Object(s.a)(n),"_onPointerDown",(function(t){switch(t.pointerType){case"touch":n._onEvent("onTouchStart",t);break;default:n._onEvent("onMouseDown",t)}})),Object(l.a)(Object(s.a)(n),"_onPointerUp",(function(t){switch(t.pointerType){case"touch":n._onEvent("onTouchEnd",t);break;default:n._onEvent("onMouseUp",t)}})),Object(l.a)(Object(s.a)(n),"_onPointerMove",(function(t){switch(t.pointerType){case"touch":n._onEvent("onTouchMove",t);break;default:n._onEvent("onMouseMove",t)}if(!n.state.isDragging){var e,r=n.props,i=r.onHover,o=r.interactiveLayerIds;t=n._normalizeEvent(t),n.state.isLoaded&&(o||i)&&(e=n._getFeatures({pos:t.point,radius:n.props.clickRadius})),i&&(t.features=e,i(t));var a=Boolean(o&&e&&e.length>0),s=a&&!n.state.isHovering,u=!a&&n.state.isHovering;s&&n._onEvent("onMouseEnter",t),u&&n._onEvent("onMouseLeave",t),(s||u)&&n.setState({isHovering:a})}})),Object(l.a)(Object(s.a)(n),"_onClick",(function(t){var e=n.props,r=e.onClick,i=e.onNativeClick,o=e.onDblClick,a=e.doubleClickZoom,s=[],u=o||a;switch(t.type){case"anyclick":s.push(i),u||s.push(r);break;case"click":u&&s.push(r)}(s=s.filter(Boolean)).length&&((t=n._normalizeEvent(t)).features=n._getFeatures({pos:t.point,radius:n.props.clickRadius}),s.forEach((function(e){return e(t)})))})),Be(t),n._controller=t.controller||new je,n._eventManager=new Oe(null,{touchAction:t.touchAction}),n._updateInteractiveContext({isDragging:!1,eventManager:n._eventManager}),n}return Object(c.a)(e,t),Object(u.a)(e,null,[{key:"supported",value:function(){return Nt.supported()}}]),Object(u.a)(e,[{key:"componentDidMount",value:function(){var t=this._eventManager,e=this._eventCanvasRef.current;t.setElement(e),t.on({pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerup:this._onPointerUp,pointerleave:this._onEvent.bind(this,"onMouseOut"),click:this._onClick,anyclick:this._onClick,dblclick:this._onEvent.bind(this,"onDblClick"),wheel:this._onEvent.bind(this,"onWheel"),contextmenu:this._onEvent.bind(this,"onContextMenu")}),this._setControllerProps(this.props),this._updateInteractiveContext({mapContainer:e})}},{key:"componentWillUnmount",value:function(){this._eventManager.destroy()}},{key:"_setControllerProps",value:function(t){t=Object.assign({},t,t.viewState,{isInteractive:Boolean(t.onViewStateChange||t.onViewportChange),onViewportChange:this._onViewportChange,onStateChange:this._onInteractionStateChange,eventManager:this._eventManager,width:this._width,height:this._height}),this._controller.setOptions(t);var e=this._interactiveContext;e.onViewportChange=t.onViewportChange,e.onViewStateChange=t.onViewStateChange}},{key:"_getFeatures",value:function(t){var e,n=t.pos,r=t.radius,i={},o=this.getMap();if(this.props.interactiveLayerIds&&(i.layers=this.props.interactiveLayerIds),r){var a=r,s=[[n[0]-a,n[1]+a],[n[0]+a,n[1]-a]];e=o&&o.queryRenderedFeatures(s,i)}else e=o&&o.queryRenderedFeatures(n,i);return e}},{key:"_updateInteractiveContext",value:function(t){this._interactiveContext=Object.assign({},this._interactiveContext,t)}},{key:"_normalizeEvent",value:function(t){if(t.lngLat)return t;var e=t.offsetCenter,n=[e.x,e.y],r=new Z(Object.assign({},this.props,{width:this._width,height:this._height}));return t.point=n,t.lngLat=r.unproject(n),t}},{key:"render",value:function(){this._setControllerProps(this.props);var t=this.props,e=t.width,n=t.height,i=t.style,o=t.getCursor,a=Object.assign({position:"relative"},i,{width:e,height:n,cursor:o(this.state)});return p.a.createElement(It.Provider,{value:this._interactiveContext},p.a.createElement("div",{key:"event-canvas",ref:this._eventCanvasRef,style:a},p.a.createElement(Nt,r({},this.props,{width:"100%",height:"100%",style:null,onResize:this._onResize,onLoad:this._onLoad,ref:this._staticMapRef}),this.props.children)))}}]),e}(h.PureComponent);Object(l.a)(qe,"propTypes",Ue),Object(l.a)(qe,"defaultProps",Ve);var We={type:d.a.string.isRequired,id:d.a.string},Ge=0,He=function(t){function e(t){var n;return Object(i.a)(this,e),n=Object(o.a)(this,Object(a.a)(e).call(this,t)),Object(l.a)(Object(s.a)(n),"id",void 0),Object(l.a)(Object(s.a)(n),"type",void 0),Object(l.a)(Object(s.a)(n),"_map",null),Object(l.a)(Object(s.a)(n),"_sourceOptions",{}),Object(l.a)(Object(s.a)(n),"_updateSource",(function(){var t=Object(s.a)(n),e=t.type,r=t._map;if(r){var i=Object(s.a)(n),o=i._sourceOptions,a=i.props;ct(!a.id||a.id===n.id,"source id changed"),ct(a.type===e,"source type changed");var u=null,c=0;for(var l in a)"children"!==l&&"id"!==l&&o[l]!==a[l]&&(o[l]=a[l],u=l,c++);var h=n.getSource();h?c&&("geojson"===e?h.setData(o.data):"image"===e?h.updateImage({url:o.url,coordinates:o.coordinates}):"canvas"!==e&&"video"!==e||1!==c||"coordinates"!==u?(r.removeSource(n.id),r.addSource(n.id,o)):h.setCoordinates(o.coordinates)):n._createSource(o)}})),n.id=t.id||"jsx-source-".concat(Ge++),n.type=t.type,n}return Object(c.a)(e,t),Object(u.a)(e,[{key:"componentWillUnmount",value:function(){var t=this,e=this._map;e&&(e.off("styledata",this._updateSource),e.style&&requestAnimationFrame((function(){return e.removeSource(t.id)})))}},{key:"getSource",value:function(){var t=this._map;return t&&t.style&&t.getSource(this.id)}},{key:"_createSource",value:function(t){var e=this._map;e.style&&e.style._loaded&&e.addSource(this.id,t)}},{key:"_render",value:function(t){var e=this;return this._map||(this._map=t.map,this._map.on("styledata",this._updateSource)),this._updateSource(),p.a.Children.map(this.props.children,(function(t){return Object(h.cloneElement)(t,{source:e.id})}))}},{key:"render",value:function(){return p.a.createElement(It.Consumer,null,this._render.bind(this))}}]),e}(h.PureComponent);function Ke(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}Object(l.a)(He,"propTypes",We);var Qe=n(24);function Xe(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var n=0;n=.5;)p-=.5,f+=.5*a;else if(d>i-c)for(;d>i-c&&p<=.5;)p+=.5,d-=.5*a;var m=e-h*o,y=m+o,g=.5;if(.5===p&&(h=Math.floor(h),g=1),m=g;)h-=g,m+=g*o;else if(y>r-c)for(;y>r-c&&h<=1-g;)h+=g,y-=g*o;return ln.find((function(t){var e=cn[t];return e.x===h&&e.y===p}))||s}({x:t,y:e,anchor:i,padding:a,width:n.width,height:n.height,selfWidth:s.clientWidth,selfHeight:s.clientHeight}):i}},{key:"_getContainerStyle",value:function(t,e,n,r){var i=this._context.viewport,o=this.props,a=o.offsetLeft,s=o.offsetTop,u=o.sortByDepth,c=cn[r],l=t+a,h=e+s,p={position:"absolute",transform:"\n translate(".concat(100*-c.x,"%, ").concat(100*-c.y,"%)\n translate(").concat(l,"px, ").concat(h,"px)\n "),display:void 0,zIndex:void 0};return u?(n>1||n<-1||t<0||t>i.width||e<0||e>i.height?p.display="none":p.zIndex=Math.floor((1-n)/2*1e5),p):p}},{key:"_renderTip",value:function(t){var e=this.props.tipSize;return p.a.createElement("div",{key:"tip",className:"mapboxgl-popup-tip",style:{borderWidth:e}})}},{key:"_renderContent",value:function(){var t=this.props,e=t.closeButton,n=t.children,r=this._context.eventManager?null:this._onClick;return p.a.createElement("div",{key:"content",ref:this._contentRef,className:"mapboxgl-popup-content",onClick:r},e&&p.a.createElement("button",{key:"close-button",className:"mapboxgl-popup-close-button",type:"button"},"\xd7"),n)}},{key:"_render",value:function(){var t=this.props,e=t.className,n=t.longitude,r=t.latitude,i=t.altitude,o=this._context.viewport.project([n,r,i]),a=Object(_.a)(o,3),s=a[0],u=a[1],c=a[2],l=this._getPosition(s,u),h=this._getContainerStyle(s,u,c,l);return p.a.createElement("div",{className:"mapboxgl-popup mapboxgl-popup-anchor-".concat(l," ").concat(e),style:h,ref:this._containerRef},this._renderTip(l),this._renderContent())}}]),e}(tn);Object(l.a)(fn,"propTypes",hn),Object(l.a)(fn,"defaultProps",pn);var dn,mn=n(14),yn=Object.assign({},tn.propTypes,{className:d.a.string,container:d.a.object}),gn=Object.assign({},tn.defaultProps,{className:"",container:null}),vn=function(t){function e(){var t,n;Object(i.a)(this,e);for(var r=arguments.length,u=new Array(r),c=0;c(r=1))return r;for(;no?n=i:r=i,i=.5*(r-n)+n}return i},r.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=o;function o(t,e){this.x=t,this.y=e}function a(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var n=0;n0;)e[n]=arguments[n+1];for(var r=0,i=e;r>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function m(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function y(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function g(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,n){var r={};for(var i in t)r[i]=e.call(n||this,t[i],i,t);return r}function _(t,e,n){var r={};for(var i in t)e.call(n||this,t[i],i,t)&&(r[i]=t[i]);return r}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?v(t,b):t}var w={};function x(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0)}function E(t,e,n){return(n.y-t.y)*(e.x-t.x)>(e.y-t.y)*(n.x-t.x)}function T(t){for(var e=0,n=0,r=t.length,i=r-1,o=void 0,a=void 0;n@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,n,r,i){var o=r||i;return e[n]=!o||o.toLowerCase(),""})),e["max-age"]){var n=parseInt(e["max-age"],10);isNaN(n)?delete e["max-age"]:e["max-age"]=n}return e}var I=null;function k(t){if(null==I){var e=t.navigator?t.navigator.userAgent:null;I=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return I}function A(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var O,P,D,M,R=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),N=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,L=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,F={now:R,frame:function(t){var e=N(t);return{cancel:function(){return L(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var n=self.document.createElement("canvas"),r=n.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return n.width=t.width,n.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return O||(O=self.document.createElement("a")),O.href=t,O.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==P&&(P=self.matchMedia("(prefers-reduced-motion: reduce)")),P.matches)}},j={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},z={supported:!1,testSupport:function(t){!B&&M&&(U?V(t):D=t)}},B=!1,U=!1;function V(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,M),t.isContextLost())return;z.supported=!0}catch(t){}t.deleteTexture(e),B=!0}self.document&&((M=self.document.createElement("img")).onload=function(){D&&V(D),D=null,U=!0},M.onerror=function(){B=!0,D=null},M.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var q="01",W=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function G(t){return 0===t.indexOf("mapbox:")}W.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",q,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},W.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},W.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},W.prototype.normalizeStyleURL=function(t,e){if(!G(t))return t;var n=X(t);return n.path="/styles/v1"+n.path,this._makeAPIURL(n,this._customAccessToken||e)},W.prototype.normalizeGlyphsURL=function(t,e){if(!G(t))return t;var n=X(t);return n.path="/fonts/v1"+n.path,this._makeAPIURL(n,this._customAccessToken||e)},W.prototype.normalizeSourceURL=function(t,e){if(!G(t))return t;var n=X(t);return n.path="/v4/"+n.authority+".json",n.params.push("secure"),this._makeAPIURL(n,this._customAccessToken||e)},W.prototype.normalizeSpriteURL=function(t,e,n,r){var i=X(t);return G(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+n,this._makeAPIURL(i,this._customAccessToken||r)):(i.path+=""+e+n,Y(i))},W.prototype.normalizeTileURL=function(t,e,n){if(this._isSkuTokenExpired()&&this._createSkuToken(),!e||!G(e))return t;var r=X(t),i=F.devicePixelRatio>=2||512===n?"@2x":"",o=z.supported?".webp":"$1";return r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+i+o),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path,j.REQUIRE_ACCESS_TOKEN&&(j.ACCESS_TOKEN||this._customAccessToken)&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,this._customAccessToken)},W.prototype.canonicalizeTileURL=function(t){var e=X(t);if(!e.path.match(/(^\/v4\/)/)||!e.path.match(/\.[\w]+$/))return t;var n="mapbox://tiles/";n+=e.path.replace("/v4/","");var r=e.params.filter((function(t){return!t.match(/^access_token=/)}));return r.length&&(n+="?"+r.join("&")),n},W.prototype.canonicalizeTileset=function(t,e){if(!G(e))return t.tiles||[];for(var n=[],r=0,i=t.tiles;r=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){x("Unable to write to LocalStorage")}},J.prototype.processRequests=function(t){},J.prototype.postEvent=function(t,e,n,r){var i=this;if(j.EVENTS_URL){var o=X(j.EVENTS_URL);o.params.push("access_token="+(r||j.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.6.1",skuId:q,userId:this.anonId},s=e?h(a,e):a,u={url:Y(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=wt(u,(function(t){i.pendingRequest=null,n(t),i.saveEventData(),i.processRequests(r)}))}},J.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var $,tt,et=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,n,r){this.skuToken=n,(j.EVENTS_URL&&r||j.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return G(t)||K(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},r)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var n=this.queue.shift(),r=n.id,i=n.timestamp;r&&this.success[r]||(this.anonId||this.fetchEventData(),m(this.anonId)||(this.anonId=d()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||r&&(e.success[r]=!0)}),t))}},e}(J),nt=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){j.EVENTS_URL&&j.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return G(t)||K(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var n=Z(j.ACCESS_TOKEN),r=n?n.u:j.ACCESS_TOKEN,i=r!==this.eventData.tokenU;m(this.anonId)||(this.anonId=d(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=r)}),t)}},e}(J)),rt=nt.postTurnstileEvent.bind(nt),it=new et,ot=it.postMapLoadEvent.bind(it),at="mapbox-tiles",st=500,ut=50,ct=42e4;function lt(){self.caches&&!$&&($=self.caches.open(at))}function ht(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var pt=1/0,ft={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ft);var dt=function(t){function e(e,n,r){401===n&&K(r)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=n,this.url=r,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),mt=S()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function yt(t,e){var n,r=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:mt(),signal:r.signal}),o=!1,a=!1,s=(n=i.url).indexOf("sku=")>0&&K(n);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(n,r,o){if(!a){if(n&&"SecurityError"!==n.message&&x(n),r&&o)return c(r);var u=Date.now();self.fetch(i).then((function(n){if(n.ok){var r=s?n.clone():null;return c(n,r,u)}return e(new dt(n.statusText,n.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(n,r,s){("arrayBuffer"===t.type?n.arrayBuffer():"json"===t.type?n.json():n.text()).then((function(t){a||(r&&s&&function(t,e,n){if(lt(),$){var r={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return r.headers.set(e,t)}));var i=C(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&r.headers.set("Expires",new Date(n+1e3*i["max-age"]).toUTCString()),new Date(r.headers.get("Expires")).getTime()-nDate.now()&&!n["no-cache"]}(r);t.delete(n),i&&t.put(n,r.clone()),e(null,r,i)})).catch(e)})).catch(e)}(i,u):u(null,null),{cancel:function(){a=!0,o||r.abort()}}}var gt,vt,_t=function(t,e){if(n=t.url,!(/^file:/.test(n)||/^file:/.test(mt())&&!/^\w+:/.test(n))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return yt(t,e);if(S()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var n;return function(t,e){var n=new self.XMLHttpRequest;for(var r in n.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(n.responseType="arraybuffer"),t.headers)n.setRequestHeader(r,t.headers[r]);return"json"===t.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===t.credentials,n.onerror=function(){e(new Error(n.statusText))},n.onload=function(){if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){var r=n.response;if("json"===t.type)try{r=JSON.parse(n.response)}catch(t){return e(t)}e(null,r,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else e(new dt(n.statusText,n.status,t.url))},n.send(t.body),{cancel:function(){return n.abort()}}}(t,e)},bt=function(t,e){return _t(h(t,{type:"arrayBuffer"}),e)},wt=function(t,e){return _t(h(t,{method:"POST"}),e)};function xt(t,e,n){n[t]&&-1!==n[t].indexOf(e)||(n[t]=n[t]||[],n[t].push(e))}function Et(t,e,n){if(n&&n[t]){var r=n[t].indexOf(e);-1!==r&&n[t].splice(r,1)}}gt=[],vt=0;var Tt=function(t,e){void 0===e&&(e={}),h(this,e),this.type=t},St=function(t){function e(e,n){void 0===n&&(n={}),t.call(this,"error",h({error:e},n))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Tt),Ct=function(){};Ct.prototype.on=function(t,e){return this._listeners=this._listeners||{},xt(t,e,this._listeners),this},Ct.prototype.off=function(t,e){return Et(t,e,this._listeners),Et(t,e,this._oneTimeListeners),this},Ct.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},xt(t,e,this._oneTimeListeners),this},Ct.prototype.fire=function(t,e){"string"==typeof t&&(t=new Tt(t,e||{}));var n=t.type;if(this.listens(n)){t.target=this;for(var r=0,i=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];r0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Ct.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var It={$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"},sources:{required:!0,type:"sources"},sprite:{type:"string"},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"},"*":{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"},"*":{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:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},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"],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:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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:{},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-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"],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},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},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}},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"}}},kt=function(t,e,n,r){this.message=(t?t+": ":"")+n,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)};function At(t){var e=t.key,n=t.value;return n?[new kt(e,n,"constants have been deprecated as of v8")]:[]}function Ot(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var r=0,i=e;r":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Kt=[Nt,Lt,Ft,jt,zt,qt,Bt,Gt(Ut),Wt];function Qt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Qt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var n=0,r=Kt;n255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?r(parseFloat(t)/100*255):r(parseInt(t))}function a(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in n)return n[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=i.indexOf("("),c=i.indexOf(")");if(-1!==u&&c+1===i.length){var l=i.substr(0,u),h=i.substr(u+1,c-(u+1)).split(","),p=1;switch(l){case"rgba":if(4!==h.length)return null;p=a(h.pop());case"rgb":return 3!==h.length?null:[o(h[0]),o(h[1]),o(h[2]),p];case"hsla":if(4!==h.length)return null;p=a(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=a(h[1]),m=a(h[2]),y=m<=.5?m*(d+1):m+d-m*d,g=2*m-y;return[r(255*s(g,y,f+1/3)),r(255*s(g,y,f)),r(255*s(g,y,f-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,Yt=function(t,e,n,r){void 0===r&&(r=1),this.r=t,this.g=e,this.b=n,this.a=r};Yt.parse=function(t){if(t){if(t instanceof Yt)return t;if("string"==typeof t){var e=Xt(t);if(e)return new Yt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Yt.prototype.toString=function(){var t=this.toArray(),e=t[0],n=t[1],r=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(n)+","+Math.round(r)+","+i+")"},Yt.prototype.toArray=function(){var t=this.r,e=this.g,n=this.b,r=this.a;return 0===r?[0,0,0,0]:[255*t/r,255*e/r,255*n/r,r]},Yt.black=new Yt(0,0,0,1),Yt.white=new Yt(1,1,1,1),Yt.transparent=new Yt(0,0,0,0),Yt.red=new Yt(1,0,0,1);var Zt=function(t,e,n){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Zt.prototype.compare=function(t,e){return this.collator.compare(t,e)},Zt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Jt=function(t,e,n,r,i){this.text=t,this.image=e,this.scale=n,this.fontStack=r,this.textColor=i},$t=function(t){this.sections=t};$t.fromString=function(t){return new $t([new Jt(t,null,null,null,null)])},$t.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},$t.factory=function(t){return t instanceof $t?t:$t.fromString(t)},$t.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},$t.prototype.serialize=function(){for(var t=["format"],e=0,n=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[t,e,n,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[t,e,n,r]:[t,e,n]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ne(t){if(null===t)return Nt;if("string"==typeof t)return Ft;if("boolean"==typeof t)return jt;if("number"==typeof t)return Lt;if(t instanceof Yt)return zt;if(t instanceof Zt)return Vt;if(t instanceof $t)return qt;if(t instanceof te)return Wt;if(Array.isArray(t)){for(var e,n=t.length,r=0,i=t;r2){var s=t[1];if("string"!=typeof s||!(s in ae)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=ae[s],r++}else o=Ut;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],r++}n=Gt(o,a)}else n=ae[i];for(var u=[];r1)&&e.push(r)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var ue=function(t){this.type=qt,this.sections=t};ue.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n=t[1];if(!Array.isArray(n)&&"object"==typeof n)return e.error("First argument must be an image or text section.");for(var r=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Lt)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,Gt(Ft))))return null;var c=null;if(a["text-color"]&&!(c=e.parse(a["text-color"],1,zt)))return null;var l=r[r.length-1];l.scale=s,l.font=u,l.textColor=c}else{var h=e.parse(t[o],1,Ut);if(!h)return null;var p=h.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,r.push({content:h,scale:null,font:null,textColor:null})}}return new ue(r)},ue.prototype.evaluate=function(t){return new $t(this.sections.map((function(e){var n=e.content.evaluate(t);return ne(n)===Wt?new Jt("",n,null,null,null):new Jt(re(n),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ue.prototype.eachChild=function(t){for(var e=0,n=this.sections;e-1&&(n=!0),new te({name:e,available:n})},ce.prototype.eachChild=function(t){t(this.input)},ce.prototype.possibleOutputs=function(){return[void 0]},ce.prototype.serialize=function(){return["image",this.input.serialize()]};var le={"to-boolean":jt,"to-color":zt,"to-number":Lt,"to-string":Ft},he=function(t,e){this.type=t,this.args=e};he.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n=t[0];if(("to-boolean"===n||"to-string"===n)&&2!==t.length)return e.error("Expected one argument.");for(var r=le[n],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ee(e[0],e[1],e[2],e[3])))return new Yt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new oe(n||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s=0)return!1;var n=!0;return t.eachChild((function(t){n&&!ve(t,e)&&(n=!1)})),n}me.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var n=t[1];if("object"!=typeof n||Array.isArray(n))return e.error("Collator options argument must be an object.");var r=e.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,jt);if(!r)return null;var i=e.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,jt);if(!i)return null;var o=null;return n.locale&&!(o=e.parse(n.locale,1,Ft))?null:new me(r,i,o)},me.prototype.evaluate=function(t){return new Zt(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},me.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},me.prototype.possibleOutputs=function(){return[void 0]},me.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var _e=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};_e.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var n=t[1];return e.scope.has(n)?new _e(n,e.scope.get(n)):e.error('Unknown variable "'+n+'". Make sure "'+n+'" has been bound in an enclosing "let" expression before using it.',1)},_e.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},_e.prototype.eachChild=function(){},_e.prototype.possibleOutputs=function(){return[void 0]},_e.prototype.serialize=function(){return["var",this.name]};var be=function(t,e,n,r,i){void 0===e&&(e=[]),void 0===r&&(r=new Rt),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=r,this.errors=i,this.expectedType=n};function we(t,e){for(var n,r,i=t.length-1,o=0,a=i,s=0;o<=a;)if(n=t[s=Math.floor((o+a)/2)],r=t[s+1],n<=e){if(s===i||ee))throw new oe("Input is not a number.");a=s-1}return 0}be.prototype.parse=function(t,e,n,r,i){return void 0===i&&(i={}),e?this.concat(e,n,r)._parse(t,i):this._parse(t,i)},be.prototype._parse=function(t,e){function n(t,e,n){return"assert"===n?new se(e,[t]):"coerce"===n?new he(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[r];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=n(o,a,e.typeAnnotation||"coerce");else o=n(o,a,e.typeAnnotation||"assert")}if(!(o instanceof ie)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof _e)return t(e.boundExpression);if(e instanceof de&&"error"===e.name)return!1;if(e instanceof me)return!1;var n=e instanceof he||e instanceof se,r=!0;return e.eachChild((function(e){r=n?r&&t(e):r&&e instanceof ie})),!!r&&ye(e)&&ve(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new fe;try{o=new ie(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},be.prototype.concat=function(t,e,n){var r="number"==typeof t?this.path.concat(t):this.path,i=n?this.scope.concat(n):this.scope;return new be(this.registry,r,e||null,i,this.errors)},be.prototype.error=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Mt(r,t))},be.prototype.checkSubtype=function(t,e){var n=Qt(t,e);return n&&this.error(n),n};var xe=function(t,e,n){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var r=0,i=n;r=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var l=e.parse(s,c,i);if(!l)return null;i=i||l.type,r.push([a,l])}return new xe(i,n,r)},xe.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);var i=e.length;return r>=e[i-1]?n[i-1].evaluate(t):n[we(e,r)].evaluate(t)},xe.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Te=Object.freeze({__proto__:null,number:Ee,color:function(t,e,n){return new Yt(Ee(t.r,e.r,n),Ee(t.g,e.g,n),Ee(t.b,e.b,n),Ee(t.a,e.a,n))},array:function(t,e,n){return t.map((function(t,r){return Ee(t,e[r],n)}))}}),Se=.95047,Ce=1,Ie=1.08883,ke=4/29,Ae=6/29,Oe=3*Ae*Ae,Pe=Ae*Ae*Ae,De=Math.PI/180,Me=180/Math.PI;function Re(t){return t>Pe?Math.pow(t,1/3):t/Oe+ke}function Ne(t){return t>Ae?t*t*t:Oe*(t-ke)}function Le(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Fe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function je(t){var e=Fe(t.r),n=Fe(t.g),r=Fe(t.b),i=Re((.4124564*e+.3575761*n+.1804375*r)/Se),o=Re((.2126729*e+.7151522*n+.072175*r)/Ce);return{l:116*o-16,a:500*(i-o),b:200*(o-Re((.0193339*e+.119192*n+.9503041*r)/Ie)),alpha:t.a}}function ze(t){var e=(t.l+16)/116,n=isNaN(t.a)?e:e+t.a/500,r=isNaN(t.b)?e:e-t.b/200;return e=Ce*Ne(e),n=Se*Ne(n),r=Ie*Ne(r),new Yt(Le(3.2404542*n-1.5371385*e-.4985314*r),Le(-.969266*n+1.8760108*e+.041556*r),Le(.0556434*n-.2040259*e+1.0572252*r),t.alpha)}function Be(t,e,n){var r=e-t;return t+n*(r>180||r<-180?r-360*Math.round(r/360):r)}var Ue={forward:je,reverse:ze,interpolate:function(t,e,n){return{l:Ee(t.l,e.l,n),a:Ee(t.a,e.a,n),b:Ee(t.b,e.b,n),alpha:Ee(t.alpha,e.alpha,n)}}},Ve={forward:function(t){var e=je(t),n=e.l,r=e.a,i=e.b,o=Math.atan2(i,r)*Me;return{h:o<0?o+360:o,c:Math.sqrt(r*r+i*i),l:n,alpha:t.a}},reverse:function(t){var e=t.h*De,n=t.c;return ze({l:t.l,a:Math.cos(e)*n,b:Math.sin(e)*n,alpha:t.alpha})},interpolate:function(t,e,n){return{h:Be(t.h,e.h,n),c:Ee(t.c,e.c,n),l:Ee(t.l,e.l,n),alpha:Ee(t.alpha,e.alpha,n)}}},qe=Object.freeze({__proto__:null,lab:Ue,hcl:Ve}),We=function(t,e,n,r,i){this.type=t,this.operator=e,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Lt)))return null;var u=[],c=null;"interpolate-hcl"===n||"interpolate-lab"===n?c=zt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var l=0;l=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var m=e.parse(p,d,c);if(!m)return null;c=c||m.type,u.push([h,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new We(c,n,r,i,u):e.error("Type "+Ht(c)+" is not interpolatable.")},We.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);var i=e.length;if(r>=e[i-1])return n[i-1].evaluate(t);var o=we(e,r),a=e[o],s=e[o+1],u=We.interpolationFactor(this.interpolation,r,a,s),c=n[o].evaluate(t),l=n[o+1].evaluate(t);return"interpolate"===this.operator?Te[this.type.kind.toLowerCase()](c,l,u):"interpolate-hcl"===this.operator?Ve.reverse(Ve.interpolate(Ve.forward(c),Ve.forward(l),u)):Ue.reverse(Ue.interpolate(Ue.forward(c),Ue.forward(l),u))},We.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e=n.length)throw new oe("Array index out of bounds: "+e+" > "+(n.length-1)+".");if(e!==Math.floor(e))throw new oe("Array index must be an integer, but found "+e+" instead.");return n[e]},Qe.prototype.eachChild=function(t){t(this.index),t(this.input)},Qe.prototype.possibleOutputs=function(){return[void 0]},Qe.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Xe=function(t,e){this.type=jt,this.needle=t,this.haystack=e};Xe.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var n,r=e.parse(t[1],1,Ut),i=e.parse(t[2],2,Ut);return r&&i?"boolean"!==(n=r.type).kind&&"string"!==n.kind&&"number"!==n.kind&&"null"!==n.kind&&"value"!==n.kind?e.error("Expected first argument to be of type boolean, string, number or null, but found "+Ht(r.type)+" instead"):new Xe(r,i):null},Xe.prototype.evaluate=function(t){var e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!e||!n)return!1;if(!function(t){return"boolean"==typeof t||"string"==typeof t||"number"==typeof t}(e))throw new oe("Expected first argument to be of type boolean, string or number, but found "+Ht(ne(e))+" instead.");if(!function(t){return Array.isArray(t)||"string"==typeof t}(n))throw new oe("Expected second argument to be of type array or string, but found "+Ht(ne(n))+" instead.");return n.indexOf(e)>=0},Xe.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Xe.prototype.possibleOutputs=function(){return[!0,!1]},Xe.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Ye=function(t,e,n,r,i,o){this.inputType=t,this.type=e,this.input=n,this.cases=r,this.outputs=i,this.otherwise=o};Ye.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var n,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var i={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,ne(p)))return null}else n=ne(p);if(void 0!==i[String(p)])return c.error("Branch labels must be unique.");i[String(p)]=o.length}var f=e.parse(u,a,r);if(!f)return null;r=r||f.type,o.push(f)}var d=e.parse(t[1],1,Ut);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,r);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(n,d.type)?null:new Ye(n,r,d,i,o,m):null},Ye.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ne(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Ye.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Ye.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},Ye.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],n=[],r={},i=0,o=Object.keys(this.cases).sort();i",(function(t,e,n){return e>n}),(function(t,e,n,r){return r.compare(e,n)>0})),an=tn("<=",(function(t,e,n){return e<=n}),(function(t,e,n,r){return r.compare(e,n)<=0})),sn=tn(">=",(function(t,e,n){return e>=n}),(function(t,e,n,r){return r.compare(e,n)>=0})),un=function(t,e,n,r,i){this.type=Ft,this.number=t,this.locale=e,this.currency=n,this.minFractionDigits=r,this.maxFractionDigits=i};un.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var n=e.parse(t[1],1,Lt);if(!n)return null;var r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");var i=null;if(r.locale&&!(i=e.parse(r.locale,1,Ft)))return null;var o=null;if(r.currency&&!(o=e.parse(r.currency,1,Ft)))return null;var a=null;if(r["min-fraction-digits"]&&!(a=e.parse(r["min-fraction-digits"],1,Lt)))return null;var s=null;return r["max-fraction-digits"]&&!(s=e.parse(r["max-fraction-digits"],1,Lt))?null:new un(n,i,o,a,s)},un.prototype.evaluate=function(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))},un.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},un.prototype.possibleOutputs=function(){return[void 0]},un.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var cn=function(t){this.type=Lt,this.input=t};cn.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?e.error("Expected argument of type string or array, but found "+Ht(n.type)+" instead."):new cn(n):null},cn.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new oe("Expected value to be of type string or array, but found "+Ht(ne(e))+" instead.")},cn.prototype.eachChild=function(t){t(this.input)},cn.prototype.possibleOutputs=function(){return[void 0]},cn.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ln={"==":en,"!=":nn,">":on,"<":rn,">=":sn,"<=":an,array:se,at:Qe,boolean:se,case:Ze,coalesce:He,collator:me,format:ue,image:ce,in:Xe,interpolate:We,"interpolate-hcl":We,"interpolate-lab":We,length:cn,let:Ke,literal:ie,match:Ye,number:se,"number-format":un,object:se,step:xe,string:se,"to-boolean":he,"to-color":he,"to-number":he,"to-string":he,var:_e};function hn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3];n=n.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=ee(n,r,i,a);if(s)throw new oe(s);return new Yt(n/255*a,r/255*a,i/255*a,a)}function pn(t,e){return t in e}function fn(t,e){var n=e[t];return void 0===n?null:n}function dn(t){return{type:t}}function mn(t){return{result:"success",value:t}}function yn(t){return{result:"error",value:t}}function gn(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function vn(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function _n(t){return!!t.expression&&t.expression.interpolated}function bn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function wn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function xn(t){return t}function En(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:void 0}function Tn(t,e,n,r,i){return En(typeof n===i?r[n]:void 0,t.default,e.default)}function Sn(t,e,n){if("number"!==bn(n))return En(t.default,e.default);var r=t.stops.length;if(1===r)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[r-1][0])return t.stops[r-1][1];var i=we(t.stops.map((function(t){return t[0]})),n);return t.stops[i][1]}function Cn(t,e,n){var r=void 0!==t.base?t.base:1;if("number"!==bn(n))return En(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[i-1][0])return t.stops[i-1][1];var o=we(t.stops.map((function(t){return t[0]})),n),a=function(t,e,n,r){var i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(n,r,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],c=Te[e.type]||xn;if(t.colorSpace&&"rgb"!==t.colorSpace){var l=qe[t.colorSpace];c=function(t,e){return l.reverse(l.interpolate(l.forward(t),l.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=s.evaluate.apply(void 0,t),r=u.evaluate.apply(void 0,t);if(void 0!==n&&void 0!==r)return c(n,r,a)}}:c(s,u,a)}function In(t,e,n){return"color"===e.type?n=Yt.parse(n):"formatted"===e.type?n=$t.fromString(n.toString()):"resolvedImage"===e.type?n=te.fromString(n.toString()):bn(n)===e.type||"enum"===e.type&&e.values[n]||(n=void 0),En(n,t.default,e.default)}de.register(ln,{error:[{kind:"error"},[Ft],function(t,e){var n=e[0];throw new oe(n.evaluate(t))}],typeof:[Ft,[Ut],function(t,e){return Ht(ne(e[0].evaluate(t)))}],"to-rgba":[Gt(Lt,4),[zt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[zt,[Lt,Lt,Lt],hn],rgba:[zt,[Lt,Lt,Lt,Lt],hn],has:{type:jt,overloads:[[[Ft],function(t,e){return pn(e[0].evaluate(t),t.properties())}],[[Ft,Bt],function(t,e){var n=e[0],r=e[1];return pn(n.evaluate(t),r.evaluate(t))}]]},get:{type:Ut,overloads:[[[Ft],function(t,e){return fn(e[0].evaluate(t),t.properties())}],[[Ft,Bt],function(t,e){var n=e[0],r=e[1];return fn(n.evaluate(t),r.evaluate(t))}]]},"feature-state":[Ut,[Ft],function(t,e){return fn(e[0].evaluate(t),t.featureState||{})}],properties:[Bt,[],function(t){return t.properties()}],"geometry-type":[Ft,[],function(t){return t.geometryType()}],id:[Ut,[],function(t){return t.id()}],zoom:[Lt,[],function(t){return t.globals.zoom}],"heatmap-density":[Lt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Lt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Ut,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Lt,dn(Lt),function(t,e){for(var n=0,r=0,i=e;r":[jt,[Ft,Ut],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i>o}],"filter-id->":[jt,[Ut],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r>i}],"filter-<=":[jt,[Ft,Ut],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[jt,[Ut],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r<=i}],"filter->=":[jt,[Ft,Ut],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[jt,[Ut],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r>=i}],"filter-has":[jt,[Ut],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[jt,[],function(t){return null!==t.id()}],"filter-type-in":[jt,[Gt(Ft)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[jt,[Gt(Ut)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[jt,[Ft,Gt(Ut)],function(t,e){var n=e[0];return e[1].value.indexOf(t.properties()[n.value])>=0}],"filter-in-large":[jt,[Ft,Gt(Ut)],function(t,e){var n=e[0],r=e[1];return function(t,e,n,r){for(;n<=r;){var i=n+r>>1;if(e[i]===t)return!0;e[i]>t?r=i-1:n=i+1}return!1}(t.properties()[n.value],r.value,0,r.value.length-1)}],all:{type:jt,overloads:[[[jt,jt],function(t,e){var n=e[0],r=e[1];return n.evaluate(t)&&r.evaluate(t)}],[dn(jt),function(t,e){for(var n=0,r=e;n0&&"string"==typeof t[0]&&t[0]in ln}function On(t,e){var n=new be(ln,[],e?function(t){var e={color:zt,string:Ft,number:Lt,enum:Ft,boolean:jt,formatted:qt,resolvedImage:Wt};return"array"===t.type?Gt(e[t.value]||Ut,t.length):e[t.type]}(e):void 0),r=n.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?mn(new kn(r,e)):yn(n.errors)}kn.prototype.evaluateWithoutErrorHandling=function(t,e,n,r,i){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=i,this.expression.evaluate(this._evaluator)},kn.prototype.evaluate=function(t,e,n,r,i){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=n||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=i||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new oe("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Pn=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!ge(e.expression)};Pn.prototype.evaluateWithoutErrorHandling=function(t,e,n,r,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,r,i)},Pn.prototype.evaluate=function(t,e,n,r,i){return this._styleExpression.evaluate(t,e,n,r,i)};var Dn=function(t,e,n,r){this.kind=t,this.zoomStops=n,this._styleExpression=e,this.isStateDependent="camera"!==t&&!ge(e.expression),this.interpolationType=r};function Mn(t,e){if("error"===(t=On(t,e)).result)return t;var n=t.value.expression,r=ye(n);if(!r&&!gn(e))return yn([new Mt("","data expressions not supported")]);var i=ve(n,["zoom"]);if(!i&&!vn(e))return yn([new Mt("","zoom expressions not supported")]);var o=function t(e){var n=null;if(e instanceof Ke)n=t(e.result);else if(e instanceof He)for(var r=0,i=e.args;rr.maximum?[new kt(e,n,n+" is greater than the maximum value "+r.maximum)]:[]}function jn(t){var e,n,r,i=t.valueSpec,o=Pt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,c="array"===bn(t.value.stops)&&"array"===bn(t.value.stops[0])&&"object"===bn(t.value.stops[0][0]),l=Nn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new kt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],n=t.value;return e=e.concat(Ln({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===bn(n)&&0===n.length&&e.push(new kt(t.key,n,"array must have at least one stop")),e},default:function(t){return or({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&l.push(new kt(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||l.push(new kt(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!_n(t.valueSpec)&&l.push(new kt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!gn(t.valueSpec)?l.push(new kt(t.key,t.value,"property functions not supported")):s&&!vn(t.valueSpec)&&l.push(new kt(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==t.value.property||l.push(new kt(t.key,t.value,'"property" property is required')),l;function h(t){var e=[],o=t.value,s=t.key;if("array"!==bn(o))return[new kt(s,o,"array expected, "+bn(o)+" found")];if(2!==o.length)return[new kt(s,o,"array length 2 expected, length "+o.length+" found")];if(c){if("object"!==bn(o[0]))return[new kt(s,o,"object expected, "+bn(o[0])+" found")];if(void 0===o[0].zoom)return[new kt(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new kt(s,o,"object stop key must have value")];if(r&&r>Pt(o[0].zoom))return[new kt(s,o[0].zoom,"stop zoom values must appear in ascending order")];Pt(o[0].zoom)!==r&&(r=Pt(o[0].zoom),n=void 0,a={}),e=e.concat(Nn({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Fn,value:p}}))}else e=e.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return An(Dt(o[1]))?e.concat([new kt(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(or({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function p(t,r){var s=bn(t.value),u=Pt(t.value),c=null!==t.value?t.value:r;if(e){if(s!==e)return[new kt(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new kt(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var l="number expected, "+s+" found";return gn(i)&&void 0===o&&(l+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new kt(t.key,c,l)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==n&&u=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&Array.isArray(t[2]);case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,n=t.slice(1);ee?1:0}function Gn(t){if(!t)return!0;var e,n=t[0];return t.length<=1?"any"!==n:"=="===n?Hn(t[1],t[2],"=="):"!="===n?Xn(Hn(t[1],t[2],"==")):"<"===n||">"===n||"<="===n||">="===n?Hn(t[1],t[2],n):"any"===n?(e=t.slice(1),["any"].concat(e.map(Gn))):"all"===n?["all"].concat(t.slice(1).map(Gn)):"none"===n?["all"].concat(t.slice(1).map(Gn).map(Xn)):"in"===n?Kn(t[1],t.slice(2)):"!in"===n?Xn(Kn(t[1],t.slice(2))):"has"===n?Qn(t[1]):"!has"!==n||Xn(Qn(t[1]))}function Hn(t,e,n){switch(t){case"$type":return["filter-type-"+n,e];case"$id":return["filter-id-"+n,e];default:return["filter-"+n,t,e]}}function Kn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(Wn)]]:["filter-in-small",t,["literal",e]]}}function Qn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Xn(t){return["!",t]}function Yn(t){return Un(Dt(t.value))?zn(Ot({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var n=e.value,r=e.key;if("array"!==bn(n))return[new kt(r,n,"array expected, "+bn(n)+" found")];var i,o=e.styleSpec,a=[];if(n.length<1)return[new kt(r,n,"filter array must have at least 1 element")];switch(a=a.concat(Bn({key:r+"[0]",value:n[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Pt(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===Pt(n[1])&&a.push(new kt(r,n,'"$type" cannot be use with operator "'+n[0]+'"'));case"==":case"!=":3!==n.length&&a.push(new kt(r,n,'filter array for operator "'+n[0]+'" must have 3 elements'));case"in":case"!in":n.length>=2&&"string"!==(i=bn(n[1]))&&a.push(new kt(r+"[1]",n[1],"string expected, "+i+" found"));for(var s=2;s=l[f+0]&&r>=l[f+1])?(a[p]=!0,o.push(c[p])):a[p]=!1}}},gr.prototype._forEachCell=function(t,e,n,r,i,o,a,s){for(var u=this._convertToCellCoord(t),c=this._convertToCellCoord(e),l=this._convertToCellCoord(n),h=this._convertToCellCoord(r),p=u;p<=l;p++)for(var f=c;f<=h;f++){var d=this.d*f+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(f),this._convertFromCellCoord(p+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,n,r,d,o,a,s))return}},gr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},gr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},gr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=yr+this.cells.length+1+1,n=0,r=0;r=0)){var h=t[l];c[l]=_r[u].shallow.indexOf(l)>=0?h:Er(h,e)}t instanceof Error&&(c.message=t.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==u&&(c.$name=u),c}throw new Error("can't serialize object of type "+typeof t)}function Tr(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||xr(t)||ArrayBuffer.isView(t)||t instanceof vr)return t;if(Array.isArray(t))return t.map(Tr);if("object"==typeof t){var e=t.$name||"Object",n=_r[e].klass;if(!n)throw new Error("can't deserialize unregistered class "+e);if(n.deserialize)return n.deserialize(t);for(var r=Object.create(n.prototype),i=0,o=Object.keys(t);i=0?s:Tr(s)}}return r}throw new Error("can't deserialize object of type "+typeof t)}var Sr=function(){this.first=!0};Sr.prototype.update=function(t,e){var n=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Ir(t){for(var e=0,n=t;e=65097&&t<=65103)||!!Cr["CJK Compatibility Ideographs"](t)||!!Cr["CJK Compatibility"](t)||!!Cr["CJK Radicals Supplement"](t)||!!Cr["CJK Strokes"](t)||!(!Cr["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||!!Cr["CJK Unified Ideographs Extension A"](t)||!!Cr["CJK Unified Ideographs"](t)||!!Cr["Enclosed CJK Letters and Months"](t)||!!Cr["Hangul Compatibility Jamo"](t)||!!Cr["Hangul Jamo Extended-A"](t)||!!Cr["Hangul Jamo Extended-B"](t)||!!Cr["Hangul Jamo"](t)||!!Cr["Hangul Syllables"](t)||!!Cr.Hiragana(t)||!!Cr["Ideographic Description Characters"](t)||!!Cr.Kanbun(t)||!!Cr["Kangxi Radicals"](t)||!!Cr["Katakana Phonetic Extensions"](t)||!(!Cr.Katakana(t)||12540===t)||!(!Cr["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Cr["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||!!Cr["Unified Canadian Aboriginal Syllabics"](t)||!!Cr["Unified Canadian Aboriginal Syllabics Extended"](t)||!!Cr["Vertical Forms"](t)||!!Cr["Yijing Hexagram Symbols"](t)||!!Cr["Yi Syllables"](t)||!!Cr["Yi Radicals"](t))}function Or(t){return!(Ar(t)||function(t){return!(!Cr["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||!(!Cr["General Punctuation"](t)||8214!==t&&8224!==t&&8225!==t&&8240!==t&&8241!==t&&8251!==t&&8252!==t&&8258!==t&&8263!==t&&8264!==t&&8265!==t&&8273!==t)||!!Cr["Letterlike Symbols"](t)||!!Cr["Number Forms"](t)||!(!Cr["Miscellaneous Technical"](t)||!(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215))||!(!Cr["Control Pictures"](t)||9251===t)||!!Cr["Optical Character Recognition"](t)||!!Cr["Enclosed Alphanumerics"](t)||!!Cr["Geometric Shapes"](t)||!(!Cr["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||!(!Cr["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||!!Cr["CJK Symbols and Punctuation"](t)||!!Cr.Katakana(t)||!!Cr["Private Use Area"](t)||!!Cr["CJK Compatibility Forms"](t)||!!Cr["Small Form Variants"](t)||!!Cr["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t}(t))}function Pr(t){return t>=1424&&t<=2303||Cr["Arabic Presentation Forms-A"](t)||Cr["Arabic Presentation Forms-B"](t)}function Dr(t,e){return!(!e&&Pr(t))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||Cr.Khmer(t))}function Mr(t){for(var e=0,n=t;ethis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*e}};var Kr=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(wn(t))return new Rn(t,e);if(An(t)){var n=Mn(t,e);if("error"===n.result)throw new Error(n.value.map((function(t){return t.key+": "+t.message})).join(", "));return n.value}var r=t;return"string"==typeof t&&"color"===e.type&&(r=Yt.parse(t)),{kind:"constant",evaluate:function(){return r}}}(void 0===e?t.specification.default:e,t.specification)};Kr.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Kr.prototype.possiblyEvaluate=function(t,e){return this.property.possiblyEvaluate(this,t,e)};var Qr=function(t){this.property=t,this.value=new Kr(t,void 0)};Qr.prototype.transitioned=function(t,e){return new Yr(this.property,this.value,e,h({},t.transition,this.transition),t.now)},Qr.prototype.untransitioned=function(){return new Yr(this.property,this.value,null,{},0)};var Xr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Xr.prototype.getValue=function(t){return b(this._values[t].value.value)},Xr.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Qr(this._values[t].property)),this._values[t].value=new Kr(this._values[t].property,null===e?void 0:b(e))},Xr.prototype.getTransition=function(t){return b(this._values[t].transition)},Xr.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Qr(this._values[t].property)),this._values[t].transition=b(e)||void 0},Xr.prototype.serialize=function(){for(var t={},e=0,n=Object.keys(this._values);ethis.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(n=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}(o))}return r};var Zr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Zr.prototype.possiblyEvaluate=function(t,e){for(var n=new ti(this._properties),r=0,i=Object.keys(this._values);rr.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},e.prototype.interpolate=function(t){return t},e}(ni),ii=function(t){this.specification=t};ii.prototype.possiblyEvaluate=function(t,e,n){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e,null,{},n);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new Hr(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Hr(Math.floor(e.zoom),e)),t.expression.evaluate(new Hr(Math.floor(e.zoom+1),e)),e)}},ii.prototype._calculate=function(t,e,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},ii.prototype.interpolate=function(t){return t};var oi=function(t){this.specification=t};oi.prototype.possiblyEvaluate=function(t,e,n){return!!t.expression.evaluate(e,null,{},n)},oi.prototype.interpolate=function(){return!1};var ai=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var n=t[e];n.specification.overridable&&this.overridableProperties.push(e);var r=this.defaultPropertyValues[e]=new Kr(n,void 0),i=this.defaultTransitionablePropertyValues[e]=new Qr(n);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}};br("DataDrivenProperty",ni),br("DataConstantProperty",ei),br("CrossFadedDataDrivenProperty",ri),br("CrossFadedProperty",ii),br("ColorRampProperty",oi);var si=function(t){function e(e,n){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter=function(){return!0},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),n.layout&&(this._unevaluatedLayout=new Jr(n.layout)),n.paint)){for(var r in this._transitionablePaint=new Xr(n.paint),e.paint)this.setPaintProperty(r,e.paint[r],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,n){if(void 0===n&&(n={}),null!=e){var r="layers."+this.id+".layout."+t;if(this._validate(fr,r,t,e,n))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return g(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,n){if(void 0===n&&(n={}),null!=e){var r="layers."+this.id+".paint."+t;if(this._validate(pr,r,t,e,n))return!1}if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],o="cross-faded-data-driven"===i.property.specification["property-type"],a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var u=this._transitionablePaint._values[t].value;return u.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(t,s,u)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,n){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,e)},e.prototype.serialize=function(){var 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),_(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,n,r,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&dr(this,t.call(lr,{key:e,layerType:this.type,objectKey:n,value:r,styleSpec:It,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof $r&&gn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Ct),ui={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ci=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},li=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function hi(t,e){void 0===e&&(e=1);var n=0,r=0;return{members:t.map((function(t){var i,o=(i=t.type,ui[i].BYTES_PER_ELEMENT),a=n=pi(n,Math.max(e,o)),s=t.components||1;return r=Math.max(r,o),n+=o*s,{name:t.name,type:t.type,components:s,offset:a}})),size:pi(n,Math.max(r,e)),alignment:e}}function pi(t,e){return Math.ceil(t/e)*e}li.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},li.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},li.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},li.prototype.clear=function(){this.length=0},li.prototype.resize=function(t){this.reserve(t),this.length=t},li.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},li.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var r=2*t;return this.int16[r+0]=e,this.int16[r+1]=n,t},e}(li);fi.prototype.bytesPerElement=4,br("StructArrayLayout2i4",fi);var di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)},e.prototype.emplace=function(t,e,n,r,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=n,this.int16[o+2]=r,this.int16[o+3]=i,t},e}(li);di.prototype.bytesPerElement=8,br("StructArrayLayout4i8",di);var mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)},e.prototype.emplace=function(t,e,n,r,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(li);mi.prototype.bytesPerElement=12,br("StructArrayLayout2i4i12",mi);var yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)},e.prototype.emplace=function(t,e,n,r,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.uint8[u+4]=r,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(li);yi.prototype.bytesPerElement=8,br("StructArrayLayout2i4ub8",yi);var gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,n,r,i,o,a,s)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u){var c=8*t;return this.uint16[c+0]=e,this.uint16[c+1]=n,this.uint16[c+2]=r,this.uint16[c+3]=i,this.uint16[c+4]=o,this.uint16[c+5]=a,this.uint16[c+6]=s,this.uint16[c+7]=u,t},e}(li);gi.prototype.bytesPerElement=16,br("StructArrayLayout8ui16",gi);var vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s,u,c,l,h){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,n,r,i,o,a,s,u,c,l,h)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,c,l,h,p){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=n,this.int16[f+2]=r,this.int16[f+3]=i,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=c,this.int16[f+9]=l,this.int16[f+10]=h,this.int16[f+11]=p,t},e}(li);vi.prototype.bytesPerElement=24,br("StructArrayLayout4i4ui4i24",vi);var _i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=n,this.float32[i+2]=r,t},e}(li);_i.prototype.bytesPerElement=12,br("StructArrayLayout3f12",_i);var bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var n=1*t;return this.uint32[n+0]=e,t},e}(li);bi.prototype.bytesPerElement=4,br("StructArrayLayout1ul4",bi);var wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s,u,c,l){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,n,r,i,o,a,s,u,c,l)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,c,l,h){var p=12*t,f=6*t;return this.int16[p+0]=e,this.int16[p+1]=n,this.int16[p+2]=r,this.int16[p+3]=i,this.int16[p+4]=o,this.int16[p+5]=a,this.uint32[f+3]=s,this.uint16[p+8]=u,this.uint16[p+9]=c,this.int16[p+10]=l,this.int16[p+11]=h,t},e}(li);wi.prototype.bytesPerElement=24,br("StructArrayLayout6i1ul2ui2i24",wi);var xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)},e.prototype.emplace=function(t,e,n,r,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(li);xi.prototype.bytesPerElement=12,br("StructArrayLayout2i2i2i12",xi);var Ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)},e.prototype.emplace=function(t,e,n,r,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=n,this.float32[a+1]=r,this.float32[a+2]=i,t},e}(li);Ei.prototype.bytesPerElement=12,br("StructArrayLayout2ub2f12",Ei);var Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){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)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s,u,c,l,h,p,f,d,m,y){var g=this.length;return this.resize(g+1),this.emplace(g,t,e,n,r,i,o,a,s,u,c,l,h,p,f,d,m,y)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,c,l,h,p,f,d,m,y,g){var v=24*t,_=12*t,b=48*t;return this.int16[v+0]=e,this.int16[v+1]=n,this.uint16[v+2]=r,this.uint16[v+3]=i,this.uint32[_+2]=o,this.uint32[_+3]=a,this.uint32[_+4]=s,this.uint16[v+10]=u,this.uint16[v+11]=c,this.uint16[v+12]=l,this.float32[_+7]=h,this.float32[_+8]=p,this.uint8[b+36]=f,this.uint8[b+37]=d,this.uint8[b+38]=m,this.uint32[_+10]=y,this.int16[v+22]=g,t},e}(li);Ti.prototype.bytesPerElement=48,br("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ti);var Si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){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)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s,u,c,l,h,p,f,d,m,y,g,v,_,b,w,x,E,T,S){var C=this.length;return this.resize(C+1),this.emplace(C,t,e,n,r,i,o,a,s,u,c,l,h,p,f,d,m,y,g,v,_,b,w,x,E,T,S)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,c,l,h,p,f,d,m,y,g,v,_,b,w,x,E,T,S,C){var I=30*t,k=15*t;return this.int16[I+0]=e,this.int16[I+1]=n,this.int16[I+2]=r,this.int16[I+3]=i,this.int16[I+4]=o,this.int16[I+5]=a,this.int16[I+6]=s,this.int16[I+7]=u,this.uint16[I+8]=c,this.uint16[I+9]=l,this.uint16[I+10]=h,this.uint16[I+11]=p,this.uint16[I+12]=f,this.uint16[I+13]=d,this.uint16[I+14]=m,this.uint16[I+15]=y,this.uint16[I+16]=g,this.uint16[I+17]=v,this.uint16[I+18]=_,this.uint16[I+19]=b,this.uint16[I+20]=w,this.uint16[I+21]=x,this.uint32[k+11]=E,this.float32[k+12]=T,this.float32[k+13]=S,this.float32[k+14]=C,t},e}(li);Si.prototype.bytesPerElement=60,br("StructArrayLayout8i14ui1ul3f60",Si);var Ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var n=1*t;return this.float32[n+0]=e,t},e}(li);Ci.prototype.bytesPerElement=4,br("StructArrayLayout1f4",Ci);var Ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=n,this.int16[i+2]=r,t},e}(li);Ii.prototype.bytesPerElement=6,br("StructArrayLayout3i6",Ii);var ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=2*t,o=4*t;return this.uint32[i+0]=e,this.uint16[o+2]=n,this.uint16[o+3]=r,t},e}(li);ki.prototype.bytesPerElement=8,br("StructArrayLayout1ul2ui8",ki);var Ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=n,this.uint16[i+2]=r,t},e}(li);Ai.prototype.bytesPerElement=6,br("StructArrayLayout3ui6",Ai);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var r=2*t;return this.uint16[r+0]=e,this.uint16[r+1]=n,t},e}(li);Oi.prototype.bytesPerElement=4,br("StructArrayLayout2ui4",Oi);var Pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var n=1*t;return this.uint16[n+0]=e,t},e}(li);Pi.prototype.bytesPerElement=2,br("StructArrayLayout1ui2",Pi);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var r=2*t;return this.float32[r+0]=e,this.float32[r+1]=n,t},e}(li);Di.prototype.bytesPerElement=8,br("StructArrayLayout2f8",Di);var Mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)},e.prototype.emplace=function(t,e,n,r,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=n,this.float32[o+2]=r,this.float32[o+3]=i,t},e}(li);Mi.prototype.bytesPerElement=16,br("StructArrayLayout4f16",Mi);var Ri=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},n.radius.get=function(){return this._structArray.int16[this._pos2+10]},n.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},n.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},n.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},n.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(ci);Ri.prototype.size=24;var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Ri(this,t)},e}(wi);br("CollisionBoxArray",Ni);var Li=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},n.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},n.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},n.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},n.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},n.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},n.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},n.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},n.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},n.segment.get=function(){return this._structArray.uint16[this._pos2+10]},n.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},n.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},n.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},n.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},n.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},n.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},n.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},n.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},n.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},n.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},n.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},n.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},n.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},n.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},n.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},n.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},n.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},n.associatedIconIndex.set=function(t){this._structArray.int16[this._pos2+22]=t},Object.defineProperties(e.prototype,n),e}(ci);Li.prototype.size=48;var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Li(this,t)},e}(Ti);br("PlacedSymbolArray",Fi);var ji=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},n.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},n.rightJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t},n.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},n.centerJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t},n.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},n.leftJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+4]=t},n.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},n.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+5]=t},n.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},n.placedIconSymbolIndex.set=function(t){this._structArray.int16[this._pos2+6]=t},n.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},n.verticalPlacedIconSymbolIndex.set=function(t){this._structArray.int16[this._pos2+7]=t},n.key.get=function(){return this._structArray.uint16[this._pos2+8]},n.key.set=function(t){this._structArray.uint16[this._pos2+8]=t},n.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},n.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},n.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+10]=t},n.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},n.verticalTextBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+11]=t},n.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},n.verticalTextBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+12]=t},n.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},n.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+13]=t},n.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},n.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+14]=t},n.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},n.verticalIconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+15]=t},n.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},n.verticalIconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+16]=t},n.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},n.featureIndex.set=function(t){this._structArray.uint16[this._pos2+17]=t},n.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},n.numHorizontalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+18]=t},n.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},n.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+19]=t},n.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},n.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+20]=t},n.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},n.numVerticalIconVertices.set=function(t){this._structArray.uint16[this._pos2+21]=t},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+11]},n.crossTileID.set=function(t){this._structArray.uint32[this._pos4+11]=t},n.textBoxScale.get=function(){return this._structArray.float32[this._pos4+12]},n.textBoxScale.set=function(t){this._structArray.float32[this._pos4+12]=t},n.textOffset0.get=function(){return this._structArray.float32[this._pos4+13]},n.textOffset0.set=function(t){this._structArray.float32[this._pos4+13]=t},n.textOffset1.get=function(){return this._structArray.float32[this._pos4+14]},n.textOffset1.set=function(t){this._structArray.float32[this._pos4+14]=t},Object.defineProperties(e.prototype,n),e}(ci);ji.prototype.size=60;var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ji(this,t)},e}(Si);br("SymbolInstanceArray",zi);var Bi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={offsetX:{configurable:!0}};return n.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},n.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,n),e}(ci);Bi.prototype.size=4;var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new Bi(this,t)},e}(Ci);br("GlyphOffsetArray",Ui);var Vi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return n.x.get=function(){return this._structArray.int16[this._pos2+0]},n.x.set=function(t){this._structArray.int16[this._pos2+0]=t},n.y.get=function(){return this._structArray.int16[this._pos2+1]},n.y.set=function(t){this._structArray.int16[this._pos2+1]=t},n.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},n.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,n),e}(ci);Vi.prototype.size=6;var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e.prototype.get=function(t){return new Vi(this,t)},e}(Ii);br("SymbolLineVertexArray",qi);var Wi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},n.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},n.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,n),e}(ci);Wi.prototype.size=8;var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Wi(this,t)},e}(ki);br("FeatureIndexArray",Gi);var Hi=hi([{name:"a_pos",components:2,type:"Int16"}],4).members,Ki=function(t){void 0===t&&(t=[]),this.segments=t};function Qi(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}Ki.prototype.prepareSegment=function(t,e,n,r){var i=this.segments[this.segments.length-1];return t>Ki.MAX_VERTEX_ARRAY_LENGTH&&x("Max vertices per segment is "+Ki.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Ki.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==r)&&(i={vertexOffset:e.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},void 0!==r&&(i.sortKey=r),this.segments.push(i)),i},Ki.prototype.get=function(){return this.segments},Ki.prototype.destroy=function(){for(var t=0,e=this.segments;t>1;this.ids[r]>=t?n=r:e=r+1}for(var i=[];this.ids[e]===t;){var o=this.positions[3*e],a=this.positions[3*e+1],s=this.positions[3*e+2];i.push({index:o,start:a,end:s}),e++}return i},Xi.serialize=function(t,e){var n=new Float64Array(t.ids),r=new Uint32Array(t.positions);return function t(e,n,r,i){if(!(r>=i)){for(var o=e[r+i>>1],a=r-1,s=i+1;;){do{a++}while(e[a]o);if(a>=s)break;Yi(e,a,s),Yi(n,3*a,3*s),Yi(n,3*a+1,3*s+1),Yi(n,3*a+2,3*s+2)}t(e,n,r,s),t(e,n,s+1,i)}}(n,r,0,n.length-1),e&&e.push(n.buffer,r.buffer),{ids:n,positions:r}},Xi.deserialize=function(t){var e=new Xi;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},br("FeaturePositionMap",Xi);var Zi=function(t,e){this.gl=t.gl,this.location=e},Ji=function(t){function e(e,n){t.call(this,e,n),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(Zi),$i=function(t){function e(e,n){t.call(this,e,n),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Zi),to=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(Zi),eo=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(Zi),no=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(Zi),ro=function(t){function e(e,n){t.call(this,e,n),this.current=Yt.transparent}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(Zi),io=new Float32Array(16),oo=function(t){function e(e,n){t.call(this,e,n),this.current=io}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(Zi);function ao(t){return[Qi(255*t.r,255*t.g),Qi(255*t.b,255*t.a)]}var so=function(t,e,n){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=n,this.maxValue=-1/0};so.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},so.prototype.setConstantPatternPositions=function(){},so.prototype.populatePaintArray=function(){},so.prototype.updatePaintArray=function(){},so.prototype.upload=function(){},so.prototype.destroy=function(){},so.prototype.setUniforms=function(t,e,n,r){e.set(r.constantOr(this.value))},so.prototype.getBinding=function(t,e){return"color"===this.type?new ro(t,e):new $i(t,e)},so.serialize=function(t){var e=t.value,n=t.names,r=t.type;return{value:Er(e),names:n,type:r}},so.deserialize=function(t){var e=t.value,n=t.names,r=t.type;return new so(Tr(e),n,r)};var uo=function(t,e,n){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=n,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};uo.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},uo.prototype.populatePaintArray=function(){},uo.prototype.updatePaintArray=function(){},uo.prototype.upload=function(){},uo.prototype.destroy=function(){},uo.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr},uo.prototype.setUniforms=function(t,e,n,r,i){var o=this.patternPositions;"u_pattern_to"===i&&o.patternTo&&e.set(o.patternTo),"u_pattern_from"===i&&o.patternFrom&&e.set(o.patternFrom)},uo.prototype.getBinding=function(t,e){return new no(t,e)};var co=function(t,e,n,r){this.expression=t,this.names=e,this.type=n,this.uniformNames=this.names.map((function(t){return"a_"+t})),this.maxValue=-1/0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===n?2:1,offset:0}})),this.paintVertexArray=new r};co.prototype.defines=function(){return[]},co.prototype.setConstantPatternPositions=function(){},co.prototype.populatePaintArray=function(t,e,n,r){var i=this.paintVertexArray,o=i.length;i.reserve(t);var a=this.expression.evaluate(new Hr(0),e,{},[],r);if("color"===this.type)for(var s=ao(a),u=o;uvo.max||a.yvo.max)&&(x("Geometry exceeds allowed extent, reduce your vector tile buffer size"),a.x=c(a.x,vo.min,vo.max),a.y=c(a.y,vo.min,vo.max))}return n}function bo(t,e,n,r,i){t.emplaceBack(2*e+(r+1)/2,2*n+(i+1)/2)}var wo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new fi,this.indexArray=new Ai,this.segments=new Ki,this.programConfigurations=new fo(Hi,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function xo(t,e){for(var n=0;n1){if(Co(t,e))return!0;for(var r=0;r1?t.distSqr(n):t.distSqr(n.sub(e)._mult(i)._add(e))}function Oo(t,e){for(var n,r,i,o=!1,a=0;ae.y!=i.y>e.y&&e.x<(i.x-r.x)*(e.y-r.y)/(i.y-r.y)+r.x&&(o=!o);return o}function Po(t,e){for(var n=!1,r=0,i=t.length-1;re.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(n=!n)}return n}function Do(t,e,n){var r=n[0],i=n[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var o=E(t,e,n[0]);return o!==E(t,e,n[1])||o!==E(t,e,n[2])||o!==E(t,e,n[3])}function Mo(t,e,n){var r=e.paint.get(t).value;return"constant"===r.kind?r.value:n.programConfigurations.get(e.id).binders[t].maxValue}function Ro(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function No(t,e,n,r,o){if(!e[0]&&!e[1])return t;var a=i.convert(e)._mult(o);"viewport"===n&&a._rotate(-r);for(var s=[],u=0;u=go||c<0||c>=go)){var l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=l.vertexLength;bo(this.layoutVertexArray,u,c,-1,-1),bo(this.layoutVertexArray,u,c,1,-1),bo(this.layoutVertexArray,u,c,1,1),bo(this.layoutVertexArray,u,c,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),l.vertexLength+=4,l.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,{})},br("CircleBucket",wo,{omit:["layers"]});var Lo,Fo=new ai({"circle-sort-key":new ni(It.layout_circle["circle-sort-key"])}),jo={paint:new ai({"circle-radius":new ni(It.paint_circle["circle-radius"]),"circle-color":new ni(It.paint_circle["circle-color"]),"circle-blur":new ni(It.paint_circle["circle-blur"]),"circle-opacity":new ni(It.paint_circle["circle-opacity"]),"circle-translate":new ei(It.paint_circle["circle-translate"]),"circle-translate-anchor":new ei(It.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ei(It.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ei(It.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ni(It.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ni(It.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ni(It.paint_circle["circle-stroke-opacity"])}),layout:Fo},zo="undefined"!=typeof Float32Array?Float32Array:Array;function Bo(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,n=arguments.length;n--;)e+=t[n]*t[n];return Math.sqrt(e)}),Lo=new zo(3),zo!=Float32Array&&(Lo[0]=0,Lo[1]=0,Lo[2]=0),function(){var t=new zo(4);zo!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var Uo=function(t){function e(e){t.call(this,e,jo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new wo(t)},e.prototype.queryRadius=function(t){var e=t;return Mo("circle-radius",this,e)+Mo("circle-stroke-width",this,e)+Ro(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,i,o,a,s){for(var u=No(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),c=this.paint.get("circle-radius").evaluate(e,n)+this.paint.get("circle-stroke-width").evaluate(e,n),l="map"===this.paint.get("circle-pitch-alignment"),h=l?u:function(t,e){return t.map((function(t){return Vo(t,e)}))}(u,s),p=l?c*a:c,f=0,d=r;ft.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u80*n){r=o=t[0],i=a=t[1];for(var d=n;do&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-r,a-i))?1/c:0}return aa(p,f,n,r,i,c),f}function ia(t,e,n,r,i){var o,a;if(i===ka(t,e,n,r)>0)for(o=e;o=e;o-=r)a=Sa(o,t[o],t[o+1],a);return a&&_a(a,a.next)&&(Ca(a),a=a.next),a}function oa(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!_a(r,r.next)&&0!==va(r.prev,r,r.next))r=r.next;else{if(Ca(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function aa(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=da(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,u,c=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}(t,r,i,o);for(var s,u,c=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?ua(t,r,i,o):sa(t))e.push(s.i/n),e.push(t.i/n),e.push(u.i/n),Ca(t),t=u.next,c=u.next;else if((t=u)===c){a?1===a?aa(t=ca(oa(t),e,n),e,n,r,i,o,2):2===a&&la(t,e,n,r,i,o):aa(oa(t),e,n,r,i,o,1);break}}}function sa(t){var e=t.prev,n=t,r=t.next;if(va(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(ya(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&va(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ua(t,e,n,r){var i=t.prev,o=t,a=t.next;if(va(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=da(s,u,e,n,r),p=da(c,l,e,n,r),f=t.prevZ,d=t.nextZ;f&&f.z>=h&&d&&d.z<=p;){if(f!==t.prev&&f!==t.next&&ya(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&va(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,d!==t.prev&&d!==t.next&&ya(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&va(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&ya(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&va(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=p;){if(d!==t.prev&&d!==t.next&&ya(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&va(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function ca(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!_a(i,o)&&ba(i,r,r.next,o)&&Ea(i,o)&&Ea(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Ca(r),Ca(r.next),r=t=o),r=r.next}while(r!==t);return oa(r)}function la(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ga(a,s)){var u=Ta(a,s);return a=oa(a,a.next),u=oa(u,u.next),aa(a,e,n,r,i,o),void aa(u,e,n,r,i,o)}s=s.next}a=a.next}while(a!==t)}function ha(t,e){return t.x-e.x}function pa(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=l&&i!==r.x&&ya(on.x||r.x===n.x&&fa(n,r)))&&(n=r,p=u)),r=r.next}while(r!==c);return n}(t,e)){var n=Ta(e,t);oa(n,n.next)}}function fa(t,e){return va(t.prev,t,e.prev)<0&&va(e.next,t,t.next)<0}function da(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ma(t){var e=t,n=t;do{(e.x=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function ga(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&ba(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Ea(t,e)&&Ea(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(va(t.prev,t,e.prev)||va(t,e.prev,e))||_a(t,e)&&va(t.prev,t,t.next)>0&&va(e.prev,e,e.next)>0)}function va(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function _a(t,e){return t.x===e.x&&t.y===e.y}function ba(t,e,n,r){var i=xa(va(t,e,n)),o=xa(va(t,e,r)),a=xa(va(n,r,t)),s=xa(va(n,r,e));return i!==o&&a!==s||!(0!==i||!wa(t,n,e))||!(0!==o||!wa(t,r,e))||!(0!==a||!wa(n,t,r))||!(0!==s||!wa(n,e,r))}function wa(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function xa(t){return t>0?1:t<0?-1:0}function Ea(t,e){return va(t.prev,t,t.next)<0?va(t,e,t.next)>=0&&va(t,t.prev,e)>=0:va(t,e,t.prev)<0||va(t,t.next,e)<0}function Ta(t,e){var n=new Ia(t.i,t.x,t.y),r=new Ia(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Sa(t,e,n,r){var i=new Ia(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ca(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ia(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ka(t,e,n,r){for(var i=0,o=e,a=n-r;or;){if(i-r>600){var a=i-r+1,s=n-r+1,u=Math.log(a),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(a-c)/a)*(s-a/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-s*c/a+l)),Math.min(i,Math.floor(n+(a-s)*c/a+l)),o)}var h=e[n],p=r,f=i;for(Oa(e,r,n),o(e[i],h)>0&&Oa(e,r,i);p0;)f--}0===o(e[r],h)?Oa(e,r,f):Oa(e,++f,i),f<=n&&(r=f+1),n<=f&&(i=f-1)}}(t,e,n||0,r||t.length-1,i||Pa)}function Oa(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Pa(t,e){return te?1:0}function Da(t,e){var n=t.length;if(n<=1)return[t];for(var r,i,o=[],a=0;a1)for(var u=0;u0&&(r+=t[i-1].length,n.holes.push(r))}return n},ea.default=na;var La=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new fi,this.indexArray=new Ai,this.indexArray2=new Oi,this.programConfigurations=new fo(ta,t.layers,t.zoom),this.segments=new Ki,this.segments2=new Ki,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};La.prototype.populate=function(t,e){this.hasPattern=Ra("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),r=[],i=0,o=t;i>3}if(o--,1===r||2===r)a+=t.readSVarint(),s+=t.readSVarint(),1===r&&(e&&u.push(e),e=[]),e.push(new i(a,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&u.push(e),u},Va.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;t.pos>3}if(r--,1===n||2===n)(i+=t.readSVarint())s&&(s=i),(o+=t.readSVarint())c&&(c=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,u,s,c]},Va.prototype.toGeoJSON=function(t,e,n){var r,i,o=this.extent*Math.pow(2,n),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),c=Va.types[this.type];function l(t){for(var e=0;e>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n))}function Qa(t,e,n){if(3===t){var r=new Ga(n,n.readVarint()+n.pos);r.length&&(e[r.name]=r)}}Ha.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Ua(this._pbf,e,this.extent,this._keys,this._values)};var Xa={VectorTile:function(t,e){this.layers=t.readFields(Qa,{},e)},VectorTileFeature:Ua,VectorTileLayer:Ga},Ya=Xa.VectorTileFeature.types,Za=Math.pow(2,13);function Ja(t,e,n,r,i,o,a,s){t.emplaceBack(e,n,2*Math.floor(r*Za)+a,i*Za*2,o*Za*2,Math.round(s))}var $a=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new mi,this.indexArray=new Ai,this.programConfigurations=new fo(Ba,t.layers,t.zoom),this.segments=new Ki,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function ts(t,e){return t.x===e.x&&(t.x<0||t.x>go)||t.y===e.y&&(t.y<0||t.y>go)}function es(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>go}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>go}))}$a.prototype.populate=function(t,e){this.features=[],this.hasPattern=Ra("fill-extrusion",this.layers,e);for(var n=0,r=t;n=1){var g=f[m-1];if(!ts(y,g)){l.vertexLength+4>Ki.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=y.sub(g)._perp()._unit(),_=g.dist(y);d+_>32768&&(d=0),Ja(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,0,d),Ja(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,1,d),d+=_,Ja(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,0,d),Ja(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,1,d);var b=l.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),l.vertexLength+=4,l.primitiveLength+=2}}}}if(l.vertexLength+s>Ki.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),"Polygon"===Ya[t.type]){for(var w=[],x=[],E=l.vertexLength,T=0,S=a;T=2&&t[l-1].equals(t[l-2]);)l--;for(var h=0;h0;if(S&&_>h){var I=p.dist(m);if(I>2*f){var k=p.sub(p.sub(m)._mult(f/I)._round());this.updateDistance(m,k),this.addCurrentVertex(k,g,0,0,d),m=k}}var A=m&&y,O=A?n:c?"butt":r;if(A&&"round"===O&&(Ei&&(O="bevel"),"bevel"===O&&(E>2&&(O="flipbevel"),E100)b=v.mult(-1);else{var P=E*g.add(v).mag()/g.sub(v).mag();b._perp()._mult(P*(C?-1:1))}this.addCurrentVertex(p,b,0,0,d),this.addCurrentVertex(p,b.mult(-1),0,0,d)}else if("bevel"===O||"fakeround"===O){var D=-Math.sqrt(E*E-1),M=C?D:0,R=C?0:D;if(m&&this.addCurrentVertex(p,g,M,R,d),"fakeround"===O)for(var N=Math.round(180*T/Math.PI/20),L=1;L2*f){var V=p.add(y.sub(p)._mult(f/U)._round());this.updateDistance(p,V),this.addCurrentVertex(V,v,0,0,d),p=V}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,s)}},ls.prototype.addCurrentVertex=function(t,e,n,r,i,o){void 0===o&&(o=!1);var a=e.x+e.y*n,s=e.y-e.x*n,u=-e.x+e.y*r,c=-e.y-e.x*r;this.addHalfVertex(t,a,s,o,!1,n,i),this.addHalfVertex(t,u,c,o,!0,-r,i),this.distance>cs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,n,r,i,o))},ls.prototype.addHalfVertex=function(t,e,n,r,i,o,a){var s=t.x,u=t.y,c=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(r?1:0),(u<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1)|(63&c)<<2,c>>6);var l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),i?this.e2=l:this.e1=l},ls.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(cs-1):this.distance},br("LineBucket",ls,{omit:["layers","patternFeatures"]});var hs=new ai({"line-cap":new ei(It.layout_line["line-cap"]),"line-join":new ni(It.layout_line["line-join"]),"line-miter-limit":new ei(It.layout_line["line-miter-limit"]),"line-round-limit":new ei(It.layout_line["line-round-limit"]),"line-sort-key":new ni(It.layout_line["line-sort-key"])}),ps={paint:new ai({"line-opacity":new ni(It.paint_line["line-opacity"]),"line-color":new ni(It.paint_line["line-color"]),"line-translate":new ei(It.paint_line["line-translate"]),"line-translate-anchor":new ei(It.paint_line["line-translate-anchor"]),"line-width":new ni(It.paint_line["line-width"]),"line-gap-width":new ni(It.paint_line["line-gap-width"]),"line-offset":new ni(It.paint_line["line-offset"]),"line-blur":new ni(It.paint_line["line-blur"]),"line-dasharray":new ii(It.paint_line["line-dasharray"]),"line-pattern":new ri(It.paint_line["line-pattern"]),"line-gradient":new oi(It.paint_line["line-gradient"])}),layout:hs},fs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,n){return n=new Hr(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),t.prototype.possiblyEvaluate.call(this,e,n)},e.prototype.evaluate=function(e,n,r,i){return n=h({},n,{zoom:Math.floor(n.zoom)}),t.prototype.evaluate.call(this,e,n,r,i)},e}(ni))(ps.paint.properties["line-width"].specification);fs.useIntegerZoom=!0;var ds=function(t){function e(e){t.call(this,e,ps)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Yo(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,n){t.prototype.recalculate.call(this,e,n),this.paint._values["line-floorwidth"]=fs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new ls(t)},e.prototype.queryRadius=function(t){var e=t,n=ms(Mo("line-width",this,e),Mo("line-gap-width",this,e)),r=Mo("line-offset",this,e);return n/2+Math.abs(r)+Ro(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,o,a,s){var u=No(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),c=s/2*ms(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),l=this.paint.get("line-offset").evaluate(e,n);return l&&(r=function(t,e){for(var n=[],r=new i(0,0),o=0;o=3)for(var o=0;o0?e+2*t:t}var ys=hi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),gs=hi([{name:"a_projected_pos",components:3,type:"Float32"}],4),vs=(hi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),hi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),_s=(hi([{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"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),hi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),bs=hi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function ws(t,e,n){return t.sections.forEach((function(t){t.text=function(t,e,n){var r=e.layout.get("text-transform").evaluate(n,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),Gr.applyArabicShaping&&(t=Gr.applyArabicShaping(t)),t}(t.text,e,n)})),t}hi([{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"}]),hi([{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:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"}]),hi([{type:"Float32",name:"offsetX"}]),hi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var xs={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"},Es=24,Ts=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,h=n?i-1:0,p=n?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=p,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+h],h+=p,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)},Ss=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,d=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[n+f]=255&a,f+=d,a/=256,c-=8);t[n+f-d]|=128*m},Cs=Is;function Is(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Is.Varint=0,Is.Fixed64=1,Is.Bytes=2,Is.Fixed32=5;var ks="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function As(t){return t.type===Is.Bytes?t.readVarint()+t.pos:t.pos+1}function Os(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ps(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function Ds(t,e){for(var n=0;n>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function qs(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Is.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Us(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=qs(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Us(this.buf,this.pos)+4294967296*Us(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Us(this.buf,this.pos)+4294967296*qs(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ts(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ts(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(r=(112&(i=o[n.pos++]))>>4,i<128)return Os(t,r,e);if(r|=(127&(i=o[n.pos++]))<<3,i<128)return Os(t,r,e);if(r|=(127&(i=o[n.pos++]))<<10,i<128)return Os(t,r,e);if(r|=(127&(i=o[n.pos++]))<<17,i<128)return Os(t,r,e);if(r|=(127&(i=o[n.pos++]))<<24,i<128)return Os(t,r,e);if(r|=(1&(i=o[n.pos++]))<<31,i<128)return Os(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&ks?function(t,e,n){return ks.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){for(var r="",i=e;i239?4:u>223?3:u>191?2:1;if(i+l>n)break;1===l?u<128&&(c=u):2===l?128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===l?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((c=(15&u)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),i+=l}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Is.Bytes)return t.push(this.readVarint(e));var n=As(this);for(t=t||[];this.pos127;);else if(e===Is.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Is.Fixed32)this.pos+=4;else{if(e!==Is.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&Ps(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),Ss(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ss(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n=128&&Ps(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,Is.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Ds,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Ms,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ls,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Rs,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Ns,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Fs,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,js,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,zs,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Bs,e)},writeBytesField:function(t,e){this.writeTag(t,Is.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Is.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Is.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Is.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Is.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Is.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Is.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Is.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Is.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Is.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ws=3;function Gs(t,e,n){1===t&&n.readMessage(Hs,e)}function Hs(t,e,n){if(3===t){var r=n.readMessage(Ks,{}),i=r.id,o=r.bitmap,a=r.width,s=r.height,u=r.left,c=r.top,l=r.advance;e.push({id:i,bitmap:new Ko({width:a+2*Ws,height:s+2*Ws},o),metrics:{width:a,height:s,left:u,top:c,advance:l}})}}function Ks(t,e,n){1===t?e.id=n.readVarint():2===t?e.bitmap=n.readBytes():3===t?e.width=n.readVarint():4===t?e.height=n.readVarint():5===t?e.left=n.readSVarint():6===t?e.top=n.readSVarint():7===t&&(e.advance=n.readVarint())}var Qs=Ws;function Xs(t){for(var e=0,n=0,r=0,i=t;r=0;p--){var f=a[p];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,u=Math.max(u,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){var d=a.pop();p0&&j>S&&(S=j)}else{var z=n[I.fontStack],B=z&&z[A];if(B&&B.rect)D=B.rect,P=B.metrics;else{var U=e[I.fontStack],V=U&&U[A];if(!V)continue;P=V.metrics}O=(w-I.scale)*Es}N?(t.verticalizable=!0,T.push({glyph:A,imageName:M,x:p,y:f+O,vertical:N,scale:I.scale,fontStack:I.fontStack,sectionIndex:k,metrics:P,rect:D}),p+=R*I.scale+c):(T.push({glyph:A,imageName:M,x:p,y:f+O,vertical:N,scale:I.scale,fontStack:I.fontStack,sectionIndex:k,metrics:P,rect:D}),p+=P.advance*I.scale+c)}if(0!==T.length){var q=p-c;d=Math.max(q,d),fu(T,0,T.length-1,y,S)}p=0;var W=o*w+S;E.lineOffset=Math.max(S,x),f+=W,m=Math.max(W,m),++g}else f+=o,++g}var G,H=f-eu,K=pu(a),Q=K.horizontalAlign,X=K.verticalAlign;(function(t,e,n,r,i,o,a,s,u){var c,l=(e-n)*i;c=o!==a?-s*r-eu:(-r*u+.5)*a;for(var h=0,p=t;h=0&&r>=t&&ou[this.text.charCodeAt(r)];r--)n--;this.text=this.text.substring(t,n),this.sectionIndex=this.sectionIndex.slice(t,n)},ru.prototype.substring=function(t,e){var n=new ru;return n.text=this.text.substring(t,e),n.sectionIndex=this.sectionIndex.slice(t,e),n.sections=this.sections,n},ru.prototype.toString=function(){return this.text},ru.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,n){return Math.max(e,t.sections[n].scale)}),0)},ru.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(nu.forText(t.scale,t.fontStack||e));for(var n=this.sections.length-1,r=0;r=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var ou={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},au={};function su(t,e,n,r,i,o){if(e.imageName){var a=r[e.imageName];return a?a.displaySize[0]*e.scale*Es/o+i:0}var s=n[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function uu(t,e,n,r){var i=Math.pow(t-e,2);return r?t=0,h=0,p=0;p-n/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],c=0;sr;)c-=u.shift().angleDelta;if(c>i)return!1;a++,s+=h.dist(p)}return!0}function xu(t){for(var e=0,n=0;nc){var d=(c-u)/f,m=Ee(h.x,p.x,d),y=Ee(h.y,p.y,d),g=new mu(m,y,p.angleTo(h),l);return g._round(),!a||wu(t,g,s,a,e)?g:void 0}u+=f}}function Cu(t,e,n,r,i,o,a,s,u){var c=Eu(r,o,a),l=Tu(r,i),h=l*a,p=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-h=0&&w=0&&x=0&&f+l<=h){var E=new mu(w,x,_,m);E._round(),i&&!wu(e,E,a,i,o)||d.push(E)}}p+=v}return u||d.length||s||(d=t(e,p/2,r,i,o,a,s,!0,c)),d}(t,p?e/2*s%e:(l/2+2*o)*a*s%e,e,c,n,h,p,!1,u)}var Iu=Ys;function ku(t,e,n,r){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2*Iu,c=a.paddedRect.h-2*Iu,l=t.right-t.left,h=t.bottom-t.top,p=a.stretchX||[[0,u]],f=a.stretchY||[[0,c]],d=function(t,e){return t+e[1]-e[0]},m=p.reduce(d,0),y=f.reduce(d,0),g=u-m,v=c-y,_=0,b=m,w=0,x=y,E=0,T=g,S=0,C=v;if(a.content&&r){var I=a.content;_=Au(p,0,I[0]),w=Au(f,0,I[1]),b=Au(p,I[0],I[2]),x=Au(f,I[1],I[3]),E=I[0]-_,S=I[1]-w,T=I[2]-I[0]-b,C=I[3]-I[1]-x}var k=function(r,o,u,c){var p=Pu(r.stretch-_,b,l,t.left),f=Du(r.fixed-E,T,r.stretch,m),d=Pu(o.stretch-w,x,h,t.top),g=Du(o.fixed-S,C,o.stretch,y),v=Pu(u.stretch-_,b,l,t.left),I=Du(u.fixed-E,T,u.stretch,m),k=Pu(c.stretch-w,x,h,t.top),A=Du(c.fixed-S,C,c.stretch,y),O=new i(p,d),P=new i(v,d),D=new i(v,k),M=new i(p,k),R=new i(f/s,g/s),N=new i(I/s,A/s),L=e*Math.PI/180;if(L){var F=Math.sin(L),j=Math.cos(L),z=[j,-F,F,j];O._matMult(z),P._matMult(z),M._matMult(z),D._matMult(z)}var B=r.stretch+r.fixed,U=u.stretch+u.fixed,V=o.stretch+o.fixed,q=c.stretch+c.fixed;return{tl:O,tr:P,bl:M,br:D,tex:{x:a.paddedRect.x+Iu+B,y:a.paddedRect.y+Iu+V,w:U-B,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:N,minFontScaleX:T/s/l,minFontScaleY:C/s/h,isSDF:n}};if(r&&(a.stretchX||a.stretchY))for(var A=Ou(p,g,m),O=Ou(f,v,y),P=0;P0&&(v=Math.max(10*u,v),this._addLineCollisionCircles(t,e,n,n.segment,_,v,r,o,a,h))}else{if(p){var b=new i(m,f),w=new i(y,f),x=new i(m,d),E=new i(y,d),T=p*Math.PI/180;b._rotate(T),w._rotate(T),x._rotate(T),E._rotate(T),m=Math.min(b.x,w.x,x.x,E.x),y=Math.max(b.x,w.x,x.x,E.x),f=Math.min(b.y,w.y,x.y,E.y),d=Math.max(b.y,w.y,x.y,E.y)}t.emplaceBack(n.x,n.y,m,f,y,d,r,o,a,0,0)}this.boxEndIndex=t.length};Mu.prototype._addLineCollisionCircles=function(t,e,n,r,i,o,a,s,u,c){var l=o/2,h=Math.floor(i/l)||1,p=1+.4*Math.log(c)/Math.LN2,f=Math.floor(h*p/2),d=-o/2,m=n,y=r+1,g=d,v=-i/2,_=v-i/4;do{if(--y<0){if(g>v)return;y=0;break}g-=e[y].dist(m),m=e[y]}while(g>_);for(var b=e[y].dist(e[y+1]),w=-f;wi&&(E+=x-i),!(E=e.length)return;b=e[y].dist(e[y+1])}var T=E-g,S=e[y],C=e[y+1].sub(S)._unit()._mult(T)._add(S)._round(),I=Math.abs(E-d)0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)};function Nu(t,e){return te?1:0}function Lu(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);for(var r=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],c=0;ca)&&(a=l.x),(!c||l.y>s)&&(s=l.y)}var h=a-r,p=s-o,f=Math.min(h,p),d=f/2,m=new Ru([],Fu);if(0===f)return new i(r,o);for(var y=r;yv.d||!v.d)&&(v=b,n&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,_)),b.max-v.d<=e||(d=b.h/2,m.push(new ju(b.p.x-d,b.p.y-d,d,t)),m.push(new ju(b.p.x+d,b.p.y-d,d,t)),m.push(new ju(b.p.x-d,b.p.y+d,d,t)),m.push(new ju(b.p.x+d,b.p.y+d,d,t)),_+=4)}return n&&(console.log("num probes: "+_),console.log("best distance: "+v.d)),v.p}function Fu(t,e){return e.max-t.max}function ju(t,e,n,r){this.p=new i(t,e),this.h=n,this.d=function(t,e){for(var n=!1,r=1/0,i=0;it.y!=l.y>t.y&&t.x<(l.x-c.x)*(t.y-c.y)/(l.y-c.y)+c.x&&(n=!n),r=Math.min(r,Ao(t,c,l))}return(n?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}Ru.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Ru.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Ru.prototype.peek=function(){return this.data[0]},Ru.prototype._up=function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r},Ru.prototype._down=function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i};var zu=e((function(t){t.exports=function(t,e){var n,r,i,o,a,s,u,c;for(n=3&t.length,r=t.length-n,i=e,a=3432918353,s=461845907,c=0;c>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,n){case 3:u^=(255&t.charCodeAt(c+2))<<16;case 2:u^=(255&t.charCodeAt(c+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(c)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),Bu=e((function(t){t.exports=function(t,e){for(var n,r=t.length,i=e^r,o=0;r>=4;)n=1540483477*(65535&(n=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(n>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),Uu=zu,Vu=zu,qu=Bu;Uu.murmur3=Vu,Uu.murmur2=qu;var Wu=7,Gu=Number.POSITIVE_INFINITY;function Hu(t,e){return e[1]!==Gu?function(t,e,n){var r=0,i=0;switch(e=Math.abs(e),n=Math.abs(n),t){case"top-right":case"top-left":case"top":i=n-Wu;break;case"bottom-right":case"bottom-left":case"bottom":i=-n+Wu}switch(t){case"top-right":case"bottom-right":case"right":r=-e;break;case"top-left":case"bottom-left":case"left":r=e}return[r,i]}(t,e[0],e[1]):function(t,e){var n=0,r=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":r=i-Wu;break;case"bottom-right":case"bottom-left":r=-i+Wu;break;case"bottom":r=-e+Wu;break;case"top":r=e-Wu}switch(t){case"top-right":case"bottom-right":n=-i;break;case"top-left":case"bottom-left":n=i;break;case"left":n=e;break;case"right":n=-e}return[n,r]}(t,e[0])}function Ku(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var Qu=255,Xu=Qu*yu;function Yu(t,e,n,r,o,a,s,u,c,l,h,p,f,d){var m=function(t,e,n,r,o,a,s,u){for(var c=r.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,l=[],h=0,p=e.positionedLines;hXu&&x(t.layerIds[0]+': Value for "text-size" is >= '+Qu+'. Reduce your "text-size".'):"composite"===y.kind&&((g=[yu*d.compositeTextSizes[0].evaluate(s,{}),yu*d.compositeTextSizes[1].evaluate(s,{})])[0]>Xu||g[1]>Xu)&&x(t.layerIds[0]+': Value for "text-size" is >= '+Qu+'. Reduce your "text-size".'),t.addSymbols(t.text,m,g,u,a,s,l,e,c.lineStartIndex,c.lineLength,f);for(var v=0,_=h;v<_.length;v+=1)p[_[v]]=t.text.placedSymbolArray.length-1;return 4*m.length}function Zu(t){for(var e in t)return t[e];return null}function Ju(t,e,n,r){var i=t.compareText;if(e in i){for(var o=i[e],a=o.length-1;a>=0;a--)if(r.dist(o[a])0)&&("constant"!==i.value.kind||i.value.value.length>0),u=("constant"!==a.value.kind||!!a.value.value)&&Object.keys(a.parameters).length>0,c=r.get("symbol-sort-key");if(this.features=[],s||u){for(var l=e.iconDependencies,h=e.glyphDependencies,p=e.availableImages,f=new Hr(this.zoom),d=0,m=t;d=0;for(var A=0,O=b.sections;A=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u0;this.addCollisionDebugVertices(a,s,u,c,l?r?this.textCollisionCircle:this.iconCollisionCircle:r?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,n,l)}},ac.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t0},ac.prototype.hasIconData=function(){return this.icon.segments.get().length>0},ac.prototype.hasTextCollisionBoxData=function(){return this.textCollisionBox.segments.get().length>0},ac.prototype.hasIconCollisionBoxData=function(){return this.iconCollisionBox.segments.get().length>0},ac.prototype.hasTextCollisionCircleData=function(){return this.textCollisionCircle.segments.get().length>0},ac.prototype.hasIconCollisionCircleData=function(){return this.iconCollisionCircle.segments.get().length>0},ac.prototype.addIndicesForPlacedSymbol=function(t,e){for(var n=t.placedSymbolArray.get(e),r=n.vertexStartIndex+4*n.numGlyphs,i=n.vertexStartIndex;i1||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(var n=0,r=this.symbolInstanceIndexes;n=0&&r.indexOf(t)===n&&e.addIndicesForPlacedSymbol(e.text,t)})),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},br("SymbolBucket",ac,{omit:["layers","collisionBoxArray","features","compareText"]}),ac.MAX_GLYPHS=65535,ac.addDynamicAttributes=nc;var sc=new ai({"symbol-placement":new ei(It.layout_symbol["symbol-placement"]),"symbol-spacing":new ei(It.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ei(It.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ni(It.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ei(It.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ei(It.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new ei(It.layout_symbol["icon-ignore-placement"]),"icon-optional":new ei(It.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ei(It.layout_symbol["icon-rotation-alignment"]),"icon-size":new ni(It.layout_symbol["icon-size"]),"icon-text-fit":new ei(It.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ei(It.layout_symbol["icon-text-fit-padding"]),"icon-image":new ni(It.layout_symbol["icon-image"]),"icon-rotate":new ni(It.layout_symbol["icon-rotate"]),"icon-padding":new ei(It.layout_symbol["icon-padding"]),"icon-keep-upright":new ei(It.layout_symbol["icon-keep-upright"]),"icon-offset":new ni(It.layout_symbol["icon-offset"]),"icon-anchor":new ni(It.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ei(It.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ei(It.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ei(It.layout_symbol["text-rotation-alignment"]),"text-field":new ni(It.layout_symbol["text-field"]),"text-font":new ni(It.layout_symbol["text-font"]),"text-size":new ni(It.layout_symbol["text-size"]),"text-max-width":new ni(It.layout_symbol["text-max-width"]),"text-line-height":new ei(It.layout_symbol["text-line-height"]),"text-letter-spacing":new ni(It.layout_symbol["text-letter-spacing"]),"text-justify":new ni(It.layout_symbol["text-justify"]),"text-radial-offset":new ni(It.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ei(It.layout_symbol["text-variable-anchor"]),"text-anchor":new ni(It.layout_symbol["text-anchor"]),"text-max-angle":new ei(It.layout_symbol["text-max-angle"]),"text-writing-mode":new ei(It.layout_symbol["text-writing-mode"]),"text-rotate":new ni(It.layout_symbol["text-rotate"]),"text-padding":new ei(It.layout_symbol["text-padding"]),"text-keep-upright":new ei(It.layout_symbol["text-keep-upright"]),"text-transform":new ni(It.layout_symbol["text-transform"]),"text-offset":new ni(It.layout_symbol["text-offset"]),"text-allow-overlap":new ei(It.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new ei(It.layout_symbol["text-ignore-placement"]),"text-optional":new ei(It.layout_symbol["text-optional"])}),uc={paint:new ai({"icon-opacity":new ni(It.paint_symbol["icon-opacity"]),"icon-color":new ni(It.paint_symbol["icon-color"]),"icon-halo-color":new ni(It.paint_symbol["icon-halo-color"]),"icon-halo-width":new ni(It.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ni(It.paint_symbol["icon-halo-blur"]),"icon-translate":new ei(It.paint_symbol["icon-translate"]),"icon-translate-anchor":new ei(It.paint_symbol["icon-translate-anchor"]),"text-opacity":new ni(It.paint_symbol["text-opacity"]),"text-color":new ni(It.paint_symbol["text-color"],{runtimeType:zt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new ni(It.paint_symbol["text-halo-color"]),"text-halo-width":new ni(It.paint_symbol["text-halo-width"]),"text-halo-blur":new ni(It.paint_symbol["text-halo-blur"]),"text-translate":new ei(It.paint_symbol["text-translate"]),"text-translate-anchor":new ei(It.paint_symbol["text-translate-anchor"])}),layout:sc},cc=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Nt,this.defaultValue=t};cc.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},cc.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},cc.prototype.possibleOutputs=function(){return[void 0]},cc.prototype.serialize=function(){return null},br("FormatSectionOverride",cc,{omit:["defaultValue"]});var lc=function(t){function e(e){t.call(this,e,uc)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,n){if(t.prototype.recalculate.call(this,e,n),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var r=this.layout.get("text-writing-mode");if(r){for(var i=[],o=0,a=r;o",targetMapId:r,sourceMapId:o.mapId})}}},Ec.prototype.receive=function(t){var e=t.data,n=e.id;if(n&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[n];var r=this.cancelCallbacks[n];delete this.cancelCallbacks[n],r&&r()}else S()||e.mustQueue?(this.tasks[n]=e,this.taskQueue.push(n),this.invoker.trigger()):this.processTask(n,e)},Ec.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Ec.prototype.processTask=function(t,e){var n=this;if(""===e.type){var r=this.callbacks[t];delete this.callbacks[t],r&&(e.error?r(Tr(e.error)):r(null,Tr(e.data)))}else{var i=!1,o=k(this.globalScope)?void 0:[],a=e.hasCallback?function(e,r){i=!0,delete n.cancelCallbacks[t],n.target.postMessage({id:t,type:"",sourceMapId:n.mapId,error:e?Er(e):null,data:Er(r,o)},o)}:function(t){i=!0},s=null,u=Tr(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],u.source)[c[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Ec.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Sc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Sc.prototype.setNorthEast=function(t){return this._ne=t instanceof Cc?new Cc(t.lng,t.lat):Cc.convert(t),this},Sc.prototype.setSouthWest=function(t){return this._sw=t instanceof Cc?new Cc(t.lng,t.lat):Cc.convert(t),this},Sc.prototype.extend=function(t){var e,n,r=this._sw,i=this._ne;if(t instanceof Cc)e=t,n=t;else{if(!(t instanceof Sc))return Array.isArray(t)?t.every(Array.isArray)?this.extend(Sc.convert(t)):this.extend(Cc.convert(t)):this;if(e=t._sw,n=t._ne,!e||!n)return this}return r||i?(r.lng=Math.min(e.lng,r.lng),r.lat=Math.min(e.lat,r.lat),i.lng=Math.max(n.lng,i.lng),i.lat=Math.max(n.lat,i.lat)):(this._sw=new Cc(e.lng,e.lat),this._ne=new Cc(n.lng,n.lat)),this},Sc.prototype.getCenter=function(){return new Cc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Sc.prototype.getSouthWest=function(){return this._sw},Sc.prototype.getNorthEast=function(){return this._ne},Sc.prototype.getNorthWest=function(){return new Cc(this.getWest(),this.getNorth())},Sc.prototype.getSouthEast=function(){return new Cc(this.getEast(),this.getSouth())},Sc.prototype.getWest=function(){return this._sw.lng},Sc.prototype.getSouth=function(){return this._sw.lat},Sc.prototype.getEast=function(){return this._ne.lng},Sc.prototype.getNorth=function(){return this._ne.lat},Sc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Sc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Sc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Sc.prototype.contains=function(t){var e=Cc.convert(t),n=e.lng,r=e.lat,i=this._sw.lat<=r&&r<=this._ne.lat,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),i&&o},Sc.convert=function(t){return!t||t instanceof Sc?t:new Sc(t)};var Cc=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Cc.prototype.wrap=function(){return new Cc(l(this.lng,-180,180),this.lat)},Cc.prototype.toArray=function(){return[this.lng,this.lat]},Cc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Cc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,n=e/Math.cos(Math.PI/180*this.lat);return new Sc(new Cc(this.lng-n,this.lat-e),new Cc(this.lng+n,this.lat+e))},Cc.convert=function(t){if(t instanceof Cc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Cc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Cc(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 [, ]")};var Ic=2*Math.PI*6378137;function kc(t){return Ic*Math.cos(t*Math.PI/180)}function Ac(t){return(180+t)/360}function Oc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Pc(t,e){return t/kc(e)}function Dc(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var Mc=function(t,e,n){void 0===n&&(n=0),this.x=+t,this.y=+e,this.z=+n};Mc.fromLngLat=function(t,e){void 0===e&&(e=0);var n=Cc.convert(t);return new Mc(Ac(n.lng),Oc(n.lat),Pc(e,n.lat))},Mc.prototype.toLngLat=function(){return new Cc(360*this.x-180,Dc(this.y))},Mc.prototype.toAltitude=function(){return this.z*kc(Dc(this.y))},Mc.prototype.meterInMercatorCoordinateUnits=function(){return 1/Ic*(t=Dc(this.y),1/Math.cos(t*Math.PI/180));var t};var Rc=function(t,e,n){this.z=t,this.x=e,this.y=n,this.key=Fc(0,t,e,n)};Rc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Rc.prototype.url=function(t,e){var n,r,i,o,a,s=(n=this.x,r=this.y,i=this.z,o=Tc(256*n,256*(r=Math.pow(2,i)-r-1),i),a=Tc(256*(n+1),256*(r+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,n){for(var r,i="",o=t;o>0;o--)i+=(e&(r=1<this.canonical.z?new Lc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Lc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Lc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},Lc.prototype.children=function(t){if(this.overscaledZ>=t)return[new Lc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,n=2*this.canonical.x,r=2*this.canonical.y;return[new Lc(e,this.wrap,e,n,r),new Lc(e,this.wrap,e,n+1,r),new Lc(e,this.wrap,e,n,r+1),new Lc(e,this.wrap,e,n+1,r+1)]},Lc.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},jc.prototype._unpackMapbox=function(t,e,n){return(256*t*256+256*e+n)/10-1e4},jc.prototype._unpackTerrarium=function(t,e,n){return 256*t+e+n/256-32768},jc.prototype.getPixels=function(){return new Qo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},jc.prototype.backfillBorder=function(t,e,n){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var r=e*this.dim,i=e*this.dim+this.dim,o=n*this.dim,a=n*this.dim+this.dim;switch(e){case-1:r=i-1;break;case 1:i=r+1}switch(n){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-n*this.dim,c=o;c=0)null!==this.deletedStates[t][r]&&(this.deletedStates[t][r]=this.deletedStates[t][r]||{},this.deletedStates[t][r][n]=null);else if(void 0!==e&&e>=0)if(this.stateChanges[t]&&this.stateChanges[t][r])for(n in this.deletedStates[t][r]={},this.stateChanges[t][r])this.deletedStates[t][r][n]=null;else this.deletedStates[t][r]=null;else this.deletedStates[t]=null}},qc.prototype.getState=function(t,e){var n=String(e),r=this.state[t]||{},i=this.stateChanges[t]||{},o=h({},r[n],i[n]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var a=this.deletedStates[t][e];if(null===a)return{};for(var s in a)delete o[s]}return o},qc.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},qc.prototype.coalesceChanges=function(t,e){var n={};for(var r in this.stateChanges){this.state[r]=this.state[r]||{};var i={};for(var o in this.stateChanges[r])this.state[r][o]||(this.state[r][o]={}),h(this.state[r][o],this.stateChanges[r][o]),i[o]=this.state[r][o];n[r]=i}for(var a in this.deletedStates){this.state[a]=this.state[a]||{};var s={};if(null===this.deletedStates[a])for(var u in this.state[a])s[u]={},this.state[a][u]={};else for(var c in this.deletedStates[a]){if(null===this.deletedStates[a][c])this.state[a][c]={};else for(var l=0,p=Object.keys(this.deletedStates[a][c]);l=0&&l[3]>=0&&s.insert(a,l[0],l[1],l[2],l[3])}},Wc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Xa.VectorTile(new Cs(this.rawTileData)).layers,this.sourceLayerCoder=new Bc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Wc.prototype.query=function(t,e,n){var r=this;this.loadVTLayers();for(var o=t.params||{},a=go/t.tileSize/t.scale,s=qn(o.filter),u=t.queryGeometry,c=t.queryPadding*a,l=Gc(u),h=this.grid.query(l.minX-c,l.minY-c,l.maxX+c,l.maxY+c),p=Gc(t.cameraQueryGeometry),f=0,d=this.grid3D.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c,(function(e,n,r,o){return function(t,e,n,r,o){for(var a=0,s=t;a=u.x&&o>=u.y)return!0}var c=[new i(e,n),new i(e,o),new i(r,o),new i(r,n)];if(t.length>2)for(var l=0,h=c;l=0)return!0;return!1}(o,u)){var c=this.sourceLayerCoder.decode(n),l=this.vtLayers[c].feature(r);if(i(new Hr(this.tileID.overscaledZ),l))for(var h=0;h>u.z,l=new i(u.x*c,u.y*c),h=new i(l.x+c,l.y+c),p=this.segments.prepareSegment(4,n,r);n.emplaceBack(l.x,l.y,l.x,l.y),n.emplaceBack(h.x,l.y,h.x,l.y),n.emplaceBack(l.x,h.y,l.x,h.y),n.emplaceBack(h.x,h.y,h.x,h.y);var f=p.vertexLength;r.emplaceBack(f,f+1,f+2),r.emplaceBack(f+1,f+2,f+3),p.vertexLength+=4,p.primitiveLength+=2}this.maskedBoundsBuffer=e.createVertexBuffer(n,zc.members),this.maskedIndexBuffer=e.createIndexBuffer(r)}},Kc.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Kc.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Kc.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var n=C(t.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+1e3*n["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var r=Date.now(),i=!1;if(this.expirationTime>r)i=!1;else if(e)if(this.expirationTimeut&&(t.getActor().send("enforceCacheSizeLimit",st),pt=0)},t.clamp=c,t.clearTileCache=function(t){var e=self.caches.delete(at);t&&e.catch(t).then((function(){return t()}))},t.clone=function(t){var e=new zo(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.config=j,t.create=function(){var t=new zo(16);return zo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new zo(9);return zo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new zo(4);return zo!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=On,t.createLayout=hi,t.createStyleLayer=function(t){return"custom"===t.type?new mc(t):new yc[t.type](t)},t.deepEqual=a,t.ease=u,t.emitValidationErrors=dr,t.endsWith=g,t.enforceCacheSizeLimit=function(t){lt(),$&&$.then((function(e){e.keys().then((function(n){for(var r=0;r=j.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:n,cancelled:!1,cancel:function(){this.cancelled=!0}};return gt.push(r),r}vt++;var i=!1,o=function(){if(!i)for(i=!0,vt--;gt.length&&vt=go||s.y<0||s.y>=go||function(t,e,n,r,i,o,a,s,u,c,l,h,p,f,d,m,y,g,v,_,b,w,E){var T,S,C,I,k,A=t.addToLineVertexArray(e,n),O=0,P=0,D=0,M=0,R=-1,N=-1,L={},F=Uu(""),j=0,z=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(j=(T=s.layout.get("text-offset").evaluate(b,{}).map((function(t){return t*Es})))[0],z=T[1]):(j=s.layout.get("text-radial-offset").evaluate(b,{})*Es,z=Gu),t.allowVerticalPlacement&&r.vertical){var B=s.layout.get("text-rotate").evaluate(b,{})+90,U=r.vertical;I=new Mu(u,n,e,c,l,h,U,p,f,d,t.overscaling,B),a&&(k=new Mu(u,n,e,c,l,h,a,y,g,d,t.overscaling,B))}if(i){var V=s.layout.get("icon-rotate").evaluate(b,{}),q="none"!==s.layout.get("icon-text-fit"),W=ku(i,V,E,q),G=a?ku(a,V,E,q):void 0;C=new Mu(u,n,e,c,l,h,i,y,g,!1,t.overscaling,V),O=4*W.length;var H=t.iconSizeData,K=null;"source"===H.kind?(K=[yu*s.layout.get("icon-size").evaluate(b,{})])[0]>Xu&&x(t.layerIds[0]+': Value for "icon-size" is >= '+Qu+'. Reduce your "icon-size".'):"composite"===H.kind&&((K=[yu*w.compositeIconSizes[0].evaluate(b,{}),yu*w.compositeIconSizes[1].evaluate(b,{})])[0]>Xu||K[1]>Xu)&&x(t.layerIds[0]+': Value for "icon-size" is >= '+Qu+'. Reduce your "icon-size".'),t.addSymbols(t.icon,W,K,_,v,b,!1,e,A.lineStartIndex,A.lineLength,-1),R=t.icon.placedSymbolArray.length-1,G&&(P=4*G.length,t.addSymbols(t.icon,G,K,_,v,b,tu.vertical,e,A.lineStartIndex,A.lineLength,-1),N=t.icon.placedSymbolArray.length-1)}for(var Q in r.horizontal){var X=r.horizontal[Q];if(!S){F=Uu(X.text);var Y=s.layout.get("text-rotate").evaluate(b,{});S=new Mu(u,n,e,c,l,h,X,p,f,d,t.overscaling,Y)}var Z=1===X.positionedLines.length;if(D+=Yu(t,e,X,o,s,d,b,m,A,r.vertical?tu.horizontal:tu.horizontalOnly,Z?Object.keys(r.horizontal):[Q],L,R,w),Z)break}r.vertical&&(M+=Yu(t,e,r.vertical,o,s,d,b,m,A,tu.vertical,["vertical"],L,N,w));var J=S?S.boxStartIndex:t.collisionBoxArray.length,$=S?S.boxEndIndex:t.collisionBoxArray.length,tt=I?I.boxStartIndex:t.collisionBoxArray.length,et=I?I.boxEndIndex:t.collisionBoxArray.length,nt=C?C.boxStartIndex:t.collisionBoxArray.length,rt=C?C.boxEndIndex:t.collisionBoxArray.length,it=k?k.boxStartIndex:t.collisionBoxArray.length,ot=k?k.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=ac.MAX_GLYPHS&&x("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),t.symbolInstances.emplaceBack(e.x,e.y,L.right>=0?L.right:-1,L.center>=0?L.center:-1,L.left>=0?L.left:-1,L.vertical||-1,R,N,F,J,$,tt,et,nt,rt,it,ot,c,D,M,O,P,0,p,j,z)}(t,s,i,n,r,o,p,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,w,S,c,_,E,C,d,e,a,l)};if("line"===I)for(var P=0,D=function(t,e,n,r,o){for(var a=[],s=0;s=r&&p.x>=r||(h.x>=r?h=new i(r,h.y+(p.y-h.y)*((r-h.x)/(p.x-h.x)))._round():p.x>=r&&(p=new i(r,h.y+(p.y-h.y)*((r-h.x)/(p.x-h.x)))._round()),h.y>=o&&p.y>=o||(h.y>=o?h=new i(h.x+(p.x-h.x)*((o-h.y)/(p.y-h.y)),o)._round():p.y>=o&&(p=new i(h.x+(p.x-h.x)*((o-h.y)/(p.y-h.y)),o)._round()),c&&h.equals(c[c.length-1])||(c=[h],a.push(c)),c.push(p)))))}return a}(e.geometry,0,0,go,go);P1){var B=Su(z,T,n.vertical||m,r,24,v);B&&O(z,B)}}else if("Polygon"===e.type)for(var U=0,V=Da(e.geometry,0);U=I.maxzoom||"none"!==I.visibility&&(a(C,this.zoom,r),(m[I.id]=I.createBucket({index:l.bucketLayerIDs.length,layers:C,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(w,y),l.bucketLayerIDs.push(C.map((function(t){return t.id}))))}}}var k=t.mapObject(y.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(k).length?o.send("getGlyphs",{uid:this.uid,stacks:k},(function(t,e){h||(h=t,p=e,P.call(u))})):p={};var A=Object.keys(y.iconDependencies);A.length?o.send("getImages",{icons:A,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,f=e,P.call(u))})):f={};var O=Object.keys(y.patternDependencies);function P(){if(h)return s(h);if(p&&f&&d){var e=new i(p),n=new t.ImageAtlas(f,d);for(var o in m){var u=m[o];u instanceof t.SymbolBucket?(a(u.layers,this.zoom,r),t.performSymbolLayout(u,p,e.positions,f,n.iconPositions,this.showCollisionBoxes)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(a(u.layers,this.zoom,r),u.addFeatures(y,n.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:n,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}O.length?o.send("getImages",{icons:O,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,P.call(u))})):d={},P.call(this)};var s="undefined"!=typeof performance,u={getEntriesByName:function(t){return!!(s&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(t)},mark:function(t){return!!(s&&performance&&performance.mark)&&performance.mark(t)},measure:function(t,e,n){return!!(s&&performance&&performance.measure)&&performance.measure(t,e,n)},clearMarks:function(t){return!!(s&&performance&&performance.clearMarks)&&performance.clearMarks(t)},clearMeasures:function(t){return!!(s&&performance&&performance.clearMeasures)&&performance.clearMeasures(t)}},c=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},u.mark(this._marks.start)};function l(e,n){var r=t.getArrayBuffer(e.request,(function(e,r,i,o){e?n(e):r&&n(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(r)),rawData:r,cacheControl:i,expires:o})}));return function(){r.cancel(),n()}}c.prototype.finish=function(){u.mark(this._marks.end);var t=u.getEntriesByName(this._marks.measure);return 0===t.length&&(u.measure(this._marks.measure,this._marks.start,this._marks.end),t=u.getEntriesByName(this._marks.measure),u.clearMarks(this._marks.start),u.clearMarks(this._marks.end),u.clearMeasures(this._marks.measure)),t},u.Performance=c;var h=function(t,e,n,r){this.actor=t,this.layerIndex=e,this.availableImages=n,this.loadVectorData=r||l,this.loading={},this.loaded={}};h.prototype.loadTile=function(e,n){var r=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new u.Performance(e.request),s=this.loading[i]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete r.loading[i],e||!o)return s.status="done",r.loaded[i]=s,n(e);var u=o.rawData,c={};o.expires&&(c.expires=o.expires),o.cacheControl&&(c.cacheControl=o.cacheControl);var l={};if(a){var h=a.finish();h&&(l.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=o.vectorTile,s.parse(o.vectorTile,r.layerIndex,r.availableImages,r.actor,(function(e,r){if(e||!r)return n(e);n(null,t.extend({rawTileData:u.slice(0)},r,c,l))})),r.loaded=r.loaded||{},r.loaded[i]=s}))},h.prototype.reloadTile=function(t,e){var n=this,r=this.loaded,i=t.uid,o=this;if(r&&r[i]){var a=r[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,r){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,n.availableImages,o.actor,i)),e(t,r)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},h.prototype.abortTile=function(t,e){var n=this.loading,r=t.uid;n&&n[r]&&n[r].abort&&(n[r].abort(),delete n[r]),e()},h.prototype.removeTile=function(t,e){var n=this.loaded,r=t.uid;n&&n[r]&&delete n[r],e()};var p=function(){this.loaded={}};p.prototype.loadTile=function(e,n){var r=e.uid,i=e.encoding,o=e.rawImageData,a=new t.DEMData(r,o,i);this.loaded=this.loaded||{},this.loaded[r]=a,n(null,a)},p.prototype.removeTile=function(t){var e=this.loaded,n=t.uid;e&&e[n]&&delete e[n]};var f={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function d(t){var e=0;if(t&&t.length>0){e+=Math.abs(m(t[0]));for(var n=1;n2){for(a=0;a=0}(t)===e?t:t.reverse()}var w=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,x=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};x.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],n=0,r=this._feature.geometry;n>31}function F(t,e){for(var n=t.loadGeometry(),r=t.type,i=0,o=0,a=n.length,s=0;s>1;!function t(e,n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(u-s/2<0?-1:1);t(e,n,r,Math.max(i,Math.floor(r-u*l/s+h)),Math.min(o,Math.floor(r+(s-u)*l/s+h)),a)}var p=n[2*r+a],f=i,d=o;for(z(e,n,i,r),n[2*o+a]>p&&z(e,n,i,o);fp;)d--}n[2*i+a]===p?z(e,n,i,d):z(e,n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(e,n,s,i,o,a%2),t(e,n,r,i,s-1,a+1),t(e,n,r,s+1,o,a+1)}}(a,s,r,0,a.length-1,0)};W.prototype.range=function(t,e,n,r){return function(t,e,n,r,i,o,a){for(var s,u,c=[0,t.length-1,0],l=[];c.length;){var h=c.pop(),p=c.pop(),f=c.pop();if(p-f<=a)for(var d=f;d<=p;d++)s=e[2*d],u=e[2*d+1],s>=n&&s<=i&&u>=r&&u<=o&&l.push(t[d]);else{var m=Math.floor((f+p)/2);s=e[2*m],u=e[2*m+1],s>=n&&s<=i&&u>=r&&u<=o&&l.push(t[m]);var y=(h+1)%2;(0===h?n<=s:r<=u)&&(c.push(f),c.push(m-1),c.push(y)),(0===h?i>=s:o>=u)&&(c.push(m+1),c.push(p),c.push(y))}}return l}(this.ids,this.coords,t,e,n,r,this.nodeSize)},W.prototype.within=function(t,e,n){return function(t,e,n,r,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var c=a.pop(),l=a.pop(),h=a.pop();if(l-h<=o)for(var p=h;p<=l;p++)U(e[2*p],e[2*p+1],n,r)<=u&&s.push(t[p]);else{var f=Math.floor((h+l)/2),d=e[2*f],m=e[2*f+1];U(d,m,n,r)<=u&&s.push(t[f]);var y=(c+1)%2;(0===c?n-i<=d:r-i<=m)&&(a.push(h),a.push(f-1),a.push(y)),(0===c?n+i>=d:r+i>=m)&&(a.push(f+1),a.push(l),a.push(y))}}return s}(this.ids,this.coords,t,e,n,this.nodeSize)};var G={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},H=function(t){this.options=$(Object.create(G),t),this.trees=new Array(this.options.maxZoom+1)};function K(t,e,n,r,i){return{x:t,y:e,zoom:1/0,id:n,parentId:-1,numPoints:r,properties:i}}function Q(t,e){var n=t.geometry.coordinates,r=n[0],i=n[1];return{x:Z(r),y:J(i),zoom:1/0,index:e,parentId:-1}}function X(t){return{type:"Feature",id:t.id,properties:Y(t),geometry:{type:"Point",coordinates:[(r=t.x,360*(r-.5)),(e=t.y,n=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(n))/Math.PI-90)]}};var e,n,r}function Y(t){var e=t.numPoints,n=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return $($({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function Z(t){return t/360+.5}function J(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function $(t,e){for(var n in e)t[n]=e[n];return t}function tt(t){return t.x}function et(t){return t.y}function nt(t,e,n,r,i,o){var a=i-n,s=o-r;if(0!==a||0!==s){var u=((t-n)*a+(e-r)*s)/(a*a+s*s);u>1?(n=i,r=o):u>0&&(n+=a*u,r+=s*u)}return(a=t-n)*a+(s=e-r)*s}function rt(t,e,n,r){var i={id:void 0===t?null:t,type:e,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,n=t.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)it(t,e);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r0&&(a+=r?(i*c-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(c-o,2))),i=u,o=c}var l=e.length-3;e[2]=1,function t(e,n,r,i){for(var o,a=i,s=r-n>>1,u=r-n,c=e[n],l=e[n+1],h=e[r],p=e[r+1],f=n+3;fa)o=f,a=d;else if(d===a){var m=Math.abs(f-s);mi&&(o-n>3&&t(e,n,o,i),e[o+2]=a,r-o>3&&t(e,o,r,i))}(e,0,l,n),e[l+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function ut(t,e,n,r){for(var i=0;i1?1:n}function ht(t,e,n,r,i,o,a,s){if(r/=e,o>=(n/=e)&&a=r)return null;for(var u=[],c=0;c=n&&d=r)){var m=[];if("Point"===p||"MultiPoint"===p)pt(h,m,n,r,i);else if("LineString"===p)ft(h,m,n,r,i,!1,s.lineMetrics);else if("MultiLineString"===p)mt(h,m,n,r,i,!1);else if("Polygon"===p)mt(h,m,n,r,i,!0);else if("MultiPolygon"===p)for(var y=0;y=n&&a<=r&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function ft(t,e,n,r,i,o,a){for(var s,u,c=dt(t),l=0===i?gt:vt,h=t.start,p=0;pn&&(u=l(c,f,d,y,g,n),a&&(c.start=h+s*u)):v>r?_=n&&(u=l(c,f,d,y,g,n),b=!0),_>r&&v<=r&&(u=l(c,f,d,y,g,r),b=!0),!o&&b&&(a&&(c.end=h+s*u),e.push(c),c=dt(t)),a&&(h+=s)}var w=t.length-3;f=t[w],d=t[w+1],m=t[w+2],(v=0===i?f:d)>=n&&v<=r&&yt(c,f,d,m),w=c.length-3,o&&w>=3&&(c[w]!==c[0]||c[w+1]!==c[1])&&yt(c,c[0],c[1],c[2]),c.length&&e.push(c)}function dt(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function mt(t,e,n,r,i,o){for(var a=0;aa.maxX&&(a.maxX=l),h>a.maxY&&(a.maxY=h)}return a}function Tt(t,e,n,r){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:r))n.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(n.numSimplified++,s.push(e[u]),s.push(e[u+1])),n.numPoints++;i&&function(t,e){for(var n=0,r=0,i=t.length,o=i-2;r0===e)for(r=0,i=t.length;r24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var r=function(t,e){var n=[];if("FeatureCollection"===t.type)for(var r=0;r=r;c--){var l=+Date.now();s=this._cluster(s,c),this.trees[c]=new W(s,tt,et,o,Float32Array),n&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-l)}return n&&console.timeEnd("total time"),this},H.prototype.getClusters=function(t,e){var n=((t[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)n=-180,i=180;else if(n>i){var a=this.getClusters([n,r,180,o],e),s=this.getClusters([-180,r,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],c=[],l=0,h=u.range(Z(n),J(o),Z(i),J(r));l1?this._map(c,!0):null,y=(u<<5)+(e+1)+this.points.length,g=0,v=h;g>5},H.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},H.prototype._map=function(t,e){if(t.numPoints)return e?$({},t.properties):t.properties;var n=this.points[t.index].properties,r=this.options.map(n);return e&&r===n?$({},r):r},Ct.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Ct.prototype.splitTile=function(t,e,n,r,i,o,a){for(var s=[t,e,n,r],u=this.options,c=u.debug;s.length;){r=s.pop(),n=s.pop(),e=s.pop(),t=s.pop();var l=1<1&&console.time("creation"),p=this.tiles[h]=Et(t,e,n,r,u),this.tileCoords.push({z:e,x:n,y:r}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,r,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=t,i){if(e===u.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var m,y,g,v,_,b,w=.5*u.buffer/u.extent,x=.5-w,E=.5+w,T=1+w;m=y=g=v=null,_=ht(t,l,n-w,n+E,0,p.minX,p.maxX,u),b=ht(t,l,n+x,n+T,0,p.minX,p.maxX,u),t=null,_&&(m=ht(_,l,r-w,r+E,1,p.minY,p.maxY,u),y=ht(_,l,r+x,r+T,1,p.minY,p.maxY,u),_=null),b&&(g=ht(b,l,r-w,r+E,1,p.minY,p.maxY,u),v=ht(b,l,r+x,r+T,1,p.minY,p.maxY,u),b=null),c>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*n,2*r),s.push(y||[],e+1,2*n,2*r+1),s.push(g||[],e+1,2*n+1,2*r),s.push(v||[],e+1,2*n+1,2*r+1)}}},Ct.prototype.getTile=function(t,e,n){var r=this.options,i=r.extent,o=r.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,n);for(var u,c=t,l=e,h=n;!u&&c>0;)c--,l=Math.floor(l/2),h=Math.floor(h/2),u=this.tiles[It(c,l,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,l,h),o>1&&console.time("drilling down"),this.splitTile(u.source,c,l,h,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?wt(this.tiles[s],i):null):null};var At=function(e){function n(t,n,r,i){e.call(this,t,n,r,kt),i&&(this.loadGeoJSON=i)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},n.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var n=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(r&&r.request&&r.request.collectResourceTiming)&&new u.Performance(r.request);this.loadGeoJSON(r,(function(o,a){if(o||!a)return n(o);if("object"!=typeof a)return n(new Error("Input data given to '"+r.source+"' is not a valid GeoJSON object."));!function t(e,n){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(v(t,n)),e;case"GeometryCollection":return e.geometries=e.geometries.map(v(t,n)),e;case"Feature":return e.geometry=t(e.geometry,n),e;case"Polygon":case"MultiPolygon":return function(t,e){return"Polygon"===t.type?t.coordinates=_(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(v(_,e))),t}(e,n);default:return e}}(a,!0);try{e._geoJSONIndex=r.cluster?new H(function(e){var n=e.superclusterOptions,r=e.clusterProperties;if(!r||!n)return n;for(var i={},o={},a={accumulated:null,zoom:0},s={properties:null},u=Object.keys(r),c=0,l=u;c=0?0:e.button},n.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var p=function(e){function n(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.isLoaded=function(){return this.loaded},n.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,n=this.requestors;e=0?1.2:1))}function g(t,e,n,r,i,o,a){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else{var u=o.requests[s];u||(u=o.requests[s]=[],_.loadGlyphRange(n,s,r.url,r.requestManager,(function(t,e){if(e)for(var n in e)r._doesCharSupportLocalGlyph(+n)||(o.glyphs[+n]=e[+n]);for(var i=0,a=u;ithis.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a=r&&e.x=i&&e.y0&&(u[new t.OverscaledTileID(e.overscaledZ,o,n.z,i,n.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,n.z,a,n.y-1).key]={backfilled:!1}),n.y+10&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",r))}}))},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setData=function(e){var n=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)n.fire(new t.ErrorEvent(e));else{var r={dataType:"source",sourceDataType:"content"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(r.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new t.Event("data",r))}})),this},n.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},n.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},n.prototype.getClusterLeaves=function(t,e,n,r){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:n},r),this},n.prototype._updateWorkerData=function(e){var n=this;this._loaded=!1;var r=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(r.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(i),this.actor.send(this.type+".loadData",r,(function(t,i){n._removed||i&&i.abandoned||(n._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[n.id]&&(n._resourceTiming=i.resourceTiming[n.id].slice(0)),n.actor.send(n.type+".coalesce",{source:r.source},null),e(t))}))},n.prototype.loaded=function(){return this._loaded},n.prototype.loadTile=function(e,n){var r=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var o={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};e.request=this.actor.send(i,o,(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?n(null):t?n(t):(e.loadVectorData(o,r.map.painter,"reloadTile"===i),n(null))}))},n.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},n.prototype.unloadTile=function(t){t.unloadVectorData(),t.clearMask(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},n.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},n.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},n.prototype.hasTransition=function(){return!1},n}(t.Evented),P=function(e){function n(t,n,r,i){e.call(this),this.id=t,this.dispatcher=r,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=n}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.load=function(e,n){var r=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,o){r._loaded=!0,i?r.fire(new t.ErrorEvent(i)):o&&(r.image=o,e&&(r.coordinates=e),n&&n(),r._finishLoading())}))},n.prototype.loaded=function(){return this._loaded},n.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},n.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setCoordinates=function(e){var n=this;this.coordinates=e;var r=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var n=1/0,r=1/0,i=-1/0,o=-1/0,a=0,s=e;an.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("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}},n.prototype.getVideo=function(){return this.video},n.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},n.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,n=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.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 t.Texture(e,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[r];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},n.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this.video&&!this.video.paused},n}(P),M=function(e){function n(n,r,i,o){e.call(this,n,r,i,o),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,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 t.ErrorEvent(new t.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},n.prototype.getCanvas=function(){return this.canvas},n.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},n.prototype.onRemove=function(){this.pause()},n.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var n=this.map.painter.context,r=n.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(n,this.canvas,r.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},n.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this._playing},n.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},z.prototype.has=function(t){return t.wrapped().key in this.data},z.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},z.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},z.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},z.prototype.remove=function(t,e){if(!this.has(t))return this;var n=t.wrapped().key,r=void 0===e?0:this.data[n].indexOf(e),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),0===this.data[n].length&&delete this.data[n],this.onRemove(i.value),this.order.splice(this.order.indexOf(n),1),this},z.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},z.prototype.filter=function(t){var e=[];for(var n in this.data)for(var r=0,i=this.data[n];r1||(Math.abs(n)>1&&(1===Math.abs(n+i)?n+=i:1===Math.abs(n-i)&&(n-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,n,r),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},n.prototype.getTile=function(t){return this.getTileByID(t.key)},n.prototype.getTileByID=function(t){return this._tiles[t]},n.prototype._retainLoadedChildren=function(t,e,n,r){for(var i in this._tiles){var o=this._tiles[i];if(!(r[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>n)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){r[a.key]=a;break}}}},n.prototype.findLoadedParent=function(t,e){for(var n=t.overscaledZ-1;n>=e;n--){var r=t.scaledTo(n);if(!r)return;var i=String(r.key),o=this._tiles[i];if(o&&o.hasData())return o;if(this._cache.has(r))return this._cache.get(r)}},n.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),n=Math.floor(5*e),r="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(r)},n.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,n=Math.round(e);if(this._prevLng=t,n){var r={};for(var i in this._tiles){var o=this._tiles[i];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+n),r[o.tileID.key]=o}for(var a in this._tiles=r,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var s in this._tiles){var u=this._tiles[s];this._setTileReloadTimer(s,u)}}},n.prototype.update=function(e){var r=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return r._source.hasTile(t)})))):i=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-n.maxOverzooming,this._source.minzoom),s=Math.max(o+n.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,o);if(Dt(this._source.type)){for(var c={},l={},h=0,p=Object.keys(u);hthis._source.maxzoom){var y=d.children(this._source.maxzoom)[0],g=this.getTile(y);if(g&&g.hasData()){r[y.key]=y;continue}}else{var v=d.children(this._source.maxzoom);if(r[v[0].key]&&r[v[1].key]&&r[v[2].key]&&r[v[3].key])continue}for(var _=m.wasRequested(),b=d.overscaledZ-1;b>=o;--b){var w=d.scaledTo(b);if(i[w.key])break;if(i[w.key]=!0,!(m=this.getTile(w))&&_&&(m=this._addTile(w)),m&&(r[w.key]=w,_=m.wasRequested(),m.hasData()))break}}}return r},n.prototype._addTile=function(e){var n=this._tiles[e.key];if(n)return n;(n=this._cache.getAndRemove(e))&&(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)));var r=Boolean(n);return r||(n=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,e.key,n.state))),n?(n.uses++,this._tiles[e.key]=n,r||this._source.fire(new t.Event("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n):null},n.prototype._setTileReloadTimer=function(t,e){var n=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout((function(){n._reloadTile(t,"expired"),delete n._timers[t]}),r))},n.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},n.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},n.prototype.tilesIn=function(e,n,r){var i=this,o=[],a=this.transform;if(!a)return o;for(var s=r?a.getCameraQueryGeometry(e):e,u=e.map((function(t){return a.pointCoordinate(t)})),c=s.map((function(t){return a.pointCoordinate(t)})),l=this.getIds(),h=1/0,p=1/0,f=-1/0,d=-1/0,m=0,y=c;m=0&&g[1].y+y>=0){var v=u.map((function(t){return s.getTilePoint(t)})),_=c.map((function(t){return s.getTilePoint(t)}));o.push({tile:r,tileID:s,queryGeometry:v,cameraQueryGeometry:_,scale:m})}}},_=0;_=t.browser.now())return!0}return!1},n.prototype.setFeatureState=function(t,e,n){t=t||"_geojsonTileLayer",this._state.updateState(t,e,n)},n.prototype.removeFeatureState=function(t,e,n){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,n)},n.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},n.prototype.setDependencies=function(t,e,n){var r=this._tiles[t];r&&r.setDependencies(e,n)},n.prototype.reloadTilesForDependencies=function(t,e){for(var n in this._tiles)this._tiles[n].hasDependency(t,e)&&this._reloadTile(n,"reloading");this._cache.filter((function(n){return!n.hasDependency(t,e)}))},n}(t.Evented);function Pt(t,e){return t%32-e%32||e-t}function Dt(t){return"raster"===t||"image"===t||"video"===t}function Mt(){return new t.window.Worker(si.workerUrl)}Ot.maxOverzooming=10,Ot.maxUnderzooming=3;var Rt=function(){this.active={}};Rt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length=-e[0]&&n<=e[0]&&r>=-e[1]&&r<=e[1]}function Jt(e,n,r,i,o,a,s,u){var c=i?e.textSizeData:e.iconSizeData,l=t.evaluateSizeForZoom(c,r.transform.zoom),h=[256/r.width*2+1,256/r.height*2+1],p=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var f=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=r.transform.width/r.transform.height,y=!1,g=0;gMath.abs(r.x-n.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?n.yr.x)?{needsFlipping:!0}:null}function ee(e,n,r,i,o,a,s,u,c,l,h,p,f,d){var m,y=n/24,g=e.lineOffsetX*y,v=e.lineOffsetY*y;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,w=e.lineStartIndex+e.lineLength,x=$t(y,u,g,v,r,h,p,e,c,a,f,!1);if(!x)return{notEnoughRoom:!0};var E=Yt(x.first.point,s).point,T=Yt(x.last.point,s).point;if(i&&!r){var S=te(e.writingMode,E,T,d);if(S)return S}m=[x.first];for(var C=e.glyphStartIndex+1;C<_-1;C++)m.push(re(y*u.getoffsetX(C),g,v,r,h,p,e.segment,b,w,c,a,f,!1));m.push(x.last)}else{if(i&&!r){var I=Yt(p,o).point,k=e.lineStartIndex+e.segment+1,A=new t.Point(c.getx(k),c.gety(k)),O=Yt(A,o),P=O.signedDistanceFromCamera>0?O.point:ne(p,A,I,1,o),D=te(e.writingMode,I,P,d);if(D)return D}var M=re(y*u.getoffsetX(e.glyphStartIndex),g,v,r,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,a,f,!1);if(!M)return{notEnoughRoom:!0};m=[M]}for(var R=0,N=m;R0?1:-1,y=0;i&&(m*=-1,y=Math.PI),m<0&&(y+=Math.PI);for(var g=m>0?u+s:u+s+1,v=g,_=o,b=o,w=0,x=0,E=Math.abs(d);w+x<=E;){if((g+=m)=c)return null;if(b=_,void 0===(_=p[g])){var T=new t.Point(l.getx(g),l.gety(g)),S=Yt(T,h);if(S.signedDistanceFromCamera>0)_=p[g]=S.point;else{var C=g-m;_=ne(0===w?a:new t.Point(l.getx(C),l.gety(C)),T,b,E-w+1,h)}}w+=x,x=b.dist(_)}var I=(E-w)/x,k=_.sub(b),A=k.mult(I)._add(b);return A._add(k._unit()._perp()._mult(r*m)),{point:A,angle:y+Math.atan2(_.y-b.y,_.x-b.x),tileDistance:f?{prevTileDistance:g-m===v?0:l.gettileUnitDistanceFromAnchor(g-m),lastSegmentViewportDistance:E-w}:null}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,n,r,i){this._forEachCell(e,n,r,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)},Kt.prototype.insertCircle=function(t,e,n,r){this._forEachCell(e-r,n-r,e+r,n+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(n),this.circles.push(r)},Kt.prototype._insertBoxCell=function(t,e,n,r,i,o){this.boxCells[i].push(o)},Kt.prototype._insertCircleCell=function(t,e,n,r,i,o){this.circleCells[i].push(o)},Kt.prototype._query=function(t,e,n,r,i,o){if(n<0||t>this.width||r<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=n&&this.height<=r){if(i)return!0;for(var s=0;s0:a},Kt.prototype._queryCircle=function(t,e,n,r,i){var o=t-n,a=t+n,s=e-n,u=e+n;if(a<0||o>this.width||u<0||s>this.height)return!r&&[];var c=[],l={hitTest:r,circle:{x:t,y:e,radius:n},seenUids:{box:{},circle:{}}};return this._forEachCell(o,s,a,u,this._queryCellCircle,c,l,i),r?c.length>0:c},Kt.prototype.query=function(t,e,n,r,i){return this._query(t,e,n,r,!1,i)},Kt.prototype.hitTest=function(t,e,n,r,i){return this._query(t,e,n,r,!0,i)},Kt.prototype.hitTestCircle=function(t,e,n,r){return this._queryCircle(t,e,n,!0,r)},Kt.prototype._queryCell=function(t,e,n,r,i,o,a,s){var u=a.seenUids,c=this.boxCells[i];if(null!==c)for(var l=this.bboxes,h=0,p=c;h=l[d+0]&&r>=l[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:l[d],y1:l[d+1],x2:l[d+2],y2:l[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var y=this.circles,g=0,v=m;ga*a+s*s},Kt.prototype._circleAndRectCollide=function(t,e,n,r,i,o,a){var s=(o-r)/2,u=Math.abs(t-(r+s));if(u>s+n)return!1;var c=(a-i)/2,l=Math.abs(e-(i+c));if(l>c+n)return!1;if(u<=s||l<=c)return!0;var h=u-s,p=l-c;return h*h+p*p<=n*n};var ie=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function oe(t,e){for(var n=0;nI)ue(e,k,!1);else{var M=this.projectPoint(c,A,O),R=P*T;if(d.length>0){var N=M.x-d[d.length-4],L=M.y-d[d.length-3];if(R*R*2>N*N+L*L&&k+8-C&&F=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},se.prototype.isInsideGrid=function(t,e,n,r){return n>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(m=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:y,width:n,height:r,anchor:t,textBoxScale:i,prevAnchor:m},this.markUsedJustification(p,t,h,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,h),this.placedOrientations[h.crossTileID]=f),{shift:g,placedGlyphBoxes:v}):void 0},ge.prototype.placeLayerBucket=function(e,n,r,i,o,a,s,u,c,l){var h=this,p=e.layers[0].layout,f=t.evaluateSizeForZoom(e.textSizeData,this.transform.zoom),d=p.get("text-optional"),m=p.get("icon-optional"),y=p.get("text-allow-overlap"),g=p.get("icon-allow-overlap"),v=y&&(g||!e.hasIconData()||m),_=g&&(y||!e.hasTextData()||d),b=this.collisionGroups.get(e.sourceID),w="map"===p.get("text-rotation-alignment"),x="map"===p.get("text-pitch-alignment"),E="none"!==p.get("icon-text-fit"),T="viewport-y"===p.get("symbol-z-order");!e.collisionArrays&&l&&e.deserializeCollisionBoxes(l);var S=function(i,l){if(!c[i.crossTileID])if(u)h.placements[i.crossTileID]=new pe(!1,!1,!1);else{var T,S=!1,C=!1,I=!0,k=null,A={box:null,offscreen:null},O={box:null,offscreen:null},P=null,D=null,M=0,R=0,N=0;l.textFeatureIndex&&(M=l.textFeatureIndex),l.verticalTextFeatureIndex&&(R=l.verticalTextFeatureIndex);var L=l.textBox;if(L){var F=function(n){var r=t.WritingMode.horizontal;if(e.allowVerticalPlacement&&!n&&h.prevPlacement){var o=h.prevPlacement.placedOrientations[i.crossTileID];o&&(h.placedOrientations[i.crossTileID]=o,r=o,h.markUsedOrientation(e,r,i))}return r},j=function(n,r){if(e.allowVerticalPlacement&&i.numVerticalGlyphVertices>0&&l.verticalTextBox)for(var o=0,a=e.writingModes;o0&&(z=z.filter((function(t){return t!==B.anchor}))).unshift(B.anchor)}var U=function(t,r,o){for(var s=t.x2-t.x1,u=t.y2-t.y1,c=i.textBoxScale,l=E&&!g?r:null,p={box:[],offscreen:!1},f=y?2*z.length:z.length,d=0;d=z.length,_=h.attemptAnchorPlacement(m,t,s,u,c,w,x,a,n,b,v,i,e,o,l);if(_&&(p=_.placedGlyphBoxes)&&p.box&&p.box.length){S=!0,k=_.shift;break}}return p};j((function(){return U(L,l.iconBox,t.WritingMode.horizontal)}),(function(){var n=l.verticalTextBox,r=A&&A.box&&A.box.length;return e.allowVerticalPlacement&&!r&&i.numVerticalGlyphVertices>0&&n?U(n,l.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),A&&(S=A.box,I=A.offscreen);var V=F(A&&A.box);if(!S&&h.prevPlacement){var q=h.prevPlacement.variableOffsets[i.crossTileID];q&&(h.variableOffsets[i.crossTileID]=q,h.markUsedJustification(e,q.anchor,i,V))}}else{var W=function(t,r){var o=h.collisionIndex.placeCollisionBox(t,p.get("text-allow-overlap"),a,n,b.predicate);return o&&o.box&&o.box.length&&(h.markUsedOrientation(e,r,i),h.placedOrientations[i.crossTileID]=r),o};j((function(){return W(L,t.WritingMode.horizontal)}),(function(){var n=l.verticalTextBox;return e.allowVerticalPlacement&&i.numVerticalGlyphVertices>0&&n?W(n,t.WritingMode.vertical):{box:null,offscreen:null}})),F(A&&A.box&&A.box.length)}}S=(T=A)&&T.box&&T.box.length>0,I=T&&T.offscreen;var G=l.textCircles;if(G){var H=e.text.placedSymbolArray.get(i.centerJustifiedTextSymbolIndex),K=t.evaluateSizeForFeature(e.textSizeData,f,H);P=h.collisionIndex.placeCollisionCircles(G,p.get("text-allow-overlap"),o,a,H,e.lineVertexArray,e.glyphOffsetArray,K,n,r,s,x,b.predicate),S=p.get("text-allow-overlap")||P.circles.length>0,I=I&&P.offscreen}if(l.iconFeatureIndex&&(N=l.iconFeatureIndex),l.iconBox){var Q=function(t){var e=E&&k?ye(t,k.x,k.y,w,x,h.transform.angle):t;return h.collisionIndex.placeCollisionBox(e,p.get("icon-allow-overlap"),a,n,b.predicate)};C=O&&O.box&&O.box.length&&l.verticalIconBox?(D=Q(l.verticalIconBox)).box.length>0:(D=Q(l.iconBox)).box.length>0,I=I&&D.offscreen}var X=d||0===i.numHorizontalGlyphVertices&&0===i.numVerticalGlyphVertices,Y=m||0===i.numIconVertices;X||Y?Y?X||(C=C&&S):S=C&&S:C=S=C&&S,S&&T&&T.box&&(O&&O.box&&R?h.collisionIndex.insertCollisionBox(T.box,p.get("text-ignore-placement"),e.bucketInstanceId,R,b.ID):h.collisionIndex.insertCollisionBox(T.box,p.get("text-ignore-placement"),e.bucketInstanceId,M,b.ID)),C&&D&&h.collisionIndex.insertCollisionBox(D.box,p.get("icon-ignore-placement"),e.bucketInstanceId,N,b.ID),S&&P&&h.collisionIndex.insertCollisionCircles(P.circles,p.get("text-ignore-placement"),e.bucketInstanceId,M,b.ID),h.placements[i.crossTileID]=new pe(S||v,C||_,I||e.justReloaded),c[i.crossTileID]=!0}};if(T)for(var C=e.getSortedSymbolIndexes(this.transform.angle),I=C.length-1;I>=0;--I){var k=C[I];S(e.symbolInstances.get(k),e.collisionArrays[k])}else for(var A=0;A=0&&(e.text.placedSymbolArray.get(c).crossTileID=o>=0&&c!==o?0:r.crossTileID)}},ge.prototype.markUsedOrientation=function(e,n,r){for(var i=n===t.WritingMode.horizontal||n===t.WritingMode.horizontalOnly?n:0,o=n===t.WritingMode.vertical?n:0,a=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];a0||u>0,_=o.numIconVertices>0,b=i.placedOrientations[o.crossTileID],w=b===t.WritingMode.vertical,x=b===t.WritingMode.horizontal||b===t.WritingMode.horizontalOnly;if(v){var E=Ce(g.text),T=w?Ie:E;d(e.text,s,T);var S=x?Ie:E;d(e.text,u,S);var C=g.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=C||w?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=C||x?1:0);var I=i.variableOffsets[o.crossTileID];I&&i.markUsedJustification(e,I.anchor,o,b);var k=i.placedOrientations[o.crossTileID];k&&(i.markUsedJustification(e,"left",o,k),i.markUsedOrientation(e,k,o))}if(_){var A=Ce(g.icon),O=!(p&&o.verticalPlacedIconSymbolIndex&&w);if(o.placedIconSymbolIndex>=0){var P=O?A:Ie;d(e.icon,o.numIconVertices,P),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=g.icon.isHidden()}if(o.verticalPlacedIconSymbolIndex>=0){var D=O?Ie:A;d(e.icon,o.numVerticalIconVertices,D),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasIconCollisionCircleData()||e.hasTextCollisionBoxData()||e.hasTextCollisionCircleData()){var M=e.collisionArrays[r];if(M){var R=new t.Point(0,0);if(M.textBox||M.verticalTextBox){var N=!0;if(c){var L=i.variableOffsets[m];L?(R=me(L.anchor,L.width,L.height,L.textOffset,L.textBoxScale),l&&R._rotate(h?i.transform.angle:-i.transform.angle)):N=!1}M.textBox&&ve(e.textCollisionBox.collisionVertexArray,g.text.placed,!N||w,R.x,R.y),M.verticalTextBox&&ve(e.textCollisionBox.collisionVertexArray,g.text.placed,!N||x,R.x,R.y)}var F=Boolean(!x&&M.verticalIconBox);M.iconBox&&ve(e.iconCollisionBox.collisionVertexArray,g.icon.placed,F,p?R.x:0,p?R.y:0),M.verticalIconBox&&ve(e.iconCollisionBox.collisionVertexArray,g.icon.placed,!F,p?R.x:0,p?R.y:0);var j=M.textCircles;if(j&&e.hasTextCollisionCircleData())for(var z=0;zt},ge.prototype.setStale=function(){this.stale=!0};var _e=Math.pow(2,25),be=Math.pow(2,24),we=Math.pow(2,17),xe=Math.pow(2,16),Ee=Math.pow(2,9),Te=Math.pow(2,8),Se=Math.pow(2,1);function Ce(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,n=Math.floor(127*t.opacity);return n*_e+e*be+n*we+e*xe+n*Ee+e*Te+n*Se+e}var Ie=0,ke=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};ke.prototype.continuePlacement=function(t,e,n,r,i){for(;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=n[e[this._currentPlacementIndex]],u=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(this._inProgressLayer||(this._inProgressLayer=new ke),this._inProgressLayer.continuePlacement(r[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Ae.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Oe=512/t.EXTENT/2,Pe=function(t,e,n){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var r=0;rt.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,i)}else{var c=a[t.scaledTo(Number(o)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var l=0;l1?"@2x":"",u=t.getJSON(n.transformRequest(n.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,a||(a=t,i=e,l())})),c=t.getImage(n.transformRequest(n.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,a||(a=t,o=e,l())}));function l(){if(a)r(a);else if(i&&o){var e=t.browser.getImageData(o),n={};for(var s in i){var u=i[s],c=u.width,l=u.height,h=u.x,p=u.y,f=u.sdf,d=u.pixelRatio,m=u.stretchX,y=u.stretchY,g=u.content,v=new t.RGBAImage({width:c,height:l});t.RGBAImage.copy(e,v,{x:h,y:p},{x:0,y:0},{width:c,height:l}),n[s]={data:v,pixelRatio:d,sdf:f,stretchX:m,stretchY:y,content:g}}r(null,n)}}return{cancel:function(){u&&(u.cancel(),u=null),c&&(c.cancel(),c=null)}}}(e.sprite,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r.dispatcher.broadcast("setImages",r.imageManager.listImages()),r.fire(new t.Event("data",{dataType:"style"}))})):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var o=jt(this.stylesheet.layers);this._order=o.map((function(t){return t.id})),this._layers={};for(var a=0,s=o;a0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return r.forEach((function(t){"setTransition"!==t.command&&n[t.command].apply(n,t.args)})),this.stylesheet=e,!0},n.prototype.addImage=function(e,n){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,n),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},n.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},n.prototype.getImage=function(t){return this.imageManager.getImage(t)},n.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},n.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},n.prototype.addSource=function(e,n,r){var i=this;if(void 0===r&&(r={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!n.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(n).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(n.type)>=0)||!this._validate(t.validateStyle.source,"sources."+e,n,null,r)){this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);var o=this.sourceCaches[e]=new Ot(e,n,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},n.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var n in this._layers)if(this._layers[n].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+n+'" is using it.')));var r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.onRemove(this.map),this._changed=!0},n.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},n.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},n.prototype.addLayer=function(e,n,r){void 0===r&&(r={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var o;if("custom"===e.type){if(Ne(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},r))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}})}var a=n?this._order.indexOf(n):this._order.length;if(n&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" does not exist on this map.')));else{if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},n.prototype.moveLayer=function(e,n){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==n){var r=this._order.indexOf(e);this._order.splice(r,1);var i=n?this._order.indexOf(n):this._order.length;n&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},n.prototype.removeLayer=function(e){this._checkLoaded();var n=this._layers[e];if(n){n.setEventedParent(null);var r=this._order.indexOf(e);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=n,delete this._layers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],n.onRemove&&n.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},n.prototype.getLayer=function(t){return this._layers[t]},n.prototype.setLayerZoomRange=function(e,n,r){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===n&&i.maxzoom===r||(null!=n&&(i.minzoom=n),null!=r&&(i.maxzoom=r),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},n.prototype.setFilter=function(e,n,r){void 0===r&&(r={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,n))return null==n?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",n,null,r)||(i.filter=t.clone$1(n),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},n.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},n.prototype.setLayoutProperty=function(e,n,r,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(n),r)||(o.setLayoutProperty(n,r,i),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},n.prototype.getLayoutProperty=function(e,n){var r=this.getLayer(e);if(r)return r.getLayoutProperty(n);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},n.prototype.setPaintProperty=function(e,n,r,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(n),r)||(o.setPaintProperty(n,r,i)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},n.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},n.prototype.setFeatureState=function(e,n){this._checkLoaded();var r=e.source,i=e.sourceLayer,o=this.sourceCaches[r],a=parseInt(e.id,10);if(void 0!==o){var s=o.getSource().type;"geojson"===s&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==s||i?isNaN(a)||a<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative."))):o.setFeatureState(i,a,n):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},n.prototype.removeFeatureState=function(e,n){this._checkLoaded();var r=e.source,i=this.sourceCaches[r];if(void 0!==i){var o=i.getSource().type,a="vector"===o?e.sourceLayer:void 0,s=parseInt(e.id,10);"vector"!==o||a?void 0!==e.id&&isNaN(s)||s<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be non-negative."))):n&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(a,s,n):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},n.prototype.getFeatureState=function(e){this._checkLoaded();var n=e.source,r=e.sourceLayer,i=this.sourceCaches[n],o=parseInt(e.id,10);if(void 0!==i)if("vector"!==i.getSource().type||r){if(!(isNaN(o)||o<0))return i.getFeatureState(r,o);this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative.")))}else this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},n.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},n.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},n.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},n.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,n=function(t){return"fill-extrusion"===e._layers[t].type},r={},i=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(n(a)){r[a]=o;for(var s=0,u=t;s=0;d--){var m=this._order[d];if(n(m))for(var y=i.length-1;y>=0;y--){var g=i[y].feature;if(r[g.layer.id] 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_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Qe=fn("uniform float u_overscale_factor;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {float alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {color=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {color*=.2;}float extrude_scale_length=length(v_extrude_scale);float extrude_length=length(v_extrude)*extrude_scale_length;float stroke_width=15.0*extrude_scale_length/u_overscale_factor;float radius=v_radius*extrude_scale_length;float distance_to_edge=abs(extrude_length-radius);float opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);gl_FragColor=opacity_t*color;}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);highp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;v_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;v_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;}"),Xe=fn("uniform highp vec4 u_color;void main() {gl_FragColor=u_color;}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Ye=fn("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),Ze=fn("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),Je=fn("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec4 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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;}"),$e=fn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec4 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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);}"),tn=fn("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);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;}"),en=fn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec4 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;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);base=max(0.0,base);height=max(0.0,height);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\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/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;}"),nn=fn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;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 exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),rn=fn("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;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),on=fn("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;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;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;v_width2=vec2(outset,inset);}"),an=fn("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 float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute 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_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;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;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;v_width2=vec2(outset,inset);}"),sn=fn("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec4 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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 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,1.0);float x_b=mod(v_linesofar/pattern_size_b.x,1.0);float y_a=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_a.y+2.0)/2.0)/pattern_size_a.y);float y_b=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_b.y+2.0)/2.0)/pattern_size_b.y);vec2 pos_a=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,vec2(x_a,y_a));vec2 pos_b=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,vec2(x_b,y_b));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute 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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;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;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;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);}"),un=fn("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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute 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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;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;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;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);}"),cn=fn("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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform 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;}"),ln=fn("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;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;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_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;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;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(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=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}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=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);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;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),hn=fn("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;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 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;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(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=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}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=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),pn=fn("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;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;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_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;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;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(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=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}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=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,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);}");function fn(t,e){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r={};return{fragmentSource:t=t.replace(n,(function(t,e,n,i,o){return r[o]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+n+" "+i+" "+o+";\n#else\nuniform "+n+" "+i+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n"})),vertexSource:e=e.replace(n,(function(t,e,n,i,o){var a="float"===i?"vec2":"vec4",s=o.match(/color/)?"color":a;return r[o]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+n+" "+a+" a_"+o+";\nvarying "+n+" "+i+" "+o+";\n#else\nuniform "+n+" "+i+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = a_"+o+";\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+s+"(a_"+o+", u_"+o+"_t);\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+n+" "+a+" a_"+o+";\n#else\nuniform "+n+" "+i+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+n+" "+i+" "+o+" = a_"+o+";\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+n+" "+i+" "+o+" = unpack_mix_"+s+"(a_"+o+", u_"+o+"_t);\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n"}))}}var dn=Object.freeze({__proto__:null,prelude:Be,background:Ue,backgroundPattern:Ve,circle:qe,clippingMask:We,heatmap:Ge,heatmapTexture:He,collisionBox:Ke,collisionCircle:Qe,debug:Xe,fill:Ye,fillOutline:Ze,fillOutlinePattern:Je,fillPattern:$e,fillExtrusion:tn,fillExtrusionPattern:en,hillshadePrepare:nn,hillshade:rn,line:on,lineGradient:an,linePattern:sn,lineSDF:un,raster:cn,symbolIcon:ln,symbolSDF:hn,symbolTextAndIcon:pn}),mn=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};mn.prototype.bind=function(t,e,n,r,i,o,a,s){this.context=t;for(var u=this.boundPaintVertexBuffers.length!==r.length,c=0;!u&&c>16,u>>16],u_pixel_coord_lower:[65535&s,65535&u]}}yn.prototype.draw=function(t,e,n,r,i,o,a,s,u,c,l,h,p,f,d,m){var y,g=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(n),t.setStencilMode(r),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[v].set(a[v]);f&&f.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var _=(y={},y[g.LINES]=2,y[g.TRIANGLES]=3,y[g.LINE_STRIP]=1,y)[e],b=0,w=l.get();b0?1-1/(1.001-a):-a),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:Bn(i.paint.get("raster-hue-rotate"))};var o,a};function Bn(t){t*=Math.PI/180;var e=Math.sin(t),n=Math.cos(t);return[(2*n+1)/3,(-Math.sqrt(3)*e-n+1)/3,(Math.sqrt(3)*e-n+1)/3]}var Un=function(t,e,n,r,i,o,a,s,u,c){var l=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:l.cameraToCenterDistance,u_pitch:l.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:l.width/l.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+r,u_texsize:c,u_texture:0}},Vn=function(e,n,r,i,o,a,s,u,c,l,h){var p=o.transform;return t.extend(Un(e,n,r,i,o,a,s,u,c,l),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},qn=function(e,n,r,i,o,a,s,u,c,l){return t.extend(Vn(e,n,r,i,o,a,s,u,!0,c,!0),{u_texsize_icon:l,u_texture_icon:1})},Wn=function(t,e,n){return{u_matrix:t,u_opacity:e,u_color:n}},Gn=function(e,n,r,i,o,a){return t.extend(function(t,e,n,r){var i=n.imageManager.getPattern(t.from.toString()),o=n.imageManager.getPattern(t.to.toString()),a=n.imageManager.getPixelSize(),s=a.width,u=a.height,c=Math.pow(2,r.tileID.overscaledZ),l=r.tileSize*Math.pow(2,n.transform.tileZoom)/c,h=l*(r.tileID.canonical.x+r.tileID.wrap*c),p=l*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/ce(r,1,n.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(i,a,r,o),{u_matrix:e,u_opacity:n})},Hn={fillExtrusion:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_lightpos:new t.Uniform3f(e,n.u_lightpos),u_lightintensity:new t.Uniform1f(e,n.u_lightintensity),u_lightcolor:new t.Uniform3f(e,n.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,n.u_vertical_gradient),u_opacity:new t.Uniform1f(e,n.u_opacity)}},fillExtrusionPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_lightpos:new t.Uniform3f(e,n.u_lightpos),u_lightintensity:new t.Uniform1f(e,n.u_lightintensity),u_lightcolor:new t.Uniform3f(e,n.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,n.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,n.u_height_factor),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade),u_opacity:new t.Uniform1f(e,n.u_opacity)}},fill:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},fillPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},fillOutline:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world)}},fillOutlinePattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},circle:function(e,n){return{u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,n.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,n.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},collisionBox:Sn,collisionCircle:Sn,debug:function(e,n){return{u_color:new t.UniformColor(e,n.u_color),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},clippingMask:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},heatmap:function(e,n){return{u_extrude_scale:new t.Uniform1f(e,n.u_extrude_scale),u_intensity:new t.Uniform1f(e,n.u_intensity),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},heatmapTexture:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world),u_image:new t.Uniform1i(e,n.u_image),u_color_ramp:new t.Uniform1i(e,n.u_color_ramp),u_opacity:new t.Uniform1f(e,n.u_opacity)}},hillshade:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_latrange:new t.Uniform2f(e,n.u_latrange),u_light:new t.Uniform2f(e,n.u_light),u_shadow:new t.UniformColor(e,n.u_shadow),u_highlight:new t.UniformColor(e,n.u_highlight),u_accent:new t.UniformColor(e,n.u_accent)}},hillshadePrepare:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_dimension:new t.Uniform2f(e,n.u_dimension),u_zoom:new t.Uniform1f(e,n.u_zoom),u_maxzoom:new t.Uniform1f(e,n.u_maxzoom),u_unpack:new t.Uniform4f(e,n.u_unpack)}},line:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels)}},lineGradient:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_image:new t.Uniform1i(e,n.u_image)}},linePattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_texsize:new t.Uniform2f(e,n.u_texsize),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_image:new t.Uniform1i(e,n.u_image),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_scale:new t.Uniform4f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},lineSDF:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,n.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,n.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,n.u_sdfgamma),u_image:new t.Uniform1i(e,n.u_image),u_tex_y_a:new t.Uniform1f(e,n.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,n.u_tex_y_b),u_mix:new t.Uniform1f(e,n.u_mix)}},raster:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_tl_parent:new t.Uniform2f(e,n.u_tl_parent),u_scale_parent:new t.Uniform1f(e,n.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,n.u_buffer_scale),u_fade_t:new t.Uniform1f(e,n.u_fade_t),u_opacity:new t.Uniform1f(e,n.u_opacity),u_image0:new t.Uniform1i(e,n.u_image0),u_image1:new t.Uniform1i(e,n.u_image1),u_brightness_low:new t.Uniform1f(e,n.u_brightness_low),u_brightness_high:new t.Uniform1f(e,n.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,n.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,n.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,n.u_spin_weights)}},symbolIcon:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1f(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texture:new t.Uniform1i(e,n.u_texture)}},symbolSDF:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1f(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texture:new t.Uniform1i(e,n.u_texture),u_gamma_scale:new t.Uniform1f(e,n.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_is_halo:new t.Uniform1f(e,n.u_is_halo)}},symbolTextAndIcon:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1f(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texsize_icon:new t.Uniform2f(e,n.u_texsize_icon),u_texture:new t.Uniform1i(e,n.u_texture),u_texture_icon:new t.Uniform1i(e,n.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,n.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_is_halo:new t.Uniform1f(e,n.u_is_halo)}},background:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_opacity:new t.Uniform1f(e,n.u_opacity),u_color:new t.UniformColor(e,n.u_color)}},backgroundPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_opacity:new t.Uniform1f(e,n.u_opacity),u_image:new t.Uniform1i(e,n.u_image),u_pattern_tl_a:new t.Uniform2f(e,n.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,n.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,n.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,n.u_pattern_br_b),u_texsize:new t.Uniform2f(e,n.u_texsize),u_mix:new t.Uniform1f(e,n.u_mix),u_pattern_size_a:new t.Uniform2f(e,n.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,n.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,n.u_scale_a),u_scale_b:new t.Uniform1f(e,n.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,n.u_tile_units_to_pixels)}}};function Kn(e,n){for(var r=e.sort((function(t,e){return t.tileID.isLessThan(e.tileID)?-1:e.tileID.isLessThan(t.tileID)?1:0})),i=0;i=0&&(m[g.associatedIconIndex]={shiftedAnchor:I,angle:k})}else oe(g.numGlyphs,f)}if(h){d.clear();for(var O=e.icon.placedSymbolArray,P=0;P0){var s=t.browser.now(),u=(s-e.timeAdded)/a,c=n?(s-n.timeAdded)/a:-1,l=r.getSource(),h=o.coveringZoomLevel({tileSize:l.tileSize,roundZoom:l.roundZoom}),p=!n||Math.abs(n.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),f=p&&e.refreshedUponExpiration?1:t.clamp(p?u:1-c,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),n?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}function ur(e,n,r){var i=e.context,o=i.gl,a=r.posMatrix,s=e.useProgram("debug"),u=St.disabled,c=Ct.disabled,l=e.colorModeForRenderPass(),h="$debug";s.draw(i,o.LINE_STRIP,u,c,l,kt.disabled,In(a,t.Color.red),h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var p=n.getTileByID(r.key).latestRawTileData,f=p&&p.byteLength||0,d=Math.floor(f/1024),m=n.getTile(r).tileSize,y=512/Math.min(m,512),g=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(g+=" => "+r.overscaledZ);for(var v=function(t,e,n,r){r=r||1;var i,o,a,s,u,c,l,h,p=[];for(i=0,o=t.length;i":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]},lr={symbol:function(e,n,r,i,o){if("translucent"===e.renderPass){var a=Ct.disabled,s=e.colorModeForRenderPass();r.layout.get("text-variable-anchor")&&function(e,n,r,i,o,a,s){for(var u=n.transform,c="map"===o,l="map"===a,h=0,p=e;he.y){var n=t;t=e,e=n}return{x0:t.x,y0:t.y,x1:e.x,y1:e.y,dx:e.x-t.x,dy:e.y-t.y}}function fr(t,e,n,r,i){var o=Math.max(n,Math.floor(e.y0)),a=Math.min(r,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,h=e.dx<0,p=o;pu.dy&&(a=s,s=u,u=a),s.dy>c.dy&&(a=s,s=c,c=a),u.dy>c.dy&&(a=u,u=c,c=a),s.dy&&fr(c,s,r,i,o),u.dy&&fr(c,u,r,i,o)}hr.prototype.resize=function(e,n){var r=this.context.gl;if(this.width=e*t.browser.devicePixelRatio,this.height=n*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,o=this.style._order;i256&&this.clearStencil(),n.setColorMode(It.disabled),n.setDepthMode(St.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Ct({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},hr.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Ct({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},hr.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new It([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?It.unblended:It.alphaBlended},hr.prototype.depthModeForSublayer=function(t,e,n){if(!this.opaquePassEnabledForLayer())return St.disabled;var r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new St(n||this.context.gl.LEQUAL,e,[r,r])},hr.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer=0;this.currentLayer--){var A=this.style._layers[i[this.currentLayer]],O=o[A.source],P=l[A.source];this._renderTileClippingMasks(A,P),this.renderLayer(this,O,A,P)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},hr.prototype.isPatternMissing=function(t){if(!t)return!1;var e=this.imageManager.getPattern(t.from.toString()),n=this.imageManager.getPattern(t.to.toString());return!e||!n},hr.prototype.useProgram=function(t,e){void 0===e&&(e=this.emptyProgramConfiguration),this.cache=this.cache||{};var n=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new yn(this.context,dn[t],e,Hn[t],this._showOverdrawInspector)),this.cache[n]},hr.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},hr.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)};var mr=function(e,n,r,i,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=n||22,this._minPitch=null==r?0:r,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}},yr={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};mr.prototype.clone=function(){var t=new mr(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._calcMatrices(),t},yr.minZoom.get=function(){return this._minZoom},yr.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},yr.maxZoom.get=function(){return this._maxZoom},yr.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},yr.minPitch.get=function(){return this._minPitch},yr.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},yr.maxPitch.get=function(){return this._maxPitch},yr.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},yr.renderWorldCopies.get=function(){return this._renderWorldCopies},yr.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},yr.worldSize.get=function(){return this.tileSize*this.scale},yr.centerPoint.get=function(){return this.size._div(2)},yr.size.get=function(){return new t.Point(this.width,this.height)},yr.bearing.get=function(){return-this.angle/Math.PI*180},yr.bearing.set=function(e){var n=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},yr.pitch.get=function(){return this._pitch/Math.PI*180},yr.pitch.set=function(e){var n=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())},yr.fov.get=function(){return this._fov/Math.PI*180},yr.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},yr.zoom.get=function(){return this._zoom},yr.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},yr.center.get=function(){return this._center},yr.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},mr.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},mr.prototype.getVisibleUnwrappedCoordinates=function(e){var n=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(r.x,i.x,o.x,a.x)),u=Math.floor(Math.max(r.x,i.x,o.x,a.x)),c=s-1;c<=u+1;c++)0!==c&&n.push(new t.UnwrappedTileID(c,e));return n},mr.prototype.coveringTiles=function(e){var n=this.coveringZoomLevel(e),r=n;if(void 0!==e.minzoom&&ne.maxzoom&&(n=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,n),a=new t.Point(o*i.x-.5,o*i.y-.5);return function(e,n,r,i){void 0===i&&(i=!0);var o=1<=0&&u<=o)for(c=n;ca&&(i=a-y)}if(this.lngRange){var g=f.x,v=c.x/2;g-vu&&(r=u-v)}void 0===r&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==r?r:f.x,void 0!==i?i:f.y))),this._unmodified=l,this._constraining=!1}},mr.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=this._fov/2,n=Math.PI/2+this._pitch,r=Math.sin(e)*this.cameraToCenterDistance/Math.sin(Math.PI-n-e),i=this.point,o=i.x,a=i.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),u=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,u,s),t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-o,-a,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c;var l=this.width%2/2,h=this.height%2/2,p=Math.cos(this.angle),f=Math.sin(this.angle),d=o-Math.round(o)+p*l+f*h,m=a-Math.round(a)+p*h+f*l,y=new Float64Array(c);if(t.translate(y,y,[d>.5?d-1:d,m>.5?m-1:m,0]),this.alignedProjMatrix=y,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},mr.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance},mr.prototype.getCameraPoint=function(){var e=this._pitch,n=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,n))},mr.prototype.getCameraQueryGeometry=function(e){var n=this.getCameraPoint();if(1===e.length)return[e[0],n];for(var r=n.x,i=n.y,o=n.x,a=n.y,s=0,u=e;s=3&&!t.some((function(t){return isNaN(t)}))&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},gr.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var vr=function(e){function r(r,i,o,a){void 0===a&&(a={});var s=n.mousePos(i.getCanvasContainer(),o),u=i.unproject(s);e.call(this,r,t.extend({point:s,lngLat:u,originalEvent:o},a)),this._defaultPrevented=!1,this.target=i}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,i),r}(t.Event),_r=function(e){function r(r,i,o){var a=n.touchPos(i.getCanvasContainer(),o),s=a.map((function(t){return i.unproject(t)})),u=a.reduce((function(t,e,n,r){return t.add(e.div(r.length))}),new t.Point(0,0)),c=i.unproject(u);e.call(this,r,{points:a,point:u,lngLats:s,lngLat:c,originalEvent:o}),this._defaultPrevented=!1}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,i),r}(t.Event),br=function(t){function e(e,n,r){t.call(this,e,{originalEvent:r}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,n),e}(t.Event),wr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};wr.prototype.setZoomRate=function(t){this._defaultZoomRate=t},wr.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},wr.prototype.isEnabled=function(){return!!this._enabled},wr.prototype.isActive=function(){return!!this._active},wr.prototype.isZooming=function(){return!!this._zooming},wr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},wr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},wr.prototype.onWheel=function(e){if(this.isEnabled()){var n=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,r=t.browser.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==n&&n%4.000244140625==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*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.isActive()||this._start(e)),e.preventDefault()}},wr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},wr.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e}))),this._finishTimeout&&clearTimeout(this._finishTimeout);var r=n.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},wr.prototype._onScrollFrame=function(){var e=this;if(this._frameId=null,this.isActive()){var n=this._map.transform;if(0!==this._delta){var r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?n.zoomScale(this._targetZoom):n.scale;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=n.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a="number"==typeof this._targetZoom?this._targetZoom:n.zoom,s=this._startZoom,u=this._easing,c=!1;if("wheel"===this._type&&s&&u){var l=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=u(l);n.zoom=t.number(s,a,h),l<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):c=!0}else n.zoom=a,c=!0;n.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom}),200))}},wr.prototype._smoothOutEasing=function(e){var n=t.ease;if(this._prevEase){var r=this._prevEase,i=(t.browser.now()-r.start)/r.duration,o=r.easing(i+.01)-r.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);n=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:n},n};var xr=function(e,n){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=n.clickTolerance||1,t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};xr.prototype.isEnabled=function(){return!!this._enabled},xr.prototype.isActive=function(){return!!this._active},xr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},xr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},xr.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.window.document.addEventListener("mousemove",this._onMouseMove,!1),t.window.document.addEventListener("keydown",this._onKeyDown,!1),t.window.document.addEventListener("mouseup",this._onMouseUp,!1),n.disableDrag(),this._startPos=this._lastPos=n.mousePos(this._el,e),this._active=!0)},xr.prototype._onMouseMove=function(t){var e=n.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)180&&(f=180);var d=f/180;c+=h*f*(d/2),Math.abs(n._normalizeBearing(c,0))0&&n-e[0][0]>160;)e.shift()};var Sr={linearity:.3,easing:t.bezier(0,0,.3,1),maxSpeed:1400,deceleration:2500},Cr=function(e,n){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",this._clickTolerance=n.clickTolerance||1,this._inertiaOptions=Sr,t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};Cr.prototype.isEnabled=function(){return"disabled"!==this._state},Cr.prototype.isActive=function(){return"active"===this._state},Cr.prototype.enable=function(e){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled",this._inertiaOptions=t.extend(Sr,e))},Cr.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},Cr.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==n.mouseButton(e)||(n.addEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),n.addEventListener(t.window.document,"mouseup",this._onMouseUp),this._start(e)))},Cr.prototype.onTouchStart=function(e){this.isEnabled()&&(e.touches&&e.touches.length>1&&("pending"===this._state||"active"===this._state)||(n.addEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),n.addEventListener(t.window.document,"touchend",this._onTouchEnd),this._start(e)))},Cr.prototype._start=function(e){t.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._prevPos=this._lastPos=n.mousePos(this._el,e),this._startTouch=this._lastTouch=t.window.TouchEvent&&e instanceof t.window.TouchEvent?n.touchPos(this._el,e):null,this._inertia=[[t.browser.now(),this._startPos]]},Cr.prototype._touchesMatch=function(t,e){return!(!t||!e||t.length!==e.length)&&t.every((function(t,n){return e[n]===t}))},Cr.prototype._onMove=function(e){e.preventDefault();var r=t.window.TouchEvent&&e instanceof t.window.TouchEvent?n.touchPos(this._el,e):null,i=n.mousePos(this._el,e);(r?this._touchesMatch(this._lastTouch,r):this._lastPos.equals(i))||"pending"===this._state&&i.dist(this._mouseDownPos)1&&n.addEventListener(t.window.document,"touchend",this._onTouchEnd);break;case"pending":this._state="enabled",this._unbind();break;case"enabled":this._unbind()}},Cr.prototype._onBlur=function(t){this._abort(t)},Cr.prototype._unbind=function(){n.removeEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),n.removeEventListener(t.window.document,"touchend",this._onTouchEnd),n.removeEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),n.removeEventListener(t.window.document,"mouseup",this._onMouseUp),n.removeEventListener(t.window,"blur",this._onBlur)},Cr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._mouseDownPos,delete this._lastPos,delete this._startTouch,delete this._lastTouch,delete this._shouldStart},Cr.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var n=e[e.length-1],r=e[0],i=n[1].sub(r[1]),o=(n[0]-r[0])/1e3;if(0===o||n[1].equals(r[1]))this._fireEvent("moveend",t);else{var a=this._inertiaOptions,s=a.linearity,u=a.easing,c=a.maxSpeed,l=a.deceleration,h=i.mult(s/o),p=h.mag();p>c&&(p=c,h._unit()._mult(p));var f=p/(l*s),d=h.mult(-f/2);this._map.panBy(d,{duration:1e3*f,easing:u,noMoveStart:!0},{originalEvent:t})}}},Cr.prototype._fireEvent=function(e,n){return this._map.fire(new t.Event(e,n?{originalEvent:n}:{}))},Cr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,n=t.browser.now();e.length>0&&n-e[0][0]>160;)e.shift()};var Ir=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this)};function kr(t){return t*(2-t)}Ir.prototype.isEnabled=function(){return!!this._enabled},Ir.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},Ir.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},Ir.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,n=0,r=0,i=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?r=-1:(o=1,t.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),u={duration:300,delayEndEvents:500,easing:kr,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+15*n,pitch:a.getPitch()+10*r,offset:[100*-i,100*-o],center:a.getCenter()};a.easeTo(u,{originalEvent:t})}};var Ar=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this)};Ar.prototype.isEnabled=function(){return!!this._enabled},Ar.prototype.isActive=function(){return!!this._active},Ar.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Ar.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Ar.prototype.onTouchStart=function(t){var e=this;if(this.isEnabled()&&!(t.points.length>1))if(this._tapped){var n=t.points[0],r=this._tappedPoint;if(r&&r.dist(n)<=30){t.originalEvent.preventDefault();var i=function(){e._tapped&&e._zoom(t),e._map.off("touchcancel",o),e._resetTapped()},o=function(){e._map.off("touchend",i),e._resetTapped()};this._map.once("touchend",i),this._map.once("touchcancel",o)}else this._resetTapped()}else this._tappedPoint=t.points[0],this._tapped=setTimeout((function(){e._tapped=null,e._tappedPoint=null}),300)},Ar.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null},Ar.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},Ar.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},Ar.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var Or=t.bezier(0,0,.15,1),Pr=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)};Pr.prototype.isEnabled=function(){return!!this._enabled},Pr.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},Pr.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},Pr.prototype.disableRotation=function(){this._rotationDisabled=!0},Pr.prototype.enableRotation=function(){this._rotationDisabled=!1},Pr.prototype.isActive=function(){return this.isEnabled()&&!!this._gestureIntent},Pr.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var r=n.mousePos(this._el,e.touches[0]),i=n.mousePos(this._el,e.touches[1]),o=r.add(i).div(2);this._startVec=r.sub(i),this._startAround=this._map.transform.pointLocation(o),this._gestureIntent=void 0,this._inertia=[],n.addEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),n.addEventListener(t.window.document,"touchend",this._onEnd)}},Pr.prototype._getTouchEventData=function(t){var e=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]),i=e.sub(r);return{vec:i,center:e.add(r).div(2),scale:i.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*i.angleWith(this._startVec)/Math.PI}},Pr.prototype._onMove=function(e){if(2===e.touches.length){var n=this._getTouchEventData(e),r=n.vec,i=n.scale,o=n.bearing;if(!this._gestureIntent){var a=this._rotationDisabled&&1!==i||Math.abs(1-i)>.15;Math.abs(o)>10?this._gestureIntent="rotate":a&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=r)}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault()}},Pr.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var n=this._map.transform;this._startScale||(this._startScale=n.scale,this._startBearing=n.bearing);var r=this._getTouchEventData(this._lastTouchEvent),i=r.center,o=r.bearing,a=r.scale,s=n.pointLocation(i),u=n.locationPoint(s);"rotate"===e&&(n.bearing=this._startBearing+o),n.zoom=n.scaleZoom(this._startScale*a),n.setLocationAtPoint(this._startAround,u),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),a,i])}},Pr.prototype._onEnd=function(e){n.removeEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),n.removeEventListener(t.window.document,"touchend",this._onEnd);var r=this._gestureIntent,i=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,r){this._map.fire(new t.Event(r+"end",{originalEvent:e})),this._drainInertiaBuffer();var o=this._inertia,a=this._map;if(o.length<2)a.snapToNorth({},{originalEvent:e});else{var s=o[o.length-1],u=o[0],c=a.transform.scaleZoom(i*s[1]),l=a.transform.scaleZoom(i*u[1]),h=c-l,p=(s[0]-u[0])/1e3,f=s[2];if(0!==p&&c!==l){var d=.15*h/p;Math.abs(d)>2.5&&(d=d>0?2.5:-2.5);var m=1e3*Math.abs(d/(12*.15)),y=c+d*m/2e3;a.easeTo({zoom:y,duration:m,easing:Or,around:this._aroundCenter?a.getCenter():a.unproject(f),noMoveStart:!0},{originalEvent:e})}else a.snapToNorth({},{originalEvent:e})}}},Pr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,n=t.browser.now();e.length>2&&n-e[0][0]>160;)e.shift()};var Dr={scrollZoom:wr,boxZoom:xr,dragRotate:Tr,dragPan:Cr,keyboard:Ir,doubleClickZoom:Ar,touchZoomRotate:Pr},Mr=function(e){function n(n,r){e.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=r.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},n.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},n.prototype.panBy=function(e,n,r){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},n),r)},n.prototype.panTo=function(e,n,r){return this.easeTo(t.extend({center:e},n),r)},n.prototype.getZoom=function(){return this.transform.zoom},n.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},n.prototype.zoomTo=function(e,n,r){return this.easeTo(t.extend({zoom:e},n),r)},n.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},n.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},n.prototype.getBearing=function(){return this.transform.bearing},n.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},n.prototype.rotateTo=function(e,n,r){return this.easeTo(t.extend({bearing:e},n),r)},n.prototype.resetNorth=function(e,n){return this.rotateTo(0,t.extend({duration:1e3},e),n),this},n.prototype.resetNorthPitch=function(e,n){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),n),this},n.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())e?1:0})),["bottom","left","right","top"])){var a=this.transform,s=a.project(t.LngLat.convert(e)),u=a.project(t.LngLat.convert(n)),c=s.rotate(-r*Math.PI/180),l=u.rotate(-r*Math.PI/180),h=new t.Point(Math.max(c.x,l.x),Math.max(c.y,l.y)),p=new t.Point(Math.min(c.x,l.x),Math.min(c.y,l.y)),f=h.sub(p),d=(a.width-i.padding.left-i.padding.right)/f.x,m=(a.height-i.padding.top-i.padding.bottom)/f.y;if(!(m<0||d<0)){var y=Math.min(a.scaleZoom(a.scale*Math.min(d,m)),i.maxZoom),g=t.Point.convert(i.offset),v=(i.padding.left-i.padding.right)/2,_=(i.padding.top-i.padding.bottom)/2,b=new t.Point(g.x+v,g.y+_).mult(a.scale/a.zoomScale(y));return{center:a.unproject(s.add(u).div(2).sub(b)),zoom:y,bearing:r}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}else t.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'")},n.prototype.fitBounds=function(t,e,n){return this._fitInternal(this.cameraForBounds(t,e),e,n)},n.prototype.fitScreenCoordinates=function(e,n,r,i,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(n)),r,i),i,o)},n.prototype._fitInternal=function(e,n,r){return e?(n=t.extend(e,n)).linear?this.easeTo(n,r):this.flyTo(n,r):this},n.prototype.jumpTo=function(e,n){this.stop();var r=this.transform,i=!1,o=!1,a=!1;return"zoom"in e&&r.zoom!==+e.zoom&&(i=!0,r.zoom=+e.zoom),void 0!==e.center&&(r.center=t.LngLat.convert(e.center)),"bearing"in e&&r.bearing!==+e.bearing&&(o=!0,r.bearing=+e.bearing),"pitch"in e&&r.pitch!==+e.pitch&&(a=!0,r.pitch=+e.pitch),this.fire(new t.Event("movestart",n)).fire(new t.Event("move",n)),i&&this.fire(new t.Event("zoomstart",n)).fire(new t.Event("zoom",n)).fire(new t.Event("zoomend",n)),o&&this.fire(new t.Event("rotatestart",n)).fire(new t.Event("rotate",n)).fire(new t.Event("rotateend",n)),a&&this.fire(new t.Event("pitchstart",n)).fire(new t.Event("pitch",n)).fire(new t.Event("pitchend",n)),this.fire(new t.Event("moveend",n))},n.prototype.easeTo=function(e,n){var r=this;this.stop(),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var i=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),u="zoom"in e?+e.zoom:o,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,l="pitch"in e?+e.pitch:s,h=i.centerPoint.add(t.Point.convert(e.offset)),p=i.pointLocation(h),f=t.LngLat.convert(e.center||p);this._normalizeCenter(f);var d,m,y=i.project(p),g=i.project(f).sub(y),v=i.zoomScale(u-o);return e.around&&(d=t.LngLat.convert(e.around),m=i.locationPoint(d)),this._zooming=u!==o,this._rotating=a!==c,this._pitching=l!==s,this._prepareEase(n,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease((function(e){if(r._zooming&&(i.zoom=t.number(o,u,e)),r._rotating&&(i.bearing=t.number(a,c,e)),r._pitching&&(i.pitch=t.number(s,l,e)),d)i.setLocationAtPoint(d,m);else{var p=i.zoomScale(i.zoom-o),f=u>o?Math.min(2,v):Math.max(.5,v),_=Math.pow(f,1-e),b=i.unproject(y.add(g.mult(e*_)).mult(p));i.setLocationAtPoint(i.renderWorldCopies?b.wrap():b,h)}r._fireMoveEvents(n)}),(function(){e.delayEndEvents?r._easeEndTimeoutID=setTimeout((function(){return r._afterEase(n)}),e.delayEndEvents):r._afterEase(n)}),e),this},n.prototype._prepareEase=function(e,n){this._moving=!0,n||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&this.fire(new t.Event("pitchstart",e))},n.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},n.prototype._afterEase=function(e){var n=this._zooming,r=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,n&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),i&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))},n.prototype.flyTo=function(e,n){var r=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,n)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),c="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,l="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:u,p=o.zoomScale(c-a),f=o.centerPoint.add(t.Point.convert(e.offset)),d=o.pointLocation(f),m=t.LngLat.convert(e.center||d);this._normalizeCenter(m);var y=o.project(d),g=o.project(m).sub(y),v=e.curve,_=Math.max(o.width,o.height),b=_/p,w=g.mag();if("minZoom"in e){var x=t.clamp(Math.min(e.minZoom,a,c),o.minZoom,o.maxZoom),E=_/o.zoomScale(x-a);v=Math.sqrt(E/w*2)}var T=v*v;function S(t){var e=(b*b-_*_+(t?-1:1)*T*T*w*w)/(2*(t?b:_)*T*w);return Math.log(Math.sqrt(e*e+1)-e)}function C(t){return(Math.exp(t)-Math.exp(-t))/2}function I(t){return(Math.exp(t)+Math.exp(-t))/2}var k=S(0),A=function(t){return I(k)/I(k+v*t)},O=function(t){return _*((I(k)*(C(e=k+v*t)/I(e))-C(k))/T)/w;var e},P=(S(1)-k)/v;if(Math.abs(w)<1e-6||!isFinite(P)){if(Math.abs(_-b)<1e-6)return this.easeTo(e,n);var D=b<_?-1:1;P=Math.abs(Math.log(b/_))/v,O=function(){return 0},A=function(t){return Math.exp(D*v*t)}}if("duration"in e)e.duration=+e.duration;else{var M="screenSpeed"in e?+e.screenSpeed/v:+e.speed;e.duration=1e3*P/M}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==l,this._pitching=h!==u,this._prepareEase(n,!1),this._ease((function(e){var i=e*P,p=1/A(i);o.zoom=1===e?c:a+o.scaleZoom(p),r._rotating&&(o.bearing=t.number(s,l,e)),r._pitching&&(o.pitch=t.number(u,h,e));var d=1===e?m:o.unproject(y.add(g.mult(O(i))).mult(p));o.setLocationAtPoint(o.renderWorldCopies?d.wrap():d,f),r._fireMoveEvents(n)}),(function(){return r._afterEase(n)}),e),this},n.prototype.isEasing=function(){return!!this._easeFrameId},n.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}return this},n.prototype._ease=function(e,n,r){!1===r.animate||0===r.duration?(e(1),n()):(this._easeStart=t.browser.now(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},n.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},n.prototype._normalizeBearing=function(e,n){e=t.wrap(e,-180,180);var r=Math.abs(e-n);return Math.abs(e-360-n)180?-360:n<-180?360:0}},n}(t.Evented),Rr=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};Rr.prototype.getDefaultPosition=function(){return"bottom-right"},Rr.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=n.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Rr.prototype.onRemove=function(){n.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Rr.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var n=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var r=n.reduce((function(t,e,r){return e.value&&(t+=e.key+"="+e.value+(r=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Rr.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var Nr=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Nr.prototype.onAdd=function(t){this._map=t,this._container=n.create("div","mapboxgl-ctrl");var e=n.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Nr.prototype.onRemove=function(){n.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Nr.prototype.getDefaultPosition=function(){return"bottom-left"},Nr.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Nr.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},Nr.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var Lr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Lr.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Lr.prototype.remove=function(t){for(var e=this._currentlyRunning,n=0,r=e?this._queue.concat(e):this._queue;ne.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitchUr)throw new Error("maxPitch must be less than or equal to "+Ur);var o=new mr(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(r.call(this,o,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new Lr,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Fr,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof zr))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return i._update(!1)})),this.on("moveend",(function(){return i._update(!1)})),this.on("zoom",(function(){return i._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var r=t.getCanvasContainer(),i=null,o=!1,a=null;for(var s in Dr)t[s]=new Dr[s](t,e),e.interactive&&e[s]&&t[s].enable(e[s]);n.addEventListener(r,"mouseout",(function(e){t.fire(new vr("mouseout",t,e))})),n.addEventListener(r,"mousedown",(function(i){o=!0,a=n.mousePos(r,i);var s=new vr("mousedown",t,i);t.fire(s),s.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(i),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(i),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(i))})),n.addEventListener(r,"mouseup",(function(e){var n=t.dragRotate.isActive();i&&!n&&t.fire(new vr("contextmenu",t,i)),i=null,o=!1,t.fire(new vr("mouseup",t,e))})),n.addEventListener(r,"mousemove",(function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var n=e.target;n&&n!==r;)n=n.parentNode;n===r&&t.fire(new vr("mousemove",t,e))}})),n.addEventListener(r,"mouseover",(function(e){for(var n=e.target;n&&n!==r;)n=n.parentNode;n===r&&t.fire(new vr("mouseover",t,e))})),n.addEventListener(r,"touchstart",(function(n){var r=new _r("touchstart",t,n);t.fire(r),r.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(n),t.touchZoomRotate.onStart(n),t.doubleClickZoom.onTouchStart(r))}),{passive:!1}),n.addEventListener(r,"touchmove",(function(e){t.fire(new _r("touchmove",t,e))}),{passive:!1}),n.addEventListener(r,"touchend",(function(e){t.fire(new _r("touchend",t,e))})),n.addEventListener(r,"touchcancel",(function(e){t.fire(new _r("touchcancel",t,e))})),n.addEventListener(r,"click",(function(i){var o=n.mousePos(r,i);(!a||o.equals(a)||o.dist(a)-1&&this._controls.splice(n,1),e.onRemove(this),this},i.prototype.resize=function(e){var n=this._containerDimensions(),r=n[0],i=n[1];return this._resizeCanvas(r,i),this.transform.resize(r,i),this.painter.resize(r,i),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?Br:t)=Br&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()Ur)throw new Error("maxPitch must be less than or equal to "+Ur);if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},i.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},i.prototype.on=function(t,e,n){var i=this;if(void 0===n)return r.prototype.on.call(this,t,e);var o=function(){var r;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:n,delegates:{mousemove:function(r){var a=i.getLayer(e)?i.queryRenderedFeatures(r.point,{layers:[e]}):[];a.length?o||(o=!0,n.call(i,new vr(t,i,r.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:n,delegates:{mousemove:function(r){(i.getLayer(e)?i.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,n.call(i,new vr(t,i,r.originalEvent)))},mouseout:function(e){a&&(a=!1,n.call(i,new vr(t,i,e.originalEvent)))}}}}return{layer:e,listener:n,delegates:(r={},r[t]=function(t){var r=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,n.call(i,t),delete t.features)},r)}}();for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(o),o.delegates)this.on(a,o.delegates[a]);return this},i.prototype.off=function(t,e,n){if(void 0===n)return r.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var i=this._delegatedListeners[t],o=0;o180;){var s=r.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360}return e}Hr.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.disabled=t===this._map.getMaxZoom(),this._zoomOutButton.disabled=t===this._map.getMinZoom()},Hr.prototype._rotateCompassArrow=function(){var t=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=t},Hr.prototype.onAdd=function(t){return this._map=t,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 Tr(t,{button:"left",element:this._compass}),n.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),n.addEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.enable()),this._container},Hr.prototype.onRemove=function(){n.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),n.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),n.removeEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.disable(),delete this._handler),delete this._map},Hr.prototype._createButton=function(t,e){var r=n.create("button",t,this._container);return r.type="button",r.addEventListener("click",e),r},Hr.prototype._setButtonTitle=function(t,e){var n=this._map._getUIString("NavigationControl."+e);t.title=n,t.setAttribute("aria-label",n)};var Qr={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 Xr(t,e,n){var r=t.classList;for(var i in Qr)r.remove("mapboxgl-"+n+"-anchor-"+i);r.add("mapboxgl-"+n+"-anchor-"+e)}var Yr,Zr=function(e){function r(r,i){var o=this;if(e.call(this),(r instanceof t.window.HTMLElement||i)&&(r=t.extend({element:r},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._draggable=r&&r.draggable||!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&"auto"!==r.pitchAlignment?r.pitchAlignment:this._rotationAlignment,r&&r.element)this._element=r.element,this._offset=t.Point.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=n.create("div"),this._element.setAttribute("aria-label","Map marker");var a=n.createNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","41px"),a.setAttributeNS(null,"width","27px"),a.setAttributeNS(null,"viewBox","0 0 27 41");var s=n.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");var u=n.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill-rule","nonzero");var c=n.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"transform","translate(3.0, 29.0)"),c.setAttributeNS(null,"fill","#000000");for(var l=0,h=[{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"}];le.getEast()||n.latitudee.getNorth())},r.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},r.prototype._onSuccess=function(e){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("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("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()},r.prototype._updateCamera=function(e){var n=new t.LngLat(e.coords.longitude,e.coords.latitude),r=e.coords.accuracy,i=this._map.getBearing(),o=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(r),o,{geolocateSource:!0})},r.prototype._updateMarker=function(t){t?this._userLocationDotMarker.setLngLat([t.coords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},r.prototype._onError=function(e){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),void 0!==this._geolocationWatchID&&this._clearWatch()}else this._setErrorState();"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()},r.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},r.prototype._setupUI=function(e){var r=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=n.create("button","mapboxgl-ctrl-geolocate",this._container),n.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Zr(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){var n=e.originalEvent&&"resize"===e.originalEvent.type;e.geolocateSource||"ACTIVE_LOCK"!==r._watchState||n||(r._watchState="BACKGROUND",r._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),r._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),r.fire(new t.Event("trackuserlocationend")))}))},r.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},r.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},r}(t.Evented),ti={maxWidth:100,unit:"metric"},ei=function(e){this.options=t.extend({},ti,e),t.bindAll(["_onMove","setUnit"],this)};function ni(t,e,n){var r,i,o,a,s,u,c=n&&n.maxWidth||100,l=t._container.clientHeight/2,h=(r=t.unproject([0,l]),i=t.unproject([c,l]),o=Math.PI/180,a=r.lat*o,s=i.lat*o,u=Math.sin(a)*Math.sin(s)+Math.cos(a)*Math.cos(s)*Math.cos((i.lng-r.lng)*o),6371e3*Math.acos(Math.min(u,1)));if(n&&"imperial"===n.unit){var p=3.2808*h;p>5280?ri(e,c,p/5280,t._getUIString("ScaleControl.Miles")):ri(e,c,p,t._getUIString("ScaleControl.Feet"))}else n&&"nautical"===n.unit?ri(e,c,h/1852,t._getUIString("ScaleControl.NauticalMiles")):h>=1e3?ri(e,c,h/1e3,t._getUIString("ScaleControl.Kilometers")):ri(e,c,h,t._getUIString("ScaleControl.Meters"))}function ri(t,e,n,r){var i,o,a,s=(i=n,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a))),u=s/n;t.style.width=e*u+"px",t.innerHTML=s+r}ei.prototype.getDefaultPosition=function(){return"bottom-left"},ei.prototype._onMove=function(){ni(this._map,this._container,this.options)},ei.prototype.onAdd=function(t){return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},ei.prototype.onRemove=function(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},ei.prototype.setUnit=function(t){this.options.unit=t,ni(this._map,this._container,this.options)};var ii=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};ii.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ii.prototype.onRemove=function(){n.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ii.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},ii.prototype._setupUI=function(){var e=this._fullscreenButton=n.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);n.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ii.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},ii.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ii.prototype._isFullscreen=function(){return this._fullscreen},ii.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ii.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var oi={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},ai=function(e){function r(n){e.call(this),this.options=t.extend(Object.create(oi),n),t.bindAll(["_update","_onClickClose","remove"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.addTo=function(e){var n=this;return this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",(function(t){n._update(t.point)})),this._map.on("mouseup",(function(t){n._update(t.point)})),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},r.prototype.isOpen=function(){return!!this._map},r.prototype.remove=function(){return this._content&&n.remove(this._content),this._container&&(n.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),this._map.off("remove",this.remove),this._map.off("mousemove"),delete this._map),this.fire(new t.Event("close")),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove"),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},r.prototype.trackPointer=function(){var t=this;return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",(function(e){t._update(e.point)})),this._map.on("drag",(function(e){t._update(e.point)})),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},r.prototype.getElement=function(){return this._container},r.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},r.prototype.setHTML=function(e){var n,r=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;n=i.firstChild;)r.appendChild(n);return this.setDOMContent(r)},r.prototype.getMaxWidth=function(){return this._container.style.maxWidth},r.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},r.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},r.prototype.addClassName=function(t){this._container.classList.add(t)},r.prototype.removeClassName=function(t){this._container.classList.remove(t)},r.prototype.toggleClassName=function(t){return this._container.classList.toggle(t)},r.prototype._createContent=function(){this._content&&n.remove(this._content),this._content=n.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=n.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},r.prototype._update=function(e){var r=this,i=this._lngLat||this._trackPointer;if(this._map&&i&&this._content&&(this._container||(this._container=n.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=n.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return r._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Kr(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var o=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,s=function e(n){if(n){if("number"==typeof n){var r=Math.round(Math.sqrt(.5*Math.pow(n,2)));return{center:new t.Point(0,0),top:new t.Point(0,n),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-n),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(n,0),right:new t.Point(-n,0)}}if(n instanceof t.Point||Array.isArray(n)){var i=t.Point.convert(n);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(n.center||[0,0]),top:t.Point.convert(n.top||[0,0]),"top-left":t.Point.convert(n["top-left"]||[0,0]),"top-right":t.Point.convert(n["top-right"]||[0,0]),bottom:t.Point.convert(n.bottom||[0,0]),"bottom-left":t.Point.convert(n["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(n["bottom-right"]||[0,0]),left:t.Point.convert(n.left||[0,0]),right:t.Point.convert(n.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!a){var u,c=this._container.offsetWidth,l=this._container.offsetHeight;u=o.y+s.bottom.ythis._map.transform.height-l?["bottom"]:[],o.xthis._map.transform.width-c/2&&u.push("right"),a=0===u.length?"bottom":u.join("-")}var h=o.add(s[a]).round();n.setTransform(this._container,Qr[a]+" translate("+h.x+"px,"+h.y+"px)"),Xr(this._container,a,"popup")}},r.prototype._onClickClose=function(){this.remove()},r}(t.Evented),si={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:qr,NavigationControl:Hr,GeolocateControl:$r,AttributionControl:Rr,ScaleControl:ei,FullscreenControl:ii,Popup:ai,Marker:Zr,Style:je,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Rt.workerCount},set workerCount(t){Rt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return si})),n}()},function(t,e){e.__esModule=!0;e.ATTRIBUTE_NAMES={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"};var n=e.TAG_NAMES={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},r=(e.VALID_TAG_NAMES=Object.keys(n).map((function(t){return n[t]})),e.TAG_PROPERTIES={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src"},e.REACT_TAG_MAP={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"});e.HELMET_PROPS={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},e.HTML_TAG_MAP=Object.keys(r).reduce((function(t,e){return t[r[e]]=e,t}),{}),e.SELF_CLOSING_TAGS=[n.NOSCRIPT,n.SCRIPT,n.STYLE],e.HELMET_ATTRIBUTE="data-react-helmet"},function(t,e,n){"use strict";!function t(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}}(),t.exports=n(47)},function(t,e,n){!function(t){"use strict";function e(t){return Array.prototype.slice.call(t)}function n(t){return new Promise((function(e,n){t.onsuccess=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function r(t,e,r){var i,o=new Promise((function(o,a){n(i=t[e].apply(t,r)).then(o,a)}));return o.request=i,o}function i(t,e,n){var i=r(t,e,n);return i.then((function(t){if(t)return new l(t,i.request)}))}function o(t,e,n){n.forEach((function(n){Object.defineProperty(t.prototype,n,{get:function(){return this[e][n]},set:function(t){this[e][n]=t}})}))}function a(t,e,n,i){i.forEach((function(i){i in n.prototype&&(t.prototype[i]=function(){return r(this[e],i,arguments)})}))}function s(t,e,n,r){r.forEach((function(r){r in n.prototype&&(t.prototype[r]=function(){return this[e][r].apply(this[e],arguments)})}))}function u(t,e,n,r){r.forEach((function(r){r in n.prototype&&(t.prototype[r]=function(){return i(this[e],r,arguments)})}))}function c(t){this._index=t}function l(t,e){this._cursor=t,this._request=e}function h(t){this._store=t}function p(t){this._tx=t,this.complete=new Promise((function(e,n){t.oncomplete=function(){e()},t.onerror=function(){n(t.error)},t.onabort=function(){n(t.error)}}))}function f(t,e,n){this._db=t,this.oldVersion=e,this.transaction=new p(n)}function d(t){this._db=t}o(c,"_index",["name","keyPath","multiEntry","unique"]),a(c,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),u(c,"_index",IDBIndex,["openCursor","openKeyCursor"]),o(l,"_cursor",["direction","key","primaryKey","value"]),a(l,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach((function(t){t in IDBCursor.prototype&&(l.prototype[t]=function(){var e=this,r=arguments;return Promise.resolve().then((function(){return e._cursor[t].apply(e._cursor,r),n(e._request).then((function(t){if(t)return new l(t,e._request)}))}))})})),h.prototype.createIndex=function(){return new c(this._store.createIndex.apply(this._store,arguments))},h.prototype.index=function(){return new c(this._store.index.apply(this._store,arguments))},o(h,"_store",["name","keyPath","indexNames","autoIncrement"]),a(h,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),u(h,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),s(h,"_store",IDBObjectStore,["deleteIndex"]),p.prototype.objectStore=function(){return new h(this._tx.objectStore.apply(this._tx,arguments))},o(p,"_tx",["objectStoreNames","mode"]),s(p,"_tx",IDBTransaction,["abort"]),f.prototype.createObjectStore=function(){return new h(this._db.createObjectStore.apply(this._db,arguments))},o(f,"_db",["name","version","objectStoreNames"]),s(f,"_db",IDBDatabase,["deleteObjectStore","close"]),d.prototype.transaction=function(){return new p(this._db.transaction.apply(this._db,arguments))},o(d,"_db",["name","version","objectStoreNames"]),s(d,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach((function(t){[h,c].forEach((function(n){t in n.prototype&&(n.prototype[t.replace("open","iterate")]=function(){var n=e(arguments),r=n[n.length-1],i=this._store||this._index,o=i[t].apply(i,n.slice(0,-1));o.onsuccess=function(){r(o.result)}})}))})),[c,h].forEach((function(t){t.prototype.getAll||(t.prototype.getAll=function(t,e){var n=this,r=[];return new Promise((function(i){n.iterateCursor(t,(function(t){t?(r.push(t.value),void 0===e||r.length!=e?t.continue():i(r)):i(r)}))}))})})),t.openDb=function(t,e,n){var i=r(indexedDB,"open",[t,e]),o=i.request;return o&&(o.onupgradeneeded=function(t){n&&n(new f(o.result,t.oldVersion,o.transaction))}),i.then((function(t){return new d(t)}))},t.deleteDb=function(t){return r(indexedDB,"deleteDatabase",[t])},Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(3);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',r=t.head||t.getElementsByTagName("head")[0],i=t.createElement("style");i.id="detectElementResize",i.type="text/css",null!=e&&i.setAttribute("nonce",e),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(t.createTextNode(n)),r.appendChild(i)}}(o),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=o.createElement("div")).className="resize-triggers",t.__resizeTriggers__.innerHTML='
',t.appendChild(t.__resizeTriggers__),a(t),t.addEventListener("scroll",s,!0),l&&(t.__resizeTriggers__.__animationListener__=function(e){e.animationName==m&&a(t)},t.__resizeTriggers__.addEventListener(l,t.__resizeTriggers__.__animationListener__))}t.__resizeListeners__.push(i)}},removeResizeListener:function(t,e){if(r)t.detachEvent("onresize",e);else if(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),!t.__resizeListeners__.length){t.removeEventListener("scroll",s,!0),t.__resizeTriggers__.__animationListener__&&(t.__resizeTriggers__.removeEventListener(l,t.__resizeTriggers__.__animationListener__),t.__resizeTriggers__.__animationListener__=null);try{t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__)}catch(n){}}}}}var o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var n=0;n=320?r:void 0,omitscript:!0})},e.defaultProps={hideCaption:!1,containerTagName:"div",protocol:"https:",injectScript:!0},e}(r.PureComponent);e.a=u},function(t,e,n){"use strict";var r=n(64),i=n(26),o=n(65);function a(t,e){return e.encode?e.strict?r(t):encodeURIComponent(t):t}function s(t){var e=t.indexOf("?");return-1===e?"":t.slice(e+1)}function u(t,e){var n=function(t){var e;switch(t.arrayFormat){case"index":return function(t,n,r){e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return function(t,n,r){e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==r[t]?r[t]=[].concat(r[t],n):r[t]=[n]:r[t]=n};default:return function(t,e,n){void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}(e=i({arrayFormat:"none"},e)),r=Object.create(null);return"string"!==typeof t?r:(t=t.trim().replace(/^[?#&]/,""))?(t.split("&").forEach((function(t){var e=t.replace(/\+/g," ").split("="),i=e.shift(),a=e.length>0?e.join("="):void 0;a=void 0===a?null:o(a),n(o(i),a,r)})),Object.keys(r).sort().reduce((function(t,e){var n=r[e];return Boolean(n)&&"object"===typeof n&&!Array.isArray(n)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"===typeof e?t(Object.keys(e)).sort((function(t,e){return Number(t)-Number(e)})).map((function(t){return e[t]})):e}(n):t[e]=n,t}),Object.create(null))):r}e.extract=s,e.parse=u,e.stringify=function(t,e){!1===(e=i({encode:!0,strict:!0,arrayFormat:"none"},e)).sort&&(e.sort=function(){});var n=function(t){switch(t.arrayFormat){case"index":return function(e,n,r){return null===n?[a(e,t),"[",r,"]"].join(""):[a(e,t),"[",a(r,t),"]=",a(n,t)].join("")};case"bracket":return function(e,n){return null===n?a(e,t):[a(e,t),"[]=",a(n,t)].join("")};default:return function(e,n){return null===n?a(e,t):[a(e,t),"=",a(n,t)].join("")}}}(e);return t?Object.keys(t).sort(e.sort).map((function(r){var i=t[r];if(void 0===i)return"";if(null===i)return a(r,e);if(Array.isArray(i)){var o=[];return i.slice().forEach((function(t){void 0!==t&&o.push(n(r,t,o.length))})),o.join("&")}return a(r,e)+"="+a(i,e)})).filter((function(t){return t.length>0})).join("&"):""},e.parseUrl=function(t,e){return{url:t.split("?")[0]||"",query:u(s(t),e)}}},,,function(t,e,n){e.__esModule=!0,e.Helmet=void 0;var r=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var f=function(t){var e,n;return n=e=function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}(this,e.apply(this,arguments))}return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,e),n.prototype.shouldComponentUpdate=function(t){return!(0,u.default)(this.props,t)},n.prototype.mapNestedChildrenToProps=function(t,e){if(!e)return null;switch(t.type){case l.TAG_NAMES.SCRIPT:case l.TAG_NAMES.NOSCRIPT:return{innerHTML:e};case l.TAG_NAMES.STYLE:return{cssText:e}}throw new Error("<"+t.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},n.prototype.flattenArrayTypeChildren=function(t){var e,n=t.child,i=t.arrayTypeChildren,o=t.newChildProps,a=t.nestedChildren;return r({},i,((e={})[n.type]=[].concat(i[n.type]||[],[r({},o,this.mapNestedChildrenToProps(n,a))]),e))},n.prototype.mapObjectTypeChildren=function(t){var e,n,i=t.child,o=t.newProps,a=t.newChildProps,s=t.nestedChildren;switch(i.type){case l.TAG_NAMES.TITLE:return r({},o,((e={})[i.type]=s,e.titleAttributes=r({},a),e));case l.TAG_NAMES.BODY:return r({},o,{bodyAttributes:r({},a)});case l.TAG_NAMES.HTML:return r({},o,{htmlAttributes:r({},a)})}return r({},o,((n={})[i.type]=r({},a),n))},n.prototype.mapArrayTypeChildrenToProps=function(t,e){var n=r({},e);return Object.keys(t).forEach((function(e){var i;n=r({},n,((i={})[e]=t[e],i))})),n},n.prototype.warnOnInvalidChildren=function(t,e){return!0},n.prototype.mapChildrenToProps=function(t,e){var n=this,r={};return o.default.Children.forEach(t,(function(t){if(t&&t.props){var i=t.props,o=i.children,a=p(i,["children"]),s=(0,c.convertReactPropstoHtmlAttributes)(a);switch(n.warnOnInvalidChildren(t,o),t.type){case l.TAG_NAMES.LINK:case l.TAG_NAMES.META:case l.TAG_NAMES.NOSCRIPT:case l.TAG_NAMES.SCRIPT:case l.TAG_NAMES.STYLE:r=n.flattenArrayTypeChildren({child:t,arrayTypeChildren:r,newChildProps:s,nestedChildren:o});break;default:e=n.mapObjectTypeChildren({child:t,newProps:e,newChildProps:s,nestedChildren:o})}}})),e=this.mapArrayTypeChildrenToProps(r,e)},n.prototype.render=function(){var e=this.props,n=e.children,i=p(e,["children"]),a=r({},i);return n&&(a=this.mapChildrenToProps(n,a)),o.default.createElement(t,a)},i(n,null,[{key:"canUseDOM",set:function(e){t.canUseDOM=e}}]),n}(o.default.Component),e.propTypes={base:a.default.object,bodyAttributes:a.default.object,children:a.default.oneOfType([a.default.arrayOf(a.default.node),a.default.node]),defaultTitle:a.default.string,defer:a.default.bool,encodeSpecialCharacters:a.default.bool,htmlAttributes:a.default.object,link:a.default.arrayOf(a.default.object),meta:a.default.arrayOf(a.default.object),noscript:a.default.arrayOf(a.default.object),onChangeClientState:a.default.func,script:a.default.arrayOf(a.default.object),style:a.default.arrayOf(a.default.object),title:a.default.string,titleAttributes:a.default.object,titleTemplate:a.default.string},e.defaultProps={defer:!0,encodeSpecialCharacters:!0},e.peek=t.peek,e.rewind=function(){var e=t.rewind();return e||(e=(0,c.mapStateOnServer)({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),e},n}((0,s.default)(c.reducePropsToState,c.handleClientStateChange,c.mapStateOnServer)((function(){return null})));f.renderStatic=f.rewind,e.Helmet=f,e.default=f},,function(t,e,n){"use strict";var r=n(26),i="function"===typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,a=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,u=i?Symbol.for("react.strict_mode"):60108,c=i?Symbol.for("react.profiler"):60114,l=i?Symbol.for("react.provider"):60109,h=i?Symbol.for("react.context"):60110,p=i?Symbol.for("react.forward_ref"):60112,f=i?Symbol.for("react.suspense"):60113;i&&Symbol.for("react.suspense_list");var d=i?Symbol.for("react.memo"):60115,m=i?Symbol.for("react.lazy"):60116;i&&Symbol.for("react.fundamental"),i&&Symbol.for("react.responder"),i&&Symbol.for("react.scope");var y="function"===typeof Symbol&&Symbol.iterator;function g(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;nP.length&&P.push(t)}function R(t,e,n){return null==t?0:function t(e,n,r,i){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var u=!1;if(null===e)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case o:case a:u=!0}}if(u)return r(i,e,""===n?"."+N(e,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(e))for(var c=0;c