/*! For license information please see LICENSES */
(window.webpackJsonp=window.webpackJsonp||[]).push([[79],[function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return o})),r.d(t,"e",(function(){return a})),r.d(t,"c",(function(){return s})),r.d(t,"d",(function(){return l}));var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function a(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function l(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e}},,,function(e,t,r){"use strict";r.d(t,"d",(function(){return i})),r.d(t,"e",(function(){return a})),r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"l",(function(){return c})),r.d(t,"j",(function(){return u})),r.d(t,"i",(function(){return p})),r.d(t,"f",(function(){return h})),r.d(t,"c",(function(){return d})),r.d(t,"k",(function(){return f})),r.d(t,"n",(function(){return m})),r.d(t,"m",(function(){return g})),r.d(t,"h",(function(){return b})),r.d(t,"g",(function(){return _}));var n=Object.prototype.toString;function i(e){switch(n.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return _(e,Error)}}function o(e,t){return n.call(e)==="[object "+t+"]"}function a(e){return o(e,"ErrorEvent")}function s(e){return o(e,"DOMError")}function l(e){return o(e,"DOMException")}function c(e){return o(e,"String")}function u(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function p(e){return o(e,"Object")}function h(e){return"undefined"!=typeof Event&&_(e,Event)}function d(e){return"undefined"!=typeof Element&&_(e,Element)}function f(e){return o(e,"RegExp")}function m(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function g(e){return p(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function b(e){return"number"==typeof e&&e!=e}function _(e,t){try{return e instanceof t}catch(e){return!1}}},,,,,,function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return a}));var n=r(102),i={};function o(){return Object(n.b)()?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function a(e,t,r){var n=r||o(),i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}}).call(this,r(31))},function(e,t,r){"use strict";r.d(t,"e",(function(){return s})),r.d(t,"a",(function(){return l})),r.d(t,"g",(function(){return c})),r.d(t,"f",(function(){return u})),r.d(t,"h",(function(){return p})),r.d(t,"b",(function(){return h})),r.d(t,"d",(function(){return m})),r.d(t,"c",(function(){return g}));var n=r(0),i=r(165),o=r(3),a=r(67);function s(e,t,r){if(t in e){var n=e[t],i=r(n);if("function"==typeof i)try{c(i,n)}catch(e){}e[t]=i}}function l(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}function c(e,t){var r=t.prototype||{};e.prototype=t.prototype=r,l(e,"__sentry_original__",t)}function u(e){return e.__sentry_original__}function p(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}function h(e){var t=e;if(Object(o.d)(e))t=Object(n.a)({message:e.message,name:e.name,stack:e.stack},f(e));else if(Object(o.f)(e)){var r=e;t=Object(n.a)({type:r.type,target:d(r.target),currentTarget:d(r.currentTarget)},f(r)),"undefined"!=typeof CustomEvent&&Object(o.g)(e,CustomEvent)&&(t.detail=r.detail)}return t}function d(e){try{return Object(o.c)(e)?Object(i.b)(e):Object.prototype.toString.call(e)}catch(e){return"<unknown>"}}function f(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}function m(e,t){void 0===t&&(t=40);var r=Object.keys(h(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return Object(a.d)(r[0],t);for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length?i:Object(a.d)(i,t)}return""}function g(e){var t,r;if(Object(o.i)(e)){var i={};try{for(var a=Object(n.e)(Object.keys(e)),s=a.next();!s.done;s=a.next()){var l=s.value;void 0!==e[l]&&(i[l]=g(e[l]))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return i}return Array.isArray(e)?e.map(g):e}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return c})),r.d(t,"c",(function(){return n}));var n,i=r(0),o=r(51),a=r(9),s=Object(a.a)(),l=["debug","info","warn","error","log","assert"];function c(e){var t=Object(a.a)();if(!("console"in t))return e();var r=t.console,n={};l.forEach((function(e){var i=r[e]&&r[e].__sentry_original__;e in t.console&&i&&(n[e]=r[e],r[e]=i)}));try{return e()}finally{Object.keys(n).forEach((function(e){r[e]=n[e]}))}}function u(){var e=!1,t={enable:function(){e=!0},disable:function(){e=!1}};return o.a?l.forEach((function(r){t[r]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e&&c((function(){var e;(e=s.console)[r].apply(e,Object(i.d)(["Sentry Logger ["+r+"]:"],t))}))}})):l.forEach((function(e){t[e]=function(){}})),t}n=o.a?Object(a.b)("logger",u):u()},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},,,,,function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"d",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"e",(function(){return c})),r.d(t,"a",(function(){return u})),r.d(t,"f",(function(){return p})),r.d(t,"h",(function(){return h})),r.d(t,"j",(function(){return d})),r.d(t,"g",(function(){return f})),r.d(t,"i",(function(){return m})),r.d(t,"k",(function(){return g})),r.d(t,"m",(function(){return b})),r.d(t,"l",(function(){return _}));var n=r(0),i=r(46);function o(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var o=Object(i.b)();if(o&&o[e])return o[e].apply(o,Object(n.d)(t));throw new Error("No hub defined or "+e+" was not found on the hub, please open a bug report.")}function a(e,t){return o("captureException",e,{captureContext:t,originalException:e,syntheticException:new Error("Sentry syntheticException")})}function s(e,t){var r=new Error(e),i="string"!=typeof t?{captureContext:t}:void 0;return o("captureMessage",e,"string"==typeof t?t:void 0,Object(n.a)({originalException:e,syntheticException:r},i))}function l(e){return o("captureEvent",e)}function c(e){o("configureScope",e)}function u(e){o("addBreadcrumb",e)}function p(e,t){o("setContext",e,t)}function h(e){o("setExtras",e)}function d(e){o("setTags",e)}function f(e,t){o("setExtra",e,t)}function m(e,t){o("setTag",e,t)}function g(e){o("setUser",e)}function b(e){o("withScope",e)}function _(e,t){return o("startTransaction",Object(n.a)({},e),t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n={};r.r(n),r.d(n,"FunctionToString",(function(){return a})),r.d(n,"InboundFilters",(function(){return d}));var i,o=r(10),a=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){i=Function.prototype.toString,Function.prototype.toString=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object(o.f)(this)||this;return i.apply(r,e)}},e.id="FunctionToString",e}(),s=r(0),l=r(11),c=r(105),u=r(67),p=r(14),h=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],d=function(){function e(t){void 0===t&&(t={}),this._options=t,this.name=e.id}return e.prototype.setupOnce=function(t,r){t((function(t){var n=r();if(n){var i=n.getIntegration(e);if(i){var o=n.getClient(),a=o?o.getOptions():{},d=function(e,t){void 0===e&&(e={});void 0===t&&(t={});return{allowUrls:Object(s.d)(e.whitelistUrls||[],e.allowUrls||[],t.whitelistUrls||[],t.allowUrls||[]),denyUrls:Object(s.d)(e.blacklistUrls||[],e.denyUrls||[],t.blacklistUrls||[],t.denyUrls||[]),ignoreErrors:Object(s.d)(e.ignoreErrors||[],t.ignoreErrors||[],h),ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(i._options,a);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return p.a&&l.c.warn("Event dropped due to being internal Sentry Error.\nEvent: "+Object(c.d)(e)),!0;if(function(e,t){if(!t||!t.length)return!1;return function(e){if(e.message)return[e.message];if(e.exception)try{var t=e.exception.values&&e.exception.values[0]||{},r=t.type,n=void 0===r?"":r,i=t.value,o=void 0===i?"":i;return[""+o,n+": "+o]}catch(t){return p.a&&l.c.error("Cannot extract message for event "+Object(c.d)(e)),[]}return[]}(e).some((function(e){return t.some((function(t){return Object(u.a)(e,t)}))}))}(e,t.ignoreErrors))return p.a&&l.c.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+Object(c.d)(e)),!0;if(function(e,t){if(!t||!t.length)return!1;var r=m(e);return!!r&&t.some((function(e){return Object(u.a)(r,e)}))}(e,t.denyUrls))return p.a&&l.c.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+Object(c.d)(e)+".\nUrl: "+m(e)),!0;if(!function(e,t){if(!t||!t.length)return!0;var r=m(e);return!r||t.some((function(e){return Object(u.a)(r,e)}))}(e,t.allowUrls))return p.a&&l.c.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+Object(c.d)(e)+".\nUrl: "+m(e)),!0;return!1}(t,d)?null:t}}return t}))},e.id="InboundFilters",e}();function f(e){void 0===e&&(e=[]);for(var t=e.length-1;t>=0;t--){var r=e[t];if(r&&"<anonymous>"!==r.filename&&"[native code]"!==r.filename)return r.filename||null}return null}function m(e){try{if(e.stacktrace)return f(e.stacktrace.frames);var t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?f(t):null}catch(t){return p.a&&l.c.error("Cannot extract url for event "+Object(c.d)(e)),null}}},,,function(e,t,r){"use strict";r.d(t,"d",(function(){return a})),r.d(t,"c",(function(){return p})),r.d(t,"a",(function(){return h})),r.d(t,"b",(function(){return d}));var n=r(69),i=r(10),o="7";!function(){function e(e,t,r){void 0===t&&(t={}),this.dsn=e,this._dsnObject=Object(n.b)(e),this.metadata=t,this._tunnel=r}e.prototype.getDsn=function(){return this._dsnObject},e.prototype.forceEnvelope=function(){return!!this._tunnel},e.prototype.getBaseApiEndpoint=function(){return s(this._dsnObject)},e.prototype.getStoreEndpoint=function(){return u(this._dsnObject)},e.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return p(this._dsnObject)},e.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return h(this._dsnObject,this._tunnel)}}();function a(e,t,r){return{initDsn:e,metadata:t||{},dsn:Object(n.b)(e),tunnel:r}}function s(e){var t=e.protocol?e.protocol+":":"",r=e.port?":"+e.port:"";return t+"//"+e.host+r+(e.path?"/"+e.path:"")+"/api/"}function l(e,t){return""+s(e)+e.projectId+"/"+t+"/"}function c(e){return Object(i.h)({sentry_key:e.publicKey,sentry_version:o})}function u(e){return l(e,"store")}function p(e){return u(e)+"?"+c(e)}function h(e,t){return t||function(e){return l(e,"envelope")}(e)+"?"+c(e)}function d(e,t){var r=Object(n.b)(e),i=s(r)+"embed/error-page/",o="dsn="+Object(n.a)(r);for(var a in t)if("dsn"!==a)if("user"===a){if(!t.user)continue;t.user.name&&(o+="&name="+encodeURIComponent(t.user.name)),t.user.email&&(o+="&email="+encodeURIComponent(t.user.email))}else o+="&"+encodeURIComponent(a)+"="+encodeURIComponent(t[a]);return i+"?"+o}},function(e,t,r){"use strict";r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return f})),r.d(t,"a",(function(){return m}));var n=r(0),i=r(22),o=r(26),a=r(9),s=r(10),l=r(105),c=r(11),u=r(17),p=Object(a.a)(),h=0;function d(){return h>0}function f(e,t,r){if(void 0===t&&(t={}),"function"!=typeof e)return e;try{var o=e.__sentry_wrapped__;if(o)return o;if(Object(s.f)(e))return e}catch(t){return e}var a=function(){var o=Array.prototype.slice.call(arguments);try{r&&"function"==typeof r&&r.apply(this,arguments);var a=o.map((function(e){return f(e,t)}));return e.apply(this,a)}catch(e){throw h+=1,setTimeout((function(){h-=1})),Object(i.m)((function(r){r.addEventProcessor((function(e){return t.mechanism&&(Object(l.b)(e,void 0,void 0),Object(l.a)(e,t.mechanism)),e.extra=Object(n.a)(Object(n.a)({},e.extra),{arguments:o}),e})),Object(i.c)(e)})),e}};try{for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&(a[c]=e[c])}catch(e){}Object(s.g)(a,e),Object(s.a)(e,"__sentry_wrapped__",a);try{Object.getOwnPropertyDescriptor(a,"name").configurable&&Object.defineProperty(a,"name",{get:function(){return e.name}})}catch(e){}return a}function m(e){if(void 0===e&&(e={}),p.document)if(e.eventId)if(e.dsn){var t=p.document.createElement("script");t.async=!0,t.src=Object(o.b)(e.dsn,e),e.onLoad&&(t.onload=e.onLoad);var r=p.document.head||p.document.body;r&&r.appendChild(t)}else u.a&&c.c.error("Missing dsn option in showReportDialog call");else u.a&&c.c.error("Missing eventId option in showReportDialog call")}},function(e,t,r){"use strict";r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var n=r(3);function i(e){return new a((function(t){t(e)}))}function o(e){return new a((function(t,r){r(e)}))}var a=function(){function e(e){var t=this;this._state=0,this._handlers=[],this._resolve=function(e){t._setResult(1,e)},this._reject=function(e){t._setResult(2,e)},this._setResult=function(e,r){0===t._state&&(Object(n.n)(r)?r.then(t._resolve,t._reject):(t._state=e,t._value=r,t._executeHandlers()))},this._executeHandlers=function(){if(0!==t._state){var e=t._handlers.slice();t._handlers=[],e.forEach((function(e){e[0]||(1===t._state&&e[1](t._value),2===t._state&&e[2](t._value),e[0]=!0)}))}};try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}return e.prototype.then=function(t,r){var n=this;return new e((function(e,i){n._handlers.push([!1,function(r){if(t)try{e(t(r))}catch(e){i(e)}else e(r)},function(t){if(r)try{e(r(t))}catch(e){i(e)}else i(t)}]),n._executeHandlers()}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var r=this;return new e((function(e,n){var i,o;return r.then((function(e){o=!1,i=e,t&&t()}),(function(e){o=!0,i=e,t&&t()})).then((function(){o?n(i):e(i)}))}))},e}()},,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){return e.__proto__=t,e}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(e,r)||(e[r]=t[r]);return e});var o=function(e){function t(t){var r=this.constructor,n=e.call(this,t)||this;return n.message=t,n.name=r.prototype.constructor.name,i(n,r.prototype),n}return Object(n.b)(t,e),t}(Error)},function(e,t,r){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=e(t);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(n)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(i[a]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);n&&i[l[0]]||(r&&(l[2]?l[2]="".concat(r," and ").concat(l[2]):l[2]=r),t.push(l))}},t}},function(e,t,r){"use strict";function n(e,t){for(var r=[],n={},i=0;i<t.length;i++){var o=t[i],a=o[0],s={id:e+":"+i,css:o[1],media:o[2],sourceMap:o[3]};n[a]?n[a].parts.push(s):r.push(n[a]={id:a,parts:[s]})}return r}r.r(t),r.d(t,"default",(function(){return f}));var i="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!i)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var o={},a=i&&(document.head||document.getElementsByTagName("head")[0]),s=null,l=0,c=!1,u=function(){},p=null,h="data-vue-ssr-id",d="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function f(e,t,r,i){c=r,p=i||{};var a=n(e,t);return m(a),function(t){for(var r=[],i=0;i<a.length;i++){var s=a[i];(l=o[s.id]).refs--,r.push(l)}t?m(a=n(e,t)):a=[];for(i=0;i<r.length;i++){var l;if(0===(l=r[i]).refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete o[l.id]}}}}function m(e){for(var t=0;t<e.length;t++){var r=e[t],n=o[r.id];if(n){n.refs++;for(var i=0;i<n.parts.length;i++)n.parts[i](r.parts[i]);for(;i<r.parts.length;i++)n.parts.push(b(r.parts[i]));n.parts.length>r.parts.length&&(n.parts.length=r.parts.length)}else{var a=[];for(i=0;i<r.parts.length;i++)a.push(b(r.parts[i]));o[r.id]={id:r.id,refs:1,parts:a}}}}function g(){var e=document.createElement("style");return e.type="text/css",a.appendChild(e),e}function b(e){var t,r,n=document.querySelector("style["+h+'~="'+e.id+'"]');if(n){if(c)return u;n.parentNode.removeChild(n)}if(d){var i=l++;n=s||(s=g()),t=v.bind(null,n,i,!1),r=v.bind(null,n,i,!0)}else n=g(),t=x.bind(null,n),r=function(){n.parentNode.removeChild(n)};return t(e),function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap)return;t(e=n)}else r()}}var _,y=(_=[],function(e,t){return _[e]=t,_.filter(Boolean).join("\n")});function v(e,t,r,n){var i=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=y(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function x(e,t){var r=t.css,n=t.media,i=t.sourceMap;if(n&&e.setAttribute("media",n),p.ssrId&&e.setAttribute(h,t.id),i&&(r+="\n/*# sourceURL="+i.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}},,,,,function(e,t,r){"use strict";r.d(t,"d",(function(){return S})),r.d(t,"a",(function(){return O})),r.d(t,"b",(function(){return L})),r.d(t,"c",(function(){return z}));var n=r(0),i=r(264),o=r(3),a=r(10),s=r(263),l=r(53),c=r(105),u=r(28),p="?";function h(e,t,r,n){var i={filename:e,function:t,in_app:!0};return void 0!==r&&(i.lineno=r),void 0!==n&&(i.colno=n),i}var d=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,f=/\((\S*)(?::(\d+))(?::(\d+))\)/,m=[30,function(e){var t=d.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){var r=f.exec(t[2]);r&&(t[2]=r[1],t[3]=r[2],t[4]=r[3])}var i=Object(n.c)(T(t[1]||p,t[2]),2),o=i[0];return h(i[1],o,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],g=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,b=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,_=[50,function(e){var t,r=g.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=b.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var o=r[3],a=r[1]||p;return a=(t=Object(n.c)(T(a,o),2))[0],h(o=t[1],a,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}}],y=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,v=[40,function(e){var t=y.exec(e);return t?h(t[2],t[1]||p,+t[3],t[4]?+t[4]:void 0):void 0}],x=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,w=[10,function(e){var t=x.exec(e);return t?h(t[2],t[3]||p,+t[1]):void 0}],k=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,E=[20,function(e){var t=k.exec(e);return t?h(t[5],t[3]||t[4]||p,+t[1],+t[2]):void 0}],T=function(e,t){var r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:p,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};function S(e){var t=A(e),r={type:e&&e.name,value:I(e)};return t.length&&(r.stacktrace={frames:t}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function C(e){return{exception:{values:[S(e)]}}}function A(e){var t=e.stacktrace||e.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(M.test(e.message))return 1}return 0}(e);try{return Object(l.a)(w,E,m,v,_)(t,r)}catch(e){}return[]}var M=/Minified React error #\d+;/i;function I(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function O(e,t,r){var n=z(e,t&&t.syntheticException||void 0,r);return Object(c.a)(n),n.level=i.a.Error,t&&t.event_id&&(n.event_id=t.event_id),Object(u.c)(n)}function L(e,t,r,n){void 0===t&&(t=i.a.Info);var o=D(e,r&&r.syntheticException||void 0,n);return o.level=t,r&&r.event_id&&(o.event_id=r.event_id),Object(u.c)(o)}function z(e,t,r,i){var l;if(Object(o.e)(e)&&e.error)return C(e.error);if(Object(o.a)(e)||Object(o.b)(e)){var u=e;if("stack"in e)l=C(e);else{var p=u.name||(Object(o.a)(u)?"DOMError":"DOMException"),h=u.message?p+": "+u.message:p;l=D(h,t,r),Object(c.b)(l,h)}return"code"in u&&(l.tags=Object(n.a)(Object(n.a)({},l.tags),{"DOMException.code":""+u.code})),l}return Object(o.d)(e)?C(e):Object(o.i)(e)||Object(o.f)(e)?(l=function(e,t,r){var n={exception:{values:[{type:Object(o.f)(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:"Non-Error "+(r?"promise rejection":"exception")+" captured with keys: "+Object(a.d)(e)}]},extra:{__serialized__:Object(s.b)(e)}};if(t){var i=A(t);i.length&&(n.stacktrace={frames:i})}return n}(e,t,i),Object(c.a)(l,{synthetic:!0}),l):(l=D(e,t,r),Object(c.b)(l,""+e,void 0),Object(c.a)(l,{synthetic:!0}),l)}function D(e,t,r){var n={message:e};if(r&&t){var i=A(t);i.length&&(n.stacktrace={frames:i})}return n}},function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"d",(function(){return m})),r.d(t,"b",(function(){return g})),r.d(t,"c",(function(){return _}));var n=r(0),i=r(105),o=r(68),a=r(11),s=r(9),l=r(102),c="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,u=r(81),p=r(250),h=4,d=function(){function e(e,t,r){void 0===t&&(t=new u.a),void 0===r&&(r=h),this._version=r,this._stack=[{}],this.getStackTop().scope=t,e&&this.bindClient(e)}return e.prototype.isOlderThan=function(e){return this._version<e},e.prototype.bindClient=function(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()},e.prototype.pushScope=function(){var e=u.a.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e},e.prototype.popScope=function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()},e.prototype.withScope=function(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(e,t){var r=this._lastEventId=t&&t.event_id?t.event_id:Object(i.f)(),o=t;if(!t){var a=void 0;try{throw new Error("Sentry syntheticException")}catch(e){a=e}o={originalException:e,syntheticException:a}}return this._invokeClient("captureException",e,Object(n.a)(Object(n.a)({},o),{event_id:r})),r},e.prototype.captureMessage=function(e,t,r){var o=this._lastEventId=r&&r.event_id?r.event_id:Object(i.f)(),a=r;if(!r){var s=void 0;try{throw new Error(e)}catch(e){s=e}a={originalException:e,syntheticException:s}}return this._invokeClient("captureMessage",e,t,Object(n.a)(Object(n.a)({},a),{event_id:o})),o},e.prototype.captureEvent=function(e,t){var r=t&&t.event_id?t.event_id:Object(i.f)();return"transaction"!==e.type&&(this._lastEventId=r),this._invokeClient("captureEvent",e,Object(n.a)(Object(n.a)({},t),{event_id:r})),r},e.prototype.lastEventId=function(){return this._lastEventId},e.prototype.addBreadcrumb=function(e,t){var r=this.getStackTop(),i=r.scope,s=r.client;if(i&&s){var l=s.getOptions&&s.getOptions()||{},c=l.beforeBreadcrumb,u=void 0===c?null:c,p=l.maxBreadcrumbs,h=void 0===p?100:p;if(!(h<=0)){var d=Object(o.a)(),f=Object(n.a)({timestamp:d},e),m=u?Object(a.b)((function(){return u(f,t)})):f;null!==m&&i.addBreadcrumb(m,h)}}},e.prototype.setUser=function(e){var t=this.getScope();t&&t.setUser(e)},e.prototype.setTags=function(e){var t=this.getScope();t&&t.setTags(e)},e.prototype.setExtras=function(e){var t=this.getScope();t&&t.setExtras(e)},e.prototype.setTag=function(e,t){var r=this.getScope();r&&r.setTag(e,t)},e.prototype.setExtra=function(e,t){var r=this.getScope();r&&r.setExtra(e,t)},e.prototype.setContext=function(e,t){var r=this.getScope();r&&r.setContext(e,t)},e.prototype.configureScope=function(e){var t=this.getStackTop(),r=t.scope,n=t.client;r&&n&&e(r)},e.prototype.run=function(e){var t=m(this);try{e(this)}finally{m(t)}},e.prototype.getIntegration=function(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return c&&a.c.warn("Cannot retrieve integration "+e.id+" from the current Hub"),null}},e.prototype.startSpan=function(e){return this._callExtensionMethod("startSpan",e)},e.prototype.startTransaction=function(e,t){return this._callExtensionMethod("startTransaction",e,t)},e.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},e.prototype.captureSession=function(e){if(void 0===e&&(e=!1),e)return this.endSession();this._sendSessionUpdate()},e.prototype.endSession=function(){var e=this.getStackTop(),t=e&&e.scope,r=t&&t.getSession();r&&r.close(),this._sendSessionUpdate(),t&&t.setSession()},e.prototype.startSession=function(e){var t=this.getStackTop(),r=t.scope,i=t.client,o=i&&i.getOptions()||{},a=o.release,l=o.environment,c=(Object(s.a)().navigator||{}).userAgent,u=new p.a(Object(n.a)(Object(n.a)(Object(n.a)({release:a,environment:l},r&&{user:r.getUser()}),c&&{userAgent:c}),e));if(r){var h=r.getSession&&r.getSession();h&&"ok"===h.status&&h.update({status:"exited"}),this.endSession(),r.setSession(u)}return u},e.prototype._sendSessionUpdate=function(){var e=this.getStackTop(),t=e.scope,r=e.client;if(t){var n=t.getSession&&t.getSession();n&&r&&r.captureSession&&r.captureSession(n)}},e.prototype._invokeClient=function(e){for(var t,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var o=this.getStackTop(),a=o.scope,s=o.client;s&&s[e]&&(t=s)[e].apply(t,Object(n.d)(r,[a]))},e.prototype._callExtensionMethod=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=f().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);c&&a.c.warn("Extension method "+e+" couldn't be found, doing nothing.")},e}();function f(){var e=Object(s.a)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function m(e){var t=f(),r=_(t);return y(t,e),r}function g(){var e=f();return b(e)&&!_(e).isOlderThan(h)||y(e,new d),Object(l.b)()?function(e){try{var t=f().__SENTRY__,r=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!r)return _(e);if(!b(r)||_(r).isOlderThan(h)){var n=_(e).getStackTop();y(r,new d(n.client,u.a.clone(n.scope)))}return _(r)}catch(t){return _(e)}}(e):_(e)}function b(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function _(e){return Object(s.b)("hub",(function(){return new d}),e)}function y(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}},,,,function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"e",(function(){return x})),r.d(t,"h",(function(){return w})),r.d(t,"f",(function(){return k})),r.d(t,"d",(function(){return E})),r.d(t,"g",(function(){return T})),r.d(t,"c",(function(){return S})),r.d(t,"a",(function(){return C})),r.d(t,"i",(function(){return A}));var n=r(0),i=r(23),o=r(161),a=r(46),s=r(9),l=r(11),c=r(28),u=r(171),p=r(124),h=r(17),d=r(27),f=r(156),m=r(162),g=r(157),b=r(158),_=r(159),y=r(160),v=[new i.a.InboundFilters,new i.a.FunctionToString,new f.a,new m.a,new g.a,new b.a,new _.a,new y.a];function x(e){if(void 0===e&&(e={}),void 0===e.defaultIntegrations&&(e.defaultIntegrations=v),void 0===e.release){var t=Object(s.a)();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0),Object(o.a)(p.a,e),e.autoSessionTracking&&function(){if(void 0===Object(s.a)().document)return void(h.a&&l.c.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));var e=Object(a.b)();if(!e.captureSession)return;M(e),Object(u.a)("history",(function(e){var t=e.from,r=e.to;void 0!==t&&t!==r&&M(Object(a.b)())}))}()}function w(e){void 0===e&&(e={});var t=Object(a.b)(),r=t.getScope();r&&(e.user=Object(n.a)(Object(n.a)({},r.getUser()),e.user)),e.eventId||(e.eventId=t.lastEventId());var i=t.getClient();i&&i.showReportDialog(e)}function k(){return Object(a.b)().lastEventId()}function E(){}function T(e){e()}function S(e){var t=Object(a.b)().getClient();return t?t.flush(e):(h.a&&l.c.warn("Cannot flush events. No client defined."),Object(c.c)(!1))}function C(e){var t=Object(a.b)().getClient();return t?t.close(e):(h.a&&l.c.warn("Cannot flush events and disable SDK. No client defined."),Object(c.c)(!1))}function A(e){return Object(d.c)(e)()}function M(e){e.startSession({ignoreDuration:!0}),e.captureSession()}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return s}));var n=r(0),i=50;function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.sort((function(e,t){return e[0]-t[0]})).map((function(e){return e[1]}));return function(e,t){var o,a,s,l;void 0===t&&(t=0);var c=[];try{for(var u=Object(n.e)(e.split("\n").slice(t)),p=u.next();!p.done;p=u.next()){var h=p.value;try{for(var d=(s=void 0,Object(n.e)(r)),f=d.next();!f.done;f=d.next()){var m=(0,f.value)(h);if(m){c.push(m);break}}}catch(e){s={error:e}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(s)throw s.error}}}}catch(e){o={error:e}}finally{try{p&&!p.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}return function(e){if(!e.length)return[];var t=e,r=t[0].function||"",o=t[t.length-1].function||"";-1===r.indexOf("captureMessage")&&-1===r.indexOf("captureException")||(t=t.slice(1));-1!==o.indexOf("sentryWrapped")&&(t=t.slice(0,-1));return t.slice(0,i).map((function(e){return Object(n.a)(Object(n.a)({},e),{filename:e.filename||t[0].filename,function:e.function||"?"})})).reverse()}(c)}}var a="<anonymous>";function s(e){try{return e&&"function"==typeof e&&e.name||a}catch(e){return a}}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return s}));var n=r(0),i=r(3);function o(e,t){return void 0===t&&(t=[]),[e,t]}function a(e){var t=Object(n.c)(e,2),r=Object(n.c)(t[1],1);return Object(n.c)(r[0],1)[0].type}function s(e){var t=Object(n.c)(e,2),r=t[0],o=t[1],a=JSON.stringify(r);return o.reduce((function(e,t){var r=Object(n.c)(t,2),o=r[0],a=r[1],s=Object(i.j)(a)?String(a):JSON.stringify(a);return e+"\n"+JSON.stringify(o)+"\n"+s}),a)}},,,,,,,,,,function(e,t,r){"use strict";r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return s}));var n=r(3);function i(e,t){return void 0===t&&(t=0),"string"!=typeof e||0===t||e.length<=t?e:e.substr(0,t)+"..."}function o(e,t){var r=e,n=r.length;if(n<=150)return r;t>n&&(t=n);var i=Math.max(t-60,0);i<5&&(i=0);var o=Math.min(i+140,n);return o>n-5&&(o=n),o===n&&(i=Math.max(o-140,0)),r=r.slice(i,o),i>0&&(r="'{snip} "+r),o<n&&(r+=" {snip}"),r}function a(e,t){if(!Array.isArray(e))return"";for(var r=[],n=0;n<e.length;n++){var i=e[n];try{r.push(String(i))}catch(e){r.push("[value cannot be serialized]")}}return r.join(t)}function s(e,t){return!!Object(n.l)(e)&&(Object(n.k)(t)?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return c})),r.d(t,"c",(function(){return u}));var n=r(9),i=r(102),o={nowSeconds:function(){return Date.now()/1e3}};var a=Object(i.b)()?function(){try{return Object(i.a)(e,"perf_hooks").performance}catch(e){return}}():function(){var e=Object(n.a)().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),s=void 0===a?o:{nowSeconds:function(){return(a.timeOrigin+a.now())/1e3}},l=o.nowSeconds.bind(o),c=s.nowSeconds.bind(s),u=c;!function(){var e=Object(n.a)().performance;if(e&&e.now){var t=36e5,r=e.now(),i=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+r-i):t,a=o<t,s=e.timing&&e.timing.navigationStart,l="number"==typeof s?Math.abs(s+r-i):t;return a||l<t?o<=l?("timeOrigin",e.timeOrigin):("navigationStart",s):("dateNow",i)}"none"}()}).call(this,r(224)(e))},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return c}));var n=r(0),i=r(38),o=r(51),a=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function s(e,t){void 0===t&&(t=!1);var r=e.host,n=e.path,i=e.pass,o=e.port,a=e.projectId;return e.protocol+"://"+e.publicKey+(t&&i?":"+i:"")+"@"+r+(o?":"+o:"")+"/"+(n?n+"/":n)+a}function l(e){return"user"in e&&!("publicKey"in e)&&(e.publicKey=e.user),{user:e.publicKey||"",protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function c(e){var t="string"==typeof e?function(e){var t=a.exec(e);if(!t)throw new i.a("Invalid Sentry Dsn: "+e);var r=Object(n.c)(t.slice(1),6),o=r[0],s=r[1],c=r[2],u=void 0===c?"":c,p=r[3],h=r[4],d=void 0===h?"":h,f="",m=r[5],g=m.split("/");if(g.length>1&&(f=g.slice(0,-1).join("/"),m=g.pop()),m){var b=m.match(/^\d+/);b&&(m=b[0])}return l({host:p,pass:u,path:f,projectId:m,port:d,protocol:o,publicKey:s})}(e):l(e);return function(e){if(o.a){var t=e.port,r=e.projectId,n=e.protocol;if(["protocol","publicKey","host","projectId"].forEach((function(t){if(!e[t])throw new i.a("Invalid Sentry Dsn: "+t+" missing")})),!r.match(/^\d+$/))throw new i.a("Invalid Sentry Dsn: Invalid projectId "+r);if(!function(e){return"http"===e||"https"===e}(n))throw new i.a("Invalid Sentry Dsn: Invalid protocol "+n);if(t&&isNaN(parseInt(t,10)))throw new i.a("Invalid Sentry Dsn: Invalid port "+t)}}(t),t}},,,,,,function(e,t,r){"use strict";r.d(t,"b",(function(){return u})),r.d(t,"d",(function(){return p})),r.d(t,"a",(function(){return h})),r.d(t,"c",(function(){return d}));var n=r(0),i=r(69),o=r(57),a=r(263),s=r(26);function l(e){if(e.metadata&&e.metadata.sdk){var t=e.metadata.sdk;return{name:t.name,version:t.version}}}function c(e,t){return t?(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=Object(n.d)(e.sdk.integrations||[],t.integrations||[]),e.sdk.packages=Object(n.d)(e.sdk.packages||[],t.packages||[]),e):e}function u(e,t){var r=l(t),a=Object(n.a)(Object(n.a)({sent_at:(new Date).toISOString()},r&&{sdk:r}),!!t.tunnel&&{dsn:Object(i.a)(t.dsn)}),s="aggregates"in e?"sessions":"session",c=[{type:s},e];return[Object(o.a)(a,[c]),s]}function p(e,t){var r=Object(n.c)(u(e,t),2),i=r[0],a=r[1];return{body:Object(o.c)(i),type:a,url:Object(s.a)(t.dsn,t.tunnel)}}function h(e,t){var r=l(t),a=e.type||"event",s=(e.sdkProcessingMetadata||{}).transactionSampling||{},u=s.method,p=s.rate;c(e,t.metadata.sdk),e.tags=e.tags||{},e.extra=e.extra||{},e.sdkProcessingMetadata&&e.sdkProcessingMetadata.baseClientNormalized||(e.tags.skippedNormalization=!0,e.extra.normalizeDepth=e.sdkProcessingMetadata?e.sdkProcessingMetadata.normalizeDepth:"unset"),delete e.sdkProcessingMetadata;var h=Object(n.a)(Object(n.a)({event_id:e.event_id,sent_at:(new Date).toISOString()},r&&{sdk:r}),!!t.tunnel&&{dsn:Object(i.a)(t.dsn)}),d=[{type:a,sample_rates:[{id:u,rate:p}]},e];return Object(o.a)(h,[d])}function d(e,t){var r,u=l(t),p=e.type||"event",h="transaction"===p||!!t.tunnel,d=(e.sdkProcessingMetadata||{}).transactionSampling||{},f=d.method,m=d.rate;c(e,t.metadata.sdk),e.tags=e.tags||{},e.extra=e.extra||{},e.sdkProcessingMetadata&&e.sdkProcessingMetadata.baseClientNormalized||(e.tags.skippedNormalization=!0,e.extra.normalizeDepth=e.sdkProcessingMetadata?e.sdkProcessingMetadata.normalizeDepth:"unset"),delete e.sdkProcessingMetadata;try{r=JSON.stringify(e)}catch(t){e.tags.JSONStringifyError=!0,e.extra.JSONStringifyError=t;try{r=JSON.stringify(Object(a.a)(e))}catch(e){var g=e;r=JSON.stringify({message:"JSON.stringify error after renormalization",extra:{message:g.message,stack:g.stack}})}}var b={body:r,type:p,url:h?Object(s.a)(t.dsn,t.tunnel):Object(s.c)(t.dsn)};if(h){var _=Object(n.a)(Object(n.a)({event_id:e.event_id,sent_at:(new Date).toISOString()},u&&{sdk:u}),!!t.tunnel&&{dsn:Object(i.a)(t.dsn)}),y=[{type:p,sample_rates:[{id:f,rate:m}]},b.body],v=Object(o.a)(_,[y]);b.body=Object(o.c)(v)}return b}},function(e,t,r){"use strict";r.d(t,"a",(function(){return _}));var n=r(0),i=r(26),o=r(75),a=r(9),s=r(439),l=r(11),c=r(57),u=r(68);var p=r(69),h=r(440),d=r(172),f=r(17),m=r(78);function g(e){return"event"===e?"error":e}var b=Object(a.a)(),_=function(){function e(e){var t=this;this.options=e,this._buffer=Object(s.a)(30),this._rateLimits={},this._outcomes={},this._api=Object(i.d)(e.dsn,e._metadata,e.tunnel),this.url=Object(i.c)(this._api.dsn),this.options.sendClientReports&&b.document&&b.document.addEventListener("visibilitychange",(function(){"hidden"===b.document.visibilityState&&t._flushOutcomes()}))}return e.prototype.sendEvent=function(e){return this._sendRequest(Object(o.c)(e,this._api),e)},e.prototype.sendSession=function(e){return this._sendRequest(Object(o.d)(e,this._api),e)},e.prototype.close=function(e){return this._buffer.drain(e)},e.prototype.recordLostEvent=function(e,t){var r;if(this.options.sendClientReports){var n=g(t)+":"+e;f.a&&l.c.log("Adding outcome: "+n),this._outcomes[n]=(null!=(r=this._outcomes[n])?r:0)+1}},e.prototype._flushOutcomes=function(){if(this.options.sendClientReports){var e=this._outcomes;if(this._outcomes={},Object.keys(e).length){f.a&&l.c.log("Flushing outcomes:\n"+JSON.stringify(e,null,2));var t,r,o,a,s=Object(i.a)(this._api.dsn,this._api.tunnel),h=Object.keys(e).map((function(t){var r=Object(n.c)(t.split(":"),2),i=r[0];return{reason:r[1],category:i,quantity:e[t]}})),d=(t=h,r=this._api.tunnel&&Object(p.a)(this._api.dsn),a=[{type:"client_report"},{timestamp:o||Object(u.a)(),discarded_events:t}],Object(c.a)(r?{dsn:r}:{},[a]));try{Object(m.b)(s,Object(c.c)(d))}catch(e){f.a&&l.c.error(e)}}else f.a&&l.c.log("No outcomes to flush")}},e.prototype._handleResponse=function(e){var t=e.requestType,r=e.response,n=e.headers,i=e.resolve,o=e.reject,a=Object(h.a)(r.status);this._rateLimits=Object(d.c)(this._rateLimits,n),this._isRateLimited(t)&&f.a&&l.c.warn("Too many "+t+" requests, backing off until: "+this._disabledUntil(t)),"success"!==a?o(r):i({status:a})},e.prototype._disabledUntil=function(e){var t=g(e);return new Date(Object(d.a)(this._rateLimits,t))},e.prototype._isRateLimited=function(e){var t=g(e);return Object(d.b)(this._rateLimits,t)},e}()},,function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return u}));var n=r(9),i=r(103),o=r(11);var a,s=r(17),l=Object(n.a)();function c(){if(a)return a;if(Object(i.a)(l.fetch))return a=l.fetch.bind(l);var e=l.document,t=l.fetch;if(e&&"function"==typeof e.createElement)try{var r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r);var n=r.contentWindow;n&&n.fetch&&(t=n.fetch),e.head.removeChild(r)}catch(e){s.a&&o.c.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return a=t.bind(l)}function u(e,t){if("[object Navigator]"===Object.prototype.toString.call(l&&l.navigator)&&"function"==typeof l.navigator.sendBeacon)return l.navigator.sendBeacon.bind(l.navigator)(e,t);if(Object(i.b)()){var r=c();r(e,{body:t,method:"POST",credentials:"omit",keepalive:!0}).then(null,(function(e){}))}else;}},function(e,t,r){"use strict";r.d(t,"a",(function(){return y})),r.d(t,"b",(function(){return x})),r.d(t,"c",(function(){return M})),r.d(t,"d",(function(){return v}));var n=r(126),i=r(82),o=r(167),a=r(168),s=r(104);const l=e=>null==e,c=e=>!l(e),u=(e,t,r)=>d(t,e)===d(r,e);function p(e){return e&&e.length&&new RegExp(["^\\/([a-zA-Z0-9@\\-%_~.:]","[/a-zA-Z0-9@\\-%_~.:]*)?","([?][^#]*)?(#[^#]*)?$"].join("")).test(e)}function h(e,t,r){return e.matched.some((e=>Object.values(e.components).some((e=>e.options&&e.options[t]===r))))}function d(e="",t){let r=e.split("?")[0];return t&&t.base&&(r=r.replace(t.base,"/")),"/"===r.charAt(r.length-1)&&(r=r.slice(0,-1)),r=r.replace(/\/+/g,"/"),r}function f(e){return"string"==typeof e?e:JSON.stringify(e)}function m(e){if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e}function g(e,t){if(!t||!e||"object"!=typeof e)return e;if(t in e)return e[t];const r=Array.isArray(t)?t:(t+"").split(".");let n=e;for(;r.length&&n;)n=n[r.shift()];return n}function b(e,t){return e&&t&&"string"==typeof e&&!e.startsWith(t)?t+" "+e:e}class _{constructor(e,t){this.ctx=e,this.options=t,this._initState()}setUniversal(e,t){return l(t)?this.removeUniversal(e):(this.setCookie(e,t),this.setLocalStorage(e,t),this.setState(e,t),t)}getUniversal(e){let t;return l(t)&&(t=this.getCookie(e)),l(t)&&(t=this.getLocalStorage(e)),l(t)&&(t=this.getState(e)),t}syncUniversal(e,t){let r=this.getUniversal(e);return l(r)&&c(t)&&(r=t),c(r)&&this.setUniversal(e,r),r}removeUniversal(e){this.removeState(e),this.removeLocalStorage(e),this.removeCookie(e)}_initState(){if(i.set(this,"_state",{}),this._useVuex=this.options.vuex&&!!this.ctx.store,this._useVuex){const e={namespaced:!0,state:()=>this.options.initialState,mutations:{SET(e,t){i.set(e,t.key,t.value)}}};this.ctx.store.registerModule(this.options.vuex.namespace,e,{preserveState:Boolean(this.ctx.store.state[this.options.vuex.namespace])}),this.state=this.ctx.store.state[this.options.vuex.namespace]}else i.set(this,"state",{})}setState(e,t){return"_"===e[0]?i.set(this._state,e,t):this._useVuex?this.ctx.store.commit(this.options.vuex.namespace+"/SET",{key:e,value:t}):i.set(this.state,e,t),t}getState(e){return"_"!==e[0]?this.state[e]:this._state[e]}watchState(e,t){if(this._useVuex)return this.ctx.store.watch((t=>g(t[this.options.vuex.namespace],e)),t)}removeState(e){this.setState(e,void 0)}setLocalStorage(e,t){if(l(t))return this.removeLocalStorage(e);if(!this.isLocalStorageEnabled())return;const r=this.getPrefix()+e;try{localStorage.setItem(r,f(t))}catch(e){if(!this.options.ignoreExceptions)throw e}return t}getLocalStorage(e){if(!this.isLocalStorageEnabled())return;const t=this.getPrefix()+e;return m(localStorage.getItem(t))}removeLocalStorage(e){if(!this.isLocalStorageEnabled())return;const t=this.getPrefix()+e;localStorage.removeItem(t)}getCookies(){if(!this.isCookiesEnabled())return;const e=document.cookie;return o.parse(e||"")||{}}setCookie(e,t,r={}){if(!this.options.cookie)return;if(!this.isCookiesEnabled())return;const n=(void 0!==r.prefix?r.prefix:this.options.cookie.prefix)+e,i=Object.assign({},this.options.cookie.options,r),a=f(t);l(t)&&(i.maxAge=-1),"number"==typeof i.expires&&(i.expires=new Date(Date.now()+864e5*i.expires));const s=o.serialize(n,a,i);return document.cookie=s,t}getCookie(e){if(!this.options.cookie)return;if(!this.isCookiesEnabled())return;const t=this.options.cookie.prefix+e,r=this.getCookies();return m(r[t]?decodeURIComponent(r[t]):void 0)}removeCookie(e,t){this.setCookie(e,void 0,t)}getPrefix(){if(!this.options.localStorage)throw new Error("Cannot get prefix; localStorage is off");return this.options.localStorage.prefix}isLocalStorageEnabled(){if(!this.options.localStorage)return!1;const e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return this.options.ignoreExceptions,!1}}isCookiesEnabled(){return!!this.options.cookie&&!!window.navigator.cookieEnabled}}class y{constructor(e,t){this.strategies={},this._errorListeners=[],this._redirectListeners=[],this.ctx=e,this.options=t;const r=new _(e,{...t,initialState:{user:null,loggedIn:!1}});this.$storage=r,this.$state=r.state}get state(){return this._stateWarnShown||(this._stateWarnShown=!0),this.$state}get strategy(){return this.getStrategy()}getStrategy(e=!0){if(e){if(!this.$state.strategy)throw new Error("No strategy is set!");if(!this.strategies[this.$state.strategy])throw new Error("Strategy not supported: "+this.$state.strategy)}return this.strategies[this.$state.strategy]}get user(){return this.$state.user}get loggedIn(){return this.$state.loggedIn}get busy(){return this.$storage.getState("busy")}async init(){if(this.options.resetOnError&&this.onError(((...e)=>{("function"!=typeof this.options.resetOnError||this.options.resetOnError(...e))&&this.reset()})),this.$storage.syncUniversal("strategy",this.options.defaultStrategy),!this.getStrategy(!1)&&(this.$storage.setUniversal("strategy",this.options.defaultStrategy),!this.getStrategy(!1)))return Promise.resolve();try{await this.mounted()}catch(e){this.callOnError(e)}finally{this.options.watchLoggedIn&&this.$storage.watchState("loggedIn",(e=>{h(this.ctx.route,"auth",!1)||this.redirect(e?"home":"logout")}))}}getState(e){return this._getStateWarnShown||(this._getStateWarnShown=!0),this.$storage.getState(e)}registerStrategy(e,t){this.strategies[e]=t}setStrategy(e){if(e===this.$storage.getUniversal("strategy"))return Promise.resolve();if(!this.strategies[e])throw new Error(`Strategy ${e} is not defined!`);return this.reset(),this.$storage.setUniversal("strategy",e),this.mounted()}mounted(...e){return this.getStrategy().mounted?Promise.resolve(this.getStrategy().mounted(...e)).catch((e=>(this.callOnError(e,{method:"mounted"}),Promise.reject(e)))):this.fetchUserOnce()}loginWith(e,...t){return this.setStrategy(e).then((()=>this.login(...t)))}login(...e){return this.getStrategy().login?this.wrapLogin(this.getStrategy().login(...e)).catch((e=>(this.callOnError(e,{method:"login"}),Promise.reject(e)))):Promise.resolve()}fetchUser(...e){return this.getStrategy().fetchUser?Promise.resolve(this.getStrategy().fetchUser(...e)).catch((e=>(this.callOnError(e,{method:"fetchUser"}),Promise.reject(e)))):Promise.resolve()}logout(...e){return this.getStrategy().logout?Promise.resolve(this.getStrategy().logout(...e)).catch((e=>(this.callOnError(e,{method:"logout"}),Promise.reject(e)))):(this.reset(),Promise.resolve())}setUserToken(e,t){return this.getStrategy().setUserToken?Promise.resolve(this.getStrategy().setUserToken(e,t)).catch((e=>(this.callOnError(e,{method:"setUserToken"}),Promise.reject(e)))):(this.getStrategy().token.set(e),Promise.resolve())}reset(...e){return this.getStrategy().reset||(this.setUser(!1),this.getStrategy().token.reset(),this.getStrategy().refreshToken.reset()),this.getStrategy().reset(...e)}refreshTokens(){return this.getStrategy().refreshController?Promise.resolve(this.getStrategy().refreshController.handleRefresh()).catch((e=>(this.callOnError(e,{method:"refreshTokens"}),Promise.reject(e)))):Promise.resolve()}check(...e){return this.getStrategy().check?this.getStrategy().check(...e):{valid:!0}}fetchUserOnce(...e){return this.$state.user?Promise.resolve():this.fetchUser(...e)}setUser(e){this.$storage.setState("user",e);let t={valid:Boolean(e)};t.valid&&(t=this.check()),this.$storage.setState("loggedIn",t.valid)}request(e,t={}){const r="object"==typeof t?Object.assign({},t,e):e;if(""===r.baseURL&&(r.baseURL=n(this.ctx.req)),this.ctx.app.$axios)return this.ctx.app.$axios.request(r).catch((e=>(this.callOnError(e,{method:"request"}),Promise.reject(e))))}requestWith(e,t,r){const n=this.getStrategy().token.get(),i=Object.assign({},r,t),o=this.strategies[e].options.token.name||"Authorization";return i.headers||(i.headers={}),!i.headers[o]&&c(n)&&n&&"string"==typeof n&&(i.headers[o]=n),this.request(i)}wrapLogin(e){return this.$storage.setState("busy",!0),this.error=null,Promise.resolve(e).then((e=>(this.$storage.setState("busy",!1),e))).catch((e=>(this.$storage.setState("busy",!1),Promise.reject(e))))}onError(e){this._errorListeners.push(e)}callOnError(e,t={}){this.error=e;for(const r of this._errorListeners)r(e,t)}redirect(e,t=!1){if(!this.options.redirect)return;const r=this.options.fullPathRedirect?this.ctx.route.fullPath:this.ctx.route.path;let n=this.options.redirect[e];if(n){if(this.options.rewriteRedirects&&("login"===e&&p(r)&&!u(this.ctx,n,r)&&this.$storage.setUniversal("redirect",r),"home"===e)){const e=this.$storage.getUniversal("redirect");this.$storage.setUniversal("redirect",null),p(e)&&(n=e)}n=this.callOnRedirect(n,r)||n,u(this.ctx,n,r)||(t?(p(n)&&!n.includes(this.ctx.base)&&(n=d("/"+this.ctx.base+"/"+n)),window.location.replace(n)):this.ctx.redirect(n,this.ctx.query))}}onRedirect(e){this._redirectListeners.push(e)}callOnRedirect(e,t){for(const r of this._redirectListeners)e=r(e,t)||e;return e}hasScope(e){const t=this.$state.user&&g(this.$state.user,this.options.scopeKey);return!!t&&(Array.isArray(t)?t.includes(e):Boolean(g(t,e)))}}const v=async e=>{if(h(e.route,"auth",!1))return;const t=function(e,t=[]){return[].concat(...e.matched.map((function(e,r){return Object.keys(e.components).map((function(n){return t.push(r),e.components[n]}))})))}(e.route,[]);if(!t.length)return;const{login:r,callback:n}=e.$auth.options.redirect,i=h(e.route,"auth","guest"),o=t=>d(e.route.path,e)===d(t,e);if(e.$auth.$state.loggedIn){const{tokenExpired:t,refreshTokenExpired:n,isRefreshable:a}=e.$auth.check(!0);if((!r||o(r)||i)&&e.$auth.redirect("home"),n)e.$auth.reset();else if(t)if(a)try{await e.$auth.refreshTokens()}catch(t){e.$auth.reset()}else e.$auth.reset()}else i||n&&o(n)||e.$auth.redirect("login")};Error;class x extends Error{constructor(){super("Both token and refresh token have expired. Your request was aborted."),this.name="ExpiredAuthSessionError"}}var w,k;(k=w||(w={})).UNKNOWN="UNKNOWN",k.VALID="VALID",k.EXPIRED="EXPIRED";class E{constructor(e,t){this._status=this._calculate(e,t)}unknown(){return w.UNKNOWN===this._status}valid(){return w.VALID===this._status}expired(){return w.EXPIRED===this._status}_calculate(e,t){const r=Date.now();try{if(!e||!t)return w.UNKNOWN}catch(e){return w.UNKNOWN}return r<(t-=500)?w.VALID:w.EXPIRED}}class T{constructor(e,t){this.scheme=e,this.axios=t,this.interceptor=null}setHeader(e){this.scheme.options.token.global&&this.axios.setHeader(this.scheme.options.token.name,e)}clearHeader(){this.scheme.options.token.global&&this.axios.setHeader(this.scheme.options.token.name,!1)}initializeRequestInterceptor(e){this.interceptor=this.axios.interceptors.request.use((async t=>{if(!this._needToken(t)||t.url===e)return t;const{valid:r,tokenExpired:n,refreshTokenExpired:i,isRefreshable:o}=this.scheme.check(!0);let a=r;if(i)throw this.scheme.reset(),new x;if(n){if(!o)throw this.scheme.reset(),new x;a=await this.scheme.refreshTokens().then((()=>!0)).catch((()=>{throw this.scheme.reset(),new x}))}const s=this.scheme.token.get();if(!a){if(!s&&this._requestHasAuthorizationHeader(t))throw new x;return t}return this._getUpdatedRequestConfig(t,s)}))}reset(){this.axios.interceptors.request.eject(this.interceptor),this.interceptor=null}_needToken(e){const t=this.scheme.options;return t.token.global||Object.values(t.endpoints).some((t=>"object"==typeof t?t.url===e.url:t===e.url))}_getUpdatedRequestConfig(e,t){return"string"==typeof t&&(e.headers[this.scheme.options.token.name]=t),e}_requestHasAuthorizationHeader(e){return!!e.headers.common[this.scheme.options.token.name]}}class S{constructor(e,t){this.scheme=e,this.$storage=t}get(){const e=this.scheme.options.token.prefix+this.scheme.name;return this.$storage.getUniversal(e)}set(e){const t=b(e,this.scheme.options.token.type);return this._setToken(t),this._updateExpiration(t),"string"==typeof t&&this.scheme.requestHandler.setHeader(t),t}sync(){const e=this._syncToken();return this._syncExpiration(),"string"==typeof e&&this.scheme.requestHandler.setHeader(e),e}reset(){this.scheme.requestHandler.clearHeader(),this._setToken(!1),this._setExpiration(!1)}status(){return new E(this.get(),this._getExpiration())}_getExpiration(){const e=this.scheme.options.token.expirationPrefix+this.scheme.name;return this.$storage.getUniversal(e)}_setExpiration(e){const t=this.scheme.options.token.expirationPrefix+this.scheme.name;return this.$storage.setUniversal(t,e)}_syncExpiration(){const e=this.scheme.options.token.expirationPrefix+this.scheme.name;return this.$storage.syncUniversal(e)}_updateExpiration(e){let t;const r=Date.now(),n=1e3*Number(this.scheme.options.token.maxAge),i=n?r+n:0;try{t=1e3*s(e+"").exp||i}catch(e){if(t=i,!e||"InvalidTokenError"!==e.name)throw e}return this._setExpiration(t||!1)}_setToken(e){const t=this.scheme.options.token.prefix+this.scheme.name;return this.$storage.setUniversal(t,e)}_syncToken(){const e=this.scheme.options.token.prefix+this.scheme.name;return this.$storage.syncUniversal(e)}}class C{constructor(e,...t){this.$auth=e,this.options=t.reduce(((e,t)=>a(e,t)),{})}get name(){return this.options.name}}const A={name:"local",endpoints:{login:{url:"/api/auth/login",method:"post"},logout:{url:"/api/auth/logout",method:"post"},user:{url:"/api/auth/user",method:"get"}},token:{property:"token",type:"Bearer",name:"Authorization",maxAge:1800,global:!0,required:!0,prefix:"_token.",expirationPrefix:"_token_expiration."},user:{property:"user",autoFetch:!0},clientId:!1,grantType:!1,scope:!1};class M extends C{constructor(e,t,...r){super(e,t,...r,A),this.token=new S(this,this.$auth.$storage),this.requestHandler=new T(this,this.$auth.ctx.$axios)}check(e=!1){const t={valid:!1,tokenExpired:!1};if(!this.token.sync())return t;if(!e)return t.valid=!0,t;return this.token.status().expired()?(t.tokenExpired=!0,t):(t.valid=!0,t)}mounted({tokenCallback:e=(()=>this.$auth.reset()),refreshTokenCallback:t}={}){const{tokenExpired:r,refreshTokenExpired:n}=this.check(!0);return n&&"function"==typeof t?t():r&&"function"==typeof e&&e(),this.initializeRequestInterceptor(),this.$auth.fetchUserOnce()}async login(e,{reset:t=!0}={}){if(!this.options.endpoints.login)return;t&&this.$auth.reset({resetInterceptor:!1}),this.options.clientId&&(e.data.client_id=this.options.clientId),this.options.grantType&&(e.data.grant_type=this.options.grantType),this.options.scope&&(e.data.scope=this.options.scope);const r=await this.$auth.request(e,this.options.endpoints.login);return this.updateTokens(r),this.requestHandler.interceptor||this.initializeRequestInterceptor(),this.options.user.autoFetch&&await this.fetchUser(),r}setUserToken(e){return this.token.set(e),this.fetchUser()}fetchUser(e){return this.check().valid?this.options.endpoints.user?this.$auth.requestWith(this.name,e,this.options.endpoints.user).then((e=>{const t=g(e.data,this.options.user.property);if(!t){const e=new Error(`User Data response does not contain field ${this.options.user.property}`);return Promise.reject(e)}return this.$auth.setUser(t),e})).catch((e=>(this.$auth.callOnError(e,{method:"fetchUser"}),Promise.reject(e)))):(this.$auth.setUser({}),Promise.resolve()):Promise.resolve()}async logout(e={}){return this.options.endpoints.logout&&await this.$auth.requestWith(this.name,e,this.options.endpoints.logout).catch((()=>{})),this.$auth.reset()}reset({resetInterceptor:e=!0}={}){this.$auth.setUser(!1),this.token.reset(),e&&this.requestHandler.reset()}updateTokens(e){const t=!this.options.token.required||g(e.data,this.options.token.property);this.token.set(t)}initializeRequestInterceptor(){this.requestHandler.initializeRequestInterceptor()}}},function(e,t,r){"use strict";var n={name:"NoSsr",functional:!0,props:{placeholder:String,placeholderTag:{type:String,default:"div"}},render:function(e,t){var r=t.parent,n=t.slots,i=t.props,o=n(),a=o.default;void 0===a&&(a=[]);var s=o.placeholder;return r._isMounted?a:(r.$once("hook:mounted",(function(){r.$forceUpdate()})),i.placeholderTag&&(i.placeholder||s)?e(i.placeholderTag,{class:["no-ssr-placeholder"]},i.placeholder||s):a.length>0?a.map((function(){return e(!1)})):e(!1))}};e.exports=n},function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return u}));var n=r(0),i=r(3),o=r(68),a=r(28),s=r(9),l=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}return e.clone=function(t){var r=new e;return t&&(r._breadcrumbs=Object(n.d)(t._breadcrumbs),r._tags=Object(n.a)({},t._tags),r._extra=Object(n.a)({},t._extra),r._contexts=Object(n.a)({},t._contexts),r._user=t._user,r._level=t._level,r._span=t._span,r._session=t._session,r._transactionName=t._transactionName,r._fingerprint=t._fingerprint,r._eventProcessors=Object(n.d)(t._eventProcessors),r._requestSession=t._requestSession),r},e.prototype.addScopeListener=function(e){this._scopeListeners.push(e)},e.prototype.addEventProcessor=function(e){return this._eventProcessors.push(e),this},e.prototype.setUser=function(e){return this._user=e||{},this._session&&this._session.update({user:e}),this._notifyScopeListeners(),this},e.prototype.getUser=function(){return this._user},e.prototype.getRequestSession=function(){return this._requestSession},e.prototype.setRequestSession=function(e){return this._requestSession=e,this},e.prototype.setTags=function(e){return this._tags=Object(n.a)(Object(n.a)({},this._tags),e),this._notifyScopeListeners(),this},e.prototype.setTag=function(e,t){var r;return this._tags=Object(n.a)(Object(n.a)({},this._tags),((r={})[e]=t,r)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(e){return this._extra=Object(n.a)(Object(n.a)({},this._extra),e),this._notifyScopeListeners(),this},e.prototype.setExtra=function(e,t){var r;return this._extra=Object(n.a)(Object(n.a)({},this._extra),((r={})[e]=t,r)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(e){return this._fingerprint=e,this._notifyScopeListeners(),this},e.prototype.setLevel=function(e){return this._level=e,this._notifyScopeListeners(),this},e.prototype.setTransactionName=function(e){return this._transactionName=e,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(e){return this.setTransactionName(e)},e.prototype.setContext=function(e,t){var r;return null===t?delete this._contexts[e]:this._contexts=Object(n.a)(Object(n.a)({},this._contexts),((r={})[e]=t,r)),this._notifyScopeListeners(),this},e.prototype.setSpan=function(e){return this._span=e,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.prototype.getTransaction=function(){var e=this.getSpan();return e&&e.transaction},e.prototype.setSession=function(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if("function"==typeof t){var r=t(this);return r instanceof e?r:this}return t instanceof e?(this._tags=Object(n.a)(Object(n.a)({},this._tags),t._tags),this._extra=Object(n.a)(Object(n.a)({},this._extra),t._extra),this._contexts=Object(n.a)(Object(n.a)({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):Object(i.i)(t)&&(this._tags=Object(n.a)(Object(n.a)({},this._tags),t.tags),this._extra=Object(n.a)(Object(n.a)({},this._extra),t.extra),this._contexts=Object(n.a)(Object(n.a)({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession)),this},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},e.prototype.addBreadcrumb=function(e,t){var r="number"==typeof t?Math.min(t,100):100;if(r<=0)return this;var i=Object(n.a)({timestamp:Object(o.a)()},e);return this._breadcrumbs=Object(n.d)(this._breadcrumbs,[i]).slice(-r),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype.applyToEvent=function(e,t){if(this._extra&&Object.keys(this._extra).length&&(e.extra=Object(n.a)(Object(n.a)({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=Object(n.a)(Object(n.a)({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=Object(n.a)(Object(n.a)({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=Object(n.a)(Object(n.a)({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=Object(n.a)({trace:this._span.getTraceContext()},e.contexts);var r=this._span.transaction&&this._span.transaction.name;r&&(e.tags=Object(n.a)({transaction:r},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=Object(n.d)(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors(Object(n.d)(c(),this._eventProcessors),e,t)},e.prototype.setSDKProcessingMetadata=function(e){return this._sdkProcessingMetadata=Object(n.a)(Object(n.a)({},this._sdkProcessingMetadata),e),this},e.prototype._notifyEventProcessors=function(e,t,r,o){var s=this;return void 0===o&&(o=0),new a.a((function(a,l){var c=e[o];if(null===t||"function"!=typeof c)a(t);else{var u=c(Object(n.a)({},t),r);Object(i.n)(u)?u.then((function(t){return s._notifyEventProcessors(e,t,r,o+1).then(a)})).then(null,l):s._notifyEventProcessors(e,u,r,o+1).then(a).then(null,l)}}))},e.prototype._notifyScopeListeners=function(){var e=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();function c(){return Object(s.b)("globalEventProcessors",(function(){return[]}))}function u(e){c().push(e)}},,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";(function(e,n){r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var i=r(248);function o(){return!Object(i.a)()&&"[object process]"===Object.prototype.toString.call(void 0!==e?e:0)}function a(e,t){return e.require(t)}}).call(this,r(87),r(224)(e))},function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return c})),r.d(t,"e",(function(){return u})),r.d(t,"c",(function(){return p}));var n=r(51),i=r(9),o=r(11);function a(){if(!("fetch"in Object(i.a)()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function s(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function l(){if(!a())return!1;var e=Object(i.a)();if(s(e.fetch))return!0;var t=!1,r=e.document;if(r&&"function"==typeof r.createElement)try{var l=r.createElement("iframe");l.hidden=!0,r.head.appendChild(l),l.contentWindow&&l.contentWindow.fetch&&(t=s(l.contentWindow.fetch)),r.head.removeChild(l)}catch(e){n.a&&o.c.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}function c(){return"ReportingObserver"in Object(i.a)()}function u(){if(!a())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(e){return!1}}function p(){var e=Object(i.a)(),t=e.chrome,r=t&&t.app&&t.app.runtime,n="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!r&&n}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype=new Error,n.prototype.name="InvalidCharacterError";var i="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new n("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,i,o=0,a=0,s="";i=t.charAt(a++);~i&&(r=o%4?64*r+i:i,o++%4)?s+=String.fromCharCode(255&r>>(-2*o&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return s};function o(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(i(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return i(t)}}function a(e){this.message=e}function s(e,t){if("string"!=typeof e)throw new a("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(o(e.split(".")[r]))}catch(e){throw new a("Invalid token specified: "+e.message)}}a.prototype=new Error,a.prototype.name="InvalidTokenError";const l=s;l.default=s,l.InvalidTokenError=a,e.exports=l},function(e,t,r){"use strict";r.d(t,"f",(function(){return a})),r.d(t,"e",(function(){return s})),r.d(t,"d",(function(){return c})),r.d(t,"b",(function(){return u})),r.d(t,"a",(function(){return p})),r.d(t,"c",(function(){return h}));var n=r(0),i=r(9),o=r(10);r(67);function a(){var e=Object(i.a)(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var r=new Uint16Array(8);t.getRandomValues(r),r[3]=4095&r[3]|16384,r[4]=16383&r[4]|32768;var n=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return n(r[0])+n(r[1])+n(r[2])+n(r[3])+n(r[4])+n(r[5])+n(r[6])+n(r[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function s(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+r+n}}function l(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function c(e){var t=e.message,r=e.event_id;if(t)return t;var n=l(e);return n?n.type&&n.value?n.type+": "+n.value:n.type||n.value||r||"<unknown>":r||"<unknown>"}function u(e,t,r){var n=e.exception=e.exception||{},i=n.values=n.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type=r||"Error")}function p(e,t){var r=l(e);if(r){var i=r.mechanism;if(r.mechanism=Object(n.a)(Object(n.a)(Object(n.a)({},{type:"generic",handled:!0}),i),t),t&&"data"in t){var o=Object(n.a)(Object(n.a)({},i&&i.data),t.data);r.mechanism.data=o}}}function h(e){if(e&&e.__sentry_captured__)return!0;try{Object(o.a)(e,"__sentry_captured__",!0)}catch(e){}return!1}},,,,,,,,,,,,,,,function(e,t,r){"use strict";e.exports={API_ORIGIN:"https://api.mapbox.com",EVENT_PROGRESS_DOWNLOAD:"downloadProgress",EVENT_PROGRESS_UPLOAD:"uploadProgress",EVENT_ERROR:"error",EVENT_RESPONSE:"response",ERROR_HTTP:"HttpError",ERROR_REQUEST_ABORTED:"RequestAbortedError"}},function(e,t){e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e};var r=Object.prototype.hasOwnProperty},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(28),i=function(){function e(){}return e.prototype.sendEvent=function(e){return Object(n.c)({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:"skipped"})},e.prototype.close=function(e){return Object(n.c)(!0)},e}()},function(e,t,r){"use strict";r.r(t);var n=r(157);r.d(t,"GlobalHandlers",(function(){return n.a}));var i=r(156);r.d(t,"TryCatch",(function(){return i.a}));var o=r(162);r.d(t,"Breadcrumbs",(function(){return o.a}));var a=r(158);r.d(t,"LinkedErrors",(function(){return a.a}));var s=r(160);r.d(t,"UserAgent",(function(){return s.a}));var l=r(159);r.d(t,"Dedupe",(function(){return l.a}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return x}));var n=r(0),i=r(225),o=r(243),a=r(9),s=r(11),l=r(26),c=r(230),u=r(264),p=r(103),h=r(45),d=r(226),f=r(227),m=r(228),g=r(229),b=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.b)(t,e),t.prototype.eventFromException=function(e,t){return Object(h.a)(e,t,this._options.attachStacktrace)},t.prototype.eventFromMessage=function(e,t,r){return void 0===t&&(t=u.a.Info),Object(h.b)(e,t,r,this._options.attachStacktrace)},t.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var t=Object(n.a)(Object(n.a)({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,sendClientReports:this._options.sendClientReports,_metadata:this._options._metadata}),r=Object(l.d)(t.dsn,t._metadata,t.tunnel),i=Object(l.a)(r.dsn,r.tunnel);if(this._options.transport)return new this._options.transport(t);if(Object(p.b)()){var o=Object(n.a)({},t.fetchParameters);return this._newTransport=Object(d.a)({requestOptions:o,url:i}),new f.a(t)}return this._newTransport=Object(m.a)({url:i,headers:t.headers}),new g.a(t)},t}(c.a),_=r(17),y=r(27),v=r(162),x=function(e){function t(t){void 0===t&&(t={});return t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:i.a}],version:i.a},e.call(this,b,t)||this}return Object(n.b)(t,e),t.prototype.showReportDialog=function(e){void 0===e&&(e={}),Object(a.a)().document&&(this._isEnabled()?Object(y.a)(Object(n.a)(Object(n.a)({},e),{dsn:e.dsn||this.getDsn()})):_.a&&s.c.error("Trying to call showReportDialog with Sentry Client disabled"))},t.prototype._prepareEvent=function(t,r,n){return t.platform=t.platform||"javascript",e.prototype._prepareEvent.call(this,t,r,n)},t.prototype._sendEvent=function(t){var r=this.getIntegration(v.a);r&&r.addSentryBreadcrumb(t),e.prototype._sendEvent.call(this,t)},t}(o.a)},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(439),i=r(57),o=r(172),a=r(28),s=r(440),l=30;function c(e,t,r){void 0===r&&(r=Object(n.a)(e.bufferSize||l));var c={};return{send:function(e){var n=Object(i.b)(e),l="event"===n?"error":n,p={category:l,body:Object(i.c)(e)};return Object(o.b)(c,l)?Object(a.b)({status:"rate_limit",reason:u(c,l)}):r.add((function(){return t(p).then((function(e){var t=e.body,r=e.headers,n=e.reason,i=e.statusCode,p=Object(s.a)(i);return r&&(c=Object(o.c)(c,r)),"success"===p?Object(a.c)({status:p,reason:n}):Object(a.b)({status:p,reason:n||t||("rate_limit"===p?u(c,l):"Unknown transport error")})}))}))},flush:function(e){return r.drain(e)}}}function u(e,t){return"Too many "+t+" requests, backing off until: "+new Date(Object(o.a)(e,t)).toISOString()}},function(e,t,r){"use strict";var n=function(e,t=!0){const r=t&&e.headers?e.headers["x-forwarded-proto"]:void 0,n="string"==typeof r?r.includes("https"):void 0;if(n)return!0;const i=e.connection?e.connection.encrypted:void 0,o=void 0!==i?!0===i:void 0;return!!o||void 0===n&&void 0===o&&void 0};const i="undefined"!=typeof location?location:{origin:"",pathname:"/"};e.exports=function(e,t){return e?encodeURI("http"+(n(e)?"s":"")+"://"+(e.headers["x-forwarded-host"]||e.headers.host)+(t?e.url:"")):i.origin+(t?i.pathname:"")}},,,,,function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){var r=t.split(".").slice(-1)[0];if(e[r])throw new Error("The key `".concat(r,"` is already in use."));return e[r]=t,e}),{})}function a(e){return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var o=n("string"==typeof r[0]?[].concat(r):[""].concat(r),4),a=o[0],s=o[1],l=o[2],c=o[3];return a.length&&"/"!==a.charAt(a.length-1)&&(a+="/"),l="".concat(a).concat(l||"getField"),c="".concat(a).concat(c||"updateField"),e(a,s,l,c)}}function s(e){return function(t){return t.split(/[.[\]]+/).reduce((function(e,t){return e[t]}),e)}}function l(e,t){var r=t.path,n=t.value;r.split(/[.[\]]+/).reduce((function(e,t,r,i){return i.length===r+1&&(e[t]=n),e[t]}),e)}r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return c})),r.d(t,"c",(function(){return l}));a((function(e,t,r,n){var i=Array.isArray(t)?o(t):t;return Object.keys(i).reduce((function(e,t){var o=i[t],a={get:function(){return this.$store.getters[r](o)},set:function(e){this.$store.commit(n,{path:o,value:e})}};return e[t]=a,e}),{})}));var c=a((function(e,t,r,n){var i=Array.isArray(t)?o(t):t;return Object.keys(i).reduce((function(e,t){var o=i[t];return e[t]={get:function(){var e,t=this.$store,i=(e=t.getters[r](o),Object.keys(e).map((function(t){return[t,e[t]]})));return i.map((function(e){return Object.keys(e[1]).reduce((function(i,a){var s="".concat(o,"[").concat(e[0],"].").concat(a);return Object.defineProperty(i,a,{get:function(){return t.getters[r](s)},set:function(e){t.commit(n,{path:s,value:e})}})}),{})}))}},e}),{})}))},,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";e.exports=function(e,t){return t||(t={}),"string"!=typeof(e=e&&e.__esModule?e.default:e)?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e)}},,function(e,t,r){"use strict";r.r(t);var n=r(76);r.d(t,"BaseTransport",(function(){return n.a}));var i=r(227);r.d(t,"FetchTransport",(function(){return i.a}));var o=r(229);r.d(t,"XHRTransport",(function(){return o.a}));var a=r(226);r.d(t,"makeNewFetchTransport",(function(){return a.a}));var s=r(228);r.d(t,"makeNewXHRTransport",(function(){return s.a}))},,function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),i=r(9),o=r(10),a=r(53),s=r(27),l=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],c=function(){function e(t){this.name=e.id,this._options=Object(n.a)({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t)}return e.prototype.setupOnce=function(){var e=Object(i.a)();this._options.setTimeout&&Object(o.e)(e,"setTimeout",u),this._options.setInterval&&Object(o.e)(e,"setInterval",u),this._options.requestAnimationFrame&&Object(o.e)(e,"requestAnimationFrame",p),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&Object(o.e)(XMLHttpRequest.prototype,"send",h);var t=this._options.eventTarget;t&&(Array.isArray(t)?t:l).forEach(d)},e.id="TryCatch",e}();function u(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0];return t[0]=Object(s.c)(n,{mechanism:{data:{function:Object(a.b)(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function p(e){return function(t){return e.apply(this,[Object(s.c)(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Object(a.b)(e)},handled:!0,type:"instrument"}})])}}function h(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((function(e){e in n&&"function"==typeof n[e]&&Object(o.e)(n,e,(function(t){var r={mechanism:{data:{function:e,handler:Object(a.b)(t)},handled:!0,type:"instrument"}},n=Object(o.f)(t);return n&&(r.mechanism.data.handler=Object(a.b)(n)),Object(s.c)(t,r)}))})),e.apply(this,t)}}function d(e){var t=Object(i.a)(),r=t[e]&&t[e].prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&(Object(o.e)(r,"addEventListener",(function(t){return function(r,n,i){try{"function"==typeof n.handleEvent&&(n.handleEvent=Object(s.c)(n.handleEvent.bind(n),{mechanism:{data:{function:"handleEvent",handler:Object(a.b)(n),target:e},handled:!0,type:"instrument"}}))}catch(e){}return t.apply(this,[r,Object(s.c)(n,{mechanism:{data:{function:"addEventListener",handler:Object(a.b)(n),target:e},handled:!0,type:"instrument"}}),i])}})),Object(o.e)(r,"removeEventListener",(function(e){return function(t,r,n){var i=r;try{var o=i&&i.__sentry_wrapped__;o&&e.call(this,t,o,n)}catch(e){}return e.call(this,t,i,n)}})))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(0),i=r(46),o=r(264),a=r(171),s=r(3),l=r(165),c=r(11),u=r(105),p=r(45),h=r(17),d=r(27),f=function(){function e(t){this.name=e.id,this._installFunc={onerror:m,onunhandledrejection:g},this._options=Object(n.a)({onerror:!0,onunhandledrejection:!0},t)}return e.prototype.setupOnce=function(){Error.stackTraceLimit=50;var e,t=this._options;for(var r in t){var n=this._installFunc[r];n&&t[r]&&(e=r,h.a&&c.c.log("Global Handler attached: "+e),n(),this._installFunc[r]=void 0)}},e.id="GlobalHandlers",e}();function m(){Object(a.a)("error",(function(e){var t=Object(n.c)(y(),2),r=t[0],i=t[1];if(r.getIntegration(f)){var a=e.msg,l=e.url,c=e.line,u=e.column,h=e.error;if(!(Object(d.b)()||h&&h.__sentry_own_request__)){var m=void 0===h&&Object(s.l)(a)?function(e,t,r,n){var i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,o=Object(s.e)(e)?e.message:e,a="Error",l=o.match(i);l&&(a=l[1],o=l[2]);var c={exception:{values:[{type:a,value:o}]}};return b(c,t,r,n)}(a,l,c,u):b(Object(p.c)(h||a,void 0,i,!1),l,c,u);m.level=o.a.Error,_(r,h,m,"onerror")}}}))}function g(){Object(a.a)("unhandledrejection",(function(e){var t=Object(n.c)(y(),2),r=t[0],i=t[1];if(r.getIntegration(f)){var a=e;try{"reason"in e?a=e.reason:"detail"in e&&"reason"in e.detail&&(a=e.detail.reason)}catch(e){}if(Object(d.b)()||a&&a.__sentry_own_request__)return!0;var l=Object(s.j)(a)?{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(a)}]}}:Object(p.c)(a,void 0,i,!0);l.level=o.a.Error,_(r,a,l,"onunhandledrejection")}}))}function b(e,t,r,n){var i=e.exception=e.exception||{},o=i.values=i.values||[],a=o[0]=o[0]||{},c=a.stacktrace=a.stacktrace||{},u=c.frames=c.frames||[],p=isNaN(parseInt(n,10))?void 0:n,h=isNaN(parseInt(r,10))?void 0:r,d=Object(s.l)(t)&&t.length>0?t:Object(l.a)();return 0===u.length&&u.push({colno:p,filename:d,function:"?",in_app:!0,lineno:h}),e}function _(e,t,r,n){Object(u.a)(r,{handled:!1,type:n}),e.captureEvent(r,{originalException:t})}function y(){var e=Object(i.b)(),t=e.getClient();return[e,t&&t.getOptions().attachStacktrace]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(0),i=r(81),o=r(46),a=r(3),s=r(45),l=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._key=t.key||"cause",this._limit=t.limit||5}return e.prototype.setupOnce=function(){Object(i.b)((function(t,r){var i=Object(o.b)().getIntegration(e);return i?function(e,t,r,i){if(!(r.exception&&r.exception.values&&i&&Object(a.g)(i.originalException,Error)))return r;var o=c(t,i.originalException,e);return r.exception.values=Object(n.d)(o,r.exception.values),r}(i._key,i._limit,t,r):t}))},e.id="LinkedErrors",e}();function c(e,t,r,i){if(void 0===i&&(i=[]),!Object(a.g)(t[r],Error)||i.length+1>=e)return i;var o=Object(s.d)(t[r]);return c(e,t[r],r,Object(n.d)([o],i))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(11),i=r(17),o=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(t,r){t((function(t){var o=r().getIntegration(e);if(o){try{if(function(e,t){if(!t)return!1;if(function(e,t){var r=e.message,n=t.message;if(!r&&!n)return!1;if(r&&!n||!r&&n)return!1;if(r!==n)return!1;if(!s(e,t))return!1;if(!a(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){var r=l(t),n=l(e);if(!r||!n)return!1;if(r.type!==n.type||r.value!==n.value)return!1;if(!s(e,t))return!1;if(!a(e,t))return!1;return!0}(e,t))return!0;return!1}(t,o._previousEvent))return i.a&&n.c.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){return o._previousEvent=t}return o._previousEvent=t}return t}))},e.id="Dedupe",e}();function a(e,t){var r=c(e),n=c(t);if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++){var o=n[i],a=r[i];if(o.filename!==a.filename||o.lineno!==a.lineno||o.colno!==a.colno||o.function!==a.function)return!1}return!0}function s(e,t){var r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;try{return!(r.join("")!==n.join(""))}catch(e){return!1}}function l(e){return e.exception&&e.exception.values&&e.exception.values[0]}function c(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}else if(e.stacktrace)return e.stacktrace.frames}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(0),i=r(81),o=r(46),a=r(9),s=Object(a.a)(),l=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){Object(i.b)((function(t){if(Object(o.b)().getIntegration(e)){if(!s.navigator&&!s.location&&!s.document)return t;var r=t.request&&t.request.url||s.location&&s.location.href,i=(s.document||{}).referrer,a=(s.navigator||{}).userAgent,l=Object(n.a)(Object(n.a)(Object(n.a)({},t.request&&t.request.headers),i&&{Referer:i}),a&&{"User-Agent":a}),c=Object(n.a)(Object(n.a)({},r&&{url:r}),{headers:l});return Object(n.a)(Object(n.a)({},t),{request:c})}return t}))},e.id="UserAgent",e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(46),i=r(11),o=r(14);function a(e,t){!0===t.debug&&o.a&&i.c.enable();var r=Object(n.b)(),a=r.getScope();a&&a.update(t.initialScope);var s=new e(t);r.bindClient(s)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(0),i=r(46),o=r(264),a=r(105),s=r(171),l=r(165),c=["fatal","error","warning","log","info","debug","critical"];function u(e){return"warn"===e?o.a.Warning:function(e){return-1!==c.indexOf(e)}(e)?e:o.a.Log}var p=r(67),h=r(9),d=function(){function e(t){this.name=e.id,this._options=Object(n.a)({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype.addSentryBreadcrumb=function(e){this._options.sentry&&Object(i.b)().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:Object(a.d)(e)},{event:e})},e.prototype.setupOnce=function(){this._options.console&&Object(s.a)("console",f),this._options.dom&&Object(s.a)("dom",function(e){function t(t){var r,n="object"==typeof e?e.serializeAttribute:void 0;"string"==typeof n&&(n=[n]);try{r=t.event.target?Object(l.b)(t.event.target,n):Object(l.b)(t.event,n)}catch(e){r="<unknown>"}0!==r.length&&Object(i.b)().addBreadcrumb({category:"ui."+t.name,message:r},{event:t.event,name:t.name,global:t.global})}return t}(this._options.dom)),this._options.xhr&&Object(s.a)("xhr",m),this._options.fetch&&Object(s.a)("fetch",g),this._options.history&&Object(s.a)("history",b)},e.id="Breadcrumbs",e}();function f(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:u(e.level),message:Object(p.b)(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message="Assertion failed: "+(Object(p.b)(e.args.slice(1)," ")||"console.assert"),t.data.arguments=e.args.slice(1)}Object(i.b)().addBreadcrumb(t,{input:e.args,level:e.level})}function m(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;var t=e.xhr.__sentry_xhr__||{},r=t.method,n=t.url,o=t.status_code,a=t.body;Object(i.b)().addBreadcrumb({category:"xhr",data:{method:r,url:n,status_code:o},type:"http"},{xhr:e.xhr,input:a})}else;}function g(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?Object(i.b)().addBreadcrumb({category:"fetch",data:e.fetchData,level:o.a.Error,type:"http"},{data:e.error,input:e.args}):Object(i.b)().addBreadcrumb({category:"fetch",data:Object(n.a)(Object(n.a)({},e.fetchData),{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response})))}function b(e){var t=Object(h.a)(),r=e.from,n=e.to,o=Object(a.e)(t.location.href),s=Object(a.e)(r),l=Object(a.e)(n);s.path||(s=o),o.protocol===l.protocol&&o.host===l.host&&(n=l.relative),o.protocol===s.protocol&&o.host===s.host&&(r=s.relative),Object(i.b)().addBreadcrumb({category:"navigation",data:{from:r,to:n}})}},function(e,t,r){"use strict";var n={name:"ClientOnly",functional:!0,props:{placeholder:String,placeholderTag:{type:String,default:"div"}},render:function(e,t){var r=t.parent,n=t.slots,i=t.props,o=n(),a=o.default;void 0===a&&(a=[]);var s=o.placeholder;return r._isMounted?a:(r.$once("hook:mounted",(function(){r.$forceUpdate()})),i.placeholderTag&&(i.placeholder||s)?e(i.placeholderTag,{class:["client-only-placeholder"]},i.placeholder||s):a.length>0?a.map((function(){return e(!1)})):e(!1))}};e.exports=n},,function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return s}));var n=r(9),i=r(3);function o(e,t){try{for(var r=e,n=[],i=0,o=0,s=void 0;r&&i++<5&&!("html"===(s=a(r,t))||i>1&&o+3*n.length+s.length>=80);)n.push(s),o+=s.length,r=r.parentNode;return n.reverse().join(" > ")}catch(e){return"<unknown>"}}function a(e,t){var r,n,o,a,s,l=e,c=[];if(!l||!l.tagName)return"";c.push(l.tagName.toLowerCase());var u=t&&t.length?t.filter((function(e){return l.getAttribute(e)})).map((function(e){return[e,l.getAttribute(e)]})):null;if(u&&u.length)u.forEach((function(e){c.push("["+e[0]+'="'+e[1]+'"]')}));else if(l.id&&c.push("#"+l.id),(r=l.className)&&Object(i.l)(r))for(n=r.split(/\s+/),s=0;s<n.length;s++)c.push("."+n[s]);var p=["type","name","title","alt"];for(s=0;s<p.length;s++)o=p[s],(a=l.getAttribute(o))&&c.push("["+o+'="'+a+'"]');return c.join("")}function s(){var e=Object(n.a)();try{return e.document.location.href}catch(e){return""}}},,,function(e,t,r){"use strict";function n(e){return null!==e&&"object"==typeof e}function i(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",o=arguments.length>3?arguments[3]:void 0;if(!n(t))return i(e,{},r,o);var a=Object.assign({},t);for(var s in e)if("__proto__"!==s&&"constructor"!==s){var l=e[s];null!=l&&(o&&o(a,s,l,r)||(Array.isArray(l)&&Array.isArray(a[s])?a[s]=a[s].concat(l):n(l)&&n(a[s])?a[s]=i(l,a[s],(r?"".concat(r,"."):"")+s.toString(),o):a[s]=l))}return a}function o(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.reduce(((t,r)=>i(t,r,"",e)),{})}}r(59),r(63),r(111);var a=o();a.fn=o(((e,t,r,n)=>{if(void 0!==e[t]&&"function"==typeof r)return e[t]=r(e[t]),!0})),a.arrayFn=o(((e,t,r,n)=>{if(Array.isArray(e[t])&&"function"==typeof r)return e[t]=r(e[t]),!0})),a.extend=o,e.exports=a},function(e,t,r){"use strict";r.r(t),r.d(t,"Severity",(function(){return i.a})),r.d(t,"addGlobalEventProcessor",(function(){return o.b})),r.d(t,"addBreadcrumb",(function(){return a.a})),r.d(t,"captureException",(function(){return a.c})),r.d(t,"captureEvent",(function(){return a.b})),r.d(t,"captureMessage",(function(){return a.d})),r.d(t,"configureScope",(function(){return a.e})),r.d(t,"getHubFromCarrier",(function(){return s.c})),r.d(t,"getCurrentHub",(function(){return s.b})),r.d(t,"Hub",(function(){return s.a})),r.d(t,"makeMain",(function(){return s.d})),r.d(t,"Scope",(function(){return o.a})),r.d(t,"Session",(function(){return l.a})),r.d(t,"startTransaction",(function(){return a.l})),r.d(t,"SDK_VERSION",(function(){return c.a})),r.d(t,"setContext",(function(){return a.f})),r.d(t,"setExtra",(function(){return a.g})),r.d(t,"setExtras",(function(){return a.h})),r.d(t,"setTag",(function(){return a.i})),r.d(t,"setTags",(function(){return a.j})),r.d(t,"setUser",(function(){return a.k})),r.d(t,"withScope",(function(){return a.m})),r.d(t,"BrowserClient",(function(){return u.a})),r.d(t,"injectReportDialog",(function(){return p.a})),r.d(t,"eventFromException",(function(){return h.a})),r.d(t,"eventFromMessage",(function(){return h.b})),r.d(t,"defaultIntegrations",(function(){return d.b})),r.d(t,"forceLoad",(function(){return d.d})),r.d(t,"init",(function(){return d.e})),r.d(t,"lastEventId",(function(){return d.f})),r.d(t,"onLoad",(function(){return d.g})),r.d(t,"showReportDialog",(function(){return d.h})),r.d(t,"flush",(function(){return d.c})),r.d(t,"close",(function(){return d.a})),r.d(t,"wrap",(function(){return d.i})),r.d(t,"SDK_NAME",(function(){return f})),r.d(t,"Integrations",(function(){return x})),r.d(t,"Transports",(function(){return _}));var n=r(0),i=r(264),o=r(81),a=r(22),s=r(46),l=r(250),c=r(225),u=r(124),p=r(27),h=r(45),d=r(50),f="sentry.javascript.browser",m=r(23),g=r(9),b=r(123),_=r(154),y={},v=Object(g.a)();v.Sentry&&v.Sentry.Integrations&&(y=v.Sentry.Integrations);var x=Object(n.a)(Object(n.a)(Object(n.a)({},y),m.a),b)},function(e,t,r){"use strict";function n(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return c}));var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^/]+?|)(\.[^./]*|))(?:[/]*)$/;function o(e){var t=i.exec(e);return t?t.slice(1):[]}function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r="",i=!1,o=e.length-1;o>=-1&&!i;o--){var a=o>=0?e[o]:"/";a&&(r=a+"/"+r,i="/"===a.charAt(0))}return(i?"/":"")+(r=n(r.split("/").filter((function(e){return!!e})),!i).join("/"))||"."}function s(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}function l(e,t){e=a(e).substr(1),t=a(t).substr(1);for(var r=s(e.split("/")),n=s(t.split("/")),i=Math.min(r.length,n.length),o=i,l=0;l<i;l++)if(r[l]!==n[l]){o=l;break}var c=[];for(l=o;l<r.length;l++)c.push("..");return(c=c.concat(n.slice(o))).join("/")}function c(e,t){var r=o(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return g}));var n,i=r(0),o=r(51),a=r(9),s=r(3),l=r(11),c=r(10),u=r(53),p=r(103),h=Object(a.a)(),d={},f={};function m(e){if(!f[e])switch(f[e]=!0,e){case"console":!function(){if(!("console"in h))return;l.a.forEach((function(e){e in h.console&&Object(c.e)(h.console,e,(function(t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];b("console",{args:r,level:e}),t&&t.apply(h.console,r)}}))}))}();break;case"dom":!function(){if(!("document"in h))return;var e=b.bind(null,"dom"),t=k(e,!0);h.document.addEventListener("click",t,!1),h.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((function(t){var r=h[t]&&h[t].prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&(Object(c.e)(r,"addEventListener",(function(t){return function(r,n,i){if("click"===r||"keypress"==r)try{var o=this,a=o.__sentry_instrumentation_handlers__=o.__sentry_instrumentation_handlers__||{},s=a[r]=a[r]||{refCount:0};if(!s.handler){var l=k(e);s.handler=l,t.call(this,r,l,i)}s.refCount+=1}catch(e){}return t.call(this,r,n,i)}})),Object(c.e)(r,"removeEventListener",(function(e){return function(t,r,n){if("click"===t||"keypress"==t)try{var i=this,o=i.__sentry_instrumentation_handlers__||{},a=o[t];a&&(a.refCount-=1,a.refCount<=0&&(e.call(this,t,a.handler,n),a.handler=void 0,delete o[t]),0===Object.keys(o).length&&delete i.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,r,n)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in h))return;var e=XMLHttpRequest.prototype;Object(c.e)(e,"open",(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this,i=t[1],o=n.__sentry_xhr__={method:Object(s.l)(t[0])?t[0].toUpperCase():t[0],url:t[1]};Object(s.l)(i)&&"POST"===o.method&&i.match(/sentry_key/)&&(n.__sentry_own_request__=!0);var a=function(){if(4===n.readyState){try{o.status_code=n.status}catch(e){}b("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:n})}};return"onreadystatechange"in n&&"function"==typeof n.onreadystatechange?Object(c.e)(n,"onreadystatechange",(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return a(),e.apply(n,t)}})):n.addEventListener("readystatechange",a),e.apply(n,t)}})),Object(c.e)(e,"send",(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return this.__sentry_xhr__&&void 0!==t[0]&&(this.__sentry_xhr__.body=t[0]),b("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}();break;case"fetch":!function(){if(!Object(p.d)())return;Object(c.e)(h,"fetch",(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n={args:t,fetchData:{method:_(t),url:y(t)},startTimestamp:Date.now()};return b("fetch",Object(i.a)({},n)),e.apply(h,t).then((function(e){return b("fetch",Object(i.a)(Object(i.a)({},n),{endTimestamp:Date.now(),response:e})),e}),(function(e){throw b("fetch",Object(i.a)(Object(i.a)({},n),{endTimestamp:Date.now(),error:e})),e}))}}))}();break;case"history":!function(){if(!Object(p.c)())return;var e=h.onpopstate;function t(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=t.length>2?t[2]:void 0;if(i){var o=n,a=String(i);n=a,b("history",{from:o,to:a})}return e.apply(this,t)}}h.onpopstate=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=h.location.href,o=n;if(n=i,b("history",{from:o,to:i}),e)try{return e.apply(this,t)}catch(e){}},Object(c.e)(h.history,"pushState",t),Object(c.e)(h.history,"replaceState",t)}();break;case"error":E=h.onerror,h.onerror=function(e,t,r,n,i){return b("error",{column:n,error:i,line:r,msg:e,url:t}),!!E&&E.apply(this,arguments)};break;case"unhandledrejection":T=h.onunhandledrejection,h.onunhandledrejection=function(e){return b("unhandledrejection",e),!T||T.apply(this,arguments)};break;default:return void(o.a&&l.c.warn("unknown instrumentation type:",e))}}function g(e,t){d[e]=d[e]||[],d[e].push(t),m(e)}function b(e,t){var r,n;if(e&&d[e])try{for(var a=Object(i.e)(d[e]||[]),s=a.next();!s.done;s=a.next()){var c=s.value;try{c(t)}catch(t){o.a&&l.c.error("Error while triggering instrumentation handler.\nType: "+e+"\nName: "+Object(u.b)(c)+"\nError:",t)}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}function _(e){return void 0===e&&(e=[]),"Request"in h&&Object(s.g)(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function y(e){return void 0===e&&(e=[]),"string"==typeof e[0]?e[0]:"Request"in h&&Object(s.g)(e[0],Request)?e[0].url:String(e[0])}var v,x,w=1e3;function k(e,t){return void 0===t&&(t=!1),function(r){if(r&&x!==r&&!function(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(e){}return!0}(r)){var n="keypress"===r.type?"input":r.type;(void 0===v||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(e){}return!1}(x,r))&&(e({event:r,name:n,global:t}),x=r),clearTimeout(v),v=h.setTimeout((function(){v=void 0}),w)}}}var E=null;var T=null},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return s}));var n=r(0),i=6e4;function o(e,t){return e[t]||e.all||0}function a(e,t,r){return void 0===r&&(r=Date.now()),o(e,t)>r}function s(e,t,r){var o,a,s,l;void 0===r&&(r=Date.now());var c=Object(n.a)({},e),u=t["x-sentry-rate-limits"],p=t["retry-after"];if(u)try{for(var h=Object(n.e)(u.trim().split(",")),d=h.next();!d.done;d=h.next()){var f=d.value.split(":",2),m=parseInt(f[0],10),g=1e3*(isNaN(m)?60:m);if(f[1])try{for(var b=(s=void 0,Object(n.e)(f[1].split(";"))),_=b.next();!_.done;_=b.next()){c[_.value]=r+g}}catch(e){s={error:e}}finally{try{_&&!_.done&&(l=b.return)&&l.call(b)}finally{if(s)throw s.error}}else c.all=r+g}}catch(e){o={error:e}}finally{try{d&&!d.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}else p&&(c.all=r+function(e,t){void 0===t&&(t=Date.now());var r=parseInt(""+e,10);if(!isNaN(r))return 1e3*r;var n=Date.parse(""+e);return isNaN(n)?i:n-t}(p,r));return c}},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(o=i.key,a=void 0,a=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(o,"string"),"symbol"===n(a)?a:String(a)),i)}var o,a}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,n;return t=e,n=[{key:"innerWidth",value:function(e){var t=e.offsetWidth,r=getComputedStyle(e);return t+=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight)}},{key:"width",value:function(e){var t=e.offsetWidth,r=getComputedStyle(e);return t-=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),t}},{key:"getWindowScrollTop",value:function(){var e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}},{key:"getWindowScrollLeft",value:function(){var e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}},{key:"getOuterWidth",value:function(e,t){if(e){var r=e.offsetWidth;if(t){var n=getComputedStyle(e);r+=parseFloat(n.marginLeft)+parseFloat(n.marginRight)}return r}return 0}},{key:"getOuterHeight",value:function(e,t){if(e){var r=e.offsetHeight;if(t){var n=getComputedStyle(e);r+=parseFloat(n.marginTop)+parseFloat(n.marginBottom)}return r}return 0}},{key:"getClientHeight",value:function(e,t){if(e){var r=e.clientHeight;if(t){var n=getComputedStyle(e);r+=parseFloat(n.marginTop)+parseFloat(n.marginBottom)}return r}return 0}},{key:"getViewport",value:function(){var e=window,t=document,r=t.documentElement,n=t.getElementsByTagName("body")[0];return{width:e.innerWidth||r.clientWidth||n.clientWidth,height:e.innerHeight||r.clientHeight||n.clientHeight}}},{key:"getOffset",value:function(e){var t=e.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:t.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}},{key:"generateZIndex",value:function(){return this.zindex=this.zindex||999,++this.zindex}},{key:"getCurrentZIndex",value:function(){return this.zindex}},{key:"index",value:function(e){for(var t=e.parentNode.childNodes,r=0,n=0;n<t.length;n++){if(t[n]===e)return r;1===t[n].nodeType&&r++}return-1}},{key:"addMultipleClasses",value:function(e,t){if(e.classList)for(var r=t.split(" "),n=0;n<r.length;n++)e.classList.add(r[n]);else for(var i=t.split(" "),o=0;o<i.length;o++)e.className+=" "+i[o]}},{key:"addClass",value:function(e,t){e.classList?e.classList.add(t):e.className+=" "+t}},{key:"removeClass",value:function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}},{key:"hasClass",value:function(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className))}},{key:"find",value:function(e,t){return e.querySelectorAll(t)}},{key:"findSingle",value:function(e,t){return e.querySelector(t)}},{key:"getHeight",value:function(e){var t=e.offsetHeight,r=getComputedStyle(e);return t-=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom)+parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth)}},{key:"getWidth",value:function(e){var t=e.offsetWidth,r=getComputedStyle(e);return t-=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight)+parseFloat(r.borderLeftWidth)+parseFloat(r.borderRightWidth)}},{key:"absolutePosition",value:function(e,t){var r,n,i=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),o=i.height,a=i.width,s=t.offsetHeight,l=t.offsetWidth,c=t.getBoundingClientRect(),u=this.getWindowScrollTop(),p=this.getWindowScrollLeft(),h=this.getViewport();c.top+s+o>h.height?(r=c.top+u-o,e.style.transformOrigin="bottom",r<0&&(r=u)):(r=s+c.top+u,e.style.transformOrigin="top"),n=c.left+a>h.width?Math.max(0,c.left+p+l-a):c.left+p,e.style.top=r+"px",e.style.left=n+"px"}},{key:"relativePosition",value:function(e,t){var r,n,i=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),o=t.offsetHeight,a=t.getBoundingClientRect(),s=this.getViewport();a.top+o+i.height>s.height?(r=-1*i.height,e.style.transformOrigin="bottom",a.top+r<0&&(r=-1*a.top)):(r=o,e.style.transformOrigin="top"),n=i.width>s.width?-1*a.left:a.left+i.width>s.width?-1*(a.left+i.width-s.width):0,e.style.top=r+"px",e.style.left=n+"px"}},{key:"getParents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null===e.parentNode?t:this.getParents(e.parentNode,t.concat([e.parentNode]))}},{key:"getScrollableParents",value:function(e){var t,r,n=[];if(e){var o,a=this.getParents(e),s=/(auto|scroll)/,l=i(a);try{for(l.s();!(o=l.n()).done;){var c=o.value,u=1===c.nodeType&&c.dataset.scrollselectors;if(u){var p,h=i(u.split(","));try{for(h.s();!(p=h.n()).done;){var d=p.value,f=this.findSingle(c,d);f&&(t=f,r=void 0,r=window.getComputedStyle(t,null),s.test(r.getPropertyValue("overflow"))||s.test(r.getPropertyValue("overflowX"))||s.test(r.getPropertyValue("overflowY")))&&n.push(f)}}catch(e){h.e(e)}finally{h.f()}}}}catch(e){l.e(e)}finally{l.f()}}return n}},{key:"getHiddenElementOuterHeight",value:function(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetHeight;return e.style.display="none",e.style.visibility="visible",t}},{key:"getHiddenElementOuterWidth",value:function(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetWidth;return e.style.display="none",e.style.visibility="visible",t}},{key:"getHiddenElementDimensions",value:function(e){var t={};return e.style.visibility="hidden",e.style.display="block",t.width=e.offsetWidth,t.height=e.offsetHeight,e.style.display="none",e.style.visibility="visible",t}},{key:"fadeIn",value:function(e,t){e.style.opacity=0;var r=+new Date,n=0;!function i(){n=+e.style.opacity+((new Date).getTime()-r)/t,e.style.opacity=n,r=+new Date,+n<1&&(window.requestAnimationFrame&&requestAnimationFrame(i)||setTimeout(i,16))}()}},{key:"fadeOut",value:function(e,t){var r=1,n=50/t,i=setInterval((function(){(r-=n)<=0&&(r=0,clearInterval(i)),e.style.opacity=r}),50)}},{key:"getUserAgent",value:function(){return navigator.userAgent}},{key:"appendChild",value:function(e,t){if(this.isElement(t))t.appendChild(e);else{if(!t.el||!t.el.nativeElement)throw new Error("Cannot append "+t+" to "+e);t.el.nativeElement.appendChild(e)}}},{key:"scrollInView",value:function(e,t){var r=getComputedStyle(e).getPropertyValue("borderTopWidth"),n=r?parseFloat(r):0,i=getComputedStyle(e).getPropertyValue("paddingTop"),o=i?parseFloat(i):0,a=e.getBoundingClientRect(),s=t.getBoundingClientRect().top+document.body.scrollTop-(a.top+document.body.scrollTop)-n-o,l=e.scrollTop,c=e.clientHeight,u=this.getOuterHeight(t);s<0?e.scrollTop=l+s:s+u>c&&(e.scrollTop=l+s-c+u)}},{key:"clearSelection",value:function(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}},{key:"calculateScrollbarWidth",value:function(){if(null!=this.calculatedScrollbarWidth)return this.calculatedScrollbarWidth;var e=document.createElement("div");e.className="p-scrollbar-measure",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),this.calculatedScrollbarWidth=t,t}},{key:"getBrowser",value:function(){if(!this.browser){var e=this.resolveUserAgent();this.browser={},e.browser&&(this.browser[e.browser]=!0,this.browser.version=e.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser}},{key:"resolveUserAgent",value:function(){var e=navigator.userAgent.toLowerCase(),t=/(chrome)[ ]([\w.]+)/.exec(e)||/(webkit)[ ]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}}},{key:"isVisible",value:function(e){return null!=e.offsetParent}},{key:"invokeElementMethod",value:function(e,t,r){e[t].apply(e,r)}},{key:"getFocusableElements",value:function(t){var r,n=[],o=i(e.find(t,'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), \n                [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), \n                input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), \n                textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), \n                [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'));try{for(o.s();!(r=o.n()).done;){var a=r.value;"none"!=getComputedStyle(a).display&&"hidden"!=getComputedStyle(a).visibility&&n.push(a)}}catch(e){o.e(e)}finally{o.f()}return n}},{key:"getFirstFocusableElement",value:function(e){var t=this.getFocusableElements(e);return t.length>0?t[0]:null}},{key:"isClickable",value:function(e){var t=e.nodeName,r=e.parentElement&&e.parentElement.nodeName;return"INPUT"==t||"BUTTON"==t||"A"==t||"INPUT"==r||"BUTTON"==r||"A"==r||this.hasClass(e,"p-button")||this.hasClass(e.parentElement,"p-button")||this.hasClass(e.parentElement,"p-checkbox")||this.hasClass(e.parentElement,"p-radiobutton")}},{key:"applyStyle",value:function(e,t){if("string"==typeof t)e.style.cssText=t;else for(var r in t)e.style[r]=t[r]}},{key:"isIOS",value:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}},{key:"isAndroid",value:function(){return/(android)/i.test(navigator.userAgent)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}}],(r=null)&&a(t.prototype,r),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=s},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n="6.19.7"},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),i=r(125),o=r(78);function a(e,t){return void 0===t&&(t=Object(o.a)()),Object(i.a)({bufferSize:e.bufferSize},(function(r){var i=Object(n.a)({body:r.body,method:"POST",referrerPolicy:"origin"},e.requestOptions);return t(e.url,i).then((function(e){return e.text().then((function(t){return{body:t,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")},reason:e.statusText,statusCode:e.status}}))}))}))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),i=r(103),o=r(28),a=r(38),s=r(76),l=r(78),c=function(e){function t(t,r){void 0===r&&(r=Object(l.a)());var n=e.call(this,t)||this;return n._fetch=r,n}return Object(n.b)(t,e),t.prototype._sendRequest=function(e,t){var r=this;if(this._isRateLimited(e.type))return this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429});var n={body:e.body,method:"POST",referrerPolicy:Object(i.e)()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(n,this.options.fetchParameters),void 0!==this.options.headers&&(n.headers=this.options.headers),this._buffer.add((function(){return new o.a((function(t,i){r._fetch(e.url,n).then((function(n){var o={"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")};r._handleResponse({requestType:e.type,response:n,headers:o,resolve:t,reject:i})})).catch(i)}))})).then(void 0,(function(t){throw t instanceof a.a?r.recordLostEvent("queue_overflow",e.type):r.recordLostEvent("network_error",e.type),t}))},t}(s.a)},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(125),i=r(28),o=4;function a(e){return Object(n.a)({bufferSize:e.bufferSize},(function(t){return new i.a((function(r,n){var i=new XMLHttpRequest;for(var a in i.onreadystatechange=function(){if(i.readyState===o){var e={body:i.response,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")},reason:i.statusText,statusCode:i.status};r(e)}},i.open("POST",e.url),e.headers)Object.prototype.hasOwnProperty.call(e.headers,a)&&i.setRequestHeader(a,e.headers[a]);i.send(t.body)}))}))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),i=r(28),o=r(38),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.b)(t,e),t.prototype._sendRequest=function(e,t){var r=this;return this._isRateLimited(e.type)?(this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429})):this._buffer.add((function(){return new i.a((function(t,n){var i=new XMLHttpRequest;for(var o in i.onreadystatechange=function(){if(4===i.readyState){var o={"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")};r._handleResponse({requestType:e.type,response:i,headers:o,resolve:t,reject:n})}},i.open("POST",e.url),r.options.headers)Object.prototype.hasOwnProperty.call(r.options.headers,o)&&i.setRequestHeader(o,r.options.headers[o]);i.send(e.body)}))})).then(void 0,(function(t){throw t instanceof o.a?r.recordLostEvent("queue_overflow",e.type):r.recordLostEvent("network_error",e.type),t}))},t}(r(76).a)},function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(0),i=r(11),o=r(38),a=r(26),s=r(14),l=r(75),c=r(122),u=function(){function e(e){this._options=e,this._options.dsn||s.a&&i.c.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return e.prototype.eventFromException=function(e,t){throw new o.a("Backend has to implement `eventFromException` method")},e.prototype.eventFromMessage=function(e,t,r){throw new o.a("Backend has to implement `eventFromMessage` method")},e.prototype.sendEvent=function(e){if(this._newTransport&&this._options.dsn&&this._options._experiments&&this._options._experiments.newTransport){var t=Object(a.d)(this._options.dsn,this._options._metadata,this._options.tunnel),r=Object(l.a)(e,t);this._newTransport.send(r).then(null,(function(e){s.a&&i.c.error("Error while sending event:",e)}))}else this._transport.sendEvent(e).then(null,(function(e){s.a&&i.c.error("Error while sending event:",e)}))},e.prototype.sendSession=function(e){if(this._transport.sendSession)if(this._newTransport&&this._options.dsn&&this._options._experiments&&this._options._experiments.newTransport){var t=Object(a.d)(this._options.dsn,this._options._metadata,this._options.tunnel),r=Object(n.c)(Object(l.b)(e,t),1)[0];this._newTransport.send(r).then(null,(function(e){s.a&&i.c.error("Error while sending session:",e)}))}else this._transport.sendSession(e).then(null,(function(e){s.a&&i.c.error("Error while sending session:",e)}));else s.a&&i.c.warn("Dropping session because custom transport doesn't implement sendSession")},e.prototype.getTransport=function(){return this._transport},e.prototype._setupTransport=function(){return new c.a},e}()},,,,,,,,,,function(e,t,r){"use strict";var n=r(414),i=r(241);function o(e){i.call(this,e)}o.prototype=Object.create(i.prototype),o.prototype.constructor=o,o.prototype.sendRequest=n.browserSend,o.prototype.abortRequest=n.browserAbort,e.exports=function(e){return new o(e)}},function(e,t,r){"use strict";var n=r(242),i=r(420),o=r(120);function a(e){if(!e||!e.accessToken)throw new Error("Cannot create a client without an access token");n(e.accessToken),this.accessToken=e.accessToken,this.origin=e.origin||o.API_ORIGIN}a.prototype.createRequest=function(e){return new i(this,e)},e.exports=a},function(e,t,r){"use strict";var n=r(419),i={};function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e){if(i[e])return i[e];var t=e.split("."),r=t[0],a=t[1];if(!a)throw new Error("Invalid token");var s=function(e){try{return JSON.parse(n.decode(e))}catch(e){throw new Error("Invalid token")}}(a),l={usage:r,user:s.u};return o(s,"a")&&(l.authorization=s.a),o(s,"exp")&&(l.expires=1e3*s.exp),o(s,"iat")&&(l.created=1e3*s.iat),o(s,"scopes")&&(l.scopes=s.scopes),o(s,"client")&&(l.client=s.client),o(s,"ll")&&(l.lastLogin=s.ll),o(s,"iu")&&(l.impersonator=s.iu),i[e]=l,l}},function(e,t,r){"use strict";r.d(t,"a",(function(){return x}));var n=r(0),i=r(81),o=r(69),a=r(105),s=r(11),l=r(3),c=r(28),u=r(68),p=r(263),h=r(67),d=r(38),f=r(14),m=r(46),g=r(10),b=[];function _(e){return e.reduce((function(e,t){return e.every((function(e){return t.name!==e.name}))&&e.push(t),e}),[])}function y(e){var t={};return function(e){var t=e.defaultIntegrations&&Object(n.d)(e.defaultIntegrations)||[],r=e.integrations,i=Object(n.d)(_(t));Array.isArray(r)?i=Object(n.d)(i.filter((function(e){return r.every((function(t){return t.name!==e.name}))})),_(r)):"function"==typeof r&&(i=r(i),i=Array.isArray(i)?i:[i]);var o=i.map((function(e){return e.name})),a="Debug";return-1!==o.indexOf(a)&&i.push.apply(i,Object(n.d)(i.splice(o.indexOf(a),1))),i}(e).forEach((function(e){t[e.name]=e,function(e){-1===b.indexOf(e.name)&&(e.setupOnce(i.b,m.b),b.push(e.name),f.a&&s.c.log("Integration installed: "+e.name))}(e)})),Object(g.a)(t,"initialized",!0),t}var v="Not capturing exception because it's already been captured.",x=function(){function e(e,t){this._integrations={},this._numProcessing=0,this._backend=new e(t),this._options=t,t.dsn&&(this._dsn=Object(o.b)(t.dsn))}return e.prototype.captureException=function(e,t,r){var n=this;if(!Object(a.c)(e)){var i=t&&t.event_id;return this._process(this._getBackend().eventFromException(e,t).then((function(e){return n._captureEvent(e,t,r)})).then((function(e){i=e}))),i}f.a&&s.c.log(v)},e.prototype.captureMessage=function(e,t,r,n){var i=this,o=r&&r.event_id,a=Object(l.j)(e)?this._getBackend().eventFromMessage(String(e),t,r):this._getBackend().eventFromException(e,r);return this._process(a.then((function(e){return i._captureEvent(e,r,n)})).then((function(e){o=e}))),o},e.prototype.captureEvent=function(e,t,r){if(!(t&&t.originalException&&Object(a.c)(t.originalException))){var n=t&&t.event_id;return this._process(this._captureEvent(e,t,r).then((function(e){n=e}))),n}f.a&&s.c.log(v)},e.prototype.captureSession=function(e){this._isEnabled()?"string"!=typeof e.release?f.a&&s.c.warn("Discarded session because of missing or non-string release"):(this._sendSession(e),e.update({init:!1})):f.a&&s.c.warn("SDK not enabled, will not capture session.")},e.prototype.getDsn=function(){return this._dsn},e.prototype.getOptions=function(){return this._options},e.prototype.getTransport=function(){return this._getBackend().getTransport()},e.prototype.flush=function(e){var t=this;return this._isClientDoneProcessing(e).then((function(r){return t.getTransport().close(e).then((function(e){return r&&e}))}))},e.prototype.close=function(e){var t=this;return this.flush(e).then((function(e){return t.getOptions().enabled=!1,e}))},e.prototype.setupIntegrations=function(){this._isEnabled()&&!this._integrations.initialized&&(this._integrations=y(this._options))},e.prototype.getIntegration=function(e){try{return this._integrations[e.id]||null}catch(t){return f.a&&s.c.warn("Cannot retrieve integration "+e.id+" from the current Client"),null}},e.prototype._updateSessionFromEvent=function(e,t){var r,i,o=!1,a=!1,s=t.exception&&t.exception.values;if(s){a=!0;try{for(var l=Object(n.e)(s),c=l.next();!c.done;c=l.next()){var u=c.value.mechanism;if(u&&!1===u.handled){o=!0;break}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}var p="ok"===e.status;(p&&0===e.errors||p&&o)&&(e.update(Object(n.a)(Object(n.a)({},o&&{status:"crashed"}),{errors:e.errors||Number(a||o)})),this.captureSession(e))},e.prototype._sendSession=function(e){this._getBackend().sendSession(e)},e.prototype._isClientDoneProcessing=function(e){var t=this;return new c.a((function(r){var n=0,i=setInterval((function(){0==t._numProcessing?(clearInterval(i),r(!0)):(n+=1,e&&n>=e&&(clearInterval(i),r(!1)))}),1)}))},e.prototype._getBackend=function(){return this._backend},e.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},e.prototype._prepareEvent=function(e,t,r){var o=this,s=this.getOptions(),l=s.normalizeDepth,h=void 0===l?3:l,d=s.normalizeMaxBreadth,f=void 0===d?1e3:d,m=Object(n.a)(Object(n.a)({},e),{event_id:e.event_id||(r&&r.event_id?r.event_id:Object(a.f)()),timestamp:e.timestamp||Object(u.a)()});this._applyClientOptions(m),this._applyIntegrationsMetadata(m);var g=t;r&&r.captureContext&&(g=i.a.clone(g).update(r.captureContext));var b=Object(c.c)(m);return g&&(b=g.applyToEvent(m,r)),b.then((function(e){return e&&(e.sdkProcessingMetadata=Object(n.a)(Object(n.a)({},e.sdkProcessingMetadata),{normalizeDepth:Object(p.a)(h)+" ("+typeof h+")"})),"number"==typeof h&&h>0?o._normalizeEvent(e,h,f):e}))},e.prototype._normalizeEvent=function(e,t,r){if(!e)return null;var i=Object(n.a)(Object(n.a)(Object(n.a)(Object(n.a)(Object(n.a)({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((function(e){return Object(n.a)(Object(n.a)({},e),e.data&&{data:Object(p.a)(e.data,t,r)})}))}),e.user&&{user:Object(p.a)(e.user,t,r)}),e.contexts&&{contexts:Object(p.a)(e.contexts,t,r)}),e.extra&&{extra:Object(p.a)(e.extra,t,r)});return e.contexts&&e.contexts.trace&&(i.contexts.trace=e.contexts.trace),i.sdkProcessingMetadata=Object(n.a)(Object(n.a)({},i.sdkProcessingMetadata),{baseClientNormalized:!0}),i},e.prototype._applyClientOptions=function(e){var t=this.getOptions(),r=t.environment,n=t.release,i=t.dist,o=t.maxValueLength,a=void 0===o?250:o;"environment"in e||(e.environment="environment"in t?r:"production"),void 0===e.release&&void 0!==n&&(e.release=n),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=Object(h.d)(e.message,a));var s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=Object(h.d)(s.value,a));var l=e.request;l&&l.url&&(l.url=Object(h.d)(l.url,a))},e.prototype._applyIntegrationsMetadata=function(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=Object(n.d)(e.sdk.integrations||[],t))},e.prototype._sendEvent=function(e){this._getBackend().sendEvent(e)},e.prototype._captureEvent=function(e,t,r){return this._processEvent(e,t,r).then((function(e){return e.event_id}),(function(e){f.a&&s.c.error(e)}))},e.prototype._processEvent=function(e,t,r){var n=this,i=this.getOptions(),o=i.beforeSend,a=i.sampleRate,s=this.getTransport();function u(e,t){s.recordLostEvent&&s.recordLostEvent(e,t)}if(!this._isEnabled())return Object(c.b)(new d.a("SDK not enabled, will not capture event."));var p="transaction"===e.type;return!p&&"number"==typeof a&&Math.random()>a?(u("sample_rate","event"),Object(c.b)(new d.a("Discarding event because it's not included in the random sample (sampling rate = "+a+")"))):this._prepareEvent(e,r,t).then((function(r){if(null===r)throw u("event_processor",e.type||"event"),new d.a("An event processor returned null, will not send event.");return t&&t.data&&!0===t.data.__sentry__||p||!o?r:function(e){var t="`beforeSend` method has to return `null` or a valid event.";if(Object(l.n)(e))return e.then((function(e){if(!Object(l.i)(e)&&null!==e)throw new d.a(t);return e}),(function(e){throw new d.a("beforeSend rejected with "+e)}));if(!Object(l.i)(e)&&null!==e)throw new d.a(t);return e}(o(r,t))})).then((function(t){if(null===t)throw u("before_send",e.type||"event"),new d.a("`beforeSend` returned `null`, will not send event.");var i=r&&r.getSession&&r.getSession();return!p&&i&&n._updateSessionFromEvent(i,t),n._sendEvent(t),t})).then(null,(function(e){if(e instanceof d.a)throw e;throw n.captureException(e,{data:{__sentry__:!0},originalException:e}),new d.a("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+e)}))},e.prototype._process=function(e){var t=this;this._numProcessing+=1,e.then((function(e){return t._numProcessing-=1,e}),(function(e){return t._numProcessing-=1,e}))},e}()},function(e,t,r){"use strict";function n(e,t){return t=t||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],a={},s=function e(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:e,headers:{keys:function(){return o},entries:function(){return o.map((function(e){return[e,i.getResponseHeader(e)]}))},get:function(e){return i.getResponseHeader(e)},has:function(e){return null!=i.getResponseHeader(e)}}}};for(var l in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().toLowerCase().replace(/^(.+?):/gm,(function(e,t){a[t]||o.push(a[t]=t)})),r(s())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(l,t.headers[l]);i.send(t.body||null)}))}r.d(t,"a",(function(){return n}))},,function(e,t,r){"use strict";var n=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)};var i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?u((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function a(e,t,r){return e.concat(t).map((function(e){return o(e,r)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function l(e,t){try{return t in e}catch(e){return!1}}function c(e,t,r){var n={};return r.isMergeableObject(e)&&s(e).forEach((function(t){n[t]=o(e[t],r)})),s(t).forEach((function(i){(function(e,t){return l(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(l(e,i)&&r.isMergeableObject(t[i])?n[i]=function(e,t){if(!t.customMerge)return u;var r=t.customMerge(e);return"function"==typeof r?r:u}(i,r)(e[i],t[i],r):n[i]=o(t[i],r))})),n}function u(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||a,r.isMergeableObject=r.isMergeableObject||n,r.cloneUnlessOtherwiseSpecified=o;var i=Array.isArray(t);return i===Array.isArray(e)?i?r.arrayMerge(e,t,r):c(e,t,r):o(t,r)}u.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return u(e,r,t)}),{})};var p=u;e.exports=p},function(e,t,r){(function(e,r){var n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object AsyncFunction]",s="[object Function]",l="[object GeneratorFunction]",c="[object Null]",u="[object Object]",p="[object Proxy]",h="[object Undefined]",d=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,m={};m["[object Float32Array]"]=m["[object Float64Array]"]=m["[object Int8Array]"]=m["[object Int16Array]"]=m["[object Int32Array]"]=m["[object Uint8Array]"]=m["[object Uint8ClampedArray]"]=m["[object Uint16Array]"]=m["[object Uint32Array]"]=!0,m[o]=m["[object Array]"]=m["[object ArrayBuffer]"]=m["[object Boolean]"]=m["[object DataView]"]=m["[object Date]"]=m["[object Error]"]=m[s]=m["[object Map]"]=m["[object Number]"]=m[u]=m["[object RegExp]"]=m["[object Set]"]=m["[object String]"]=m["[object WeakMap]"]=!1;var g="object"==typeof e&&e&&e.Object===Object&&e,b="object"==typeof self&&self&&self.Object===Object&&self,_=g||b||Function("return this")(),y=t&&!t.nodeType&&t,v=y&&"object"==typeof r&&r&&!r.nodeType&&r,x=v&&v.exports===y,w=x&&g.process,k=function(){try{var e=v&&v.require&&v.require("util").types;return e||w&&w.binding&&w.binding("util")}catch(e){}}(),E=k&&k.isTypedArray;var T,S,C,A=Array.prototype,M=Function.prototype,I=Object.prototype,O=_["__core-js_shared__"],L=M.toString,z=I.hasOwnProperty,D=(T=/[^.]+$/.exec(O&&O.keys&&O.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"",P=I.toString,R=L.call(Object),B=RegExp("^"+L.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=x?_.Buffer:void 0,j=_.Symbol,N=_.Uint8Array,U=F?F.allocUnsafe:void 0,V=(S=Object.getPrototypeOf,C=Object,function(e){return S(C(e))}),q=Object.create,$=I.propertyIsEnumerable,G=A.splice,W=j?j.toStringTag:void 0,H=function(){try{var e=ye(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Z=F?F.isBuffer:void 0,X=Math.max,K=Date.now,Y=ye(_,"Map"),J=ye(Object,"create"),Q=function(){function e(){}return function(t){if(!Oe(t))return{};if(q)return q(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ee(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function te(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function re(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ne(e){var t=this.__data__=new te(e);this.size=t.size}function ie(e,t){var r=Se(e),n=!r&&Te(e),i=!r&&!n&&Ae(e),o=!r&&!n&&!i&&ze(e),a=r||n||i||o,s=a?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],l=s.length;for(var c in e)!t&&!z.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ve(c,l))||s.push(c);return s}function oe(e,t,r){(void 0!==r&&!Ee(e[t],r)||void 0===r&&!(t in e))&&le(e,t,r)}function ae(e,t,r){var n=e[t];z.call(e,t)&&Ee(n,r)&&(void 0!==r||t in e)||le(e,t,r)}function se(e,t){for(var r=e.length;r--;)if(Ee(e[r][0],t))return r;return-1}function le(e,t,r){"__proto__"==t&&H?H(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}ee.prototype.clear=function(){this.__data__=J?J(null):{},this.size=0},ee.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ee.prototype.get=function(e){var t=this.__data__;if(J){var r=t[e];return r===n?void 0:r}return z.call(t,e)?t[e]:void 0},ee.prototype.has=function(e){var t=this.__data__;return J?void 0!==t[e]:z.call(t,e)},ee.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=J&&void 0===t?n:t,this},te.prototype.clear=function(){this.__data__=[],this.size=0},te.prototype.delete=function(e){var t=this.__data__,r=se(t,e);return!(r<0)&&(r==t.length-1?t.pop():G.call(t,r,1),--this.size,!0)},te.prototype.get=function(e){var t=this.__data__,r=se(t,e);return r<0?void 0:t[r][1]},te.prototype.has=function(e){return se(this.__data__,e)>-1},te.prototype.set=function(e,t){var r=this.__data__,n=se(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},re.prototype.clear=function(){this.size=0,this.__data__={hash:new ee,map:new(Y||te),string:new ee}},re.prototype.delete=function(e){var t=_e(this,e).delete(e);return this.size-=t?1:0,t},re.prototype.get=function(e){return _e(this,e).get(e)},re.prototype.has=function(e){return _e(this,e).has(e)},re.prototype.set=function(e,t){var r=_e(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},ne.prototype.clear=function(){this.__data__=new te,this.size=0},ne.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ne.prototype.get=function(e){return this.__data__.get(e)},ne.prototype.has=function(e){return this.__data__.has(e)},ne.prototype.set=function(e,t){var r=this.__data__;if(r instanceof te){var n=r.__data__;if(!Y||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new re(n)}return r.set(e,t),this.size=r.size,this};var ce,ue=function(e,t,r){for(var n=-1,i=Object(e),o=r(e),a=o.length;a--;){var s=o[ce?a:++n];if(!1===t(i[s],s,i))break}return e};function pe(e){return null==e?void 0===e?h:c:W&&W in Object(e)?function(e){var t=z.call(e,W),r=e[W];try{e[W]=void 0;var n=!0}catch(e){}var i=P.call(e);n&&(t?e[W]=r:delete e[W]);return i}(e):function(e){return P.call(e)}(e)}function he(e){return Le(e)&&pe(e)==o}function de(e){return!(!Oe(e)||function(e){return!!D&&D in e}(e))&&(Me(e)?B:d).test(function(e){if(null!=e){try{return L.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function fe(e){if(!Oe(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=xe(e),r=[];for(var n in e)("constructor"!=n||!t&&z.call(e,n))&&r.push(n);return r}function me(e,t,r,n,i){e!==t&&ue(t,(function(o,a){if(i||(i=new ne),Oe(o))!function(e,t,r,n,i,o,a){var s=we(e,r),l=we(t,r),c=a.get(l);if(c)return void oe(e,r,c);var p=o?o(s,l,r+"",e,t,a):void 0,h=void 0===p;if(h){var d=Se(l),f=!d&&Ae(l),m=!d&&!f&&ze(l);p=l,d||f||m?Se(s)?p=s:Le(v=s)&&Ce(v)?p=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(s):f?(h=!1,p=function(e,t){if(t)return e.slice();var r=e.length,n=U?U(r):new e.constructor(r);return e.copy(n),n}(l,!0)):m?(h=!1,g=l,b=!0?(_=g.buffer,y=new _.constructor(_.byteLength),new N(y).set(new N(_)),y):g.buffer,p=new g.constructor(b,g.byteOffset,g.length)):p=[]:function(e){if(!Le(e)||pe(e)!=u)return!1;var t=V(e);if(null===t)return!0;var r=z.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&L.call(r)==R}(l)||Te(l)?(p=s,Te(s)?p=function(e){return function(e,t,r,n){var i=!r;r||(r={});var o=-1,a=t.length;for(;++o<a;){var s=t[o],l=n?n(r[s],e[s],s,r,e):void 0;void 0===l&&(l=e[s]),i?le(r,s,l):ae(r,s,l)}return r}(e,De(e))}(s):Oe(s)&&!Me(s)||(p=function(e){return"function"!=typeof e.constructor||xe(e)?{}:Q(V(e))}(l))):h=!1}var g,b,_,y;var v;h&&(a.set(l,p),i(p,l,n,o,a),a.delete(l));oe(e,r,p)}(e,t,a,r,me,n,i);else{var s=n?n(we(e,a),o,a+"",e,t,i):void 0;void 0===s&&(s=o),oe(e,a,s)}}),De)}function ge(e,t){return ke(function(e,t,r){return t=X(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=X(n.length-t,0),a=Array(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,s)}}(e,t,Be),e+"")}var be=H?function(e,t){return H(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:Be;function _e(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function ye(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return de(r)?r:void 0}function ve(e,t){var r=typeof e;return!!(t=null==t?i:t)&&("number"==r||"symbol"!=r&&f.test(e))&&e>-1&&e%1==0&&e<t}function xe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||I)}function we(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ke=function(e){var t=0,r=0;return function(){var n=K(),i=16-(n-r);if(r=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(be);function Ee(e,t){return e===t||e!=e&&t!=t}var Te=he(function(){return arguments}())?he:function(e){return Le(e)&&z.call(e,"callee")&&!$.call(e,"callee")},Se=Array.isArray;function Ce(e){return null!=e&&Ie(e.length)&&!Me(e)}var Ae=Z||function(){return!1};function Me(e){if(!Oe(e))return!1;var t=pe(e);return t==s||t==l||t==a||t==p}function Ie(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Oe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Le(e){return null!=e&&"object"==typeof e}var ze=E?function(e){return function(t){return e(t)}}(E):function(e){return Le(e)&&Ie(e.length)&&!!m[pe(e)]};function De(e){return Ce(e)?ie(e,!0):fe(e)}var Pe,Re=(Pe=function(e,t,r,n){me(e,t,r,n)},ge((function(e,t){var r=-1,n=t.length,i=n>1?t[n-1]:void 0,o=n>2?t[2]:void 0;for(i=Pe.length>3&&"function"==typeof i?(n--,i):void 0,o&&function(e,t,r){if(!Oe(r))return!1;var n=typeof t;return!!("number"==n?Ce(r)&&ve(t,r.length):"string"==n&&t in r)&&Ee(r[t],e)}(t[0],t[1],o)&&(i=n<3?void 0:i,n=1),e=Object(e);++r<n;){var a=t[r];a&&Pe(e,a,r,i)}return e})));function Be(e){return e}r.exports=Re}).call(this,r(31),r(191)(e))},function(e,t,r){"use strict";function n(){return"undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&!!__SENTRY_BROWSER_BUNDLE__}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(){var e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(r){if(e)return!!t.has(r)||(t.add(r),!1);for(var n=0;n<t.length;n++){if(t[n]===r)return!0}return t.push(r),!1},function(r){if(e)t.delete(r);else for(var n=0;n<t.length;n++)if(t[n]===r){t.splice(n,1);break}}]}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(105),i=r(68),o=r(10),a=function(){function e(e){this.errors=0,this.sid=Object(n.f)(),this.duration=0,this.status="ok",this.init=!0,this.ignoreDuration=!1;var t=Object(i.b)();this.timestamp=t,this.started=t,e&&this.update(e)}return e.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),this.timestamp=e.timestamp||Object(i.b)(),e.ignoreDuration&&(this.ignoreDuration=e.ignoreDuration),e.sid&&(this.sid=32===e.sid.length?e.sid:Object(n.f)()),void 0!==e.init&&(this.init=e.init),!this.did&&e.did&&(this.did=""+e.did),"number"==typeof e.started&&(this.started=e.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof e.duration)this.duration=e.duration;else{var t=this.timestamp-this.started;this.duration=t>=0?t:0}e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress),!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent),"number"==typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},e.prototype.close=function(e){e?this.update({status:e}):"ok"===this.status?this.update({status:"exited"}):this.update()},e.prototype.toJSON=function(){return Object(o.c)({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:{release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent}})},e}()},function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="fb15")}({"0ca3":function(e,t,r){"use strict";var n=r("c6aa");r.n(n).a},7937:function(e,t,r){},"7fca":function(e,t,r){"use strict";var n=r("c10a");r.n(n).a},8875:function(e,t,r){var n,i,o,a;"undefined"!=typeof self&&self,a=function(){function e(){if(document.currentScript)return document.currentScript;try{throw new Error}catch(u){var e,t,r,n=/@([^@]*):(\d+):(\d+)\s*$/gi,i=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(u.stack)||n.exec(u.stack),o=i&&i[1]||!1,a=i&&i[2]||!1,s=document.location.href.replace(document.location.hash,""),l=document.getElementsByTagName("script");o===s&&(e=document.documentElement.outerHTML,t=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),r=e.replace(t,"$1").trim());for(var c=0;c<l.length;c++){if("interactive"===l[c].readyState)return l[c];if(l[c].src===o)return l[c];if(o===s&&l[c].innerHTML&&l[c].innerHTML.trim()===r)return l[c]}return null}}return e},i=[],void 0===(o="function"==typeof(n=a)?n.apply(t,i):n)||(e.exports=o)},9334:function(e,t,r){"use strict";var n=r("7937");r.n(n).a},c10a:function(e,t,r){},c6aa:function(e,t,r){},fb15:function(e,t,r){"use strict";if(r.r(t),r.d(t,"DEFAULT_BACKGROUND_COLOR",(function(){return C})),r.d(t,"DEFAULT_BORDER_RADIUS",(function(){return A})),r.d(t,"DEFAULT_ROW_LENGTH",(function(){return M})),r.d(t,"DEFAULT_TRIGGER_CONTAINER_SPACE",(function(){return I})),r.d(t,"DEFAULT_SWATCH_SIZE",(function(){return O})),r.d(t,"DEFAULT_SHOW_BORDER",(function(){return L})),r.d(t,"extractPropertyFromPreset",(function(){return z})),"undefined"!=typeof window){var n=window.document.currentScript,i=r("8875");n=i(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:i});var o=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(r.p=o[1])}var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"vue-swatches",attrs:{tabindex:"-1"},on:{blur:function(t){return e.onBlur(t.relatedTarget)}}},[e.inline?e._e():r("div",{ref:"triggerWrapper",staticClass:"vue-swatches__trigger__wrapper",on:{click:e.togglePopover}},[e._t("trigger",[r("div",{staticClass:"vue-swatches__trigger",class:{"vue-swatches--is-empty":!e.value,"vue-swatches--is-disabled":e.disabled},style:e.triggerStyles},[r("div",{directives:[{name:"show",rawName:"v-show",value:e.isNoColor,expression:"isNoColor"}],staticClass:"vue-swatches__diagonal__wrapper vue-swatches--has-children-centered"},[r("div",{staticClass:"vue-swatches__diagonal"})])])])],2),r("transition",{attrs:{name:"vue-swatches-show-hide"}},[r("div",{directives:[{name:"show",rawName:"v-show",value:e.inline||e.isOpen,expression:"inline || isOpen"}],ref:"containerWrapper",staticClass:"vue-swatches__container",class:{"vue-swatches--inline":e.inline},style:e.containerStyles},[r("div",{staticClass:"vue-swatches__wrapper",style:e.wrapperStyles},[e.isNested?e._l(e.computedSwatches,(function(t,n){return r("div",{key:n,staticClass:"vue-swatches__row"},e._l(t,(function(i,o){return r("v-swatch",{key:o,attrs:{"is-last":n===e.computedSwatches.length-1&&o===t.length,"row-length-setted":null!==e.rowLength||null!==e.presetRowLength,"border-radius":e.computedBorderRadius,disabled:e.getSwatchDisabled(i),inline:e.inline,selected:e.checkEquality(e.getSwatchColor(i),e.value),"swatch-size":e.computedSwatchSize,"spacing-size":e.computedSpacingSize,"show-border":e.getSwatchShowBorder(i),"show-checkbox":e.showCheckbox,"show-labels":e.showLabels,"swatch-color":e.getSwatchColor(i),"swatch-label":e.getSwatchLabel(i),"swatch-alt":e.getSwatchAlt(i),"swatch-style":e.swatchStyle},on:{blur:function(t){return e.onBlur(t)},click:function(t){return e.updateSwatch(i)}},nativeOn:{click:function(t){return e.updateSwatch(i)}}})})),1)})):e._l(e.computedSwatches,(function(t,n){return r("v-swatch",{key:n,attrs:{"is-last":n===e.computedSwatches.length-1,"row-length-setted":null!==e.rowLength||null!==e.presetRowLength,"border-radius":e.computedBorderRadius,disabled:e.getSwatchDisabled(t),inline:e.inline,selected:e.checkEquality(e.getSwatchColor(t),e.value),"swatch-size":e.computedSwatchSize,"spacing-size":e.computedSpacingSize,"show-border":e.getSwatchShowBorder(t),"show-checkbox":e.showCheckbox,"show-labels":e.showLabels,"swatch-color":e.getSwatchColor(t),"swatch-label":e.getSwatchLabel(t),"swatch-alt":e.getSwatchAlt(t),"swatch-style":e.swatchStyle},on:{blur:function(t){return e.onBlur(t)},click:function(r){return e.updateSwatch(t)}},nativeOn:{click:function(r){return e.updateSwatch(t)}}})}))],2),e.showFallback?r("div",{staticClass:"vue-swatches__fallback__wrapper",style:e.computedFallbackWrapperStyles},[r("span",{staticClass:"vue-swatches__fallback__input--wrapper"},[r("input",{ref:"fallbackInput",staticClass:"vue-swatches__fallback__input",class:e.fallbackInputClass,attrs:{type:e.fallbackInputType},domProps:{value:e.internalValue},on:{input:function(t){return e.updateSwatch(t.target.value,{fromFallbackInput:!0})}}})]),e.showFallbackOk?r("button",{staticClass:"vue-swatches__fallback__button",class:e.fallbackOkClass,on:{click:function(t){return t.preventDefault(),e.onFallbackButtonClick(t)}}},[e._v(" "+e._s(e.fallbackOkText)+" ")]):e._e()]):e._e()])])],1)},s=[],l={colors:["#1FBC9C","#1CA085","#2ECC70","#27AF60","#3398DB","#2980B9","#A463BF","#8E43AD","#3D556E","#222F3D","#F2C511","#F39C19","#E84B3C","#C0382B","#DDE6E8","#BDC3C8"],rowLength:4},c={colors:["#CC0001","#E36101","#FFCC00","#009900","#0066CB","#000000","#FFFFFF"],showBorder:!0},u={colors:[["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff"],["#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff"],["#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"],["#dd7e6b","#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#a4c2f4","#9fc5e8","#b4a7d6","#d5a6bd"],["#cc4125","#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6d9eeb","#6fa8dc","#8e7cc3","#c27ba0"],["#a61c00","#cc0000","#e69138","#f1c232","#6aa84f","#45818e","#3c78d8","#3d85c6","#674ea7","#a64d79"],["#85200c","#990000","#b45f06","#bf9000","#38761d","#134f5c","#1155cc","#0b5394","#351c75","#741b47"],["#5b0f00","#660000","#783f04","#7f6000","#274e13","#0c343d","#1c4587","#073763","#20124d","#4c1130"]],borderRadius:"0",rowLength:10,swatchSize:24,spacingSize:0},p=function(){var e=this,t=this,r=t.$createElement,n=t._self._c||r;return n("div",{staticClass:"vue-swatches__swatch",class:{"vue-swatches__swatch--border":t.showBorder,"vue-swatches__swatch--selected":t.selected,"vue-swatches__swatch--is-disabled":t.disabled},style:t.swatchStyles,attrs:{"aria-label":t.swatchAlt,role:"button",tabindex:"0"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.$emit("click",t.swatchColor)},blur:function(t){return e.$emit("blur",t.relatedTarget)}}},[""===t.swatchColor?n("div",{staticClass:"vue-swatches__diagonal__wrapper vue-swatches--has-children-centered"},[n("div",{staticClass:"vue-swatches__diagonal"})]):t._e(),n("v-check",{directives:[{name:"show",rawName:"v-show",value:t.showCheckbox&&t.selected,expression:"showCheckbox && selected"}]}),t.showLabels?n("div",{staticClass:"vue-swatches__swatch__label",style:t.labelStyles},[t._v(" "+t._s(t.swatchLabel)+" ")]):t._e()],1)},h=[],d=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"vue-swatches__check__wrapper vue-swatches--has-children-centered"},[r("div",{staticClass:"vue-swatches__check__circle vue-swatches--has-children-centered"},[r("svg",{staticClass:"check",attrs:{version:"1.1",role:"presentation",width:"12",height:"12",viewBox:"0 0 1792 1792"}},[r("path",{staticClass:"vue-swatches__check__path",attrs:{d:"M1671 566q0 40-28 68l-724 724-136 136q-28 28-68 28t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 295 656-657q28-28 68-28t68 28l136 136q28 28 28 68z"}})])])])},f=[],m={name:"v-check",data:function(){return{}}};function g(e,t,r,n,i,o,a,s){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=r,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):i&&(l=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:e,options:c}}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){y(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r("7fca");var v={name:"v-swatch",components:{VCheck:g(m,d,f,!1,null,null,null).exports},props:{borderRadius:{type:String},isLast:{type:Boolean,default:!1},rowLengthSetted:{type:Boolean,default:!1},disabled:{type:Boolean},inline:{type:Boolean},selected:{type:Boolean,default:!1},showCheckbox:{type:Boolean},showBorder:{type:Boolean},showLabels:{type:Boolean},spacingSize:{type:Number},swatchColor:{type:String,default:""},swatchLabel:{type:String},swatchAlt:{type:String},swatchSize:{type:Number},swatchStyle:{type:Object}},data:function(){return{}},computed:{computedLabelStyle:function(){var e=8+3*Math.floor(this.spacingSize/5);return{bottom:"-".concat(e,"px")}},computedSwatchStyle:function(){var e={width:"".concat(this.swatchSize,"px"),height:"".concat(this.swatchSize,"px"),borderRadius:this.borderRadius,backgroundColor:""!==this.swatchColor?this.swatchColor:"#FFFFFF",cursor:this.cursorStyle};return this.inline&&this.isLast||(e.marginRight="".concat(this.spacingSize,"px")),this.inline&&!this.rowLengthSetted?e:_({},e,{marginBottom:"".concat(this.spacingSize,"px")})},cursorStyle:function(){return this.disabled?"not-allowed":"pointer"},labelStyles:function(){return[this.computedLabelStyle]},swatchStyles:function(){return[this.computedSwatchStyle,this.swatchStyle]}}},x=v,w=(r("0ca3"),g(x,p,h,!1,null,null,null)).exports;function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){S(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function S(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var C="#ffffff",A="10px",M=4,I=5,O=42,L=!1,z=function(e,t,r){return"string"!=typeof e?null:"text-basic"===e?void 0===c[t]?null:c[t]:"text-advanced"===e?void 0===u[t]?null:u[t]:"basic"===e||r?void 0===l[t]?null:l[t]:null},D={name:"v-swatches",components:{VSwatch:w},props:{backgroundColor:{type:String,default:C},closeOnSelect:{type:Boolean,default:!0},swatches:{type:[Array,String],default:function(){return"basic"}},disabled:{type:Boolean,default:!1},fallbackInputClass:{type:[Array,Object,String],default:null},fallbackInputType:{type:String,default:function(){return"text"},validator:function(e){return-1!==["text","color"].indexOf(e)}},fallbackOkClass:{type:[Array,Object,String],default:null},fallbackOkText:{type:String,default:"Ok"},inline:{type:Boolean,default:!1},shapes:{type:String,default:"squares"},popoverX:{type:String,default:"right"},popoverY:{type:String,default:"bottom"},rowLength:{type:[Number,String],default:null},showBorder:{type:Boolean,default:null},showFallback:{type:Boolean,default:!1},showCheckbox:{type:Boolean,default:!0},showLabels:{type:Boolean,default:!1},spacingSize:{type:Number,default:null},swatchSize:{type:[Number,String],default:null},swatchStyle:{type:[Object,Array],default:function(){}},triggerStyle:{type:[Object,Array],default:function(){}},wrapperStyle:{type:[Object,Array],default:function(){}},value:{type:String,default:null}},data:function(){return{alwaysOnScreenStyle:{},componentMounted:!1,internalValue:this.value,internalIsOpen:!1}},computed:{isNested:function(){return!!(this.computedSwatches&&this.computedSwatches.length&&this.computedSwatches[0]instanceof Array)},isOpen:function(){return!this.inline&&this.internalIsOpen},isNoColor:function(){return this.checkEquality("",this.value)},presetBorderRadius:function(){return z(this.swatches,"borderRadius")},presetRowLength:function(){return z(this.swatches,"rowLength")},presetShowBorder:function(){return z(this.swatches,"showBorder")},presetSwatchSize:function(){return z(this.swatches,"swatchSize")},presetSpacingSize:function(){return z(this.swatches,"spacingSize")},computedSwatches:function(){return this.swatches instanceof Array?this.swatches:"string"==typeof this.swatches?z(this.swatches,"colors",!0):[]},computedBorderRadius:function(){return null!==this.presetBorderRadius?this.presetBorderRadius:this.borderRadius},computedRowLength:function(){return null!==this.rowLength?Number(this.rowLength):null!==this.presetRowLength?this.presetRowLength:this.computedSwatches.length<M&&!this.isNested?this.computedSwatches.length:M},computedSwatchSize:function(){return null!==this.swatchSize?Number(this.swatchSize):null!==this.presetSwatchSize?this.presetSwatchSize:O},computedSpacingSize:function(){return null!==this.spacingSize?this.spacingSize:null!==this.presetSpacingSize?this.presetSpacingSize:Math.round(.25*this.computedSwatchSize)},computedShowBorder:function(){return null!==this.showBorder?this.showBorder:null!==this.presetShowBorder?this.presetShowBorder:L},showFallbackOk:function(){return!this.inline},borderRadius:function(){return"squares"===this.shapes?"".concat(Math.round(.25*this.computedSwatchSize),"px"):"circles"===this.shapes?"50%":""},wrapperWidth:function(){return this.computedRowLength*(this.computedSwatchSize+this.computedSpacingSize)},computedtriggerStyle:function(){return{width:"42px",height:"42px",backgroundColor:this.value?this.value:"#ffffff",borderRadius:"circles"===this.shapes?"50%":A}},triggerStyles:function(){return[this.computedtriggerStyle,this.triggerStyle]},containerStyles:function(){var e=[{backgroundColor:this.backgroundColor},this.alwaysOnScreenStyle];return this.inline?e:[].concat(e,[{padding:"5px",marginBottom:"5px"}])},computedWrapperStyle:function(){return this.inline?{}:{paddingTop:"".concat(this.computedSpacingSize,"px"),paddingLeft:"".concat(this.computedSpacingSize,"px"),width:"".concat(this.wrapperWidth,"px")}},wrapperStyles:function(){return[this.computedWrapperStyle,this.wrapperStyle]},computedFallbackWrapperStyle:function(){var e={marginLeft:"".concat(this.computedSpacingSize,"px"),paddingBottom:"".concat(this.computedSpacingSize,"px")};return this.inline?e:T({},e,{width:"".concat(this.wrapperWidth-this.computedSpacingSize,"px")})},computedFallbackWrapperStyles:function(){return[this.computedFallbackWrapperStyle]}},watch:{value:function(e){this.internalValue=e}},mounted:function(){this.componentMounted=!0},methods:{checkEquality:function(e,t){return!(!e&&""!==e||!t&&""!==t)&&e.toUpperCase()===t.toUpperCase()},hidePopover:function(){this.internalIsOpen=!1,this.$el.blur(),this.$emit("close",this.internalValue)},getAlwaysOnScreenStyle:function(){var e={},t=this.$refs.triggerWrapper,r=this.$refs.containerWrapper;if(!this.componentMounted||this.inline||!t||!window||!document)return e;var n=t.getBoundingClientRect(),i=5,o=(document.documentElement.clientWidth||window.innerWidth)-5,a=5,s=(document.documentElement.clientHeight||window.innerHeight)-5;r.style.visibility="hidden",r.style.display="block";var l=r.getBoundingClientRect();return r.style.display="none",r.style.visibility="visible","top"===this.popoverY?n.top-l.height<a?(e.top="".concat(n.height+I,"px"),e.bottom="auto"):(e.bottom="".concat(n.height+I,"px"),e.top="auto"):"bottom"===this.popoverY&&(n.bottom+l.height>s?(e.bottom="".concat(n.height+I,"px"),e.top="auto"):(e.top="".concat(n.height+I,"px"),e.bottom="auto")),"left"===this.popoverX?n.right-l.width<i?(e.left=0,e.right="auto"):(e.right=0,e.left="auto"):"right"===this.popoverX&&(n.left+l.width>o?(e.right=0,e.left="auto"):(e.left=0,e.right="auto")),e},getSwatchShowBorder:function(e){return"string"==typeof e?this.computedShowBorder:"object"===k(e)?void 0!==e.showBorder?e.showBorder:this.computedShowBorder:void 0},getSwatchColor:function(e){return"string"==typeof e?e:"object"===k(e)?e.color:void 0},getSwatchDisabled:function(e){return"string"==typeof e?this.disabled:"object"===k(e)?void 0!==e.disabled?e.disabled:this.disabled:void 0},getSwatchLabel:function(e){return"string"==typeof e?e:"object"===k(e)?e.label||e.color:void 0},getSwatchAlt:function(e){return"string"==typeof e?e:"object"===k(e)?e.alt||this.getSwatchLabel(e):void 0},onBlur:function(e){this.isOpen&&(null!==e&&this.$el.contains(e)||(this.internalIsOpen=!1,this.$emit("close",this.internalValue)))},onFallbackButtonClick:function(){this.hidePopover()},showPopover:function(){this.isOpen||this.inline||this.disabled||(this.alwaysOnScreenStyle=this.getAlwaysOnScreenStyle(),this.internalIsOpen=!0,this.$el.focus(),this.$emit("open"))},togglePopover:function(){this.isOpen?this.hidePopover():this.showPopover()},updateSwatch:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).fromFallbackInput;if(!this.getSwatchDisabled(e)){var r=this.getSwatchColor(e);this.internalValue=r,this.$emit("input",r),!this.closeOnSelect||this.inline||t||this.hidePopover()}}}},P=D,R=(r("9334"),g(P,a,s,!1,null,null,null)).exports;t.default=R}}).default},function(e,t,r){"use strict";function n(e){return null!==e&&"object"==typeof e}function i(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",o=arguments.length>3?arguments[3]:void 0;if(!n(t))return i(e,{},r,o);var a=Object.assign({},t);for(var s in e)if("__proto__"!==s&&"constructor"!==s){var l=e[s];null!==l&&(o&&o(a,s,l,r)||(Array.isArray(l)&&Array.isArray(a[s])?a[s]=a[s].concat(l):n(l)&&n(a[s])?a[s]=i(l,a[s],(r?"".concat(r,"."):"")+s.toString(),o):a[s]=l))}return a}function o(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.reduce((function(t,r){return i(t,r,"",e)}),{})}}r(59),r(63),r(111);var a=o();a.fn=o((function(e,t,r,n){if(void 0!==e[t]&&"function"==typeof r)return e[t]=r(e[t]),!0})),a.arrayFn=o((function(e,t,r,n){if(Array.isArray(e[t])&&"function"==typeof r)return e[t]=r(e[t]),!0})),a.extend=o,e.exports=a},function(e,t,r){"use strict";r.d(t,"a",(function(){return v}));var n=r(254),i=r.n(n);function o(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,l,"next",e)}function l(e){o(a,n,i,s,l,"throw",e)}s(void 0)}))}}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u="axios-retry";function p(e){return!e.response&&Boolean(e.code)&&"ECONNABORTED"!==e.code&&i()(e)}var h=["get","head","options"],d=h.concat(["put","delete"]);function f(e){return"ECONNABORTED"!==e.code&&(!e.response||e.response.status>=500&&e.response.status<=599)}function m(e){return!!e.config&&(f(e)&&-1!==d.indexOf(e.config.method))}function g(e){return p(e)||m(e)}function b(){return 0}function _(e){var t=e[u]||{};return t.retryCount=t.retryCount||0,e[u]=t,t}function y(){return(y=a((function*(e,t,r,n){var i=r.retryCount<e&&t(n);if("object"==typeof i)try{return!1!==(yield i)}catch(e){return!1}return i}))).apply(this,arguments)}function v(e,t){var r=e.interceptors.request.use((e=>(_(e).lastRequestTime=Date.now(),e))),n=e.interceptors.response.use(null,function(){var r=a((function*(r){var{config:n}=r;if(!n)return Promise.reject(r);var{retries:i=3,retryCondition:o=g,retryDelay:a=b,shouldResetTimeout:s=!1,onRetry:c=(()=>{})}=function(e,t){return l(l({},t),e[u])}(n,t),p=_(n);if(yield function(e,t,r,n){return y.apply(this,arguments)}(i,o,p,r)){p.retryCount+=1;var h=a(p.retryCount,r);if(function(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}(e,n),!s&&n.timeout&&p.lastRequestTime){var d=Date.now()-p.lastRequestTime,f=n.timeout-d-h;if(f<=0)return Promise.reject(r);n.timeout=f}return n.transformRequest=[e=>e],c(p.retryCount,r,n),new Promise((t=>setTimeout((()=>t(e(n))),h)))}return Promise.reject(r)}));return function(e){return r.apply(this,arguments)}}());return{requestInterceptorId:r,responseInterceptorId:n}}v.isNetworkError=p,v.isSafeRequestError=function(e){return!!e.config&&(f(e)&&-1!==h.indexOf(e.config.method))},v.isIdempotentRequestError=m,v.isNetworkOrIdempotentRequestError=g,v.exponentialDelay=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=Math.pow(2,e)*t;return r+.2*r*Math.random()},v.isRetryableError=f},function(e,t,r){"use strict";const n=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);e.exports=e=>!n.has(e&&e.code)},,function(e,t,r){(function(t){e.exports=function(){"use strict";var e,r,n;function i(t,i){if(e)if(r){var o="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+e+")(sharedChunk); ("+r+")(sharedChunk); self.onerror = null;",a={};e(a),n=i(a),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(n.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else r=i;else e=i}return i(["exports"],(function(e){var r="undefined"!=typeof self?self:{},n="2.15.0";let i;const o={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==i){const e=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{i=null!=t.env.API_URL_REGEX?new RegExp(t.env.API_URL_REGEX):e}catch(t){i=e}}return i},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!o.API_URL)return null;try{const e=new URL(o.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},a={supported:!1,testSupport:function(e){!c&&l&&(u?p(e):s=e)}};let s,l,c=!1,u=!1;function p(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,l),e.isContextLost())return;a.supported=!0}catch(e){}e.deleteTexture(t),c=!0}r.document&&(l=r.document.createElement("img"),l.onload=function(){s&&p(s),s=null,u=!0},l.onerror=function(){c=!0,s=null},l.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const h="01";function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var f=m;function m(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}m.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)<t)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r-=i/o}var a=0,s=1;for(r=e,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-e)<t));n++)e>i?a=r:s=r,r=.5*(s-a)+a;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var g=d(f),b=_;function _(e,t){this.x=e,this.y=t}_.prototype={clone:function(){return new _(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=n,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-n*(this.y-t.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},_.convert=function(e){return e instanceof _?e:Array.isArray(e)?new _(e[0],e[1]):e};var y=d(b);const v=Math.PI/180,x=180/Math.PI;function w(e){return e*v}function k(e){return e*x}const E=[[0,0],[1,0],[1,1],[0,1]];function T(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function S(e,t,r,n){const i=new g(e,t,r,n);return function(e){return i.solve(e)}}const C=S(.25,.1,.25,1);function A(e,t,r){return Math.min(r,Math.max(t,e))}function M(e,t,r){return(r=A((r-e)/(t-e),0,1))*r*(3-2*r)}function I(e,t,r){const n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function O(e,t,r){if(!e.length)return r(null,[]);let n=e.length;const i=new Array(e.length);let o=null;e.forEach(((e,a)=>{t(e,((e,t)=>{e&&(o=e),i[a]=t,0==--n&&r(o,i)}))}))}function L(e){const t=[];for(const r in e)t.push(e[r]);return t}function z(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}let D=1;function P(){return D++}function R(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function B(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function F(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function j(e,t){e.forEach((e=>{t[e]&&(t[e]=t[e].bind(t))}))}function N(e,t){return-1!==e.indexOf(t,e.length-t.length)}function U(e,t,r){const n={};for(const i in e)n[i]=t.call(r||this,e[i],i,e);return n}function V(e,t,r){const n={};for(const i in e)t.call(r||this,e[i],i,e)&&(n[i]=e[i]);return n}function q(e){return Array.isArray(e)?e.map(q):"object"==typeof e&&e?U(e,q):e}const $={};function G(e){$[e]||($[e]=!0)}function W(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function H(e){let t=0;for(let r,n,i=0,o=e.length,a=o-1;i<o;a=i++)r=e[i],n=e[a],t+=(n.x-r.x)*(r.y+n.y);return t}function Z(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function X(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,r,n,i)=>{const o=n||i;return t[r]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let K=null;function Y(e){if(null==K){const t=e.navigator?e.navigator.userAgent:null;K=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return K}function J(e){try{const t=r[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function Q(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}const ee="mapbox-tiles";let te,re,ne=500,ie=50;function oe(){try{return r.caches}catch(e){}}function ae(){oe()&&!te&&(te=r.caches.open(ee))}function se(e){const t=e.indexOf("?");if(t<0)return e;const r=function(e){const t=e.indexOf("?");return t>0?e.slice(t+1).split("&"):[]}(e),n=r.filter((e=>{const t=e.split("=");return"language"===t[0]||"worldview"===t[0]}));return n.length?`${e.slice(0,t)}?${n.join("&")}`:e.slice(0,t)}let le=1/0;const ce={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ce);class ue extends Error{constructor(e,t,r){401===t&&xe(r)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=r}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const pe=Z()?()=>self.worker&&self.worker.referrer:()=>("blob:"===r.location.protocol?r.parent:r).location.href,he=function(e,t){if(!(/^file:/.test(n=e.url)||/^file:/.test(pe())&&!/^\w+:/.test(n))){if(r.fetch&&r.Request&&r.AbortController&&r.Request.prototype.hasOwnProperty("signal"))return function(e,t){const n=new r.AbortController,i=new r.Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:pe(),referrerPolicy:e.referrerPolicy,signal:n.signal});let o=!1,a=!1;const s=(l=i.url).indexOf("sku=")>0&&xe(l);var l;"json"===e.type&&i.headers.set("Accept","application/json");const c=(n,o,l)=>{if(a)return;if(n&&"SecurityError"!==n.message&&G(n.toString()),o&&l)return u(o);const c=Date.now();r.fetch(i).then((r=>{if(r.ok){const e=s?r.clone():null;return u(r,e,c)}return t(new ue(r.statusText,r.status,e.url))})).catch((r=>{"AbortError"!==r.name&&t(new Error(`${r.message} ${e.url}`))}))},u=(n,s,l)=>{("arrayBuffer"===e.type?n.arrayBuffer():"json"===e.type?n.json():n.text()).then((e=>{a||(s&&l&&function(e,t,n){if(ae(),!te)return;const i={status:t.status,statusText:t.statusText,headers:new r.Headers};t.headers.forEach(((e,t)=>i.headers.set(t,e)));const o=X(t.headers.get("Cache-Control")||"");if(o["no-store"])return;o["max-age"]&&i.headers.set("Expires",new Date(n+1e3*o["max-age"]).toUTCString());const a=i.headers.get("Expires");a&&(new Date(a).getTime()-n<42e4||function(e,t){if(void 0===re)try{new Response(new ReadableStream),re=!0}catch(e){re=!1}re?t(e.body):e.blob().then(t)}(t,(t=>{const n=new r.Response(t,i);ae(),te&&te.then((t=>t.put(se(e.url),n))).catch((e=>G(e.message)))})))}(i,s,l),o=!0,t(null,e,n.headers.get("Cache-Control"),n.headers.get("Expires")))})).catch((e=>{a||t(new Error(e.message))}))};return s?function(e,t){if(ae(),!te)return t(null);const r=se(e.url);te.then((e=>{e.match(r).then((n=>{const i=function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")||0),r=X(e.headers.get("Cache-Control")||"");return t>Date.now()&&!r["no-cache"]}(n);e.delete(r),i&&e.put(r,n.clone()),t(null,n,i)})).catch(t)})).catch(t)}(i,c):c(null,null),{cancel:()=>{a=!0,o||n.abort()}}}(e,t);if(Z()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var n;return function(e,t){const n=new r.XMLHttpRequest;n.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(n.responseType="arraybuffer");for(const t in e.headers)n.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===e.credentials,n.onerror=()=>{t(new Error(n.statusText))},n.onload=()=>{if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let r=n.response;if("json"===e.type)try{r=JSON.parse(n.response)}catch(e){return t(e)}t(null,r,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else t(new ue(n.statusText,n.status,e.url))},n.send(e.body),{cancel:()=>n.abort()}}(e,t)},de=function(e,t){return he(z(e,{type:"arrayBuffer"}),t)};function fe(e){const t=r.document.createElement("a");return t.href=e,t.protocol===r.document.location.protocol&&t.host===r.document.location.host}const me="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let ge,be;ge=[],be=0;const _e=function(e,t){if(a.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),be>=o.MAX_PARALLEL_IMAGE_REQUESTS){const r={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return ge.push(r),r}be++;let n=!1;const i=()=>{if(!n)for(n=!0,be--;ge.length&&be<o.MAX_PARALLEL_IMAGE_REQUESTS;){const e=ge.shift(),{requestParameters:t,callback:r,cancelled:n}=e;n||(e.cancel=_e(t,r).cancel)}},s=de(e,((e,n,o,a)=>{i(),e?t(e):n&&(r.createImageBitmap?function(e,t){const n=new r.Blob([new Uint8Array(e)],{type:"image/png"});r.createImageBitmap(n).then((e=>{t(null,e)})).catch((e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(n,((e,r)=>t(e,r,o,a))):function(e,t){const n=new r.Image,i=r.URL;n.onload=()=>{t(null,n),i.revokeObjectURL(n.src),n.onload=null,r.requestAnimationFrame((()=>{n.src=me}))},n.onerror=()=>t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const o=new r.Blob([new Uint8Array(e)],{type:"image/png"});n.src=e.byteLength?i.createObjectURL(o):me}(n,((e,r)=>t(e,r,o,a))))}));return{cancel:()=>{s.cancel(),i()}}},ye="NO_ACCESS_TOKEN";function ve(e){return 0===e.indexOf("mapbox:")}function xe(e){return o.API_URL_REGEX.test(e)}function we(e){return o.API_CDN_URL_REGEX.test(e)}function ke(e){return o.API_STYLE_REGEX.test(e)&&!Ee(e)}function Ee(e){return o.API_SPRITE_REGEX.test(e)}const Te=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Se(e){const t=e.match(Te);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Ce(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}const Ae="mapbox.eventData";function Me(e){if(!e)return null;const t=e.split(".");if(!t||3!==t.length)return null;try{return JSON.parse(decodeURIComponent(r.atob(t[1]).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))}catch(e){return null}}class Ie{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const t=Me(o.ACCESS_TOKEN);let n="";return n=t&&t.u?r.btoa(encodeURIComponent(t.u).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(Number("0x"+t))))):o.ACCESS_TOKEN||"",e?`${Ae}.${e}:${n}`:`${Ae}:${n}`}fetchEventData(){const e=J("localStorage"),t=this.getStorageKey(),n=this.getStorageKey("uuid");if(e)try{const e=r.localStorage.getItem(t);e&&(this.eventData=JSON.parse(e));const i=r.localStorage.getItem(n);i&&(this.anonId=i)}catch(e){G("Unable to read from LocalStorage")}}saveEventData(){const e=J("localStorage"),t=this.getStorageKey(),n=this.getStorageKey("uuid");if(e)try{r.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&r.localStorage.setItem(t,JSON.stringify(this.eventData))}catch(e){G("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,t,r,n){if(!o.EVENTS_URL)return;const i=Se(o.EVENTS_URL);i.params.push(`access_token=${n||o.ACCESS_TOKEN||""}`);const a={event:this.type,created:new Date(e).toISOString()},s=t?z(a,t):a,l={url:Ce(i),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=function(e,t){return he(z(e,{method:"POST"}),t)}(l,(e=>{this.pendingRequest=null,r(e),this.saveEventData(),this.processRequests(n)}))}queueRequest(e,t){this.queue.push(e),this.processRequests(t)}}const Oe=new class extends Ie{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(e,t){o.EVENTS_URL&&o.ACCESS_TOKEN&&Array.isArray(e)&&e.some((e=>ve(e)||xe(e)))&&this.queueRequest(Date.now(),t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const t=Me(o.ACCESS_TOKEN),r=t?t.u:o.ACCESS_TOKEN;let i=r!==this.eventData.tokenU;F(this.anonId)||(this.anonId=R(),i=!0);const a=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(a),r=(a-this.eventData.lastSuccess)/864e5;i=i||r>=1||r<-1||e.getDate()!==t.getDate()}else i=!0;i?this.postEvent(a,{sdkIdentifier:"mapbox-gl-js",sdkVersion:n,skuId:h,"enabled.telemetry":!1,userId:this.anonId},(e=>{e||(this.eventData.lastSuccess=a,this.eventData.tokenU=r)}),e):this.processRequests()}},Le=Oe.postTurnstileEvent.bind(Oe),ze=new class extends Ie{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(e,t,r,n){this.skuToken=t,this.errorCb=n,o.EVENTS_URL&&(r||o.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},r):this.errorCb(new Error(ye)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:r}=this.queue.shift();t&&this.success[t]||(this.anonId||this.fetchEventData(),F(this.anonId)||(this.anonId=R()),this.postEvent(r,{sdkIdentifier:"mapbox-gl-js",sdkVersion:n,skuId:h,skuToken:this.skuToken,userId:this.anonId},(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e))}},De=ze.postMapLoadEvent.bind(ze),Pe=new class extends Ie{constructor(){super("gljs.performance")}postPerformanceEvent(e,t){o.EVENTS_URL&&(e||o.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,performanceData:i}=this.queue.shift(),o=function(e){const t=r.performance.getEntriesByType("resource"),i=r.performance.getEntriesByType("mark"),o=function(e){const t={};if(e)for(const r in e)if("other"!==r)for(const n of e[r]){const e=`${r}ResolveRangeMin`,i=`${r}ResolveRangeMax`,o=`${r}RequestCount`,a=`${r}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,n.startTime),t[i]=Math.max(t[i]||-1/0,n.responseEnd);const s=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==n.transferSize&&0===n.transferSize&&s(a),s(o)}return t}(function(e,t){const r={};if(e)for(const n of e){const e=t(n);void 0===r[e]&&(r[e]=[]),r[e].push(n)}return r}(t,Ve)),a=r.devicePixelRatio,s=r.navigator.connection||r.navigator.mozConnection||r.navigator.webkitConnection,l={counters:[],metadata:[],attributes:[]},c=(e,t,r)=>{null!=r&&e.push({name:t,value:r.toString()})};for(const e in o)c(l.counters,e,o[e]);if(e.interactionRange[0]!==1/0&&e.interactionRange[1]!==-1/0&&(c(l.counters,"interactionRangeMin",e.interactionRange[0]),c(l.counters,"interactionRangeMax",e.interactionRange[1])),i)for(const e of Object.keys(Ne)){const t=Ne[e],r=i.find((e=>e.name===t));r&&c(l.counters,t,r.startTime)}return c(l.counters,"visibilityHidden",e.visibilityHidden),c(l.attributes,"style",function(e){if(e)for(const t of e){const e=t.name.split("?")[0];if(ke(e)){const t=e.split("/").slice(-2);if(2===t.length)return`mapbox://styles/${t[0]}/${t[1]}`}}}(t)),c(l.attributes,"terrainEnabled",e.terrainEnabled?"true":"false"),c(l.attributes,"fogEnabled",e.fogEnabled?"true":"false"),c(l.attributes,"projection",e.projection),c(l.attributes,"zoom",e.zoom),c(l.metadata,"devicePixelRatio",a),c(l.metadata,"connectionEffectiveType",s?s.effectiveType:void 0),c(l.metadata,"navigatorUserAgent",r.navigator.userAgent),c(l.metadata,"screenWidth",r.screen.width),c(l.metadata,"screenHeight",r.screen.height),c(l.metadata,"windowWidth",r.innerWidth),c(l.metadata,"windowHeight",r.innerHeight),c(l.metadata,"mapWidth",e.width/a),c(l.metadata,"mapHeight",e.height/a),c(l.metadata,"webglRenderer",e.renderer),c(l.metadata,"webglVendor",e.vendor),c(l.metadata,"sdkVersion",n),c(l.metadata,"sdkIdentifier","mapbox-gl-js"),l}(i);for(const e of o.metadata);for(const e of o.counters);for(const e of o.attributes);this.postEvent(t,o,(()=>{}),e)}},Re=Pe.postPerformanceEvent.bind(Pe),Be=new class extends Ie{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(e,t,r,n){if(!o.API_URL||!o.SESSION_PATH)return;const i=Se(o.API_URL+o.SESSION_PATH);i.params.push(`sku=${t||""}`),i.params.push(`access_token=${n||o.ACCESS_TOKEN||""}`);const a={url:Ce(i),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(e,t){return he(z(e,{method:"GET"}),t)}(a,(e=>{this.pendingRequest=null,r(e),this.saveEventData(),this.processRequests(n)}))}getSessionAPI(e,t,r,n){this.skuToken=t,this.errorCb=n,o.SESSION_PATH&&o.API_URL&&(r||o.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},r):this.errorCb(new Error(ye)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:r}=this.queue.shift();t&&this.success[t]||this.getSession(r,this.skuToken,(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e)}},Fe=Be.getSessionAPI.bind(Be),je=new Set,Ne={create:"create",load:"load",fullLoad:"fullLoad"},Ue={mark(e){r.performance.mark(e)},measure(e,t,n){r.performance.measure(e,t,n)}};function Ve(e){const t=e.name.split("?")[0];return we(t)&&t.includes("mapbox-gl.js")?"javascript":we(t)&&t.includes("mapbox-gl.css")?"css":function(e){return o.API_FONTS_REGEX.test(e)}(t)?"fontRange":Ee(t)?"sprite":ke(t)?"style":function(e){return o.API_TILEJSON_REGEX.test(e)}(t)?"tilejson":"other"}const qe=r.performance;function $e(e){const t=e?e.url.toString():void 0;return qe.getEntriesByName(t)}let Ge,We,He,Ze;const Xe={now:()=>void 0!==He?He:r.performance.now(),setNow(e){He=e},restoreNow(){He=void 0},frame(e){const t=r.requestAnimationFrame(e);return{cancel:()=>r.cancelAnimationFrame(t)}},getImageData(e,t=0){const{width:n,height:i}=e;Ze||(Ze=r.document.createElement("canvas"));const o=Ze.getContext("2d",{willReadFrequently:!0});if(!o)throw new Error("failed to create canvas 2d context");return(n>Ze.width||i>Ze.height)&&(Ze.width=n,Ze.height=i),o.clearRect(-t,-t,n+2*t,i+2*t),o.drawImage(e,0,0,n,i),o.getImageData(-t,-t,n+2*t,i+2*t)},resolveURL:e=>(Ge||(Ge=r.document.createElement("a")),Ge.href=e,Ge.href),get devicePixelRatio(){return r.devicePixelRatio},get prefersReducedMotion(){return!!r.matchMedia&&(null==We&&(We=r.matchMedia("(prefers-reduced-motion: reduce)")),We.matches)}};function Ke(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function Ye(e,t,r){if(r&&r[e]){const n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}class Je{constructor(e,t={}){z(this,t),this.type=e}}class Qe extends Je{constructor(e,t={}){super("error",z({error:e},t))}}class et{on(e,t){return this._listeners=this._listeners||{},Ke(e,t,this._listeners),this}off(e,t){return Ye(e,t,this._listeners),Ye(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},Ke(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new Je(e,t||{}));const r=e.type;if(this.listens(r)){e.target=this;const t=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of t)r.call(this,e);const n=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const t of n)Ye(r,t,this._oneTimeListeners),t.call(this,e);const i=this._eventedParent;i&&(z(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(e))}return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}var tt=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":{},"mapbox":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":{},"line":{},"line-center":{}},"default":"point","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"units":"factor of the original icon size","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":{},"width":{},"height":{},"both":{}},"default":"none","requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"units":"pixels","requires":["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","units":"ems","default":0,"requires":["text-field"],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["text-field",{"!":"text-variable-anchor"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"units":"degrees","requires":["text-field",{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","units":"ems","length":2,"default":[0,0],"requires":["text-field",{"!":"text-radial-offset"}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"geometry_type":{"type":"enum","values":{"Point":{},"LineString":{},"Polygon":{}}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":{},"exponential":{},"interval":{},"categorical":{}},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{},"lab":{},"hcl":{}},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds"},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds"}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function rt(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}function nt(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function it(e){if(Array.isArray(e))return e.map(it);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const r in e)t[r]=it(e[r]);return t}return nt(e)}class ot extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}var at=ot;class st{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new st(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}var lt=st;const ct={kind:"null"},ut={kind:"number"},pt={kind:"string"},ht={kind:"boolean"},dt={kind:"color"},ft={kind:"object"},mt={kind:"value"},gt={kind:"collator"},bt={kind:"formatted"},_t={kind:"resolvedImage"};function yt(e,t){return{kind:"array",itemType:e,N:t}}function vt(e){if("array"===e.kind){const t=vt(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const xt=[ct,ut,pt,ht,dt,bt,ft,yt(mt),_t];function wt(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!wt(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of xt)if(!wt(e,t))return null}return`Expected ${vt(e)} but found ${vt(t)} instead.`}function kt(e,t){return t.some((t=>t.kind===e.kind))}function Et(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}var Tt,St={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ct(e){return(e=Math.round(e))<0?0:e>255?255:e}function At(e){return Ct("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function Mt(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function It(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{Tt={}.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in St)return St[r].slice();if("#"===r[0])return 4===r.length?(t=parseInt(r.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var n=r.indexOf("("),i=r.indexOf(")");if(-1!==n&&i+1===r.length){var o=r.substr(0,n),a=r.substr(n+1,i-(n+1)).split(","),s=1;switch(o){case"rgba":if(4!==a.length)return null;s=Mt(a.pop());case"rgb":return 3!==a.length?null:[At(a[0]),At(a[1]),At(a[2]),s];case"hsla":if(4!==a.length)return null;s=Mt(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,c=Mt(a[1]),u=Mt(a[2]),p=u<=.5?u*(c+1):u+c-u*c,h=2*u-p;return[Ct(255*It(h,p,l+1/3)),Ct(255*It(h,p,l)),Ct(255*It(h,p,l-1/3)),s];default:return null}}return null}}catch(e){}class Ot{constructor(e,t,r,n=1){this.r=e,this.g=t,this.b=r,this.a=n}static parse(e){if(!e)return;if(e instanceof Ot)return e;if("string"!=typeof e)return;const t=Tt(e);return t?new Ot(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3]):void 0}toString(){const[e,t,r,n]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(r)},${n})`}toArray(){const{r:e,g:t,b:r,a:n}=this;return 0===n?[0,0,0,0]:[255*e/n,255*t/n,255*r/n,n]}toArray01(){const{r:e,g:t,b:r,a:n}=this;return 0===n?[0,0,0,0]:[e/n,t/n,r/n,n]}toArray01PremultipliedAlpha(){const{r:e,g:t,b:r,a:n}=this;return[e,t,r,n]}}Ot.black=new Ot(0,0,0,1),Ot.white=new Ot(1,1,1,1),Ot.transparent=new Ot(0,0,0,0),Ot.red=new Ot(1,0,0,1),Ot.blue=new Ot(0,0,1,1);var Lt=Ot;class zt{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Dt{constructor(e,t,r,n,i){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i}}class Pt{constructor(e){this.sections=e}static fromString(e){return new Pt([new Dt(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof Pt?e:Pt.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.name]);continue}e.push(t.text);const r={};t.fontStack&&(r["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(r["font-scale"]=t.scale),t.textColor&&(r["text-color"]=["rgba"].concat(t.textColor.toArray())),e.push(r)}return e}}class Rt{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Rt({name:e,available:!1}):null}serialize(){return["image",this.name]}}function Bt(e,t,r,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ft(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Lt)return!0;if(e instanceof zt)return!0;if(e instanceof Pt)return!0;if(e instanceof Rt)return!0;if(Array.isArray(e)){for(const t of e)if(!Ft(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!Ft(e[t]))return!1;return!0}return!1}function jt(e){if(null===e)return ct;if("string"==typeof e)return pt;if("boolean"==typeof e)return ht;if("number"==typeof e)return ut;if(e instanceof Lt)return dt;if(e instanceof zt)return gt;if(e instanceof Pt)return bt;if(e instanceof Rt)return _t;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=jt(t);if(r){if(r===e)continue;r=mt;break}r=e}return yt(r||mt,t)}return ft}function Nt(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Lt||e instanceof Pt||e instanceof Rt?e.toString():JSON.stringify(e)}class Ut{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Ft(e[1]))return t.error("invalid value");const r=e[1];let n=jt(r);const i=t.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new Ut(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Lt?["rgba"].concat(this.value.toArray()):this.value instanceof Pt?this.value.serialize():this.value}}var Vt=Ut,qt=class{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}};const $t={string:pt,number:ut,boolean:ht,object:ft};class Gt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const i=e[0];if("array"===i){let i,o;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in $t)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=$t[r],n++}else i=mt;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}r=yt(i,o)}else r=$t[i];const o=[];for(;n<e.length;n++){const r=t.parse(e[n],n,mt);if(!r)return null;o.push(r)}return new Gt(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!wt(this.type,jt(r)))return r;if(t===this.args.length-1)throw new qt(`Expected value to be of type ${vt(this.type)}, but found ${vt(jt(r))} instead.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){t.push(r.kind);const n=e.N;("number"==typeof n||this.args.length>1)&&t.push(n)}}return t.concat(this.args.map((e=>e.serialize())))}}var Wt=Gt;class Ht{constructor(e){this.type=bt,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let i=!1;for(let r=1;r<=e.length-1;++r){const o=e[r];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;let e=null;if(o["font-scale"]&&(e=t.parse(o["font-scale"],1,ut),!e))return null;let r=null;if(o["text-font"]&&(r=t.parse(o["text-font"],1,yt(pt)),!r))return null;let a=null;if(o["text-color"]&&(a=t.parse(o["text-color"],1,dt),!a))return null;const s=n[n.length-1];s.scale=e,s.font=r,s.textColor=a}else{const o=t.parse(e[r],1,mt);if(!o)return null;const a=o.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:o,scale:null,font:null,textColor:null})}}return new Ht(n)}evaluate(e){return new Pt(this.sections.map((t=>{const r=t.content.evaluate(e);return jt(r)===_t?new Dt("",r,null,null,null):new Dt(Nt(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const r={};t.scale&&(r["font-scale"]=t.scale.serialize()),t.font&&(r["text-font"]=t.font.serialize()),t.textColor&&(r["text-color"]=t.textColor.serialize()),e.push(r)}return e}}class Zt{constructor(e){this.type=_t,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,pt);return r?new Zt(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=Rt.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Xt={"to-boolean":ht,"to-color":dt,"to-number":ut,"to-string":pt};class Kt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=Xt[r],i=[];for(let r=1;r<e.length;r++){const n=t.parse(e[r],r,mt);if(!n)return null;i.push(n)}return new Kt(n,i)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof Lt)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:Bt(t[0],t[1],t[2],t[3]),!r))return new Lt(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new qt(r||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new qt(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?Pt.fromString(Nt(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?Rt.fromString(Nt(this.args[0].evaluate(e))):Nt(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new Ht([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Zt(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild((t=>{e.push(t.serialize())})),e}}var Yt=Kt;const Jt=["Unknown","Point","LineString","Polygon"];var Qt=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Jt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:r,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(r*t-e[0])+this.featureDistanceData.bearing[1]*(n*t-e[1])}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Lt.parse(e)),t}};class er{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((e=>e.serialize())))}static parse(e,t){const r=e[0],n=er.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,a=o.filter((([t])=>!Array.isArray(t)||t.length===e.length-1));let s=null;for(const[n,o]of a){s=new Cr(t.registry,t.path,null,t.scope);const a=[];let l=!1;for(let t=1;t<e.length;t++){const r=e[t],i=Array.isArray(n)?n[t-1]:n.type,o=s.parse(r,1+a.length,i);if(!o){l=!0;break}a.push(o)}if(!l)if(Array.isArray(n)&&n.length!==a.length)s.error(`Expected ${n.length} arguments, but found ${a.length} instead.`);else{for(let e=0;e<a.length;e++){const t=Array.isArray(n)?n[e]:n.type,r=a[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new er(r,i,o,a)}}if(1===a.length)t.errors.push(...s.errors);else{const r=(a.length?a:o).map((([e])=>{return t=e,Array.isArray(t)?`(${t.map(vt).join(", ")})`:`(${vt(t.type)}...)`;var t})).join(" | "),n=[];for(let r=1;r<e.length;r++){const i=t.parse(e[r],1+n.length);if(!i)return null;n.push(vt(i.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){er.definitions=t;for(const r in t)e[r]=er}}var tr=er;class rr{constructor(e,t,r){this.type=gt,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,ht);if(!n)return null;const i=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,ht);if(!i)return null;let o=null;return r.locale&&(o=t.parse(r.locale,1,pt),!o)?null:new rr(n,i,o)}evaluate(e){return new zt(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}const nr=8192;function ir(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function or(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function ar(e,t){const r=(180+e[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=Math.pow(2,t.z);return[Math.round(r*i*nr),Math.round(n*i*nr)]}function sr(e,t,r){const n=e[0]-t[0],i=e[1]-t[1],o=e[0]-r[0],a=e[1]-r[1];return n*a-o*i==0&&n*o<=0&&i*a<=0}function lr(e,t){let r=!1;for(let a=0,s=t.length;a<s;a++){const s=t[a];for(let t=0,a=s.length;t<a-1;t++){if(sr(e,s[t],s[t+1]))return!1;(i=s[t])[1]>(n=e)[1]!=(o=s[t+1])[1]>n[1]&&n[0]<(o[0]-i[0])*(n[1]-i[1])/(o[1]-i[1])+i[0]&&(r=!r)}}var n,i,o;return r}function cr(e,t){for(let r=0;r<t.length;r++)if(lr(e,t[r]))return!0;return!1}function ur(e,t,r,n){const i=n[0]-r[0],o=n[1]-r[1],a=(e[0]-r[0])*o-i*(e[1]-r[1]),s=(t[0]-r[0])*o-i*(t[1]-r[1]);return a>0&&s<0||a<0&&s>0}function pr(e,t,r){for(const c of r)for(let r=0;r<c.length-1;++r)if(0!=(s=[(a=c[r+1])[0]-(o=c[r])[0],a[1]-o[1]])[0]*(l=[(i=t)[0]-(n=e)[0],i[1]-n[1]])[1]-s[1]*l[0]&&ur(n,i,o,a)&&ur(o,a,n,i))return!0;var n,i,o,a,s,l;return!1}function hr(e,t){for(let r=0;r<e.length;++r)if(!lr(e[r],t))return!1;for(let r=0;r<e.length-1;++r)if(pr(e[r],e[r+1],t))return!1;return!0}function dr(e,t){for(let r=0;r<t.length;r++)if(hr(e,t[r]))return!0;return!1}function fr(e,t,r){const n=[];for(let i=0;i<e.length;i++){const o=[];for(let n=0;n<e[i].length;n++){const a=ar(e[i][n],r);ir(t,a),o.push(a)}n.push(o)}return n}function mr(e,t,r){const n=[];for(let i=0;i<e.length;i++){const o=fr(e[i],t,r);n.push(o)}return n}function gr(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){const t=.5*n;let i=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===i&&(i=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=i}ir(t,e)}function br(e,t,r,n){const i=Math.pow(2,n.z)*nr,o=[n.x*nr,n.y*nr],a=[];if(!e)return a;for(const n of e)for(const e of n){const n=[e.x+o[0],e.y+o[1]];gr(n,t,r,i),a.push(n)}return a}function _r(e,t,r,n){const i=Math.pow(2,n.z)*nr,o=[n.x*nr,n.y*nr],a=[];if(!e)return a;for(const r of e){const e=[];for(const n of r){const r=[n.x+o[0],n.y+o[1]];ir(t,r),e.push(r)}a.push(e)}if(t[2]-t[0]<=i/2){(s=t)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const e of a)for(const n of e)gr(n,t,r,i)}var s;return a}class yr{constructor(e,t){this.type=ht,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Ft(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e<t.features.length;++e){const r=t.features[e].geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new yr(t,t.features[e].geometry)}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new yr(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new yr(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(!i)return!1;if("Polygon"===t.type){const o=fr(t.coordinates,n,i),a=br(e.geometry(),r,n,i);if(!or(r,n))return!1;for(const e of a)if(!lr(e,o))return!1}if("MultiPolygon"===t.type){const o=mr(t.coordinates,n,i),a=br(e.geometry(),r,n,i);if(!or(r,n))return!1;for(const e of a)if(!cr(e,o))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(!i)return!1;if("Polygon"===t.type){const o=fr(t.coordinates,n,i),a=_r(e.geometry(),r,n,i);if(!or(r,n))return!1;for(const e of a)if(!hr(e,o))return!1}if("MultiPolygon"===t.type){const o=mr(t.coordinates,n,i),a=_r(e.geometry(),r,n,i);if(!or(r,n))return!1;for(const e of a)if(!dr(e,o))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var vr=yr;function xr(e){if(e instanceof tr){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof vr)return!1;let t=!0;return e.eachChild((e=>{t&&!xr(e)&&(t=!1)})),t}function wr(e){if(e instanceof tr&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!wr(e)&&(t=!1)})),t}function kr(e,t){if(e instanceof tr&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!kr(e,t)&&(r=!1)})),r}class Er{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new Er(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var Tr=Er;class Sr{constructor(e,t=[],r,n=new lt,i=[]){this.registry=e,this.path=t,this.key=t.map((e=>`[${e}]`)).join(""),this.scope=n,this.errors=i,this.expectedType=r}parse(e,t,r,n,i={}){return t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)}_parse(e,t){function r(e,t,r){return"assert"===r?new Wt(t,[e]):"coerce"===r?new Yt(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const i=this.registry[n];if(i){let n=i.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,i=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==i.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==i.kind&&"string"!==i.kind){if(this.checkSubtype(e,i))return null}else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof Vt)&&"resolvedImage"!==n.type.kind&&Ar(n)){const t=new Qt;try{n=new Vt(n.type,n.evaluate(t))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new Sr(this.registry,n,t||null,i,this.errors)}error(e,...t){const r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new at(r,e))}checkSubtype(e,t){const r=wt(e,t);return r&&this.error(r),r}}var Cr=Sr;function Ar(e){if(e instanceof Tr)return Ar(e.boundExpression);if(e instanceof tr&&"error"===e.name)return!1;if(e instanceof rr)return!1;if(e instanceof vr)return!1;const t=e instanceof Yt||e instanceof Wt;let r=!0;return e.eachChild((e=>{r=t?r&&Ar(e):r&&e instanceof Vt})),!!r&&xr(e)&&kr(e,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function Mr(e,t){const r=e.length-1;let n,i,o=0,a=r,s=0;for(;o<=a;)if(s=Math.floor((o+a)/2),n=e[s],i=e[s+1],n<=t){if(s===r||t<i)return s;o=s+1}else{if(!(n>t))throw new qt("Input is not a number.");a=s-1}return 0}class Ir{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,ut);if(!r)return null;const n=[];let i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(let r=1;r<e.length;r+=2){const o=1===r?-1/0:e[r],a=e[r+1],s=r,l=r+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(n.length&&n[n.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=t.parse(a,l,i);if(!c)return null;i=i||c.type,n.push([o,c])}return new Ir(i,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Mr(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){const e=["step",this.input.serialize()];for(let t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}var Or=Ir;function Lr(e,t,r){return e*(1-r)+t*r}var zr=Object.freeze({__proto__:null,array:function(e,t,r){return e.map(((e,n)=>Lr(e,t[n],r)))},color:function(e,t,r){return new Lt(Lr(e.r,t.r,r),Lr(e.g,t.g,r),Lr(e.b,t.b,r),Lr(e.a,t.a,r))},number:Lr});const Dr=.95047,Pr=1.08883,Rr=4/29,Br=6/29,Fr=3*Br*Br,jr=Br*Br*Br,Nr=Math.PI/180,Ur=180/Math.PI;function Vr(e){return e>jr?Math.pow(e,1/3):e/Fr+Rr}function qr(e){return e>Br?e*e*e:Fr*(e-Rr)}function $r(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Gr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Wr(e){const t=Gr(e.r),r=Gr(e.g),n=Gr(e.b),i=Vr((.4124564*t+.3575761*r+.1804375*n)/Dr),o=Vr((.2126729*t+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Vr((.0193339*t+.119192*r+.9503041*n)/Pr)),alpha:e.a}}function Hr(e){let t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*qr(t),r=Dr*qr(r),n=Pr*qr(n),new Lt($r(3.2404542*r-1.5371385*t-.4985314*n),$r(-.969266*r+1.8760108*t+.041556*n),$r(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function Zr(e,t,r){const n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}const Xr={forward:Wr,reverse:Hr,interpolate:function(e,t,r){return{l:Lr(e.l,t.l,r),a:Lr(e.a,t.a,r),b:Lr(e.b,t.b,r),alpha:Lr(e.alpha,t.alpha,r)}}},Kr={forward:function(e){const{l:t,a:r,b:n}=Wr(e),i=Math.atan2(n,r)*Ur;return{h:i<0?i+360:i,c:Math.sqrt(r*r+n*n),l:t,alpha:e.a}},reverse:function(e){const t=e.h*Nr,r=e.c;return Hr({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:Zr(e.h,t.h,r),c:Lr(e.c,t.c,r),l:Lr(e.l,t.l,r),alpha:Lr(e.alpha,t.alpha,r)}}};var Yr=Object.freeze({__proto__:null,hcl:Kr,lab:Xr});class Jr{constructor(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let i=0;if("exponential"===e.name)i=Qr(t,e.base,r,n);else if("linear"===e.name)i=Qr(t,1,r,n);else if("cubic-bezier"===e.name){const o=e.controlPoints;i=new g(o[0],o[1],o[2],o[3]).solve(Qr(t,1,r,n))}return i}static parse(e,t){let[r,n,i,...o]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(i=t.parse(i,2,ut),!i)return null;const a=[];let s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=dt:t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType);for(let e=0;e<o.length;e+=2){const r=o[e],n=o[e+1],i=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',i);if(a.length&&a[a.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const c=t.parse(n,l,s);if(!c)return null;s=s||c.type,a.push([r,c])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new Jr(s,r,n,i,a):t.error(`Type ${vt(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);const o=Mr(t,n),a=Jr.interpolationFactor(this.interpolation,n,t[o],t[o+1]),s=r[o].evaluate(e),l=r[o+1].evaluate(e);return"interpolate"===this.operator?zr[this.type.kind.toLowerCase()](s,l,a):"interpolate-hcl"===this.operator?Kr.reverse(Kr.interpolate(Kr.forward(s),Kr.forward(l),a)):Xr.reverse(Xr.interpolate(Xr.forward(s),Xr.forward(l),a))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let e=0;e<this.labels.length;e++)t.push(this.labels[e],this.outputs[e].serialize());return t}}function Qr(e,t,r,n){const i=n-r,o=e-r;return 0===i?0:1===t?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}var en=Jr;class tn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const i=[];for(const n of e.slice(1)){const e=t.parse(n,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,i.push(e)}const o=n&&i.some((e=>wt(n,e.type)));return new tn(o?mt:r,i)}evaluate(e){let t,r=null,n=0;for(const i of this.args){if(n++,r=i.evaluate(e),r&&r instanceof Rt&&!r.available&&(t||(t=r),r=null,n===this.args.length))return t;if(null!==r)break}return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=["coalesce"];return this.eachChild((t=>{e.push(t.serialize())})),e}}var rn=tn;class nn{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n<e.length-1;n+=2){const i=e[n];if("string"!=typeof i)return t.error(`Expected string, but found ${typeof i} instead.`,n);if(/[^a-zA-Z0-9_]/.test(i))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const o=t.parse(e[n+1],n+1);if(!o)return null;r.push([i,o])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new nn(r,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[t,r]of this.bindings)e.push(t,r.serialize());return e.push(this.result.serialize()),e}}var on=nn;class an{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ut),n=t.parse(e[2],2,yt(t.expectedType||mt));return r&&n?new an(n.type.itemType,r,n):null}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new qt(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new qt(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new qt(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var sn=an;class ln{constructor(e,t){this.type=ht,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,mt),n=t.parse(e[2],2,mt);return r&&n?kt(r.type,[ht,pt,ut,ct,mt])?new ln(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${vt(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(null==r)return!1;if(!Et(t,["boolean","string","number","null"]))throw new qt(`Expected first argument to be of type boolean, string, number or null, but found ${vt(jt(t))} instead.`);if(!Et(r,["string","array"]))throw new qt(`Expected second argument to be of type array or string, but found ${vt(jt(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var cn=ln;class un{constructor(e,t,r){this.type=ut,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,mt),n=t.parse(e[2],2,mt);if(!r||!n)return null;if(!kt(r.type,[ht,pt,ut,ct,mt]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${vt(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,ut);return i?new un(r,n,i):null}return new un(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Et(t,["boolean","string","number","null"]))throw new qt(`Expected first argument to be of type boolean, string, number or null, but found ${vt(jt(t))} instead.`);if(!Et(r,["string","array"]))throw new qt(`Expected second argument to be of type array or string, but found ${vt(jt(r))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var pn=un;class hn{constructor(e,t,r,n,i,o){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const i={},o=[];for(let a=2;a<e.length-1;a+=2){let s=e[a];const l=e[a+1];Array.isArray(s)||(s=[s]);const c=t.concat(a);if(0===s.length)return c.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,jt(e)))return null}else r=jt(e);if(void 0!==i[String(e)])return c.error("Branch labels must be unique.");i[String(e)]=o.length}const u=t.parse(l,a,n);if(!u)return null;n=n||u.type,o.push(u)}const a=t.parse(e[1],1,mt);if(!a)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==a.type.kind&&t.concat(1).checkSubtype(r,a.type)?null:new hn(r,n,a,i,o,s):null}evaluate(e){const t=this.input.evaluate(e);return(jt(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),r=[],n={};for(const e of t){const t=n[this.cases[e]];void 0===t?(n[this.cases[e]]=r.length,r.push([this.cases[e],[e]])):r[t][1].push(e)}const i=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,n]of r)e.push(1===n.length?i(n[0]):n.map(i)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}var dn=hn;class fn{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let i=1;i<e.length-1;i+=2){const o=t.parse(e[i],i,ht);if(!o)return null;const a=t.parse(e[i+1],i+1,r);if(!a)return null;n.push([o,a]),r=r||a.type}const i=t.parse(e[e.length-1],e.length-1,r);return i?new fn(r,n,i):null}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild((t=>{e.push(t.serialize())})),e}}var mn=fn;class gn{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,mt),n=t.parse(e[2],2,ut);if(!r||!n)return null;if(!kt(r.type,[yt(mt),pt,mt]))return t.error(`Expected first argument to be of type array or string, but found ${vt(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,ut);return i?new gn(r.type,r,n,i):null}return new gn(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Et(t,["string","array"]))throw new qt(`Expected first argument to be of type array or string, but found ${vt(jt(t))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var bn=gn;function _n(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function yn(e,t,r,n){return 0===n.compare(t,r)}function vn(e,t,r){const n="=="!==e&&"!="!==e;return class i{constructor(e,t,r){this.type=ht,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let o=t.parse(e[1],1,mt);if(!o)return null;if(!_n(r,o.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${vt(o.type)}'.`);let a=t.parse(e[2],2,mt);if(!a)return null;if(!_n(r,a.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${vt(a.type)}'.`);if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error(`Cannot compare types '${vt(o.type)}' and '${vt(a.type)}'.`);n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new Wt(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new Wt(o.type,[a])));let s=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,gt),!s)return null}return new i(o,a,s)}evaluate(i){const o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const t=jt(o),r=jt(a);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new qt(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=jt(o),r=jt(a);if("string"!==e.kind||"string"!==r.kind)return t(i,o,a)}return this.collator?r(i,o,a,this.collator.evaluate(i)):t(i,o,a)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild((e=>{t.push(e.serialize())})),t}}}const xn=vn("==",(function(e,t,r){return t===r}),yn),wn=vn("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!yn(0,t,r,n)})),kn=vn("<",(function(e,t,r){return t<r}),(function(e,t,r,n){return n.compare(t,r)<0})),En=vn(">",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),Tn=vn("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),Sn=vn(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0}));class Cn{constructor(e,t,r,n,i,o){this.type=pt,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,ut);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=t.parse(n.locale,1,pt),!i))return null;let o=null;if(n.currency&&(o=t.parse(n.currency,1,pt),!o))return null;let a=null;if(n.unit&&(a=t.parse(n.unit,1,pt),!a))return null;let s=null;if(n["min-fraction-digits"]&&(s=t.parse(n["min-fraction-digits"],1,ut),!s))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,ut),!l)?null:new Cn(r,i,o,a,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class An{constructor(e){this.type=ut,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${vt(r.type)} instead.`):new An(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new qt(`Expected value to be of type string or array, but found ${vt(jt(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild((t=>{e.push(t.serialize())})),e}}const Mn={"==":xn,"!=":wn,">":En,"<":kn,">=":Sn,"<=":Tn,array:Wt,at:sn,boolean:Wt,case:mn,coalesce:rn,collator:rr,format:Ht,image:Zt,in:cn,"index-of":pn,interpolate:en,"interpolate-hcl":en,"interpolate-lab":en,length:An,let:on,literal:Vt,match:dn,number:Wt,"number-format":Cn,object:Wt,slice:bn,step:Or,string:Wt,"to-boolean":Yt,"to-color":Yt,"to-number":Yt,"to-string":Yt,var:Tr,within:vr};function In(e,[t,r,n,i]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const o=i?i.evaluate(e):1,a=Bt(t,r,n,o);if(a)throw new qt(a);return new Lt(t/255*o,r/255*o,n/255*o,o)}function On(e,t){return e in t}function Ln(e,t){const r=t[e];return void 0===r?null:r}function zn(e){return{type:e}}tr.register(Mn,{error:[{kind:"error"},[pt],(e,[t])=>{throw new qt(t.evaluate(e))}],typeof:[pt,[mt],(e,[t])=>vt(jt(t.evaluate(e)))],"to-rgba":[yt(ut,4),[dt],(e,[t])=>t.evaluate(e).toArray()],rgb:[dt,[ut,ut,ut],In],rgba:[dt,[ut,ut,ut,ut],In],has:{type:ht,overloads:[[[pt],(e,[t])=>On(t.evaluate(e),e.properties())],[[pt,ft],(e,[t,r])=>On(t.evaluate(e),r.evaluate(e))]]},get:{type:mt,overloads:[[[pt],(e,[t])=>Ln(t.evaluate(e),e.properties())],[[pt,ft],(e,[t,r])=>Ln(t.evaluate(e),r.evaluate(e))]]},"feature-state":[mt,[pt],(e,[t])=>Ln(t.evaluate(e),e.featureState||{})],properties:[ft,[],e=>e.properties()],"geometry-type":[pt,[],e=>e.geometryType()],id:[mt,[],e=>e.id()],zoom:[ut,[],e=>e.globals.zoom],pitch:[ut,[],e=>e.globals.pitch||0],"distance-from-center":[ut,[],e=>e.distanceFromCenter()],"heatmap-density":[ut,[],e=>e.globals.heatmapDensity||0],"line-progress":[ut,[],e=>e.globals.lineProgress||0],"sky-radial-progress":[ut,[],e=>e.globals.skyRadialProgress||0],accumulated:[mt,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[ut,zn(ut),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[ut,zn(ut),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:ut,overloads:[[[ut,ut],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[ut],(e,[t])=>-t.evaluate(e)]]},"/":[ut,[ut,ut],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[ut,[ut,ut],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[ut,[],()=>Math.LN2],pi:[ut,[],()=>Math.PI],e:[ut,[],()=>Math.E],"^":[ut,[ut,ut],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[ut,[ut],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[ut,[ut],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[ut,[ut],(e,[t])=>Math.log(t.evaluate(e))],log2:[ut,[ut],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[ut,[ut],(e,[t])=>Math.sin(t.evaluate(e))],cos:[ut,[ut],(e,[t])=>Math.cos(t.evaluate(e))],tan:[ut,[ut],(e,[t])=>Math.tan(t.evaluate(e))],asin:[ut,[ut],(e,[t])=>Math.asin(t.evaluate(e))],acos:[ut,[ut],(e,[t])=>Math.acos(t.evaluate(e))],atan:[ut,[ut],(e,[t])=>Math.atan(t.evaluate(e))],min:[ut,zn(ut),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[ut,zn(ut),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[ut,[ut],(e,[t])=>Math.abs(t.evaluate(e))],round:[ut,[ut],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[ut,[ut],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[ut,[ut],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[ht,[pt,mt],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[ht,[mt],(e,[t])=>e.id()===t.value],"filter-type-==":[ht,[pt],(e,[t])=>e.geometryType()===t.value],"filter-<":[ht,[pt,mt],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[ht,[mt],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[ht,[pt,mt],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[ht,[mt],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[ht,[pt,mt],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[ht,[mt],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[ht,[pt,mt],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[ht,[mt],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[ht,[mt],(e,[t])=>t.value in e.properties()],"filter-has-id":[ht,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[ht,[yt(pt)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[ht,[yt(mt)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[ht,[pt,yt(mt)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[ht,[pt,yt(mt)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:ht,overloads:[[[ht,ht],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[zn(ht),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:ht,overloads:[[[ht,ht],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[zn(ht),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[ht,[ht],(e,[t])=>!t.evaluate(e)],"is-supported-script":[ht,[pt],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[pt,[pt],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[pt,[pt],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[pt,zn(mt),(e,t)=>t.map((t=>Nt(t.evaluate(e)))).join("")],"resolved-locale":[pt,[gt],(e,[t])=>t.evaluate(e).resolvedLocale()]});var Dn=Mn;function Pn(e){return{result:"success",value:e}}function Rn(e){return{result:"error",value:e}}function Bn(e){return"data-driven"===e["property-type"]}function Fn(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function jn(e){return!!e.expression&&e.expression.interpolated}function Nn(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Un(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Vn(e){return e}function qn(e,t){const r="color"===t.type,n=e.stops&&"object"==typeof e.stops[0][0],i=n||!(n||void 0!==e.property),o=e.type||(jn(t)?"exponential":"interval");if(r&&((e=rt({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],Lt.parse(e[1])]))),e.default=Lt.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Yr[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let a,s,l;if("exponential"===o)a=Hn;else if("interval"===o)a=Wn;else if("categorical"===o){a=Gn,s=Object.create(null);for(const t of e.stops)s[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);a=Zn}if(n){const r={},n=[];for(let t=0;t<e.stops.length;t++){const i=e.stops[t],o=i[0].zoom;void 0===r[o]&&(r[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},n.push(o)),r[o].stops.push([i[0].value,i[1]])}const i=[];for(const e of n)i.push([r[e].zoom,qn(r[e],t)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:en.interpolationFactor.bind(void 0,o),zoomStops:i.map((e=>e[0])),evaluate:({zoom:r},n)=>Hn({stops:i,base:e.base},t,r).evaluate(r,n)}}if(i){const r="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:en.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:r})=>a(e,t,r,s,l)}}return{kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[e.property]:void 0;return void 0===i?$n(e.default,t.default):a(e,t,i,s,l)}}}function $n(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function Gn(e,t,r,n,i){return $n(typeof r===i?n[r]:void 0,e.default,t.default)}function Wn(e,t,r){if("number"!==Nn(r))return $n(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];const i=Mr(e.stops.map((e=>e[0])),r);return e.stops[i][1]}function Hn(e,t,r){const n=void 0!==e.base?e.base:1;if("number"!==Nn(r))return $n(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];const o=Mr(e.stops.map((e=>e[0])),r),a=function(e,t,r,n){const i=n-r,o=e-r;return 0===i?0:1===t?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}(r,n,e.stops[o][0],e.stops[o+1][0]),s=e.stops[o][1],l=e.stops[o+1][1];let c=zr[t.type]||Vn;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=Yr[e.colorSpace];c=(e,r)=>t.reverse(t.interpolate(t.forward(e),t.forward(r),a))}return"function"==typeof s.evaluate?{evaluate(...e){const t=s.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==r)return c(t,r,a)}}:c(s,l,a)}function Zn(e,t,r){return"color"===t.type?r=Lt.parse(r):"formatted"===t.type?r=Pt.fromString(r.toString()):"resolvedImage"===t.type?r=Rt.fromString(r.toString()):Nn(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),$n(r,e.default,t.default)}class Xn{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Qt,this._defaultValue=t?function(e){return"color"===e.type&&(Un(e.default)||Array.isArray(e.default))?new Lt(0,0,0,0):"color"===e.type?Lt.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,n,i,o,a,s){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,i,o,a,s){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new qt(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0),this._defaultValue}}}function Kn(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Dn}function Yn(e,t){const r=new Cr(Dn,[],t?function(e){const t={color:dt,string:pt,number:ut,enum:pt,boolean:ht,formatted:bt,resolvedImage:_t};return"array"===e.type?yt(t[e.value]||mt,e.length):t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?Pn(new Xn(n,t)):Rn(r.errors)}class Jn{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!wr(t.expression)}evaluateWithoutErrorHandling(e,t,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,o)}evaluate(e,t,r,n,i,o){return this._styleExpression.evaluate(e,t,r,n,i,o)}}class Qn{constructor(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!wr(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,o)}evaluate(e,t,r,n,i,o){return this._styleExpression.evaluate(e,t,r,n,i,o)}interpolationFactor(e,t,r){return this.interpolationType?en.interpolationFactor(this.interpolationType,e,t,r):0}}function ei(e,t){if("error"===(e=Yn(e,t)).result)return e;const r=e.value.expression,n=xr(r);if(!n&&!Bn(t))return Rn([new at("","data expressions not supported")]);const i=kr(r,["zoom","pitch","distance-from-center"]);if(!i&&!Fn(t))return Rn([new at("","zoom expressions not supported")]);const o=ri(r);return o||i?o instanceof at?Rn([o]):o instanceof en&&!jn(t)?Rn([new at("",'"interpolate" expressions cannot be used with this property')]):Pn(o?new Qn(n?"camera":"composite",e.value,o.labels,o instanceof en?o.interpolation:void 0):new Jn(n?"constant":"source",e.value)):Rn([new at("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class ti{constructor(e,t){this._parameters=e,this._specification=t,rt(this,qn(this._parameters,this._specification))}static deserialize(e){return new ti(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function ri(e){let t=null;if(e instanceof on)t=ri(e.result);else if(e instanceof rn){for(const r of e.args)if(t=ri(r),t)break}else(e instanceof Or||e instanceof en)&&e.input instanceof tr&&"zoom"===e.input.name&&(t=e);return t instanceof at||e.eachChild((e=>{const r=ri(e);r instanceof at?t=r:!t&&r?t=new at("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new at("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}class ni{constructor(e,t,r,n){this.message=(e?`${e}: `:"")+r,n&&(this.identifier=n),null!=t&&t.__line__&&(this.line=t.__line__)}}function ii(e){const t=e.key,r=e.value,n=e.valueSpec||{},i=e.objectElementValidators||{},o=e.style,a=e.styleSpec;let s=[];const l=Nn(r);if("object"!==l)return[new ni(t,r,`object expected, ${l} found`)];for(const e in r){const l=e.split(".")[0];let c;i[l]?c=i[l]:n[l]?c=Fi:i["*"]?c=i["*"]:n["*"]&&(c=Fi),c?s=s.concat(c({key:(t?`${t}.`:t)+e,value:r[e],valueSpec:n[l]||n["*"],style:o,styleSpec:a,object:r,objectKey:e},r)):s.push(new ni(t,r[e],`unknown property "${e}"`))}for(const e in n)i[e]||n[e].required&&void 0===n[e].default&&void 0===r[e]&&s.push(new ni(t,r,`missing required property "${e}"`));return s}function oi(e){const t=e.value,r=e.valueSpec,n=e.style,i=e.styleSpec,o=e.key,a=e.arrayElementValidator||Fi;if("array"!==Nn(t))return[new ni(o,t,`array expected, ${Nn(t)} found`)];if(r.length&&t.length!==r.length)return[new ni(o,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.length<r["min-length"])return[new ni(o,t,`array length at least ${r["min-length"]} expected, length ${t.length} found`)];let s={type:r.value,values:r.values,minimum:r.minimum,maximum:r.maximum,function:void 0};i.$version<7&&(s.function=r.function),"object"===Nn(r.value)&&(s=r.value);let l=[];for(let e=0;e<t.length;e++)l=l.concat(a({array:t,arrayIndex:e,value:t[e],valueSpec:s,style:n,styleSpec:i,key:`${o}[${e}]`}));return l}function ai(e){const t=e.key,r=e.value,n=e.valueSpec;let i=Nn(r);if("number"===i&&r!=r&&(i="NaN"),"number"!==i)return[new ni(t,r,`number expected, ${i} found`)];if("minimum"in n){let i=n.minimum;if("array"===Nn(n.minimum)&&(i=n.minimum[e.arrayIndex]),r<i)return[new ni(t,r,`${r} is less than the minimum value ${i}`)]}if("maximum"in n){let i=n.maximum;if("array"===Nn(n.maximum)&&(i=n.maximum[e.arrayIndex]),r>i)return[new ni(t,r,`${r} is greater than the maximum value ${i}`)]}return[]}function si(e){const t=e.valueSpec,r=nt(e.value.type);let n,i,o,a={};const s="categorical"!==r&&void 0===e.value.property,l=!s,c="array"===Nn(e.value.stops)&&"array"===Nn(e.value.stops[0])&&"object"===Nn(e.value.stops[0][0]),u=ii({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===r)return[new ni(e.key,e.value,'identity function may not have a "stops" property')];let t=[];const n=e.value;return t=t.concat(oi({key:e.key,value:n,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:p})),"array"===Nn(n)&&0===n.length&&t.push(new ni(e.key,n,"array must have at least one stop")),t},default:function(e){return Fi({key:e.key,value:e.value,valueSpec:t,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===r&&s&&u.push(new ni(e.key,e.value,'missing required property "property"')),"identity"===r||e.value.stops||u.push(new ni(e.key,e.value,'missing required property "stops"')),"exponential"===r&&e.valueSpec.expression&&!jn(e.valueSpec)&&u.push(new ni(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Bn(e.valueSpec)?u.push(new ni(e.key,e.value,"property functions not supported")):s&&!Fn(e.valueSpec)&&u.push(new ni(e.key,e.value,"zoom functions not supported"))),"categorical"!==r&&!c||void 0!==e.value.property||u.push(new ni(e.key,e.value,'"property" property is required')),u;function p(e){let r=[];const n=e.value,s=e.key;if("array"!==Nn(n))return[new ni(s,n,`array expected, ${Nn(n)} found`)];if(2!==n.length)return[new ni(s,n,`array length 2 expected, length ${n.length} found`)];if(c){if("object"!==Nn(n[0]))return[new ni(s,n,`object expected, ${Nn(n[0])} found`)];if(void 0===n[0].zoom)return[new ni(s,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new ni(s,n,"object stop key must have value")];const t=nt(n[0].zoom);if("number"!=typeof t)return[new ni(s,n[0].zoom,"stop zoom values must be numbers")];if(o&&o>t)return[new ni(s,n[0].zoom,"stop zoom values must appear in ascending order")];t!==o&&(o=t,i=void 0,a={}),r=r.concat(ii({key:`${s}[0]`,value:n[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:ai,value:h}}))}else r=r.concat(h({key:`${s}[0]`,value:n[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},n));return Kn(it(n[1]))?r.concat([new ni(`${s}[1]`,n[1],"expressions are not allowed in function stops.")]):r.concat(Fi({key:`${s}[1]`,value:n[1],valueSpec:t,style:e.style,styleSpec:e.styleSpec}))}function h(e,o){const s=Nn(e.value),l=nt(e.value),c=null!==e.value?e.value:o;if(n){if(s!==n)return[new ni(e.key,c,`${s} stop domain type must match previous stop domain type ${n}`)]}else n=s;if("number"!==s&&"string"!==s&&"boolean"!==s&&"number"!=typeof l&&"string"!=typeof l&&"boolean"!=typeof l)return[new ni(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==r){let n=`number expected, ${s} found`;return Bn(t)&&void 0===r&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ni(e.key,c,n)]}return"categorical"!==r||"number"!==s||"number"==typeof l&&isFinite(l)&&Math.floor(l)===l?"categorical"!==r&&"number"===s&&"number"==typeof l&&"number"==typeof i&&void 0!==i&&l<i?[new ni(e.key,c,"stop domain values must appear in ascending order")]:(i=l,"categorical"===r&&l in a?[new ni(e.key,c,"stop domain values must be unique")]:(a[l]=!0,[])):[new ni(e.key,c,`integer expected, found ${String(l)}`)]}}function li(e){const t=("property"===e.expressionContext?ei:Yn)(it(e.value),e.valueSpec);if("error"===t.result)return t.value.map((t=>new ni(`${e.key}${t.key}`,e.value,t.message)));const r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new ni(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!wr(r))return[new ni(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext)return ci(r,e);if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!kr(r,["zoom","feature-state"]))return[new ni(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!xr(r))return[new ni(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ci(e,t){const r=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(t.valueSpec&&t.valueSpec.expression)for(const e of t.valueSpec.expression.parameters)r.delete(e);if(0===r.size)return[];const n=[];return e instanceof tr&&r.has(e.name)?[new ni(t.key,t.value,`["${e.name}"] expression is not supported in a filter for a ${t.object.type} layer with id: ${t.object.id}`)]:(e.eachChild((e=>{n.push(...ci(e,t))})),n)}function ui(e){const t=e.key,r=e.value,n=e.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(nt(r))&&i.push(new ni(t,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(nt(r))&&i.push(new ni(t,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function pi(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!pi(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function hi(e,t="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};pi(e)||(e=yi(e));const r=e;let n=!0;try{n=function(e){if(!mi(e))return e;let t=it(e);return fi(t),t=di(t),t}(r)}catch(e){}const i=tt[`filter_${t}`],o=Yn(n,i);let a=null;if("error"===o.result)throw new Error(o.value.map((e=>`${e.key}: ${e.message}`)).join(", "));a=(e,t,r)=>o.value.evaluate(e,t,{},r);let s=null,l=null;if(n!==r){const e=Yn(r,i);if("error"===e.result)throw new Error(e.value.map((e=>`${e.key}: ${e.message}`)).join(", "));s=(t,r,n,i,o)=>e.value.evaluate(t,r,{},n,void 0,void 0,i,o),l=!xr(e.value.expression)}return{filter:a,dynamicFilter:s||void 0,needGeometry:_i(n),needFeature:!!l}}function di(e){if(!Array.isArray(e))return e;const t=function(e){if(gi.has(e[0]))for(let t=1;t<e.length;t++)if(mi(e[t]))return!0;return e}(e);return!0===t?t:t.map((e=>di(e)))}function fi(e){let t=!1;const r=[];if("case"===e[0]){for(let n=1;n<e.length-1;n+=2)t=t||mi(e[n]),r.push(e[n+1]);r.push(e[e.length-1])}else if("match"===e[0]){t=t||mi(e[1]);for(let t=2;t<e.length-1;t+=2)r.push(e[t+1]);r.push(e[e.length-1])}else if("step"===e[0]){t=t||mi(e[1]);for(let t=1;t<e.length-1;t+=2)r.push(e[t+1])}t&&(e.length=0,e.push("any",...r));for(let t=1;t<e.length;t++)fi(e[t])}function mi(e){if(!Array.isArray(e))return!1;if("pitch"===(t=e[0])||"distance-from-center"===t)return!0;var t;for(let t=1;t<e.length;t++)if(mi(e[t]))return!0;return!1}const gi=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function bi(e,t){return e<t?-1:e>t?1:0}function _i(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(let t=1;t<e.length;t++)if(_i(e[t]))return!0;return!1}function yi(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?vi(e[1],e[2],"=="):"!="===t?ki(vi(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?vi(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(yi))):"all"===t?["all"].concat(e.slice(1).map(yi)):"none"===t?["all"].concat(e.slice(1).map(yi).map(ki)):"in"===t?xi(e[1],e.slice(2)):"!in"===t?ki(xi(e[1],e.slice(2))):"has"===t?wi(e[1]):"!has"===t?ki(wi(e[1])):"within"!==t||e;var r}function vi(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function xi(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(bi)]]:["filter-in-small",e,["literal",t]]}}function wi(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function ki(e){return["!",e]}function Ei(e){return pi(it(e.value))?li(rt({},e,{expressionContext:"filter",valueSpec:e.styleSpec[`filter_${e.layerType||"fill"}`]})):Ti(e)}function Ti(e){const t=e.value,r=e.key;if("array"!==Nn(t))return[new ni(r,t,`array expected, ${Nn(t)} found`)];const n=e.styleSpec;let i,o=[];if(t.length<1)return[new ni(r,t,"filter array must have at least 1 element")];switch(o=o.concat(ui({key:`${r}[0]`,value:t[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),nt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===nt(t[1])&&o.push(new ni(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":3!==t.length&&o.push(new ni(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(i=Nn(t[1]),"string"!==i&&o.push(new ni(`${r}[1]`,t[1],`string expected, ${i} found`)));for(let a=2;a<t.length;a++)i=Nn(t[a]),"$type"===nt(t[1])?o=o.concat(ui({key:`${r}[${a}]`,value:t[a],valueSpec:n.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&o.push(new ni(`${r}[${a}]`,t[a],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let n=1;n<t.length;n++)o=o.concat(Ti({key:`${r}[${n}]`,value:t[n],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=Nn(t[1]),2!==t.length?o.push(new ni(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):"string"!==i&&o.push(new ni(`${r}[1]`,t[1],`string expected, ${i} found`));break;case"within":i=Nn(t[1]),2!==t.length?o.push(new ni(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):"object"!==i&&o.push(new ni(`${r}[1]`,t[1],`object expected, ${i} found`))}return o}function Si(e,t){const r=e.key,n=e.style,i=e.styleSpec,o=e.value,a=e.objectKey,s=i[`${t}_${e.layerType}`];if(!s)return[];const l=a.match(/^(.*)-transition$/);if("paint"===t&&l&&s[l[1]]&&s[l[1]].transition)return Fi({key:r,value:o,valueSpec:i.transition,style:n,styleSpec:i});const c=e.valueSpec||s[a];if(!c)return[new ni(r,o,`unknown property "${a}"`)];let u;if("string"===Nn(o)&&Bn(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(o))){const e=`\`{ "type": "identity", "property": ${u?JSON.stringify(u[1]):'"_"'} }\``;return[new ni(r,o,`"${a}" does not support interpolation syntax\nUse an identity property function instead: ${e}.`)]}const p=[];return"symbol"===e.layerType&&("text-field"===a&&n&&!n.glyphs&&p.push(new ni(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Un(it(o))&&"identity"===nt(o.type)&&p.push(new ni(r,o,'"text-font" does not support identity functions'))),p.concat(Fi({key:e.key,value:o,valueSpec:c,style:n,styleSpec:i,expressionContext:"property",propertyType:t,propertyKey:a}))}function Ci(e){return Si(e,"paint")}function Ai(e){return Si(e,"layout")}function Mi(e){let t=[];const r=e.value,n=e.key,i=e.style,o=e.styleSpec;r.type||r.ref||t.push(new ni(n,r,'either "type" or "ref" is required'));let a=nt(r.type);const s=nt(r.ref);if(r.id){const o=nt(r.id);for(let a=0;a<e.arrayIndex;a++){const e=i.layers[a];nt(e.id)===o&&t.push(new ni(n,r.id,`duplicate layer id "${r.id}", previously used at line ${e.id.__line__}`))}}if("ref"in r){let e;["type","source","source-layer","filter","layout"].forEach((e=>{e in r&&t.push(new ni(n,r[e],`"${e}" is prohibited for ref layers`))})),i.layers.forEach((t=>{nt(t.id)===s&&(e=t)})),e?e.ref?t.push(new ni(n,r.ref,"ref cannot reference another ref layer")):a=nt(e.type):"string"==typeof s&&t.push(new ni(n,r.ref,`ref layer "${s}" not found`))}else if("background"!==a&&"sky"!==a)if(r.source){const e=i.sources&&i.sources[r.source],o=e&&nt(e.type);e?"vector"===o&&"raster"===a?t.push(new ni(n,r.source,`layer "${r.id}" requires a raster source`)):"raster"===o&&"raster"!==a?t.push(new ni(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==o||r["source-layer"]?"raster-dem"===o&&"hillshade"!==a?t.push(new ni(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!r.paint||!r.paint["line-gradient"]&&!r.paint["line-trim-offset"]||"geojson"===o&&e.lineMetrics||t.push(new ni(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ni(n,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new ni(n,r.source,`source "${r.source}" not found`))}else t.push(new ni(n,r,'missing required property "source"'));return t=t.concat(ii({key:n,value:r,valueSpec:o.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Fi({key:`${n}.type`,value:r.type,valueSpec:o.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"}),filter:e=>Ei(rt({layerType:a},e)),layout:e=>ii({layer:r,key:e.key,value:e.value,valueSpec:{},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>Ai(rt({layerType:a},e))}}),paint:e=>ii({layer:r,key:e.key,value:e.value,valueSpec:{},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>Ci(rt({layerType:a},e))}})}})),t}function Ii(e){const t=e.value,r=e.key,n=Nn(t);return"string"!==n?[new ni(r,t,`string expected, ${n} found`)]:[]}const Oi={promoteId:function({key:e,value:t}){if("string"===Nn(t))return Ii({key:e,value:t});{const r=[];for(const n in t)r.push(...Ii({key:`${e}.${n}`,value:t[n]}));return r}}};function Li(e){const t=e.value,r=e.key,n=e.styleSpec,i=e.style;if(!t.type)return[new ni(r,t,'"type" is required')];const o=nt(t.type);let a;switch(o){case"vector":case"raster":case"raster-dem":return a=ii({key:r,value:t,valueSpec:n[`source_${o.replace("-","_")}`],style:e.style,styleSpec:n,objectElementValidators:Oi}),a;case"geojson":if(a=ii({key:r,value:t,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:Oi}),t.cluster)for(const e in t.clusterProperties){const[n,i]=t.clusterProperties[e],o="string"==typeof n?[n,["accumulated"],["get",e]]:n;a.push(...li({key:`${r}.${e}.map`,value:i,expressionContext:"cluster-map"})),a.push(...li({key:`${r}.${e}.reduce`,value:o,expressionContext:"cluster-reduce"}))}return a;case"video":return ii({key:r,value:t,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return ii({key:r,value:t,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new ni(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ui({key:`${r}.type`,value:t.type,valueSpec:{values:zi(n)},style:i,styleSpec:n})}}function zi(e){return e.source.reduce(((t,r)=>{const n=e[r];return"enum"===n.type.type&&(t=t.concat(Object.keys(n.type.values))),t}),[])}function Di(e){const t=e.value,r=e.styleSpec,n=r.light,i=e.style;let o=[];const a=Nn(t);if(void 0===t)return o;if("object"!==a)return o=o.concat([new ni("light",t,`object expected, ${a} found`)]),o;for(const e in t){const a=e.match(/^(.*)-transition$/);o=o.concat(a&&n[a[1]]&&n[a[1]].transition?Fi({key:e,value:t[e],valueSpec:r.transition,style:i,styleSpec:r}):n[e]?Fi({key:e,value:t[e],valueSpec:n[e],style:i,styleSpec:r}):[new ni(e,t[e],`unknown property "${e}"`)])}return o}function Pi(e){const t=e.value,r=e.key,n=e.style,i=e.styleSpec,o=i.terrain;let a=[];const s=Nn(t);if(void 0===t)return a;if("object"!==s)return a=a.concat([new ni("terrain",t,`object expected, ${s} found`)]),a;for(const e in t){const r=e.match(/^(.*)-transition$/);a=a.concat(r&&o[r[1]]&&o[r[1]].transition?Fi({key:e,value:t[e],valueSpec:i.transition,style:n,styleSpec:i}):o[e]?Fi({key:e,value:t[e],valueSpec:o[e],style:n,styleSpec:i}):[new ni(e,t[e],`unknown property "${e}"`)])}if(t.source){const e=n.sources&&n.sources[t.source],i=e&&nt(e.type);e?"raster-dem"!==i&&a.push(new ni(r,t.source,`terrain cannot be used with a source of type ${String(i)}, it only be used with a "raster-dem" source type`)):a.push(new ni(r,t.source,`source "${t.source}" not found`))}else a.push(new ni(r,t,'terrain is missing required property "source"'));return a}function Ri(e){const t=e.value,r=e.style,n=e.styleSpec,i=n.fog;let o=[];const a=Nn(t);if(void 0===t)return o;if("object"!==a)return o=o.concat([new ni("fog",t,`object expected, ${a} found`)]),o;for(const e in t){const a=e.match(/^(.*)-transition$/);o=o.concat(a&&i[a[1]]&&i[a[1]].transition?Fi({key:e,value:t[e],valueSpec:n.transition,style:r,styleSpec:n}):i[e]?Fi({key:e,value:t[e],valueSpec:i[e],style:r,styleSpec:n}):[new ni(e,t[e],`unknown property "${e}"`)])}return o}const Bi={"*":()=>[],array:oi,boolean:function(e){const t=e.value,r=e.key,n=Nn(t);return"boolean"!==n?[new ni(r,t,`boolean expected, ${n} found`)]:[]},number:ai,color:function(e){const t=e.key,r=e.value,n=Nn(r);return"string"!==n?[new ni(t,r,`color expected, ${n} found`)]:null===Tt(r)?[new ni(t,r,`color expected, "${r}" found`)]:[]},enum:ui,filter:Ei,function:si,layer:Mi,object:ii,source:Li,light:Di,terrain:Pi,fog:Ri,string:Ii,formatted:function(e){return 0===Ii(e).length?[]:li(e)},resolvedImage:function(e){return 0===Ii(e).length?[]:li(e)},projection:function(e){const t=e.value,r=e.styleSpec,n=r.projection,i=e.style;let o=[];const a=Nn(t);if("object"===a)for(const e in t)o=o.concat(Fi({key:e,value:t[e],valueSpec:n[e],style:i,styleSpec:r}));else"string"!==a&&(o=o.concat([new ni("projection",t,`object or string expected, ${a} found`)]));return o}};function Fi(e){const t=e.value,r=e.valueSpec,n=e.styleSpec;return r.expression&&Un(nt(t))?si(e):r.expression&&Kn(it(t))?li(e):r.type&&Bi[r.type]?Bi[r.type](e):ii(rt({},e,{valueSpec:r.type?n[r.type]:r}))}function ji(e){const t=e.value,r=e.key,n=Ii(e);return n.length||(-1===t.indexOf("{fontstack}")&&n.push(new ni(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&n.push(new ni(r,t,'"glyphs" url must include a "{range}" token'))),n}function Ni(e,t=tt){return qi(Fi({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:ji,"*":()=>[]}}))}const Ui=e=>qi(Ci(e)),Vi=e=>qi(Ai(e));function qi(e){return e.slice().sort(((e,t)=>e.line&&t.line?e.line-t.line:0))}function $i(e,t){let r=!1;if(t&&t.length)for(const n of t)e.fire(new Qe(new Error(n.message))),r=!0;return r}var Gi=Hi,Wi=3;function Hi(e,t,r){var n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var i=new Int32Array(this.arrayBuffer);e=i[0],this.d=(t=i[1])+2*(r=i[2]);for(var o=0;o<this.d*this.d;o++){var a=i[Wi+o],s=i[Wi+o+1];n.push(a===s?null:i.subarray(a,s))}var l=i[Wi+n.length+1];this.keys=i.subarray(i[Wi+n.length],l),this.bboxes=i.subarray(l),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var u=r/t*e;this.min=-u,this.max=e+u}Hi.prototype.insert=function(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Hi.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Hi.prototype._insertCell=function(e,t,r,n,i,o){this.cells[i].push(o)},Hi.prototype.query=function(e,t,r,n,i){var o=this.min,a=this.max;if(e<=o&&t<=o&&a<=r&&a<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(e,t,r,n,this._queryCell,s,{},i),s},Hi.prototype._queryCell=function(e,t,r,n,i,o,a,s){var l=this.cells[i];if(null!==l)for(var c=this.keys,u=this.bboxes,p=0;p<l.length;p++){var h=l[p];if(void 0===a[h]){var d=4*h;(s?s(u[d+0],u[d+1],u[d+2],u[d+3]):e<=u[d+2]&&t<=u[d+3]&&r>=u[d+0]&&n>=u[d+1])?(a[h]=!0,o.push(c[h])):a[h]=!1}}},Hi.prototype._forEachCell=function(e,t,r,n,i,o,a,s){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),p=this._convertToCellCoord(n),h=l;h<=u;h++)for(var d=c;d<=p;d++){var f=this.d*d+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(d),this._convertFromCellCoord(h+1),this._convertFromCellCoord(d+1)))&&i.call(this,e,t,r,n,f,o,a,s))return}},Hi.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},Hi.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},Hi.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=Wi+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(t+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var o=t,a=0;a<e.length;a++){var s=e[a];i[Wi+a]=o,i.set(s,o),o+=s.length}return i[Wi+e.length]=o,i.set(this.keys,o),i[Wi+e.length+1]=o+=this.keys.length,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var Zi=d(Gi);const Xi={};function Ki(e,t,r={}){Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Xi[t]={klass:e,omit:r.omit||[]}}Ki(Object,"Object"),Zi.serialize=function(e,t){const r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}},Zi.deserialize=function(e){return new Zi(e.buffer)},Object.defineProperty(Zi,"name",{value:"Grid"}),Ki(Zi,"Grid"),Ki(Lt,"Color"),Ki(Error,"Error"),Ki(ue,"AJAXError"),Ki(Rt,"ResolvedImage"),Ki(ti,"StylePropertyFunction"),Ki(Xn,"StyleExpression",{omit:["_evaluator"]}),Ki(Qn,"ZoomDependentExpression"),Ki(Jn,"ZoomConstantExpression"),Ki(tr,"CompoundExpression",{omit:["_evaluate"]});for(const e in Dn)Xi[Dn[e]._classRegistryKey]||Ki(Dn[e],`Expression${e}`);function Yi(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function Ji(e){return r.ImageBitmap&&e instanceof r.ImageBitmap}function Qi(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(Yi(e)||Ji(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){const r=e;return t&&t.push(r.buffer),r}if(e instanceof r.ImageData)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){const r=[];for(const n of e)r.push(Qi(n,t));return r}if("object"==typeof e){const r=e.constructor,n=r._classRegistryKey;if(!n)throw new Error(`can't serialize object of unregistered class ${n}`);const i=r.serialize?r.serialize(e,t):{};if(!r.serialize){for(const r in e)e.hasOwnProperty(r)&&(Xi[n].omit.indexOf(r)>=0||(i[r]=Qi(e[r],t)));e instanceof Error&&(i.message=e.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==n&&(i.$name=n),i}throw new Error("can't serialize object of type "+typeof e)}function eo(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||Yi(e)||Ji(e)||ArrayBuffer.isView(e)||e instanceof r.ImageData)return e;if(Array.isArray(e))return e.map(eo);if("object"==typeof e){const t=e.$name||"Object",{klass:r}=Xi[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);const n=Object.create(r.prototype);for(const t of Object.keys(e))"$name"!==t&&(n[t]=eo(e[t]));return n}throw new Error("can't deserialize object of type "+typeof e)}const to={"Latin-1 Supplement":e=>e>=128&&e<=255,Arabic:e=>e>=1536&&e<=1791,"Arabic Supplement":e=>e>=1872&&e<=1919,"Arabic Extended-A":e=>e>=2208&&e<=2303,"Hangul Jamo":e=>e>=4352&&e<=4607,"Unified Canadian Aboriginal Syllabics":e=>e>=5120&&e<=5759,Khmer:e=>e>=6016&&e<=6143,"Unified Canadian Aboriginal Syllabics Extended":e=>e>=6320&&e<=6399,"General Punctuation":e=>e>=8192&&e<=8303,"Letterlike Symbols":e=>e>=8448&&e<=8527,"Number Forms":e=>e>=8528&&e<=8591,"Miscellaneous Technical":e=>e>=8960&&e<=9215,"Control Pictures":e=>e>=9216&&e<=9279,"Optical Character Recognition":e=>e>=9280&&e<=9311,"Enclosed Alphanumerics":e=>e>=9312&&e<=9471,"Geometric Shapes":e=>e>=9632&&e<=9727,"Miscellaneous Symbols":e=>e>=9728&&e<=9983,"Miscellaneous Symbols and Arrows":e=>e>=11008&&e<=11263,"CJK Radicals Supplement":e=>e>=11904&&e<=12031,"Kangxi Radicals":e=>e>=12032&&e<=12255,"Ideographic Description Characters":e=>e>=12272&&e<=12287,"CJK Symbols and Punctuation":e=>e>=12288&&e<=12351,Hiragana:e=>e>=12352&&e<=12447,Katakana:e=>e>=12448&&e<=12543,Bopomofo:e=>e>=12544&&e<=12591,"Hangul Compatibility Jamo":e=>e>=12592&&e<=12687,Kanbun:e=>e>=12688&&e<=12703,"Bopomofo Extended":e=>e>=12704&&e<=12735,"CJK Strokes":e=>e>=12736&&e<=12783,"Katakana Phonetic Extensions":e=>e>=12784&&e<=12799,"Enclosed CJK Letters and Months":e=>e>=12800&&e<=13055,"CJK Compatibility":e=>e>=13056&&e<=13311,"CJK Unified Ideographs Extension A":e=>e>=13312&&e<=19903,"Yijing Hexagram Symbols":e=>e>=19904&&e<=19967,"CJK Unified Ideographs":e=>e>=19968&&e<=40959,"Yi Syllables":e=>e>=40960&&e<=42127,"Yi Radicals":e=>e>=42128&&e<=42191,"Hangul Jamo Extended-A":e=>e>=43360&&e<=43391,"Hangul Syllables":e=>e>=44032&&e<=55215,"Hangul Jamo Extended-B":e=>e>=55216&&e<=55295,"Private Use Area":e=>e>=57344&&e<=63743,"CJK Compatibility Ideographs":e=>e>=63744&&e<=64255,"Arabic Presentation Forms-A":e=>e>=64336&&e<=65023,"Vertical Forms":e=>e>=65040&&e<=65055,"CJK Compatibility Forms":e=>e>=65072&&e<=65103,"Small Form Variants":e=>e>=65104&&e<=65135,"Arabic Presentation Forms-B":e=>e>=65136&&e<=65279,"Halfwidth and Fullwidth Forms":e=>e>=65280&&e<=65519};function ro(e){for(const t of e)if(oo(t.charCodeAt(0)))return!0;return!1}function no(e){for(const t of e)if(!io(t.charCodeAt(0)))return!1;return!0}function io(e){return!(to.Arabic(e)||to["Arabic Supplement"](e)||to["Arabic Extended-A"](e)||to["Arabic Presentation Forms-A"](e)||to["Arabic Presentation Forms-B"](e))}function oo(e){return!(746!==e&&747!==e&&(e<4352||!(to["Bopomofo Extended"](e)||to.Bopomofo(e)||to["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||to["CJK Compatibility Ideographs"](e)||to["CJK Compatibility"](e)||to["CJK Radicals Supplement"](e)||to["CJK Strokes"](e)||!(!to["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||to["CJK Unified Ideographs Extension A"](e)||to["CJK Unified Ideographs"](e)||to["Enclosed CJK Letters and Months"](e)||to["Hangul Compatibility Jamo"](e)||to["Hangul Jamo Extended-A"](e)||to["Hangul Jamo Extended-B"](e)||to["Hangul Jamo"](e)||to["Hangul Syllables"](e)||to.Hiragana(e)||to["Ideographic Description Characters"](e)||to.Kanbun(e)||to["Kangxi Radicals"](e)||to["Katakana Phonetic Extensions"](e)||to.Katakana(e)&&12540!==e||!(!to["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!to["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||to["Unified Canadian Aboriginal Syllabics"](e)||to["Unified Canadian Aboriginal Syllabics Extended"](e)||to["Vertical Forms"](e)||to["Yijing Hexagram Symbols"](e)||to["Yi Syllables"](e)||to["Yi Radicals"](e))))}function ao(e){return!(oo(e)||function(e){return!!(to["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||to["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||to["Letterlike Symbols"](e)||to["Number Forms"](e)||to["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||to["Control Pictures"](e)&&9251!==e||to["Optical Character Recognition"](e)||to["Enclosed Alphanumerics"](e)||to["Geometric Shapes"](e)||to["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||to["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||to["CJK Symbols and Punctuation"](e)||to.Katakana(e)||to["Private Use Area"](e)||to["CJK Compatibility Forms"](e)||to["Small Form Variants"](e)||to["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function so(e){return e>=1424&&e<=2303||to["Arabic Presentation Forms-A"](e)||to["Arabic Presentation Forms-B"](e)}function lo(e,t){return!(!t&&so(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||to.Khmer(e))}function co(e){for(const t of e)if(so(t.charCodeAt(0)))return!0;return!1}const uo="deferred",po="loading",ho="loaded";let fo=null,mo="unavailable",go=null;const bo=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(mo="error"),fo&&fo(e)};function _o(){yo.fire(new Je("pluginStateChange",{pluginStatus:mo,pluginURL:go}))}const yo=new et,vo=function(){return mo},xo=function(){if(mo!==uo||!go)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");mo=po,_o(),go&&de({url:go},(e=>{e?bo(e):(mo=ho,_o())}))},wo={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>mo===ho||null!=wo.applyArabicShaping,isLoading:()=>mo===po,setState(e){mo=e.pluginStatus,go=e.pluginURL},isParsed:()=>null!=wo.applyArabicShaping&&null!=wo.processBidirectionalText&&null!=wo.processStyledBidirectionalText,getPluginURL:()=>go};class ko{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.transition=t.transition,this.pitch=t.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(e){return function(e,t){for(const r of e)if(!lo(r.charCodeAt(0),t))return!1;return!0}(e,wo.isLoaded())}}class Eo{constructor(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(Un(e))return new ti(e,t);if(Kn(e)){const r=ei(e,t);if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return r.value}{let r=e;return"string"==typeof e&&"color"===t.type&&(r=Lt.parse(e)),{kind:"constant",evaluate:()=>r}}}(void 0===t?e.specification.default:t,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}}class To{constructor(e){this.property=e,this.value=new Eo(e,void 0)}transitioned(e,t){return new Co(this.property,this.value,t,z({},e.transition,this.transition),e.now)}untransitioned(){return new Co(this.property,this.value,null,{},0)}}class So{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return q(this._values[e].value.value)}setValue(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new To(this._values[e].property)),this._values[e].value=new Eo(this._values[e].property,null===t?void 0:q(t))}getTransition(e){return q(this._values[e].transition)}setTransition(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new To(this._values[e].property)),this._values[e].transition=q(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r);const n=this.getTransition(t);void 0!==n&&(e[`${t}-transition`]=n)}return e}transitioned(e,t){const r=new Ao(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(e,t._values[n]);return r}untransitioned(){const e=new Ao(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class Co{constructor(e,t,r,n,i){const o=n.delay||0,a=n.duration||0;i=i||0,this.property=e,this.value=t,this.begin=i+o,this.end=this.begin+a,e.specification.transition&&(n.delay||n.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){const n=e.now||0,i=this.value.possiblyEvaluate(e,t,r),o=this.prior;if(o){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return o.possiblyEvaluate(e,t,r);{const a=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(e,t,r),i,T(a))}}return i}}class Ao{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){const n=new Oo(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Mo{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return q(this._values[e].value)}setValue(e,t){this._values[e]=new Eo(this._values[e].property,null===t?void 0:q(t))}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){const n=new Oo(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}}class Io{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,n){return this.property.evaluate(this.value,this.parameters,e,t,r,n)}}class Oo{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Lo{constructor(e){this.specification=e}possiblyEvaluate(e,t){return e.expression.evaluate(t)}interpolate(e,t,r){const n=zr[this.specification.type];return n?n(e,t,r):e}}class zo{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,n){return new Io(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},r,n)}:e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Io(this,{kind:"constant",value:void 0},e.parameters);const n=zr[this.specification.type];return n?new Io(this,{kind:"constant",value:n(e.value.value,t.value.value,r)},e.parameters):e}evaluate(e,t,r,n,i,o){return"constant"===e.kind?e.value:e.evaluate(t,r,n,i,o)}}class Do{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)}interpolate(){return!1}}class Po{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const t=new ko(0,{});for(const r in e){const n=e[r];n.specification.overridable&&this.overridableProperties.push(r);const i=this.defaultPropertyValues[r]=new Eo(n,void 0),o=this.defaultTransitionablePropertyValues[r]=new To(n);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate(t)}}}function Ro(e,t){return 256*(e=A(Math.floor(e),0,255))+A(Math.floor(t),0,255)}Ki(zo,"DataDrivenProperty"),Ki(Lo,"DataConstantProperty"),Ki(Do,"ColorRampProperty");const Bo={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Fo{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class jo{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function No(e,t=1){let r=0,n=0;return{members:e.map((e=>{const i=Bo[e.type].BYTES_PER_ELEMENT,o=r=Uo(r,Math.max(t,i)),a=e.components||1;return n=Math.max(n,i),r+=i*a,{name:e.name,type:e.type,components:a,offset:o}})),size:Uo(r,Math.max(n,t)),alignment:t}}function Uo(e,t){return Math.ceil(e/t)*t}class Vo extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e}}Vo.prototype.bytesPerElement=4,Ki(Vo,"StructArrayLayout2i4");class qo extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e}}qo.prototype.bytesPerElement=6,Ki(qo,"StructArrayLayout3i6");class $o extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,e}}$o.prototype.bytesPerElement=8,Ki($o,"StructArrayLayout4i8");class Go extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,o,a)}emplace(e,t,r,n,i,o,a,s){const l=6*e,c=12*e,u=3*e;return this.int16[l+0]=t,this.int16[l+1]=r,this.uint8[c+4]=n,this.uint8[c+5]=i,this.uint8[c+6]=o,this.uint8[c+7]=a,this.float32[u+2]=s,e}}Go.prototype.bytesPerElement=12,Ki(Go,"StructArrayLayout2i4ub1f12");class Wo extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=4*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,e}}Wo.prototype.bytesPerElement=16,Ki(Wo,"StructArrayLayout4f16");class Ho extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const a=6*e,s=3*e;return this.uint16[a+0]=t,this.uint16[a+1]=r,this.uint16[a+2]=n,this.uint16[a+3]=i,this.float32[s+2]=o,e}}Ho.prototype.bytesPerElement=12,Ki(Ho,"StructArrayLayout4ui1f12");class Zo extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=4*e;return this.uint16[o+0]=t,this.uint16[o+1]=r,this.uint16[o+2]=n,this.uint16[o+3]=i,e}}Zo.prototype.bytesPerElement=8,Ki(Zo,"StructArrayLayout4ui8");class Xo extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o)}emplace(e,t,r,n,i,o,a){const s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,e}}Xo.prototype.bytesPerElement=12,Ki(Xo,"StructArrayLayout6i12");class Ko extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a,s,l,c,u,p){const h=this.length;return this.resize(h+1),this.emplace(h,e,t,r,n,i,o,a,s,l,c,u,p)}emplace(e,t,r,n,i,o,a,s,l,c,u,p,h){const d=12*e;return this.int16[d+0]=t,this.int16[d+1]=r,this.int16[d+2]=n,this.int16[d+3]=i,this.uint16[d+4]=o,this.uint16[d+5]=a,this.uint16[d+6]=s,this.uint16[d+7]=l,this.int16[d+8]=c,this.int16[d+9]=u,this.int16[d+10]=p,this.int16[d+11]=h,e}}Ko.prototype.bytesPerElement=24,Ki(Ko,"StructArrayLayout4i4ui4i24");class Yo extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o)}emplace(e,t,r,n,i,o,a){const s=10*e,l=5*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.float32[l+2]=i,this.float32[l+3]=o,this.float32[l+4]=a,e}}Yo.prototype.bytesPerElement=20,Ki(Yo,"StructArrayLayout3i3f20");class Jo extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}Jo.prototype.bytesPerElement=4,Ki(Jo,"StructArrayLayout1ul4");class Qo extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a,s,l,c,u,p,h){const d=this.length;return this.resize(d+1),this.emplace(d,e,t,r,n,i,o,a,s,l,c,u,p,h)}emplace(e,t,r,n,i,o,a,s,l,c,u,p,h,d){const f=20*e,m=10*e;return this.int16[f+0]=t,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.int16[f+4]=o,this.float32[m+3]=a,this.float32[m+4]=s,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[f+14]=u,this.uint32[m+8]=p,this.uint16[f+18]=h,this.uint16[f+19]=d,e}}Qo.prototype.bytesPerElement=40,Ki(Qo,"StructArrayLayout5i4f1i1ul2ui40");class ea extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,o,a)}emplace(e,t,r,n,i,o,a,s){const l=8*e;return this.int16[l+0]=t,this.int16[l+1]=r,this.int16[l+2]=n,this.int16[l+4]=i,this.int16[l+5]=o,this.int16[l+6]=a,this.int16[l+7]=s,e}}ea.prototype.bytesPerElement=16,Ki(ea,"StructArrayLayout3i2i2i16");class ta extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const a=4*e,s=8*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,e}}ta.prototype.bytesPerElement=16,Ki(ta,"StructArrayLayout2f1f2i16");class ra extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=12*e,a=3*e;return this.uint8[o+0]=t,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,e}}ra.prototype.bytesPerElement=12,Ki(ra,"StructArrayLayout2ub2f12");class na extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e}}na.prototype.bytesPerElement=12,Ki(na,"StructArrayLayout3f12");class ia extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e}}ia.prototype.bytesPerElement=6,Ki(ia,"StructArrayLayout3ui6");class oa extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g,b,_,y,v){const x=this.length;return this.resize(x+1),this.emplace(x,e,t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g,b,_,y,v)}emplace(e,t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g,b,_,y,v,x){const w=30*e,k=15*e,E=60*e;return this.int16[w+0]=t,this.int16[w+1]=r,this.int16[w+2]=n,this.float32[k+2]=i,this.float32[k+3]=o,this.uint16[w+8]=a,this.uint16[w+9]=s,this.uint32[k+5]=l,this.uint32[k+6]=c,this.uint32[k+7]=u,this.uint16[w+16]=p,this.uint16[w+17]=h,this.uint16[w+18]=d,this.float32[k+10]=f,this.float32[k+11]=m,this.uint8[E+48]=g,this.uint8[E+49]=b,this.uint8[E+50]=_,this.uint32[k+13]=y,this.int16[w+28]=v,this.uint8[E+58]=x,e}}oa.prototype.bytesPerElement=60,Ki(oa,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class aa extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g,b,_,y,v,x,w,k,E,T,S,C,A,M){const I=this.length;return this.resize(I+1),this.emplace(I,e,t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g,b,_,y,v,x,w,k,E,T,S,C,A,M)}emplace(e,t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g,b,_,y,v,x,w,k,E,T,S,C,A,M,I){const O=38*e,L=19*e;return this.int16[O+0]=t,this.int16[O+1]=r,this.int16[O+2]=n,this.float32[L+2]=i,this.float32[L+3]=o,this.int16[O+8]=a,this.int16[O+9]=s,this.int16[O+10]=l,this.int16[O+11]=c,this.int16[O+12]=u,this.int16[O+13]=p,this.uint16[O+14]=h,this.uint16[O+15]=d,this.uint16[O+16]=f,this.uint16[O+17]=m,this.uint16[O+18]=g,this.uint16[O+19]=b,this.uint16[O+20]=_,this.uint16[O+21]=y,this.uint16[O+22]=v,this.uint16[O+23]=x,this.uint16[O+24]=w,this.uint16[O+25]=k,this.uint16[O+26]=E,this.uint16[O+27]=T,this.uint16[O+28]=S,this.uint32[L+15]=C,this.float32[L+16]=A,this.float32[L+17]=M,this.float32[L+18]=I,e}}aa.prototype.bytesPerElement=76,Ki(aa,"StructArrayLayout3i2f6i15ui1ul3f76");class sa extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}sa.prototype.bytesPerElement=4,Ki(sa,"StructArrayLayout1f4");class la extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const a=5*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,this.float32[a+4]=o,e}}la.prototype.bytesPerElement=20,Ki(la,"StructArrayLayout5f20");class ca extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=6*e;return this.uint32[3*e+0]=t,this.uint16[o+2]=r,this.uint16[o+3]=n,this.uint16[o+4]=i,e}}ca.prototype.bytesPerElement=12,Ki(ca,"StructArrayLayout1ul3ui12");class ua extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e}}ua.prototype.bytesPerElement=4,Ki(ua,"StructArrayLayout2ui4");class pa extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}pa.prototype.bytesPerElement=2,Ki(pa,"StructArrayLayout1ui2");class ha extends jo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e}}ha.prototype.bytesPerElement=8,Ki(ha,"StructArrayLayout2f8");class da extends Fo{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}da.prototype.size=40;class fa extends Qo{get(e){return new da(this,e)}}Ki(fa,"CollisionBoxArray");class ma extends Fo{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}ma.prototype.size=60;class ga extends oa{get(e){return new ma(this,e)}}Ki(ga,"PlacedSymbolArray");class ba extends Fo{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(e){this._structArray.uint32[this._pos4+15]=e}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}ba.prototype.size=76;class _a extends aa{get(e){return new ba(this,e)}}Ki(_a,"SymbolInstanceArray");class ya extends sa{getoffsetX(e){return this.float32[1*e+0]}}Ki(ya,"GlyphOffsetArray");class va extends Vo{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}Ki(va,"SymbolLineVertexArray");class xa extends Fo{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}xa.prototype.size=12;class wa extends ca{get(e){return new xa(this,e)}}Ki(wa,"FeatureIndexArray");class ka extends ua{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}Ki(ka,"FillExtrusionCentroidArray");const Ea=No([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Ta=No([{name:"a_dash",components:4,type:"Uint16"}]);var Sa={exports:{}},Ca={exports:{}};Ca.exports=function(e,t){var r,n,i,o,a,s,l,c;for(n=e.length-(r=3&e.length),i=t,a=3432918353,s=461845907,c=0;c<n;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,i=27492+(65535&(o=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.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};var Aa=Ca.exports,Ma={exports:{}};Ma.exports=function(e,t){for(var r,n=e.length,i=t^n,o=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&e.charCodeAt(o+2))<<16;case 2:i^=(255&e.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};var Ia=Aa,Oa=Ma.exports;Sa.exports=Ia,Sa.exports.murmur3=Ia,Sa.exports.murmur2=Oa;var La=d(Sa.exports);class za{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,r,n){this.ids.push(Da(e)),this.positions.push(t,r,n)}getPositions(e){const t=Da(e);let r=0,n=this.ids.length-1;for(;r<n;){const e=r+n>>1;this.ids[e]>=t?n=e:r=e+1}const i=[];for(;this.ids[r]===t;)i.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return i}static serialize(e,t){const r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Pa(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}}static deserialize(e){const t=new za;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}}function Da(e){const t=+e;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:La(String(e))}function Pa(e,t,r,n){for(;r<n;){const i=e[r+n>>1];let o=r-1,a=n+1;for(;;){do{o++}while(e[o]<i);do{a--}while(e[a]>i);if(o>=a)break;Ra(e,o,a),Ra(t,3*o,3*a),Ra(t,3*o+1,3*a+1),Ra(t,3*o+2,3*a+2)}a-r<n-a?(Pa(e,t,r,a),r=a+1):(Pa(e,t,a+1,n),n=a)}}function Ra(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}Ki(za,"FeaturePositionMap");class Ba{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,t){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,t),this.initialized=!0),!!this.location}}class Fa extends Ba{constructor(e){super(e),this.current=0}set(e,t,r){this.fetchUniformLocation(e,t)&&this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))}}class ja extends Ba{constructor(e){super(e),this.current=[0,0,0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3])))}}class Na extends Ba{constructor(e){super(e),this.current=Lt.transparent}set(e,t,r){this.fetchUniformLocation(e,t)&&(r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a)))}}const Ua=new Float32Array(16),Va=new Float32Array(9),qa=new Float32Array(4);function $a(e){return[Ro(255*e.r,255*e.g),Ro(255*e.b,255*e.a)]}class Ga{constructor(e,t,r){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=r}setUniform(e,t,r,n,i){t.set(e,i,n.constantOr(this.value))}getBinding(e,t){return"color"===this.type?new Na(e):new Fa(e)}}class Wa{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,t,r,n,i){const o="u_pattern"===i||"u_dash"===i?this.pattern:"u_pixel_ratio"===i?this.pixelRatio:null;o&&t.set(e,i,o)}getBinding(e,t){return"u_pattern"===t||"u_dash"===t?new ja(e):new Fa(e)}}class Ha{constructor(e,t,r,n){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(e,t,r,n,i,o){const a=this.paintVertexArray.length,s=this.expression.evaluate(new ko(0),t,{},i,n,o);this.paintVertexArray.resize(e),this._setPaintValue(a,e,s)}updatePaintArray(e,t,r,n,i){const o=this.expression.evaluate({zoom:0},r,n,void 0,i);this._setPaintValue(e,t,o)}_setPaintValue(e,t,r){if("color"===this.type){const n=$a(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Za{constructor(e,t,r,n,i,o){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,t,r,n,i,o){const a=this.expression.evaluate(new ko(this.zoom),t,{},i,n,o),s=this.expression.evaluate(new ko(this.zoom+1),t,{},i,n,o),l=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(l,e,a,s)}updatePaintArray(e,t,r,n,i){const o=this.expression.evaluate({zoom:this.zoom},r,n,void 0,i),a=this.expression.evaluate({zoom:this.zoom+1},r,n,void 0,i);this._setPaintValue(e,t,o,a)}_setPaintValue(e,t,r,n){if("color"===this.type){const i=$a(r),o=$a(n);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1],o[0],o[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t,r,n,i){const o=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,a=A(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);t.set(e,i,a)}getBinding(e,t){return new Fa(e)}}class Xa{constructor(e,t,r,n,i){this.expression=e,this.layerId=i,this.paintVertexAttributes=("array"===r?Ta:Ea).members;for(let e=0;e<t.length;++e);this.paintVertexArray=new n}populatePaintArray(e,t,r){const n=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(n,e,t.patterns&&t.patterns[this.layerId],r)}updatePaintArray(e,t,r,n,i,o){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],o)}_setPaintValues(e,t,r,n){if(!n||!r)return;const i=n[r];if(!i)return;const{tl:o,br:a,pixelRatio:s}=i;for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,o[0],o[1],a[0],a[1],s)}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Ka{constructor(e,t,r=(()=>!0)){this.binders={},this._buffers=[];const n=[];for(const i in e.paint._values){if(!r(i))continue;const o=e.paint.get(i);if(!(o instanceof Io&&Bn(o.property.specification)))continue;const a=Qa(i,e.type),s=o.value,l=o.property.specification.type,c=!!o.property.useIntegerZoom,u="line-dasharray"===i||i.endsWith("pattern"),p="line-dasharray"===i&&"constant"!==e.layout.get("line-cap").value.kind;if("constant"!==s.kind||p)if("source"===s.kind||p||u){const t=rs(i,l,"source");this.binders[i]=u?new Xa(s,a,l,t,e.id):new Ha(s,a,l,t),n.push(`/a_${i}`)}else{const e=rs(i,l,"composite");this.binders[i]=new Za(s,a,l,c,t,e),n.push(`/z_${i}`)}else this.binders[i]=u?new Wa(s.value,a):new Ga(s.value,a,l),n.push(`/u_${i}`)}this.cacheKey=n.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof Ha||t instanceof Za?t.maxValue:0}populatePaintArrays(e,t,r,n,i,o){for(const a in this.binders){const s=this.binders[a];(s instanceof Ha||s instanceof Za||s instanceof Xa)&&s.populatePaintArray(e,t,r,n,i,o)}}setConstantPatternPositions(e){for(const t in this.binders){const r=this.binders[t];r instanceof Wa&&r.setConstantPatternPositions(e)}}updatePaintArrays(e,t,r,n,i,o){let a=!1;for(const s in e){const l=t.getPositions(s);for(const t of l){const l=r.feature(t.index);for(const r in this.binders){const c=this.binders[r];if((c instanceof Ha||c instanceof Za||c instanceof Xa)&&!0===c.expression.isStateDependent){const u=n.paint.get(r);c.expression=u.value,c.updatePaintArray(t.start,t.end,l,e[s],i,o),a=!0}}}}return a}defines(){const e=[];for(const t in this.binders){const r=this.binders[t];(r instanceof Ga||r instanceof Wa)&&e.push(...r.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof Ha||r instanceof Za||r instanceof Xa)for(let t=0;t<r.paintVertexAttributes.length;t++)e.push(r.paintVertexAttributes[t].name)}return e}getBinderUniforms(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof Ga||r instanceof Wa||r instanceof Za)for(const t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const t=[];for(const r in this.binders){const n=this.binders[r];if(n instanceof Ga||n instanceof Wa||n instanceof Za)for(const i of n.uniformNames)t.push({name:i,property:r,binding:n.getBinding(e,i)})}return t}setUniforms(e,t,r,n,i){for(const{name:t,property:o,binding:a}of r)this.binders[o].setUniform(e,a,i,n.get(o),t)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const t=this.binders[e];(t instanceof Ha||t instanceof Za||t instanceof Xa)&&t.paintVertexBuffer&&this._buffers.push(t.paintVertexBuffer)}}upload(e){for(const t in this.binders){const r=this.binders[t];(r instanceof Ha||r instanceof Za||r instanceof Xa)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof Ha||t instanceof Za||t instanceof Xa)&&t.destroy()}}}class Ya{constructor(e,t,r=(()=>!0)){this.programConfigurations={};for(const n of e)this.programConfigurations[n.id]=new Ka(n,t,r);this.needsUpload=!1,this._featureMap=new za,this._bufferOffset=0}populatePaintArrays(e,t,r,n,i,o,a){for(const r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,n,i,o,a);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,n,i){for(const o of r)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,t,o,n,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Ja={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function Qa(e,t){return Ja[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}const es={"line-pattern":{source:Ho,composite:Ho},"fill-pattern":{source:Ho,composite:Ho},"fill-extrusion-pattern":{source:Ho,composite:Ho},"line-dasharray":{source:Zo,composite:Zo}},ts={color:{source:ha,composite:Wo},number:{source:sa,composite:ha}};function rs(e,t,r){const n=es[e];return n&&n[r]||ts[t][r]}Ki(Ga,"ConstantBinder"),Ki(Wa,"PatternConstantBinder"),Ki(Ha,"SourceExpressionBinder"),Ki(Xa,"PatternCompositeBinder"),Ki(Za,"CompositeExpressionBinder"),Ki(Ka,"ProgramConfiguration",{omit:["_buffers"]}),Ki(Ya,"ProgramConfigurationSet");const ns="-transition";class is extends et{constructor(e,t){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new Mo(t.layout)),t.paint)){this._transitionablePaint=new So(t.paint);for(const t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(const t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Oo(t.paint)}}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t,r={}){null!=t&&this._validate(Vi,`layers.${this.id}.layout.${e}`,e,t,r)||("visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t)}getPaintProperty(e){return N(e,ns)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t,r={}){if(null!=t&&this._validate(Ui,`layers.${this.id}.paint.${e}`,e,t,r))return!1;if(N(e,ns))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{const r=this._transitionablePaint._values[e],n=r.value.isDataDriven(),i=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);const o=this._transitionablePaint._values[e].value,a=o.isDataDriven(),s=N(e,"pattern")||"line-dasharray"===e;return a||n||s||this._handleOverridablePaintPropertyUpdate(e,i,o)}}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getProgramConfiguration(e){return null}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){const e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),V(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}_validate(e,t,r,n,i={}){return(!i||!1!==i.validate)&&$i(this,e.call(Ni,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:tt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof Io&&Bn(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=hi(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const os=No([{name:"a_pos",components:2,type:"Int16"}],4),as=No([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class ss{constructor(e=[]){this.segments=e}prepareSegment(e,t,r,n){let i=this.segments[this.segments.length-1];return e>ss.MAX_VERTEX_ARRAY_LENGTH&&G(`Max vertices per segment is ${ss.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!i||i.vertexLength+e>ss.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,r,n){return new ss([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}ss.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ki(ss,"SegmentVector");var ls=8192;class cs{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof ql?new ql(e.lng,e.lat):ql.convert(e),this}setSouthWest(e){return this._sw=e instanceof ql?new ql(e.lng,e.lat):ql.convert(e),this}extend(e){const t=this._sw,r=this._ne;let n,i;if(e instanceof ql)n=e,i=e;else{if(!(e instanceof cs))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(cs.convert(e)):this.extend(ql.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(ql.convert(e)):this;if(n=e._sw,i=e._ne,!n||!i)return this}return t||r?(t.lng=Math.min(n.lng,t.lng),t.lat=Math.min(n.lat,t.lat),r.lng=Math.max(i.lng,r.lng),r.lat=Math.max(i.lat,r.lat)):(this._sw=new ql(n.lng,n.lat),this._ne=new ql(i.lng,i.lat)),this}getCenter(){return new ql((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new ql(this.getWest(),this.getNorth())}getSouthEast(){return new ql(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:t,lat:r}=ql.convert(e);let n=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&n}static convert(e){return!e||e instanceof cs?e:new cs(e)}}var us=1e-6,ps="undefined"!=typeof Float32Array?Float32Array:Array;function hs(){var e=new ps(9);return ps!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ds(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],p=t[8],h=r[0],d=r[1],f=r[2],m=r[3],g=r[4],b=r[5],_=r[6],y=r[7],v=r[8];return e[0]=h*n+d*a+f*c,e[1]=h*i+d*s+f*u,e[2]=h*o+d*l+f*p,e[3]=m*n+g*a+b*c,e[4]=m*i+g*s+b*u,e[5]=m*o+g*l+b*p,e[6]=_*n+y*a+v*c,e[7]=_*i+y*s+v*u,e[8]=_*o+y*l+v*p,e}function fs(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ms(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],p=t[9],h=t[10],d=t[11],f=t[12],m=t[13],g=t[14],b=t[15],_=r*s-n*a,y=r*l-i*a,v=r*c-o*a,x=n*l-i*s,w=n*c-o*s,k=i*c-o*l,E=u*m-p*f,T=u*g-h*f,S=u*b-d*f,C=p*g-h*m,A=p*b-d*m,M=h*b-d*g,I=_*M-y*A+v*C+x*S-w*T+k*E;return I?(e[0]=(s*M-l*A+c*C)*(I=1/I),e[1]=(i*A-n*M-o*C)*I,e[2]=(m*k-g*w+b*x)*I,e[3]=(h*w-p*k-d*x)*I,e[4]=(l*S-a*M-c*T)*I,e[5]=(r*M-i*S+o*T)*I,e[6]=(g*v-f*k-b*y)*I,e[7]=(u*k-h*v+d*y)*I,e[8]=(a*A-s*S+c*E)*I,e[9]=(n*S-r*A-o*E)*I,e[10]=(f*w-m*v+b*_)*I,e[11]=(p*v-u*w-d*_)*I,e[12]=(s*T-a*C-l*E)*I,e[13]=(r*C-n*T+i*E)*I,e[14]=(m*y-f*x-g*_)*I,e[15]=(u*x-p*y+h*_)*I,e):null}function gs(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],p=t[8],h=t[9],d=t[10],f=t[11],m=t[12],g=t[13],b=t[14],_=t[15],y=r[0],v=r[1],x=r[2],w=r[3];return e[0]=y*n+v*s+x*p+w*m,e[1]=y*i+v*l+x*h+w*g,e[2]=y*o+v*c+x*d+w*b,e[3]=y*a+v*u+x*f+w*_,e[4]=(y=r[4])*n+(v=r[5])*s+(x=r[6])*p+(w=r[7])*m,e[5]=y*i+v*l+x*h+w*g,e[6]=y*o+v*c+x*d+w*b,e[7]=y*a+v*u+x*f+w*_,e[8]=(y=r[8])*n+(v=r[9])*s+(x=r[10])*p+(w=r[11])*m,e[9]=y*i+v*l+x*h+w*g,e[10]=y*o+v*c+x*d+w*b,e[11]=y*a+v*u+x*f+w*_,e[12]=(y=r[12])*n+(v=r[13])*s+(x=r[14])*p+(w=r[15])*m,e[13]=y*i+v*l+x*h+w*g,e[14]=y*o+v*c+x*d+w*b,e[15]=y*a+v*u+x*f+w*_,e}function bs(e,t,r){var n,i,o,a,s,l,c,u,p,h,d,f,m=r[0],g=r[1],b=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*b+t[12],e[13]=t[1]*m+t[5]*g+t[9]*b+t[13],e[14]=t[2]*m+t[6]*g+t[10]*b+t[14],e[15]=t[3]*m+t[7]*g+t[11]*b+t[15]):(i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],p=t[8],h=t[9],d=t[10],f=t[11],e[0]=n=t[0],e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=p,e[9]=h,e[10]=d,e[11]=f,e[12]=n*m+s*g+p*b+t[12],e[13]=i*m+l*g+h*b+t[13],e[14]=o*m+c*g+d*b+t[14],e[15]=a*m+u*g+f*b+t[15]),e}function _s(e,t,r){var n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ys(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],p=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*n,e[5]=a*i+u*n,e[6]=s*i+p*n,e[7]=l*i+h*n,e[8]=c*i-o*n,e[9]=u*i-a*n,e[10]=p*i-s*n,e[11]=h*i-l*n,e}function vs(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],s=t[2],l=t[3],c=t[8],u=t[9],p=t[10],h=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*n,e[1]=a*i-u*n,e[2]=s*i-p*n,e[3]=l*i-h*n,e[8]=o*n+c*i,e[9]=a*n+u*i,e[10]=s*n+p*i,e[11]=l*n+h*i,e}function xs(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ws(e,t,r){var n,i,o,a=r[0],s=r[1],l=r[2],c=Math.hypot(a,s,l);return c<us?null:(a*=c=1/c,s*=c,l*=c,n=Math.sin(t),i=Math.cos(t),e[0]=a*a*(o=1-i)+i,e[1]=s*a*o+l*n,e[2]=l*a*o-s*n,e[3]=0,e[4]=a*s*o-l*n,e[5]=s*s*o+i,e[6]=l*s*o+a*n,e[7]=0,e[8]=a*l*o+s*n,e[9]=s*l*o-a*n,e[10]=l*l*o+i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var ks=gs;function Es(){var e=new ps(3);return ps!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Ts(e){var t=new ps(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ss(e){return Math.hypot(e[0],e[1],e[2])}function Cs(e,t,r){var n=new ps(3);return n[0]=e,n[1]=t,n[2]=r,n}function As(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Ms(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function Is(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function Os(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function Ls(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function zs(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function Ds(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function Ps(e,t){var r=t[0],n=t[1],i=t[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function Rs(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Bs(e,t,r){var n=t[0],i=t[1],o=t[2],a=r[0],s=r[1],l=r[2];return e[0]=i*l-o*s,e[1]=o*a-n*l,e[2]=n*s-i*a,e}function Fs(e,t,r){var n=t[0],i=t[1],o=t[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return e[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/(a=a||1),e[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,e[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,e}function js(e,t,r){var n=r[0],i=r[1],o=r[2],a=t[0],s=t[1],l=t[2],c=i*l-o*s,u=o*a-n*l,p=n*s-i*a,h=i*p-o*u,d=o*c-n*p,f=n*u-i*c,m=2*r[3];return u*=m,p*=m,d*=2,f*=2,e[0]=a+(c*=m)+(h*=2),e[1]=s+u+d,e[2]=l+p+f,e}var Ns,Us=Ms,Vs=Is,qs=Ss;function $s(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Gs(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=r*a,e[1]=n*a,e[2]=i*a,e[3]=o*a,e}function Ws(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,e}function Hs(){var e=new ps(4);return ps!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Zs(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Xs(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l+a*s,e[1]=i*l+o*s,e[2]=o*l-i*s,e[3]=a*l-n*s,e}function Ks(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l-o*s,e[1]=i*l+a*s,e[2]=o*l+n*s,e[3]=a*l-i*s,e}Es(),Ns=new ps(4),ps!=Float32Array&&(Ns[0]=0,Ns[1]=0,Ns[2]=0,Ns[3]=0);var Ys=Gs;Es(),Cs(1,0,0),Cs(0,1,0),Hs(),Hs(),hs();const Js=No([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Qs}=Js,el=No([{name:"a_pos_3",components:3,type:"Int16"}]);var tl=No([{name:"a_pos",type:"Int16",components:2}]);class rl{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(e,t,r){const n=Rs(t,this.dir);if(Math.abs(n)<1e-6)return!1;const i=((e[0]-this.pos[0])*t[0]+(e[1]-this.pos[1])*t[1]+(e[2]-this.pos[2])*t[2])/n;return r[0]=this.pos[0]+this.dir[0]*i,r[1]=this.pos[1]+this.dir[1]*i,r[2]=this.pos[2]+this.dir[2]*i,!0}closestPointOnSphere(e,t,r){if(function(e,t){var r=e[0],n=e[1],i=e[2],o=t[0],a=t[1],s=t[2];return Math.abs(r-o)<=us*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=us*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=us*Math.max(1,Math.abs(i),Math.abs(s))}(this.pos,e)||0===t)return r[0]=r[1]=r[2]=0,!1;const[n,i,o]=this.dir,a=this.pos[0]-e[0],s=this.pos[1]-e[1],l=this.pos[2]-e[2],c=n*n+i*i+o*o,u=2*(a*n+s*i+l*o),p=u*u-4*c*(a*a+s*s+l*l-t*t);if(p<0){const e=Math.max(-u/2,0),c=a+n*e,p=s+i*e,h=l+o*e,d=Math.hypot(c,p,h);return r[0]=c*t/d,r[1]=p*t/d,r[2]=h*t/d,!1}{const e=(-u-Math.sqrt(p))/(2*c);if(e<0){const e=Math.hypot(a,s,l);return r[0]=a*t/e,r[1]=s*t/e,r[2]=l*t/e,!1}return r[0]=a+n*e,r[1]=s+i*e,r[2]=l+o*e,!0}}}class nl{constructor(e,t,r,n,i){this.TL=e,this.TR=t,this.BR=r,this.BL=n,this.horizon=i}static fromInvProjectionMatrix(e,t,r){const n=[-1,1,1],i=[1,1,1],o=[1,-1,1],a=[-1,-1,1],s=Fs(n,n,e),l=Fs(i,i,e),c=Fs(o,o,e),u=Fs(a,a,e);return new nl(s,l,c,u,t/r)}}class il{constructor(e,t){this.points=e,this.planes=t}static fromInvProjectionMatrix(e,t,r,n){const i=Math.pow(2,r),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((r=>{const o=Ws([],r,e),a=1/o[3]/t*i;return function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}(o,o,[a,a,n?1/o[3]:a,a])})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((e=>{const t=Ps([],Bs([],Us([],o[e[0]],o[e[1]]),Us([],o[e[2]],o[e[1]]))),r=-Rs(t,o[e[1]]);return t.concat(r)}));return new il(o,a)}}class ol{static fromPoints(e){const t=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0];for(const n of e)Os(t,t,n),Ls(r,r,n);return new ol(t,r)}static applyTransform(e,t){const r=e.getCorners();for(let e=0;e<r.length;++e)Fs(r[e],r[e],t);return ol.fromPoints(r)}constructor(e,t){this.min=e,this.max=t,this.center=zs([],As([],this.min,this.max),.5)}quadrant(e){const t=[e%2==0,e<2],r=Ts(this.min),n=Ts(this.max);for(let e=0;e<t.length;e++)r[e]=t[e]?this.min[e]:this.center[e],n[e]=t[e]?this.center[e]:this.max[e];return n[2]=this.max[2],new ol(r,n)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,t=this.max;return[[e[0],e[1],e[2]],[t[0],e[1],e[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],t[2]],[e[0],t[1],t[2]]]}intersects(e){const t=this.getCorners();let r=!0;for(let n=0;n<e.planes.length;n++){const i=e.planes[n];let o=0;for(let e=0;e<t.length;e++)o+=Rs(i,t[e])+i[3]>=0;if(0===o)return 0;o!==t.length&&(r=!1)}if(r)return 2;for(let t=0;t<3;t++){let r=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let i=0;i<e.points.length;i++){const o=e.points[i][t]-this.min[t];r=Math.min(r,o),n=Math.max(n,o)}if(n<0||r>this.max[t]-this.min[t])return 0}return 1}}const al=5,sl=6,ll=ls/Math.PI/2,cl=16383,ul=64,pl=[ul,32,16],hl=-ll,dl=ll,fl=[new ol([hl,hl,hl],[dl,dl,dl]),new ol([hl,hl,hl],[0,0,dl]),new ol([0,hl,hl],[dl,0,dl]),new ol([hl,0,hl],[0,dl,dl]),new ol([0,0,hl],[dl,dl,dl])];function ml(e){return e*ll/Nl}function gl(e,t,r,n=!0){const i=zs([],e._camera.position,e.worldSize),o=[t,r,1,1];Ws(o,o,e.pixelMatrixInverse),$s(o,o,1/o[3]);const a=Ps([],Us([],o,i)),s=e.globeMatrix,l=[s[12],s[13],s[14]],c=Us([],l,i),u=Ss(c),p=Ps([],c),h=e.worldSize/(2*Math.PI),d=Rs(p,a),f=Math.asin(h/u);if(f<Math.acos(d)){if(!n)return null;const e=[],t=[];zs(e,a,u/d),Ps(t,Us(t,e,c)),Ps(a,As(a,c,zs(a,t,Math.tan(f)*u)))}const m=[];new rl(i,a).closestPointOnSphere(l,h,m);const g=Ps([],Q(s,0)),b=Ps([],Q(s,1)),_=Ps([],Q(s,2)),y=Rs(g,m),v=Rs(b,m),x=Rs(_,m),w=k(Math.asin(-v/h));let E=k(Math.atan2(y,x));E=e.center.lng+function(e,t){const r=(t-e+180)%360-180;return r<-180?r+360:r}(e.center.lng,E);const T=Gl(E),S=A(Wl(w),0,1);return new Ql(T,S)}class bl{constructor(e,t,r){this.a=Us([],e,r),this.b=Us([],t,r),this.center=r;const n=Ps([],this.a),i=Ps([],this.b);this.angle=Math.acos(Rs(n,i))}}function _l(e,t){if(0===e.angle)return null;let r;return r=0===e.a[t]?1/e.angle*.5*Math.PI:1/e.angle*Math.atan(e.b[t]/e.a[t]/Math.sin(e.angle)-1/Math.tan(e.angle)),r<0||r>1?null:function(e,t,r,n){const i=Math.sin(r);return e*(Math.sin((1-n)*r)/i)+t*(Math.sin(n*r)/i)}(e.a[t],e.b[t],e.angle,A(r,0,1))+e.center[t]}function yl(e){if(e.z<=1)return fl[e.z+2*e.y+e.x];const t=Tl(El(e));return ol.fromPoints(t)}function vl(e,t,r){return zs(e,e,1-r),Ds(e,e,t,r)}function xl(e,t){const r=Dl(t.zoom);if(0===r)return yl(e);const n=El(e),i=Tl(n),o=Gl(n.getWest())*t.worldSize,a=Gl(n.getEast())*t.worldSize,s=Wl(n.getNorth())*t.worldSize,l=Wl(n.getSouth())*t.worldSize,c=[o,s,0],u=[a,s,0],p=[o,l,0],h=[a,l,0],d=ms([],t.globeMatrix);return Fs(c,c,d),Fs(u,u,d),Fs(p,p,d),Fs(h,h,d),i[0]=vl(i[0],p,r),i[1]=vl(i[1],h,r),i[2]=vl(i[2],u,r),i[3]=vl(i[3],c,r),ol.fromPoints(i)}function wl(e,t,r){for(const n of e)Fs(n,n,t),zs(n,n,r)}function kl(e,t,r){const n=t/e.worldSize,i=e.globeMatrix;if(r.z<=1){const e=yl(r).getCorners();return wl(e,i,n),ol.fromPoints(e)}const o=El(r),a=Tl(o);wl(a,i,n);const s=Number.MAX_VALUE,l=[-s,-s,-s],c=[s,s,s];if(o.contains(e.center)){for(const e of a)Os(c,c,e),Ls(l,l,e);l[2]=0;const t=e.point,r=[t.x*n,t.y*n,0];return Os(c,c,r),Ls(l,l,r),new ol(c,l)}const u=[i[12]*n,i[13]*n,i[14]*n],p=o.getCenter(),h=A(e.center.lat,-Yl,Yl),d=A(p.lat,-Yl,Yl),f=Gl(e.center.lng),m=Wl(h);let g=f-Gl(p.lng);const b=m-Wl(d);g>.5?g-=1:g<-.5&&(g+=1);let _=0;Math.abs(g)>Math.abs(b)?_=g>=0?1:3:(_=b>=0?0:2,Ds(u,u,[i[4]*n,i[5]*n,i[6]*n],-Math.sin(w(b>=0?o.getSouth():o.getNorth()))*ll));const y=a[_],v=a[(_+1)%4],x=new bl(y,v,u),k=[_l(x,0)||y[0],_l(x,1)||y[1],_l(x,2)||y[2]],E=Dl(e.zoom);if(E>0){const n=function({x:e,y:t,z:r},n,i,o,a){const s=1/(1<<r);let l=e*s,c=l+s,u=t*s,p=u+s,h=0;const d=(l+c)/2-o;return d>.5?h=-1:d<-.5&&(h=1),l=((l+h)*n-(o*=n))*i+o,c=((c+h)*n-o)*i+o,u=(u*n-(a*=n))*i+a,p=(p*n-a)*i+a,[[l,p,0],[c,p,0],[c,u,0],[l,u,0]]}(r,t,e._pixelsPerMercatorPixel,f,m);for(let e=0;e<a.length;e++)vl(a[e],n[e],E);const i=As([],n[_],n[(_+1)%4]);zs(i,i,.5),vl(k,i,E)}for(const e of a)Os(c,c,e),Ls(l,l,e);return c[2]=Math.min(y[2],v[2]),Os(c,c,k),Ls(l,l,k),new ol(c,l)}function El({x:e,y:t,z:r}){const n=1/(1<<r),i=new ql(Zl(e*n),Xl((t+1)*n)),o=new ql(Zl((e+1)*n),Xl(t*n));return new cs(i,o)}function Tl(e){const t=w(e.getNorth()),r=w(e.getSouth()),n=Math.cos(t),i=Math.cos(r),o=Math.sin(t),a=Math.sin(r),s=e.getWest(),l=e.getEast();return[Sl(i,a,s),Sl(i,a,l),Sl(n,o,l),Sl(n,o,s)]}function Sl(e,t,r,n=ll){return r=w(r),[e*Math.sin(r)*n,-t*n,e*Math.cos(r)*n]}function Cl(e,t,r){return Sl(Math.cos(w(e)),Math.sin(w(e)),t,r)}function Al(e,t,r,n){const i=1<<r.z,o=(e/ls+r.x)/i;return Cl(Xl((t/ls+r.y)/i),Zl(o),n)}function Ml({min:e,max:t}){return cl/Math.max(t[0]-e[0],t[1]-e[1],t[2]-e[2])}const Il=new Float64Array(16);function Ol(e){const t=Ml(e),r=xs(Il,[t,t,t]);return bs(r,r,((n=[])[0]=-(i=e.min)[0],n[1]=-i[1],n[2]=-i[2],n));var n,i}function Ll(e){const t=(n=e.min,(r=Il)[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=n[0],r[13]=n[1],r[14]=n[2],r[15]=1,r);var r,n;const i=1/Ml(e);return _s(t,t,[i,i,i])}function zl(e,t,r,n,i){const o=function(e){const t=ls/(2*Math.PI);return e/(2*Math.PI)/t}(r),a=[e,t,-r/(2*Math.PI)],s=fs(new Float64Array(16));return bs(s,s,a),_s(s,s,[o,o,o]),ys(s,s,w(-i)),vs(s,s,w(-n)),s}function Dl(e){return M(al,sl,e)}function Pl(e,t){const r=Cl(t.lat,t.lng),n=function(e){const t=Cl(e._center.lat,e._center.lng);let r=Bs([],Cs(0,1,0),t);const n=ws([],-e.angle,t);r=Fs(r,r,n),ws(n,-e._pitch,r);const i=Ps([],t);return zs(i,i,ml(e.cameraToCenterDistance/e.pixelsPerMeter)),Fs(i,i,n),As([],t,i)}(e);return a=(i=Ms([],n,r))[0],s=i[1],l=i[2],c=(o=r)[0],u=o[1],p=o[2],d=(h=Math.sqrt(a*a+s*s+l*l)*Math.sqrt(c*c+u*u+p*p))&&Rs(i,o)/h,Math.acos(Math.min(Math.max(d,-1),1));var i,o,a,s,l,c,u,p,h,d}function Rl(e,t){return Pl(e,t)>Math.PI/2*1.01}const Bl=w(85),Fl=Math.cos(Bl),jl=Math.sin(Bl),Nl=6371008.8,Ul=2*Math.PI*Nl;class Vl{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Vl(I(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return Nl*Math.acos(Math.min(i,1))}toBounds(e=0){const t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new cs(new Vl(this.lng-r,this.lat-t),new Vl(this.lng+r,this.lat+t))}toEcef(e){const t=ml(e);return Cl(this.lat,this.lng,ll+t)}static convert(e){if(e instanceof Vl)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Vl(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new Vl(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}var ql=Vl;function $l(e){return Ul*Math.cos(e*Math.PI/180)}function Gl(e){return(180+e)/360}function Wl(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Hl(e,t){return e/$l(t)}function Zl(e){return 360*e-180}function Xl(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function Kl(e,t){return e*$l(Xl(t))}const Yl=85.051129;function Jl(e){return 1/Math.cos(e*Math.PI/180)}class Ql{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(e,t=0){const r=ql.convert(e);return new Ql(Gl(r.lng),Wl(r.lat),Hl(t,r.lat))}toLngLat(){return new ql(Zl(this.x),Xl(this.y))}toAltitude(){return Kl(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Ul*Jl(Xl(this.y))}}function ec(e,t,r,n,i,o,a,s,l){const c=(t+n)/2,u=(r+i)/2,p=new y(c,u);s(p),function(e,t,r,n,i,o){const a=r-i,s=n-o;return Math.abs((n-t)*a-(r-e)*s)/Math.hypot(a,s)}(p.x,p.y,o.x,o.y,a.x,a.y)>=l?(ec(e,t,r,c,u,o,p,s,l),ec(e,c,u,n,i,p,a,s,l)):e.push(a)}function tc(e,t,r){let n=e[0],i=n.x,o=n.y;t(n);const a=[n];for(let s=1;s<e.length;s++){const l=e[s],{x:c,y:u}=l;t(l),ec(a,i,o,c,u,n,l,t,r),i=c,o=u,n=l}return a}function rc(e,t,r,n){if(n(t,r)){const i=t.add(r)._mult(.5);rc(e,t,i,n),rc(e,i,r,n)}else e.push(r)}function nc(e,t){let r=e[0];const n=[r];for(let i=1;i<e.length;i++){const o=e[i];rc(n,r,o,t),r=o}return n}const ic=Math.pow(2,14)-1,oc=-ic-1;function ac(e,t){const r=Math.round(e.x*t),n=Math.round(e.y*t);return e.x=A(r,oc,ic),e.y=A(n,oc,ic),(r<e.x||r>e.x+1||n<e.y||n>e.y+1)&&G("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function sc(e,t,r){const n=e.loadGeometry(),i=e.extent,o=ls/i;if(t&&r&&r.projection.isReprojectedInTileSpace){const o=1<<t.z,{scale:a,x:s,y:l,projection:c}=r,u=e=>{const r=Zl((t.x+e.x/i)/o),n=Xl((t.y+e.y/i)/o),u=c.project(r,n);e.x=(u.x*a-s)*i,e.y=(u.y*a-l)*i};for(let t=0;t<n.length;t++)if(1!==e.type)n[t]=tc(n[t],u,1);else{const e=[];for(const r of n[t])r.x<0||r.x>=i||r.y<0||r.y>=i||(u(r),e.push(r));n[t]=e}}for(const e of n)for(const t of e)ac(t,o);return n}function lc(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?sc(e):[]}}function cc(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}function uc(e,t,r){const n=16384;e.emplaceBack(t.x,t.y,t.z,r[0]*n,r[1]*n,r[2]*n)}class pc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Vo,this.indexArray=new ia,this.segments=new ss,this.programConfigurations=new Ya(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r,n){const i=this.layers[0],o=[];let a=null;"circle"===i.type&&(a=i.layout.get("circle-sort-key"));for(const{feature:t,id:i,index:s,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=lc(t,e);if(!this.layers[0]._featureFilter.filter(new ko(this.zoom),c,r))continue;const u=a?a.evaluate(c,{},r):void 0,p={id:i,properties:t.properties,type:t.type,sourceLayerIndex:l,index:s,geometry:e?c.geometry:sc(t,r,n),patterns:{},sortKey:u};o.push(p)}a&&o.sort(((e,t)=>e.sortKey-t.sortKey));let s=null;"globe"===n.projection.name&&(this.globeExtVertexArray=new Xo,s=n.projection);for(const n of o){const{geometry:i,index:o,sourceLayerIndex:a}=n,l=e[o].feature;this.addFeature(n,i,o,t.availableImages,r,s),t.featureIndex.insert(l,i,o,a,this.index)}}update(e,t,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,os.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,as.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,t,r,n,i,o){for(const r of t)for(const t of r){const r=t.x,n=t.y;if(r<0||r>=ls||n<0||n>=ls)continue;if(o){const e=o.projectTilePoint(r,n,i),t=o.upVector(i,r,n),a=this.globeExtVertexArray;uc(a,e,t),uc(a,e,t),uc(a,e,t),uc(a,e,t)}const a=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),s=a.vertexLength;cc(this.layoutVertexArray,r,n,-1,-1),cc(this.layoutVertexArray,r,n,1,-1),cc(this.layoutVertexArray,r,n,1,1),cc(this.layoutVertexArray,r,n,-1,1),this.indexArray.emplaceBack(s,s+1,s+2),this.indexArray.emplaceBack(s,s+2,s+3),a.vertexLength+=4,a.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n,i)}}function hc(e,t){for(let r=0;r<e.length;r++)if(xc(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(xc(e,t[r]))return!0;return!!gc(e,t)}function dc(e,t,r){return!!xc(e,t)||!!_c(t,e,r)}function fc(e,t){if(1===e.length)return vc(t,e[0]);for(let r=0;r<t.length;r++){const n=t[r];for(let t=0;t<n.length;t++)if(xc(e,n[t]))return!0}for(let r=0;r<e.length;r++)if(vc(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(gc(e,t[r]))return!0;return!1}function mc(e,t,r){if(e.length>1){if(gc(e,t))return!0;for(let n=0;n<t.length;n++)if(_c(t[n],e,r))return!0}for(let n=0;n<e.length;n++)if(_c(e[n],t,r))return!0;return!1}function gc(e,t){if(0===e.length||0===t.length)return!1;for(let r=0;r<e.length-1;r++){const n=e[r],i=e[r+1];for(let e=0;e<t.length-1;e++)if(bc(n,i,t[e],t[e+1]))return!0}return!1}function bc(e,t,r,n){return W(e,r,n)!==W(t,r,n)&&W(e,t,r)!==W(e,t,n)}function _c(e,t,r){const n=r*r;if(1===t.length)return e.distSqr(t[0])<n;for(let r=1;r<t.length;r++)if(yc(e,t[r-1],t[r])<n)return!0;return!1}function yc(e,t,r){const n=t.distSqr(r);if(0===n)return e.distSqr(t);const i=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/n;return e.distSqr(i<0?t:i>1?r:r.sub(t)._mult(i)._add(t))}function vc(e,t){let r,n,i,o=!1;for(let a=0;a<e.length;a++){r=e[a];for(let e=0,a=r.length-1;e<r.length;a=e++)n=r[e],i=r[a],n.y>t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(o=!o)}return o}function xc(e,t){let r=!1;for(let n=0,i=e.length-1;n<e.length;i=n++){const o=e[n],a=e[i];o.y>t.y!=a.y>t.y&&t.x<(a.x-o.x)*(t.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function wc(e,t,r,n,i){for(const o of e)if(t<=o.x&&r<=o.y&&n>=o.x&&i>=o.y)return!0;const o=[new y(t,r),new y(t,i),new y(n,i),new y(n,r)];if(e.length>2)for(const t of o)if(xc(e,t))return!0;for(let t=0;t<e.length-1;t++)if(kc(e[t],e[t+1],o))return!0;return!1}function kc(e,t,r){const n=r[0],i=r[2];if(e.x<n.x&&t.x<n.x||e.x>i.x&&t.x>i.x||e.y<n.y&&t.y<n.y||e.y>i.y&&t.y>i.y)return!1;const o=W(e,t,r[0]);return o!==W(e,t,r[1])||o!==W(e,t,r[2])||o!==W(e,t,r[3])}function Ec(e,t,r){const n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Tc(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Sc(e,t,r,n,i){if(!t[0]&&!t[1])return e;const o=y.convert(t)._mult(i);"viewport"===r&&o._rotate(-n);const a=[];for(let t=0;t<e.length;t++)a.push(e[t].sub(o));return a}function Cc(e,t,r,n){const i=y.convert(e)._mult(n);return"viewport"===t&&i._rotate(-r),i}Ki(pc,"CircleBucket",{omit:["layers"]});const Ac=new Po({"circle-sort-key":new zo(tt.layout_circle["circle-sort-key"])});var Mc={paint:new Po({"circle-radius":new zo(tt.paint_circle["circle-radius"]),"circle-color":new zo(tt.paint_circle["circle-color"]),"circle-blur":new zo(tt.paint_circle["circle-blur"]),"circle-opacity":new zo(tt.paint_circle["circle-opacity"]),"circle-translate":new Lo(tt.paint_circle["circle-translate"]),"circle-translate-anchor":new Lo(tt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Lo(tt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Lo(tt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new zo(tt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new zo(tt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new zo(tt.paint_circle["circle-stroke-opacity"])}),layout:Ac};function Ic(e,t,r,n,i,o,a,s,l){if(o&&e.queryGeometry.isAboveHorizon)return!1;o&&(l*=e.pixelToTileUnitsFactor);const c=e.tileID.canonical,u=r.projection.upVectorScale(c,r.center.lat,r.worldSize).metersToTile;for(const p of t)for(const t of p){const p=t.add(s),h=i&&r.elevation?r.elevation.exaggeration()*i.getElevationAt(p.x,p.y,!0):0,d=r.projection.projectTilePoint(p.x,p.y,c);if(h>0){const e=r.projection.upVector(c,p.x,p.y);d.x+=e[0]*u*h,d.y+=e[1]*u*h,d.z+=e[2]*u*h}const f=o?p:Oc(d.x,d.y,d.z,n),m=o?e.tilespaceRays.map((e=>Dc(e,h))):e.queryGeometry.screenGeometry,g=Ws([],[d.x,d.y,d.z,1],n);if(!a&&o?l*=g[3]/r.cameraToCenterDistance:a&&!o&&(l*=r.cameraToCenterDistance/g[3]),o){const e=Xl((t.y/ls+c.y)/(1<<c.z));l/=r.projection.pixelsPerMeter(e,1)/Hl(1,e)}if(dc(m,f,l))return!0}return!1}function Oc(e,t,r,n){const i=Ws([],[e,t,r,1],n);return new y(i[0]/i[3],i[1]/i[3])}const Lc=Cs(0,0,0),zc=Cs(0,0,1);function Dc(e,t){const r=Es();return Lc[2]=t,e.intersectsPlane(Lc,zc,r),new y(r[0],r[1])}class Pc extends pc{}function Rc(e,{width:t,height:r},n,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==t*r*n)throw new RangeError("mismatched image size")}else i=new Uint8Array(t*r*n);return e.width=t,e.height=r,e.data=i,e}function Bc(e,t,r){const{width:n,height:i}=t;n===e.width&&i===e.height||(Fc(e,t,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,i)},r),e.width=n,e.height=i,e.data=t.data)}function Fc(e,t,r,n,i,o){if(0===i.width||0===i.height)return t;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 source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const a=e.data,s=t.data;for(let l=0;l<i.height;l++){const c=((r.y+l)*e.width+r.x)*o,u=((n.y+l)*t.width+n.x)*o;for(let e=0;e<i.width*o;e++)s[u+e]=a[c+e]}return t}Ki(Pc,"HeatmapBucket",{omit:["layers"]});class jc{constructor(e,t){Rc(this,e,1,t)}resize(e){Bc(this,new jc(e),1)}clone(){return new jc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i){Fc(e,t,r,n,i,1)}}class Nc{constructor(e,t){Rc(this,e,4,t)}resize(e){Bc(this,new Nc(e),4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Nc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i){Fc(e,t,r,n,i,4)}}Ki(jc,"AlphaImage"),Ki(Nc,"RGBAImage");var Uc={paint:new Po({"heatmap-radius":new zo(tt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new zo(tt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Lo(tt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Do(tt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Lo(tt.paint_heatmap["heatmap-opacity"])})};function Vc(e){const t={},r=e.resolution||256,n=e.clips?e.clips.length:1,i=e.image||new Nc({width:r,height:n}),o=(r,n,o)=>{t[e.evaluationKey]=o;const a=e.expression.evaluate(t);i.data[r+n+0]=Math.floor(255*a.r/a.a),i.data[r+n+1]=Math.floor(255*a.g/a.a),i.data[r+n+2]=Math.floor(255*a.b/a.a),i.data[r+n+3]=Math.floor(255*a.a)};if(e.clips)for(let t=0,i=0;t<n;++t,i+=4*r)for(let n=0,a=0;n<r;n++,a+=4){const s=n/(r-1),{start:l,end:c}=e.clips[t];o(i,a,l*(1-s)+c*s)}else for(let e=0,t=0;e<r;e++,t+=4)o(0,t,e/(r-1));return i}var qc={paint:new Po({"hillshade-illumination-direction":new Lo(tt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Lo(tt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Lo(tt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Lo(tt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Lo(tt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Lo(tt.paint_hillshade["hillshade-accent-color"])})};const $c=No([{name:"a_pos",components:2,type:"Int16"}],4),{members:Gc}=$c;var Wc={exports:{}};function Hc(e,t,r){r=r||2;var n,i,o,a,s,l,c,u=t&&t.length,p=u?t[0]*r:e.length,h=Zc(e,0,p,r,!0),d=[];if(!h||h.next===h.prev)return d;if(u&&(h=function(e,t,r,n){var i,o,a,s=[];for(i=0,o=t.length;i<o;i++)(a=Zc(e,t[i]*n,i<o-1?t[i+1]*n:e.length,n,!1))===a.next&&(a.steiner=!0),s.push(ou(a));for(s.sort(tu),i=0;i<s.length;i++)r=ru(s[i],r);return r}(e,t,h,r)),e.length>80*r){n=o=e[0],i=a=e[1];for(var f=r;f<p;f+=r)(s=e[f])<n&&(n=s),(l=e[f+1])<i&&(i=l),s>o&&(o=s),l>a&&(a=l);c=0!==(c=Math.max(o-n,a-i))?32767/c:0}return Kc(h,d,r,n,i,c,0),d}function Zc(e,t,r,n,i){var o,a;if(i===_u(e,t,r,n)>0)for(o=t;o<r;o+=n)a=mu(o,e[o],e[o+1],a);else for(o=r-n;o>=t;o-=n)a=mu(o,e[o],e[o+1],a);return a&&cu(a,a.next)&&(gu(a),a=a.next),a}function Xc(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!cu(n,n.next)&&0!==lu(n.prev,n,n.next))n=n.next;else{if(gu(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function Kc(e,t,r,n,i,o,a){if(e){!a&&o&&function(e,t,r,n){var i=e;do{0===i.z&&(i.z=iu(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,o,a,s,l,c=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t<c&&(s++,n=n.nextZ);t++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1)}(i)}(e,n,i,o);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?Jc(e,n,i,o):Yc(e))t.push(s.i/r|0),t.push(e.i/r|0),t.push(l.i/r|0),gu(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?Kc(e=Qc(Xc(e),t,r),t,r,n,i,o,2):2===a&&eu(e,t,r,n,i,o):Kc(Xc(e),t,r,n,i,o,1);break}}}function Yc(e){var t=e.prev,r=e,n=e.next;if(lu(t,r,n)>=0)return!1;for(var i=t.x,o=r.x,a=n.x,s=t.y,l=r.y,c=n.y,u=i<o?i<a?i:a:o<a?o:a,p=s<l?s<c?s:c:l<c?l:c,h=i>o?i>a?i:a:o>a?o:a,d=s>l?s>c?s:c:l>c?l:c,f=n.next;f!==t;){if(f.x>=u&&f.x<=h&&f.y>=p&&f.y<=d&&au(i,s,o,l,a,c,f.x,f.y)&&lu(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Jc(e,t,r,n){var i=e.prev,o=e,a=e.next;if(lu(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,c=a.x,u=i.y,p=o.y,h=a.y,d=s<l?s<c?s:c:l<c?l:c,f=u<p?u<h?u:h:p<h?p:h,m=s>l?s>c?s:c:l>c?l:c,g=u>p?u>h?u:h:p>h?p:h,b=iu(d,f,t,r,n),_=iu(m,g,t,r,n),y=e.prevZ,v=e.nextZ;y&&y.z>=b&&v&&v.z<=_;){if(y.x>=d&&y.x<=m&&y.y>=f&&y.y<=g&&y!==i&&y!==a&&au(s,u,l,p,c,h,y.x,y.y)&&lu(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,v.x>=d&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==a&&au(s,u,l,p,c,h,v.x,v.y)&&lu(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;y&&y.z>=b;){if(y.x>=d&&y.x<=m&&y.y>=f&&y.y<=g&&y!==i&&y!==a&&au(s,u,l,p,c,h,y.x,y.y)&&lu(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;v&&v.z<=_;){if(v.x>=d&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==a&&au(s,u,l,p,c,h,v.x,v.y)&&lu(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function Qc(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!cu(i,o)&&uu(i,n,n.next,o)&&du(i,o)&&du(o,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),gu(n),gu(n.next),n=e=o),n=n.next}while(n!==e);return Xc(n)}function eu(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&su(a,s)){var l=fu(a,s);return a=Xc(a,a.next),l=Xc(l,l.next),Kc(a,t,r,n,i,o,0),void Kc(l,t,r,n,i,o,0)}s=s.next}a=a.next}while(a!==e)}function tu(e,t){return e.x-t.x}function ru(e,t){var r=function(e,t){var r,n=t,i=e.x,o=e.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a&&(a=s,r=n.x<n.next.x?n:n.next,s===i))return r}n=n.next}while(n!==t);if(!r)return null;var l,c=r,u=r.x,p=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=u&&i!==n.x&&au(o<p?i:a,o,u,p,o<p?a:i,o,n.x,n.y)&&(l=Math.abs(o-n.y)/(i-n.x),du(n,e)&&(l<h||l===h&&(n.x>r.x||n.x===r.x&&nu(r,n)))&&(r=n,h=l)),n=n.next}while(n!==c);return r}(e,t);if(!r)return t;var n=fu(r,e);return Xc(n,n.next),Xc(r,r.next)}function nu(e,t){return lu(e.prev,e,t.prev)<0&&lu(t.next,e,e.next)<0}function iu(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function ou(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function au(e,t,r,n,i,o,a,s){return(i-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(n-s)>=(r-a)*(t-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function su(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&uu(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(du(e,t)&&du(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(lu(e.prev,e,t.prev)||lu(e,t.prev,t))||cu(e,t)&&lu(e.prev,e,e.next)>0&&lu(t.prev,t,t.next)>0)}function lu(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function cu(e,t){return e.x===t.x&&e.y===t.y}function uu(e,t,r,n){var i=hu(lu(e,t,r)),o=hu(lu(e,t,n)),a=hu(lu(r,n,e)),s=hu(lu(r,n,t));return i!==o&&a!==s||!(0!==i||!pu(e,r,t))||!(0!==o||!pu(e,n,t))||!(0!==a||!pu(r,e,n))||!(0!==s||!pu(r,t,n))}function pu(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function hu(e){return e>0?1:e<0?-1:0}function du(e,t){return lu(e.prev,e,e.next)<0?lu(e,t,e.next)>=0&&lu(e,e.prev,t)>=0:lu(e,t,e.prev)<0||lu(e,e.next,t)<0}function fu(e,t){var r=new bu(e.i,e.x,e.y),n=new bu(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function mu(e,t,r,n){var i=new bu(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function gu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function bu(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _u(e,t,r,n){for(var i=0,o=t,a=r-n;o<r;o+=n)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}Wc.exports=Hc,Wc.exports.default=Hc,Hc.deviation=function(e,t,r,n){var i=t&&t.length,o=Math.abs(_u(e,0,i?t[0]*r:e.length,r));if(i)for(var a=0,s=t.length;a<s;a++)o-=Math.abs(_u(e,t[a]*r,a<s-1?t[a+1]*r:e.length,r));var l=0;for(a=0;a<n.length;a+=3){var c=n[a]*r,u=n[a+1]*r,p=n[a+2]*r;l+=Math.abs((e[c]-e[p])*(e[u+1]-e[c+1])-(e[c]-e[u])*(e[p+1]-e[c+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},Hc.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[i][o][a]);i>0&&r.holes.push(n+=e[i-1].length)}return r};var yu=d(Wc.exports);function vu(e,t,r,n,i){xu(e,t,r||0,n||e.length-1,i||ku)}function xu(e,t,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,a=t-r+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);xu(e,t,Math.max(r,Math.floor(t-a*l/o+c)),Math.min(n,Math.floor(t+(o-a)*l/o+c)),i)}var u=e[t],p=r,h=n;for(wu(e,r,t),i(e[n],u)>0&&wu(e,r,n);p<h;){for(wu(e,p,h),p++,h--;i(e[p],u)<0;)p++;for(;i(e[h],u)>0;)h--}0===i(e[r],u)?wu(e,r,h):wu(e,++h,n),h<=t&&(r=h+1),t<=h&&(n=h-1)}}function wu(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function ku(e,t){return e<t?-1:e>t?1:0}function Eu(e,t){const r=e.length;if(r<=1)return[e];const n=[];let i,o;for(let t=0;t<r;t++){const r=H(e[t]);0!==r&&(e[t].area=Math.abs(r),void 0===o&&(o=r<0),o===r<0?(i&&n.push(i),i=[e[t]]):i.push(e[t]))}if(i&&n.push(i),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(vu(n[e],t,1,n[e].length-1,Tu),n[e]=n[e].slice(0,t));return n}function Tu(e,t){return t.area-e.area}function Su(e,t,r){const n=r.patternDependencies;let i=!1;for(const r of t){const t=r.paint.get(`${e}-pattern`);t.isConstant()||(i=!0);const o=t.constantOr(null);o&&(i=!0,n[o]=!0)}return i}function Cu(e,t,r,n,i){const o=i.patternDependencies;for(const a of t){const t=a.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:n},r,{},i.availableImages);e=e&&e.name?e.name:e,o[e]=!0,r.patterns[a.id]=e}}return r}class Au{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Vo,this.indexArray=new ia,this.indexArray2=new ua,this.programConfigurations=new Ya(e.layers,e.zoom),this.segments=new ss,this.segments2=new ss,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.projection=e.projection}populate(e,t,r,n){this.hasPattern=Su("fill",this.layers,t);const i=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:a,id:s,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=lc(a,e);if(!this.layers[0]._featureFilter.filter(new ko(this.zoom),u,r))continue;const p=i?i.evaluate(u,{},r,t.availableImages):void 0,h={id:s,properties:a.properties,type:a.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:sc(a,r,n),patterns:{},sortKey:p};o.push(h)}i&&o.sort(((e,t)=>e.sortKey-t.sortKey));for(const n of o){const{geometry:i,index:o,sourceLayerIndex:a}=n;if(this.hasPattern){const e=Cu("fill",this.layers,n,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(n,i,o,r,{},t.availableImages);t.featureIndex.insert(e[o].feature,i,o,a,this.index)}}update(e,t,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r,n)}addFeatures(e,t,r,n,i){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Gc),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,n,i,o=[]){for(const e of Eu(t,500)){let t=0;for(const r of e)t+=r.length;const r=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),n=r.vertexLength,i=[],o=[];for(const t of e){if(0===t.length)continue;t!==e[0]&&o.push(i.length/2);const r=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),n=r.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(n+t.length-1,n),i.push(t[0].x),i.push(t[0].y);for(let e=1;e<t.length;e++)this.layoutVertexArray.emplaceBack(t[e].x,t[e].y),this.indexArray2.emplaceBack(n+e-1,n+e),i.push(t[e].x),i.push(t[e].y);r.vertexLength+=t.length,r.primitiveLength+=t.length}const a=yu(i,o);for(let e=0;e<a.length;e+=3)this.indexArray.emplaceBack(n+a[e],n+a[e+1],n+a[e+2]);r.vertexLength+=t,r.primitiveLength+=a.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,o,n)}}Ki(Au,"FillBucket",{omit:["layers","patternFeatures"]});const Mu=new Po({"fill-sort-key":new zo(tt.layout_fill["fill-sort-key"])});var Iu={paint:new Po({"fill-antialias":new Lo(tt.paint_fill["fill-antialias"]),"fill-opacity":new zo(tt.paint_fill["fill-opacity"]),"fill-color":new zo(tt.paint_fill["fill-color"]),"fill-outline-color":new zo(tt.paint_fill["fill-outline-color"]),"fill-translate":new Lo(tt.paint_fill["fill-translate"]),"fill-translate-anchor":new Lo(tt.paint_fill["fill-translate-anchor"]),"fill-pattern":new zo(tt.paint_fill["fill-pattern"])}),layout:Mu};const Ou=No([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Lu=No([{name:"a_centroid_pos",components:2,type:"Uint16"}]),zu=No([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Du}=Ou;var Pu={},Ru=b,Bu=Fu;function Fu(e,t,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=i,e.readFields(ju,this,t)}function ju(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function Nu(e){for(var t,r,n=0,i=0,o=e.length,a=o-1;i<o;a=i++)n+=((r=e[a]).x-(t=e[i]).x)*(t.y+r.y);return n}Fu.types=["Unknown","Point","LineString","Polygon"],Fu.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,o=0,a=0,s=[];e.pos<r;){if(i<=0){var l=e.readVarint();n=7&l,i=l>>3}if(i--,1===n||2===n)o+=e.readSVarint(),a+=e.readSVarint(),1===n&&(t&&s.push(t),t=[]),t.push(new Ru(o,a));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&s.push(t),s},Fu.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,l=1/0,c=-1/0;e.pos<t;){if(n<=0){var u=e.readVarint();r=7&u,n=u>>3}if(n--,1===r||2===r)(i+=e.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=e.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,l,s,c]},Fu.prototype.toGeoJSON=function(e,t,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=Fu.types[this.type];function u(e){for(var t=0;t<e.length;t++){var r=e[t];e[t]=[360*(r.x+a)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var p=[];for(n=0;n<l.length;n++)p[n]=l[n][0];u(l=p);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,i=[],o=0;o<t;o++){var a=Nu(e[o]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(r&&i.push(r),r=[e[o]]):r.push(e[o]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)u(l[n][i])}1===l.length?l=l[0]:c="Multi"+c;var h={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(h.id=this.id),h};var Uu=Bu,Vu=qu;function qu(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields($u,this,t),this.length=this._features.length}function $u(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}qu.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Uu(this._pbf,t,this.extent,this._keys,this._values)};var Gu=Vu;function Wu(e,t,r){if(3===e){var n=new Gu(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}var Hu=Pu.VectorTile=function(e,t){this.layers=e.readFields(Wu,{},t)},Zu=Pu.VectorTileFeature=Bu;function Xu(e,t,r,n){const i=[],o=0===n?(e,t,r,n,i,o)=>{e.push(new y(o,r+(o-t)/(n-t)*(i-r)))}:(e,t,r,n,i,o)=>{e.push(new y(t+(o-r)/(i-r)*(n-t),o))};for(const a of e){const e=[];for(const i of a){if(i.length<=2)continue;const a=[];for(let e=0;e<i.length-1;e++){const s=i[e].x,l=i[e].y,c=i[e+1].x,u=i[e+1].y,p=0===n?s:l,h=0===n?c:u;p<t?h>t&&o(a,s,l,c,u,t):p>r?h<r&&o(a,s,l,c,u,r):a.push(i[e]),h<t&&p>=t&&o(a,s,l,c,u,t),h>r&&p<=r&&o(a,s,l,c,u,r)}let s=i[i.length-1];const l=0===n?s.x:s.y;l>=t&&l<=r&&a.push(s),a.length&&(s=a[a.length-1],a[0].x===s.x&&a[0].y===s.y||a.push(a[0]),e.push(a))}e.length&&i.push(e)}return i}Pu.VectorTileLayer=Vu;const Ku=Zu.types,Yu=Math.pow(2,13);function Ju(e,t,r,n,i,o,a,s){e.emplaceBack((t<<1)+a,(r<<1)+o,(Math.floor(n*Yu)<<1)+i,Math.round(s))}function Qu(e,t,r){const n=16384;e.emplaceBack(t.x,t.y,t.z,r[0]*n,r[1]*n,r[2]*n)}class ep{constructor(){this.acc=new y(0,0),this.polyCount=[]}startRing(e){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new y(e.x,e.y),this.max=new y(e.x,e.y))}append(e,t){this.currentPolyCount.edges++,this.acc._add(e);const r=this.min,n=this.max;e.x<r.x?r.x=e.x:e.x>n.x&&(n.x=e.x),e.y<r.y?r.y=e.y:e.y>n.y&&(n.y=e.y),((0===e.x||e.x===ls)&&e.x===t.x)!=((0===e.y||e.y===ls)&&e.y===t.y)&&this.processBorderOverlap(e,t),t.x<0!=e.x<0&&this.addBorderIntersection(0,Lr(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>ls!=e.x>ls&&this.addBorderIntersection(1,Lr(t.y,e.y,(ls-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,Lr(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>ls!=e.y>ls&&this.addBorderIntersection(3,Lr(t.x,e.x,(ls-t.y)/(e.y-t.y)))}addBorderIntersection(e,t){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const r=this.borders[e];t<r[0]&&(r[0]=t),t>r[1]&&(r[1]=t)}processBorderOverlap(e,t){if(e.x===t.x){if(e.y===t.y)return;const r=0===e.x?0:1;this.addBorderIntersection(r,t.y),this.addBorderIntersection(r,e.y)}else{const r=0===e.y?2:3;this.addBorderIntersection(r,t.x),this.addBorderIntersection(r,e.x)}}centroid(){const e=this.polyCount.reduce(((e,t)=>e+t.edges),0);return 0!==e?this.acc.div(e)._round():new y(0,0)}span(){return new y(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce(((e,t)=>e+ +(t[0]!==Number.MAX_VALUE)),0)}}class tp{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.layoutVertexArray=new $o,this.centroidVertexArray=new ka,this.indexArray=new ia,this.programConfigurations=new Ya(e.layers,e.zoom),this.segments=new ss,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.enableTerrain=e.enableTerrain}populate(e,t,r,n){this.features=[],this.hasPattern=Su("fill-extrusion",this.layers,t),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(e){const t=Math.exp(Math.PI*(1-e.y/(1<<e.z)*2));return 80150034*t/(t*t+1)/ls/(1<<e.z)}(r),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:i,id:o,index:a,sourceLayerIndex:s}of e){const e=this.layers[0]._featureFilter.needGeometry,l=lc(i,e);if(!this.layers[0]._featureFilter.filter(new ko(this.zoom),l,r))continue;const c={id:o,sourceLayerIndex:s,index:a,geometry:e?l.geometry:sc(i,r,n),properties:i.properties,type:i.type,patterns:{}},u=this.layoutVertexArray.length;this.hasPattern?this.features.push(Cu("fill-extrusion",this.layers,c,this.zoom,t)):this.addFeature(c,c.geometry,a,r,{},t.availableImages,n),t.featureIndex.insert(i,c.geometry,a,s,this.index,u)}this.sortBorders()}addFeatures(e,t,r,n,i){for(const e of this.features){const{geometry:o}=e;this.addFeature(e,o,e.index,t,r,n,i)}this.sortBorders()}update(e,t,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Du),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,zu.members,!0))),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){0!==this.centroidVertexArray.length&&(this.centroidVertexBuffer?this.needsCentroidUpdate&&this.centroidVertexBuffer.updateData(this.centroidVertexArray):this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Lu.members,!0),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,n,i,o,a){const s=[new y(0,0),new y(ls,ls)],l=a.projection,c="globe"===l.name,u=this.enableTerrain&&!c?new ep:null,p="Polygon"===Ku[e.type];c&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Xo);const h=Eu(t,500);for(let e=h.length-1;e>=0;e--){const t=h[e];(0===t.length||(d=t[0]).every((e=>e.x<=0))||d.every((e=>e.x>=ls))||d.every((e=>e.y<=0))||d.every((e=>e.y>=ls)))&&h.splice(e,1)}var d;let f;if(c)f=cp(h,s,n);else{f=[];for(const e of h)f.push({polygon:e,bounds:s})}const m=p?this.edgeRadius:0;for(const{polygon:e,bounds:t}of f){let r=0,i=0;for(const t of e)p&&!t[0].equals(t[t.length-1])&&t.push(t[0]),i+=p?t.length-1:t.length;const o=this.segments.prepareSegment((p?5:4)*i,this.layoutVertexArray,this.indexArray);if(p){const t=[],i=[];r=o.vertexLength;for(const r of e){let a,s;r.length&&r!==e[0]&&i.push(t.length/2),a=r[1].sub(r[0])._perp()._unit();for(let e=1;e<r.length;e++){const i=r[e],u=r[e===r.length-1?1:e+1];let{x:p,y:h}=i;if(m){s=u.sub(i)._perp()._unit();const e=a.add(s)._unit(),t=m*Math.min(4,1/(a.x*e.x+a.y*e.y));p+=t*e.x,h+=t*e.y,a=s}Ju(this.layoutVertexArray,p,h,0,0,1,1,0),o.vertexLength++,t.push(i.x,i.y),c&&Qu(this.layoutVertexExtArray,l.projectTilePoint(p,h,n),l.upVector(n,p,h))}}const a=yu(t,i);for(let e=0;e<a.length;e+=3)this.indexArray.emplaceBack(r+a[e],r+a[e+2],r+a[e+1]),o.primitiveLength++}for(const i of e){u&&i.length&&u.startRing(i[0]);let e,a,s,h=i.length>4&&ap(i[i.length-2],i[0],i[1]),d=m?np(i[i.length-2],i[0],i[1],m):0;a=i[1].sub(i[0])._perp()._unit();let f=!0;for(let g=1,b=0;g<i.length;g++){let _=i[g-1],y=i[g];const v=i[g===i.length-1?1:g+1];if(u&&p&&u.currentPolyCount.top++,op(y,_,t)){m&&(a=v.sub(y)._perp()._unit(),f=!f);continue}u&&u.append(y,_);const x=y.sub(_)._perp(),w=x.x/(Math.abs(x.x)+Math.abs(x.y)),k=x.y>0?1:0,E=_.dist(y);if(b+E>32768&&(b=0),m){s=v.sub(y)._perp()._unit();let e=ip(_,y,v,rp(a,s),m);isNaN(e)&&(e=0);const t=y.sub(_)._unit();_=_.add(t.mult(d))._round(),y=y.add(t.mult(-e))._round(),d=e,a=s}const T=o.vertexLength,S=i.length>4&&ap(_,y,v);let C=sp(b,h,f);if(Ju(this.layoutVertexArray,_.x,_.y,w,k,0,0,C),Ju(this.layoutVertexArray,_.x,_.y,w,k,0,1,C),b+=E,C=sp(b,S,!f),h=S,Ju(this.layoutVertexArray,y.x,y.y,w,k,0,0,C),Ju(this.layoutVertexArray,y.x,y.y,w,k,0,1,C),o.vertexLength+=4,this.indexArray.emplaceBack(T+0,T+1,T+2),this.indexArray.emplaceBack(T+1,T+3,T+2),o.primitiveLength+=2,m){const n=r+(1===g?i.length-2:g-2),a=1===g?r:n+1;if(this.indexArray.emplaceBack(T+1,n,T+3),this.indexArray.emplaceBack(n,a,T+3),o.primitiveLength+=2,void 0===e&&(e=T),!op(v,i[g],t)){const t=g===i.length-1?e:o.vertexLength;this.indexArray.emplaceBack(T+2,T+3,t),this.indexArray.emplaceBack(T+3,t+1,t),this.indexArray.emplaceBack(T+3,a,t+1),o.primitiveLength+=3}f=!f}if(c){const e=this.layoutVertexExtArray,t=l.projectTilePoint(_.x,_.y,n),r=l.projectTilePoint(y.x,y.y,n),i=l.upVector(n,_.x,_.y),o=l.upVector(n,y.x,y.y);Qu(e,t,i),Qu(e,t,i),Qu(e,r,o),Qu(e,r,o)}}p&&(r+=i.length-1)}}if(u&&u.polyCount.length>0){if(u.borders){u.vertexArrayOffset=this.centroidVertexArray.length;const e=u.borders,t=this.featuresOnBorder.push(u)-1;for(let r=0;r<4;r++)e[r][0]!==Number.MAX_VALUE&&this.borders[r].push(t)}this.encodeCentroid(u.borders?void 0:u.centroid(),u)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,o,n)}sortBorders(){for(let e=0;e<4;e++)this.borders[e].sort(((t,r)=>this.featuresOnBorder[t].borders[e][0]-this.featuresOnBorder[r].borders[e][0]))}encodeCentroid(e,t,r=!0){let n,i;if(e)if(0!==e.y){const r=t.span()._mult(this.tileToMeter);n=(Math.max(e.x,1)<<3)+Math.min(7,Math.round(r.x/10)),i=(Math.max(e.y,1)<<3)+Math.min(7,Math.round(r.y/10))}else n=Math.ceil(7*(e.x+450)),i=0;else n=0,i=+r;let o=r?this.centroidVertexArray.length:t.vertexArrayOffset;for(const e of t.polyCount){r&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*e.edges+e.top);for(let t=0;t<e.top;t++)this.centroidVertexArray.emplace(o++,n,i);for(let t=0;t<2*e.edges;t++)this.centroidVertexArray.emplace(o++,0,i),this.centroidVertexArray.emplace(o++,n,i)}}}function rp(e,t){const r=e.add(t)._unit();return e.x*r.x+e.y*r.y}function np(e,t,r,n){const i=t.sub(e)._perp()._unit(),o=r.sub(t)._perp()._unit();return ip(e,t,r,rp(i,o),n)}function ip(e,t,r,n,i){const o=Math.sqrt(1-n*n);return Math.min(e.dist(t)/3,t.dist(r)/3,i*o/n)}function op(e,t,r){return e.x<r[0].x&&t.x<r[0].x||e.x>r[1].x&&t.x>r[1].x||e.y<r[0].y&&t.y<r[0].y||e.y>r[1].y&&t.y>r[1].y}function ap(e,t,r){if(e.x<0||e.x>=ls||t.x<0||t.x>=ls||r.x<0||r.x>=ls)return!1;const n=r.sub(t),i=n.perp(),o=e.sub(t);return(n.x*o.x+n.y*o.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(o.x*o.x+o.y*o.y))>-.866&&i.x*o.x+i.y*o.y<0}function sp(e,t,r){const n=t?2|e:-3&e;return r?1|n:-2&n}function lp(){const e=Math.PI/32,t=Math.tan(e),r=Nl;return r*Math.sqrt(1+2*t*t)-r}function cp(e,t,r){const n=1<<r.z,i=Zl(r.x/n),o=Zl((r.x+1)/n),a=Xl(r.y/n),s=Xl((r.y+1)/n);return function(e,t,r,n,i=0,o){const a=[];if(!e.length||!r||!n)return a;const s=(e,t)=>{for(const r of e)a.push({polygon:r,bounds:t})},l=Math.ceil(Math.log2(r)),c=Math.ceil(Math.log2(n)),u=l-c,p=[];for(let e=0;e<Math.abs(u);e++)p.push(u>0?0:1);for(let e=0;e<Math.min(l,c);e++)p.push(0),p.push(1);let h=e;if(h=Xu(h,t[0].y-i,t[1].y+i,1),h=Xu(h,t[0].x-i,t[1].x+i,0),!h.length)return a;const d=[];for(p.length?d.push({polygons:h,bounds:t,depth:0}):s(h,t);d.length;){const e=d.pop(),t=e.depth,r=p[t],n=e.bounds[0],a=e.bounds[1],l=0===r?n.x:n.y,c=0===r?a.x:a.y,u=o?o(r,l,c):.5*(l+c),h=Xu(e.polygons,l-i,u+i,r),f=Xu(e.polygons,u-i,c+i,r);if(h.length){const e=[n,new y(0===r?u:a.x,1===r?u:a.y)];p.length>t+1?d.push({polygons:h,bounds:e,depth:t+1}):s(h,e)}if(f.length){const e=[new y(0===r?u:n.x,1===r?u:n.y),a];p.length>t+1?d.push({polygons:f,bounds:e,depth:t+1}):s(f,e)}}return a}(e,t,Math.ceil((o-i)/11.25),Math.ceil((a-s)/11.25),1,((e,t,i)=>{if(0===e)return.5*(t+i);{const e=Xl((r.y+t/ls)/n);return(Wl(.5*(Xl((r.y+i/ls)/n)+e))*n-r.y)*ls}}))}Ki(tp,"FillExtrusionBucket",{omit:["layers","features"]}),Ki(ep,"PartMetadata");const up=new Po({"fill-extrusion-edge-radius":new Lo(tt["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var pp={paint:new Po({"fill-extrusion-opacity":new Lo(tt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new zo(tt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Lo(tt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Lo(tt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new zo(tt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new zo(tt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new zo(tt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Lo(tt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new Lo(tt["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new Lo(tt["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new Lo(tt["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:up};function hp(e,t,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[e*n-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}class dp{constructor(e,t,r){this.z=e,this.x=t,this.y=r,this.key=gp(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t){const r=function(e,t,r){var n=hp(256*e,256*(t=Math.pow(2,r)-t-1),r),i=hp(256*(e+1),256*(t+1),r);return n[0]+","+n[1]+","+i[0]+","+i[1]}(this.x,this.y,this.z),n=function(e,t,r){let n,i="";for(let o=e;o>0;o--)n=1<<o-1,i+=(t&n?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",r)}toString(){return`${this.z}/${this.x}/${this.y}`}}class fp{constructor(e,t){this.wrap=e,this.canonical=t,this.key=gp(e,t.z,t.z,t.x,t.y)}}class mp{constructor(e,t,r,n,i){this.overscaledZ=e,this.wrap=t,this.canonical=new dp(r,+n,+i),this.key=0===t&&e===r?this.canonical.key:gp(t,e,r,n,i)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const t=this.canonical.z-e;return e>this.canonical.z?new mp(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new mp(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t=!0){if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return gp(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);{const r=this.canonical.z-e;return gp(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new mp(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new mp(t,this.wrap,t,r,n),new mp(t,this.wrap,t,r+1,n),new mp(t,this.wrap,t,r,n+1),new mp(t,this.wrap,t,r+1,n+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new mp(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new mp(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new fp(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function gp(e,t,r,n,i){const o=1<<Math.min(r,22);let a=o*(i%o)+n%o;return e&&r<22&&(a+=o*o*((e<0?-2*e-1:2*e)%(1<<2*(22-r)))),16*(32*a+r)+(t-r)}Ki(dp,"CanonicalTileID"),Ki(mp,"OverscaledTileID",{omit:["projMatrix"]});class bp extends y{constructor(e,t,r){super(e,t),this.z=r}}function _p(e,t){return e.x*t.x+e.y*t.y}function yp(e,t){if(1===e.length){let r=0;const n=t[r++];let i;for(;!i||n.equals(i);)if(i=t[r++],!i)return 1/0;for(;r<t.length;r++){const o=t[r],a=e[0],s=i.sub(n),l=o.sub(n),c=a.sub(n),u=_p(s,s),p=_p(s,l),h=_p(l,l),d=_p(c,s),f=_p(c,l),m=u*h-p*p,g=(h*d-p*f)/m,b=(u*f-p*d)/m,_=n.z*(1-g-b)+i.z*g+o.z*b;if(isFinite(_))return _}return 1/0}{let e=1/0;for(const r of t)e=Math.min(e,r.z);return e}}function vp(e,t,r,n,i,o,a,s){const l=a*i.getElevationAt(e,t,!0,!0),c=0!==o[0],u=c?0===o[1]?a*(o[0]/7-450):a*function(e,t,r){const n=Math.floor(t[0]/8),i=Math.floor(t[1]/8),o=10*(t[0]-8*n),a=10*(t[1]-8*i),s=e.getElevationAt(n,i,!0,!0),l=e.getMeterToDEM(r),c=Math.floor(.5*(o*l-1)),u=Math.floor(.5*(a*l-1)),p=e.tileCoordToPixel(n,i),h=2*c+1,d=2*u+1,f=function(e,t,r,n,i){return[e.getElevationAtPixel(t,r,!0),e.getElevationAtPixel(t+i,r,!0),e.getElevationAtPixel(t,r+i,!0),e.getElevationAtPixel(t+n,r+i,!0)]}(e,p.x-c,p.y-u,h,d),m=Math.abs(f[0]-f[1]),g=Math.abs(f[2]-f[3]),b=Math.abs(f[0]-f[2])+Math.abs(f[1]-f[3]),_=Math.min(.25,.5*l*(m+g)/h),y=Math.min(.25,.5*l*b/d);return s+Math.max(_*o,y*a)}(i,o,s):l;return{base:l+(0===r)?-1:r,top:c?Math.max(u+n,l+r+2):l+n}}const xp=No([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:wp}=xp,kp=No([{name:"a_packed",components:4,type:"Float32"}]),{members:Ep}=kp,Tp=Zu.types,Sp=Math.cos(Math.PI/180*37.5);class Cp{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Go,this.layoutVertexArray2=new Wo,this.indexArray=new ia,this.programConfigurations=new Ya(e.layers,e.zoom),this.segments=new ss,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r,n){this.hasPattern=Su("line",this.layers,t);const i=this.layers[0].layout.get("line-sort-key"),o=[];for(const{feature:t,id:a,index:s,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=lc(t,e);if(!this.layers[0]._featureFilter.filter(new ko(this.zoom),c,r))continue;const u=i?i.evaluate(c,{},r):void 0,p={id:a,properties:t.properties,type:t.type,sourceLayerIndex:l,index:s,geometry:e?c.geometry:sc(t,r,n),patterns:{},sortKey:u};o.push(p)}i&&o.sort(((e,t)=>e.sortKey-t.sortKey));const{lineAtlas:a,featureIndex:s}=t,l=this.addConstantDashes(a);for(const n of o){const{geometry:i,index:o,sourceLayerIndex:c}=n;if(l&&this.addFeatureDashes(n,a),this.hasPattern){const e=Cu("line",this.layers,n,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(n,i,o,r,a.positions,t.availableImages);s.insert(e[o].feature,i,o,c,this.index)}}addConstantDashes(e){let t=!1;for(const r of this.layers){const n=r.paint.get("line-dasharray").value,i=r.layout.get("line-cap").value;if("constant"!==n.kind||"constant"!==i.kind)t=!0;else{const t=i.value,r=n.value;if(!r)continue;e.addDash(r,t)}}return t}addFeatureDashes(e,t){const r=this.zoom;for(const n of this.layers){const i=n.paint.get("line-dasharray").value,o=n.layout.get("line-cap").value;if("constant"===i.kind&&"constant"===o.kind)continue;let a,s;if("constant"===i.kind){if(a=i.value,!a)continue}else a=i.evaluate({zoom:r},e);s="constant"===o.kind?o.value:o.evaluate({zoom:r},e),t.addDash(a,s),e.patterns[n.id]=t.getKey(a,s)}}update(e,t,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r,n)}addFeatures(e,t,r,n,i){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Ep)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,wp),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,r,n,i,o){const a=this.layers[0].layout,s=a.get("line-join").evaluate(e,{}),l=a.get("line-cap").evaluate(e,{}),c=a.get("line-miter-limit"),u=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const r of t)this.addLine(r,e,s,l,c,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,o,n)}addLine(e,t,r,n,i,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const a="Polygon"===Tp[t.type];let s=e.length;for(;s>=2&&e[s-1].equals(e[s-2]);)s--;let l=0;for(;l<s-1&&e[l].equals(e[l+1]);)l++;if(s<(a?3:2))return;"bevel"===r&&(i=1.05);const c=this.overscaling<=16?15*ls/(512*this.overscaling):0,u=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray);let p,h,d,f,m;this.e1=this.e2=-1,a&&(p=e[s-2],m=e[l].sub(p)._unit()._perp());for(let t=l;t<s;t++){if(d=t===s-1?a?e[l+1]:void 0:e[t+1],d&&e[t].equals(d))continue;m&&(f=m),p&&(h=p),p=e[t],m=d?d.sub(p)._unit()._perp():f,f=f||m;let g=f.add(m);0===g.x&&0===g.y||g._unit();const b=f.x*m.x+f.y*m.y,_=g.x*m.x+g.y*m.y,y=0!==_?1/_:1/0,v=2*Math.sqrt(2-2*_),x=_<Sp&&h&&d,w=f.x*m.y-f.y*m.x>0;if(x&&t>l){const e=p.dist(h);if(e>2*c){const t=p.sub(p.sub(h)._mult(c/e)._round());this.updateDistance(h,t),this.addCurrentVertex(t,f,0,0,u),h=t}}const k=h&&d;let E=k?r:a?"butt":n;if(k&&"round"===E&&(y<o?E="miter":y<=2&&(E="fakeround")),"miter"===E&&y>i&&(E="bevel"),"bevel"===E&&(y>2&&(E="flipbevel"),y<i&&(E="miter")),h&&this.updateDistance(h,p),"miter"===E)g._mult(y),this.addCurrentVertex(p,g,0,0,u);else if("flipbevel"===E){if(y>100)g=m.mult(-1);else{const e=y*f.add(m).mag()/f.sub(m).mag();g._perp()._mult(e*(w?-1:1))}this.addCurrentVertex(p,g,0,0,u),this.addCurrentVertex(p,g.mult(-1),0,0,u)}else if("bevel"===E||"fakeround"===E){const e=-Math.sqrt(y*y-1),t=w?e:0,r=w?0:e;if(h&&this.addCurrentVertex(p,f,t,r,u),"fakeround"===E){const e=Math.round(180*v/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;if(.5!==r){const e=r-.5;r+=r*e*(r-1)*((1.0904+b*(b*(3.55645-1.43519*b)-3.2452))*e*e+(.848013+b*(.215638*b-1.06021)))}const n=m.sub(f)._mult(r)._add(f)._unit()._mult(w?-1:1);this.addHalfVertex(p,n.x,n.y,!1,w,0,u)}}d&&this.addCurrentVertex(p,m,-t,-r,u)}else if("butt"===E)this.addCurrentVertex(p,g,0,0,u);else if("square"===E){const e=h?1:-1;h||this.addCurrentVertex(p,g,e,e,u),this.addCurrentVertex(p,g,0,0,u),h&&this.addCurrentVertex(p,g,e,e,u)}else"round"===E&&(h&&(this.addCurrentVertex(p,f,0,0,u),this.addCurrentVertex(p,f,1,1,u,!0)),d&&(this.addCurrentVertex(p,m,-1,-1,u,!0),this.addCurrentVertex(p,m,0,0,u)));if(x&&t<s-1){const e=p.dist(d);if(e>2*c){const t=p.add(d.sub(p)._mult(c/e)._round());this.updateDistance(p,t),this.addCurrentVertex(t,m,0,0,u),p=t}}}}addCurrentVertex(e,t,r,n,i,o=!1){const a=t.y*n-t.x,s=-t.y-t.x*n;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,o,!1,r,i),this.addHalfVertex(e,a,s,o,!0,-n,i)}addHalfVertex({x:e,y:t},r,n,i,o,a,s){this.layoutVertexArray.emplaceBack((e<<1)+(i?1:0),(t<<1)+(o?1:0),Math.round(63*r)+128,Math.round(63*n)+128,1+(0===a?0:a<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const l=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),s.primitiveLength++),o?this.e2=l:this.e1=l}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}Ki(Cp,"LineBucket",{omit:["layers","patternFeatures"]});const Ap=new Po({"line-cap":new zo(tt.layout_line["line-cap"]),"line-join":new zo(tt.layout_line["line-join"]),"line-miter-limit":new Lo(tt.layout_line["line-miter-limit"]),"line-round-limit":new Lo(tt.layout_line["line-round-limit"]),"line-sort-key":new zo(tt.layout_line["line-sort-key"])});var Mp={paint:new Po({"line-opacity":new zo(tt.paint_line["line-opacity"]),"line-color":new zo(tt.paint_line["line-color"]),"line-translate":new Lo(tt.paint_line["line-translate"]),"line-translate-anchor":new Lo(tt.paint_line["line-translate-anchor"]),"line-width":new zo(tt.paint_line["line-width"]),"line-gap-width":new zo(tt.paint_line["line-gap-width"]),"line-offset":new zo(tt.paint_line["line-offset"]),"line-blur":new zo(tt.paint_line["line-blur"]),"line-dasharray":new zo(tt.paint_line["line-dasharray"]),"line-pattern":new zo(tt.paint_line["line-pattern"]),"line-gradient":new Do(tt.paint_line["line-gradient"]),"line-trim-offset":new Lo(tt.paint_line["line-trim-offset"])}),layout:Ap};const Ip=new class extends zo{possiblyEvaluate(e,t){return t=new ko(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,n){return t=z({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,n)}}(Mp.paint.properties["line-width"].specification);function Op(e,t){return t>0?t+2*e:e}Ip.useIntegerZoom=!0;const Lp=No([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),zp=No([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),Dp=No([{name:"a_projected_pos",components:4,type:"Float32"}],4);No([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Pp=No([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Rp=No([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);No([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Bp=No([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Fp=No([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);No([{name:"triangle",components:3,type:"Uint16"}]),No([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),No([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),No([{type:"Float32",name:"offsetX"}]),No([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var jp=24;const Np=128;function Up(e,t){const{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new ko(e+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:n}=r;let i=0;for(;i<t.length&&t[i]<=e;)i++;i=Math.max(0,i-1);let o=i;for(;o<t.length&&t[o]<e+1;)o++;o=Math.min(t.length-1,o);const a=t[i],s=t[o];return"composite"===r.kind?{kind:"composite",minZoom:a,maxZoom:s,interpolationType:n}:{kind:"camera",minZoom:a,maxZoom:s,minSize:r.evaluate(new ko(a)),maxSize:r.evaluate(new ko(s)),interpolationType:n}}}function Vp(e,{uSize:t,uSizeT:r},{lowerSize:n,upperSize:i}){return"source"===e.kind?n/Np:"composite"===e.kind?Lr(n/Np,i/Np,r):t}function qp(e,t){let r=0,n=0;if("constant"===e.kind)n=e.layoutSize;else if("source"!==e.kind){const{interpolationType:i,minZoom:o,maxZoom:a}=e,s=i?A(en.interpolationFactor(i,t,o,a),0,1):0;"camera"===e.kind?n=Lr(e.minSize,e.maxSize,s):r=s}return{uSizeT:r,uSize:n}}var $p=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:Np,evaluateSizeForFeature:Vp,evaluateSizeForZoom:qp,getSizeData:Up});function Gp(e,t,r){return e.sections.forEach((e=>{e.text=function(e,t,r){const n=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),wo.applyArabicShaping&&(e=wo.applyArabicShaping(e)),e}(e.text,t,r)})),e}const Wp={"!":"︕","#":"＃",$:"＄","%":"％","&":"＆","(":"︵",")":"︶","*":"＊","+":"＋",",":"︐","-":"︲",".":"・","/":"／",":":"︓",";":"︔","<":"︿","=":"＝",">":"﹀","?":"︖","@":"＠","[":"﹇","\\":"＼","]":"﹈","^":"＾",_:"︳","`":"｀","{":"︷","|":"―","}":"︸","~":"～","¢":"￠","£":"￡","¥":"￥","¦":"￤","¬":"￢","¯":"￣","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"￦","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","！":"︕","（":"︵","）":"︶","，":"︐","－":"︲","．":"・","：":"︓","；":"︔","＜":"︿","＞":"﹀","？":"︖","［":"﹇","］":"﹈","＿":"︳","｛":"︷","｜":"―","｝":"︸","｟":"︵","｠":"︶","｡":"︒","｢":"﹁","｣":"﹂","←":"↑","→":"↓"};function Hp(e){return"︶"===e||"﹈"===e||"︸"===e||"﹄"===e||"﹂"===e||"︾"===e||"︼"===e||"︺"===e||"︘"===e||"﹀"===e||"︐"===e||"︓"===e||"︔"===e||"｀"===e||"￣"===e||"︑"===e||"︒"===e}function Zp(e){return"︵"===e||"﹇"===e||"︷"===e||"﹃"===e||"﹁"===e||"︽"===e||"︻"===e||"︹"===e||"︗"===e||"︿"===e}var Xp=Jp,Kp=function(e,t,r,n,i){var o,a,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,p=r?i-1:0,h=r?-1:1,d=e[t+p];for(p+=h,o=d&(1<<-u)-1,d>>=-u,u+=s;u>0;o=256*o+e[t+p],p+=h,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+e[t+p],p+=h,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=c}return(d?-1:1)*a*Math.pow(2,o-n)},Yp=function(e,t,r,n,i,o){var a,s,l,c=8*o-i-1,u=(1<<c)-1,p=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+p>=1?h/l:h*Math.pow(2,1-p))*l>=2&&(a++,l/=2),a+p>=u?(s=0,a=u):a+p>=1?(s=(t*l-1)*Math.pow(2,i),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=f,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+d]=255&a,d+=f,a/=256,c-=8);e[r+d-f]|=128*m};function Jp(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Jp.Varint=0,Jp.Fixed64=1,Jp.Bytes=2,Jp.Fixed32=5;var Qp=4294967296,eh=1/Qp,th="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function rh(e){return e.type===Jp.Bytes?e.readVarint()+e.pos:e.pos+1}function nh(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function ih(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function oh(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function ah(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function sh(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function lh(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function ch(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function uh(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function ph(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function hh(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function dh(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function fh(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function mh(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function gh(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}Jp.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,e(i,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=fh(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=gh(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=fh(this.buf,this.pos)+fh(this.buf,this.pos+4)*Qp;return this.pos+=8,e},readSFixed64:function(){var e=fh(this.buf,this.pos)+gh(this.buf,this.pos+4)*Qp;return this.pos+=8,e},readFloat:function(){var e=Kp(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Kp(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return nh(e,n,t);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return nh(e,n,t);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return nh(e,n,t);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return nh(e,n,t);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return nh(e,n,t);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return nh(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&th?function(e,t,r){return th.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){for(var n="",i=t;i<r;){var o,a,s,l=e[i],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(o=e[i+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(a=e[i+2],128==(192&(o=e[i+1]))&&128==(192&a)&&((c=(15&l)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=e[i+2],s=e[i+3],128==(192&(o=e[i+1]))&&128==(192&a)&&128==(192&s)&&((c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Jp.Bytes)return e.push(this.readVarint(t));var r=rh(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==Jp.Bytes)return e.push(this.readSVarint());var t=rh(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Jp.Bytes)return e.push(this.readBoolean());var t=rh(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Jp.Bytes)return e.push(this.readFloat());var t=rh(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Jp.Bytes)return e.push(this.readDouble());var t=rh(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Jp.Bytes)return e.push(this.readFixed32());var t=rh(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Jp.Bytes)return e.push(this.readSFixed32());var t=rh(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Jp.Bytes)return e.push(this.readFixed64());var t=rh(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Jp.Bytes)return e.push(this.readSFixed64());var t=rh(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===Jp.Varint)for(;this.buf[this.pos++]>127;);else if(t===Jp.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Jp.Fixed32)this.pos+=4;else{if(t!==Jp.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),mh(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),mh(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),mh(this.buf,-1&e,this.pos),mh(this.buf,Math.floor(e*eh),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),mh(this.buf,-1&e,this.pos),mh(this.buf,Math.floor(e*eh),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,r.buf[r.pos]=127&(e>>>=7)}(r,0,t),function(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,i,o=0;o<t.length;o++){if((n=t.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&ih(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Yp(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Yp(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&ih(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,Jp.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,oh,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,ah,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,ch,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,sh,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,lh,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,uh,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,ph,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,hh,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,dh,t)},writeBytesField:function(e,t){this.writeTag(e,Jp.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Jp.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Jp.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Jp.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Jp.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Jp.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Jp.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Jp.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Jp.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Jp.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var bh=d(Xp);const _h=3;function yh(e,t,r){t.glyphs=[],1===e&&r.readMessage(vh,t)}function vh(e,t,r){if(3===e){const{id:e,bitmap:n,width:i,height:o,left:a,top:s,advance:l}=r.readMessage(xh,{});t.glyphs.push({id:e,bitmap:new jc({width:i+2*_h,height:o+2*_h},n),metrics:{width:i,height:o,left:a,top:s,advance:l}})}else 4===e?t.ascender=r.readSVarint():5===e&&(t.descender=r.readSVarint())}function xh(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}const wh=_h;function kh(e){let t=0,r=0;for(const n of e)t+=n.w*n.h,r=Math.max(r,n.w);e.sort(((e,t)=>t.h-e.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let i=0,o=0;for(const t of e)for(let e=n.length-1;e>=0;e--){const r=n[e];if(!(t.w>r.w||t.h>r.h)){if(t.x=r.x,t.y=r.y,o=Math.max(o,t.y+t.h),i=Math.max(i,t.x+t.w),t.w===r.w&&t.h===r.h){const t=n.pop();e<n.length&&(n[e]=t)}else t.h===r.h?(r.x+=t.w,r.w-=t.w):t.w===r.w?(r.y+=t.h,r.h-=t.h):(n.push({x:r.x+t.w,y:r.y,w:r.w-t.w,h:t.h}),r.y+=t.h,r.h-=t.h);break}}return{w:i,h:o,fill:t/(i*o)||0}}const Eh=1;class Th{constructor(e,{pixelRatio:t,version:r,stretchX:n,stretchY:i,content:o}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=n,this.stretchY=i,this.content=o,this.version=r}get tl(){return[this.paddedRect.x+Eh,this.paddedRect.y+Eh]}get br(){return[this.paddedRect.x+this.paddedRect.w-Eh,this.paddedRect.y+this.paddedRect.h-Eh]}get displaySize(){return[(this.paddedRect.w-2*Eh)/this.pixelRatio,(this.paddedRect.h-2*Eh)/this.pixelRatio]}}class Sh{constructor(e,t){const r={},n={};this.haveRenderCallbacks=[];const i=[];this.addImages(e,r,i),this.addImages(t,n,i);const{w:o,h:a}=kh(i),s=new Nc({width:o||1,height:a||1});for(const t in e){const n=e[t],i=r[t].paddedRect;Nc.copy(n.data,s,{x:0,y:0},{x:i.x+Eh,y:i.y+Eh},n.data)}for(const e in t){const r=t[e],i=n[e].paddedRect,o=i.x+Eh,a=i.y+Eh,l=r.data.width,c=r.data.height;Nc.copy(r.data,s,{x:0,y:0},{x:o,y:a},r.data),Nc.copy(r.data,s,{x:0,y:c-1},{x:o,y:a-1},{width:l,height:1}),Nc.copy(r.data,s,{x:0,y:0},{x:o,y:a+c},{width:l,height:1}),Nc.copy(r.data,s,{x:l-1,y:0},{x:o-1,y:a},{width:1,height:c}),Nc.copy(r.data,s,{x:0,y:0},{x:o+l,y:a},{width:1,height:c})}this.image=s,this.iconPositions=r,this.patternPositions=n}addImages(e,t,r){for(const n in e){const i=e[n],o={x:0,y:0,w:i.data.width+2*Eh,h:i.data.height+2*Eh};r.push(o),t[n]=new Th(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(e,t){this.haveRenderCallbacks=this.haveRenderCallbacks.filter((t=>e.hasImage(t))),e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const r in e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}patchUpdatedImage(e,t,r){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[n,i]=e.tl;r.update(t.data,void 0,{x:n,y:i})}}Ki(Th,"ImagePosition"),Ki(Sh,"ImageAtlas");const Ch={horizontal:1,vertical:2,horizontalOnly:3},Ah=-17;class Mh{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,t){const r=new Mh;return r.scale=e||1,r.fontStack=t,r}static forImage(e){const t=new Mh;return t.imageName=e,t}}class Ih{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){const r=new Ih;for(let n=0;n<e.sections.length;n++){const i=e.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,t)}return r}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(e){this.text=function(e,t){let r="";for(let n=0;n<e.length;n++){const i=e.charCodeAt(n+1)||null,o=e.charCodeAt(n-1)||null;r+=!t&&(i&&ao(i)&&!Wp[e[n+1]]||o&&ao(o)&&!Wp[e[n-1]])||!Wp[e[n]]?e[n]:Wp[e[n]]}return r}(this.text,e)}trim(){let e=0;for(let t=0;t<this.text.length&&Lh[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let r=this.text.length-1;r>=0&&r>=e&&Lh[this.text.charCodeAt(r)];r--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const r=new Ih;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(Mh.forText(e.scale,e.fontStack||t));const r=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(r)}addImageSection(e){const t=e.image?e.image.name:"";if(0===t.length)return void G("Can't add FormattedSection with an empty image.");const r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(Mh.forImage(t)),this.sectionIndex.push(this.sections.length-1)):G("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Oh(e,t,r,n,i,o,a,s,l,c,u,p,h,d,f){const m=Ih.fromFeature(e,i);p===Ch.vertical&&m.verticalizePunctuation(h);let g=[];const b=function(e,t,r,n,i,o){if(!e)return[];const a=[],s=function(e,t,r,n,i,o){let a=0;for(let r=0;r<e.length();r++){const s=e.getSection(r);a+=Dh(e.getCharCode(r),s,n,i,t,o)}return a/Math.max(1,Math.ceil(a/r))}(e,t,r,n,i,o),l=e.text.indexOf("​")>=0;let c=0;for(let r=0;r<e.length();r++){const p=e.getSection(r),h=e.getCharCode(r);if(Lh[h]||(c+=Dh(h,p,n,i,t,o)),r<e.length()-1){const t=!((u=h)<11904||!(to["Bopomofo Extended"](u)||to.Bopomofo(u)||to["CJK Compatibility Forms"](u)||to["CJK Compatibility Ideographs"](u)||to["CJK Compatibility"](u)||to["CJK Radicals Supplement"](u)||to["CJK Strokes"](u)||to["CJK Symbols and Punctuation"](u)||to["CJK Unified Ideographs Extension A"](u)||to["CJK Unified Ideographs"](u)||to["Enclosed CJK Letters and Months"](u)||to["Halfwidth and Fullwidth Forms"](u)||to.Hiragana(u)||to["Ideographic Description Characters"](u)||to["Kangxi Radicals"](u)||to["Katakana Phonetic Extensions"](u)||to.Katakana(u)||to["Vertical Forms"](u)||to["Yi Radicals"](u)||to["Yi Syllables"](u)));(zh[h]||t||p.imageName)&&a.push(Bh(r+1,c,s,a,Rh(h,e.getCharCode(r+1),t&&l),!1))}}var u;return Fh(Bh(e.length(),c,s,a,0,!0))}(m,c,o,t,n,d),{processBidirectionalText:_,processStyledBidirectionalText:y}=wo;if(_&&1===m.sections.length){const e=_(m.toString(),b);for(const t of e){const e=new Ih;e.text=t,e.sections=m.sections;for(let r=0;r<t.length;r++)e.sectionIndex.push(0);g.push(e)}}else if(y){const e=y(m.text,m.sectionIndex,b);for(const t of e){const e=new Ih;e.text=t[0],e.sectionIndex=t[1],e.sections=m.sections,g.push(e)}}else g=function(e,t){const r=[],n=e.text;let i=0;for(const n of t)r.push(e.substring(i,n)),i=n;return i<n.length&&r.push(e.substring(i,n.length)),r}(m,b);const v=[],x={positionedLines:v,text:m.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:p,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(e,t,r,n,i,o,a,s,l,c,u,p){let h=0,d=0,f=0;const m="right"===s?1:"left"===s?0:.5;let g=!1;for(const e of i){const r=e.getSections();for(const e of r){if(e.imageName)continue;const r=t[e.fontStack];if(r&&(g=void 0!==r.ascender&&void 0!==r.descender,!g))break}if(!g)break}let b=0;for(const a of i){a.trim();const i=a.getMaxScale(),s=(i-1)*jp,y={positionedGlyphs:[],lineOffset:0};e.positionedLines[b]=y;const v=y.positionedGlyphs;let x=0;if(!a.length()){d+=o,++b;continue}let w=0,k=0;for(let o=0;o<a.length();o++){const s=a.getSection(o),f=a.getSectionIndex(o),m=a.getCharCode(o);let b=s.scale,y=null,E=null,T=null,S=jp,C=0;const A=!(l===Ch.horizontal||!u&&!oo(m)||u&&(Lh[m]||(_=m,to.Arabic(_)||to["Arabic Supplement"](_)||to["Arabic Extended-A"](_)||to["Arabic Presentation Forms-A"](_)||to["Arabic Presentation Forms-B"](_))));if(s.imageName){const t=n[s.imageName];if(!t)continue;T=s.imageName,e.iconsInText=e.iconsInText||!0,E=t.paddedRect;const r=t.displaySize;b=b*jp/p,y={width:r[0],height:r[1],left:Eh,top:-wh,advance:A?r[1]:r[0],localGlyph:!1},C=g?-y.height*b:Ah+i*jp-r[1]*b,S=y.advance;const o=(A?r[0]:r[1])*b-jp*i;o>0&&o>x&&(x=o)}else{const e=r[s.fontStack];if(!e)continue;e[m]&&(E=e[m]);const n=t[s.fontStack];if(!n)continue;const o=n.glyphs[m];if(!o)continue;if(y=o.metrics,S=8203!==m?jp:0,g){const e=void 0!==n.ascender?Math.abs(n.ascender):0,t=void 0!==n.descender?Math.abs(n.descender):0,r=(e+t)*b;w<r&&(w=r,k=(e-t)/2*b),C=-e*b}else C=Ah+(i-b)*jp}A?(e.verticalizable=!0,v.push({glyph:m,imageName:T,x:h,y:d+C,vertical:A,scale:b,localGlyph:y.localGlyph,fontStack:s.fontStack,sectionIndex:f,metrics:y,rect:E}),h+=S*b+c):(v.push({glyph:m,imageName:T,x:h,y:d+C,vertical:A,scale:b,localGlyph:y.localGlyph,fontStack:s.fontStack,sectionIndex:f,metrics:y,rect:E}),h+=y.advance*b+c)}0!==v.length&&(f=Math.max(h-c,f),g?Nh(v,m,x,k,o*i/2):Nh(v,m,x,0,o/2)),h=0;const E=o*i+x;y.lineOffset=Math.max(x,s),d+=E,++b}var _;const y=d,{horizontalAlign:v,verticalAlign:x}=jh(a);(function(e,t,r,n,i,o){const a=(t-r)*i,s=-o*n;for(const t of e)for(const e of t.positionedGlyphs)e.x+=a,e.y+=s})(e.positionedLines,m,v,x,f,y),e.top+=-x*y,e.bottom=e.top+y,e.left+=-v*f,e.right=e.left+f,e.hasBaseline=g}(x,t,r,n,g,a,s,l,p,c,h,f),!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(v)&&x}const Lh={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},zh={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Dh(e,t,r,n,i,o){if(t.imageName){const e=n[t.imageName];return e?e.displaySize[0]*t.scale*jp/o+i:0}{const n=r[t.fontStack],o=n&&n.glyphs[e];return o?o.metrics.advance*t.scale+i:0}}function Ph(e,t,r,n){const i=Math.pow(e-t,2);return n?e<t?i/2:2*i:i+Math.abs(r)*r}function Rh(e,t,r){let n=0;return 10===e&&(n-=1e4),r&&(n+=150),40!==e&&65288!==e||(n+=50),41!==t&&65289!==t||(n+=50),n}function Bh(e,t,r,n,i,o){let a=null,s=Ph(t,r,i,o);for(const e of n){const n=Ph(t-e.x,r,i,o)+e.badness;n<=s&&(a=e,s=n)}return{index:e,x:t,priorBreak:a,badness:s}}function Fh(e){return e?Fh(e.priorBreak).concat(e.index):[]}function jh(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Nh(e,t,r,n,i){if(!(t||r||n||i))return;const o=e.length-1,a=e[o],s=(a.x+a.metrics.advance*a.scale)*t;for(let t=0;t<=o;t++)e[t].x-=s,e[t].y+=r+n+i}function Uh(e,t,r){const{horizontalAlign:n,verticalAlign:i}=jh(r),o=t[0]-e.displaySize[0]*n,a=t[1]-e.displaySize[1]*i;return{image:e,top:a,bottom:a+e.displaySize[1],left:o,right:o+e.displaySize[0]}}function Vh(e,t,r,n,i,o){const a=e.image;let s;if(a.content){const e=a.content,t=a.pixelRatio||1;s=[e[0]/t,e[1]/t,a.displaySize[0]-e[2]/t,a.displaySize[1]-e[3]/t]}const l=t.left*o,c=t.right*o;let u,p,h,d;"width"===r||"both"===r?(d=i[0]+l-n[3],p=i[0]+c+n[1]):(d=i[0]+(l+c-a.displaySize[0])/2,p=d+a.displaySize[0]);const f=t.top*o,m=t.bottom*o;return"height"===r||"both"===r?(u=i[1]+f-n[0],h=i[1]+m+n[2]):(u=i[1]+(f+m-a.displaySize[1])/2,h=u+a.displaySize[1]),{image:a,top:u,right:p,bottom:h,left:d,collisionPadding:s}}class qh extends y{constructor(e,t,r,n,i){super(e,t),this.angle=n,this.z=r,void 0!==i&&(this.segment=i)}clone(){return new qh(this.x,this.y,this.z,this.angle,this.segment)}}function $h(e,t,r,n,i){if(void 0===t.segment)return!0;let o=t,a=t.segment+1,s=0;for(;s>-r/2;){if(a--,a<0)return!1;s-=e[a].dist(o),o=e[a]}s+=e[a].dist(e[a+1]),a++;const l=[];let c=0;for(;s<r/2;){const t=e[a],r=e[a+1];if(!r)return!1;let o=e[a-1].angleTo(t)-t.angleTo(r);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:o}),c+=o;s-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;a++,s+=t.dist(r)}return!0}function Gh(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Wh(e,t,r){return e?.6*t*r:0}function Hh(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Zh(e,t,r,n,i,o){const a=Wh(r,i,o),s=Hh(r,n)*o;let l=0;const c=Gh(e)/2;for(let r=0;r<e.length-1;r++){const n=e[r],i=e[r+1],o=n.dist(i);if(l+o>c){const u=(c-l)/o,p=Lr(n.x,i.x,u),h=Lr(n.y,i.y,u),d=new qh(p,h,0,i.angleTo(n),r);return!a||$h(e,d,s,a,t)?d:void 0}l+=o}}function Xh(e,t,r,n,i,o,a,s,l){const c=Wh(n,o,a),u=Hh(n,i),p=u*a,h=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-p<t/4&&(t=p+t/4),Kh(e,h?t/2*s%t:(u/2+2*o)*a*s%t,t,c,r,p,h,!1,l)}function Kh(e,t,r,n,i,o,a,s,l){const c=o/2,u=Gh(e);let p=0,h=t-r,d=[];for(let t=0;t<e.length-1;t++){const a=e[t],s=e[t+1],f=a.dist(s),m=s.angleTo(a);for(;h+r<p+f;){h+=r;const g=(h-p)/f,b=Lr(a.x,s.x,g),_=Lr(a.y,s.y,g);if(b>=0&&b<l&&_>=0&&_<l&&h-c>=0&&h+c<=u){const r=new qh(b,_,0,m,t);r._round(),n&&!$h(e,r,o,n,i)||d.push(r)}}p+=f}return s||d.length||a||(d=Kh(e,p/2,r,n,i,o,a,!0,l)),d}function Yh(e,t,r,n,i){const o=[];for(let a=0;a<e.length;a++){const s=e[a];let l;for(let e=0;e<s.length-1;e++){let a=s[e],c=s[e+1];a.x<t&&c.x<t||(a.x<t?a=new y(t,a.y+(t-a.x)/(c.x-a.x)*(c.y-a.y))._round():c.x<t&&(c=new y(t,a.y+(t-a.x)/(c.x-a.x)*(c.y-a.y))._round()),a.y<r&&c.y<r||(a.y<r?a=new y(a.x+(r-a.y)/(c.y-a.y)*(c.x-a.x),r)._round():c.y<r&&(c=new y(a.x+(r-a.y)/(c.y-a.y)*(c.x-a.x),r)._round()),a.x>=n&&c.x>=n||(a.x>=n?a=new y(n,a.y+(n-a.x)/(c.x-a.x)*(c.y-a.y))._round():c.x>=n&&(c=new y(n,a.y+(n-a.x)/(c.x-a.x)*(c.y-a.y))._round()),a.y>=i&&c.y>=i||(a.y>=i?a=new y(a.x+(i-a.y)/(c.y-a.y)*(c.x-a.x),i)._round():c.y>=i&&(c=new y(a.x+(i-a.y)/(c.y-a.y)*(c.x-a.x),i)._round()),l&&a.equals(l[l.length-1])||(l=[a],o.push(l)),l.push(c)))))}}return o}Ki(qh,"Anchor");const Jh=1e20;function Qh(e,t,r,n,i,o,a,s,l){for(let c=t;c<t+n;c++)ed(e,r*o+c,o,i,a,s,l);for(let c=r;c<r+i;c++)ed(e,c*o+t,1,n,a,s,l)}function ed(e,t,r,n,i,o,a){o[0]=0,a[0]=-Jh,a[1]=Jh,i[0]=e[t];for(let s=1,l=0,c=0;s<n;s++){i[s]=e[t+s*r];const n=s*s;do{const e=o[l];c=(i[s]-i[e]+n-e*e)/(s-e)/2}while(c<=a[l]&&--l>-1);l++,o[l]=s,a[l]=c,a[l+1]=Jh}for(let s=0,l=0;s<n;s++){for(;a[l+1]<s;)l++;const n=o[l],c=s-n;e[t+s*r]=i[n]+c*c}}const td=2,rd={none:0,ideographs:1,all:2};class nd{constructor(e,t,r){this.requestManager=e,this.localGlyphMode=t,this.localFontFamily=r,this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e){this.url=e}getGlyphs(e,t){const r=[];for(const t in e)for(const n of e[t])r.push({stack:t,id:n});O(r,(({stack:e,id:t},r)=>{let n=this.entries[e];n||(n=this.entries[e]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let i=n.glyphs[t];if(void 0!==i)return void r(null,{stack:e,id:t,glyph:i});if(i=this._tinySDF(n,e,t),i)return n.glyphs[t]=i,void r(null,{stack:e,id:t,glyph:i});const o=Math.floor(t/256);if(256*o>65535)return void r(new Error("glyphs > 65535 not supported"));if(n.ranges[o])return void r(null,{stack:e,id:t,glyph:i});let a=n.requests[o];a||(a=n.requests[o]=[],nd.loadGlyphRange(e,o,this.url,this.requestManager,((e,t)=>{if(t){n.ascender=t.ascender,n.descender=t.descender;for(const e in t.glyphs)this._doesCharSupportLocalGlyph(+e)||(n.glyphs[+e]=t.glyphs[+e]);n.ranges[o]=!0}for(const r of a)r(e,t);delete n.requests[o]}))),a.push(((n,i)=>{n?r(n):i&&r(null,{stack:e,id:t,glyph:i.glyphs[t]||null})}))}),((e,r)=>{if(e)t(e);else if(r){const e={};for(const{stack:t,id:n,glyph:i}of r)void 0===e[t]&&(e[t]={}),void 0===e[t].glyphs&&(e[t].glyphs={}),e[t].glyphs[n]=i&&{id:i.id,bitmap:i.bitmap.clone(),metrics:i.metrics},e[t].ascender=this.entries[t].ascender,e[t].descender=this.entries[t].descender;t(null,e)}}))}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==rd.none&&(this.localGlyphMode===rd.all?!!this.localFontFamily:!!this.localFontFamily&&(to["CJK Unified Ideographs"](e)||to["Hangul Syllables"](e)||to.Hiragana(e)||to.Katakana(e)||to["CJK Symbols and Punctuation"](e)))}_tinySDF(e,t,r){const n=this.localFontFamily;if(!n||!this._doesCharSupportLocalGlyph(r))return;let i=e.tinySDF;if(!i){let r="400";/bold/i.test(t)?r="900":/medium/i.test(t)?r="500":/light/i.test(t)&&(r="200"),i=e.tinySDF=new nd.TinySDF({fontFamily:n,fontWeight:r,fontSize:24*td,buffer:3*td,radius:8*td}),i.fontWeight=r}if(this.localGlyphs[i.fontWeight][r])return this.localGlyphs[i.fontWeight][r];const o=String.fromCharCode(r),{data:a,width:s,height:l,glyphWidth:c,glyphHeight:u,glyphLeft:p,glyphTop:h,glyphAdvance:d}=i.draw(o);return this.localGlyphs[i.fontWeight][r]={id:r,bitmap:new jc({width:s,height:l},a),metrics:{width:c/td,height:u/td,left:p/td,top:h/td-27,advance:d/td,localGlyph:!0}}}}nd.loadGlyphRange=function(e,t,r,n,i){const o=256*t,a=o+255,s=n.transformRequest(n.normalizeGlyphsURL(r).replace("{fontstack}",e).replace("{range}",`${o}-${a}`),ce.Glyphs);de(s,((e,t)=>{if(e)i(e);else if(t){const e={},r=function(e){return new bh(e).readFields(yh,{})}(t);for(const t of r.glyphs)e[t.id]=t;i(null,{glyphs:e,ascender:r.ascender,descender:r.descender})}}))},nd.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:r=8,cutoff:n=.25,fontFamily:i="sans-serif",fontWeight:o="normal",fontStyle:a="normal"}={}){this.buffer=t,this.cutoff=n,this.radius=r;const s=this.size=e+4*t,l=this._createCanvas(s),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${a} ${o} ${e}px ${i}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(e){const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:r,actualBoundingBoxDescent:n,actualBoundingBoxLeft:i,actualBoundingBoxRight:o}=this.ctx.measureText(e),a=Math.ceil(r),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-i))),l=Math.min(this.size-this.buffer,a+Math.ceil(n)),c=s+2*this.buffer,u=l+2*this.buffer,p=Math.max(c*u,0),h=new Uint8ClampedArray(p),d={data:h,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:a,glyphLeft:0,glyphAdvance:t};if(0===s||0===l)return d;const{ctx:f,buffer:m,gridInner:g,gridOuter:b}=this;f.clearRect(m,m,s,l),f.fillText(e,m,m+a);const _=f.getImageData(m,m,s,l);b.fill(Jh,0,p),g.fill(0,0,p);for(let e=0;e<l;e++)for(let t=0;t<s;t++){const r=_.data[4*(e*s+t)+3]/255;if(0===r)continue;const n=(e+m)*c+t+m;if(1===r)b[n]=0,g[n]=Jh;else{const e=.5-r;b[n]=e>0?e*e:0,g[n]=e<0?e*e:0}}Qh(b,0,0,c,u,c,this.f,this.v,this.z),Qh(g,m,m,s,l,c,this.f,this.v,this.z);for(let e=0;e<p;e++){const t=Math.sqrt(b[e])-Math.sqrt(g[e]);h[e]=Math.round(255-255*(t/this.radius+this.cutoff))}return d}};const id=Eh;function od(e,t,r,n){const i=[],o=e.image,a=o.pixelRatio,s=o.paddedRect.w-2*id,l=o.paddedRect.h-2*id,c=e.right-e.left,u=e.bottom-e.top,p=o.stretchX||[[0,s]],h=o.stretchY||[[0,l]],d=(e,t)=>e+t[1]-t[0],f=p.reduce(d,0),m=h.reduce(d,0),g=s-f,b=l-m;let _=0,v=f,x=0,w=m,k=0,E=g,T=0,S=b;if(o.content&&n){const e=o.content;_=ad(p,0,e[0]),x=ad(h,0,e[1]),v=ad(p,e[0],e[2]),w=ad(h,e[1],e[3]),k=e[0]-_,T=e[1]-x,E=e[2]-e[0]-v,S=e[3]-e[1]-w}const C=(n,i,s,l)=>{const p=ld(n.stretch-_,v,c,e.left),h=cd(n.fixed-k,E,n.stretch,f),d=ld(i.stretch-x,w,u,e.top),g=cd(i.fixed-T,S,i.stretch,m),b=ld(s.stretch-_,v,c,e.left),C=cd(s.fixed-k,E,s.stretch,f),A=ld(l.stretch-x,w,u,e.top),M=cd(l.fixed-T,S,l.stretch,m),I=new y(p,d),O=new y(b,d),L=new y(b,A),z=new y(p,A),D=new y(h/a,g/a),P=new y(C/a,M/a),R=t*Math.PI/180;if(R){const e=Math.sin(R),t=Math.cos(R),r=[t,-e,e,t];I._matMult(r),O._matMult(r),z._matMult(r),L._matMult(r)}const B=n.stretch+n.fixed,F=i.stretch+i.fixed;return{tl:I,tr:O,bl:z,br:L,tex:{x:o.paddedRect.x+id+B,y:o.paddedRect.y+id+F,w:s.stretch+s.fixed-B,h:l.stretch+l.fixed-F},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:P,minFontScaleX:E/a/c,minFontScaleY:S/a/u,isSDF:r}};if(n&&(o.stretchX||o.stretchY)){const e=sd(p,g,f),t=sd(h,b,m);for(let r=0;r<e.length-1;r++){const n=e[r],o=e[r+1];for(let e=0;e<t.length-1;e++)i.push(C(n,t[e],o,t[e+1]))}}else i.push(C({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));return i}function ad(e,t,r){let n=0;for(const i of e)n+=Math.max(t,Math.min(r,i[1]))-Math.max(t,Math.min(r,i[0]));return n}function sd(e,t,r){const n=[{fixed:-id,stretch:0}];for(const[t,r]of e){const e=n[n.length-1];n.push({fixed:t-e.stretch,stretch:e.stretch}),n.push({fixed:t-e.stretch,stretch:e.stretch+(r-t)})}return n.push({fixed:t+id,stretch:r}),n}function ld(e,t,r,n){return e/t*r+n}function cd(e,t,r,n){return e-t*r/n}function ud(e,t,r,n){const i=t+e.positionedLines[n].lineOffset;return 0===n?r+i/2:r+(i+(t+e.positionedLines[n-1].lineOffset))/2}class pd{constructor(e=[],t=hd){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const i=e-1>>1,o=t[i];if(r(n,o)>=0)break;t[e]=o,e=i}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e<n;){let n=1+(e<<1),o=t[n];const a=n+1;if(a<this.length&&r(t[a],o)<0&&(n=a,o=t[a]),r(o,i)>=0)break;t[e]=o,e=n}t[e]=i}}function hd(e,t){return e<t?-1:e>t?1:0}function dd(e,t=1,r=!1){let n=1/0,i=1/0,o=-1/0,a=-1/0;const s=e[0];for(let e=0;e<s.length;e++){const t=s[e];(!e||t.x<n)&&(n=t.x),(!e||t.y<i)&&(i=t.y),(!e||t.x>o)&&(o=t.x),(!e||t.y>a)&&(a=t.y)}const l=Math.min(o-n,a-i);let c=l/2;const u=new pd([],fd);if(0===l)return new y(n,i);for(let t=n;t<o;t+=l)for(let r=i;r<a;r+=l)u.push(new md(t+c,r+c,c,e));let p=function(e){let t=0,r=0,n=0;const i=e[0];for(let e=0,o=i.length,a=o-1;e<o;a=e++){const o=i[e],s=i[a],l=o.x*s.y-s.x*o.y;r+=(o.x+s.x)*l,n+=(o.y+s.y)*l,t+=3*l}return new md(r/t,n/t,0,e)}(e),h=u.length;for(;u.length;){const r=u.pop();(r.d>p.d||!p.d)&&(p=r),r.max-p.d<=t||(c=r.h/2,u.push(new md(r.p.x-c,r.p.y-c,c,e)),u.push(new md(r.p.x+c,r.p.y-c,c,e)),u.push(new md(r.p.x-c,r.p.y+c,c,e)),u.push(new md(r.p.x+c,r.p.y+c,c,e)),h+=4)}return p.p}function fd(e,t){return t.max-e.max}class md{constructor(e,t,r,n){this.p=new y(e,t),this.h=r,this.d=function(e,t){let r=!1,n=1/0;for(let i=0;i<t.length;i++){const o=t[i];for(let t=0,i=o.length,a=i-1;t<i;a=t++){const i=o[t],s=o[a];i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(r=!r),n=Math.min(n,yc(e,i,s))}}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}}const gd=7,bd=Number.POSITIVE_INFINITY,_d=Math.sqrt(2);function yd(e,[t,r]){let n=0,i=0;if(r===bd){t<0&&(t=0);const r=t/_d;switch(e){case"top-right":case"top-left":i=r-gd;break;case"bottom-right":case"bottom-left":i=-r+gd;break;case"bottom":i=-t+gd;break;case"top":i=t-gd}switch(e){case"top-right":case"bottom-right":n=-r;break;case"top-left":case"bottom-left":n=r;break;case"left":n=t;break;case"right":n=-t}}else{switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-gd;break;case"bottom-right":case"bottom-left":case"bottom":i=-r+gd}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}}return[n,i]}function vd(e,t,r,n,i,o,a,s,l,c){e.createArrays(),e.tilePixelRatio=ls/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;const u=e.layers[0].layout,p=e.layers[0]._unevaluatedLayout._values,h={};if("composite"===e.textSizeData.kind){const{minZoom:t,maxZoom:r}=e.textSizeData;h.compositeTextSizes=[p["text-size"].possiblyEvaluate(new ko(t),s),p["text-size"].possiblyEvaluate(new ko(r),s)]}if("composite"===e.iconSizeData.kind){const{minZoom:t,maxZoom:r}=e.iconSizeData;h.compositeIconSizes=[p["icon-size"].possiblyEvaluate(new ko(t),s),p["icon-size"].possiblyEvaluate(new ko(r),s)]}h.layoutTextSize=p["text-size"].possiblyEvaluate(new ko(l+1),s),h.layoutIconSize=p["icon-size"].possiblyEvaluate(new ko(l+1),s),h.textMaxSize=p["text-size"].possiblyEvaluate(new ko(18),s);const d="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),f=u.get("text-size");for(const o of e.features){const l=u.get("text-font").evaluate(o,{},s).join(","),p=f.evaluate(o,{},s),m=h.layoutTextSize.evaluate(o,{},s),g=(h.layoutIconSize.evaluate(o,{},s),{horizontal:{},vertical:void 0}),b=o.text;let _,y=[0,0];if(b){const n=b.toString(),a=u.get("text-letter-spacing").evaluate(o,{},s)*jp,c=u.get("text-line-height").evaluate(o,{},s)*jp,h=no(n)?a:0,f=u.get("text-anchor").evaluate(o,{},s),_=u.get("text-variable-anchor");if(!_){const e=u.get("text-radial-offset").evaluate(o,{},s);y=e?yd(f,[e*jp,bd]):u.get("text-offset").evaluate(o,{},s).map((e=>e*jp))}let v=d?"center":u.get("text-justify").evaluate(o,{},s);const x="point"===u.get("symbol-placement"),w=x?u.get("text-max-width").evaluate(o,{},s)*jp:1/0,k=o=>{e.allowVerticalPlacement&&ro(n)&&(g.vertical=Oh(b,t,r,i,l,w,c,f,o,h,y,Ch.vertical,!0,m,p))};if(!d&&_){const e="auto"===v?_.map((e=>xd(e))):[v];let n=!1;for(let o=0;o<e.length;o++){const a=e[o];if(!g.horizontal[a])if(n)g.horizontal[a]=g.horizontal[0];else{const e=Oh(b,t,r,i,l,w,c,"center",a,h,y,Ch.horizontal,!1,m,p);e&&(g.horizontal[a]=e,n=1===e.positionedLines.length)}}k("left")}else{if("auto"===v&&(v=xd(f)),x||u.get("text-writing-mode").indexOf("horizontal")>=0||!ro(n)){const e=Oh(b,t,r,i,l,w,c,f,v,h,y,Ch.horizontal,!1,m,p);e&&(g.horizontal[v]=e)}k(x?"left":v)}}let v=!1;if(o.icon&&o.icon.name){const t=n[o.icon.name];t&&(_=Uh(i[o.icon.name],u.get("icon-offset").evaluate(o,{},s),u.get("icon-anchor").evaluate(o,{},s)),v=t.sdf,void 0===e.sdfIcons?e.sdfIcons=t.sdf:e.sdfIcons!==t.sdf&&G("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0))}const x=Sd(g.horizontal)||g.vertical;e.iconsInText||(e.iconsInText=!!x&&x.iconsInText),(x||_)&&wd(e,o,g,_,n,h,m,0,y,v,a,s,c)}o&&e.generateCollisionDebugBuffers(l,e.collisionBoxArray)}function xd(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function wd(e,t,r,n,i,o,a,s,l,c,u,p,h){let d=o.textMaxSize.evaluate(t,{},p);void 0===d&&(d=a);const f=e.layers[0].layout,m=f.get("icon-offset").evaluate(t,{},p),g=Sd(r.horizontal)||r.vertical,b="globe"===h.name,_=jp,y=a/_,v=e.tilePixelRatio*d/_,x=(I=e.overscaling,e.zoom>18&&I>2&&(I>>=1),Math.max(ls/(512*I),1)*f.get("symbol-spacing")),k=f.get("text-padding")*e.tilePixelRatio,E=f.get("icon-padding")*e.tilePixelRatio,T=w(f.get("text-max-angle")),S="map"===f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),C="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),A=f.get("symbol-placement"),M=x/2;var I;const O=f.get("icon-text-fit");let L;n&&"none"!==O&&(e.allowVerticalPlacement&&r.vertical&&(L=Vh(n,r.vertical,O,f.get("icon-text-fit-padding"),m,y)),g&&(n=Vh(n,g,O,f.get("icon-text-fit-padding"),m,y)));const z=(a,s,d)=>{if(s.x<0||s.x>=ls||s.y<0||s.y>=ls)return;let f=null;if(b){const{x:e,y:t,z:r}=h.projectTilePoint(s.x,s.y,d);f={anchor:new qh(e,t,r,0,void 0),up:h.upVector(d,s.x,s.y)}}!function(e,t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g,b,_,y,v,x,w,k,E){const T=e.addToLineVertexArray(t,n);let S,C,A,M,I,O,L,z=0,D=0,P=0,R=0,B=-1,F=-1;const j={};let N=La("");const U=r?r.anchor:t;let V=0,q=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[V,q]=l.layout.get("text-offset").evaluate(v,{},E).map((e=>e*jp)):(V=l.layout.get("text-radial-offset").evaluate(v,{},E)*jp,q=bd),e.allowVerticalPlacement&&i.vertical){const e=i.vertical;if(f)O=Ad(e),s&&(L=Ad(s));else{const r=l.layout.get("text-rotate").evaluate(v,{},E)+90;A=Cd(c,U,t,u,p,h,e,d,r,m),s&&(M=Cd(c,U,t,u,p,h,s,b,r))}}if(o){const n=l.layout.get("icon-rotate").evaluate(v,{},E),i="none"!==l.layout.get("icon-text-fit"),a=od(o,n,w,i),d=s?od(s,n,w,i):void 0;C=Cd(c,U,t,u,p,h,o,b,n),z=4*a.length;const f=e.iconSizeData;let m=null;"source"===f.kind?(m=[Np*l.layout.get("icon-size").evaluate(v,{},E)],m[0]>Ed&&G(`${e.layerIds[0]}: Value for "icon-size" is >= ${kd}. Reduce your "icon-size".`)):"composite"===f.kind&&(m=[Np*x.compositeIconSizes[0].evaluate(v,{},E),Np*x.compositeIconSizes[1].evaluate(v,{},E)],(m[0]>Ed||m[1]>Ed)&&G(`${e.layerIds[0]}: Value for "icon-size" is >= ${kd}. Reduce your "icon-size".`)),e.addSymbols(e.icon,a,m,y,_,v,!1,r,t,T.lineStartIndex,T.lineLength,-1,k,E),B=e.icon.placedSymbolArray.length-1,d&&(D=4*d.length,e.addSymbols(e.icon,d,m,y,_,v,Ch.vertical,r,t,T.lineStartIndex,T.lineLength,-1,k,E),F=e.icon.placedSymbolArray.length-1)}for(const n in i.horizontal){const o=i.horizontal[n];S||(N=La(o.text),f?I=Ad(o):S=Cd(c,U,t,u,p,h,o,d,l.layout.get("text-rotate").evaluate(v,{},E),m));const s=1===o.positionedLines.length;if(P+=Td(e,r,t,o,a,l,f,v,m,T,i.vertical?Ch.horizontal:Ch.horizontalOnly,s?Object.keys(i.horizontal):[n],j,B,x,k,E),s)break}i.vertical&&(R+=Td(e,r,t,i.vertical,a,l,f,v,m,T,Ch.vertical,["vertical"],j,F,x,k,E));let $=-1;const W=(e,t)=>e?Math.max(e,t):t;$=W(I,$),$=W(O,$),$=W(L,$);const H=$>-1?1:0;e.glyphOffsetArray.length>=lf.MAX_GLYPHS&&G("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==v.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,v.sortKey),e.symbolInstances.emplaceBack(U.x,U.y,U.z,t.x,t.y,j.right>=0?j.right:-1,j.center>=0?j.center:-1,j.left>=0?j.left:-1,j.vertical>=0?j.vertical:-1,B,F,N,void 0!==S?S:e.collisionBoxArray.length,void 0!==S?S+1:e.collisionBoxArray.length,void 0!==A?A:e.collisionBoxArray.length,void 0!==A?A+1:e.collisionBoxArray.length,void 0!==C?C:e.collisionBoxArray.length,void 0!==C?C+1:e.collisionBoxArray.length,M||e.collisionBoxArray.length,M?M+1:e.collisionBoxArray.length,u,P,R,z,D,H,0,V,q,$)}(e,s,f,a,r,n,i,L,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,k,S,l,0,E,C,m,t,o,c,u,p)};if("line"===A)for(const i of Yh(t.geometry,0,0,ls,ls)){const t=Xh(i,x,T,r.vertical||g,n,_,v,e.overscaling,ls);for(const r of t)g&&Md(e,g.text,M,r)||z(i,r,p)}else if("line-center"===A){for(const e of t.geometry)if(e.length>1){const t=Zh(e,T,r.vertical||g,n,_,v);t&&z(e,t,p)}}else if("Polygon"===t.type)for(const e of Eu(t.geometry,0)){const t=dd(e,16);z(e[0],new qh(t.x,t.y,0,0,void 0),p)}else if("LineString"===t.type)for(const e of t.geometry)z(e,new qh(e[0].x,e[0].y,0,0,void 0),p);else if("Point"===t.type)for(const e of t.geometry)for(const t of e)z([t],new qh(t.x,t.y,0,0,void 0),p)}const kd=255,Ed=kd*Np;function Td(e,t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g){const b=function(e,t,r,n,i,o,a,s){const l=[];if(0===t.positionedLines.length)return l;const c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=function(e){const t=e[0],r=e[1],n=t*r;return n>0?[t,-r]:n<0?[-t,r]:0===t?[r,t]:[r,-t]}(r);let p=Math.abs(t.top-t.bottom);for(const e of t.positionedLines)p-=e.lineOffset;const h=t.positionedLines.length,d=p/h;let f=t.top-r[1];for(let e=0;e<h;++e){const n=t.positionedLines[e];f=ud(t,d,f,e);for(const e of n.positionedGlyphs){if(!e.rect)continue;const n=e.rect||{};let o=wh+1,p=!0,h=1,d=0;if(e.imageName){const t=a[e.imageName];if(!t)continue;if(t.sdf){G("SDF images are not supported in formatted text and will be ignored.");continue}p=!1,h=t.pixelRatio,o=Eh/h}const m=(i||s)&&e.vertical,g=e.metrics.advance*e.scale/2,b=e.metrics,_=e.rect;if(null===_)continue;s&&t.verticalizable&&(d=e.imageName?g-e.metrics.width*e.scale/2:0);const v=i?[e.x+g,e.y]:[0,0];let x=[0,0],w=[0,0],k=!1;i||(m?(w=[e.x+g+u[0],e.y+u[1]-d],k=!0):x=[e.x+g+r[0],e.y+r[1]-d]);const E=_.w*e.scale/(h*(e.localGlyph?td:1)),T=_.h*e.scale/(h*(e.localGlyph?td:1));let S,C,A,M;if(m){const t=e.y-f,r=new y(-g,g-t),n=-Math.PI/2,i=new y(...w);S=new y(-g+x[0],x[1]),S._rotateAround(n,r)._add(i),S.x+=-t+g,S.y-=(b.left-o)*e.scale;const a=e.imageName?b.advance*e.scale:jp*e.scale,s=String.fromCharCode(e.glyph);Hp(s)?S.x+=(1-o)*e.scale:Zp(s)?S.x+=a-b.height*e.scale+(-o-1)*e.scale:S.x+=e.imageName||b.width+2*o===_.w&&b.height+2*o===_.h?(a-T)/2:(a-(b.height+2*o)*e.scale)/2,C=new y(S.x,S.y-E),A=new y(S.x+T,S.y),M=new y(S.x+T,S.y-E)}else{const t=(b.left-o)*e.scale-g+x[0],r=(-b.top-o)*e.scale+x[1],n=t+E,i=r+T;S=new y(t,r),C=new y(n,r),A=new y(t,i),M=new y(n,i)}if(c){let e;e=i?new y(0,0):k?new y(u[0],u[1]):new y(r[0],r[1]),S._rotateAround(c,e),C._rotateAround(c,e),A._rotateAround(c,e),M._rotateAround(c,e)}const I=new y(0,0),O=new y(0,0);l.push({tl:S,tr:C,bl:A,br:M,tex:n,writingMode:t.writingMode,glyphOffset:v,sectionIndex:e.sectionIndex,isSDF:p,pixelOffsetTL:I,pixelOffsetBR:O,minFontScaleX:0,minFontScaleY:0})}}return l}(0,n,l,o,a,s,i,e.allowVerticalPlacement),_=e.textSizeData;let v=null;"source"===_.kind?(v=[Np*o.layout.get("text-size").evaluate(s,{},g)],v[0]>Ed&&G(`${e.layerIds[0]}: Value for "text-size" is >= ${kd}. Reduce your "text-size".`)):"composite"===_.kind&&(v=[Np*f.compositeTextSizes[0].evaluate(s,{},g),Np*f.compositeTextSizes[1].evaluate(s,{},g)],(v[0]>Ed||v[1]>Ed)&&G(`${e.layerIds[0]}: Value for "text-size" is >= ${kd}. Reduce your "text-size".`)),e.addSymbols(e.text,b,v,l,a,s,u,t,r,c.lineStartIndex,c.lineLength,d,m,g);for(const t of p)h[t]=e.text.placedSymbolArray.length-1;return 4*b.length}function Sd(e){for(const t in e)return e[t];return null}function Cd(e,t,r,n,i,o,a,s,l,c){let u=a.top,p=a.bottom,h=a.left,d=a.right;const f=a.collisionPadding;if(f&&(h-=f[0],u-=f[1],d+=f[2],p+=f[3]),l){const e=new y(h,u),t=new y(d,u),r=new y(h,p),n=new y(d,p),i=w(l);let o=new y(0,0);c&&(o=new y(c[0],c[1])),e._rotateAround(i,o),t._rotateAround(i,o),r._rotateAround(i,o),n._rotateAround(i,o),h=Math.min(e.x,t.x,r.x,n.x),d=Math.max(e.x,t.x,r.x,n.x),u=Math.min(e.y,t.y,r.y,n.y),p=Math.max(e.y,t.y,r.y,n.y)}return e.emplaceBack(t.x,t.y,t.z,r.x,r.y,h,u,d,p,s,n,i,o),e.length-1}function Ad(e){e.collisionPadding&&(e.top-=e.collisionPadding[1],e.bottom+=e.collisionPadding[3]);const t=e.bottom-e.top;return t>0?Math.max(10,t):null}function Md(e,t,r,n){const i=e.compareText;if(t in i){const e=i[t];for(let t=e.length-1;t>=0;t--)if(n.dist(e[t])<r)return!0}else i[t]=[];return i[t].push(n),!1}function Id(e,t){const r=e.fovAboveCenter,n=e.elevation?e.elevation.getMinElevationBelowMSL()*t:0,i=(e._camera.position[2]*e.worldSize-n)/Math.cos(e._pitch),o=Math.sin(r)*i/Math.sin(Math.max(Math.PI/2-e._pitch-r,.01)),a=Math.sin(e._pitch)*o+i;return Math.min(1.01*a,i*(1/e._horizonShift))}function Od(e,t){if(!t.isReprojectedInTileSpace)return{scale:1<<e.z,x:e.x,y:e.y,x2:e.x+1,y2:e.y+1,projection:t};const r=Math.pow(2,-e.z),n=e.x*r,i=(e.x+1)*r,o=e.y*r,a=(e.y+1)*r,s=Zl(n),l=Zl(i),c=Xl(o),u=Xl(a),p=t.project(s,c),h=t.project(l,c),d=t.project(l,u),f=t.project(s,u);let m=Math.min(p.x,h.x,d.x,f.x),g=Math.min(p.y,h.y,d.y,f.y),b=Math.max(p.x,h.x,d.x,f.x),_=Math.max(p.y,h.y,d.y,f.y);const y=r/16;function v(e,r,n,i,o,a){const s=(n+o)/2,l=(i+a)/2,c=t.project(Zl(s),Xl(l)),u=Math.max(0,m-c.x,g-c.y,c.x-b,c.y-_);m=Math.min(m,c.x),b=Math.max(b,c.x),g=Math.min(g,c.y),_=Math.max(_,c.y),u>y&&(v(e,c,n,i,s,l),v(c,r,s,l,o,a))}v(p,h,n,o,i,o),v(h,d,i,o,i,a),v(d,f,i,a,n,a),v(f,p,n,a,n,o),m-=y,g-=y,b+=y,_+=y;const x=1/Math.max(b-m,_-g);return{scale:x,x:m*x,y:g*x,x2:b*x,y2:_*x,projection:t}}const Ld=fs(new Float32Array(16));class zd{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,t){return{x:0,y:0,z:0}}unproject(e,t){return new ql(0,0)}projectTilePoint(e,t,r){return{x:e,y:t,z:0}}locationPoint(e,t,r=!0){return e._coordinatePoint(e.locationCoordinate(t),r)}pixelsPerMeter(e,t){return Hl(1,e)*t}pixelSpaceConversion(e,t,r){return 1}farthestPixelDistance(e){return Id(e,e.pixelsPerMeter)}pointCoordinate(e,t,r,n){const i=e.horizonLineFromTop(!1),o=new y(t,Math.max(i,r));return e.rayIntersectionCoordinate(e.pointRayIntersection(o,n))}pointCoordinate3D(e,t,r){const n=new y(t,r);if(e.elevation)return e.elevation.pointCoordinate(n);{const t=this.pointCoordinate(e,n.x,n.y,0);return[t.x,t.y,t.z]}}isPointAboveHorizon(e,t){if(e.elevation)return!this.pointCoordinate3D(e,t.x,t.y);const r=e.horizonLineFromTop();return t.y<r}createInversionMatrix(e,t){return Ld}createTileMatrix(e,t,r){let n,i,o;const a=r.canonical,s=fs(new Float64Array(16));if(this.isReprojectedInTileSpace){const l=Od(a,this);n=1,i=l.x+r.wrap*l.scale,o=l.y,_s(s,s,[n/l.scale,n/l.scale,e.pixelsPerMeter/t])}else n=t/e.zoomScale(a.z),i=(a.x+Math.pow(2,a.z)*r.wrap)*n,o=a.y*n;return bs(s,s,[i,o,0]),_s(s,s,[n/ls,n/ls,1]),s}upVector(e,t,r){return[0,0,1]}upVectorScale(e,t,r){return{metersToTile:1}}}class Dd extends zd{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[t,r]=this.parallels=e.parallels||[29.5,45.5],n=Math.sin(w(t));this.n=(n+Math.sin(w(r)))/2,this.c=1+n*(2*this.n-n),this.r0=Math.sqrt(this.c)/this.n}project(e,t){const{n:r,c:n,r0:i}=this,o=w(e-this.center[0]),a=w(t),s=Math.sqrt(n-2*r*Math.sin(a))/r;return{x:s*Math.sin(o*r),y:s*Math.cos(o*r)-i,z:0}}unproject(e,t){const{n:r,c:n,r0:i}=this,o=i+t;let a=Math.atan2(e,Math.abs(o))*Math.sign(o);o*r<0&&(a-=Math.PI*Math.sign(e)*Math.sign(o));const s=w(this.center[0])*r;a=I(a,-Math.PI-s,Math.PI-s);const l=A(k(a/r)+this.center[0],-180,180),c=Math.asin(A((n-(e*e+o*o)*r*r)/(2*r),-1,1)),u=A(k(c),-Yl,Yl);return new ql(l,u)}}const Pd=1.340264,Rd=-.081106,Bd=893e-6,Fd=.003796,jd=Math.sqrt(3)/2;class Nd extends zd{project(e,t){t=t/180*Math.PI,e=e/180*Math.PI;const r=Math.asin(jd*Math.sin(t)),n=r*r,i=n*n*n;return{x:.5*(e*Math.cos(r)/(jd*(Pd+3*Rd*n+i*(7*Bd+9*Fd*n)))/Math.PI+.5),y:1-.5*(r*(Pd+Rd*n+i*(Bd+Fd*n))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let r=t=(2*(1-t)-1)*Math.PI,n=r*r,i=n*n*n;for(let e,o,a,s=0;s<12&&(o=r*(Pd+Rd*n+i*(Bd+Fd*n))-t,a=Pd+3*Rd*n+i*(7*Bd+9*Fd*n),e=o/a,r=A(r-e,-Math.PI/3,Math.PI/3),n=r*r,i=n*n*n,!(Math.abs(e)<1e-12));++s);const o=jd*e*(Pd+3*Rd*n+i*(7*Bd+9*Fd*n))/Math.cos(r),a=Math.asin(Math.sin(r)/jd),s=A(180*o/Math.PI,-180,180),l=A(180*a/Math.PI,-Yl,Yl);return new ql(s,l)}}class Ud extends zd{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){return{x:.5+e/360,y:.5-t/360,z:0}}unproject(e,t){const r=360*(e-.5),n=A(360*(.5-t),-Yl,Yl);return new ql(r,n)}}const Vd=Math.PI/2;function qd(e){return Math.tan((Vd+e)/2)}class $d extends zd{constructor(e){super(e),this.center=e.center||[0,30];const[t,r]=this.parallels=e.parallels||[30,30];let n=w(t),i=w(r);this.southernCenter=n+i<0,this.southernCenter&&(n=-n,i=-i);const o=Math.cos(n),a=qd(n);this.n=n===i?Math.sin(n):Math.log(o/Math.cos(i))/Math.log(qd(i)/a),this.f=o*Math.pow(qd(n),this.n)/this.n}project(e,t){t=w(t),this.southernCenter&&(t=-t),e=w(e-this.center[0]);const r=1e-6,{n:n,f:i}=this;i>0?t<-Vd+r&&(t=-Vd+r):t>Vd-r&&(t=Vd-r);const o=i/Math.pow(qd(t),n);let a=o*Math.sin(n*e),s=i-o*Math.cos(n*e);return a=.5*(a/Math.PI+.5),s=.5*(s/Math.PI+.5),{x:a,y:this.southernCenter?s:1-s,z:0}}unproject(e,t){e=(2*e-.5)*Math.PI,this.southernCenter&&(t=1-t),t=(2*(1-t)-.5)*Math.PI;const{n:r,f:n}=this,i=n-t,o=Math.sign(i),a=Math.sign(r)*Math.sqrt(e*e+i*i);let s=Math.atan2(e,Math.abs(i))*o;i*r<0&&(s-=Math.PI*Math.sign(e)*o);const l=A(k(s/r)+this.center[0],-180,180),c=A(k(2*Math.atan(Math.pow(n/a,1/r))-Vd),-Yl,Yl);return new ql(l,this.southernCenter?-c:c)}}class Gd extends zd{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,t){return{x:Gl(e),y:Wl(t),z:0}}unproject(e,t){const r=Zl(e),n=Xl(t);return new ql(r,n)}}const Wd=w(Yl);class Hd extends zd{project(e,t){const r=(t=w(t))*t,n=r*r;return{x:.5*((e=w(e))*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791))/Math.PI+.5),y:1-.5*(t*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let r=t=(2*(1-t)-1)*Math.PI,n=25,i=0,o=r*r;do{o=r*r;const e=o*o;i=(r*(1.007226+o*(.015085+e*(.028874*o-.044475-.005916*e)))-t)/(1.007226+o*(.045255+e*(.259866*o-.311325-.005916*11*e))),r=A(r-i,-Wd,Wd)}while(Math.abs(i)>1e-6&&--n>0);o=r*r;const a=A(k(e/(.8707+o*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979))),-180,180),s=k(r);return new ql(a,s)}}const Zd=w(Yl);class Xd extends zd{project(e,t){t=w(t),e=w(e);const r=Math.cos(t),n=2/Math.PI,i=Math.acos(r*Math.cos(e/2)),o=Math.sin(i)/i,a=.5*(e*n+2*r*Math.sin(e/2)/o)||0,s=.5*(t+Math.sin(t)/o)||0;return{x:.5*(a/Math.PI+.5),y:1-.5*(s/Math.PI+1),z:0}}unproject(e,t){let r=e=(2*e-.5)*Math.PI,n=t=(2*(1-t)-1)*Math.PI,i=25;const o=1e-6;let a=0,s=0;do{const i=Math.cos(n),o=Math.sin(n),l=2*o*i,c=o*o,u=i*i,p=Math.cos(r/2),h=Math.sin(r/2),d=2*p*h,f=h*h,m=1-u*p*p,g=m?1/m:0,b=m?Math.acos(i*p)*Math.sqrt(1/m):0,_=.5*(2*b*i*h+2*r/Math.PI)-e,y=.5*(b*o+n)-t,v=.5*g*(u*f+b*i*p*c)+1/Math.PI,x=g*(d*l/4-b*o*h),w=.125*g*(l*h-b*o*u*d),k=.5*g*(c*p+b*f*i)+.5,E=x*w-k*v;a=(y*x-_*k)/E,s=(_*w-y*v)/E,r=A(r-a,-Math.PI,Math.PI),n=A(n-s,-Zd,Zd)}while((Math.abs(a)>o||Math.abs(s)>o)&&--i>0);return new ql(k(r),k(n))}}class Kd extends zd{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(w(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){const{scale:r,cosPhi:n}=this;return{x:w(e)*n*r+.5,y:-Math.sin(w(t))/n*r+.5,z:0}}unproject(e,t){const{scale:r,cosPhi:n}=this,i=-(t-.5)/r,o=A(k((e-.5)/r)/n,-180,180),a=Math.asin(A(i*n,-1,1)),s=A(k(a),-Yl,Yl);return new ql(o,s)}}class Yd extends Gd{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,t,r){const n=Al(e,t,r);return Fs(n,n,Ol(yl(r))),{x:n[0],y:n[1],z:n[2]}}locationPoint(e,t){const r=Cl(t.lat,t.lng),n=Ps([],r),i=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(t),e._centerAltitude):e._centerAltitude;Ds(r,r,n,Hl(1,0)*ls*i);const o=fs(new Float64Array(16));return gs(o,e.pixelMatrix,e.globeMatrix),Fs(r,r,o),new y(r[0],r[1])}pixelsPerMeter(e,t){return Hl(1,0)*t}pixelSpaceConversion(e,t,r){const n=Hl(1,e)*t,i=Lr(Hl(1,45)*t,n,r);return this.pixelsPerMeter(e,t)/i}createTileMatrix(e,t,r){const n=Ll(yl(r.canonical));return gs(new Float64Array(16),e.globeMatrix,n)}createInversionMatrix(e,t){const{center:r}=e,n=Ol(yl(t));return vs(n,n,w(r.lng)),ys(n,n,w(r.lat)),_s(n,n,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(n)}pointCoordinate(e,t,r,n){return gl(e,t,r,!0)||new Ql(0,0)}pointCoordinate3D(e,t,r){const n=this.pointCoordinate(e,t,r,0);return[n.x,n.y,n.z]}isPointAboveHorizon(e,t){return!gl(e,t.x,t.y,!1)}farthestPixelDistance(e){const t=function(e,t){const r=e.cameraToCenterDistance,n=e._centerAltitude*t,i=e._camera,o=e._camera.forward(),a=As([],zs([],o,-r),[0,0,n]),s=e.worldSize/(2*Math.PI),l=[0,0,-s],c=e.width/e.height,u=Math.tan(e.fovAboveCenter),p=zs([],i.up(),u),h=zs([],i.right(),u*c),d=Ps([],As([],As([],o,p),h)),f=[];let m;if(new rl(a,d).closestPointOnSphere(l,s,f)){const t=As([],f,l),r=Us([],t,a);m=Math.cos(e.fovAboveCenter)*Ss(r)}else{const e=Us([],a,l),t=Us([],l,a);Ps(t,t);const r=Ss(e)-s;m=Math.sqrt(r*(r+2*s));const n=Math.acos(m/(s+r))-Math.acos(Rs(o,t));m*=Math.cos(n)}return 1.01*m}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),r=Dl(e.zoom);if(r>0){const n=Id(e,Hl(1,e.center.lat)*e.worldSize),i=e.worldSize/(2*Math.PI),o=Math.max(e.width,e.height)/e.worldSize*Math.PI;return Lr(t,n+i*(1-Math.cos(o)),Math.pow(r,10))}return t}upVector(e,t,r){return Al(t,r,e,1)}upVectorScale(e){return{metersToTile:ml(Ml(yl(e)))}}}function Jd(e){const t=e.parallels,r=!!t&&Math.abs(t[0]+t[1])<.01;switch(e.name){case"mercator":return new Gd(e);case"equirectangular":return new Ud(e);case"naturalEarth":return new Hd(e);case"equalEarth":return new Nd(e);case"winkelTripel":return new Xd(e);case"albers":return r?new Kd(e):new Dd(e);case"lambertConformalConic":return r?new Kd(e):new $d(e);case"globe":return new Yd(e)}throw new Error(`Invalid projection name: ${e.name}`)}const Qd=Zu.types,ef=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function tf(e,t,r,n,i,o,a,s,l,c,u,p,h){const d=s?Math.min(Ed,Math.round(s[0])):0,f=s?Math.min(Ed,Math.round(s[1])):0;e.emplaceBack(t,r,Math.round(32*n),Math.round(32*i),o,a,(d<<1)+(l?1:0),f,16*c,16*u,256*p,256*h)}function rf(e,t,r,n,i,o,a){e.emplaceBack(t,r,n,i,o,a)}function nf(e,t,r,n,i){e.emplaceBack(t,r,n,i),e.emplaceBack(t,r,n,i),e.emplaceBack(t,r,n,i),e.emplaceBack(t,r,n,i)}function of(e){for(const t of e.sections)if(co(t.text))return!0;return!1}class af{constructor(e){this.layoutVertexArray=new Ko,this.indexArray=new ia,this.programConfigurations=e,this.segments=new ss,this.dynamicLayoutVertexArray=new Wo,this.opacityVertexArray=new Jo,this.placedSymbolArray=new ga,this.globeExtVertexArray=new Yo}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Lp.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Dp.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,ef,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,zp.members,!0)),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}Ki(af,"SymbolBuffers");class sf{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new ss,this.collisionVertexArray=new ra,this.collisionVertexArrayExt=new na}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Pp.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,Rp.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}Ki(sf,"CollisionBuffers");class lf{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=fs([]),this.placementViewportMatrix=fs([]);const t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Up(this.zoom,t["text-size"]),this.iconSizeData=Up(this.zoom,t["icon-size"]);const r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=r.get("text-writing-mode").map((e=>Ch[e])),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=e.sourceID,this.projection=e.projection}createArrays(){this.text=new af(new Ya(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new af(new Ya(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new ya,this.lineVertexArray=new va,this.symbolInstances=new _a}calculateGlyphDependencies(e,t,r,n,i){for(let r=0;r<e.length;r++)if(t[e.charCodeAt(r)]=!0,n&&i){const n=Wp[e.charAt(r)];n&&(t[n.charCodeAt(0)]=!0)}}populate(e,t,r,n){const i=this.layers[0],o=i.layout,a="globe"===this.projection.name,s=o.get("text-font"),l=o.get("text-field"),c=o.get("icon-image"),u=("constant"!==l.value.kind||l.value.value instanceof Pt&&!l.value.value.isEmpty()||l.value.value.toString().length>0)&&("constant"!==s.value.kind||s.value.value.length>0),p="constant"!==c.value.kind||!!c.value.value||Object.keys(c.parameters).length>0,h=o.get("symbol-sort-key");if(this.features=[],!u&&!p)return;const d=t.iconDependencies,f=t.glyphDependencies,m=t.availableImages,g=new ko(this.zoom);for(const{feature:t,id:l,index:c,sourceLayerIndex:b}of e){const e=i._featureFilter.needGeometry,_=lc(t,e);if(!i._featureFilter.filter(g,_,r))continue;if(e||(_.geometry=sc(t,r,n)),a&&1!==t.type&&r.z<=5){const e=_.geometry,t=.98078528056,n=(e,n)=>Rs(Al(e.x,e.y,r,1),Al(n.x,n.y,r,1))<t;for(let t=0;t<e.length;t++)e[t]=nc(e[t],n)}let y,v;if(u){const e=i.getValueAndResolveTokens("text-field",_,r,m),t=Pt.factory(e);of(t)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===vo()||this.hasRTLText&&wo.isParsed())&&(y=Gp(t,i,_))}if(p){const e=i.getValueAndResolveTokens("icon-image",_,r,m);v=e instanceof Rt?e:Rt.fromString(e)}if(!y&&!v)continue;const x=this.sortFeaturesByKey?h.evaluate(_,{},r):void 0;if(this.features.push({id:l,text:y,icon:v,index:c,sourceLayerIndex:b,geometry:_.geometry,properties:t.properties,type:Qd[t.type],sortKey:x}),v&&(d[v.name]=!0),y){const e=s.evaluate(_,{},r).join(","),t="map"===o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Ch.vertical)>=0;for(const r of y.sections)if(r.image)d[r.image.name]=!0;else{const n=ro(y.toString()),i=r.fontStack||e,o=f[i]=f[i]||{};this.calculateGlyphDependencies(r.text,o,t,this.allowVerticalPlacement,n)}}}"line"===o.get("symbol-placement")&&(this.features=function(e){const t={},r={},n=[];let i=0;function o(t){n.push(e[t]),i++}function a(e,t,i){const o=r[e];return delete r[e],r[t]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(i[0]),o}function s(e,r,i){const o=t[r];return delete t[r],t[e]=o,n[o].geometry[0].shift(),n[o].geometry[0]=i[0].concat(n[o].geometry[0]),o}function l(e,t,r){const n=r?t[0][t[0].length-1]:t[0][0];return`${e}:${n.x}:${n.y}`}for(let c=0;c<e.length;c++){const u=e[c],p=u.geometry,h=u.text?u.text.toString():null;if(!h){o(c);continue}const d=l(h,p),f=l(h,p,!0);if(d in r&&f in t&&r[d]!==t[f]){const e=s(d,f,p),i=a(d,f,n[e].geometry);delete t[d],delete r[f],r[l(h,n[i].geometry,!0)]=i,n[e].geometry=null}else d in r?a(d,f,p):f in t?s(d,f,p):(o(c),t[d]=i-1,r[f]=i-1)}return n.filter((e=>e.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,r,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r,n),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r,n))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=Jd(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const r=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:e,y:r}of t)this.lineVertexArray.emplaceBack(e,r);return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,t,r,n,i,o,a,s,l,c,u,p,h,d){const f=e.indexArray,m=e.layoutVertexArray,g=e.globeExtVertexArray,b=e.segments.prepareSegment(4*t.length,m,f,this.canOverlap?o.sortKey:void 0),_=this.glyphOffsetArray.length,y=b.vertexLength,v=this.allowVerticalPlacement&&a===Ch.vertical?Math.PI/2:0,x=o.text&&o.text.sections;for(let n=0;n<t.length;n++){const{tl:i,tr:a,bl:c,br:u,tex:p,pixelOffsetTL:_,pixelOffsetBR:y,minFontScaleX:w,minFontScaleY:k,glyphOffset:E,isSDF:T,sectionIndex:S}=t[n],C=b.vertexLength,A=E[1];if(tf(m,l.x,l.y,i.x,A+i.y,p.x,p.y,r,T,_.x,_.y,w,k),tf(m,l.x,l.y,a.x,A+a.y,p.x+p.w,p.y,r,T,y.x,_.y,w,k),tf(m,l.x,l.y,c.x,A+c.y,p.x,p.y+p.h,r,T,_.x,y.y,w,k),tf(m,l.x,l.y,u.x,A+u.y,p.x+p.w,p.y+p.h,r,T,y.x,y.y,w,k),s){const{x:t,y:r,z:n}=s.anchor,[i,o,a]=s.up;rf(g,t,r,n,i,o,a),rf(g,t,r,n,i,o,a),rf(g,t,r,n,i,o,a),rf(g,t,r,n,i,o,a),nf(e.dynamicLayoutVertexArray,t,r,n,v)}else nf(e.dynamicLayoutVertexArray,l.x,l.y,l.z,v);f.emplaceBack(C,C+1,C+2),f.emplaceBack(C+1,C+2,C+3),b.vertexLength+=4,b.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(E[0]),n!==t.length-1&&S===t[n+1].sectionIndex||e.programConfigurations.populatePaintArrays(m.length,o,o.index,{},h,d,x&&x[S])}const w=s?s.anchor:l;e.placedSymbolArray.emplaceBack(w.x,w.y,w.z,l.x,l.y,_,this.glyphOffsetArray.length-_,y,c,u,l.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],a,0,!1,0,p,0)}_commitLayoutVertex(e,t,r,n,i,o,a){e.emplaceBack(t,r,n,i,o,Math.round(a.x),Math.round(a.y))}_addCollisionDebugVertices(e,t,r,n,i,o,a){const s=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray),l=s.vertexLength,c=a.tileAnchorX,u=a.tileAnchorY;for(let e=0;e<4;e++)r.collisionVertexArray.emplaceBack(0,0,0,0);r.collisionVertexArrayExt.emplaceBack(t,-e.padding,-e.padding),r.collisionVertexArrayExt.emplaceBack(t,e.padding,-e.padding),r.collisionVertexArrayExt.emplaceBack(t,e.padding,e.padding),r.collisionVertexArrayExt.emplaceBack(t,-e.padding,e.padding),this._commitLayoutVertex(r.layoutVertexArray,n,i,o,c,u,new y(e.x1,e.y1)),this._commitLayoutVertex(r.layoutVertexArray,n,i,o,c,u,new y(e.x2,e.y1)),this._commitLayoutVertex(r.layoutVertexArray,n,i,o,c,u,new y(e.x2,e.y2)),this._commitLayoutVertex(r.layoutVertexArray,n,i,o,c,u,new y(e.x1,e.y2)),s.vertexLength+=4;const p=r.indexArray;p.emplaceBack(l,l+1),p.emplaceBack(l+1,l+2),p.emplaceBack(l+2,l+3),p.emplaceBack(l+3,l),s.primitiveLength+=4}_addTextDebugCollisionBoxes(e,t,r,n,i,o){for(let a=n;a<i;a++){const n=r.get(a),i=this.getSymbolInstanceTextSize(e,o,t,a);this._addCollisionDebugVertices(n,i,this.textCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,o)}}_addIconDebugCollisionBoxes(e,t,r,n,i,o){for(let a=n;a<i;a++){const n=r.get(a),i=this.getSymbolInstanceIconSize(e,t,o.placedIconSymbolIndex);this._addCollisionDebugVertices(n,i,this.iconCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,o)}}generateCollisionDebugBuffers(e,t){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new sf(ea,Bp.members,ua),this.iconCollisionBox=new sf(ea,Bp.members,ua);const r=qp(this.iconSizeData,e),n=qp(this.textSizeData,e);for(let i=0;i<this.symbolInstances.length;i++){const o=this.symbolInstances.get(i);this._addTextDebugCollisionBoxes(n,e,t,o.textBoxStartIndex,o.textBoxEndIndex,o),this._addTextDebugCollisionBoxes(n,e,t,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._addIconDebugCollisionBoxes(r,e,t,o.iconBoxStartIndex,o.iconBoxEndIndex,o),this._addIconDebugCollisionBoxes(r,e,t,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o)}}getSymbolInstanceTextSize(e,t,r,n){const i=this.text.placedSymbolArray.get(t.rightJustifiedTextSymbolIndex>=0?t.rightJustifiedTextSymbolIndex:t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.leftJustifiedTextSymbolIndex>=0?t.leftJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex>=0?t.verticalPlacedTextSymbolIndex:n),o=Vp(this.textSizeData,e,i)/jp;return this.tilePixelRatio*o}getSymbolInstanceIconSize(e,t,r){const n=this.icon.placedSymbolArray.get(r),i=Vp(this.iconSizeData,e,n);return this.tilePixelRatio*i}_commitDebugCollisionVertexUpdate(e,t,r){e.emplaceBack(t,-r,-r),e.emplaceBack(t,r,-r),e.emplaceBack(t,r,r),e.emplaceBack(t,-r,r)}_updateTextDebugCollisionBoxes(e,t,r,n,i,o){for(let a=n;a<i;a++){const n=r.get(a),i=this.getSymbolInstanceTextSize(e,o,t,a);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,i,n.padding)}}_updateIconDebugCollisionBoxes(e,t,r,n,i,o){for(let a=n;a<i;a++){const n=r.get(a),i=this.getSymbolInstanceIconSize(e,t,o);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,i,n.padding)}}updateCollisionDebugBuffers(e,t){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const r=qp(this.iconSizeData,e),n=qp(this.textSizeData,e);for(let i=0;i<this.symbolInstances.length;i++){const o=this.symbolInstances.get(i);this._updateTextDebugCollisionBoxes(n,e,t,o.textBoxStartIndex,o.textBoxEndIndex,o),this._updateTextDebugCollisionBoxes(n,e,t,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._updateIconDebugCollisionBoxes(r,e,t,o.iconBoxStartIndex,o.iconBoxEndIndex,o.placedIconSymbolIndex),this._updateIconDebugCollisionBoxes(r,e,t,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o.placedIconSymbolIndex)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,t,r,n,i,o,a,s,l){const c={};if(t<r){const{x1:r,y1:n,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:p,tileAnchorY:h,featureIndex:d}=e.get(t);c.textBox={x1:r,y1:n,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:p,tileAnchorY:h},c.textFeatureIndex=d}if(n<i){const{x1:t,y1:r,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:p,tileAnchorY:h,featureIndex:d}=e.get(n);c.verticalTextBox={x1:t,y1:r,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:p,tileAnchorY:h},c.verticalTextFeatureIndex=d}if(o<a){const{x1:t,y1:r,x2:n,y2:i,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:p,tileAnchorY:h,featureIndex:d}=e.get(o);c.iconBox={x1:t,y1:r,x2:n,y2:i,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:p,tileAnchorY:h},c.iconFeatureIndex=d}if(s<l){const{x1:t,y1:r,x2:n,y2:i,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:p,tileAnchorY:h,featureIndex:d}=e.get(s);c.verticalIconBox={x1:t,y1:r,x2:n,y2:i,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:p,tileAnchorY:h},c.verticalIconFeatureIndex=d}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){const r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){const r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs;for(let t=r.vertexStartIndex;t<n;t+=4)e.indexArray.emplaceBack(t,t+1,t+2),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const t=Math.sin(e),r=Math.cos(e),n=[],i=[],o=[];for(let e=0;e<this.symbolInstances.length;++e){o.push(e);const a=this.symbolInstances.get(e);n.push(0|Math.round(t*a.tileAnchorX+r*a.tileAnchorY)),i.push(a.featureIndex)}return o.sort(((e,t)=>n[e]-n[t]||i[t]-i[e])),o}addToSortKeyRanges(e,t){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);const{rightJustifiedTextSymbolIndex:r,centerJustifiedTextSymbolIndex:n,leftJustifiedTextSymbolIndex:i,verticalPlacedTextSymbolIndex:o,placedIconSymbolIndex:a,verticalPlacedIconSymbolIndex:s}=t;r>=0&&this.addIndicesForPlacedSymbol(this.text,r),n>=0&&n!==r&&this.addIndicesForPlacedSymbol(this.text,n),i>=0&&i!==n&&i!==r&&this.addIndicesForPlacedSymbol(this.text,i),o>=0&&this.addIndicesForPlacedSymbol(this.text,o),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a),s>=0&&this.addIndicesForPlacedSymbol(this.icon,s)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Ki(lf,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),lf.MAX_GLYPHS=65535,lf.addDynamicAttributes=nf;const cf=new Po({"symbol-placement":new Lo(tt.layout_symbol["symbol-placement"]),"symbol-spacing":new Lo(tt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Lo(tt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new zo(tt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Lo(tt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Lo(tt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Lo(tt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Lo(tt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Lo(tt.layout_symbol["icon-rotation-alignment"]),"icon-size":new zo(tt.layout_symbol["icon-size"]),"icon-text-fit":new Lo(tt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Lo(tt.layout_symbol["icon-text-fit-padding"]),"icon-image":new zo(tt.layout_symbol["icon-image"]),"icon-rotate":new zo(tt.layout_symbol["icon-rotate"]),"icon-padding":new Lo(tt.layout_symbol["icon-padding"]),"icon-keep-upright":new Lo(tt.layout_symbol["icon-keep-upright"]),"icon-offset":new zo(tt.layout_symbol["icon-offset"]),"icon-anchor":new zo(tt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Lo(tt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Lo(tt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Lo(tt.layout_symbol["text-rotation-alignment"]),"text-field":new zo(tt.layout_symbol["text-field"]),"text-font":new zo(tt.layout_symbol["text-font"]),"text-size":new zo(tt.layout_symbol["text-size"]),"text-max-width":new zo(tt.layout_symbol["text-max-width"]),"text-line-height":new zo(tt.layout_symbol["text-line-height"]),"text-letter-spacing":new zo(tt.layout_symbol["text-letter-spacing"]),"text-justify":new zo(tt.layout_symbol["text-justify"]),"text-radial-offset":new zo(tt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Lo(tt.layout_symbol["text-variable-anchor"]),"text-anchor":new zo(tt.layout_symbol["text-anchor"]),"text-max-angle":new Lo(tt.layout_symbol["text-max-angle"]),"text-writing-mode":new Lo(tt.layout_symbol["text-writing-mode"]),"text-rotate":new zo(tt.layout_symbol["text-rotate"]),"text-padding":new Lo(tt.layout_symbol["text-padding"]),"text-keep-upright":new Lo(tt.layout_symbol["text-keep-upright"]),"text-transform":new zo(tt.layout_symbol["text-transform"]),"text-offset":new zo(tt.layout_symbol["text-offset"]),"text-allow-overlap":new Lo(tt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Lo(tt.layout_symbol["text-ignore-placement"]),"text-optional":new Lo(tt.layout_symbol["text-optional"])});var uf={paint:new Po({"icon-opacity":new zo(tt.paint_symbol["icon-opacity"]),"icon-color":new zo(tt.paint_symbol["icon-color"]),"icon-halo-color":new zo(tt.paint_symbol["icon-halo-color"]),"icon-halo-width":new zo(tt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new zo(tt.paint_symbol["icon-halo-blur"]),"icon-translate":new Lo(tt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Lo(tt.paint_symbol["icon-translate-anchor"]),"text-opacity":new zo(tt.paint_symbol["text-opacity"]),"text-color":new zo(tt.paint_symbol["text-color"],{runtimeType:dt,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new zo(tt.paint_symbol["text-halo-color"]),"text-halo-width":new zo(tt.paint_symbol["text-halo-width"]),"text-halo-blur":new zo(tt.paint_symbol["text-halo-blur"]),"text-translate":new Lo(tt.paint_symbol["text-translate"]),"text-translate-anchor":new Lo(tt.paint_symbol["text-translate-anchor"])}),layout:cf};class pf{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:ct,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ki(pf,"FormatSectionOverride",{omit:["defaultValue"]});class hf extends is{constructor(e){super(e,uf)}recalculate(e,t){super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const r=this.layout.get("text-writing-mode");if(r){const e=[];for(const t of r)e.indexOf(t)<0&&e.push(t);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(e,t,r,n){const i=this.layout.get(e).evaluate(t,{},r,n),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||Kn(o.value)||!i?i:function(e,t){return t.replace(/{([^{}]+)}/g,((t,r)=>r in e?String(e[r]):""))}(t.properties,i)}createBucket(e){return new lf(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of uf.paint.overridableProperties){if(!hf.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),r=new pf(t),n=new Xn(r,t.property.specification);let i=null;i="constant"===t.value.kind||"source"===t.value.kind?new Jn("source",n):new Qn("composite",n,t.value.zoomStops,t.value._interpolationType),this.paint._values[e]=new Io(t.property,i,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven())&&hf.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const r=e.get("text-field"),n=uf.paint.properties[t];let i=!1;const o=e=>{for(const t of e)if(n.overrides&&n.overrides.hasOverride(t))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof Pt)o(r.value.value.sections);else if("source"===r.value.kind){const e=t=>{i||(t instanceof Vt&&jt(t.value)===bt?o(t.value.sections):t instanceof Ht?o(t.sections):t.eachChild(e))},t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return i}getProgramConfiguration(e){return new Ka(this,e)}}var df={paint:new Po({"background-color":new Lo(tt.paint_background["background-color"]),"background-pattern":new Lo(tt.paint_background["background-pattern"]),"background-opacity":new Lo(tt.paint_background["background-opacity"])})},ff={paint:new Po({"raster-opacity":new Lo(tt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Lo(tt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Lo(tt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Lo(tt.paint_raster["raster-brightness-max"]),"raster-saturation":new Lo(tt.paint_raster["raster-saturation"]),"raster-contrast":new Lo(tt.paint_raster["raster-contrast"]),"raster-resampling":new Lo(tt.paint_raster["raster-resampling"]),"raster-fade-duration":new Lo(tt.paint_raster["raster-fade-duration"])})};class mf extends is{constructor(e){super(e,{}),this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isLayerDraped(){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}var gf={paint:new Po({"sky-type":new Lo(tt.paint_sky["sky-type"]),"sky-atmosphere-sun":new Lo(tt.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new Lo(tt.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new Lo(tt.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new Lo(tt.paint_sky["sky-gradient-radius"]),"sky-gradient":new Do(tt.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new Lo(tt.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new Lo(tt.paint_sky["sky-atmosphere-color"]),"sky-opacity":new Lo(tt.paint_sky["sky-opacity"])})};function bf(e,t,r){const n=[0,0,1],i=Zs([]);return Ks(i,i,r?-w(e)+Math.PI:w(e)),Xs(i,i,-w(t)),js(n,n,i),Ps(n,n)}const _f={circle:class extends is{constructor(e){super(e,Mc)}createBucket(e){return new pc(e)}queryRadius(e){const t=e;return Ec("circle-radius",this,t)+Ec("circle-stroke-width",this,t)+Tc(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,r,n,i,o,a,s){const l=Cc(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r);return Ic(e,n,o,a,s,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,c)}getProgramIds(){return["circle"]}getProgramConfiguration(e){return new Ka(this,e)}},heatmap:class extends is{createBucket(e){return new Pc(e)}constructor(e){super(e,Uc),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Vc({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(e){return Ec("heatmap-radius",this,e)}queryIntersectsFeature(e,t,r,n,i,o,a,s){const l=this.paint.get("heatmap-radius").evaluate(t,r);return Ic(e,n,o,a,s,!0,!0,new y(0,0),l)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(e){return new Ka(this,e)}},hillshade:class extends is{constructor(e){super(e,qc)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends is{constructor(e){super(e,Iu)}getProgramIds(){const e=this.paint.get("fill-pattern"),t=e&&e.constantOr(1),r=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&r.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),r}getProgramConfiguration(e){return new Ka(this,e)}recalculate(e,t){super.recalculate(e,t);const r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new Au(e)}queryRadius(){return Tc(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,r,n,i,o){return!e.queryGeometry.isAboveHorizon&&fc(Sc(e.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),n)}isTileClipped(){return!0}},"fill-extrusion":class extends is{constructor(e){super(e,pp)}createBucket(e){return new tp(e)}queryRadius(){return Tc(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(e){return new Ka(this,e)}queryIntersectsFeature(e,t,r,n,i,o,a,s,l){const c=Cc(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),u=this.paint.get("fill-extrusion-height").evaluate(t,r),p=this.paint.get("fill-extrusion-base").evaluate(t,r),h=[0,0],d=s&&o.elevation,f=o.elevation?o.elevation.exaggeration():1,m=e.tile.getBucket(this);if(d&&m instanceof tp){const e=m.centroidVertexArray,t=l+1;t<e.length&&(h[0]=e.geta_centroid_pos0(t),h[1]=e.geta_centroid_pos1(t))}if(0===h[0]&&1===h[1])return!1;"globe"===o.projection.name&&(n=cp([n],[new y(0,0),new y(ls,ls)],e.tileID.canonical).map((e=>e.polygon)).flat());const g=d?s:null,[b,_]=function(e,t,r,n,i,o,a,s,l,c,u){return"globe"===e.projection.name?function(e,t,r,n,i,o,a,s,l,c,u){const p=[],h=[],d=e.projection.upVectorScale(u,e.center.lat,e.worldSize).metersToTile,f=[0,0,0,1],m=[0,0,0,1],g=(e,t,r,n)=>{e[0]=t,e[1]=r,e[2]=n,e[3]=1},b=lp();r>0&&(r+=b),n+=b;for(const b of t){const t=[],_=[];for(const p of b){const h=p.x+i.x,b=p.y+i.y,y=e.projection.projectTilePoint(h,b,u),v=e.projection.upVector(u,p.x,p.y);let x=r,w=n;if(a){const e=vp(h,b,r,n,a,s,l,c);x+=e.base,w+=e.top}0!==r?g(f,y.x+v[0]*d*x,y.y+v[1]*d*x,y.z+v[2]*d*x):g(f,y.x,y.y,y.z),g(m,y.x+v[0]*d*w,y.y+v[1]*d*w,y.z+v[2]*d*w),Fs(f,f,o),Fs(m,m,o),t.push(new bp(f[0],f[1],f[2])),_.push(new bp(m[0],m[1],m[2]))}p.push(t),h.push(_)}return[p,h]}(e,t,r,n,i,o,a,s,l,c,u):a?function(e,t,r,n,i,o,a,s,l){const c=[],u=[],p=[0,0,0,1];for(const h of e){const e=[],d=[];for(const c of h){const u=c.x+n.x,h=c.y+n.y,f=vp(u,h,t,r,o,a,s,l);p[0]=u,p[1]=h,p[2]=f.base,p[3]=1,Ws(p,p,i),p[3]=Math.max(p[3],1e-5);const m=new bp(p[0]/p[3],p[1]/p[3],p[2]/p[3]);p[0]=u,p[1]=h,p[2]=f.top,p[3]=1,Ws(p,p,i),p[3]=Math.max(p[3],1e-5);const g=new bp(p[0]/p[3],p[1]/p[3],p[2]/p[3]);e.push(m),d.push(g)}c.push(e),u.push(d)}return[c,u]}(t,r,n,i,o,a,s,l,c):function(e,t,r,n,i){const o=[],a=[],s=i[8]*t,l=i[9]*t,c=i[10]*t,u=i[11]*t,p=i[8]*r,h=i[9]*r,d=i[10]*r,f=i[11]*r;for(const t of e){const e=[],r=[];for(const o of t){const t=o.x+n.x,a=o.y+n.y,m=i[0]*t+i[4]*a+i[12],g=i[1]*t+i[5]*a+i[13],b=i[2]*t+i[6]*a+i[14],_=i[3]*t+i[7]*a+i[15],y=m+s,v=g+l,x=b+c,w=Math.max(_+u,1e-5),k=m+p,E=g+h,T=b+d,S=Math.max(_+f,1e-5);e.push(new bp(y/w,v/w,x/w)),r.push(new bp(k/S,E/S,T/S))}o.push(e),a.push(r)}return[o,a]}(t,r,n,i,o)}(o,n,p,u,c,a,g,h,f,o.center.lat,e.tileID.canonical),v=e.queryGeometry;return function(e,t,r){let n=1/0;fc(r,t)&&(n=yp(r,t[0]));for(let i=0;i<t.length;i++){const o=t[i],a=e[i];for(let e=0;e<o.length-1;e++){const t=o[e],i=[t,o[e+1],a[e+1],a[e],t];hc(r,i)&&(n=Math.min(n,yp(r,i)))}}return n!==1/0&&n}(b,_,v.isPointQuery()?v.screenBounds:v.screenGeometry)}},line:class extends is{constructor(e){super(e,Mp),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof Or,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Ip.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Cp(e)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getProgramConfiguration(e){return new Ka(this,e)}queryRadius(e){const t=e,r=Op(Ec("line-width",this,t),Ec("line-gap-width",this,t)),n=Ec("line-offset",this,t);return r/2+Math.abs(n)+Tc(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,r,n,i,o){if(e.queryGeometry.isAboveHorizon)return!1;const a=Sc(e.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),s=e.pixelToTileUnitsFactor/2*Op(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),l=this.paint.get("line-offset").evaluate(t,r);return l&&(n=function(e,t){const r=[],n=new y(0,0);for(let i=0;i<e.length;i++){const o=e[i],a=[];for(let e=0;e<o.length;e++){const r=o[e],i=o[e+1],s=0===e?n:r.sub(o[e-1])._unit()._perp(),l=e===o.length-1?n:i.sub(r)._unit()._perp(),c=s._add(l)._unit();c._mult(1/(c.x*l.x+c.y*l.y)),a.push(c._mult(t)._add(r))}r.push(a)}return r}(n,l*e.pixelToTileUnitsFactor)),function(e,t,r){for(let n=0;n<t.length;n++){const i=t[n];if(e.length>=3)for(let t=0;t<i.length;t++)if(xc(e,i[t]))return!0;if(mc(e,i,r))return!0}return!1}(a,n,s)}isTileClipped(){return!0}},symbol:hf,background:class extends is{constructor(e){super(e,df)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}},raster:class extends is{constructor(e){super(e,ff)}getProgramIds(){return["raster"]}},sky:class extends is{constructor(e){super(e,gf),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"sky-gradient"===e?this._updateColorRamp():"sky-atmosphere-sun"!==e&&"sky-atmosphere-halo-color"!==e&&"sky-atmosphere-color"!==e&&"sky-atmosphere-sun-intensity"!==e||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=Vc({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(e){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const t=e.style.light.properties.get("position");return this._lightPosition.azimuthal!==t.azimuthal||this._lightPosition.polar!==t.polar}return!1}getCenter(e,t){if("atmosphere"===this.paint.get("sky-type")){const r=this.paint.get("sky-atmosphere-sun"),n=!r,i=e.style.light,o=i.properties.get("position");return n&&"viewport"===i.properties.get("anchor")&&G("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),n?bf(o.azimuthal,90-o.polar,t):bf(r[0],90-r[1],t)}const r=this.paint.get("sky-gradient-center");return bf(r[0],90-r[1],t)}is3D(){return!1}isSky(){return!0}markSkyboxValid(e){this._skyboxInvalidated=!1,this._lightPosition=e.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const e=this.paint.get("sky-type");return"atmosphere"===e?["skyboxCapture","skybox"]:"gradient"===e?["skyboxGradient"]:null}}};class yf{constructor(e,t,r,n){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,n)}update(e,t,n){const{width:i,height:o}=e,{context:a}=this,{gl:s}=a,{HTMLImageElement:l,HTMLCanvasElement:c,HTMLVideoElement:u,ImageData:p,ImageBitmap:h}=r;if(s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!t||!1!==t.premultiply)),n||this.size&&this.size[0]===i&&this.size[1]===o){const{x:t,y:r}=n||{x:0,y:0};e instanceof l||e instanceof c||e instanceof u||e instanceof p||h&&e instanceof h?s.texSubImage2D(s.TEXTURE_2D,0,t,r,s.RGBA,s.UNSIGNED_BYTE,e):s.texSubImage2D(s.TEXTURE_2D,0,t,r,i,o,s.RGBA,s.UNSIGNED_BYTE,e.data)}else this.size=[i,o],e instanceof l||e instanceof c||e instanceof u||e instanceof p||h&&e instanceof h?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,e):s.texImage2D(s.TEXTURE_2D,0,this.format,i,o,0,this.format,s.UNSIGNED_BYTE,e.data);this.useMipmap=Boolean(t&&t.useMipmap&&this.isSizePowerOfTwo()),this.useMipmap&&s.generateMipmap(s.TEXTURE_2D)}bind(e,t){const{context:r}=this,{gl:n}=r;n.bindTexture(n.TEXTURE_2D,this.texture),e!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,this.useMipmap?e===n.NEAREST?n.NEAREST_MIPMAP_NEAREST:n.LINEAR_MIPMAP_NEAREST:e),this.filter=e),t!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrap=t)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class vf{constructor(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){this._channel=void 0,this._callback=()=>{}}}class xf{constructor(){this.tasks={},this.taskQueue=[],j(["process"],this),this.invoker=new vf(this.process),this.nextId=0}add(e,t){const r=this.nextId++,n=function({type:e,isSymbolTile:t,zoom:r}){return r=r||0,"message"===e?0:"maybePrepare"!==e||t?"parseTile"!==e||t?"parseTile"===e&&t?300-r:"maybePrepare"===e&&t?400-r:500:200-r:100-r}(t);if(0===n){Z();try{e()}finally{}return{cancel:()=>{}}}return this.tasks[r]={fn:e,metadata:t,priority:n,id:r},this.taskQueue.push(r),this.invoker.trigger(),{cancel:()=>{delete this.tasks[r]}}}process(){Z();try{if(this.taskQueue=this.taskQueue.filter((e=>!!this.tasks[e])),!this.taskQueue.length)return;const e=this.pick();if(null===e)return;const t=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!t)return;t.fn()}finally{}}pick(){let e=null,t=1/0;for(let r=0;r<this.taskQueue.length;r++){const n=this.tasks[this.taskQueue[r]];n.priority<t&&(t=n.priority,e=r)}if(null===e)return null;const r=this.taskQueue[e];return this.taskQueue.splice(e,1),r}remove(){this.invoker.remove()}}class wf{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){const r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}const kf=["tile","layer","source","sourceLayer","state"];class Ef{constructor(e,t,r,n,i){this.type="Feature",this._vectorTileFeature=e,this._z=t,this._x=r,this._y=n,this.properties=e.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};void 0!==this.id&&(e.id=this.id);for(const t of kf)void 0!==this[t]&&(e[t]=this[t]);return e}}const Tf=32,Sf=33,Cf=new Uint16Array(8184);for(let e=0;e<2046;e++){let t=e+2,r=0,n=0,i=0,o=0,a=0,s=0;for(1&t?i=o=a=Tf:r=n=s=Tf;(t>>=1)>1;){const e=r+i>>1,l=n+o>>1;1&t?(i=r,o=n,r=a,n=s):(r=i,n=o,i=a,o=s),a=e,s=l}const l=4*e;Cf[l+0]=r,Cf[l+1]=n,Cf[l+2]=i,Cf[l+3]=o}const Af=new Uint16Array(2178),Mf=new Uint8Array(1089),If=new Uint16Array(1089);function Of(e){return 0===e?-.03125:32===e?.03125:0}var Lf=No([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const zf={type:2,extent:ls,loadGeometry:()=>[[new y(0,0),new y(ls+1,0),new y(ls+1,ls+1),new y(0,ls+1),new y(0,0)]]};class Df{constructor(e,t,r,n,i){this.tileID=e,this.uid=P(),this.uses=0,this.tileSize=t,this.tileZoom=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=i,this.expiredRequestCount=0,this.state="loading",n&&n.transform&&(this.projection=n.transform.projection)}registerFadeDuration(e){const t=e+this.timeAdded;t<Xe.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}get tileTransform(){return this._tileTransform||(this._tileTransform=Od(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(e,t,r){if(this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(e,t){const r={};if(!t)return r;for(const n of e){const e=n.layerIds.map((e=>t.getLayer(e))).filter(Boolean);if(0!==e.length){n.layers=e,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(const t of e)r[t.id]=n}}return r}(e.buckets,t.style),this.hasSymbolBuckets=!1;for(const e in this.buckets){const t=this.buckets[e];if(t instanceof lf){if(this.hasSymbolBuckets=!0,!r)break;t.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const e in this.buckets){const t=this.buckets[e];if(t instanceof lf&&t.hasRTLText){this.hasRTLText=!0,wo.isLoading()||wo.isLoaded()||"deferred"!==vo()||xo();break}}this.queryPadding=0;for(const e in this.buckets){const r=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(e).queryRadius(r))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.lineAtlas&&(this.lineAtlas=e.lineAtlas)}else this.collisionBoxArray=new fa}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.id]}upload(e){for(const t in this.buckets){const r=this.buckets[t];r.uploadPending()&&r.upload(e)}const t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new yf(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new yf(e,this.glyphAtlasImage,t.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new yf(e,this.lineAtlas.image,t.ALPHA),this.lineAtlas.uploaded=!0)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,r,n,i,o,a,s){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:n,pixelPosMatrix:a,transform:o,params:i,tileTransform:this.tileTransform},e,t,r):{}}querySourceFeatures(e,t){const r=this.latestFeatureIndex;if(!r||!r.rawTileData)return;const n=r.loadVTLayers(),i=t?t.sourceLayer:"",o=n._geojsonTileLayer||n[i];if(!o)return;const a=hi(t&&t.filter),{z:s,x:l,y:c}=this.tileID.canonical,u={z:s,x:l,y:c};for(let t=0;t<o.length;t++){const n=o.feature(t);if(a.needGeometry){const e=lc(n,!0);if(!a.filter(new ko(this.tileID.overscaledZ),e,this.tileID.canonical))continue}else if(!a.filter(new ko(this.tileID.overscaledZ),n))continue;const p=r.getId(n,i),h=new Ef(n,s,l,c,p);h.tile=u,e.push(h)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const t=this.expirationTime;if(e.cacheControl){const t=X(e.cacheControl);t["max-age"]&&(this.expirationTime=Date.now()+1e3*t["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const e=Date.now();let r=!1;if(this.expirationTime>e)r=!1;else if(t)if(this.expirationTime<t)r=!0;else{const n=this.expirationTime-t;n?this.expirationTime=e+Math.max(n,3e4):r=!0}else r=!0;r?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(e,t){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(e).length||!t)return;const r=this.latestFeatureIndex.loadVTLayers(),n=t.style.listImages();for(const i in this.buckets){if(!t.style.hasLayer(i))continue;const o=this.buckets[i],a=o.layers[0].sourceLayer||"_geojsonTileLayer",s=r[a],l=e[a];if(!s||!l||0===Object.keys(l).length)continue;if(o.update(l,s,n,this.imageAtlas&&this.imageAtlas.patternPositions||{}),o instanceof Cp||o instanceof Au){const e=t.style._getSourceCache(o.layers[0].source);t._terrain&&t._terrain.enabled&&e&&o.programConfigurations.needsUpload&&t._terrain._clearRenderCacheForTile(e.id,this.tileID)}const c=t&&t.style&&t.style.getLayer(i);c&&(this.queryPadding=Math.max(this.queryPadding,c.queryRadius(o)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Xe.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=Xe.now()+e}setTexture(e,t){const r=t.context,n=r.gl;this.texture=this.texture||t.getTileTexture(e.width),this.texture?this.texture.update(e,{useMipmap:!0}):(this.texture=new yf(r,e,n.RGBA,{useMipmap:!0}),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE))}setDependencies(e,t){const r={};for(const e of t)r[e]=!0;this.dependencies[e]=r}hasDependency(e,t){for(const r of e){const e=this.dependencies[r];if(e)for(const r of t)if(e[r])return!0}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(e,t){if(!t||"mercator"===t.name||this._tileDebugBuffer)return;const r=sc(zf,this.tileID.canonical,this.tileTransform)[0],n=new Vo,i=new pa;for(let e=0;e<r.length;e++){const{x:t,y:o}=r[e];n.emplaceBack(t,o),i.emplaceBack(e)}i.emplaceBack(0),this._tileDebugIndexBuffer=e.createIndexBuffer(i),this._tileDebugBuffer=e.createVertexBuffer(n,tl.members),this._tileDebugSegments=ss.simpleSegment(0,0,n.length,i.length)}_makeTileBoundsBuffers(e,t){if(this._tileBoundsBuffer||!t||"mercator"===t.name)return;const r=sc(zf,this.tileID.canonical,this.tileTransform)[0];let n,i;if(this.isRaster){const e=function(e,t){const r=Od(e,t),n=Math.pow(2,e.z);for(let i=0;i<Sf;i++)for(let o=0;o<Sf;o++){const a=Zl((e.x+(o+Of(o))/Tf)/n),s=Xl((e.y+(i+Of(i))/Tf)/n),l=t.project(a,s),c=i*Sf+o;Af[2*c+0]=Math.round((l.x*r.scale-r.x)*ls),Af[2*c+1]=Math.round((l.y*r.scale-r.y)*ls)}Mf.fill(0),If.fill(0);for(let e=2045;e>=0;e--){const t=4*e,r=Cf[t+0],n=Cf[t+1],i=Cf[t+2],o=Cf[t+3],a=r+i>>1,s=n+o>>1,l=a+s-n,c=s+r-a,u=n*Sf+r,p=o*Sf+i,h=s*Sf+a,d=Math.hypot((Af[2*u+0]+Af[2*p+0])/2-Af[2*h+0],(Af[2*u+1]+Af[2*p+1])/2-Af[2*h+1])>=16;Mf[h]=Mf[h]||(d?1:0),e<1022&&(Mf[h]=Mf[h]||Mf[(n+c>>1)*Sf+(r+l>>1)]||Mf[(o+c>>1)*Sf+(i+l>>1)])}const i=new $o,o=new ia;let a=0;function s(e,t){const r=t*Sf+e;return 0===If[r]&&(i.emplaceBack(Af[2*r+0],Af[2*r+1],e*ls/Tf,t*ls/Tf),If[r]=++a),If[r]-1}function l(e,t,r,n,i,a){const c=e+r>>1,u=t+n>>1;if(Math.abs(e-i)+Math.abs(t-a)>1&&Mf[u*Sf+c])l(i,a,e,t,c,u),l(r,n,i,a,c,u);else{const l=s(e,t),c=s(r,n),u=s(i,a);o.emplaceBack(l,c,u)}}return l(0,0,Tf,Tf,Tf,0),l(Tf,Tf,0,0,0,Tf),{vertices:i,indices:o}}(this.tileID.canonical,t);n=e.vertices,i=e.indices}else{n=new $o,i=new ia;for(const{x:e,y:t}of r)n.emplaceBack(e,t,0,0);const e=yu(n.int16,void 0,4);for(let t=0;t<e.length;t+=3)i.emplaceBack(e[t],e[t+1],e[t+2])}this._tileBoundsBuffer=e.createVertexBuffer(n,Lf.members),this._tileBoundsIndexBuffer=e.createIndexBuffer(i),this._tileBoundsSegments=ss.simpleSegment(0,0,n.length,i.length)}_makeGlobeTileDebugBuffers(e,t){const r=t.projection;if(!r||"globe"!==r.name||t.freezeTileCoverage)return;const n=this.tileID.canonical,i=Ol(xl(n,t)),o=Dl(t.zoom);let a;o>0&&(a=ms(new Float64Array(16),t.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(e,n,t,i,a,o),this._makeGlobeTileDebugTextBuffer(e,n,t,i,a,o)}_globePoint(e,t,r,n,i,o,a){let s=Al(e,t,r);if(o){const i=1<<r.z,l=Gl(n.center.lng),c=Wl(n.center.lat),u=(r.x+.5)/i-l;let p=0;u>.5?p=-1:u<-.5&&(p=1);let h=(e/ls+r.x)/i+p,d=(t/ls+r.y)/i;h=(h-l)*n._pixelsPerMercatorPixel+l,d=(d-c)*n._pixelsPerMercatorPixel+c;const f=[h*n.worldSize,d*n.worldSize,0];Fs(f,f,o),s=vl(s,f,a)}return Fs(s,s,i)}_makeGlobeTileDebugBorderBuffer(e,t,r,n,i,o){const a=new Vo,s=new pa,l=new qo,c=(e,c,u,p,h)=>{const d=(u-e)/(h-1),f=(p-c)/(h-1),m=a.length;for(let u=0;u<h;u++){const p=e+u*d,h=c+u*f;a.emplaceBack(p,h);const g=this._globePoint(p,h,t,r,n,i,o);l.emplaceBack(g[0],g[1],g[2]),s.emplaceBack(m+u)}},u=ls;c(0,0,u,0,16),c(u,0,u,u,16),c(u,u,0,u,16),c(0,u,0,0,16),this._tileDebugIndexBuffer=e.createIndexBuffer(s),this._tileDebugBuffer=e.createVertexBuffer(a,tl.members),this._globeTileDebugBorderBuffer=e.createVertexBuffer(l,el.members),this._tileDebugSegments=ss.simpleSegment(0,0,a.length,s.length)}_makeGlobeTileDebugTextBuffer(e,t,r,n,i,o){const a=ls/4,s=new Vo,l=new ia,c=new qo,u=25;l.reserve(32),s.reserve(u),c.reserve(u);const p=(e,t)=>u*e+t;for(let e=0;e<u;e++){const l=e*a;for(let e=0;e<u;e++){const u=e*a;s.emplaceBack(u,l);const p=this._globePoint(u,l,t,r,n,i,o);c.emplaceBack(p[0],p[1],p[2])}}for(let e=0;e<4;e++)for(let t=0;t<4;t++){const r=p(e,t),n=p(e,t+1),i=p(e+1,t),o=p(e+1,t+1);l.emplaceBack(r,n,i),l.emplaceBack(i,n,o)}this._tileDebugTextIndexBuffer=e.createIndexBuffer(l),this._tileDebugTextBuffer=e.createVertexBuffer(s,tl.members),this._globeTileDebugTextBuffer=e.createVertexBuffer(c,el.members),this._tileDebugTextSegments=ss.simpleSegment(0,0,u,32)}}class Pf{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,t,r){const n=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][n]=this.stateChanges[e][n]||{},z(this.stateChanges[e][n],r),null===this.deletedStates[e]){this.deletedStates[e]={};for(const t in this.state[e])t!==n&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][n]){this.deletedStates[e][n]={};for(const t in this.state[e][n])r[t]||(this.deletedStates[e][n][t]=null)}else for(const t in r)this.deletedStates[e]&&this.deletedStates[e][n]&&null===this.deletedStates[e][n][t]&&delete this.deletedStates[e][n][t]}removeFeatureState(e,t,r){if(null===this.deletedStates[e])return;const n=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&void 0!==t)null!==this.deletedStates[e][n]&&(this.deletedStates[e][n]=this.deletedStates[e][n]||{},this.deletedStates[e][n][r]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][n])for(r in this.deletedStates[e][n]={},this.stateChanges[e][n])this.deletedStates[e][n][r]=null;else this.deletedStates[e][n]=null;else this.deletedStates[e]=null}getState(e,t){const r=String(t),n=z({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){const r=this.deletedStates[e][t];if(null===r)return{};for(const e in r)delete n[e]}return n}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(e,t){const r={};for(const e in this.stateChanges){this.state[e]=this.state[e]||{};const t={};for(const r in this.stateChanges[e])this.state[e][r]||(this.state[e][r]={}),z(this.state[e][r],this.stateChanges[e][r]),t[r]=this.state[e][r];r[e]=t}for(const e in this.deletedStates){this.state[e]=this.state[e]||{};const t={};if(null===this.deletedStates[e])for(const r in this.state[e])t[r]={},this.state[e][r]={};else for(const r in this.deletedStates[e]){if(null===this.deletedStates[e][r])this.state[e][r]={};else if(this.state[e][r])for(const t of Object.keys(this.deletedStates[e][r]))delete this.state[e][r][t];t[r]=this.state[e][r]}r[e]=r[e]||{},z(r[e],t)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(const n in e)e[n].setFeatureState(r,t)}}class Rf{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,t){const r=this.toIdx(e,t);return{min:this.minimums[r],max:this.maximums[r]}}isLeaf(e,t){return this.leaves[this.toIdx(e,t)]}toIdx(e,t){return t*this.size+e}}function Bf(e,t,r,n){let i=0,o=Number.MAX_VALUE;for(let a=0;a<3;a++)if(Math.abs(n[a])<1e-15){if(r[a]<e[a]||r[a]>t[a])return null}else{const s=1/n[a];let l=(e[a]-r[a])*s,c=(t[a]-r[a])*s;if(l>c){const e=l;l=c,c=e}if(l>i&&(i=l),c<o&&(o=c),i>o)return null}return i}function Ff(e,t,r,n,i,o,a,s,l,c,u){const p=n-e,h=i-t,d=o-r,f=a-e,m=s-t,g=l-r,b=u[1]*g-u[2]*m,_=u[2]*f-u[0]*g,y=u[0]*m-u[1]*f,v=p*b+h*_+d*y;if(Math.abs(v)<1e-15)return null;const x=1/v,w=c[0]-e,k=c[1]-t,E=c[2]-r,T=(w*b+k*_+E*y)*x;if(T<0||T>1)return null;const S=k*d-E*h,C=E*p-w*d,A=w*h-k*p,M=(u[0]*S+u[1]*C+u[2]*A)*x;return M<0||T+M>1?null:(f*S+m*C+g*A)*x}function jf(e,t,r){return(e-t)/(r-t)}function Nf(e,t,r,n,i,o,a,s,l){const c=1<<r,u=o-n,p=a-i,h=(e+1)/c*u+n,d=(t+0)/c*p+i,f=(t+1)/c*p+i;s[0]=(e+0)/c*u+n,s[1]=d,l[0]=h,l[1]=f}class Uf{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const t=function(e){const t=Math.ceil(Math.log2(e.dim/8)),r=[];let n=Math.ceil(Math.pow(2,t));const i=1/n,o=(e,t,r,n,i)=>{const o=n?1:0,a=(e+1)*r-o,s=t*r,l=(t+1)*r-o;i[0]=e*r,i[1]=s,i[2]=a,i[3]=l};let a=new Rf(n);const s=[];for(let t=0;t<n*n;t++){o(t%n,Math.floor(t/n),i,!1,s);const r=qf(s[0],s[1],e),l=qf(s[2],s[1],e),c=qf(s[2],s[3],e),u=qf(s[0],s[3],e);a.minimums.push(Math.min(r,l,c,u)),a.maximums.push(Math.max(r,l,c,u)),a.leaves.push(1)}for(r.push(a),n/=2;n>=1;n/=2){const e=r[r.length-1];a=new Rf(n);for(let t=0;t<n*n;t++){o(t%n,Math.floor(t/n),2,!0,s);const r=e.getElevation(s[0],s[1]),i=e.getElevation(s[2],s[1]),l=e.getElevation(s[2],s[3]),c=e.getElevation(s[0],s[3]),u=e.isLeaf(s[0],s[1]),p=e.isLeaf(s[2],s[1]),h=e.isLeaf(s[2],s[3]),d=e.isLeaf(s[0],s[3]),f=Math.min(r.min,i.min,l.min,c.min),m=Math.max(r.max,i.max,l.max,c.max),g=u&&p&&h&&d;a.maximums.push(m),a.minimums.push(f),a.leaves.push(m-f<=5&&g?1:0)}r.push(a)}return r}(this.dem),r=t.length-1,n=t[r];this._addNode(n.minimums[0],n.maximums[0],n.leaves[0]),this._construct(t,0,0,r,0)}raycastRoot(e,t,r,n,i,o,a=1){return Bf([e,t,-100],[r,n,this.maximums[0]*a],i,o)}raycast(e,t,r,n,i,o,a=1){if(!this.nodeCount)return null;const s=this.raycastRoot(e,t,r,n,i,o,a);if(null==s)return null;const l=[],c=[],u=[],p=[],h=[{idx:0,t:s,nodex:0,nodey:0,depth:0}];for(;h.length>0;){const{idx:s,t:d,nodex:f,nodey:m,depth:g}=h.pop();if(this.leaves[s]){Nf(f,m,g,e,t,r,n,u,p);const s=1<<g,l=(f+0)/s,c=(f+1)/s,h=(m+0)/s,b=(m+1)/s,_=qf(l,h,this.dem)*a,y=qf(c,h,this.dem)*a,v=qf(c,b,this.dem)*a,x=qf(l,b,this.dem)*a,w=Ff(u[0],u[1],_,p[0],u[1],y,p[0],p[1],v,i,o),k=Ff(p[0],p[1],v,u[0],p[1],x,u[0],u[1],_,i,o),E=Math.min(null!==w?w:Number.MAX_VALUE,null!==k?k:Number.MAX_VALUE);if(E!==Number.MAX_VALUE)return E;{const e=Ds([],i,o,d);if(Vf(_,y,x,v,jf(e[0],u[0],p[0]),jf(e[1],u[1],p[1]))>=e[2])return d}continue}let b=0;for(let h=0;h<this._siblingOffset.length;h++){Nf((f<<1)+this._siblingOffset[h][0],(m<<1)+this._siblingOffset[h][1],g+1,e,t,r,n,u,p),u[2]=-100,p[2]=this.maximums[this.childOffsets[s]+h]*a;const d=Bf(u,p,i,o);if(null!=d){const e=d;l[h]=e;let t=!1;for(let r=0;r<b&&!t;r++)e>=l[c[r]]&&(c.splice(r,0,h),t=!0);t||(c[b]=h),b++}}for(let e=0;e<b;e++){const t=c[e];h.push({idx:this.childOffsets[s]+t,t:l[t],nodex:(f<<1)+this._siblingOffset[t][0],nodey:(m<<1)+this._siblingOffset[t][1],depth:g+1})}}return null}_addNode(e,t,r){return this.minimums.push(e),this.maximums.push(t),this.leaves.push(r),this.childOffsets.push(0),this.nodeCount++}_construct(e,t,r,n,i){if(1===e[n].isLeaf(t,r))return;this.childOffsets[i]||(this.childOffsets[i]=this.nodeCount);const o=n-1,a=e[o];let s=0,l=0;for(let e=0;e<this._siblingOffset.length;e++){const n=2*t+this._siblingOffset[e][0],i=2*r+this._siblingOffset[e][1],o=a.getElevation(n,i),c=a.isLeaf(n,i),u=this._addNode(o.min,o.max,c);c&&(s|=1<<e),l||(l=u)}for(let n=0;n<this._siblingOffset.length;n++)s&1<<n||this._construct(e,2*t+this._siblingOffset[n][0],2*r+this._siblingOffset[n][1],o,l+n)}}function Vf(e,t,r,n,i,o){return Lr(Lr(e,r,o),Lr(t,n,o),i)}function qf(e,t,r){const n=r.dim,i=A(e*n-.5,0,n-1),o=A(t*n-.5,0,n-1),a=Math.floor(i),s=Math.floor(o),l=Math.min(a+1,n-1),c=Math.min(s+1,n-1);return Vf(r.get(a,s),r.get(l,s),r.get(a,c),r.get(l,c),i-a,o-s)}const $f={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function Gf(e,t,r){return(256*e*256+256*t+r)/10-1e4}function Wf(e,t,r){return 256*e+t+r/256-32768}class Hf{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,t,r,n=!1,i=!1){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return G(`"${r}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;const o=this.dim=t.height-2,a=new Uint32Array(t.data.buffer);if(this.pixels=new Uint8Array(t.data.buffer),this.encoding=r||"mapbox",this.borderReady=n,!n){for(let e=0;e<o;e++)a[this._idx(-1,e)]=a[this._idx(0,e)],a[this._idx(o,e)]=a[this._idx(o-1,e)],a[this._idx(e,-1)]=a[this._idx(e,0)],a[this._idx(e,o)]=a[this._idx(e,o-1)];a[this._idx(-1,-1)]=a[this._idx(0,0)],a[this._idx(o,-1)]=a[this._idx(o-1,0)],a[this._idx(-1,o)]=a[this._idx(0,o-1)],a[this._idx(o,o)]=a[this._idx(o-1,o-1)],i&&this._buildQuadTree()}}_buildQuadTree(){this._tree=new Uf(this)}get(e,t,r=!1){r&&(e=A(e,-1,this.dim),t=A(t,-1,this.dim));const n=4*this._idx(e,t);return("terrarium"===this.encoding?Wf:Gf)(this.pixels[n],this.pixels[n+1],this.pixels[n+2])}static getUnpackVector(e){return $f[e]}get unpackVector(){return $f[this.encoding]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}static pack(e,t){const r=[0,0,0,0],n=Hf.getUnpackVector(t);let i=Math.floor((e+n[3])/n[2]);return r[2]=i%256,i=Math.floor(i/256),r[1]=i%256,i=Math.floor(i/256),r[0]=i,r}getPixels(){return new Nc({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let n=t*this.dim,i=t*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}const s=-t*this.dim,l=-r*this.dim;for(let t=o;t<a;t++)for(let r=n;r<i;r++){const n=4*this._idx(r,t),i=4*this._idx(r+s,t+l);this.pixels[n+0]=e.pixels[i+0],this.pixels[n+1]=e.pixels[i+1],this.pixels[n+2]=e.pixels[i+2],this.pixels[n+3]=e.pixels[i+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}Ki(Hf,"DEMData"),Ki(Uf,"DemMinMaxQuadTree",{omit:["dem"]});class Zf{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(const e in this.data)for(const t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,r){const n=e.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);const i={value:t,timeout:void 0};if(void 0!==r&&(i.timeout=setTimeout((()=>{this.remove(e,i)}),r)),this.data[n].push(i),this.order.push(n),this.order.length>this.max){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){const t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;const r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){const t=[];for(const r in this.data)for(const n of this.data[r])e(n.value)||t.push(n);for(const e of t)this.remove(e.value.tileID,e)}}class Xf{constructor(e,t,r){this.func=e,this.mask=t,this.range=r}}Xf.ReadOnly=!1,Xf.ReadWrite=!0,Xf.disabled=new Xf(519,Xf.ReadOnly,[0,1]);const Kf=7680;class Yf{constructor(e,t,r,n,i,o){this.test=e,this.ref=t,this.mask=r,this.fail=n,this.depthFail=i,this.pass=o}}Yf.disabled=new Yf({func:519,mask:0},0,0,Kf,Kf,Kf);class Jf{constructor(e,t,r){this.blendFunction=e,this.blendColor=t,this.mask=r}}Jf.Replace=[1,0],Jf.disabled=new Jf(Jf.Replace,Lt.transparent,[!1,!1,!1,!1]),Jf.unblended=new Jf(Jf.Replace,Lt.transparent,[!0,!0,!0,!0]),Jf.alphaBlended=new Jf([1,771],Lt.transparent,[!0,!0,!0,!0]);const Qf=1029,em=2305;class tm{constructor(e,t,r){this.enable=e,this.mode=t,this.frontFace=r}}tm.disabled=new tm(!1,Qf,em),tm.backCCW=new tm(!0,Qf,em),tm.backCW=new tm(!0,Qf,2304),tm.frontCW=new tm(!0,1028,2304),tm.frontCCW=new tm(!0,1028,em);class rm extends et{constructor(e,t,r){super(),this.id=e,this._onlySymbols=r,t.on("data",(e=>{"source"===e.dataType&&"metadata"===e.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))})),t.on("error",(()=>{this._sourceErrored=!0})),this._source=t,this._tiles={},this._cache=new Zf(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new Pf,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(e){this.map=e,this._minTileCacheSize=void 0===this._minTileCacheSize&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const e in this._tiles){const t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,t){return e.isSymbolTile=this._onlySymbols,this._source.loadTile(e,t)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,(()=>{}))}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e,(()=>{}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const t in this._tiles){const r=this._tiles[t];r.upload(e),r.prepare(this.map.style.imageManager)}}getIds(){return L(this._tiles).map((e=>e.tileID)).sort(nm).map((e=>e.key))}getRenderableIds(e){const t=[];for(const r in this._tiles)this._isIdRenderable(+r,e)&&t.push(this._tiles[r]);return e?t.sort(((e,t)=>{const r=e.tileID,n=t.tileID,i=new y(r.canonical.x,r.canonical.y)._rotate(this.transform.angle),o=new y(n.canonical.x,n.canonical.y)._rotate(this.transform.angle);return r.overscaledZ-n.overscaledZ||o.y-i.y||o.x-i.x})).map((e=>e.tileID.key)):t.map((e=>e.tileID)).sort(nm).map((e=>e.key))}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(+e,"reloading")}}_reloadTile(e,t){const r=this._tiles[e];r&&("loading"!==r.state&&(r.state=t),this._loadTile(r,this._tileLoaded.bind(this,r,e,t)))}_tileLoaded(e,t,r,n){if(n)if(e.state="errored",404!==n.status)this._source.fire(new Qe(n,{tile:e}));else if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const e=this.map.painter.terrain;this.update(this.transform,e.getScaledDemTileSize(),!0),e.resetTileLookupCache(this.id)}else this.update(this.transform);else e.timeAdded=Xe.now(),"expired"===r&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(t,e),"raster-dem"===this._source.type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new Je("data",{dataType:"source",tile:e,coord:e.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const t=this.getRenderableIds();for(let n=0;n<t.length;n++){const i=t[n];if(e.neighboringTiles&&e.neighboringTiles[i]){const t=this.getTileByID(i);r(e,t),r(t,e)}}function r(e,t){if(!e.dem||e.dem.borderReady)return;e.needsHillshadePrepare=!0,e.needsDEMTextureUpload=!0;let r=t.tileID.canonical.x-e.tileID.canonical.x;const n=t.tileID.canonical.y-e.tileID.canonical.y,i=Math.pow(2,e.tileID.canonical.z),o=t.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,n),e.neighboringTiles&&e.neighboringTiles[o]&&(e.neighboringTiles[o].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,r,n){for(const i in this._tiles){let o=this._tiles[i];if(n[i]||!o.hasData()||o.tileID.overscaledZ<=t||o.tileID.overscaledZ>r)continue;let a=o.tileID;for(;o&&o.tileID.overscaledZ>t+1;){const e=o.tileID.scaledTo(o.tileID.overscaledZ-1);o=this._tiles[e.key],o&&o.hasData()&&(a=e)}let s=a;for(;s.overscaledZ>t;)if(s=s.scaledTo(s.overscaledZ-1),e[s.key]){n[a.key]=a;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){const r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(let r=e.overscaledZ-1;r>=t;r--){const t=e.scaledTo(r),n=this._getLoadedTile(t);if(n)return n}}_getLoadedTile(e){const t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,t){t=t||this._source.tileSize;const r=Math.ceil(e.width/t)+1,n=Math.ceil(e.height/t)+1,i=Math.floor(r*n*5),o="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,i):i,a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(a)}handleWrapJump(e){const t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){const e={};for(const r in this._tiles){const n=this._tiles[r];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+t),e[n.tileID.key]=n}this._tiles=e;for(const e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(const e in this._tiles)this._setTileReloadTimer(+e,this._tiles[e])}}update(e,t,r){if(this.transform=e,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!r)return;let n;this.updateCacheSize(e,t),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((e=>new mp(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y))):(n=e.coveringTiles({tileSize:t||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!r,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(n=n.filter((e=>this._source.hasTile(e))))):n=[];const i=this._updateRetainedTiles(n);if(im(this._source.type)&&0!==n.length){const e={},t={},r=Object.keys(i);for(const n of r){const r=i[n],o=this._tiles[n];if(!o||o.fadeEndTime&&o.fadeEndTime<=Xe.now())continue;const a=this.findLoadedParent(r,Math.max(r.overscaledZ-rm.maxOverzooming,this._source.minzoom));a&&(this._addTile(a.tileID),e[a.tileID.key]=a.tileID),t[n]=r}const o=n[n.length-1].overscaledZ;for(const e in this._tiles){const r=this._tiles[e];if(i[e]||!r.hasData())continue;let n=r.tileID;for(;n.overscaledZ>o;){n=n.scaledTo(n.overscaledZ-1);const o=this._tiles[n.key];if(o&&o.hasData()&&t[n.key]){i[e]=r.tileID;break}}}for(const t in e)i[t]||(this._coveredTiles[t]=!0,i[t]=e[t])}for(const e in i)this._tiles[e].clearFadeHold();const o=function(e,t){const r=[];for(const n in e)n in t||r.push(n);return r}(this._tiles,i);for(const e of o){const t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(+e)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const t={};if(0===e.length)return t;const r={},n=e.reduce(((e,t)=>Math.min(e,t.overscaledZ)),1/0),i=e[0].overscaledZ,o=Math.max(i-rm.maxOverzooming,this._source.minzoom),a=Math.max(i+rm.maxUnderzooming,this._source.minzoom),s={};for(const r of e){const e=this._addTile(r);t[r.key]=r,e.hasData()||n<this._source.maxzoom&&(s[r.key]=r)}this._retainLoadedChildren(s,n,a,t);for(const n of e){let e=this._tiles[n.key];if(e.hasData())continue;if(n.canonical.z>=this._source.maxzoom){const e=n.children(this._source.maxzoom)[0],r=this.getTile(e);if(r&&r.hasData()){t[e.key]=e;continue}}else{const e=n.children(this._source.maxzoom);if(t[e[0].key]&&t[e[1].key]&&t[e[2].key]&&t[e[3].key])continue}let i=e.wasRequested();for(let a=n.overscaledZ-1;a>=o;--a){const o=n.scaledTo(a);if(r[o.key])break;if(r[o.key]=!0,e=this.getTile(o),!e&&i&&(e=this._addTile(o)),e&&(t[o.key]=o,i=e.wasRequested(),e.hasData()))break}}return t}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const t=[];let r,n=this._tiles[e].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}t.push(n.key);const e=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(e),r)break;n=e}for(const e of t)this._loadedParentTiles[e]=r}}_addTile(e){let t=this._tiles[e.key];if(t)return t;t=this._cache.getAndRemove(e),t&&(this._setTileReloadTimer(e.key,t),t.tileID=e,this._state.initializeTileState(t,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,t)));const r=Boolean(t);if(!r){const r=this.map?this.map.painter:null;t=new Df(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,r,this._isRaster),this._loadTile(t,this._tileLoaded.bind(this,t,e.key,t.state))}return t?(t.uses++,this._tiles[e.key]=t,r||this._source.fire(new Je("dataloading",{tile:t,coord:t.tileID,dataType:"source"})),t):null}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const r=t.getExpiryTimeout();r&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),r))}_removeTile(e){const t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(e,t,r){const n=[],i=this.transform;if(!i)return n;const o="globe"===i.projection.name,a=Gl(i.center.lng);for(const s in this._tiles){const l=this._tiles[s];if(r&&l.clearQueryDebugViz(),l.holdingForFade())continue;let c;if(o){const e=l.tileID.canonical;if(0===e.z){const t=[Math.abs(A(a,...om(e,-1))-a),Math.abs(A(a,...om(e,1))-a)];c=[0,2*t.indexOf(Math.min(...t))-1]}else{const t=[Math.abs(A(a,...om(e,-1))-a),Math.abs(A(a,...om(e,0))-a),Math.abs(A(a,...om(e,1))-a)];c=[t.indexOf(Math.min(...t))-1]}}else c=[0];for(const r of c){const o=e.containsTile(l,i,t,r);o&&n.push(o)}}return n}getVisibleCoordinates(e){const t=this.getRenderableIds(e).map((e=>this._tiles[e].tileID));for(const e of t)e.projMatrix=this.transform.calculateProjMatrix(e.toUnwrapped());return t}hasTransition(){if(this._source.hasTransition())return!0;if(im(this._source.type))for(const e in this._tiles){const t=this._tiles[e];if(void 0!==t.fadeEndTime&&t.fadeEndTime>=Xe.now())return!0}return!1}setFeatureState(e,t,r){this._state.updateState(e=e||"_geojsonTileLayer",t,r)}removeFeatureState(e,t,r){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,r)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,r){const n=this._tiles[e];n&&n.setDependencies(t,r)}reloadTilesForDependencies(e,t){for(const r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(+r,"reloading");this._cache.filter((r=>!r.hasDependency(e,t)))}_preloadTiles(e,t){if(!this._sourceLoaded){const r=()=>{this._sourceLoaded&&(this._source.off("data",r),this._preloadTiles(e,t))};return void this._source.on("data",r)}const r=new Map,n=Array.isArray(e)?e:[e],i=this.map.painter.terrain,o=this.usedForTerrain&&i?i.getScaledDemTileSize():this._source.tileSize;for(const e of n){const t=e.coveringTiles({tileSize:o,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const e of t)r.set(e.key,e);this.usedForTerrain&&e.updateElevation(!1)}O(Array.from(r.values()),((e,t)=>{const r=new Df(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(r,(e=>{"raster-dem"===this._source.type&&r.dem&&this._backfillDEM(r),t(e,r)}))}),t)}}function nm(e,t){const r=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function im(e){return"raster"===e||"image"===e||"video"===e||"custom"===e}function om(e,t){const r=1<<e.z;return[e.x/r+t,(e.x+1)/r+t]}rm.maxOverzooming=10,rm.maxUnderzooming=3;class am{constructor(e,t,r){this._demTile=e,this._dem=this._demTile.dem,this._scale=t,this._offset=r}static create(e,t,r){const n=r||e.findDEMTileFor(t);if(!n||!n.dem)return;const i=n.dem,o=n.tileID,a=1<<t.canonical.z-o.canonical.z;return new am(n,n.tileSize/ls/a,[(t.canonical.x/a-o.canonical.x)*i.dim,(t.canonical.y/a-o.canonical.y)*i.dim])}tileCoordToPixel(e,t){const r=t*this._scale+this._offset[1],n=Math.floor(e*this._scale+this._offset[0]),i=Math.floor(r);return new y(n,i)}getElevationAt(e,t,r,n){const i=e*this._scale+this._offset[0],o=t*this._scale+this._offset[1],a=Math.floor(i),s=Math.floor(o),l=this._dem;return n=!!n,r?Lr(Lr(l.get(a,s,n),l.get(a,s+1,n),o-s),Lr(l.get(a+1,s,n),l.get(a+1,s+1,n),o-s),i-a):l.get(a,s,n)}getElevationAtPixel(e,t,r){return this._dem.get(e,t,!!r)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*Hl(1,e)*this._dem.stride}}class sm{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Zi(ls,16,0),this.featureIndexArray=new wa,this.promoteId=t}insert(e,t,r,n,i,o=0){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i,o);const s=this.grid;for(let e=0;e<t.length;e++){const r=t[e],n=[1/0,1/0,-1/0,-1/0];for(let e=0;e<r.length;e++){const t=r[e];n[0]=Math.min(n[0],t.x),n[1]=Math.min(n[1],t.y),n[2]=Math.max(n[2],t.x),n[3]=Math.max(n[3],t.y)}n[0]<ls&&n[1]<ls&&n[2]>=0&&n[3]>=0&&s.insert(a,n[0],n[1],n[2],n[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Hu(new bh(this.rawTileData)).layers,this.sourceLayerCoder=new wf(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,t,r,n){this.loadVTLayers();const i=e.params||{},o=hi(i.filter),a=e.tileResult,s=e.transform,l=a.bufferedTilespaceBounds,c=this.grid.query(l.min.x,l.min.y,l.max.x,l.max.y,((e,t,r,n)=>wc(a.bufferedTilespaceGeometry,e,t,r,n)));c.sort(cm);let u=null;s.elevation&&c.length>0&&(u=am.create(s.elevation,this.tileID));const p={};let h;for(let s=0;s<c.length;s++){const l=c[s];if(l===h)continue;h=l;const d=this.featureIndexArray.get(l);let f=null;this.loadMatchingFeature(p,d,o,i.layers,i.availableImages,t,r,n,((t,r,n,i=0)=>(f||(f=sc(t,this.tileID.canonical,e.tileTransform)),r.queryIntersectsFeature(a,t,n,f,this.z,e.transform,e.pixelPosMatrix,u,i))))}return p}loadMatchingFeature(e,t,r,n,i,o,a,s,l){const{featureIndex:c,bucketIndex:u,sourceLayerIndex:p,layoutVertexArrayOffset:h}=t,d=this.bucketLayerIDs[u];if(n&&!function(e,t){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}(n,d))return;const f=this.sourceLayerCoder.decode(p),m=this.vtLayers[f].feature(c);if(r.needGeometry){const e=lc(m,!0);if(!r.filter(new ko(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!r.filter(new ko(this.tileID.overscaledZ),m))return;const g=this.getId(m,f);for(let t=0;t<d.length;t++){const r=d[t];if(n&&n.indexOf(r)<0)continue;const u=o[r];if(!u)continue;let p={};void 0!==g&&s&&(p=s.getState(u.sourceLayer||"_geojsonTileLayer",g));const f=z({},a[r]);f.paint=lm(f.paint,u.paint,m,p,i),f.layout=lm(f.layout,u.layout,m,p,i);const b=!l||l(m,u,p,h);if(!b)continue;const _=new Ef(m,this.z,this.x,this.y,g);_.layer=f;let y=e[r];void 0===y&&(y=e[r]=[]),y.push({featureIndex:c,feature:_,intersectionZ:b})}}lookupSymbolFeatures(e,t,r,n,i,o,a,s){const l={};this.loadVTLayers();const c=hi(i);for(const i of e)this.loadMatchingFeature(l,{bucketIndex:r,sourceLayerIndex:n,featureIndex:i,layoutVertexArrayOffset:0},c,o,a,s,t);return l}loadFeature(e){const{featureIndex:t,sourceLayerIndex:r}=e;this.loadVTLayers();const n=this.sourceLayerCoder.decode(r),i=this.vtFeatures[n];if(i[t])return i[t];const o=this.vtLayers[n].feature(t);return i[t]=o,o}hasLayer(e){for(const t of this.bucketLayerIDs)for(const r of t)if(e===r)return!0;return!1}getId(e,t){let r=e.id;if(this.promoteId){const n="string"==typeof this.promoteId?this.promoteId:this.promoteId[t];null!=n&&(r=e.properties[n]),"boolean"==typeof r&&(r=Number(r))}return r}}function lm(e,t,r,n,i){return U(e,((e,o)=>{const a=t instanceof Oo?t.get(o):null;return a&&a.evaluate?a.evaluate(r,n,i):a}))}function cm(e,t){return t-e}Ki(sm,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class um{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.image=new jc({width:e,height:t}),this.positions={},this.uploaded=!1}getDash(e,t){const r=this.getKey(e,t);return this.positions[r]}trim(){const e=this.width,t=this.height=B(this.nextRow);this.image.resize({width:e,height:t})}getKey(e,t){return e.join(",")+t}getDashRanges(e,t,r){const n=[];let i=e.length%2==1?-e[e.length-1]*r:0,o=e[0]*r,a=!0;n.push({left:i,right:o,isDash:a,zeroLength:0===e[0]});let s=e[0];for(let t=1;t<e.length;t++){a=!a;const l=e[t];i=s*r,s+=l,o=s*r,n.push({left:i,right:o,isDash:a,zeroLength:0===l})}return n}addRoundDash(e,t,r){const n=t/2;for(let t=-r;t<=r;t++){const i=this.width*(this.nextRow+r+t);let o=0,a=e[o];for(let s=0;s<this.width;s++){s/a.right>1&&(a=e[++o]);const l=Math.abs(s-a.left),c=Math.abs(s-a.right),u=Math.min(l,c);let p;const h=t/r*(n+1);if(a.isDash){const e=n-Math.abs(h);p=Math.sqrt(u*u+e*e)}else p=n-Math.sqrt(u*u+h*h);this.image.data[i+s]=Math.max(0,Math.min(255,p+128))}}}addRegularDash(e,t){for(let t=e.length-1;t>=0;--t){const r=e[t],n=e[t+1];r.zeroLength?e.splice(t,1):n&&n.isDash===r.isDash&&(n.left=r.left,e.splice(t,1))}const r=e[0],n=e[e.length-1];r.isDash===n.isDash&&(r.left=n.left-this.width,n.right=r.right+this.width);const i=this.width*this.nextRow;let o=0,a=e[o];for(let r=0;r<this.width;r++){r/a.right>1&&(a=e[++o]);const n=Math.abs(r-a.left),s=Math.abs(r-a.right),l=Math.min(n,s);this.image.data[i+r]=Math.max(0,Math.min(255,(a.isDash?l:-l)+t+128))}}addDash(e,t){const r=this.getKey(e,t);if(this.positions[r])return this.positions[r];const n="round"===t,i=n?7:0,o=2*i+1;if(this.nextRow+o>this.height)return G("LineAtlas out of space"),null;0===e.length&&e.push(1);let a=0;for(let t=0;t<e.length;t++)e[t]<0&&(G("Negative value is found in line dasharray, replacing values with 0"),e[t]=0),a+=e[t];if(0!==a){const r=this.width/a,o=this.getDashRanges(e,this.width,r);n?this.addRoundDash(o,r,i):this.addRegularDash(o,"square"===t?.5*r:0)}const s=this.nextRow+i;this.nextRow+=o;const l={tl:[s,i],br:[a,0]};return this.positions[r]=l,l}}Ki(um,"LineAtlas");const pm=1*td;class hm{constructor(e){const t={},r=[];for(const n in e){const i=e[n],o=t[n]={};for(const e in i.glyphs){const t=i.glyphs[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const n=t.metrics.localGlyph?pm:1,a={x:0,y:0,w:t.bitmap.width+2*n,h:t.bitmap.height+2*n};r.push(a),o[e]=a}}const{w:n,h:i}=kh(r),o=new jc({width:n||1,height:i||1});for(const r in e){const n=e[r];for(const e in n.glyphs){const i=n.glyphs[+e];if(!i||0===i.bitmap.width||0===i.bitmap.height)continue;const a=t[r][e],s=i.metrics.localGlyph?pm:1;jc.copy(i.bitmap,o,{x:0,y:0},{x:a.x+s,y:a.y+s},i.bitmap)}}this.image=o,this.positions=t}}Ki(hm,"GlyphAtlas");class dm{constructor(e){this.tileID=new mp(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.tileZoom=e.tileZoom,this.uid=e.uid,this.zoom=e.zoom,this.canonical=e.tileID.canonical,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.enableTerrain=!!e.enableTerrain,this.isSymbolTile=e.isSymbolTile,this.tileTransform=Od(e.tileID.canonical,e.projection),this.projection=e.projection}parse(e,t,r,n,i){this.status="parsing",this.data=e,this.collisionBoxArray=new fa;const o=new wf(Object.keys(e.layers).sort()),a=new sm(this.tileID,this.promoteId);a.bucketLayerIDs=[];const s={},l=new um(256,256),c={featureIndex:a,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:l,availableImages:r},u=t.familiesBySource[this.source];for(const t in u){const n=e.layers[t];if(!n)continue;let i=!1,l=!1;for(const e of u[t])"symbol"===e[0].type?i=!0:l=!0;if(!0===this.isSymbolTile&&!i)continue;if(!1===this.isSymbolTile&&!l)continue;1===n.version&&G(`Vector tile source "${this.source}" layer "${t}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const p=o.encode(t),h=[];for(let e=0;e<n.length;e++){const r=n.feature(e),i=a.getId(r,t);h.push({feature:r,id:i,index:e,sourceLayerIndex:p})}for(const e of u[t]){const t=e[0];void 0!==this.isSymbolTile&&"symbol"===t.type!==this.isSymbolTile||t.minzoom&&this.zoom<Math.floor(t.minzoom)||t.maxzoom&&this.zoom>=t.maxzoom||"none"!==t.visibility&&(fm(e,this.zoom,r),(s[t.id]=t.createBucket({index:a.bucketLayerIDs.length,layers:e,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:p,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:r})).populate(h,c,this.tileID.canonical,this.tileTransform),a.bucketLayerIDs.push(e.map((e=>e.id))))}}let p,h,d,f;l.trim();const m={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},g=()=>{if(p)return i(p);if(h&&d&&f){const e=new hm(h),t=new Sh(d,f);for(const n in s){const i=s[n];i instanceof lf?(fm(i.layers,this.zoom,r),vd(i,h,e.positions,d,t.iconPositions,this.showCollisionBoxes,r,this.tileID.canonical,this.tileZoom,this.projection)):i.hasPattern&&(i instanceof Cp||i instanceof Au||i instanceof tp)&&(fm(i.layers,this.zoom,r),i.addFeatures(c,this.tileID.canonical,t.patternPositions,r,this.tileTransform))}this.status="done",i(null,{buckets:L(s).filter((e=>!e.isEmpty())),featureIndex:a,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,lineAtlas:l,imageAtlas:t,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?d:null,glyphPositions:this.returnDependencies?e.positions:null})}},b=U(c.glyphDependencies,(e=>Object.keys(e).map(Number)));Object.keys(b).length?n.send("getGlyphs",{uid:this.uid,stacks:b},((e,t)=>{p||(p=e,h=t,g())}),void 0,!1,m):h={};const _=Object.keys(c.iconDependencies);_.length?n.send("getImages",{icons:_,source:this.source,tileID:this.tileID,type:"icons"},((e,t)=>{p||(p=e,d=t,g())}),void 0,!1,m):d={};const y=Object.keys(c.patternDependencies);y.length?n.send("getImages",{icons:y,source:this.source,tileID:this.tileID,type:"patterns"},((e,t)=>{p||(p=e,f=t,g())}),void 0,!1,m):f={},g()}}function fm(e,t,r){const n=new ko(t);for(const t of e)t.recalculate(n,r)}class mm{constructor(e){this.entries={},this.scheduler=e}request(e,t,r,n){const i=this.entries[e]=this.entries[e]||{callbacks:[]};if(i.result){const[e,r]=i.result;return this.scheduler?this.scheduler.add((()=>{n(e,r)}),t):n(e,r),()=>{}}return i.callbacks.push(n),i.cancel||(i.cancel=r(((r,n)=>{i.result=[r,n];for(const e of i.callbacks)this.scheduler?this.scheduler.add((()=>{e(r,n)}),t):e(r,n);setTimeout((()=>delete this.entries[e]),3e3)}))),()=>{i.result||(i.callbacks=i.callbacks.filter((e=>e!==n)),i.callbacks.length||(i.cancel(),delete this.entries[e]))}}}function gm(e,t,r){const n=JSON.stringify(e.request);return e.data&&(this.deduped.entries[n]={result:[null,e.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom},(t=>{const n=de(e.request,((e,n,i,o)=>{e?t(e):n&&t(null,{vectorTile:r?void 0:new Hu(new bh(n)),rawData:n,cacheControl:i,expires:o})}));return()=>{n.cancel(),t()}}),t)}const bm=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class _m{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(219!==t)throw new Error("Data does not appear to be in a KDBush format.");const n=r>>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const i=bm[15&r];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new _m(a,o,i,e)}constructor(e,t=64,r=Float64Array,n){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const i=bm.indexOf(this.ArrayType),o=2*e*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+a+s,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+o+a+s),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+a+s,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return ym(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,s=[0,i.length-1,0],l=[];for(;s.length;){const c=s.pop()||0,u=s.pop()||0,p=s.pop()||0;if(u-p<=a){for(let a=p;a<=u;a++){const s=o[2*a],c=o[2*a+1];s>=e&&s<=r&&c>=t&&c<=n&&l.push(i[a])}continue}const h=p+u>>1,d=o[2*h],f=o[2*h+1];d>=e&&d<=r&&f>=t&&f<=n&&l.push(i[h]),(0===c?e<=d:t<=f)&&(s.push(p),s.push(h-1),s.push(1-c)),(0===c?r>=d:n>=f)&&(s.push(h+1),s.push(u),s.push(1-c))}return l}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:i,nodeSize:o}=this,a=[0,n.length-1,0],s=[],l=r*r;for(;a.length;){const c=a.pop()||0,u=a.pop()||0,p=a.pop()||0;if(u-p<=o){for(let r=p;r<=u;r++)km(i[2*r],i[2*r+1],e,t)<=l&&s.push(n[r]);continue}const h=p+u>>1,d=i[2*h],f=i[2*h+1];km(d,f,e,t)<=l&&s.push(n[h]),(0===c?e-r<=d:t-r<=f)&&(a.push(p),a.push(h-1),a.push(1-c)),(0===c?e+r>=d:t+r>=f)&&(a.push(h+1),a.push(u),a.push(1-c))}return s}}function ym(e,t,r,n,i,o){if(i-n<=r)return;const a=n+i>>1;vm(e,t,a,n,i,o),ym(e,t,r,n,a-1,1-o),ym(e,t,r,a+1,i,1-o)}function vm(e,t,r,n,i,o){for(;i>n;){if(i-n>600){const a=i-n+1,s=r-n+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/a)*(s-a/2<0?-1:1);vm(e,t,r,Math.max(n,Math.floor(r-s*c/a+u)),Math.min(i,Math.floor(r+(a-s)*c/a+u)),o)}const a=t[2*r+o];let s=n,l=i;for(xm(e,t,n,r),t[2*i+o]>a&&xm(e,t,n,i);s<l;){for(xm(e,t,s,l),s++,l--;t[2*s+o]<a;)s++;for(;t[2*l+o]>a;)l--}t[2*n+o]===a?xm(e,t,n,l):(l++,xm(e,t,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function xm(e,t,r,n){wm(e,r,n),wm(t,2*r,2*n),wm(t,2*r+1,2*n+1)}function wm(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function km(e,t,r,n){const i=e-r,o=t-n;return i*i+o*o}e.ARRAY_TYPE=ps,e.AUTH_ERR_MSG=ye,e.Aabb=ol,e.Actor=class{constructor(e,t,n){this.target=e,this.parent=t,this.mapId=n,this.callbacks={},this.cancelCallbacks={},j(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=Z()?e:r,this.scheduler=new xf}send(e,t,r,n,i=!1,o){const a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(r.metadata=o,this.callbacks[a]=r);const s=Y(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:e,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:Qi(t,s)},s),{cancel:()=>{r&&delete this.callbacks[a],this.target.postMessage({id:a,type:"<cancel>",targetMapId:n,sourceMapId:this.mapId})}}}receive(e){const t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){const e=this.cancelCallbacks[r];delete this.cancelCallbacks[r],e&&e.cancel()}else if(t.mustQueue||Z()){const e=this.callbacks[r];this.cancelCallbacks[r]=this.scheduler.add((()=>this.processTask(r,t)),e&&e.metadata||{type:"message"})}else this.processTask(r,t)}processTask(e,t){if("<response>"===t.type){const r=this.callbacks[e];delete this.callbacks[e],r&&(t.error?r(eo(t.error)):r(null,eo(t.data)))}else{const r=Y(this.globalScope)?void 0:[],n=t.hasCallback?(t,n)=>{delete this.cancelCallbacks[e],this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:t?Qi(t):null,data:Qi(n,r)},r)}:e=>{},i=eo(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,i,n);else if(this.parent.getWorkerSource){const e=t.type.split(".");this.parent.getWorkerSource(t.sourceMapId,e[0],i.source)[e[1]](i,n)}else n(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},e.CanonicalTileID=dp,e.Color=Lt,e.ColorMode=Jf,e.CullFaceMode=tm,e.DEMData=Hf,e.DataConstantProperty=Lo,e.DedupedRequest=mm,e.DepthMode=Xf,e.EXTENT=ls,e.Elevation=class{isDataAvailableAtPoint(e){const t=this._source();if(this.isUsingMockSource()||!t||e.y<0||e.y>1)return!1;const r=t.getSource().maxzoom,n=1<<r,i=Math.floor(e.x),o=Math.floor((e.x-i)*n),a=Math.floor(e.y*n),s=this.findDEMTileFor(new mp(r,i,r,o,a));return!(!s||!s.dem)}getAtPointOrZero(e,t=0){return this.getAtPoint(e,t)||0}getAtPoint(e,t,r=!0){if(this.isUsingMockSource())return null;null==t&&(t=null);const n=this._source();if(!n)return t;if(e.y<0||e.y>1)return t;const i=n.getSource().maxzoom,o=1<<i,a=Math.floor(e.x),s=e.x-a,l=new mp(i,a,i,Math.floor(s*o),Math.floor(e.y*o)),c=this.findDEMTileFor(l);if(!c||!c.dem)return t;const u=c.dem,p=1<<c.tileID.canonical.z,h=(s*p-c.tileID.canonical.x)*u.dim,d=(e.y*p-c.tileID.canonical.y)*u.dim,f=Math.floor(h),m=Math.floor(d);return(r?this.exaggeration():1)*Lr(Lr(u.get(f,m),u.get(f,m+1),d-m),Lr(u.get(f+1,m),u.get(f+1,m+1),d-m),h-f)}getAtTileOffset(e,t,r){const n=1<<e.canonical.z;return this.getAtPointOrZero(new Ql(e.wrap+(e.canonical.x+t/ls)/n,(e.canonical.y+r/ls)/n))}getAtTileOffsetFunc(e,t,r,n){return i=>{const o=this.getAtTileOffset(e,i.x,i.y),a=n.upVector(e.canonical,i.x,i.y);return zs(a,a,o*n.upVectorScale(e.canonical,t,r).metersToTile),a}}getForTilePoints(e,t,r,n){if(this.isUsingMockSource())return!1;const i=am.create(this,e,n);return!!i&&(t.forEach((e=>{e[2]=this.exaggeration()*i.getElevationAt(e[0],e[1],r)})),!0)}getMinMaxForTile(e){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(e);if(!t||!t.dem)return null;const r=t.dem.tree,n=t.tileID,i=1<<e.canonical.z-n.canonical.z;let o=e.canonical.x/i-n.canonical.x,a=e.canonical.y/i-n.canonical.y,s=0;for(let t=0;t<e.canonical.z-n.canonical.z&&!r.leaves[s];t++){o*=2,a*=2;const e=2*Math.floor(a)+Math.floor(o);s=r.childOffsets[s]+e,o%=1,a%=1}return{min:this.exaggeration()*r.minimums[s],max:this.exaggeration()*r.maximums[s]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(e,t,r){throw new Error("Pure virtual method called.")}pointCoordinate(e){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(e){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}},e.ErrorEvent=Qe,e.EvaluationParameters=ko,e.Event=Je,e.Evented=et,e.FillExtrusionBucket=tp,e.Frustum=il,e.FrustumCorners=nl,e.GLOBE_RADIUS=ll,e.GLOBE_SCALE_MATCH_LATITUDE=45,e.GLOBE_ZOOM_THRESHOLD_MAX=sl,e.GLOBE_ZOOM_THRESHOLD_MIN=al,e.GlobeSharedBuffers=class{constructor(e){this._createGrid(e),this._createPoles(e)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const e of this._poleSegments)e.destroy();for(const e of this._gridSegments)e.withSkirts.destroy(),e.withoutSkirts.destroy();if(this._wireframeIndexBuffer){this._wireframeIndexBuffer.destroy();for(const e of this._wireframeSegments)e.destroy()}}_fillGridMeshWithLods(e,t){const r=new Vo,n=new ia,i=[],o=e+1+2,a=t[0]+1,s=t[0]+1+(1+t.length),l=(e,t,r)=>{let n=e===o-1?e-2:0===e?e:e-1;return n+=r?24575:0,[n,t]};for(let e=0;e<o;++e)r.emplaceBack(...l(e,0,!0));for(let e=0;e<a;++e)for(let t=0;t<o;++t)r.emplaceBack(...l(t,e,(0===t||t===o-1)&&!0));for(let e=0;e<t.length;++e){const n=t[e];for(let e=0;e<o;++e)r.emplaceBack(...l(e,n,!0))}for(let e=0;e<t.length;++e){const a=n.length,l=t[e]+1+2,c=new ia;for(let r=0;r<l-1;r++){const i=r===l-2,a=i?o*(s-t.length+e-r):o;for(let e=0;e<o-1;e++){const t=r*o+e;0===r||i||0===e||e===o-2?(c.emplaceBack(t+1,t,t+a),c.emplaceBack(t+a,t+a+1,t+1)):(n.emplaceBack(t+1,t,t+a),n.emplaceBack(t+a,t+a+1,t+1))}}const u=ss.simpleSegment(0,a,r.length,n.length-a);for(let e=0;e<c.uint16.length;e+=3)n.emplaceBack(c.uint16[e],c.uint16[e+1],c.uint16[e+2]);const p=ss.simpleSegment(0,a,r.length,n.length-a);i.push({withoutSkirts:u,withSkirts:p})}return{vertices:r,indices:n,segments:i}}_createGrid(e){const t=this._fillGridMeshWithLods(ul,pl);this._gridSegments=t.segments,this._gridBuffer=e.createVertexBuffer(t.vertices,tl.members),this._gridIndexBuffer=e.createIndexBuffer(t.indices,!0)}_createPoles(e){const t=new ia;for(let e=0;e<=ul;e++)t.emplaceBack(0,e+1,e+2);this._poleIndexBuffer=e.createIndexBuffer(t,!0);const r=new la,n=new la;this._poleSegments=[];for(let e=0,t=0;e<al;e++){const i=360/(1<<e);r.emplaceBack(0,-ll,0,.5,0),n.emplaceBack(0,-ll,0,.5,1);for(let e=0;e<=ul;e++){const t=e/ul,o=Lr(0,i,t),[a,s,l]=Sl(Fl,jl,o,ll);r.emplaceBack(a,s,l,t,0),n.emplaceBack(a,s,l,t,1)}this._poleSegments.push(ss.simpleSegment(t,0,66,64)),t+=66}this._poleNorthVertexBuffer=e.createVertexBuffer(r,Qs,!1),this._poleSouthVertexBuffer=e.createVertexBuffer(n,Qs,!1)}getGridBuffers(e,t){return[this._gridBuffer,this._gridIndexBuffer,t?this._gridSegments[e].withSkirts:this._gridSegments[e].withoutSkirts]}getPoleBuffers(e){return[this._poleNorthVertexBuffer,this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[e]]}getWirefameBuffers(e,t){if(!this._wireframeSegments){const t=new ua,r=ul,n=r+1+2,i=1;this._wireframeSegments=[];for(let e=0,o=0;e<pl.length;e++){const a=pl[e];for(let e=i;e<a+i;e++)for(let o=i;o<r+i;o++){const r=e*n+o;t.emplaceBack(r,r+1),t.emplaceBack(r,r+n),t.emplaceBack(r,r+n+1)}const s=a*r*3;this._wireframeSegments.push(ss.simpleSegment(0,o,(a+1)*n,s)),o+=s}this._wireframeIndexBuffer=e.createIndexBuffer(t)}return[this._gridBuffer,this._wireframeIndexBuffer,this._wireframeSegments[t]]}},e.GlyphManager=nd,e.ImagePosition=Th,e.KDBush=_m,e.LivePerformanceUtils=Ue,e.LngLat=ql,e.LngLatBounds=cs,e.LocalGlyphMode=rd,e.MAX_MERCATOR_LATITUDE=Yl,e.MercatorCoordinate=Ql,e.ONE_EM=jp,e.OverscaledTileID=mp,e.PerformanceMarkers=Ne,e.Point=y,e.Properties=Po,e.RGBAImage=Nc,e.Ray=rl,e.RequestManager=class{constructor(e,t,r){this._transformRequestFn=e,this._customAccessToken=t,this._silenceAuthErrors=!!r,this._createSkuToken()}_createSkuToken(){const e=function(){let e="";for(let t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",h,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}normalizeStyleURL(e,t){if(!ve(e))return e;const r=Se(e);return r.path=`/styles/v1${r.path}`,this._makeAPIURL(r,this._customAccessToken||t)}normalizeGlyphsURL(e,t){if(!ve(e))return e;const r=Se(e);return r.path=`/fonts/v1${r.path}`,this._makeAPIURL(r,this._customAccessToken||t)}normalizeSourceURL(e,t,r,n){if(!ve(e))return e;const i=Se(e);return i.path=`/v4/${i.authority}.json`,i.params.push("secure"),r&&i.params.push(`language=${r}`),n&&i.params.push(`worldview=${n}`),this._makeAPIURL(i,this._customAccessToken||t)}normalizeSpriteURL(e,t,r,n){const i=Se(e);return ve(e)?(i.path=`/styles/v1${i.path}/sprite${t}${r}`,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=`${t}${r}`,Ce(i))}normalizeTileURL(e,t,r){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!ve(e))return e;const n=Se(e);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${t||r&&"raster"!==n.authority&&512===r?"@2x":""}${a.supported?".webp":"$1"}`),"raster"===n.authority?n.path=`/${o.RASTER_URL_PREFIX}${n.path}`:(n.path=n.path.replace(/^.+\/v4\//,"/"),n.path=`/${o.TILE_URL_VERSION}${n.path}`);const i=this._customAccessToken||function(e){for(const t of e){const e=t.match(/^access_token=(.*)$/);if(e)return e[1]}return null}(n.params)||o.ACCESS_TOKEN;return o.REQUIRE_ACCESS_TOKEN&&i&&this._skuToken&&n.params.push(`sku=${this._skuToken}`),this._makeAPIURL(n,i)}canonicalizeTileURL(e,t){const r=Se(e);if(!r.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!r.path.match(/\.[\w]+$/))return e;let n="mapbox://";r.path.match(/^\/raster\/v1\//)?n+=`raster/${r.path.replace(`/${o.RASTER_URL_PREFIX}/`,"")}`:n+=`tiles/${r.path.replace(`/${o.TILE_URL_VERSION}/`,"")}`;let i=r.params;return t&&(i=i.filter((e=>!e.match(/^access_token=/)))),i.length&&(n+=`?${i.join("&")}`),n}canonicalizeTileset(e,t){const r=!!t&&ve(t),n=[];for(const t of e.tiles||[])xe(t)?n.push(this.canonicalizeTileURL(t,r)):n.push(t);return n}_makeAPIURL(e,t){const r="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",n=Se(o.API_URL);if(e.protocol=n.protocol,e.authority=n.authority,"http"===e.protocol){const t=e.params.indexOf("secure");t>=0&&e.params.splice(t,1)}if("/"!==n.path&&(e.path=`${n.path}${e.path}`),!o.REQUIRE_ACCESS_TOKEN)return Ce(e);if(t=t||o.ACCESS_TOKEN,!this._silenceAuthErrors){if(!t)throw new Error(`An API access token is required to use Mapbox GL. ${r}`);if("s"===t[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${r}`)}return e.params=e.params.filter((e=>-1===e.indexOf("access_token"))),e.params.push(`access_token=${t||""}`),Ce(e)}},e.ResourceType=ce,e.SegmentVector=ss,e.SourceCache=rm,e.StencilMode=Yf,e.StructArrayLayout1ui2=pa,e.StructArrayLayout2f1f2i16=ta,e.StructArrayLayout2i4=Vo,e.StructArrayLayout2ui4=ua,e.StructArrayLayout3f12=na,e.StructArrayLayout3ui6=ia,e.StructArrayLayout4i8=$o,e.StructArrayLayout5f20=la,e.Texture=yf,e.Tile=Df,e.Transitionable=So,e.Uniform1f=Fa,e.Uniform1i=class extends Ba{constructor(e){super(e),this.current=0}set(e,t,r){this.fetchUniformLocation(e,t)&&this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}},e.Uniform2f=class extends Ba{constructor(e){super(e),this.current=[0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1])))}},e.Uniform3f=class extends Ba{constructor(e){super(e),this.current=[0,0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2])))}},e.Uniform4f=ja,e.UniformColor=Na,e.UniformMatrix2f=class extends Ba{constructor(e){super(e),this.current=qa}set(e,t,r){if(this.fetchUniformLocation(e,t))for(let e=0;e<4;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix2fv(this.location,!1,r);break}}},e.UniformMatrix3f=class extends Ba{constructor(e){super(e),this.current=Va}set(e,t,r){if(this.fetchUniformLocation(e,t))for(let e=0;e<9;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix3fv(this.location,!1,r);break}}},e.UniformMatrix4f=class extends Ba{constructor(e){super(e),this.current=Ua}set(e,t,r){if(this.fetchUniformLocation(e,t)){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let e=1;e<16;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}}},e.UnwrappedTileID=fp,e.ValidationError=ni,e.VectorTileFeature=Zu,e.VectorTileWorkerSource=class extends et{constructor(e,t,r,n,i){super(),this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=i||gm,this.loading={},this.loaded={},this.deduped=new mm(e.scheduler),this.isSpriteLoaded=n,this.scheduler=e.scheduler}loadTile(e,t){const r=e.uid,n=e&&e.request,i=n&&n.collectResourceTiming,o=this.loading[r]=new dm(e);o.abort=this.loadVectorData(e,((a,s)=>{const l=!this.loading[r];if(delete this.loading[r],l||a||!s)return o.status="done",l||(this.loaded[r]=o),t(a);const c=s.rawData,u={};s.expires&&(u.expires=s.expires),s.cacheControl&&(u.cacheControl=s.cacheControl),o.vectorTile=s.vectorTile||new Hu(new bh(c));const p=()=>{o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,((e,r)=>{if(e||!r)return t(e);const o={};if(i){const e=$e(n);e.length>0&&(o.resourceTiming=JSON.parse(JSON.stringify(e)))}t(null,z({rawTileData:c.slice(0)},r,u,o))}))};this.isSpriteLoaded?p():this.once("isSpriteLoaded",(()=>{this.scheduler?this.scheduler.add(p,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom}):p()})),this.loaded=this.loaded||{},this.loaded[r]=o}))}reloadTile(e,t){const r=this.loaded,n=e.uid,i=this;if(r&&r[n]){const o=r[n];o.showCollisionBoxes=e.showCollisionBoxes,o.enableTerrain=!!e.enableTerrain,o.projection=e.projection,o.tileTransform=Od(e.tileID.canonical,e.projection);const a=(e,r)=>{const n=o.reloadCallback;n&&(delete o.reloadCallback,o.parse(o.vectorTile,i.layerIndex,this.availableImages,i.actor,n)),t(e,r)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a())}}abortTile(e,t){const r=e.uid,n=this.loading[r];n&&(n.abort&&n.abort(),delete this.loading[r]),t()}removeTile(e,t){const r=this.loaded,n=e.uid;r&&r[n]&&delete r[n],t()}},e.WritingMode=Ch,e.ZoomDependentExpression=Qn,e.add=As,e.addDynamicAttributes=nf,e.adjoint=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=a*u-s*c,e[1]=i*c-n*u,e[2]=n*s-i*a,e[3]=s*l-o*u,e[4]=r*u-i*l,e[5]=i*o-r*s,e[6]=o*c-a*l,e[7]=n*l-r*c,e[8]=r*a-n*o,e},e.asyncAll=O,e.bezier=S,e.bindAll=j,e.boundsAttributes=Lf,e.bufferConvexPolygon=function(e,t){const r=[];for(let n=0;n<e.length;n++){const i=I(n-1,-1,e.length-1),o=I(n+1,-1,e.length-1),a=e[n],s=e[o],l=e[i].sub(a).unit(),c=s.sub(a).unit(),u=c.angleWithSep(l.x,l.y),p=l.add(c).unit().mult(-1*t/Math.sin(u/2));r.push(a.add(p))}return r},e.cacheEntryPossiblyAdded=function(e){le++,le>ie&&(e.getActor().send("enforceCacheSizeLimit",ne),le=0)},e.calculateGlobeLabelMatrix=function(e,t){const{x:r,y:n}=e.point,i=zl(r,n,e.worldSize/e._pixelsPerMercatorPixel,0,0);return gs(i,i,Ll(yl(t)))},e.calculateGlobeMatrix=function(e){const{x:t,y:r}=e.point,{lng:n,lat:i}=e._center;return zl(t,r,e.worldSize,n,i)},e.calculateGlobeMercatorMatrix=function(e){const t=e.pixelsPerMeter,r=t/Hl(1,e.center.lat),n=fs(new Float64Array(16));return bs(n,n,[e.point.x,e.point.y,0]),_s(n,n,[r,r,t]),Float32Array.from(n)},e.circumferenceAtLatitude=$l,e.clamp=A,e.clearTileCache=function(e){if(!oe())return;const t=r.caches.delete(ee);e&&t.catch(e).then((()=>e()))},e.clipLine=Yh,e.clone=function(e){var t=new ps(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.clone$1=q,e.collisionCircleLayout=Fp,e.config=o,e.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},e.create=function(){var e=new ps(16);return ps!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.create$1=hs,e.createExpression=Yn,e.createLayout=No,e.createStyleLayer=function(e){return"custom"===e.type?new mf(e):new _f[e.type](e)},e.cross=Bs,e.degToRad=w,e.distance=function(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])},e.div=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e},e.dot=Rs,e.earthRadius=Nl,e.ease=C,e.easeCubicInOut=T,e.ecefToLatLng=function([e,t,r]){const n=Math.hypot(e,t,r),i=Math.atan2(e,r),o=.5*Math.PI-Math.acos(-t/n);return new ql(k(i),k(o))},e.emitValidationErrors=$i,e.endsWith=N,e.enforceCacheSizeLimit=function(e){ae(),te&&te.then((t=>{t.keys().then((r=>{for(let n=0;n<r.length-e;n++)t.delete(r[n])}))}))},e.evaluateSizeForFeature=Vp,e.evaluateSizeForZoom=qp,e.evaluateVariableOffset=yd,e.evented=yo,e.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},e.exactEquals$1=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},e.exported=Xe,e.exported$1=a,e.extend=z,e.extend$1=rt,e.fillExtrusionHeightLift=lp,e.filterObject=V,e.fromMat4=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},e.fromQuat=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=r+r,s=n+n,l=i+i,c=r*a,u=n*a,p=n*s,h=i*a,d=i*s,f=i*l,m=o*a,g=o*s,b=o*l;return e[0]=1-p-f,e[1]=u+b,e[2]=h-g,e[3]=0,e[4]=u-b,e[5]=1-c-f,e[6]=d+m,e[7]=0,e[8]=h+g,e[9]=d-m,e[10]=1-c-p,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.fromRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},e.fromScaling=xs,e.furthestTileCorner=function(e){const t=Math.round((e+45+360)%360/90)%4;return E[t]},e.getAABBPointSquareDist=function(e,t,r){let n=0;for(let i=0;i<2;++i){const o=r?r[i]:0;e[i]>o&&(n+=(e[i]-o)*(e[i]-o)),t[i]<o&&(n+=(o-t[i])*(o-t[i]))}return n},e.getAnchorAlignment=jh,e.getAnchorJustification=xd,e.getBounds=function(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const o of e)t=Math.min(t,o.x),r=Math.min(r,o.y),n=Math.max(n,o.x),i=Math.max(i,o.y);return{min:new y(t,r),max:new y(n,i)}},e.getColumn=Q,e.getDefaultExportFromCjs=d,e.getGridMatrix=function(e,t,r,n){const i=t.getNorth(),o=t.getSouth(),a=t.getWest(),s=t.getEast(),l=1<<e.z,c=s-a,u=i-o,p=c/ul,h=-u/pl[r],d=[0,p,0,h,0,0,i,a,0];if(e.z>0){const e=180/n;ds(d,d,[e/c+1,0,0,0,e/u+1,0,-.5*e/p,.5*e/h,1])}return d[2]=l,d[5]=e.x,d[8]=e.y,d},e.getImage=_e,e.getJSON=function(e,t){return he(z(e,{type:"json"}),t)},e.getLatitudinalLod=function(e){const t=Yl-5;e=A(e,-t,t)/t*90;const r=Math.pow(Math.abs(Math.sin(w(e))),3);return Math.round(r*(pl.length-1))},e.getMapSessionAPI=Fe,e.getPerformanceMeasurement=$e,e.getProjection=Jd,e.getRTLTextPluginStatus=vo,e.getReferrer=pe,e.getTilePoint=function(e,{x:t,y:r},n=0){return new y(((t-n)*e.scale-e.x)*ls,(r*e.scale-e.y)*ls)},e.getTileVec3=function(e,t,r=0){return Cs(((t.x-r)*e.scale-e.x)*ls,(t.y*e.scale-e.y)*ls,Kl(t.z,t.y))},e.getVideo=function(e,t){const n=r.document.createElement("video");n.muted=!0,n.onloadstart=function(){t(null,n)};for(let t=0;t<e.length;t++){const i=r.document.createElement("source");fe(e[t])||(n.crossOrigin="Anonymous"),i.src=e[t],n.appendChild(i)}return{cancel:()=>{}}},e.globeCenterToScreenPoint=function(e){const t=[0,0,0],r=fs(new Float64Array(16));return gs(r,e.pixelMatrix,e.globeMatrix),Fs(t,t,r),new y(t[0],t[1])},e.globeDenormalizeECEF=Ll,e.globeECEFOrigin=function(e,t){const r=[0,0,0];return Fs(r,r,Ol(yl(t.canonical))),Fs(r,r,e),r},e.globeMetersToEcef=ml,e.globeNormalizeECEF=Ol,e.globePixelsToTileUnits=function(e,t){return ls/(512*Math.pow(2,e))*Ml(yl(t))},e.globePoleMatrixForTile=function(e,t,r){const n=fs(new Float64Array(16)),i=(t/(1<<e)-.5)*Math.PI*2;return vs(n,r.globeMatrix,i),Float32Array.from(n)},e.globeTileBounds=yl,e.globeTiltAtLngLat=Pl,e.globeToMercatorTransition=Dl,e.globeUseCustomAntiAliasing=function(e,t,r){const n=Dl(r.zoom),i=e.style.map._antialias,o=!!t.extStandardDerivatives,a=t.extStandardDerivativesForceOff||e.terrain&&e.terrain.exaggeration()>0;return 0===n&&!i&&!a&&o},e.identity=fs,e.identity$1=Zs,e.invert=ms,e.isFullscreen=function(){return!!r.document.fullscreenElement||!!r.document.webkitFullscreenElement},e.isLngLatBehindGlobe=Rl,e.isMapAuthenticated=function(e){return je.has(e)},e.isMapboxURL=ve,e.isSafariWithAntialiasingBug=function(e){const t=e.navigator?e.navigator.userAgent:null;return!!Y(e)&&t&&(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},e.latFromMercatorY=Xl,e.latLngToECEF=Cl,e.len=qs,e.length=Ss,e.length$1=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},e.lngFromMercatorX=Zl,e.loadVectorTile=gm,e.makeRequest=he,e.mapValue=function(e,t,r,n,i){return A((e-t)/(r-t)*(i-n)+n,n,i)},e.mercatorScale=Jl,e.mercatorXfromLng=Gl,e.mercatorYfromLat=Wl,e.mercatorZfromAltitude=Hl,e.mul=ks,e.mul$1=Vs,e.multiply=gs,e.multiply$1=ds,e.multiply$2=Is,e.nextPowerOfTwo=B,e.normalize=Ps,e.normalize$1=Ys,e.normalize$2=Gs,e.number=Lr,e.ortho=function(e,t,r,n,i,o,a){var s=1/(t-r),l=1/(n-i),c=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(a+o)*c,e[15]=1,e},e.pbf=Xp,e.perspective=function(e,t,r,n,i){var o,a=1/Math.tan(t/2);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=(i+n)*(o=1/(n-i)),e[14]=2*i*n*o):(e[10]=-1,e[14]=-2*n),e},e.pick=function(e,t){const r={};for(let n=0;n<t.length;n++){const i=t[n];i in e&&(r[i]=e[i])}return r},e.plugin=wo,e.pointGeometry=b,e.polesInViewport=function(e){const t=fs(new Float64Array(16));gs(t,e.pixelMatrix,e.globeMatrix);const r=[0,hl,0],n=[0,dl,0];return Fs(r,r,t),Fs(n,n,t),[r[0]>0&&r[0]<=e.width&&r[1]>0&&r[1]<=e.height&&!Rl(e,new ql(e.center.lat,90)),n[0]>0&&n[0]<=e.width&&n[1]>0&&n[1]<=e.height&&!Rl(e,new ql(e.center.lat,-90))]},e.polygonContainsPoint=xc,e.polygonIntersectsBox=wc,e.polygonIntersectsPolygon=hc,e.polygonizeBounds=function(e,t,r=0,n=!0){const i=new y(r,r),o=e.sub(i),a=t.add(i),s=[o,new y(a.x,o.y),a,new y(o.x,a.y)];return n&&s.push(o.clone()),s},e.posAttributes=tl,e.postMapLoadEvent=De,e.postPerformanceEvent=Re,e.postTurnstileEvent=Le,e.potpack=kh,e.prevPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},e.radToDeg=k,e.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.registerForPluginStateChange=function(e){return e({pluginStatus:mo,pluginURL:go}),yo.on("pluginStateChange",e),e},e.removeAuthState=function(e){je.delete(e)},e.renderColorRamp=Vc,e.resample=tc,e.rotateX=ys,e.rotateX$1=Xs,e.rotateY=vs,e.rotateY$1=Ks,e.rotateZ=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],s=t[2],l=t[3],c=t[4],u=t[5],p=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+c*n,e[1]=a*i+u*n,e[2]=s*i+p*n,e[3]=l*i+h*n,e[4]=c*i-o*n,e[5]=u*i-a*n,e[6]=p*i-s*n,e[7]=h*i-l*n,e},e.rotateZ$1=function(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l+i*s,e[1]=i*l-n*s,e[2]=o*l+a*s,e[3]=a*l-o*s,e},e.scale=_s,e.scale$1=$s,e.scale$2=zs,e.scaleAndAdd=Ds,e.set=function(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e},e.setCacheLimits=function(e,t){ne=e,ie=t},e.setColumn=function(e,t,r){e[4*t+0]=r[0],e[4*t+1]=r[1],e[4*t+2]=r[2],e[4*t+3]=r[3]},e.setRTLTextPlugin=function(e,t,r=!1){if(mo===uo||mo===po||mo===ho)throw new Error("setRTLTextPlugin cannot be called multiple times.");go=Xe.resolveURL(e),mo=uo,fo=t,_o(),r||xo()},e.smoothstep=M,e.spec=tt,e.squaredLength=function(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n},e.storeAuthState=function(e,t){t?je.add(e):je.delete(e)},e.sub=Us,e.subtract=Ms,e.symbolSize=$p,e.tileAABB=function(e,t,r,n,i,o,a,s,l){if("globe"===l.name)return kl(e,t,new dp(r,n,i));const c=Od({z:r,x:n,y:i},l);return new ol([(o+c.x/c.scale)*t,t*(c.y/c.scale),a],[(o+c.x2/c.scale)*t,t*(c.y2/c.scale),s])},e.tileCornersToBounds=El,e.tileTransform=Od,e.transformMat3=function(e,t,r){var n=t[0],i=t[1],o=t[2];return e[0]=n*r[0]+i*r[3]+o*r[6],e[1]=n*r[1]+i*r[4]+o*r[7],e[2]=n*r[2]+i*r[5]+o*r[8],e},e.transformMat4=Fs,e.transformMat4$1=Ws,e.transformQuat=js,e.transitionTileAABBinECEF=xl,e.translate=bs,e.transpose=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},e.triggerPluginCompletionEvent=bo,e.uniqueId=P,e.updateGlobeVertexNormal=function(e,t,r,n,i){const o=5*t+2;e.float32[o+0]=r,e.float32[o+1]=n,e.float32[o+2]=i},e.validateCustomStyleLayer=function(e){const t=[],r=e.id;return void 0===r&&t.push({message:`layers.${r}: missing required property "id"`}),void 0===e.render&&t.push({message:`layers.${r}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),t},e.validateFilter=e=>qi(Ei(e)),e.validateFog=e=>qi(Ri(e)),e.validateLayer=e=>qi(Mi(e)),e.validateLight=e=>qi(Di(e)),e.validateSource=e=>qi(Li(e)),e.validateStyle=Ni,e.validateTerrain=e=>qi(Pi(e)),e.values=L,e.vectorTile=Pu,e.version=n,e.warnOnce=G,e.window=r,e.wrap=I})),i(["./shared"],(function(e){function t(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return JSON.stringify(e);if(Array.isArray(e)){let r="[";for(const n of e)r+=`${t(n)},`;return`${r}]`}let r="{";for(const n of Object.keys(e).sort())r+=`${n}:${t(e[n])},`;return`${r}}`}function r(r){let n="";for(const i of e.refProperties)n+=`/${t(r[i])}`;return n}class n{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(t,n){for(const r of t)this._layerConfigs[r.id]=r,(this._layers[r.id]=e.createStyleLayer(r)).compileFilter(),this.keyCache[r.id]&&delete this.keyCache[r.id];for(const e of n)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const i=function(e,t){const n={};for(let i=0;i<e.length;i++){const o=t&&t[e[i].id]||r(e[i]);t&&(t[e[i].id]=o);let a=n[o];a||(a=n[o]=[]),a.push(e[i])}const i=[];for(const e in n)i.push(n[e]);return i}(e.values(this._layerConfigs),this.keyCache);for(const e of i){const t=e.map((e=>this._layers[e.id])),r=t[0];if("none"===r.visibility)continue;const n=r.source||"";let i=this.familiesBySource[n];i||(i=this.familiesBySource[n]={});const o=r.sourceLayer||"_geojsonTileLayer";let a=i[o];a||(a=i[o]=[]),a.push(t)}}}class i{loadTile(t,r){const{uid:n,encoding:i,rawImageData:o,padding:a,buildQuadTree:s}=t,l=e.window.ImageBitmap&&o instanceof e.window.ImageBitmap?this.getImageData(o,a):o;r(null,new e.DEMData(n,l,i,a<1,s))}getImageData(e,t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);const r=this.offscreenCanvasContext.getImageData(-t,-t,e.width+2*t,e.height+2*t);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),r}}function o(e,t){if(0!==e.length){a(e[0],t);for(var r=1;r<e.length;r++)a(e[r],!t)}}function a(e,t){for(var r=0,n=0,i=0,o=e.length,a=o-1;i<o;a=i++){var s=(e[i][0]-e[a][0])*(e[a][1]+e[i][1]),l=r+s;n+=Math.abs(r)>=Math.abs(s)?r-l+s:s-l+r,r=l}r+n>=0!=!!t&&e.reverse()}var s=e.getDefaultExportFromCjs((function e(t,r){var n,i=t&&t.type;if("FeatureCollection"===i)for(n=0;n<t.features.length;n++)e(t.features[n],r);else if("GeometryCollection"===i)for(n=0;n<t.geometries.length;n++)e(t.geometries[n],r);else if("Feature"===i)e(t.geometry,r);else if("Polygon"===i)o(t.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<t.coordinates.length;n++)o(t.coordinates[n],r);return t}));const l=e.VectorTileFeature.prototype.toGeoJSON;var c={exports:{}},u=e.pointGeometry,p=e.vectorTile.VectorTileFeature,h=d;function d(e,t){this.options=t||{},this.features=e,this.length=e.length}function f(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}d.prototype.feature=function(e){return new f(this.features[e],this.options.extent)},f.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var r=e[t],n=[],i=0;i<r.length;i++)n.push(new u(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},f.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,n=1/0,i=-1/0,o=0;o<e.length;o++)for(var a=e[o],s=0;s<a.length;s++){var l=a[s];t=Math.min(t,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[t,n,r,i]},f.prototype.toGeoJSON=p.prototype.toGeoJSON;var m=e.pbf,g=h;function b(e){var t=new m;return function(e,t){for(var r in e.layers)t.writeMessage(3,_,e.layers[r])}(e,t),t.finish()}function _(e,t){var r;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)n.feature=e.feature(r),t.writeMessage(2,y,n);var i=n.keys;for(r=0;r<i.length;r++)t.writeStringField(3,i[r]);var o=n.values;for(r=0;r<o.length;r++)t.writeMessage(4,E,o[r])}function y(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,v,e),t.writeVarintField(3,r.type),t.writeMessage(4,k,r)}function v(e,t){var r=e.feature,n=e.keys,i=e.values,o=e.keycache,a=e.valuecache;for(var s in r.properties){var l=r.properties[s],c=o[s];if(null!==l){void 0===c&&(n.push(s),o[s]=c=n.length-1),t.writeVarint(c);var u=typeof l;"string"!==u&&"boolean"!==u&&"number"!==u&&(l=JSON.stringify(l));var p=u+":"+l,h=a[p];void 0===h&&(i.push(l),a[p]=h=i.length-1),t.writeVarint(h)}}}function x(e,t){return(t<<3)+(7&e)}function w(e){return e<<1^e>>31}function k(e,t){for(var r=e.loadGeometry(),n=e.type,i=0,o=0,a=r.length,s=0;s<a;s++){var l=r[s],c=1;1===n&&(c=l.length),t.writeVarint(x(1,c));for(var u=3===n?l.length-1:l.length,p=0;p<u;p++){1===p&&1!==n&&t.writeVarint(x(2,u-1));var h=l[p].x-i,d=l[p].y-o;t.writeVarint(w(h)),t.writeVarint(w(d)),i+=h,o+=d}3===n&&t.writeVarint(x(7,1))}}function E(e,t){var r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}c.exports=b,c.exports.fromVectorTileJs=b,c.exports.fromGeojsonVt=function(e,t){t=t||{};var r={};for(var n in e)r[n]=new g(e[n].features,t),r[n].name=n,r[n].version=t.version,r[n].extent=t.extent;return b({layers:r})},c.exports.GeoJSONWrapper=g;var T=e.getDefaultExportFromCjs(c.exports);const S={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},C=Math.fround||(A=new Float32Array(1),e=>(A[0]=+e,A[0]));var A;const M=3,I=5,O=6;class L{constructor(e){this.options=Object.assign(Object.create(S),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:n}=this.options;e.length,this.points=e;const i=[];for(let t=0;t<e.length;t++){const r=e[t];if(!r.geometry)continue;const[n,o]=r.geometry.coordinates,a=C(P(n)),s=C(R(o));i.push(a,s,1/0,t,-1,1),this.options.reduce&&i.push(0)}let o=this.trees[n+1]=this._createTree(i);for(let e=n;e>=r;e--)Date.now(),o=this.trees[e]=this._createTree(this._cluster(o,e));return this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,e[1]));let i=180===e[2]?180:((e[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){const e=this.getClusters([r,n,180,o],t),a=this.getClusters([-180,n,i,o],t);return e.concat(a)}const a=this.trees[this._limitZoom(t)],s=a.range(P(r),R(o),P(i),R(n)),l=a.data,c=[];for(const e of s){const t=this.stride*e;c.push(l[t+I]>1?z(l,t,this.clusterProps):this.points[l[t+M]])}return c}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);const o=i.data;if(t*this.stride>=o.length)throw new Error(n);const a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=i.within(o[t*this.stride],o[t*this.stride+1],a),l=[];for(const t of s){const r=t*this.stride;o[r+4]===e&&l.push(o[r+I]>1?z(o,r,this.clusterProps):this.points[o[r+M]])}if(0===l.length)throw new Error(n);return l}getLeaves(e,t,r){const n=[];return this._appendLeaves(n,e,t=t||10,r=r||0,0),n}getTile(e,t,r){const n=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:o,radius:a}=this.options,s=a/o,l=(r-s)/i,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((t-s)/i,l,(t+1+s)/i,c),n.data,t,r,i,u),0===t&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.data,i,r,i,u),t===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.data,-1,r,i,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,n,i){const o=this.getChildren(t);for(const t of o){const o=t.properties;if(o&&o.cluster?i+o.point_count<=n?i+=o.point_count:i=this._appendLeaves(e,o.cluster_id,r,n,i):i<n?i++:e.push(t),e.length===r)break}return i}_createTree(t){const r=new e.KDBush(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let e=0;e<t.length;e+=this.stride)r.add(t[e],t[e+1]);return r.finish(),r.data=t,r}_addTileFeatures(e,t,r,n,i,o){for(const a of e){const e=a*this.stride,s=t[e+I]>1;let l,c,u;if(s)l=D(t,e,this.clusterProps),c=t[e],u=t[e+1];else{const r=this.points[t[e+M]];l=r.properties;const[n,i]=r.geometry.coordinates;c=P(n),u=R(i)}const p={type:1,geometry:[[Math.round(this.options.extent*(c*i-r)),Math.round(this.options.extent*(u*i-n))]],tags:l};let h;h=s||this.options.generateId?t[e+M]:this.points[t[e+M]].id,void 0!==h&&(p.id=h),o.features.push(p)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:n,reduce:i,minPoints:o}=this.options,a=r/(n*Math.pow(2,t)),s=e.data,l=[],c=this.stride;for(let r=0;r<s.length;r+=c){if(s[r+2]<=t)continue;s[r+2]=t;const n=s[r],u=s[r+1],p=e.within(s[r],s[r+1],a),h=s[r+I];let d=h;for(const e of p){const r=e*c;s[r+2]>t&&(d+=s[r+I])}if(d>h&&d>=o){let e,o=n*h,a=u*h,f=-1;const m=((r/c|0)<<5)+(t+1)+this.points.length;for(const n of p){const l=n*c;if(s[l+2]<=t)continue;s[l+2]=t;const u=s[l+I];o+=s[l]*u,a+=s[l+1]*u,s[l+4]=m,i&&(e||(e=this._map(s,r,!0),f=this.clusterProps.length,this.clusterProps.push(e)),i(e,this._map(s,l)))}s[r+4]=m,l.push(o/d,a/d,1/0,m,-1,d),i&&l.push(f)}else{for(let e=0;e<c;e++)l.push(s[r+e]);if(d>1)for(const e of p){const r=e*c;if(!(s[r+2]<=t)){s[r+2]=t;for(let e=0;e<c;e++)l.push(s[r+e])}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+I]>1){const n=this.clusterProps[e[t+O]];return r?Object.assign({},n):n}const n=this.points[e[t+M]].properties,i=this.options.map(n);return r&&i===n?Object.assign({},i):i}}function z(e,t,r){return{type:"Feature",id:e[t+M],properties:D(e,t,r),geometry:{type:"Point",coordinates:[(n=e[t],360*(n-.5)),B(e[t+1])]}};var n}function D(e,t,r){const n=e[t+I],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,o=e[t+O],a=-1===o?{}:Object.assign({},r[o]);return Object.assign(a,{cluster:!0,cluster_id:e[t+M],point_count:n,point_count_abbreviated:i})}function P(e){return e/360+.5}function R(e){const t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function B(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function F(e,t,r,n){for(var i,o=n,a=r-t>>1,s=r-t,l=e[t],c=e[t+1],u=e[r],p=e[r+1],h=t+3;h<r;h+=3){var d=j(e[h],e[h+1],l,c,u,p);if(d>o)i=h,o=d;else if(d===o){var f=Math.abs(h-a);f<s&&(i=h,s=f)}}o>n&&(i-t>3&&F(e,t,i,n),e[i+2]=o,r-i>3&&F(e,i,r,n))}function j(e,t,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var l=((e-r)*a+(t-n)*s)/(a*a+s*s);l>1?(r=i,n=o):l>0&&(r+=a*l,n+=s*l)}return(a=e-r)*a+(s=t-n)*s}function N(e,t,r,n){var i={id:void 0===e?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)U(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<t.length;n++)U(e,t[n]);else if("MultiPolygon"===r)for(n=0;n<t.length;n++)for(var i=0;i<t[n].length;i++)U(e,t[n][i])}(i),i}function U(e,t){for(var r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function V(e,t,r,n){if(t.geometry){var i=t.geometry.coordinates,o=t.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===o)q(i,s);else if("MultiPoint"===o)for(var c=0;c<i.length;c++)q(i[c],s);else if("LineString"===o)$(i,s,a,!1);else if("MultiLineString"===o){if(r.lineMetrics){for(c=0;c<i.length;c++)$(i[c],s=[],a,!1),e.push(N(l,"LineString",s,t.properties));return}G(i,s,a,!1)}else if("Polygon"===o)G(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(c=0;c<t.geometry.geometries.length;c++)V(e,{id:l,geometry:t.geometry.geometries[c],properties:t.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<i.length;c++){var u=[];G(i[c],u,a,!0),s.push(u)}}e.push(N(l,o,s,t.properties))}}function q(e,t){t.push(W(e[0])),t.push(H(e[1])),t.push(0)}function $(e,t,r,n){for(var i,o,a=0,s=0;s<e.length;s++){var l=W(e[s][0]),c=H(e[s][1]);t.push(l),t.push(c),t.push(0),s>0&&(a+=n?(i*c-l*o)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-o,2))),i=l,o=c}var u=t.length-3;t[2]=1,F(t,0,u,r),t[u+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function G(e,t,r,n){for(var i=0;i<e.length;i++){var o=[];$(e[i],o,r,n),t.push(o)}}function W(e){return e/360+.5}function H(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Z(e,t,r,n,i,o,a,s){if(n/=t,o>=(r/=t)&&a<n)return e;if(a<r||o>=n)return null;for(var l=[],c=0;c<e.length;c++){var u=e[c],p=u.geometry,h=u.type,d=0===i?u.minX:u.minY,f=0===i?u.maxX:u.maxY;if(d>=r&&f<n)l.push(u);else if(!(f<r||d>=n)){var m=[];if("Point"===h||"MultiPoint"===h)X(p,m,r,n,i);else if("LineString"===h)K(p,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===h)J(p,m,r,n,i,!1);else if("Polygon"===h)J(p,m,r,n,i,!0);else if("MultiPolygon"===h)for(var g=0;g<p.length;g++){var b=[];J(p[g],b,r,n,i,!0),b.length&&m.push(b)}if(m.length){if(s.lineMetrics&&"LineString"===h){for(g=0;g<m.length;g++)l.push(N(u.id,h,m[g],u.tags));continue}"LineString"!==h&&"MultiLineString"!==h||(1===m.length?(h="LineString",m=m[0]):h="MultiLineString"),"Point"!==h&&"MultiPoint"!==h||(h=3===m.length?"Point":"MultiPoint"),l.push(N(u.id,h,m,u.tags))}}}return l.length?l:null}function X(e,t,r,n,i){for(var o=0;o<e.length;o+=3){var a=e[o+i];a>=r&&a<=n&&(t.push(e[o]),t.push(e[o+1]),t.push(e[o+2]))}}function K(e,t,r,n,i,o,a){for(var s,l,c=Y(e),u=0===i?ee:te,p=e.start,h=0;h<e.length-3;h+=3){var d=e[h],f=e[h+1],m=e[h+2],g=e[h+3],b=e[h+4],_=0===i?d:f,y=0===i?g:b,v=!1;a&&(s=Math.sqrt(Math.pow(d-g,2)+Math.pow(f-b,2))),_<r?y>r&&(l=u(c,d,f,g,b,r),a&&(c.start=p+s*l)):_>n?y<n&&(l=u(c,d,f,g,b,n),a&&(c.start=p+s*l)):Q(c,d,f,m),y<r&&_>=r&&(l=u(c,d,f,g,b,r),v=!0),y>n&&_<=n&&(l=u(c,d,f,g,b,n),v=!0),!o&&v&&(a&&(c.end=p+s*l),t.push(c),c=Y(e)),a&&(p+=s)}var x=e.length-3;d=e[x],f=e[x+1],m=e[x+2],(_=0===i?d:f)>=r&&_<=n&&Q(c,d,f,m),x=c.length-3,o&&x>=3&&(c[x]!==c[0]||c[x+1]!==c[1])&&Q(c,c[0],c[1],c[2]),c.length&&t.push(c)}function Y(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function J(e,t,r,n,i,o){for(var a=0;a<e.length;a++)K(e[a],t,r,n,i,o,!1)}function Q(e,t,r,n){e.push(t),e.push(r),e.push(n)}function ee(e,t,r,n,i,o){var a=(o-t)/(n-t);return e.push(o),e.push(r+(i-r)*a),e.push(1),a}function te(e,t,r,n,i,o){var a=(o-r)/(i-r);return e.push(t+(n-t)*a),e.push(o),e.push(1),a}function re(e,t){for(var r=[],n=0;n<e.length;n++){var i,o=e[n],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=ne(o.geometry,t);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(ne(o.geometry[s],t))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var l=[],c=0;c<o.geometry[s].length;c++)l.push(ne(o.geometry[s][c],t));i.push(l)}r.push(N(o.id,a,i,o.tags))}return r}function ne(e,t){var r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(var n=0;n<e.length;n+=3)r.push(e[n]+t,e[n+1],e[n+2]);return r}function ie(e,t){if(e.transformed)return e;var r,n,i,o=1<<e.z,a=e.x,s=e.y;for(r=0;r<e.features.length;r++){var l=e.features[r],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(n=0;n<c.length;n+=2)l.geometry.push(oe(c[n],c[n+1],t,o,a,s));else for(n=0;n<c.length;n++){var p=[];for(i=0;i<c[n].length;i+=2)p.push(oe(c[n][i],c[n][i+1],t,o,a,s));l.geometry.push(p)}}return e.transformed=!0,e}function oe(e,t,r,n,i,o){return[Math.round(r*(e*n-i)),Math.round(r*(t*n-o))]}function ae(e,t,r,n,i){for(var o=t===i.maxZoom?0:i.tolerance/((1<<t)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<e.length;s++){a.numFeatures++,se(a,e[s],o,i);var l=e[s].minX,c=e[s].minY,u=e[s].maxX,p=e[s].maxY;l<a.minX&&(a.minX=l),c<a.minY&&(a.minY=c),u>a.maxX&&(a.maxX=u),p>a.maxY&&(a.maxY=p)}return a}function se(e,t,r,n){var i=t.geometry,o=t.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),e.numPoints++,e.numSimplified++;else if("LineString"===o)le(a,i,e,r,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)le(a,i[s],e,r,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var l=0;l<i.length;l++){var c=i[l];for(s=0;s<c.length;s++)le(a,c[s],e,r,!0,0===s)}if(a.length){var u=t.tags||null;if("LineString"===o&&n.lineMetrics){for(var p in u={},t.tags)u[p]=t.tags[p];u.mapbox_clip_start=i.start/i.size,u.mapbox_clip_end=i.end/i.size}var h={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:u};null!==t.id&&(h.id=t.id),e.features.push(h)}}function le(e,t,r,n,i,o){var a=n*n;if(n>0&&t.size<(i?a:n))r.numPoints+=t.length/3;else{for(var s=[],l=0;l<t.length;l+=3)(0===n||t[l+2]>a)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;i&&function(e,t){for(var r=0,n=0,i=e.length,o=i-2;n<i;o=n,n+=2)r+=(e[n]-e[o])*(e[n+1]+e[o+1]);if(r>0===t)for(n=0,i=e.length;n<i/2;n+=2){var a=e[n],s=e[n+1];e[n]=e[i-2-n],e[n+1]=e[i-1-n],e[i-2-n]=a,e[i-1-n]=s}}(s,o),e.push(s)}}function ce(e,t){var r=(t=this.options=function(e,t){for(var r in t)e[r]=t[r];return e}(Object.create(this.options),t)).debug;if(t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(e,t){var r=[];if("FeatureCollection"===e.type)for(var n=0;n<e.features.length;n++)V(r,e.features[n],t,n);else V(r,"Feature"===e.type?e:{geometry:e},t);return r}(e,t);this.tiles={},this.tileCoords=[],r&&(this.stats={},this.total=0),n=function(e,t){var r=t.buffer/t.extent,n=e,i=Z(e,1,-1-r,r,0,-1,2,t),o=Z(e,1,1-r,2+r,0,-1,2,t);return(i||o)&&(n=Z(e,1,-r,1+r,0,-1,2,t)||[],i&&(n=re(i,1).concat(n)),o&&(n=n.concat(re(o,-1)))),n}(n,t),n.length&&this.splitTile(n,0,0,0),r&&n.length}function ue(e,t,r){return 32*((1<<e)*r+t)+e}function pe(t,r){const n=t.tileID.canonical;if(!this._geoJSONIndex)return r(null,null);const i=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!i)return r(null,null);const o=new class{constructor(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=t.length,this._features=t}feature(t){return new class{constructor(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(1===this._feature.type){const t=[];for(const r of this._feature.geometry)t.push([new e.Point(r[0],r[1])]);return t}{const t=[];for(const r of this._feature.geometry){const n=[];for(const t of r)n.push(new e.Point(t[0],t[1]));t.push(n)}return t}}toGeoJSON(e,t,r){return l.call(this,e,t,r)}}(this._features[t])}}(i.features);let a=T(o);0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),r(null,{vectorTile:o,rawData:a.buffer})}ce.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ce.prototype.splitTile=function(e,t,r,n,i,o,a){for(var s=[e,t,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var u=1<<t,p=ue(t,r,n),h=this.tiles[p];if(!h&&(h=this.tiles[p]=ae(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),c)){var d="z"+t;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(h.source=e,i){if(t===l.maxZoom||t===i)continue;var f=1<<i-t;if(r!==Math.floor(o/f)||n!==Math.floor(a/f))continue}else if(t===l.indexMaxZoom||h.numPoints<=l.indexMaxPoints)continue;if(h.source=null,0!==e.length){var m,g,b,_,y,v,x=.5*l.buffer/l.extent,w=.5-x,k=.5+x,E=1+x;m=g=b=_=null,y=Z(e,u,r-x,r+k,0,h.minX,h.maxX,l),v=Z(e,u,r+w,r+E,0,h.minX,h.maxX,l),e=null,y&&(m=Z(y,u,n-x,n+k,1,h.minY,h.maxY,l),g=Z(y,u,n+w,n+E,1,h.minY,h.maxY,l),y=null),v&&(b=Z(v,u,n-x,n+k,1,h.minY,h.maxY,l),_=Z(v,u,n+w,n+E,1,h.minY,h.maxY,l),v=null),s.push(m||[],t+1,2*r,2*n),s.push(g||[],t+1,2*r,2*n+1),s.push(b||[],t+1,2*r+1,2*n),s.push(_||[],t+1,2*r+1,2*n+1)}}},ce.prototype.getTile=function(e,t,r){var n=this.options,i=n.extent;if(n.debug,e<0||e>24)return null;var o=1<<e,a=ue(e,t=(t%o+o)%o,r);if(this.tiles[a])return ie(this.tiles[a],i);for(var s,l=e,c=t,u=r;!s&&l>0;)l--,c=Math.floor(c/2),u=Math.floor(u/2),s=this.tiles[ue(l,c,u)];return s&&s.source?(this.splitTile(s.source,l,c,u,e,t,r),this.tiles[a]?ie(this.tiles[a],i):null):null};class he extends e.VectorTileWorkerSource{constructor(e,t,r,n,i){super(e,t,r,n,pe),i&&(this.loadGeoJSON=i)}loadData(t,r){const n=t&&t.request,i=n&&n.collectResourceTiming;this.loadGeoJSON(t,((o,a)=>{if(o||!a)return r(o);if("object"!=typeof a)return r(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));{s(a,!0);try{if(t.filter){const r=e.createExpression(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));const n=a.features.filter((e=>r.value.evaluate({zoom:0},e)));a={type:"FeatureCollection",features:n}}this._geoJSONIndex=t.cluster?new L(function({superclusterOptions:t,clusterProperties:r}){if(!r||!t)return t;const n={},i={},o={accumulated:null,zoom:0},a={properties:null},s=Object.keys(r);for(const t of s){const[o,a]=r[t],s=e.createExpression(a),l=e.createExpression("string"==typeof o?[o,["accumulated"],["get",t]]:o);n[t]=s.value,i[t]=l.value}return t.map=e=>{a.properties=e;const t={};for(const e of s)t[e]=n[e].evaluate(o,a);return t},t.reduce=(e,t)=>{a.properties=t;for(const t of s)o.accumulated=e[t],e[t]=i[t].evaluate(o,a)},t}(t)).load(a.features):function(e,t){return new ce(e,t)}(a,t.geojsonVtOptions)}catch(o){return r(o)}this.loaded={};const l={};if(i){const r=e.getPerformanceMeasurement(n);r&&(l.resourceTiming={},l.resourceTiming[t.source]=JSON.parse(JSON.stringify(r)))}r(null,l)}}))}reloadTile(e,t){const r=this.loaded;return r&&r[e.uid]?super.reloadTile(e,t):this.loadTile(e,t)}loadGeoJSON(t,r){if(t.request)e.getJSON(t.request,r);else{if("string"!=typeof t.data)return r(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));try{return r(null,JSON.parse(t.data))}catch(e){return r(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}}getClusterChildren(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}}getClusterLeaves(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}}}class de{constructor(t){this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=e.getProjection({name:"mercator"}),this.workerSourceTypes={vector:e.VectorTileWorkerSource,geojson:he},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(e,t)=>{if(this.workerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=t=>{if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText}}clearCaches(e,t,r){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],r()}checkIfReady(e,t,r){r()}setReferrer(e,t){this.referrer=t}spriteLoaded(t,r){this.isSpriteLoaded[t]=r;for(const n in this.workerSources[t]){const i=this.workerSources[t][n];for(const t in i)i[t]instanceof e.VectorTileWorkerSource&&(i[t].isSpriteLoaded=r,i[t].fire(new e.Event("isSpriteLoaded")))}}setImages(e,t,r){this.availableImages[e]=t;for(const r in this.workerSources[e]){const n=this.workerSources[e][r];for(const e in n)n[e].availableImages=t}r()}enableTerrain(e,t,r){this.terrain=t,r()}setProjection(t,r){this.projections[t]=e.getProjection(r)}setLayers(e,t,r){this.getLayerIndex(e).replace(t),r()}updateLayers(e,t,r){this.getLayerIndex(e).update(t.layers,t.removedIds),r()}loadTile(t,r,n){const i=this.enableTerrain?e.extend({enableTerrain:this.terrain},r):r;i.projection=this.projections[t]||this.defaultProjection,this.getWorkerSource(t,r.type,r.source).loadTile(i,n)}loadDEMTile(t,r,n){const i=this.enableTerrain?e.extend({buildQuadTree:this.terrain},r):r;this.getDEMWorkerSource(t,r.source).loadTile(i,n)}reloadTile(t,r,n){const i=this.enableTerrain?e.extend({enableTerrain:this.terrain},r):r;i.projection=this.projections[t]||this.defaultProjection,this.getWorkerSource(t,r.type,r.source).reloadTile(i,n)}abortTile(e,t,r){this.getWorkerSource(e,t.type,t.source).abortTile(t,r)}removeTile(e,t,r){this.getWorkerSource(e,t.type,t.source).removeTile(t,r)}removeSource(e,t,r){if(!this.workerSources[e]||!this.workerSources[e][t.type]||!this.workerSources[e][t.type][t.source])return;const n=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==n.removeSource?n.removeSource(t,r):r()}loadWorkerSource(e,t,r){try{this.self.importScripts(t.url),r()}catch(e){r(e.toString())}}syncRTLPluginState(t,r,n){try{e.plugin.setState(r);const t=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&null!=t){this.self.importScripts(t);const r=e.plugin.isParsed();n(r?void 0:new Error(`RTL Text Plugin failed to import scripts from ${t}`),r)}}catch(e){n(e.toString())}}getAvailableImages(e){let t=this.availableImages[e];return t||(t=[]),t}getLayerIndex(e){let t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new n),t}getWorkerSource(e,t,r){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){const n={send:(t,r,n,i,o,a)=>{this.actor.send(t,r,n,e,o,a)},scheduler:this.actor.scheduler};this.workerSources[e][t][r]=new this.workerSourceTypes[t](n,this.getLayerIndex(e),this.getAvailableImages(e),this.isSpriteLoaded[e])}return this.workerSources[e][t][r]}getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new i),this.demWorkerSources[e][t]}enforceCacheSizeLimit(t,r){e.enforceCacheSizeLimit(r)}getWorkerPerformanceMetrics(e,t,r){r(void 0,void 0)}}return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new de(self)),de})),i(["./shared"],(function(e){function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r)return!1;if(Object.keys(e).length!==Object.keys(r).length)return!1;for(const n in e)if(!t(e[n],r[n]))return!1;return!0}return e===r}var r=n;function n(e){return!function(e){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{t=new Worker(n),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(n),e}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var r=t.getImageData(0,0,1,1);return r&&r.width===e.width}()?(void 0===i[t=e&&e.failIfMajorPerformanceCaveat]&&(i[t]=function(e){var t,r=function(e){var t=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=e,t.getContext("webgl",r)||t.getContext("experimental-webgl",r)}(e);if(!r)return!1;try{t=r.createShader(r.VERTEX_SHADER)}catch(e){return!1}return!(!t||r.isContextLost())&&(r.shaderSource(t,"void main() {}"),r.compileShader(t),!0===r.getShaderParameter(t,r.COMPILE_STATUS))}(t)),i[t]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var t}(e)}var i={};function o(t,r,n){const i=e.window.document.createElement(t);return void 0!==r&&(i.className=r),n&&n.appendChild(i),i}function a(t,r,n){const i=e.window.document.createElementNS("http://www.w3.org/2000/svg",t);for(const e of Object.keys(r))i.setAttributeNS(null,e,r[e]);return n&&n.appendChild(i),i}n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const s=e.window.document&&e.window.document.documentElement.style,l=s&&void 0!==s.userSelect?"userSelect":"WebkitUserSelect";let c;function u(){s&&l&&(c=s[l],s[l]="none")}function p(){s&&l&&(s[l]=c)}function h(t){t.preventDefault(),t.stopPropagation(),e.window.removeEventListener("click",h,!0)}function d(){e.window.addEventListener("click",h,!0),e.window.setTimeout((()=>{e.window.removeEventListener("click",h,!0)}),0)}function f(e,t){const r=e.getBoundingClientRect();return b(e,r,t)}function m(e,t){const r=e.getBoundingClientRect(),n=[];for(let i=0;i<t.length;i++)n.push(b(e,r,t[i]));return n}function g(t){return void 0!==e.window.InstallTrigger&&2===t.button&&t.ctrlKey&&e.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:t.button}function b(t,r,n){const i=t.offsetWidth===r.width?1:t.offsetWidth/r.width;return new e.Point((n.clientX-r.left)*i,(n.clientY-r.top)*i)}function _(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=r*o-i*n;return a?(e[0]=o*(a=1/a),e[1]=-n*a,e[2]=-i*a,e[3]=r*a,e):null}function y(e){const{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class v extends e.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:e,callback:t}of this.requestors)this._notify(e,t);this.requestors=[]}}hasImage(e){return!!this.getImage(e)}getImage(e){return this.images[e]}addImage(e,t){this._validate(e,t)&&(this.images[e]=t)}_validate(t,r){let n=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new e.ErrorEvent(new Error(`Image "${t}" has invalid "stretchX" value`))),n=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new e.ErrorEvent(new Error(`Image "${t}" has invalid "stretchY" value`))),n=!1),this._validateContent(r.content,r)||(this.fire(new e.ErrorEvent(new Error(`Image "${t}" has invalid "content" value`))),n=!1),n}_validateStretch(e,t){if(!e)return!0;let r=0;for(const n of e){if(n[0]<r||n[1]<n[0]||t<n[1])return!1;r=n[1]}return!0}_validateContent(e,t){return!(e&&(4!==e.length||e[0]<0||t.data.width<e[0]||e[1]<0||t.data.height<e[1]||e[2]<0||t.data.width<e[2]||e[3]<0||t.data.height<e[3]||e[2]<e[0]||e[3]<e[1]))}updateImage(e,t){t.version=this.images[e].version+1,this.images[e]=t,this.updatedImages[e]=!0}removeImage(e){const t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e,t){let r=!0;if(!this.isLoaded())for(const t of e)this.images[t]||(r=!1);this.isLoaded()||r?this._notify(e,t):this.requestors.push({ids:e,callback:t})}_notify(t,r){const n={};for(const r of t){this.images[r]||this.fire(new e.Event("styleimagemissing",{id:r}));const t=this.images[r];t?n[r]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:e.warnOnce(`Image "${r}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}r(null,n)}getPixelSize(){const{width:e,height:t}=this.atlasImage;return{width:e,height:t}}getPattern(t){const r=this.patterns[t],n=this.getImage(t);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{const r={w:n.data.width+2,h:n.data.height+2,x:0,y:0},i=new e.ImagePosition(r,n);this.patterns[t]={bin:r,position:i}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const r=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new e.Texture(t,this.atlasImage,r.RGBA),this.atlasTexture&&this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const e in this.patterns)t.push(this.patterns[e].bin);const{w:r,h:n}=e.potpack(t),i=this.atlasImage;i.resize({width:r||1,height:n||1});for(const t in this.patterns){const{bin:r}=this.patterns[t],n=r.x+1,o=r.y+1,a=this.images[t].data,s=a.width,l=a.height;e.RGBAImage.copy(a,i,{x:0,y:0},{x:n,y:o},{width:s,height:l}),e.RGBAImage.copy(a,i,{x:0,y:l-1},{x:n,y:o-1},{width:s,height:1}),e.RGBAImage.copy(a,i,{x:0,y:0},{x:n,y:o+l},{width:s,height:1}),e.RGBAImage.copy(a,i,{x:s-1,y:0},{x:n-1,y:o},{width:1,height:l}),e.RGBAImage.copy(a,i,{x:0,y:0},{x:n+s,y:o},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const t of e){if(this.callbackDispatchedThisFrame[t])continue;this.callbackDispatchedThisFrame[t]=!0;const e=this.images[t];y(e)&&this.updateImage(t,e)}}}const x=new e.Properties({anchor:new e.DataConstantProperty(e.spec.light.anchor),position:new class{constructor(){this.specification=e.spec.light.position}possiblyEvaluate(t,r){return function([t,r,n]){const i=e.degToRad(r+90),o=e.degToRad(n);return{x:t*Math.cos(i)*Math.sin(o),y:t*Math.sin(i)*Math.sin(o),z:t*Math.cos(o),azimuthal:r,polar:n}}(t.expression.evaluate(r))}interpolate(t,r,n){return{x:e.number(t.x,r.x,n),y:e.number(t.y,r.y,n),z:e.number(t.z,r.z,n),azimuthal:e.number(t.azimuthal,r.azimuthal,n),polar:e.number(t.polar,r.polar,n)}}},color:new e.DataConstantProperty(e.spec.light.color),intensity:new e.DataConstantProperty(e.spec.light.intensity)});class w extends e.Evented{constructor(t){super(),this._transitionable=new e.Transitionable(x),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,r={}){if(!this._validate(e.validateLight,t,r))for(const r in t){const n=t[r];e.endsWith(r,"-transition")?this._transitionable.setTransition(r.slice(0,-11),n):this._transitionable.setValue(r,n)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,r,n){return(!n||!1!==n.validate)&&e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.spec})))}}const k=new e.Properties({source:new e.DataConstantProperty(e.spec.terrain.source),exaggeration:new e.DataConstantProperty(e.spec.terrain.exaggeration)});let E=class extends e.Evented{constructor(t,r){super(),this._transitionable=new e.Transitionable(k),this.set(t),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=r}get(){return this._transitionable.serialize()}set(t){for(const r in t){const n=t[r];e.endsWith(r,"-transition")?this._transitionable.setTransition(r.slice(0,-11),n):this._transitionable.setValue(r,n)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}};function T(t,r,n,i){const o=e.smoothstep(45,65,n),[a,s]=S(t,i),l=e.length(r);let c=1-Math.min(1,Math.exp((l-a)/(s-a)*-6));return c*=c*c,c=Math.min(1,1.00747*c),c*o*t.alpha}function S(e,t){const r=.5/Math.tan(.5*t);return[e.range[0]+r,e.range[1]+r]}const C=new e.Properties({range:new e.DataConstantProperty(e.spec.fog.range),color:new e.DataConstantProperty(e.spec.fog.color),"high-color":new e.DataConstantProperty(e.spec.fog["high-color"]),"space-color":new e.DataConstantProperty(e.spec.fog["space-color"]),"horizon-blend":new e.DataConstantProperty(e.spec.fog["horizon-blend"]),"star-intensity":new e.DataConstantProperty(e.spec.fog["star-intensity"])});class A extends e.Evented{constructor(t,r){super(),this._transitionable=new e.Transitionable(C),this.set(t),this._transitioning=this._transitionable.untransitioned(),this._transform=r}get state(){const t=this._transform,r="globe"===t.projection.name,n=e.globeToMercatorTransition(t.zoom),i=this.properties.get("range"),o=[.5,3];return{range:r?[e.number(o[0],i[0],n),e.number(o[1],i[1],n)]:i,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(t,r={}){if(!this._validate(e.validateFog,t,r)){for(const r of Object.keys(e.spec.fog))t&&void 0===t[r]&&(t[r]=e.spec.fog[r].default);for(const r in t){const n=t[r];e.endsWith(r,"-transition")?this._transitionable.setTransition(r.slice(0,-11),n):this._transitionable.setValue(r,n)}}}getOpacity(t){if(!this._transform.projection.supportsFog)return 0;const r=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:e.smoothstep(45,65,t))*r.a}getOpacityAtLatLng(t,r){return this._transform.projection.supportsFog?function(t,r,n){const i=e.MercatorCoordinate.fromLngLat(r),o=n.elevation?n.elevation.getAtPointOrZero(i):0,a=[i.x,i.y,o];return e.transformMat4(a,a,n.mercatorFogMatrix),T(t,a,n.pitch,n._fov)}(this.state,t,r):0}getFovAdjustedRange(e){return this._transform.projection.supportsFog?S(this.state,e):[0,1]}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,r,n){return(!n||!1!==n.validate)&&e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.spec})))}}class M{constructor(t,r){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=e.uniqueId();const n=this.workerPool.acquire(this.id);for(let e=0;e<n.length;e++){const t=new M.Actor(n[e],r,this.id);t.name=`Worker ${e}`,this.actors.push(t)}this.ready=!1,this.broadcast("checkIfReady",null,(()=>{this.ready=!0}))}broadcast(t,r,n){e.asyncAll(this.actors,((e,n)=>{e.send(t,r,n)}),n=n||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((e=>{e.remove()})),this.actors=[],this.workerPool.release(this.id)}}function I(t,r,n){return r*(e.EXTENT/(t.tileSize*Math.pow(2,n-t.tileID.overscaledZ)))}M.Actor=e.Actor;class O{constructor(e,t,r,n){this.screenBounds=e,this.cameraPoint=t,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=r,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,n)}static createFromScreenPoints(t,r){let n,i;if(t instanceof e.Point||"number"==typeof t[0]){const o=e.Point.convert(t);n=[o],i=r.isPointAboveHorizon(o)}else{const o=e.Point.convert(t[0]),a=e.Point.convert(t[1]);n=[o,a],i=e.polygonizeBounds(o,a).every((e=>r.isPointAboveHorizon(e)))}return new O(n,r.getCameraPoint(),i,r)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(t){return e.polygonizeBounds(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],t)}bufferedCameraGeometry(t){const r=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new e.Point(1,1)):this.screenBounds[1],i=e.polygonizeBounds(r,n,0,!1);return this.cameraPoint.y>n.y&&(this.cameraPoint.x>r.x&&this.cameraPoint.x<n.x?i.splice(3,0,this.cameraPoint):this.cameraPoint.x>=n.x?i[2]=this.cameraPoint:this.cameraPoint.x<=r.x&&(i[3]=this.cameraPoint)),e.bufferConvexPolygon(i,t)}bufferedCameraGeometryGlobe(t){const r=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new e.Point(1,1)):this.screenBounds[1],i=e.polygonizeBounds(r,n,t),o=this.cameraPoint.clone();switch(3*((o.y>r.y)+(o.y>n.y))+((o.x>r.x)+(o.x>n.x))){case 0:i[0]=o,i[4]=o.clone();break;case 1:i.splice(1,0,o);break;case 2:i[1]=o;break;case 3:i.splice(4,0,o);break;case 5:i.splice(2,0,o);break;case 6:i[3]=o;break;case 7:i.splice(3,0,o);break;case 8:i[2]=o}return i}containsTile(t,r,n,i=0){const o=t.queryPadding/r._pixelsPerMercatorPixel+1,a=n?this._bufferedCameraMercator(o,r):this._bufferedScreenMercator(o,r);let s=t.tileID.wrap+(a.unwrapped?i:0);const l=a.polygon.map((r=>e.getTilePoint(t.tileTransform,r,s)));if(!e.polygonIntersectsBox(l,0,0,e.EXTENT,e.EXTENT))return;s=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?i:0);const c=this.screenGeometryMercator.polygon.map((r=>e.getTileVec3(t.tileTransform,r,s))),u=c.map((t=>new e.Point(t[0],t[1]))),p=r.getFreeCameraOptions().position||new e.MercatorCoordinate(0,0,0),h=e.getTileVec3(t.tileTransform,p,s),d=c.map((t=>{const r=e.sub(t,t,h);return e.normalize(r,r),new e.Ray(h,r)})),f=I(t,1,r.zoom)*r._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:u,tilespaceRays:d,bufferedTilespaceGeometry:l,bufferedTilespaceBounds:(m=e.getBounds(l),m.min.x=e.clamp(m.min.x,0,e.EXTENT),m.min.y=e.clamp(m.min.y,0,e.EXTENT),m.max.x=e.clamp(m.max.x,0,e.EXTENT),m.max.y=e.clamp(m.max.y,0,e.EXTENT),m),tile:t,tileID:t.tileID,pixelToTileUnitsFactor:f};var m}_bufferedScreenMercator(e,t){const r=D(e);if(this._screenRaycastCache[r])return this._screenRaycastCache[r];{let n;return n="globe"===t.projection.name?this._projectAndResample(this.bufferedScreenGeometry(e),t):{polygon:this.bufferedScreenGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._screenRaycastCache[r]=n,n}}_bufferedCameraMercator(e,t){const r=D(e);if(this._cameraRaycastCache[r])return this._cameraRaycastCache[r];{let n;return n="globe"===t.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(e),t):{polygon:this.bufferedCameraGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._cameraRaycastCache[r]=n,n}}_projectAndResample(t,r){const n=function(t,r){const n=e.multiply([],r.pixelMatrix,r.globeMatrix),i=[0,-e.GLOBE_RADIUS,0,1],o=[0,e.GLOBE_RADIUS,0,1],a=[0,0,0,1];e.transformMat4$1(i,i,n),e.transformMat4$1(o,o,n),e.transformMat4$1(a,a,n);const s=new e.Point(i[0]/i[3],i[1]/i[3]),l=new e.Point(o[0]/o[3],o[1]/o[3]),c=e.polygonContainsPoint(t,s)&&i[3]<a[3],u=e.polygonContainsPoint(t,l)&&o[3]<a[3];if(!c&&!u)return null;const p=function(e,t,r){for(let n=1;n<e.length;n++){const i=z(t.pointCoordinate3D(e[n-1]).x),o=z(t.pointCoordinate3D(e[n]).x);if(r<0){if(i<o)return{idx:n,t:-i/(o-1-i)}}else if(o<i)return{idx:n,t:(1-i)/(o+1-i)}}return null}(t,r,c?-1:1);if(!p)return null;const{idx:h,t:d}=p;let f=h>1?L(t.slice(0,h),r):[],m=h<t.length?L(t.slice(h),r):[];f=f.map((t=>new e.Point(z(t.x),t.y))),m=m.map((t=>new e.Point(z(t.x),t.y)));const g=[...f];0===g.length&&g.push(m[m.length-1]);const b=e.number(g[g.length-1].y,(0===m.length?f[0]:m[0]).y,d);let _;return _=c?[new e.Point(0,b),new e.Point(0,0),new e.Point(1,0),new e.Point(1,b)]:[new e.Point(1,b),new e.Point(1,1),new e.Point(0,1),new e.Point(0,b)],g.push(..._),0===m.length?g.push(f[0]):g.push(...m),{polygon:g.map((t=>new e.MercatorCoordinate(t.x,t.y))),unwrapped:!1}}(t,r);if(n)return n;const i=function(t,r){let n=!1,i=-1/0,o=0;for(let e=0;e<t.length-1;e++)t[e].x>i&&(i=t[e].x,o=e);for(let e=0;e<t.length-1;e++){const r=(o+e)%(t.length-1),i=t[r],a=t[r+1];Math.abs(i.x-a.x)>.5&&(i.x<a.x?(i.x+=1,0===r&&(t[t.length-1].x+=1)):(a.x+=1,r+1===t.length-1&&(t[0].x+=1)),n=!0)}const a=e.mercatorXfromLng(r.center.lng);return n&&a<Math.abs(a-1)&&t.forEach((e=>{e.x-=1})),{polygon:t,unwrapped:n}}(L(t,r).map((t=>new e.Point(z(t.x),t.y))),r);return{polygon:i.polygon.map((t=>new e.MercatorCoordinate(t.x,t.y))),unwrapped:i.unwrapped}}}function L(t,r){return e.resample(t,(e=>{const t=r.pointCoordinate3D(e);e.x=t.x,e.y=t.y}),1/256)}function z(e){return e<0?1+e%1:e%1}function D(e){return 100*e|0}function P(t,r,n,i,o){const a=function(n,i){if(n)return o(n);if(i){t.url&&i.tiles&&t.tiles&&delete t.tiles;const n=e.pick(e.extend(i,t),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);i.vector_layers&&(n.vectorLayers=i.vector_layers,n.vectorLayerIds=n.vectorLayers.map((e=>e.id))),n.tiles=r.canonicalizeTileset(n,t.url),o(null,n)}};return t.url?e.getJSON(r.transformRequest(r.normalizeSourceURL(t.url,null,n,i),e.ResourceType.Source),a):e.exported.frame((()=>a(null,t)))}class R{constructor(t,r,n){this.bounds=e.LngLatBounds.convert(this.validateBounds(t)),this.minzoom=r||0,this.maxzoom=n||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(t){const r=Math.pow(2,t.z),n=Math.floor(e.mercatorXfromLng(this.bounds.getWest())*r),i=Math.floor(e.mercatorYfromLat(this.bounds.getNorth())*r),o=Math.ceil(e.mercatorXfromLng(this.bounds.getEast())*r),a=Math.ceil(e.mercatorYfromLat(this.bounds.getSouth())*r);return t.x>=n&&t.x<o&&t.y>=i&&t.y<a}}class B{constructor(e,t,r){this.context=e;const n=e.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||t.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const F={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class j{constructor(e,t,r,n){this.length=t.length,this.attributes=r,this.itemSize=t.bytesPerElement,this.dynamicDraw=n,this.context=e;const i=e.gl;this.buffer=i.createBuffer(),e.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||t.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let r=0;r<this.attributes.length;r++){const n=t.attributes[this.attributes[r].name];void 0!==n&&e.enableVertexAttribArray(n)}}setVertexAttribPointers(e,t,r){for(let n=0;n<this.attributes.length;n++){const i=this.attributes[n],o=t.attributes[i.name];void 0!==o&&e.vertexAttribPointer(o,i.components,e[F[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class N{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class U extends N{getDefault(){return e.Color.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class V extends N{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class q extends N{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class $ extends N{getDefault(){return[!0,!0,!0,!0]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class G extends N{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class W extends N{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class H extends N{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class Z extends N{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class X extends N{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class K extends N{getDefault(){return[0,1]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class Y extends N{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class J extends N{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class Q extends N{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class ee extends N{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class te extends N{getDefault(){return e.Color.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class re extends N{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class ne extends N{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class ie extends N{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class oe extends N{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}let ae,se=class extends N{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}};class le extends N{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class ce extends N{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class ue extends N{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class pe extends N{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class he extends N{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class de extends N{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class fe extends N{getDefault(){return null}set(e){const t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class me extends N{constructor(e){super(e),this.vao=e.extVertexArrayObject}getDefault(){return null}set(e){this.vao&&(e!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(e),this.current=e,this.dirty=!1)}}class ge extends N{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class be extends N{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class _e extends N{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class ye extends N{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class ve extends ye{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class xe extends ye{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,this.attachment(),t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class we extends xe{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class ke{constructor(e,t,r,n){this.context=e,this.width=t,this.height=r;const i=this.framebuffer=e.gl.createFramebuffer();this.colorAttachment=new ve(e,i),n&&(this.depthAttachment=new xe(e,i))}destroy(){const e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){const t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}}class Ee{constructor(e,t=!1){if(this.gl=e,this.isWebGL2=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),t){const t=e;this.extVertexArrayObject={createVertexArrayOES:t.createVertexArray.bind(e),deleteVertexArrayOES:t.deleteVertexArray.bind(e),bindVertexArrayOES:t.bindVertexArray.bind(e)}}this.clearColor=new U(this),this.clearDepth=new V(this),this.clearStencil=new q(this),this.colorMask=new $(this),this.depthMask=new G(this),this.stencilMask=new W(this),this.stencilFunc=new H(this),this.stencilOp=new Z(this),this.stencilTest=new X(this),this.depthRange=new K(this),this.depthTest=new Y(this),this.depthFunc=new J(this),this.blend=new Q(this),this.blendFunc=new ee(this),this.blendColor=new te(this),this.blendEquation=new re(this),this.cullFace=new ne(this),this.cullFaceSide=new ie(this),this.frontFace=new oe(this),this.program=new se(this),this.activeTexture=new le(this),this.viewport=new ce(this),this.bindFramebuffer=new ue(this),this.bindRenderbuffer=new pe(this),this.bindTexture=new he(this),this.bindVertexBuffer=new de(this),this.bindElementBuffer=new fe(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new me(this),this.pixelStoreUnpack=new ge(this),this.pixelStoreUnpackPremultiplyAlpha=new be(this),this.pixelStoreUnpackFlipY=new _e(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureFilterAnisotropicForceOff=!1,this.extStandardDerivativesForceOff=!1,this.extDebugRendererInfo=e.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=e.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=e.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),t||(this.extTextureHalfFloat=e.getExtension("OES_texture_half_float")),(t||this.extTextureHalfFloat&&e.getExtension("OES_texture_half_float_linear"))&&(this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float")),this.extStandardDerivatives=t||e.getExtension("OES_standard_derivatives"),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t){return new B(this,e,t)}createVertexBuffer(e,t,r){return new j(this,e,t,r)}createRenderbuffer(e,t,r){const n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,e,t,r),this.bindRenderbuffer.set(null),i}createFramebuffer(e,t,r){return new ke(this,e,t,r)}clear({color:e,depth:t,stencil:r}){const n=this.gl;let i=0;e&&(i|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==t&&(i|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==r&&(i|=n.STENCIL_BUFFER_BIT,this.clearStencil.set(r),this.stencilMask.set(255)),n.clear(i)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(r){t(r.blendFunction,e.ColorMode.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(r.blendFunction),this.blendColor.set(r.blendColor)),this.colorMask.set(r.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class Te extends e.Evented{constructor(t,r,n,i){if(super(),this.id=t,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.extend(this,e.pick(r,["url","scheme","tileSize","promoteId"])),this._options=e.extend({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(i),this._tileWorkers={},this._deduped=new e.DedupedRequest}load(t){this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"}));const r=Array.isArray(this.map._language)?this.map._language.join():this.map._language,n=this.map._worldview;this._tileJSONRequest=P(this._options,this.map._requestManager,r,n,((r,i)=>{this._tileJSONRequest=null,this._loaded=!0,r?(n&&n.length,this.fire(new e.ErrorEvent(r))):i&&(e.extend(this,i),i.bounds&&(this.tileBounds=new R(i.bounds,this.minzoom,this.maxzoom)),e.postTurnstileEvent(i.tiles,this.map._requestManager._customAccessToken),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"}))),t&&t(r)}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest(),this.load((()=>this.map.style._clearSource(this.id)))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return e.extend({},this._options)}loadTile(t,r){const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(n,e.ResourceType.Tile),data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:e.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:t.isSymbolTile};if(i.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state)"loading"===t.state?t.reloadCallback=r:t.request=t.actor.send("reloadTile",i,o.bind(this));else if(t.actor=this._tileWorkers[n]=this._tileWorkers[n]||this.dispatcher.getActor(),this.dispatcher.ready)t.request=t.actor.send("loadTile",i,o.bind(this),void 0,!0);else{const r=e.loadVectorTile.call({deduped:this._deduped},i,((e,r)=>{e||!r?o.call(this,e):(i.data={cacheControl:r.cacheControl,expires:r.expires,rawData:r.rawData.slice(0)},t.actor&&t.actor.send("loadTile",i,o.bind(this),void 0,!0))}),!0);t.request={cancel:r}}function o(n,i){return delete t.request,t.aborted?r(null):n&&404!==n.status?r(n):(i&&i.resourceTiming&&(t.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&t.setExpiryData(i),t.loadVectorData(i,this.map.painter),e.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id})}unloadTile(e){e.unloadVectorData(),e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Se extends e.Evented{constructor(t,r,n,i){super(),this.id=t,this.dispatcher=n,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.extend({type:"raster"},r),e.extend(this,e.pick(r,["url","scheme","tileSize"]))}load(t){this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=P(this._options,this.map._requestManager,null,null,((r,n)=>{this._tileJSONRequest=null,this._loaded=!0,r?this.fire(new e.ErrorEvent(r)):n&&(e.extend(this,n),n.bounds&&(this.tileBounds=new R(n.bounds,this.minzoom,this.maxzoom)),e.postTurnstileEvent(n.tiles),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"}))),t&&t(r)}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest(),this.load((()=>this.map.style._clearSource(this.id)))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return e.extend({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(t,r){const n=e.exported.devicePixelRatio>=2,i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),n,this.tileSize);t.request=e.getImage(this.map._requestManager.transformRequest(i,e.ResourceType.Tile),((n,i,o,a)=>(delete t.request,t.aborted?(t.state="unloaded",r(null)):n?(t.state="errored",r(n)):i?(this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:o,expires:a}),t.setTexture(i,this.map.painter),t.state="loaded",e.cacheEntryPossiblyAdded(this.dispatcher),void r(null)):r(null))))}static loadTileData(e,t,r){e.setTexture(t,r)}static unloadTileData(e,t){e.texture&&t.saveTileTexture(e.texture)}abortTile(e,t){e.request&&(e.request.cancel(),delete e.request),t()}unloadTile(e,t){e.texture&&this.map.painter.saveTileTexture(e.texture),t()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function Ce(t,r,n,i,o,a,s,l){const c=[t,n,o,r,i,a,1,1,1],u=[s,l,1],p=e.adjoint([],c),[h,d,f]=e.transformMat3(u,u,e.transpose(p,p));return e.multiply$1(c,[h,0,0,0,d,0,0,0,f],c)}class Ae extends e.Evented{constructor(e,t,r,n){super(),this.id=e,this.dispatcher=r,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=t,this._dirty=!1}load(t,r){this._loaded=r||!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),((r,n)=>{if(this._imageRequest=null,this._loaded=!0,r)this.fire(new e.ErrorEvent(r));else if(n){const{HTMLImageElement:r}=e.window;this.image=n instanceof r?e.exported.getImageData(n):n,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,t&&(this.coordinates=t),this._finishLoading()}}))}loaded(){return this._loaded}updateImage(e){return this.image&&e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(t){this.coordinates=t,this._boundsArray=void 0;const r=t.map(e.MercatorCoordinate.fromLngLat);return this.tileID=function(t){let r=1/0,n=1/0,i=-1/0,o=-1/0;for(const e of t)r=Math.min(r,e.x),n=Math.min(n,e.y),i=Math.max(i,e.x),o=Math.max(o,e.y);const a=Math.max(i-r,o-n),s=Math.max(0,Math.floor(-Math.log(a)/Math.LN2)),l=Math.pow(2,s);return new e.CanonicalTileID(s,Math.floor((r+i)/2*l),Math.floor((n+o)/2*l))}(r),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(t){for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture)}if(this._boundsArray)return;const r=e.tileTransform(this.tileID,this.map.transform.projection),[n,i,o,a]=this.coordinates.map((t=>{const n=r.projection.project(t[0],t[1]);return e.getTilePoint(r,n)._round()}));this.perspectiveTransform=function(t,r,n,i,o,a,s,l,c,u){const p=Ce(0,0,t,0,0,r,t,r),h=Ce(n,i,o,a,s,l,c,u);return e.multiply$1(h,e.adjoint(p,p),h),[h[6]/h[8]*t/e.EXTENT,h[7]/h[8]*r/e.EXTENT]}(this.width,this.height,n.x,n.y,i.x,i.y,a.x,a.y,o.x,o.y);const s=this._boundsArray=new e.StructArrayLayout4i8;s.emplaceBack(n.x,n.y,0,0),s.emplaceBack(i.x,i.y,e.EXTENT,0),s.emplaceBack(a.x,a.y,0,e.EXTENT),s.emplaceBack(o.x,o.y,e.EXTENT,e.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=t.createVertexBuffer(s,e.boundsAttributes.members),this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const t=this.map.painter.context,r=t.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new e.Texture(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(t)}loadTile(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Me={vector:Te,raster:Se,"raster-dem":class extends Se{constructor(t,r,n,i){super(t,r,n,i),this.type="raster-dem",this.maxzoom=22,this._options=e.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox"}loadTile(t,r){const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function i(e,n){e&&(t.state="errored",r(e)),n&&(t.dem=n,t.dem.onDeserialize(),t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0,t.state="loaded",r(null))}t.request=e.getImage(this.map._requestManager.transformRequest(n,e.ResourceType.Tile),function(n,o,a,s){if(delete t.request,t.aborted)t.state="unloaded",r(null);else if(n)t.state="errored",r(n);else if(o){this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:a,expires:s});const r=e.window.ImageBitmap&&o instanceof e.window.ImageBitmap&&(null==ae&&(ae=e.window.OffscreenCanvas&&new e.window.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof e.window.createImageBitmap),ae),n=1-(o.width-e.prevPowerOfTwo(o.width))/2;n<1||t.neighboringTiles||(t.neighboringTiles=this._getNeighboringTiles(t.tileID));const l=r?o:e.exported.getImageData(o,n),c={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:l,encoding:this.encoding,padding:n};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",c,i.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(t){const r=t.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,o=0===r.x?t.wrap-1:t.wrap,a=(r.x+1+n)%n,s=r.x+1===n?t.wrap+1:t.wrap,l={};return l[new e.OverscaledTileID(t.overscaledZ,o,r.z,i,r.y).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,a,r.y).key]={backfilled:!1},r.y>0&&(l[new e.OverscaledTileID(t.overscaledZ,o,r.z,i,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new e.OverscaledTileID(t.overscaledZ,o,r.z,i,r.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,a,r.y+1).key]={backfilled:!1}),l}unloadTile(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded"}},geojson:class extends e.Evented{constructor(t,r,n,i){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=n.getActor(),this.setEventedParent(i),this._data=r.data,this._options=e.extend({},r),this._collectResourceTiming=r.collectResourceTiming,void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;const o=e.EXTENT/this.tileSize;this.workerOptions=e.extend({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*o,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*o,extent:e.EXTENT,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?r.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:e.EXTENT,radius:(void 0!==r.clusterRadius?r.clusterRadius:50)*o,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions)}onAdd(e){this.map=e,this.setData(this._data)}setData(e){return this._data=e,this._updateWorkerData(),this}getClusterExpansionZoom(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this}getClusterChildren(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this}getClusterLeaves(e,t,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:r},n),this}_updateWorkerData(){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new e.Event("dataloading",{dataType:"source"})),this._loaded=!1;const t=e.extend({},this.workerOptions),r=this._data;"string"==typeof r?(t.request=this.map._requestManager.transformRequest(e.exported.resolveURL(r),e.ResourceType.Source),t.request.collectResourceTiming=this._collectResourceTiming):t.data=JSON.stringify(r),this._pendingLoad=this.actor.send(`${this.type}.loadData`,t,((t,r)=>{if(this._loaded=!0,this._pendingLoad=null,t)this.fire(new e.ErrorEvent(t));else{const t={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&r&&r.resourceTiming&&r.resourceTiming[this.id]&&(t.resourceTiming=r.resourceTiming[this.id]),this.fire(new e.Event("data",t)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)}))}loaded(){return this._loaded}loadTile(t,r){const n=t.actor?"reloadTile":"loadTile";t.actor=this.actor,t.request=this.actor.send(n,{type:this.type,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},((e,i)=>(delete t.request,t.unloadVectorData(),t.aborted?r(null):e?r(e):(t.loadVectorData(i,this.map.painter,"reloadTile"===n),r(null)))),void 0,"loadTile"===n)}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0}unloadTile(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return e.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends Ae{constructor(e,t,r,n){super(e,t,r,n),this.roundZoom=!0,this.type="video",this.options=t}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const r of t.urls)this.urls.push(this.map._requestManager.transformRequest(r,e.ResourceType.Source).url);e.getVideo(this.urls,((t,r)=>{this._loaded=!0,t?this.fire(new e.ErrorEvent(t)):r&&(this.video=r,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading())}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const r=this.video.seekable;t<r.start(0)||t>r.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,r=t.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(t)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:Ae,canvas:class extends Ae{constructor(t,r,n,i){super(t,r,n,i),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e))))||this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof e.window.HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const r=this.map.painter.context;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(r,this.canvas,r.gl.RGBA,{premultiply:!0}),this._prepareData(r)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},custom:class extends e.Evented{constructor(t,r,n,i){super(),this.id=t,this.type="custom",this._dataType="raster",this._dispatcher=n,this._implementation=r,this.setEventedParent(i),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new e.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new e.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new R(this._implementation.bounds,this.minzoom,this.maxzoom)),r.update=this._update.bind(this),r.clearTiles=this._clearTiles.bind(this),r.coveringTiles=this._coveringTiles.bind(this),e.extend(this,e.pick(r,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return e.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(t){this._map=t,this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(t),this.load()}onRemove(e){this._implementation.onRemove&&this._implementation.onRemove(e)}hasTile(e){if(this._implementation.hasTile){const{x:t,y:r,z:n}=e.canonical;return this._implementation.hasTile({x:t,y:r,z:n})}return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(t,r){const{x:n,y:i,z:o}=t.tileID.canonical,a=new e.window.AbortController;t.request=Promise.resolve(this._implementation.loadTile({x:n,y:i,z:o},{signal:a.signal})).then(function(n){return delete t.request,t.aborted?(t.state="unloaded",r(null)):void 0===n?(t.state="errored",r(null)):null===n?(this.loadTileData(t,{width:this.tileSize,height:this.tileSize,data:null}),t.state="loaded",r(null)):function(t){return t instanceof e.window.ImageData||t instanceof e.window.HTMLCanvasElement||t instanceof e.window.ImageBitmap||t instanceof e.window.HTMLImageElement}(n)?(this.loadTileData(t,n),t.state="loaded",void r(null)):(t.state="errored",r(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}.bind(this)).catch((e=>{20!==e.code&&(t.state="errored",r(e))})),t.request.cancel=()=>a.abort()}loadTileData(e,t){Se.loadTileData(e,t,this._map.painter)}unloadTileData(e){Se.unloadTileData(e,this._map.painter)}unloadTile(e,t){if(this.unloadTileData(e),this._implementation.unloadTile){const{x:t,y:r,z:n}=e.tileID.canonical;this._implementation.unloadTile({x:t,y:r,z:n})}t()}abortTile(e,t){e.request&&e.request.cancel&&(e.request.cancel(),delete e.request),t()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map((e=>({x:e.canonical.x,y:e.canonical.y,z:e.canonical.z})))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"}))}}},Ie=function(t,r,n,i){const o=new Me[r.type](t,r,n,i);if(o.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${o.id}`);return e.bindAll(["load","abort","unload","serialize","prepare"],o),o};function Oe(t,r){const n=e.identity([]);return e.scale(n,n,[.5*t.width,.5*-t.height,1]),e.translate(n,n,[1,-1,0]),e.multiply(n,n,t.calculateProjMatrix(r.toUnwrapped())),Float32Array.from(n)}function Le(e,t,r,n,i,o,a,s=!1){const l=e.tilesIn(n,a,s);l.sort(De);const c=[];for(const n of l)c.push({wrappedTileID:n.tile.tileID.wrapped().key,queryResults:n.tile.queryRenderedFeatures(t,r,e._state,n,i,o,Oe(e.transform,n.tile.tileID),s)});const u=function(e){const t={},r={};for(const n of e){const e=n.queryResults,i=n.wrappedTileID,o=r[i]=r[i]||{};for(const r in e){const n=e[r],i=o[r]=o[r]||{},a=t[r]=t[r]||[];for(const e of n)i[e.featureIndex]||(i[e.featureIndex]=!0,a.push(e))}}return t}(c);for(const t in u)u[t].forEach((t=>{const r=t.feature,n=r.layer;n&&"background"!==n.type&&"sky"!==n.type&&(r.source=n.source,n["source-layer"]&&(r.sourceLayer=n["source-layer"]),r.state=void 0!==r.id?e.getFeatureState(n["source-layer"],r.id):{})}));return u}function ze(e,t){const r=e.getRenderableIds().map((t=>e.getTileByID(t))),n=[],i={};for(let e=0;e<r.length;e++){const o=r[e],a=o.tileID.canonical.key;i[a]||(i[a]=!0,o.querySourceFeatures(n,t))}return n}function De(e,t){const r=e.tileID,n=t.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}function Pe(){return null!=ho.workerClass?new ho.workerClass:new e.window.Worker(ho.workerUrl)}const Re="mapboxgl_preloaded_worker_pool";class Be{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<Be.workerCount;)this.workers.push(new Pe);return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],0===this.numActive()&&(this.workers.forEach((e=>{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[Re]}numActive(){return Object.keys(this.active).length}}let Fe;function je(){return Fe||(Fe=new Be),Fe}function Ne(t,r){const n={};for(const e in t)"ref"!==e&&(n[e]=t[e]);return e.refProperties.forEach((e=>{e in r&&(n[e]=r[e])})),n}function Ue(e){e=e.slice();const t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=Ne(e[r],t[e[r].ref]));return e}Be.workerCount=2;const Ve={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setProjection:"setProjection"};function qe(e,t,r){r.push({command:Ve.addSource,args:[e,t[e]]})}function $e(e,t,r){t.push({command:Ve.removeSource,args:[e]}),r[e]=!0}function Ge(e,t,r,n){$e(e,r,n),qe(e,t,r)}function We(e,r,n){let i;for(i in e[n])if(e[n].hasOwnProperty(i)&&"data"!==i&&!t(e[n][i],r[n][i]))return!1;for(i in r[n])if(r[n].hasOwnProperty(i)&&"data"!==i&&!t(e[n][i],r[n][i]))return!1;return!0}function He(e,r,n,i,o,a){let s;for(s in r=r||{},e=e||{})e.hasOwnProperty(s)&&(t(e[s],r[s])||n.push({command:a,args:[i,s,r[s],o]}));for(s in r)r.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t(e[s],r[s])||n.push({command:a,args:[i,s,r[s],o]}))}function Ze(e){return e.id}function Xe(e,t){return e[t.id]=t,e}class Ke{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.clamp(t,0,1);let r=1,n=this._distances[r];const i=t*this.paddedLength+this.padding;for(;n<i&&r<this._distances.length;)n=this._distances[++r];const o=r-1,a=this._distances[o],s=n-a,l=s>0?(i-a)/s:0;return this.points[o].mult(1-l).add(this.points[r].mult(l))}}class Ye{constructor(e,t,r){const n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(let e=0;e<this.xCellCount*this.yCellCount;e++)n.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)}insertCircle(e,t,r,n){this._forEachCell(t-n,r-n,t+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(n)}_insertBoxCell(e,t,r,n,i,o){this.boxCells[i].push(o)}_insertCircleCell(e,t,r,n,i,o){this.circleCells[i].push(o)}_query(e,t,r,n,i,o){if(r<0||e>this.width||n<0||t>this.height)return!i&&[];const a=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(let e=0;e<this.boxKeys.length;e++)a.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){const t=this.circles[3*e],r=this.circles[3*e+1],n=this.circles[3*e+2];a.push({key:this.circleKeys[e],x1:t-n,y1:r-n,x2:t+n,y2:r+n})}return o?a.filter(o):a}return this._forEachCell(e,t,r,n,this._queryCell,a,{hitTest:i,seenUids:{box:{},circle:{}}},o),i?a.length>0:a}_queryCircle(e,t,r,n,i){const o=e-r,a=e+r,s=t-r,l=t+r;if(a<0||o>this.width||l<0||s>this.height)return!n&&[];const c=[];return this._forEachCell(o,s,a,l,this._queryCellCircle,c,{hitTest:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}},i),n?c.length>0:c}query(e,t,r,n,i){return this._query(e,t,r,n,!1,i)}hitTest(e,t,r,n,i){return this._query(e,t,r,n,!0,i)}hitTestCircle(e,t,r,n){return this._queryCircle(e,t,r,!0,n)}_queryCell(e,t,r,n,i,o,a,s){const l=a.seenUids,c=this.boxCells[i];if(null!==c){const i=this.bboxes;for(const u of c)if(!l.box[u]){l.box[u]=!0;const c=4*u;if(e<=i[c+2]&&t<=i[c+3]&&r>=i[c+0]&&n>=i[c+1]&&(!s||s(this.boxKeys[u]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[u],x1:i[c],y1:i[c+1],x2:i[c+2],y2:i[c+3]})}}}const u=this.circleCells[i];if(null!==u){const i=this.circles;for(const c of u)if(!l.circle[c]){l.circle[c]=!0;const u=3*c;if(this._circleAndRectCollide(i[u],i[u+1],i[u+2],e,t,r,n)&&(!s||s(this.circleKeys[c]))){if(a.hitTest)return o.push(!0),!0;{const e=i[u],t=i[u+1],r=i[u+2];o.push({key:this.circleKeys[c],x1:e-r,y1:t-r,x2:e+r,y2:t+r})}}}}}_queryCellCircle(e,t,r,n,i,o,a,s){const l=a.circle,c=a.seenUids,u=this.boxCells[i];if(null!==u){const e=this.bboxes;for(const t of u)if(!c.box[t]){c.box[t]=!0;const r=4*t;if(this._circleAndRectCollide(l.x,l.y,l.radius,e[r+0],e[r+1],e[r+2],e[r+3])&&(!s||s(this.boxKeys[t])))return o.push(!0),!0}}const p=this.circleCells[i];if(null!==p){const e=this.circles;for(const t of p)if(!c.circle[t]){c.circle[t]=!0;const r=3*t;if(this._circlesCollide(e[r],e[r+1],e[r+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[t])))return o.push(!0),!0}}}_forEachCell(e,t,r,n,i,o,a,s){const l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(r),p=this._convertToYCellCoord(n);for(let h=l;h<=u;h++)for(let l=c;l<=p;l++)if(i.call(this,e,t,r,n,this.xCellCount*l+h,o,a,s))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,r,n,i,o){const a=n-e,s=i-t,l=r+o;return l*l>a*a+s*s}_circleAndRectCollide(e,t,r,n,i,o,a){const s=(o-n)/2,l=Math.abs(e-(n+s));if(l>s+r)return!1;const c=(a-i)/2,u=Math.abs(t-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;const p=l-s,h=u-c;return p*p+h*h<=r*r}}const Je={unknown:0,flipRequired:1,flipNotRequired:2},Qe=Math.tan(85*Math.PI/180);function et(t,r,n,i,o,a,s){const l=e.create();if(n)if("globe"===a.name){const t=e.calculateGlobeLabelMatrix(o,r);e.multiply(l,l,t)}else{const t=_([],s);l[0]=t[0],l[1]=t[1],l[4]=t[2],l[5]=t[3],i||e.rotateZ(l,l,o.angle)}else e.multiply(l,o.labelPlaneMatrix,t);return l}function tt(e,t,r,n,i,o,a){const s=et(e,t,r,n,i,o,a);return"globe"===o.name&&r||(s[2]=s[6]=s[10]=s[14]=0),s}function rt(t,r,n,i,o,a,s){if(n){if("globe"===a.name){const l=et(t,r,n,i,o,a,s);return e.invert(l,l),e.multiply(l,t,l),l}{const r=e.clone(t),n=e.identity([]);return n[0]=s[0],n[1]=s[1],n[4]=s[2],n[5]=s[3],e.multiply(r,r,n),i||e.rotateZ(r,r,-o.angle),r}}return o.glCoordMatrix}function nt(t,r,n,i){const o=[t,r,n,1];n?e.transformMat4$1(o,o,i):ft(o,o,i);const a=o[3];return o[0]/=a,o[1]/=a,o[2]/=a,o}function it(e,t){return Math.min(.5+e/t*.5,1.5)}function ot(e,t){const r=e[0]/e[3],n=e[1]/e[3];return r>=-t[0]&&r<=t[0]&&n>=-t[1]&&n<=t[1]}function at(t,r,n,i,o,a,s,l,c,u){const p=n.transform,h=i?t.textSizeData:t.iconSizeData,d=e.evaluateSizeForZoom(h,n.transform.zoom),f="globe"===p.projection.name,m=[256/n.width*2+1,256/n.height*2+1],g=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;g.clear();let b=null;f&&(b=i?t.text.globeExtVertexArray:t.icon.globeExtVertexArray);const _=t.lineVertexArray,y=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,v=n.transform.width/n.transform.height;let x,w=!1;for(let i=0;i<y.length;i++){const f=y.get(i),{numGlyphs:k,writingMode:E}=f;if(E!==e.WritingMode.vertical||w||x===e.WritingMode.horizontal||(w=!0),x=E,(f.hidden||E===e.WritingMode.vertical)&&!w){dt(k,g);continue}w=!1;const T=new e.Point(f.tileAnchorX,f.tileAnchorY);let{x:S,y:C,z:A}=p.projection.projectTilePoint(T.x,T.y,u.canonical);if(c){const[e,t,r]=c(T);S+=e,C+=t,A+=r}const M=[S,C,A,1];if(e.transformMat4$1(M,M,r),!ot(M,m)){dt(k,g);continue}const I=it(n.transform.cameraToCenterDistance,M[3]),O=e.evaluateSizeForFeature(h,d,f),L=s?O/I:O*I,z=nt(S,C,A,o);if(z[3]<=0){dt(k,g);continue}let D={};const P=s?null:c,R=ct(f,L,!1,l,r,o,a,t.glyphOffsetArray,_,g,b,z,T,D,v,P,p.projection,u,s);w=R.useVertical,P&&R.needsFlipping&&(D={}),(R.notEnoughRoom||w||R.needsFlipping&&ct(f,L,!0,l,r,o,a,t.glyphOffsetArray,_,g,b,z,T,D,v,P,p.projection,u,s).notEnoughRoom)&&dt(k,g)}i?(t.text.dynamicLayoutVertexBuffer.updateData(g),b&&t.text.globeExtVertexBuffer.updateData(b)):(t.icon.dynamicLayoutVertexBuffer.updateData(g),b&&t.icon.globeExtVertexBuffer.updateData(b))}function st(e,t,r,n,i,o,a,s,l,c,u,p,h,d,f,m){const{lineStartIndex:g,glyphStartIndex:b,segment:_}=s,y=b+s.numGlyphs,v=g+s.lineLength,x=t.getoffsetX(b),w=t.getoffsetX(y-1),k=ht(e*x,r,n,i,o,a,_,g,v,l,c,u,p,h,!0,d,f,m);if(!k)return null;const E=ht(e*w,r,n,i,o,a,_,g,v,l,c,u,p,h,!0,d,f,m);return E?{first:k,last:E}:null}function lt(t,r,n,i){return t===e.WritingMode.horizontal&&Math.abs(i)>Math.abs(n)?{useVertical:!0}:t===e.WritingMode.vertical?i>0?{needsFlipping:!0}:null:r!==Je.unknown&&function(e,t){return 0===e||Math.abs(t/e)>Qe}(n,i)?r===Je.flipRequired?{needsFlipping:!0}:null:n<0?{needsFlipping:!0}:null}function ct(t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g,b,_,y){const v=r/24,x=t.lineOffsetX*v,w=t.lineOffsetY*v,{lineStartIndex:k,glyphStartIndex:E,numGlyphs:T,segment:S,writingMode:C,flipState:A}=t,M=k+t.lineLength,I=t=>{if(p){const[r,n,i]=t.up,o=u.length;e.updateGlobeVertexNormal(p,o+0,r,n,i),e.updateGlobeVertexNormal(p,o+1,r,n,i),e.updateGlobeVertexNormal(p,o+2,r,n,i),e.updateGlobeVertexNormal(p,o+3,r,n,i)}const[r,n,i]=t.point;e.addDynamicAttributes(u,r,n,i,t.angle)};if(T>1){const e=st(v,l,x,w,n,h,d,t,c,a,f,g,!1,b,_,y);if(!e)return{notEnoughRoom:!0};if(i&&!n){let[r,n,i]=e.first.point,[o,a,l]=e.last.point;[r,n]=nt(r,n,i,s),[o,a]=nt(o,a,l,s);const c=lt(C,A,(o-r)*m,a-n);if(t.flipState=c&&c.needsFlipping?Je.flipRequired:Je.flipNotRequired,c)return c}I(e.first);for(let e=E+1;e<E+T-1;e++){const t=ht(v*l.getoffsetX(e),x,w,n,h,d,S,k,M,c,a,f,g,!1,!1,b,_,y);if(!t)return u.length-=4*(e-E),{notEnoughRoom:!0};I(t)}I(e.last)}else{if(i&&!n){const r=nt(d.x,d.y,0,o),n=k+S+1,i=new e.Point(c.getx(n),c.gety(n)),a=nt(i.x,i.y,0,o),s=a[3]>0?a:pt(d,i,r,1,o,void 0,b,_.canonical),l=lt(C,A,(s[0]-r[0])*m,s[1]-r[1]);if(t.flipState=l&&l.needsFlipping?Je.flipRequired:Je.flipNotRequired,l)return l}const r=ht(v*l.getoffsetX(E),x,w,n,h,d,S,k,M,c,a,f,g,!1,!1,b,_,y);if(!r)return{notEnoughRoom:!0};I(r)}return{}}function ut(e,t,r,n,i){const{x:o,y:a,z:s}=n.projectTilePoint(e.x,e.y,t);if(!i)return nt(o,a,s,r);const[l,c,u]=i(e);return nt(o+l,a+c,s+u,r)}function pt(t,r,n,i,o,a,s,l){const c=ut(t.sub(r)._unit()._add(t),l,o,s,a);return e.sub(c,n,c),e.normalize(c,c),e.scaleAndAdd(c,n,c,i)}function ht(t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g,b,_){const y=i?t-r:t+r;let v=y>0?1:-1,x=0;i&&(v*=-1,x=Math.PI),v<0&&(x+=Math.PI);let w=l+s+(v>0?0:1)|0,k=o,E=o,T=0,S=0;const C=Math.abs(y),A=[],M=[];let I=a,O=I;const L=()=>pt(O,I,E,C-T+1,p,d,g,b.canonical);for(;T+S<=C;){if(w+=v,w<l||w>=c)return null;if(E=k,O=I,A.push(E),f&&M.push(O),I=new e.Point(u.getx(w),u.gety(w)),k=h[w],!k){const e=ut(I,b.canonical,p,g,d);k=e[3]>0?h[w]=e:L()}T+=S,S=e.distance(E,k)}m&&d&&(h[w]&&(k=L(),S=e.distance(E,k)),h[w]=k);const z=(C-T)/S,D=I.sub(O)._mult(z)._add(O),P=e.sub([],k,E),R=e.scaleAndAdd([],E,P,z);let B=[0,0,1],F=P[0],j=P[1];if(_&&(B=g.upVector(b.canonical,D.x,D.y),0!==B[0]||0!==B[1]||1!==B[2])){const t=[B[2],0,-B[0]],r=e.cross([],B,t);e.normalize(t,t),e.normalize(r,r),F=e.dot(P,t),j=e.dot(P,r)}if(n){const t=e.cross([],B,P);e.normalize(t,t),e.scaleAndAdd(R,R,t,n*v)}const N=x+Math.atan2(j,F);return A.push(R),f&&M.push(D),{point:R,angle:N,path:A,tilePath:M,up:B}}function dt(e,t){const r=t.length,n=r+4*e;t.resize(n),t.float32.fill(-1/0,4*r,4*n)}function ft(e,t,r){const n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e[3]=r[3]*n+r[7]*i+r[15],e}const mt=100;class gt{constructor(e,t,r=new Ye(e.width+200,e.height+200,25),n=new Ye(e.width+200,e.height+200,25)){this.transform=e,this.grid=r,this.ignoredGrid=n,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+mt,this.screenBottomBoundary=e.height+mt,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.fogState=t}placeCollisionBox(e,t,r,n,i,o,a,s){let l=r.projectedAnchorX,c=r.projectedAnchorY,u=r.projectedAnchorZ;const p=r.elevation,h=r.tileID,d=e.getProjection();if(p&&h){const[e,t,n]=d.upVector(h.canonical,r.tileAnchorX,r.tileAnchorY),i=d.upVectorScale(h.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;l+=e*p*i,c+=t*p*i,u+=n*p*i}const f=this.projectAndGetPerspectiveRatio(a,l,c,u,r.tileID,"globe"===d.name||!!p||this.transform.pitch>0,d),m=o*f.perspectiveRatio,g=(r.x1*t+n.x-r.padding)*m+f.point.x,b=(r.y1*t+n.y-r.padding)*m+f.point.y,_=(r.x2*t+n.x+r.padding)*m+f.point.x,y=(r.y2*t+n.y+r.padding)*m+f.point.y,v=f.perspectiveRatio<=.55||f.occluded;return!this.isInsideGrid(g,b,_,y)||!i&&this.grid.hitTest(g,b,_,y,s)||v?{box:[],offscreen:!1,occluded:f.occluded}:{box:[g,b,_,y],offscreen:this.isOffscreen(g,b,_,y),occluded:!1}}placeCollisionCircles(t,r,n,i,o,a,s,l,c,u,p,h,d,f,m){const g=[],b=this.transform.elevation,_=t.getProjection(),y=b?b.getAtTileOffsetFunc(m,this.transform.center.lat,this.transform.worldSize,_):null,v=new e.Point(n.tileAnchorX,n.tileAnchorY);let{x:x,y:w,z:k}=_.projectTilePoint(v.x,v.y,m.canonical);if(y){const[e,t,r]=y(v);x+=e,w+=t,k+=r}const E="globe"===_.name,T=this.projectAndGetPerspectiveRatio(s,x,w,k,m,E||!!b||this.transform.pitch>0,_),{perspectiveRatio:S}=T,C=(p?a/S:a*S)/e.ONE_EM,A=nt(x,w,k,l),M=T.signedDistanceFromCamera>0?st(C,o,n.lineOffsetX*C,n.lineOffsetY*C,!1,A,v,n,i,l,{},b&&!p?y:null,p&&!!b,_,m,p):null;let I=!1,O=!1,L=!0;if(M&&!T.occluded){const t=.5*d*S+f,n=new e.Point(-100,-100),i=new e.Point(this.screenRightBoundary,this.screenBottomBoundary),o=new Ke,{first:a,last:s}=M,l=a.path.length;let p=[];for(let e=l-1;e>=1;e--)p.push(a.path[e]);for(let e=1;e<s.path.length;e++)p.push(s.path[e]);const m=2.5*t;c&&(p=p.map((([e,t,r],n)=>(y&&!E&&(r=y(n<l-1?a.tilePath[l-1-n]:s.tilePath[n-l+2])[2]),nt(e,t,r,c)))),p.some((e=>e[3]<=0))&&(p=[]));let b=[];if(p.length>0){let t=1/0,r=-1/0,o=1/0,a=-1/0;for(const e of p)t=Math.min(t,e[0]),o=Math.min(o,e[1]),r=Math.max(r,e[0]),a=Math.max(a,e[1]);r>=n.x&&t<=i.x&&a>=n.y&&o<=i.y&&(b=[p.map((t=>new e.Point(t[0],t[1])))],(t<n.x||r>i.x||o<n.y||a>i.y)&&(b=e.clipLine(b,n.x,n.y,i.x,i.y)))}for(const e of b){o.reset(e,.25*t);let n=0;n=o.length<=.5*t?1:Math.ceil(o.paddedLength/m)+1;for(let e=0;e<n;e++){const i=e/Math.max(n-1,1),a=o.lerp(i),s=a.x+mt,l=a.y+mt;g.push(s,l,t,0);const c=s-t,p=l-t,d=s+t,f=l+t;if(L=L&&this.isOffscreen(c,p,d,f),O=O||this.isInsideGrid(c,p,d,f),!r&&this.grid.hitTestCircle(s,l,t,h)&&(I=!0,!u))return{circles:[],offscreen:!1,collisionDetected:I,occluded:!1}}}}return{circles:!u&&I||!O?[]:g,offscreen:L,collisionDetected:I,occluded:T.occluded}}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const r=[];let n=1/0,i=1/0,o=-1/0,a=-1/0;for(const s of t){const t=new e.Point(s.x+mt,s.y+mt);n=Math.min(n,t.x),i=Math.min(i,t.y),o=Math.max(o,t.x),a=Math.max(a,t.y),r.push(t)}const s=this.grid.query(n,i,o,a).concat(this.ignoredGrid.query(n,i,o,a)),l={},c={};for(const t of s){const n=t.key;if(void 0===l[n.bucketInstanceId]&&(l[n.bucketInstanceId]={}),l[n.bucketInstanceId][n.featureIndex])continue;const i=[new e.Point(t.x1,t.y1),new e.Point(t.x2,t.y1),new e.Point(t.x2,t.y2),new e.Point(t.x1,t.y2)];e.polygonIntersectsPolygon(r,i)&&(l[n.bucketInstanceId][n.featureIndex]=!0,void 0===c[n.bucketInstanceId]&&(c[n.bucketInstanceId]=[]),c[n.bucketInstanceId].push(n.featureIndex))}return c}insertCollisionBox(e,t,r,n,i){(t?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:n,collisionGroupID:i},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,r,n,i){const o=t?this.ignoredGrid:this.grid,a={bucketInstanceId:r,featureIndex:n,collisionGroupID:i};for(let t=0;t<e.length;t+=4)o.insertCircle(a,e[t],e[t+1],e[t+2])}projectAndGetPerspectiveRatio(t,r,n,i,o,a,s){const l=[r,n,i,1];let c=!1;if(i||this.transform.pitch>0){if(e.transformMat4$1(l,l,t),this.fogState&&o&&"globe"!==s.name){const t=function(t,r,n,i,o,a){const s=a.calculateFogTileMatrix(o),l=[r,n,i];return e.transformMat4(l,l,s),T(t,l,a.pitch,a._fov)}(this.fogState,r,n,i,o.toUnwrapped(),this.transform);c=t>.9}}else ft(l,l,t);const u=l[3];return{point:new e.Point((l[0]/u+1)/2*this.transform.width+mt,(-l[1]/u+1)/2*this.transform.height+mt),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(s)/u*.5,1.5),signedDistanceFromCamera:u,occluded:a&&l[2]>u||c}}isOffscreen(e,t,r,n){return r<mt||e>=this.screenRightBoundary||n<mt||t>this.screenBottomBoundary}isInsideGrid(e,t,r,n){return r>=0&&e<this.gridRightBoundary&&n>=0&&t<this.gridBottomBoundary}getViewportMatrix(){const t=e.identity([]);return e.translate(t,t,[-100,-100,0]),t}}function bt(t,r,n){const i=r.createTileMatrix(t,t.worldSize,n.toUnwrapped());return e.multiply(new Float32Array(16),t.projMatrix,i)}function _t(e,t,r){if(t.projection.name===r.projection.name)return e.projMatrix;const n=r.clone();return n.setProjection(t.projection),bt(n,t.getProjection(),e)}function yt(e,t,r){return t.name===r.projection.name?e.projMatrix:bt(r,t,e)}class vt{constructor(e,t,r,n){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):n&&r?1:0,this.placed=r}isHidden(){return 0===this.opacity&&!this.placed}}class xt{constructor(e,t,r,n,i,o=!1){this.text=new vt(e?e.text:null,t,r,i),this.icon=new vt(e?e.icon:null,t,n,i),this.clipped=o}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class wt{constructor(e,t,r,n=!1){this.text=e,this.icon=t,this.skipFade=r,this.clipped=n}}class kt{constructor(){this.invProjMatrix=e.create(),this.viewportMatrix=e.create(),this.circles=[]}}class Et{constructor(e,t,r,n,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}}class Tt{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function St(t,r,n,i,o){const{horizontalAlign:a,verticalAlign:s}=e.getAnchorAlignment(t),l=-(a-.5)*r,c=-(s-.5)*n,u=e.evaluateVariableOffset(t,i);return new e.Point(l+u[0]*o,c+u[1]*o)}function Ct(t,r,n,i,o){const a=new e.Point(t,r);return n&&a._rotate(i?o:-o),a}class At{constructor(e,t,r,n,i){this.transform=e.clone(),this.projection=e.projection.name,this.collisionIndex=new gt(this.transform,i),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new Tt(r),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,r,n,i){const o=n.getBucket(r),a=n.latestFeatureIndex;if(!o||!a||r.id!==o.layerIds[0])return;const s=o.layers[0].layout,l=n.collisionBoxArray,c=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),u=n.tileSize/e.EXTENT,p=n.tileID.toUnwrapped();this.transform.setProjection(o.projection);const h=(d=n.tileID,f=o.getProjection(),m=this.transform,f.name===this.projection?m.calculateProjMatrix(d.toUnwrapped()):bt(m,f,d));var d,f,m;const g="map"===s.get("text-pitch-alignment"),b="map"===s.get("text-rotation-alignment");r.compileFilter();const _=r.dynamicFilter(),y=r.dynamicFilterNeedsFeature(),v=this.transform.calculatePixelsToTileUnitsMatrix(n),x=tt(h,n.tileID.canonical,g,b,this.transform,o.getProjection(),v);let w=null;if(g){const t=rt(h,n.tileID.canonical,g,b,this.transform,o.getProjection(),v);w=e.multiply([],this.transform.labelPlaneMatrix,t)}let k=null;_&&n.latestFeatureIndex&&(k={unwrappedTileID:p,dynamicFilter:_,dynamicFilterNeedsFeature:y,featureIndex:n.latestFeatureIndex}),this.retainedQueryData[o.bucketInstanceId]=new Et(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,n.tileID);const E={bucket:o,layout:s,posMatrix:h,textLabelPlaneMatrix:x,labelToScreenMatrix:w,clippingData:k,scale:c,textPixelRatio:u,holdingForFade:n.holdingForFade(),collisionBoxArray:l,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:e.evaluateSizeForZoom(o.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(i)for(const e of o.sortKeyRanges){const{sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i}=e;t.push({sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i,parameters:E})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:E})}attemptAnchorPlacement(e,t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g,b){const{textOffset0:_,textOffset1:y,crossTileID:v}=p,x=[_,y],w=St(e,r,n,x,i),k=this.collisionIndex.placeCollisionBox(d,i,t,Ct(w.x,w.y,o,a,this.transform.angle),u,s,l,c.predicate);if(m){const e=d.getSymbolInstanceIconSize(b,this.transform.zoom,p.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(d,e,m,Ct(w.x,w.y,o,a,this.transform.angle),u,s,l,c.predicate).box.length)return}if(k.box.length>0){let t;return this.prevPlacement&&this.prevPlacement.variableOffsets[v]&&this.prevPlacement.placements[v]&&this.prevPlacement.placements[v].text&&(t=this.prevPlacement.variableOffsets[v].anchor),this.variableOffsets[v]={textOffset:x,width:r,height:n,anchor:e,textScale:i,prevAnchor:t},this.markUsedJustification(d,e,p,f),d.allowVerticalPlacement&&(this.markUsedOrientation(d,f,p),this.placedOrientations[v]=f),{shift:w,placedGlyphBoxes:k}}}placeLayerBucketPart(t,r,n,i){const{bucket:o,layout:a,posMatrix:s,textLabelPlaneMatrix:l,labelToScreenMatrix:c,clippingData:u,textPixelRatio:p,holdingForFade:h,collisionBoxArray:d,partiallyEvaluatedTextSize:f,partiallyEvaluatedIconSize:m,collisionGroup:g}=t.parameters,b=a.get("text-optional"),_=a.get("icon-optional"),y=a.get("text-allow-overlap"),v=a.get("icon-allow-overlap"),x="map"===a.get("text-rotation-alignment"),w="map"===a.get("text-pitch-alignment"),k="none"!==a.get("icon-text-fit"),E="viewport-y"===a.get("symbol-z-order");this.transform.setProjection(o.projection);let T=y&&(v||!o.hasIconData()||_),S=v&&(y||!o.hasTextData()||b);!o.collisionArrays&&d&&o.deserializeCollisionBoxes(d),n&&i&&o.updateCollisionDebugBuffers(this.transform.zoom,d);const C=(t,i,d)=>{const{crossTileID:E,numVerticalGlyphVertices:C}=t;if(u){const n={zoom:this.transform.zoom,pitch:this.transform.pitch};let i=null;if(u.dynamicFilterNeedsFeature){const e=this.retainedQueryData[o.bucketInstanceId];i=u.featureIndex.loadFeature({featureIndex:t.featureIndex,bucketIndex:e.bucketIndex,sourceLayerIndex:e.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,u.dynamicFilter)(n,i,this.retainedQueryData[o.bucketInstanceId].tileID.canonical,new e.Point(t.tileAnchorX,t.tileAnchorY),this.transform.calculateDistanceTileData(u.unwrappedTileID)))return this.placements[E]=new wt(!1,!1,!1,!0),void r.add(E)}if(r.has(E))return;if(h)return void(this.placements[E]=new wt(!1,!1,!1));let A=!1,M=!1,I=!0,O=!1,L=!1,z=null,D={box:null,offscreen:null,occluded:null},P={box:null,offscreen:null,occluded:null},R=null,B=null,F=null,j=0,N=0,U=0;d.textFeatureIndex?j=d.textFeatureIndex:t.useRuntimeCollisionCircles&&(j=t.featureIndex),d.verticalTextFeatureIndex&&(N=d.verticalTextFeatureIndex);const V=e=>{e.tileID=this.retainedQueryData[o.bucketInstanceId].tileID;const t=this.transform.elevation;(t||e.elevation)&&(e.elevation=t?t.getAtTileOffset(e.tileID,e.tileAnchorX,e.tileAnchorY):0)},q=d.textBox;if(q){V(q);const r=r=>{let n=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[E];e&&(this.placedOrientations[E]=e,n=e,this.markUsedOrientation(o,n,t))}return n},n=(t,r)=>{if(o.allowVerticalPlacement&&C>0&&d.verticalTextBox){for(const n of o.writingModes)if(n===e.WritingMode.vertical?(D=r(),P=D):D=t(),D&&D.box&&D.box.length)break}else D=t()};if(a.get("text-variable-anchor")){let l=a.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[E]){const e=this.prevPlacement.variableOffsets[E];l.indexOf(e.anchor)>0&&(l=l.filter((t=>t!==e.anchor)),l.unshift(e.anchor))}const c=(e,r,n)=>{const a=o.getSymbolInstanceTextSize(f,t,this.transform.zoom,i),c=(e.x2-e.x1)*a+2*e.padding,u=(e.y2-e.y1)*a+2*e.padding,h=k&&!v?r:null;h&&V(h);let d={box:[],offscreen:!1,occluded:!1};const b=y?2*l.length:l.length;for(let r=0;r<b;++r){const b=this.attemptAnchorPlacement(l[r%l.length],e,c,u,a,x,w,p,s,g,r>=l.length,t,i,o,n,h,f,m);if(b&&(d=b.placedGlyphBoxes,d&&d.box&&d.box.length)){A=!0,z=b.shift;break}}return d};n((()=>c(q,d.iconBox,e.WritingMode.horizontal)),(()=>{const t=d.verticalTextBox;return t&&V(t),o.allowVerticalPlacement&&!(D&&D.box&&D.box.length)&&C>0&&t?c(t,d.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null,occluded:null}})),D&&(A=D.box,I=D.offscreen,O=D.occluded);const u=r(!(!D||!D.box));if(!A&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[E];e&&(this.variableOffsets[E]=e,this.markUsedJustification(o,e.anchor,t,u))}}else{const a=(r,n)=>{const a=o.getSymbolInstanceTextSize(f,t,this.transform.zoom,i),l=this.collisionIndex.placeCollisionBox(o,a,r,new e.Point(0,0),y,p,s,g.predicate);return l&&l.box&&l.box.length&&(this.markUsedOrientation(o,n,t),this.placedOrientations[E]=n),l};n((()=>a(q,e.WritingMode.horizontal)),(()=>{const t=d.verticalTextBox;return o.allowVerticalPlacement&&C>0&&t?(V(t),a(t,e.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}})),r(!!(D&&D.box&&D.box.length))}}if(R=D,A=R&&R.box&&R.box.length>0,I=R&&R.offscreen,O=R&&R.occluded,t.useRuntimeCollisionCircles){const r=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex),i=e.evaluateSizeForFeature(o.textSizeData,f,r),u=a.get("text-padding");B=this.collisionIndex.placeCollisionCircles(o,y,r,o.lineVertexArray,o.glyphOffsetArray,i,s,l,c,n,w,g.predicate,t.collisionCircleDiameter*i/e.ONE_EM,u,this.retainedQueryData[o.bucketInstanceId].tileID),A=y||B.circles.length>0&&!B.collisionDetected,I=I&&B.offscreen,O=B.occluded}if(d.iconFeatureIndex&&(U=d.iconFeatureIndex),d.iconBox){const r=r=>{V(r);const n=k&&z?Ct(z.x,z.y,x,w,this.transform.angle):new e.Point(0,0),i=o.getSymbolInstanceIconSize(m,this.transform.zoom,t.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(o,i,r,n,v,p,s,g.predicate)};P&&P.box&&P.box.length&&d.verticalIconBox?(F=r(d.verticalIconBox),M=F.box.length>0):(F=r(d.iconBox),M=F.box.length>0),I=I&&F.offscreen,L=F.occluded}const $=b||0===t.numHorizontalGlyphVertices&&0===C,G=_||0===t.numIconVertices;if($||G?G?$||(M=M&&A):A=M&&A:M=A=M&&A,A&&R&&R.box&&this.collisionIndex.insertCollisionBox(R.box,a.get("text-ignore-placement"),o.bucketInstanceId,P&&P.box&&N?N:j,g.ID),M&&F&&this.collisionIndex.insertCollisionBox(F.box,a.get("icon-ignore-placement"),o.bucketInstanceId,U,g.ID),B&&(A&&this.collisionIndex.insertCollisionCircles(B.circles,a.get("text-ignore-placement"),o.bucketInstanceId,j,g.ID),n)){const e=o.bucketInstanceId;let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=new kt);for(let e=0;e<B.circles.length;e+=4)t.circles.push(B.circles[e+0]),t.circles.push(B.circles[e+1]),t.circles.push(B.circles[e+2]),t.circles.push(B.collisionDetected?1:0)}const W="globe"!==o.projection.name;T=T&&(W||!O),S=S&&(W||!L),this.placements[E]=new wt(A||T,M||S,I||o.justReloaded),r.add(E)};if(E){const e=o.getSortedSymbolIndexes(this.transform.angle);for(let t=e.length-1;t>=0;--t){const r=e[t];C(o.symbolInstances.get(r),r,o.collisionArrays[r])}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)C(o.symbolInstances.get(e),e,o.collisionArrays[e]);if(n&&o.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[o.bucketInstanceId];e.invert(t.invProjMatrix,s),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1}markUsedJustification(t,r,n,i){const{leftJustifiedTextSymbolIndex:o,centerJustifiedTextSymbolIndex:a,rightJustifiedTextSymbolIndex:s,verticalPlacedTextSymbolIndex:l,crossTileID:c}=n,u=e.getAnchorJustification(r),p=i===e.WritingMode.vertical?l:"left"===u?o:"center"===u?a:"right"===u?s:-1;o>=0&&(t.text.placedSymbolArray.get(o).crossTileID=p>=0&&o!==p?0:c),a>=0&&(t.text.placedSymbolArray.get(a).crossTileID=p>=0&&a!==p?0:c),s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=p>=0&&s!==p?0:c),l>=0&&(t.text.placedSymbolArray.get(l).crossTileID=p>=0&&l!==p?0:c)}markUsedOrientation(t,r,n){const i=r===e.WritingMode.horizontal||r===e.WritingMode.horizontalOnly?r:0,o=r===e.WritingMode.vertical?r:0,{leftJustifiedTextSymbolIndex:a,centerJustifiedTextSymbolIndex:s,rightJustifiedTextSymbolIndex:l,verticalPlacedTextSymbolIndex:c}=n,u=t.text.placedSymbolArray;a>=0&&(u.get(a).placedOrientation=i),s>=0&&(u.get(s).placedOrientation=i),l>=0&&(u.get(l).placedOrientation=i),c>=0&&(u.get(c).placedOrientation=o)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let r=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const n=t?t.symbolFadeChange(e):1,i=t?t.opacities:{},o=t?t.variableOffsets:{},a=t?t.placedOrientations:{};for(const e in this.placements){const t=this.placements[e],o=i[e];o?(this.opacities[e]=new xt(o,n,t.text,t.icon,null,t.clipped),r=r||t.text!==o.text.placed||t.icon!==o.icon.placed):(this.opacities[e]=new xt(null,n,t.text,t.icon,t.skipFade,t.clipped),r=r||t.text||t.icon)}for(const e in i){const t=i[e];if(!this.opacities[e]){const i=new xt(t,n,!1,!1);i.isHidden()||(this.opacities[e]=i,r=r||t.text.placed||t.icon.placed)}}for(const e in o)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=o[e]);for(const e in a)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=a[e]);r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){const r=new Set;for(const n of t){const t=n.getBucket(e);t&&n.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,r,n.collisionBoxArray)}}updateBucketOpacities(t,r,n){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const i=t.layers[0].layout,o=!!t.layers[0].dynamicFilter(),a=new xt(null,0,!1,!1,!0),s=i.get("text-allow-overlap"),l=i.get("icon-allow-overlap"),c=i.get("text-variable-anchor"),u="map"===i.get("text-rotation-alignment"),p="map"===i.get("text-pitch-alignment"),h="none"!==i.get("icon-text-fit"),d=new xt(null,0,s&&(l||!t.hasIconData()||i.get("icon-optional")),l&&(s||!t.hasTextData()||i.get("text-optional")),!0);!t.collisionArrays&&n&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(n);const f=(e,t,r)=>{for(let n=0;n<t/4;n++)e.opacityVertexArray.emplaceBack(r)};let m=0;for(let n=0;n<t.symbolInstances.length;n++){const i=t.symbolInstances.get(n),{numHorizontalGlyphVertices:s,numVerticalGlyphVertices:l,crossTileID:g,numIconVertices:b}=i,_=r.has(g);let y=this.opacities[g];_?y=a:y||(y=d,this.opacities[g]=y),r.add(g);const v=s>0||l>0,x=b>0,w=this.placedOrientations[g],k=w===e.WritingMode.vertical,E=w===e.WritingMode.horizontal||w===e.WritingMode.horizontalOnly;if(!v&&!x||y.isHidden()||m++,v){const e=Bt(y.text);f(t.text,s,k?Ft:e),f(t.text,l,E?Ft:e);const r=y.text.isHidden(),{leftJustifiedTextSymbolIndex:n,centerJustifiedTextSymbolIndex:o,rightJustifiedTextSymbolIndex:a,verticalPlacedTextSymbolIndex:c}=i,u=t.text.placedSymbolArray,p=r||k?1:0;n>=0&&(u.get(n).hidden=p),o>=0&&(u.get(o).hidden=p),a>=0&&(u.get(a).hidden=p),c>=0&&(u.get(c).hidden=r||E?1:0);const h=this.variableOffsets[g];h&&this.markUsedJustification(t,h.anchor,i,w);const d=this.placedOrientations[g];d&&(this.markUsedJustification(t,"left",i,d),this.markUsedOrientation(t,d,i))}if(x){const e=Bt(y.icon),{placedIconSymbolIndex:r,verticalPlacedIconSymbolIndex:n}=i,o=t.icon.placedSymbolArray,a=y.icon.isHidden()?1:0;r>=0&&(f(t.icon,b,k?Ft:e),o.get(r).hidden=a),n>=0&&(f(t.icon,i.numVerticalIconVertices,E?Ft:e),o.get(n).hidden=a)}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const r=t.collisionArrays[n];if(r){let n=new e.Point(0,0),i=!0;if(r.textBox||r.verticalTextBox){if(c){const e=this.variableOffsets[g];e?(n=St(e.anchor,e.width,e.height,e.textOffset,e.textScale),u&&n._rotate(p?this.transform.angle:-this.transform.angle)):i=!1}o&&(i=!y.clipped),r.textBox&&Mt(t.textCollisionBox.collisionVertexArray,y.text.placed,!i||k,n.x,n.y),r.verticalTextBox&&Mt(t.textCollisionBox.collisionVertexArray,y.text.placed,!i||E,n.x,n.y)}const a=i&&Boolean(!E&&r.verticalIconBox);r.iconBox&&Mt(t.iconCollisionBox.collisionVertexArray,y.icon.placed,a,h?n.x:0,h?n.y:0),r.verticalIconBox&&Mt(t.iconCollisionBox.collisionVertexArray,y.icon.placed,!a,h?n.x:0,h?n.y:0)}}}if(t.fullyClipped=0===m,t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){const r=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*r>e}setStale(){this.stale=!0}}function Mt(e,t,r,n,i){e.emplaceBack(t?1:0,r?1:0,n||0,i||0),e.emplaceBack(t?1:0,r?1:0,n||0,i||0),e.emplaceBack(t?1:0,r?1:0,n||0,i||0),e.emplaceBack(t?1:0,r?1:0,n||0,i||0)}const It=Math.pow(2,25),Ot=Math.pow(2,24),Lt=Math.pow(2,17),zt=Math.pow(2,16),Dt=Math.pow(2,9),Pt=Math.pow(2,8),Rt=Math.pow(2,1);function Bt(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;const t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*It+t*Ot+r*Lt+t*zt+r*Dt+t*Pt+r*Rt+t}const Ft=0;class jt{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(e,t,r,n,i){const o=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(o,n,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,i())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort(((e,t)=>e.sortKey-t.sortKey)));this._currentPartIndex<o.length;){const e=o[this._currentPartIndex];if(t.placeLayerBucketPart(e,this._seenCrossTileIDs,r,0===e.symbolInstanceStart),this._currentPartIndex++,i())return!0}return!1}}class Nt{constructor(e,t,r,n,i,o,a,s){this.placement=new At(e,i,o,a,s),this._currentPlacementIndex=t.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(t,r,n){const i=e.exported.now(),o=()=>{const t=e.exported.now()-i;return!this._forceFullPlacement&&t>2};for(;this._currentPlacementIndex>=0;){const e=r[t[this._currentPlacementIndex]],i=this.placement.collisionIndex.transform.zoom;if("symbol"===e.type&&(!e.minzoom||e.minzoom<=i)&&(!e.maxzoom||e.maxzoom>i)){if(this._inProgressLayer||(this._inProgressLayer=new jt(e)),this._inProgressLayer.continuePlacement(n[e.source],this.placement,this._showCollisionBoxes,e,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const Ut=512/e.EXTENT/2;class Vt{constructor(t,r,n){this.tileID=t,this.bucketInstanceId=n,this.index=new e.KDBush(r.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const i=t.canonical.x*e.EXTENT,o=t.canonical.y*e.EXTENT;for(let e=0;e<r.length;e++){const{key:t,crossTileID:n,tileAnchorX:a,tileAnchorY:s}=r.get(e),l=Math.floor((i+a)*Ut),c=Math.floor((o+s)*Ut);this.index.add(l,c),this.keys.push(t),this.crossTileIDs.push(n)}this.index.finish()}findMatches(t,r,n){const i=this.tileID.canonical.z<r.canonical.z?1:Math.pow(2,this.tileID.canonical.z-r.canonical.z),o=Ut/Math.pow(2,r.canonical.z-this.tileID.canonical.z),a=r.canonical.x*e.EXTENT,s=r.canonical.y*e.EXTENT;for(let e=0;e<t.length;e++){const r=t.get(e);if(r.crossTileID)continue;const{key:l,tileAnchorX:c,tileAnchorY:u}=r,p=Math.floor((a+c)*o),h=Math.floor((s+u)*o),d=this.index.range(p-i,h-i,p+i,h+i);for(const e of d){const t=this.crossTileIDs[e];if(this.keys[e]===l&&!n.has(t)){n.add(t),r.crossTileID=t;break}}}}}class qt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class $t{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const t=Math.round((e-this.lng)/360);if(0!==t)for(const e in this.indexes){const r=this.indexes[e],n={};for(const e in r){const i=r[e];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),n[i.tileID.key]=i}this.indexes[e]=n}this.lng=e}addBucket(e,t,r){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;e<t.symbolInstances.length;e++)t.symbolInstances.get(e).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]=new Set);const n=this.usedCrossTileIDs[e.overscaledZ];for(const r in this.indexes){const i=this.indexes[r];if(Number(r)>e.overscaledZ)for(const r in i){const o=i[r];o.tileID.isChildOf(e)&&o.findMatches(t.symbolInstances,e,n)}else{const o=i[e.scaledTo(Number(r)).key];o&&o.findMatches(t.symbolInstances,e,n)}}for(let e=0;e<t.symbolInstances.length;e++){const i=t.symbolInstances.get(e);i.crossTileID||(i.crossTileID=r.generate(),n.add(i.crossTileID))}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Vt(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(const r of t.crossTileIDs)this.usedCrossTileIDs[e].delete(r)}removeStaleBuckets(e){let t=!1;for(const r in this.indexes){const n=this.indexes[r];for(const i in n)e[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],t=!0)}return t}}class Gt{constructor(){this.layerIndexes={},this.crossTileIDs=new qt,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,r,n){let i=this.layerIndexes[e.id];void 0===i&&(i=this.layerIndexes[e.id]=new $t);let o=!1;const a={};"globe"!==n.name&&i.handleWrapJump(r);for(const r of t){const t=r.getBucket(e);t&&e.id===t.layerIds[0]&&(t.bucketInstanceId||(t.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(r.tileID,t,this.crossTileIDs)&&(o=!0),a[t.bucketInstanceId]=!0)}return i.removeStaleBuckets(a)&&(o=!0),o}pruneUnusedLayers(e){const t={};e.forEach((e=>{t[e]=!0}));for(const e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}}const Wt=(t,r)=>e.emitValidationErrors(t,r&&r.filter((e=>"source.canvas"!==e.identifier))),Ht=e.pick(Ve,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),Zt=e.pick(Ve,["setCenter","setZoom","setBearing","setPitch"]),Xt={version:8,layers:[],sources:{}},Kt={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class Yt extends e.Evented{constructor(t,r={}){super(),this.map=t,this.dispatcher=new M(je(),this),this.imageManager=new v,this.imageManager.setEventedParent(this),this.glyphManager=new e.GlyphManager(t._requestManager,r.localFontFamily?e.LocalGlyphMode.all:r.localIdeographFontFamily?e.LocalGlyphMode.ideographs:e.LocalGlyphMode.none,r.localFontFamily||r.localIdeographFontFamily),this.crossTileSymbolIndex=new Gt,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",e.getReferrer());const n=this;this._rtlTextPluginCallback=Yt.registerForPluginStateChange((t=>{n.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},((t,r)=>{if(e.triggerPluginCompletionEvent(t),r&&r.every((e=>e)))for(const e in n._sourceCaches){const t=n._sourceCaches[e],r=t.getSource().type;"vector"!==r&&"geojson"!==r||t.reload()}}))})),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.getSource(e.sourceId);if(t&&t.vectorLayerIds)for(const e in this._layers){const r=this._layers[e];r.source===t.id&&this._validateLayer(r)}}))}loadURL(t,r={}){this.fire(new e.Event("dataloading",{dataType:"style"}));const n="boolean"==typeof r.validate?r.validate:!e.isMapboxURL(t);t=this.map._requestManager.normalizeStyleURL(t,r.accessToken);const i=this.map._requestManager.transformRequest(t,e.ResourceType.Style);this._request=e.getJSON(i,((t,r)=>{this._request=null,t?this.fire(new e.ErrorEvent(t)):r&&this._load(r,n)}))}loadJSON(t,r={}){this.fire(new e.Event("dataloading",{dataType:"style"})),this._request=e.exported.frame((()=>{this._request=null,this._load(t,!1!==r.validate)}))}loadEmpty(){this.fire(new e.Event("dataloading",{dataType:"style"})),this._load(Xt,!1)}_updateLayerCount(e,t){const r=t?1:-1;e.is3D()&&(this._num3DLayers+=r),"circle"===e.type&&(this._numCircleLayers+=r),"symbol"===e.type&&(this._numSymbolLayers+=r)}_load(t,r){if(r&&Wt(this,e.validateStyle(t)))return;this._loaded=!0,this.stylesheet=e.clone$1(t),this._updateMapProjection();for(const e in t.sources)this.addSource(e,t.sources[e],{validate:!1});this._changed=!1,t.sprite?this._loadSprite(t.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(t.glyphs);const n=Ue(this.stylesheet.layers);this._order=n.map((e=>e.id)),this._layers={},this._serializedLayers={};for(const t of n){const r=e.createStyleLayer(t);r.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=r,this._serializedLayers[r.id]=r.serialize(),this._updateLayerCount(r,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new w(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new e.Event("data",{dataType:"style"})),this.fire(new e.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}setProjection(e){e?this.stylesheet.projection=e:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(t){this._spriteRequest=function(t,r,n){let i,o,a;const s=e.exported.devicePixelRatio>1?"@2x":"";let l=e.getJSON(r.transformRequest(r.normalizeSpriteURL(t,s,".json"),e.ResourceType.SpriteJSON),((e,t)=>{l=null,a||(a=e,i=t,u())})),c=e.getImage(r.transformRequest(r.normalizeSpriteURL(t,s,".png"),e.ResourceType.SpriteImage),((e,t)=>{c=null,a||(a=e,o=t,u())}));function u(){if(a)n(a);else if(i&&o){const t=e.exported.getImageData(o),r={};for(const n in i){const{width:o,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:p,stretchY:h,content:d}=i[n],f=new e.RGBAImage({width:o,height:a});e.RGBAImage.copy(t,f,{x:s,y:l},{x:0,y:0},{width:o,height:a}),r[n]={data:f,pixelRatio:u,sdf:c,stretchX:p,stretchY:h,content:d}}n(null,r)}}return{cancel(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(t,this.map._requestManager,((t,r)=>{if(this._spriteRequest=null,t)this.fire(new e.ErrorEvent(t));else if(r)for(const e in r)this.imageManager.addImage(e,r[e]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new e.Event("data",{dataType:"style"}))}))}_validateLayer(t){const r=this.getSource(t.source);if(!r)return;const n=t.sourceLayer;n&&("geojson"===r.type||r.vectorLayerIds&&-1===r.vectorLayerIds.indexOf(n))&&this.fire(new e.ErrorEvent(new Error(`Source layer "${n}" does not exist on source "${r.id}" as specified by style layer "${t.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const e in this._sourceCaches)if(!this._sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(e){const t=[];for(const r of e){const e=this._layers[r];"custom"!==e.type&&t.push(e.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.fog&&this.fog.hasTransition())return!0;for(const e in this._sourceCaches)if(this._sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(e){return!!this.terrain&&("function"==typeof e.isLayerDraped?e.isLayerDraped():Kt[e.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(t){if(!this._loaded)return;const r=this._changed;if(this._changed){const e=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);(e.length||r.length)&&this._updateWorkerLayers(e,r);for(const e in this._updatedSources){const t=this._updatedSources[e];"reload"===t?this._reloadSource(e):"clear"===t&&this._clearSource(e)}this._updateTilesForChangedImages();for(const e in this._updatedPaintProps)this._layers[e].updateTransitions(t);this.light.updateTransitions(t),this.fog&&this.fog.updateTransitions(t),this._resetUpdates()}const n={};for(const e in this._sourceCaches){const t=this._sourceCaches[e];n[e]=t.used,t.used=!1}for(const e of this._order){const r=this._layers[e];if(r.recalculate(t,this._availableImages),!r.isHidden(t.zoom)){const e=this._getLayerSourceCache(r);e&&(e.used=!0)}const n=this.map.painter;if(n){const e=r.getProgramIds();if(!e)continue;const i=r.getProgramConfiguration(t.zoom);for(const t of e)n.useProgram(t,i)}}for(const t in n){const r=this._sourceCaches[t];n[t]!==r.used&&r.getSource().fire(new e.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:r.getSource().id}))}this.light.recalculate(t),this.terrain&&this.terrain.recalculate(t),this.fog&&this.fog.recalculate(t),this.z=t.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),r&&this.fire(new e.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const t in this._sourceCaches)this._sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateWorkerLayers(e,t){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(e),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(r){if(this._checkLoaded(),Wt(this,e.validateStyle(r)))return!1;(r=e.clone$1(r)).layers=Ue(r.layers);const n=function(e,r){if(!e)return[{command:Ve.setStyle,args:[r]}];let n=[];try{if(!t(e.version,r.version))return[{command:Ve.setStyle,args:[r]}];t(e.center,r.center)||n.push({command:Ve.setCenter,args:[r.center]}),t(e.zoom,r.zoom)||n.push({command:Ve.setZoom,args:[r.zoom]}),t(e.bearing,r.bearing)||n.push({command:Ve.setBearing,args:[r.bearing]}),t(e.pitch,r.pitch)||n.push({command:Ve.setPitch,args:[r.pitch]}),t(e.sprite,r.sprite)||n.push({command:Ve.setSprite,args:[r.sprite]}),t(e.glyphs,r.glyphs)||n.push({command:Ve.setGlyphs,args:[r.glyphs]}),t(e.transition,r.transition)||n.push({command:Ve.setTransition,args:[r.transition]}),t(e.light,r.light)||n.push({command:Ve.setLight,args:[r.light]}),t(e.fog,r.fog)||n.push({command:Ve.setFog,args:[r.fog]}),t(e.projection,r.projection)||n.push({command:Ve.setProjection,args:[r.projection]});const i={},o=[];!function(e,r,n,i){let o;for(o in r=r||{},e=e||{})e.hasOwnProperty(o)&&(r.hasOwnProperty(o)||$e(o,n,i));for(o in r){if(!r.hasOwnProperty(o))continue;const a=r[o];e.hasOwnProperty(o)?t(e[o],a)||("geojson"===e[o].type&&"geojson"===a.type&&We(e,r,o)?n.push({command:Ve.setGeoJSONSourceData,args:[o,a.data]}):Ge(o,r,n,i)):qe(o,r,n)}}(e.sources,r.sources,o,i);const a=[];e.layers&&e.layers.forEach((e=>{e.source&&i[e.source]?n.push({command:Ve.removeLayer,args:[e.id]}):a.push(e)}));let s=e.terrain;s&&i[s.source]&&(n.push({command:Ve.setTerrain,args:[void 0]}),s=void 0),n=n.concat(o),t(s,r.terrain)||n.push({command:Ve.setTerrain,args:[r.terrain]}),function(e,r,n){r=r||[];const i=(e=e||[]).map(Ze),o=r.map(Ze),a=e.reduce(Xe,{}),s=r.reduce(Xe,{}),l=i.slice(),c=Object.create(null);let u,p,h,d,f,m,g;for(u=0,p=0;u<i.length;u++)h=i[u],s.hasOwnProperty(h)?p++:(n.push({command:Ve.removeLayer,args:[h]}),l.splice(l.indexOf(h,p),1));for(u=0,p=0;u<o.length;u++)h=o[o.length-1-u],l[l.length-1-u]!==h&&(a.hasOwnProperty(h)?(n.push({command:Ve.removeLayer,args:[h]}),l.splice(l.lastIndexOf(h,l.length-p),1)):p++,m=l[l.length-u],n.push({command:Ve.addLayer,args:[s[h],m]}),l.splice(l.length-u,0,h),c[h]=!0);for(u=0;u<o.length;u++)if(h=o[u],d=a[h],f=s[h],!c[h]&&!t(d,f))if(t(d.source,f.source)&&t(d["source-layer"],f["source-layer"])&&t(d.type,f.type)){for(g in He(d.layout,f.layout,n,h,null,Ve.setLayoutProperty),He(d.paint,f.paint,n,h,null,Ve.setPaintProperty),t(d.filter,f.filter)||n.push({command:Ve.setFilter,args:[h,f.filter]}),t(d.minzoom,f.minzoom)&&t(d.maxzoom,f.maxzoom)||n.push({command:Ve.setLayerZoomRange,args:[h,f.minzoom,f.maxzoom]}),d)d.hasOwnProperty(g)&&"layout"!==g&&"paint"!==g&&"filter"!==g&&"metadata"!==g&&"minzoom"!==g&&"maxzoom"!==g&&(0===g.indexOf("paint.")?He(d[g],f[g],n,h,g.slice(6),Ve.setPaintProperty):t(d[g],f[g])||n.push({command:Ve.setLayerProperty,args:[h,g,f[g]]}));for(g in f)f.hasOwnProperty(g)&&!d.hasOwnProperty(g)&&"layout"!==g&&"paint"!==g&&"filter"!==g&&"metadata"!==g&&"minzoom"!==g&&"maxzoom"!==g&&(0===g.indexOf("paint.")?He(d[g],f[g],n,h,g.slice(6),Ve.setPaintProperty):t(d[g],f[g])||n.push({command:Ve.setLayerProperty,args:[h,g,f[g]]}))}else n.push({command:Ve.removeLayer,args:[h]}),m=l[l.lastIndexOf(h)+1],n.push({command:Ve.addLayer,args:[f,m]})}(a,r.layers,n)}catch(e){n=[{command:Ve.setStyle,args:[r]}]}return n}(this.serialize(),r).filter((e=>!(e.command in Zt)));if(0===n.length)return!1;const i=n.filter((e=>!(e.command in Ht)));if(i.length>0)throw new Error(`Unimplemented: ${i.map((e=>e.command)).join(", ")}.`);return n.forEach((e=>{"setTransition"!==e.command&&"setProjection"!==e.command&&this[e.command].apply(this,e.args)})),this.stylesheet=r,this._updateMapProjection(),!0}addImage(t,r){return this.getImage(t)?this.fire(new e.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(t,r),this._afterImageUpdated(t),this)}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}removeImage(t){return this.getImage(t)?(this.imageManager.removeImage(t),this._afterImageUpdated(t),this):this.fire(new e.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(t,r,n={}){if(this._checkLoaded(),void 0!==this.getSource(t))throw new Error("There is already a source with this ID");if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(e.validateSource,`sources.${t}`,r,null,n))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);const i=Ie(t,r,this.dispatcher,this);i.setEventedParent(this,(()=>({isSourceLoaded:this._isSourceCacheLoaded(t),source:i.serialize(),sourceId:t})));const o=r=>{const n=(r?"symbol:":"other:")+t,o=this._sourceCaches[n]=new e.SourceCache(n,i,r);(r?this._symbolSourceCaches:this._otherSourceCaches)[t]=o,o.style=this,o.onAdd(this.map)};o(!1),"vector"!==r.type&&"geojson"!==r.type||o(!0),i.onAdd&&i.onAdd(this.map),this._changed=!0}removeSource(t){this._checkLoaded();const r=this.getSource(t);if(!r)throw new Error("There is no source with this ID");for(const r in this._layers)if(this._layers[r].source===t)return this.fire(new e.ErrorEvent(new Error(`Source "${t}" cannot be removed while layer "${r}" is using it.`)));if(this.terrain&&this.terrain.get().source===t)return this.fire(new e.ErrorEvent(new Error(`Source "${t}" cannot be removed while terrain is using it.`)));const n=this._getSourceCaches(t);for(const t of n)delete this._sourceCaches[t.id],delete this._updatedSources[t.id],t.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t.getSource().id})),t.setEventedParent(null),t.clearTiles();return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],r.setEventedParent(null),r.onRemove&&r.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(e,t){this._checkLoaded(),this.getSource(e).setData(t),this._changed=!0}getSource(e){const t=this._getSourceCache(e);return t&&t.getSource()}_getSources(){const e=[];for(const t in this._otherSourceCaches){const r=this._getSourceCache(t);r&&e.push(r.getSource())}return e}addLayer(t,r,n={}){this._checkLoaded();const i=t.id;if(this.getLayer(i))return void this.fire(new e.ErrorEvent(new Error(`Layer with id "${i}" already exists on this map`)));let o;if("custom"===t.type){if(Wt(this,e.validateCustomStyleLayer(t)))return;o=e.createStyleLayer(t)}else{if("object"==typeof t.source&&(this.addSource(i,t.source),t=e.clone$1(t),t=e.extend(t,{source:i})),this._validate(e.validateLayer,`layers.${i}`,t,{arrayIndex:-1},n))return;o=e.createStyleLayer(t),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[o.id]=o.serialize(),this._updateLayerCount(o,!0)}const a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)return void this.fire(new e.ErrorEvent(new Error(`Layer with id "${r}" does not exist on this map.`)));this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o;const s=this._getLayerSourceCache(o);if(this._removedLayers[i]&&o.source&&s&&"custom"!==o.type){const e=this._removedLayers[i];delete this._removedLayers[i],e.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",s.pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(t,r){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===r)return;const n=this._order.indexOf(t);this._order.splice(n,1);const i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new e.ErrorEvent(new Error(`Layer with id "${r}" does not exist on this map.`))):(this._order.splice(i,0,t),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(t){this._checkLoaded();const r=this._layers[t];if(!r)return void this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be removed.`)));r.setEventedParent(null),this._updateLayerCount(r,!1);const n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(e){return this._layers[e]}hasLayer(e){return e in this._layers}hasLayerType(e){for(const t in this._layers)if(this._layers[t].type===e)return!0;return!1}setLayerZoomRange(t,r,n){this._checkLoaded();const i=this.getLayer(t);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(r,n,i={}){this._checkLoaded();const o=this.getLayer(r);if(o){if(!t(o.filter,n))return null==n?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(e.validateFilter,`layers.${o.id}.filter`,n,{layerType:o.type},i)||(o.filter=e.clone$1(n),this._updateLayer(o)))}else this.fire(new e.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be filtered.`)))}getFilter(t){const r=this.getLayer(t);return r&&e.clone$1(r.filter)}setLayoutProperty(r,n,i,o={}){this._checkLoaded();const a=this.getLayer(r);a?t(a.getLayoutProperty(n),i)||(a.setLayoutProperty(n,i,o),this._updateLayer(a)):this.fire(new e.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(t,r){const n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style.`)))}setPaintProperty(r,n,i,o={}){this._checkLoaded();const a=this.getLayer(r);a?t(a.getPaintProperty(n),i)||(a.setPaintProperty(n,i,o)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[r]=!0):this.fire(new e.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(e,t){const r=this.getLayer(e);return r&&r.getPaintProperty(t)}setFeatureState(t,r){this._checkLoaded();const n=t.source,i=t.sourceLayer,o=this.getSource(n);if(!o)return void this.fire(new e.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)));const a=o.type;if("geojson"===a&&i)return void this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===a&&!i)return void this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided.")));const s=this._getSourceCaches(n);for(const e of s)e.setFeatureState(i,t.id,r)}removeFeatureState(t,r){this._checkLoaded();const n=t.source,i=this.getSource(n);if(!i)return void this.fire(new e.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)));const o=i.type,a="vector"===o?t.sourceLayer:void 0;if("vector"===o&&!a)return void this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(r&&"string"!=typeof t.id&&"number"!=typeof t.id)return void this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const s=this._getSourceCaches(n);for(const e of s)e.removeFeatureState(a,t.id,r)}getFeatureState(t){this._checkLoaded();const r=t.source,n=t.sourceLayer,i=this.getSource(r);if(i){if("vector"!==i.type||n)return void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(r)[0].getFeatureState(n,t.id);this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error(`The source '${r}' does not exist in the map's style.`)))}getTransition(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const t={};for(const e in this._sourceCaches){const r=this._sourceCaches[e].getSource();t[r.id]||(t[r.id]=r.serialize())}return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:t,layers:this._serializeLayers(this._order)},(e=>void 0!==e))}_updateLayer(e){this._updatedLayers[e.id]=!0;const t=this._getLayerSourceCache(e);e.source&&!this._updatedSources[e.source]&&t&&"raster"!==t.getSource().type&&(this._updatedSources[e.source]="reload",t.pause()),this._changed=!0,e.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(e){const t=e=>"fill-extrusion"===this._layers[e].type,r={},n=[];for(let i=this._order.length-1;i>=0;i--){const o=this._order[i];if(t(o)){r[o]=i;for(const t of e){const e=t[o];if(e)for(const t of e)n.push(t)}}}n.sort(((e,t)=>t.intersectionZ-e.intersectionZ));const i=[];for(let o=this._order.length-1;o>=0;o--){const a=this._order[o];if(t(a))for(let e=n.length-1;e>=0;e--){const t=n[e].feature;if(r[t.layer.id]<o)break;i.push(t),n.pop()}else for(const t of e){const e=t[a];if(e)for(const t of e)i.push(t.feature)}}return i}queryRenderedFeatures(t,r,n){r&&r.filter&&this._validate(e.validateFilter,"queryRenderedFeatures.filter",r.filter,null,r);const i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new e.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const t of r.layers){const r=this._layers[t];if(!r)return this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];i[r.source]=!0}}const o=[];r.availableImages=this._availableImages;const a=r&&r.layers?r.layers.some((e=>{const t=this.getLayer(e);return t&&t.is3D()})):this.has3DLayers(),s=O.createFromScreenPoints(t,n);for(const e in this._sourceCaches){const t=this._sourceCaches[e].getSource().id;r.layers&&!i[t]||o.push(Le(this._sourceCaches[e],this._layers,this._serializedLayers,s,r,n,a,!!this.map._showQueryGeometry))}return this.placement&&o.push(function(e,t,r,n,i,o,a){const s={},l=o.queryRenderedSymbols(n),c=[];for(const e of Object.keys(l).map(Number))c.push(a[e]);c.sort(De);for(const r of c){const n=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],t,r.bucketIndex,r.sourceLayerIndex,i.filter,i.layers,i.availableImages,e);for(const e in n){const t=s[e]=s[e]||[],i=n[e];i.sort(((e,t)=>{const n=r.featureSortOrder;if(n){const r=n.indexOf(e.featureIndex);return n.indexOf(t.featureIndex)-r}return t.featureIndex-e.featureIndex}));for(const e of i)t.push(e)}}for(const t in s)s[t].forEach((n=>{const i=n.feature,o=r(e[t]);if(!o)return;const a=o.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=a}));return s}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),s.screenGeometry,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(o)}querySourceFeatures(t,r){r&&r.filter&&this._validate(e.validateFilter,"querySourceFeatures.filter",r.filter,null,r);const n=this._getSourceCaches(t);let i=[];for(const e of n)i=i.concat(ze(e,r));return i}addSourceType(e,t,r){return Yt.getSourceType(e)?r(new Error(`A source type called "${e}" already exists.`)):(Yt.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},r):r(null,null))}getLight(){return this.light.getLight()}setLight(e,r={}){this._checkLoaded();const n=this.light.getLight();let i=!1;for(const r in e)if(!t(e[r],n[r])){i=!0;break}if(!i)return;const o=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(e,r),this.light.updateTransitions(o)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(r,n=1){if(this._checkLoaded(),!r)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let i=r;if(1===n){if("object"==typeof i.source){const t="terrain-dem-src";this.addSource(t,i.source),i=e.clone$1(i),i=e.extend(i,{source:t})}if(this._validate(e.validateTerrain,"terrain",i))return}if(!this.terrain||this.terrain&&n!==this.terrain.drapeRenderMode){if(!i)return;this._createTerrain(i,n)}else{const r=this.terrain,n=r.get();for(const t of Object.keys(e.spec.terrain))!i.hasOwnProperty(t)&&e.spec.terrain[t].default&&(i[t]=e.spec.terrain[t].default);for(const e in i)if(!t(i[e],n[e])){r.set(i),this.stylesheet.terrain=i;const e=this._setTransitionParameters({duration:0});r.updateTransitions(e);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(e){const t=this.fog=new A(e,this.map.transform);this.stylesheet.fog=e;const r=this._setTransitionParameters({duration:0});t.updateTransitions(r)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask((()=>{for(const e of this.map._markers)e._evaluateOpacity()}))}getFog(){return this.fog?this.fog.get():null}setFog(e){if(this._checkLoaded(),!e)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const r=this.fog,n=r.get();0===Object.keys(e).length&&r.set(e);for(const i in e)if(!t(e[i],n[i])){r.set(e),this.stylesheet.fog=e;const t=this._setTransitionParameters({duration:0});r.updateTransitions(t);break}}else this._createFog(e);this._markersNeedUpdate=!0}_setTransitionParameters(t){return{now:e.exported.now(),transition:e.extend(t,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const e=this._order.filter((e=>this.isLayerDraped(this._layers[e]))),t=this._order.filter((e=>!this.isLayerDraped(this._layers[e])));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...e),this._drapedFirstOrder.push(...t)}_createTerrain(e,t){const r=this.terrain=new E(e,t);this.stylesheet.terrain=e,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const n=this._setTransitionParameters({duration:0});r.updateTransitions(n)}_force3DLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"fill-extrusion"===t.type&&this._updateLayer(t)}}_forceSymbolLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"symbol"===t.type&&this._updateLayer(t)}}_validate(t,r,n,i,o={}){return(!o||!1!==o.validate)&&Wt(this,t.call(e.validateStyle,e.extend({key:r,style:this.serialize(),value:n,styleSpec:e.spec},i)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const e in this._layers)this._layers[e].setEventedParent(null);for(const e in this._sourceCaches)this._sourceCaches[e].clearTiles(),this._sourceCaches[e].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(e){const t=this._getSourceCaches(e);for(const e of t)e.clearTiles()}_reloadSource(e){const t=this._getSourceCaches(e);for(const e of t)e.resume(),e.reload()}_reloadSources(){for(const e of this._getSources())e.reload&&e.reload()}_updateSources(e){for(const t in this._sourceCaches)this._sourceCaches[t].update(e)}_generateCollisionBoxes(){for(const e in this._sourceCaches){const t=this._sourceCaches[e];t.resume(),t.reload()}}_updatePlacement(t,r,n,i,o=!1){let a=!1,s=!1;const l={};for(const e of this._order){const r=this._layers[e];if("symbol"!==r.type)continue;if(!l[r.source]){const e=this._getLayerSourceCache(r);if(!e)continue;l[r.source]=e.getRenderableIds(!0).map((t=>e.getTileByID(t))).sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}const n=this.crossTileSymbolIndex.addLayer(r,l[r.source],t.center.lng,t.projection);a=a||n}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),o=o||this._layerOrderChanged||0===n,this._layerOrderChanged&&this.fire(new e.Event("neworder")),(o||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.exported.now(),t.zoom))&&(this.pauseablePlacement=new Nt(t,this._order,o,r,n,i,this.placement,this.fog&&t.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.exported.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(const e of this._order){const t=this._layers[e];"symbol"===t.type&&this.placement.updateLayerOpacities(t,l[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.exported.now())}_releaseSymbolFadeTiles(){for(const e in this._sourceCaches)this._sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,t,r){this.imageManager.getImages(t.icons,r),this._updateTilesForChangedImages();const n=e=>{e&&e.setDependencies(t.tileID.key,t.type,t.icons)};n(this._otherSourceCaches[t.source]),n(this._symbolSourceCaches[t.source])}getGlyphs(e,t,r){this.glyphManager.getGlyphs(t.stacks,r)}getResource(t,r,n){return e.makeRequest(r,n)}_getSourceCache(e){return this._otherSourceCaches[e]}_getLayerSourceCache(e){return"symbol"===e.type?this._symbolSourceCaches[e.source]:this._otherSourceCaches[e.source]}_getSourceCaches(e){const t=[];return this._otherSourceCaches[e]&&t.push(this._otherSourceCaches[e]),this._symbolSourceCaches[e]&&t.push(this._symbolSourceCaches[e]),t}_isSourceCacheLoaded(t){const r=this._getSourceCaches(t);return 0===r.length?(this.fire(new e.ErrorEvent(new Error(`There is no source with ID '${t}'`))),!1):r.every((e=>e.loaded()))}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}Yt.getSourceType=function(e){return Me[e]},Yt.setSourceType=function(e,t){Me[e]=t},Yt.registerForPluginStateChange=e.registerForPluginStateChange;var Jt="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#define EXTENT 8192.0\n#define HALF_PI PI/2.0\n#define QUARTER_PI PI/4.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0",Qt="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",er="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\nconst float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}\n#ifdef TERRAIN\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;\n#else\nuniform sampler2D u_dem;uniform sampler2D u_dem_prev;\n#endif\nuniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos));\n#ifdef TERRAIN_DEM_NEAREST_FILTER\nreturn u_exaggeration*tl;\n#endif\nfloat tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(\nunpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))\n);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nfloat tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a;\n#else\nvec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack);\n#endif\nreturn vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }\n#endif",tr="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",rr="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif";let nr={},ir={};const or=[];ur(Jt,or),ur(er,or),ur(tr,or),ur(rr,or),nr=pr("",er),ir=pr(rr,tr);const ar=pr("\n#if __VERSION__ >=300\n#define varying in\n#define gl_FragColor glFragColor\n#define texture2D texture\n#define textureCube texture\nout vec4 glFragColor;\n#endif\nhighp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}","\n#if __VERSION__ >=300\n#define attribute in\n#define varying out\n#define texture2D texture\n#endif\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered."),sr=Jt,lr="\n#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif";var cr={background:pr("uniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nvarying vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform vec4 u_color;varying vec4 v_color;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(u_color);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),backgroundPattern:pr("uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),circle:pr("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\ngl_FragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}"),clippingMask:pr("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:pr("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),heatmapTexture:pr("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:pr("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}","attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:pr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos_2f;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:pr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;\n#endif\nvarying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}"),fill:pr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutline:pr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutlinePattern:pr("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillPattern:pr("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillExtrusion:pr("varying vec4 v_color;\n#ifdef RENDER_SHADOWS\nvarying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\nvoid main() {\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvec3 normal=v_normal;\n#endif\nfloat z;vec4 color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z);\n#else\ncolor=v_color;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef ZERO_ROOF_RADIUS\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#endif\ncolor.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec4 v_color;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\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\nvec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nv_normal=normal;\n#endif\nbase=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele;vec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nv_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w;\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(color,NdotL);\n#else\nv_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_color*=u_opacity;\n#ifdef ZERO_ROOF_RADIUS\nv_roof_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef LIGHTING_3D_MODE\nv_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0)));\n#else\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),fillExtrusionPattern:pr("uniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,v_NdotL)*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_NdotL=NdotL;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif \n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}"),hillshadePrepare:pr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nreturn texture2D(u_image,coord).a/4.0;\n#else\nvec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;\n#endif\n}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:pr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\ngl_FragColor=apply_lighting(gl_FragColor);\n#endif\n#ifdef FOG\ngl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),line:pr("uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\nuniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nfloat linearstep(float edge0,float edge1,float x) {return  clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture2D(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trimmed=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef RENDER_LINE_ALPHA_DISCARD\nif (alpha < u_alpha_discard_threshold) {discard;}\n#endif\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);\n#ifdef RENDER_LINE_BORDER_AUTO\nfloat Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}\n#else\nout_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha);\n#endif\n}\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define EXTRUDE_SCALE 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nattribute highp vec4 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nattribute float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nfloat a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);\n#else\nv_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),linePattern:pr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting(color);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),raster:pr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply(out_color,v_fog_pos));\n#endif\ngl_FragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),symbolIcon:pr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}"),symbolSDF:pr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}"),symbolTextAndIcon:pr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}"),terrainRaster:pr("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nvarying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nvoid main() {vec4 color=texture2D(u_image0,v_pos0);\n#ifdef RENDER_SHADOWS\ncolor.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nconst float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;\n#ifdef TERRAIN_WIREFRAME\nelevation+=wireframeOffset;\n#endif\nv_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w;\n#endif\n}"),terrainDepth:pr("#ifdef GL_ES\nprecision highp float;\n#endif\nvarying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}","uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:pr("\nvarying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Qt),skyboxGradient:pr("varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Qt),skyboxCapture:pr("\nvarying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;\n#ifdef GL_ES\nprecision highp float;\n#endif\n#define BETA_R                  vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M                  vec3(21e-6,21e-6,21e-6)\n#define MIE_G                   0.76\n#define DENSITY_HEIGHT_SCALE_R  8000.0\n#define DENSITY_HEIGHT_SCALE_M  1200.0\n#define PLANET_RADIUS           6360e3\n#define ATMOSPHERE_RADIUS       6420e3\n#define SAMPLE_STEPS            10\n#define DENSITY_STEPS           4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}","attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:pr("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nvec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#else\ncolor=texture2D(u_image0,v_pos0);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nattribute vec3 a_globe_pos;attribute vec2 a_uv;\n#else\nattribute vec2 a_pos;\n#endif\nvarying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);\n#ifdef TERRAIN_WIREFRAME\nheight+=wireframeOffset;\n#endif\nglobe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}"),globeAtmosphere:pr("uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x:\n(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y:\nuv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}","attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}")};function ur(e,t){const r=e.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n");for(let e of r)if(e=e.trim(),"#"===e[0]&&e.includes("if")&&!e.includes("endif")){e=e.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const r=e.split(" ");for(const e of r)t.includes(e)||t.push(e)}}function pr(e,t){const r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=t.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),i={},o=[...or];return ur(e,o),ur(t,o),{fragmentSource:e=e.replace(r,((e,t,r,n,o)=>(i[o]=!0,"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nvarying ${r} ${n} ${o};\n#else\nuniform ${r} ${n} u_${o};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${o}\n    ${r} ${n} ${o} = u_${o};\n#endif\n`))),vertexSource:t=t.replace(r,((e,t,r,n,o)=>{const a="float"===n?"vec2":"vec4",s=o.match(/color/)?"color":a;return i[o]?"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\nattribute ${r} ${a} a_${o};\nvarying ${r} ${n} ${o};\n#else\nuniform ${r} ${n} u_${o};\n#endif\n`:"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${o}\n    ${o} = a_${o};\n#else\n    ${r} ${n} ${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    ${r} ${n} ${o} = u_${o};\n#endif\n`:"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\nattribute ${r} ${a} a_${o};\n#else\nuniform ${r} ${n} u_${o};\n#endif\n`:"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${o}\n    ${r} ${n} ${o} = a_${o};\n#else\n    ${r} ${n} ${o} = u_${o};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${o}\n    ${r} ${n} ${o} = unpack_mix_${s}(a_${o}, u_${o}_t);\n#else\n    ${r} ${n} ${o} = u_${o};\n#endif\n`})),staticAttributes:n,usedDefines:o}}class hr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(e,t,r,n,i,o,a){this.context=e;let s=this.boundPaintVertexBuffers.length!==n.length;for(let e=0;!s&&e<n.length;e++)this.boundPaintVertexBuffers[e]!==n[e]&&(s=!0);let l=this.boundDynamicVertexBuffers.length!==a.length;for(let e=0;!l&&e<a.length;e++)this.boundDynamicVertexBuffers[e]!==a[e]&&(l=!0);if(!e.extVertexArrayObject||!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==r||s||l||this.boundIndexBuffer!==i||this.boundVertexOffset!==o)this.freshBind(t,r,n,i,o,a);else{e.bindVertexArrayOES.set(this.vao);for(const e of a)e&&e.bind();i&&i.dynamicDraw&&i.bind()}}freshBind(e,t,r,n,i,o){let a;const s=e.numAttributes,l=this.context,c=l.gl;if(l.extVertexArrayObject)this.vao&&this.destroy(),this.vao=l.extVertexArrayObject.createVertexArrayOES(),l.bindVertexArrayOES.set(this.vao),a=0,this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffers=o;else{a=l.currentNumAttributes||0;for(let e=s;e<a;e++)c.disableVertexAttribArray(e)}t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,i);for(const t of r)t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,i);for(const t of o)t&&(t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,i));n&&n.bind(),l.currentNumAttributes=s}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function dr(t,r){const n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new e.MercatorCoordinate(0,i/n).toLngLat().lat,new e.MercatorCoordinate(0,(i+1)/n).toLngLat().lat]}function fr(t,r,n,i,o,a,s){const l=t.context,c=l.gl,u=n.fbo;if(!u)return;t.prepareDrawTile();const p=t.useProgram("hillshade");l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,u.colorAttachment.get());const h=((e,t,r,n)=>{const i=r.paint.get("hillshade-shadow-color"),o=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color");let s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);const l=!e.options.moving;return{u_matrix:n||e.transform.calculateProjMatrix(t.tileID.toUnwrapped(),l),u_image:0,u_latrange:dr(0,t.tileID),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:o,u_accent:a}})(t,n,i,t.terrain?r.projMatrix:null);t.prepareDrawProgram(l,p,r.toUnwrapped());const{tileBoundsBuffer:d,tileBoundsIndexBuffer:f,tileBoundsSegments:m}=t.getTileBoundsBuffers(n);p.draw(l,c.TRIANGLES,o,a,s,e.CullFaceMode.disabled,h,i.id,d,f,m)}function mr(t,r,n){if(!r.needsDEMTextureUpload)return;const i=t.context,o=i.gl;i.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(n.stride);const a=n.getPixels();r.demTexture?r.demTexture.update(a,{premultiply:!1}):r.demTexture=new e.Texture(i,a,o.RGBA,{premultiply:!1}),r.needsDEMTextureUpload=!1}function gr(t,r,n,i,o,a){const s=t.context,l=s.gl;if(!r.dem)return;const c=r.dem;if(s.activeTexture.set(l.TEXTURE1),mr(t,r,c),!r.demTexture)return;r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);const u=c.dim;s.activeTexture.set(l.TEXTURE0);let p=r.fbo;if(!p){const t=new e.Texture(s,{width:u,height:u,data:null},l.RGBA);t.bind(l.LINEAR,l.CLAMP_TO_EDGE),p=r.fbo=s.createFramebuffer(u,u,!0),p.colorAttachment.set(t.texture)}s.bindFramebuffer.set(p.framebuffer),s.viewport.set([0,0,u,u]);const{tileBoundsBuffer:h,tileBoundsIndexBuffer:d,tileBoundsSegments:f}=t.getMercatorTileBoundsBuffers();t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,o,a,e.CullFaceMode.disabled,((t,r)=>{const n=r.stride,i=e.create();return e.ortho(i,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(i,i,[0,-e.EXTENT,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:t.overscaledZ,u_unpack:r.unpackVector}})(r.tileID,c),n.id,h,d,f),r.needsHillshadePrepare=!1}const br=t=>({u_matrix:new e.UniformMatrix4f(t),u_image0:new e.Uniform1i(t),u_skirt_height:new e.Uniform1f(t)}),_r=(e,t)=>({u_matrix:e,u_image0:0,u_skirt_height:t}),yr=(e,t,r,n,i,o,a,s,l,c,u,p,h,d,f)=>({u_proj_matrix:Float32Array.from(e),u_globe_matrix:t,u_normalize_matrix:Float32Array.from(n),u_merc_matrix:r,u_zoom_transition:i,u_merc_center:o,u_image0:0,u_frustum_tl:a,u_frustum_tr:s,u_frustum_br:l,u_frustum_bl:c,u_globe_pos:u,u_globe_radius:p,u_viewport:h,u_grid_matrix:f?Float32Array.from(f):new Float32Array(9),u_skirt_height:d});function vr(e,t){return null!=e&&null!=t&&!(!e.hasData()||!t.hasData())&&null!=e.demTexture&&null!=t.demTexture&&e.tileID.key!==t.tileID.key}const xr=new class{constructor(){this.operations={}}newMorphing(e,t,r,n,i){if(e in this.operations){const t=this.operations[e];t.to.tileID.key!==r.tileID.key&&(t.queued=r)}else this.operations[e]={startTime:n,phase:0,duration:i,from:t,to:r,queued:null}}getMorphValuesForProxy(e){if(!(e in this.operations))return null;const t=this.operations[e];return{from:t.from,to:t.to,phase:t.phase}}update(e){for(const t in this.operations){const r=this.operations[t];for(r.phase=(e-r.startTime)/r.duration;r.phase>=1||!this._validOp(r);)if(!this._nextOp(r,e)){delete this.operations[t];break}}}_nextOp(e,t){return!!e.queued&&(e.from=e.to,e.to=e.queued,e.queued=null,e.phase=0,e.startTime=t,!0)}_validOp(e){return e.from.hasData()&&e.to.hasData()}},wr={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function kr(e){return 6*Math.pow(1.5,22-e)}function Er(e,t){const r=1<<e.z;return!t&&(0===e.x||e.x===r-1)||0===e.y||e.y===r-1}const Tr=e=>({u_matrix:e});function Sr(t,r,n,i,o){if(o>0){const a=e.exported.now(),s=(a-t.timeAdded)/o,l=r?(a-r.timeAdded)/o:-1,c=n.getSource(),u=i.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-u)>Math.abs(t.tileID.overscaledZ-u),h=p&&t.refreshedUponExpiration?1:e.clamp(p?s:1-l,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-h}:{opacity:h,mix:0}}return{opacity:1,mix:0}}class Cr extends e.SourceCache{constructor(e){const t={type:"raster-dem",maxzoom:e.transform.maxZoom},r=new M(je(),null),n=Ie("mock-dem",t,r,e.style);super("mock-dem",n,!1),n.setEventedParent(this),this._sourceLoaded=!0}_loadTile(e,t){e.state="loaded",t(null)}}class Ar extends e.SourceCache{constructor(e){const t=Ie("proxy",{type:"geojson",maxzoom:e.transform.maxZoom},new M(je(),null),e.style);super("proxy",t,!1),t.setEventedParent(this),this.map=this.getSource().map=e,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(t,r,n){if(t.freezeTileCoverage)return;this.transform=t;const i=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce(((r,n)=>{if(r[n.key]="",!this._tiles[n.key]){const r=new e.Tile(n,this._source.tileSize*n.overscaleFactor(),t.tileZoom);r.state="loaded",this._tiles[n.key]=r}return r}),{});for(const e in this._tiles)e in i||(this.freeFBO(e),this._tiles[e].unloadVectorData(),delete this._tiles[e])}freeFBO(e){const t=this.proxyCachedFBO[e];if(void 0!==t){const r=Object.values(t);this.renderCachePool.push(...r),delete this.proxyCachedFBO[e]}}deallocRenderCache(){this.renderCache.forEach((e=>e.fb.destroy())),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Mr extends e.OverscaledTileID{constructor(e,t,r){super(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y),this.proxyTileKey=t,this.projMatrix=r}}class Ir extends e.Elevation{constructor(t,r){super(),this.painter=t,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[n,i,o]=function(t){const r=new e.StructArrayLayout2i4,n=new e.StructArrayLayout3ui6,i=131;r.reserve(17161),n.reserve(33800);const o=e.EXTENT/128,a=e.EXTENT+o/2,s=a+o;for(let t=-o;t<s;t+=o)for(let n=-o;n<s;n+=o){const i=n<0||n>a||t<0||t>a?24575:0,o=e.clamp(Math.round(n),0,e.EXTENT),s=e.clamp(Math.round(t),0,e.EXTENT);r.emplaceBack(o+i,s)}const l=(e,t)=>{const r=t*i+e;n.emplaceBack(r+1,r,r+i),n.emplaceBack(r+i,r+i+1,r+1)};for(let e=1;e<129;e++)for(let t=1;t<129;t++)l(t,e);return[0,129].forEach((e=>{for(let t=0;t<130;t++)l(t,e),l(e,t)})),[r,n,32768]}(),a=t.context;this.gridBuffer=a.createVertexBuffer(n,e.posAttributes.members),this.gridIndexBuffer=a.createIndexBuffer(i),this.gridSegments=e.SegmentVector.simpleSegment(0,0,n.length,i.length),this.gridNoSkirtSegments=e.SegmentVector.simpleSegment(0,0,n.length,o),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Ar(r.map),this.orthoMatrix=e.create(),e.ortho(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,e.EXTENT,0,e.EXTENT,0,1);const s=a.gl;this._overlapStencilMode=new e.StencilMode({func:s.GEQUAL,mask:255},0,255,s.KEEP,s.KEEP,s.REPLACE),this._previousZoom=t.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=r,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Cr(r.map)}set style(e){e.on("data",this._onStyleDataEvent.bind(this)),e.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=e,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",(()=>{this._clearLineLayersFromRenderCache()}))}update(t,r,n){if(t&&t.terrain){this._style!==t&&(this.style=t),this.enabled=!0;const i=t.terrain.properties;this.sourceCache=0===t.terrain.drapeRenderMode?this._mockSourceCache:t._getSourceCache(i.get("source")),this._exaggeration=i.get("exaggeration");const o=()=>{this.sourceCache.used&&e.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const t=this.getScaledDemTileSize();this.sourceCache.update(r,t,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,o(),this._initializing=!0),o(),r.updateElevation(!0,n),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(r),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(e){this._findCoveringTileCache[e]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const t=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||100!==t.efficiency&&e.warnOnce(`Terrain render cache efficiency is not optimal (${t.efficiency}%) and performance\n                may be affected negatively, consider placing all background, fill and line layers before layer\n                with id '${t.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(e){e.coord&&"source"===e.dataType?this._clearRenderCacheForTile(e.sourceCacheId,e.coord):"style"===e.dataType&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const e in this._style._sourceCaches)this._style._sourceCaches[e].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach((e=>e.fb.destroy())),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const e=2*this.proxySourceCache.getSource().tileSize;return[e,e]}set useVertexMorphing(e){this._useVertexMorphing=e}updateTileBinding(t){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const r=this.proxySourceCache,n=this.painter.transform;this._initializing&&(this._initializing=0===n._centerAltitude&&-1===this.getAtPointOrZero(e.MercatorCoordinate.fromLngLat(n.center),-1),this._emptyDEMTextureDirty=!this._initializing);const i=this.proxyCoords=r.getIds().map((e=>{const t=r.getTileByID(e).tileID;return t.projMatrix=n.calculateProjMatrix(t.toUnwrapped()),t}));!function(t,r){const n=r.transform.pointCoordinate(r.transform.getCameraPoint()),i=new e.Point(n.x,n.y);t.sort(((t,r)=>{if(r.overscaledZ-t.overscaledZ)return r.overscaledZ-t.overscaledZ;const n=new e.Point(t.canonical.x+(1<<t.canonical.z)*t.wrap,t.canonical.y),o=new e.Point(r.canonical.x+(1<<r.canonical.z)*r.wrap,r.canonical.y),a=i.mult(1<<t.canonical.z);return a.x-=.5,a.y-=.5,a.distSqr(n)-a.distSqr(o)}))}(i,this.painter),this._previousZoom=n.zoom;const o=this.proxyToSource||{};this.proxyToSource={},i.forEach((e=>{this.proxyToSource[e.key]={}})),this.terrainTileForTile={};const a=this._style._sourceCaches;for(const e in a){const r=a[e];if(!r.used)continue;if(r!==this.sourceCache&&this.resetTileLookupCache(r.id),this._setupProxiedCoordsForOrtho(r,t[e],o),r.usedForTerrain)continue;const n=t[e];r.getSource().reparseOverscaled&&this._assignTerrainTiles(n)}this.proxiedCoords[r.id]=i.map((e=>new Mr(e,e.key,this.orthoMatrix))),this._assignTerrainTiles(i),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(o),this.renderingToTexture=!1,this._updateTimestamp=e.exported.now();const s={};this._visibleDemTiles=[];for(const e of this.proxyCoords){const t=this.terrainTileForTile[e.key];if(!t)continue;const r=t.tileID.key;r in s||(this._visibleDemTiles.push(t),s[r]=r)}}_assignTerrainTiles(e){this._initializing||e.forEach((e=>{if(this.terrainTileForTile[e.key])return;const t=this._findTileCoveringTileID(e,this.sourceCache);t&&(this.terrainTileForTile[e.key]=t)}))}_prepareDEMTextures(){const e=this.painter.context,t=e.gl;for(const r in this.terrainTileForTile){const n=this.terrainTileForTile[r],i=n.dem;!i||n.demTexture&&!n.needsDEMTextureUpload||(e.activeTexture.set(t.TEXTURE1),mr(this.painter,n,i))}}_prepareDemTileUniforms(e,t,r,n){if(!t||null==t.demTexture)return!1;const i=e.tileID.canonical,o=Math.pow(2,t.tileID.canonical.z-i.z),a=n||"";return r[`u_dem_tl${a}`]=[i.x*o%1,i.y*o%1],r[`u_dem_scale${a}`]=o,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const t=this.painter.context,r=t.gl;if(!this._emptyDepthBufferTexture){const n=new e.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new e.Texture(t,n,r.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let e=0;const t=this._visibleDemTiles.reduce(((t,r)=>{if(!r.dem)return t;const n=r.dem.tree.minimums[0];return n>0&&e++,t+n}),0);return e?t/e:0}_updateEmptyDEMTexture(){const t=this.painter.context,r=t.gl;t.activeTexture.set(r.TEXTURE2);const n=this._getLoadedAreaMinimum(),i=new e.RGBAImage({width:1,height:1},new Uint8Array(e.DEMData.pack(n,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let o=this._emptyDEMTexture;return o?o.update(i,{premultiply:!1}):o=this._emptyDEMTexture=new e.Texture(t,i,r.RGBA,{premultiply:!1}),o}setupElevationDraw(t,r,n){const i=this.painter.context,o=i.gl,a=(s=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:e.DEMData.getUnpackVector(s),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var s;a.u_dem_size=this.sourceCache.getSource().tileSize,a.u_exaggeration=this.exaggeration();let l=null,c=null,u=1;if(n&&n.morphing&&this._useVertexMorphing){const e=n.morphing.srcDemTile,r=n.morphing.dstDemTile;u=n.morphing.phase,e&&r&&(this._prepareDemTileUniforms(t,e,a,"_prev")&&(c=e),this._prepareDemTileUniforms(t,r,a)&&(l=r))}if(c&&l?(i.activeTexture.set(o.TEXTURE2),l.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),i.activeTexture.set(o.TEXTURE4),c.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),a.u_dem_lerp=u):(l=this.terrainTileForTile[t.tileID.key],i.activeTexture.set(o.TEXTURE2),(this._prepareDemTileUniforms(t,l,a)?l.demTexture:this.emptyDEMTexture).bind(o.NEAREST,o.CLAMP_TO_EDGE)),i.activeTexture.set(o.TEXTURE3),n&&n.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),this._depthFBO&&(a.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),a.u_depth_size_inv=[1,1]),n&&n.useMeterToDem&&l){const t=(1<<l.tileID.canonical.z)*e.mercatorZfromAltitude(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;a.u_meter_to_dem=t}if(n&&n.labelPlaneMatrixInv&&(a.u_label_plane_matrix_inv=n.labelPlaneMatrixInv),r.setTerrainUniformValues(i,a),"globe"===this.painter.transform.projection.name){const e=this.globeUniformValues(this.painter.transform,t.tileID.canonical,n&&n.useDenormalizedUpVectorScale);r.setGlobeUniformValues(i,e)}}globeUniformValues(t,r,n){const i=t.projection;return{u_tile_tl_up:i.upVector(r,0,0),u_tile_tr_up:i.upVector(r,e.EXTENT,0),u_tile_br_up:i.upVector(r,e.EXTENT,e.EXTENT),u_tile_bl_up:i.upVector(r,0,e.EXTENT),u_tile_up_scale:n?e.globeMetersToEcef(1):i.upVectorScale(r,t.center.lat,t.worldSize).metersToTile}}renderToBackBuffer(t){const r=this.painter,n=this.painter.context;0!==t.length&&(n.bindFramebuffer.set(null),n.viewport.set([0,0,r.width,r.height]),r.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(t,r,n,i,o){if("globe"===t.transform.projection.name)!function(t,r,n,i,o){const a=t.context,s=a.gl;let l,c;const u=t.options.showTerrainWireframe?2:0,p=t.transform,h=e.globeUseCustomAntiAliasing(t,a,p),d=(e,r)=>{if(c===e)return;const n=[wr[e],"PROJECTION_GLOBE_VIEW"];h&&n.push("CUSTOM_ANTIALIASING"),r&&n.push(wr[u]),l=t.useProgram("globeRaster",null,n),c=e},f=t.colorModeForRenderPass(),m=new e.DepthMode(s.LEQUAL,e.DepthMode.ReadWrite,t.depthRangeFor3D);xr.update(o);const g=e.calculateGlobeMercatorMatrix(p),b=[e.mercatorXfromLng(p.center.lng),e.mercatorYfromLat(p.center.lat)],_=u?[!1,!0]:[!1],y=t.globeSharedBuffers,v=[p.width*e.exported.devicePixelRatio,p.height*e.exported.devicePixelRatio],x=Float32Array.from(p.globeMatrix),w={useDenormalizedUpVectorScale:!0};if(_.forEach((u=>{const p=t.transform,h=kr(p.zoom)*r.exaggeration();c=-1;const _=u?s.LINES:s.TRIANGLES;for(const c of i){const i=n.getTile(c),k=e.StencilMode.disabled,E=r.prevTerrainTileForTile[c.key],T=r.terrainTileForTile[c.key];vr(E,T)&&xr.newMorphing(c.key,E,T,o,250),a.activeTexture.set(s.TEXTURE0),i.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE);const S=xr.getMorphValuesForProxy(c.key),C=S?1:0;S&&e.extend$1(w,{morphing:{srcDemTile:S.from,dstDemTile:S.to,phase:e.easeCubicInOut(S.phase)}});const A=e.tileCornersToBounds(c.canonical),M=e.getLatitudinalLod(A.getCenter().lat),I=e.getGridMatrix(c.canonical,A,M,p.worldSize/p._pixelsPerMercatorPixel),O=e.globeNormalizeECEF(e.globeTileBounds(c.canonical)),L=yr(p.projMatrix,x,g,O,e.globeToMercatorTransition(p.zoom),b,p.frustumCorners.TL,p.frustumCorners.TR,p.frustumCorners.BR,p.frustumCorners.BL,p.globeCenterInViewSpace,p.globeRadius,v,h,I);if(d(C,u),r.setupElevationDraw(i,l,w),t.prepareDrawProgram(a,l,c.toUnwrapped()),y){const[r,n,i]=u?y.getWirefameBuffers(t.context,M):y.getGridBuffers(M,0!==h);l.draw(a,_,m,k,f,e.CullFaceMode.backCCW,L,"globe_raster",r,n,i)}}})),y){const o=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];h&&o.push("CUSTOM_ANTIALIASING"),l=t.useProgram("globeRaster",null,o);for(const o of i){const{x:i,y:c,z:u}=o.canonical,h=0===c,d=c===(1<<u)-1,[g,_,x,k]=y.getPoleBuffers(u);if(k&&(h||d)){const c=n.getTile(o);a.activeTexture.set(s.TEXTURE0),c.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE);let y=e.globePoleMatrixForTile(u,i,p);const E=e.globeNormalizeECEF(e.globeTileBounds(o.canonical)),T=(t,r)=>t.draw(a,s.TRIANGLES,m,e.StencilMode.disabled,f,e.CullFaceMode.disabled,yr(p.projMatrix,y,y,E,0,b,p.frustumCorners.TL,p.frustumCorners.TR,p.frustumCorners.BR,p.frustumCorners.BL,p.globeCenterInViewSpace,p.globeRadius,v,0),"globe_pole_raster",r,x,k);r.setupElevationDraw(c,l,w),t.prepareDrawProgram(a,l,o.toUnwrapped()),h&&T(l,g),d&&(y=e.scale(e.create(),y,[1,-1,1]),T(l,_))}}}}(t,r,n,i,o);else{const a=t.context,s=a.gl;let l,c;const u=t.options.showTerrainWireframe?2:0,p=(e,r)=>{if(c===e)return;const n=[wr[e]];r&&n.push(wr[u]),l=t.useProgram("terrainRaster",null,n),c=e},h=t.colorModeForRenderPass(),d=new e.DepthMode(s.LEQUAL,e.DepthMode.ReadWrite,t.depthRangeFor3D);xr.update(o);const f=t.transform,m=kr(f.zoom)*r.exaggeration();(u?[!1,!0]:[!1]).forEach((u=>{c=-1;const g=u?s.LINES:s.TRIANGLES,[b,_]=u?r.getWirefameBuffer():[r.gridIndexBuffer,r.gridSegments];for(const c of i){const i=n.getTile(c),y=e.StencilMode.disabled,v=r.prevTerrainTileForTile[c.key],x=r.terrainTileForTile[c.key];vr(v,x)&&xr.newMorphing(c.key,v,x,o,250),a.activeTexture.set(s.TEXTURE0),i.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST);const w=xr.getMorphValuesForProxy(c.key),k=w?1:0;let E;w&&(E={morphing:{srcDemTile:w.from,dstDemTile:w.to,phase:e.easeCubicInOut(w.phase)}});const T=_r(c.projMatrix,Er(c.canonical,f.renderWorldCopies)?m/10:m);p(k,u),r.setupElevationDraw(i,l,E),t.prepareDrawProgram(a,l,c.toUnwrapped()),l.draw(a,g,d,y,h,e.CullFaceMode.backCCW,T,"terrain_raster",r.gridBuffer,b,_)}}))}}(r,this,this.proxySourceCache,t,this._updateTimestamp),this.renderingToTexture=!0,r.gpuTimingDeferredRenderEnd(),t.splice(0,t.length))}renderBatch(t){if(0===this._drapedRenderBatches.length)return t+1;this.renderingToTexture=!0;const r=this.painter,n=this.painter.context,i=this.proxySourceCache,o=this.proxiedCoords[i.id],a=this._drapedRenderBatches.shift(),s=[],l=r.style.order;let c=0;for(const u of o){const o=i.getTileByID(u.proxyTileKey),p=i.proxyCachedFBO[u.key]?i.proxyCachedFBO[u.key][t]:void 0,h=void 0!==p?i.renderCache[p]:this.pool[c++],d=void 0!==p;if(o.texture=h.tex,d&&!h.dirty){s.push(o.tileID);continue}let f;n.bindFramebuffer.set(h.fb.framebuffer),this.renderedToTile=!1,h.dirty&&(n.clear({color:e.Color.transparent,stencil:0}),h.dirty=!1);for(let e=a.start;e<=a.end;++e){const t=r.style._layers[l[e]];if(t.isHidden(r.transform.zoom))continue;const i=r.style._getLayerSourceCache(t),o=i?this.proxyToSource[u.key][i.id]:[u];if(!o)continue;const a=o;n.viewport.set([0,0,h.fb.width,h.fb.height]),f!==(i?i.id:null)&&(this._setupStencil(h,o,t,i),f=i?i.id:null),r.renderLayer(r,i,t,a)}this.renderedToTile?(h.dirty=!0,s.push(o.tileID)):d||--c,5===c&&(c=0,this.renderToBackBuffer(s))}return this.renderToBackBuffer(s),this.renderingToTexture=!1,n.bindFramebuffer.set(null),n.viewport.set([0,0,r.width,r.height]),a.end+1}postRender(){}renderCacheEfficiency(e){const t=e.order.length;if(0===t)return{efficiency:100};let r,n=0,i=0,o=!1;for(let a=0;a<t;++a){const t=e._layers[e.order[a]];this._style.isLayerDraped(t)?(o&&++n,++i):o||(o=!0,r=t.id)}return 0===i?{efficiency:100}:{efficiency:100*(1-n/i),firstUndrapedLayer:r}}getMinElevationBelowMSL(){let e=0;return this._visibleDemTiles.filter((e=>e.dem)).forEach((t=>{e=Math.min(e,t.dem.tree.minimums[0])})),0===e?e:(e-30)*this._exaggeration}raycast(e,t,r){if(!this._visibleDemTiles)return null;const n=this._visibleDemTiles.filter((e=>e.dem)).map((n=>{const i=n.tileID,o=1<<i.overscaledZ,{x:a,y:s}=i.canonical,l=a/o,c=(a+1)/o,u=s/o,p=(s+1)/o;return{minx:l,miny:u,maxx:c,maxy:p,t:n.dem.tree.raycastRoot(l,u,c,p,e,t,r),tile:n}}));n.sort(((e,t)=>(null!==e.t?e.t:Number.MAX_VALUE)-(null!==t.t?t.t:Number.MAX_VALUE)));for(const i of n){if(null==i.t)return null;const n=i.tile.dem.tree.raycast(i.minx,i.miny,i.maxx,i.maxy,e,t,r);if(null!=n)return n}return null}_createFBO(){const t=this.painter.context,r=t.gl,n=this.drapeBufferSize;t.activeTexture.set(r.TEXTURE0);const i=new e.Texture(t,{width:n[0],height:n[1],data:null},r.RGBA);i.bind(r.LINEAR,r.CLAMP_TO_EDGE);const o=t.createFramebuffer(n[0],n[1],!1);return o.colorAttachment.set(i.texture),o.depthAttachment=new we(t,o.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=t.createRenderbuffer(t.gl.DEPTH_STENCIL,n[0],n[1]),this._stencilRef=0,o.depthAttachment.set(this._sharedDepthStencil),t.clear({stencil:0})):o.depthAttachment.set(this._sharedDepthStencil),t.extTextureFilterAnisotropic&&!t.extTextureFilterAnisotropicForceOff&&r.texParameterf(r.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax),{fb:o,tex:i,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._style.light&&this._style.light.hasTransition())return!0;for(const e in this._style._sourceCaches)if(this._style._sourceCaches[e].hasTransition())return!0;return this._style.order.some((e=>{const t=this._style._layers[e],r=t.isHidden(this.painter.transform.zoom);return"custom"===t.type?!r&&t.shouldRedrape():!r&&t.hasTransition()}))}_clearLineLayersFromRenderCache(){let t=!1;for(const e of this._style._getSources())if(e instanceof Te){t=!0;break}if(!t)return;const r={};for(let t=0;t<this._style.order.length;++t){const n=this._style._layers[this._style.order[t]],i=this._style._getLayerSourceCache(n);if(i&&!r[i.id]&&!n.isHidden(this.painter.transform.zoom)&&"line"===n.type&&n.widthExpression()instanceof e.ZoomDependentExpression){r[i.id]=!0;for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][i.id];if(t)for(const e of t)this._clearRenderCacheForTile(i.id,e)}}}}_clearRasterLayersFromRenderCache(){let e=!1;for(const t in this._style._sourceCaches)if(this._style._sourceCaches[t]._source instanceof Se){e=!0;break}if(!e)return;const t={};for(let e=0;e<this._style.order.length;++e){const r=this._style._layers[this._style.order[e]],n=this._style._getLayerSourceCache(r);if(!n||t[n.id])continue;if(r.isHidden(this.painter.transform.zoom)||"raster"!==r.type)continue;const i=r.paint.get("raster-fade-duration");for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][n.id];if(t)for(const e of t){const t=Sr(n.getTile(e),n.findLoadedParent(e,0),n,this.painter.transform,i);(1!==t.opacity||0!==t.mix)&&this._clearRenderCacheForTile(n.id,e)}}}}_setupDrapedRenderBatches(){const e=this._style.order,t=e.length;if(0===t)return;const r=[];let n,i=0,o=this._style._layers[e[i]];for(;!this._style.isLayerDraped(o)&&o.isHidden(this.painter.transform.zoom)&&++i<t;)o=this._style._layers[e[i]];for(;i<t;++i){const t=this._style._layers[e[i]];t.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(t)?void 0===n&&(n=i):void 0!==n&&(r.push({start:n,end:i-1}),n=void 0))}void 0!==n&&r.push({start:n,end:i-1}),this._drapedRenderBatches=r}_setupRenderCache(e){const t=this.proxySourceCache;if(this._shouldDisableRenderCache()||this._invalidateRenderCache){if(this._invalidateRenderCache=!1,t.renderCache.length>t.renderCachePool.length){const e=Object.values(t.proxyCachedFBO);t.proxyCachedFBO={};for(let r=0;r<e.length;++r){const n=Object.values(e[r]);t.renderCachePool.push(...n)}}return}this._clearRasterLayersFromRenderCache();const r=this.proxyCoords,n=this._tilesDirty;for(let i=r.length-1;i>=0;i--){const o=r[i];if(t.getTileByID(o.key),void 0!==t.proxyCachedFBO[o.key]){const r=e[o.key],i=this.proxyToSource[o.key];let a=0;for(const e in i){const t=i[e],o=r[e];if(!o||o.length!==t.length||t.some(((t,r)=>t!==o[r]||n[e]&&n[e].hasOwnProperty(t.key)))){a=-1;break}++a}for(const e in t.proxyCachedFBO[o.key])t.renderCache[t.proxyCachedFBO[o.key][e]].dirty=a<0||a!==Object.values(r).length}}const i=[...this._drapedRenderBatches];i.sort(((e,t)=>t.end-t.start-(e.end-e.start)));for(const e of i)for(const n of r){if(t.proxyCachedFBO[n.key])continue;let r=t.renderCachePool.pop();void 0===r&&t.renderCache.length<50&&(r=t.renderCache.length,t.renderCache.push(this._createFBO())),void 0!==r&&(t.proxyCachedFBO[n.key]={},t.proxyCachedFBO[n.key][e.start]=r,t.renderCache[r].dirty=!0)}this._tilesDirty={}}_setupStencil(e,t,r,n){if(!n||!this._sourceTilesOverlap[n.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const i=this.painter.context,o=i.gl;if(t.length<=1)return void(this._overlapStencilType=!1);let a;if(r.isTileClipped())a=t.length,this._overlapStencilMode.test={func:o.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(t[0].overscaledZ>t[t.length-1].overscaledZ))return void(this._overlapStencilType=!1);a=1,this._overlapStencilMode.test={func:o.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+a>255&&(i.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=a,this._overlapStencilMode.ref=this._stencilRef,r.isTileClipped()&&this._renderTileClippingMasks(t,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(t){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[t.key]),this._overlapStencilMode):e.StencilMode.disabled}_renderTileClippingMasks(t,r){const n=this.painter,i=this.painter.context,o=i.gl;n._tileClippingMaskIDs={},i.setColorMode(e.ColorMode.disabled),i.setDepthMode(e.DepthMode.disabled);const a=n.useProgram("clippingMask");for(const s of t){const t=n._tileClippingMaskIDs[s.key]=--r;a.draw(i,o.TRIANGLES,e.DepthMode.disabled,new e.StencilMode({func:o.ALWAYS,mask:0},t,255,o.KEEP,o.KEEP,o.REPLACE),e.ColorMode.disabled,e.CullFaceMode.disabled,Tr(s.projMatrix),"$clipping",n.tileExtentBuffer,n.quadTriangleIndexBuffer,n.tileExtentSegments)}}pointCoordinate(t){const r=this.painter.transform;if(t.x<0||t.x>r.width||t.y<0||t.y>r.height)return null;const n=[t.x,t.y,1,1];e.transformMat4$1(n,n,r.pixelMatrixInverse),e.scale$1(n,n,1/n[3]),n[0]/=r.worldSize,n[1]/=r.worldSize;const i=r._camera.position,o=e.mercatorZfromAltitude(1,r.center.lat),a=[i[0],i[1],i[2]/o,0],s=e.subtract([],n.slice(0,3),a);e.normalize(s,s);const l=this.raycast(a,s,this._exaggeration);return null!==l&&l?(e.scaleAndAdd(a,a,s,l),a[3]=a[2],a[2]*=o,a):null}drawDepth(){const t=this.painter,r=t.context,n=this.proxySourceCache,i=Math.ceil(t.width),o=Math.ceil(t.height);if(!this._depthFBO||this._depthFBO.width===i&&this._depthFBO.height===o||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const t=r.gl,n=r.createFramebuffer(i,o,!0);r.activeTexture.set(t.TEXTURE0);const a=new e.Texture(r,{width:i,height:o,data:null},t.RGBA);a.bind(t.NEAREST,t.CLAMP_TO_EDGE),n.colorAttachment.set(a.texture);const s=r.createRenderbuffer(r.gl.DEPTH_COMPONENT16,i,o);n.depthAttachment.set(s),this._depthFBO=n,this._depthTexture=a}r.bindFramebuffer.set(this._depthFBO.framebuffer),r.viewport.set([0,0,i,o]),function(t,r,n,i){if("globe"===t.transform.projection.name)return;const o=t.context,a=o.gl;o.clear({depth:1});const s=t.useProgram("terrainDepth"),l=new e.DepthMode(a.LESS,e.DepthMode.ReadWrite,t.depthRangeFor3D);for(const t of i){const i=n.getTile(t),c=_r(t.projMatrix,0);r.setupElevationDraw(i,s),s.draw(o,a.TRIANGLES,l,e.StencilMode.disabled,e.ColorMode.unblended,e.CullFaceMode.backCCW,c,"terrain_depth",r.gridBuffer,r.gridIndexBuffer,r.gridNoSkirtSegments)}}(t,this,n,this.proxyCoords)}_setupProxiedCoordsForOrtho(e,t,r){if(e.getSource()instanceof Ae)return this._setupProxiedCoordsForImageSource(e,t,r);this._findCoveringTileCache[e.id]=this._findCoveringTileCache[e.id]||{};const n=this.proxiedCoords[e.id]=[],i=this.proxyCoords;for(let t=0;t<i.length;t++){const o=i[t],a=this._findTileCoveringTileID(o,e);if(a){const t=this._createProxiedId(o,a,r[o.key]&&r[o.key][e.id]);n.push(t),this.proxyToSource[o.key][e.id]=[t]}}let o=!1;for(let i=0;i<t.length;i++){const a=e.getTile(t[i]);if(!a||!a.hasData())continue;const s=this._findTileCoveringTileID(a.tileID,this.proxySourceCache);if(s&&s.tileID.canonical.z!==a.tileID.canonical.z){const t=this.proxyToSource[s.tileID.key][e.id],i=this._createProxiedId(s.tileID,a,r[s.tileID.key]&&r[s.tileID.key][e.id]);t?t.splice(t.length-1,0,i):this.proxyToSource[s.tileID.key][e.id]=[i],n.push(i),o=!0}}this._sourceTilesOverlap[e.id]=o}_setupProxiedCoordsForImageSource(t,r,n){if(!t.getSource().loaded())return;const i=this.proxiedCoords[t.id]=[],o=this.proxyCoords,a=t.getSource(),s=new e.Point(a.tileID.x,a.tileID.y)._div(1<<a.tileID.z),l=a.coordinates.map(e.MercatorCoordinate.fromLngLat).reduce(((e,t)=>(e.min.x=Math.min(e.min.x,t.x-s.x),e.min.y=Math.min(e.min.y,t.y-s.y),e.max.x=Math.max(e.max.x,t.x-s.x),e.max.y=Math.max(e.max.y,t.y-s.y),e)),{min:new e.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new e.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),c=(t,r)=>{const n=t.wrap+t.canonical.x/(1<<t.canonical.z),i=t.canonical.y/(1<<t.canonical.z),o=e.EXTENT/(1<<t.canonical.z),a=r.wrap+r.canonical.x/(1<<r.canonical.z),s=r.canonical.y/(1<<r.canonical.z);return n+o<a+l.min.x||n>a+l.max.x||i+o<s+l.min.y||i>s+l.max.y};for(let e=0;e<o.length;e++){const a=o[e];for(let e=0;e<r.length;e++){const o=t.getTile(r[e]);if(!o||!o.hasData())continue;if(c(a,o.tileID))continue;const s=this._createProxiedId(a,o,n[a.key]&&n[a.key][t.id]),l=this.proxyToSource[a.key][t.id];l?l.push(s):this.proxyToSource[a.key][t.id]=[s],i.push(s)}}}_createProxiedId(t,r,n){let i=this.orthoMatrix;if(n){const e=n.find((e=>e.key===r.tileID.key));if(e)return e}if(r.tileID.key!==t.key){const n=t.canonical.z-r.tileID.canonical.z;let o,a,s;i=e.create();const l=r.tileID.wrap-t.wrap<<t.overscaledZ;n>0?(o=e.EXTENT>>n,a=o*((r.tileID.canonical.x<<n)-t.canonical.x+l),s=o*((r.tileID.canonical.y<<n)-t.canonical.y)):(o=e.EXTENT<<-n,a=e.EXTENT*(r.tileID.canonical.x-(t.canonical.x+l<<-n)),s=e.EXTENT*(r.tileID.canonical.y-(t.canonical.y<<-n))),e.ortho(i,0,o,0,o,0,1),e.translate(i,i,[a,s,0])}return new Mr(r.tileID,t.key,i)}_findTileCoveringTileID(t,r){let n=r.getTile(t);if(n&&n.hasData())return n;const i=this._findCoveringTileCache[r.id],o=i[t.key];if(n=o?r.getTileByID(o):null,n&&n.hasData()||null===o)return n;let a=n?n.tileID:t,s=a.overscaledZ;const l=r.getSource().minzoom,c=[];if(!o){const i=r.getSource().maxzoom;if(t.canonical.z>=i){const n=t.canonical.z-i;r.getSource().reparseOverscaled?(s=Math.max(t.canonical.z+2,r.transform.tileZoom),a=new e.OverscaledTileID(s,t.wrap,i,t.canonical.x>>n,t.canonical.y>>n)):0!==n&&(s=i,a=new e.OverscaledTileID(s,t.wrap,i,t.canonical.x>>n,t.canonical.y>>n))}a.key!==t.key&&(c.push(a.key),n=r.getTile(a))}const u=e=>{c.forEach((t=>{i[t]=e})),c.length=0};for(s-=1;s>=l&&(!n||!n.hasData());s--){n&&u(n.tileID.key);const e=a.calculateScaledKey(s);if(n=r.getTileByID(e),n&&n.hasData())break;const t=i[e];if(null===t)break;void 0===t?c.push(e):n=r.getTileByID(t)}return u(n?n.tileID.key:null),n&&n.hasData()?n:null}findDEMTileFor(e){return this.enabled?this._findTileCoveringTileID(e,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(e,t){let r=this._tilesDirty[e];r||(r=this._tilesDirty[e]={}),r[t.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const t=function(t){let r=0;const n=new e.StructArrayLayout2ui4,i=131;for(let e=1;e<129;e++){for(let t=1;t<129;t++)r=e*i+t,n.emplaceBack(r,r+1),n.emplaceBack(r,r+i),n.emplaceBack(r+1,r+i),128===e&&n.emplaceBack(r+i,r+i+1);n.emplaceBack(r+1,r+1+i)}return n}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(t),this.wireframeSegments=e.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,t.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class Or{static cacheKey(e,t,r,n){let i=`${t}${n?n.cacheKey:""}`;for(const t of r)e.usedDefines.includes(t)&&(i+=`/${t}`);return i}constructor(t,r,n,i,o,a){const s=t.gl;this.program=s.createProgram();const l=function(e){const t=[];for(let r=0;r<e.length;r++){if(null===e[r])continue;const n=e[r].split(" ");t.push(n.pop())}return t}(n.staticAttributes),c=i?i.getBinderAttributes():[],u=l.concat(c);let p=i?i.defines():[];p=p.concat(a.map((e=>`#define ${e}`)));const h=t.isWebGL2?"#version 300 es\n":"",d=h+p.concat(t.extStandardDerivatives&&0===h.length?"#extension GL_OES_standard_derivatives : enable\n".concat(lr):lr,lr,sr,ar.fragmentSource,ir.fragmentSource,n.fragmentSource).join("\n"),f=h+p.concat("\n#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif",sr,ar.vertexSource,ir.vertexSource,nr.vertexSource,n.vertexSource).join("\n"),m=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);s.shaderSource(m,d),s.compileShader(m),s.attachShader(this.program,m);const g=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())this.failedToCreate=!0;else{s.shaderSource(g,f),s.compileShader(g),s.attachShader(this.program,g),this.attributes={},this.numAttributes=u.length;for(let e=0;e<this.numAttributes;e++)u[e]&&(s.bindAttribLocation(this.program,e,u[e]),this.attributes[u[e]]=e);s.linkProgram(this.program),s.deleteShader(g),s.deleteShader(m),this.fixedUniforms=o(t),this.binderUniforms=i?i.getUniforms(t):[],a.includes("TERRAIN")&&(this.terrainUniforms=(t=>({u_dem:new e.Uniform1i(t),u_dem_prev:new e.Uniform1i(t),u_dem_unpack:new e.Uniform4f(t),u_dem_tl:new e.Uniform2f(t),u_dem_scale:new e.Uniform1f(t),u_dem_tl_prev:new e.Uniform2f(t),u_dem_scale_prev:new e.Uniform1f(t),u_dem_size:new e.Uniform1f(t),u_dem_lerp:new e.Uniform1f(t),u_exaggeration:new e.Uniform1f(t),u_depth:new e.Uniform1i(t),u_depth_size_inv:new e.Uniform2f(t),u_meter_to_dem:new e.Uniform1f(t),u_label_plane_matrix_inv:new e.UniformMatrix4f(t)}))(t)),a.includes("GLOBE")&&(this.globeUniforms=(t=>({u_tile_tl_up:new e.Uniform3f(t),u_tile_tr_up:new e.Uniform3f(t),u_tile_br_up:new e.Uniform3f(t),u_tile_bl_up:new e.Uniform3f(t),u_tile_up_scale:new e.Uniform1f(t)}))(t)),a.includes("FOG")&&(this.fogUniforms=(t=>({u_fog_matrix:new e.UniformMatrix4f(t),u_fog_range:new e.Uniform2f(t),u_fog_color:new e.Uniform4f(t),u_fog_horizon_blend:new e.Uniform1f(t),u_fog_temporal_offset:new e.Uniform1f(t),u_frustum_tl:new e.Uniform3f(t),u_frustum_tr:new e.Uniform3f(t),u_frustum_br:new e.Uniform3f(t),u_frustum_bl:new e.Uniform3f(t),u_globe_pos:new e.Uniform3f(t),u_globe_radius:new e.Uniform1f(t),u_globe_transition:new e.Uniform1f(t),u_is_globe:new e.Uniform1i(t),u_viewport:new e.Uniform2f(t)}))(t))}}setTerrainUniformValues(e,t){if(!this.terrainUniforms)return;const r=this.terrainUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)r[e]&&r[e].set(this.program,e,t[e])}}setGlobeUniformValues(e,t){if(!this.globeUniforms)return;const r=this.globeUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)r[e]&&r[e].set(this.program,e,t[e])}}setFogUniformValues(e,t){if(!this.fogUniforms)return;const r=this.fogUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)r[e].set(this.program,e,t[e])}}draw(e,t,r,n,i,o,a,s,l,c,u,p,h,d,f){const m=e.gl;if(this.failedToCreate)return;e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(n),e.setColorMode(i),e.setCullFace(o);for(const e of Object.keys(this.fixedUniforms))this.fixedUniforms[e].set(this.program,e,a[e]);d&&d.setUniforms(this.program,e,this.binderUniforms,p,{zoom:h});const g={[m.LINES]:2,[m.TRIANGLES]:3,[m.LINE_STRIP]:1}[t];for(const r of u.get()){const n=r.vaos||(r.vaos={});(n[s]||(n[s]=new hr)).bind(e,this,l,d?d.getPaintVertexBuffers():[],c,r.vertexOffset,f||[]),m.drawElements(t,r.primitiveLength*g,m.UNSIGNED_SHORT,r.primitiveOffset*g*2)}}}function Lr(e,t){const r=Math.pow(2,t.tileID.overscaledZ),n=t.tileSize*Math.pow(2,e.transform.tileZoom)/r,i=n*(t.tileID.canonical.x+t.tileID.wrap*r),o=n*t.tileID.canonical.y;return{u_image:0,u_texsize:t.imageAtlasTexture.size,u_tile_units_to_pixels:1/I(t,1,e.transform.tileZoom),u_pixel_coord_upper:[i>>16,o>>16],u_pixel_coord_lower:[65535&i,65535&o]}}const zr=e.create(),Dr=(t,r,n,i,o,a,s,l,c,u,p)=>{const h=r.style.light,d=h.properties.get("position"),f=[d.x,d.y,d.z],m=e.create$1();"viewport"===h.properties.get("anchor")&&(e.fromRotation(m,-r.transform.angle),e.transformMat3(f,f,m));const g=h.properties.get("color"),b=r.transform,_={u_matrix:t,u_lightpos:f,u_lightintensity:h.properties.get("intensity"),u_lightcolor:[g.r,g.g,g.b],u_vertical_gradient:+n,u_opacity:i,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:zr,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:o,u_edge_radius:a};return"globe"===b.projection.name&&(_.u_tile_id=[s.canonical.x,s.canonical.y,1<<s.canonical.z],_.u_zoom_transition=c,_.u_inv_rot_matrix=p,_.u_merc_center=u,_.u_up_dir=b.projection.upVector(new e.CanonicalTileID(0,0,0),u[0]*e.EXTENT,u[1]*e.EXTENT),_.u_height_lift=l),_},Pr=(t,r,n,i,o,a,s,l,c,u,p,h)=>{const d=Dr(t,r,n,i,o,a,s,c,u,p,h),f={u_height_factor:-Math.pow(2,s.overscaledZ)/l.tileSize/8};return e.extend(d,Lr(r,l),f)},Rr=e=>({u_matrix:e}),Br=(t,r,n)=>e.extend(Rr(t),Lr(r,n)),Fr=(e,t)=>({u_matrix:e,u_world:t}),jr=(t,r,n,i)=>e.extend(Br(t,r,n),{u_world:i}),Nr=e.create(),Ur=(t,r,n,i,o,a)=>{const s=t.transform,l="globe"===s.projection.name;let c;if("map"===a.paint.get("circle-pitch-alignment"))if(l){const t=e.globePixelsToTileUnits(s.zoom,r.canonical)*s._pixelsPerMercatorPixel;c=Float32Array.from([t,0,0,t])}else c=s.calculatePixelsToTileUnitsMatrix(n);else c=new Float32Array([s.pixelsToGLUnits[0],0,0,s.pixelsToGLUnits[1]]);const u={u_camera_to_center_distance:s.cameraToCenterDistance,u_matrix:t.translatePosMatrix(r.projMatrix,n,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_device_pixel_ratio:e.exported.devicePixelRatio,u_extrude_scale:c,u_inv_rot_matrix:Nr,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(l){u.u_inv_rot_matrix=i,u.u_merc_center=o,u.u_tile_id=[r.canonical.x,r.canonical.y,1<<r.canonical.z],u.u_zoom_transition=e.globeToMercatorTransition(s.zoom);const t=o[0]*e.EXTENT,n=o[1]*e.EXTENT;u.u_up_dir=s.projection.upVector(new e.CanonicalTileID(0,0,0),t,n)}return u},Vr=e=>{const t=[];return"map"===e.paint.get("circle-pitch-alignment")&&t.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&t.push("SCALE_WITH_MAP"),t},qr=(t,r,n,i)=>{const o=e.EXTENT/n.tileSize;return{u_matrix:t,u_camera_to_center_distance:r.getCameraToCenterDistance(i),u_extrude_scale:[r.pixelsToGLUnits[0]/o,r.pixelsToGLUnits[1]/o]}},$r=(e,t,r=1)=>({u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:r}),Gr=e.create(),Wr=(t,r,n,i,o,a,s)=>{const l=t.transform,c="globe"===l.projection.name,u=c?e.globePixelsToTileUnits(l.zoom,r.canonical)*l._pixelsPerMercatorPixel:I(n,1,a),p={u_matrix:r.projMatrix,u_extrude_scale:u,u_intensity:s,u_inv_rot_matrix:Gr,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(c){p.u_inv_rot_matrix=i,p.u_merc_center=o,p.u_tile_id=[r.canonical.x,r.canonical.y,1<<r.canonical.z],p.u_zoom_transition=e.globeToMercatorTransition(l.zoom);const t=o[0]*e.EXTENT,n=o[1]*e.EXTENT;p.u_up_dir=l.projection.upVector(new e.CanonicalTileID(0,0,0),t,n)}return p},Hr=(e,t,r,n,i,o,a)=>{const s=e.transform,l=s.calculatePixelsToTileUnitsMatrix(t);return{u_matrix:Kr(e,t,r,n),u_pixels_to_tile_units:l,u_device_pixel_ratio:o,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:i,u_texsize:Yr(r)?t.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Xr(t,e.transform),u_alpha_discard_threshold:0,u_trim_offset:a}},Zr=(e,t,r,n,i)=>{const o=e.transform;return{u_matrix:Kr(e,t,r,n),u_texsize:t.imageAtlasTexture.size,u_pixels_to_tile_units:o.calculatePixelsToTileUnitsMatrix(t),u_device_pixel_ratio:i,u_image:0,u_tile_units_to_pixels:Xr(t,o),u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function Xr(e,t){return 1/I(e,1,t.tileZoom)}function Kr(e,t,r,n){return e.translatePosMatrix(n||t.tileID.projMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}function Yr(e){const t=e.paint.get("line-dasharray").value;return t.value||"constant"!==t.kind}const Jr=(e,t,r,n,i,o)=>{return{u_matrix:e,u_tl_parent:t,u_scale_parent:r,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(s=i.paint.get("raster-saturation"),s>0?1-1/(1.001-s):-s),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Qr(i.paint.get("raster-hue-rotate")),u_perspective_transform:o};var a,s};function Qr(e){e*=Math.PI/180;const t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}const en=e.create(),tn=(t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g)=>{const b=o.transform,_={u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:r?r.uSizeT:0,u_size:r?r.uSize:0,u_camera_to_center_distance:b.cameraToCenterDistance,u_rotate_symbol:+n,u_aspect_ratio:b.width/b.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:s,u_coord_matrix:l,u_is_text:+c,u_pitch_with_map:+i,u_texsize:u,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:en,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:en,u_up_vector:[0,-1,0]};return"globe"===g.name&&(_.u_tile_id=[p.canonical.x,p.canonical.y,1<<p.canonical.z],_.u_zoom_transition=h,_.u_inv_rot_matrix=f,_.u_merc_center=d,_.u_camera_forward=b._camera.forward(),_.u_ecef_origin=e.globeECEFOrigin(b.globeMatrix,p.toUnwrapped()),_.u_tile_matrix=Float32Array.from(b.globeMatrix),_.u_up_vector=m),_},rn=(t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g,b)=>e.extend(tn(t,r,n,i,o,a,s,l,c,u,h,d,f,m,g,b),{u_gamma_scale:i?o.transform.cameraToCenterDistance*Math.cos(o.terrain?0:o.transform._pitch):1,u_device_pixel_ratio:e.exported.devicePixelRatio,u_is_halo:+p}),nn=(t,r,n,i,o,a,s,l,c,u,p,h,d,f,m,g)=>e.extend(rn(t,r,n,i,o,a,s,l,!0,c,!0,p,h,d,f,m,g),{u_texsize_icon:u,u_texture_icon:1}),on=(e,t,r)=>({u_matrix:e,u_opacity:t,u_color:r}),an=(t,r,n,i,o)=>e.extend(function(e,t,r){const n=t.imageManager.getPattern(e.toString()),{width:i,height:o}=t.imageManager.getPixelSize(),a=Math.pow(2,r.tileID.overscaledZ),s=r.tileSize*Math.pow(2,t.transform.tileZoom)/a,l=s*(r.tileID.canonical.x+r.tileID.wrap*a),c=s*r.tileID.canonical.y;return{u_image:0,u_pattern_tl:n.tl,u_pattern_br:n.br,u_texsize:[i,o],u_pattern_size:n.displaySize,u_tile_units_to_pixels:1/I(r,1,t.transform.tileZoom),u_pixel_coord_upper:[l>>16,c>>16],u_pixel_coord_lower:[65535&l,65535&c]}}(i,n,o),{u_matrix:t,u_opacity:r}),sn={fillExtrusion:t=>({u_matrix:new e.UniformMatrix4f(t),u_lightpos:new e.Uniform3f(t),u_lightintensity:new e.Uniform1f(t),u_lightcolor:new e.Uniform3f(t),u_vertical_gradient:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t),u_edge_radius:new e.Uniform1f(t),u_ao:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_up_dir:new e.Uniform3f(t),u_height_lift:new e.Uniform1f(t)}),fillExtrusionPattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_lightpos:new e.Uniform3f(t),u_lightintensity:new e.Uniform1f(t),u_lightcolor:new e.Uniform3f(t),u_vertical_gradient:new e.Uniform1f(t),u_height_factor:new e.Uniform1f(t),u_edge_radius:new e.Uniform1f(t),u_ao:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_up_dir:new e.Uniform3f(t),u_height_lift:new e.Uniform1f(t),u_image:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t)}),fill:t=>({u_matrix:new e.UniformMatrix4f(t)}),fillPattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_image:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t)}),fillOutline:t=>({u_matrix:new e.UniformMatrix4f(t),u_world:new e.Uniform2f(t)}),fillOutlinePattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_world:new e.Uniform2f(t),u_image:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t)}),circle:t=>({u_camera_to_center_distance:new e.Uniform1f(t),u_extrude_scale:new e.UniformMatrix2f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_up_dir:new e.Uniform3f(t)}),collisionBox:t=>({u_matrix:new e.UniformMatrix4f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_extrude_scale:new e.Uniform2f(t)}),collisionCircle:t=>({u_matrix:new e.UniformMatrix4f(t),u_inv_matrix:new e.UniformMatrix4f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_viewport_size:new e.Uniform2f(t)}),debug:t=>({u_color:new e.UniformColor(t),u_matrix:new e.UniformMatrix4f(t),u_overlay:new e.Uniform1i(t),u_overlay_scale:new e.Uniform1f(t)}),clippingMask:t=>({u_matrix:new e.UniformMatrix4f(t)}),heatmap:t=>({u_extrude_scale:new e.Uniform1f(t),u_intensity:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_up_dir:new e.Uniform3f(t)}),heatmapTexture:t=>({u_image:new e.Uniform1i(t),u_color_ramp:new e.Uniform1i(t),u_opacity:new e.Uniform1f(t)}),hillshade:t=>({u_matrix:new e.UniformMatrix4f(t),u_image:new e.Uniform1i(t),u_latrange:new e.Uniform2f(t),u_light:new e.Uniform2f(t),u_shadow:new e.UniformColor(t),u_highlight:new e.UniformColor(t),u_accent:new e.UniformColor(t)}),hillshadePrepare:t=>({u_matrix:new e.UniformMatrix4f(t),u_image:new e.Uniform1i(t),u_dimension:new e.Uniform2f(t),u_zoom:new e.Uniform1f(t),u_unpack:new e.Uniform4f(t)}),line:t=>({u_matrix:new e.UniformMatrix4f(t),u_pixels_to_tile_units:new e.UniformMatrix2f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_units_to_pixels:new e.Uniform2f(t),u_dash_image:new e.Uniform1i(t),u_gradient_image:new e.Uniform1i(t),u_image_height:new e.Uniform1f(t),u_texsize:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t),u_alpha_discard_threshold:new e.Uniform1f(t),u_trim_offset:new e.Uniform2f(t)}),linePattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_texsize:new e.Uniform2f(t),u_pixels_to_tile_units:new e.UniformMatrix2f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_image:new e.Uniform1i(t),u_units_to_pixels:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t),u_alpha_discard_threshold:new e.Uniform1f(t)}),raster:t=>({u_matrix:new e.UniformMatrix4f(t),u_tl_parent:new e.Uniform2f(t),u_scale_parent:new e.Uniform1f(t),u_fade_t:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t),u_image0:new e.Uniform1i(t),u_image1:new e.Uniform1i(t),u_brightness_low:new e.Uniform1f(t),u_brightness_high:new e.Uniform1f(t),u_saturation_factor:new e.Uniform1f(t),u_contrast_factor:new e.Uniform1f(t),u_spin_weights:new e.Uniform3f(t),u_perspective_transform:new e.Uniform2f(t)}),symbolIcon:t=>({u_is_size_zoom_constant:new e.Uniform1i(t),u_is_size_feature_constant:new e.Uniform1i(t),u_size_t:new e.Uniform1f(t),u_size:new e.Uniform1f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_rotate_symbol:new e.Uniform1i(t),u_aspect_ratio:new e.Uniform1f(t),u_fade_change:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_label_plane_matrix:new e.UniformMatrix4f(t),u_coord_matrix:new e.UniformMatrix4f(t),u_is_text:new e.Uniform1i(t),u_pitch_with_map:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_camera_forward:new e.Uniform3f(t),u_tile_matrix:new e.UniformMatrix4f(t),u_up_vector:new e.Uniform3f(t),u_ecef_origin:new e.Uniform3f(t),u_texture:new e.Uniform1i(t)}),symbolSDF:t=>({u_is_size_zoom_constant:new e.Uniform1i(t),u_is_size_feature_constant:new e.Uniform1i(t),u_size_t:new e.Uniform1f(t),u_size:new e.Uniform1f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_rotate_symbol:new e.Uniform1i(t),u_aspect_ratio:new e.Uniform1f(t),u_fade_change:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_label_plane_matrix:new e.UniformMatrix4f(t),u_coord_matrix:new e.UniformMatrix4f(t),u_is_text:new e.Uniform1i(t),u_pitch_with_map:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_texture:new e.Uniform1i(t),u_gamma_scale:new e.Uniform1f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_camera_forward:new e.Uniform3f(t),u_tile_matrix:new e.UniformMatrix4f(t),u_up_vector:new e.Uniform3f(t),u_ecef_origin:new e.Uniform3f(t),u_is_halo:new e.Uniform1i(t)}),symbolTextAndIcon:t=>({u_is_size_zoom_constant:new e.Uniform1i(t),u_is_size_feature_constant:new e.Uniform1i(t),u_size_t:new e.Uniform1f(t),u_size:new e.Uniform1f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_rotate_symbol:new e.Uniform1i(t),u_aspect_ratio:new e.Uniform1f(t),u_fade_change:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_label_plane_matrix:new e.UniformMatrix4f(t),u_coord_matrix:new e.UniformMatrix4f(t),u_is_text:new e.Uniform1i(t),u_pitch_with_map:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_texsize_icon:new e.Uniform2f(t),u_texture:new e.Uniform1i(t),u_texture_icon:new e.Uniform1i(t),u_gamma_scale:new e.Uniform1f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_is_halo:new e.Uniform1i(t)}),background:t=>({u_matrix:new e.UniformMatrix4f(t),u_opacity:new e.Uniform1f(t),u_color:new e.UniformColor(t)}),backgroundPattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_opacity:new e.Uniform1f(t),u_image:new e.Uniform1i(t),u_pattern_tl:new e.Uniform2f(t),u_pattern_br:new e.Uniform2f(t),u_texsize:new e.Uniform2f(t),u_pattern_size:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t)}),terrainRaster:br,terrainDepth:br,skybox:t=>({u_matrix:new e.UniformMatrix4f(t),u_sun_direction:new e.Uniform3f(t),u_cubemap:new e.Uniform1i(t),u_opacity:new e.Uniform1f(t),u_temporal_offset:new e.Uniform1f(t)}),skyboxGradient:t=>({u_matrix:new e.UniformMatrix4f(t),u_color_ramp:new e.Uniform1i(t),u_center_direction:new e.Uniform3f(t),u_radius:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t),u_temporal_offset:new e.Uniform1f(t)}),skyboxCapture:t=>({u_matrix_3f:new e.UniformMatrix3f(t),u_sun_direction:new e.Uniform3f(t),u_sun_intensity:new e.Uniform1f(t),u_color_tint_r:new e.Uniform4f(t),u_color_tint_m:new e.Uniform4f(t),u_luminance:new e.Uniform1f(t)}),globeRaster:t=>({u_proj_matrix:new e.UniformMatrix4f(t),u_globe_matrix:new e.UniformMatrix4f(t),u_normalize_matrix:new e.UniformMatrix4f(t),u_merc_matrix:new e.UniformMatrix4f(t),u_zoom_transition:new e.Uniform1f(t),u_merc_center:new e.Uniform2f(t),u_image0:new e.Uniform1i(t),u_grid_matrix:new e.UniformMatrix3f(t),u_skirt_height:new e.Uniform1f(t),u_frustum_tl:new e.Uniform3f(t),u_frustum_tr:new e.Uniform3f(t),u_frustum_br:new e.Uniform3f(t),u_frustum_bl:new e.Uniform3f(t),u_globe_pos:new e.Uniform3f(t),u_globe_radius:new e.Uniform1f(t),u_viewport:new e.Uniform2f(t)}),globeAtmosphere:t=>({u_frustum_tl:new e.Uniform3f(t),u_frustum_tr:new e.Uniform3f(t),u_frustum_br:new e.Uniform3f(t),u_frustum_bl:new e.Uniform3f(t),u_horizon:new e.Uniform1f(t),u_transition:new e.Uniform1f(t),u_fadeout_range:new e.Uniform1f(t),u_color:new e.Uniform4f(t),u_high_color:new e.Uniform4f(t),u_space_color:new e.Uniform4f(t),u_star_intensity:new e.Uniform1f(t),u_star_density:new e.Uniform1f(t),u_star_size:new e.Uniform1f(t),u_temporal_offset:new e.Uniform1f(t),u_horizon_angle:new e.Uniform1f(t),u_rotation_matrix:new e.UniformMatrix4f(t)})};let ln;function cn(t,r,n,i,o,a,s){const l=t.context,c=l.gl,u=t.transform,p=t.useProgram("collisionBox"),h=[];let d=0,f=0;for(let m=0;m<i.length;m++){const g=i[m],b=r.getTile(g),_=b.getBucket(n);if(!_)continue;const y=_t(g,_,u);let v=y;0===o[0]&&0===o[1]||(v=t.translatePosMatrix(y,b,o,a));const x=s?_.textCollisionBox:_.iconCollisionBox,w=_.collisionCircleArray;if(w.length>0){const t=e.create(),r=v;e.mul(t,_.placementInvProjMatrix,u.glCoordMatrix),e.mul(t,t,_.placementViewportMatrix),h.push({circleArray:w,circleOffset:f,transform:r,invTransform:t,projection:_.getProjection()}),d+=w.length/4,f=d}x&&(t.terrain&&t.terrain.setupElevationDraw(b,p),p.draw(l,c.LINES,e.DepthMode.disabled,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.disabled,qr(v,u,b,_.getProjection()),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,u.zoom,null,[x.collisionVertexBuffer,x.collisionVertexBufferExt]))}if(!s||!h.length)return;const m=t.useProgram("collisionCircle"),g=new e.StructArrayLayout2f1f2i16;g.resize(4*d),g._trim();let b=0;for(const e of h)for(let t=0;t<e.circleArray.length/4;t++){const r=4*t,n=e.circleArray[r+0],i=e.circleArray[r+1],o=e.circleArray[r+2],a=e.circleArray[r+3];g.emplace(b++,n,i,o,a,0),g.emplace(b++,n,i,o,a,1),g.emplace(b++,n,i,o,a,2),g.emplace(b++,n,i,o,a,3)}(!ln||ln.length<2*d)&&(ln=function(t){const r=2*t,n=new e.StructArrayLayout3ui6;n.resize(r),n._trim();for(let e=0;e<r;e++){const t=6*e;n.uint16[t+0]=4*e+0,n.uint16[t+1]=4*e+1,n.uint16[t+2]=4*e+2,n.uint16[t+3]=4*e+2,n.uint16[t+4]=4*e+3,n.uint16[t+5]=4*e+0}return n}(d));const _=l.createIndexBuffer(ln,!0),y=l.createVertexBuffer(g,e.collisionCircleLayout.members,!0);for(const r of h){const i={u_matrix:r.transform,u_inv_matrix:r.invTransform,u_camera_to_center_distance:(v=u).getCameraToCenterDistance(r.projection),u_viewport_size:[v.width,v.height]};m.draw(l,c.TRIANGLES,e.DepthMode.disabled,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.disabled,i,n.id,y,_,e.SegmentVector.simpleSegment(0,2*r.circleOffset,r.circleArray.length,r.circleArray.length/2),null,u.zoom)}var v;y.destroy(),_.destroy()}const un=e.create();function pn({width:t,height:r,anchor:n,textOffset:i,textScale:o},a){const{horizontalAlign:s,verticalAlign:l}=e.getAnchorAlignment(n),c=-(s-.5)*t,u=-(l-.5)*r,p=e.evaluateVariableOffset(n,i);return new e.Point((c/o+p[0])*a,(u/o+p[1])*a)}function hn(t,r,n,i,o,a,s,l,c,u,p){const h=t.text.placedSymbolArray,d=t.text.dynamicLayoutVertexArray,f=t.icon.dynamicLayoutVertexArray,m={},g=t.getProjection(),b=yt(l,g,a),_=a.elevation,y=g.upVectorScale(l.canonical,a.center.lat,a.worldSize).metersToTile;d.clear();for(let f=0;f<h.length;f++){const v=h.get(f),{tileAnchorX:x,tileAnchorY:w,numGlyphs:k}=v,E=v.hidden||!v.crossTileID||t.allowVerticalPlacement&&!v.placedOrientation?null:i[v.crossTileID];if(E){let i=0,h=0,f=0;if(_){const e=_?_.getAtTileOffset(l,x,w):0,[t,r,n]=g.upVector(l.canonical,x,w);i=e*t*y,h=e*r*y,f=e*n*y}let[T,S,C,A]=nt(v.projectedAnchorX+i,v.projectedAnchorY+h,v.projectedAnchorZ+f,n?b:s);const M=it(a.getCameraToCenterDistance(g),A);let I=o.evaluateSizeForFeature(t.textSizeData,u,v)*M/e.ONE_EM;n&&(I*=t.tilePixelRatio/c);const O=pn(E,I);n?(({x:T,y:S,z:C}=g.projectTilePoint(x+O.x,w+O.y,l.canonical)),[T,S,C]=nt(T+i,S+h,C+f,s)):(r&&O._rotate(-a.angle),T+=O.x,S+=O.y,C=0);const L=t.allowVerticalPlacement&&v.placedOrientation===e.WritingMode.vertical?Math.PI/2:0;for(let t=0;t<k;t++)e.addDynamicAttributes(d,T,S,C,L);p&&v.associatedIconIndex>=0&&(m[v.associatedIconIndex]={x:T,y:S,z:C,angle:L})}else dt(k,d)}if(p){f.clear();const r=t.icon.placedSymbolArray;for(let t=0;t<r.length;t++){const n=r.get(t),{numGlyphs:i}=n,o=m[t];if(n.hidden||!o)dt(i,f);else{const{x:t,y:r,z:n,angle:a}=o;for(let o=0;o<i;o++)e.addDynamicAttributes(f,t,r,n,a)}}t.icon.dynamicLayoutVertexBuffer.updateData(f)}t.text.dynamicLayoutVertexBuffer.updateData(d)}function dn(e,t,r){return r.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function fn(t,r,n,i,o,a,s,l,c,u,p,h){const d=t.context,f=d.gl,m=t.transform,g="map"===l,b="map"===c,_=g&&"point"!==n.layout.get("symbol-placement"),y=g&&!b&&!_,v=void 0!==n.layout.get("symbol-sort-key").constantOr(1);let x=!1;const w=t.depthModeForSublayer(0,e.DepthMode.ReadOnly),k=[e.mercatorXfromLng(m.center.lng),e.mercatorYfromLat(m.center.lat)],E=n.layout.get("text-variable-anchor"),T="globe"===m.projection.name,S=[],C=[0,-1,0];let A=C;!T&&!m.mercatorFromTransition||g||(A=function(t){const r=t._camera.getWorldToCamera(t.worldSize,1),n=e.multiply([],r,t.globeMatrix);e.invert(n,n);const i=[0,0,0],o=[0,1,0,0];return e.transformMat4$1(o,o,n),i[0]=o[0],i[1]=o[1],i[2]=o[2],e.normalize(i,i),i}(m));for(const l of i){const i=r.getTile(l),c=i.getBucket(n);if(!c)continue;if("mercator"===c.projection.name&&T)continue;const p=o?c.text:c.icon;if(!p||c.fullyClipped||!p.segments.get().length)continue;const h=p.programConfigurations.get(n.id),d=o||c.sdfIcons,w=o?c.textSizeData:c.iconSizeData,M=b||0!==m.pitch,I=e.evaluateSizeForZoom(w,m.zoom);let O,L,z,D,P=[0,0],R=null;if(o)L=i.glyphAtlasTexture,z=f.LINEAR,O=i.glyphAtlasTexture.size,c.iconsInText&&(P=i.imageAtlasTexture.size,R=i.imageAtlasTexture,D=M||t.options.rotating||t.options.zooming||"composite"===w.kind||"camera"===w.kind?f.LINEAR:f.NEAREST);else{const e=1!==n.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;L=i.imageAtlasTexture,z=d||t.options.rotating||t.options.zooming||e||M?f.LINEAR:f.NEAREST,O=i.imageAtlasTexture.size}const B="globe"===c.projection.name,F=B?A:C,j=B?e.globeToMercatorTransition(m.zoom):0,N=yt(l,c.getProjection(),m),U=m.calculatePixelsToTileUnitsMatrix(i),V=et(N,i.tileID.canonical,b,g,m,c.getProjection(),U),q=t.terrain&&b&&_?e.invert(e.create(),V):un,$=rt(N,i.tileID.canonical,b,g,m,c.getProjection(),U),G=E&&c.hasTextData(),W="none"!==n.layout.get("icon-text-fit")&&G&&c.hasIconData();if(_){const e=m.elevation,r=e?e.getAtTileOffsetFunc(l,m.center.lat,m.worldSize,c.getProjection()):null,n=tt(N,i.tileID.canonical,b,g,m,c.getProjection(),U);at(c,N,t,o,n,$,b,u,r,l)}const H=_||o&&E||W,Z=t.translatePosMatrix(N,i,a,s),X=H?un:V,K=t.translatePosMatrix($,i,a,s,!0),Y=c.getProjection().createInversionMatrix(m,l.canonical),J=[];t.terrainRenderModeElevated()&&b&&J.push("PITCH_WITH_MAP_TERRAIN"),B&&J.push("PROJECTION_GLOBE_VIEW"),H&&J.push("PROJECTED_POS_ON_VIEWPORT");const Q=d&&0!==n.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1);let ee;ee=d?c.iconsInText?nn(w.kind,I,y,b,t,Z,X,K,O,P,l,j,k,Y,F,c.getProjection()):rn(w.kind,I,y,b,t,Z,X,K,o,O,!0,l,j,k,Y,F,c.getProjection()):tn(w.kind,I,y,b,t,Z,X,K,o,O,l,j,k,Y,F,c.getProjection());const te={program:t.useProgram(dn(d,o,c),h,J),buffers:p,uniformValues:ee,atlasTexture:L,atlasTextureIcon:R,atlasInterpolation:z,atlasInterpolationIcon:D,isSDF:d,hasHalo:Q,tile:i,labelPlaneMatrixInv:q};if(v&&c.canOverlap){x=!0;const t=p.segments.get();for(const r of t)S.push({segments:new e.SegmentVector([r]),sortKey:r.sortKey,state:te})}else S.push({segments:p.segments,sortKey:0,state:te})}x&&S.sort(((e,t)=>e.sortKey-t.sortKey));for(const e of S){const r=e.state;if(t.terrain&&t.terrain.setupElevationDraw(r.tile,r.program,{useDepthForOcclusion:!T,labelPlaneMatrixInv:r.labelPlaneMatrixInv}),d.activeTexture.set(f.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,f.CLAMP_TO_EDGE),r.atlasTextureIcon&&(d.activeTexture.set(f.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),r.isSDF){const i=r.uniformValues;r.hasHalo&&(i.u_is_halo=1,mn(r.buffers,e.segments,n,t,r.program,w,p,h,i)),i.u_is_halo=0}mn(r.buffers,e.segments,n,t,r.program,w,p,h,r.uniformValues)}}function mn(t,r,n,i,o,a,s,l,c){const u=i.context,p=[t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer,t.globeExtVertexBuffer];o.draw(u,u.gl.TRIANGLES,a,s,l,e.CullFaceMode.disabled,c,n.id,t.layoutVertexBuffer,t.indexBuffer,r,n.paint,i.transform.zoom,t.programConfigurations.get(n.id),p)}function gn(t,r,n,i,o,a,s){const l=t.context.gl,c=n.paint.get("fill-pattern"),u=c&&c.constantOr(1);let p,h,d,f,m;s?(h=u&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",p=l.LINES):(h=u?"fillPattern":"fill",p=l.TRIANGLES);for(const g of i){const i=r.getTile(g);if(u&&!i.patternsLoaded())continue;const b=i.getBucket(n);if(!b)continue;t.prepareDrawTile();const _=b.programConfigurations.get(n.id),y=t.useProgram(h,_);u&&(t.context.activeTexture.set(l.TEXTURE0),i.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),_.updatePaintBuffers());const v=c.constantOr(null);if(v&&i.imageAtlas){const e=i.imageAtlas.patternPositions[v.toString()];e&&_.setConstantPatternPositions(e)}const x=t.translatePosMatrix(g.projMatrix,i,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(s){f=b.indexBuffer2,m=b.segments2;const e=t.terrain&&t.terrain.renderingToTexture?t.terrain.drapeBufferSize:[l.drawingBufferWidth,l.drawingBufferHeight];d="fillOutlinePattern"===h&&u?jr(x,t,i,e):Fr(x,e)}else f=b.indexBuffer,m=b.segments,d=u?Br(x,t,i):Rr(x);t.prepareDrawProgram(t.context,y,g.toUnwrapped()),y.draw(t.context,p,o,t.stencilModeForClipping(g),a,e.CullFaceMode.disabled,d,n.id,b.layoutVertexBuffer,f,m,n.paint,t.transform.zoom,_)}}function bn(t,r,n,i,o,a,s){const l=t.context,c=l.gl,u=t.transform,p=n.paint.get("fill-extrusion-pattern"),h=p.constantOr(1),d=n.paint.get("fill-extrusion-opacity"),f=[n.paint.get("fill-extrusion-ambient-occlusion-intensity"),n.paint.get("fill-extrusion-ambient-occlusion-radius")],m=n.layout.get("fill-extrusion-edge-radius"),g=m>0&&!n.paint.get("fill-extrusion-rounded-roof"),b=g?0:m,_="globe"===u.projection.name?e.fillExtrusionHeightLift():0,y="globe"===u.projection.name,v=y?e.globeToMercatorTransition(u.zoom):0,x=[e.mercatorXfromLng(u.center.lng),e.mercatorYfromLat(u.center.lat)],w=[];y&&w.push("PROJECTION_GLOBE_VIEW"),f[0]>0&&w.push("FAUX_AO"),g&&w.push("ZERO_ROOF_RADIUS");for(const m of i){const i=r.getTile(m),g=i.getBucket(n);if(!g||g.projection.name!==u.projection.name)continue;const k=g.programConfigurations.get(n.id),E=t.useProgram(h?"fillExtrusionPattern":"fillExtrusion",k,w);if(t.terrain){const e=t.terrain;if(t.style.terrainSetForDrapingOnly())e.setupElevationDraw(i,E,{useMeterToDem:!0});else{if(!g.enableTerrain)continue;if(e.setupElevationDraw(i,E,{useMeterToDem:!0}),_n(l,r,m,g,n,e),!g.centroidVertexBuffer){const e=E.attributes.a_centroid_pos;void 0!==e&&c.vertexAttrib2f(e,0,0)}}}h&&(t.context.activeTexture.set(c.TEXTURE0),i.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),k.updatePaintBuffers());const T=p.constantOr(null);if(T&&i.imageAtlas){const e=i.imageAtlas.patternPositions[T.toString()];e&&k.setConstantPatternPositions(e)}const S=t.translatePosMatrix(m.projMatrix,i,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),C=u.projection.createInversionMatrix(u,m.canonical),A=n.paint.get("fill-extrusion-vertical-gradient"),M=h?Pr(S,t,A,d,f,b,m,i,_,v,x,C):Dr(S,t,A,d,f,b,m,_,v,x,C);t.prepareDrawProgram(l,E,m.toUnwrapped());const I=[];t.terrain&&I.push(g.centroidVertexBuffer),y&&I.push(g.layoutVertexExtBuffer),E.draw(l,l.gl.TRIANGLES,o,a,s,e.CullFaceMode.backCCW,M,n.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,n.paint,t.transform.zoom,k,I)}}function _n(t,r,n,i,o,a){const s=[t=>{let r=t.canonical.x-1,n=t.wrap;return r<0&&(r=(1<<t.canonical.z)-1,n--),new e.OverscaledTileID(t.overscaledZ,n,t.canonical.z,r,t.canonical.y)},t=>{let r=t.canonical.x+1,n=t.wrap;return r===1<<t.canonical.z&&(r=0,n++),new e.OverscaledTileID(t.overscaledZ,n,t.canonical.z,r,t.canonical.y)},t=>new e.OverscaledTileID(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,(0===t.canonical.y?1<<t.canonical.z:t.canonical.y)-1),t=>new e.OverscaledTileID(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y===(1<<t.canonical.z)-1?0:t.canonical.y+1)],l=e=>{const t=r.getSource().minzoom,n=e=>{const t=r.getTileByID(e);if(t&&t.hasData())return t.getBucket(o)},i=[0,-1,1];for(const r of i){if(e.overscaledZ+r<t)continue;const i=n(e.calculateScaledKey(e.overscaledZ+r));if(i)return i}},c=[0,0,0],u=(t,r)=>(c[0]=Math.min(t.min.y,r.min.y),c[1]=Math.max(t.max.y,r.max.y),c[2]=e.EXTENT-r.min.x>t.max.x?r.min.x-e.EXTENT:t.max.x,c),p=(t,r)=>(c[0]=Math.min(t.min.x,r.min.x),c[1]=Math.max(t.max.x,r.max.x),c[2]=e.EXTENT-r.min.y>t.max.y?r.min.y-e.EXTENT:t.max.y,c),h=[(e,t)=>u(e,t),(e,t)=>u(t,e),(e,t)=>p(e,t),(e,t)=>p(t,e)],d=new e.Point(0,0);let f,m,g;const b=(t,r,i,o,s)=>{const l=[[o?i:t,o?t:i,0],[o?i:r,o?r:i,0]],c=s<0?e.EXTENT+s:s,u=[o?c:(t+r)/2,o?(t+r)/2:c,0];return 0===i&&s<0||0!==i&&s>0?a.getForTilePoints(g,[u],!0,m):l.push(u),a.getForTilePoints(n,l,!0,f),Math.max(l[0][2],l[1][2],u[2])/a.exaggeration()};for(let t=0;t<4;t++){const r=(t<2?1:5)-t,o=i.borders[t];if(0===o.length)continue;const c=g=s[t](n),u=l(c);if(!(u&&u instanceof e.FillExtrusionBucket&&u.enableTerrain))continue;if(i.borderDoneWithNeighborZ[t]===u.canonical.z&&u.borderDoneWithNeighborZ[r]===i.canonical.z)continue;if(m=a.findDEMTileFor(c),!m||!m.dem)continue;if(!f){const e=a.findDEMTileFor(n);if(!e||!e.dem)return;f=e}const p=u.borders[r];let _=0;const y=u.borderDoneWithNeighborZ[r]!==i.canonical.z;if(i.canonical.z===u.canonical.z){for(let n=0;n<o.length;n++){const a=i.featuresOnBorder[o[n]],s=a.borders[t];let l;for(;_<p.length&&(l=u.featuresOnBorder[p[_]],!(l.borders[r][1]>s[0]+3));)y&&u.encodeCentroid(void 0,l,!1),_++;if(l&&_<p.length){const n=_;let o=0;for(;!(l.borders[r][0]>s[1]-3)&&(o++,++_!==p.length);)l=u.featuresOnBorder[p[_]];if(l=u.featuresOnBorder[p[n]],a.intersectsCount()>1||l.intersectsCount()>1||1!==o){1!==o&&(_=n),i.encodeCentroid(void 0,a,!1),y&&u.encodeCentroid(void 0,l,!1);continue}const c=h[t](a,l),f=t%2?e.EXTENT-1:0;d.x=b(c[0],Math.min(e.EXTENT-1,c[1]),f,t<2,c[2]),d.y=0,i.encodeCentroid(d,a,!1),y&&u.encodeCentroid(d,l,!1)}else i.encodeCentroid(void 0,a,!1)}i.borderDoneWithNeighborZ[t]=u.canonical.z,i.needsCentroidUpdate=!0,y&&(u.borderDoneWithNeighborZ[r]=i.canonical.z,u.needsCentroidUpdate=!0)}else{for(const e of o)i.encodeCentroid(void 0,i.featuresOnBorder[e],!1);if(y){for(const e of p)u.encodeCentroid(void 0,u.featuresOnBorder[e],!1);u.borderDoneWithNeighborZ[r]=i.canonical.z,u.needsCentroidUpdate=!0}i.borderDoneWithNeighborZ[t]=u.canonical.z,i.needsCentroidUpdate=!0}}(i.needsCentroidUpdate||!i.centroidVertexBuffer&&0!==i.centroidVertexArray.length)&&i.uploadCentroid(t)}const yn=new e.Color(1,0,0,1),vn=new e.Color(0,1,0,1),xn=new e.Color(0,0,1,1),wn=new e.Color(1,0,1,1),kn=new e.Color(0,1,1,1);function En(t,r,n){const i=t.context,o=t.transform,a=i.gl,s="globe"===o.projection.name,l=s?["PROJECTION_GLOBE_VIEW"]:null;let c=n.projMatrix;if(s&&e.globeToMercatorTransition(o.zoom)>0){const t=e.transitionTileAABBinECEF(n.canonical,o),r=e.globeDenormalizeECEF(t);c=e.multiply(new Float32Array(16),o.globeMatrix,r),e.multiply(c,o.projMatrix,c)}const u=t.useProgram("debug",null,l),p=r.getTileByID(n.key);t.terrain&&t.terrain.setupElevationDraw(p,u);const h=e.DepthMode.disabled,d=e.StencilMode.disabled,f=t.colorModeForRenderPass(),m="$debug";i.activeTexture.set(a.TEXTURE0),t.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s?p._makeGlobeTileDebugBuffers(t.context,o):p._makeDebugTileBoundsBuffers(t.context,o.projection);const g=p._tileDebugBuffer||t.debugBuffer,b=p._tileDebugIndexBuffer||t.debugIndexBuffer,_=p._tileDebugSegments||t.debugSegments;u.draw(i,a.LINE_STRIP,h,d,f,e.CullFaceMode.disabled,$r(c,e.Color.red),m,g,b,_,null,null,null,[p._globeTileDebugBorderBuffer]);const y=p.latestRawTileData,v=Math.floor((y&&y.byteLength||0)/1024),x=r.getTile(n).tileSize,w=512/Math.min(x,512)*(n.overscaledZ/o.zoom)*.5;let k=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(k+=` => ${n.overscaledZ}`),k+=` ${v}kb`,function(e,t){e.initDebugOverlayCanvas();const r=e.debugOverlayCanvas,n=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,k);const E=p._tileDebugTextBuffer||t.debugBuffer,T=p._tileDebugTextIndexBuffer||t.quadTriangleIndexBuffer,S=p._tileDebugTextSegments||t.debugSegments;u.draw(i,a.TRIANGLES,h,d,e.ColorMode.alphaBlended,e.CullFaceMode.disabled,$r(c,e.Color.transparent,w),m,E,T,S,null,null,null,[p._globeTileDebugTextBuffer])}function Tn(e,t,r,n){Cn(e,0,t+r/2,e.transform.width,r,n)}function Sn(e,t,r,n){Cn(e,t-r/2,0,r,e.transform.height,n)}function Cn(t,r,n,i,o,a){const s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*e.exported.devicePixelRatio,n*e.exported.devicePixelRatio,i*e.exported.devicePixelRatio,o*e.exported.devicePixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST)}const An=e.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:Mn}=An;function In(e,t,r,n){e.emplaceBack(t,r,n)}class On{constructor(t){this.vertexArray=new e.StructArrayLayout3f12,this.indices=new e.StructArrayLayout3ui6,In(this.vertexArray,-1,-1,1),In(this.vertexArray,1,-1,1),In(this.vertexArray,-1,1,1),In(this.vertexArray,1,1,1),In(this.vertexArray,-1,-1,-1),In(this.vertexArray,1,-1,-1),In(this.vertexArray,-1,1,-1),In(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=t.createVertexBuffer(this.vertexArray,Mn),this.indexBuffer=t.createIndexBuffer(this.indices),this.segment=e.SegmentVector.simpleSegment(0,0,36,12)}}function Ln(t,r,n,i,o,a){const s=t.gl,l=r.paint.get("sky-atmosphere-color"),c=r.paint.get("sky-atmosphere-halo-color"),u=r.paint.get("sky-atmosphere-sun-intensity"),p=((e,t,r,n,i)=>({u_matrix_3f:e,u_sun_direction:t,u_sun_intensity:r,u_color_tint_r:[n.r,n.g,n.b,n.a],u_color_tint_m:[i.r,i.g,i.b,i.a],u_luminance:5e-5}))(e.fromMat4(e.create$1(),i),o,u,l,c);s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+a,r.skyboxTexture,0),n.draw(t,s.TRIANGLES,e.DepthMode.disabled,e.StencilMode.disabled,e.ColorMode.unblended,e.CullFaceMode.frontCW,p,"skyboxCapture",r.skyboxGeometry.vertexBuffer,r.skyboxGeometry.indexBuffer,r.skyboxGeometry.segment)}const zn=e.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Dn{constructor(t){const r=new e.StructArrayLayout5f20;r.emplaceBack(-1,1,1,0,0),r.emplaceBack(1,1,1,1,0),r.emplaceBack(1,-1,1,1,1),r.emplaceBack(-1,-1,1,0,1);const n=new e.StructArrayLayout3ui6;n.emplaceBack(0,1,2),n.emplaceBack(2,3,0),this.vertexBuffer=t.createVertexBuffer(r,zn.members),this.indexBuffer=t.createIndexBuffer(n),this.segments=e.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Pn={symbol:function(t,r,n,i,o){if("translucent"!==t.renderPass)return;const a=e.StencilMode.disabled,s=t.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(t,r,n,i,o,a,s){const l=r.transform,c="map"===o,u="map"===a;for(const r of t){const t=i.getTile(r),o=t.getBucket(n);if(!o||!o.text||!o.text.segments.get().length)continue;const a=e.evaluateSizeForZoom(o.textSizeData,l.zoom),p=yt(r,o.getProjection(),l),h=l.calculatePixelsToTileUnitsMatrix(t),d=et(p,t.tileID.canonical,u,c,l,o.getProjection(),h),f="none"!==n.layout.get("icon-text-fit")&&o.hasIconData();if(a){const n=Math.pow(2,l.zoom-t.tileID.overscaledZ);hn(o,c,u,s,e.symbolSize,l,d,r,n,a,f)}}}(i,t,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),o),0!==n.paint.get("icon-opacity").constantOr(1)&&fn(t,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),a,s),0!==n.paint.get("text-opacity").constantOr(1)&&fn(t,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),a,s),r.map.showCollisionBoxes&&(cn(t,r,n,i,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),cn(t,r,n,i,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(t,r,n,i){if("translucent"!==t.renderPass)return;const o=n.paint.get("circle-opacity"),a=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0===o.constantOr(1)&&(0===a.constantOr(1)||0===s.constantOr(1)))return;const c=t.context,u=c.gl,p=t.transform,h=t.depthModeForSublayer(0,e.DepthMode.ReadOnly),d=e.StencilMode.disabled,f=t.colorModeForRenderPass(),m="globe"===p.projection.name,g=[e.mercatorXfromLng(p.center.lng),e.mercatorYfromLat(p.center.lat)],b=[];for(let o=0;o<i.length;o++){const a=i[o],s=r.getTile(a),c=s.getBucket(n);if(!c||c.projection.name!==p.projection.name)continue;const u=c.programConfigurations.get(n.id),h=Vr(n);m&&h.push("PROJECTION_GLOBE_VIEW");const d=t.useProgram("circle",u,h),f=c.layoutVertexBuffer,_=c.globeExtVertexBuffer,y=c.indexBuffer,v=p.projection.createInversionMatrix(p,a.canonical),x={programConfiguration:u,program:d,layoutVertexBuffer:f,globeExtVertexBuffer:_,indexBuffer:y,uniformValues:Ur(t,a,s,v,g,n),tile:s};if(l){const t=c.segments.get();for(const r of t)b.push({segments:new e.SegmentVector([r]),sortKey:r.sortKey,state:x})}else b.push({segments:c.segments,sortKey:0,state:x})}l&&b.sort(((e,t)=>e.sortKey-t.sortKey));const _={useDepthForOcclusion:!m};for(const r of b){const{programConfiguration:i,program:o,layoutVertexBuffer:a,globeExtVertexBuffer:s,indexBuffer:l,uniformValues:m,tile:g}=r.state,b=r.segments;t.terrain&&t.terrain.setupElevationDraw(g,o,_),t.prepareDrawProgram(c,o,g.tileID.toUnwrapped()),o.draw(c,u.TRIANGLES,h,d,f,e.CullFaceMode.disabled,m,n.id,a,l,b,n.paint,p.zoom,i,[s])}},heatmap:function(t,r,n,i){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){const o=t.context,a=o.gl,s=e.StencilMode.disabled,l=new e.ColorMode([a.ONE,a.ONE],e.Color.transparent,[!0,!0,!0,!0]);!function(e,t,r,n){const i=e.gl,o=t.width*n,a=t.height*n;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,o,a]);let s=r.heatmapFbo;if(!s||s&&(s.width!==o||s.height!==a)){s&&s.destroy();const t=i.createTexture();i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),s=r.heatmapFbo=e.createFramebuffer(o,a,!1),function(e,t,r,n,i,o){const a=e.gl;a.texImage2D(a.TEXTURE_2D,0,e.isWebGL2&&e.extRenderToTextureHalfFloat?a.RGBA16F:a.RGBA,i,o,0,a.RGBA,e.extRenderToTextureHalfFloat?e.isWebGL2?a.HALF_FLOAT:e.extTextureHalfFloat.HALF_FLOAT_OES:a.UNSIGNED_BYTE,null),n.colorAttachment.set(r)}(e,0,t,s,o,a)}else i.bindTexture(i.TEXTURE_2D,s.colorAttachment.get()),e.bindFramebuffer.set(s.framebuffer)}(o,t,n,"globe"===t.transform.projection.name?.5:.25),o.clear({color:e.Color.transparent});const c=t.transform,u="globe"===c.projection.name,p=u?["PROJECTION_GLOBE_VIEW"]:null,h=u?e.CullFaceMode.frontCCW:e.CullFaceMode.disabled,d=[e.mercatorXfromLng(c.center.lng),e.mercatorYfromLat(c.center.lat)];for(let f=0;f<i.length;f++){const m=i[f];if(r.hasRenderableParent(m))continue;const g=r.getTile(m),b=g.getBucket(n);if(!b||b.projection.name!==c.projection.name)continue;const _=b.programConfigurations.get(n.id),y=t.useProgram("heatmap",_,p),{zoom:v}=t.transform;t.terrain&&t.terrain.setupElevationDraw(g,y),t.prepareDrawProgram(o,y,m.toUnwrapped());const x=c.projection.createInversionMatrix(c,m.canonical);y.draw(o,a.TRIANGLES,e.DepthMode.disabled,s,l,h,Wr(t,m,g,x,d,v,n.paint.get("heatmap-intensity")),n.id,b.layoutVertexBuffer,b.indexBuffer,b.segments,n.paint,t.transform.zoom,_,u?[b.globeExtVertexBuffer]:null)}o.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,r){const n=t.context,i=n.gl,o=r.heatmapFbo;if(!o)return;n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,o.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1);let a=r.colorRampTexture;a||(a=r.colorRampTexture=new e.Texture(n,r.colorRamp,i.RGBA)),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(n,i.TRIANGLES,e.DepthMode.disabled,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.disabled,((e,t,r,n)=>({u_image:0,u_color_ramp:1,u_opacity:t.paint.get("heatmap-opacity")}))(0,r),r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,r.paint,t.transform.zoom)}(t,n))},line:function(t,r,n,i){if("translucent"!==t.renderPass)return;const o=n.paint.get("line-opacity"),a=n.paint.get("line-width");if(0===o.constantOr(1)||0===a.constantOr(1))return;const s=t.depthModeForSublayer(0,e.DepthMode.ReadOnly),l=t.colorModeForRenderPass(),c=t.terrain&&t.terrain.renderingToTexture?1:e.exported.devicePixelRatio,u=n.paint.get("line-dasharray"),p=u.constantOr(1),h=n.layout.get("line-cap"),d=n.paint.get("line-pattern"),f=d.constantOr(1),m=n.paint.get("line-gradient"),g=f?"linePattern":"line",b=t.context,_=b.gl,y=(e=>{const t=[];Yr(e)&&t.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&t.push("RENDER_LINE_GRADIENT");const r=e.paint.get("line-trim-offset");0===r[0]&&0===r[1]||t.push("RENDER_LINE_TRIM_OFFSET");const n=e.paint.get("line-pattern").constantOr(1),i=1!==e.paint.get("line-opacity").constantOr(1);return!n&&i&&t.push("RENDER_LINE_ALPHA_DISCARD"),t})(n);let v=y.includes("RENDER_LINE_ALPHA_DISCARD");t.terrain&&t.terrain.clipOrMaskOverlapStencilType()&&(v=!1);for(const o of i){const i=r.getTile(o);if(f&&!i.patternsLoaded())continue;const a=i.getBucket(n);if(!a)continue;t.prepareDrawTile();const x=a.programConfigurations.get(n.id),w=t.useProgram(g,x,y),k=d.constantOr(null);if(k&&i.imageAtlas){const e=i.imageAtlas.patternPositions[k.toString()];e&&x.setConstantPatternPositions(e)}const E=u.constantOr(null),T=h.constantOr(null);if(!f&&E&&T&&i.lineAtlas){const e=i.lineAtlas.getDash(E,T);e&&x.setConstantPatternPositions(e)}let[S,C]=n.paint.get("line-trim-offset");if("round"===T||"square"===T){const e=1;S!==C&&(0===S&&(S-=e),1===C&&(C+=e))}const A=t.terrain?o.projMatrix:null,M=f?Zr(t,i,n,A,c):Hr(t,i,n,A,a.lineClipsArray.length,c,[S,C]);if(m){const i=a.gradients[n.id];let s=i.texture;if(n.gradientVersion!==i.version){let l=256;if(n.stepInterpolant){const n=r.getSource().maxzoom,i=o.canonical.z===n?Math.ceil(1<<t.transform.maxZoom-o.canonical.z):1;l=e.clamp(e.nextPowerOfTwo(a.maxLineLength/e.EXTENT*1024*i),256,b.maxTextureSize)}i.gradient=e.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:i.gradient||void 0,clips:a.lineClipsArray}),i.texture?i.texture.update(i.gradient):i.texture=new e.Texture(b,i.gradient,_.RGBA),i.version=n.gradientVersion,s=i.texture}b.activeTexture.set(_.TEXTURE1),s.bind(n.stepInterpolant?_.NEAREST:_.LINEAR,_.CLAMP_TO_EDGE)}p&&(b.activeTexture.set(_.TEXTURE0),i.lineAtlasTexture.bind(_.LINEAR,_.REPEAT),x.updatePaintBuffers()),f&&(b.activeTexture.set(_.TEXTURE0),i.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),x.updatePaintBuffers()),t.prepareDrawProgram(b,w,o.toUnwrapped());const I=r=>{w.draw(b,_.TRIANGLES,s,r,l,e.CullFaceMode.disabled,M,n.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,n.paint,t.transform.zoom,x,[a.layoutVertexBuffer2])};if(v){const r=t.stencilModeForClipping(o).ref;0===r&&t.terrain&&b.clear({stencil:0});const n={func:_.EQUAL,mask:255};M.u_alpha_discard_threshold=.8,I(new e.StencilMode(n,r,255,_.KEEP,_.KEEP,_.INVERT)),M.u_alpha_discard_threshold=0,I(new e.StencilMode(n,r,255,_.KEEP,_.KEEP,_.KEEP))}else I(t.stencilModeForClipping(o))}v&&(t.resetStencilClippingMasks(),t.terrain&&b.clear({stencil:0}))},fill:function(t,r,n,i){const o=n.paint.get("fill-color"),a=n.paint.get("fill-opacity");if(0===a.constantOr(1))return;const s=t.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(e.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){const o=t.depthModeForSublayer(1,"opaque"===t.renderPass?e.DepthMode.ReadWrite:e.DepthMode.ReadOnly);gn(t,r,n,i,o,s,!1)}if("translucent"===t.renderPass&&n.paint.get("fill-antialias")){const o=t.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,e.DepthMode.ReadOnly);gn(t,r,n,i,o,s,!0)}},"fill-extrusion":function(t,r,n,i){const o=n.paint.get("fill-extrusion-opacity");if(0!==o&&"translucent"===t.renderPass){const a=new e.DepthMode(t.context.gl.LEQUAL,e.DepthMode.ReadWrite,t.depthRangeFor3D);if(1!==o||n.paint.get("fill-extrusion-pattern").constantOr(1))bn(t,r,n,i,a,e.StencilMode.disabled,e.ColorMode.disabled),bn(t,r,n,i,a,t.stencilModeFor3D(),t.colorModeForRenderPass()),t.resetStencilClippingMasks();else{const o=t.colorModeForRenderPass();bn(t,r,n,i,a,e.StencilMode.disabled,o)}}},hillshade:function(t,r,n,i){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;const o=t.context,a=t.depthModeForSublayer(0,e.DepthMode.ReadOnly),s=t.colorModeForRenderPass(),l=t.terrain&&t.terrain.renderingToTexture,[c,u]="translucent"!==t.renderPass||l?[{},i]:t.stencilConfigForOverlap(i);for(const i of u){const o=r.getTile(i);if(o.needsHillshadePrepare&&"offscreen"===t.renderPass)gr(t,o,n,a,e.StencilMode.disabled,s);else if("translucent"===t.renderPass){const e=l&&t.terrain?t.terrain.stencilModeForRTTOverlap(i):c[i.overscaledZ];fr(t,i,o,n,a,e,s)}}o.viewport.set([0,0,t.width,t.height]),t.resetStencilClippingMasks()},raster:function(t,r,n,i,o,a){if("translucent"!==t.renderPass)return;if(0===n.paint.get("raster-opacity"))return;if(!i.length)return;const s=t.context,l=s.gl,c=r.getSource(),u=t.useProgram("raster"),p=t.colorModeForRenderPass(),h=t.terrain&&t.terrain.renderingToTexture,[d,f]=c instanceof Ae||h?[{},i]:t.stencilConfigForOverlap(i),m=f[f.length-1].overscaledZ,g=!t.options.moving;for(const i of f){const o=h?e.DepthMode.disabled:t.depthModeForSublayer(i.overscaledZ-m,1===n.paint.get("raster-opacity")?e.DepthMode.ReadWrite:e.DepthMode.ReadOnly,l.LESS),f=i.toUnwrapped(),b=r.getTile(i);if(h&&(!b||!b.hasData()))continue;const _=h?i.projMatrix:t.transform.calculateProjMatrix(f,g),y=t.terrain&&h?t.terrain.stencilModeForRTTOverlap(i):d[i.overscaledZ],v=a?0:n.paint.get("raster-fade-duration");b.registerFadeDuration(v);const x=r.findLoadedParent(i,0),w=Sr(b,x,r,t.transform,v);let k,E;t.terrain&&t.terrain.prepareDrawTile();const T="nearest"===n.paint.get("raster-resampling")?l.NEAREST:l.LINEAR;s.activeTexture.set(l.TEXTURE0),b.texture.bind(T,l.CLAMP_TO_EDGE),s.activeTexture.set(l.TEXTURE1),x?(x.texture.bind(T,l.CLAMP_TO_EDGE),k=Math.pow(2,x.tileID.overscaledZ-b.tileID.overscaledZ),E=[b.tileID.canonical.x*k%1,b.tileID.canonical.y*k%1]):b.texture.bind(T,l.CLAMP_TO_EDGE),b.texture.useMipmap&&s.extTextureFilterAnisotropic&&t.transform.pitch>20&&l.texParameterf(l.TEXTURE_2D,s.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,s.extTextureFilterAnisotropicMax);const S=Jr(_,E||[0,0],k||1,w,n,c instanceof Ae?c.perspectiveTransform:[0,0]);if(t.prepareDrawProgram(s,u,f),c instanceof Ae)c.boundsBuffer&&c.boundsSegments&&u.draw(s,l.TRIANGLES,o,e.StencilMode.disabled,p,e.CullFaceMode.disabled,S,n.id,c.boundsBuffer,t.quadTriangleIndexBuffer,c.boundsSegments);else{const{tileBoundsBuffer:r,tileBoundsIndexBuffer:i,tileBoundsSegments:a}=t.getTileBoundsBuffers(b);u.draw(s,l.TRIANGLES,o,y,p,e.CullFaceMode.disabled,S,n.id,r,i,a)}}t.resetStencilClippingMasks()},background:function(t,r,n,i){const o=n.paint.get("background-color"),a=n.paint.get("background-opacity");if(0===a)return;const s=t.context,l=s.gl,c=t.transform,u=c.tileSize,p=n.paint.get("background-pattern");if(t.isPatternMissing(p))return;const h=!p&&1===o.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==h)return;const d=e.StencilMode.disabled,f=t.depthModeForSublayer(0,"opaque"===h?e.DepthMode.ReadWrite:e.DepthMode.ReadOnly),m=t.colorModeForRenderPass(),g=t.useProgram(p?"backgroundPattern":"background");let b,_=i;_||(b=t.getBackgroundTiles(),_=Object.values(b).map((e=>e.tileID))),p&&(s.activeTexture.set(l.TEXTURE0),t.imageManager.bind(t.context));for(const h of _){const _=h.toUnwrapped(),y=i?h.projMatrix:t.transform.calculateProjMatrix(_);t.prepareDrawTile();const v=r?r.getTile(h):b?b[h.key]:new e.Tile(h,u,c.zoom,t),x=p?an(y,a,t,p,{tileID:h,tileSize:u}):on(y,a,o);t.prepareDrawProgram(s,g,_);const{tileBoundsBuffer:w,tileBoundsIndexBuffer:k,tileBoundsSegments:E}=t.getTileBoundsBuffers(v);g.draw(s,l.TRIANGLES,f,d,m,e.CullFaceMode.disabled,x,n.id,w,k,E)}},sky:function(t,r,n){const i=t.transform,o="mercator"===i.projection.name||"globe"===i.projection.name?1:e.smoothstep(7,8,i.zoom),a=n.paint.get("sky-opacity")*o;if(0===a)return;const s=t.context,l=n.paint.get("sky-type"),c=new e.DepthMode(s.gl.LEQUAL,e.DepthMode.ReadOnly,[0,1]),u=t.frameCounter/1e3%1;"atmosphere"===l?"offscreen"===t.renderPass?n.needsSkyboxCapture(t)&&(function(t,r,n,i){const o=t.context,a=o.gl;let s=r.skyboxFbo;if(!s){s=r.skyboxFbo=o.createFramebuffer(32,32,!1),r.skyboxGeometry=new On(o),r.skyboxTexture=o.gl.createTexture(),a.bindTexture(a.TEXTURE_CUBE_MAP,r.skyboxTexture),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MAG_FILTER,a.LINEAR);for(let e=0;e<6;++e)a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,a.RGBA,32,32,0,a.RGBA,a.UNSIGNED_BYTE,null)}o.bindFramebuffer.set(s.framebuffer),o.viewport.set([0,0,32,32]);const l=r.getCenter(t,!0),c=t.useProgram("skyboxCapture"),u=new Float64Array(16);e.identity(u),e.rotateY(u,u,.5*-Math.PI),Ln(o,r,c,u,l,0),e.identity(u),e.rotateY(u,u,.5*Math.PI),Ln(o,r,c,u,l,1),e.identity(u),e.rotateX(u,u,.5*-Math.PI),Ln(o,r,c,u,l,2),e.identity(u),e.rotateX(u,u,.5*Math.PI),Ln(o,r,c,u,l,3),e.identity(u),Ln(o,r,c,u,l,4),e.identity(u),e.rotateY(u,u,Math.PI),Ln(o,r,c,u,l,5),o.viewport.set([0,0,t.width,t.height])}(t,n),n.markSkyboxValid(t)):"sky"===t.renderPass&&function(t,r,n,i,o){const a=t.context,s=a.gl,l=t.transform,c=t.useProgram("skybox");a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_CUBE_MAP,r.skyboxTexture);const u=((e,t,r,n,i)=>({u_matrix:e,u_sun_direction:t,u_cubemap:0,u_opacity:n,u_temporal_offset:i}))(l.skyboxMatrix,r.getCenter(t,!1),0,i,o);t.prepareDrawProgram(a,c),c.draw(a,s.TRIANGLES,n,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.backCW,u,"skybox",r.skyboxGeometry.vertexBuffer,r.skyboxGeometry.indexBuffer,r.skyboxGeometry.segment)}(t,n,c,a,u):"gradient"===l&&"sky"===t.renderPass&&function(t,r,n,i,o){const a=t.context,s=a.gl,l=t.transform,c=t.useProgram("skyboxGradient");r.skyboxGeometry||(r.skyboxGeometry=new On(a)),a.activeTexture.set(s.TEXTURE0);let u=r.colorRampTexture;u||(u=r.colorRampTexture=new e.Texture(a,r.colorRamp,s.RGBA)),u.bind(s.LINEAR,s.CLAMP_TO_EDGE);const p=((t,r,n,i,o)=>({u_matrix:t,u_color_ramp:0,u_center_direction:r,u_radius:e.degToRad(n),u_opacity:i,u_temporal_offset:o}))(l.skyboxMatrix,r.getCenter(t,!1),r.paint.get("sky-gradient-radius"),i,o);t.prepareDrawProgram(a,c),c.draw(a,s.TRIANGLES,n,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.backCW,p,"skyboxGradient",r.skyboxGeometry.vertexBuffer,r.skyboxGeometry.indexBuffer,r.skyboxGeometry.segment)}(t,n,c,a,u)},debug:function(e,t,r){for(let n=0;n<r.length;n++)En(e,t,r[n])},custom:function(t,r,n,i){const o=t.context,a=n.implementation;if(!t.transform.projection.unsupportedLayers||!t.transform.projection.unsupportedLayers.includes("custom")||t.terrain&&(t.terrain.renderingToTexture||"offscreen"===t.renderPass)&&n.isLayerDraped()){if("offscreen"===t.renderPass){const r=a.prerender;if(r){if(t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),"globe"===t.transform.projection.name){const n=t.transform.pointMerc;r.call(a,o.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.globeToMercatorTransition(t.transform.zoom),[n.x,n.y],t.transform.pixelsPerMeterRatio)}else r.call(a,o.gl,t.transform.customLayerMatrix());o.setDirty(),t.setBaseState()}}else if("translucent"===t.renderPass){if(t.terrain&&t.terrain.renderingToTexture){const r=a.renderToTile;if(r){const n=i[0].canonical,s=new e.MercatorCoordinate(n.x+i[0].wrap*(1<<n.z),n.y,n.z);o.setDepthMode(e.DepthMode.disabled),o.setStencilMode(e.StencilMode.disabled),o.setColorMode(t.colorModeForRenderPass()),t.setCustomLayerDefaults(),r.call(a,o.gl,s),o.setDirty(),t.setBaseState()}return}t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),o.setStencilMode(e.StencilMode.disabled);const r="3d"===a.renderingMode?new e.DepthMode(t.context.gl.LEQUAL,e.DepthMode.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,e.DepthMode.ReadOnly);if(o.setDepthMode(r),"globe"===t.transform.projection.name){const r=t.transform.pointMerc;a.render(o.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.globeToMercatorTransition(t.transform.zoom),[r.x,r.y],t.transform.pixelsPerMeterRatio)}else a.render(o.gl,t.transform.customLayerMatrix());o.setDirty(),t.setBaseState(),o.bindFramebuffer.set(null)}}else e.warnOnce("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")}};class Rn{constructor(t,r,n=!1){this.context=new Ee(t,n),this.transform=r,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.setup(),this.numSublayers=e.SourceCache.maxUnderzooming+e.SourceCache.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={}}updateTerrain(e,t){const r=!!e&&!!e.terrain&&this.transform.projection.supportsTerrain;if(!(r||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new Ir(this,e));const n=this._terrain;this.transform.elevation=r?n:null,n.update(e,this.transform,t)}_updateFog(e){const t=e.fog;if(!t||"globe"===this.transform.projection.name||t.getOpacity(this.transform.pitch)<1||t.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[r,n]=t.getFovAdjustedRange(this.transform._fov);if(r>n)return void(this.transform.fogCullDistSq=null);const i=r+.78*(n-r);this.transform.fogCullDistSq=i*i}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(t,r){if(this.width=t*e.exported.devicePixelRatio,this.height=r*e.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const e of this.style.order)this.style._layers[e].resize()}setup(){const t=this.context,r=new e.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(e.EXTENT,0),r.emplaceBack(0,e.EXTENT),r.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=t.createVertexBuffer(r,e.posAttributes.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);const n=new e.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(e.EXTENT,0),n.emplaceBack(0,e.EXTENT),n.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=t.createVertexBuffer(n,e.posAttributes.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);const i=new e.StructArrayLayout2i4;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(-1,1),i.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(i,e.posAttributes.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);const o=new e.StructArrayLayout4i8;o.emplaceBack(0,0,0,0),o.emplaceBack(e.EXTENT,0,e.EXTENT,0),o.emplaceBack(0,e.EXTENT,0,e.EXTENT),o.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.mercatorBoundsBuffer=t.createVertexBuffer(o,e.boundsAttributes.members),this.mercatorBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);const a=new e.StructArrayLayout3ui6;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(a);const s=new e.StructArrayLayout1ui2;for(const e of[0,1,3,2,0])s.emplaceBack(e);this.debugIndexBuffer=t.createIndexBuffer(s),this.emptyTexture=new e.Texture(t,new e.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),t.gl.RGBA),this.identityMat=e.create();const l=this.context.gl;this.stencilClearMode=new e.StencilMode({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(e.window.performance.now()),this.atmosphereBuffer=new Dn(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(e){return e._makeTileBoundsBuffers(this.context,this.transform.projection),e._tileBoundsBuffer?{tileBoundsBuffer:e._tileBoundsBuffer,tileBoundsIndexBuffer:e._tileBoundsIndexBuffer,tileBoundsSegments:e._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const t=this.context,r=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(t,r.TRIANGLES,e.DepthMode.disabled,this.stencilClearMode,e.ColorMode.disabled,e.CullFaceMode.disabled,Tr(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(t,r,n){if(!r||this.currentStencilSource===r.id||!t.isTileClipped()||!n||0===n.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let e=!1;for(const t of n)if(void 0===this._tileClippingMaskIDs[t.key]){e=!0;break}if(!e)return}this.currentStencilSource=r.id;const i=this.context,o=i.gl;this.nextStencilID+n.length>256&&this.clearStencil(),i.setColorMode(e.ColorMode.disabled),i.setDepthMode(e.DepthMode.disabled);const a=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const t of n){const n=r.getTile(t),s=this._tileClippingMaskIDs[t.key]=this.nextStencilID++,{tileBoundsBuffer:l,tileBoundsIndexBuffer:c,tileBoundsSegments:u}=this.getTileBoundsBuffers(n);a.draw(i,o.TRIANGLES,e.DepthMode.disabled,new e.StencilMode({func:o.ALWAYS,mask:0},s,255,o.KEEP,o.KEEP,o.REPLACE),e.ColorMode.disabled,e.CullFaceMode.disabled,Tr(t.projMatrix),"$clipping",l,c,u)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,r=this.context.gl;return new e.StencilMode({func:r.NOTEQUAL,mask:255},t,255,r.KEEP,r.KEEP,r.REPLACE)}stencilModeForClipping(t){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(t);const r=this.context.gl;return new e.StencilMode({func:r.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,r.KEEP,r.KEEP,r.REPLACE)}stencilConfigForOverlap(t){const r=this.context.gl,n=t.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),i=n[n.length-1].overscaledZ,o=n[0].overscaledZ-i+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();const t={};for(let n=0;n<o;n++)t[n+i]=new e.StencilMode({func:r.GEQUAL,mask:255},n+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=o,[t,n]}return[{[i]:e.StencilMode.disabled},n]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const r=1/8;return new e.ColorMode([t.CONSTANT_COLOR,t.ONE],new e.Color(r,r,r,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?e.ColorMode.unblended:e.ColorMode.alphaBlended}depthModeForSublayer(t,r,n){if(!this.opaquePassEnabledForLayer())return e.DepthMode.disabled;const i=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new e.DepthMode(n||this.context.gl.LEQUAL,r,[i,i])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,r){this.style=t,this.options=r,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.exported.now()),this.imageManager.beginFrame();const n=this.style.order,i=this.style._sourceCaches;for(const e in i){const t=i[e];t.used&&t.prepare(this.context)}const o={},a={},s={};for(const e in i){const t=i[e];o[e]=t.getVisibleCoordinates(),a[e]=o[e].slice().reverse(),s[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<n.length;e++)if(this.style._layers[n[e]].is3D()){this.opaquePassCutoff=e;break}if(this.terrain&&(this.terrain.updateTileBinding(s),this.opaquePassCutoff=0),"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new e.GlobeSharedBuffers(this.context)),!e.isMapAuthenticated(this.context.gl))return;this.renderPass="offscreen";for(const e of n){const r=this.style._layers[e],n=t._getLayerSourceCache(r);if(!r.hasOffscreenPass()||r.isHidden(this.transform.zoom))continue;const i=n?a[n.id]:void 0;("custom"===r.type||r.isSky()||i&&i.length)&&this.renderLayer(this,n,r,i)}this.depthRangeFor3D=[0,1-(t.order.length+2)*this.numSublayers*this.depthEpsilon];const l=this.terrain;if(l&&(this.style.hasSymbolLayers()||this.style.hasCircleLayers())&&l.drawDepth(),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]),this.context.clear({color:r.showOverdrawInspector?e.Color.black:e.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.renderPass="opaque",!this.terrain)for(this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){const e=this.style._layers[n[this.currentLayer]],r=t._getLayerSourceCache(e);if(e.isSky())continue;const i=r?a[r.id]:void 0;this._renderTileClippingMasks(e,r,i),this.renderLayer(this,r,e,i)}if(this.style.fog&&this.transform.projection.supportsFog&&function(t,r){const n=t.context,i=n.gl,o=t.transform,a=new e.DepthMode(i.LEQUAL,e.DepthMode.ReadOnly,[0,1]),s=t.useProgram("globeAtmosphere",null,"globe"===o.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),l=e.globeToMercatorTransition(o.zoom),c=r.properties.get("color").toArray01(),u=r.properties.get("high-color").toArray01(),p=r.properties.get("space-color").toArray01PremultipliedAlpha(),h=e.identity$1([]);e.rotateY$1(h,h,-e.degToRad(o._center.lng)),e.rotateX$1(h,h,e.degToRad(o._center.lat)),e.rotateZ$1(h,h,o.angle),e.rotateX$1(h,h,-o._pitch);const d=e.fromQuat(new Float32Array(16),h),f=e.mapValue(r.properties.get("star-intensity"),0,1,0,.25),m=5e-4,g=e.mapValue(r.properties.get("horizon-blend"),0,1,m,.25),b=e.globeUseCustomAntiAliasing(t,n,o)&&g===m?o.worldSize/(2*Math.PI*1.025)-1:o.globeRadius,_=t.frameCounter/1e3%1,y=e.length(o.globeCenterInViewSpace),v=Math.sqrt(Math.pow(y,2)-Math.pow(b,2)),x=Math.acos(v/y),w=((t,r,n,i,o,a,s,l,c,u,p,h,d,f)=>({u_frustum_tl:t,u_frustum_tr:r,u_frustum_br:n,u_frustum_bl:i,u_horizon:o,u_transition:a,u_fadeout_range:s,u_color:l,u_high_color:c,u_space_color:u,u_star_intensity:p,u_star_size:5*e.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:h,u_horizon_angle:d,u_rotation_matrix:f}))(o.frustumCorners.TL,o.frustumCorners.TR,o.frustumCorners.BR,o.frustumCorners.BL,o.frustumCorners.horizon,l,g,c,u,p,f,_,x,d);t.prepareDrawProgram(n,s);const k=t.atmosphereBuffer;k&&s.draw(n,i.TRIANGLES,a,e.StencilMode.disabled,e.ColorMode.alphaBlended,e.CullFaceMode.backCW,w,"skybox",k.vertexBuffer,k.indexBuffer,k.segments)}(this,this.style.fog),this.renderPass="sky",(e.globeToMercatorTransition(this.transform.zoom)>0||"globe"!==this.transform.projection.name)&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){const e=this.style._layers[n[this.currentLayer]],r=t._getLayerSourceCache(e);e.isSky()&&this.renderLayer(this,r,e,r?a[r.id]:void 0)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;){const e=this.style._layers[n[this.currentLayer]],r=t._getLayerSourceCache(e);if(e.isSky()){++this.currentLayer;continue}if(this.terrain&&this.style.isLayerDraped(e)){if(e.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer);continue}const i=r?("symbol"===e.type?s:a)[r.id]:void 0;this._renderTileClippingMasks(e,r,r?o[r.id]:void 0),this.renderLayer(this,r,e,i),++this.currentLayer}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let r=null;e.values(this.style._layers).forEach((e=>{const n=t._getLayerSourceCache(e);n&&!e.isHidden(this.transform.zoom)&&(!r||r.getSource().maxzoom<n.getSource().maxzoom)&&(r=n)})),r&&this.options.showTileBoundaries&&Pn.debug(this,r,r.getVisibleCoordinates())}this.options.showPadding&&function(e){const t=e.transform.padding;Tn(e,e.transform.height-(t.top||0),3,yn),Tn(e,t.bottom||0,3,vn),Sn(e,t.left||0,3,xn),Sn(e,e.transform.width-(t.right||0),3,wn);const r=e.transform.centerPoint;!function(e,t,r,n){Cn(e,t-1,r-10,2,20,n),Cn(e,t-10,r-1,20,2,n)}(e,r.x,e.transform.height-r.y,kn)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(e.window.performance.now()),this.saveCanvasCopy())}renderLayer(e,t,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||"sky"===r.type||"custom"===r.type||n&&n.length)&&(this.id=r.id,this.gpuTimingStart(r),(!e.transform.projection.unsupportedLayers||!e.transform.projection.unsupportedLayers.includes(r.type)||e.terrain&&"custom"===r.type)&&Pn[r.type](e,t,r,n,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(e){if(!this.options.gpuTiming)return;const t=this.context.extTimerQuery;let r=this.gpuTimers[e.id];r||(r=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:t.createQueryEXT()}),r.calls++,t.beginQueryEXT(t.TIME_ELAPSED_EXT,r.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const e=this.context.extTimerQuery,t=e.createQueryEXT();this.deferredRenderGpuTimeQueries.push(t),e.beginQueryEXT(e.TIME_ELAPSED_EXT,t)}}gpuTimingDeferredRenderEnd(){if(!this.options.gpuTimingDeferredRender)return;const e=this.context.extTimerQuery;e.endQueryEXT(e.TIME_ELAPSED_EXT)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const e=this.context.extTimerQuery;e.endQueryEXT(e.TIME_ELAPSED_EXT)}collectGpuTimers(){const e=this.gpuTimers;return this.gpuTimers={},e}collectDeferredRenderGpuQueries(){const e=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],e}queryGpuTimers(e){const t={};for(const r in e){const n=e[r],i=this.context.extTimerQuery,o=i.getQueryObjectEXT(n.query,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(n.query),t[r]=o}return t}queryGpuTimeDeferredRender(e){if(!this.options.gpuTimingDeferredRender)return 0;const t=this.context.extTimerQuery;let r=0;for(const n of e)r+=t.getQueryObjectEXT(n,t.QUERY_RESULT_EXT)/1e6,t.deleteQueryEXT(n);return r}translatePosMatrix(t,r,n,i,o){if(!n[0]&&!n[1])return t;const a=o?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(a){const e=Math.sin(a),t=Math.cos(a);n=[n[0]*t-n[1]*e,n[0]*e+n[1]*t]}const s=[o?n[0]:I(r,n[0],this.transform.zoom),o?n[1]:I(r,n[1],this.transform.zoom),0],l=new Float32Array(16);return e.translate(l,t,s),l}saveTileTexture(e){const t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const t=this._tileTextures[e];return t&&t.length>0?t.pop():null}isPatternMissing(e){return null===e||void 0!==e&&!this.imageManager.getPattern(e.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const e=this.terrain&&this.terrain.renderingToTexture,t=this.terrain&&0===this.terrain.exaggeration(),r=this.style&&this.style.fog,n=[];return this.terrainRenderModeElevated()&&n.push("TERRAIN"),"globe"===this.transform.projection.name&&n.push("GLOBE"),t&&n.push("ZERO_EXAGGERATION"),r&&!e&&0!==r.getOpacity(this.transform.pitch)&&n.push("FOG"),e&&n.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&n.push("OVERDRAW_INSPECTOR"),n}useProgram(e,t,r){this.cache=this.cache||{};const n=r||[],i=this.currentGlobalDefines().concat(n),o=Or.cacheKey(cr[e],e,i,t);return this.cache[o]||(this.cache[o]=new Or(this.context,e,cr[e],t,sn[e],i)),this.cache[o]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(t,r,n){if(this.terrain&&this.terrain.renderingToTexture)return;const i=this.style.fog;if(i){const o=i.getOpacity(this.transform.pitch),a=((t,r,n,i,o,a,s,l,c,u,p)=>{const h=t.transform,d=r.properties.get("color").toArray01();d[3]=i;const f=t.frameCounter/1e3%1;return{u_fog_matrix:n?h.calculateFogTileMatrix(n):t.identityMat,u_fog_range:r.getFovAdjustedRange(h._fov),u_fog_color:d,u_fog_horizon_blend:r.properties.get("horizon-blend"),u_fog_temporal_offset:f,u_frustum_tl:o,u_frustum_tr:a,u_frustum_br:s,u_frustum_bl:l,u_globe_pos:c,u_globe_radius:u,u_viewport:p,u_globe_transition:e.globeToMercatorTransition(h.zoom),u_is_globe:+("globe"===h.projection.name)}})(this,i,n,o,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*e.exported.devicePixelRatio,this.transform.height*e.exported.devicePixelRatio]);r.setFogUniformValues(t,a)}}setTileLoadedFlag(e){this.tileLoaded=e}saveCanvasCopy(){const e=this.canvasCopy();e&&(this.frameCopies.push(e),this.tileLoaded=!1)}canvasCopy(){const e=this.context.gl,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,0,0,e.drawingBufferWidth,e.drawingBufferHeight,0),t}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const e=this.style&&this.style.fog;return!!e&&0!==e.getOpacity(this.transform.pitch)}getBackgroundTiles(){const t=this._backgroundTiles,r=this._backgroundTiles={},n=this.transform.coveringTiles({tileSize:512});for(const i of n)r[i.key]=t[i.key]||new e.Tile(i,512,this.transform.tileZoom,this);return r}clearBackgroundTiles(){this._backgroundTiles={}}}class Bn{constructor(e=0,t=0,r=0,n=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=n}interpolate(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.number(t.right,r.right,n)),this}getCenter(t,r){const n=e.clamp((this.left+t-this.right)/2,0,t),i=e.clamp((this.top+r-this.bottom)/2,0,r);return new e.Point(n,i)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Bn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Fn(t,r){const n=e.getColumn(t,3);e.fromQuat(t,r),e.setColumn(t,3,n)}function jn(t,r){const n=e.identity$1([]);return e.rotateZ$1(n,n,-r),e.rotateX$1(n,n,-t),n}function Nn(t,r){const n=[t[0],t[1],0],i=[r[0],r[1],0];if(e.length(n)>=1e-15){const t=e.normalize([],n);e.scale$2(i,t,e.dot(i,t)),r[0]=i[0],r[1]=i[1]}const o=e.cross([],r,t);if(e.len(o)<1e-15)return null;const a=Math.atan2(-o[1],o[0]);return jn(Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2]),a)}class Un{constructor(e,t){this.position=e,this.orientation=t}get position(){return this._position}set position(t){if(t){const r=t instanceof e.MercatorCoordinate?t:new e.MercatorCoordinate(t[0],t[1],t[2]);this._renderWorldCopies&&(r.x=e.wrap(r.x,0,1)),this._position=r}else this._position=null}lookAtPoint(t,r){if(this.orientation=null,!this.position)return;const n=this.position,i=this._elevation?this._elevation.getAtPointOrZero(e.MercatorCoordinate.fromLngLat(t)):0,o=e.MercatorCoordinate.fromLngLat(t,i),a=[o.x-n.x,o.y-n.y,o.z-n.z];r||(r=[0,0,1]),r[2]=Math.abs(r[2]),this.orientation=Nn(a,r)}setPitchBearing(t,r){this.orientation=jn(e.degToRad(t),e.degToRad(-r))}}class Vn{constructor(t,r){this._transform=e.identity([]),this.orientation=r,this.position=t}get mercatorPosition(){const t=this.position;return new e.MercatorCoordinate(t[0],t[1],t[2])}get position(){const t=e.getColumn(this._transform,3);return[t[0],t[1],t[2]]}set position(t){var r;t&&e.setColumn(this._transform,3,[(r=t)[0],r[1],r[2],1])}get orientation(){return this._orientation}set orientation(t){this._orientation=t||e.identity$1([]),t&&Fn(this._transform,this._orientation)}getPitchBearing(){const e=this.forward(),t=this.right();return{bearing:Math.atan2(-t[1],t[0]),pitch:Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2])}}setPitchBearing(e,t){this._orientation=jn(e,t),Fn(this._transform,this._orientation)}forward(){const t=e.getColumn(this._transform,2);return[-t[0],-t[1],-t[2]]}up(){const t=e.getColumn(this._transform,1);return[-t[0],-t[1],-t[2]]}right(){const t=e.getColumn(this._transform,0);return[t[0],t[1],t[2]]}getCameraToWorld(t,r){const n=new Float64Array(16);return e.invert(n,this.getWorldToCamera(t,r)),n}getWorldToCameraPosition(t,r,n){const i=this.position;e.scale$2(i,i,-t);const o=new Float64Array(16);return e.fromScaling(o,[n,n,n]),e.translate(o,o,i),o[10]*=r,o}getWorldToCamera(t,r){const n=new Float64Array(16),i=new Float64Array(4),o=this.position;return e.conjugate(i,this._orientation),e.scale$2(o,o,-t),e.fromQuat(n,i),e.translate(n,n,o),n[1]*=-1,n[5]*=-1,n[9]*=-1,n[13]*=-1,n[8]*=r,n[9]*=r,n[10]*=r,n[11]*=r,n}getCameraToClipPerspective(t,r,n,i){const o=new Float64Array(16);return e.perspective(o,t,r,n,i),o}getDistanceToElevation(t,r=!1){const n=0===t?0:e.mercatorZfromAltitude(t,r?e.latFromMercatorY(this.position[1]):this.position[1]),i=this.forward();return(n-this.position[2])/i[2]}clone(){return new Vn([...this.position],[...this.orientation])}}function qn(t,r){const n=Gn(t.projection,t.zoom,t.width,t.height),i=function(t,r,n,i,o){const a=new e.LngLat(n.lng-180*Wn,n.lat),s=new e.LngLat(n.lng+180*Wn,n.lat),l=t.project(a.lng,a.lat),c=t.project(s.lng,s.lat),u=-Math.atan2(c.y-l.y,c.x-l.x),p=e.MercatorCoordinate.fromLngLat(n);p.y=e.clamp(p.y,-1+Wn,1-Wn);const h=p.toLngLat(),d=t.project(h.lng,h.lat),f=e.MercatorCoordinate.fromLngLat(h);f.x+=Wn;const m=f.toLngLat(),g=t.project(m.lng,m.lat),b=Zn(g.x-d.x,g.y-d.y,u),_=e.MercatorCoordinate.fromLngLat(h);_.y+=Wn;const y=_.toLngLat(),v=t.project(y.lng,y.lat),x=Zn(v.x-d.x,v.y-d.y,u),w=Math.abs(b.x)/Math.abs(x.y),k=e.identity([]);e.rotateZ(k,k,-u*(1-(o?0:i)));const E=e.identity([]);return e.scale(E,E,[1,1-(1-w)*i,1]),E[4]=-x.x/x.y*i,e.rotateZ(E,E,u),e.multiply(E,k,E),E}(t.projection,0,t.center,n,r),o=$n(t);return e.scale(i,i,[o,o,1]),i}function $n(t){const r=t.projection,n=Gn(t.projection,t.zoom,t.width,t.height),i=Hn(r,t.center),o=Hn(r,e.LngLat.convert(r.center));return Math.pow(2,i*n+(1-n)*o)}function Gn(t,r,n,i,o=1/0){const a=t.range;if(!a)return 0;const s=Math.min(o,Math.max(n,i)),l=Math.log(s/1024)/Math.LN2;return e.smoothstep(a[0]+l,a[1]+l,r)}const Wn=1/4e4;function Hn(t,r){const n=e.clamp(r.lat,-e.MAX_MERCATOR_LATITUDE,e.MAX_MERCATOR_LATITUDE),i=new e.LngLat(r.lng-180*Wn,n),o=new e.LngLat(r.lng+180*Wn,n),a=t.project(i.lng,n),s=t.project(o.lng,n),l=e.MercatorCoordinate.fromLngLat(i),c=e.MercatorCoordinate.fromLngLat(o),u=s.x-a.x,p=s.y-a.y,h=c.x-l.x,d=c.y-l.y,f=Math.sqrt((h*h+d*d)/(u*u+p*p));return Math.log(f)/Math.LN2}function Zn(e,t,r){const n=Math.cos(r),i=Math.sin(r);return{x:e*n-t*i,y:e*i+t*n}}class Xn{constructor(t,r,n,i,o,a,s){this.tileSize=512,this._renderWorldCopies=void 0===o||o,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setProjection(a),this.setMaxBounds(s),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Bn,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Vn,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const e=new Xn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return e._elevation=this._elevation,e._centerAltitude=this._centerAltitude,e._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,e.tileSize=this.tileSize,e.mercatorFromTransition=this.mercatorFromTransition,e.width=this.width,e.height=this.height,e.cameraElevationReference=this.cameraElevationReference,e._center=this._center,e._setZoom(this.zoom),e._seaLevelZoom=this._seaLevelZoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._nearZ=this._nearZ,e._farZ=this._farZ,e._averageElevation=this._averageElevation,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._camera=this._camera.clone(),e._calcMatrices(),e.freezeTileCoverage=this.freezeTileCoverage,e.frustumCorners=this.frustumCorners,e}get elevation(){return this._elevation}set elevation(e){this._elevation!==e&&(this._elevation=e,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(e,t=!1){const r=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||r)&&this._updateCameraOnTerrain(),(e||r)&&this._constrainCamera(t),this._calcMatrices()}getProjection(){return e.pick(this.projection,["name","center","parallels"])}setProjection(r){this.projectionOptions=r||{name:"mercator"};const n=this.projection?this.getProjection():void 0;this.projection=e.getProjection(this.projectionOptions);const i=!t(n,this.getProjection());return i&&this._calcMatrices(),this.mercatorFromTransition=!1,i}setMercatorFromTransition(){const t=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=e.getProjection({name:"mercator"});const r=t!==this.projection.name;return r&&this._calcMatrices(),r}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get cameraWorldSize(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return e.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.Point(this.width,this.height)}get bearing(){return e.wrap(this.rotation,-180,180)}set bearing(e){this.rotation=e}get rotation(){return-this.angle/Math.PI*180}set rotation(t){const r=-t*Math.PI/180;var n;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=(n=new e.ARRAY_TYPE(4),e.ARRAY_TYPE!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n),function(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);e[0]=n*l+o*s,e[1]=i*l+a*s,e[2]=n*-s+o*l,e[3]=i*-s+a*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const r=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const e=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/e)}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=e.degToRad(t),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(e){this._averageElevation=e,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._setZoom(t),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(e){this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const e=this._elevation;this._centerAltitude=e.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=e.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){void 0!==this._centerAltitudeValidForExaggeration&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const t=this._elevation,r=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],n=this.horizonLineFromTop();let i=0,o=0;for(let a=0;a<r.length;a++){const s=new e.Point(r[a][0]*this.width,n+r[a][1]*(this.height-n)),l=t.pointCoordinate(s);if(!l)continue;const c=1/Math.hypot(l[0]-this._camera.position[0],l[1]-this._camera.position[1]);i+=l[3]*c,o+=c}return 0===o?NaN:i/o}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._seaLevelZoom||!this._elevation)return;const e=this._seaLevelZoom,t=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),r=this.pixelsPerMeter/this.worldSize*t,n=this._mercatorZfromZoom(e),i=this._mercatorZfromZoom(this._maxZoom),o=Math.max(n-r,i);this._setZoom(this._zoomFromMercatorZ(o))}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}computeZoomRelativeTo(t){const r=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,t.toAltitude()));let n;n=t.z<this._camera.position[2]?[r.x,r.y,r.z]:[t.x,t.y,t.z];const i=e.length(e.sub([],this._camera.position,n));return e.clamp(this._zoomFromMercatorZ(i),this._minZoom,this._maxZoom)}setFreeCameraOptions(t){if(!this.height)return;if(!t.position&&!t.orientation)return;this._updateCameraState();let r=!1;if(t.orientation&&!e.exactEquals(t.orientation,this._camera.orientation)&&(r=this._setCameraOrientation(t.orientation)),t.position){const n=[t.position.x,t.position.y,t.position.z];e.exactEquals$1(n,this._camera.position)||(this._setCameraPosition(n),r=!0)}r&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const t=this._camera.position,r=new Un;return r.position=new e.MercatorCoordinate(t[0],t[1],t[2]),r.orientation=this._camera.orientation,r._elevation=this.elevation,r._renderWorldCopies=this.renderWorldCopies,r}_setCameraOrientation(t){if(!e.length$1(t))return!1;e.normalize$1(t,t);const r=e.transformQuat([],[0,0,-1],t),n=e.transformQuat([],[0,-1,0],t);if(n[2]<0)return!1;const i=Nn(r,n);return!!i&&(this._camera.orientation=i,!0)}_setCameraPosition(t){const r=this.zoomScale(this.minZoom)*this.tileSize,n=this.zoomScale(this.maxZoom)*this.tileSize,i=this.cameraToCenterDistance;t[2]=e.clamp(t[2],i/n,i/r),this._camera.position=t}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}getVisibleUnwrappedCoordinates(t){const r=[new e.UnwrappedTileID(0,t)];if(this.renderWorldCopies){const n=this.pointCoordinate(new e.Point(0,0)),i=this.pointCoordinate(new e.Point(this.width,0)),o=this.pointCoordinate(new e.Point(this.width,this.height)),a=this.pointCoordinate(new e.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,o.x,a.x)),l=Math.floor(Math.max(n.x,i.x,o.x,a.x)),c=1;for(let n=s-c;n<=l+c;n++)0!==n&&r.push(new e.UnwrappedTileID(n,t))}return r}coveringTiles(t){let r=this.coveringZoomLevel(t);const n=r,i=this.elevation&&!t.isTerrainDEM,o="mercator"===this.projection.name;if(void 0!==t.minzoom&&r<t.minzoom)return[];void 0!==t.maxzoom&&r>t.maxzoom&&(r=t.maxzoom);const a=this.locationCoordinate(this.center),s=this.center.lat,l=1<<r,c=[l*a.x,l*a.y,0],u="globe"===this.projection.name,p=!u,h=e.Frustum.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r,p),d=u?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),f=l*e.mercatorZfromAltitude(1,this.center.lat),m=this._camera.position[2]/e.mercatorZfromAltitude(1,this.center.lat),g=[l*d.x,l*d.y,m*(p?1:f)],b=this.cameraToCenterDistance/t.tileSize*(t.roundZoom?1:.502),_=this.pitch<=60&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace?r:0,y=t.isTerrainDEM&&this._elevation?1e4*this._elevation.exaggeration():this._centerAltitude,v=t.isTerrainDEM?-y:this._elevation?this._elevation.getMinElevationBelowMSL():0,x=this.projection.isReprojectedInTileSpace?$n(this):1,w=t=>{const r=1/4e4,n=new e.MercatorCoordinate(t.x+r,t.y,t.z),i=new e.MercatorCoordinate(t.x,t.y+r,t.z),o=t.toLngLat(),a=n.toLngLat(),s=i.toLngLat(),l=this.locationCoordinate(o),c=this.locationCoordinate(a),u=this.locationCoordinate(s),p=Math.hypot(c.x-l.x,c.y-l.y),h=Math.hypot(u.x-l.x,u.y-l.y);return Math.sqrt(p*h)*x/r},k=t=>{const r=y,n=v;return{aabb:e.tileAABB(this,l,0,0,0,t,n,r,this.projection),zoom:0,x:0,y:0,minZ:n,maxZ:r,wrap:t,fullyVisible:!1}},E=[];let T=[];const S=r,C=t.reparseOverscaled?n:r,A=e=>e*e,M=A((m-this._centerAltitude)*f),I=e=>{if(!this._elevation||!e.tileID||!o)return;const t=this._elevation.getMinMaxForTile(e.tileID),r=e.aabb;t?(r.min[2]=t.min,r.max[2]=t.max,r.center[2]=(r.min[2]+r.max[2])/2):(e.shouldSplit=O(e),e.shouldSplit||(r.min[2]=r.max[2]=r.center[2]=this._centerAltitude))},O=t=>{if(t.zoom<_)return!0;if(t.zoom===S)return!1;if(null!=t.shouldSplit)return t.shouldSplit;const r=t.aabb.distanceX(g),o=t.aabb.distanceY(g);let a=M,l=1;if(u){a=A(t.aabb.distanceZ(g));const r=Math.pow(2,t.zoom),n=e.latFromMercatorY((t.y+1)/r),i=e.latFromMercatorY(t.y/r),o=Math.min(Math.max(s,n),i),c=e.circumferenceAtLatitude(o)/e.circumferenceAtLatitude(s);if(l=o===s?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,c/this._mercatorScaleRatio),this.zoom<=e.GLOBE_ZOOM_THRESHOLD_MIN&&t.zoom===S-1&&c>=.9)return!0}else if(i&&(a=A(t.aabb.distanceZ(g)*f)),this.projection.isReprojectedInTileSpace&&n<=5){const r=Math.pow(2,t.zoom),n=w(new e.MercatorCoordinate((t.x+.5)/r,(t.y+.5)/r));l=n>.85?1:n}const c=r*r+o*o+a,p=A((1<<S-t.zoom)*b*l*((e,t)=>{if(t*A(.707)<e)return 1;const r=Math.sqrt(t/e);return r/(1.4144271570014144+(Math.pow(1.1,r-1.4144271570014144+1)-1)/(1.1-1)-1)})(Math.max(a,M),c));return c<p};if(this.renderWorldCopies)for(let e=1;e<=3;e++)E.push(k(-e)),E.push(k(e));for(E.push(k(0));E.length>0;){const n=E.pop(),a=n.x,s=n.y;let p=n.fullyVisible;if(!p){const e=n.aabb.intersects(h);if(0===e)continue;p=2===e}if(n.zoom!==S&&O(n))for(let t=0;t<4;t++){const r=(a<<1)+t%2,c=(s<<1)+(t>>1),h={aabb:o?n.aabb.quadrant(t):e.tileAABB(this,l,n.zoom+1,r,c,n.wrap,n.minZ,n.maxZ,this.projection),zoom:n.zoom+1,x:r,y:c,wrap:n.wrap,fullyVisible:p,tileID:void 0,shouldSplit:void 0,minZ:n.minZ,maxZ:n.maxZ};i&&!u&&(h.tileID=new e.OverscaledTileID(n.zoom+1===S?C:n.zoom+1,n.wrap,n.zoom+1,r,c),I(h)),E.push(h)}else{const i=n.zoom===S?C:n.zoom;if(t.minzoom&&t.minzoom>i)continue;const o=c[0]-(.5+a+(n.wrap<<n.zoom))*(1<<r-n.zoom),l=c[1]-.5-s,u=n.tileID?n.tileID:new e.OverscaledTileID(i,n.wrap,n.zoom,a,s);T.push({tileID:u,distanceSq:o*o+l*l})}}if(this.fogCullDistSq){const r=this.fogCullDistSq,n=this.horizonLineFromTop();T=T.filter((i=>{const o=[0,0,0,1],a=[e.EXTENT,e.EXTENT,0,1],s=this.calculateFogTileMatrix(i.tileID.toUnwrapped());e.transformMat4$1(o,o,s),e.transformMat4$1(a,a,s);const l=e.getAABBPointSquareDist(o,a);if(0===l)return!0;let c=!1;const u=this._elevation;if(u&&l>r&&0!==n){const r=this.calculateProjMatrix(i.tileID.toUnwrapped());let o;t.isTerrainDEM||(o=u.getMinMaxForTile(i.tileID)),o||(o={min:v,max:y});const a=e.furthestTileCorner(this.rotation),s=[a[0]*e.EXTENT,a[1]*e.EXTENT,o.max];e.transformMat4(s,s,r),c=(1-s[1])*this.height*.5<n}return l<r||c}))}return T.sort(((e,t)=>e.distanceSq-t.distanceSq)).map((e=>e.tileID))}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(t){const r=e.clamp(t.lat,-e.MAX_MERCATOR_LATITUDE,e.MAX_MERCATOR_LATITUDE),n=this.projection.project(t.lng,r);return new e.Point(n.x*this.worldSize,n.y*this.worldSize)}unproject(e){return this.projection.unproject(e.x/this.worldSize,e.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/e.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(t,r){let n,i;const o=this.centerPoint;if("globe"===this.projection.name){const e=this.worldSize;n=(r.x-o.x)/e,i=(r.y-o.y)/e}else{const e=this.pointCoordinate(r),t=this.pointCoordinate(o);n=e.x-t.x,i=e.y-t.y}const a=this.locationCoordinate(t);this.setLocation(new e.MercatorCoordinate(a.x-n,a.y-i))}setLocation(e){this.center=this.coordinateLocation(e),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(e){return this.projection.locationPoint(this,e)}locationPoint3D(e){return this.projection.locationPoint(this,e,!0)}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}pointLocation3D(e){return this.coordinateLocation(this.pointCoordinate3D(e))}locationCoordinate(t,r){const n=r?e.mercatorZfromAltitude(r,t.lat):void 0,i=this.projection.project(t.lng,t.lat);return new e.MercatorCoordinate(i.x,i.y,n)}coordinateLocation(e){return this.projection.unproject(e.x,e.y)}pointRayIntersection(t,r){const n=null!=r?r:this._centerAltitude,i=[t.x,t.y,0,1],o=[t.x,t.y,1,1];e.transformMat4$1(i,i,this.pixelMatrixInverse),e.transformMat4$1(o,o,this.pixelMatrixInverse);const a=o[3];e.scale$1(i,i,1/i[3]),e.scale$1(o,o,1/a);const s=i[2],l=o[2];return{p0:i,p1:o,t:s===l?0:(n-s)/(l-s)}}screenPointToMercatorRay(t){const r=[t.x,t.y,0,1],n=[t.x,t.y,1,1];return e.transformMat4$1(r,r,this.pixelMatrixInverse),e.transformMat4$1(n,n,this.pixelMatrixInverse),e.scale$1(r,r,1/r[3]),e.scale$1(n,n,1/n[3]),r[2]=e.mercatorZfromAltitude(r[2],this._center.lat)*this.worldSize,n[2]=e.mercatorZfromAltitude(n[2],this._center.lat)*this.worldSize,e.scale$1(r,r,1/this.worldSize),e.scale$1(n,n,1/this.worldSize),new e.Ray([r[0],r[1],r[2]],e.normalize([],e.sub([],n,r)))}rayIntersectionCoordinate(t){const{p0:r,p1:n,t:i}=t,o=e.mercatorZfromAltitude(r[2],this._center.lat),a=e.mercatorZfromAltitude(n[2],this._center.lat);return new e.MercatorCoordinate(e.number(r[0],n[0],i)/this.worldSize,e.number(r[1],n[1],i)/this.worldSize,e.number(o,a,i))}pointCoordinate(e,t=this._centerAltitude){return this.projection.pointCoordinate(this,e.x,e.y,t)}pointCoordinate3D(t){if(!this.elevation)return this.pointCoordinate(t);let r=this.projection.pointCoordinate3D(this,t.x,t.y);if(r)return new e.MercatorCoordinate(r[0],r[1],r[2]);let n=0,i=this.horizonLineFromTop();if(t.y>i)return this.pointCoordinate(t);const o=.02*i,a=t.clone();for(let t=0;t<10&&i-n>o;t++){a.y=e.number(n,i,.66);const t=this.projection.pointCoordinate3D(this,a.x,a.y);t?(i=a.y,r=t):n=a.y}return r?new e.MercatorCoordinate(r[0],r[1],r[2]):this.pointCoordinate(t)}isPointAboveHorizon(e){return this.projection.isPointAboveHorizon(this,e)}isPointOnSurface(t){if(t.y<0||t.y>this.height||t.x<0||t.x>this.width)return!1;if(this.elevation||this.zoom>=e.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(t);const r=this.pointCoordinate(t);return r.y>=0&&r.y<=1}_coordinatePoint(t,r){const n=r&&this.elevation?this.elevation.getAtPointOrZero(t,this._centerAltitude):this._centerAltitude,i=[t.x*this.worldSize,t.y*this.worldSize,n+t.toAltitude(),1];return e.transformMat4$1(i,i,this.pixelMatrix),i[3]>0?new e.Point(i[0]/i[3],i[1]/i[3]):new e.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:t,left:r}=this._edgeInsets,n=this.height-this._edgeInsets.bottom,i=this.width-this._edgeInsets.right,o=this.pointLocation3D(new e.Point(r,t)),a=this.pointLocation3D(new e.Point(i,t)),s=this.pointLocation3D(new e.Point(i,n)),l=this.pointLocation3D(new e.Point(r,n));let c=Math.min(o.lng,a.lng,s.lng,l.lng),u=Math.max(o.lng,a.lng,s.lng,l.lng),p=Math.min(o.lat,a.lat,s.lat,l.lat),h=Math.max(o.lat,a.lat,s.lat,l.lat);const d=Math.pow(2,-this.zoom)/16*270,f="globe"===this.projection.name?1:4,m=(t,r,n,i,o)=>{const a=(t+n)/2,s=(r+i)/2,l=new e.Point(a,s),{lng:g,lat:b}=this.pointLocation3D(l),_=Math.max(0,c-g,p-b,g-u,b-h);c=Math.min(c,g),u=Math.max(u,g),p=Math.min(p,b),h=Math.max(h,b),(o<f||_>d)&&(m(t,r,a,s,o+1),m(a,s,n,i,o+1))};if(m(r,t,i,t,1),m(i,t,i,n,1),m(i,n,r,n,1),m(r,n,r,t,1),"globe"===this.projection.name){const[t,r]=e.polesInViewport(this);t?(h=90,u=180,c=-180):r&&(p=-90,u=180,c=-180)}return new e.LngLatBounds(new e.LngLat(c,p),new e.LngLat(u,h))}_getBoundsRectangular(t,r){const{top:n,left:i}=this._edgeInsets,o=this.height-this._edgeInsets.bottom,a=this.width-this._edgeInsets.right,s=new e.Point(i,n),l=new e.Point(a,n),c=new e.Point(a,o),u=new e.Point(i,o);let p=this.pointCoordinate(s,t),h=this.pointCoordinate(l,t);const d=this.pointCoordinate(c,r),f=this.pointCoordinate(u,r),m=(e,t)=>(t.y-e.y)/(t.x-e.x);return p.y>1&&h.y>=0?p=new e.MercatorCoordinate((1-f.y)/m(f,p)+f.x,1):p.y<0&&h.y<=1&&(p=new e.MercatorCoordinate(-f.y/m(f,p)+f.x,0)),h.y>1&&p.y>=0?h=new e.MercatorCoordinate((1-d.y)/m(d,h)+d.x,1):h.y<0&&p.y<=1&&(h=new e.MercatorCoordinate(-d.y/m(d,h)+d.x,0)),(new e.LngLatBounds).extend(this.coordinateLocation(p)).extend(this.coordinateLocation(h)).extend(this.coordinateLocation(f)).extend(this.coordinateLocation(d))}_getBoundsRectangularTerrain(){const e=this.elevation;if(!e.visibleDemTiles.length||e.isUsingMockSource())return this._getBoundsRectangular(0,0);const t=e.visibleDemTiles.reduce(((e,t)=>{if(t.dem){const r=t.dem.tree;e.min=Math.min(e.min,r.minimums[0]),e.max=Math.max(e.max,r.maximums[0])}return e}),{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(t.min*e.exaggeration(),t.max*e.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(e=!0){const t=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,r=this.height/2-t*(1-this._horizonShift);return e?Math.max(0,r):r}getMaxBounds(){return this.maxBounds}setMaxBounds(t){this.maxBounds=t,this.minLat=-e.MAX_MERCATOR_LATITUDE,this.maxLat=e.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,t&&(this.minLat=t.getSouth(),this.maxLat=t.getNorth(),this.minLng=t.getWest(),this.maxLng=t.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=e.mercatorXfromLng(this.minLng)*this.tileSize,this.worldMaxX=e.mercatorXfromLng(this.maxLng)*this.tileSize,this.worldMinY=e.mercatorYfromLat(this.maxLat)*this.tileSize,this.worldMaxY=e.mercatorYfromLat(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(e,t){return this.projection.createTileMatrix(this,t,e)}calculateDistanceTileData(t){const r=t.key,n=this._distanceTileDataCache;if(n[r])return n[r];const i=t.canonical,o=1/this.height,a=this.cameraWorldSize,s=a/this.zoomScale(i.z),l=(i.x+Math.pow(2,i.z)*t.wrap)*s,c=i.y*s,u=this.point;u.x*=a/this.worldSize,u.y*=a/this.worldSize;const p=this.angle,h=Math.sin(-p),d=-Math.cos(-p);return n[r]={bearing:[h,d],center:[(u.x-l)*o,(u.y-c)*o],scale:s/e.EXTENT*o},n[r]}calculateFogTileMatrix(t){const r=t.key,n=this._fogTileMatrixCache;if(n[r])return n[r];const i=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,t);return e.multiply(i,this.worldToFogMatrix,i),n[r]=new Float32Array(i),n[r]}calculateProjMatrix(t,r=!1){const n=t.key,i=r?this._alignedProjMatrixCache:this._projMatrixCache;if(i[n])return i[n];const o=this.calculatePosMatrix(t,this.worldSize);return e.multiply(o,this.projection.isReprojectedInTileSpace?this.mercatorMatrix:r?this.alignedProjMatrix:this.projMatrix,o),i[n]=new Float32Array(o),i[n]}calculatePixelsToTileUnitsMatrix(t){const r=t.tileID.key,n=this._pixelsToTileUnitsCache;if(n[r])return n[r];const i=function(t,r){const{scale:n}=t.tileTransform,i=n*e.EXTENT/(t.tileSize*Math.pow(2,r.zoom-t.tileID.overscaledZ+t.tileID.canonical.z));return o=new Float32Array(4),l=(a=r.inverseAdjustmentMatrix)[1],c=a[2],u=a[3],h=(s=[i,i])[1],o[0]=a[0]*(p=s[0]),o[1]=l*p,o[2]=c*h,o[3]=u*h,o;var o,a,s,l,c,u,p,h}(t,this);return n[r]=i,n[r]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if("globe"===this.projection.name){const t=1/this.worldSize,r=e.fromScaling([],[t,t,t]);return e.multiply(r,r,this.globeMatrix),r}}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;const t=this._elevation;this._updateCameraState();const r=e.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,n=this._computeCameraPosition(r),i=this._camera.forward(),o=e.mercatorZfromAltitude(1,this._center.lat);n[2]/=o,i[2]/=o,e.normalize(i,i);const a=t.raycast(n,i,t.exaggeration());if(a){const t=e.scaleAndAdd([],n,i,a),r=new e.MercatorCoordinate(t[0],t[1],e.mercatorZfromAltitude(t[2],e.latFromMercatorY(t[1]))),s=(r.z+e.length([r.x-n[0],r.y-n[1],r.z-n[2]*o]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(s),this._centerAltitude=r.toAltitude(),this._center=this.coordinateLocation(r),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(t=!1){if(!this._elevation)return;const r=this._elevation,n=e.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,i=this._computeCameraPosition(n),o=r.getAtPointOrZero(new e.MercatorCoordinate(...i)),a=this.pixelsPerMeter/this.worldSize*o,s=this._minimumHeightOverTerrain(),l=i[2]-a;if(l<=s)if(l<0||t){const t=this.locationCoordinate(this._center,this._centerAltitude),r=[i[0],i[1],t.z-i[2]],n=e.length(r);r[2]-=(s-l)/this._pixelsPerMercatorPixel;const o=e.length(r);if(0===o)return;e.scale$2(r,r,n/o*this._pixelsPerMercatorPixel),this._camera.position=[i[0],i[1],t.z*this._pixelsPerMercatorPixel-r[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||t){const r=this.center;return r.lat=e.clamp(r.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!t)&&(r.lng=e.clamp(r.lng,this.minLng,this.maxLng)),this.center=r,void(this._constraining=!1)}const r=this._unmodified,{x:n,y:i}=this.point;let o=0,a=n,s=i;const l=this.width/2,c=this.height/2,u=this.worldMinY*this.scale,p=this.worldMaxY*this.scale;if(i-c<u&&(s=u+c),i+c>p&&(s=p-c),p-u<this.height&&(o=Math.max(o,this.height/(p-u)),s=(p+u)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const e=this.worldMinX*this.scale,t=this.worldMaxX*this.scale,r=this.worldSize/2-(e+t)/2;a=(n+r+this.worldSize)%this.worldSize-r,a-l<e&&(a=e+l),a+l>t&&(a=t-l),t-e<this.width&&(o=Math.max(o,this.width/(t-e)),a=(t+e)/2)}a===n&&s===i||(this.center=this.unproject(new e.Point(a,s))),o&&(this.zoom+=this.scaleZoom(o)),this._constrainCamera(),this._unmodified=r,this._constraining=!1}_minZoomForBounds(){let e=Math.max(0,this.scaleZoom(this.height/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(e=Math.max(e,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),e}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,r=this.pixelsPerMeter;"globe"===this.projection.name&&(this._mercatorScaleRatio=e.mercatorZfromAltitude(1,this.center.lat)/e.mercatorZfromAltitude(1,e.GLOBE_SCALE_MATCH_LATITUDE));const n=Gn(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,n),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const i="meters"===this.projection.zAxisUnit?r:1,o=this._camera.getWorldToCamera(this.worldSize,i),a=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);a[8]=2*-t.x/this.width,a[9]=2*t.y/this.height;let s=e.mul([],a,o);if(this.projection.isReprojectedInTileSpace){const t=this.locationCoordinate(this.center),r=e.identity([]);e.translate(r,r,[t.x*this.worldSize,t.y*this.worldSize,0]),e.multiply(r,r,qn(this)),e.translate(r,r,[-t.x*this.worldSize,-t.y*this.worldSize,0]),e.multiply(s,s,r),this.inverseAdjustmentMatrix=function(e){const t=qn(e,!0);return _([],[t[0],t[1],t[4],t[5]])}(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];this.mercatorMatrix=e.scale([],s,[this.worldSize,this.worldSize,this.worldSize/i,1]),this.projMatrix=s,this.invProjMatrix=e.invert(new Float64Array(16),this.projMatrix);const l=e.invert([],a);this.frustumCorners=e.FrustumCorners.fromInvProjectionMatrix(l,this.horizonLineFromTop(),this.height);const c=new Float32Array(16);e.identity(c),e.scale(c,c,[1,-1,1]),e.rotateX(c,c,this._pitch),e.rotateZ(c,c,this.angle);const u=e.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ),p=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;u[8]=2*-t.x/this.width,u[9]=2*(t.y+p)/this.height,this.skyboxMatrix=e.multiply(c,u,c);const h=this.point,d=h.x,f=h.y,m=this.width%2/2,g=this.height%2/2,b=Math.cos(this.angle),y=Math.sin(this.angle),v=d-Math.round(d)+b*m+y*g,x=f-Math.round(f)+b*g+y*m,w=new Float64Array(s);if(e.translate(w,w,[v>.5?v-1:v,x>.5?x-1:x,0]),this.alignedProjMatrix=w,s=e.create(),e.scale(s,s,[this.width/2,-this.height/2,1]),e.translate(s,s,[1,-1,0]),this.labelPlaneMatrix=s,s=e.create(),e.scale(s,s,[1,-1,1]),e.translate(s,s,[-1,-1,0]),e.scale(s,s,[2/this.width,2/this.height,1]),this.glCoordMatrix=s,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},s=e.invert(new Float64Array(16),this.pixelMatrix),!s)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=s,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=e.calculateGlobeMatrix(this);const t=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=e.transformMat4(t,t,o),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=s;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const t=this.cameraWorldSizeForFog,r=this.cameraPixelsPerMeter,n=this._camera.position,i=1/this.height/this._pixelsPerMercatorPixel,o=[t,t,r];e.scale$2(o,o,i),e.scale$2(n,n,-1),e.multiply$2(n,n,o);const a=e.create();e.translate(a,a,n),e.scale(a,a,o),this.mercatorFogMatrix=a,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(t,r,i)}_computeCameraPosition(e){const t=(e=e||this.pixelsPerMeter)/this.pixelsPerMeter,r=this._camera.forward(),n=this.point,i=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*t-e/this.worldSize*this._centerAltitude;return[n.x/this.worldSize-r[0]*i,n.y/this.worldSize-r[1]*i,e/this.worldSize*this._centerAltitude-r[2]*i]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(t){const r=this._maxCameraBoundsDistance()*Math.cos(this._pitch),n=this._camera.position[2],i=t[2];let o=1;this.projection.wrap&&(this.center=this.center.wrap()),i>0&&(o=Math.min((r-n)/i,1)),this._camera.position=e.scaleAndAdd([],this._camera.position,t,o),this._updateStateFromCamera()}_updateStateFromCamera(){const t=this._camera.position,r=this._camera.forward(),{pitch:n,bearing:i}=this._camera.getPitchBearing(),o=e.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,a=this._mercatorZfromZoom(this._maxZoom)*Math.cos(e.degToRad(this._maxPitch)),s=Math.max((t[2]-o)/Math.cos(n),a),l=this._zoomFromMercatorZ(s);e.scaleAndAdd(t,t,r,s),this._pitch=e.clamp(n,e.degToRad(this.minPitch),e.degToRad(this.maxPitch)),this.angle=e.wrap(i,-Math.PI,Math.PI),this._setZoom(e.clamp(l,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new e.MercatorCoordinate(t[0],t[1],t[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(e){return Math.pow(2,e)*this.tileSize}_mercatorZfromZoom(e){return this.cameraToCenterDistance/this._worldSizeFromZoom(e)}_minimumHeightOverTerrain(){const e=Math.min((null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(e)}_zoomFromMercatorZ(e){return this.scaleZoom(this.cameraToCenterDistance/(e*this.tileSize))}zoomFromMercatorZAdjusted(t){let r=0,n=e.GLOBE_ZOOM_THRESHOLD_MAX,i=0,o=1/0;for(;n-r>1e-6&&n>r;){const e=r+.5*(n-r),a=this.tileSize*Math.pow(2,e),s=this.getCameraToCenterDistance(this.projection,e,a),l=this.scaleZoom(s/(t*this.tileSize)),c=Math.abs(e-l);c<o&&(o=c,i=e),e<l?r=e:n=e}return i}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(e.warnOnce("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(t,r){const n=Math.min(t.x,r.x),i=Math.max(t.x,r.x),o=Math.min(t.y,r.y),a=Math.max(t.y,r.y);if(o<this.horizonLineFromTop(!1))return!0;if("mercator"!==this.projection.name)return!1;const s=[new e.Point(n,o),new e.Point(i,a),new e.Point(n,a),new e.Point(i,o)],l=this.renderWorldCopies?-3:0,c=this.renderWorldCopies?4:1;for(const e of s){const t=this.pointRayIntersection(e);if(t.t<0)return!0;const r=this.rayIntersectionCoordinate(t);if(r.x<l||r.y<0||r.x>c||r.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+e.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new e.Point(0,0),new e.Point(this.width,this.height))}zoomDeltaToMovement(t,r){const n=e.length(e.sub([],this._camera.position,t)),i=this._zoomFromMercatorZ(n)+r;return n-this._mercatorZfromZoom(i)}getCameraPoint(){if("globe"===this.projection.name){const t=function([t,r,n],i){const o=[t,r,n,1];e.transformMat4$1(o,o,i);const a=o[3]=Math.max(o[3],1e-6);return o[0]/=a,o[1]/=a,o[2]/=a,o}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new e.Point(t[0],t[1])}{const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,t))}}getCameraToCenterDistance(e,t=this.zoom,r=this.worldSize){const n=Gn(e,t,this.width,this.height,1024),i=e.pixelSpaceConversion(this.center.lat,r,n);return.5/Math.tan(.5*this._fov)*this.height*i}getWorldToCameraMatrix(){const t=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&e.multiply(t,t,this.globeMatrix),t}}function Kn(e,t){let r=!1,n=null;const i=()=>{n=null,r&&(e(),n=setTimeout(i,t),r=!1)};return()=>(r=!0,n||i(),n)}class Yn{constructor(t){this._hashName=t&&encodeURIComponent(t),e.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Kn(this._updateHashUnthrottled.bind(this),300)}addTo(t){return this._map=t,e.window.addEventListener("hashchange",this._onHashChange,!1),t.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),e.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const t=this._map;if(!t)return"";const r=Jn(t);if(this._hashName){const t=this._hashName;let n=!1;const i=e.window.location.hash.slice(1).split("&").map((e=>{const i=e.split("=")[0];return i===t?(n=!0,`${i}=${r}`):e})).filter((e=>e));return n||i.push(`${t}=${r}`),`#${i.join("&")}`}return`#${r}`}_getCurrentHash(){const t=e.window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map((e=>e.split("="))).forEach((t=>{t[0]===this._hashName&&(e=t)})),(e&&e[1]||"").split("/")}return t.split("/")}_onHashChange(){const e=this._map;if(!e)return!1;const t=this._getCurrentHash();if(t.length>=3&&!t.some((e=>isNaN(e)))){const r=e.dragRotate.isEnabled()&&e.touchZoomRotate.isEnabled()?+(t[3]||0):e.getBearing();return e.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:r,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){const t=e.window.location.href.replace(/(#.+)?$/,this.getHashString());e.window.history.replaceState(e.window.history.state,null,t)}}function Jn(e,t){const r=e.getCenter(),n=Math.round(100*e.getZoom())/100,i=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,i),a=Math.round(r.lng*o)/o,s=Math.round(r.lat*o)/o,l=e.getBearing(),c=e.getPitch();let u=t?`/${a}/${s}/${n}`:`${n}/${s}/${a}`;return(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+=`/${Math.round(c)}`),u}const Qn={linearity:.3,easing:e.bezier(0,0,.3,1)},ei=e.extend({deceleration:2500,maxSpeed:1400},Qn),ti=e.extend({deceleration:20,maxSpeed:1400},Qn),ri=e.extend({deceleration:1e3,maxSpeed:360},Qn),ni=e.extend({deceleration:1e3,maxSpeed:90},Qn);class ii{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.exported.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,r=e.exported.now();for(;t.length>0&&r-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._map._prefersReducedMotion())return;if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)r.zoom+=e.zoomDelta||0,r.bearing+=e.bearingDelta||0,r.pitch+=e.pitchDelta||0,e.panDelta&&r.pan._add(e.panDelta),e.around&&(r.around=e.around),e.pinchAround&&(r.pinchAround=e.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(r.pan.mag()){const o=ai(r.pan.mag(),n,e.extend({},ei,t||{}));i.offset=r.pan.mult(o.amount/r.pan.mag()),i.center=this._map.transform.center,oi(i,o)}if(r.zoom){const e=ai(r.zoom,n,ti);i.zoom=this._map.transform.zoom+e.amount,oi(i,e)}if(r.bearing){const t=ai(r.bearing,n,ri);i.bearing=this._map.transform.bearing+e.clamp(t.amount,-179,179),oi(i,t)}if(r.pitch){const e=ai(r.pitch,n,ni);i.pitch=this._map.transform.pitch+e.amount,oi(i,e)}if(i.zoom||i.bearing){const e=void 0===r.pinchAround?r.around:r.pinchAround;i.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),i.noMoveStart=!0,i}}function oi(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function ai(t,r,n){const{maxSpeed:i,linearity:o,deceleration:a}=n,s=e.clamp(t*o/(r/1e3),-i,i),l=Math.abs(s)/(a*o);return{easing:n.easing,duration:1e3*l,amount:s*(l/2)}}class si extends e.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,r,n,i={}){const o=f(r.getCanvasContainer(),n),a=r.unproject(o);super(t,e.extend({point:o,lngLat:a,originalEvent:n},i)),this._defaultPrevented=!1,this.target=r}}class li extends e.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,r,n){const i="touchend"===t?n.changedTouches:n.touches,o=m(r.getCanvasContainer(),i),a=o.map((e=>r.unproject(e))),s=o.reduce(((e,t,r,n)=>e.add(t.div(n.length))),new e.Point(0,0));super(t,{points:o,point:s,lngLats:a,lngLat:r.unproject(s),originalEvent:n}),this._defaultPrevented=!1}}class ci extends e.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,r){super(e,{originalEvent:r}),this._defaultPrevented=!1}}class ui{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){this._mousedownPos=void 0}wheel(e){return this._firePreventable(new ci(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new si(e.type,this._map,e))}mouseup(e){this._map.fire(new si(e.type,this._map,e))}preclick(t){const r=e.extend({},t);r.type="preclick",this._map.fire(new si(r.type,this._map,r))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||(this.preclick(e),this._map.fire(new si(e.type,this._map,e)))}dblclick(e){return this._firePreventable(new si(e.type,this._map,e))}mouseover(e){this._map.fire(new si(e.type,this._map,e))}mouseout(e){this._map.fire(new si(e.type,this._map,e))}touchstart(e){return this._firePreventable(new li(e.type,this._map,e))}touchmove(e){this._map.fire(new li(e.type,this._map,e))}touchend(e){this._map.fire(new li(e.type,this._map,e))}touchcancel(e){this._map.fire(new li(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class pi{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(e){this._map.fire(new si(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new si("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new si(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class hi{constructor(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(u(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const r=t,n=this._startPos,i=this._lastPos;if(!n||!i||i.equals(r)||!this._box&&r.dist(n)<this._clickTolerance)return;this._lastPos=r,this._box||(this._box=o("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));const a=Math.min(n.x,r.x),s=Math.max(n.x,r.x),l=Math.min(n.y,r.y),c=Math.max(n.y,r.y);this._map._requestDomTask((()=>{this._box&&(this._box.style.transform=`translate(${a}px,${l}px)`,this._box.style.width=s-a+"px",this._box.style.height=c-l+"px")}))}mouseupWindow(t,r){if(!this._active)return;const n=this._startPos,i=r;if(n&&0===t.button){if(this.reset(),d(),n.x!==i.x||n.y!==i.y)return this._map.fire(new e.Event("boxzoomend",{originalEvent:t})),{cameraAnimation:e=>e.fitScreenCoordinates(n,i,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",t)}}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),p(),delete this._startPos,delete this._lastPos}_fireEvent(t,r){return this._map.fire(new e.Event(t,{originalEvent:r}))}}function di(e,t){const r={};for(let n=0;n<e.length;n++)r[e[n].identifier]=t[n];return r}class fi{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(t,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){const r=new e.Point(0,0);for(const e of t)r._add(e);return r.div(t.length)}(r),this.touches=di(n,r)))}touchmove(e,t,r){if(this.aborted||!this.centroid)return;const n=di(r,t);for(const e in this.touches){const t=n[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class mi{constructor(e){this.singleTap=new fi(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(e,t,r){this.singleTap.touchstart(e,t,r)}touchmove(e,t,r){this.singleTap.touchmove(e,t,r)}touchend(e,t,r){const n=this.singleTap.touchend(e,t,r);if(n){const t=e.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(n)<30;if(t&&r||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class gi{constructor(){this._zoomIn=new mi({numTouches:1,numTaps:2}),this._zoomOut=new mi({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)}touchmove(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)}touchend(e,t,r){const n=this._zoomIn.touchend(e,t,r),i=this._zoomOut.touchend(e,t,r);return n?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(n)},{originalEvent:e})}):i?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(i)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const bi={0:1,2:2};class _i{constructor(e){this.reset(),this._clickTolerance=e.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(e,t){return!1}_move(e,t){return{}}mousedown(e,t){if(this._lastPoint)return;const r=g(e);this._correctButton(e,r)&&(this._lastPoint=t,this._eventButton=r)}mousemoveWindow(e,t){const r=this._lastPoint;if(r)if(e.preventDefault(),null!=this._eventButton&&function(e,t){const r=bi[t];return void 0===e.buttons||(e.buttons&r)!==r}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=t,this._move(r,t)}mouseupWindow(e){this._lastPoint&&g(e)===this._eventButton&&(this._moved&&d(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class yi extends _i{mousedown(e,t){super.mousedown(e,t),this._lastPoint&&(this._active=!0)}_correctButton(e,t){return 0===t&&!e.ctrlKey}_move(e,t){return{around:t,panDelta:t.sub(e)}}}class vi extends _i{_correctButton(e,t){return 0===t&&e.ctrlKey||2===t}_move(e,t){const r=.8*(t.x-e.x);if(r)return this._active=!0,{bearingDelta:r}}contextmenu(e){e.preventDefault()}}class xi extends _i{_correctButton(e,t){return 0===t&&e.ctrlKey||2===t}_move(e,t){const r=-.5*(t.y-e.y);if(r)return this._active=!0,{pitchDelta:r}}contextmenu(e){e.preventDefault()}}class wi{constructor(t,r){this._map=t,this._el=t.getCanvasContainer(),this._minTouches=1,this._clickTolerance=r.clickTolerance||1,this.reset(),e.bindAll(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new e.Point(0,0)}touchstart(e,t,r){return this._calculateTransform(e,t,r)}touchmove(t,r,n){if(this._active&&!(n.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(1===n.length&&!e.isFullscreen())return void this._showTouchPanBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return t.cancelable&&t.preventDefault(),this._calculateTransform(t,r,n)}}touchend(e,t,r){this._calculateTransform(e,t,r),this._active&&r.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,r,n){n.length>0&&(this._active=!0);const i=di(n,r),o=new e.Point(0,0),a=new e.Point(0,0);let s=0;for(const e in i){const t=i[e],r=this._touches[e];r&&(o._add(t),a._add(t.sub(r)),s++,i[e]=t)}if(this._touches=i,s<this._minTouches||!a.mag())return;const l=a.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(s),panDelta:l}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=o("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")}),500)}}class ki{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(e){}_move(e,t,r){return{}}touchstart(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,r){const n=this._firstTwoTouches;if(!n)return;e.preventDefault();const[i,o]=n,a=Ei(r,t,i),s=Ei(r,t,o);if(!a||!s)return;const l=this._aroundCenter?null:a.add(s).div(2);return this._move([a,s],l,e)}touchend(e,t,r){if(!this._firstTwoTouches)return;const[n,i]=this._firstTwoTouches,o=Ei(r,t,n),a=Ei(r,t,i);o&&a||(this._active&&d(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Ei(e,t,r){for(let n=0;n<e.length;n++)if(e[n].identifier===r)return t[n]}function Ti(e,t){return Math.log(e/t)/Math.LN2}class Si extends ki{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){const r=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(Ti(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Ti(this._distance,r),pinchAround:t}}}function Ci(e,t){return 180*e.angleWith(t)/Math.PI}class Ai extends ki{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t){const r=this._vector;if(this._vector=e[0].sub(e[1]),r&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:Ci(this._vector,r),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const t=25/(Math.PI*this._minDiameter)*360,r=this._startVector;if(!r)return!1;const n=Ci(e,r);return Math.abs(n)<t}}function Mi(e){return Math.abs(e.y)>Math.abs(e.x)}class Ii extends ki{constructor(e){super(),this._map=e}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(e){this._lastPoints=e,Mi(e[0].sub(e[1]))&&(this._valid=!1)}_move(t,r,n){const i=this._lastPoints;if(!i)return;const o=t[0].sub(i[0]),a=t[1].sub(i[1]);return this._map._cooperativeGestures&&!e.isFullscreen()&&n.touches.length<3||(this._valid=this.gestureBeginsVertically(o,a,n.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(o.y+a.y)/2*-.5})}gestureBeginsVertically(e,t,r){if(void 0!==this._valid)return this._valid;const n=e.mag()>=2,i=t.mag()>=2;if(!n&&!i)return;if(!n||!i)return null==this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;const o=e.y>0==t.y>0;return Mi(e)&&Mi(t)&&o}}const Oi={panStep:100,bearingStep:15,pitchStep:10};class Li{constructor(){const e=Oi;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,r=0,n=0,i=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),i=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),i=1);break;case 38:e.shiftKey?n=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?n=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:a=>{const s=a.getZoom();a.easeTo({duration:300,easeId:"keyboardHandler",easing:zi,zoom:t?Math.round(s)+t*(e.shiftKey?2:1):s,bearing:a.getBearing()+r*this._bearingStep,pitch:a.getPitch()+n*this._pitchStep,offset:[-i*this._panStep,-o*this._panStep],center:a.getCenter()},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function zi(e){return e*(2-e)}const Di=4.000244140625;class Pi{constructor(t,r){this._map=t,this._el=t.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,e.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(t.ctrlKey||t.metaKey||this.isZooming()||e.isFullscreen()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let r=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const n=e.exported.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%Di==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}_onTimeout(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const t=f(this._el,e);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:t,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._map.transform;"wheel"===this._type&&t.projection.wrap&&(t._center.lng>=180||t._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const r=()=>t._terrainEnabled()&&this._aroundCoord?t.computeZoomRelativeTo(this._aroundCoord):t.zoom;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>Di?this._wheelZoomRate:this._defaultZoomRate;let n=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==n&&(n=1/n);const i=r(),o=Math.pow(2,i),a="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):o;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(a*n))),"wheel"===this._type&&(this._startZoom=i,this._easing=this._smoothOutEasing(200)),this._delta=0}const n="number"==typeof this._targetZoom?this._targetZoom:r(),i=this._startZoom,o=this._easing;let a,s=!1;if("wheel"===this._type&&i&&o){const t=Math.min((e.exported.now()-this._lastWheelEventTime)/200,1),r=o(t);a=e.number(i,n,r),t<1?this._frameId||(this._frameId=!0):s=!0}else a=n,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:a-r(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let r=e.ease;if(this._prevEase){const t=this._prevEase,n=(e.exported.now()-t.start)/t.duration,i=t.easing(n+.01)-t.easing(n),o=.27/Math.sqrt(i*i+1e-4)*.01,a=Math.sqrt(.0729-o*o);r=e.bezier(o,a,.25,1)}return this._prevEase={start:e.exported.now(),duration:t,easing:r},r}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=o("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(e.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")}),200)}}class Ri{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Bi{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(e,t){return e.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:r.getZoom()+(e.shiftKey?-1:1),around:r.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Fi{constructor(){this._tap=new mi({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(e,t,r){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=t[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(e,t,r))}touchmove(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;const n=t[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,r)}touchend(e,t,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(e,t,r)&&(this._tapTime=e.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ji{constructor(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Ni{constructor(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Ui{constructor(e,t,r,n){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const Vi=e=>e.zoom||e.drag||e.pitch||e.rotate;class qi extends e.Event{}class $i{constructor(){this.constants=[1,1,.01],this.radius=0}setup(t,r){const n=e.sub([],r,t);this.radius=e.length(n[2]<0?e.div([],n,this.constants):[n[0],n[1],0])}projectRay(t){e.div(t,t,this.constants),e.normalize(t,t),e.mul$1(t,t,this.constants);const r=e.scale$2([],t,this.radius);if(r[2]>0){const t=e.scale$2([],[0,0,1],e.dot(r,[0,0,1])),n=e.scale$2([],e.normalize([],[r[0],r[1],0]),this.radius),i=e.add([],r,e.scale$2([],e.sub([],e.add([],n,t),r),2));r[0]=i[0],r[1]=i[1]}return r}}function Gi(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class Wi{constructor(t,r){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ii(t),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new $i,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(r),e.bindAll(["handleEvent","handleWindowEvent"],this);const n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[e.window,"blur",void 0]];for(const[t,r,n]of this._listeners)t.addEventListener(r,t===e.window.document?this.handleWindowEvent:this.handleEvent,n)}destroy(){for(const[t,r,n]of this._listeners)t.removeEventListener(r,t===e.window.document?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(e){const t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new ui(t,e));const n=t.boxZoom=new hi(t,e);this._add("boxZoom",n);const i=new gi,o=new Bi;t.doubleClickZoom=new Ri(o,i),this._add("tapZoom",i),this._add("clickZoom",o);const a=new Fi;this._add("tapDragZoom",a);const s=t.touchPitch=new Ii(t);this._add("touchPitch",s);const l=new vi(e),c=new xi(e);t.dragRotate=new Ni(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const u=new yi(e),p=new wi(t,e);t.dragPan=new ji(r,u,p),this._add("mousePan",u),this._add("touchPan",p,["touchZoom","touchRotate"]);const h=new Ai,d=new Si;t.touchZoomRotate=new Ui(r,d,h,a),this._add("touchRotate",h,["touchPan","touchZoom"]),this._add("touchZoom",d,["touchPan","touchRotate"]),this._add("blockableMapEvent",new pi(t));const f=t.scrollZoom=new Pi(t,this);this._add("scrollZoom",f,["mousePan"]);const m=t.keyboard=new Li;this._add("keyboard",m);for(const r of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])e.interactive&&e[r]&&t[r].enable(e[r])}_add(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(const{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Vi(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(e,t,r){for(const n in e)if(n!==r&&(!t||t.indexOf(n)<0))return!0;return!1}handleWindowEvent(e){this.handleEvent(e,`${e.type}Window`)}_getMapTouches(e){const t=[];for(const r of e)this._el.contains(r.target)&&t.push(r);return t}handleEvent(e,t){this._updatingCamera=!0;const r="renderFrame"===e.type,n=r?void 0:e,i={needsRenderFrame:!1},o={},a={},s=e.touches?this._getMapTouches(e.touches):void 0,l=s?m(this._el,s):r?void 0:f(this._el,e);for(const{handlerName:r,handler:c,allowed:u}of this._handlers){if(!c.isEnabled())continue;let p;this._blockedByActive(a,u,r)?c.reset():c[t||e.type]&&(p=c[t||e.type](e,l,s),this.mergeHandlerResult(i,o,p,r,n),p&&p.needsRenderFrame&&this._triggerRenderFrame()),(p||c.isActive())&&(a[r]=c)}const c={};for(const e in this._previousActiveHandlers)a[e]||(c[e]=n);this._previousActiveHandlers=a,(Object.keys(c).length||Gi(i))&&(this._changes.push([i,o,c]),this._triggerRenderFrame()),(Object.keys(a).length||Gi(i))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:u}=i;u&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],u(this._map))}mergeHandlerResult(t,r,n,i,o){if(!n)return;e.extend(t,n);const a={handlerName:i,originalEvent:n.originalEvent||o};void 0!==n.zoomDelta&&(r.zoom=a),void 0!==n.panDelta&&(r.drag=a),void 0!==n.pitchDelta&&(r.pitch=a),void 0!==n.bearingDelta&&(r.rotate=a)}_applyChanges(){const t={},r={},n={};for(const[i,o,a]of this._changes)i.panDelta&&(t.panDelta=(t.panDelta||new e.Point(0,0))._add(i.panDelta)),i.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+i.pitchDelta),void 0!==i.around&&(t.around=i.around),void 0!==i.aroundCoord&&(t.aroundCoord=i.aroundCoord),void 0!==i.pinchAround&&(t.pinchAround=i.pinchAround),i.noInertia&&(t.noInertia=i.noInertia),e.extend(r,o),e.extend(n,a);this._updateMapTransform(t,r,n),this._changes=[]}_updateMapTransform(t,r,n){const i=this._map,o=i.transform,a=e=>[e.x,e.y,e.z];if((e=>{const t=this._eventsInProgress.drag;return t&&!this._handlersById[t.handlerName].isActive()})()&&!Gi(t)){const e=o.zoom;o.cameraElevationReference="sea",o.recenterOnTerrain(),o.cameraElevationReference="ground",e!==o.zoom&&this._map._update(!0)}if(o._isCameraConstrained&&i._stop(!0),!Gi(t))return void this._fireEvents(r,n,!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:u,around:p,aroundCoord:h,pinchAround:d}=t;o._isCameraConstrained&&(l>0&&(l=0),o._isCameraConstrained=!1),void 0!==d&&(p=d),(l||(e=>r[e]&&!this._eventsInProgress[e])("drag"))&&p&&(this._dragOrigin=a(o.pointCoordinate3D(p)),this._trackingEllipsoid.setup(o._camera.position,this._dragOrigin)),o.cameraElevationReference="sea",i._stop(!0),p=p||i.transform.centerPoint,c&&(o.bearing+=c),u&&(o.pitch+=u),o._updateCameraState();const f=[0,0,0];if(s)if("mercator"===o.projection.name){const e=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(p).dir),t=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(p.sub(s)).dir);f[0]=t[0]-e[0],f[1]=t[1]-e[1]}else{const t=o.pointCoordinate(p);if("globe"===o.projection.name){s=s.rotate(-o.angle);const r=o._pixelsPerMercatorPixel/o.worldSize;f[0]=-s.x*e.mercatorScale(e.latFromMercatorY(t.y))*r,f[1]=-s.y*e.mercatorScale(o.center.lat)*r}else{const e=o.pointCoordinate(p.sub(s));t&&e&&(f[0]=e.x-t.x,f[1]=e.y-t.y)}}const m=o.zoom,g=[0,0,0];if(l){const t=a(h||o.pointCoordinate3D(p)),r={dir:e.normalize([],e.sub([],t,o._camera.position))};if(r.dir[2]<0){const n=o.zoomDeltaToMovement(t,l);e.scale$2(g,r.dir,n)}}const b=e.add(f,f,g);o._translateCameraConstrained(b),l&&Math.abs(o.zoom-m)>1e-4&&o.recenterOnTerrain(),o.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(r,n,!0)}_fireEvents(t,r,n){const i=Vi(this._eventsInProgress),o=Vi(t),a={};for(const e in t){const{originalEvent:r}=t[e];this._eventsInProgress[e]||(a[`${e}start`]=r),this._eventsInProgress[e]=t[e]}!i&&o&&this._fireEvent("movestart",o.originalEvent);for(const e in a)this._fireEvent(e,a[e]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:r}=t[e];this._fireEvent(e,r)}const s={};let l;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:n}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=r[t]||n,s[`${e}end`]=l)}for(const e in s)this._fireEvent(e,s[e]);const c=Vi(this._eventsInProgress);if(n&&(i||o)&&!c){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;t?(r(t.bearing||this._map.getBearing())&&(t.bearing=0),this._map.easeTo(t,{originalEvent:l})):(this._map.fire(new e.Event("moveend",{originalEvent:l})),r(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,r){this._map.fire(new e.Event(t,r?{originalEvent:r}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{this._frameId=void 0,this.handleEvent(new qi("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const Hi="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Zi extends e.Evented{constructor(t,r){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=r.bearingSnap,this._respectPrefersReducedMotion=!1!==r.respectPrefersReducedMotion,e.bindAll(["_renderFrameCallback"],this)}getCenter(){return new e.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(t,r,n){return t=e.Point.convert(t).mult(-1),this.panTo(this.transform.center,e.extend({offset:t},r),n)}panTo(t,r,n){return this.easeTo(e.extend({center:t},r),n)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(t,r,n){return this.easeTo(e.extend({zoom:t},r),n)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(t,r,n){return this.easeTo(e.extend({bearing:t},r),n)}resetNorth(t,r){return this.rotateTo(0,e.extend({duration:1e3},t),r),this}resetNorthPitch(t,r){return this.easeTo(e.extend({bearing:0,pitch:0,duration:1e3},t),r),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}cameraForBounds(t,r){t=e.LngLatBounds.convert(t);const n=r&&r.bearing||0,i=r&&r.pitch||0,o=t.getNorthWest(),a=t.getSouthEast();return this._cameraForBounds(this.transform,o,a,n,i,r)}_extendCameraOptions(t){const r={top:0,bottom:0,right:0,left:0};if("number"==typeof(t=e.extend({padding:r,offset:[0,0],maxZoom:this.transform.maxZoom},t)).padding){const e=t.padding;t.padding={top:e,bottom:e,right:e,left:e}}return t.padding=e.extend(r,t.padding),t}_minimumAABBFrustumDistance(e,t){const r=t.max[0]-t.min[0],n=t.max[1]-t.min[1];return r/n>e.aspect?r/(2*Math.tan(.5*e.fovX)*e.aspect):n/(2*Math.tan(.5*e.fovY)*e.aspect)}_cameraForBoundsOnGlobe(t,r,n,i,o,a){const s=t.clone(),l=this._extendCameraOptions(a);s.bearing=i,s.pitch=o;const c=e.LngLat.convert(r),u=e.LngLat.convert(n),p=.5*(c.lat+u.lat),h=.5*(c.lng+u.lng),d=e.latLngToECEF(p,h),f=e.normalize([],d),m=e.normalize([],e.cross([],f,[0,1,0])),g=e.cross([],m,f),b=[m[0],m[1],m[2],0,g[0],g[1],g[2],0,f[0],f[1],f[2],0,0,0,0,1],_=[d,e.latLngToECEF(c.lat,c.lng),e.latLngToECEF(u.lat,c.lng),e.latLngToECEF(u.lat,u.lng),e.latLngToECEF(c.lat,u.lng),e.latLngToECEF(p,c.lng),e.latLngToECEF(p,u.lng),e.latLngToECEF(c.lat,h),e.latLngToECEF(u.lat,h)];let y=e.Aabb.fromPoints(_.map((t=>[e.dot(m,t),e.dot(g,t),e.dot(f,t)])));const v=e.transformMat4([],y.center,b);0===e.squaredLength(v)&&e.set(v,0,0,1),e.normalize(v,v),e.scale$2(v,v,e.GLOBE_RADIUS),s.center=e.ecefToLatLng(v);const x=s.getWorldToCameraMatrix(),w=e.invert(new Float64Array(16),x);y=e.Aabb.applyTransform(y,e.multiply([],x,b)),e.transformMat4(v,v,x);const k=.5*(y.max[2]-y.min[2]),E=this._minimumAABBFrustumDistance(s,y),T=e.scale$2([],[0,0,1],k),S=e.add(T,v,T),C=E+(0===s.pitch?0:e.distance(v,S)),A=s.globeCenterInViewSpace,M=e.sub([],v,[A[0],A[1],A[2]]);e.normalize(M,M),e.scale$2(M,M,C);const I=e.add([],v,M);e.transformMat4(I,I,w);const O=e.earthRadius/e.GLOBE_RADIUS,L=e.length(I),z=e.mercatorZfromAltitude(Math.max(L*O-e.earthRadius,Number.EPSILON),0),D=Math.min(s.zoomFromMercatorZAdjusted(z),l.maxZoom);return D>.5*(e.GLOBE_ZOOM_THRESHOLD_MIN+e.GLOBE_ZOOM_THRESHOLD_MAX)?(s.setProjection({name:"mercator"}),s.zoom=D,this._cameraForBounds(s,r,n,i,o,a)):{center:s.center,zoom:D,bearing:i,pitch:o}}queryTerrainElevation(t,r){const n=this.transform.elevation;return n?(r=e.extend({},{exaggerated:!0},r),n.getAtPoint(e.MercatorCoordinate.fromLngLat(t),null,r.exaggerated)):null}_cameraForBounds(t,r,n,i,o,a){if("globe"===t.projection.name)return this._cameraForBoundsOnGlobe(t,r,n,i,o,a);const s=t.clone(),l=this._extendCameraOptions(a),c=s.padding;s.bearing=i,s.pitch=o;const u=e.LngLat.convert(r),p=e.LngLat.convert(n),h=new e.LngLat(u.lng,p.lat),d=new e.LngLat(p.lng,u.lat),f=s.project(u),m=s.project(p),g=this.queryTerrainElevation(u),b=this.queryTerrainElevation(p),_=this.queryTerrainElevation(h),y=this.queryTerrainElevation(d),v=[[f.x,f.y,Math.min(g||0,b||0,_||0,y||0)],[m.x,m.y,Math.max(g||0,b||0,_||0,y||0)]];let x=e.Aabb.fromPoints(v);const w=s.getWorldToCameraMatrix(),k=e.invert(new Float64Array(16),w);x=e.Aabb.applyTransform(x,w);const E=e.sub([],x.max,x.min),T=c.left||0,S=c.right||0,C=c.bottom||0,A=c.top||0,{left:M,right:I,top:O,bottom:L}=l.padding,z=.5*(T+S),D=.5*(A+C),P=Math.min(s.scaleZoom(s.scale*Math.min((s.width-(T+S+M+I))/E[0],(s.height-(C+A+L+O))/E[1])),l.maxZoom),R=s.scale/s.zoomScale(P);x=new e.Aabb([x.min[0]-(M+z)*R,x.min[1]-(L+D)*R,x.min[2]],[x.max[0]+(I+z)*R,x.max[1]+(O+D)*R,x.max[2]]);const B=.5*E[2],F=this._minimumAABBFrustumDistance(s,x),j=[0,0,1,0];e.transformMat4$1(j,j,w),e.normalize$2(j,j);const N=e.scale$2([],j,F+B),U=e.add([],x.center,N),V=("number"==typeof l.offset.x&&"number"==typeof l.offset.y?new e.Point(l.offset.x,l.offset.y):e.Point.convert(l.offset)).rotate(-e.degToRad(i));x.center[0]-=V.x*R,x.center[1]+=V.y*R,e.transformMat4(x.center,x.center,k),e.transformMat4(U,U,k);const q=[x.center[0],x.center[1],U[2]*s.pixelsPerMeter];e.scale$2(q,q,1/s.worldSize);const $=e.lngFromMercatorX(q[0]),G=e.latFromMercatorY(q[1]),W=Math.min(s._zoomFromMercatorZ(q[2]),l.maxZoom),H=new e.LngLat($,G);return s.mercatorFromTransition&&W<.5*(e.GLOBE_ZOOM_THRESHOLD_MIN+e.GLOBE_ZOOM_THRESHOLD_MAX)?(s.setProjection({name:"globe"}),s.zoom=W,this._cameraForBounds(s,r,n,i,o,a)):{center:H,zoom:W,bearing:i,pitch:o}}fitBounds(e,t,r){const n=this.cameraForBounds(e,t);return this._fitInternal(n,t,r)}fitScreenCoordinates(t,r,n,i,o){const a=e.Point.convert(t),s=e.Point.convert(r),l=new e.Point(Math.min(a.x,s.x),Math.min(a.y,s.y)),c=new e.Point(Math.max(a.x,s.x),Math.max(a.y,s.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(a,s))return this;const u=this.transform.pointLocation3D(l),p=this.transform.pointLocation3D(c),h=this.transform.pointLocation3D(new e.Point(l.x,c.y)),d=this.transform.pointLocation3D(new e.Point(c.x,l.y)),f=[Math.min(u.lng,p.lng,h.lng,d.lng),Math.min(u.lat,p.lat,h.lat,d.lat)],m=[Math.max(u.lng,p.lng,h.lng,d.lng),Math.max(u.lat,p.lat,h.lat,d.lat)],g=i&&i.pitch?i.pitch:this.getPitch(),b=this._cameraForBounds(this.transform,f,m,n,g,i);return this._fitInternal(b,i,o)}_fitInternal(t,r,n){return t?(delete(r=e.extend(t,r)).padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this}jumpTo(t,r){this.stop();const n=t.preloadOnly?this.transform.clone():this.transform;let i=!1,o=!1,a=!1;return"zoom"in t&&n.zoom!==+t.zoom&&(i=!0,n.zoom=+t.zoom),void 0!==t.center&&(n.center=e.LngLat.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(o=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(a=!0,n.pitch=+t.pitch),null==t.padding||n.isPaddingEqual(t.padding)||(n.padding=t.padding),t.preloadOnly?(this._preloadTiles(n),this):(this.fire(new e.Event("movestart",r)).fire(new e.Event("move",r)),i&&this.fire(new e.Event("zoomstart",r)).fire(new e.Event("zoom",r)).fire(new e.Event("zoomend",r)),o&&this.fire(new e.Event("rotatestart",r)).fire(new e.Event("rotate",r)).fire(new e.Event("rotateend",r)),a&&this.fire(new e.Event("pitchstart",r)).fire(new e.Event("pitch",r)).fire(new e.Event("pitchend",r)),this.fire(new e.Event("moveend",r)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||e.warnOnce(Hi),this.transform.getFreeCameraOptions()}setFreeCameraOptions(t,r){const n=this.transform;if(!n.projection.supportsFreeCamera)return e.warnOnce(Hi),this;this.stop();const i=n.zoom,o=n.pitch,a=n.bearing;n.setFreeCameraOptions(t);const s=i!==n.zoom,l=o!==n.pitch,c=a!==n.bearing;return this.fire(new e.Event("movestart",r)).fire(new e.Event("move",r)),s&&this.fire(new e.Event("zoomstart",r)).fire(new e.Event("zoom",r)).fire(new e.Event("zoomend",r)),c&&this.fire(new e.Event("rotatestart",r)).fire(new e.Event("rotate",r)).fire(new e.Event("rotateend",r)),l&&this.fire(new e.Event("pitchstart",r)).fire(new e.Event("pitch",r)).fire(new e.Event("pitchend",r)),this.fire(new e.Event("moveend",r)),this}easeTo(t,r){this._stop(!1,t.easeId),(!1===(t=e.extend({offset:[0,0],duration:500,easing:e.ease},t)).animate||this._prefersReducedMotion(t))&&(t.duration=0);const n=this.transform,i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?+t.zoom:i,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,p="padding"in t?t.padding:n.padding,h=e.Point.convert(t.offset);let d,f,m;if("globe"===n.projection.name){const r=e.MercatorCoordinate.fromLngLat(n.center),i=h.rotate(-n.angle);r.x+=i.x/n.worldSize,r.y+=i.y/n.worldSize;const o=r.toLngLat(),a=e.LngLat.convert(t.center||o);this._normalizeCenter(a),d=n.centerPoint.add(i),f=new e.Point(r.x,r.y).mult(n.worldSize),m=new e.Point(e.mercatorXfromLng(a.lng),e.mercatorYfromLat(a.lat)).mult(n.worldSize).sub(f)}else{d=n.centerPoint.add(h);const r=n.pointLocation(d),i=e.LngLat.convert(t.center||r);this._normalizeCenter(i),f=n.project(r),m=n.project(i).sub(f)}const g=n.zoomScale(l-i);let b,_;t.around&&(b=e.LngLat.convert(t.around),_=n.locationPoint(b));const y=this._zooming||l!==i,v=this._rotating||o!==c,x=this._pitching||u!==a,w=!n.isPaddingEqual(p),k=n=>k=>{if(y&&(n.zoom=e.number(i,l,k)),v&&(n.bearing=e.number(o,c,k)),x&&(n.pitch=e.number(a,u,k)),w&&(n.interpolatePadding(s,p,k),d=n.centerPoint.add(h)),b)n.setLocationAtPoint(b,_);else{const e=n.zoomScale(n.zoom-i),t=l>i?Math.min(2,g):Math.max(.5,g),r=Math.pow(t,1-k),o=n.unproject(f.add(m.mult(k*r)).mult(e));n.setLocationAtPoint(n.renderWorldCopies?o.wrap():o,d)}return t.preloadOnly||this._fireMoveEvents(r),n};if(t.preloadOnly){const e=this._emulate(k,t.duration,n);return this._preloadTiles(e),this}const E={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=y,this._rotating=v,this._pitching=x,this._padding=w,this._easeId=t.easeId,this._prepareEase(r,t.noMoveStart,E),this._ease(k(n),(e=>{n.recenterOnTerrain(),this._afterEase(r,e)}),t),this}_prepareEase(t,r,n={}){this._moving=!0,this.transform.cameraElevationReference="sea",r||n.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.Event("pitchstart",t))}_fireMoveEvents(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))}_afterEase(t,r){if(this._easeId&&r&&this._easeId===r)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const n=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.Event("zoomend",t)),i&&this.fire(new e.Event("rotateend",t)),o&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))}flyTo(t,r){if(this._prefersReducedMotion(t)){const n=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);const n=this.transform,i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?e.clamp(+t.zoom,n.minZoom,n.maxZoom):i,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,p="padding"in t?t.padding:n.padding,h=n.zoomScale(l-i),d=e.Point.convert(t.offset);let f=n.centerPoint.add(d);const m=n.pointLocation(f),g=e.LngLat.convert(t.center||m);this._normalizeCenter(g);const b=n.project(m),_=n.project(g).sub(b);let y=t.curve;const v=Math.max(n.width,n.height),x=v/h,w=_.mag();if("minZoom"in t){const r=e.clamp(Math.min(t.minZoom,i,l),n.minZoom,n.maxZoom),o=v/n.zoomScale(r-i);y=Math.sqrt(o/w*2)}const k=y*y;function E(e){const t=(x*x-v*v+(e?-1:1)*k*k*w*w)/(2*(e?x:v)*k*w);return Math.log(Math.sqrt(t*t+1)-t)}function T(e){return(Math.exp(e)-Math.exp(-e))/2}function S(e){return(Math.exp(e)+Math.exp(-e))/2}const C=E(0);let A=function(e){return S(C)/S(C+y*e)},M=function(e){return v*((S(C)*(T(t=C+y*e)/S(t))-T(C))/k)/w;var t},I=(E(1)-C)/y;if(Math.abs(w)<1e-6||!isFinite(I)){if(Math.abs(v-x)<1e-6)return this.easeTo(t,r);const e=x<v?-1:1;I=Math.abs(Math.log(x/v))/y,M=function(){return 0},A=function(t){return Math.exp(e*y*t)}}t.duration="duration"in t?+t.duration:1e3*I/("screenSpeed"in t?+t.screenSpeed/y:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0);const O=o!==c,L=u!==a,z=!n.isPaddingEqual(p),D=n=>h=>{const m=h*I,y=1/A(m);n.zoom=1===h?l:i+n.scaleZoom(y),O&&(n.bearing=e.number(o,c,h)),L&&(n.pitch=e.number(a,u,h)),z&&(n.interpolatePadding(s,p,h),f=n.centerPoint.add(d));const v=1===h?g:n.unproject(b.add(_.mult(M(m))).mult(y));return n.setLocationAtPoint(n.renderWorldCopies?v.wrap():v,f),n._updateCameraOnTerrain(),t.preloadOnly||this._fireMoveEvents(r),n};if(t.preloadOnly){const e=this._emulate(D,t.duration,n);return this._preloadTiles(e),this}return this._zooming=!0,this._rotating=O,this._pitching=L,this._padding=z,this._prepareEase(r,!1),this._ease(D(n),(()=>this._afterEase(r)),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const e=this._onEaseEnd;this._onEaseEnd=void 0,e.call(this,t)}if(!e){const e=this.handlers;e&&e.stop(!1)}return this}_ease(t,r,n){!1===n.animate||0===n.duration?(t(1),r()):(this._easeStart=e.exported.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((e.exported.now()-this._easeStart)/this._easeOptions.duration,1),r=this._onEaseFrame;r&&r(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,r){t=e.wrap(t,-180,180);const n=Math.abs(t-r);return Math.abs(t-360-r)<n&&(t-=360),Math.abs(t+360-r)<n&&(t+=360),t}_normalizeCenter(e){const t=this.transform;if(!t.renderWorldCopies||t.maxBounds)return;const r=e.lng-t.center.lng;e.lng+=r>180?-360:r<-180?360:0}_prefersReducedMotion(t){return this._respectPrefersReducedMotion&&e.exported.prefersReducedMotion&&!(t&&t.essential)}_emulate(e,t,r){const n=Math.ceil(15*t/1e3),i=[],o=e(r.clone());for(let e=0;e<=n;e++){const t=o(e/n);i.push(t.clone())}return i}}class Xi{constructor(t={}){this.options=t,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(e){const t=this.options&&this.options.compact;return this._map=e,this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=o("button","mapboxgl-ctrl-attrib-button",this._container),o("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),t&&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===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(e,t){const r=this._map._getUIString(`AttributionControl.${t}`);e.setAttribute("aria-label",r),e.removeAttribute("title"),e.firstElementChild&&e.firstElementChild.setAttribute("title",r)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));const r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(t){const n=r.reduce(((e,t,n)=>(t.value&&(e+=`${t.key}=${t.value}${n<r.length-1?"&":""}`),e)),"?");t.href=`${e.config.FEEDBACK_URL}/${n}#${Jn(this._map,!0)}`,t.rel="noopener nofollow",this._setElementTitle(t,"MapFeedback")}}_updateData(e){!e||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType&&"style"!==e.dataType||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let e=[];if(this._map.style.stylesheet){const e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}const t=this._map.style._sourceCaches;for(const r in t){const n=t[r];if(n.used){const t=n.getSource();t.attribution&&e.indexOf(t.attribution)<0&&e.push(t.attribution)}}e.sort(((e,t)=>e.length-t.length)),e=e.filter(((t,r)=>{for(let n=r+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0})),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=[...this.options.customAttribution,...e]:e.unshift(this.options.customAttribution));const r=e.join(" | ");r!==this._attribHTML&&(this._attribHTML=r,e.length?(this._innerContainer.innerHTML=r,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class Ki{constructor(){e.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(e){this._map=e,this._container=o("div","mapboxgl-ctrl");const t=o("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const e=this._map.style._sourceCaches;if(0===Object.entries(e).length)return!0;for(const t in e){const r=e[t].getSource();if(r.hasOwnProperty("mapbox_logo")&&!r.mapbox_logo)return!1}return!0}_updateCompact(){const e=this._container.children;if(e.length){const t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}}}class Yi{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){const t=this._currentlyRunning,r=t?this._queue.concat(t):this._queue;for(const t of r)if(t.id===e)return void(t.cancelled=!0)}run(e=0){const t=this._currentlyRunning=this._queue;this._queue=[];for(const r of t)if(!r.cancelled&&(r.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Ji(t,r,n){if(t=new e.LngLat(t.lng,t.lat),r){const i=new e.LngLat(t.lng-360,t.lat),o=new e.LngLat(t.lng+360,t.lat),a=360*Math.ceil(Math.abs(t.lng-n.center.lng)/360),s=n.locationPoint(t).distSqr(r),l=r.x<0||r.y<0||r.x>n.width||r.y>n.height;n.locationPoint(i).distSqr(r)<s&&(l||Math.abs(i.lng-n.center.lng)<a)?t=i:n.locationPoint(o).distSqr(r)<s&&(l||Math.abs(o.lng-n.center.lng)<a)&&(t=o)}for(;Math.abs(t.lng-n.center.lng)>180;){const e=n.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}const Qi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};class eo extends e.Evented{constructor(t,r){if(super(),(t instanceof e.window.HTMLElement||r)&&(t=e.extend({element:t},r)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=t&&t.occludedOpacity||.2,t&&t.element)this._element=t.element,this._offset=e.Point.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=o("div");const r=41,n=27,i=a("svg",{display:"block",height:r*this._scale+"px",width:n*this._scale+"px",viewBox:`0 0 ${n} ${r}`},this._element),s=a("radialGradient",{id:"shadowGradient"},a("defs",{},i));a("stop",{offset:"10%","stop-opacity":.4},s),a("stop",{offset:"100%","stop-opacity":.05},s),a("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},i),a("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},i),a("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},i),a("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},i),this._offset=e.Point.convert(t&&t.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault()})),this._element.addEventListener("mousedown",(e=>{e.preventDefault()}));const n=this._element.classList;for(const e in Qi)n.remove(`mapboxgl-marker-anchor-${e}`);n.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(e){return e===this._map||(this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._updateMoving),e.on("moveend",this._update),e.on("remove",this._clearFadeTimer),e._addMarker(this),this.setDraggable(this._draggable),this._update(),e.on("click",this._onMapClick)),this}remove(){const e=this._map;return e&&(e.off("click",this._onMapClick),e.off("move",this._updateMoving),e.off("moveend",this._update),e.off("mousedown",this._addDragHandler),e.off("touchstart",this._addDragHandler),e.off("mouseup",this._onUp),e.off("touchend",this._onUp),e.off("mousemove",this._onMove),e.off("touchmove",this._onMove),e.off("remove",this._clearFadeTimer),e._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const t=38.1,r=13.5,n=Math.sqrt(Math.pow(r,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-t],"bottom-left":[n,-1*(t-r+n)],"bottom-right":[-n,-1*(t-r+n)],left:[r,-1*(t-r)],right:[-r,-1*(t-r)]}:this._offset}this._popup=e,e._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(e){const t=e.code,r=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==r&&13!==r||this.togglePopup()}_onMapClick(e){const t=e.originalEvent.target,r=this._element;this._popup&&(t===r||r.contains(t))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const e=this._popup;return e?(e.isOpen()?(e.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(e.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const e=this._map,t=this._pos;if(!e||!t)return!1;const r=e.unproject(t),n=e.getFreeCameraOptions();if(!n.position)return!1;const i=n.position.toLngLat();return i.distanceTo(r)<.9*i.distanceTo(this._lngLat)}_evaluateOpacity(){const t=this._map;if(!t)return;const r=this._pos;if(!r||r.x<0||r.x>t.transform.width||r.y<0||r.y>t.transform.height)return void this._clearFadeTimer();const n=t.unproject(r);let i;t._showingGlobe()&&e.isLngLatBehindGlobe(t.transform,this._lngLat)?i=0:(i=1-t._queryFogOpacity(n),t.transform._terrainEnabled()&&t.getTerrain()&&this._behindTerrain()&&(i*=this._occludedOpacity)),this._element.style.opacity=`${i}`,this._element.style.pointerEvents=i>0?"auto":"none",this._popup&&this._popup._setOpacity(i),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const e=this._pos;if(!e||!this._map)return;const t=this._offset.mult(this._scale);this._element.style.transform=`\n            translate(${e.x}px,${e.y}px)\n            ${Qi[this._anchor]}\n            ${this._calculateXYTransform()} ${this._calculateZTransform()}\n            translate(${t.x}px,${t.y}px)\n        `}_calculateXYTransform(){const t=this._pos,r=this._map,n=this.getPitchAlignment();if(!r||!t||"map"!==n)return"";if(!r._showingGlobe()){const e=r.getPitch();return e?`rotateX(${e}deg)`:""}const i=e.radToDeg(e.globeTiltAtLngLat(r.transform,this._lngLat)),o=t.sub(e.globeCenterToScreenPoint(r.transform)),a=Math.abs(o.x)+Math.abs(o.y);if(0===a)return"";const s=i/a;return`rotateX(${-o.y*s}deg) rotateY(${o.x*s}deg)`}_calculateZTransform(){const t=this._pos,r=this._map;if(!r||!t)return"";let n=0;const i=this.getRotationAlignment();if("map"===i)if(r._showingGlobe()){const t=r.project(new e.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),i=r.project(new e.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(t);n=e.radToDeg(Math.atan2(i.y,i.x))-90}else n=-r.getBearing();else if("horizon"===i){const i=e.smoothstep(4,6,r.getZoom()),o=e.globeCenterToScreenPoint(r.transform);o.y+=i*r.transform.height;const a=t.sub(o),s=e.radToDeg(Math.atan2(a.y,a.x));n=(s>90?s-270:s+90)*(1-i)}return n+=this._rotation,n?`rotateZ(${n}deg)`:""}_update(t){e.window.cancelAnimationFrame(this._updateFrameId);const r=this._map;r&&(r.transform.renderWorldCopies&&(this._lngLat=Ji(this._lngLat,this._pos,r.transform)),this._pos=r.project(this._lngLat),!0===t?this._updateFrameId=e.window.requestAnimationFrame((()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())})):this._pos=this._pos.round(),r._requestDomTask((()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(r._showingGlobe()||r.getTerrain()||r.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))})))}getOffset(){return this._offset}setOffset(t){return this._offset=e.Point.convert(t),this._update(),this}_onMove(t){const r=this._map;if(!r)return;const n=this._pointerdownPos,i=this._positionDelta;if(n&&i){if(!this._isDragging){const e=this._clickTolerance||r._clickTolerance;if(t.point.dist(n)<e)return;this._isDragging=!0}this._pos=t.point.sub(i),this._lngLat=r.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const t=this._map;t&&(t.off("mousemove",this._onMove),t.off("touchmove",this._onMove)),"active"===this._state&&this.fire(new e.Event("dragend")),this._state="inactive"}_addDragHandler(e){const t=this._map,r=this._pos;t&&r&&this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(r),this._pointerdownPos=e.point,this._state="pending",t.on("mousemove",this._onMove),t.on("touchmove",this._onMove),t.once("mouseup",this._onUp),t.once("touchend",this._onUp))}setDraggable(e){this._draggable=!!e;const t=this._map;return t&&(e?(t.on("mousedown",this._addDragHandler),t.on("touchstart",this._addDragHandler)):(t.off("mousedown",this._addDragHandler),t.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return"auto"===this._rotationAlignment||"horizon"===this._rotationAlignment&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e||"auto",this._update(),this}getPitchAlignment(){return"auto"===this._pitchAlignment?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(e){return this._occludedOpacity=e||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const to={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ro=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function no(t=new e.Point(0,0),r="bottom"){if("number"==typeof t){const n=Math.round(Math.sqrt(.5*Math.pow(t,2)));switch(r){case"top":return new e.Point(0,t);case"top-left":return new e.Point(n,n);case"top-right":return new e.Point(-n,n);case"bottom":return new e.Point(0,-t);case"bottom-left":return new e.Point(n,-n);case"bottom-right":return new e.Point(-n,-n);case"left":return new e.Point(t,0);case"right":return new e.Point(-t,0)}return new e.Point(0,0)}return t instanceof e.Point||Array.isArray(t)?e.Point.convert(t):e.Point.convert(t[r]||[0,0])}class io{constructor(e){this.jumpTo(e)}getValue(t){if(t<=this._startTime)return this._start;if(t>=this._endTime)return this._end;const r=e.easeCubicInOut((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-r)+this._end*r}isEasing(e){return e>=this._startTime&&e<=this._endTime}jumpTo(e){this._startTime=-1/0,this._endTime=-1/0,this._start=e,this._end=e}easeTo(e,t,r){this._start=this.getValue(t),this._end=e,this._startTime=t,this._endTime=t+r}}const oo={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},ao={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},so={showCompass:!0,showZoom:!0,visualizePitch:!1};class lo{constructor(t,r,n=!1){this._clickTolerance=10,this.element=r,this.mouseRotate=new vi({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,n&&(this.mousePitch=new xi({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener("mousedown",this.mousedown),r.addEventListener("touchstart",this.touchstart,{passive:!1}),r.addEventListener("touchmove",this.touchmove),r.addEventListener("touchend",this.touchend),r.addEventListener("touchcancel",this.reset)}down(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),u()}move(e,t){const r=this.map,n=this.mouseRotate.mousemoveWindow(e,t),i=n&&n.bearingDelta;if(i&&r.setBearing(r.getBearing()+i),this.mousePitch){const n=this.mousePitch.mousemoveWindow(e,t),i=n&&n.pitchDelta;i&&r.setPitch(r.getPitch()+i)}}off(){const e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart,{passive:!1}),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){p(),e.window.removeEventListener("mousemove",this.mousemove),e.window.removeEventListener("mouseup",this.mouseup)}mousedown(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),f(this.element,t)),e.window.addEventListener("mousemove",this.mousemove),e.window.addEventListener("mouseup",this.mouseup)}mousemove(e){this.move(e,f(this.element,e))}mouseup(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()}touchstart(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=m(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>e.preventDefault()},this._startPos))}touchmove(e){1!==e.targetTouches.length?this.reset():(this._lastPos=m(this.element,e.targetTouches)[0],this.move({preventDefault:()=>e.preventDefault()},this._lastPos))}touchend(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}const co={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},uo={maxWidth:100,unit:"metric"},po={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},ho={version:e.version,supported:r,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:class extends Zi{constructor(t){if(e.LivePerformanceUtils.mark(e.PerformanceMarkers.create),null!=(t=e.extend({},ao,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(t.antialias&&e.isSafariWithAntialiasingBug(e.window)&&(t.antialias=!1,e.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Xn(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies),t),this._interactive=t.interactive,this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._useWebGL2=t.useWebGL2,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=t.crossSourceCollisions,this._collectResourceTiming=t.collectResourceTiming,this._optimizeForTerrain=t.optimizeForTerrain,this._language=this._parseLanguage(t.language),this._worldview=t.worldview,this._renderTaskQueue=new Yi,this._domRenderTaskQueue=new Yi,this._controls=[],this._markers=[],this._popups=[],this._mapId=e.uniqueId(),this._locale=e.extend({},oo,t.locale),this._clickTolerance=t.clickTolerance,this._cooperativeGestures=t.cooperativeGestures,this._performanceMetricsCollection=t.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new io(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new e.RequestManager(t.transformRequest,t.accessToken,t.testMode),this._silenceAuthErrors=!!t.testMode,"string"==typeof t.container){if(this._container=e.window.document.getElementById(t.container),!this._container)throw new Error(`Container '${t.container}' not found.`)}else{if(!(t.container instanceof e.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(this._container.childNodes.length>0&&e.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),void 0!==e.window&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1),e.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),e.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new Wi(this,t),this._localFontFamily=t.localFontFamily,this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),t.projection&&this.setProjection(t.projection),this._hash=t.hash&&new Yn("string"==typeof t.hash&&t.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),t.attributionControl&&this.addControl(new Xi({customAttribution:t.customAttribution})),this._logoControl=new Ki,this.addControl(this._logoControl,t.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.Event(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new e.Event(`${t.dataType}dataloading`,t))}))}_getMapId(){return this._mapId}addControl(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=t.onAdd(this);this._controls.push(t);const i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(t){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const r=!this._moving;return r&&this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t)),this.fire(new e.Event("resize",t)),r&&this.fire(new e.Event("moveend",t)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t?this.setZoom(t):this.fire(new e.Event("zoomstart")).fire(new e.Event("zoom")).fire(new e.Event("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t?this.setZoom(t):this.fire(new e.Event("zoomstart")).fire(new e.Event("zoom")).fire(new e.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t?this.setPitch(t):this.fire(new e.Event("pitchstart")).fire(new e.Event("pitch")).fire(new e.Event("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?85:t)>85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t?this.setPitch(t):this.fire(new e.Event("pitchstart")).fire(new e.Event("pitch")).fire(new e.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(t){return"auto"===t?e.window.navigator.language:Array.isArray(t)?0===t.length?void 0:t.map((t=>"auto"===t?e.window.navigator.language:t)):t}setLanguage(e){const t=this._parseLanguage(e);if(!this.style||t===this._language)return this;this._language=t,this.style._reloadSources();for(const e of this._controls)e._setLanguage&&e._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(e){return this.style&&e!==this._worldview?(this._worldview=e,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(e){return this._lazyInitEmptyStyle(),e?"string"==typeof e&&(e={name:e}):e=null,this._useExplicitProjection=!!e,this._prioritizeAndUpdateProjection(e,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const t=this.transform,r=t.projection.name;let n;"globe"===r&&t.zoom>=e.GLOBE_ZOOM_THRESHOLD_MAX?(t.setMercatorFromTransition(),n=!0):"mercator"===r&&t.zoom<e.GLOBE_ZOOM_THRESHOLD_MAX&&(t.setProjection({name:"globe"}),n=!0),n&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayerUpdate())}_prioritizeAndUpdateProjection(e,t){return this._updateProjection(e||t||{name:"mercator"})}_updateProjection(t){let r;if(r="globe"===t.name&&this.transform.zoom>=e.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(t),this.style.applyProjectionUpdate(),r){this.painter.clearBackgroundTiles();for(const e in this.style._sourceCaches)this.style._sourceCaches[e].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(t){return this.transform.locationPoint3D(e.LngLat.convert(t))}unproject(t){return this.transform.pointLocation3D(e.Point.convert(t))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(e,t,r){if("mouseenter"===e||"mouseover"===e){let n=!1;const i=i=>{const o=t.filter((e=>this.getLayer(e))),a=o.length?this.queryRenderedFeatures(i.point,{layers:o}):[];a.length?n||(n=!0,r.call(this,new si(e,this,i.originalEvent,{features:a}))):n=!1},o=()=>{n=!1};return{layers:new Set(t),listener:r,delegates:{mousemove:i,mouseout:o}}}if("mouseleave"===e||"mouseout"===e){let n=!1;const i=i=>{const o=t.filter((e=>this.getLayer(e)));(o.length?this.queryRenderedFeatures(i.point,{layers:o}):[]).length?n=!0:n&&(n=!1,r.call(this,new si(e,this,i.originalEvent)))},o=t=>{n&&(n=!1,r.call(this,new si(e,this,t.originalEvent)))};return{layers:new Set(t),listener:r,delegates:{mousemove:i,mouseout:o}}}{const n=e=>{const n=t.filter((e=>this.getLayer(e))),i=n.length?this.queryRenderedFeatures(e.point,{layers:n}):[];i.length&&(e.features=i,r.call(this,e),delete e.features)};return{layers:new Set(t),listener:r,delegates:{[e]:n}}}}on(e,t,r){if(void 0===r)return super.on(e,t);Array.isArray(t)||(t=[t]);const n=this._createDelegatedListener(e,t,r);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(n);for(const e in n.delegates)this.on(e,n.delegates[e]);return this}once(e,t,r){if(void 0===r)return super.once(e,t);Array.isArray(t)||(t=[t]);const n=this._createDelegatedListener(e,t,r);for(const e in n.delegates)this.once(e,n.delegates[e]);return this}off(e,t,r){if(void 0===r)return super.off(e,t);t=new Set(Array.isArray(t)?t:[t]);const n=(e,t)=>{if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0},i=this._delegatedListeners?this._delegatedListeners[e]:void 0;return i&&(e=>{for(let i=0;i<e.length;i++){const o=e[i];if(o.listener===r&&n(o.layers,t)){for(const e in o.delegates)this.off(e,o.delegates[e]);return e.splice(i,1),this}}})(i),this}queryRenderedFeatures(t,r){return this.style?(void 0!==r||void 0===t||t instanceof e.Point||Array.isArray(t)||(r=t,t=void 0),this.style.queryRenderedFeatures(t=t||[[0,0],[this.transform.width,this.transform.height]],r=r||{},this.transform)):[]}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}isPointOnSurface(t){const{name:r}=this.transform.projection;return"globe"!==r&&"mercator"!==r&&e.warnOnce(`${r} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(e.Point.convert(t))}setStyle(t,r){return!1!==(r=e.extend({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&r.localFontFamily===this._localFontFamily&&this.style&&t?(this._diffStyle(t,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._localFontFamily=r.localFontFamily,this._updateStyle(t,r))}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),e&&(this.style=new Yt(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e):this.style.loadJSON(e)),this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Yt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,r){if("string"==typeof t){const n=this._requestManager.normalizeStyleURL(t),i=this._requestManager.transformRequest(n,e.ResourceType.Style);e.getJSON(i,((t,n)=>{t?this.fire(new e.ErrorEvent(t)):n&&this._updateDiff(n,r)}))}else"object"==typeof t&&this._updateDiff(t,r)}_updateDiff(t,r){try{this.style.setState(t)&&this._update(!0)}catch(n){e.warnOnce(`Unable to perform style diff: ${n.message||n.error||n}.  Rebuilding the style from scratch.`),this._updateStyle(t,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(e.warnOnce("There is no style added to the map."),!1)}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){return!!this.style&&this.style._isSourceCacheLoaded(e)}areTilesLoaded(){const e=this.style&&this.style._sourceCaches;for(const t in e){const r=e[t]._tiles;for(const e in r){const t=r[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}addSourceType(e,t,r){this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,r)}removeSource(e){return this.style.removeSource(e),this._updateTerrain(),this._update(!0)}getSource(e){return this.style.getSource(e)}addImage(t,r,{pixelRatio:n=1,sdf:i=!1,stretchX:o,stretchY:a,content:s}={}){if(this._lazyInitEmptyStyle(),r instanceof e.window.HTMLImageElement||e.window.ImageBitmap&&r instanceof e.window.ImageBitmap){const{width:l,height:c,data:u}=e.exported.getImageData(r);this.style.addImage(t,{data:new e.RGBAImage({width:l,height:c},u),pixelRatio:n,stretchX:o,stretchY:a,content:s,sdf:i,version:0})}else if(void 0===r.width||void 0===r.height)this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:l,height:c}=r,u=r;this.style.addImage(t,{data:new e.RGBAImage({width:l,height:c},new Uint8Array(u.data)),pixelRatio:n,stretchX:o,stretchY:a,content:s,sdf:i,version:0,userImage:u}),u.onAdd&&u.onAdd(this,t)}}updateImage(t,r){const n=this.style.getImage(t);if(!n)return void this.fire(new e.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const i=r instanceof e.window.HTMLImageElement||e.window.ImageBitmap&&r instanceof e.window.ImageBitmap?e.exported.getImageData(r):r,{width:o,height:a}=i;void 0!==o&&void 0!==a?o===n.data.width&&a===n.data.height?(n.data.replace(i.data,!(r instanceof e.window.HTMLImageElement||e.window.ImageBitmap&&r instanceof e.window.ImageBitmap)),this.style.updateImage(t,n)):this.fire(new e.ErrorEvent(new Error(`The width and height of the updated image (${o}, ${a})\n                must be that same as the previous version of the image\n                (${n.data.width}, ${n.data.height})`))):this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")))}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(t,r){e.getImage(this._requestManager.transformRequest(t,e.ResourceType.Image),((t,n)=>{r(t,n instanceof e.window.HTMLImageElement?e.exported.getImageData(n):n)}))}listImages(){return this.style.listImages()}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style.getLayer(e)}setLayerZoomRange(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)}setFilter(e,t,r={}){return this.style.setFilter(e,t,r),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,r,n={}){return this.style.setPaintProperty(e,t,r,n),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,r,n={}){return this.style.setLayoutProperty(e,t,r,n),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(e){return this._lazyInitEmptyStyle(),!e&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(e),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(e){return this._lazyInitEmptyStyle(),this.style.setFog(e),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(t){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(e.LngLat.convert(t),this.transform):0}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}_updateContainerDimensions(){if(!this._container)return;const t=this._container.getBoundingClientRect().width||400,r=this._container.getBoundingClientRect().height||300;let n,i,o,a=this._container;for(;a&&(!i||!o);){const t=e.window.getComputedStyle(a).transform;t&&"none"!==t&&(n=t.match(/matrix.*\((.+)\)/)[1].split(", "),n[0]&&"0"!==n[0]&&"1"!==n[0]&&(i=n[0]),n[3]&&"0"!==n[3]&&"1"!==n[3]&&(o=n[3])),a=a.parentElement}this._containerWidth=i?Math.abs(t/i):t,this._containerHeight=o?Math.abs(r/o):r}_detectMissingCSS(){"rgb(250, 128, 114)"!==e.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSCanary=o("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();const t=this._canvasContainer=o("div","mapboxgl-canvas-container",e);this._interactive&&t.classList.add("mapboxgl-interactive"),this._canvas=o("canvas","mapboxgl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const r=this._controlContainer=o("div","mapboxgl-control-container",e),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((e=>{n[e]=o("div",`mapboxgl-ctrl-${e}`,r)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,r){const n=e.exported.devicePixelRatio||1;this._canvas.width=n*Math.ceil(t),this._canvas.height=n*Math.ceil(r),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${r}px`}_addMarker(e){this._markers.push(e)}_removeMarker(e){const t=this._markers.indexOf(e);-1!==t&&this._markers.splice(t,1)}_addPopup(e){this._popups.push(e)}_removePopup(e){const t=this._popups.indexOf(e);-1!==t&&this._popups.splice(t,1)}_setupPainter(){const t=e.extend({},r.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._useWebGL2&&this._canvas.getContext("webgl2",t),i=n||this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);i?(this._useWebGL2&&!n&&e.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),e.storeAuthState(i,!0),this.painter=new Rn(i,this.transform,!!n),this.on("data",(e=>{"source"===e.dataType&&this.painter.setTileLoadedFlag(!0)})),e.exported$1.testSupport(i)):this.fire(new e.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.Event("webglcontextlost",{originalEvent:t}))}_contextRestored(t){this._setupPainter(),this.resize(),this._update(),this.fire(new e.Event("webglcontextrestored",{originalEvent:t}))}_onMapScroll(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_requestDomTask(e){!this.loaded()||this.loaded()&&!this.isMoving()?e():this._domRenderTaskQueue.add(e)}_render(t){let r;const n=this.painter.context.extTimerQuery,i=e.exported.now();if(this.listens("gpu-timing-frame")&&(r=n.createQueryEXT(),n.beginQueryEXT(n.TIME_ELAPSED_EXT,r)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],e.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],e.window.performance.now())),this._renderTaskQueue.run(t),this._domRenderTaskQueue.run(t),this._removed)return;this._updateProjectionTransition();const o=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,r=this.transform.pitch,n=e.exported.now(),i=new e.EvaluationParameters(t,{now:n,fadeDuration:o,pitch:r,transition:this.style.getTransition()});this.style.update(i)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let a=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),a=this._updateAverageElevation(i),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):a=this._updateAverageElevation(i),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,o,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:o,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new e.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new e.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),r){const t=e.exported.now()-i;n.endQueryEXT(n.TIME_ELAPSED_EXT,r),setTimeout((()=>{const o=n.getQueryObjectEXT(r,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(r),this.fire(new e.Event("gpu-timing-frame",{cpuTime:t,gpuTime:o})),e.window.performance.mark("frame-gpu",{startTime:i,detail:{gpuTime:o}})}),50)}if(this.listens("gpu-timing-layer")){const t=this.painter.collectGpuTimers();setTimeout((()=>{const r=this.painter.queryGpuTimers(t);this.fire(new e.Event("gpu-timing-layer",{layerTimes:r}))}),50)}if(this.listens("gpu-timing-deferred-render")){const t=this.painter.collectDeferredRenderGpuQueries();setTimeout((()=>{const r=this.painter.queryGpuTimeDeferredRender(t);this.fire(new e.Event("gpu-timing-deferred-render",{gpuTime:r}))}),50)}const s=this._sourcesDirty||this._styleDirty||this._placementDirty||a;if(s||this._repaint)this.triggerRepaint();else{const t=!this.isMoving()&&this.loaded();if(t&&(a=this._updateAverageElevation(i,!0)),a)this.triggerRepaint();else if(this._triggerFrame(!1),t&&(this.fire(new e.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const t=this._calculateSpeedIndex();this.fire(new e.Event("speedindexcompleted",{speedIndex:t})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0,e.LivePerformanceUtils.mark(e.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&e.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(e){for(const t of this._markers)e&&!this.getRenderWorldCopies()&&(t._lngLat=t._lngLat.wrap()),t._update();for(const t of this._popups)!e||this.getRenderWorldCopies()||t._trackPointer||(t._lngLat=t._lngLat.wrap()),t._update()}_updateAverageElevation(e,t=!1){const r=e=>(this.transform.averageElevation=e,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&r(0);if((t||e-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(e)){const t=this.transform.averageElevation;let n=this.transform.sampleAverageElevation(),i=!1;this.transform.elevation&&(i=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(n)?n=0:this._averageElevationLastSampledAt=e;const o=Math.abs(t-n);if(o>1){if(this._isInitialLoad||i)return this._averageElevation.jumpTo(n),r(n);this._averageElevation.easeTo(n,e,300)}else if(o>1e-4)return this._averageElevation.jumpTo(n),r(n)}return!!this._averageElevation.isEasing(e)&&r(this._averageElevation.getValue(e))}_authenticate(){e.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(t=>{if(t&&(t.message===e.AUTH_ERR_MSG||401===t.status)){const t=this.painter.context.gl;e.storeAuthState(t,!1),this._logoControl instanceof Ki&&this._logoControl._updateLogo(),t&&t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new e.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}})),e.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(()=>{}))}_updateTerrain(){const e=this._isDragging();this.painter.updateTerrain(this.style,e)}_calculateSpeedIndex(){const e=this.painter.canvasCopy(),t=this.painter.getCanvasCopiesAndTimestamps();t.timeStamps.push(performance.now());const r=this.painter.context.gl,n=r.createFramebuffer();function i(e){r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0);const t=new Uint8Array(r.drawingBufferWidth*r.drawingBufferHeight*4);return r.readPixels(0,0,r.drawingBufferWidth,r.drawingBufferHeight,r.RGBA,r.UNSIGNED_BYTE,t),t}return r.bindFramebuffer(r.FRAMEBUFFER,n),this._canvasPixelComparison(i(e),t.canvasCopies.map(i),t.timeStamps)}_canvasPixelComparison(e,t,r){let n=r[1]-r[0];const i=e.length/4;for(let o=0;o<t.length;o++){const a=t[o];let s=0;for(let t=0;t<a.length;t+=4)a[t]===e[t]&&a[t+1]===e[t+1]&&a[t+2]===e[t+2]&&a[t+3]===e[t+3]&&(s+=1);n+=(r[o+2]-r[o+1])*(1-s/i)}return n}remove(){this._hash&&this._hash.remove();for(const e of this._controls)e.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),void 0!==e.window&&(e.window.removeEventListener("resize",this._onWindowResize,!1),e.window.removeEventListener("orientationchange",this._onWindowResize,!1),e.window.removeEventListener("webkitfullscreenchange",this._onWindowResize,!1),e.window.removeEventListener("online",this._onWindowOnline,!1),e.window.removeEventListener("visibilitychange",this._onVisibilityChange,!1));const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),e.removeAuthState(this.painter.context.gl),this._removed=!0,this.fire(new e.Event("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(t){this._renderNextFrame=this._renderNextFrame||t,this.style&&!this._frame&&(this._frame=e.exported.frame((e=>{const t=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,t&&this._render(e)})))}_preloadTiles(t){const r=this.style?Object.values(this.style._sourceCaches):[];return e.asyncAll(r,((e,r)=>e._preloadTiles(t,r)),(()=>{this.triggerRepaint()})),this}_onWindowOnline(){this._update()}_onWindowResize(e){this._trackResize&&this.resize({originalEvent:e})._update()}_onVisibilityChange(){"hidden"===e.window.document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(e){this._showTerrainWireframe!==e&&(this._showTerrainWireframe=e,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(e){this._speedIndexTiming!==e&&(this._speedIndexTiming=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(e){this._showTileAABBs!==e&&(this._showTileAABBs=e,e&&this._update())}_setCacheLimits(t,r){e.setCacheLimits(t,r)}get version(){return e.version}},NavigationControl:class{constructor(t){this.options=e.extend({},so,t),this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(e.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(e=>{this._map&&this._map.zoomIn({},{originalEvent:e})})),o("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(e=>{this._map&&this._map.zoomOut({},{originalEvent:e})})),o("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(e.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(e=>{const t=this._map;t&&(this.options.visualizePitch?t.resetNorthPitch({},{originalEvent:e}):t.resetNorth({},{originalEvent:e}))})),this._compassIcon=o("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const e=this._map;if(!e)return;const t=e.getZoom(),r=t===e.getMaxZoom(),n=t===e.getMinZoom();this._zoomInButton.disabled=r,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",r.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())}_rotateCompassArrow(){const e=this._map;if(!e)return;const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(e.transform.pitch*(Math.PI/180)),.5)}) rotateX(${e.transform.pitch}deg) rotateZ(${e.transform.angle*(180/Math.PI)}deg)`:`rotate(${e.transform.angle*(180/Math.PI)}deg)`;e._requestDomTask((()=>{this._compassIcon&&(this._compassIcon.style.transform=t)}))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),e.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&e.on("pitch",this._rotateCompassArrow),e.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new lo(e,this._compass,this.options.visualizePitch)),this._container}onRemove(){const e=this._map;e&&(this._container.remove(),this.options.showZoom&&e.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&e.off("pitch",this._rotateCompassArrow),e.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(e,t){const r=o("button",e,this._container);return r.type="button",r.addEventListener("click",t),r}_setButtonTitle(e,t){if(!this._map)return;const r=this._map._getUIString(`NavigationControl.${t}`);e.setAttribute("aria-label",r),e.firstElementChild&&e.firstElementChild.setAttribute("title",r)}},GeolocateControl:class extends e.Evented{constructor(t){super(),this.options=e.extend({geolocation:e.window.navigator.geolocation},co,t),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Kn(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(e){return this._map=e,this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(t){const r=(e=!!this.options.geolocation)=>{this._supportsGeolocation=e,t(e)};void 0!==this._supportsGeolocation?t(this._supportsGeolocation):void 0!==e.window.navigator.permissions?e.window.navigator.permissions.query({name:"geolocation"}).then((e=>r("denied"!==e.state))).catch((()=>r())):r()}_isOutOfMapMaxBounds(e){const t=this._map.getMaxBounds(),r=e.coords;return!!t&&(r.longitude<t.getWest()||r.longitude>t.getEast()||r.latitude<t.getSouth()||r.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("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(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}}_updateCamera(t){const r=new e.LngLat(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),o=e.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),o,{geolocateSource:!0})}_updateMarker(t){if(t){const r=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const t=this._map.transform,r=e.mercatorZfromAltitude(1,t._center.lat)*t.worldSize,n=Math.ceil(2*this._accuracy*r);this._circleElement.style.width=`${n}px`,this._circleElement.style.height=`${n}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(t){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this._geolocateButton=o("button","mapboxgl-ctrl-geolocate",this._container),o("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o("div","mapboxgl-user-location"),this._dotElement.appendChild(o("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(o("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new eo({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=o("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new eo({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new e.Event("trackuserlocationend")))}))}}_onDeviceOrientation(e){this._userLocationDotMarker&&(e.webkitCompassHeading?this._heading=e.webkitCompassHeading:!0===e.absolute&&(this._heading=-1*e.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return e.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 e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.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 e.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(e={maximumAge:6e5,timeout:0},this._noTimeout=!0):(e=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,e),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const t=()=>{e.window.addEventListener("ondeviceorientationabsolute"in e.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};void 0!==e.window.DeviceMotionEvent&&"function"==typeof e.window.DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((e=>{"granted"===e&&t()})).catch(console.error):t()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),e.window.removeEventListener("deviceorientation",this._onDeviceOrientation),e.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Xi,ScaleControl:class{constructor(t){this.options=e.extend({},uo,t),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch(e){return!1}}(),e.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const e=this.options.maxWidth||100,t=this._map,r=t._containerHeight/2,n=t._containerWidth/2-e/2,i=t.unproject([n,r]),o=t.unproject([n+e,r]),a=i.distanceTo(o);if("imperial"===this.options.unit){const t=3.2808*a;t>5280?this._setScale(e,t/5280,"mile"):this._setScale(e,t,"foot")}else"nautical"===this.options.unit?this._setScale(e,a/1852,"nautical-mile"):a>=1e3?this._setScale(e,a/1e3,"kilometer"):this._setScale(e,a,"meter")}_setScale(e,t,r){this._map._requestDomTask((()=>{const n=function(e){const t=Math.pow(10,`${Math.floor(e)}`.length-1);let r=e/t;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(e){const t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(r),t*r}(t),i=n/t;this._container.innerHTML=this._isNumberFormatSupported&&"nautical-mile"!==r?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:r}).format(n):`${n}&nbsp;${po[r]}`,this._container.style.width=e*i+"px"}))}onAdd(e){return this._map=e,this._language=e.getLanguage(),this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(e){this._language=e,this._update()}setUnit(e){this.options.unit=e,this._update()}},FullscreenControl:class{constructor(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.window.HTMLElement?this._container=t.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in e.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=o("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!e.window.document.fullscreenEnabled&&!e.window.document.webkitFullscreenEnabled)}_setupUI(){const t=this._fullscreenButton=o("button","mapboxgl-ctrl-fullscreen",this._controlContainer);o("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",e)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(e.window.document.fullscreenElement||e.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends e.Evented{constructor(t){super(),this.options=e.extend(Object.create(to),t),e.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(t&&t.className?t.className.trim().split(/\s+/):[])}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&t.on("preclick",this._onClose),this.options.closeOnMove&&t.on("move",this._onClose),t.on("remove",this.remove),this._update(),t._addPopup(this),this._focusFirstElement(),this._trackPointer?(t.on("mousemove",this._onMouseEvent),t.on("mouseup",this._onMouseEvent),t._canvasContainer.classList.add("mapboxgl-track-pointer")):t.on("move",this._update),this.fire(new e.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const t=this._map;return t&&(t.off("move",this._update),t.off("move",this._onClose),t.off("preclick",this._onClose),t.off("click",this._onClose),t.off("remove",this.remove),t.off("mousemove",this._onMouseEvent),t.off("mouseup",this._onMouseEvent),t.off("drag",this._onMouseEvent),t._canvasContainer&&t._canvasContainer.classList.remove("mapboxgl-track-pointer"),t._removePopup(this),this._map=void 0),this.fire(new e.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(t){this._lngLat=e.LngLat.convert(t),this._pos=null,this._trackPointer=!1,this._update();const r=this._map;return r&&(r.on("move",this._update),r.off("mousemove",this._onMouseEvent),r._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const e=this._map;return e&&(e.off("move",this._update),e.on("mousemove",this._onMouseEvent),e.on("drag",this._onMouseEvent),e._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(e.window.document.createTextNode(t))}setHTML(t){const r=e.window.document.createDocumentFragment(),n=e.window.document.createElement("body");let i;for(n.innerHTML=t;i=n.firstChild,i;)r.appendChild(i);return this.setDOMContent(r)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){let t=this._content;if(t)for(;t.hasChildNodes();)t.firstChild&&t.removeChild(t.firstChild);else t=this._content=o("div","mapboxgl-popup-content",this._container||void 0);if(t.appendChild(e),this.options.closeButton){const e=this._closeButton=o("button","mapboxgl-popup-close-button",t);e.type="button",e.setAttribute("aria-label","Close popup"),e.setAttribute("aria-hidden","true"),e.innerHTML="&#215;",e.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(e){return this._classList.add(e),this._updateClassList(),this}removeClassName(e){return this._classList.delete(e),this._updateClassList(),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){let t;return this._classList.delete(e)?t=!1:(this._classList.add(e),t=!0),this._updateClassList(),t}_onMouseEvent(e){this._update(e.point)}_getAnchor(e){if(this.options.anchor)return this.options.anchor;const t=this._map,r=this._container,n=this._pos;if(!t||!r||!n)return"bottom";const i=r.offsetWidth,o=r.offsetHeight,a=n.x<i/2,s=n.x>t.transform.width-i/2;if(n.y+e<o)return a?"top-left":s?"top-right":"top";if(n.y>t.transform.height-o){if(a)return"bottom-left";if(s)return"bottom-right"}return a?"left":s?"right":"bottom"}_updateClassList(){const e=this._container;if(!e)return;const t=[...this._classList];t.push("mapboxgl-popup"),this._anchor&&t.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&t.push("mapboxgl-popup-track-pointer"),e.className=t.join(" ")}_update(t){const r=this._map,n=this._content;if(!r||!this._lngLat&&!this._trackPointer||!n)return;let i=this._container;if(i||(i=this._container=o("div","mapboxgl-popup",r.getContainer()),this._tip=o("div","mapboxgl-popup-tip",i),i.appendChild(n)),this.options.maxWidth&&i.style.maxWidth!==this.options.maxWidth&&(i.style.maxWidth=this.options.maxWidth),r.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ji(this._lngLat,this._pos,r.transform)),!this._trackPointer||t){const e=this._pos=this._trackPointer&&t?t:r.project(this._lngLat),n=no(this.options.offset),i=this._anchor=this._getAnchor(n.y),o=no(this.options.offset,i),a=e.add(o).round();r._requestDomTask((()=>{this._container&&i&&(this._container.style.transform=`${Qi[i]} translate(${a.x}px,${a.y}px)`)}))}if(!this._marker&&r._showingGlobe()){const t=e.isLngLatBehindGlobe(r.transform,this._lngLat)?0:1;this._setOpacity(t)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const e=this._container.querySelector(ro);e&&e.focus()}_onClose(){this.remove()}_setOpacity(e){this._container&&(this._container.style.opacity=`${e}`),this._content&&(this._content.style.pointerEvents=e?"auto":"none")}},Marker:eo,Style:Yt,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,FreeCameraOptions:Un,Evented:e.Evented,config:e.config,prewarm:function(){je().acquire(Re)},clearPrewarmedResources:function(){const e=Fe;e&&e.isPreloaded()&&1===e.numActive()&&(e.release(Re),Fe=null)},get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return Be.workerCount},set workerCount(e){Be.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage(t){e.clearTileCache(t)},workerUrl:"",workerClass:null,setNow:e.exported.setNow,restoreNow:e.exported.restoreNow};return ho})),n}()}).call(this,r(87))},function(e,t,r){"use strict";e.exports=r(431)},function(e,t,r){"use strict";e.exports=r(435)},function(e,t,r){"use strict";e.exports=r(436)},function(e,t,r){"use strict";e.exports=r(437)},function(e,t,r){var n;window,n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="./src/index.js")}({"./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js?!./src/editor.vue?vue&type=script&lang=js&":function(e,t,r){"use strict";r.r(t);var n=r("./node_modules/marked/lib/marked.js"),i=r.n(n),o=r("./node_modules/turndown/lib/turndown.es.js"),a=r("./node_modules/codemirror/lib/codemirror.js"),s=r.n(a);r("./node_modules/codemirror/addon/display/fullscreen.js"),r("./node_modules/codemirror/mode/markdown/markdown.js"),r("./node_modules/codemirror/addon/display/placeholder.js"),t.default={props:{id:{type:String,default:function(){return"v-md-editor-"+Math.random().toString(16).substr(2,9)}},css:{type:String},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"300px"},toolbar:{type:String,default:"clean redo undo | bold italic strikethrough heading | image link | numlist bullist code quote | preview fullscreen"},placeholder:{type:String,default:""},extend:{type:Object},buttons:{type:Object,default:function(){return{clean:{cmd:"clean",ico:"fas far fa-remove-format mdi mdi-format-clear",title:"Html to markdown",hotkey:"Shift-Alt-F"},undo:{cmd:"undo",ico:"fas far fa-undo mdi mdi-undo-variant",title:"Undo",hotkey:"Ctrl-Z"},redo:{cmd:"redo",ico:"fas far fa-redo mdi mdi-redo-variant",title:"Redo",hotkey:"Ctrl-Y"},bullist:{cmd:"bullist",ico:"fas far fa-list-ul mdi mdi-format-list-bulleted",title:"Generic List"},numlist:{cmd:"numlist",ico:"fas far fa-list-ol mdi mdi-format-list-numbered",title:"Numbered List"},bold:{title:"Bold",ico:"fas far fa-bold mdi mdi-format-bold",cmd:"bold",hotkey:"Ctrl-B"},italic:{title:"Italic",ico:"fas far fa-italic mdi mdi-format-italic",cmd:"italic",hotkey:"Ctrl-I"},strikethrough:{cmd:"strikethrough",ico:"fas far fa-strikethrough mdi mdi-format-strikethrough",title:"Strikethrough"},heading:{title:"Heading",ico:"fas far fa-heading mdi mdi-format-header-3",cmd:"heading",hotkey:"Ctrl-H"},code:{title:"Code",ico:"fas far fa-code mdi mdi-code-tags",cmd:"code",hotkey:"Ctrl-X"},quote:{title:"Quote",ico:"fas far fa-quote-left mdi mdi-format-quote-open",cmd:"quote",hotkey:"Ctrl-Q"},link:{title:"Link",ico:"fas far fa-link mdi mdi-link",cmd:"link",hotkey:"Ctrl-K"},image:{title:"Image",ico:"fas far fa-image mdi mdi-image",cmd:"image",hotkey:"Ctrl-P"},fullscreen:{cmd:"fullscreen",ico:"fas far fa-expand mdi mdi-fullscreen",title:"Toggle Fullscreen",hotkey:"F11",ready:!0},preview:{cmd:"preview",ico:"fas far fa-eye mdi mdi-eye",title:"Toggle Preview",hotkey:"Ctrl-P",ready:!0}}}},theme:{type:String,default:"outline-secondary"},value:{type:String,default:"",required:!1},options:{type:Object,default:function(){return{lineWrapping:!0}}}},data:function(){return{editor:null,preview:!1,fullScreen:!1,html:"",toolbars:[]}},computed:{styles:function(){return{width:/^\d+$/.test(this.width)?"".concat(this.width,"px"):this.width,height:/^\d+$/.test(this.height)?"".concat(this.height,"px"):this.height}}},watch:{value:function(e){e!=this.editor.getValue()&&this.editor.setValue(e)}},methods:{isEmpty:function(e){return null==e||/^[\s\xa0]*$/.test(e)},isUrl:function(e){return!this.isEmpty(e)&&e.match(/((http(s)?):\/\/[\w\.\/\-=?#]+)/gi)},format:function(){for(var e=arguments[0],t=1;t<=arguments.length;t++)e=e.replace(/%[a-z]/,arguments[t]);return e},_toggleBlock:function(e,t,r){r=this.isEmpty(r)?t:r;var n,i=this.editor,o=i.getCursor("start"),a=i.getCursor("end");this.state()[e]?(t=(n=i.getLine(o.line)).slice(0,o.ch),r=n.slice(o.ch),"bold"==e?(t=t.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),r=r.replace(/(\*\*|__)/,"")):"italic"==e?(t=t.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),r=r.replace(/(\*|_)/,"")):"strikethrough"==e&&(t=t.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),r=r.replace(/(\*\*|~~)/,"")),i.replaceRange(t+r,{line:o.line,ch:0},{line:o.line,ch:99999999999999}),"bold"==e||"strikethrough"==e?(o.ch-=2,o!==a&&(a.ch-=2)):"italic"==e&&(o.ch-=1,o!==a&&(a.ch-=1))):(n=i.getSelection(),"bold"==e?n=(n=n.split("**").join("")).split("__").join(""):"italic"==e?n=(n=n.split("*").join("")).split("_").join(""):"strikethrough"==e&&(n=n.split("~~").join("")),i.replaceSelection(t+n+r),o.ch+=t.length,a.ch=o.ch+n.length),i.setSelection(o,a)},_toggleLine:function(e){for(var t=this.editor,r=this.state(),n=t.getCursor("start"),i=t.getCursor("end"),o={quote:/^(\s*)\>\s+/,bullist:/^(\s*)(\*|\-|\+)\s+/,numlist:/^(\s*)\d+\.\s+/},a={quote:"> ",bullist:"* ",numlist:"1. "},s=n.line;s<=i.line;s++)!function(n){var i=t.getLine(n);i=r[e]?i.replace(o[e],"$1"):a[e]+i,t.replaceRange(i,{line:n,ch:0},{line:n,ch:99999999999999})}(s)},state:function(e){e=e||this.editor.getCursor("start");var t=this.editor.getTokenAt(e);if(!t.type)return{};for(var r,n,i=t.type.split(" "),o={},a=0;a<i.length;a++)"strong"===(r=i[a])?o.bold=!0:"variable-2"===r?(n=this.editor.getLine(e.line),/^\s*\d+\.\s/.test(n)?o.numlist=!0:o.bullist=!0):"atom"===r?o.quote=!0:"em"===r?o.italic=!0:"quote"===r?o.quote=!0:"strikethrough"===r?o.strikethrough=!0:"comment"===r?o.code=!0:"link"===r||"url"===r?o.link=!0:"image"===r?o.image=!0:r.match(/^header(\-[1-6])?$/)&&(o[r.replace("header","heading")]=!0);return o},_replaceSelection:function(e,t,r){var n,i=this.editor,o=t[0],a=t[1],s=i.getCursor("start"),l=i.getCursor("end");r&&Object.keys(r).forEach((function(e){o=o.replace("#"+e+"#",r[e]),a=a.replace("#"+e+"#",r[e])})),e?(n=i.getLine(s.line),o=n.slice(0,s.ch),a=n.slice(s.ch),i.replaceRange(o+a,{line:s.line,ch:0})):(i.replaceSelection(o+a),s.ch+=o.length,s!==l&&(l.ch+=o.length)),i.setSelection(s,l)},drawImage:function(e){var t=this.state();this._replaceSelection(t.image,["![#title#](",'#url# "#title#")'],e)},drawLink:function(e){var t=this.state();this._replaceSelection(t.link,["[#title#]",'(#url# "#title#")'],e)},command:function(e){var t=this.editor,r=t.getSelection();switch(this.$emit("command:"+e,this),e){case"undo":t.undo();break;case"redo":t.redo();break;case"bold":this._toggleBlock("bold","**");break;case"italic":this._toggleBlock("italic","*");break;case"strikethrough":this._toggleBlock("strikethrough","~~");break;case"code":this._toggleBlock("code","```");break;case"heading":t.replaceSelection("\n### "+r);break;case"image":var n=prompt("Please enter image url","https://");if(this.isUrl(n)){var a=this.isEmpty(r)?"This is image title":r;this.drawImage({title:a,url:n})}break;case"link":n=prompt("Please enter link","https://"),this.isUrl(n)&&(a=this.isEmpty(r)?n:r,this.drawLink({title:a,url:n}));break;case"quote":this._toggleLine("quote");break;case"numlist":this._toggleLine("numlist");break;case"bullist":this._toggleLine("bullist");break;case"preview":this.html=i()(t.getValue(),{breaks:!0}),this.preview=!this.preview;break;case"fullscreen":this.fullScreen=!this.fullScreen,t.setOption("fullScreen",!t.getOption("fullScreen"));break;case"clean":var s=new o.default;t.replaceSelection(s.turndown(r))}t.focus()},build:function(){var e=this;if(!this.__rendered){var t=Object.assign({},this.buttons,this.extend),r={};this.toolbar.split("|").forEach((function(n,i){var o=[];n.toLowerCase().split(/(\s)/).forEach((function(n){if(!e.isEmpty(n)){var i=t[n];e.isEmpty(i.hotkey)||(r[i.hotkey]=function(){return e.command(i.cmd)}),o.push(i)}})),o.length>0&&e.toolbars.push(o)}));var n=Object.assign({mode:"markdown",extraKeys:r},this.options),i=this.editor=s.a.fromTextArea(document.getElementById(this.id),n);i.setValue(this.value),i.setSize(this.width,this.height),i.on("change",(function(t){var r=t.getValue();e.$emit("change",r),e.$emit("input",r)})),this.__rendered=!0}}},mounted:function(){this.build()},destroy:function(){this.editor.toTextArea()}}},"./node_modules/codemirror/addon/display/fullscreen.js":function(e,t,r){!function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function r(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var r=e.state.fullScreenRestore;t.style.width=r.width,t.style.height=r.height,window.scrollTo(r.scrollLeft,r.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,(function(n,i,o){o==e.Init&&(o=!1),!o!=!i&&(i?t(n):r(n))}))}(r("./node_modules/codemirror/lib/codemirror.js"))},"./node_modules/codemirror/addon/display/placeholder.js":function(e,t,r){!function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function r(e){t(e);var r=e.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=e.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var n=e.getOption("placeholder");"string"==typeof n&&(n=document.createTextNode(n)),r.appendChild(n),e.display.lineSpace.insertBefore(r,e.display.lineSpace.firstChild)}function n(e){o(e)&&r(e)}function i(e){var n=e.getWrapperElement(),i=o(e);n.className=n.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?r(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(r,o,a){var s=a&&a!=e.Init;if(o&&!s)r.on("blur",n),r.on("change",i),r.on("swapDoc",i),i(r);else if(!o&&s){r.off("blur",n),r.off("change",i),r.off("swapDoc",i),t(r);var l=r.getWrapperElement();l.className=l.className.replace(" CodeMirror-empty","")}o&&!r.hasFocus()&&n(r)}))}(r("./node_modules/codemirror/lib/codemirror.js"))},"./node_modules/codemirror/lib/codemirror.css":function(e,t,r){},"./node_modules/codemirror/lib/codemirror.js":function(e,t,r){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=n||i||o,s=a&&(n?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),p=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),f=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),b=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),_=m||/Mac/.test(t),y=/\bCrOS\b/.test(e),v=/win/i.test(t),x=p&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(p=!1,l=!0);var w=_&&(c||p&&(null==x||x<12.11)),k=r||a&&s>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var T,S=function(e,t){var r=e.className,n=E(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function C(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function A(e,t){return C(e).appendChild(t)}function M(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function I(e,t,r,n){var i=M(e,t,r,n);return i.setAttribute("role","presentation"),i}function O(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function L(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function z(e,t){var r=e.className;E(t).test(r)||(e.className+=(r?" ":"")+t)}function D(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!E(r[n]).test(t)&&(t+=" "+r[n]);return t}T=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var P=function(e){e.select()};function R(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function B(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function F(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=r-a%r,o=s+1}}m?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(P=function(e){try{e.select()}catch(e){}});var j=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function N(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}j.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},j.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};var U=50,V={toString:function(){return"CodeMirror.Pass"}},q={scroll:!1},$={origin:"*mouse"},G={origin:"+move"};function W(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,n=o+1,(i+=r-i%r)>=t)return n}}var H=[""];function Z(e){for(;H.length<=e;)H.push(X(H)+" ");return H[e]}function X(e){return e[e.length-1]}function K(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Y(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function J(){}function Q(e,t){var r;return Object.create?r=Object.create(e):(J.prototype=e,r=new J),t&&B(t,r),r}var ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function te(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function re(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ae(e,t,r){for(;(r<0?t>0:t<e.length)&&oe(e.charAt(t));)t+=r;return t}function se(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}function le(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}var ce=null;function ue(e,t,r){var n;ce=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:ce=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:ce=i)}return null!=n?n:ce}var pe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(r){return r<=247?e.charAt(r):1424<=r&&r<=1524?"R":1536<=r&&r<=1785?t.charAt(r-1536):1774<=r&&r<=2220?"r":8192<=r&&r<=8203?"w":8204==r?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(e,t,r){this.level=e,this.from=t,this.to=r}return function(e,t){var c="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!n.test(e))return!1;for(var u=e.length,p=[],h=0;h<u;++h)p.push(r(e.charCodeAt(h)));for(var d=0,f=c;d<u;++d){var m=p[d];"m"==m?p[d]=f:f=m}for(var g=0,b=c;g<u;++g){var _=p[g];"1"==_&&"r"==b?p[g]="n":o.test(_)&&(b=_,"r"==_&&(p[g]="R"))}for(var y=1,v=p[0];y<u-1;++y){var x=p[y];"+"==x&&"1"==v&&"1"==p[y+1]?p[y]="1":","!=x||v!=p[y+1]||"1"!=v&&"n"!=v||(p[y]=v),v=x}for(var w=0;w<u;++w){var k=p[w];if(","==k)p[w]="N";else if("%"==k){var E=void 0;for(E=w+1;E<u&&"%"==p[E];++E);for(var T=w&&"!"==p[w-1]||E<u&&"1"==p[E]?"1":"N",S=w;S<E;++S)p[S]=T;w=E-1}}for(var C=0,A=c;C<u;++C){var M=p[C];"L"==A&&"1"==M?p[C]="L":o.test(M)&&(A=M)}for(var I=0;I<u;++I)if(i.test(p[I])){var O=void 0;for(O=I+1;O<u&&i.test(p[O]);++O);for(var L="L"==(I?p[I-1]:c),z=L==("L"==(O<u?p[O]:c))?L?"L":"R":c,D=I;D<O;++D)p[D]=z;I=O-1}for(var P,R=[],B=0;B<u;)if(a.test(p[B])){var F=B;for(++B;B<u&&a.test(p[B]);++B);R.push(new l(0,F,B))}else{var j=B,N=R.length,U="rtl"==t?1:0;for(++B;B<u&&"L"!=p[B];++B);for(var V=j;V<B;)if(s.test(p[V])){j<V&&(R.splice(N,0,new l(1,j,V)),N+=U);var q=V;for(++V;V<B&&s.test(p[V]);++V);R.splice(N,0,new l(2,q,V)),N+=U,j=V}else++V;j<B&&R.splice(N,0,new l(1,j,B))}return"ltr"==t&&(1==R[0].level&&(P=e.match(/^\s+/))&&(R[0].from=P[0].length,R.unshift(new l(0,0,P[0].length))),1==X(R).level&&(P=e.match(/\s+$/))&&(X(R).to-=P[0].length,R.push(new l(0,u-P[0].length,u)))),"rtl"==t?R.reverse():R}}();function he(e,t){var r=e.order;return null==r&&(r=e.order=pe(e.text,t)),r}var de=[],fe=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||de).concat(r)}};function me(e,t){return e._handlers&&e._handlers[t]||de}function ge(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=N(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function be(e,t){var r=me(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function _e(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),be(e,r||t.type,e,t),Ee(t)||t.codemirrorIgnore}function ye(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==N(r,t[n])&&r.push(t[n])}function ve(e,t){return me(e,t).length>0}function xe(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){ge(this,e,t)}}function we(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ke(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ee(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Te(e){we(e),ke(e)}function Se(e){return e.target||e.srcElement}function Ce(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),_&&e.ctrlKey&&1==t&&(t=3),t}var Ae,Me,Ie=function(){if(a&&s<9)return!1;var e=M("div");return"draggable"in e||"dragDrop"in e}();function Oe(e){if(null==Ae){var t=M("span","​");A(e,M("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ae=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var r=Ae?M("span","​"):M("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Le(e){if(null!=Me)return Me;var t=A(e,document.createTextNode("AخA")),r=T(t,0,1).getBoundingClientRect(),n=T(t,1,2).getBoundingClientRect();return C(e),!(!r||r.left==r.right)&&(Me=n.right-r.right<3)}var ze,De=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Pe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Re="oncopy"in(ze=M("div"))||(ze.setAttribute("oncopy","return;"),"function"==typeof ze.oncopy),Be=null;function Fe(e){if(null!=Be)return Be;var t=A(e,M("span","x")),r=t.getBoundingClientRect(),n=T(t,0,1).getBoundingClientRect();return Be=Math.abs(r.left-n.left)>1}var je={},Ne={};function Ue(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),je[e]=t}function Ve(e,t){Ne[e]=t}function qe(e){if("string"==typeof e&&Ne.hasOwnProperty(e))e=Ne[e];else if(e&&"string"==typeof e.name&&Ne.hasOwnProperty(e.name)){var t=Ne[e.name];"string"==typeof t&&(t={name:t}),(e=Q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return qe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return qe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function $e(e,t){t=qe(t);var r=je[t.name];if(!r)return $e(e,"text/plain");var n=r(e,t);if(Ge.hasOwnProperty(t.name)){var i=Ge[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var Ge={};function We(e,t){B(t,Ge.hasOwnProperty(e)?Ge[e]:Ge[e]={})}function He(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Ze(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Xe(e,t,r){return!e.startState||e.startState(t,r)}var Ke=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Ye(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function Je(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,(function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i})),n}function Qe(e,t,r){var n=[];return e.iter(t,r,(function(e){n.push(e.text)})),n}function et(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function tt(e){if(null==e.parent)return null;for(var t=e.parent,r=N(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function rt(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return r+a}function nt(e,t){return t>=e.first&&t<e.first+e.size}function it(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ot(e,t,r){if(void 0===r&&(r=null),!(this instanceof ot))return new ot(e,t,r);this.line=e,this.ch=t,this.sticky=r}function at(e,t){return e.line-t.line||e.ch-t.ch}function st(e,t){return e.sticky==t.sticky&&0==at(e,t)}function lt(e){return ot(e.line,e.ch)}function ct(e,t){return at(e,t)<0?t:e}function ut(e,t){return at(e,t)<0?e:t}function pt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ht(e,t){if(t.line<e.first)return ot(e.first,0);var r=e.first+e.size-1;return t.line>r?ot(r,Ye(e,r).text.length):dt(t,Ye(e,t.line).text.length)}function dt(e,t){var r=e.ch;return null==r||r>t?ot(e.line,t):r<0?ot(e.line,0):e}function ft(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=ht(e,t[n]);return r}Ke.prototype.eol=function(){return this.pos>=this.string.length},Ke.prototype.sol=function(){return this.pos==this.lineStart},Ke.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ke.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ke.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ke.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ke.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ke.prototype.skipToEnd=function(){this.pos=this.string.length},Ke.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ke.prototype.backUp=function(e){this.pos-=e},Ke.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Ke.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Ke.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ke.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ke.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ke.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ke.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var mt=function(e,t){this.state=e,this.lookAhead=t},gt=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function bt(e,t,r,n){var i=[e.state.modeGen],o={};St(e,t.text,e.doc.mode,r,(function(e,t){return i.push(e,t)}),o,n);for(var a=r.state,s=function(n){r.baseTokens=i;var s=e.state.overlays[n],l=1,c=0;r.state=!0,St(e,t.text,s.mode,r,(function(e,t){for(var r=l;c<e;){var n=i[l];n>e&&i.splice(l,1,e,i[l+1],n),l+=2,c=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;r<l;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}}),o),r.state=a,r.baseTokens=null,r.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function _t(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=yt(e,tt(t)),i=t.text.length>e.options.maxHighlightLength&&He(e.doc.mode,n.state),o=bt(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function yt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new gt(n,!0,t);var o=Ct(e,t,r),a=o>n.first&&Ye(n,o-1).stateAfter,s=a?gt.fromSaved(n,a,o):new gt(n,Xe(n.mode),o);return n.iter(o,t,(function(r){vt(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?s.save():null,s.nextLine()})),r&&(n.modeFrontier=s.line),s}function vt(e,t,r,n){var i=e.doc.mode,o=new Ke(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&xt(i,r.state);!o.eol();)wt(i,o,r.state),o.start=o.pos}function xt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ze(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function wt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ze(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}gt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},gt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},gt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},gt.fromSaved=function(e,t,r){return t instanceof mt?new gt(e,He(e.mode,t.state),r,t.lookAhead):new gt(e,He(e.mode,t),r)},gt.prototype.save=function(e){var t=!1!==e?He(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new mt(t,this.maxLookAhead):t};var kt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Et(e,t,r,n){var i,o,a=e.doc,s=a.mode,l=Ye(a,(t=ht(a,t)).line),c=yt(e,t.line,r),u=new Ke(l.text,e.options.tabSize,c);for(n&&(o=[]);(n||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=wt(s,u,c.state),n&&o.push(new kt(u,i,He(a.mode,c.state)));return n?o:new kt(u,i,c.state)}function Tt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function St(e,t,r,n,i,o,a){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,p=new Ke(t,e.options.tabSize,n),h=e.options.addModeClass&&[null];for(""==t&&Tt(xt(r,n.state),o);!p.eol();){if(p.pos>e.options.maxHighlightLength?(s=!1,a&&vt(e,t,n,p.pos),p.pos=t.length,l=null):l=Tt(wt(r,p,n.state,h),o),h){var d=h[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||u!=l){for(;c<p.start;)i(c=Math.min(p.start,c+5e3),u);u=l}p.start=p.pos}for(;c<p.pos;){var f=Math.min(p.pos,c+5e3);i(f,u),c=f}}function Ct(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=Ye(o,s-1),c=l.stateAfter;if(c&&(!r||s+(c instanceof mt?c.lookAhead:0)<=o.modeFrontier))return s;var u=F(l.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}function At(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=Ye(e,n).stateAfter;if(i&&(!(i instanceof mt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}var Mt=!1,It=!1;function Ot(){Mt=!0}function Lt(){It=!0}function zt(e,t,r){this.marker=e,this.from=t,this.to=r}function Dt(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Pt(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Rt(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Bt(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new zt(a,o.from,s?null:o.to))}}return n}function Ft(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new zt(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}function jt(e,t){if(t.full)return null;var r=nt(e,t.from.line)&&Ye(e,t.from.line).markedSpans,n=nt(e,t.to.line)&&Ye(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==at(t.from,t.to),s=Bt(r,i,a),l=Ft(n,o,a),c=1==t.text.length,u=X(t.text).length+(c?i:0);if(s)for(var p=0;p<s.length;++p){var h=s[p];if(null==h.to){var d=Dt(l,h.marker);d?c&&(h.to=null==d.to?null:d.to+u):h.to=i}}if(l)for(var f=0;f<l.length;++f){var m=l[f];null!=m.to&&(m.to+=u),null==m.from?Dt(s,m.marker)||(m.from=u,c&&(s||(s=[])).push(m)):(m.from+=u,c&&(s||(s=[])).push(m))}s&&(s=Nt(s)),l&&l!=s&&(l=Nt(l));var g=[s];if(!c){var b,_=t.text.length-2;if(_>0&&s)for(var y=0;y<s.length;++y)null==s[y].to&&(b||(b=[])).push(new zt(s[y].marker,null,null));for(var v=0;v<_;++v)g.push(b);g.push(l)}return g}function Nt(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ut(e,t,r){var n=null;if(e.iter(t.line,r.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=N(n,r)||(n||(n=[])).push(r)}})),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],s=a.find(0),l=0;l<i.length;++l){var c=i[l];if(!(at(c.to,s.from)<0||at(c.from,s.to)>0)){var u=[l,1],p=at(c.from,s.from),h=at(c.to,s.to);(p<0||!a.inclusiveLeft&&!p)&&u.push({from:c.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}function Vt(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function qt(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function $t(e){return e.inclusiveLeft?-1:0}function Gt(e){return e.inclusiveRight?1:0}function Wt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=at(n.from,i.from)||$t(e)-$t(t);if(o)return-o;var a=at(n.to,i.to)||Gt(e)-Gt(t);return a||t.id-e.id}function Ht(e,t){var r,n=It&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||Wt(r,i.marker)<0)&&(r=i.marker);return r}function Zt(e){return Ht(e,!0)}function Xt(e){return Ht(e,!1)}function Kt(e,t){var r,n=It&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||Wt(r,o.marker)<0)&&(r=o.marker)}return r}function Yt(e,t,r,n,i){var o=Ye(e,t),a=It&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=at(c.from,r)||$t(l.marker)-$t(i),p=at(c.to,n)||Gt(l.marker)-Gt(i);if(!(u>=0&&p<=0||u<=0&&p>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(c.to,r)>=0:at(c.to,r)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(c.from,n)<=0:at(c.from,n)<0)))return!0}}}function Jt(e){for(var t;t=Zt(e);)e=t.find(-1,!0).line;return e}function Qt(e){for(var t;t=Xt(e);)e=t.find(1,!0).line;return e}function er(e){for(var t,r;t=Xt(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function tr(e,t){var r=Ye(e,t),n=Jt(r);return r==n?t:tt(n)}function rr(e,t){if(t>e.lastLine())return t;var r,n=Ye(e,t);if(!nr(e,n))return t;for(;r=Xt(n);)n=r.find(1,!0).line;return tt(n)+1}function nr(e,t){var r=It&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&ir(e,t,n))return!0}}function ir(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return ir(e,n.line,Dt(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&ir(e,t,i))return!0}function or(e){for(var t=0,r=(e=Jt(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==r)break;t+=s.height}return t}function ar(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Zt(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=Xt(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function sr(e){var t=e.display,r=e.doc;t.maxLine=Ye(r,r.first),t.maxLineLength=ar(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=ar(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var lr=function(e,t,r){this.text=e,qt(this,t),this.height=r?r(this):1};function cr(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Vt(e),qt(e,r);var i=n?n(e):1;i!=e.height&&et(e,i)}function ur(e){e.parent=null,Vt(e)}lr.prototype.lineNo=function(){return tt(this)},xe(lr);var pr={},hr={};function dr(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?hr:pr;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function fr(e,t){var r=I("span",null,null,l?"padding-right: .1px":null),n={pre:I("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;n.pos=0,n.addToken=gr,Le(e.display.measure)&&(a=he(o,e.doc.direction))&&(n.addToken=_r(n.addToken,a)),n.map=[],vr(o,n,_t(e,o,t!=e.display.externalMeasured&&tt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=D(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=D(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Oe(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return be(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=D(n.pre.className,n.textClass||"")),n}function mr(e){var t=M("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gr(e,t,r,n,i,o,l){if(t){var c,u=e.splitSpaces?br(t,e.trailingSpace):t,p=e.cm.state.specialChars,h=!1;if(p.test(t)){c=document.createDocumentFragment();for(var d=0;;){p.lastIndex=d;var f=p.exec(t),m=f?f.index-d:t.length-d;if(m){var g=document.createTextNode(u.slice(d,d+m));a&&s<9?c.appendChild(M("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!f)break;d+=m+1;var b=void 0;if("\t"==f[0]){var _=e.cm.options.tabSize,y=_-e.col%_;(b=c.appendChild(M("span",Z(y),"cm-tab"))).setAttribute("role","presentation"),b.setAttribute("cm-text","\t"),e.col+=y}else"\r"==f[0]||"\n"==f[0]?((b=c.appendChild(M("span","\r"==f[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",f[0]),e.col+=1):((b=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),a&&s<9?c.appendChild(M("span",[b])):c.appendChild(b),e.col+=1);e.map.push(e.pos,e.pos+1,b),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||n||i||h||o){var v=r||"";n&&(v+=n),i&&(v+=i);var x=M("span",[c],v,o);if(l)for(var w in l)l.hasOwnProperty(w)&&"style"!=w&&"class"!=w&&x.setAttribute(w,l[w]);return e.content.appendChild(x)}e.content.appendChild(c)}}function br(e,t){if(e.length>1&&!/  /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}function _r(e,t){return function(r,n,i,o,a,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+n.length;;){for(var p=void 0,h=0;h<t.length&&!((p=t[h]).to>c&&p.from<=c);h++);if(p.to>=u)return e(r,n,i,o,a,s,l);e(r,n.slice(0,p.to-c),i,o,null,s,l),o=null,n=n.slice(p.to-c),c=p.to}}}function yr(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function vr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,s,l,c,u,p,h,d=i.length,f=0,m=1,g="",b=0;;){if(b==f){l=c=u=s="",h=null,p=null,b=1/0;for(var _=[],y=void 0,v=0;v<n.length;++v){var x=n[v],w=x.marker;if("bookmark"==w.type&&x.from==f&&w.widgetNode)_.push(w);else if(x.from<=f&&(null==x.to||x.to>f||w.collapsed&&x.to==f&&x.from==f)){if(null!=x.to&&x.to!=f&&b>x.to&&(b=x.to,c=""),w.className&&(l+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&x.from==f&&(u+=" "+w.startStyle),w.endStyle&&x.to==b&&(y||(y=[])).push(w.endStyle,x.to),w.title&&((h||(h={})).title=w.title),w.attributes)for(var k in w.attributes)(h||(h={}))[k]=w.attributes[k];w.collapsed&&(!p||Wt(p.marker,w)<0)&&(p=x)}else x.from>f&&b>x.from&&(b=x.from)}if(y)for(var E=0;E<y.length;E+=2)y[E+1]==b&&(c+=" "+y[E]);if(!p||p.from==f)for(var T=0;T<_.length;++T)yr(t,0,_[T]);if(p&&(p.from||0)==f){if(yr(t,(null==p.to?d+1:p.to)-f,p.marker,null==p.from),null==p.to)return;p.to==f&&(p=!1)}}if(f>=d)break;for(var S=Math.min(d,b);;){if(g){var C=f+g.length;if(!p){var A=C>S?g.slice(0,S-f):g;t.addToken(t,A,a?a+l:l,u,f+A.length==b?c:"",s,h)}if(C>=S){g=g.slice(S-f),f=S;break}f=C,u=""}g=i.slice(o,o=r[m++]),a=dr(r[m++],t.cm.options)}}else for(var M=1;M<r.length;M+=2)t.addToken(t,i.slice(o,o=r[M]),dr(r[M+1],t.cm.options))}function xr(e,t,r){this.line=t,this.rest=er(t),this.size=this.rest?tt(X(this.rest))-r+1:1,this.node=this.text=null,this.hidden=nr(e,t)}function wr(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new xr(e.doc,Ye(e.doc,o),o);n=o+a.size,i.push(a)}return i}var kr=null;function Er(e){kr?kr.ops.push(e):e.ownsGroup=kr={ops:[e],delayedCallbacks:[]}}function Tr(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function Sr(e,t){var r=e.ownsGroup;if(r)try{Tr(r)}finally{kr=null,t(r)}}var Cr=null;function Ar(e,t){var r=me(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);kr?n=kr.delayedCallbacks:Cr?n=Cr:(n=Cr=[],setTimeout(Mr,0));for(var o=function(e){n.push((function(){return r[e].apply(null,i)}))},a=0;a<r.length;++a)o(a)}}function Mr(){var e=Cr;Cr=null;for(var t=0;t<e.length;++t)e[t]()}function Ir(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Dr(e,t):"gutter"==o?Rr(e,t,r,n):"class"==o?Pr(e,t):"widget"==o&&Br(e,t,n)}t.changes=null}function Or(e){return e.node==e.text&&(e.node=M("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function Lr(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=Or(t);t.background=n.insertBefore(M("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function zr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):fr(e,t)}function Dr(e,t){var r=t.text.className,n=zr(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Pr(e,t)):r&&(t.text.className=r)}function Pr(e,t){Lr(e,t),t.line.wrapClass?Or(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Rr(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=Or(t);t.gutterBackground=M("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=Or(t),s=t.gutter=M("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(M("div",it(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(M("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[c]+"px; width: "+n.gutterWidth[c]+"px"))}}}function Br(e,t,r){t.alignable&&(t.alignable=null);for(var n=E("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);jr(e,t,r)}function Fr(e,t,r,n){var i=zr(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Pr(e,t),Rr(e,t,r,n),jr(e,t,n),t.node}function jr(e,t,r){if(Nr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Nr(e,t.rest[n],t,r,!1)}function Nr(e,t,r,n,i){if(t.widgets)for(var o=Or(r),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=M("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Ur(l,c,r,n),e.display.input.setUneditable(c),i&&l.above?o.insertBefore(c,r.gutter||r.text):o.appendChild(c),Ar(l,"redraw")}}function Ur(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Vr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!O(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),A(t.display.measure,M("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function qr(e,t){for(var r=Se(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function $r(e){return e.lineSpace.offsetTop}function Gr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Wr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=A(e.measure,M("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Hr(e){return U-e.display.nativeBarWidth}function Zr(e){return e.display.scroller.clientWidth-Hr(e)-e.display.barWidth}function Xr(e){return e.display.scroller.clientHeight-Hr(e)-e.display.barHeight}function Kr(e,t,r){var n=e.options.lineWrapping,i=n&&Zr(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Yr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(tt(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Jr(e,t){var r=tt(t=Jt(t)),n=e.display.externalMeasured=new xr(e.doc,t,r);n.lineN=r;var i=n.built=fr(e,n);return n.text=i.pre,A(e.display.lineMeasure,i.pre),n}function Qr(e,t,r,n){return rn(e,tn(e,t),r,n)}function en(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Rn(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function tn(e,t){var r=tt(t),n=en(e,r);n&&!n.text?n=null:n&&n.changes&&(Ir(e,n,r,On(e)),e.curOp.forceUpdate=!0),n||(n=Jr(e,t));var i=Yr(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function rn(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Kr(e,t.view,t.rect),t.hasHeights=!0),(o=ln(e,t,r,n)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var nn,on={left:0,right:0,top:0,bottom:0};function an(e,t,r){for(var n,i,o,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(i=0,o=1,a="left"):t<l?o=1+(i=t-s):(c==e.length-3||t==l&&e[c+3]>t)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(n=e[c+2],s==l&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],a="left";if("right"==r&&i==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function sn(e,t){var r=on;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function ln(e,t,r,n){var i,o=an(t.map,r,n),l=o.node,c=o.start,u=o.end,p=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;c&&oe(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&oe(t.line.text.charAt(o.coverStart+u));)++u;if((i=a&&s<9&&0==c&&u==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():sn(T(l,c,u).getClientRects(),n)).left||i.right||0==c)break;u=c,c-=1,p="right"}a&&s<11&&(i=cn(e.display.measure,i))}else{var d;c>0&&(p=n="right"),i=e.options.lineWrapping&&(d=l.getClientRects()).length>1?d["right"==n?d.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var f=l.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+In(e.display),top:f.top,bottom:f.bottom}:on}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,b=(m+g)/2,_=t.view.measure.heights,y=0;y<_.length-1&&!(b<_[y]);y++);var v=y?_[y-1]:0,x=_[y],w={left:("right"==p?i.right:i.left)-t.rect.left,right:("left"==p?i.left:i.right)-t.rect.left,top:v,bottom:x};return i.left||i.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=m,w.rbottom=g),w}function cn(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Fe(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function un(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function pn(e){e.display.externalMeasure=null,C(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)un(e.display.view[t])}function hn(e){pn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function dn(){return u&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function fn(){return u&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function mn(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=Vr(e.widgets[r]));return t}function gn(e,t,r,n,i){if(!i){var o=mn(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var a=or(t);if("local"==n?a+=$r(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==n?0:fn());var l=s.left+("window"==n?0:dn());r.left+=l,r.right+=l}return r.top+=a,r.bottom+=a,r}function bn(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=dn(),i-=fn();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function _n(e,t,r,n,i){return n||(n=Ye(e.doc,t.line)),gn(e,n,Qr(e,n,t.ch,i),r)}function yn(e,t,r,n,i,o){function a(t,a){var s=rn(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,gn(e,n,s,r)}n=n||Ye(e.doc,t.line),i||(i=tn(e,n));var s=he(n,e.doc.direction),l=t.ch,c=t.sticky;if(l>=n.text.length?(l=n.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,r){return a(r?e-1:e,1==s[t].level!=r)}var p=ue(s,l,c),h=ce,d=u(l,p,"before"==c);return null!=h&&(d.other=u(l,h,"before"!=c)),d}function vn(e,t){var r=0;t=ht(e.doc,t),e.options.lineWrapping||(r=In(e.display)*t.ch);var n=Ye(e.doc,t.line),i=or(n)+$r(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function xn(e,t,r,n,i){var o=ot(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function wn(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return xn(n.first,0,null,-1,-1);var i=rt(n,r),o=n.first+n.size-1;if(i>o)return xn(n.first+n.size-1,Ye(n,o).text.length,null,1,1);t<0&&(t=0);for(var a=Ye(n,i);;){var s=Sn(e,a,i,t,r),l=Kt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=Ye(n,i=c.line)}}function kn(e,t,r,n){n-=mn(t);var i=t.text.length,o=se((function(t){return rn(e,r,t-1).bottom<=n}),i,0);return{begin:o,end:i=se((function(t){return rn(e,r,t).top>n}),o,i)}}function En(e,t,r,n){return r||(r=tn(e,t)),kn(e,t,r,gn(e,t,rn(e,r,n),"line").top)}function Tn(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Sn(e,t,r,n,i){i-=or(t);var o=tn(e,t),a=mn(t),s=0,l=t.text.length,c=!0,u=he(t,e.doc.direction);if(u){var p=(e.options.lineWrapping?An:Cn)(e,t,r,o,u,n,i);s=(c=1!=p.level)?p.from:p.to-1,l=c?p.to:p.from-1}var h,d,f=null,m=null,g=se((function(t){var r=rn(e,o,t);return r.top+=a,r.bottom+=a,!!Tn(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(f=t,m=r),!0)}),s,l),b=!1;if(m){var _=n-m.left<m.right-n,y=_==c;g=f+(y?0:1),d=y?"after":"before",h=_?m.left:m.right}else{c||g!=l&&g!=s||g++,d=0==g?"after":g==t.text.length?"before":rn(e,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var v=yn(e,ot(r,g,d),"line",t,o);h=v.left,b=i<v.top?-1:i>=v.bottom?1:0}return xn(r,g=ae(t.text,g,1),d,b,n-h)}function Cn(e,t,r,n,i,o,a){var s=se((function(s){var l=i[s],c=1!=l.level;return Tn(yn(e,ot(r,c?l.to:l.from,c?"before":"after"),"line",t,n),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=yn(e,ot(r,c?l.from:l.to,c?"after":"before"),"line",t,n);Tn(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l}function An(e,t,r,n,i,o,a){var s=kn(e,t,n,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,p=null,h=0;h<i.length;h++){var d=i[h];if(!(d.from>=c||d.to<=l)){var f=rn(e,n,1!=d.level?Math.min(c,d.to)-1:Math.max(l,d.from)).right,m=f<o?o-f+1e9:f-o;(!u||p>m)&&(u=d,p=m)}}return u||(u=i[i.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function Mn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==nn){nn=M("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)nn.appendChild(document.createTextNode("x")),nn.appendChild(M("br"));nn.appendChild(document.createTextNode("x"))}A(e.measure,nn);var r=nn.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),C(e.measure),r||1}function In(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=M("span","xxxxxxxxxx"),r=M("pre",[t],"CodeMirror-line-like");A(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function On(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;r[s]=o.offsetLeft+o.clientLeft+i,n[s]=o.clientWidth}return{fixedPos:Ln(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Ln(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function zn(e){var t=Mn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/In(e.display)-3);return function(i){if(nr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function Dn(e){var t=e.doc,r=zn(e);t.iter((function(e){var t=r(e);t!=e.height&&et(e,t)}))}function Pn(e,t,r,n){var i=e.display;if(!r&&"true"==Se(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(e){return null}var l,c=wn(e,o,a);if(n&&c.xRel>0&&(l=Ye(e.doc,c.line).text).length==c.ch){var u=F(l,l.length,e.options.tabSize)-l.length;c=ot(c.line,Math.max(0,Math.round((o-Wr(e.display).left)/In(e.display))-u))}return c}function Rn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function Bn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)It&&tr(e.doc,t)<i.viewTo&&jn(e);else if(r<=i.viewFrom)It&&rr(e.doc,r+n)>i.viewFrom?jn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)jn(e);else if(t<=i.viewFrom){var o=Nn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):jn(e)}else if(r>=i.viewTo){var a=Nn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):jn(e)}else{var s=Nn(e,t,t,-1),l=Nn(e,r,r+n,1);s&&l?(i.view=i.view.slice(0,s.index).concat(wr(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):jn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function Fn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[Rn(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==N(a,r)&&a.push(r)}}}function jn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Nn(e,t,r,n){var i,o=Rn(e,t),a=e.display.view;if(!It||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=t){if(n>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;tr(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function Un(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=wr(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=wr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Rn(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(wr(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,Rn(e,r)))),n.viewTo=r}function Vn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function qn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function $n(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(t||a!=r.sel.primIndex){var s=r.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&Gn(e,s.head,i),l||Hn(e,s,o)}}return n}function Gn(e,t,r){var n=yn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(M("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(M("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function Wn(e,t){return e.top-t.top||e.left-t.left}function Hn(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),a=Wr(e.display),s=a.left,l=Math.max(n.sizerWidth,Zr(e)-n.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function u(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(M("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(null==r?l-e:r)+"px;\n                             height: "+(n-t)+"px"))}function p(t,r,n){var o,a,p=Ye(i,t),h=p.text.length;function d(r,n){return _n(e,ot(t,r),"div",p,n)}function f(t,r,n){var i=En(e,p,null,t),o="ltr"==r==("after"==n)?"left":"right";return d("after"==n?i.begin:i.end-(/\s/.test(p.text.charAt(i.end-1))?2:1),o)[o]}var m=he(p,i.direction);return le(m,r||0,null==n?h:n,(function(e,t,i,p){var g="ltr"==i,b=d(e,g?"left":"right"),_=d(t-1,g?"right":"left"),y=null==r&&0==e,v=null==n&&t==h,x=0==p,w=!m||p==m.length-1;if(_.top-b.top<=3){var k=(c?v:y)&&w,E=(c?y:v)&&x?s:(g?b:_).left,T=k?l:(g?_:b).right;u(E,b.top,T-E,b.bottom)}else{var S,C,A,M;g?(S=c&&y&&x?s:b.left,C=c?l:f(e,i,"before"),A=c?s:f(t,i,"after"),M=c&&v&&w?l:_.right):(S=c?f(e,i,"before"):s,C=!c&&y&&x?l:b.right,A=!c&&v&&w?s:_.left,M=c?f(t,i,"after"):l),u(S,b.top,C-S,b.bottom),b.bottom<_.top&&u(s,b.bottom,null,_.top),u(A,_.top,M-A,_.bottom)}(!o||Wn(b,o)<0)&&(o=b),Wn(_,o)<0&&(o=_),(!a||Wn(b,a)<0)&&(a=b),Wn(_,a)<0&&(a=_)})),{start:o,end:a}}var h=t.from(),d=t.to();if(h.line==d.line)p(h.line,h.ch,d.ch);else{var f=Ye(i,h.line),m=Ye(i,d.line),g=Jt(f)==Jt(m),b=p(h.line,h.ch,g?f.text.length+1:null).end,_=p(d.line,g?0:null,d.ch).start;g&&(b.top<_.top-2?(u(b.right,b.top,null,b.bottom),u(s,_.top,_.left,_.bottom)):u(b.right,b.top,_.left-b.right,b.bottom)),b.bottom<_.top&&u(s,b.bottom,null,_.top)}r.appendChild(o)}function Zn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Xn(e){e.state.focused||(e.display.input.focus(),Yn(e))}function Kn(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Jn(e))}),100)}function Yn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(be(e,"focus",e,t),e.state.focused=!0,z(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Zn(e))}function Jn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(be(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Qn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=e.options.lineWrapping,l=void 0,c=0;if(!i.hidden){if(a&&s<8){var u=i.node.offsetTop+i.node.offsetHeight;l=u-r,r=u}else{var p=i.node.getBoundingClientRect();l=p.bottom-p.top,!o&&i.text.firstChild&&(c=i.text.firstChild.getBoundingClientRect().right-p.left-1)}var h=i.line.height-l;if((h>.005||h<-.005)&&(et(i.line,l),ei(i.line),i.rest))for(var d=0;d<i.rest.length;d++)ei(i.rest[d]);if(c>e.display.sizerWidth){var f=Math.ceil(c/In(e.display));f>e.display.maxLineLength&&(e.display.maxLineLength=f,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function ei(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function ti(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-$r(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=rt(t,n),a=rt(t,i);if(r&&r.ensure){var s=r.ensure.from.line,l=r.ensure.to.line;s<o?(o=s,a=rt(t,or(Ye(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=rt(t,or(Ye(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ri(e,t){if(!_e(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!f){var o=M("div","​",null,"position: absolute;\n                         top: "+(t.top-r.viewOffset-$r(e.display))+"px;\n                         height: "+(t.bottom-t.top+Hr(e)+r.barHeight)+"px;\n                         left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ni(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ot(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=yn(e,t),l=r&&r!=t?yn(e,r):s,c=oi(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n}),u=e.doc.scrollTop,p=e.doc.scrollLeft;if(null!=c.scrollTop&&(hi(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(fi(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return i}function ii(e,t){var r=oi(e,t);null!=r.scrollTop&&hi(e,r.scrollTop),null!=r.scrollLeft&&fi(e,r.scrollLeft)}function oi(e,t){var r=e.display,n=Mn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Xr(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Gr(r),l=t.top<n,c=t.bottom>s-n;if(t.top<i)a.scrollTop=l?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,h=Zr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),d=t.right-t.left>h;return d&&(t.right=t.left+h),t.left<10?a.scrollLeft=0:t.left<p?a.scrollLeft=Math.max(0,t.left-(d?0:10)):t.right>h+p-3&&(a.scrollLeft=t.right+(d?0:10)-h),a}function ai(e,t){null!=t&&(ui(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function si(e){ui(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function li(e,t,r){null==t&&null==r||ui(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function ci(e,t){ui(e),e.curOp.scrollToPos=t}function ui(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,pi(e,vn(e,t.from),vn(e,t.to),t.margin))}function pi(e,t,r,n){var i=oi(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});li(e,i.scrollLeft,i.scrollTop)}function hi(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||qi(e,{top:t}),di(e,t,!0),r&&qi(e),Pi(e,100))}function di(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function fi(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,Hi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function mi(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Gr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Hr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var gi=function(e,t,r){this.cm=r;var n=this.vert=M("div",[M("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=M("div",[M("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),fe(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),fe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};gi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},gi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},gi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},gi.prototype.zeroWidthHack=function(){var e=_&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new j,this.disableVert=new j},gi.prototype.enableZeroWidthBar=function(e,t,r){function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},gi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var bi=function(){};function _i(e,t){t||(t=mi(e));var r=e.display.barWidth,n=e.display.barHeight;yi(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Qn(e),yi(e,mi(e)),r=e.display.barWidth,n=e.display.barHeight}function yi(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}bi.prototype.update=function(){return{bottom:0,right:0}},bi.prototype.setScrollLeft=function(){},bi.prototype.setScrollTop=function(){},bi.prototype.clear=function(){};var vi={native:gi,null:bi};function xi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new vi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?fi(e,t):hi(e,t)}),e),e.display.scrollbars.addClass&&z(e.display.wrapper,e.display.scrollbars.addClass)}var wi=0;function ki(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++wi},Er(e.curOp)}function Ei(e){var t=e.curOp;t&&Sr(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Ti(e)}))}function Ti(e){for(var t=e.ops,r=0;r<t.length;r++)Si(t[r]);for(var n=0;n<t.length;n++)Ci(t[n]);for(var i=0;i<t.length;i++)Ai(t[i]);for(var o=0;o<t.length;o++)Mi(t[o]);for(var a=0;a<t.length;a++)Ii(t[a])}function Si(e){var t=e.cm,r=t.display;Fi(t),e.updateMaxLine&&sr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Bi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ci(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function Ai(e){var t=e.cm,r=t.display;e.updatedDisplay&&Qn(t),e.barMeasure=mi(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Qr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Hr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Zr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Mi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&fi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==L();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&_i(t,e.barMeasure),e.updatedDisplay&&Wi(t,e.barMeasure),e.selectionChanged&&Zn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Xn(e.cm)}function Ii(e){var t=e.cm,r=t.display,n=t.doc;e.updatedDisplay&&Vi(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&di(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&fi(t,e.scrollLeft,!0,!0),e.scrollToPos&&ri(t,ni(t,ht(n,e.scrollToPos.from),ht(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||be(i[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&be(o[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&be(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Oi(e,t){if(e.curOp)return t();ki(e);try{return t()}finally{Ei(e)}}function Li(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ki(e);try{return t.apply(e,arguments)}finally{Ei(e)}}}function zi(e){return function(){if(this.curOp)return e.apply(this,arguments);ki(this);try{return e.apply(this,arguments)}finally{Ei(this)}}}function Di(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ki(t);try{return e.apply(this,arguments)}finally{Ei(t)}}}function Pi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,R(Ri,e))}function Ri(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=yt(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(n.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?He(t.mode,n.state):null,l=bt(e,o,n,!0);s&&(n.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var p=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!p&&h<a.length;++h)p=a[h]!=o.styles[h];p&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&vt(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return Pi(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Oi(e,(function(){for(var t=0;t<i.length;t++)Fn(e,i[t],"text")}))}}var Bi=function(e,t,r){var n=e.display;this.viewport=t,this.visible=ti(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Zr(e),this.force=r,this.dims=On(e),this.events=[]};function Fi(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Hr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Hr(e)+"px",t.scrollbarsClipped=!0)}function ji(e){if(e.hasFocus())return null;var t=L();if(!t||!O(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&O(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function Ni(e){if(e&&e.activeElt&&e.activeElt!=L()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function Ui(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return jn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Vn(e))return!1;Zi(e)&&(jn(e),t.dims=On(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),It&&(o=tr(e.doc,o),a=rr(e.doc,a));var s=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Un(e,o,a),r.viewOffset=or(Ye(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var l=Vn(e);if(!s&&0==l&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=ji(e);return l>4&&(r.lineDiv.style.display="none"),$i(e,r.updateLineNumbers,t.dims),l>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,Ni(c),C(r.cursorDiv),C(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Pi(e,400)),r.updateLineNumbers=null,!0}function Vi(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Zr(e))n&&(t.visible=ti(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Gr(e.display)-Xr(e),r.top)}),t.visible=ti(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Ui(e,t))break;Qn(e);var i=mi(e);qn(e),_i(e,i),Wi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function qi(e,t){var r=new Bi(e,t);if(Ui(e,r)){Qn(e),Vi(e,r);var n=mi(e);qn(e),_i(e,n),Wi(e,n),r.finish()}}function $i(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,a=o.firstChild;function s(t){var r=t.nextSibling;return l&&_&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var c=n.view,u=n.viewFrom,p=0;p<c.length;p++){var h=c[p];if(h.hidden);else if(h.node&&h.node.parentNode==o){for(;a!=h.node;)a=s(a);var d=i&&null!=t&&t<=u&&h.lineNumber;h.changes&&(N(h.changes,"gutter")>-1&&(d=!1),Ir(e,h,u,r)),d&&(C(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(it(e.options,u)))),a=h.node.nextSibling}else{var f=Fr(e,h,u,r);o.insertBefore(f,a)}u+=h.size}for(;a;)a=s(a)}function Gi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Wi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Hr(e)+"px"}function Hi(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=Ln(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var s=r[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Zi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=it(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(M("div",[M("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Gi(e.display),!0}return!1}function Xi(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;n=!0}r.push({className:o,style:a})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function Ki(e){var t=e.gutters,r=e.gutterSpecs;C(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],o=i.className,a=i.style,s=t.appendChild(M("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",Gi(e)}function Yi(e){Ki(e.display),Bn(e),Hi(e)}function Ji(e,t,n,i){var o=this;this.input=n,o.scrollbarFiller=M("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=M("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=I("div",null,"CodeMirror-code"),o.selectionDiv=M("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=M("div",null,"CodeMirror-cursors"),o.measure=M("div",null,"CodeMirror-measure"),o.lineMeasure=M("div",null,"CodeMirror-measure"),o.lineSpace=I("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=I("div",[o.lineSpace],"CodeMirror-lines");o.mover=M("div",[c],null,"position: relative"),o.sizer=M("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=M("div",null,null,"position: absolute; height: "+U+"px; width: 1px;"),o.gutters=M("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=M("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=M("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||r&&b||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=Xi(i.gutters,i.lineNumbers),Ki(o),n.init(o)}Bi.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},Bi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)be.apply(null,this.events[e])};var Qi=0,eo=null;function to(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function ro(e){var t=to(e);return t.x*=eo,t.y*=eo,t}function no(e,t){var n=to(t),i=n.x,o=n.y,a=e.display,s=a.scroller,c=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&c||o&&u){if(o&&_&&l)e:for(var h=t.target,d=a.view;h!=s;h=h.parentNode)for(var f=0;f<d.length;f++)if(d[f].node==h){e.display.currentWheelTarget=h;break e}if(i&&!r&&!p&&null!=eo)return o&&u&&hi(e,Math.max(0,s.scrollTop+o*eo)),fi(e,Math.max(0,s.scrollLeft+i*eo)),(!o||o&&u)&&we(t),void(a.wheelStartX=null);if(o&&null!=eo){var m=o*eo,g=e.doc.scrollTop,b=g+a.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):b=Math.min(e.doc.height,b+m+50),qi(e,{top:g,bottom:b})}Qi<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,r=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,r&&(eo=(eo*Qi+r)/(Qi+1),++Qi)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}a?eo=-.53:r?eo=15:u?eo=-.7:h&&(eo=-1/3);var io=function(e,t){this.ranges=e,this.primIndex=t};io.prototype.primary=function(){return this.ranges[this.primIndex]},io.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!st(r.anchor,n.anchor)||!st(r.head,n.head))return!1}return!0},io.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new oo(lt(this.ranges[t].anchor),lt(this.ranges[t].head));return new io(e,this.primIndex)},io.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},io.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(at(t,n.from())>=0&&at(e,n.to())<=0)return r}return-1};var oo=function(e,t){this.anchor=e,this.head=t};function ao(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort((function(e,t){return at(e.from(),t.from())})),r=N(t,i);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],l=at(s.to(),a.from());if(n&&!a.empty()?l>0:l>=0){var c=ut(s.from(),a.from()),u=ct(s.to(),a.to()),p=s.empty()?a.from()==a.head:s.from()==s.head;o<=r&&--r,t.splice(--o,2,new oo(p?u:c,p?c:u))}}return new io(t,r)}function so(e,t){return new io([new oo(e,t||e)],0)}function lo(e){return e.text?ot(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function co(e,t){if(at(e,t.from)<0)return e;if(at(e,t.to)<=0)return lo(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=lo(t).ch-t.to.ch),ot(r,n)}function uo(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new oo(co(i.anchor,t),co(i.head,t)))}return ao(e.cm,r,e.sel.primIndex)}function po(e,t,r){return e.line==t.line?ot(r.line,e.ch-t.ch+r.ch):ot(r.line+(e.line-t.line),e.ch)}function ho(e,t,r){for(var n=[],i=ot(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=po(s.from,i,o),c=po(lo(s),i,o);if(i=s.to,o=c,"around"==r){var u=e.sel.ranges[a],p=at(u.head,u.anchor)<0;n[a]=new oo(p?c:l,p?l:c)}else n[a]=new oo(l,l)}return new io(n,e.sel.primIndex)}function fo(e){e.doc.mode=$e(e.options,e.doc.modeOption),mo(e)}function mo(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Pi(e,100),e.state.modeGen++,e.curOp&&Bn(e)}function go(e,t){return 0==t.from.ch&&0==t.to.ch&&""==X(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function bo(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){cr(e,r,i,n),Ar(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new lr(c[o],i(o),n));return r}var s=t.from,l=t.to,c=t.text,u=Ye(e,s.line),p=Ye(e,l.line),h=X(c),d=i(c.length-1),f=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(go(e,t)){var m=a(0,c.length-1);o(p,p.text,d),f&&e.remove(s.line,f),m.length&&e.insert(s.line,m)}else if(u==p)if(1==c.length)o(u,u.text.slice(0,s.ch)+h+u.text.slice(l.ch),d);else{var g=a(1,c.length-1);g.push(new lr(h+u.text.slice(l.ch),d,n)),o(u,u.text.slice(0,s.ch)+c[0],i(0)),e.insert(s.line+1,g)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+p.text.slice(l.ch),i(0)),e.remove(s.line+1,f);else{o(u,u.text.slice(0,s.ch)+c[0],i(0)),o(p,h+p.text.slice(l.ch),d);var b=a(1,c.length-1);f>1&&e.remove(s.line+1,f-1),e.insert(s.line+1,b)}Ar(e,"change",e,t)}function _o(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var s=e.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;r&&!l||(t(s.doc,l),n(s.doc,e,l))}}}n(e,null,!0)}function yo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Dn(e),fo(e),vo(e),e.options.lineWrapping||sr(e),e.options.mode=t.modeOption,Bn(e)}function vo(e){("rtl"==e.doc.direction?z:S)(e.display.lineDiv,"CodeMirror-rtl")}function xo(e){Oi(e,(function(){vo(e),Bn(e)}))}function wo(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ko(e,t){var r={from:lt(t.from),to:lo(t),text:Je(e,t.from,t.to)};return Io(e,r,t.from.line,t.to.line+1),_o(e,(function(e){return Io(e,r,t.from.line,t.to.line+1)}),!0),r}function Eo(e){for(;e.length&&X(e).ranges;)e.pop()}function To(e,t){return t?(Eo(e.done),X(e.done)):e.done.length&&!X(e.done).ranges?X(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),X(e.done)):void 0}function So(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=To(i,i.lastOp==n)))a=X(o.changes),0==at(t.from,t.to)&&0==at(t.from,a.to)?a.to=lo(t):o.changes.push(ko(e,t));else{var l=X(i.done);for(l&&l.ranges||Mo(e.sel,i.done),o={changes:[ko(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||be(e,"historyAdded")}function Co(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ao(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Co(e,o,X(i.done),t))?i.done[i.done.length-1]=t:Mo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&Eo(i.undone)}function Mo(e,t){var r=X(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Io(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),(function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o}))}function Oo(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function Lo(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Oo(r[i]));return n}function zo(e,t){var r=Lo(e,t),n=jt(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else a&&(r[i]=a)}return r}function Do(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?io.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];n.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var p in c)(u=p.match(/^spans_(\d+)$/))&&N(t,Number(u[1]))>-1&&(X(s)[p]=c[p],delete c[p])}}}return n}function Po(e,t,r,n){if(n){var i=e.anchor;if(r){var o=at(t,i)<0;o!=at(r,i)<0?(i=t,t=r):o!=at(t,r)<0&&(t=r)}return new oo(i,t)}return new oo(r||t,t)}function Ro(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Vo(e,new io([Po(e.sel.primary(),t,r,i)],0),n)}function Bo(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=Po(e.sel.ranges[o],t[o],null,i);Vo(e,ao(e.cm,n,e.sel.primIndex),r)}function Fo(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Vo(e,ao(e.cm,i,e.sel.primIndex),n)}function jo(e,t,r,n){Vo(e,so(t,r),n)}function No(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new oo(ht(e,t[r].anchor),ht(e,t[r].head))},origin:r&&r.origin};return be(e,"beforeSelectionChange",e,n),e.cm&&be(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?ao(e.cm,n.ranges,n.ranges.length-1):t}function Uo(e,t,r){var n=e.history.done,i=X(n);i&&i.ranges?(n[n.length-1]=t,qo(e,t,r)):Vo(e,t,r)}function Vo(e,t,r){qo(e,t,r),Ao(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function qo(e,t,r){(ve(e,"beforeSelectionChange")||e.cm&&ve(e.cm,"beforeSelectionChange"))&&(t=No(e,t,r));var n=r&&r.bias||(at(t.primary().head,e.sel.primary().head)<0?-1:1);$o(e,Wo(e,t,n,!0)),r&&!1===r.scroll||!e.cm||si(e.cm)}function $o(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ye(e.cm)),Ar(e,"cursorActivity",e))}function Go(e){$o(e,Wo(e,e.sel,null,!1))}function Wo(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=Zo(e,a.anchor,s&&s.anchor,r,n),c=Zo(e,a.head,s&&s.head,r,n);(i||l!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new oo(l,c))}return i?ao(e.cm,i,t.primIndex):t}function Ho(e,t,r,n,i){var o=Ye(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(i&&(be(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(r){var p=l.find(n<0?1:-1),h=void 0;if((n<0?u:c)&&(p=Xo(e,p,-n,p&&p.line==t.line?o:null)),p&&p.line==t.line&&(h=at(p,r))&&(n<0?h<0:h>0))return Ho(e,p,t,n,i)}var d=l.find(n<0?-1:1);return(n<0?c:u)&&(d=Xo(e,d,n,d.line==t.line?o:null)),d?Ho(e,d,t,n,i):null}}return t}function Zo(e,t,r,n,i){var o=n||1,a=Ho(e,t,r,o,i)||!i&&Ho(e,t,r,o,!0)||Ho(e,t,r,-o,i)||!i&&Ho(e,t,r,-o,!0);return a||(e.cantEdit=!0,ot(e.first,0))}function Xo(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?ht(e,ot(t.line-1)):null:r>0&&t.ch==(n||Ye(e,t.line)).text.length?t.line<e.first+e.size-1?ot(t.line+1,0):null:new ot(t.line,t.ch+r)}function Ko(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),q)}function Yo(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=ht(e,t)),r&&(n.to=ht(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),be(e,"beforeChange",e,n),e.cm&&be(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Jo(e,t,r){if(e.cm){if(!e.cm.curOp)return Li(e.cm,Jo)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"))||(t=Yo(e,t,!0))){var n=Mt&&!r&&Ut(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Qo(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Qo(e,t)}}function Qo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=at(t.from,t.to)){var r=uo(e,t);So(e,t,r,e.cm?e.cm.curOp.id:NaN),ra(e,t,r,jt(e,t));var n=[];_o(e,(function(e,r){r||-1!=N(n,e.history)||(sa(e.history,t),n.push(e.history)),ra(e,t,null,jt(e,t))}))}}function ea(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c<s.length&&(i=s[c],r?!i.ranges||i.equals(e.sel):i.ranges);c++);if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(n)return void s.push(i);break}if(Mo(i,l),r&&!i.equals(e.sel))return void Vo(e,i,{clearRedo:!1});a=i}var u=[];Mo(a,l),l.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var p=ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"),h=function(r){var n=i.changes[r];if(n.origin=t,p&&!Yo(e,n,!1))return s.length=0,{};u.push(ko(e,n));var o=r?uo(e,n):X(s);ra(e,n,o,zo(e,n)),!r&&e.cm&&e.cm.scrollIntoView({from:n.from,to:lo(n)});var a=[];_o(e,(function(e,t){t||-1!=N(a,e.history)||(sa(e.history,n),a.push(e.history)),ra(e,n,null,zo(e,n))}))},d=i.changes.length-1;d>=0;--d){var f=h(d);if(f)return f.v}}}}function ta(e,t){if(0!=t&&(e.first+=t,e.sel=new io(K(e.sel.ranges,(function(e){return new oo(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Bn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)Fn(e.cm,n,"gutter")}}function ra(e,t,r,n){if(e.cm&&!e.cm.curOp)return Li(e.cm,ra)(e,t,r,n);if(t.to.line<e.first)ta(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);ta(e,i),t={from:ot(e.first,0),to:ot(t.to.line+i,t.to.ch),text:[X(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ot(o,Ye(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),r||(r=uo(e,t)),e.cm?na(e.cm,t,n):bo(e,t,n),qo(e,r,q),e.cantEdit&&Zo(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}}function na(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=tt(Jt(Ye(n,o.line))),n.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&ye(e),bo(n,t,r,zn(e)),e.options.lineWrapping||(n.iter(l,o.line+t.text.length,(function(e){var t=ar(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),At(n,o.line),Pi(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Bn(e):o.line!=a.line||1!=t.text.length||go(e.doc,t)?Bn(e,o.line,a.line+1,c):Fn(e,o.line,"text");var u=ve(e,"changes"),p=ve(e,"change");if(p||u){var h={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};p&&Ar(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function ia(e,t,r,n,i){var o;n||(n=r),at(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Jo(e,{from:r,to:n,text:t,origin:i})}function oa(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function aa(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)oa(o.ranges[s].anchor,t,r,n),oa(o.ranges[s].head,t,r,n)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(r<c.from.line)c.from=ot(c.from.line+n,c.from.ch),c.to=ot(c.to.line+n,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function sa(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;aa(e.done,r,n,i),aa(e.undone,r,n,i)}function la(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=Ye(e,pt(e,t)):i=tt(t),null==i?null:(n(o,i)&&e.cm&&Fn(e.cm,i,r),o)}function ca(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function ua(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}oo.prototype.from=function(){return ut(this.anchor,this.head)},oo.prototype.to=function(){return ct(this.anchor,this.head)},oo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ca.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,ur(i),Ar(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},ua.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var o=Math.min(t,i-e),a=n.height;if(n.removeInner(e,o),this.height-=a-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ca))){var s=[];this.collapse(s),this.children=[new ca(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new ca(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++n,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new ua(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=N(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new ua(e.children);n.parent=e,e.children=[n,t],e=n}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var pa=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function ha(e,t,r){or(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ai(e,r)}function da(e,t,r,n){var i=new pa(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),la(e,t,"widget",(function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!nr(e,t)){var n=or(t)<e.scrollTop;et(t,t.height+Vr(i)),n&&ai(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&Ar(o,"lineWidgetAdded",o,i,"number"==typeof t?t:tt(t)),i}pa.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=tt(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=Vr(this);et(r,Math.max(0,r.height-o)),e&&(Oi(e,(function(){ha(e,r,-o),Fn(e,n,"widget")})),Ar(e,"lineWidgetCleared",e,this,n))}},pa.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Vr(this)-t;i&&(nr(this.doc,n)||et(n,n.height+i),r&&Oi(r,(function(){r.curOp.forceUpdate=!0,ha(r,n,i),Ar(r,"lineWidgetChanged",r,e,tt(n))})))},xe(pa);var fa=0,ma=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++fa};function ga(e,t,r,n,i){if(n&&n.shared)return _a(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return Li(e.cm,ga)(e,t,r,n,i);var o=new ma(e,i),a=at(t,r);if(n&&B(n,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=I("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Yt(e,t.line,t,r,o)||t.line!=r.line&&Yt(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Lt()}o.addToHistory&&So(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,r.line+1,(function(e){c&&o.collapsed&&!c.options.lineWrapping&&Jt(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&et(e,0),Rt(e,new zt(o,l==t.line?t.ch:null,l==r.line?r.ch:null)),++l})),o.collapsed&&e.iter(t.line,r.line+1,(function(t){nr(e,t)&&et(t,0)})),o.clearOnEnter&&fe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Ot(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++fa,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Bn(c,t.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=r.line;u++)Fn(c,u,"text");o.atomic&&Go(c.doc),Ar(c,"markerAdded",c,o)}return o}ma.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&ki(e),ve(this,"clear")){var r=this.find();r&&Ar(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Dt(a.markedSpans,this);e&&!this.collapsed?Fn(e,tt(a),"text"):e&&(null!=s.to&&(i=tt(a)),null!=s.from&&(n=tt(a))),a.markedSpans=Pt(a.markedSpans,s),null==s.from&&this.collapsed&&!nr(this.doc,a)&&e&&et(a,Mn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Jt(this.lines[l]),u=ar(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Bn(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Go(e.doc)),e&&Ar(e,"markerCleared",e,this,n,i),t&&Ei(e),this.parent&&this.parent.clear()}},ma.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Dt(o.markedSpans,this);if(null!=a.from&&(r=ot(t?o:tt(o),a.from),-1==e))return r;if(null!=a.to&&(n=ot(t?o:tt(o),a.to),1==e))return n}return r&&{from:r,to:n}},ma.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&Oi(n,(function(){var i=t.line,o=tt(t.line),a=en(n,o);if(a&&(un(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!nr(r.doc,i)&&null!=r.height){var s=r.height;r.height=null;var l=Vr(r)-s;l&&et(i,i.height+l)}Ar(n,"markerChanged",n,e)}))},ma.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=N(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ma.prototype.detachLine=function(e){if(this.lines.splice(N(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},xe(ma);var ba=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function _a(e,t,r,n,i){(n=B(n)).shared=!1;var o=[ga(e,t,r,n,i)],a=o[0],s=n.widgetNode;return _o(e,(function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(ga(e,ht(e,t),ht(e,r),n,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=X(o)})),new ba(o,a)}function ya(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),(function(e){return e.parent}))}function va(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(at(o,a)){var s=ga(e,o,a,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}function xa(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];_o(r.primary.doc,(function(e){return n.push(e)}));for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==N(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<e.length;r++)t(r)}ba.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ar(this,"clear")}},ba.prototype.find=function(e,t){return this.primary.find(e,t)},xe(ba);var wa=0,ka=function(e,t,r,n,i){if(!(this instanceof ka))return new ka(e,t,r,n,i);null==r&&(r=0),ua.call(this,[new ca([new lr("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=ot(r,0);this.sel=so(o),this.history=new wo(null),this.id=++wa,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),bo(this,{from:o,to:o,text:e}),Vo(this,so(o),q)};ka.prototype=Q(ua.prototype,{constructor:ka,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Qe(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Di((function(e){var t=ot(this.first,0),r=this.first+this.size-1;Jo(this,{from:t,to:ot(r,Ye(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&li(this.cm,0,0),Vo(this,so(t),q)})),replaceRange:function(e,t,r,n){ia(this,e,t=ht(this,t),r=r?ht(this,r):t,n)},getRange:function(e,t,r){var n=Je(this,ht(this,e),ht(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(nt(this,e))return Ye(this,e)},getLineNumber:function(e){return tt(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ye(this,e)),Jt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ht(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Di((function(e,t,r){jo(this,ht(this,"number"==typeof e?ot(e,t||0):e),null,r)})),setSelection:Di((function(e,t,r){jo(this,ht(this,e),ht(this,t||e),r)})),extendSelection:Di((function(e,t,r){Ro(this,ht(this,e),t&&ht(this,t),r)})),extendSelections:Di((function(e,t){Bo(this,ft(this,e),t)})),extendSelectionsBy:Di((function(e,t){Bo(this,ft(this,K(this.sel.ranges,e)),t)})),setSelections:Di((function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new oo(ht(this,e[i].anchor),ht(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Vo(this,ao(this.cm,n,t),r)}})),addSelection:Di((function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new oo(ht(this,e),ht(this,t||e))),Vo(this,ao(this.cm,n,n.length-1),r)})),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=Je(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=Je(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:Di((function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:r}}for(var s=t&&"end"!=t&&ho(this,n,t),l=n.length-1;l>=0;l--)Jo(this,n[l]);s?Uo(this,s):this.cm&&si(this.cm)})),undo:Di((function(){ea(this,"undo")})),redo:Di((function(){ea(this,"redo")})),undoSelection:Di((function(){ea(this,"undo",!0)})),redoSelection:Di((function(){ea(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new wo(this.history.maxGeneration),_o(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Do(this.history.done),undone:Do(this.history.undone)}},setHistory:function(e){var t=this.history=new wo(this.history.maxGeneration);t.done=Do(e.done.slice(0),null,!0),t.undone=Do(e.undone.slice(0),null,!0)},setGutterMarker:Di((function(e,t,r){return la(this,e,"gutter",(function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&ne(n)&&(e.gutterMarkers=null),!0}))})),clearGutter:Di((function(e){var t=this;this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&la(t,r,"gutter",(function(){return r.gutterMarkers[e]=null,ne(r.gutterMarkers)&&(r.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!nt(this,e))return null;if(t=e,!(e=Ye(this,e)))return null}else if(null==(t=tt(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Di((function(e,t,r){return la(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(E(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0}))})),removeLineClass:Di((function(e,t,r){return la(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(E(r));if(!o)return!1;var a=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:Di((function(e,t,r){return da(this,e,t,r)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return ga(this,ht(this,e),ht(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return ga(this,e=ht(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=Ye(this,(e=ht(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=ht(this,e),t=ht(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&i==e.line&&e.ch>=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||r&&!r(l.marker)||n.push(l.marker.parent||l.marker)}++i})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)})),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r})),ht(this,ot(r,t))},indexFromPos:function(e){var t=(e=ht(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+r})),t},copy:function(e){var t=new ka(Qe(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new ka(Qe(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],va(n,ya(this)),n},unlinkDoc:function(e){if(e instanceof Bs&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),xa(ya(this));break}if(e.history==this.history){var r=[e.id];_o(e,(function(e){return r.push(e.id)}),!0),e.history=new wo(null),e.history.done=Do(this.history.done,r),e.history.undone=Do(this.history.undone,r)}},iterLinkedDocs:function(e){_o(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):De(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Di((function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&xo(this.cm))}))}),ka.prototype.eachLine=ka.prototype.iter;var Ea=0;function Ta(e){var t=this;if(Aa(t),!_e(t,e)&&!qr(t.display,e)){we(e),a&&(Ea=+new Date);var r=Pn(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),s=0,l=function(){++s==i&&Li(t,(function(){var e={from:r=ht(t.doc,r),to:r,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};Jo(t.doc,e),Uo(t.doc,so(ht(t.doc,r),ht(t.doc,lo(e))))}))()},c=function(e,r){if(t.options.allowDropFileTypes&&-1==N(t.options.allowDropFileTypes,e.type))l();else{var n=new FileReader;n.onerror=function(){return l()},n.onload=function(){var e=n.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[r]=e),l()},n.readAsText(e)}},u=0;u<n.length;u++)c(n[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var p=e.dataTransfer.getData("Text");if(p){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),qo(t.doc,so(r,r)),h)for(var d=0;d<h.length;++d)ia(t.doc,"",h[d].anchor,h[d].head,"drag");t.replaceSelection(p,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Sa(e,t){if(a&&(!e.state.draggingText||+new Date-Ea<100))Te(t);else if(!_e(e,t)&&!qr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var r=M("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),p&&r.parentNode.removeChild(r)}}function Ca(e,t){var r=Pn(e,t);if(r){var n=document.createDocumentFragment();Gn(e,r,n),e.display.dragCursor||(e.display.dragCursor=M("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),A(e.display.dragCursor,n)}}function Aa(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ma(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation((function(){for(var t=0;t<r.length;t++)e(r[t])}))}}var Ia=!1;function Oa(){Ia||(La(),Ia=!0)}function La(){var e;fe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Ma(za)}),100))})),fe(window,"blur",(function(){return Ma(Jn)}))}function za(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Da={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Pa=0;Pa<10;Pa++)Da[Pa+48]=Da[Pa+96]=String(Pa);for(var Ra=65;Ra<=90;Ra++)Da[Ra]=String.fromCharCode(Ra);for(var Ba=1;Ba<=12;Ba++)Da[Ba+111]=Da[Ba+63235]="F"+Ba;var Fa={};function ja(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Na(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=K(r.split(" "),ja),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=n):(s=i.slice(0,o+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function Ua(e,t,r,n){var i=(t=Ga(t)).call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Ua(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=Ua(e,t.fallthrough[o],r,n);if(a)return a}}}function Va(e){var t="string"==typeof e?e:Da[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function qa(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(w?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(w?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function $a(e,t){if(p&&34==e.keyCode&&e.char)return!1;var r=Da[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),qa(r,e,t))}function Ga(e){return"string"==typeof e?Fa[e]:e}function Wa(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&at(o.from,X(n).to)<=0;){var a=n.pop();if(at(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}Oi(e,(function(){for(var t=n.length-1;t>=0;t--)ia(e.doc,"",n[t].from,n[t].to,"+delete");si(e)}))}function Ha(e,t,r){var n=ae(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Za(e,t,r){var n=Ha(e,t.ch,r);return null==n?null:new ot(t.line,n,r<0?"after":"before")}function Xa(e,t,r,n,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=he(r,t.doc.direction);if(o){var a,s=i<0?X(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=tn(t,r);a=i<0?r.text.length-1:0;var u=rn(t,c,a).top;a=se((function(e){return rn(t,c,e).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Ha(r,a,1))}else a=i<0?s.to:s.from;return new ot(n,a,l)}}return new ot(n,i<0?r.text.length:0,i<0?"before":"after")}function Ka(e,t,r,n){var i=he(t,e.doc.direction);if(!i)return Za(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=ue(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return Za(t,r,n);var s,l=function(e,r){return Ha(t,e instanceof ot?e.ch:e,r)},c=function(r){return e.options.lineWrapping?(s=s||tn(e,t),En(e,t,s,r)):{begin:0,end:t.text.length}},u=c("before"==r.sticky?l(r,-1):r.ch);if("rtl"==e.doc.direction||1==a.level){var p=1==a.level==n<0,h=l(r,p?1:-1);if(null!=h&&(p?h<=a.to&&h<=u.end:h>=a.from&&h>=u.begin)){var d=p?"before":"after";return new ot(r.line,h,d)}}var f=function(e,t,n){for(var o=function(e,t){return t?new ot(r.line,l(e,1),"before"):new ot(r.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],s=t>0==(1!=a.level),c=s?n.begin:l(n.end,-1);if(a.from<=c&&c<a.to)return o(c,s);if(c=s?a.from:l(a.to,-1),n.begin<=c&&c<n.end)return o(c,s)}},m=f(o+n,n,u);if(m)return m;var g=n>0?u.end:l(u.begin,-1);return null==g||n>0&&g==t.text.length||!(m=f(n>0?0:i.length-1,n,c(g)))?null:m}Fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Fa.default=_?Fa.macDefault:Fa.pcDefault;var Ya={selectAll:Ko,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),q)},killLine:function(e){return Wa(e,(function(t){if(t.empty()){var r=Ye(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:ot(t.head.line+1,0)}:{from:t.head,to:ot(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Wa(e,(function(t){return{from:ot(t.from().line,0),to:ht(e.doc,ot(t.to().line+1,0))}}))},delLineLeft:function(e){return Wa(e,(function(e){return{from:ot(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Wa(e,(function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Wa(e,(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return Ja(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return es(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return Qa(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")}),G)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")}),G)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?es(e,t.head):n}),G)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=F(e.getLine(o.line),o.ch,n);t.push(Z(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Oi(e,(function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=Ye(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ot(i.line,i.ch-1)),i.ch>0)i=new ot(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ot(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Ye(e.doc,i.line-1).text;a&&(i=new ot(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ot(i.line-1,a.length-1),i,"+transpose"))}r.push(new oo(i,i))}e.setSelections(r)}))},newlineAndIndent:function(e){return Oi(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);si(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ja(e,t){var r=Ye(e.doc,t),n=Jt(r);return n!=r&&(t=tt(n)),Xa(!0,e,n,t,1)}function Qa(e,t){var r=Ye(e.doc,t),n=Qt(r);return n!=r&&(t=tt(n)),Xa(!0,e,r,t,-1)}function es(e,t){var r=Ja(e,t.line),n=Ye(e.doc,r.line),i=he(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(r.ch,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return ot(r.line,a?0:o,r.sticky)}return r}function ts(e,t,r){if("string"==typeof t&&!(t=Ya[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=V}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function rs(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Ua(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Ua(t,e.options.extraKeys,r,e)||Ua(t,e.options.keyMap,r,e)}var ns=new j;function is(e,t,r,n){var i=e.state.keySeq;if(i){if(Va(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ns.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),os(e,i+" "+t,r,n))return!0}return os(e,t,r,n)}function os(e,t,r,n){var i=rs(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&Ar(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(we(r),Zn(e)),!!i}function as(e,t){var r=$a(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?is(e,"Shift-"+r,t,(function(t){return ts(e,t,!0)}))||is(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ts(e,t)})):is(e,r,t,(function(t){return ts(e,t)})))}function ss(e,t,r){return is(e,"'"+r+"'",t,(function(t){return ts(e,t,!0)}))}var ls=null;function cs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=L(),_e(t,e)))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var i=as(t,e);p&&(ls=i?n:null,i||88!=n||Re||!(_?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),r&&!_&&!i&&46==n&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||us(t)}}function us(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(S(t,"CodeMirror-crosshair"),ge(document,"keyup",r),ge(document,"mouseover",r))}z(t,"CodeMirror-crosshair"),fe(document,"keyup",r),fe(document,"mouseover",r)}function ps(e){16==e.keyCode&&(this.doc.sel.shift=!1),_e(this,e)}function hs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||qr(t.display,e)||_e(t,e)||e.ctrlKey&&!e.altKey||_&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(p&&r==ls)return ls=null,void we(e);if(!p||e.which&&!(e.which<10)||!as(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(ss(t,e,i)||t.display.input.onKeyPress(e))}}}var ds,fs,ms=400,gs=function(e,t,r){this.time=e,this.pos=t,this.button=r};function bs(e,t){var r=+new Date;return fs&&fs.compare(r,e,t)?(ds=fs=null,"triple"):ds&&ds.compare(r,e,t)?(fs=new gs(r,e,t),ds=null,"double"):(ds=new gs(r,e,t),fs=null,"single")}function _s(e){var t=this,r=t.display;if(!(_e(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,qr(r,e))l||(r.scroller.draggable=!1,setTimeout((function(){return r.scroller.draggable=!0}),100));else if(!Cs(t,e)){var n=Pn(t,e),i=Ce(e),o=n?bs(n,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),n&&ys(t,i,n,o,e)||(1==i?n?xs(t,n,o,e):Se(e)==r.scroller&&we(e):2==i?(n&&Ro(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==i&&(k?t.display.input.onContextMenu(e):Kn(t)))}}function ys(e,t,r,n,i){var o="Click";return"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o),is(e,qa(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=Ya[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=V}finally{e.state.suppressEdits=!1}return n}))}function vs(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=y?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),null==i.addNew&&(i.addNew=_?r.metaKey:r.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(_?r.altKey:r.ctrlKey)),i}function xs(e,t,r,n){a?setTimeout(R(Xn,e),0):e.curOp.focus=L();var i,o=vs(e,r,n),s=e.doc.sel;e.options.dragDrop&&Ie&&!e.isReadOnly()&&"single"==r&&(i=s.contains(t))>-1&&(at((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(at(i.to(),t)>0||t.xRel<0)?ws(e,n,t,o):Es(e,n,t,o)}function ws(e,t,r,n){var i=e.display,o=!1,c=Li(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,ge(i.wrapper.ownerDocument,"mouseup",c),ge(i.wrapper.ownerDocument,"mousemove",u),ge(i.scroller,"dragstart",p),ge(i.scroller,"drop",c),o||(we(t),n.addNew||Ro(e.doc,r,null,null,n.extend),l&&!h||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},p=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),fe(i.wrapper.ownerDocument,"mouseup",c),fe(i.wrapper.ownerDocument,"mousemove",u),fe(i.scroller,"dragstart",p),fe(i.scroller,"drop",c),Kn(e),setTimeout((function(){return i.input.focus()}),20)}function ks(e,t,r){if("char"==r)return new oo(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new oo(ot(t.line,0),ht(e.doc,ot(t.line+1,0)));var n=r(e,t);return new oo(n.from,n.to)}function Es(e,t,r,n){var i=e.display,o=e.doc;we(t);var a,s,l=o.sel,c=l.ranges;if(n.addNew&&!n.extend?(s=o.sel.contains(r),a=s>-1?c[s]:new oo(r,r)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==n.unit)n.addNew||(a=new oo(r,r)),r=Pn(e,t,!0,!0),s=-1;else{var u=ks(e,r,n.unit);a=n.extend?Po(a,u.anchor,u.head,n.extend):u}n.addNew?-1==s?(s=c.length,Vo(o,ao(e,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==n.unit&&!n.extend?(Vo(o,ao(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Fo(o,s,a,$):(s=0,Vo(o,new io([a],0),$),l=o.sel);var p=r;function h(t){if(0!=at(p,t))if(p=t,"rectangle"==n.unit){for(var i=[],c=e.options.tabSize,u=F(Ye(o,r.line).text,r.ch,c),h=F(Ye(o,t.line).text,t.ch,c),d=Math.min(u,h),f=Math.max(u,h),m=Math.min(r.line,t.line),g=Math.min(e.lastLine(),Math.max(r.line,t.line));m<=g;m++){var b=Ye(o,m).text,_=W(b,d,c);d==f?i.push(new oo(ot(m,_),ot(m,_))):b.length>_&&i.push(new oo(ot(m,_),ot(m,W(b,f,c))))}i.length||i.push(new oo(r,r)),Vo(o,ao(e,l.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,v=a,x=ks(e,t,n.unit),w=v.anchor;at(x.anchor,w)>0?(y=x.head,w=ut(v.from(),x.anchor)):(y=x.anchor,w=ct(v.to(),x.head));var k=l.ranges.slice(0);k[s]=Ts(e,new oo(ht(o,w),y)),Vo(o,ao(e,k,s),$)}}var d=i.wrapper.getBoundingClientRect(),f=0;function m(t){var r=++f,a=Pn(e,t,!0,"rectangle"==n.unit);if(a)if(0!=at(a,p)){e.curOp.focus=L(),h(a);var s=ti(i,o);(a.line>=s.to||a.line<s.from)&&setTimeout(Li(e,(function(){f==r&&m(t)})),150)}else{var l=t.clientY<d.top?-20:t.clientY>d.bottom?20:0;l&&setTimeout(Li(e,(function(){f==r&&(i.scroller.scrollTop+=l,m(t))})),50)}}function g(t){e.state.selectingText=!1,f=1/0,t&&(we(t),i.input.focus()),ge(i.wrapper.ownerDocument,"mousemove",b),ge(i.wrapper.ownerDocument,"mouseup",_),o.history.lastSelOrigin=null}var b=Li(e,(function(e){0!==e.buttons&&Ce(e)?m(e):g(e)})),_=Li(e,g);e.state.selectingText=_,fe(i.wrapper.ownerDocument,"mousemove",b),fe(i.wrapper.ownerDocument,"mouseup",_)}function Ts(e,t){var r=t.anchor,n=t.head,i=Ye(e.doc,r.line);if(0==at(r,n)&&r.sticky==n.sticky)return t;var o=he(i);if(!o)return t;var a=ue(o,r.ch,r.sticky),s=o[a];if(s.from!=r.ch&&s.to!=r.ch)return t;var l,c=a+(s.from==r.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(n.line!=r.line)l=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ue(o,n.ch,n.sticky),p=u-a||(n.ch-r.ch)*(1==s.level?-1:1);l=u==c-1||u==c?p<0:p>0}var h=o[c+(l?-1:0)],d=l==(1==h.level),f=d?h.from:h.to,m=d?"after":"before";return r.ch==f&&r.sticky==m?t:new oo(new ot(r.line,f,m),n)}function Ss(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&we(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!ve(e,r))return Ee(t);o-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i)return be(e,r,e,rt(e.doc,o),e.display.gutterSpecs[l].className,t),Ee(t)}}function Cs(e,t){return Ss(e,t,"gutterClick",!0)}function As(e,t){qr(e.display,t)||Ms(e,t)||_e(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Ms(e,t){return!!ve(e,"gutterContextMenu")&&Ss(e,t,"gutterContextMenu",!1)}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),hn(e)}gs.prototype.compare=function(e,t,r){return this.time+ms>e&&0==at(t,this.pos)&&r==this.button};var Os={toString:function(){return"CodeMirror.Init"}},Ls={},zs={};function Ds(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=Os&&i(e,t,r)}:i)}e.defineOption=r,e.Init=Os,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,fo(e)}),!0),r("indentUnit",2,fo,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){mo(e),hn(e),Bn(e)}),!0),r("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(ot(n,o))}n++}));for(var i=r.length-1;i>=0;i--)ia(e.doc,t,r[i],ot(r[i].line,r[i].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Os&&e.refresh()})),r("specialCharPlaceholder",mr,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",b?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),r("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),r("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),r("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),r("rtlMoveVisually",!v),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){Is(e),Yi(e)}),!0),r("keyMap","default",(function(e,t,r){var n=Ga(t),i=r!=Os&&Ga(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Rs,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=Xi(t,e.options.lineNumbers),Yi(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Ln(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return _i(e)}),!0),r("scrollbarStyle","native",(function(e){xi(e),_i(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Xi(e.options.gutters,t),Yi(e)}),!0),r("firstLineNumber",1,Yi,!0),r("lineNumberFormatter",(function(e){return e}),Yi,!0),r("showCursorWhenSelecting",!1,qn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(Jn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),r("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),r("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),r("dragDrop",!0,Ps),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,qn,!0),r("singleCursorHeightPerLine",!0,qn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,mo,!0),r("addModeClass",!1,mo,!0),r("pollInterval",100),r("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),r("historyEventDelay",1250),r("viewportMargin",10,(function(e){return e.refresh()}),!0),r("maxHighlightLength",1e4,mo,!0),r("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),r("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),r("autofocus",null),r("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),r("phrases",null)}function Ps(e,t,r){if(!t!=!(r&&r!=Os)){var n=e.display.dragFunctions,i=t?fe:ge;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function Rs(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),sr(e)),Dn(e),Bn(e),hn(e),setTimeout((function(){return _i(e)}),100)}function Bs(e,t){var r=this;if(!(this instanceof Bs))return new Bs(e,t);this.options=t=t?B(t):{},B(Ls,t,!1);var n=t.value;"string"==typeof n?n=new ka(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Bs.inputStyles[t.inputStyle](this),o=this.display=new Ji(e,n,i,t);for(var c in o.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new j,keySeq:null,specialChars:null},t.autofocus&&!b&&o.input.focus(),a&&s<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),Fs(this),Oa(),ki(this),this.curOp.forceUpdate=!0,yo(this,n),t.autofocus&&!b||this.hasFocus()?setTimeout(R(Yn,this),20):Jn(this),zs)zs.hasOwnProperty(c)&&zs[c](this,t[c],Os);Zi(this),t.finishInit&&t.finishInit(this);for(var u=0;u<js.length;++u)js[u](this);Ei(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Fs(e){var t=e.display;fe(t.scroller,"mousedown",Li(e,_s)),fe(t.scroller,"dblclick",a&&s<11?Li(e,(function(t){if(!_e(e,t)){var r=Pn(e,t);if(r&&!Cs(e,t)&&!qr(e.display,t)){we(t);var n=e.findWordAt(r);Ro(e.doc,n.anchor,n.head)}}})):function(t){return _e(e,t)||we(t)}),fe(t.scroller,"contextmenu",(function(t){return As(e,t)})),fe(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||As(e,r)}));var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}fe(t.scroller,"touchstart",(function(i){if(!_e(e,i)&&!o(i)&&!Cs(e,i)){t.input.ensurePolled(),clearTimeout(r);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!qr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!n.prev||l(n,n.prev)?new oo(a,a):!n.prev.prev||l(n,n.prev.prev)?e.findWordAt(a):new oo(ot(a.line,0),ht(e.doc,ot(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),we(r)}i()})),fe(t.scroller,"touchcancel",i),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(hi(e,t.scroller.scrollTop),fi(e,t.scroller.scrollLeft,!0),be(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return no(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return no(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){_e(e,t)||Te(t)},over:function(t){_e(e,t)||(Ca(e,t),Te(t))},start:function(t){return Sa(e,t)},drop:Li(e,Ta),leave:function(t){_e(e,t)||Aa(e)}};var c=t.input.getField();fe(c,"keyup",(function(t){return ps.call(e,t)})),fe(c,"keydown",Li(e,cs)),fe(c,"keypress",Li(e,hs)),fe(c,"focus",(function(t){return Yn(e,t)})),fe(c,"blur",(function(t){return Jn(e,t)}))}Bs.defaults=Ls,Bs.optionHandlers=zs;var js=[];function Ns(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=yt(e,t).state:r="prev");var a=e.options.tabSize,s=Ye(o,t),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==V||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?F(Ye(o,t-1).text,null,a):0:"add"==r?c=l+e.options.indentUnit:"subtract"==r?c=l-e.options.indentUnit:"number"==typeof r&&(c=l+r),c=Math.max(0,c);var p="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(c/a);d;--d)h+=a,p+="\t";if(h<c&&(p+=Z(c-h)),p!=u)return ia(o,p,ot(t,0),ot(t,u.length),"+input"),s.stateAfter=null,!0;for(var f=0;f<o.sel.ranges.length;f++){var m=o.sel.ranges[f];if(m.head.line==t&&m.head.ch<u.length){var g=ot(t,u.length);Fo(o,f,new oo(g,g));break}}}Bs.defineInitHook=function(e){return js.push(e)};var Us=null;function Vs(e){Us=e}function qs(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a=+new Date-200,s="paste"==i||e.state.pasteIncoming>a,l=De(t),c=null;if(s&&n.ranges.length>1)if(Us&&Us.text.join("\n")==t){if(n.ranges.length%Us.text.length==0){c=[];for(var u=0;u<Us.text.length;u++)c.push(o.splitLines(Us.text[u]))}}else l.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(c=K(l,(function(e){return[e]})));for(var p=e.curOp.updateInput,h=n.ranges.length-1;h>=0;h--){var d=n.ranges[h],f=d.from(),m=d.to();d.empty()&&(r&&r>0?f=ot(f.line,f.ch-r):e.state.overwrite&&!s?m=ot(m.line,Math.min(Ye(o,m.line).text.length,m.ch+X(l).length)):s&&Us&&Us.lineWise&&Us.text.join("\n")==t&&(f=m=ot(f.line,0)));var g={from:f,to:m,text:c?c[h%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Jo(e.doc,g),Ar(e,"inputRead",e,g)}t&&!s&&Gs(e,t),si(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function $s(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Oi(t,(function(){return qs(t,r,0,null,"paste")})),!0}function Gs(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=Ns(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ye(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Ns(e,i.head.line,"smart"));a&&Ar(e,"electricInput",e,i.head.line)}}}function Ws(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:ot(i,0),head:ot(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Hs(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Zs(){var e=M("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=M("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Hs(e),t}function Xs(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&Li(this,t[e])(this,r,i),be(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Ga(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:zi((function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");Y(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},(function(e){return e.priority})),this.state.modeGen++,Bn(this)})),removeOverlay:zi((function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void Bn(this)}})),indentLine:zi((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),nt(this.doc,e)&&Ns(this,e,t,r)})),indentSelection:zi((function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(Ns(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&si(this));else{var o=i.from(),a=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<r;++l)Ns(this,l,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[n].from().ch>0&&Fo(this.doc,n,new oo(o,c[n].to()),q)}}})),getTokenAt:function(e,t){return Et(this,e,t)},getLineTokens:function(e,t){return Et(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=ht(this.doc,e);var t,r=_t(this,Ye(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!r.hasOwnProperty(t))return n;var i=r[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&n.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var s=i[o[t][a]];s&&n.push(s)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var l=0;l<i._global.length;l++){var c=i._global[l];c.pred(o,this)&&-1==N(n,c.val)&&n.push(c.val)}return n},getStateAfter:function(e,t){var r=this.doc;return yt(this,(e=pt(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return yn(this,null==e?r.head:"object"==typeof e?ht(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return _n(this,ht(this.doc,e),t||"page")},coordsChar:function(e,t){return wn(this,(e=bn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=bn(this,{top:e,left:0},t||"page").top,rt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=Ye(this.doc,e)}else n=e;return gn(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-or(n):0)},defaultTextHeight:function(){return Mn(this.display)},defaultCharWidth:function(){return In(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display,a=(e=yn(this,ht(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&ii(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:zi(cs),triggerOnKeyPress:zi(hs),triggerOnKeyUp:ps,triggerOnMouseDown:zi(_s),execCommand:function(e){if(Ya.hasOwnProperty(e))return Ya[e].call(null,this)},triggerElectric:zi((function(e){Gs(this,e)})),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=ht(this.doc,e),a=0;a<t&&!(o=Ks(this.doc,o,i,r,n)).hitSide;++a);return o},moveH:zi((function(e,t){var r=this;this.extendSelectionsBy((function(n){return r.display.shift||r.doc.extend||n.empty()?Ks(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()}),G)})),deleteH:zi((function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Wa(this,(function(r){var i=Ks(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}}))})),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var a=ht(this.doc,e),s=0;s<t;++s){var l=yn(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Ys(this,l,i,r)).hitSide)break}return a},moveV:zi((function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var s=yn(r,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var l=Ys(r,s,e,t);return"page"==t&&a==n.sel.primary()&&ai(r,_n(r,l,"div").top-s.top),l}),G),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(e){var t=Ye(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var o=t.charAt(r),a=re(o,i)?function(e){return re(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!re(e)};r>0&&a(t.charAt(r-1));)--r;for(;n<t.length&&a(t.charAt(n));)++n}return new oo(ot(e.line,r),ot(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),be(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==L()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:zi((function(e,t){li(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Hr(this)-this.display.barHeight,width:e.scrollWidth-Hr(this)-this.display.barWidth,clientHeight:Xr(this),clientWidth:Zr(this)}},scrollIntoView:zi((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ot(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?ci(this,e):pi(this,e.from,e.to,e.margin)})),setSize:zi((function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&pn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Fn(r,i,"widget");break}++i})),this.curOp.forceUpdate=!0,be(this,"refresh",this)})),operation:function(e){return Oi(this,e)},startOperation:function(){return ki(this)},endOperation:function(){return Ei(this)},refresh:zi((function(){var e=this.display.cachedTextHeight;Bn(this),this.curOp.forceUpdate=!0,hn(this),li(this,this.doc.scrollLeft,this.doc.scrollTop),Gi(this.display),(null==e||Math.abs(e-Mn(this.display))>.5||this.options.lineWrapping)&&Dn(this),be(this,"refresh",this)})),swapDoc:zi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),yo(this,e),hn(this),this.display.input.reset(),li(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ar(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xe(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}function Ks(e,t,r,n,i){var o=t,a=r,s=Ye(e,t.line),l=i&&"rtl"==e.direction?-r:r;function c(){var r=t.line+l;return!(r<e.first||r>=e.first+e.size)&&(t=new ot(r,t.ch,t.sticky),s=Ye(e,r))}function u(n){var o;if(null==(o=i?Ka(e.cm,s,t,r):Za(s,t,r))){if(n||!c())return!1;t=Xa(i,e.cm,s,t.line,l)}else t=o;return!0}if("char"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var p=null,h="group"==n,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(r<0)||u(!f);f=!1){var m=s.text.charAt(t.ch)||"\n",g=re(m,d)?"w":h&&"\n"==m?"n":!h||/\s/.test(m)?null:"p";if(!h||f||g||(g="s"),p&&p!=g){r<0&&(r=1,u(),t.sticky="after");break}if(g&&(p=g),r>0&&!u(!f))break}var b=Zo(e,t,o,a,!0);return st(o,b)&&(b.hitSide=!0),b}function Ys(e,t,r,n){var i,o,a=e.doc,s=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*Mn(e.display),3);i=(r>0?t.bottom:t.top)+r*c}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;(o=wn(e,s,i)).outside;){if(r<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*r}return o}var Js=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new j,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Qs(e,t){var r=en(e,t.line);if(!r||r.hidden)return null;var n=Ye(e.doc,t.line),i=Yr(r,n,t.line),o=he(n,e.doc.direction),a="left";o&&(a=ue(o,t.ch)%2?"right":"left");var s=an(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function el(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function tl(e,t){return t&&(e.bad=!0),e}function rl(e,t,r,n,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(e){return function(t){return t.id==e}}function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function p(e){e&&(u(),o+=e)}function h(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void p(r);var o,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(ot(n,0),ot(i+1,0),c(+d));return void(f.length&&(o=f[0].find(0))&&p(Je(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&u();for(var g=0;g<t.childNodes.length;g++)h(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),m&&(a=!0)}else 3==t.nodeType&&p(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;h(t),t!=r;)t=t.nextSibling,l=!1;return o}function nl(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return tl(e.clipPos(ot(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return il(o,t,r)}}function il(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!O(n,t))return tl(ot(tt(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?X(e.rest):e.line;return tl(ot(tt(o),o.text.length),i)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,r&&(r=a.nodeValue.length));s.parentNode!=n;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,r,n){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?l.map:c[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==r){var u=tt(i<0?e.line:e.rest[i]),p=o[a]+n;return(n<0||s!=t)&&(p=o[a+(n?1:0)]),ot(u,p)}}}var p=u(a,s,r);if(p)return tl(p,i);for(var h=s.nextSibling,d=a?a.nodeValue.length-r:0;h;h=h.nextSibling){if(p=u(h,h.firstChild,0))return tl(ot(p.line,p.ch-d),i);d+=h.textContent.length}for(var f=s.previousSibling,m=r;f;f=f.previousSibling){if(p=u(f,f.firstChild,-1))return tl(ot(p.line,p.ch+m),i);m+=f.textContent.length}}Js.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(o(e)&&!_e(n,e)){if(n.somethingSelected())Vs({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=Ws(n);Vs({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation((function(){n.setSelections(t.ranges,0,q),n.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Us.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Zs(),l=s.firstChild;n.display.lineSpace.insertBefore(s,n.display.lineSpace.firstChild),l.value=Us.text.join("\n");var c=document.activeElement;P(l),setTimeout((function(){n.display.lineSpace.removeChild(s),c.focus(),c==i&&r.showPrimarySelection()}),50)}}Hs(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),fe(i,"paste",(function(e){!o(e)||_e(n,e)||$s(e,n)||s<=11&&setTimeout(Li(n,(function(){return t.updateFromDOM()})),20)})),fe(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),fe(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),fe(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),fe(i,"touchstart",(function(){return r.forceCompositionEnd()})),fe(i,"input",(function(){t.composing||t.readFromDOMSoon()})),fe(i,"copy",a),fe(i,"cut",a)},Js.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Js.prototype.prepareSelection=function(){var e=$n(this.cm,!1);return e.focus=document.activeElement==this.div,e},Js.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Js.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Js.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=nl(t,e.anchorNode,e.anchorOffset),s=nl(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=at(ut(a,s),i)||0!=at(ct(a,s),o)){var l=t.display.view,c=i.line>=t.display.viewFrom&&Qs(t,i)||{node:l[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&Qs(t,o);if(!u){var p=l[l.length-1].measure,h=p.maps?p.maps[p.maps.length-1]:p.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(c&&u){var d,f=e.rangeCount&&e.getRangeAt(0);try{d=T(c.node,c.offset,u.offset,u.node)}catch(e){}d&&(!r&&t.state.focused?(e.collapse(c.node,c.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),f&&null==e.anchorNode?e.addRange(f):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Js.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Js.prototype.showMultipleSelections=function(e){A(this.cm.display.cursorDiv,e.cursors),A(this.cm.display.selectionDiv,e.selection)},Js.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Js.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return O(this.div,t)},Js.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Js.prototype.blur=function(){this.div.blur()},Js.prototype.getField=function(){return this.div},Js.prototype.supportsTouch=function(){return!0},Js.prototype.receivedFocus=function(){var e=this;function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.selectionInEditor()?this.pollSelection():Oi(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,t)},Js.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Js.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&u&&this.cm.display.gutterSpecs.length&&el(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=nl(t,e.anchorNode,e.anchorOffset),n=nl(t,e.focusNode,e.focusOffset);r&&n&&Oi(t,(function(){Vo(t.doc,so(r,n),q),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)}))}}},Js.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>n.firstLine()&&(a=ot(a.line-1,Ye(n.doc,a.line-1).length)),s.ch==Ye(n.doc,s.line).text.length&&s.line<n.lastLine()&&(s=ot(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=Rn(n,a.line))?(t=tt(i.view[0].line),r=i.view[0].node):(t=tt(i.view[e].line),r=i.view[e-1].node.nextSibling);var l,c,u=Rn(n,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=tt(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!r)return!1;for(var p=n.doc.splitLines(rl(n,r,c,t,l)),h=Je(n.doc,ot(t,0),ot(l,Ye(n.doc,l).text.length));p.length>1&&h.length>1;)if(X(p)==X(h))p.pop(),h.pop(),l--;else{if(p[0]!=h[0])break;p.shift(),h.shift(),t++}for(var d=0,f=0,m=p[0],g=h[0],b=Math.min(m.length,g.length);d<b&&m.charCodeAt(d)==g.charCodeAt(d);)++d;for(var _=X(p),y=X(h),v=Math.min(_.length-(1==p.length?d:0),y.length-(1==h.length?d:0));f<v&&_.charCodeAt(_.length-f-1)==y.charCodeAt(y.length-f-1);)++f;if(1==p.length&&1==h.length&&t==a.line)for(;d&&d>a.ch&&_.charCodeAt(_.length-f-1)==y.charCodeAt(y.length-f-1);)d--,f++;p[p.length-1]=_.slice(0,_.length-f).replace(/^\u200b+/,""),p[0]=p[0].slice(d).replace(/\u200b+$/,"");var x=ot(t,d),w=ot(l,h.length?X(h).length-f:0);return p.length>1||p[0]||at(x,w)?(ia(n.doc,p,x,w,"+input"),!0):void 0},Js.prototype.ensurePolled=function(){this.forceCompositionEnd()},Js.prototype.reset=function(){this.forceCompositionEnd()},Js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Js.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Js.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Oi(this.cm,(function(){return Bn(e.cm)}))},Js.prototype.setUneditable=function(e){e.contentEditable="false"},Js.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Li(this.cm,qs)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Js.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Js.prototype.onContextMenu=function(){},Js.prototype.resetPosition=function(){},Js.prototype.needsContentAttribute=!0;var ol=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null};function al(e,t){if((t=t?B(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=L();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var i;if(e.form&&(fe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(ge(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Bs((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function sl(e){e.off=ge,e.on=fe,e.wheelEventPixels=ro,e.Doc=ka,e.splitLines=De,e.countColumn=F,e.findColumn=W,e.isWordChar=te,e.Pass=V,e.signal=be,e.Line=lr,e.changeEnd=lo,e.scrollbarModel=vi,e.Pos=ot,e.cmpPos=at,e.modes=je,e.mimeModes=Ne,e.resolveMode=qe,e.getMode=$e,e.modeExtensions=Ge,e.extendMode=We,e.copyState=He,e.startState=Xe,e.innerMode=Ze,e.commands=Ya,e.keyMap=Fa,e.keyName=$a,e.isModifierKey=Va,e.lookupKey=Ua,e.normalizeKeyMap=Na,e.StringStream=Ke,e.SharedTextMarker=ba,e.TextMarker=ma,e.LineWidget=pa,e.e_preventDefault=we,e.e_stopPropagation=ke,e.e_stop=Te,e.addClass=z,e.contains=O,e.rmClass=S,e.keyNames=Da}ol.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!_e(n,e)){if(n.somethingSelected())Vs({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Ws(n);Vs({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,q):(r.prevInput="",i.value=t.text.join("\n"),P(i))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),fe(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),fe(i,"paste",(function(e){_e(n,e)||$s(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),fe(i,"cut",o),fe(i,"copy",o),fe(e.scroller,"paste",(function(t){if(!qr(e,t)&&!_e(n,t)){if(!i.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),fe(e.lineSpace,"selectstart",(function(t){qr(e,t)||we(t)})),fe(i,"compositionstart",(function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(i,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},ol.prototype.createField=function(e){this.wrapper=Zs(),this.textarea=this.wrapper.firstChild},ol.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ol.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=$n(e);if(e.options.moveInputWithCursor){var i=yn(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},ol.prototype.showSelection=function(e){var t=this.cm.display;A(t.cursorDiv,e.cursors),A(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ol.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&P(this.textarea),a&&s>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},ol.prototype.getField=function(){return this.textarea},ol.prototype.supportsTouch=function(){return!1},ol.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!b||L()!=this.textarea))try{this.textarea.focus()}catch(e){}},ol.prototype.blur=function(){this.textarea.blur()},ol.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ol.prototype.receivedFocus=function(){this.slowPoll()},ol.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},ol.prototype.fastPoll=function(){var e=!1,t=this;function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}t.pollingFast=!0,t.polling.set(20,r)},ol.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Pe(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||_&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(n.length,i.length);l<c&&n.charCodeAt(l)==i.charCodeAt(l);)++l;return Oi(t,(function(){qs(t,i.slice(l),n.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ol.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ol.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},ol.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Pn(r,e),c=n.scroller.scrollTop;if(o&&!p){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(o)&&Li(r,Vo)(r.doc,so(o),q);var u,h=i.style.cssText,d=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n      z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),n.input.focus(),l&&window.scrollTo(null,u),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=b,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),a&&s>=9&&g(),k){Te(e);var m=function(){ge(window,"mouseup",m),setTimeout(b,20)};fe(window,"mouseup",m)}else setTimeout(b,50)}function g(){if(null!=i.selectionStart){var e=r.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function b(){if(t.contextMenuPending==b&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=h,a&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&s<9)&&g();var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Li(r,Ko)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},ol.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},ol.prototype.setUneditable=function(){},ol.prototype.needsContentAttribute=!1,Ds(Bs),Xs(Bs);var ll="iter insert remove copy getEditor constructor".split(" ");for(var cl in ka.prototype)ka.prototype.hasOwnProperty(cl)&&N(ll,cl)<0&&(Bs.prototype[cl]=function(e){return function(){return e.apply(this.doc,arguments)}}(ka.prototype[cl]));return xe(ka),Bs.inputStyles={textarea:ol,contenteditable:Js},Bs.defineMode=function(e){Bs.defaults.mode||"null"==e||(Bs.defaults.mode=e),Ue.apply(this,arguments)},Bs.defineMIME=Ve,Bs.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Bs.defineMIME("text/plain","null"),Bs.defineExtension=function(e,t){Bs.prototype[e]=t},Bs.defineDocExtension=function(e,t){ka.prototype[e]=t},Bs.fromTextArea=al,sl(Bs),Bs.version="5.55.0",Bs}()},"./node_modules/codemirror/mode/markdown/markdown.js":function(e,t,r){!function(e){"use strict";e.defineMode("markdown",(function(t,r){var n=e.getMode(t,"text/html"),i="null"==n.name;function o(r){if(e.findModeByName){var n=e.findModeByName(r);n&&(r=n.mime||n.mimes[0])}var i=e.getMode(t,r);return"null"==i.name?null:i}void 0===r.highlightFormatting&&(r.highlightFormatting=!1),void 0===r.maxBlockquoteDepth&&(r.maxBlockquoteDepth=0),void 0===r.taskLists&&(r.taskLists=!1),void 0===r.strikethrough&&(r.strikethrough=!1),void 0===r.emoji&&(r.emoji=!1),void 0===r.fencedCodeBlockHighlighting&&(r.fencedCodeBlockHighlighting=!0),void 0===r.fencedCodeBlockDefaultMode&&(r.fencedCodeBlockDefaultMode="text/plain"),void 0===r.xml&&(r.xml=!0),void 0===r.tokenTypeOverrides&&(r.tokenTypeOverrides={});var a={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var s in a)a.hasOwnProperty(s)&&r.tokenTypeOverrides[s]&&(a[s]=r.tokenTypeOverrides[s]);var l=/^([*\-_])(?:\s*\1){2,}\s*$/,c=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,p=r.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,f=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,m=/^\s*\[[^\]]+?\]:.*$/,g=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,b="    ";function _(e,t,r){return t.f=t.inline=r,r(e,t)}function y(e,t,r){return t.f=t.block=r,r(e,t)}function v(e){return!e||!/\S/.test(e.string)}function x(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==k){var r=i;if(!r){var o=e.innerMode(n,t.htmlState);r="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}r&&(t.f=C,t.block=w,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function w(t,n){var i=t.column()===n.indentation,s=v(n.prevLine.stream),d=n.indentedCode,g=n.prevLine.hr,b=!1!==n.list,y=(n.listStack[n.listStack.length-1]||0)+3;n.indentedCode=!1;var x=n.indentation;if(null===n.indentationDiff&&(n.indentationDiff=n.indentation,b)){for(n.list=null;x<n.listStack[n.listStack.length-1];)n.listStack.pop(),n.listStack.length?n.indentation=n.listStack[n.listStack.length-1]:n.list=!1;!1!==n.list&&(n.indentationDiff=x-n.listStack[n.listStack.length-1])}var w=!(s||g||n.prevLine.header||b&&d||n.prevLine.fencedCodeEnd),k=(!1===n.list||g||s)&&n.indentation<=y&&t.match(l),S=null;if(n.indentationDiff>=4&&(d||n.prevLine.fencedCodeEnd||n.prevLine.header||s))return t.skipToEnd(),n.indentedCode=!0,a.code;if(t.eatSpace())return null;if(i&&n.indentation<=y&&(S=t.match(p))&&S[1].length<=6)return n.quote=0,n.header=S[1].length,n.thisLine.header=!0,r.highlightFormatting&&(n.formatting="header"),n.f=n.inline,T(n);if(n.indentation<=y&&t.eat(">"))return n.quote=i?1:n.quote+1,r.highlightFormatting&&(n.formatting="quote"),t.eatSpace(),T(n);if(!k&&!n.setext&&i&&n.indentation<=y&&(S=t.match(c))){var C=S[1]?"ol":"ul";return n.indentation=x+t.current().length,n.list=!0,n.quote=0,n.listStack.push(n.indentation),n.em=!1,n.strong=!1,n.code=!1,n.strikethrough=!1,r.taskLists&&t.match(u,!1)&&(n.taskList=!0),n.f=n.inline,r.highlightFormatting&&(n.formatting=["list","list-"+C]),T(n)}return i&&n.indentation<=y&&(S=t.match(f,!0))?(n.quote=0,n.fencedEndRE=new RegExp(S[1]+"+ *$"),n.localMode=r.fencedCodeBlockHighlighting&&o(S[2]||r.fencedCodeBlockDefaultMode),n.localMode&&(n.localState=e.startState(n.localMode)),n.f=n.block=E,r.highlightFormatting&&(n.formatting="code-block"),n.code=-1,T(n)):n.setext||!(w&&b||n.quote||!1!==n.list||n.code||k||m.test(t.string))&&(S=t.lookAhead(1))&&(S=S.match(h))?(n.setext?(n.header=n.setext,n.setext=0,t.skipToEnd(),r.highlightFormatting&&(n.formatting="header")):(n.header="="==S[0].charAt(0)?1:2,n.setext=n.header),n.thisLine.header=!0,n.f=n.inline,T(n)):k?(t.skipToEnd(),n.hr=!0,n.thisLine.hr=!0,a.hr):"["===t.peek()?_(t,n,L):_(t,n,n.inline)}function k(t,r){var o=n.token(t,r.htmlState);if(!i){var a=e.innerMode(n,r.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||r.md_inside&&t.current().indexOf(">")>-1)&&(r.f=C,r.block=w,r.htmlState=null)}return o}function E(e,t){var n,i=t.listStack[t.listStack.length-1]||0,o=t.indentation<i,s=i+3;return t.fencedEndRE&&t.indentation<=s&&(o||e.match(t.fencedEndRE))?(r.highlightFormatting&&(t.formatting="code-block"),o||(n=T(t)),t.localMode=t.localState=null,t.block=w,t.f=C,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,o?y(e,t,t.block):n):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),a.code)}function T(e){var t=[];if(e.formatting){t.push(a.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var n=0;n<e.formatting.length;n++)t.push(a.formatting+"-"+e.formatting[n]),"header"===e.formatting[n]&&t.push(a.formatting+"-"+e.formatting[n]+"-"+e.header),"quote"===e.formatting[n]&&(!r.maxBlockquoteDepth||r.maxBlockquoteDepth>=e.quote?t.push(a.formatting+"-"+e.formatting[n]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(a.linkHref,"url"):(e.strong&&t.push(a.strong),e.em&&t.push(a.em),e.strikethrough&&t.push(a.strikethrough),e.emoji&&t.push(a.emoji),e.linkText&&t.push(a.linkText),e.code&&t.push(a.code),e.image&&t.push(a.image),e.imageAltText&&t.push(a.imageAltText,"link"),e.imageMarker&&t.push(a.imageMarker)),e.header&&t.push(a.header,a.header+"-"+e.header),e.quote&&(t.push(a.quote),!r.maxBlockquoteDepth||r.maxBlockquoteDepth>=e.quote?t.push(a.quote+"-"+e.quote):t.push(a.quote+"-"+r.maxBlockquoteDepth)),!1!==e.list){var i=(e.listStack.length-1)%3;i?1===i?t.push(a.list2):t.push(a.list3):t.push(a.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function S(e,t){if(e.match(d,!0))return T(t)}function C(t,i){var o=i.text(t,i);if(void 0!==o)return o;if(i.list)return i.list=null,T(i);if(i.taskList)return" "===t.match(u,!0)[1]?i.taskOpen=!0:i.taskClosed=!0,r.highlightFormatting&&(i.formatting="task"),i.taskList=!1,T(i);if(i.taskOpen=!1,i.taskClosed=!1,i.header&&t.match(/^#+$/,!0))return r.highlightFormatting&&(i.formatting="header"),T(i);var s=t.next();if(i.linkTitle){i.linkTitle=!1;var l=s;"("===s&&(l=")");var c="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(c),!0))return a.linkHref}if("`"===s){var p=i.formatting;r.highlightFormatting&&(i.formatting="code"),t.eatWhile("`");var h=t.current().length;if(0!=i.code||i.quote&&1!=h){if(h==i.code){var d=T(i);return i.code=0,d}return i.formatting=p,T(i)}return i.code=h,T(i)}if(i.code)return T(i);if("\\"===s&&(t.next(),r.highlightFormatting)){var f=T(i),m=a.formatting+"-escape";return f?f+" "+m:m}if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,r.highlightFormatting&&(i.formatting="image"),T(i);if("["===s&&i.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return i.imageMarker=!1,i.imageAltText=!0,r.highlightFormatting&&(i.formatting="image"),T(i);if("]"===s&&i.imageAltText){r.highlightFormatting&&(i.formatting="image");var f=T(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=M,f}if("["===s&&!i.image)return i.linkText&&t.match(/^.*?\]/)||(i.linkText=!0,r.highlightFormatting&&(i.formatting="link")),T(i);if("]"===s&&i.linkText){r.highlightFormatting&&(i.formatting="link");var f=T(i);return i.linkText=!1,i.inline=i.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?M:C,f}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=A,r.highlightFormatting&&(i.formatting="link"),(f=T(i))?f+=" ":f="",f+a.linkInline;if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=A,r.highlightFormatting&&(i.formatting="link"),(f=T(i))?f+=" ":f="",f+a.linkEmail;if(r.xml&&"<"===s&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var b=t.string.indexOf(">",t.pos);if(-1!=b){var _=t.string.substring(t.start,b);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(_)&&(i.md_inside=!0)}return t.backUp(1),i.htmlState=e.startState(n),y(t,i,k)}if(r.xml&&"<"===s&&t.match(/^\/\w*?>/))return i.md_inside=!1,"tag";if("*"===s||"_"===s){for(var v=1,x=1==t.pos?" ":t.string.charAt(t.pos-2);v<3&&t.eat(s);)v++;var w=t.peek()||" ",E=!/\s/.test(w)&&(!g.test(w)||/\s/.test(x)||g.test(x)),S=!/\s/.test(x)&&(!g.test(x)||/\s/.test(w)||g.test(w)),I=null,O=null;if(v%2&&(i.em||!E||"*"!==s&&S&&!g.test(x)?i.em!=s||!S||"*"!==s&&E&&!g.test(w)||(I=!1):I=!0),v>1&&(i.strong||!E||"*"!==s&&S&&!g.test(x)?i.strong!=s||!S||"*"!==s&&E&&!g.test(w)||(O=!1):O=!0),null!=O||null!=I)return r.highlightFormatting&&(i.formatting=null==I?"strong":null==O?"em":"strong em"),!0===I&&(i.em=s),!0===O&&(i.strong=s),d=T(i),!1===I&&(i.em=!1),!1===O&&(i.strong=!1),d}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return T(i);t.backUp(1)}if(r.strikethrough)if("~"===s&&t.eatWhile(s)){if(i.strikethrough)return r.highlightFormatting&&(i.formatting="strikethrough"),d=T(i),i.strikethrough=!1,d;if(t.match(/^[^\s]/,!1))return i.strikethrough=!0,r.highlightFormatting&&(i.formatting="strikethrough"),T(i)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return T(i);t.backUp(2)}if(r.emoji&&":"===s&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){i.emoji=!0,r.highlightFormatting&&(i.formatting="emoji");var L=T(i);return i.emoji=!1,L}return" "===s&&(t.match(/^ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),T(i)}function A(e,t){if(">"===e.next()){t.f=t.inline=C,r.highlightFormatting&&(t.formatting="link");var n=T(t);return n?n+=" ":n="",n+a.linkInline}return e.match(/^[^>]+/,!0),a.linkInline}function M(e,t){if(e.eatSpace())return null;var n=e.next();return"("===n||"["===n?(t.f=t.inline=O("("===n?")":"]"),r.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,T(t)):"error"}var I={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function O(e){return function(t,n){if(t.next()===e){n.f=n.inline=C,r.highlightFormatting&&(n.formatting="link-string");var i=T(n);return n.linkHref=!1,i}return t.match(I[e]),n.linkHref=!0,T(n)}}function L(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=z,e.next(),r.highlightFormatting&&(t.formatting="link"),t.linkText=!0,T(t)):_(e,t,C)}function z(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=D,r.highlightFormatting&&(t.formatting="link");var n=T(t);return t.linkText=!1,n}return e.match(/^([^\]\\]|\\.)+/,!0),a.linkText}function D(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=C,a.linkHref+" url")}var P={startState:function(){return{f:w,prevLine:{stream:null},thisLine:{stream:null},block:w,htmlState:null,indentation:0,inline:C,text:S,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(n,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return x(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=k)){var r=e.match(/^\s*/,!0)[0].replace(/\t/g,b).length;if(t.indentation=r,t.indentationDiff=null,r>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==k?{state:e.htmlState,mode:n}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:P}},indent:function(t,r,i){return t.block==k&&n.indent?n.indent(t.htmlState,r,i):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,r,i):e.Pass},blankLine:x,getType:T,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return P}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(r("./node_modules/codemirror/lib/codemirror.js"),r("./node_modules/codemirror/mode/xml/xml.js"),r("./node_modules/codemirror/mode/meta.js"))},"./node_modules/codemirror/mode/meta.js":function(e,t,r){!function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t<e.modeInfo.length;t++){var r=e.modeInfo[t];r.mimes&&(r.mime=r.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var r=0;r<e.modeInfo.length;r++){var n=e.modeInfo[r];if(n.mime==t)return n;if(n.mimes)for(var i=0;i<n.mimes.length;i++)if(n.mimes[i]==t)return n}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){t=t.toLowerCase();for(var r=0;r<e.modeInfo.length;r++){var n=e.modeInfo[r];if(n.ext)for(var i=0;i<n.ext.length;i++)if(n.ext[i]==t)return n}},e.findModeByFileName=function(t){for(var r=0;r<e.modeInfo.length;r++){var n=e.modeInfo[r];if(n.file&&n.file.test(t))return n}var i=t.lastIndexOf("."),o=i>-1&&t.substring(i+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var r=0;r<e.modeInfo.length;r++){var n=e.modeInfo[r];if(n.name.toLowerCase()==t)return n;if(n.alias)for(var i=0;i<n.alias.length;i++)if(n.alias[i].toLowerCase()==t)return n}}}(r("./node_modules/codemirror/lib/codemirror.js"))},"./node_modules/codemirror/mode/xml/xml.js":function(e,t,r){!function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(n,i){var o,a,s=n.indentUnit,l={},c=i.htmlMode?t:r;for(var u in c)l[u]=c[u];for(var u in i)l[u]=i[u];function p(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();return"<"==n?e.eat("!")?e.eat("[")?e.match("CDATA[")?r(f("atom","]]>")):null:e.match("--")?r(f("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(m(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=f("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=h,"tag bracket"):"&"==n?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function h(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=p,o=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return o="equals",null;if("<"==r){t.tokenize=p,t.state=y,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=d(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=h;break}return"string"};return t.isInAttribute=!0,t}function f(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=p;break}r.next()}return e}}function m(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=m(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=p;break}return r.tokenize=m(e-1),r.tokenize(t,r)}}return"meta"}}function g(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function b(e){e.context&&(e.context=e.context.prev)}function _(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!l.contextGrabbers.hasOwnProperty(r)||!l.contextGrabbers[r].hasOwnProperty(t))return;b(e)}}function y(e,t,r){return"openTag"==e?(r.tagStart=t.column(),v):"closeTag"==e?x:y}function v(e,t,r){return"word"==e?(r.tagName=t.current(),a="tag",E):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",E(e,t,r)):(a="error",v)}function x(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&l.implicitlyClosed.hasOwnProperty(r.context.tagName)&&b(r),r.context&&r.context.tagName==n||!1===l.matchClosing?(a="tag",w):(a="tag error",k)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",w(e,t,r)):(a="error",k)}function w(e,t,r){return"endTag"!=e?(a="error",w):(b(r),y)}function k(e,t,r){return a="error",w(e,t,r)}function E(e,t,r){if("word"==e)return a="attribute",T;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(n)?_(r,n):(_(r,n),r.context=new g(r,n,i==r.indented)),y}return a="error",E}function T(e,t,r){return"equals"==e?S:(l.allowMissing||(a="error"),E(e,t,r))}function S(e,t,r){return"string"==e?C:"word"==e&&l.allowUnquoted?(a="string",E):(a="error",E(e,t,r))}function C(e,t,r){return"string"==e?C:E(e,t,r)}return p.isInText=!0,{startState:function(e){var t={tokenize:p,state:y,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var r=t.tokenize(e,t);return(r||o)&&"comment"!=r&&(a=null,t.state=t.state(o||r,e,t),a&&(r="error"==a?r+" error":a)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=h&&t.tokenize!=p)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var o=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(o&&o[1])for(;i;){if(i.tagName==o[2]){i=i.prev;break}if(!l.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(o)for(;i;){var a=l.contextGrabbers[i.tagName];if(!a||!a.hasOwnProperty(o[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==S&&(e.state=E)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],r=e.context;r;r=r.prev)r.tagName&&t.push(r.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(r("./node_modules/codemirror/lib/codemirror.js"))},"./node_modules/marked/lib/marked.js":function(e,t,r){e.exports=function(){"use strict";function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}function r(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e){var t=0;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=r(e)))return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}function o(e,t){return e(t={exports:{}},t.exports),t.exports}var a=o((function(e){function t(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function r(t){e.exports.defaults=t}e.exports={defaults:t(),getDefaults:t,changeDefaults:r}})),s=(a.defaults,a.getDefaults,a.changeDefaults,/[&<>"']/),l=/[&<>"']/g,c=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,p={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},h=function(e){return p[e]};function d(e,t){if(t){if(s.test(e))return e.replace(l,h)}else if(c.test(e))return e.replace(u,h);return e}var f=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function m(e){return e.replace(f,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var g=/(^|[^\[])\^/g;function b(e,t){e=e.source||e,t=t||"";var r={replace:function(t,n){return n=(n=n.source||n).replace(g,"$1"),e=e.replace(t,n),r},getRegex:function(){return new RegExp(e,t)}};return r}var _=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v(e,t,r){if(e){var n;try{n=decodeURIComponent(m(r)).replace(_,"").toLowerCase()}catch(e){return null}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}t&&!y.test(r)&&(r=T(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch(e){return null}return r}var x={},w=/^[^:]+:\/*[^/]*$/,k=/^([^:]+:)[\s\S]*$/,E=/^([^:]+:\/*[^/]*)[\s\S]*$/;function T(e,t){x[" "+e]||(w.test(e)?x[" "+e]=e+"/":x[" "+e]=A(e,"/",!0));var r=-1===(e=x[" "+e]).indexOf(":");return"//"===t.substring(0,2)?r?t:e.replace(k,"$1")+t:"/"===t.charAt(0)?r?t:e.replace(E,"$1")+t:e+t}function S(e){for(var t,r,n=1;n<arguments.length;n++)for(r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}function C(e,t){var r=e.replace(/\|/g,(function(e,t,r){for(var n=!1,i=t;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"})).split(/ \|/),n=0;if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(/\\\|/g,"|");return r}function A(e,t,r){var n=e.length;if(0===n)return"";for(var i=0;i<n;){var o=e.charAt(n-i-1);if(o!==t||r){if(o===t||!r)break;i++}else i++}return e.substr(0,n-i)}function M(e,t){if(-1===e.indexOf(t[1]))return-1;for(var r=e.length,n=0,i=0;i<r;i++)if("\\"===e[i])i++;else if(e[i]===t[0])n++;else if(e[i]===t[1]&&--n<0)return i;return-1}function I(e){e&&e.sanitize&&e.silent}var O={escape:d,unescape:m,edit:b,cleanUrl:v,resolveUrl:T,noopTest:{exec:function(){}},merge:S,splitCells:C,rtrim:A,findClosingBracket:M,checkSanitizeDeprecation:I},L=a.defaults,z=O.rtrim,D=O.splitCells,P=O.escape,R=O.findClosingBracket;function B(e,t,r){var n=t.href,i=t.title?P(t.title):null;return"!"!==e[0].charAt(0)?{type:"link",raw:r,href:n,title:i,text:e[1]}:{type:"image",raw:r,text:P(e[1]),href:n,title:i}}function F(e,t){var r=e.match(/^(\s+)(?:```)/);if(null===r)return t;var n=r[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=n.length?e.slice(n.length):e})).join("\n")}var j=function(){function e(e){this.options=e||L}var t=e.prototype;return t.space=function(e){var t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e,t){var r=this.rules.block.code.exec(e);if(r){var n=t[t.length-1];if(n&&"paragraph"===n.type)return{raw:r[0],text:r[0].trimRight()};var i=r[0].replace(/^ {4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:z(i,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var r=t[0],n=F(r,t[3]||"");return{type:"code",raw:r,lang:t[2]?t[2].trim():t[2],text:n}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var r={type:"table",header:D(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(r.header.length===r.align.length){var n,i=r.align.length;for(n=0;n<i;n++)/^ *-+: *$/.test(r.align[n])?r.align[n]="right":/^ *:-+: *$/.test(r.align[n])?r.align[n]="center":/^ *:-+ *$/.test(r.align[n])?r.align[n]="left":r.align[n]=null;for(i=r.cells.length,n=0;n<i;n++)r.cells[n]=D(r.cells[n],r.header.length);return r}}},t.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},t.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var r=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],text:r}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){for(var r,n,i,o,a,s,l,c=t[0],u=t[2],p=u.length>1,h={type:"list",raw:c,ordered:p,start:p?+u:"",loose:!1,items:[]},d=t[0].match(this.rules.block.item),f=!1,m=d.length,g=0;g<m;g++)c=r=d[g],n=r.length,~(r=r.replace(/^ *([*+-]|\d+\.) */,"")).indexOf("\n ")&&(n-=r.length,r=this.options.pedantic?r.replace(/^ {1,4}/gm,""):r.replace(new RegExp("^ {1,"+n+"}","gm"),"")),g!==m-1&&(i=this.rules.block.bullet.exec(d[g+1])[0],(u.length>1?1===i.length:i.length>1||this.options.smartLists&&i!==u)&&(o=d.slice(g+1).join("\n"),h.raw=h.raw.substring(0,h.raw.length-o.length),g=m-1)),a=f||/\n\n(?!\s*$)/.test(r),g!==m-1&&(f="\n"===r.charAt(r.length-1),a||(a=f)),a&&(h.loose=!0),l=void 0,(s=/^\[[ xX]\] /.test(r))&&(l=" "!==r[1],r=r.replace(/^\[[ xX]\] +/,"")),h.items.push({type:"list_item",raw:c,task:s,checked:l,loose:a,text:r});return h}},t.html=function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):P(t[0]):t[0]}},t.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},t.table=function(e){var t=this.rules.block.table.exec(e);if(t){var r={type:"table",header:D(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(r.header.length===r.align.length){r.raw=t[0];var n,i=r.align.length;for(n=0;n<i;n++)/^ *-+: *$/.test(r.align[n])?r.align[n]="right":/^ *:-+: *$/.test(r.align[n])?r.align[n]="center":/^ *:-+ *$/.test(r.align[n])?r.align[n]="left":r.align[n]=null;for(i=r.cells.length,n=0;n<i;n++)r.cells[n]=D(r.cells[n].replace(/^ *\| *| *\| *$/g,""),r.header.length);return r}}},t.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1]}},t.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t)return{type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1]}},t.text=function(e,t){var r=this.rules.block.text.exec(e);if(r){var n=t[t.length-1];return n&&"text"===n.type?{raw:r[0],text:r[0]}:{type:"text",raw:r[0],text:r[0]}}},t.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:P(t[1])}},t.tag=function(e,t,r){var n=this.rules.inline.tag.exec(e);if(n)return!t&&/^<a /i.test(n[0])?t=!0:t&&/^<\/a>/i.test(n[0])&&(t=!1),!r&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?r=!0:r&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(r=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:t,inRawBlock:r,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):P(n[0]):n[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var r=R(t[2],"()");if(r>-1){var n=(0===t[0].indexOf("!")?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,n).trim(),t[3]=""}var i=t[2],o="";if(this.options.pedantic){var a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);a?(i=a[1],o=a[3]):o=""}else o=t[3]?t[3].slice(1,-1):"";return B(t,{href:(i=i.trim().replace(/^<([\s\S]*)>$/,"$1"))?i.replace(this.rules.inline._escapes,"$1"):i,title:o?o.replace(this.rules.inline._escapes,"$1"):o},t[0])}},t.reflink=function(e,t){var r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){var n=(r[2]||r[1]).replace(/\s+/g," ");if(!(n=t[n.toLowerCase()])||!n.href){var i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return B(r,n,r[0])}},t.strong=function(e){var t=this.rules.inline.strong.exec(e);if(t)return{type:"strong",raw:t[0],text:t[4]||t[3]||t[2]||t[1]}},t.em=function(e){var t=this.rules.inline.em.exec(e);if(t)return{type:"em",raw:t[0],text:t[6]||t[5]||t[4]||t[3]||t[2]||t[1]}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var r=t[2].replace(/\n/g," "),n=/[^ ]/.test(r),i=r.startsWith(" ")&&r.endsWith(" ");return n&&i&&(r=r.substring(1,r.length-1)),r=P(r,!0),{type:"codespan",raw:t[0],text:r}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[1]}},t.autolink=function(e,t){var r,n,i=this.rules.inline.autolink.exec(e);if(i)return n="@"===i[2]?"mailto:"+(r=P(this.options.mangle?t(i[1]):i[1])):r=P(i[1]),{type:"link",raw:i[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}},t.url=function(e,t){var r;if(r=this.rules.inline.url.exec(e)){var n,i;if("@"===r[2])i="mailto:"+(n=P(this.options.mangle?t(r[0]):r[0]));else{var o;do{o=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0]}while(o!==r[0]);n=P(r[0]),i="www."===r[1]?"http://"+n:n}return{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}},t.inlineText=function(e,t,r){var n,i=this.rules.inline.text.exec(e);if(i)return n=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):P(i[0]):i[0]:P(this.options.smartypants?r(i[0]):i[0]),{type:"text",raw:i[0],text:n}},e}(),N=O.noopTest,U=O.edit,V=O.merge,q={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:N,table:N,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};q.def=U(q.def).replace("label",q._label).replace("title",q._title).getRegex(),q.bullet=/(?:[*+-]|\d{1,9}\.)/,q.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,q.item=U(q.item,"gm").replace(/bull/g,q.bullet).getRegex(),q.list=U(q.list).replace(/bull/g,q.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+q.def.source+")").getRegex(),q._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",q._comment=/<!--(?!-?>)[\s\S]*?-->/,q.html=U(q.html,"i").replace("comment",q._comment).replace("tag",q._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),q.paragraph=U(q._paragraph).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",q._tag).getRegex(),q.blockquote=U(q.blockquote).replace("paragraph",q.paragraph).getRegex(),q.normal=V({},q),q.gfm=V({},q.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),q.gfm.nptable=U(q.gfm.nptable).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",q._tag).getRegex(),q.gfm.table=U(q.gfm.table).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",q._tag).getRegex(),q.pedantic=V({},q.normal,{html:U("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",q._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:N,paragraph:U(q.normal._paragraph).replace("hr",q.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",q.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var $={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:N,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^_([^\s_<][\s\S]*?[^\s_])_(?!_|[^\s,punctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\s,punctuation])|^\*([^\s*<\[])\*(?!\*)|^\*([^\s<"][\s\S]*?[^\s\[\*])\*(?![\]`punctuation])|^\*([^\s*"<\[][\s\S]*[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:N,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,_punctuation:"!\"#$%&'()*+\\-./:;<=>?@\\[^_{|}~"};$.em=U($.em).replace(/punctuation/g,$._punctuation).getRegex(),$._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,$._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,$._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,$.autolink=U($.autolink).replace("scheme",$._scheme).replace("email",$._email).getRegex(),$._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,$.tag=U($.tag).replace("comment",q._comment).replace("attribute",$._attribute).getRegex(),$._label=/(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,$._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,$._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,$.link=U($.link).replace("label",$._label).replace("href",$._href).replace("title",$._title).getRegex(),$.reflink=U($.reflink).replace("label",$._label).getRegex(),$.normal=V({},$),$.pedantic=V({},$.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:U(/^!?\[(label)\]\((.*?)\)/).replace("label",$._label).getRegex(),reflink:U(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",$._label).getRegex()}),$.gfm=V({},$.normal,{escape:U($.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),$.gfm.url=U($.gfm.url,"i").replace("email",$.gfm._extended_email).getRegex(),$.breaks=V({},$.gfm,{br:U($.br).replace("{2,}","*").getRegex(),text:U($.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var G={block:q,inline:$},W=a.defaults,H=G.block,Z=G.inline;function X(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function K(e){var t,r,n="",i=e.length;for(t=0;t<i;t++)r=e.charCodeAt(t),Math.random()>.5&&(r="x"+r.toString(16)),n+="&#"+r+";";return n}var Y=function(){function e(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||W,this.options.tokenizer=this.options.tokenizer||new j,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:H.normal,inline:Z.normal};this.options.pedantic?(t.block=H.pedantic,t.inline=Z.pedantic):this.options.gfm&&(t.block=H.gfm,this.options.breaks?t.inline=Z.breaks:t.inline=Z.gfm),this.tokenizer.rules=t}e.lex=function(t,r){return new e(r).lex(t)};var r=e.prototype;return r.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},r.blockTokens=function(e,t,r){var n,i,o,a;for(void 0===t&&(t=[]),void 0===r&&(r=!0),e=e.replace(/^ +$/gm,"");e;)if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),n.type&&t.push(n);else if(n=this.tokenizer.code(e,t))e=e.substring(n.raw.length),n.type?t.push(n):((a=t[t.length-1]).raw+="\n"+n.raw,a.text+="\n"+n.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.nptable(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),n.tokens=this.blockTokens(n.text,[],r),t.push(n);else if(n=this.tokenizer.list(e)){for(e=e.substring(n.raw.length),o=n.items.length,i=0;i<o;i++)n.items[i].tokens=this.blockTokens(n.items[i].text,[],!1);t.push(n)}else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(r&&(n=this.tokenizer.def(e)))e=e.substring(n.raw.length),this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else if(r&&(n=this.tokenizer.paragraph(e)))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.text(e,t))e=e.substring(n.raw.length),n.type?t.push(n):((a=t[t.length-1]).raw+="\n"+n.raw,a.text+="\n"+n.text);else if(e){var s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(s)}return t},r.inline=function(e){var t,r,n,i,o,a,s=e.length;for(t=0;t<s;t++)switch((a=e[t]).type){case"paragraph":case"text":case"heading":a.tokens=[],this.inlineTokens(a.text,a.tokens);break;case"table":for(a.tokens={header:[],cells:[]},i=a.header.length,r=0;r<i;r++)a.tokens.header[r]=[],this.inlineTokens(a.header[r],a.tokens.header[r]);for(i=a.cells.length,r=0;r<i;r++)for(o=a.cells[r],a.tokens.cells[r]=[],n=0;n<o.length;n++)a.tokens.cells[r][n]=[],this.inlineTokens(o[n],a.tokens.cells[r][n]);break;case"blockquote":this.inline(a.tokens);break;case"list":for(i=a.items.length,r=0;r<i;r++)this.inline(a.items[r].tokens)}return e},r.inlineTokens=function(e,t,r,n){var i;for(void 0===t&&(t=[]),void 0===r&&(r=!1),void 0===n&&(n=!1);e;)if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e,r,n))e=e.substring(i.raw.length),r=i.inLink,n=i.inRawBlock,t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),"link"===i.type&&(i.tokens=this.inlineTokens(i.text,[],!0,n)),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),"link"===i.type&&(i.tokens=this.inlineTokens(i.text,[],!0,n)),t.push(i);else if(i=this.tokenizer.strong(e))e=e.substring(i.raw.length),i.tokens=this.inlineTokens(i.text,[],r,n),t.push(i);else if(i=this.tokenizer.em(e))e=e.substring(i.raw.length),i.tokens=this.inlineTokens(i.text,[],r,n),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),i.tokens=this.inlineTokens(i.text,[],r,n),t.push(i);else if(i=this.tokenizer.autolink(e,K))e=e.substring(i.raw.length),t.push(i);else if(r||!(i=this.tokenizer.url(e,K))){if(i=this.tokenizer.inlineText(e,n,X))e=e.substring(i.raw.length),t.push(i);else if(e){var o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(o)}}else e=e.substring(i.raw.length),t.push(i);return t},t(e,null,[{key:"rules",get:function(){return{block:H,inline:Z}}}]),e}(),J=a.defaults,Q=O.cleanUrl,ee=O.escape,te=function(){function e(e){this.options=e||J}var t=e.prototype;return t.code=function(e,t,r){var n=(t||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,n);null!=i&&i!==e&&(r=!0,e=i)}return n?'<pre><code class="'+this.options.langPrefix+ee(n,!0)+'">'+(r?e:ee(e,!0))+"</code></pre>\n":"<pre><code>"+(r?e:ee(e,!0))+"</code></pre>\n"},t.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},t.html=function(e){return e},t.heading=function(e,t,r,n){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+n.slug(r)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},t.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},t.list=function(e,t,r){var n=t?"ol":"ul";return"<"+n+(t&&1!==r?' start="'+r+'"':"")+">\n"+e+"</"+n+">\n"},t.listitem=function(e){return"<li>"+e+"</li>\n"},t.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},t.paragraph=function(e){return"<p>"+e+"</p>\n"},t.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},t.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},t.tablecell=function(e,t){var r=t.header?"th":"td";return(t.align?"<"+r+' align="'+t.align+'">':"<"+r+">")+e+"</"+r+">\n"},t.strong=function(e){return"<strong>"+e+"</strong>"},t.em=function(e){return"<em>"+e+"</em>"},t.codespan=function(e){return"<code>"+e+"</code>"},t.br=function(){return this.options.xhtml?"<br/>":"<br>"},t.del=function(e){return"<del>"+e+"</del>"},t.link=function(e,t,r){if(null===(e=Q(this.options.sanitize,this.options.baseUrl,e)))return r;var n='<a href="'+ee(e)+'"';return t&&(n+=' title="'+t+'"'),n+=">"+r+"</a>"},t.image=function(e,t,r){if(null===(e=Q(this.options.sanitize,this.options.baseUrl,e)))return r;var n='<img src="'+e+'" alt="'+r+'"';return t&&(n+=' title="'+t+'"'),n+=this.options.xhtml?"/>":">"},t.text=function(e){return e},e}(),re=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,r){return""+r},t.image=function(e,t,r){return""+r},t.br=function(){return""},e}(),ne=function(){function e(){this.seen={}}return e.prototype.slug=function(e){var t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var r=t;do{this.seen[r]++,t=r+"-"+this.seen[r]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},e}(),ie=a.defaults,oe=O.unescape,ae=function(){function e(e){this.options=e||ie,this.options.renderer=this.options.renderer||new te,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new re,this.slugger=new ne}e.parse=function(t,r){return new e(r).parse(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var r,n,i,o,a,s,l,c,u,p,h,d,f,m,g,b,_,y,v="",x=e.length;for(r=0;r<x;r++)switch((p=e[r]).type){case"space":continue;case"hr":v+=this.renderer.hr();continue;case"heading":v+=this.renderer.heading(this.parseInline(p.tokens),p.depth,oe(this.parseInline(p.tokens,this.textRenderer)),this.slugger);continue;case"code":v+=this.renderer.code(p.text,p.lang,p.escaped);continue;case"table":for(c="",l="",o=p.header.length,n=0;n<o;n++)l+=this.renderer.tablecell(this.parseInline(p.tokens.header[n]),{header:!0,align:p.align[n]});for(c+=this.renderer.tablerow(l),u="",o=p.cells.length,n=0;n<o;n++){for(l="",a=(s=p.tokens.cells[n]).length,i=0;i<a;i++)l+=this.renderer.tablecell(this.parseInline(s[i]),{header:!1,align:p.align[i]});u+=this.renderer.tablerow(l)}v+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(p.tokens),v+=this.renderer.blockquote(u);continue;case"list":for(h=p.ordered,d=p.start,f=p.loose,o=p.items.length,u="",n=0;n<o;n++)b=(g=p.items[n]).checked,_=g.task,m="",g.task&&(y=this.renderer.checkbox(b),f?g.tokens.length>0&&"text"===g.tokens[0].type?(g.tokens[0].text=y+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=y+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:y}):m+=y),m+=this.parse(g.tokens,f),u+=this.renderer.listitem(m,_,b);v+=this.renderer.list(u,h,d);continue;case"html":v+=this.renderer.html(p.text);continue;case"paragraph":v+=this.renderer.paragraph(this.parseInline(p.tokens));continue;case"text":for(u=p.tokens?this.parseInline(p.tokens):p.text;r+1<x&&"text"===e[r+1].type;)u+="\n"+((p=e[++r]).tokens?this.parseInline(p.tokens):p.text);v+=t?this.renderer.paragraph(u):u;continue;default:var w='Token with "'+p.type+'" type was not found.';if(this.options.silent)return;throw new Error(w)}return v},t.parseInline=function(e,t){t=t||this.renderer;var r,n,i="",o=e.length;for(r=0;r<o;r++)switch((n=e[r]).type){case"escape":case"text":i+=t.text(n.text);break;case"html":i+=t.html(n.text);break;case"link":i+=t.link(n.href,n.title,this.parseInline(n.tokens,t));break;case"image":i+=t.image(n.href,n.title,n.text);break;case"strong":i+=t.strong(this.parseInline(n.tokens,t));break;case"em":i+=t.em(this.parseInline(n.tokens,t));break;case"codespan":i+=t.codespan(n.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(n.tokens,t));break;default:var a='Token with "'+n.type+'" type was not found.';if(this.options.silent)return;throw new Error(a)}return i},e}(),se=O.merge,le=O.checkSanitizeDeprecation,ce=O.escape,ue=a.getDefaults,pe=a.changeDefaults,he=a.defaults;function de(e,t,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(r=t,t=null),t=se({},de.defaults,t||{}),le(t),r){var n,i=t.highlight;try{n=Y.lex(e,t)}catch(e){return r(e)}var o=function(e){var o;if(!e)try{o=ae.parse(n,t)}catch(t){e=t}return t.highlight=i,e?r(e):r(null,o)};if(!i||i.length<3)return o();if(delete t.highlight,!n.length)return o();var a=0;return de.walkTokens(n,(function(e){"code"===e.type&&(a++,i(e.text,e.lang,(function(t,r){if(t)return o(t);null!=r&&r!==e.text&&(e.text=r,e.escaped=!0),0==--a&&o()})))})),void(0===a&&o())}try{var s=Y.lex(e,t);return t.walkTokens&&de.walkTokens(s,t.walkTokens),ae.parse(s,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+ce(e.message+"",!0)+"</pre>";throw e}}return de.options=de.setOptions=function(e){return se(de.defaults,e),pe(de.defaults),de},de.getDefaults=ue,de.defaults=he,de.use=function(e){var t=se({},e);if(e.renderer&&function(){var r=de.defaults.renderer||new te,n=function(t){var n=r[t];r[t]=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=e.renderer[t].apply(r,o);return!1===s&&(s=n.apply(r,o)),s}};for(var i in e.renderer)n(i);t.renderer=r}(),e.tokenizer&&function(){var r=de.defaults.tokenizer||new j,n=function(t){var n=r[t];r[t]=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=e.tokenizer[t].apply(r,o);return!1===s&&(s=n.apply(r,o)),s}};for(var i in e.tokenizer)n(i);t.tokenizer=r}(),e.walkTokens){var r=de.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens(t),r&&r(t)}}de.setOptions(t)},de.walkTokens=function(e,t){for(var r,n=i(e);!(r=n()).done;){var o=r.value;switch(t(o),o.type){case"table":for(var a,s=i(o.tokens.header);!(a=s()).done;){var l=a.value;de.walkTokens(l,t)}for(var c,u=i(o.tokens.cells);!(c=u()).done;)for(var p,h=i(c.value);!(p=h()).done;){var d=p.value;de.walkTokens(d,t)}break;case"list":de.walkTokens(o.items,t);break;default:o.tokens&&de.walkTokens(o.tokens,t)}}},de.Parser=ae,de.parser=ae.parse,de.Renderer=te,de.TextRenderer=re,de.Lexer=Y,de.lexer=Y.lex,de.Tokenizer=j,de.Slugger=ne,de.parse=de,de}()},"./node_modules/turndown/lib/turndown.es.js":function(e,t,r){"use strict";function n(e,t){return Array(t+1).join(e)}r.r(t);var i=["address","article","aside","audio","blockquote","body","canvas","center","dd","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frameset","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","isindex","li","main","menu","nav","noframes","noscript","ol","output","p","pre","section","table","tbody","td","tfoot","th","thead","tr","ul"];function o(e){return-1!==i.indexOf(e.nodeName.toLowerCase())}var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function s(e){return-1!==a.indexOf(e.nodeName.toLowerCase())}var l=a.join(),c={};function u(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function p(e,t,r){for(var n=0;n<e.length;n++){var i=e[n];if(h(i,t,r))return i}}function h(e,t,r){var n=e.filter;if("string"==typeof n){if(n===t.nodeName.toLowerCase())return!0}else if(Array.isArray(n)){if(n.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof n)throw new TypeError("`filter` needs to be a string, array, or function");if(n.call(e,t,r))return!0}}function d(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function f(e,t,r){return e&&e.parentNode===t||r(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}c.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},c.lineBreak={filter:"br",replacement:function(e,t,r){return r.br+"\n"}},c.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,r){var i=Number(t.nodeName.charAt(1));return"setext"===r.headingStyle&&i<3?"\n\n"+e+"\n"+n(1===i?"=":"-",e.length)+"\n\n":"\n\n"+n("#",i)+" "+e+"\n\n"}},c.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},c.list={filter:["ul","ol"],replacement:function(e,t){var r=t.parentNode;return"LI"===r.nodeName&&r.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},c.listItem={filter:"li",replacement:function(e,t,r){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n    ");var n=r.bulletListMarker+"   ",i=t.parentNode;if("OL"===i.nodeName){var o=i.getAttribute("start"),a=Array.prototype.indexOf.call(i.children,t);n=(o?Number(o)+a:a+1)+".  "}return n+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},c.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,r){return"\n\n    "+t.firstChild.textContent.replace(/\n/g,"\n    ")+"\n\n"}},c.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,r){for(var i,o=((t.firstChild.className||"").match(/language-(\S+)/)||[null,""])[1],a=t.firstChild.textContent,s=r.fence.charAt(0),l=3,c=new RegExp("^"+s+"{3,}","gm");i=c.exec(a);)i[0].length>=l&&(l=i[0].length+1);var u=n(s,l);return"\n\n"+u+o+"\n"+a.replace(/\n$/,"")+"\n"+u+"\n\n"}},c.horizontalRule={filter:"hr",replacement:function(e,t,r){return"\n\n"+r.hr+"\n\n"}},c.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){return"["+e+"]("+t.getAttribute("href")+(t.title?' "'+t.title+'"':"")+")"}},c.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,r){var n,i,o=t.getAttribute("href"),a=t.title?' "'+t.title+'"':"";switch(r.linkReferenceStyle){case"collapsed":n="["+e+"][]",i="["+e+"]: "+o+a;break;case"shortcut":n="["+e+"]",i="["+e+"]: "+o+a;break;default:var s=this.references.length+1;n="["+e+"]["+s+"]",i="["+s+"]: "+o+a}return this.references.push(i),n},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},c.emphasis={filter:["em","i"],replacement:function(e,t,r){return e.trim()?r.emDelimiter+e+r.emDelimiter:""}},c.strong={filter:["strong","b"],replacement:function(e,t,r){return e.trim()?r.strongDelimiter+e+r.strongDelimiter:""}},c.code={filter:function(e){var t=e.previousSibling||e.nextSibling,r="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!r},replacement:function(e){if(!e.trim())return"";var t="`",r="",n="",i=e.match(/`+/gm);if(i)for(/^`/.test(e)&&(r=" "),/`$/.test(e)&&(n=" ");-1!==i.indexOf(t);)t+="`";return t+r+e+n+t}},c.image={filter:"img",replacement:function(e,t){var r=t.alt||"",n=t.getAttribute("src")||"",i=t.title||"";return n?"!["+r+"]("+n+(i?' "'+i+'"':"")+")":""}},u.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=p(this.array,e,this.options))||(t=p(this._keep,e,this.options))||(t=p(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var m,g,b,_="undefined"!=typeof window?window:{},y=function(){var e=_.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?_.DOMParser:(m=function(){},g=r(0).JSDOM,m.prototype.parseFromString=function(e){return new g(e).window.document},m);function v(e){var t;return function(e){var t=e.element,r=e.isBlock,n=e.isVoid,i=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!i(t)){for(var o=null,a=!1,s=null,l=f(s,t,i);l!==t;){if(3===l.nodeType||4===l.nodeType){var c=l.data.replace(/[ \r\n\t]+/g," ");if(o&&!/ $/.test(o.data)||a||" "!==c[0]||(c=c.substr(1)),!c){l=d(l);continue}l.data=c,o=l}else{if(1!==l.nodeType){l=d(l);continue}r(l)||"BR"===l.nodeName?(o&&(o.data=o.data.replace(/ $/,"")),o=null,a=!1):n(l)&&(o=null,a=!0)}var u=f(s,l,i);s=l,l=u}o&&(o.data=o.data.replace(/ $/,""),o.data||d(o))}}({element:t="string"==typeof e?(b=b||new y).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):e.cloneNode(!0),isBlock:o,isVoid:s}),t}function x(e){return e.isBlock=o(e),e.isCode="code"===e.nodeName.toLowerCase()||e.parentNode.isCode,e.isBlank=function(e){return-1===["A","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"].indexOf(e.nodeName)&&/^\s*$/i.test(e.textContent)&&!s(e)&&!function(e){return e.querySelector&&e.querySelector(l)}(e)}(e),e.flankingWhitespace=function(e){var t="",r="";if(!e.isBlock){var n=/^\s/.test(e.textContent),i=/\s$/.test(e.textContent),o=e.isBlank&&n&&i;n&&!w("left",e)&&(t=" "),o||!i||w("right",e)||(r=" ")}return{leading:t,trailing:r}}(e),e}function w(e,t){var r,n,i;return"left"===e?(r=t.previousSibling,n=/ $/):(r=t.nextSibling,n=/^ /),r&&(3===r.nodeType?i=n.test(r.nodeValue):1!==r.nodeType||o(r)||(i=n.test(r.textContent))),i}var k=Array.prototype.reduce,E=/^\n*/,T=/\n*$/,S=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function C(e){if(!(this instanceof C))return new C(e);var t={rules:c,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:"  ",blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}return e}({},t,e),this.rules=new u(this.options)}function A(e){var t=this;return k.call(e.childNodes,(function(e,r){var n="";return 3===(r=new x(r)).nodeType?n=r.isCode?r.nodeValue:t.escape(r.nodeValue):1===r.nodeType&&(n=I.call(t,r)),O(e,n)}),"")}function M(e){var t=this;return this.rules.forEach((function(r){"function"==typeof r.append&&(e=O(e,r.append(t.options)))})),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function I(e){var t=this.rules.forNode(e),r=A.call(this,e),n=e.flankingWhitespace;return(n.leading||n.trailing)&&(r=r.trim()),n.leading+t.replacement(r,e,this.options)+n.trailing}function O(e,t){var r,n,i,o=(r=t,n=[e.match(T)[0],r.match(E)[0]].sort(),(i=n[n.length-1]).length<2?i:"\n\n");return(e=e.replace(T,""))+o+(t=t.replace(E,""))}C.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=A.call(this,new v(e));return M.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return S.reduce((function(e,t){return e.replace(t[0],t[1])}),e)}},t.default=C},"./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./src/editor.vue?vue&type=template&id=7c83f806&":function(e,t,r){"use strict";r.r(t),r.d(t,"render",(function(){return n})),r.d(t,"staticRenderFns",(function(){return i}));var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{class:["v-md-container",e.css,{"v-md-auto-resize":"auto"==e.height,"v-md-fullscreen":e.fullScreen}]},[e.toolbars.length>0?r("div",{staticClass:"v-md-toolbar"},e._l(e.toolbars,(function(t){return r("div",{staticClass:"btn-group mr-5",attrs:{role:"group"}},e._l(t,(function(t){return r("button",{class:"btn btn-"+e.theme,attrs:{type:"button",title:t.title,disabled:e.preview&&!t.ready},on:{click:function(r){return e.command(t.cmd)}}},[r("i",{class:t.ico})])})),0)})),0):e._e(),e._v(" "),r("div",{staticClass:"v-md-wrapper",on:{click:function(t){return e.editor.focus()}}},[r("textarea",{staticClass:"v-md-editor",style:e.styles,attrs:{id:e.id,placeholder:e.placeholder}}),e._v(" "),e.preview?r("div",{staticClass:"v-md-preview",domProps:{innerHTML:e._s(e.html)}}):e._e()])])},i=[];n._withStripped=!0},"./node_modules/vue-loader/lib/runtime/componentNormalizer.js":function(e,t,r){"use strict";function n(e,t,r,n,i,o,a,s){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=r,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):i&&(l=s?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:e,options:c}}r.r(t),r.d(t,"default",(function(){return n}))},"./src/editor.vue":function(e,t,r){"use strict";r.r(t);var n=r("./src/editor.vue?vue&type=template&id=7c83f806&"),i=r("./src/editor.vue?vue&type=script&lang=js&"),o=r("./node_modules/vue-loader/lib/runtime/componentNormalizer.js"),a=Object(o.default)(i.default,n.render,n.staticRenderFns,!1,null,null,null);a.options.__file="src/editor.vue",t.default=a.exports},"./src/editor.vue?vue&type=script&lang=js&":function(e,t,r){"use strict";r.r(t);var n=r("./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js?!./src/editor.vue?vue&type=script&lang=js&");t.default=n.default},"./src/editor.vue?vue&type=template&id=7c83f806&":function(e,t,r){"use strict";r.r(t);var n=r("./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./src/editor.vue?vue&type=template&id=7c83f806&");r.d(t,"render",(function(){return n.render})),r.d(t,"staticRenderFns",(function(){return n.staticRenderFns}))},"./src/index.css":function(e,t,r){},"./src/index.js":function(e,t,r){"use strict";r.r(t),r("./node_modules/codemirror/lib/codemirror.css"),r("./src/index.css");var n=r("./src/editor.vue"),i={install:function(e){e.__md_editor_installed||(e.__md_editor_installed=!0,e.component("markdown-editor",n.default))}};"undefined"!=typeof window&&window.Vue&&Vue.use(i),t.default=i},0:function(e,t){}})},e.exports=n()},,function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return c}));var n=r(0),i=r(3),o=r(249),a=r(10),s=r(53);function l(e,t,r){void 0===t&&(t=1/0),void 0===r&&(r=1/0);try{return u("",e,t,r)}catch(e){return{ERROR:"**non-serializable** ("+e+")"}}}function c(e,t,r){void 0===t&&(t=3),void 0===r&&(r=102400);var n,i=l(e,t);return n=i,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(n))>r?c(e,t-1,r):i}function u(t,r,l,c,p){void 0===l&&(l=1/0),void 0===c&&(c=1/0),void 0===p&&(p=Object(o.a)());var h=Object(n.c)(p,2),d=h[0],f=h[1],m=r;if(m&&"function"==typeof m.toJSON)try{return m.toJSON()}catch(e){}if(null===r||["number","boolean","string"].includes(typeof r)&&!Object(i.h)(r))return r;var g=function(t,r){try{return"domain"===t&&r&&"object"==typeof r&&r._events?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":void 0!==e&&r===e?"[Global]":"undefined"!=typeof window&&r===window?"[Window]":"undefined"!=typeof document&&r===document?"[Document]":Object(i.m)(r)?"[SyntheticEvent]":"number"==typeof r&&r!=r?"[NaN]":void 0===r?"[undefined]":"function"==typeof r?"[Function: "+Object(s.b)(r)+"]":"symbol"==typeof r?"["+String(r)+"]":"bigint"==typeof r?"[BigInt: "+String(r)+"]":"[object "+Object.getPrototypeOf(r).constructor.name+"]"}catch(e){return"**non-serializable** ("+e+")"}}(t,r);if(!g.startsWith("[object "))return g;if(0===l)return g.replace("object ","");if(d(r))return"[Circular ~]";var b=Array.isArray(r)?[]:{},_=0,y=Object(i.d)(r)||Object(i.f)(r)?Object(a.b)(r):r;for(var v in y)if(Object.prototype.hasOwnProperty.call(y,v)){if(_>=c){b[v]="[MaxProperties ~]";break}var x=y[v];b[v]=u(v,x,l-1,c,p),_+=1}return f(r),b}}).call(this,r(31))},function(e,t,r){"use strict";var n;r.d(t,"a",(function(){return n})),function(e){e.Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical"}(n||(n={}))},function(e,t,r){"use strict";function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,a=void 0,a=function(e,t){if("object"!==o(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===o(a)?a:String(a)),n)}var i,a}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,i;return t=e,i=[{key:"equals",value:function(e,t,r){return r?this.resolveFieldData(e,r)===this.resolveFieldData(t,r):this.deepEquals(e,t)}},{key:"deepEquals",value:function(e,t){if(e===t)return!0;if(e&&t&&"object"==o(e)&&"object"==o(t)){var r,n,i,a=Array.isArray(e),s=Array.isArray(t);if(a&&s){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!this.deepEquals(e[r],t[r]))return!1;return!0}if(a!=s)return!1;var l=e instanceof Date,c=t instanceof Date;if(l!=c)return!1;if(l&&c)return e.getTime()==t.getTime();var u=e instanceof RegExp,p=t instanceof RegExp;if(u!=p)return!1;if(u&&p)return e.toString()==t.toString();var h=Object.keys(e);if((n=h.length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,h[r]))return!1;for(r=n;0!=r--;)if(i=h[r],!this.deepEquals(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}},{key:"resolveFieldData",value:function(e,t){if(e&&Object.keys(e).length&&t){if(this.isFunction(t))return t(e);if(-1===t.indexOf("."))return e[t];for(var r=t.split("."),n=e,i=0,o=r.length;i<o;++i){if(null==n)return null;n=n[r[i]]}return n}return null}},{key:"isFunction",value:function(e){return!!(e&&e.constructor&&e.call&&e.apply)}},{key:"filter",value:function(e,t,r){var i=[];if(e){var o,a=n(e);try{for(a.s();!(o=a.n()).done;){var s,l=o.value,c=n(t);try{for(c.s();!(s=c.n()).done;){var u=s.value;if(String(this.resolveFieldData(l,u)).toLowerCase().indexOf(r.toLowerCase())>-1){i.push(l);break}}}catch(e){c.e(e)}finally{c.f()}}}catch(e){a.e(e)}finally{a.f()}}return i}},{key:"reorderArray",value:function(e,t,r){var n;if(e&&t!==r){if(r>=e.length)for(n=r-e.length;1+n--;)e.push(void 0);e.splice(r,0,e.splice(t,1)[0])}}},{key:"findIndexInList",value:function(e,t){var r=-1;if(t)for(var n=0;n<t.length;n++)if(t[n]===e){r=n;break}return r}},{key:"contains",value:function(e,t){if(null!=e&&t&&t.length){var r,i=n(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(this.equals(e,o))return!0}}catch(e){i.e(e)}finally{i.f()}}return!1}},{key:"insertIntoOrderedArray",value:function(e,t,r,n){if(r.length>0){for(var i=!1,o=0;o<r.length;o++)if(this.findIndexInList(r[o],n)>t){r.splice(o,0,e),i=!0;break}i||r.push(e)}else r.push(e)}},{key:"removeAccents",value:function(e){return e&&e.search(/[\xC0-\xFF]/g)>-1&&(e=e.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),e}},{key:"getVNodeProp",value:function(e,t){var r=e._props;if(r){var n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return r[Object.prototype.hasOwnProperty.call(r,n)?n:t]}return null}}],(r=null)&&a(t.prototype,r),i&&a(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=s},,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pv_id_";return n++,"".concat(e).concat(n)};var n=0},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(173))&&n.__esModule?n:{default:n};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,a=void 0,a=function(e,t){if("object"!==o(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===o(a)?a:String(a)),n)}var i,a}var s=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.listener=r}var t,r,n;return t=e,(r=[{key:"bindScrollListener",value:function(){this.scrollableParents=i.default.getScrollableParents(this.element);for(var e=0;e<this.scrollableParents.length;e++)this.scrollableParents[e].addEventListener("scroll",this.listener)}},{key:"unbindScrollListener",value:function(){if(this.scrollableParents)for(var e=0;e<this.scrollableParents.length;e++)this.scrollableParents[e].removeEventListener("scroll",this.listener)}},{key:"destroy",value:function(){this.unbindScrollListener(),this.element=null,this.listener=null,this.scrollableParents=null}}])&&a(t.prototype,r),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=s},,,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={AND:"and",OR:"or"};t.default=n},,,,function(e,t,r){e.exports=function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",i="second",o="minute",a="hour",s="day",l="week",c="month",u="quarter",p="year",h="date",d="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},b=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},_={s:b,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),i=r%60;return(t<=0?"+":"-")+b(n,2,"0")+":"+b(i,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),i=t.clone().add(n,c),o=r-i<0,a=t.clone().add(n+(o?-1:1),c);return+(-(n+(r-i)/(o?i-a:a-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:p,w:l,d:s,D:h,h:a,m:o,s:i,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",v={};v[y]=g;var x="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[x])},k=function e(t,r,n){var i;if(!t)return y;if("string"==typeof t){var o=t.toLowerCase();v[o]&&(i=o),r&&(v[o]=r,i=o);var a=t.split("-");if(!i&&a.length>1)return e(a[0])}else{var s=t.name;v[s]=t,i=s}return!n&&i&&(y=i),i||!n&&y},E=function(e,t){if(w(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new S(r)},T=_;T.l=k,T.i=w,T.w=function(e,t){return E(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function g(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var b=g.prototype;return b.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(f);if(n){var i=n[2]-1||0,o=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.init()},b.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},b.$utils=function(){return T},b.isValid=function(){return!(this.$d.toString()===d)},b.isSame=function(e,t){var r=E(e);return this.startOf(t)<=r&&r<=this.endOf(t)},b.isAfter=function(e,t){return E(e)<this.startOf(t)},b.isBefore=function(e,t){return this.endOf(t)<E(e)},b.$g=function(e,t,r){return T.u(e)?this[t]:this.set(r,e)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(e,t){var r=this,n=!!T.u(t)||t,u=T.p(e),d=function(e,t){var i=T.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return n?i:i.endOf(s)},f=function(e,t){return T.w(r.toDate()[e].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},m=this.$W,g=this.$M,b=this.$D,_="set"+(this.$u?"UTC":"");switch(u){case p:return n?d(1,0):d(31,11);case c:return n?d(1,g):d(0,g+1);case l:var y=this.$locale().weekStart||0,v=(m<y?m+7:m)-y;return d(n?b-v:b+(6-v),g);case s:case h:return f(_+"Hours",0);case a:return f(_+"Minutes",1);case o:return f(_+"Seconds",2);case i:return f(_+"Milliseconds",3);default:return this.clone()}},b.endOf=function(e){return this.startOf(e,!1)},b.$set=function(e,t){var r,l=T.p(e),u="set"+(this.$u?"UTC":""),d=(r={},r[s]=u+"Date",r[h]=u+"Date",r[c]=u+"Month",r[p]=u+"FullYear",r[a]=u+"Hours",r[o]=u+"Minutes",r[i]=u+"Seconds",r[n]=u+"Milliseconds",r)[l],f=l===s?this.$D+(t-this.$W):t;if(l===c||l===p){var m=this.clone().set(h,1);m.$d[d](f),m.init(),this.$d=m.set(h,Math.min(this.$D,m.daysInMonth())).$d}else d&&this.$d[d](f);return this.init(),this},b.set=function(e,t){return this.clone().$set(e,t)},b.get=function(e){return this[T.p(e)]()},b.add=function(n,u){var h,d=this;n=Number(n);var f=T.p(u),m=function(e){var t=E(d);return T.w(t.date(t.date()+Math.round(e*n)),d)};if(f===c)return this.set(c,this.$M+n);if(f===p)return this.set(p,this.$y+n);if(f===s)return m(1);if(f===l)return m(7);var g=(h={},h[o]=t,h[a]=r,h[i]=e,h)[f]||1,b=this.$d.getTime()+n*g;return T.w(b,this)},b.subtract=function(e,t){return this.add(-1*e,t)},b.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||d;var n=e||"YYYY-MM-DDTHH:mm:ssZ",i=T.z(this),o=this.$H,a=this.$m,s=this.$M,l=r.weekdays,c=r.months,u=r.meridiem,p=function(e,r,i,o){return e&&(e[r]||e(t,n))||i[r].slice(0,o)},h=function(e){return T.s(o%12||12,e,"0")},f=u||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(m,(function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return T.s(t.$y,4,"0");case"M":return s+1;case"MM":return T.s(s+1,2,"0");case"MMM":return p(r.monthsShort,s,c,3);case"MMMM":return p(c,s);case"D":return t.$D;case"DD":return T.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return p(r.weekdaysMin,t.$W,l,2);case"ddd":return p(r.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(o);case"HH":return T.s(o,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return f(o,a,!0);case"A":return f(o,a,!1);case"m":return String(a);case"mm":return T.s(a,2,"0");case"s":return String(t.$s);case"ss":return T.s(t.$s,2,"0");case"SSS":return T.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(n,h,d){var f,m=this,g=T.p(h),b=E(n),_=(b.utcOffset()-this.utcOffset())*t,y=this-b,v=function(){return T.m(m,b)};switch(g){case p:f=v()/12;break;case c:f=v();break;case u:f=v()/3;break;case l:f=(y-_)/6048e5;break;case s:f=(y-_)/864e5;break;case a:f=y/r;break;case o:f=y/t;break;case i:f=y/e;break;default:f=y}return d?f:T.a(f)},b.daysInMonth=function(){return this.endOf(c).$D},b.$locale=function(){return v[this.$L]},b.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=k(e,t,!0);return n&&(r.$L=n),r},b.clone=function(){return T.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},g}(),C=S.prototype;return E.prototype=C,[["$ms",n],["$s",i],["$m",o],["$H",a],["$W",s],["$M",c],["$y",p],["$D",h]].forEach((function(e){C[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),E.extend=function(e,t){return e.$i||(e(t,S,E),e.$i=!0),E},E.locale=k,E.isDayjs=w,E.unix=function(e){return E(1e3*e)},E.en=v[y],E.Ls=v,E.p={},E}()},function(e,t,r){"use strict";e.exports=r(432)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(265))&&n.__esModule?n:{default:n};function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw o}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var s={filter:function(e,t,r,n,a){var s=[];if(e){var l,c=o(e);try{for(c.s();!(l=c.n()).done;){var u,p=l.value,h=o(t);try{for(h.s();!(u=h.n()).done;){var d=u.value,f=i.default.resolveFieldData(p,d);if(this.filters[n](f,r,a)){s.push(p);break}}}catch(e){h.e(e)}finally{h.f()}}}catch(e){c.e(e)}finally{c.f()}}return s},filters:{startsWith:function(e,t,r){if(null==t||""===t.trim())return!0;if(null==e)return!1;var n=i.default.removeAccents(t.toString()).toLocaleLowerCase(r);return i.default.removeAccents(e.toString()).toLocaleLowerCase(r).slice(0,n.length)===n},contains:function(e,t,r){if(null==t||"string"==typeof t&&""===t.trim())return!0;if(null==e)return!1;var n=i.default.removeAccents(t.toString()).toLocaleLowerCase(r);return-1!==i.default.removeAccents(e.toString()).toLocaleLowerCase(r).indexOf(n)},notContains:function(e,t,r){if(null==t||"string"==typeof t&&""===t.trim())return!0;if(null==e)return!1;var n=i.default.removeAccents(t.toString()).toLocaleLowerCase(r);return-1===i.default.removeAccents(e.toString()).toLocaleLowerCase(r).indexOf(n)},endsWith:function(e,t,r){if(null==t||""===t.trim())return!0;if(null==e)return!1;var n=i.default.removeAccents(t.toString()).toLocaleLowerCase(r),o=i.default.removeAccents(e.toString()).toLocaleLowerCase(r);return-1!==o.indexOf(n,o.length-n.length)},equals:function(e,t,r){return null==t||"string"==typeof t&&""===t.trim()||null!=e&&(e.getTime&&t.getTime?e.getTime()===t.getTime():i.default.removeAccents(e.toString()).toLocaleLowerCase(r)==i.default.removeAccents(t.toString()).toLocaleLowerCase(r))},notEquals:function(e,t,r){return null!=t&&("string"!=typeof t||""!==t.trim())&&(null==e||(e.getTime&&t.getTime?e.getTime()!==t.getTime():i.default.removeAccents(e.toString()).toLocaleLowerCase(r)!=i.default.removeAccents(t.toString()).toLocaleLowerCase(r)))},in:function(e,t){if(null==t||0===t.length)return!0;for(var r=0;r<t.length;r++)if(i.default.equals(e,t[r]))return!0;return!1},between:function(e,t){return null==t||null==t[0]||null==t[1]||null!=e&&(e.getTime?t[0].getTime()<=e.getTime()&&e.getTime()<=t[1].getTime():t[0]<=e&&e<=t[1])},lt:function(e,t){return null==t||null!=e&&(e.getTime&&t.getTime?e.getTime()<t.getTime():e<t)},lte:function(e,t){return null==t||null!=e&&(e.getTime&&t.getTime?e.getTime()<=t.getTime():e<=t)},gt:function(e,t){return null==t||null!=e&&(e.getTime&&t.getTime?e.getTime()>t.getTime():e>t)},gte:function(e,t){return null==t||null!=e&&(e.getTime&&t.getTime?e.getTime()>=t.getTime():e>=t)},dateIs:function(e,t){return null==t||null!=e&&e.toDateString()===t.toDateString()},dateIsNot:function(e,t){return null==t||null!=e&&e.toDateString()!==t.toDateString()},dateBefore:function(e,t){return null==t||null!=e&&e.getTime()<t.getTime()},dateAfter:function(e,t){return null==t||null!=e&&e.getTime()>t.getTime()}},register:function(e,t){this.filters[e]=t}};t.default=s},function(e,t,r){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=(0,((n=r(297))&&n.__esModule?n:{default:n}).default)();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=new Map;return{on:function(t,r){var n=e.get(t);n?n.push(r):n=[r],e.set(t,n)},off:function(t,r){var n=e.get(t);n&&n.splice(n.indexOf(r)>>>0,1)},emit:function(t,r){var n=e.get(t);n&&n.slice().map((function(e){e(r)}))}}}},,,,,,,,,,,,,,,,function(e,t,r){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=new(((n=r(1))&&n.__esModule?n:{default:n}).default);t.default=i},,function(e,t,r){(function(e){e.installComponents=function(e,r){var n="function"==typeof e.exports?e.exports.extendOptions:e.options;for(var i in"function"==typeof e.exports&&(n.components=e.exports.options.components),n.components=n.components||{},r)n.components[i]=n.components[i]||r[i];n.functional&&function(e,r){if(e.exports[t])return;e.exports[t]=!0;var n=e.exports.render;e.exports.render=function(e,t){return n(e,Object.assign({},t,{_c:function(e,n,i){return t._c(r[e]||e,n,i)}}))}}(e,n.components)};var t="_functionalComponents"}).call(this,r(31))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){var n=r(352);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,r(40).default)("6f4e3760",n,!0,{sourceMap:!1})},function(e,t,r){var n=r(39)((function(e){return e[1]}));n.push([e.i,".vue-swatches__check__wrapper{height:100%;position:absolute;width:100%}.vue-swatches__check__circle{background-color:rgba(0,0,0,.15);border-radius:50%;height:21px;width:21px}.vue-swatches__check__path{fill:#fff}.vue-swatches__swatch{display:inline-block;font-size:0;position:relative}.vue-swatches__swatch:focus,.vue-swatches__swatch:hover{box-shadow:inset 0 0 2px rgba(0,0,0,.75);opacity:.9;outline:none}.vue-swatches__swatch.vue-swatches__swatch--border,.vue-swatches__swatch.vue-swatches__swatch--selected{box-shadow:inset 0 0 2px rgba(0,0,0,.75)}.vue-swatches__swatch__label{color:#666;font-size:10px;font-weight:700;left:0;position:absolute;right:0;text-align:center}.vue-swatches__swatch .vue-swatches__diagonal__wrapper{position:absolute}fieldset[disabled] .vue-swatches{pointer-events:none}.vue-swatches{display:inline-block;outline:none;position:relative}.vue-swatches__trigger__wrapper{cursor:pointer;display:inline-block}.vue-swatches__trigger.vue-swatches--is-empty{border:2px solid #ccc}.vue-swatches__trigger.vue-swatches--is-disabled{cursor:not-allowed}.vue-swatches__container{box-sizing:content-box}.vue-swatches__container.vue-swatches--inline{font-size:0}.vue-swatches__container:not(.vue-swatches--inline){border-radius:5px;box-shadow:0 2px 3px hsla(0,0%,4%,.2),0 0 0 1px hsla(0,0%,4%,.2);display:block;overflow:auto;position:absolute;z-index:50}.vue-swatches__wrapper{background-color:inherit;box-sizing:content-box}.vue-swatches__row{font-size:0}.vue-swatches__fallback__wrapper{display:table}.vue-swatches__fallback__input--wrapper{display:table-cell;font-size:14px;padding-right:10px;width:100%}.vue-swatches__fallback__input{background:#fff;border:1px solid #dcdcdc;border-radius:5px;color:#35495e;padding-bottom:6px;padding-top:6px;width:100%}.vue-swatches__fallback__button{background-color:#3571c8;border:0;border-radius:5px;color:#fff;cursor:pointer;display:table-cell;font-weight:700;padding:6px 15px}.vue-swatches-show-hide-enter-active,.vue-swatches-show-hide-leave-active{transition:all .3s ease}.vue-swatches-show-hide-enter,.vue-swatches-show-hide-leave-active{opacity:0}.vue-swatches--has-children-centered{align-items:center;display:flex;justify-content:center}.vue-swatches__diagonal__wrapper{height:100%;width:100%}.vue-swatches__diagonal{background:linear-gradient(to top right,transparent,transparent calc(50% - 2.4px),#de080a 50%,transparent calc(50% + 2.4px),transparent);height:75%;width:75%}",""]),n.locals={},e.exports=n},function(e,t,r){var n=r(354);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,r(40).default)("a167932a",n,!0,{sourceMap:!1})},function(e,t,r){var n=r(39),i=r(152),o=r(355),a=r(356),s=r(357),l=r(358),c=r(359),u=n((function(e){return e[1]})),p=i(o),h=i(o,{hash:"?#iefix"}),d=i(a),f=i(s),m=i(l),g=i(c,{hash:"?#primeicons"});u.push([e.i,'@font-face{font-display:block;font-family:"primeicons";font-style:normal;font-weight:400;src:url('+p+");src:url("+h+') format("embedded-opentype"),url('+d+') format("woff2"),url('+f+') format("woff"),url('+m+') format("truetype"),url('+g+') format("svg")}.pi{speak:none;font-feature-settings:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;font-family:"primeicons";font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.pi:before{--webkit-backface-visibility:hidden;backface-visibility:hidden}.pi-fw{text-align:center;width:1.28571429em}.pi-spin{animation:fa-spin 2s linear infinite}@keyframes fa-spin{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}.pi-eraser:before{content:"\\ea04"}.pi-stopwatch:before{content:"\\ea01"}.pi-verified:before{content:"\\ea02"}.pi-delete-left:before{content:"\\ea03"}.pi-hourglass:before{content:"\\e9fe"}.pi-truck:before{content:"\\ea00"}.pi-wrench:before{content:"\\e9ff"}.pi-microphone:before{content:"\\e9fa"}.pi-megaphone:before{content:"\\e9fb"}.pi-arrow-right-arrow-left:before{content:"\\e9fc"}.pi-bitcoin:before{content:"\\e9fd"}.pi-file-edit:before{content:"\\e9f6"}.pi-language:before{content:"\\e9f7"}.pi-file-export:before{content:"\\e9f8"}.pi-file-import:before{content:"\\e9f9"}.pi-file-word:before{content:"\\e9f1"}.pi-gift:before{content:"\\e9f2"}.pi-cart-plus:before{content:"\\e9f3"}.pi-thumbs-down-fill:before{content:"\\e9f4"}.pi-thumbs-up-fill:before{content:"\\e9f5"}.pi-arrows-alt:before{content:"\\e9f0"}.pi-calculator:before{content:"\\e9ef"}.pi-sort-alt-slash:before{content:"\\e9ee"}.pi-arrows-h:before{content:"\\e9ec"}.pi-arrows-v:before{content:"\\e9ed"}.pi-pound:before{content:"\\e9eb"}.pi-prime:before{content:"\\e9ea"}.pi-chart-pie:before{content:"\\e9e9"}.pi-reddit:before{content:"\\e9e8"}.pi-code:before{content:"\\e9e7"}.pi-sync:before{content:"\\e9e6"}.pi-shopping-bag:before{content:"\\e9e5"}.pi-server:before{content:"\\e9e4"}.pi-database:before{content:"\\e9e3"}.pi-hashtag:before{content:"\\e9e2"}.pi-bookmark-fill:before{content:"\\e9df"}.pi-filter-fill:before{content:"\\e9e0"}.pi-heart-fill:before{content:"\\e9e1"}.pi-flag-fill:before{content:"\\e9de"}.pi-circle:before{content:"\\e9dc"}.pi-circle-fill:before{content:"\\e9dd"}.pi-bolt:before{content:"\\e9db"}.pi-history:before{content:"\\e9da"}.pi-box:before{content:"\\e9d9"}.pi-at:before{content:"\\e9d8"}.pi-arrow-up-right:before{content:"\\e9d4"}.pi-arrow-up-left:before{content:"\\e9d5"}.pi-arrow-down-left:before{content:"\\e9d6"}.pi-arrow-down-right:before{content:"\\e9d7"}.pi-telegram:before{content:"\\e9d3"}.pi-stop-circle:before{content:"\\e9d2"}.pi-stop:before{content:"\\e9d1"}.pi-whatsapp:before{content:"\\e9d0"}.pi-building:before{content:"\\e9cf"}.pi-qrcode:before{content:"\\e9ce"}.pi-car:before{content:"\\e9cd"}.pi-instagram:before{content:"\\e9cc"}.pi-linkedin:before{content:"\\e9cb"}.pi-send:before{content:"\\e9ca"}.pi-slack:before{content:"\\e9c9"}.pi-sun:before{content:"\\e9c8"}.pi-moon:before{content:"\\e9c7"}.pi-vimeo:before{content:"\\e9c6"}.pi-youtube:before{content:"\\e9c5"}.pi-flag:before{content:"\\e9c4"}.pi-wallet:before{content:"\\e9c3"}.pi-map:before{content:"\\e9c2"}.pi-link:before{content:"\\e9c1"}.pi-credit-card:before{content:"\\e9bf"}.pi-discord:before{content:"\\e9c0"}.pi-percentage:before{content:"\\e9be"}.pi-euro:before{content:"\\e9bd"}.pi-book:before{content:"\\e9ba"}.pi-shield:before{content:"\\e9b9"}.pi-paypal:before{content:"\\e9bb"}.pi-amazon:before{content:"\\e9bc"}.pi-phone:before{content:"\\e9b8"}.pi-filter-slash:before{content:"\\e9b7"}.pi-facebook:before{content:"\\e9b4"}.pi-github:before{content:"\\e9b5"}.pi-twitter:before{content:"\\e9b6"}.pi-step-backward-alt:before{content:"\\e9ac"}.pi-step-forward-alt:before{content:"\\e9ad"}.pi-forward:before{content:"\\e9ae"}.pi-backward:before{content:"\\e9af"}.pi-fast-backward:before{content:"\\e9b0"}.pi-fast-forward:before{content:"\\e9b1"}.pi-pause:before{content:"\\e9b2"}.pi-play:before{content:"\\e9b3"}.pi-compass:before{content:"\\e9ab"}.pi-id-card:before{content:"\\e9aa"}.pi-ticket:before{content:"\\e9a9"}.pi-file-o:before{content:"\\e9a8"}.pi-reply:before{content:"\\e9a7"}.pi-directions-alt:before{content:"\\e9a5"}.pi-directions:before{content:"\\e9a6"}.pi-thumbs-up:before{content:"\\e9a3"}.pi-thumbs-down:before{content:"\\e9a4"}.pi-sort-numeric-down-alt:before{content:"\\e996"}.pi-sort-numeric-up-alt:before{content:"\\e997"}.pi-sort-alpha-down-alt:before{content:"\\e998"}.pi-sort-alpha-up-alt:before{content:"\\e999"}.pi-sort-numeric-down:before{content:"\\e99a"}.pi-sort-numeric-up:before{content:"\\e99b"}.pi-sort-alpha-down:before{content:"\\e99c"}.pi-sort-alpha-up:before{content:"\\e99d"}.pi-sort-alt:before{content:"\\e99e"}.pi-sort-amount-up:before{content:"\\e99f"}.pi-sort-amount-down:before{content:"\\e9a0"}.pi-sort-amount-down-alt:before{content:"\\e9a1"}.pi-sort-amount-up-alt:before{content:"\\e9a2"}.pi-palette:before{content:"\\e995"}.pi-undo:before{content:"\\e994"}.pi-desktop:before{content:"\\e993"}.pi-sliders-v:before{content:"\\e991"}.pi-sliders-h:before{content:"\\e992"}.pi-search-plus:before{content:"\\e98f"}.pi-search-minus:before{content:"\\e990"}.pi-file-excel:before{content:"\\e98e"}.pi-file-pdf:before{content:"\\e98d"}.pi-check-square:before{content:"\\e98c"}.pi-chart-line:before{content:"\\e98b"}.pi-user-edit:before{content:"\\e98a"}.pi-exclamation-circle:before{content:"\\e989"}.pi-android:before{content:"\\e985"}.pi-google:before{content:"\\e986"}.pi-apple:before{content:"\\e987"}.pi-microsoft:before{content:"\\e988"}.pi-heart:before{content:"\\e984"}.pi-mobile:before{content:"\\e982"}.pi-tablet:before{content:"\\e983"}.pi-key:before{content:"\\e981"}.pi-shopping-cart:before{content:"\\e980"}.pi-comments:before{content:"\\e97e"}.pi-comment:before{content:"\\e97f"}.pi-briefcase:before{content:"\\e97d"}.pi-bell:before{content:"\\e97c"}.pi-paperclip:before{content:"\\e97b"}.pi-share-alt:before{content:"\\e97a"}.pi-envelope:before{content:"\\e979"}.pi-volume-down:before{content:"\\e976"}.pi-volume-up:before{content:"\\e977"}.pi-volume-off:before{content:"\\e978"}.pi-eject:before{content:"\\e975"}.pi-money-bill:before{content:"\\e974"}.pi-images:before{content:"\\e973"}.pi-image:before{content:"\\e972"}.pi-sign-in:before{content:"\\e970"}.pi-sign-out:before{content:"\\e971"}.pi-wifi:before{content:"\\e96f"}.pi-sitemap:before{content:"\\e96e"}.pi-chart-bar:before{content:"\\e96d"}.pi-camera:before{content:"\\e96c"}.pi-dollar:before{content:"\\e96b"}.pi-lock-open:before{content:"\\e96a"}.pi-table:before{content:"\\e969"}.pi-map-marker:before{content:"\\e968"}.pi-list:before{content:"\\e967"}.pi-eye-slash:before{content:"\\e965"}.pi-eye:before{content:"\\e966"}.pi-folder-open:before{content:"\\e964"}.pi-folder:before{content:"\\e963"}.pi-video:before{content:"\\e962"}.pi-inbox:before{content:"\\e961"}.pi-lock:before{content:"\\e95f"}.pi-unlock:before{content:"\\e960"}.pi-tags:before{content:"\\e95d"}.pi-tag:before{content:"\\e95e"}.pi-power-off:before{content:"\\e95c"}.pi-save:before{content:"\\e95b"}.pi-question-circle:before{content:"\\e959"}.pi-question:before{content:"\\e95a"}.pi-copy:before{content:"\\e957"}.pi-file:before{content:"\\e958"}.pi-clone:before{content:"\\e955"}.pi-calendar-times:before{content:"\\e952"}.pi-calendar-minus:before{content:"\\e953"}.pi-calendar-plus:before{content:"\\e954"}.pi-ellipsis-v:before{content:"\\e950"}.pi-ellipsis-h:before{content:"\\e951"}.pi-bookmark:before{content:"\\e94e"}.pi-globe:before{content:"\\e94f"}.pi-replay:before{content:"\\e94d"}.pi-filter:before{content:"\\e94c"}.pi-print:before{content:"\\e94b"}.pi-align-right:before{content:"\\e946"}.pi-align-left:before{content:"\\e947"}.pi-align-center:before{content:"\\e948"}.pi-align-justify:before{content:"\\e949"}.pi-cog:before{content:"\\e94a"}.pi-cloud-download:before{content:"\\e943"}.pi-cloud-upload:before{content:"\\e944"}.pi-cloud:before{content:"\\e945"}.pi-pencil:before{content:"\\e942"}.pi-users:before{content:"\\e941"}.pi-clock:before{content:"\\e940"}.pi-user-minus:before{content:"\\e93e"}.pi-user-plus:before{content:"\\e93f"}.pi-trash:before{content:"\\e93d"}.pi-external-link:before{content:"\\e93c"}.pi-window-maximize:before{content:"\\e93b"}.pi-window-minimize:before{content:"\\e93a"}.pi-refresh:before{content:"\\e938"}.pi-user:before{content:"\\e939"}.pi-exclamation-triangle:before{content:"\\e922"}.pi-calendar:before{content:"\\e927"}.pi-chevron-circle-left:before{content:"\\e928"}.pi-chevron-circle-down:before{content:"\\e929"}.pi-chevron-circle-right:before{content:"\\e92a"}.pi-chevron-circle-up:before{content:"\\e92b"}.pi-angle-double-down:before{content:"\\e92c"}.pi-angle-double-left:before{content:"\\e92d"}.pi-angle-double-right:before{content:"\\e92e"}.pi-angle-double-up:before{content:"\\e92f"}.pi-angle-down:before{content:"\\e930"}.pi-angle-left:before{content:"\\e931"}.pi-angle-right:before{content:"\\e932"}.pi-angle-up:before{content:"\\e933"}.pi-upload:before{content:"\\e934"}.pi-download:before{content:"\\e956"}.pi-ban:before{content:"\\e935"}.pi-star-fill:before{content:"\\e936"}.pi-star:before{content:"\\e937"}.pi-chevron-left:before{content:"\\e900"}.pi-chevron-right:before{content:"\\e901"}.pi-chevron-down:before{content:"\\e902"}.pi-chevron-up:before{content:"\\e903"}.pi-caret-left:before{content:"\\e904"}.pi-caret-right:before{content:"\\e905"}.pi-caret-down:before{content:"\\e906"}.pi-caret-up:before{content:"\\e907"}.pi-search:before{content:"\\e908"}.pi-check:before{content:"\\e909"}.pi-check-circle:before{content:"\\e90a"}.pi-times:before{content:"\\e90b"}.pi-times-circle:before{content:"\\e90c"}.pi-plus:before{content:"\\e90d"}.pi-plus-circle:before{content:"\\e90e"}.pi-minus:before{content:"\\e90f"}.pi-minus-circle:before{content:"\\e910"}.pi-circle-on:before{content:"\\e911"}.pi-circle-off:before{content:"\\e912"}.pi-sort-down:before{content:"\\e913"}.pi-sort-up:before{content:"\\e914"}.pi-sort:before{content:"\\e915"}.pi-step-backward:before{content:"\\e916"}.pi-step-forward:before{content:"\\e917"}.pi-th-large:before{content:"\\e918"}.pi-arrow-down:before{content:"\\e919"}.pi-arrow-left:before{content:"\\e91a"}.pi-arrow-right:before{content:"\\e91b"}.pi-arrow-up:before{content:"\\e91c"}.pi-bars:before{content:"\\e91d"}.pi-arrow-circle-down:before{content:"\\e91e"}.pi-arrow-circle-left:before{content:"\\e91f"}.pi-arrow-circle-right:before{content:"\\e920"}.pi-arrow-circle-up:before{content:"\\e921"}.pi-info:before{content:"\\e923"}.pi-info-circle:before{content:"\\e924"}.pi-home:before{content:"\\e925"}.pi-spinner:before{content:"\\e926"}',""]),u.locals={},e.exports=u},function(e,t,r){e.exports=r.p+"fonts/primeicons.c08d00c.eot"},function(e,t,r){e.exports=r.p+"fonts/primeicons.c0929a1.woff2"},function(e,t,r){e.exports=r.p+"fonts/primeicons.0620709.woff"},function(e,t,r){e.exports=r.p+"fonts/primeicons.acb1929.ttf"},function(e,t,r){e.exports=r.p+"img/primeicons.1d854e3.svg"},function(e,t,r){var n=r(361);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,r(40).default)("62b55f39",n,!0,{sourceMap:!1})},function(e,t,r){var n=r(39),i=r(152),o=r(362),a=r(363),s=n((function(e){return e[1]})),l=i(o),c=i(a);s.push([e.i,".p-component,.p-component *{box-sizing:border-box}.p-hidden{display:none}.p-hidden-space{visibility:hidden}.p-hidden-accessible{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.p-hidden-accessible input,.p-hidden-accessible select{transform:scale(0)}.p-reset{border:0;font-size:100%;list-style:none;margin:0;outline:0;padding:0;-webkit-text-decoration:none;text-decoration:none}.p-disabled,.p-disabled *{cursor:default!important;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.p-component-overlay{height:100%;left:0;position:fixed;top:0;width:100%}.p-overflow-hidden{overflow:hidden}.p-unselectable-text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.p-scrollbar-measure{height:100px;overflow:scroll;position:absolute;top:-9999px;width:100px}@keyframes p-fadein{0%{opacity:0}to{opacity:1}}button,input[type=button],input[type=file]::-webkit-file-upload-button,input[type=reset],input[type=submit]{border-radius:0}.p-link{background-color:transparent;border:0;cursor:pointer;margin:0;padding:0;text-align:left;-webkit-user-select:none;-moz-user-select:none;user-select:none}.p-link:disabled{cursor:default}.p-connected-overlay{opacity:0;transform:scaleY(.8);transition:transform .12s cubic-bezier(0,0,.2,1),opacity .12s cubic-bezier(0,0,.2,1)}.p-connected-overlay-visible{opacity:1;transform:scaleY(1)}.p-connected-overlay-hidden{opacity:0;transform:scaleY(1);transition:opacity .1s linear}.p-connected-overlay-enter{opacity:0;transform:scaleY(.8)}.p-connected-overlay-leave-to{opacity:0}.p-connected-overlay-enter-active{transition:transform .12s cubic-bezier(0,0,.2,1),opacity .12s cubic-bezier(0,0,.2,1)}.p-connected-overlay-leave-active{transition:opacity .1s linear}.p-toggleable-content-enter,.p-toggleable-content-leave-to{max-height:0}.p-toggleable-content-enter-to,.p-toggleable-content-leave{max-height:1000px}.p-toggleable-content-leave-active{overflow:hidden;transition:max-height .45s cubic-bezier(0,1,0,1)}.p-toggleable-content-enter-active{overflow:hidden;transition:max-height 1s ease-in-out}.p-sr-only{word-wrap:normal!important;clip:rect(1px,1px,1px,1px);border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.p-badge{border-radius:10px;display:inline-block;padding:0 .5rem;text-align:center}.p-overlay-badge{position:relative}.p-overlay-badge .p-badge{margin:0;position:absolute;right:0;top:0;transform:translate(50%,-50%);transform-origin:100% 0}.p-badge-dot{height:.5rem;min-width:.5rem;width:.5rem}.p-badge-dot,.p-badge-no-gutter{border-radius:50%;padding:0}.p-button{align-items:center;cursor:pointer;display:inline-flex;margin:0;overflow:hidden;position:relative;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:bottom}.p-button-label{flex:1 1 auto}.p-button-icon-right{order:1}.p-button:disabled{cursor:default}.p-button-icon-only{justify-content:center}.p-button-icon-only .p-button-label{flex:0 0 auto;visibility:hidden;width:0}.p-button-vertical{flex-direction:column}.p-button-icon-bottom{order:2}.p-buttonset .p-button{margin:0}.p-buttonset .p-button:not(:last-child){border-right:0}.p-buttonset .p-button:not(:first-of-type):not(:last-of-type){border-radius:0}.p-buttonset .p-button:first-of-type{border-bottom-right-radius:0;border-top-right-radius:0}.p-buttonset .p-button:last-of-type{border-bottom-left-radius:0;border-top-left-radius:0}.p-buttonset .p-button:focus{position:relative;z-index:1}.p-checkbox{cursor:pointer;display:inline-flex;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:bottom}.p-checkbox-box{align-items:center;display:flex;justify-content:center}.p-colorpicker-panel .p-colorpicker-color{background:transparent url("+l+") no-repeat 0 0}.p-colorpicker-panel .p-colorpicker-hue{background:transparent url("+c+") no-repeat 0 0}.p-inputtext{margin:0}.p-fluid .p-inputtext{width:100%}.p-inputgroup{align-items:stretch;display:flex;width:100%}.p-inputgroup-addon{align-items:center;display:flex;justify-content:center}.p-inputgroup .p-float-label{align-items:stretch;display:flex;width:100%}.p-fluid .p-inputgroup .p-input,.p-fluid .p-inputgroup .p-inputtext,.p-inputgroup .p-inputtext,.p-inputgroup .p-inputwrapper{flex:1 1 auto;width:1%}.p-float-label{display:block;position:relative}.p-float-label label{line-height:1;margin-top:-.5rem;pointer-events:none;position:absolute;top:50%;transition-property:all;transition-timing-function:ease}.p-float-label textarea~label{top:1rem}.p-float-label .p-inputwrapper-filled~label,.p-float-label .p-inputwrapper-focus~label,.p-float-label input.p-filled~label,.p-float-label input:focus~label,.p-float-label textarea.p-filled~label,.p-float-label textarea:focus~label{font-size:12px;top:-.75rem}.p-float-label .input:-webkit-autofill~label{font-size:12px;top:-20px}.p-input-icon-left,.p-input-icon-right{display:inline-block;position:relative}.p-input-icon-left>i,.p-input-icon-right>i{margin-top:-.5rem;position:absolute;top:50%}.p-fluid .p-input-icon-left,.p-fluid .p-input-icon-right{display:block;width:100%}.p-radiobutton{cursor:pointer;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:bottom}.p-radiobutton-box{align-items:center;display:flex;justify-content:center}.p-radiobutton-icon{backface-visibility:hidden;border-radius:50%;transform:translateZ(0) scale(.1);visibility:hidden}.p-radiobutton-box.p-highlight .p-radiobutton-icon{transform:translateZ(0) scale(1);visibility:visible}.p-ripple{overflow:hidden;position:relative}.p-ink{background:hsla(0,0%,100%,.5);border-radius:100%;display:block;pointer-events:none;position:absolute;transform:scale(0)}.p-ink-active{animation:ripple .4s linear}.p-ripple-disabled .p-ink{display:none!important}@keyframes ripple{to{opacity:0;transform:scale(2.5)}}.p-tooltip{display:none;max-width:12.5rem;padding:.25em .5rem;position:absolute}.p-tooltip.p-tooltip-left,.p-tooltip.p-tooltip-right{padding:0 .25rem}.p-tooltip.p-tooltip-bottom,.p-tooltip.p-tooltip-top{padding:.25em 0}.p-tooltip .p-tooltip-text{white-space:pre-line;word-break:break-word}.p-tooltip-arrow{border-color:transparent;border-style:solid;height:0;position:absolute;width:0}.p-tooltip-right .p-tooltip-arrow{border-width:.25em .25em .25em 0;left:0;margin-top:-.25rem;top:50%}.p-tooltip-left .p-tooltip-arrow{border-width:.25em 0 .25em .25rem;margin-top:-.25rem;right:0;top:50%}.p-tooltip.p-tooltip-top{padding:.25em 0}.p-tooltip-top .p-tooltip-arrow{border-width:.25em .25em 0;bottom:0;left:50%;margin-left:-.25rem}.p-tooltip-bottom .p-tooltip-arrow{border-width:0 .25em .25rem;left:50%;margin-left:-.25rem;top:0}",""]),s.locals={},e.exports=s},function(e,t,r){e.exports=r.p+"img/color.c7a3380.png"},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAACWCAIAAAC3uvTNAAAA7ElEQVRYw+2YUQqDQAxEh9GWuqV6Be9/JT88RN0VRUuv0ElBwhKY3yF5m90kLKd+mF/975r6geNyjm9Fy0kgqTJ6nqoIdGKczjmPJU5tZxA8wWPL7YOHKhZAlcmTAVVcxSCrMbfgqY/H6JEOoASPe56tgSrqLR7U2zWojwWjJ3jq47HEiZoGTwJxP1RRXw8y9RZfCMhbhTHOVTxXnUFtPJ5rGjzu35y2KfKGQxWT2K4TQL1d2zz6KAH1kRU8wfOXx+37qY3Hct+aDaqot2u7R/wMuDS3qnj0z0HqK4X/+kRNHdfUwFP2Nisqe/sFuUZiVjC9HCUAAAAASUVORK5CYII="},function(e,t,r){var n=r(365);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,r(40).default)("01d7d1f6",n,!0,{sourceMap:!1})},function(e,t,r){var n=r(39)((function(e){return e[1]}));n.push([e.i,'.CodeMirror{color:#000;direction:ltr;font-family:monospace;height:300px}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{background-color:#f7f7f7;border-right:1px solid #ddd;white-space:nowrap}.CodeMirror-linenumber{color:#999;min-width:20px;padding:0 3px 0 5px;text-align:right;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{background:#7e7;border:0!important;width:auto}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{animation:blink 1.06s steps(1) infinite;background-color:rgba(20,255,20,.5)}.cm-animate-fat-cursor{animation:blink 1.06s steps(1) infinite;background-color:#7e7;border:0;width:auto}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:-50px}.CodeMirror-ruler{border-left:1px solid #ccc;bottom:0;position:absolute;top:0}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{-webkit-text-decoration:underline;text-decoration:underline}.cm-strikethrough{-webkit-text-decoration:line-through;text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{background:#fff;overflow:hidden;position:relative}.CodeMirror-scroll{height:100%;margin-bottom:-50px;margin-right:-50px;outline:none;overflow:scroll!important;padding-bottom:50px;position:relative}.CodeMirror-sizer{border-right:50px solid transparent;position:relative}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{display:none;position:absolute;z-index:6}.CodeMirror-vscrollbar{overflow-x:hidden;overflow-y:scroll;right:0;top:0}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-x:scroll;overflow-y:hidden}.CodeMirror-scrollbar-filler{bottom:0;right:0}.CodeMirror-gutter-filler{bottom:0;left:0}.CodeMirror-gutters{left:0;min-height:100%;position:absolute;top:0;z-index:3}.CodeMirror-gutter{display:inline-block;height:100%;margin-bottom:-50px;vertical-align:top;white-space:normal}.CodeMirror-gutter-wrapper{background:none!important;border:none!important;position:absolute;z-index:4}.CodeMirror-gutter-background{bottom:0;position:absolute;top:0;z-index:4}.CodeMirror-gutter-elt{cursor:default;position:absolute;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{word-wrap:normal;-webkit-tap-highlight-color:transparent;font-feature-settings:"calt";background:transparent;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;font-variant-ligatures:contextual;line-height:inherit;margin:0;overflow:visible;position:relative;white-space:pre;z-index:2}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{bottom:0;left:0;position:absolute;right:0;top:0;z-index:0}.CodeMirror-linewidget{padding:.1px;position:relative;z-index:2}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{box-sizing:content-box}.CodeMirror-measure{height:0;overflow:hidden;position:absolute;visibility:hidden;width:100%}.CodeMirror-cursor{pointer-events:none;position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{position:relative;visibility:hidden;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.v-md-container{background:#fff;border:1px solid #ddd}.v-md-container>.v-md-toolbar{background:#f5f5f5;border-bottom:1px solid #ddd;padding:8px 5px}.v-md-wrapper{position:relative}.v-md-preview{background:#fff;bottom:0;color:#333;height:auto!important;left:0;overflow:auto;padding:5px;position:absolute;right:0;top:0;z-index:999}.v-md-fullscreen{bottom:0;height:100%!important;left:0;overflow:hidden;position:fixed;right:0;top:0;width:100%;z-index:99999}.v-md-fullscreen .v-md-preview{position:fixed!important;top:52px}.v-md-auto-resize .CodeMirror{height:auto!important}.v-md-auto-resize .CodeMirror-scroll{height:auto;min-height:250px;outline:none;overflow:auto;overflow:visible;position:relative}.v-md-wrapper .CodeMirror-fullscreen{bottom:0;height:auto!important;left:0;position:fixed!important;right:0;top:52px;z-index:9}',""]),n.locals={},e.exports=n},,,,,function(e,t,r){var n=r(371);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,r(40).default)("44b53712",n,!0,{sourceMap:!1})},function(e,t,r){var n=r(39)((function(e){return e[1]}));n.push([e.i,':root{--surface-a:#fff;--surface-b:#f8f9fa;--surface-c:#e9ecef;--surface-d:#dee2e6;--surface-e:#fff;--surface-f:#fff;--text-color:#495057;--text-color-secondary:#6c757d;--primary-color:#3b82f6;--primary-color-text:#fff;--font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;--surface-0:#fff;--surface-50:#fafafa;--surface-100:#f5f5f5;--surface-200:#eee;--surface-300:#e0e0e0;--surface-400:#bdbdbd;--surface-500:#9e9e9e;--surface-600:#757575;--surface-700:#616161;--surface-800:#424242;--surface-900:#212121;--gray-50:#fafafa;--gray-100:#f5f5f5;--gray-200:#eee;--gray-300:#e0e0e0;--gray-400:#bdbdbd;--gray-500:#9e9e9e;--gray-600:#757575;--gray-700:#616161;--gray-800:#424242;--gray-900:#212121;--content-padding:1.25rem;--inline-spacing:0.5rem;--border-radius:6px;--surface-ground:#eff3f8;--surface-section:#fff;--surface-card:#fff;--surface-overlay:#fff;--surface-border:#dfe7ef;--surface-hover:#f6f9fc;--focus-ring:0 0 0 0.2rem #bfdbfe;--maskbg:rgba(0,0,0,.4)}*{box-sizing:border-box}.p-component{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400}.p-component-overlay{background-color:rgba(0,0,0,.4);transition-duration:.2s}.p-component:disabled,.p-disabled{opacity:.6}.p-error{color:#e24c4c}.p-text-secondary{color:#6c757d}.p-link,.pi{font-size:1rem}.p-link{border-radius:6px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}.p-link:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-component-overlay-enter{animation:p-component-overlay-enter-animation .15s forwards}.p-component-overlay-leave{animation:p-component-overlay-leave-animation .15s forwards}@keyframes p-component-overlay-enter-animation{0%{background-color:transparent}to{background-color:rgba(0,0,0,.4);background-color:var(--maskbg)}}@keyframes p-component-overlay-leave-animation{0%{background-color:rgba(0,0,0,.4);background-color:var(--maskbg)}to{background-color:transparent}}:root{--blue-50:#f5f9ff;--blue-100:#d0e1fd;--blue-200:#abc9fb;--blue-300:#85b2f9;--blue-400:#609af8;--blue-500:#3b82f6;--blue-600:#326fd1;--blue-700:#295bac;--blue-800:#204887;--blue-900:#183462;--green-50:#f4fcf7;--green-100:#caf1d8;--green-200:#a0e6ba;--green-300:#76db9b;--green-400:#4cd07d;--green-500:#22c55e;--green-600:#1da750;--green-700:#188a42;--green-800:#136c34;--green-900:#0e4f26;--yellow-50:#fefbf3;--yellow-100:#faedc4;--yellow-200:#f6de95;--yellow-300:#f2d066;--yellow-400:#eec137;--yellow-500:#eab308;--yellow-600:#c79807;--yellow-700:#a47d06;--yellow-800:#816204;--yellow-900:#5e4803;--cyan-50:#f3fbfd;--cyan-100:#c3edf5;--cyan-200:#94e0ed;--cyan-300:#65d2e4;--cyan-400:#35c4dc;--cyan-500:#06b6d4;--cyan-600:#059bb4;--cyan-700:#047f94;--cyan-800:#036475;--cyan-900:#024955;--pink-50:#fef6fa;--pink-100:#fad3e7;--pink-200:#f7b0d3;--pink-300:#f38ec0;--pink-400:#f06bac;--pink-500:#ec4899;--pink-600:#c93d82;--pink-700:#a5326b;--pink-800:#822854;--pink-900:#5e1d3d;--indigo-50:#f7f7fe;--indigo-100:#dadafc;--indigo-200:#bcbdf9;--indigo-300:#9ea0f6;--indigo-400:#8183f4;--indigo-500:#6366f1;--indigo-600:#5457cd;--indigo-700:#4547a9;--indigo-800:#363885;--indigo-900:#282960;--teal-50:#f3fbfb;--teal-100:#c7eeea;--teal-200:#9ae0d9;--teal-300:#6dd3c8;--teal-400:#41c5b7;--teal-500:#14b8a6;--teal-600:#119c8d;--teal-700:#0e8174;--teal-800:#0b655b;--teal-900:#084a42;--orange-50:#fff8f3;--orange-100:#feddc7;--orange-200:#fcc39b;--orange-300:#fba86f;--orange-400:#fa8e42;--orange-500:#f97316;--orange-600:#d46213;--orange-700:#ae510f;--orange-800:#893f0c;--orange-900:#642e09;--bluegray-50:#f7f8f9;--bluegray-100:#dadee3;--bluegray-200:#bcc3cd;--bluegray-300:#9fa9b7;--bluegray-400:#818ea1;--bluegray-500:#64748b;--bluegray-600:#556376;--bluegray-700:#465161;--bluegray-800:#37404c;--bluegray-900:#282e38;--purple-50:#fbf7ff;--purple-100:#ead6fd;--purple-200:#dab6fc;--purple-300:#c996fa;--purple-400:#b975f9;--purple-500:#a855f7;--purple-600:#8f48d2;--purple-700:#763cad;--purple-800:#5c2f88;--purple-900:#432263;--red-50:#fff5f5;--red-100:#ffd0ce;--red-200:#ffaca7;--red-300:#ff8780;--red-400:#ff6259;--red-500:#ff3d32;--red-600:#d9342b;--red-700:#b32b23;--red-800:#8c221c;--red-900:#661814}.p-autocomplete .p-autocomplete-loader{right:.75rem}.p-autocomplete.p-autocomplete-dd .p-autocomplete-loader{right:3.75rem}.p-autocomplete .p-autocomplete-multiple-container{padding:.375rem .75rem}.p-autocomplete .p-autocomplete-multiple-container:not(.p-disabled):hover{border-color:#3b82f6}.p-autocomplete .p-autocomplete-multiple-container:not(.p-disabled).p-focus{border-color:#3b82f6;box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-autocomplete .p-autocomplete-multiple-container .p-autocomplete-input-token{padding:.375rem 0}.p-autocomplete .p-autocomplete-multiple-container .p-autocomplete-input-token input{color:#495057;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;margin:0;padding:0}.p-autocomplete .p-autocomplete-multiple-container .p-autocomplete-token{background:#dee2e6;border-radius:16px;color:#495057;margin-right:.5rem;padding:.375rem .75rem}.p-autocomplete .p-autocomplete-multiple-container .p-autocomplete-token .p-autocomplete-token-icon{margin-left:.5rem}.p-autocomplete.p-invalid.p-component>.p-inputtext{border-color:#e24c4c}.p-autocomplete-panel{background:#fff;border:0;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);color:#495057}.p-autocomplete-panel .p-autocomplete-items{padding:.75rem 0}.p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item{background:transparent;border:0;border-radius:0;color:#495057;margin:0;padding:.75rem 1.25rem;transition:box-shadow .2s}.p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item:hover{background:#e9ecef;color:#495057}.p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item.p-highlight{background:#eff6ff;color:#1d4ed8}.p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item-group{background:#fff;color:#343a40;font-weight:700;margin:0;padding:.75rem 1.25rem}.p-calendar.p-invalid.p-component>.p-inputtext{border-color:#e24c4c}.p-datepicker{background:#fff;border:1px solid #ced4da;border-radius:6px;color:#495057;padding:.5rem}.p-datepicker:not(.p-datepicker-inline){background:#fff;border:0;box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.p-datepicker:not(.p-datepicker-inline) .p-datepicker-header{background:#fff}.p-datepicker .p-datepicker-header{background:#fff;border-bottom:1px solid #dee2e6;border-top-left-radius:6px;border-top-right-radius:6px;color:#495057;font-weight:600;margin:0;padding:.5rem}.p-datepicker .p-datepicker-header .p-datepicker-next,.p-datepicker .p-datepicker-header .p-datepicker-prev{background:transparent;border:0;border-radius:50%;color:#6c757d;height:2rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-datepicker .p-datepicker-header .p-datepicker-next:enabled:hover,.p-datepicker .p-datepicker-header .p-datepicker-prev:enabled:hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-datepicker .p-datepicker-header .p-datepicker-next:focus,.p-datepicker .p-datepicker-header .p-datepicker-prev:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-datepicker .p-datepicker-header .p-datepicker-title{line-height:2rem}.p-datepicker .p-datepicker-header .p-datepicker-title .p-datepicker-month,.p-datepicker .p-datepicker-header .p-datepicker-title .p-datepicker-year{color:#495057;font-weight:600;padding:.5rem;transition:background-color .2s,color .2s,box-shadow .2s}.p-datepicker .p-datepicker-header .p-datepicker-title .p-datepicker-month:enabled:hover,.p-datepicker .p-datepicker-header .p-datepicker-title .p-datepicker-year:enabled:hover{color:#3b82f6}.p-datepicker .p-datepicker-header .p-datepicker-title .p-datepicker-month{margin-right:.5rem}.p-datepicker table{font-size:1rem;margin:.5rem 0}.p-datepicker table th{padding:.5rem}.p-datepicker table th>span{height:2.5rem;width:2.5rem}.p-datepicker table td{padding:.5rem}.p-datepicker table td>span{border:1px solid transparent;border-radius:50%;height:2.5rem;transition:box-shadow .2s;width:2.5rem}.p-datepicker table td>span.p-highlight{background:#eff6ff;color:#1d4ed8}.p-datepicker table td>span:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-datepicker table td.p-datepicker-today>span{background:#ced4da;border-color:transparent;color:#495057}.p-datepicker table td.p-datepicker-today>span.p-highlight{background:#eff6ff;color:#1d4ed8}.p-datepicker .p-datepicker-buttonbar{border-top:1px solid #dee2e6;padding:1rem 0}.p-datepicker .p-datepicker-buttonbar .p-button{width:auto}.p-datepicker .p-timepicker{border-top:1px solid #dee2e6;padding:.5rem}.p-datepicker .p-timepicker button{background:transparent;border:0;border-radius:50%;color:#6c757d;height:2rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-datepicker .p-timepicker button:enabled:hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-datepicker .p-timepicker button:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-datepicker .p-timepicker button:last-child{margin-top:.2em}.p-datepicker .p-timepicker span{font-size:1.25rem}.p-datepicker .p-timepicker>div{padding:0 .5rem}.p-datepicker.p-datepicker-timeonly .p-timepicker{border-top:0}.p-datepicker .p-monthpicker{margin:.5rem 0}.p-datepicker .p-monthpicker .p-monthpicker-month{border-radius:6px;padding:.5rem;transition:box-shadow .2s}.p-datepicker .p-monthpicker .p-monthpicker-month.p-highlight{background:#eff6ff;color:#1d4ed8}.p-datepicker .p-yearpicker{margin:.5rem 0}.p-datepicker .p-yearpicker .p-yearpicker-year{border-radius:6px;padding:.5rem;transition:box-shadow .2s}.p-datepicker .p-yearpicker .p-yearpicker-year.p-highlight{background:#eff6ff;color:#1d4ed8}.p-datepicker.p-datepicker-multiple-month .p-datepicker-group{border-left:1px solid #dee2e6;padding:0 .5rem}.p-datepicker.p-datepicker-multiple-month .p-datepicker-group:first-child{border-left:0;padding-left:0}.p-datepicker.p-datepicker-multiple-month .p-datepicker-group:last-child{padding-right:0}.p-datepicker:not(.p-disabled) table td span:not(.p-highlight):not(.p-disabled):hover{background:#e9ecef}.p-datepicker:not(.p-disabled) table td span:not(.p-highlight):not(.p-disabled):focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-datepicker:not(.p-disabled) .p-monthpicker .p-monthpicker-month:not(.p-disabled):not(.p-highlight):hover{background:#e9ecef}.p-datepicker:not(.p-disabled) .p-monthpicker .p-monthpicker-month:not(.p-disabled):focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-datepicker:not(.p-disabled) .p-yearpicker .p-yearpicker-year:not(.p-disabled):not(.p-highlight):hover{background:#e9ecef}.p-datepicker:not(.p-disabled) .p-yearpicker .p-yearpicker-year:not(.p-disabled):focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}@media screen and (max-width:769px){.p-datepicker table td,.p-datepicker table th{padding:0}}.p-cascadeselect{background:#fff;border:1px solid #ced4da;border-radius:6px;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.p-cascadeselect:not(.p-disabled):hover{border-color:#3b82f6}.p-cascadeselect:not(.p-disabled).p-focus{border-color:#3b82f6;box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-cascadeselect .p-cascadeselect-label{background:transparent;border:0;padding:.75rem}.p-cascadeselect .p-cascadeselect-label.p-placeholder{color:#6c757d}.p-cascadeselect .p-cascadeselect-label:enabled:focus{box-shadow:none;outline:0 none}.p-cascadeselect .p-cascadeselect-trigger{background:transparent;border-bottom-right-radius:6px;border-top-right-radius:6px;color:#6c757d;width:3rem}.p-cascadeselect.p-invalid.p-component{border-color:#e24c4c}.p-cascadeselect-panel{background:#fff;border:0;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);color:#495057}.p-cascadeselect-panel .p-cascadeselect-items{padding:.75rem 0}.p-cascadeselect-panel .p-cascadeselect-items .p-cascadeselect-item{background:transparent;border:0;border-radius:0;color:#495057;margin:0;transition:box-shadow .2s}.p-cascadeselect-panel .p-cascadeselect-items .p-cascadeselect-item .p-cascadeselect-item-content{padding:.75rem 1.25rem}.p-cascadeselect-panel .p-cascadeselect-items .p-cascadeselect-item .p-cascadeselect-item-content:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-cascadeselect-panel .p-cascadeselect-items .p-cascadeselect-item.p-highlight{background:#eff6ff;color:#1d4ed8}.p-cascadeselect-panel .p-cascadeselect-items .p-cascadeselect-item:not(.p-highlight):not(.p-disabled):hover{background:#e9ecef;color:#495057}.p-cascadeselect-panel .p-cascadeselect-items .p-cascadeselect-item .p-cascadeselect-group-icon{font-size:.875rem}.p-input-filled .p-cascadeselect{background:#e9ecef}.p-input-filled .p-cascadeselect:not(.p-disabled):hover{background-color:#e9ecef}.p-input-filled .p-cascadeselect:not(.p-disabled).p-focus{background-color:#fff}.p-checkbox{height:22px;width:22px}.p-checkbox .p-checkbox-box{background:#fff;border:2px solid #ced4da;border-radius:6px;color:#495057;height:22px;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s;width:22px}.p-checkbox .p-checkbox-box .p-checkbox-icon{color:#fff;font-size:14px;transition-duration:.2s}.p-checkbox .p-checkbox-box.p-highlight{background:#3b82f6;border-color:#3b82f6}.p-checkbox:not(.p-checkbox-disabled) .p-checkbox-box:hover{border-color:#3b82f6}.p-checkbox:not(.p-checkbox-disabled) .p-checkbox-box.p-focus{border-color:#3b82f6;box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-checkbox:not(.p-checkbox-disabled) .p-checkbox-box.p-highlight:hover{background:#1d4ed8;border-color:#1d4ed8;color:#fff}.p-checkbox.p-invalid>.p-checkbox-box{border-color:#e24c4c}.p-input-filled .p-checkbox .p-checkbox-box{background-color:#e9ecef}.p-input-filled .p-checkbox .p-checkbox-box.p-highlight{background:#3b82f6}.p-input-filled .p-checkbox:not(.p-checkbox-disabled) .p-checkbox-box:hover{background-color:#e9ecef}.p-input-filled .p-checkbox:not(.p-checkbox-disabled) .p-checkbox-box.p-highlight:hover{background:#1d4ed8}.p-chips .p-chips-multiple-container{padding:.375rem .75rem}.p-chips .p-chips-multiple-container:not(.p-disabled):hover{border-color:#3b82f6}.p-chips .p-chips-multiple-container:not(.p-disabled).p-focus{border-color:#3b82f6;box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-chips .p-chips-multiple-container .p-chips-token{background:#dee2e6;border-radius:16px;color:#495057;margin-right:.5rem;padding:.375rem .75rem}.p-chips .p-chips-multiple-container .p-chips-token .p-chips-token-icon{margin-left:.5rem}.p-chips .p-chips-multiple-container .p-chips-input-token{padding:.375rem 0}.p-chips .p-chips-multiple-container .p-chips-input-token input{color:#495057;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;margin:0;padding:0}.p-chips.p-invalid.p-component>.p-inputtext{border-color:#e24c4c}.p-colorpicker-preview{height:2rem;width:2rem}.p-colorpicker-panel{background:#323232;border:1px solid #191919}.p-colorpicker-panel .p-colorpicker-color-handle,.p-colorpicker-panel .p-colorpicker-hue-handle{border-color:#fff}.p-colorpicker-overlay-panel{box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.p-dropdown{background:#fff;border:1px solid #ced4da;border-radius:6px;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.p-dropdown:not(.p-disabled):hover{border-color:#3b82f6}.p-dropdown:not(.p-disabled).p-focus{border-color:#3b82f6;box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-dropdown.p-dropdown-clearable .p-dropdown-label{padding-right:1.75rem}.p-dropdown .p-dropdown-label{background:transparent;border:0}.p-dropdown .p-dropdown-label.p-placeholder{color:#6c757d}.p-dropdown .p-dropdown-label:enabled:focus{box-shadow:none;outline:0 none}.p-dropdown .p-dropdown-trigger{background:transparent;border-bottom-right-radius:6px;border-top-right-radius:6px;color:#6c757d;width:3rem}.p-dropdown .p-dropdown-clear-icon{color:#6c757d;right:3rem}.p-dropdown.p-invalid.p-component{border-color:#e24c4c}.p-dropdown-panel{background:#fff;border:0;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);color:#495057}.p-dropdown-panel .p-dropdown-header{background:#f8f9fa;border-bottom:1px solid #dee2e6;border-top-left-radius:6px;border-top-right-radius:6px;color:#343a40;margin:0;padding:.75rem 1.25rem}.p-dropdown-panel .p-dropdown-header .p-dropdown-filter{margin-right:-1.75rem;padding-right:1.75rem}.p-dropdown-panel .p-dropdown-header .p-dropdown-filter-icon{color:#6c757d;right:.75rem}.p-dropdown-panel .p-dropdown-items{padding:.75rem 0}.p-dropdown-panel .p-dropdown-items .p-dropdown-item{background:transparent;border:0;border-radius:0;color:#495057;margin:0;padding:.75rem 1.25rem;transition:box-shadow .2s}.p-dropdown-panel .p-dropdown-items .p-dropdown-item.p-highlight{background:#eff6ff;color:#1d4ed8}.p-dropdown-panel .p-dropdown-items .p-dropdown-item:not(.p-highlight):not(.p-disabled):hover{background:#e9ecef;color:#495057}.p-dropdown-panel .p-dropdown-items .p-dropdown-item-group{background:#fff;color:#343a40;font-weight:700;margin:0;padding:.75rem 1.25rem}.p-dropdown-panel .p-dropdown-items .p-dropdown-empty-message{background:transparent;color:#495057;padding:.75rem 1.25rem}.p-input-filled .p-dropdown{background:#e9ecef}.p-input-filled .p-dropdown:not(.p-disabled):hover{background-color:#e9ecef}.p-input-filled .p-dropdown:not(.p-disabled).p-focus{background-color:#fff}.p-input-filled .p-dropdown:not(.p-disabled).p-focus .p-inputtext{background-color:transparent}.p-editor-container .p-editor-toolbar{background:#f8f9fa;border-top-left-radius:6px;border-top-right-radius:6px}.p-editor-container .p-editor-toolbar.ql-snow{border:1px solid #dee2e6}.p-editor-container .p-editor-toolbar.ql-snow .ql-stroke{stroke:#6c757d}.p-editor-container .p-editor-toolbar.ql-snow .ql-fill{fill:#6c757d}.p-editor-container .p-editor-toolbar.ql-snow .ql-picker .ql-picker-label{border:0;color:#6c757d}.p-editor-container .p-editor-toolbar.ql-snow .ql-picker .ql-picker-label:hover{color:#495057}.p-editor-container .p-editor-toolbar.ql-snow .ql-picker .ql-picker-label:hover .ql-stroke{stroke:#495057}.p-editor-container .p-editor-toolbar.ql-snow .ql-picker .ql-picker-label:hover .ql-fill{fill:#495057}.p-editor-container .p-editor-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label{color:#495057}.p-editor-container .p-editor-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#495057}.p-editor-container .p-editor-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#495057}.p-editor-container .p-editor-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options{background:#fff;border:0;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);padding:.75rem 0}.p-editor-container .p-editor-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options .ql-picker-item{color:#495057}.p-editor-container .p-editor-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options .ql-picker-item:hover{background:#e9ecef;color:#495057}.p-editor-container .p-editor-toolbar.ql-snow .ql-picker.ql-expanded:not(.ql-icon-picker) .ql-picker-item{padding:.75rem 1.25rem}.p-editor-container .p-editor-content{border-bottom-left-radius:6px;border-bottom-right-radius:6px}.p-editor-container .p-editor-content.ql-snow{border:1px solid #dee2e6}.p-editor-container .p-editor-content .ql-editor{background:#fff;border-bottom-left-radius:6px;border-bottom-right-radius:6px;color:#495057}.p-editor-container .ql-snow.ql-toolbar button:focus,.p-editor-container .ql-snow.ql-toolbar button:hover{color:#495057}.p-editor-container .ql-snow.ql-toolbar button:focus .ql-stroke,.p-editor-container .ql-snow.ql-toolbar button:hover .ql-stroke{stroke:#495057}.p-editor-container .ql-snow.ql-toolbar button:focus .ql-fill,.p-editor-container .ql-snow.ql-toolbar button:hover .ql-fill{fill:#495057}.p-editor-container .ql-snow.ql-toolbar .ql-picker-item.ql-selected,.p-editor-container .ql-snow.ql-toolbar .ql-picker-label.ql-active,.p-editor-container .ql-snow.ql-toolbar button.ql-active{color:#3b82f6}.p-editor-container .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.p-editor-container .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.p-editor-container .ql-snow.ql-toolbar button.ql-active .ql-stroke{stroke:#3b82f6}.p-editor-container .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.p-editor-container .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,.p-editor-container .ql-snow.ql-toolbar button.ql-active .ql-fill{fill:#3b82f6}.p-editor-container .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-picker-label,.p-editor-container .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-picker-label,.p-editor-container .ql-snow.ql-toolbar button.ql-active .ql-picker-label{color:#3b82f6}.p-inputgroup-addon{background:#e9ecef;border-bottom:1px solid #ced4da;border-left:1px solid #ced4da;border-top:1px solid #ced4da;color:#6c757d;min-width:3rem;padding:.75rem}.p-inputgroup-addon:last-child{border-right:1px solid #ced4da}.p-inputgroup>.p-component,.p-inputgroup>.p-float-label>.p-component,.p-inputgroup>.p-inputwrapper>.p-inputtext{border-radius:0;margin:0}.p-inputgroup>.p-component+.p-inputgroup-addon,.p-inputgroup>.p-float-label>.p-component+.p-inputgroup-addon,.p-inputgroup>.p-inputwrapper>.p-inputtext+.p-inputgroup-addon{border-left:0}.p-inputgroup>.p-component:focus,.p-inputgroup>.p-component:focus~label,.p-inputgroup>.p-float-label>.p-component:focus,.p-inputgroup>.p-float-label>.p-component:focus~label,.p-inputgroup>.p-inputwrapper>.p-inputtext:focus,.p-inputgroup>.p-inputwrapper>.p-inputtext:focus~label{z-index:1}.p-inputgroup .p-float-label:first-child input,.p-inputgroup button:first-child,.p-inputgroup input:first-child,.p-inputgroup-addon:first-child,.p-inputgroup>.p-inputwrapper:first-child,.p-inputgroup>.p-inputwrapper:first-child>.p-inputtext{border-bottom-left-radius:6px;border-top-left-radius:6px}.p-inputgroup .p-float-label:last-child input,.p-inputgroup button:last-child,.p-inputgroup input:last-child,.p-inputgroup-addon:last-child,.p-inputgroup>.p-inputwrapper:last-child,.p-inputgroup>.p-inputwrapper:last-child>.p-inputtext{border-bottom-right-radius:6px;border-top-right-radius:6px}.p-fluid .p-inputgroup .p-button{width:auto}.p-fluid .p-inputgroup .p-button.p-button-icon-only{width:3rem}.p-inputnumber.p-invalid.p-component>.p-inputtext{border-color:#e24c4c}.p-inputswitch{height:1.75rem;width:3rem}.p-inputswitch .p-inputswitch-slider{background:#ced4da;border-radius:30px;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.p-inputswitch .p-inputswitch-slider:before{background:#fff;border-radius:50%;height:1.25rem;left:.25rem;margin-top:-.625rem;transition-duration:.2s;width:1.25rem}.p-inputswitch.p-inputswitch-checked .p-inputswitch-slider:before{transform:translateX(1.25rem)}.p-inputswitch.p-focus .p-inputswitch-slider{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-inputswitch:not(.p-disabled):hover .p-inputswitch-slider{background:#b6bfc8}.p-inputswitch.p-inputswitch-checked .p-inputswitch-slider{background:#3b82f6}.p-inputswitch.p-inputswitch-checked .p-inputswitch-slider:before{background:#fff}.p-inputswitch.p-inputswitch-checked:not(.p-disabled):hover .p-inputswitch-slider{background:#2563eb}.p-inputswitch.p-invalid{border-color:#e24c4c}.p-inputtext{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;border:1px solid #ced4da;border-radius:6px;color:#495057;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;padding:.75rem;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.p-inputtext:enabled:hover{border-color:#3b82f6}.p-inputtext:enabled:focus{border-color:#3b82f6;box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-inputtext.p-invalid.p-component{border-color:#e24c4c}.p-inputtext.p-inputtext-sm{font-size:.875rem;padding:.65625rem}.p-inputtext.p-inputtext-lg{font-size:1.25rem;padding:.9375rem}.p-float-label>label{transition-duration:.2s}.p-float-label>label,.p-input-icon-left>i:first-of-type{color:#6c757d;left:.75rem}.p-input-icon-left>.p-inputtext{padding-left:2.5rem}.p-input-icon-left.p-float-label>label{left:2.5rem}.p-input-icon-right>i:last-of-type{color:#6c757d;right:.75rem}.p-input-icon-right>.p-inputtext{padding-right:2.5rem}::-webkit-input-placeholder{color:#6c757d}:-moz-placeholder,::-moz-placeholder{color:#6c757d}:-ms-input-placeholder{color:#6c757d}.p-input-filled .p-inputtext,.p-input-filled .p-inputtext:enabled:hover{background-color:#e9ecef}.p-input-filled .p-inputtext:enabled:focus{background-color:#fff}.p-inputtext-sm .p-inputtext{font-size:.875rem;padding:.65625rem}.p-inputtext-lg .p-inputtext{font-size:1.25rem;padding:.9375rem}.p-listbox{background:#fff;border:1px solid #ced4da;border-radius:6px;color:#495057}.p-listbox .p-listbox-header{background:#f8f9fa;border-bottom:1px solid #dee2e6;border-top-left-radius:6px;border-top-right-radius:6px;color:#343a40;margin:0;padding:.75rem 1.25rem}.p-listbox .p-listbox-header .p-listbox-filter{padding-right:1.75rem}.p-listbox .p-listbox-header .p-listbox-filter-icon{color:#6c757d;right:.75rem}.p-listbox .p-listbox-list{padding:.75rem 0}.p-listbox .p-listbox-list .p-listbox-item{border:0;border-radius:0;color:#495057;margin:0;padding:.75rem 1.25rem;transition:box-shadow .2s}.p-listbox .p-listbox-list .p-listbox-item.p-highlight{background:#eff6ff;color:#1d4ed8}.p-listbox .p-listbox-list .p-listbox-item:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-listbox .p-listbox-list .p-listbox-item-group{background:#fff;color:#343a40;font-weight:700;margin:0;padding:.75rem 1.25rem}.p-listbox .p-listbox-list .p-listbox-empty-message{background:transparent;color:#495057;padding:.75rem 1.25rem}.p-listbox:not(.p-disabled) .p-listbox-item:not(.p-highlight):not(.p-disabled):hover{background:#e9ecef;color:#495057}.p-listbox.p-invalid{border-color:#e24c4c}.p-multiselect{background:#fff;border:1px solid #ced4da;border-radius:6px;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.p-multiselect:not(.p-disabled):hover{border-color:#3b82f6}.p-multiselect:not(.p-disabled).p-focus{border-color:#3b82f6;box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-multiselect .p-multiselect-label{padding:.75rem;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.p-multiselect .p-multiselect-label.p-placeholder{color:#6c757d}.p-multiselect.p-multiselect-chip .p-multiselect-token{background:#dee2e6;border-radius:16px;color:#495057;margin-right:.5rem;padding:.375rem .75rem}.p-multiselect.p-multiselect-chip .p-multiselect-token .p-multiselect-token-icon{margin-left:.5rem}.p-multiselect .p-multiselect-trigger{background:transparent;border-bottom-right-radius:6px;border-top-right-radius:6px;color:#6c757d;width:3rem}.p-multiselect.p-invalid.p-component{border-color:#e24c4c}.p-inputwrapper-filled.p-multiselect.p-multiselect-chip .p-multiselect-label{padding:.375rem .75rem}.p-multiselect-panel{background:#fff;border:0;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);color:#495057}.p-multiselect-panel .p-multiselect-header{background:#f8f9fa;border-bottom:1px solid #dee2e6;border-top-left-radius:6px;border-top-right-radius:6px;color:#343a40;margin:0;padding:.75rem 1.25rem}.p-multiselect-panel .p-multiselect-header .p-multiselect-filter-container .p-inputtext{padding-right:1.75rem}.p-multiselect-panel .p-multiselect-header .p-multiselect-filter-container .p-multiselect-filter-icon{color:#6c757d;right:.75rem}.p-multiselect-panel .p-multiselect-header .p-checkbox{margin-right:.5rem}.p-multiselect-panel .p-multiselect-header .p-multiselect-close{background:transparent;border:0;border-radius:50%;color:#6c757d;height:2rem;margin-left:.5rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-multiselect-panel .p-multiselect-header .p-multiselect-close:enabled:hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-multiselect-panel .p-multiselect-header .p-multiselect-close:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-multiselect-panel .p-multiselect-items{padding:.75rem 0}.p-multiselect-panel .p-multiselect-items .p-multiselect-item{background:transparent;border:0;border-radius:0;color:#495057;margin:0;padding:.75rem 1.25rem;transition:box-shadow .2s}.p-multiselect-panel .p-multiselect-items .p-multiselect-item.p-highlight{background:#eff6ff;color:#1d4ed8}.p-multiselect-panel .p-multiselect-items .p-multiselect-item:not(.p-highlight):not(.p-disabled):hover{background:#e9ecef;color:#495057}.p-multiselect-panel .p-multiselect-items .p-multiselect-item:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-multiselect-panel .p-multiselect-items .p-multiselect-item .p-checkbox{margin-right:.5rem}.p-multiselect-panel .p-multiselect-items .p-multiselect-item-group{background:#fff;color:#343a40;font-weight:700;margin:0;padding:.75rem 1.25rem}.p-multiselect-panel .p-multiselect-items .p-multiselect-empty-message{background:transparent;color:#495057;padding:.75rem 1.25rem}.p-input-filled .p-multiselect{background:#e9ecef}.p-input-filled .p-multiselect:not(.p-disabled):hover{background-color:#e9ecef}.p-input-filled .p-multiselect:not(.p-disabled).p-focus{background-color:#fff}.p-password.p-invalid.p-component>.p-inputtext{border-color:#e24c4c}.p-password-panel{background:#fff;border:0;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);color:#495057;padding:1.25rem}.p-password-panel .p-password-meter{background:#dee2e6;margin-bottom:.5rem}.p-password-panel .p-password-meter .p-password-strength.weak{background:#ea5455}.p-password-panel .p-password-meter .p-password-strength.medium{background:#ff9f42}.p-password-panel .p-password-meter .p-password-strength.strong{background:#29c76f}.p-radiobutton{height:22px;width:22px}.p-radiobutton .p-radiobutton-box{background:#fff;border:2px solid #ced4da;border-radius:50%;color:#495057;height:22px;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s;width:22px}.p-radiobutton .p-radiobutton-box:not(.p-disabled):not(.p-highlight):hover{border-color:#3b82f6}.p-radiobutton .p-radiobutton-box:not(.p-disabled).p-focus{border-color:#3b82f6;box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-radiobutton .p-radiobutton-box .p-radiobutton-icon{background-color:#fff;height:12px;transition-duration:.2s;width:12px}.p-radiobutton .p-radiobutton-box.p-highlight{background:#3b82f6;border-color:#3b82f6}.p-radiobutton .p-radiobutton-box.p-highlight:not(.p-disabled):hover{background:#1d4ed8;border-color:#1d4ed8;color:#fff}.p-radiobutton.p-invalid>.p-radiobutton-box{border-color:#e24c4c}.p-radiobutton:focus{outline:0 none}.p-input-filled .p-radiobutton .p-radiobutton-box,.p-input-filled .p-radiobutton .p-radiobutton-box:not(.p-disabled):hover{background-color:#e9ecef}.p-input-filled .p-radiobutton .p-radiobutton-box.p-highlight{background:#3b82f6}.p-input-filled .p-radiobutton .p-radiobutton-box.p-highlight:not(.p-disabled):hover{background:#1d4ed8}.p-rating .p-rating-icon{color:#495057;font-size:1.143rem;margin-left:.5rem;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.p-rating .p-rating-icon.p-rating-cancel{color:#ea5455}.p-rating .p-rating-icon:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-rating .p-rating-icon:first-child{margin-left:0}.p-rating .p-rating-icon.pi-star-fill,.p-rating:not(.p-disabled):not(.p-readonly) .p-rating-icon:hover{color:#3b82f6}.p-rating:not(.p-disabled):not(.p-readonly) .p-rating-icon.p-rating-cancel:hover{color:#e73d3e}.p-selectbutton .p-button{background:#fff;border:1px solid #ced4da;color:#495057;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.p-selectbutton .p-button .p-button-icon-left,.p-selectbutton .p-button .p-button-icon-right{color:#6c757d}.p-selectbutton .p-button:not(.p-disabled):not(.p-highlight):hover{background:#e9ecef;border-color:#ced4da;color:#495057}.p-selectbutton .p-button:not(.p-disabled):not(.p-highlight):hover .p-button-icon-left,.p-selectbutton .p-button:not(.p-disabled):not(.p-highlight):hover .p-button-icon-right{color:#343a40}.p-selectbutton .p-button.p-highlight{background:#3b82f6;border-color:#3b82f6;color:#fff}.p-selectbutton .p-button.p-highlight .p-button-icon-left,.p-selectbutton .p-button.p-highlight .p-button-icon-right{color:#fff}.p-selectbutton .p-button.p-highlight:hover{background:#2563eb;border-color:#2563eb;color:#fff}.p-selectbutton .p-button.p-highlight:hover .p-button-icon-left,.p-selectbutton .p-button.p-highlight:hover .p-button-icon-right{color:#fff}.p-selectbutton.p-invalid>.p-button{border-color:#e24c4c}.p-slider{background:#dee2e6;border:0;border-radius:6px}.p-slider.p-slider-horizontal{height:.286rem}.p-slider.p-slider-horizontal .p-slider-handle{margin-left:-.5715rem;margin-top:-.5715rem}.p-slider.p-slider-vertical{width:.286rem}.p-slider.p-slider-vertical .p-slider-handle{margin-bottom:-.5715rem;margin-left:-.5715rem}.p-slider .p-slider-handle{background:#fff;border:2px solid #3b82f6;border-radius:50%;height:1.143rem;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s;width:1.143rem}.p-slider .p-slider-handle:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-slider .p-slider-range{background:#3b82f6}.p-slider:not(.p-disabled) .p-slider-handle:hover{background:#3b82f6;border-color:#3b82f6}.p-treeselect{background:#fff;border:1px solid #ced4da;border-radius:6px;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.p-treeselect:not(.p-disabled):hover{border-color:#3b82f6}.p-treeselect:not(.p-disabled).p-focus{border-color:#3b82f6;box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-treeselect .p-treeselect-label{padding:.75rem;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.p-treeselect .p-treeselect-label.p-placeholder{color:#6c757d}.p-treeselect.p-treeselect-chip .p-treeselect-token{background:#dee2e6;border-radius:16px;color:#495057;margin-right:.5rem;padding:.375rem .75rem}.p-treeselect .p-treeselect-trigger{background:transparent;border-bottom-right-radius:6px;border-top-right-radius:6px;color:#6c757d;width:3rem}.p-treeselect.p-invalid.p-component{border-color:#e24c4c}.p-inputwrapper-filled.p-treeselect.p-treeselect-chip .p-treeselect-label{padding:.375rem .75rem}.p-treeselect-panel{background:#fff;border:0;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);color:#495057}.p-treeselect-panel .p-treeselect-items-wrapper .p-tree{border:0}.p-treeselect-panel .p-treeselect-items-wrapper .p-treeselect-empty-message{background:transparent;color:#495057;padding:.75rem 1.25rem}.p-input-filled .p-treeselect{background:#e9ecef}.p-input-filled .p-treeselect:not(.p-disabled):hover{background-color:#e9ecef}.p-input-filled .p-treeselect:not(.p-disabled).p-focus{background-color:#fff}.p-togglebutton.p-button{background:#fff;border:1px solid #ced4da;color:#495057;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.p-togglebutton.p-button .p-button-icon-left,.p-togglebutton.p-button .p-button-icon-right{color:#6c757d}.p-togglebutton.p-button:not(.p-disabled):not(.p-highlight):hover{background:#e9ecef;border-color:#ced4da;color:#495057}.p-togglebutton.p-button:not(.p-disabled):not(.p-highlight):hover .p-button-icon-left,.p-togglebutton.p-button:not(.p-disabled):not(.p-highlight):hover .p-button-icon-right{color:#343a40}.p-togglebutton.p-button.p-highlight{background:#3b82f6;border-color:#3b82f6;color:#fff}.p-togglebutton.p-button.p-highlight .p-button-icon-left,.p-togglebutton.p-button.p-highlight .p-button-icon-right{color:#fff}.p-togglebutton.p-button.p-highlight:hover{background:#2563eb;border-color:#2563eb;color:#fff}.p-togglebutton.p-button.p-highlight:hover .p-button-icon-left,.p-togglebutton.p-button.p-highlight:hover .p-button-icon-right{color:#fff}.p-togglebutton.p-button.p-invalid>.p-button{border-color:#e24c4c}.p-button{background:#3b82f6;border:1px solid #3b82f6;border-radius:6px;color:#fff;font-size:1rem;padding:.75rem 1.25rem;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.p-button:enabled:hover{background:#2563eb;border-color:#2563eb;color:#fff}.p-button:enabled:active{background:#1d4ed8;border-color:#1d4ed8;color:#fff}.p-button.p-button-outlined{background-color:transparent;border:1px solid;color:#3b82f6}.p-button.p-button-outlined:enabled:hover{background:rgba(59,130,246,.04);border:1px solid;color:#3b82f6}.p-button.p-button-outlined:enabled:active{background:rgba(59,130,246,.16);border:1px solid;color:#3b82f6}.p-button.p-button-outlined.p-button-plain{border-color:#6c757d;color:#6c757d}.p-button.p-button-outlined.p-button-plain:enabled:hover{background:#e9ecef;color:#6c757d}.p-button.p-button-outlined.p-button-plain:enabled:active{background:#dee2e6;color:#6c757d}.p-button.p-button-text{background-color:transparent;border-color:transparent;color:#3b82f6}.p-button.p-button-text:enabled:hover{background:rgba(59,130,246,.04);border-color:transparent;color:#3b82f6}.p-button.p-button-text:enabled:active{background:rgba(59,130,246,.16);border-color:transparent;color:#3b82f6}.p-button.p-button-text.p-button-plain{color:#6c757d}.p-button.p-button-text.p-button-plain:enabled:hover{background:#e9ecef;color:#6c757d}.p-button.p-button-text.p-button-plain:enabled:active{background:#dee2e6;color:#6c757d}.p-button:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-button .p-button-icon-left{margin-right:.5rem}.p-button .p-button-icon-right{margin-left:.5rem}.p-button .p-button-icon-bottom{margin-top:.5rem}.p-button .p-button-icon-top{margin-bottom:.5rem}.p-button .p-badge{background-color:#fff;color:#3b82f6;height:1rem;line-height:1rem;margin-left:.5rem;min-width:1rem}.p-button.p-button-raised{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.p-button.p-button-rounded{border-radius:2rem}.p-button.p-button-icon-only{padding:.75rem 0;width:3rem}.p-button.p-button-icon-only .p-button-icon-left,.p-button.p-button-icon-only .p-button-icon-right{margin:0}.p-button.p-button-icon-only.p-button-rounded{border-radius:50%;height:3rem}.p-button.p-button-sm{font-size:.875rem;padding:.65625rem 1.09375rem}.p-button.p-button-sm .p-button-icon{font-size:.875rem}.p-button.p-button-lg{font-size:1.25rem;padding:.9375rem 1.5625rem}.p-button.p-button-lg .p-button-icon{font-size:1.25rem}.p-button.p-button-loading-label-only .p-button-label{margin-left:.5rem}.p-button.p-button-loading-label-only .p-button-loading-icon{margin-right:0}.p-fluid .p-button{width:100%}.p-fluid .p-button-icon-only{width:3rem}.p-fluid .p-buttonset{display:flex}.p-fluid .p-buttonset .p-button{flex:1}.p-button.p-button-secondary,.p-buttonset.p-button-secondary>.p-button,.p-splitbutton.p-button-secondary>.p-button{background:#64748b;border:1px solid #64748b;color:#fff}.p-button.p-button-secondary:enabled:hover,.p-buttonset.p-button-secondary>.p-button:enabled:hover,.p-splitbutton.p-button-secondary>.p-button:enabled:hover{background:#475569;border-color:#475569;color:#fff}.p-button.p-button-secondary:enabled:focus,.p-buttonset.p-button-secondary>.p-button:enabled:focus,.p-splitbutton.p-button-secondary>.p-button:enabled:focus{box-shadow:0 0 0 .2rem #e2e8f0}.p-button.p-button-secondary:enabled:active,.p-buttonset.p-button-secondary>.p-button:enabled:active,.p-splitbutton.p-button-secondary>.p-button:enabled:active{background:#334155;border-color:#334155;color:#fff}.p-button.p-button-secondary.p-button-outlined,.p-buttonset.p-button-secondary>.p-button.p-button-outlined,.p-splitbutton.p-button-secondary>.p-button.p-button-outlined{background-color:transparent;border:1px solid;color:#64748b}.p-button.p-button-secondary.p-button-outlined:enabled:hover,.p-buttonset.p-button-secondary>.p-button.p-button-outlined:enabled:hover,.p-splitbutton.p-button-secondary>.p-button.p-button-outlined:enabled:hover{background:rgba(100,116,139,.04);border:1px solid;color:#64748b}.p-button.p-button-secondary.p-button-outlined:enabled:active,.p-buttonset.p-button-secondary>.p-button.p-button-outlined:enabled:active,.p-splitbutton.p-button-secondary>.p-button.p-button-outlined:enabled:active{background:rgba(100,116,139,.16);border:1px solid;color:#64748b}.p-button.p-button-secondary.p-button-text,.p-buttonset.p-button-secondary>.p-button.p-button-text,.p-splitbutton.p-button-secondary>.p-button.p-button-text{background-color:transparent;border-color:transparent;color:#64748b}.p-button.p-button-secondary.p-button-text:enabled:hover,.p-buttonset.p-button-secondary>.p-button.p-button-text:enabled:hover,.p-splitbutton.p-button-secondary>.p-button.p-button-text:enabled:hover{background:rgba(100,116,139,.04);border-color:transparent;color:#64748b}.p-button.p-button-secondary.p-button-text:enabled:active,.p-buttonset.p-button-secondary>.p-button.p-button-text:enabled:active,.p-splitbutton.p-button-secondary>.p-button.p-button-text:enabled:active{background:rgba(100,116,139,.16);border-color:transparent;color:#64748b}.p-button.p-button-info,.p-buttonset.p-button-info>.p-button,.p-splitbutton.p-button-info>.p-button{background:#3b82f6;border:1px solid #3b82f6;color:#fff}.p-button.p-button-info:enabled:hover,.p-buttonset.p-button-info>.p-button:enabled:hover,.p-splitbutton.p-button-info>.p-button:enabled:hover{background:#2563eb;border-color:#2563eb;color:#fff}.p-button.p-button-info:enabled:focus,.p-buttonset.p-button-info>.p-button:enabled:focus,.p-splitbutton.p-button-info>.p-button:enabled:focus{box-shadow:0 0 0 .2rem #bfdbfe}.p-button.p-button-info:enabled:active,.p-buttonset.p-button-info>.p-button:enabled:active,.p-splitbutton.p-button-info>.p-button:enabled:active{background:#1d4ed8;border-color:#1d4ed8;color:#fff}.p-button.p-button-info.p-button-outlined,.p-buttonset.p-button-info>.p-button.p-button-outlined,.p-splitbutton.p-button-info>.p-button.p-button-outlined{background-color:transparent;border:1px solid;color:#3b82f6}.p-button.p-button-info.p-button-outlined:enabled:hover,.p-buttonset.p-button-info>.p-button.p-button-outlined:enabled:hover,.p-splitbutton.p-button-info>.p-button.p-button-outlined:enabled:hover{background:rgba(59,130,246,.04);border:1px solid;color:#3b82f6}.p-button.p-button-info.p-button-outlined:enabled:active,.p-buttonset.p-button-info>.p-button.p-button-outlined:enabled:active,.p-splitbutton.p-button-info>.p-button.p-button-outlined:enabled:active{background:rgba(59,130,246,.16);border:1px solid;color:#3b82f6}.p-button.p-button-info.p-button-text,.p-buttonset.p-button-info>.p-button.p-button-text,.p-splitbutton.p-button-info>.p-button.p-button-text{background-color:transparent;border-color:transparent;color:#3b82f6}.p-button.p-button-info.p-button-text:enabled:hover,.p-buttonset.p-button-info>.p-button.p-button-text:enabled:hover,.p-splitbutton.p-button-info>.p-button.p-button-text:enabled:hover{background:rgba(59,130,246,.04);border-color:transparent;color:#3b82f6}.p-button.p-button-info.p-button-text:enabled:active,.p-buttonset.p-button-info>.p-button.p-button-text:enabled:active,.p-splitbutton.p-button-info>.p-button.p-button-text:enabled:active{background:rgba(59,130,246,.16);border-color:transparent;color:#3b82f6}.p-button.p-button-success,.p-buttonset.p-button-success>.p-button,.p-splitbutton.p-button-success>.p-button{background:#22c55e;border:1px solid #22c55e;color:#fff}.p-button.p-button-success:enabled:hover,.p-buttonset.p-button-success>.p-button:enabled:hover,.p-splitbutton.p-button-success>.p-button:enabled:hover{background:#16a34a;border-color:#16a34a;color:#fff}.p-button.p-button-success:enabled:focus,.p-buttonset.p-button-success>.p-button:enabled:focus,.p-splitbutton.p-button-success>.p-button:enabled:focus{box-shadow:0 0 0 .2rem #bbf7d0}.p-button.p-button-success:enabled:active,.p-buttonset.p-button-success>.p-button:enabled:active,.p-splitbutton.p-button-success>.p-button:enabled:active{background:#15803d;border-color:#15803d;color:#fff}.p-button.p-button-success.p-button-outlined,.p-buttonset.p-button-success>.p-button.p-button-outlined,.p-splitbutton.p-button-success>.p-button.p-button-outlined{background-color:transparent;border:1px solid;color:#22c55e}.p-button.p-button-success.p-button-outlined:enabled:hover,.p-buttonset.p-button-success>.p-button.p-button-outlined:enabled:hover,.p-splitbutton.p-button-success>.p-button.p-button-outlined:enabled:hover{background:rgba(34,197,94,.04);border:1px solid;color:#22c55e}.p-button.p-button-success.p-button-outlined:enabled:active,.p-buttonset.p-button-success>.p-button.p-button-outlined:enabled:active,.p-splitbutton.p-button-success>.p-button.p-button-outlined:enabled:active{background:rgba(34,197,94,.16);border:1px solid;color:#22c55e}.p-button.p-button-success.p-button-text,.p-buttonset.p-button-success>.p-button.p-button-text,.p-splitbutton.p-button-success>.p-button.p-button-text{background-color:transparent;border-color:transparent;color:#22c55e}.p-button.p-button-success.p-button-text:enabled:hover,.p-buttonset.p-button-success>.p-button.p-button-text:enabled:hover,.p-splitbutton.p-button-success>.p-button.p-button-text:enabled:hover{background:rgba(34,197,94,.04);border-color:transparent;color:#22c55e}.p-button.p-button-success.p-button-text:enabled:active,.p-buttonset.p-button-success>.p-button.p-button-text:enabled:active,.p-splitbutton.p-button-success>.p-button.p-button-text:enabled:active{background:rgba(34,197,94,.16);border-color:transparent;color:#22c55e}.p-button.p-button-warning,.p-buttonset.p-button-warning>.p-button,.p-splitbutton.p-button-warning>.p-button{background:#f59e0b;border:1px solid #f59e0b;color:#fff}.p-button.p-button-warning:enabled:hover,.p-buttonset.p-button-warning>.p-button:enabled:hover,.p-splitbutton.p-button-warning>.p-button:enabled:hover{background:#d97706;border-color:#d97706;color:#fff}.p-button.p-button-warning:enabled:focus,.p-buttonset.p-button-warning>.p-button:enabled:focus,.p-splitbutton.p-button-warning>.p-button:enabled:focus{box-shadow:0 0 0 .2rem #fde68a}.p-button.p-button-warning:enabled:active,.p-buttonset.p-button-warning>.p-button:enabled:active,.p-splitbutton.p-button-warning>.p-button:enabled:active{background:#b45309;border-color:#b45309;color:#fff}.p-button.p-button-warning.p-button-outlined,.p-buttonset.p-button-warning>.p-button.p-button-outlined,.p-splitbutton.p-button-warning>.p-button.p-button-outlined{background-color:transparent;border:1px solid;color:#f59e0b}.p-button.p-button-warning.p-button-outlined:enabled:hover,.p-buttonset.p-button-warning>.p-button.p-button-outlined:enabled:hover,.p-splitbutton.p-button-warning>.p-button.p-button-outlined:enabled:hover{background:rgba(245,158,11,.04);border:1px solid;color:#f59e0b}.p-button.p-button-warning.p-button-outlined:enabled:active,.p-buttonset.p-button-warning>.p-button.p-button-outlined:enabled:active,.p-splitbutton.p-button-warning>.p-button.p-button-outlined:enabled:active{background:rgba(245,158,11,.16);border:1px solid;color:#f59e0b}.p-button.p-button-warning.p-button-text,.p-buttonset.p-button-warning>.p-button.p-button-text,.p-splitbutton.p-button-warning>.p-button.p-button-text{background-color:transparent;border-color:transparent;color:#f59e0b}.p-button.p-button-warning.p-button-text:enabled:hover,.p-buttonset.p-button-warning>.p-button.p-button-text:enabled:hover,.p-splitbutton.p-button-warning>.p-button.p-button-text:enabled:hover{background:rgba(245,158,11,.04);border-color:transparent;color:#f59e0b}.p-button.p-button-warning.p-button-text:enabled:active,.p-buttonset.p-button-warning>.p-button.p-button-text:enabled:active,.p-splitbutton.p-button-warning>.p-button.p-button-text:enabled:active{background:rgba(245,158,11,.16);border-color:transparent;color:#f59e0b}.p-button.p-button-help,.p-buttonset.p-button-help>.p-button,.p-splitbutton.p-button-help>.p-button{background:#a855f7;border:1px solid #a855f7;color:#fff}.p-button.p-button-help:enabled:hover,.p-buttonset.p-button-help>.p-button:enabled:hover,.p-splitbutton.p-button-help>.p-button:enabled:hover{background:#9333ea;border-color:#9333ea;color:#fff}.p-button.p-button-help:enabled:focus,.p-buttonset.p-button-help>.p-button:enabled:focus,.p-splitbutton.p-button-help>.p-button:enabled:focus{box-shadow:0 0 0 .2rem #e9d5ff}.p-button.p-button-help:enabled:active,.p-buttonset.p-button-help>.p-button:enabled:active,.p-splitbutton.p-button-help>.p-button:enabled:active{background:#7e22ce;border-color:#7e22ce;color:#fff}.p-button.p-button-help.p-button-outlined,.p-buttonset.p-button-help>.p-button.p-button-outlined,.p-splitbutton.p-button-help>.p-button.p-button-outlined{background-color:transparent;border:1px solid;color:#a855f7}.p-button.p-button-help.p-button-outlined:enabled:hover,.p-buttonset.p-button-help>.p-button.p-button-outlined:enabled:hover,.p-splitbutton.p-button-help>.p-button.p-button-outlined:enabled:hover{background:rgba(168,85,247,.04);border:1px solid;color:#a855f7}.p-button.p-button-help.p-button-outlined:enabled:active,.p-buttonset.p-button-help>.p-button.p-button-outlined:enabled:active,.p-splitbutton.p-button-help>.p-button.p-button-outlined:enabled:active{background:rgba(168,85,247,.16);border:1px solid;color:#a855f7}.p-button.p-button-help.p-button-text,.p-buttonset.p-button-help>.p-button.p-button-text,.p-splitbutton.p-button-help>.p-button.p-button-text{background-color:transparent;border-color:transparent;color:#a855f7}.p-button.p-button-help.p-button-text:enabled:hover,.p-buttonset.p-button-help>.p-button.p-button-text:enabled:hover,.p-splitbutton.p-button-help>.p-button.p-button-text:enabled:hover{background:rgba(168,85,247,.04);border-color:transparent;color:#a855f7}.p-button.p-button-help.p-button-text:enabled:active,.p-buttonset.p-button-help>.p-button.p-button-text:enabled:active,.p-splitbutton.p-button-help>.p-button.p-button-text:enabled:active{background:rgba(168,85,247,.16);border-color:transparent;color:#a855f7}.p-button.p-button-danger,.p-buttonset.p-button-danger>.p-button,.p-splitbutton.p-button-danger>.p-button{background:#ef4444;border:1px solid #ef4444;color:#fff}.p-button.p-button-danger:enabled:hover,.p-buttonset.p-button-danger>.p-button:enabled:hover,.p-splitbutton.p-button-danger>.p-button:enabled:hover{background:#dc2626;border-color:#dc2626;color:#fff}.p-button.p-button-danger:enabled:focus,.p-buttonset.p-button-danger>.p-button:enabled:focus,.p-splitbutton.p-button-danger>.p-button:enabled:focus{box-shadow:0 0 0 .2rem #fecaca}.p-button.p-button-danger:enabled:active,.p-buttonset.p-button-danger>.p-button:enabled:active,.p-splitbutton.p-button-danger>.p-button:enabled:active{background:#b91c1c;border-color:#b91c1c;color:#fff}.p-button.p-button-danger.p-button-outlined,.p-buttonset.p-button-danger>.p-button.p-button-outlined,.p-splitbutton.p-button-danger>.p-button.p-button-outlined{background-color:transparent;border:1px solid;color:#ef4444}.p-button.p-button-danger.p-button-outlined:enabled:hover,.p-buttonset.p-button-danger>.p-button.p-button-outlined:enabled:hover,.p-splitbutton.p-button-danger>.p-button.p-button-outlined:enabled:hover{background:rgba(239,68,68,.04);border:1px solid;color:#ef4444}.p-button.p-button-danger.p-button-outlined:enabled:active,.p-buttonset.p-button-danger>.p-button.p-button-outlined:enabled:active,.p-splitbutton.p-button-danger>.p-button.p-button-outlined:enabled:active{background:rgba(239,68,68,.16);border:1px solid;color:#ef4444}.p-button.p-button-danger.p-button-text,.p-buttonset.p-button-danger>.p-button.p-button-text,.p-splitbutton.p-button-danger>.p-button.p-button-text{background-color:transparent;border-color:transparent;color:#ef4444}.p-button.p-button-danger.p-button-text:enabled:hover,.p-buttonset.p-button-danger>.p-button.p-button-text:enabled:hover,.p-splitbutton.p-button-danger>.p-button.p-button-text:enabled:hover{background:rgba(239,68,68,.04);border-color:transparent;color:#ef4444}.p-button.p-button-danger.p-button-text:enabled:active,.p-buttonset.p-button-danger>.p-button.p-button-text:enabled:active,.p-splitbutton.p-button-danger>.p-button.p-button-text:enabled:active{background:rgba(239,68,68,.16);border-color:transparent;color:#ef4444}.p-button.p-button-link{background:transparent;border:transparent;color:#1d4ed8}.p-button.p-button-link:enabled:hover{background:transparent;border-color:transparent;color:#1d4ed8}.p-button.p-button-link:enabled:hover .p-button-label{-webkit-text-decoration:underline;text-decoration:underline}.p-button.p-button-link:enabled:focus{background:transparent;border-color:transparent;box-shadow:0 0 0 .2rem #bfdbfe}.p-button.p-button-link:enabled:active{background:transparent;border-color:transparent;color:#1d4ed8}.p-speeddial-button.p-button.p-button-icon-only{height:4rem;width:4rem}.p-speeddial-button.p-button.p-button-icon-only .p-button-icon{font-size:1.3rem}.p-speeddial-action{background:#495057;color:#fff;height:3rem;width:3rem}.p-speeddial-action:hover{background:#022354;color:#fff}.p-speeddial-direction-up .p-speeddial-item{margin:.25rem 0}.p-speeddial-direction-up .p-speeddial-item:first-child{margin-bottom:.5rem}.p-speeddial-direction-down .p-speeddial-item{margin:.25rem 0}.p-speeddial-direction-down .p-speeddial-item:first-child{margin-top:.5rem}.p-speeddial-direction-left .p-speeddial-item{margin:0 .25rem}.p-speeddial-direction-left .p-speeddial-item:first-child{margin-right:.5rem}.p-speeddial-direction-right .p-speeddial-item{margin:0 .25rem}.p-speeddial-direction-right .p-speeddial-item:first-child{margin-left:.5rem}.p-speeddial-circle .p-speeddial-item,.p-speeddial-circle .p-speeddial-item:first-child,.p-speeddial-circle .p-speeddial-item:last-child,.p-speeddial-quarter-circle .p-speeddial-item,.p-speeddial-quarter-circle .p-speeddial-item:first-child,.p-speeddial-quarter-circle .p-speeddial-item:last-child,.p-speeddial-semi-circle .p-speeddial-item,.p-speeddial-semi-circle .p-speeddial-item:first-child,.p-speeddial-semi-circle .p-speeddial-item:last-child{margin:0}.p-speeddial-mask{background-color:rgba(0,0,0,.4)}.p-splitbutton{border-radius:6px}.p-splitbutton.p-button-outlined>.p-button{background-color:transparent;border:1px solid;color:#3b82f6}.p-splitbutton.p-button-outlined>.p-button:enabled:hover,.p-splitbutton.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(59,130,246,.04);color:#3b82f6}.p-splitbutton.p-button-outlined>.p-button:enabled:active,.p-splitbutton.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(59,130,246,.16);color:#3b82f6}.p-splitbutton.p-button-outlined.p-button-plain>.p-button{border-color:#6c757d;color:#6c757d}.p-splitbutton.p-button-outlined.p-button-plain>.p-button:enabled:hover,.p-splitbutton.p-button-outlined.p-button-plain>.p-button:not(button):not(a):not(.p-disabled):hover{background:#e9ecef;color:#6c757d}.p-splitbutton.p-button-outlined.p-button-plain>.p-button:enabled:active,.p-splitbutton.p-button-outlined.p-button-plain>.p-button:not(button):not(a):not(.p-disabled):active{background:#dee2e6;color:#6c757d}.p-splitbutton.p-button-text>.p-button{background-color:transparent;border-color:transparent;color:#3b82f6}.p-splitbutton.p-button-text>.p-button:enabled:hover,.p-splitbutton.p-button-text>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(59,130,246,.04);border-color:transparent;color:#3b82f6}.p-splitbutton.p-button-text>.p-button:enabled:active,.p-splitbutton.p-button-text>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(59,130,246,.16);border-color:transparent;color:#3b82f6}.p-splitbutton.p-button-text.p-button-plain>.p-button{color:#6c757d}.p-splitbutton.p-button-text.p-button-plain>.p-button:enabled:hover,.p-splitbutton.p-button-text.p-button-plain>.p-button:not(button):not(a):not(.p-disabled):hover{background:#e9ecef;color:#6c757d}.p-splitbutton.p-button-text.p-button-plain>.p-button:enabled:active,.p-splitbutton.p-button-text.p-button-plain>.p-button:not(button):not(a):not(.p-disabled):active{background:#dee2e6;color:#6c757d}.p-splitbutton.p-button-raised{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.p-splitbutton.p-button-rounded,.p-splitbutton.p-button-rounded>.p-button{border-radius:2rem}.p-splitbutton.p-button-sm>.p-button{font-size:.875rem;padding:.65625rem 1.09375rem}.p-splitbutton.p-button-sm>.p-button .p-button-icon{font-size:.875rem}.p-splitbutton.p-button-lg>.p-button{font-size:1.25rem;padding:.9375rem 1.5625rem}.p-splitbutton.p-button-lg>.p-button .p-button-icon{font-size:1.25rem}.p-splitbutton.p-button-secondary.p-button-outlined>.p-button{background-color:transparent;border:1px solid;color:#64748b}.p-splitbutton.p-button-secondary.p-button-outlined>.p-button:enabled:hover,.p-splitbutton.p-button-secondary.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(100,116,139,.04);color:#64748b}.p-splitbutton.p-button-secondary.p-button-outlined>.p-button:enabled:active,.p-splitbutton.p-button-secondary.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(100,116,139,.16);color:#64748b}.p-splitbutton.p-button-secondary.p-button-text>.p-button{background-color:transparent;border-color:transparent;color:#64748b}.p-splitbutton.p-button-secondary.p-button-text>.p-button:enabled:hover,.p-splitbutton.p-button-secondary.p-button-text>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(100,116,139,.04);border-color:transparent;color:#64748b}.p-splitbutton.p-button-secondary.p-button-text>.p-button:enabled:active,.p-splitbutton.p-button-secondary.p-button-text>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(100,116,139,.16);border-color:transparent;color:#64748b}.p-splitbutton.p-button-info.p-button-outlined>.p-button{background-color:transparent;border:1px solid;color:#3b82f6}.p-splitbutton.p-button-info.p-button-outlined>.p-button:enabled:hover,.p-splitbutton.p-button-info.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(59,130,246,.04);color:#3b82f6}.p-splitbutton.p-button-info.p-button-outlined>.p-button:enabled:active,.p-splitbutton.p-button-info.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(59,130,246,.16);color:#3b82f6}.p-splitbutton.p-button-info.p-button-text>.p-button{background-color:transparent;border-color:transparent;color:#3b82f6}.p-splitbutton.p-button-info.p-button-text>.p-button:enabled:hover,.p-splitbutton.p-button-info.p-button-text>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(59,130,246,.04);border-color:transparent;color:#3b82f6}.p-splitbutton.p-button-info.p-button-text>.p-button:enabled:active,.p-splitbutton.p-button-info.p-button-text>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(59,130,246,.16);border-color:transparent;color:#3b82f6}.p-splitbutton.p-button-success.p-button-outlined>.p-button{background-color:transparent;border:1px solid;color:#22c55e}.p-splitbutton.p-button-success.p-button-outlined>.p-button:enabled:hover,.p-splitbutton.p-button-success.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(34,197,94,.04);color:#22c55e}.p-splitbutton.p-button-success.p-button-outlined>.p-button:enabled:active,.p-splitbutton.p-button-success.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(34,197,94,.16);color:#22c55e}.p-splitbutton.p-button-success.p-button-text>.p-button{background-color:transparent;border-color:transparent;color:#22c55e}.p-splitbutton.p-button-success.p-button-text>.p-button:enabled:hover,.p-splitbutton.p-button-success.p-button-text>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(34,197,94,.04);border-color:transparent;color:#22c55e}.p-splitbutton.p-button-success.p-button-text>.p-button:enabled:active,.p-splitbutton.p-button-success.p-button-text>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(34,197,94,.16);border-color:transparent;color:#22c55e}.p-splitbutton.p-button-warning.p-button-outlined>.p-button{background-color:transparent;border:1px solid;color:#f59e0b}.p-splitbutton.p-button-warning.p-button-outlined>.p-button:enabled:hover,.p-splitbutton.p-button-warning.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(245,158,11,.04);color:#f59e0b}.p-splitbutton.p-button-warning.p-button-outlined>.p-button:enabled:active,.p-splitbutton.p-button-warning.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(245,158,11,.16);color:#f59e0b}.p-splitbutton.p-button-warning.p-button-text>.p-button{background-color:transparent;border-color:transparent;color:#f59e0b}.p-splitbutton.p-button-warning.p-button-text>.p-button:enabled:hover,.p-splitbutton.p-button-warning.p-button-text>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(245,158,11,.04);border-color:transparent;color:#f59e0b}.p-splitbutton.p-button-warning.p-button-text>.p-button:enabled:active,.p-splitbutton.p-button-warning.p-button-text>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(245,158,11,.16);border-color:transparent;color:#f59e0b}.p-splitbutton.p-button-help.p-button-outlined>.p-button{background-color:transparent;border:1px solid;color:#a855f7}.p-splitbutton.p-button-help.p-button-outlined>.p-button:enabled:hover,.p-splitbutton.p-button-help.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(168,85,247,.04);color:#a855f7}.p-splitbutton.p-button-help.p-button-outlined>.p-button:enabled:active,.p-splitbutton.p-button-help.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(168,85,247,.16);color:#a855f7}.p-splitbutton.p-button-help.p-button-text>.p-button{background-color:transparent;border-color:transparent;color:#a855f7}.p-splitbutton.p-button-help.p-button-text>.p-button:enabled:hover,.p-splitbutton.p-button-help.p-button-text>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(168,85,247,.04);border-color:transparent;color:#a855f7}.p-splitbutton.p-button-help.p-button-text>.p-button:enabled:active,.p-splitbutton.p-button-help.p-button-text>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(168,85,247,.16);border-color:transparent;color:#a855f7}.p-splitbutton.p-button-danger.p-button-outlined>.p-button{background-color:transparent;border:1px solid;color:#ef4444}.p-splitbutton.p-button-danger.p-button-outlined>.p-button:enabled:hover,.p-splitbutton.p-button-danger.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(239,68,68,.04);color:#ef4444}.p-splitbutton.p-button-danger.p-button-outlined>.p-button:enabled:active,.p-splitbutton.p-button-danger.p-button-outlined>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(239,68,68,.16);color:#ef4444}.p-splitbutton.p-button-danger.p-button-text>.p-button{background-color:transparent;border-color:transparent;color:#ef4444}.p-splitbutton.p-button-danger.p-button-text>.p-button:enabled:hover,.p-splitbutton.p-button-danger.p-button-text>.p-button:not(button):not(a):not(.p-disabled):hover{background:rgba(239,68,68,.04);border-color:transparent;color:#ef4444}.p-splitbutton.p-button-danger.p-button-text>.p-button:enabled:active,.p-splitbutton.p-button-danger.p-button-text>.p-button:not(button):not(a):not(.p-disabled):active{background:rgba(239,68,68,.16);border-color:transparent;color:#ef4444}.p-carousel .p-carousel-content .p-carousel-next,.p-carousel .p-carousel-content .p-carousel-prev{background:transparent;border:0;border-radius:50%;color:#6c757d;height:2rem;margin:.5rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-carousel .p-carousel-content .p-carousel-next:enabled:hover,.p-carousel .p-carousel-content .p-carousel-prev:enabled:hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-carousel .p-carousel-content .p-carousel-next:focus,.p-carousel .p-carousel-content .p-carousel-prev:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-carousel .p-carousel-indicators{padding:1rem}.p-carousel .p-carousel-indicators .p-carousel-indicator{margin-bottom:.5rem;margin-right:.5rem}.p-carousel .p-carousel-indicators .p-carousel-indicator button{background-color:#ced4da;border-radius:0;height:.5rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-carousel .p-carousel-indicators .p-carousel-indicator button:hover{background:#adb5bd}.p-carousel .p-carousel-indicators .p-carousel-indicator.p-highlight button{background:#eff6ff;color:#1d4ed8}.p-datatable .p-paginator-bottom,.p-datatable .p-paginator-top{border-radius:0;border-width:0 0 1px}.p-datatable .p-datatable-header{background:#f8f9fa;border:1px solid #dee2e6;border-width:1px 0;color:#343a40;font-weight:700;padding:1rem}.p-datatable .p-datatable-footer,.p-datatable .p-datatable-thead>tr>th{background:#f8f9fa;border:solid #dee2e6;border-width:0 0 1px;color:#343a40;font-weight:700;padding:1rem}.p-datatable .p-datatable-thead>tr>th{text-align:left;transition:box-shadow .2s}.p-datatable .p-datatable-tfoot>tr>td{background:#f8f9fa;border:solid #dee2e6;border-width:0 0 1px;color:#343a40;font-weight:700;padding:1rem;text-align:left}.p-datatable .p-sortable-column .p-sortable-column-icon{color:#343a40;margin-left:.5rem}.p-datatable .p-sortable-column .p-sortable-column-badge{background:#eff6ff;border-radius:50%;color:#1d4ed8;height:1.143rem;line-height:1.143rem;margin-left:.5rem;min-width:1.143rem}.p-datatable .p-sortable-column:not(.p-highlight):hover{background:#e9ecef;color:#343a40}.p-datatable .p-sortable-column:not(.p-highlight):hover .p-sortable-column-icon{color:#343a40}.p-datatable .p-sortable-column.p-highlight{background:#eff6ff;color:#1d4ed8}.p-datatable .p-sortable-column.p-highlight .p-sortable-column-icon{color:#1d4ed8}.p-datatable .p-sortable-column.p-highlight:hover{background:#eff6ff;color:#1d4ed8}.p-datatable .p-sortable-column.p-highlight:hover .p-sortable-column-icon{color:#1d4ed8}.p-datatable .p-sortable-column:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none}.p-datatable .p-datatable-tbody>tr{background:#fff;color:#495057;transition:box-shadow .2s}.p-datatable .p-datatable-tbody>tr>td{border:solid #dee2e6;border-width:0 0 1px;padding:1rem;text-align:left}.p-datatable .p-datatable-tbody>tr>td .p-row-editor-cancel,.p-datatable .p-datatable-tbody>tr>td .p-row-editor-init,.p-datatable .p-datatable-tbody>tr>td .p-row-editor-save,.p-datatable .p-datatable-tbody>tr>td .p-row-toggler{background:transparent;border:0;border-radius:50%;color:#6c757d;height:2rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-datatable .p-datatable-tbody>tr>td .p-row-editor-cancel:enabled:hover,.p-datatable .p-datatable-tbody>tr>td .p-row-editor-init:enabled:hover,.p-datatable .p-datatable-tbody>tr>td .p-row-editor-save:enabled:hover,.p-datatable .p-datatable-tbody>tr>td .p-row-toggler:enabled:hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-datatable .p-datatable-tbody>tr>td .p-row-editor-cancel:focus,.p-datatable .p-datatable-tbody>tr>td .p-row-editor-init:focus,.p-datatable .p-datatable-tbody>tr>td .p-row-editor-save:focus,.p-datatable .p-datatable-tbody>tr>td .p-row-toggler:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-datatable .p-datatable-tbody>tr>td .p-row-editor-save{margin-right:.5rem}.p-datatable .p-datatable-tbody>tr>td>.p-column-title{font-weight:700}.p-datatable .p-datatable-tbody>tr:focus{outline:.15rem solid #bfdbfe;outline-offset:-.15rem}.p-datatable .p-datatable-tbody>tr.p-highlight{background:#eff6ff;color:#1d4ed8}.p-datatable .p-datatable-tbody>tr.p-datatable-dragpoint-top>td{box-shadow:inset 0 2px 0 0 #eff6ff}.p-datatable .p-datatable-tbody>tr.p-datatable-dragpoint-bottom>td{box-shadow:inset 0 -2px 0 0 #eff6ff}.p-datatable.p-datatable-hoverable-rows .p-datatable-tbody>tr:not(.p-highlight):hover{background:#e9ecef;color:#495057}.p-datatable .p-column-resizer-helper{background:#3b82f6}.p-datatable .p-datatable-scrollable-footer,.p-datatable .p-datatable-scrollable-header{background:#f8f9fa}.p-datatable.p-datatable-scrollable>.p-datatable-wrapper>.p-datatable-table>.p-datatable-tfoot,.p-datatable.p-datatable-scrollable>.p-datatable-wrapper>.p-datatable-table>.p-datatable-thead{background-color:#f8f9fa}.p-datatable .p-datatable-loading-icon{font-size:2rem}.p-datatable.p-datatable-gridlines .p-datatable-header{border-width:1px 1px 0}.p-datatable.p-datatable-gridlines .p-datatable-footer{border-width:0 1px 1px}.p-datatable.p-datatable-gridlines .p-paginator-top{border-width:0 1px}.p-datatable.p-datatable-gridlines .p-paginator-bottom{border-width:0 1px 1px}.p-datatable.p-datatable-gridlines .p-datatable-tbody>tr>td,.p-datatable.p-datatable-gridlines .p-datatable-tfoot>tr>td,.p-datatable.p-datatable-gridlines .p-datatable-thead>tr>th{border-width:1px}.p-datatable.p-datatable-gridlines.p-datatable-scrollable .p-datatable-tbody>tr>td+td,.p-datatable.p-datatable-gridlines.p-datatable-scrollable .p-datatable-thead>tr>th+th{border-left-width:0}.p-datatable.p-datatable-gridlines.p-datatable-scrollable .p-datatable-tbody>tr+tr>td,.p-datatable.p-datatable-gridlines.p-datatable-scrollable .p-datatable-tbody>tr:first-child>td{border-top-width:0}.p-datatable.p-datatable-gridlines.p-datatable-scrollable .p-datatable-tfoot>tr>td+td{border-left-width:0}.p-datatable.p-datatable-striped .p-datatable-tbody>tr:nth-child(2n){background:#fcfcfc}.p-datatable.p-datatable-striped .p-datatable-tbody>tr:nth-child(2n).p-highlight{background:#eff6ff;color:#1d4ed8}.p-datatable.p-datatable-striped .p-datatable-tbody>tr:nth-child(2n).p-highlight .p-row-toggler,.p-datatable.p-datatable-striped .p-datatable-tbody>tr:nth-child(2n).p-highlight .p-row-toggler:hover{color:#1d4ed8}.p-datatable.p-datatable-sm .p-datatable-footer,.p-datatable.p-datatable-sm .p-datatable-header,.p-datatable.p-datatable-sm .p-datatable-tbody>tr>td,.p-datatable.p-datatable-sm .p-datatable-tfoot>tr>td,.p-datatable.p-datatable-sm .p-datatable-thead>tr>th{padding:.5rem}.p-datatable.p-datatable-lg .p-datatable-footer,.p-datatable.p-datatable-lg .p-datatable-header,.p-datatable.p-datatable-lg .p-datatable-tbody>tr>td,.p-datatable.p-datatable-lg .p-datatable-tfoot>tr>td,.p-datatable.p-datatable-lg .p-datatable-thead>tr>th{padding:1.25rem}.p-dataview .p-paginator-bottom,.p-dataview .p-paginator-top{border-radius:0;border-width:0 0 1px}.p-dataview .p-dataview-header{background:#f8f9fa;border:1px solid #dee2e6;border-width:1px 0;color:#343a40;font-weight:700;padding:1rem}.p-dataview .p-dataview-content{background:#fff;border:0;color:#495057;padding:0}.p-dataview .p-dataview-footer,.p-dataview.p-dataview-list .p-dataview-content>.p-grid>div{border:solid #dee2e6;border-width:0 0 1px}.p-dataview .p-dataview-footer{background:#f8f9fa;border-bottom-left-radius:6px;border-bottom-right-radius:6px;color:#343a40;font-weight:700;padding:1rem}.p-column-filter-row .p-column-filter-clear-button,.p-column-filter-row .p-column-filter-menu-button{margin-left:.5rem}.p-column-filter-menu-button{background:transparent;border:0;border-radius:50%;color:#6c757d;height:2rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-column-filter-menu-button:hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-column-filter-menu-button.p-column-filter-menu-button-open,.p-column-filter-menu-button.p-column-filter-menu-button-open:hover{background:#e9ecef;color:#343a40}.p-column-filter-menu-button.p-column-filter-menu-button-active,.p-column-filter-menu-button.p-column-filter-menu-button-active:hover{background:#eff6ff;color:#1d4ed8}.p-column-filter-menu-button:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-column-filter-clear-button{background:transparent;border:0;border-radius:50%;color:#6c757d;height:2rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-column-filter-clear-button:hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-column-filter-clear-button:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-column-filter-overlay{background:#fff;border:0;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);color:#495057;min-width:12.5rem}.p-column-filter-overlay .p-column-filter-row-items{padding:.75rem 0}.p-column-filter-overlay .p-column-filter-row-items .p-column-filter-row-item{background:transparent;border:0;border-radius:0;color:#495057;margin:0;padding:.75rem 1.25rem;transition:box-shadow .2s}.p-column-filter-overlay .p-column-filter-row-items .p-column-filter-row-item.p-highlight{background:#eff6ff;color:#1d4ed8}.p-column-filter-overlay .p-column-filter-row-items .p-column-filter-row-item:not(.p-highlight):not(.p-disabled):hover{background:#e9ecef;color:#495057}.p-column-filter-overlay .p-column-filter-row-items .p-column-filter-row-item:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-column-filter-overlay .p-column-filter-row-items .p-column-filter-separator{border-top:1px solid #dee2e6;margin:.25rem 0}.p-column-filter-overlay-menu .p-column-filter-operator{background:#f8f9fa;border-bottom:1px solid #dee2e6;border-top-left-radius:6px;border-top-right-radius:6px;color:#343a40;margin:0;padding:.75rem 1.25rem}.p-column-filter-overlay-menu .p-column-filter-constraint{border-bottom:1px solid #dee2e6;padding:1.25rem}.p-column-filter-overlay-menu .p-column-filter-constraint .p-column-filter-matchmode-dropdown{margin-bottom:.5rem}.p-column-filter-overlay-menu .p-column-filter-constraint .p-column-filter-remove-button{margin-top:.5rem}.p-column-filter-overlay-menu .p-column-filter-constraint:last-child{border-bottom:0}.p-column-filter-overlay-menu .p-column-filter-add-rule{padding:.75rem 1.25rem}.p-column-filter-overlay-menu .p-column-filter-buttonbar{padding:1.25rem}.fc.fc-unthemed .fc-view-container th{background:#f8f9fa;border:1px solid #dee2e6;color:#343a40}.fc.fc-unthemed .fc-view-container td.fc-widget-content{border:1px solid #dee2e6;color:#495057}.fc.fc-unthemed .fc-view-container td.fc-head-container{border:1px solid #dee2e6}.fc.fc-unthemed .fc-view-container .fc-view{background:#fff}.fc.fc-unthemed .fc-view-container .fc-row{border-right:1px solid #dee2e6}.fc.fc-unthemed .fc-view-container .fc-event{background:#2563eb;border:1px solid #2563eb;color:#fff}.fc.fc-unthemed .fc-view-container .fc-divider{background:#f8f9fa;border:1px solid #dee2e6}.fc.fc-unthemed .fc-toolbar .fc-button{align-items:center;background:#3b82f6;border:1px solid #3b82f6;border-radius:6px;color:#fff;display:flex;font-size:1rem;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.fc.fc-unthemed .fc-toolbar .fc-button:enabled:hover{background:#2563eb;border-color:#2563eb;color:#fff}.fc.fc-unthemed .fc-toolbar .fc-button:enabled:active{background:#1d4ed8;border-color:#1d4ed8;color:#fff}.fc.fc-unthemed .fc-toolbar .fc-button:enabled:active:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.fc.fc-unthemed .fc-toolbar .fc-button .fc-icon-chevron-left{font-family:"PrimeIcons"!important;font-size:1rem;text-indent:0}.fc.fc-unthemed .fc-toolbar .fc-button .fc-icon-chevron-left:before{content:"\\e900"}.fc.fc-unthemed .fc-toolbar .fc-button .fc-icon-chevron-right{font-family:"PrimeIcons"!important;font-size:1rem;text-indent:0}.fc.fc-unthemed .fc-toolbar .fc-button .fc-icon-chevron-right:before{content:"\\e901"}.fc.fc-unthemed .fc-toolbar .fc-button:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.fc.fc-unthemed .fc-toolbar .fc-button.fc-dayGridMonth-button,.fc.fc-unthemed .fc-toolbar .fc-button.fc-timeGridDay-button,.fc.fc-unthemed .fc-toolbar .fc-button.fc-timeGridWeek-button{background:#fff;border:1px solid #ced4da;color:#495057;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.fc.fc-unthemed .fc-toolbar .fc-button.fc-dayGridMonth-button:hover,.fc.fc-unthemed .fc-toolbar .fc-button.fc-timeGridDay-button:hover,.fc.fc-unthemed .fc-toolbar .fc-button.fc-timeGridWeek-button:hover{background:#e9ecef;border-color:#ced4da;color:#495057}.fc.fc-unthemed .fc-toolbar .fc-button.fc-dayGridMonth-button.fc-button-active,.fc.fc-unthemed .fc-toolbar .fc-button.fc-timeGridDay-button.fc-button-active,.fc.fc-unthemed .fc-toolbar .fc-button.fc-timeGridWeek-button.fc-button-active{background:#3b82f6;border-color:#3b82f6;color:#fff}.fc.fc-unthemed .fc-toolbar .fc-button.fc-dayGridMonth-button.fc-button-active:hover,.fc.fc-unthemed .fc-toolbar .fc-button.fc-timeGridDay-button.fc-button-active:hover,.fc.fc-unthemed .fc-toolbar .fc-button.fc-timeGridWeek-button.fc-button-active:hover{background:#2563eb;border-color:#2563eb;color:#fff}.fc.fc-unthemed .fc-toolbar .fc-button.fc-dayGridMonth-button:focus,.fc.fc-unthemed .fc-toolbar .fc-button.fc-timeGridDay-button:focus,.fc.fc-unthemed .fc-toolbar .fc-button.fc-timeGridWeek-button:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0;z-index:1}.fc.fc-unthemed .fc-toolbar .fc-button-group .fc-button{border-radius:0}.fc.fc-unthemed .fc-toolbar .fc-button-group .fc-button:first-child{border-bottom-left-radius:6px;border-top-left-radius:6px}.fc.fc-unthemed .fc-toolbar .fc-button-group .fc-button:last-child{border-bottom-right-radius:6px;border-top-right-radius:6px}.fc.fc-theme-standard .fc-view-harness .fc-scrollgrid{border-color:#dee2e6}.fc.fc-theme-standard .fc-view-harness th{background:#f8f9fa;border-color:#dee2e6;color:#343a40}.fc.fc-theme-standard .fc-view-harness td{border-color:#dee2e6;color:#495057}.fc.fc-theme-standard .fc-view-harness .fc-view{background:#fff}.fc.fc-theme-standard .fc-view-harness .fc-popover{background:none;border:0}.fc.fc-theme-standard .fc-view-harness .fc-popover .fc-popover-header{background:#f8f9fa;border:1px solid #dee2e6;color:#343a40;padding:1.25rem}.fc.fc-theme-standard .fc-view-harness .fc-popover .fc-popover-header .fc-popover-close{align-items:center;background:transparent;border:0;border-radius:50%;color:#6c757d;display:flex;font-family:"PrimeIcons"!important;font-size:1rem;height:2rem;justify-content:center;opacity:1;overflow:hidden;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.fc.fc-theme-standard .fc-view-harness .fc-popover .fc-popover-header .fc-popover-close:before{content:"\\e90b"}.fc.fc-theme-standard .fc-view-harness .fc-popover .fc-popover-header .fc-popover-close:hover{background:#e9ecef;border-color:transparent;color:#343a40}.fc.fc-theme-standard .fc-view-harness .fc-popover .fc-popover-header .fc-popover-close:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.fc.fc-theme-standard .fc-view-harness .fc-popover .fc-popover-body{background:#fff;border:1px solid #dee2e6;border-top:0;color:#495057;padding:1.25rem}.fc.fc-theme-standard .fc-view-harness .fc-event.fc-daygrid-block-event{background:#2563eb;border-color:#2563eb;color:#fff}.fc.fc-theme-standard .fc-view-harness .fc-event.fc-daygrid-block-event .fc-event-main{color:#fff}.fc.fc-theme-standard .fc-view-harness .fc-event.fc-daygrid-dot-event .fc-daygrid-event-dot{background:#2563eb;border-color:#2563eb}.fc.fc-theme-standard .fc-view-harness .fc-event.fc-daygrid-dot-event:hover{background:#e9ecef;color:#495057}.fc.fc-theme-standard .fc-view-harness .fc-cell-shaded{background:#f8f9fa}.fc.fc-theme-standard .fc-toolbar .fc-button{background:#3b82f6;border:1px solid #3b82f6;border-radius:6px;color:#fff;font-size:1rem;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.fc.fc-theme-standard .fc-toolbar .fc-button:enabled:hover{background:#2563eb;border-color:#2563eb;color:#fff}.fc.fc-theme-standard .fc-toolbar .fc-button:enabled:active{background:#1d4ed8;border-color:#1d4ed8;color:#fff}.fc.fc-theme-standard .fc-toolbar .fc-button:enabled:active:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.fc.fc-theme-standard .fc-toolbar .fc-button:disabled{background:#3b82f6;border:1px solid #3b82f6;color:#fff;opacity:.6}.fc.fc-theme-standard .fc-toolbar .fc-button .fc-icon-chevron-left{font-family:"PrimeIcons"!important;font-size:1rem;text-indent:0}.fc.fc-theme-standard .fc-toolbar .fc-button .fc-icon-chevron-left:before{content:"\\e900"}.fc.fc-theme-standard .fc-toolbar .fc-button .fc-icon-chevron-right{font-family:"PrimeIcons"!important;font-size:1rem;text-indent:0}.fc.fc-theme-standard .fc-toolbar .fc-button .fc-icon-chevron-right:before{content:"\\e901"}.fc.fc-theme-standard .fc-toolbar .fc-button:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.fc.fc-theme-standard .fc-toolbar .fc-button.fc-dayGridMonth-button,.fc.fc-theme-standard .fc-toolbar .fc-button.fc-timeGridDay-button,.fc.fc-theme-standard .fc-toolbar .fc-button.fc-timeGridWeek-button{background:#fff;border:1px solid #ced4da;color:#495057;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.fc.fc-theme-standard .fc-toolbar .fc-button.fc-dayGridMonth-button:hover,.fc.fc-theme-standard .fc-toolbar .fc-button.fc-timeGridDay-button:hover,.fc.fc-theme-standard .fc-toolbar .fc-button.fc-timeGridWeek-button:hover{background:#e9ecef;border-color:#ced4da;color:#495057}.fc.fc-theme-standard .fc-toolbar .fc-button.fc-dayGridMonth-button.fc-button-active,.fc.fc-theme-standard .fc-toolbar .fc-button.fc-timeGridDay-button.fc-button-active,.fc.fc-theme-standard .fc-toolbar .fc-button.fc-timeGridWeek-button.fc-button-active{background:#3b82f6;border-color:#3b82f6;color:#fff}.fc.fc-theme-standard .fc-toolbar .fc-button.fc-dayGridMonth-button.fc-button-active:hover,.fc.fc-theme-standard .fc-toolbar .fc-button.fc-timeGridDay-button.fc-button-active:hover,.fc.fc-theme-standard .fc-toolbar .fc-button.fc-timeGridWeek-button.fc-button-active:hover{background:#2563eb;border-color:#2563eb;color:#fff}.fc.fc-theme-standard .fc-toolbar .fc-button.fc-dayGridMonth-button:not(:disabled):focus,.fc.fc-theme-standard .fc-toolbar .fc-button.fc-timeGridDay-button:not(:disabled):focus,.fc.fc-theme-standard .fc-toolbar .fc-button.fc-timeGridWeek-button:not(:disabled):focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0;z-index:1}.fc.fc-theme-standard .fc-toolbar .fc-button-group .fc-button{border-radius:0}.fc.fc-theme-standard .fc-toolbar .fc-button-group .fc-button:first-child{border-bottom-left-radius:6px;border-top-left-radius:6px}.fc.fc-theme-standard .fc-toolbar .fc-button-group .fc-button:last-child{border-bottom-right-radius:6px;border-top-right-radius:6px}.fc.fc-theme-standard .fc-highlight{background:#eff6ff;color:#1d4ed8}.p-orderlist .p-orderlist-controls{padding:1.25rem}.p-orderlist .p-orderlist-controls .p-button{margin-bottom:.5rem}.p-orderlist .p-orderlist-header{background:#f8f9fa;border:1px solid #dee2e6;border-bottom:0;border-top-left-radius:6px;border-top-right-radius:6px;color:#343a40;font-weight:700;padding:1.25rem}.p-orderlist .p-orderlist-list{background:#fff;border:1px solid #dee2e6;border-bottom-left-radius:6px;border-bottom-right-radius:6px;color:#495057;padding:.75rem 0}.p-orderlist .p-orderlist-list .p-orderlist-item{background:transparent;border:0;color:#495057;margin:0;padding:.75rem 1.25rem;transition:transform .2s,box-shadow .2s}.p-orderlist .p-orderlist-list .p-orderlist-item:not(.p-highlight):hover{background:#e9ecef;color:#495057}.p-orderlist .p-orderlist-list .p-orderlist-item:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-orderlist .p-orderlist-list .p-orderlist-item.p-highlight{background:#eff6ff;color:#1d4ed8}.p-orderlist.p-orderlist-striped .p-orderlist-list .p-orderlist-item:nth-child(2n){background:#fcfcfc}.p-orderlist.p-orderlist-striped .p-orderlist-list .p-orderlist-item:nth-child(2n):hover{background:#e9ecef}.p-organizationchart .p-organizationchart-node-content.p-organizationchart-selectable-node:not(.p-highlight):hover{background:#e9ecef;color:#495057}.p-organizationchart .p-organizationchart-node-content.p-highlight{background:#eff6ff;color:#1d4ed8}.p-organizationchart .p-organizationchart-node-content.p-highlight .p-node-toggler i{color:#70aeff}.p-organizationchart .p-organizationchart-line-down{background:#dee2e6}.p-organizationchart .p-organizationchart-line-left{border-right:1px solid;border-color:#dee2e6}.p-organizationchart .p-organizationchart-line-top{border-color:#dee2e6;border-top:1px solid #dee2e6}.p-organizationchart .p-organizationchart-node-content{background:#fff;border:1px solid #dee2e6;color:#495057;padding:1.25rem}.p-organizationchart .p-organizationchart-node-content .p-node-toggler{background:inherit;border-radius:50%;color:inherit}.p-organizationchart .p-organizationchart-node-content .p-node-toggler:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-paginator{background:#fff;border:0 solid #e9ecef;border-radius:6px;color:#6c757d;padding:.5rem 1rem}.p-paginator .p-paginator-first,.p-paginator .p-paginator-last,.p-paginator .p-paginator-next,.p-paginator .p-paginator-prev{background-color:transparent;border:0;border-radius:50%;color:#6c757d;height:3rem;margin:.143rem;min-width:3rem;transition:box-shadow .2s}.p-paginator .p-paginator-first:not(.p-disabled):not(.p-highlight):hover,.p-paginator .p-paginator-last:not(.p-disabled):not(.p-highlight):hover,.p-paginator .p-paginator-next:not(.p-disabled):not(.p-highlight):hover,.p-paginator .p-paginator-prev:not(.p-disabled):not(.p-highlight):hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-paginator .p-paginator-first{border-bottom-left-radius:50%;border-top-left-radius:50%}.p-paginator .p-paginator-last{border-bottom-right-radius:50%;border-top-right-radius:50%}.p-paginator .p-dropdown{height:3rem;margin-left:.5rem;margin-right:.5rem}.p-paginator .p-dropdown .p-dropdown-label{padding-right:0}.p-paginator .p-paginator-page-input{margin-left:.5rem;margin-right:.5rem}.p-paginator .p-paginator-page-input .p-inputtext{max-width:3rem}.p-paginator .p-paginator-current{padding:0 .5rem}.p-paginator .p-paginator-current,.p-paginator .p-paginator-pages .p-paginator-page{background-color:transparent;border:0;color:#6c757d;height:3rem;margin:.143rem;min-width:3rem}.p-paginator .p-paginator-pages .p-paginator-page{border-radius:50%;transition:box-shadow .2s}.p-paginator .p-paginator-pages .p-paginator-page.p-highlight{background:#eff6ff;border-color:#eff6ff;color:#1d4ed8}.p-paginator .p-paginator-pages .p-paginator-page:not(.p-highlight):hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-picklist .p-picklist-buttons{padding:1.25rem}.p-picklist .p-picklist-buttons .p-button{margin-bottom:.5rem}.p-picklist .p-picklist-header{background:#f8f9fa;border:1px solid #dee2e6;border-bottom:0;border-top-left-radius:6px;border-top-right-radius:6px;color:#343a40;font-weight:700;padding:1.25rem}.p-picklist .p-picklist-list{background:#fff;border:1px solid #dee2e6;border-bottom-left-radius:6px;border-bottom-right-radius:6px;color:#495057;padding:.75rem 0}.p-picklist .p-picklist-list .p-picklist-item{background:transparent;border:0;color:#495057;margin:0;padding:.75rem 1.25rem;transition:transform .2s,box-shadow .2s}.p-picklist .p-picklist-list .p-picklist-item:not(.p-highlight):hover{background:#e9ecef;color:#495057}.p-picklist .p-picklist-list .p-picklist-item:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-picklist .p-picklist-list .p-picklist-item.p-highlight{background:#eff6ff;color:#1d4ed8}.p-picklist.p-picklist-striped .p-picklist-list .p-picklist-item:nth-child(2n){background:#fcfcfc}.p-picklist.p-picklist-striped .p-picklist-list .p-picklist-item:nth-child(2n):hover{background:#e9ecef}.p-timeline .p-timeline-event-marker{background-color:#fff;border:2px solid #3b82f6;border-radius:50%;height:1rem;width:1rem}.p-timeline .p-timeline-event-connector{background-color:#dee2e6}.p-timeline.p-timeline-vertical .p-timeline-event-content,.p-timeline.p-timeline-vertical .p-timeline-event-opposite{padding:0 1rem}.p-timeline.p-timeline-vertical .p-timeline-event-connector{width:2px}.p-timeline.p-timeline-horizontal .p-timeline-event-content,.p-timeline.p-timeline-horizontal .p-timeline-event-opposite{padding:1rem 0}.p-timeline.p-timeline-horizontal .p-timeline-event-connector{height:2px}.p-tree{background:#fff;border:1px solid #dee2e6;border-radius:6px;color:#495057;padding:1.25rem}.p-tree .p-tree-container .p-treenode{padding:.143rem}.p-tree .p-tree-container .p-treenode .p-treenode-content{border-radius:6px;padding:.5rem;transition:box-shadow .2s}.p-tree .p-tree-container .p-treenode .p-treenode-content .p-tree-toggler{background:transparent;border:0;border-radius:50%;color:#6c757d;height:2rem;margin-right:.5rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-tree .p-tree-container .p-treenode .p-treenode-content .p-tree-toggler:enabled:hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-tree .p-tree-container .p-treenode .p-treenode-content .p-tree-toggler:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-tree .p-tree-container .p-treenode .p-treenode-content .p-treenode-icon{color:#6c757d;margin-right:.5rem}.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox{margin-right:.5rem}.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox .p-indeterminate .p-checkbox-icon{color:#495057}.p-tree .p-tree-container .p-treenode .p-treenode-content:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-tree .p-tree-container .p-treenode .p-treenode-content.p-highlight{background:#eff6ff;color:#1d4ed8}.p-tree .p-tree-container .p-treenode .p-treenode-content.p-highlight .p-tree-toggler,.p-tree .p-tree-container .p-treenode .p-treenode-content.p-highlight .p-tree-toggler:hover,.p-tree .p-tree-container .p-treenode .p-treenode-content.p-highlight .p-treenode-icon,.p-tree .p-tree-container .p-treenode .p-treenode-content.p-highlight .p-treenode-icon:hover{color:#1d4ed8}.p-tree .p-tree-container .p-treenode .p-treenode-content.p-treenode-selectable:not(.p-highlight):hover{background:#e9ecef;color:#495057}.p-tree .p-tree-filter-container{margin-bottom:.5rem}.p-tree .p-tree-filter-container .p-tree-filter{padding-right:1.75rem;width:100%}.p-tree .p-tree-filter-container .p-tree-filter-icon{color:#6c757d;right:.75rem}.p-tree .p-treenode-children{padding:0 0 0 1rem}.p-tree .p-tree-loading-icon{font-size:2rem}.p-treetable .p-paginator-bottom,.p-treetable .p-paginator-top{border-radius:0;border-width:0 0 1px}.p-treetable .p-treetable-header{background:#f8f9fa;border:1px solid #dee2e6;border-width:1px 0;color:#343a40;font-weight:700;padding:1rem}.p-treetable .p-treetable-footer,.p-treetable .p-treetable-thead>tr>th{background:#f8f9fa;border:solid #dee2e6;border-width:0 0 1px;color:#343a40;font-weight:700;padding:1rem}.p-treetable .p-treetable-thead>tr>th{text-align:left;transition:box-shadow .2s}.p-treetable .p-treetable-tfoot>tr>td{background:#f8f9fa;border:solid #dee2e6;border-width:0 0 1px;color:#343a40;font-weight:700;padding:1rem;text-align:left}.p-treetable .p-sortable-column{outline-color:#bfdbfe}.p-treetable .p-sortable-column .p-sortable-column-icon{color:#343a40;margin-left:.5rem}.p-treetable .p-sortable-column .p-sortable-column-badge{background:#eff6ff;border-radius:50%;color:#1d4ed8;height:1.143rem;line-height:1.143rem;margin-left:.5rem;min-width:1.143rem}.p-treetable .p-sortable-column:not(.p-highlight):hover{background:#e9ecef;color:#343a40}.p-treetable .p-sortable-column:not(.p-highlight):hover .p-sortable-column-icon{color:#343a40}.p-treetable .p-sortable-column.p-highlight{background:#eff6ff;color:#1d4ed8}.p-treetable .p-sortable-column.p-highlight .p-sortable-column-icon{color:#1d4ed8}.p-treetable .p-treetable-tbody>tr{background:#fff;color:#495057;transition:box-shadow .2s}.p-treetable .p-treetable-tbody>tr>td{border:solid #dee2e6;border-width:0 0 1px;padding:1rem;text-align:left}.p-treetable .p-treetable-tbody>tr>td .p-treetable-toggler{background:transparent;border:0;border-radius:50%;color:#6c757d;height:2rem;margin-right:.5rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-treetable .p-treetable-tbody>tr>td .p-treetable-toggler:enabled:hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-treetable .p-treetable-tbody>tr>td .p-treetable-toggler:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-treetable .p-treetable-tbody>tr>td .p-treetable-toggler+.p-checkbox{margin-right:.5rem}.p-treetable .p-treetable-tbody>tr>td .p-treetable-toggler+.p-checkbox .p-indeterminate .p-checkbox-icon{color:#495057}.p-treetable .p-treetable-tbody>tr:focus{outline:.15rem solid #bfdbfe;outline-offset:-.15rem}.p-treetable .p-treetable-tbody>tr.p-highlight{background:#eff6ff;color:#1d4ed8}.p-treetable .p-treetable-tbody>tr.p-highlight .p-treetable-toggler,.p-treetable .p-treetable-tbody>tr.p-highlight .p-treetable-toggler:hover{color:#1d4ed8}.p-treetable.p-treetable-hoverable-rows .p-treetable-tbody>tr:not(.p-highlight):hover{background:#e9ecef;color:#495057}.p-treetable.p-treetable-hoverable-rows .p-treetable-tbody>tr:not(.p-highlight):hover .p-treetable-toggler{color:#495057}.p-treetable .p-column-resizer-helper{background:#3b82f6}.p-treetable .p-treetable-scrollable-footer,.p-treetable .p-treetable-scrollable-header{background:#f8f9fa}.p-treetable .p-treetable-loading-icon{font-size:2rem}.p-treetable.p-treetable-gridlines .p-datatable-header{border-width:1px 1px 0}.p-treetable.p-treetable-gridlines .p-treetable-footer{border-width:0 1px 1px}.p-treetable.p-treetable-gridlines .p-treetable-top{border-width:0 1px}.p-treetable.p-treetable-gridlines .p-treetable-bottom{border-width:0 1px 1px}.p-treetable.p-treetable-gridlines .p-treetable-tbody>tr>td,.p-treetable.p-treetable-gridlines .p-treetable-tfoot>tr>td,.p-treetable.p-treetable-gridlines .p-treetable-thead>tr>th{border-width:1px}.p-treetable.p-treetable-sm .p-treetable-header{padding:.875rem}.p-treetable.p-treetable-sm .p-treetable-footer,.p-treetable.p-treetable-sm .p-treetable-tbody>tr>td,.p-treetable.p-treetable-sm .p-treetable-tfoot>tr>td,.p-treetable.p-treetable-sm .p-treetable-thead>tr>th{padding:.5rem}.p-treetable.p-treetable-lg .p-treetable-footer,.p-treetable.p-treetable-lg .p-treetable-header,.p-treetable.p-treetable-lg .p-treetable-tbody>tr>td,.p-treetable.p-treetable-lg .p-treetable-tfoot>tr>td,.p-treetable.p-treetable-lg .p-treetable-thead>tr>th{padding:1.25rem}.p-accordion .p-accordion-header .p-accordion-header-link{background:#f8f9fa;border:1px solid #dee2e6;border-radius:6px;color:#6c757d;font-weight:700;padding:1.25rem;transition:box-shadow .2s}.p-accordion .p-accordion-header .p-accordion-header-link .p-accordion-toggle-icon{margin-right:.5rem}.p-accordion .p-accordion-header:not(.p-disabled) .p-accordion-header-link:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-accordion .p-accordion-header:not(.p-highlight):not(.p-disabled):hover .p-accordion-header-link{background:#e9ecef;border-color:#dee2e6;color:#343a40}.p-accordion .p-accordion-header:not(.p-disabled).p-highlight .p-accordion-header-link{background:#f8f9fa;border-bottom-left-radius:0;border-bottom-right-radius:0;border-color:#dee2e6;color:#343a40}.p-accordion .p-accordion-header:not(.p-disabled).p-highlight:hover .p-accordion-header-link{background:#e9ecef;border-color:#dee2e6;color:#343a40}.p-accordion .p-accordion-content{background:#fff;border:1px solid #dee2e6;border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top:0;border-top-left-radius:0;border-top-right-radius:0;color:#495057;padding:1.25rem}.p-accordion .p-accordion-tab{margin-bottom:4px}.p-card{background:#fff;border-radius:6px;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);color:#495057}.p-card .p-card-body{padding:1.25rem}.p-card .p-card-title{font-size:1.5rem;font-weight:700;margin-bottom:.5rem}.p-card .p-card-subtitle{color:#6c757d;font-weight:400;margin-bottom:.5rem}.p-card .p-card-content{padding:1.25rem 0}.p-card .p-card-footer{padding:1.25rem 0 0}.p-fieldset{background:#fff;border:1px solid #dee2e6;border-radius:6px;color:#495057}.p-fieldset .p-fieldset-legend{background:#f8f9fa;border:1px solid #dee2e6;border-radius:6px;color:#343a40;font-weight:700;padding:1.25rem}.p-fieldset.p-fieldset-toggleable .p-fieldset-legend{padding:0;transition:background-color .2s,color .2s,box-shadow .2s}.p-fieldset.p-fieldset-toggleable .p-fieldset-legend a{border-radius:6px;color:#343a40;padding:1.25rem;transition:box-shadow .2s}.p-fieldset.p-fieldset-toggleable .p-fieldset-legend a .p-fieldset-toggler{margin-right:.5rem}.p-fieldset.p-fieldset-toggleable .p-fieldset-legend a:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-fieldset.p-fieldset-toggleable .p-fieldset-legend a:hover{color:#343a40}.p-fieldset.p-fieldset-toggleable .p-fieldset-legend:hover{background:#e9ecef;border-color:#dee2e6;color:#343a40}.p-fieldset .p-fieldset-content{padding:1.25rem}.p-divider .p-divider-content{background-color:#fff}.p-divider.p-divider-horizontal{margin:1.25rem 0;padding:0 1.25rem}.p-divider.p-divider-horizontal:before{border-top:1px #dee2e6}.p-divider.p-divider-horizontal .p-divider-content{padding:0 .5rem}.p-divider.p-divider-vertical{margin:0 1.25rem;padding:1.25rem 0}.p-divider.p-divider-vertical:before{border-left:1px #dee2e6}.p-divider.p-divider-vertical .p-divider-content{padding:.5rem 0}.p-panel .p-panel-header{background:#f8f9fa;border:1px solid #dee2e6;border-top-left-radius:6px;border-top-right-radius:6px;color:#343a40;padding:1.25rem}.p-panel .p-panel-header .p-panel-title{font-weight:700}.p-panel .p-panel-header .p-panel-header-icon{background:transparent;border:0;border-radius:50%;color:#6c757d;height:2rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-panel .p-panel-header .p-panel-header-icon:enabled:hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-panel .p-panel-header .p-panel-header-icon:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-panel.p-panel-toggleable .p-panel-header{padding:.75rem 1.25rem}.p-panel .p-panel-content{border-bottom-left-radius:6px;border-bottom-right-radius:6px;padding:1.25rem}.p-panel .p-panel-content,.p-panel .p-panel-footer{background:#fff;border:1px solid #dee2e6;border-top:0;color:#495057}.p-panel .p-panel-footer{padding:.75rem 1.25rem}.p-scrollpanel .p-scrollpanel-bar{background:#f8f9fa;border:0}.p-splitter{background:#fff;border:1px solid #dee2e6;border-radius:6px;color:#495057}.p-splitter .p-splitter-gutter{background:#f8f9fa;transition:background-color .2s,color .2s,box-shadow .2s}.p-splitter .p-splitter-gutter .p-splitter-gutter-handle,.p-splitter .p-splitter-gutter-resizing{background:#dee2e6}.p-tabview .p-tabview-nav{background:#fff;border:solid #dee2e6;border-width:0 0 2px}.p-tabview .p-tabview-nav li{margin-right:0}.p-tabview .p-tabview-nav li .p-tabview-nav-link{background:#fff;border:0 solid transparent;border-bottom:2px solid #dee2e6;border-top-left-radius:6px;border-top-right-radius:6px;color:#6c757d;font-weight:700;margin:0 0 -2px;padding:1.25rem;transition:box-shadow .2s}.p-tabview .p-tabview-nav li .p-tabview-nav-link:not(.p-disabled):focus{box-shadow:inset 0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-tabview .p-tabview-nav li:not(.p-highlight):not(.p-disabled):hover .p-tabview-nav-link{background:#fff;border-color:#adb5bd;color:#6c757d}.p-tabview .p-tabview-nav li.p-highlight .p-tabview-nav-link{background:#fff;border-color:#3b82f6;color:#3b82f6}.p-tabview .p-tabview-nav-btn.p-link{background:#fff;border-radius:0;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);color:#3b82f6;width:3rem}.p-tabview .p-tabview-nav-btn.p-link:focus{box-shadow:inset 0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-tabview .p-tabview-panels{background:#fff;border:0;border-bottom-left-radius:6px;border-bottom-right-radius:6px;color:#495057;padding:1.25rem}.p-toolbar{background:#f8f9fa;border:1px solid #dee2e6;border-radius:6px;padding:1.25rem}.p-toolbar .p-toolbar-separator{margin:0 .5rem}.p-confirm-popup{background:#fff;border:0;border-radius:6px;box-shadow:0 1px 3px rgba(0,0,0,.3);color:#495057}.p-confirm-popup .p-confirm-popup-content{padding:1.25rem}.p-confirm-popup .p-confirm-popup-footer{padding:0 1.25rem 1.25rem;text-align:right}.p-confirm-popup .p-confirm-popup-footer button{margin:0 .5rem 0 0;width:auto}.p-confirm-popup .p-confirm-popup-footer button:last-child{margin:0}.p-confirm-popup:after,.p-confirm-popup:before{border:solid hsla(0,0%,100%,0);border-bottom:solid #fff}.p-confirm-popup.p-confirm-popup-flipped:after,.p-confirm-popup.p-confirm-popup-flipped:before{border-top-color:#fff}.p-confirm-popup .p-confirm-popup-icon{font-size:1.5rem}.p-confirm-popup .p-confirm-popup-message{margin-left:1rem}.p-dialog{border:0;border-radius:6px;box-shadow:0 1px 3px rgba(0,0,0,.3)}.p-dialog .p-dialog-header{background:#fff;border-bottom:0;border-top-left-radius:6px;border-top-right-radius:6px;color:#343a40;padding:1.5rem}.p-dialog .p-dialog-header .p-dialog-title{font-size:1.25rem;font-weight:700}.p-dialog .p-dialog-header .p-dialog-header-icon{background:transparent;border:0;border-radius:50%;color:#6c757d;height:2rem;margin-right:.5rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-dialog .p-dialog-header .p-dialog-header-icon:enabled:hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-dialog .p-dialog-header .p-dialog-header-icon:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-dialog .p-dialog-header .p-dialog-header-icon:last-child{margin-right:0}.p-dialog .p-dialog-content{background:#fff;color:#495057;padding:0 1.5rem 2rem}.p-dialog .p-dialog-footer{background:#fff;border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top:0;color:#495057;padding:0 1.5rem 1.5rem;text-align:right}.p-dialog .p-dialog-footer button{margin:0 .5rem 0 0;width:auto}.p-dialog.p-confirm-dialog .p-confirm-dialog-icon{font-size:2rem}.p-dialog.p-confirm-dialog .p-confirm-dialog-message{margin-left:1rem}.p-overlaypanel{background:#fff;border:0;border-radius:6px;box-shadow:0 1px 3px rgba(0,0,0,.3);color:#495057}.p-overlaypanel .p-overlaypanel-content{padding:1.25rem}.p-overlaypanel .p-overlaypanel-close{background:#3b82f6;border-radius:50%;color:#fff;height:2rem;position:absolute;right:-1rem;top:-1rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-overlaypanel .p-overlaypanel-close:enabled:hover{background:#2563eb;color:#fff}.p-overlaypanel:after,.p-overlaypanel:before{border:solid hsla(0,0%,100%,0);border-bottom:solid #fff}.p-overlaypanel.p-overlaypanel-flipped:after,.p-overlaypanel.p-overlaypanel-flipped:before{border-top-color:#fff}.p-sidebar{background:#fff;border:0;box-shadow:0 1px 3px rgba(0,0,0,.3);color:#495057}.p-sidebar .p-sidebar-header{padding:1.25rem}.p-sidebar .p-sidebar-header .p-sidebar-close,.p-sidebar .p-sidebar-header .p-sidebar-icon{background:transparent;border:0;border-radius:50%;color:#6c757d;height:2rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-sidebar .p-sidebar-header .p-sidebar-close:enabled:hover,.p-sidebar .p-sidebar-header .p-sidebar-icon:enabled:hover{background:#e9ecef;border-color:transparent;color:#343a40}.p-sidebar .p-sidebar-header .p-sidebar-close:focus,.p-sidebar .p-sidebar-header .p-sidebar-icon:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-sidebar .p-sidebar-header+.p-sidebar-content{padding-top:0}.p-sidebar .p-sidebar-content{padding:1.25rem}.p-tooltip .p-tooltip-text{background:#495057;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);color:#fff;padding:.75rem}.p-tooltip.p-tooltip-right .p-tooltip-arrow{border-right-color:#495057}.p-tooltip.p-tooltip-left .p-tooltip-arrow{border-left-color:#495057}.p-tooltip.p-tooltip-top .p-tooltip-arrow{border-top-color:#495057}.p-tooltip.p-tooltip-bottom .p-tooltip-arrow{border-bottom-color:#495057}.p-fileupload .p-fileupload-buttonbar{background:#f8f9fa;border:1px solid #dee2e6;border-bottom:0;border-top-left-radius:6px;border-top-right-radius:6px;color:#343a40;padding:1.25rem}.p-fileupload .p-fileupload-buttonbar .p-button{margin-right:.5rem}.p-fileupload .p-fileupload-buttonbar .p-button.p-fileupload-choose.p-focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-fileupload .p-fileupload-content{background:#fff;border:1px solid #dee2e6;border-bottom-left-radius:6px;border-bottom-right-radius:6px;color:#495057;padding:2rem 1rem}.p-fileupload .p-progressbar{height:.25rem}.p-fileupload .p-fileupload-row>div{padding:1rem}.p-fileupload.p-fileupload-advanced .p-message{margin-top:0}.p-fileupload-choose:not(.p-disabled):hover{background:#2563eb;border-color:#2563eb;color:#fff}.p-fileupload-choose:not(.p-disabled):active{background:#1d4ed8;border-color:#1d4ed8;color:#fff}.p-breadcrumb{background:#fff;border:1px solid #dee2e6;border-radius:6px;padding:1rem}.p-breadcrumb ul li .p-menuitem-link{border-radius:6px;transition:box-shadow .2s}.p-breadcrumb ul li .p-menuitem-link:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-breadcrumb ul li .p-menuitem-link .p-menuitem-text{color:#495057}.p-breadcrumb ul li .p-menuitem-link .p-menuitem-icon{color:#6c757d}.p-breadcrumb ul li.p-breadcrumb-chevron{color:#495057;margin:0 .5rem}.p-breadcrumb ul li:last-child .p-menuitem-text{color:#495057}.p-breadcrumb ul li:last-child .p-menuitem-icon{color:#6c757d}.p-contextmenu{background:#fff;border:0;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);color:#495057;padding:.25rem 0;width:12.5rem}.p-contextmenu .p-menuitem-link{border-radius:0;color:#495057;padding:.75rem 1.25rem;transition:box-shadow .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.p-contextmenu .p-menuitem-link .p-menuitem-text{color:#495057}.p-contextmenu .p-menuitem-link .p-menuitem-icon{color:#6c757d;margin-right:.5rem}.p-contextmenu .p-menuitem-link .p-submenu-icon{color:#6c757d}.p-contextmenu .p-menuitem-link:not(.p-disabled):hover{background:#e9ecef}.p-contextmenu .p-menuitem-link:not(.p-disabled):hover .p-menuitem-text{color:#495057}.p-contextmenu .p-menuitem-link:not(.p-disabled):hover .p-menuitem-icon,.p-contextmenu .p-menuitem-link:not(.p-disabled):hover .p-submenu-icon{color:#6c757d}.p-contextmenu .p-menuitem-link:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-contextmenu .p-submenu-list{background:#fff;border:0;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);padding:.25rem 0}.p-contextmenu .p-menuitem.p-menuitem-active>.p-menuitem-link{background:#eff6ff}.p-contextmenu .p-menuitem.p-menuitem-active>.p-menuitem-link .p-menuitem-icon,.p-contextmenu .p-menuitem.p-menuitem-active>.p-menuitem-link .p-menuitem-text,.p-contextmenu .p-menuitem.p-menuitem-active>.p-menuitem-link .p-submenu-icon{color:#1d4ed8}.p-contextmenu .p-menu-separator{border-top:1px solid #dee2e6;margin:.25rem 0}.p-contextmenu .p-submenu-icon{font-size:.875rem}.p-dock .p-dock-list-container{background:hsla(0,0%,100%,.1);border:1px solid hsla(0,0%,100%,.2);border-radius:.5rem;padding:.5rem}.p-dock .p-dock-item{padding:.5rem}.p-dock .p-dock-action{height:4rem;width:4rem}.p-dock.p-dock-bottom .p-dock-item-second-next,.p-dock.p-dock-bottom .p-dock-item-second-prev,.p-dock.p-dock-top .p-dock-item-second-next,.p-dock.p-dock-top .p-dock-item-second-prev{margin:0 .9rem}.p-dock.p-dock-bottom .p-dock-item-next,.p-dock.p-dock-bottom .p-dock-item-prev,.p-dock.p-dock-top .p-dock-item-next,.p-dock.p-dock-top .p-dock-item-prev{margin:0 1.3rem}.p-dock.p-dock-bottom .p-dock-item-current,.p-dock.p-dock-top .p-dock-item-current{margin:0 1.5rem}.p-dock.p-dock-left .p-dock-item-second-next,.p-dock.p-dock-left .p-dock-item-second-prev,.p-dock.p-dock-right .p-dock-item-second-next,.p-dock.p-dock-right .p-dock-item-second-prev{margin:.9rem 0}.p-dock.p-dock-left .p-dock-item-next,.p-dock.p-dock-left .p-dock-item-prev,.p-dock.p-dock-right .p-dock-item-next,.p-dock.p-dock-right .p-dock-item-prev{margin:1.3rem 0}.p-dock.p-dock-left .p-dock-item-current,.p-dock.p-dock-right .p-dock-item-current{margin:1.5rem 0}@media screen and (max-width:960px){.p-dock.p-dock-bottom .p-dock-list-container,.p-dock.p-dock-top .p-dock-list-container{overflow-x:auto;width:100%}.p-dock.p-dock-bottom .p-dock-list-container .p-dock-list,.p-dock.p-dock-top .p-dock-list-container .p-dock-list{margin:0 auto}.p-dock.p-dock-left .p-dock-list-container,.p-dock.p-dock-right .p-dock-list-container{height:100%;overflow-y:auto}.p-dock.p-dock-left .p-dock-list-container .p-dock-list,.p-dock.p-dock-right .p-dock-list-container .p-dock-list{margin:auto 0}.p-dock .p-dock-list .p-dock-item{margin:0;transform:none}}.p-megamenu{background:#f8f9fa;border:1px solid #dee2e6;border-radius:6px;color:#495057;padding:.5rem}.p-megamenu .p-megamenu-root-list>.p-menuitem>.p-menuitem-link{border-radius:6px;color:#495057;padding:.75rem 1.25rem;transition:box-shadow .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.p-megamenu .p-megamenu-root-list>.p-menuitem>.p-menuitem-link .p-menuitem-text{color:#495057}.p-megamenu .p-megamenu-root-list>.p-menuitem>.p-menuitem-link .p-menuitem-icon{color:#6c757d;margin-right:.5rem}.p-megamenu .p-megamenu-root-list>.p-menuitem>.p-menuitem-link .p-submenu-icon{color:#6c757d;margin-left:.5rem}.p-megamenu .p-megamenu-root-list>.p-menuitem>.p-menuitem-link:not(.p-disabled):hover{background:#e9ecef}.p-megamenu .p-megamenu-root-list>.p-menuitem>.p-menuitem-link:not(.p-disabled):hover .p-menuitem-text{color:#495057}.p-megamenu .p-megamenu-root-list>.p-menuitem>.p-menuitem-link:not(.p-disabled):hover .p-menuitem-icon,.p-megamenu .p-megamenu-root-list>.p-menuitem>.p-menuitem-link:not(.p-disabled):hover .p-submenu-icon{color:#6c757d}.p-megamenu .p-megamenu-root-list>.p-menuitem>.p-menuitem-link:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-megamenu .p-megamenu-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link,.p-megamenu .p-megamenu-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link:not(.p-disabled):hover{background:#eff6ff}.p-megamenu .p-megamenu-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link .p-menuitem-icon,.p-megamenu .p-megamenu-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link .p-menuitem-text,.p-megamenu .p-megamenu-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link .p-submenu-icon,.p-megamenu .p-megamenu-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link:not(.p-disabled):hover .p-menuitem-icon,.p-megamenu .p-megamenu-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link:not(.p-disabled):hover .p-menuitem-text,.p-megamenu .p-megamenu-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link:not(.p-disabled):hover .p-submenu-icon{color:#1d4ed8}.p-megamenu .p-menuitem-link{border-radius:0;color:#495057;padding:.75rem 1.25rem;transition:box-shadow .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.p-megamenu .p-menuitem-link .p-menuitem-text{color:#495057}.p-megamenu .p-menuitem-link .p-menuitem-icon{color:#6c757d;margin-right:.5rem}.p-megamenu .p-menuitem-link .p-submenu-icon{color:#6c757d}.p-megamenu .p-menuitem-link:not(.p-disabled):hover{background:#e9ecef}.p-megamenu .p-menuitem-link:not(.p-disabled):hover .p-menuitem-text{color:#495057}.p-megamenu .p-menuitem-link:not(.p-disabled):hover .p-menuitem-icon,.p-megamenu .p-menuitem-link:not(.p-disabled):hover .p-submenu-icon{color:#6c757d}.p-megamenu .p-menuitem-link:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-megamenu .p-megamenu-panel{background:#fff;border:0;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);color:#495057}.p-megamenu .p-megamenu-submenu-header{background:#fff;border-top-left-radius:6px;border-top-right-radius:6px;color:#343a40;font-weight:700;margin:0;padding:.75rem 1.25rem}.p-megamenu .p-megamenu-submenu{padding:.25rem 0;width:12.5rem}.p-megamenu .p-megamenu-submenu .p-menu-separator{border-top:1px solid #dee2e6;margin:.25rem 0}.p-megamenu .p-menuitem.p-menuitem-active>.p-menuitem-link{background:#eff6ff}.p-megamenu .p-menuitem.p-menuitem-active>.p-menuitem-link .p-menuitem-icon,.p-megamenu .p-menuitem.p-menuitem-active>.p-menuitem-link .p-menuitem-text,.p-megamenu .p-menuitem.p-menuitem-active>.p-menuitem-link .p-submenu-icon{color:#1d4ed8}.p-megamenu.p-megamenu-vertical,.p-menu{padding:.25rem 0;width:12.5rem}.p-menu{background:#fff;border:1px solid #dee2e6;border-radius:6px;color:#495057}.p-menu .p-menuitem-link{border-radius:0;color:#495057;padding:.75rem 1.25rem;transition:box-shadow .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.p-menu .p-menuitem-link .p-menuitem-text{color:#495057}.p-menu .p-menuitem-link .p-menuitem-icon{color:#6c757d;margin-right:.5rem}.p-menu .p-menuitem-link .p-submenu-icon{color:#6c757d}.p-menu .p-menuitem-link:not(.p-disabled):hover{background:#e9ecef}.p-menu .p-menuitem-link:not(.p-disabled):hover .p-menuitem-text{color:#495057}.p-menu .p-menuitem-link:not(.p-disabled):hover .p-menuitem-icon,.p-menu .p-menuitem-link:not(.p-disabled):hover .p-submenu-icon{color:#6c757d}.p-menu .p-menuitem-link:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-menu.p-menu-overlay{background:#fff;border:0;box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.p-menu .p-submenu-header{background:#fff;border-top-left-radius:0;border-top-right-radius:0;color:#343a40;font-weight:700;margin:0;padding:.75rem 1.25rem}.p-menu .p-menu-separator{border-top:1px solid #dee2e6;margin:.25rem 0}.p-menubar{background:#f8f9fa;border:1px solid #dee2e6;border-radius:6px;color:#495057;padding:.5rem}.p-menubar .p-menuitem-link{border-radius:0;color:#495057;padding:.75rem 1.25rem;transition:box-shadow .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.p-menubar .p-menuitem-link .p-menuitem-text{color:#495057}.p-menubar .p-menuitem-link .p-menuitem-icon{color:#6c757d;margin-right:.5rem}.p-menubar .p-menuitem-link .p-submenu-icon{color:#6c757d}.p-menubar .p-menuitem-link:not(.p-disabled):hover{background:#e9ecef}.p-menubar .p-menuitem-link:not(.p-disabled):hover .p-menuitem-text{color:#495057}.p-menubar .p-menuitem-link:not(.p-disabled):hover .p-menuitem-icon,.p-menubar .p-menuitem-link:not(.p-disabled):hover .p-submenu-icon{color:#6c757d}.p-menubar .p-menuitem-link:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link{border-radius:6px;color:#495057;padding:.75rem 1.25rem;transition:box-shadow .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link .p-menuitem-text{color:#495057}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link .p-menuitem-icon{color:#6c757d;margin-right:.5rem}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link .p-submenu-icon{color:#6c757d;margin-left:.5rem}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link:not(.p-disabled):hover{background:#e9ecef}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link:not(.p-disabled):hover .p-menuitem-text{color:#495057}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link:not(.p-disabled):hover .p-menuitem-icon,.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link:not(.p-disabled):hover .p-submenu-icon{color:#6c757d}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-menubar .p-menubar-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link,.p-menubar .p-menubar-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link:not(.p-disabled):hover{background:#eff6ff}.p-menubar .p-menubar-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link .p-menuitem-icon,.p-menubar .p-menubar-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link .p-menuitem-text,.p-menubar .p-menubar-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link .p-submenu-icon,.p-menubar .p-menubar-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link:not(.p-disabled):hover .p-menuitem-icon,.p-menubar .p-menubar-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link:not(.p-disabled):hover .p-menuitem-text,.p-menubar .p-menubar-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link:not(.p-disabled):hover .p-submenu-icon{color:#1d4ed8}.p-menubar .p-submenu-list{background:#fff;border:0;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);padding:.25rem 0;width:12.5rem}.p-menubar .p-submenu-list .p-menu-separator{border-top:1px solid #dee2e6;margin:.25rem 0}.p-menubar .p-submenu-list .p-submenu-icon{font-size:.875rem}.p-menubar .p-menuitem.p-menuitem-active>.p-menuitem-link{background:#eff6ff}.p-menubar .p-menuitem.p-menuitem-active>.p-menuitem-link .p-menuitem-icon,.p-menubar .p-menuitem.p-menuitem-active>.p-menuitem-link .p-menuitem-text,.p-menubar .p-menuitem.p-menuitem-active>.p-menuitem-link .p-submenu-icon{color:#1d4ed8}@media screen and (max-width:960px){.p-menubar{position:relative}.p-menubar .p-menubar-button{border-radius:50%;color:#6c757d;display:flex;height:2rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-menubar .p-menubar-button:hover{background:#e9ecef;color:#6c757d}.p-menubar .p-menubar-button:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-menubar .p-menubar-root-list{background:#fff;border:0;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);display:none;padding:.25rem 0;position:absolute;width:100%}.p-menubar .p-menubar-root-list .p-menu-separator{border-top:1px solid #dee2e6;margin:.25rem 0}.p-menubar .p-menubar-root-list .p-submenu-icon{font-size:.875rem}.p-menubar .p-menubar-root-list>.p-menuitem{position:static;width:100%}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link{border-radius:0;color:#495057;padding:.75rem 1.25rem;transition:box-shadow .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link .p-menuitem-text{color:#495057}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link .p-menuitem-icon{color:#6c757d;margin-right:.5rem}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link .p-submenu-icon{color:#6c757d}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link:not(.p-disabled):hover{background:#e9ecef}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link:not(.p-disabled):hover .p-menuitem-text{color:#495057}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link:not(.p-disabled):hover .p-menuitem-icon,.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link:not(.p-disabled):hover .p-submenu-icon{color:#6c757d}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link>.p-submenu-icon{margin-left:auto;transition:transform .2s}.p-menubar .p-menubar-root-list>.p-menuitem.p-menuitem-active>.p-menuitem-link>.p-submenu-icon{transform:rotate(-180deg)}.p-menubar .p-menubar-root-list .p-submenu-list{border:0;box-shadow:none;position:static;width:100%}.p-menubar .p-menubar-root-list .p-submenu-list .p-submenu-icon{transform:rotate(90deg);transition:transform .2s}.p-menubar .p-menubar-root-list .p-submenu-list .p-menuitem-active>.p-menuitem-link>.p-submenu-icon{transform:rotate(-90deg)}.p-menubar .p-menubar-root-list .p-menuitem{position:static;width:100%}.p-menubar .p-menubar-root-list ul li a{padding-left:2.25rem}.p-menubar .p-menubar-root-list ul li ul li a{padding-left:3.75rem}.p-menubar .p-menubar-root-list ul li ul li ul li a{padding-left:5.25rem}.p-menubar .p-menubar-root-list ul li ul li ul li ul li a{padding-left:6.75rem}.p-menubar .p-menubar-root-list ul li ul li ul li ul li ul li a{padding-left:8.25rem}.p-menubar.p-menubar-mobile-active .p-menubar-root-list{display:flex;flex-direction:column;left:0;top:100%;z-index:1}}.p-panelmenu .p-panelmenu-header>a{background:#f8f9fa;border:1px solid #dee2e6;border-radius:6px;color:#6c757d;font-weight:700;padding:1.25rem;transition:box-shadow .2s}.p-panelmenu .p-panelmenu-header>a .p-menuitem-icon,.p-panelmenu .p-panelmenu-header>a .p-panelmenu-icon{margin-right:.5rem}.p-panelmenu .p-panelmenu-header>a:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-panelmenu .p-panelmenu-header:not(.p-highlight):not(.p-disabled)>a:hover{background:#e9ecef;border-color:#dee2e6;color:#343a40}.p-panelmenu .p-panelmenu-header.p-highlight{margin-bottom:0}.p-panelmenu .p-panelmenu-header.p-highlight>a{background:#f8f9fa;border-bottom-left-radius:0;border-bottom-right-radius:0;border-color:#dee2e6;color:#343a40}.p-panelmenu .p-panelmenu-header.p-highlight:not(.p-disabled)>a:hover{background:#e9ecef;border-color:#dee2e6;color:#343a40}.p-panelmenu .p-panelmenu-content{background:#fff;border:1px solid #dee2e6;border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top:0;border-top-left-radius:0;border-top-right-radius:0;color:#495057;margin-bottom:4px;padding:.25rem 0}.p-panelmenu .p-panelmenu-content .p-menuitem .p-menuitem-link{border-radius:0;color:#495057;padding:.75rem 1.25rem;transition:box-shadow .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.p-panelmenu .p-panelmenu-content .p-menuitem .p-menuitem-link .p-menuitem-text{color:#495057}.p-panelmenu .p-panelmenu-content .p-menuitem .p-menuitem-link .p-menuitem-icon{color:#6c757d;margin-right:.5rem}.p-panelmenu .p-panelmenu-content .p-menuitem .p-menuitem-link .p-submenu-icon{color:#6c757d}.p-panelmenu .p-panelmenu-content .p-menuitem .p-menuitem-link:not(.p-disabled):hover{background:#e9ecef}.p-panelmenu .p-panelmenu-content .p-menuitem .p-menuitem-link:not(.p-disabled):hover .p-menuitem-text{color:#495057}.p-panelmenu .p-panelmenu-content .p-menuitem .p-menuitem-link:not(.p-disabled):hover .p-menuitem-icon,.p-panelmenu .p-panelmenu-content .p-menuitem .p-menuitem-link:not(.p-disabled):hover .p-submenu-icon{color:#6c757d}.p-panelmenu .p-panelmenu-content .p-menuitem .p-menuitem-link:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-panelmenu .p-panelmenu-content .p-menuitem .p-menuitem-link .p-panelmenu-icon{margin-right:.5rem}.p-panelmenu .p-panelmenu-content .p-submenu-list:not(.p-panelmenu-root-submenu){padding:0 0 0 1rem}.p-panelmenu .p-panelmenu-panel{margin-bottom:4px}.p-steps .p-steps-item .p-menuitem-link{background:transparent;background:#fff;border-radius:6px;transition:box-shadow .2s}.p-steps .p-steps-item .p-menuitem-link .p-steps-number{background:#fff;border:1px solid #e9ecef;border-radius:50%;color:#495057;font-size:1.143rem;height:2rem;line-height:2rem;min-width:2rem;z-index:1}.p-steps .p-steps-item .p-menuitem-link .p-steps-title{color:#6c757d;margin-top:.5rem}.p-steps .p-steps-item .p-menuitem-link:not(.p-disabled):focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-steps .p-steps-item.p-highlight .p-steps-number{background:#eff6ff;color:#1d4ed8}.p-steps .p-steps-item.p-highlight .p-steps-title{color:#495057;font-weight:700}.p-steps .p-steps-item:before{border-top:1px solid #dee2e6;content:" ";display:block;left:0;margin-top:-1rem;position:absolute;top:50%;width:100%}.p-tabmenu .p-tabmenu-nav{background:#fff;border:solid #dee2e6;border-width:0 0 2px}.p-tabmenu .p-tabmenu-nav .p-tabmenuitem{margin-right:0}.p-tabmenu .p-tabmenu-nav .p-tabmenuitem .p-menuitem-link{background:#fff;border:0 solid transparent;border-bottom:2px solid #dee2e6;border-top-left-radius:6px;border-top-right-radius:6px;color:#6c757d;font-weight:700;margin:0 0 -2px;padding:1.25rem;transition:box-shadow .2s}.p-tabmenu .p-tabmenu-nav .p-tabmenuitem .p-menuitem-link .p-menuitem-icon{margin-right:.5rem}.p-tabmenu .p-tabmenu-nav .p-tabmenuitem .p-menuitem-link:not(.p-disabled):focus{box-shadow:inset 0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-tabmenu .p-tabmenu-nav .p-tabmenuitem:not(.p-highlight):not(.p-disabled):hover .p-menuitem-link{background:#fff;border-color:#adb5bd;color:#6c757d}.p-tabmenu .p-tabmenu-nav .p-tabmenuitem.p-highlight .p-menuitem-link{background:#fff;border-color:#3b82f6;color:#3b82f6}.p-tieredmenu{background:#fff;border:1px solid #dee2e6;border-radius:6px;color:#495057;padding:.25rem 0;width:12.5rem}.p-tieredmenu .p-menuitem-link{border-radius:0;color:#495057;padding:.75rem 1.25rem;transition:box-shadow .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.p-tieredmenu .p-menuitem-link .p-menuitem-text{color:#495057}.p-tieredmenu .p-menuitem-link .p-menuitem-icon{color:#6c757d;margin-right:.5rem}.p-tieredmenu .p-menuitem-link .p-submenu-icon{color:#6c757d}.p-tieredmenu .p-menuitem-link:not(.p-disabled):hover{background:#e9ecef}.p-tieredmenu .p-menuitem-link:not(.p-disabled):hover .p-menuitem-text{color:#495057}.p-tieredmenu .p-menuitem-link:not(.p-disabled):hover .p-menuitem-icon,.p-tieredmenu .p-menuitem-link:not(.p-disabled):hover .p-submenu-icon{color:#6c757d}.p-tieredmenu .p-menuitem-link:focus{box-shadow:inset 0 0 0 .15rem #bfdbfe;outline:0 none;outline-offset:0}.p-tieredmenu .p-submenu-list,.p-tieredmenu.p-tieredmenu-overlay{background:#fff;border:0;box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.p-tieredmenu .p-submenu-list{padding:.25rem 0}.p-tieredmenu .p-menuitem.p-menuitem-active>.p-menuitem-link{background:#eff6ff}.p-tieredmenu .p-menuitem.p-menuitem-active>.p-menuitem-link .p-menuitem-icon,.p-tieredmenu .p-menuitem.p-menuitem-active>.p-menuitem-link .p-menuitem-text,.p-tieredmenu .p-menuitem.p-menuitem-active>.p-menuitem-link .p-submenu-icon{color:#1d4ed8}.p-tieredmenu .p-menu-separator{border-top:1px solid #dee2e6;margin:.25rem 0}.p-tieredmenu .p-submenu-icon{font-size:.875rem}.p-inline-message{border-radius:6px;margin:0;padding:.75rem}.p-inline-message.p-inline-message-info{background:#e9e9ff;border:0 solid #696cff;color:#696cff}.p-inline-message.p-inline-message-info .p-inline-message-icon{color:#696cff}.p-inline-message.p-inline-message-success{background:#e4f8f0;border:0 solid #1ea97c;color:#1ea97c}.p-inline-message.p-inline-message-success .p-inline-message-icon{color:#1ea97c}.p-inline-message.p-inline-message-warn{background:#fff2e2;border:0 solid #cc8925;color:#cc8925}.p-inline-message.p-inline-message-warn .p-inline-message-icon{color:#cc8925}.p-inline-message.p-inline-message-error{background:#ffe7e6;border:0 solid #ff5757;color:#ff5757}.p-inline-message.p-inline-message-error .p-inline-message-icon{color:#ff5757}.p-inline-message .p-inline-message-icon{font-size:1rem;margin-right:.5rem}.p-inline-message .p-inline-message-text{font-size:1rem}.p-inline-message.p-inline-message-icon-only .p-inline-message-icon{margin-right:0}.p-message{border-radius:6px;margin:1rem 0}.p-message .p-message-wrapper{padding:1.25rem 1.75rem}.p-message .p-message-close{background:transparent;border-radius:50%;height:2rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-message .p-message-close:hover{background:hsla(0,0%,100%,.3)}.p-message .p-message-close:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-message.p-message-info{background:#e9e9ff;border:solid #696cff;border-width:0 0 0 6px;color:#696cff}.p-message.p-message-info .p-message-close,.p-message.p-message-info .p-message-icon{color:#696cff}.p-message.p-message-success{background:#e4f8f0;border:solid #1ea97c;border-width:0 0 0 6px;color:#1ea97c}.p-message.p-message-success .p-message-close,.p-message.p-message-success .p-message-icon{color:#1ea97c}.p-message.p-message-warn{background:#fff2e2;border:solid #cc8925;border-width:0 0 0 6px;color:#cc8925}.p-message.p-message-warn .p-message-close,.p-message.p-message-warn .p-message-icon{color:#cc8925}.p-message.p-message-error{background:#ffe7e6;border:solid #ff5757;border-width:0 0 0 6px;color:#ff5757}.p-message.p-message-error .p-message-close,.p-message.p-message-error .p-message-icon{color:#ff5757}.p-message .p-message-text{font-size:1rem;font-weight:400}.p-message .p-message-icon{font-size:1.5rem;margin-right:.5rem}.p-toast{opacity:.9}.p-toast .p-toast-message{border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);margin:0 0 1rem}.p-toast .p-toast-message .p-toast-message-content{border-width:0 0 0 6px;padding:1rem}.p-toast .p-toast-message .p-toast-message-content .p-toast-message-text{margin:0 0 0 1rem}.p-toast .p-toast-message .p-toast-message-content .p-toast-message-icon{font-size:2rem}.p-toast .p-toast-message .p-toast-message-content .p-toast-summary{font-weight:700}.p-toast .p-toast-message .p-toast-message-content .p-toast-detail{margin:.5rem 0 0}.p-toast .p-toast-message .p-toast-icon-close{background:transparent;border-radius:50%;height:2rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-toast .p-toast-message .p-toast-icon-close:hover{background:hsla(0,0%,100%,.3)}.p-toast .p-toast-message .p-toast-icon-close:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-toast .p-toast-message.p-toast-message-info{background:#e9e9ff;border:solid #696cff;border-width:0 0 0 6px;color:#696cff}.p-toast .p-toast-message.p-toast-message-info .p-toast-icon-close,.p-toast .p-toast-message.p-toast-message-info .p-toast-message-icon{color:#696cff}.p-toast .p-toast-message.p-toast-message-success{background:#e4f8f0;border:solid #1ea97c;border-width:0 0 0 6px;color:#1ea97c}.p-toast .p-toast-message.p-toast-message-success .p-toast-icon-close,.p-toast .p-toast-message.p-toast-message-success .p-toast-message-icon{color:#1ea97c}.p-toast .p-toast-message.p-toast-message-warn{background:#fff2e2;border:solid #cc8925;border-width:0 0 0 6px;color:#cc8925}.p-toast .p-toast-message.p-toast-message-warn .p-toast-icon-close,.p-toast .p-toast-message.p-toast-message-warn .p-toast-message-icon{color:#cc8925}.p-toast .p-toast-message.p-toast-message-error{background:#ffe7e6;border:solid #ff5757;border-width:0 0 0 6px;color:#ff5757}.p-toast .p-toast-message.p-toast-message-error .p-toast-icon-close,.p-toast .p-toast-message.p-toast-message-error .p-toast-message-icon{color:#ff5757}.p-galleria .p-galleria-close{background:transparent;border-radius:50%;color:#f8f9fa;height:4rem;margin:.5rem;transition:background-color .2s,color .2s,box-shadow .2s;width:4rem}.p-galleria .p-galleria-close .p-galleria-close-icon{font-size:2rem}.p-galleria .p-galleria-close:hover{background:hsla(0,0%,100%,.1);color:#f8f9fa}.p-galleria .p-galleria-item-nav{background:transparent;border-radius:6px;color:#f8f9fa;height:4rem;margin:0 .5rem;transition:background-color .2s,color .2s,box-shadow .2s;width:4rem}.p-galleria .p-galleria-item-nav .p-galleria-item-next-icon,.p-galleria .p-galleria-item-nav .p-galleria-item-prev-icon{font-size:2rem}.p-galleria .p-galleria-item-nav:not(.p-disabled):hover{background:hsla(0,0%,100%,.1);color:#f8f9fa}.p-galleria .p-galleria-caption{background:rgba(0,0,0,.5);color:#f8f9fa;padding:1rem}.p-galleria .p-galleria-indicators{padding:1rem}.p-galleria .p-galleria-indicators .p-galleria-indicator button{background-color:#ced4da;border-radius:50%;height:1rem;transition:background-color .2s,color .2s,box-shadow .2s;width:1rem}.p-galleria .p-galleria-indicators .p-galleria-indicator button:hover{background:#adb5bd}.p-galleria .p-galleria-indicators .p-galleria-indicator.p-highlight button{background:#eff6ff;color:#1d4ed8}.p-galleria.p-galleria-indicators-bottom .p-galleria-indicator,.p-galleria.p-galleria-indicators-top .p-galleria-indicator{margin-right:.5rem}.p-galleria.p-galleria-indicators-left .p-galleria-indicator,.p-galleria.p-galleria-indicators-right .p-galleria-indicator{margin-bottom:.5rem}.p-galleria.p-galleria-indicator-onitem .p-galleria-indicators{background:rgba(0,0,0,.5)}.p-galleria.p-galleria-indicator-onitem .p-galleria-indicators .p-galleria-indicator button{background:hsla(0,0%,100%,.4)}.p-galleria.p-galleria-indicator-onitem .p-galleria-indicators .p-galleria-indicator button:hover{background:hsla(0,0%,100%,.6)}.p-galleria.p-galleria-indicator-onitem .p-galleria-indicators .p-galleria-indicator.p-highlight button{background:#eff6ff;color:#1d4ed8}.p-galleria .p-galleria-thumbnail-container{background:rgba(0,0,0,.9);padding:1rem .25rem}.p-galleria .p-galleria-thumbnail-container .p-galleria-thumbnail-next,.p-galleria .p-galleria-thumbnail-container .p-galleria-thumbnail-prev{background-color:transparent;border-radius:50%;color:#f8f9fa;height:2rem;margin:.5rem;transition:background-color .2s,color .2s,box-shadow .2s;width:2rem}.p-galleria .p-galleria-thumbnail-container .p-galleria-thumbnail-next:hover,.p-galleria .p-galleria-thumbnail-container .p-galleria-thumbnail-prev:hover{background:hsla(0,0%,100%,.1);color:#f8f9fa}.p-galleria .p-galleria-thumbnail-container .p-galleria-thumbnail-item-content:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-galleria-mask,.p-image-mask{--maskbg:rgba(0,0,0,.9)}.p-image-preview-indicator{background-color:transparent;color:#f8f9fa;transition:background-color .2s,color .2s,box-shadow .2s}.p-image-preview-container:hover>.p-image-preview-indicator{background-color:rgba(0,0,0,.5)}.p-image-toolbar{padding:1rem}.p-image-action.p-link{background-color:transparent;border-radius:50%;color:#f8f9fa;height:3rem;margin-right:.5rem;transition:background-color .2s,color .2s,box-shadow .2s;width:3rem}.p-image-action.p-link:last-child{margin-right:0}.p-image-action.p-link:hover{background-color:hsla(0,0%,100%,.1);color:#f8f9fa}.p-image-action.p-link i{font-size:1.5rem}.p-avatar{background-color:#dee2e6;border-radius:6px}.p-avatar.p-avatar-lg{font-size:1.5rem;height:3rem;width:3rem}.p-avatar.p-avatar-lg .p-avatar-icon{font-size:1.5rem}.p-avatar.p-avatar-xl{font-size:2rem;height:4rem;width:4rem}.p-avatar.p-avatar-xl .p-avatar-icon{font-size:2rem}.p-avatar-group .p-avatar{border:2px solid #fff}.p-badge{background:#3b82f6;color:#fff;font-size:.75rem;font-weight:700;height:1.5rem;line-height:1.5rem;min-width:1.5rem}.p-badge.p-badge-secondary{background-color:#64748b;color:#fff}.p-badge.p-badge-success{background-color:#22c55e;color:#fff}.p-badge.p-badge-info{background-color:#3b82f6;color:#fff}.p-badge.p-badge-warning{background-color:#f59e0b;color:#fff}.p-badge.p-badge-danger{background-color:#ef4444;color:#fff}.p-badge.p-badge-lg{font-size:1.125rem;height:2.25rem;line-height:2.25rem;min-width:2.25rem}.p-badge.p-badge-xl{font-size:1.5rem;height:3rem;line-height:3rem;min-width:3rem}.p-chip{background-color:#dee2e6;border-radius:16px;color:#495057;padding:0 .75rem}.p-chip .p-chip-text{line-height:1.5;margin-bottom:.375rem;margin-top:.375rem}.p-chip .p-chip-icon,.p-chip img{margin-right:.5rem}.p-chip img{height:2.25rem;margin-left:-.75rem;width:2.25rem}.p-chip .p-chip-remove-icon{border-radius:6px;margin-left:.5rem;transition:background-color .2s,color .2s,box-shadow .2s}.p-chip .p-chip-remove-icon:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-inplace .p-inplace-display{border-radius:6px;padding:.75rem;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.p-inplace .p-inplace-display:not(.p-disabled):hover{background:#e9ecef;color:#495057}.p-inplace .p-inplace-display:focus{box-shadow:0 0 0 .2rem #bfdbfe;outline:0 none;outline-offset:0}.p-progressbar{background:#dee2e6;border:0;border-radius:6px;height:1.5rem}.p-progressbar .p-progressbar-value{background:#3b82f6;border:0;margin:0}.p-progressbar .p-progressbar-label{color:#fff;line-height:1.5rem}.p-scrolltop{border-radius:50%;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);height:3rem;transition:background-color .2s,color .2s,box-shadow .2s;width:3rem}.p-scrolltop.p-link{background:rgba(0,0,0,.7)}.p-scrolltop.p-link:hover{background:rgba(0,0,0,.8)}.p-scrolltop .p-scrolltop-icon{color:#f8f9fa;font-size:1.5rem}.p-skeleton{background-color:#dee2e6;border-radius:6px}.p-skeleton:after{background:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.4),hsla(0,0%,100%,0))}.p-tag{background:#3b82f6;border-radius:6px;color:#fff;font-size:.75rem;font-weight:700;padding:.25rem .4rem}.p-tag.p-tag-success{background-color:#22c55e;color:#fff}.p-tag.p-tag-info{background-color:#3b82f6;color:#fff}.p-tag.p-tag-warning{background-color:#f59e0b;color:#fff}.p-tag.p-tag-danger{background-color:#ef4444;color:#fff}.p-tag .p-tag-icon{font-size:.75rem;margin-right:.25rem}.p-terminal{background:#fff;border:1px solid #dee2e6;color:#495057;padding:1.25rem}.p-terminal .p-terminal-input{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem}.p-button-label{font-weight:700}.p-accordion .p-accordion-header .p-accordion-header-link,.p-tabview .p-tabview-nav li .p-tabview-nav-link{transition:background-color .2s,border-color .2s,box-shadow .2s}.p-carousel .p-carousel-indicators .p-carousel-indicator.p-highlight button,.p-galleria .p-galleria-indicators .p-galleria-indicator.p-highlight button{background-color:#3b82f6}.p-button:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #9dc1fb,0 1px 2px 0 #000}.p-button.p-button-secondary:enabled:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #b0b9c6,0 1px 2px 0 #000}.p-button.p-button-success:enabled:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #88eaac,0 1px 2px 0 #000}.p-button.p-button-info:enabled:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #9dc1fb,0 1px 2px 0 #000}.p-button.p-button-warning:enabled:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #facf85,0 1px 2px 0 #000}.p-button.p-button-help:enabled:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #d4aafb,0 1px 2px 0 #000}.p-button.p-button-danger:enabled:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #f7a2a2,0 1px 2px 0 #000}.p-datatable .p-datatable-tbody>tr.p-datatable-dragpoint-top>td{box-shadow:inset 0 2px 0 0 #3b82f6}.p-datatable .p-datatable-tbody>tr.p-datatable-dragpoint-bottom>td{box-shadow:inset 0 -2px 0 0 #3b82f6}',""]),n.locals={},e.exports=n},function(e,t,r){var n=r(373);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,r(40).default)("9e4f9518",n,!0,{sourceMap:!1})},function(e,t,r){var n=r(39)((function(e){return e[1]}));n.push([e.i,".mapboxgl-map{-webkit-tap-highlight-color:rgba(0,0,0,0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E\")}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 0 1 3.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 0 0-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 0 0 4.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 0 1-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 0 1 .3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 0 1-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3' opacity='.3'%3E%3Ccircle cx='11.5' cy='11.5' r='9.25' mask='url(%23c)'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff' opacity='.9'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 0 1 3.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 0 0-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 0 0 4.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 0 1-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 0 1 .3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 0 1-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle cx='11.5' cy='11.5' r='9.25' mask='url(%23c)'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 0 1 3.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 0 0-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 0 0 4.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 0 1-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 0 1 .3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 0 1-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg fill='%23fff' stroke='%23fff' stroke-width='3'%3E%3Ccircle cx='11.5' cy='11.5' r='9.25' mask='url(%23c)'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);-webkit-text-decoration:none;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;-webkit-text-decoration:underline;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:\"\";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:\"\";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}",""]),n.locals={},e.exports=n},,,,,,,,,,,,,,,,,,,,function(e,t,r){e.exports=function(){"use strict";return function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)}}}()},function(e,t,r){e.exports=function(){"use strict";return function(e,t){t.prototype.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)}}}()},,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";var n=r(240);e.exports=n},function(e,t,r){"use strict";var n=r(415),i=r(417),o=r(120),a=r(418),s={};function l(e){var t=e.total,r=e.loaded;return{total:t,transferred:r,percent:100*r/t}}function c(e,t){return new Promise((function(r,n){t.onprogress=function(t){e.emitter.emit(o.EVENT_PROGRESS_DOWNLOAD,l(t))};var a=e.file;a&&(t.upload.onprogress=function(t){e.emitter.emit(o.EVENT_PROGRESS_UPLOAD,l(t))}),t.onerror=function(e){n(e)},t.onabort=function(){var t=new i({request:e,type:o.ERROR_REQUEST_ABORTED});n(t)},t.onload=function(){if(delete s[e.id],t.status<200||t.status>=400){var o=new i({request:e,body:t.response,statusCode:t.status});n(o)}else r(t)};var c=e.body;"string"==typeof c?t.send(c):c?t.send(JSON.stringify(c)):a?t.send(a):t.send(),s[e.id]=t})).then((function(t){return function(e,t){return new n(e,{body:t.response,headers:a(t.getAllResponseHeaders()),statusCode:t.status})}(e,t)}))}function u(e,t){var r=e.url(t),n=new window.XMLHttpRequest;return n.open(e.method,r),Object.keys(e.headers).forEach((function(t){n.setRequestHeader(t,e.headers[t])})),n}e.exports={browserAbort:function(e){var t=s[e.id];t&&(t.abort(),delete s[e.id])},sendRequestXhr:c,browserSend:function(e){return Promise.resolve().then((function(){var t=u(e,e.client.accessToken);return c(e,t)}))},createRequestXhr:u}},function(e,t,r){"use strict";var n=r(416);function i(e,t){this.request=e,this.headers=t.headers,this.rawBody=t.body,this.statusCode=t.statusCode;try{this.body=JSON.parse(t.body||"{}")}catch(e){this.body=t.body}this.links=n(this.headers.link)}i.prototype.hasNextPage=function(){return!!this.links.next},i.prototype.nextPage=function(){return this.hasNextPage()?this.request._extend({path:this.links.next.url}):null},e.exports=i},function(e,t,r){"use strict";e.exports=function(e){return e?e.split(/,\s*</).reduce((function(e,t){var r=function(e){var t=e.match(/<?([^>]*)>(.*)/);if(!t)return null;var r=t[1],n=t[2].split(";"),i=null,o=n.reduce((function(e,t){var r=function(e){var t=e.match(/\s*(.+)\s*=\s*"?([^"]+)"?/);return t?{key:t[1],value:t[2]}:null}(t);return r?"rel"===r.key?(i||(i=r.value),e):(e[r.key]=r.value,e):e}),{});return i?{url:r,rel:i,params:o}:null}(t);return r?(r.rel.split(/\s+/).forEach((function(t){e[t]||(e[t]={url:r.url,params:r.params})})),e):e}),{}):{}}},function(e,t,r){"use strict";var n=r(120);e.exports=function(e){var t,r=e.type||n.ERROR_HTTP;if(e.body)try{t=JSON.parse(e.body)}catch(r){t=e.body}else t=null;var i=e.message||null;i||("string"==typeof t?i=t:t&&"string"==typeof t.message?i=t.message:r===n.ERROR_REQUEST_ABORTED&&(i="Request aborted")),this.message=i,this.type=r,this.statusCode=e.statusCode||null,this.request=e.request,this.body=t}},function(e,t,r){"use strict";e.exports=function(e){var t={};return e?(e.trim().split(/[\r|\n]+/).forEach((function(e){var r=function(e){var t=e.indexOf(":");return{name:e.substring(0,t).trim().toLowerCase(),value:e.substring(t+1).trim()}}(e);t[r.name]=r.value})),t):t}},function(e,t,r){(function(e,n){var i;!function(o){var a=t,s=(e&&e.exports,"object"==typeof n&&n);s.global!==s&&s.window;var l=function(e){this.message=e};(l.prototype=new Error).name="InvalidCharacterError";var c=function(e){throw new l(e)},u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=/[\t\n\f\r ]/g,h={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&c("The string to be encoded contains characters outside of the Latin1 range.");for(var t,r,n,i,o=e.length%3,a="",s=-1,l=e.length-o;++s<l;)t=e.charCodeAt(s)<<16,r=e.charCodeAt(++s)<<8,n=e.charCodeAt(++s),a+=u.charAt((i=t+r+n)>>18&63)+u.charAt(i>>12&63)+u.charAt(i>>6&63)+u.charAt(63&i);return 2==o?(t=e.charCodeAt(s)<<8,r=e.charCodeAt(++s),a+=u.charAt((i=t+r)>>10)+u.charAt(i>>4&63)+u.charAt(i<<2&63)+"="):1==o&&(i=e.charCodeAt(s),a+=u.charAt(i>>2)+u.charAt(i<<4&63)+"=="),a},decode:function(e){var t=(e=String(e).replace(p,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&c("Invalid character: the string to be decoded is not correctly encoded.");for(var r,n,i=0,o="",a=-1;++a<t;)n=u.indexOf(e.charAt(a)),r=i%4?64*r+n:n,i++%4&&(o+=String.fromCharCode(255&r>>(-2*i&6)));return o},version:"0.1.0"};void 0===(i=function(){return h}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(191)(e),r(31))},function(e,t,r){"use strict";var n=r(242),i=r(121),o=r(421),a=r(422),s=r(120),l=1;function c(e,t){if(!e)throw new Error("MapiRequest requires a client");if(!t||!t.path||!t.method)throw new Error("MapiRequest requires an options object with path and method properties");var r={};t.body&&(r["content-type"]="application/json");var n=i(r,t.headers),a=Object.keys(n).reduce((function(e,t){return e[t.toLowerCase()]=n[t],e}),{});this.id=l++,this._options=t,this.emitter=new o,this.client=e,this.response=null,this.error=null,this.sent=!1,this.aborted=!1,this.path=t.path,this.method=t.method,this.origin=t.origin||e.origin,this.query=t.query||{},this.params=t.params||{},this.body=t.body||null,this.file=t.file||null,this.encoding=t.encoding||"utf8",this.sendFileAs=t.sendFileAs||null,this.headers=a}c.prototype.url=function(e){var t=a.prependOrigin(this.path,this.origin);t=a.appendQueryObject(t,this.query);var r=this.params,o=null==e?this.client.accessToken:e;if(o){t=a.appendQueryParam(t,"access_token",o);var s=n(o).user;r=i({ownerId:s},r)}return t=a.interpolateRouteParams(t,r),t},c.prototype.send=function(){var e=this;if(e.sent)throw new Error("This request has already been sent. Check the response and error properties. Create a new request with clone().");return e.sent=!0,e.client.sendRequest(e).then((function(t){return e.response=t,e.emitter.emit(s.EVENT_RESPONSE,t),t}),(function(t){throw e.error=t,e.emitter.emit(s.EVENT_ERROR,t),t}))},c.prototype.abort=function(){this._nextPageRequest&&(this._nextPageRequest.abort(),delete this._nextPageRequest),this.response||this.error||this.aborted||(this.aborted=!0,this.client.abortRequest(this))},c.prototype.eachPage=function(e){var t=this;function r(r){e(null,r,(function(){delete t._nextPageRequest;var e=r.nextPage();e&&(t._nextPageRequest=e,i(e))}))}function n(t){e(t,null,(function(){}))}function i(e){e.send().then(r,n)}i(this)},c.prototype.clone=function(){return this._extend()},c.prototype._extend=function(e){var t=i(this._options,e);return new c(this.client,t)},e.exports=c},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,i="~";function o(){}function a(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,r,n,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,n||e,o),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function l(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},c.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,a=new Array(o);n<o;n++)a[n]=r[n].fn;return a},c.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},c.prototype.emit=function(e,t,r,n,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,n),!0;case 5:return u.fn.call(u.context,t,r,n,o),!0;case 6:return u.fn.call(u.context,t,r,n,o,a),!0}for(c=1,l=new Array(p-1);c<p;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var h,d=u.length;for(c=0;c<d;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),p){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,n);break;default:if(!l)for(h=1,l=new Array(p-1);h<p;h++)l[h-1]=arguments[h];u[c].fn.apply(u[c].context,l)}}return!0},c.prototype.on=function(e,t,r){return s(this,e,t,r,!1)},c.prototype.once=function(e,t,r){return s(this,e,t,r,!0)},c.prototype.removeListener=function(e,t,r,n){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return l(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||n&&!a.once||r&&a.context!==r||l(this,o);else{for(var s=0,c=[],u=a.length;s<u;s++)(a[s].fn!==t||n&&!a[s].once||r&&a[s].context!==r)&&c.push(a[s]);c.length?this._events[o]=1===c.length?c[0]:c:l(this,o)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&l(this,t)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=i,c.EventEmitter=c,e.exports=c},function(e,t,r){"use strict";function n(e){return Array.isArray(e)?e.map(encodeURIComponent).join(","):encodeURIComponent(String(e))}function i(e,t,r){if(!1===r||null===r)return e;var i=/\?/.test(e)?"&":"?",o=encodeURIComponent(t);return void 0!==r&&""!==r&&!0!==r&&(o+="="+n(r)),""+e+i+o}e.exports={appendQueryObject:function(e,t){if(!t)return e;var r=e;return Object.keys(t).forEach((function(e){var n=t[e];void 0!==n&&(Array.isArray(n)&&(n=n.filter((function(e){return null!=e})).join(",")),r=i(r,e,n))})),r},appendQueryParam:i,prependOrigin:function(e,t){if(!t)return e;if("http"===e.slice(0,4))return e;var r="/"===e[0]?"":"/";return""+t.replace(/\/$/,"")+r+e},interpolateRouteParams:function(e,t){return t?e.replace(/\/:([a-zA-Z0-9]+)/g,(function(e,r){var i=t[r];if(void 0===i)throw new Error("Unspecified route parameter "+r);return"/"+n(i)})):e}}},function(e,t,r){"use strict";var n=r(121),i=r(424),o=r(427),a=r(428),s=r(430),l={},c=["country","region","postcode","district","place","locality","neighborhood","address","poi","poi.landmark"];l.forwardGeocode=function(e){i.assertShape({query:i.required(i.string),mode:i.oneOf("mapbox.places","mapbox.places-permanent"),countries:i.arrayOf(i.string),proximity:i.oneOf(i.coordinates,"ip"),types:i.arrayOf(i.oneOf(c)),autocomplete:i.boolean,bbox:i.arrayOf(i.number),limit:i.number,language:i.arrayOf(i.string),routing:i.boolean,fuzzyMatch:i.boolean,worldview:i.string})(e),e.mode=e.mode||"mapbox.places";var t=a(n({country:e.countries},o(e,["proximity","types","autocomplete","bbox","limit","language","routing","fuzzyMatch","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:o(e,["mode","query"]),query:t})},l.reverseGeocode=function(e){i.assertShape({query:i.required(i.coordinates),mode:i.oneOf("mapbox.places","mapbox.places-permanent"),countries:i.arrayOf(i.string),types:i.arrayOf(i.oneOf(c)),bbox:i.arrayOf(i.number),limit:i.number,language:i.arrayOf(i.string),reverseMode:i.oneOf("distance","score"),routing:i.boolean,worldview:i.string})(e),e.mode=e.mode||"mapbox.places";var t=a(n({country:e.countries},o(e,["country","types","bbox","limit","language","reverseMode","routing","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:o(e,["mode","query"]),query:t})},e.exports=s(l)},function(e,t,r){"use strict";(function(t){var n=r(121),i=r(425);e.exports=n(i,{file:function(e){if("undefined"!=typeof window){if(e instanceof t.Blob||e instanceof t.ArrayBuffer)return;return"Blob or ArrayBuffer"}if("string"!=typeof e&&void 0===e.pipe)return"Filename or Readable stream"},date:function(e){var t="date";if("boolean"==typeof e)return t;try{var r=new Date(e);if(r.getTime&&isNaN(r.getTime()))return t}catch(e){return t}},coordinates:function(e){return i.tuple(i.number,i.number)(e)},assertShape:function(e,t){return i.assert(i.strictShape(e),t)}})}).call(this,r(31))},function(e,t,r){"use strict";var n=r(426),i=r(121),o="value",a="\n  ",s={};function l(e){var t=Array.isArray(e);return function(r){var n,i=c(s.plainArray,r);if(i)return i;if(t&&r.length!==e.length)return"an array with "+e.length+" items";for(var o=0;o<r.length;o++)if(i=c((n=o,t?e[n]:e),r[o]))return[o].concat(i)}}function c(e,t){if(null!=t||e.hasOwnProperty("__required")){var r=e(t);return r?Array.isArray(r)?r:[r]:void 0}}function u(e,t){var r=e.length,n=e[r-1],a=e.slice(0,r-1);return 0===a.length&&(a=[o]),t=i(t,{path:a}),"function"==typeof n?n(t):p(t,function(e){return"must be "+function(e){if(/^an? /.test(e))return e;if(/^[aeiou]/i.test(e))return"an "+e;if(/^[a-z]/i.test(e))return"a "+e;return e}(e)+"."}(n))}function p(e,t){return(h(e.path)?"Item at position ":"")+(e.path.join(".")+" "+t)}function h(e){return"number"==typeof e[e.length-1]||"number"==typeof e[0]}s.assert=function(e,t){return t=t||{},function(r){var n=c(e,r);if(n){var i=u(n,t);throw t.apiName&&(i=t.apiName+": "+i),new Error(i)}}},s.shape=function(e){var t,r=(t=e,Object.keys(t||{}).map((function(e){return{key:e,value:t[e]}})));return function(e){var t,n=c(s.plainObject,e);if(n)return n;for(var i=[],l=0;l<r.length;l++)t=r[l].key,(n=c(r[l].value,e[t]))&&i.push([t].concat(n));return i.length<2?i[0]:function(e){i=i.map((function(t){return"- "+t[0]+": "+u(t,e).split("\n").join(a)}));var t=e.path.join(".");return"The following properties"+(t===o?"":" of "+t)+" have invalid values:"+a+i.join(a)}}},s.strictShape=function(e){var t=s.shape(e);return function(r){var n=t(r);if(n)return n;var i=Object.keys(r).reduce((function(t,r){return void 0===e[r]&&t.push(r),t}),[]);return 0!==i.length?function(){return"The following keys are invalid: "+i.join(", ")}:void 0}},s.arrayOf=function(e){return l(e)},s.tuple=function(){return l(Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments))},s.required=function(e){function t(t){return null==t?function(e){return p(e,h(e.path)?"cannot be undefined/null.":"is required.")}:e.apply(this,arguments)}return t.__required=!0,t},s.oneOfType=function(){var e=Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments);return function(t){var r=e.map((function(e){return c(e,t)})).filter(Boolean);if(r.length===e.length)return r.every((function(e){return 1===e.length&&"string"==typeof e[0]}))?function(e){if(e.length<2)return e[0];if(2===e.length)return e.join(" or ");return e.slice(0,-1).join(", ")+", or "+e.slice(-1)}(r.map((function(e){return e[0]}))):r.reduce((function(e,t){return t.length>e.length?t:e}))}},s.equal=function(e){return function(t){if(t!==e)return JSON.stringify(e)}},s.oneOf=function(){var e=(Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments)).map((function(e){return s.equal(e)}));return s.oneOfType.apply(this,e)},s.range=function(e){var t=e[0],r=e[1];return function(e){if(c(s.number,e)||e<t||e>r)return"number between "+t+" & "+r+" (inclusive)"}},s.any=function(){},s.boolean=function(e){if("boolean"!=typeof e)return"boolean"},s.number=function(e){if("number"!=typeof e)return"number"},s.plainArray=function(e){if(!Array.isArray(e))return"array"},s.plainObject=function(e){if(!n(e))return"object"},s.string=function(e){if("string"!=typeof e)return"string"},s.func=function(e){if("function"!=typeof e)return"function"},s.validate=c,s.processMessage=u,e.exports=s},function(e,t,r){"use strict";var n=Object.prototype.toString;e.exports=function(e){var t;return"[object Object]"===n.call(e)&&(null===(t=Object.getPrototypeOf(e))||t===Object.getPrototypeOf({}))}},function(e,t,r){"use strict";e.exports=function(e,t){var r=function(e,r){return-1!==t.indexOf(e)&&void 0!==r};return"function"==typeof t&&(r=t),Object.keys(e).filter((function(t){return r(t,e[t])})).reduce((function(t,r){return t[r]=e[r],t}),{})}},function(e,t,r){"use strict";var n=r(429);e.exports=function(e){return n(e,(function(e,t){return"boolean"==typeof t?JSON.stringify(t):t}))}},function(e,t,r){"use strict";e.exports=function(e,t){return Object.keys(e).reduce((function(r,n){return r[n]=t(n,e[n]),r}),{})}},function(e,t,r){"use strict";var n=r(241),i=r(240);e.exports=function(e){return function(t){var r;r=n.prototype.isPrototypeOf(t)?t:i(t);var o=Object.create(e);return o.client=r,o}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(293);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var l={ripple:!1,inputStyle:"outlined",locale:{startsWith:"Starts with",contains:"Contains",notContains:"Not contains",endsWith:"Ends with",equals:"Equals",notEquals:"Not equals",noFilter:"No Filter",lt:"Less than",lte:"Less than or equal to",gt:"Greater than",gte:"Greater than or equal to",dateIs:"Date is",dateIsNot:"Date is not",dateBefore:"Date is before",dateAfter:"Date is after",clear:"Clear",apply:"Apply",matchAll:"Match All",matchAny:"Match Any",addRule:"Add Rule",removeRule:"Remove Rule",accept:"Yes",reject:"No",choose:"Choose",upload:"Upload",cancel:"Cancel",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",weekHeader:"Wk",firstDayOfWeek:0,dateFormat:"mm/dd/yy",weak:"Weak",medium:"Medium",strong:"Strong",passwordPrompt:"Enter a password",emptyFilterMessage:"No results found",emptyMessage:"No available options"},filterMatchModeOptions:{text:[n.FilterMatchMode.STARTS_WITH,n.FilterMatchMode.CONTAINS,n.FilterMatchMode.NOT_CONTAINS,n.FilterMatchMode.ENDS_WITH,n.FilterMatchMode.EQUALS,n.FilterMatchMode.NOT_EQUALS],numeric:[n.FilterMatchMode.EQUALS,n.FilterMatchMode.NOT_EQUALS,n.FilterMatchMode.LESS_THAN,n.FilterMatchMode.LESS_THAN_OR_EQUAL_TO,n.FilterMatchMode.GREATER_THAN,n.FilterMatchMode.GREATER_THAN_OR_EQUAL_TO],date:[n.FilterMatchMode.DATE_IS,n.FilterMatchMode.DATE_IS_NOT,n.FilterMatchMode.DATE_BEFORE,n.FilterMatchMode.DATE_AFTER]}},c={install:function(e,t){var r=t?a(a({},l),t):a({},l);e.prototype.$primevue=e.observable({config:r})}};t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"FilterMatchMode",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"FilterOperator",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"FilterService",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"PrimeIcons",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"ToastSeverity",{enumerable:!0,get:function(){return s.default}});var n=l(r(294)),i=l(r(288)),o=l(r(295)),a=l(r(433)),s=l(r(434));function l(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={ALIGN_CENTER:"pi pi-align-center",ALIGN_JUSTIFY:"pi pi-align-justify",ALIGN_LEFT:"pi pi-align-left",ALIGN_RIGHT:"pi pi-align-right",AMAZON:"pi pi-amazon",ANDROID:"pi pi-android",ANGLE_DOUBLE_DOWN:"pi pi-angle-double-down",ANGLE_DOUBLE_LEFT:"pi pi-angle-double-left",ANGLE_DOUBLE_RIGHT:"pi pi-angle-double-right",ANGLE_DOUBLE_UP:"pi pi-angle-double-up",ANGLE_DOWN:"pi pi-angle-down",ANGLE_LEFT:"pi pi-angle-left",ANGLE_RIGHT:"pi pi-angle-right",ANGLE_UP:"pi pi-angle-up",APPLE:"pi pi-apple",ARROW_CIRCLE_DOWN:"pi pi-arrow-circle-down",ARROW_CIRCLE_LEFT:"pi pi-arrow-circle-left",ARROW_CIRCLE_RIGHT:"pi pi-arrow-circle-right",ARROW_CIRCLE_UP:"pi pi-arrow-circle-up",ARROW_DOWN:"pi pi-arrow-down",ARROW_DOWN_LEFT:"pi pi-arrow-down-left",ARROW_DOWN_RIGHT:"pi pi-arrow-down-right",ARROW_LEFT:"pi pi-arrow-left",ARROW_RIGHT:"pi pi-arrow-right",ARROW_RIGHT_ARROW_LEFT:"pi pi-arrow-right-arrow-left",ARROW_UP:"pi pi-arrow-up",ARROW_UP_LEFT:"pi pi-arrow-up-left",ARROW_UP_RIGHT:"pi pi-arrow-up-right",ARROW_H:"pi pi-arrows-h",ARROW_V:"pi pi-arrows-v",ARROW_A:"pi pi-arrows-alt",AT:"pi pi-at",BACKWARD:"pi pi-backward",BAN:"pi pi-ban",BARS:"pi pi-bars",BELL:"pi pi-bell",BITCOIN:"pi pi-bitcoin",BOLT:"pi pi-bolt",BOOK:"pi pi-book",BOOKMARK:"pi pi-bookmark",BOOKMARK_FILL:"pi pi-bookmark-fill",BOX:"pi pi-box",BRIEFCASE:"pi pi-briefcase",BUILDING:"pi pi-building",CALENDAR:"pi pi-calendar",CALENDAR_MINUS:"pi pi-calendar-minus",CALENDAR_PLUS:"pi pi-calendar-plus",CALENDAR_TIMES:"pi pi-calendar-times",CALCULATOR:"pi pi-calculator",CAMERA:"pi pi-camera",CAR:"pi pi-car",CARET_DOWN:"pi pi-caret-down",CARET_LEFT:"pi pi-caret-left",CARET_RIGHT:"pi pi-caret-right",CARET_UP:"pi pi-caret-up",CART_PLUS:"pi pi-cart-plus",CHART_BAR:"pi pi-chart-bar",CHART_LINE:"pi pi-chart-line",CHART_PIE:"pi pi-chart-pie",CHECK:"pi pi-check",CHECK_CIRCLE:"pi pi-check-circle",CHECK_SQUARE:"pi pi-check-square",CHEVRON_CIRCLE_DOWN:"pi pi-chevron-circle-down",CHEVRON_CIRCLE_LEFT:"pi pi-chevron-circle-left",CHEVRON_CIRCLE_RIGHT:"pi pi-chevron-circle-right",CHEVRON_CIRCLE_UP:"pi pi-chevron-circle-up",CHEVRON_DOWN:"pi pi-chevron-down",CHEVRON_LEFT:"pi pi-chevron-left",CHEVRON_RIGHT:"pi pi-chevron-right",CHEVRON_UP:"pi pi-chevron-up",CIRCLE:"pi pi-circle",CIRCLE_FILL:"pi pi-circle-fill",CLOCK:"pi pi-clock",CLONE:"pi pi-clone",CLOUD:"pi pi-cloud",CLOUD_DOWNLOAD:"pi pi-cloud-download",CLOUD_UPLOAD:"pi pi-cloud-upload",CODE:"pi pi-code",COG:"pi pi-cog",COMMENT:"pi pi-comment",COMMENTS:"pi pi-comments",COMPASS:"pi pi-compass",COPY:"pi pi-copy",CREDIT_CARD:"pi pi-credit-card",DATABASE:"pi pi-database",DELETELEFT:"pi pi-delete-left",DESKTOP:"pi pi-desktop",DIRECTIONS:"pi pi-directions",DIRECTIONS_ALT:"pi pi-directions-alt",DISCORD:"pi pi-discord",DOLLAR:"pi pi-dollar",DOWNLOAD:"pi pi-download",EJECT:"pi pi-eject",ELLIPSIS_H:"pi pi-ellipsis-h",ELLIPSIS_V:"pi pi-ellipsis-v",ENVELOPE:"pi pi-envelope",ERASER:"pi pi-eraser",EURO:"pi pi-euro",EXCLAMATION_CIRCLE:"pi pi-exclamation-circle",EXCLAMATION_TRIANGLE:"pi pi-exclamation-triangle",EXTERNAL_LINK:"pi pi-external-link",EYE:"pi pi-eye",EYE_SLASH:"pi pi-eye-slash",FACEBOOK:"pi pi-facebook",FAST_BACKWARD:"pi pi-fast-backward",FAST_FORWARD:"pi pi-fast-forward",FILE:"pi pi-file",FILE_EDIT:"pi pi-file-edit",FILE_EXCEL:"pi pi-file-excel",FILE_EXPORT:"pi pi-file-export",FILE_IMPORT:"pi pi-file-import",FILE_PDF:"pi pi-file-pdf",FILE_WORD:"pi pi-file-word",FILTER:"pi pi-filter",FILTER_FILL:"pi pi-filter-fill",FILTER_SLASH:"pi pi-filter-slash",FLAG:"pi pi-flag",FLAG_FILL:"pi pi-flag-fill",FOLDER:"pi pi-folder",FOLDER_OPEN:"pi pi-folder-open",FORWARD:"pi pi-forward",GIFT:"pi pi-gift",GITHUB:"pi pi-github",GLOBE:"pi pi-globe",GOOGLE:"pi pi-google",HASHTAG:"pi pi-hashtag",HEART:"pi pi-heart",HEART_FILL:"pi pi-heart-fill",HISTORY:"pi pi-history",HOURGLASS:"pi pi-hourglass",HOME:"pi pi-home",ID_CARD:"pi pi-id-card",IMAGE:"pi pi-image",IMAGES:"pi pi-images",INBOX:"pi pi-inbox",INFO:"pi pi-info",INFO_CIRCLE:"pi pi-info-circle",INSTAGRAM:"pi pi-instagram",KEY:"pi pi-key",LANGUAGE:"pi pi-language",LINK:"pi pi-link",LINKEDIN:"pi pi-linkedin",LIST:"pi pi-list",LOCK:"pi pi-lock",LOCK_OPEN:"pi pi-lock-open",MAP:"pi pi-map",MAP_MARKER:"pi pi-map-marker",MEGAPHONE:"pi pi-megaphone",MICREPHONE:"pi pi-microphone",MICROSOFT:"pi pi-microsoft",MINUS:"pi pi-minus",MINUS_CIRCLE:"pi pi-minus-circle",MOBILE:"pi pi-mobile",MONEY_BILL:"pi pi-money-bill",MOON:"pi pi-moon",PALETTE:"pi pi-palette",PAPERCLIP:"pi pi-paperclip",PAUSE:"pi pi-pause",PAYPAL:"pi pi-paypal",PENCIL:"pi pi-pencil",PERCENTAGE:"pi pi-percentage",PHONE:"pi pi-phone",PLAY:"pi pi-play",PLUS:"pi pi-plus",PLUS_CIRCLE:"pi pi-plus-circle",POUND:"pi pi-pound",POWER_OFF:"pi pi-power-off",PRIME:"pi pi-prime",PRINT:"pi pi-print",QRCODE:"pi pi-qrcode",QUESTION:"pi pi-question",QUESTION_CIRCLE:"pi pi-question-circle",REDDIT:"pi pi-reddit",REFRESH:"pi pi-refresh",REPLAY:"pi pi-replay",REPLY:"pi pi-reply",SAVE:"pi pi-save",SEARCH:"pi pi-search",SEARCH_MINUS:"pi pi-search-minus",SEARCH_PLUS:"pi pi-search-plus",SEND:"pi pi-send",SERVER:"pi pi-server",SHARE_ALT:"pi pi-share-alt",SHIELD:"pi pi-shield",SHOPPING_BAG:"pi pi-shopping-bag",SHOPPING_CART:"pi pi-shopping-cart",SIGN_IN:"pi pi-sign-in",SIGN_OUT:"pi pi-sign-out",SITEMAP:"pi pi-sitemap",SLACK:"pi pi-slack",SLIDERS_H:"pi pi-sliders-h",SLIDERS_V:"pi pi-sliders-v",SORT:"pi pi-sort",SORT_ALPHA_DOWN:"pi pi-sort-alpha-down",SORT_ALPHA_ALT_DOWN:"pi pi-sort-alpha-alt-down",SORT_ALPHA_UP:"pi pi-sort-alpha-up",SORT_ALPHA_ALT_UP:"pi pi-sort-alpha-alt-up",SORT_ALT:"pi pi-sort-alt",SORT_ALT_SLASH:"pi pi-sort-slash",SORT_AMOUNT_DOWN:"pi pi-sort-amount-down",SORT_AMOUNT_DOWN_ALT:"pi pi-sort-amount-down-alt",SORT_AMOUNT_UP:"pi pi-sort-amount-up",SORT_AMOUNT_UP_ALT:"pi pi-sort-amount-up-alt",SORT_DOWN:"pi pi-sort-down",SORT_NUMERIC_DOWN:"pi pi-sort-numeric-down",SORT_NUMERIC_ALT_DOWN:"pi pi-sort-numeric-alt-down",SORT_NUMERIC_UP:"pi pi-sort-numeric-up",SORT_NUMERIC_ALT_UP:"pi pi-sort-numeric-alt-up",SORT_UP:"pi pi-sort-up",SPINNER:"pi pi-spinner",STAR:"pi pi-star",STAR_FILL:"pi pi-star-fill",STEP_BACKWARD:"pi pi-step-backward",STEP_BACKWARD_ALT:"pi pi-step-backward-alt",STEP_FORWARD:"pi pi-step-forward",STEP_FORWARD_ALT:"pi pi-step-forward-alt",STOP:"pi pi-stop",STOPWATCH:"pi pi-stop-watch",STOP_CIRCLE:"pi pi-stop-circle",SUN:"pi pi-sun",SYNC:"pi pi-sync",TABLE:"pi pi-table",TABLET:"pi pi-tablet",TAG:"pi pi-tag",TAGS:"pi pi-tags",TELEGRAM:"pi pi-telegram",TH_LARGE:"pi pi-th-large",THUMBS_DOWN:"pi pi-thumbs-down",THUMBS_DOWN_FILL:"pi pi-thumbs-down-fill",THUMBS_UP:"pi pi-thumbs-up",THUMBS_UP_FILL:"pi pi-thumbs-up-fill",TICKET:"pi pi-ticket",TIMES:"pi pi-times",TIMES_CIRCLE:"pi pi-times-circle",TRASH:"pi pi-trash",TRUCK:"pi pi-truck",TWITTER:"pi pi-twitter",UNDO:"pi pi-undo",UNLOCK:"pi pi-unlock",UPLOAD:"pi pi-upload",USER:"pi pi-user",USER_EDIT:"pi pi-user-edit",USER_MINUS:"pi pi-user-minus",USER_PLUS:"pi pi-user-plus",USERS:"pi pi-users",VERIFIED:"pi pi-verified",VIDEO:"pi pi-video",VIMEO:"pi pi-vimeo",VOLUME_DOWN:"pi pi-volume-down",VOLUME_OFF:"pi pi-volume-off",VOLUME_UP:"pi pi-volume-up",WALLET:"pi pi-wallet",WHATSAPP:"pi pi-whatsapp",WIFI:"pi pi-wifi",WINDOW_MAXIMIZE:"pi pi-window-maximize",WINDOW_MINIMIZE:"pi pi-window-minimize",WRENCH:"pi pi-wrench",YOUTUBE:"pi pi-youtube"};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={INFO:"info",WARN:"warn",ERROR:"error",SUCCESS:"success"};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(283)),i=a(r(173)),o=a(r(284));function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e){m(e.currentTarget)}function p(e){g(e.currentTarget)}function h(e){m(e.currentTarget)}function d(e){g(e.currentTarget)}function f(e){g(e.currentTarget)}function m(e){if(!e.$_ptooltipDisabled){var t=function(e){var t=(0,n.default)()+"_tooltip";e.$_ptooltipId=t;var r=document.createElement("div");r.id=t;var i=document.createElement("div");i.className="p-tooltip-arrow",r.appendChild(i);var o=document.createElement("div");o.className="p-tooltip-text",e.$_ptooltipEscape?o.innerHTML=e.$_ptooltipValue:(o.innerHTML="",o.appendChild(document.createTextNode(e.$_ptooltipValue)));return r.appendChild(o),document.body.appendChild(r),r.style.display="inline-block",r}(e);!function(e){var t=e.$_ptooltipModifiers;t.top?(w(e),T(e)&&(k(e),T(e)&&w(e))):t.left?(x(e),T(e)&&(v(e),T(e)&&(w(e),T(e)&&(k(e),T(e)&&x(e))))):t.bottom?(k(e),T(e)&&(w(e),T(e)&&k(e))):(v(e),T(e)&&(x(e),T(e)&&(w(e),T(e)&&(k(e),T(e)&&v(e)))))}(e),i.default.fadeIn(t,250),t.style.zIndex=++i.default.zindex,window.addEventListener("resize",(function t(){i.default.isAndroid()||g(e),this.removeEventListener("resize",t)})),function(e){e.$_ptooltipScrollHandler||(e.$_ptooltipScrollHandler=new o.default(e,(function(){g(e)}))),e.$_ptooltipScrollHandler.bindScrollListener()}(e)}}function g(e){_(e),function(e){e.$_ptooltipScrollHandler&&e.$_ptooltipScrollHandler.unbindScrollListener()}(e)}function b(e){return document.getElementById(e.$_ptooltipId)}function _(e){if(e){var t=b(e);t&&t.parentElement&&document.body.removeChild(t),e.$_ptooltipId=null}}function y(e){var t=e.getBoundingClientRect();return{left:t.left+i.default.getWindowScrollLeft(),top:t.top+i.default.getWindowScrollTop()}}function v(e){E(e,"right");var t=b(e),r=y(e),n=r.left+i.default.getOuterWidth(e),o=r.top+(i.default.getOuterHeight(e)-i.default.getOuterHeight(t))/2;t.style.left=n+"px",t.style.top=o+"px"}function x(e){E(e,"left");var t=b(e),r=y(e),n=r.left-i.default.getOuterWidth(t),o=r.top+(i.default.getOuterHeight(e)-i.default.getOuterHeight(t))/2;t.style.left=n+"px",t.style.top=o+"px"}function w(e){E(e,"top");var t=b(e),r=y(e),n=r.left+(i.default.getOuterWidth(e)-i.default.getOuterWidth(t))/2,o=r.top-i.default.getOuterHeight(t);t.style.left=n+"px",t.style.top=o+"px"}function k(e){E(e,"bottom");var t=b(e),r=y(e),n=r.left+(i.default.getOuterWidth(e)-i.default.getOuterWidth(t))/2,o=r.top+i.default.getOuterHeight(e);t.style.left=n+"px",t.style.top=o+"px"}function E(e,t){var r=b(e);r.style.left="-999px",r.style.top="-999px",r.className="p-tooltip p-component p-tooltip-"+t}function T(e){var t=b(e),r=t.getBoundingClientRect(),n=r.top,o=r.left,a=i.default.getOuterWidth(t),s=i.default.getOuterHeight(t),l=i.default.getViewport();return o+a>l.width||o<0||n<0||n+s>l.height}function S(e){return e.modifiers&&Object.keys(e.modifiers).length?e.modifiers:e.arg&&"object"===c(e.arg)?Object.entries(e.arg).reduce((function(e,t){var r=s(t,2),n=r[0],i=r[1];return"event"!==n&&"position"!==n||(e[i]=!0),e}),{}):{}}var C={bind:function(e,t){e.$_ptooltipModifiers=S(t),"string"==typeof t.value?(e.$_ptooltipValue=t.value,e.$_ptooltipDisabled=!1,e.$_ptooltipEscape=!1):(e.$_ptooltipValue=t.value.value,e.$_ptooltipDisabled=t.value.disabled||!1,e.$_ptooltipEscape=t.value.escape||!1),function(e){e.$_ptooltipModifiers.focus?(e.addEventListener("focus",h),e.addEventListener("blur",d)):(e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",p),e.addEventListener("click",f))}(e)},unbind:function(e){_(e),function(e){e.$_ptooltipModifiers.focus?(e.removeEventListener("focus",h),e.removeEventListener("blur",d)):(e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",p),e.removeEventListener("click",f))}(e),e.$_ptooltipScrollHandler&&(e.$_ptooltipScrollHandler.destroy(),e.$_ptooltipScrollHandler=null)},update:function(e,t){e.$_ptooltipModifiers=S(t),"string"==typeof t.value?(e.$_ptooltipValue=t.value,e.$_ptooltipDisabled=!1,e.$_ptooltipEscape=!1):(e.$_ptooltipValue=t.value.value,e.$_ptooltipDisabled=t.value.disabled,e.$_ptooltipEscape=t.value.escape||!1)}};t.default=C},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(296))&&n.__esModule?n:{default:n};var o={install:function(e){e.prototype.$confirm={require:function(e){i.default.emit("confirm",e)},close:function(){i.default.emit("close")}}}};t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(313))&&n.__esModule?n:{default:n};var o={install:function(e){e.prototype.$toast={add:function(e){i.default.$emit("add",e)},removeGroup:function(e){i.default.$emit("remove-group",e)},removeAllGroups:function(){i.default.$emit("remove-all-groups")}}}};t.default=o},,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(38),i=r(28);function o(e){var t=[];function r(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(o){if(!(void 0===e||t.length<e))return Object(i.b)(new n.a("Not adding Promise due to buffer limit reached."));var a=o();return-1===t.indexOf(a)&&t.push(a),a.then((function(){return r(a)})).then(null,(function(){return r(a).then(null,(function(){}))})),a},drain:function(e){return new i.a((function(r,n){var o=t.length;if(!o)return r(!0);var a=setTimeout((function(){e&&e>0&&r(!1)}),e);t.forEach((function(e){Object(i.c)(e).then((function(){--o||(clearTimeout(a),r(!0))}),n)}))}))}}}},function(e,t,r){"use strict";function n(e){return e>=200&&e<300?"success":429===e?"rate_limit":e>=400&&e<500?"invalid":e>=500?"failed":"unknown"}r.d(t,"a",(function(){return n}))},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(11),i=r(52),o=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(t,r){t((function(t){var o=r().getIntegration(e);if(o){try{if(function(e,t){if(!t)return!1;if(function(e,t){var r=e.message,n=t.message;if(!r&&!n)return!1;if(r&&!n||!r&&n)return!1;if(r!==n)return!1;if(!s(e,t))return!1;if(!a(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){var r=l(t),n=l(e);if(!r||!n)return!1;if(r.type!==n.type||r.value!==n.value)return!1;if(!s(e,t))return!1;if(!a(e,t))return!1;return!0}(e,t))return!0;return!1}(t,o._previousEvent))return i.a&&n.c.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){return o._previousEvent=t}return o._previousEvent=t}return t}))},e.id="Dedupe",e}();function a(e,t){var r=c(e),n=c(t);if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++){var o=n[i],a=r[i];if(o.filename!==a.filename||o.lineno!==a.lineno||o.colno!==a.colno||o.function!==a.function)return!1}return!0}function s(e,t){var r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;try{return!(r.join("")!==n.join(""))}catch(e){return!1}}function l(e){return e.exception&&e.exception.values&&e.exception.values[0]}function c(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}else if(e.stacktrace)return e.stacktrace.frames}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(0),i=r(3),o=r(263),a=r(11),s=r(52),l=function(){function e(t){this.name=e.id,this._options=Object(n.a)({depth:3},t)}return e.prototype.setupOnce=function(t,r){t((function(t,n){var i=r().getIntegration(e);return i?i.enhanceEventWithErrorData(t,n):t}))},e.prototype.enhanceEventWithErrorData=function(e,t){var r;if(!t||!t.originalException||!Object(i.d)(t.originalException))return e;var a=t.originalException.name||t.originalException.constructor.name,s=this._extractErrorData(t.originalException);if(s){var l=Object(n.a)({},e.contexts),c=Object(o.a)(s,this._options.depth);return Object(i.i)(c)&&(l=Object(n.a)(Object(n.a)({},e.contexts),((r={})[a]=Object(n.a)({},c),r))),Object(n.a)(Object(n.a)({},e),{contexts:l})}return e},e.prototype._extractErrorData=function(e){var t,r,o,l;try{var c=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],u={};try{for(var p=Object(n.e)(Object.keys(e)),h=p.next();!h.done;h=p.next()){var d=h.value;if(-1===c.indexOf(d)){var f=e[d];u[d]=Object(i.d)(f)?f.toString():f}}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}if("function"==typeof e.toJSON){var m=e.toJSON();try{for(var g=Object(n.e)(Object.keys(m)),b=g.next();!b.done;b=g.next()){f=m[d=b.value];u[d]=Object(i.d)(f)?f.toString():f}}catch(e){o={error:e}}finally{try{b&&!b.done&&(l=g.return)&&l.call(g)}finally{if(o)throw o.error}}}return u}catch(e){s.a&&a.c.error("Unable to extract extra data from the Error object:",e)}return null},e.id="ExtraErrorData",e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),i=r(103),o=r(9),a=function(){function e(t){void 0===t&&(t={types:["crash","deprecation","intervention"]}),this._options=t,this.name=e.id}return e.prototype.setupOnce=function(e,t){Object(i.f)()&&(this._getCurrentHub=t,new(Object(o.a)().ReportingObserver)(this.handler.bind(this),{buffered:!0,types:this._options.types}).observe())},e.prototype.handler=function(t){var r,i,o=this._getCurrentHub&&this._getCurrentHub();if(o&&o.getIntegration(e)){var a=function(e){o.withScope((function(t){t.setExtra("url",e.url);var r="ReportingObserver ["+e.type+"]",n="No details available";if(e.body){var i,a={};for(var s in e.body)a[s]=e.body[s];if(t.setExtra("body",a),"crash"===e.type)n=[(i=e.body).crashId||"",i.reason||""].join(" ").trim()||n;else n=(i=e.body).message||n}o.captureMessage(r+": "+n)}))};try{for(var s=Object(n.e)(t),l=s.next();!l.done;l=s.next()){a(l.value)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}}},e.id="ReportingObserver",e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),i=r(170),o=function(){function e(t){var r=this;void 0===t&&(t={}),this.name=e.id,this._prefix="app:///",this._iteratee=function(e){if(!e.filename)return e;var t=/^[A-Z]:\\/.test(e.filename),n=/^\//.test(e.filename);if(t||n){var o=t?e.filename.replace(/^[A-Z]:/,"").replace(/\\/g,"/"):e.filename,a=r._root?Object(i.b)(r._root,o):Object(i.a)(o);e.filename=""+r._prefix+a}return e},t.root&&(this._root=t.root),t.prefix&&(this._prefix=t.prefix),t.iteratee&&(this._iteratee=t.iteratee)}return e.prototype.setupOnce=function(t,r){t((function(t){var n=r().getIntegration(e);return n?n.process(t):t}))},e.prototype.process=function(e){var t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=this._processExceptionsEvent(t)),e.stacktrace&&(t=this._processStacktraceEvent(t)),t},e.prototype._processExceptionsEvent=function(e){var t=this;try{return Object(n.a)(Object(n.a)({},e),{exception:Object(n.a)(Object(n.a)({},e.exception),{values:e.exception.values.map((function(e){return Object(n.a)(Object(n.a)({},e),{stacktrace:t._processStacktrace(e.stacktrace)})}))})})}catch(t){return e}},e.prototype._processStacktraceEvent=function(e){try{return Object(n.a)(Object(n.a)({},e),{stacktrace:this._processStacktrace(e.stacktrace)})}catch(t){return e}},e.prototype._processStacktrace=function(e){var t=this;return Object(n.a)(Object(n.a)({},e),{frames:e&&e.frames&&e.frames.map((function(e){return t._iteratee(e)}))})},e.id="RewriteFrames",e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return g}));var n=r(0),i=r(68),o=r(11),a=r(9),s=r(170),l=r(52),c={id:"Tracing"},u={id:"BrowserTracing"},p="ui.vue",h={activate:["activated","deactivated"],create:["beforeCreate","created"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]},d=/(?:^|[-_/])(\w)/g,f="root",m="anonymous component",g=function(){function e(t){var r=this;this.name=e.id,this._componentsCache={},this._applyTracingHooks=function(e,t){if(!e.$options.$_sentryPerfHook){e.$options.$_sentryPerfHook=!0;var a=r._getComponentName(e),s=a===f,u={},d=function(n){var o=Object(i.c)();r._rootSpan?r._finishRootSpan(o,t):e.$once("hook:"+n,(function(){var e=t().getIntegration(c);if(e){r._tracingActivity=e.constructor.pushActivity("Vue Application Render");var n=e.constructor.getTransaction();n&&(r._rootSpan=n.startChild({description:"Application Render",op:p}))}else{var i=function(e){if(e&&e.getScope){var t=e.getScope();if(t)return t.getTransaction()}return}(t());i&&(r._rootSpan=i.startChild({description:"Application Render",op:p}))}}))},m=function(n,o){var s=Array.isArray(r._options.tracingOptions.trackComponents)?r._options.tracingOptions.trackComponents.indexOf(a)>-1:r._options.tracingOptions.trackComponents;if(r._rootSpan&&s){var l=Object(i.c)(),c=u[o];c?(c.finish(),r._finishRootSpan(l,t)):e.$once("hook:"+n,(function(){r._rootSpan&&(u[o]=r._rootSpan.startChild({description:"Vue <"+a+">",op:p+"."+o}))}))}};r._options.tracingOptions.hooks.forEach((function(t){var i=h[t];i?i.forEach((function(i){var o=s?d.bind(r,i):m.bind(r,i,t),a=e.$options[i];Array.isArray(a)?e.$options[i]=Object(n.d)([o],a):e.$options[i]="function"==typeof a?[o,a]:[o]})):l.a&&o.c.warn("Unknown hook: "+t)}))}},l.a&&o.c.log("You are still using the Vue.js integration, consider moving to @sentry/vue"),this._options=Object(n.a)(Object(n.a)({Vue:Object(a.a)().Vue,attachProps:!0,logErrors:!1,tracing:!1},t),{tracingOptions:Object(n.a)({hooks:["mount","update"],timeout:2e3,trackComponents:!1},t.tracingOptions)})}return e.prototype.setupOnce=function(e,t){this._options.Vue?(this._attachErrorHandler(t),this._options.tracing&&this._startTracing(t)):l.a&&o.c.error("Vue integration is missing a Vue instance")},e.prototype._getComponentName=function(e){if(!e)return m;if(e.$root===e)return f;if(!e.$options)return m;if(e.$options.name)return e.$options.name;if(e.$options._componentTag)return e.$options._componentTag;if(e.$options.__file){var t=e.$options.__file.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"),r=Object(s.a)(t,".vue");return this._componentsCache[r]||(this._componentsCache[r]=r.replace(d,(function(e,t){return t?t.toUpperCase():""})))}return m},e.prototype._finishRootSpan=function(e,t){var r=this;this._rootSpanTimer&&clearTimeout(this._rootSpanTimer),this._rootSpanTimer=setTimeout((function(){if(r._tracingActivity){var n=t().getIntegration(c);n&&n.constructor.popActivity(r._tracingActivity)}r._rootSpan&&r._rootSpan.finish(e)}),this._options.tracingOptions.timeout)},e.prototype._startTracing=function(e){var t=this._applyTracingHooks;this._options.Vue.mixin({beforeCreate:function(){e().getIntegration(c)||e().getIntegration(u)?t(this,e):l.a&&o.c.error("Vue integration has tracing enabled, but Tracing integration is not configured")}})},e.prototype._attachErrorHandler=function(t){var r=this,n=this._options.Vue.config.errorHandler;this._options.Vue.config.errorHandler=function(i,a,s){var c={};if(a)try{c.componentName=r._getComponentName(a),r._options.attachProps&&(c.propsData=a.$options.propsData)}catch(e){l.a&&o.c.warn("Unable to extract metadata from Vue component.")}s&&(c.lifecycleHook=s),t().getIntegration(e)&&setTimeout((function(){t().withScope((function(e){e.setContext("vue",c),t().captureException(i)}))})),"function"==typeof n&&n.call(r._options.Vue,i,a,s),r._options.logErrors&&r._options.Vue.util&&r._options.Vue.util.warn("Error in "+s+': "'+(i&&i.toString())+'"',a)}},e.id="Vue",e}()}]]);